19 行
459 B
C
19 行
459 B
C
#ifndef PAZE_RANDOM_H
|
|
#define PAZE_RANDOM_H
|
|
#include "paze/paze_types.h"
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* 从操作系统熵源获取随机字节。返回 PAZE_OK 或 PAZE_ERR_PLATFORM。
|
|
* Windows: RtlGenRandom(advapi32) ; Linux: getrandom ; macOS/BSD: getentropy */
|
|
paze_status_t paze_random(uint8_t *out, size_t n);
|
|
|
|
/* 在 paze_random 基础上实现的 32/64 位随机数 */
|
|
uint32_t paze_random_u32(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|