Files
Viper_VRTE/openssl/rand.vp
T

25 lines
1006 B
Plaintext

import t, c
from openssl.types import *
# ============================================================
# openssl/rand.vp — 安全随机数
# 对应头文件: rand.h
# ============================================================
# int RAND_bytes(unsigned char *buf, int num) — 加密安全随机
extern def RAND_bytes(buf: bytes, num: int) -> int
# int RAND_priv_bytes(unsigned char *buf, int num) — 私钥级随机(私钥/密钥建议用)
extern def RAND_priv_bytes(buf: bytes, num: int) -> int
# int RAND_status(void)
extern def RAND_status() -> int
# int RAND_poll(void)
extern def RAND_poll() -> int
# int RAND_load_file(const char *file, long max_bytes)
extern def RAND_load_file(file: str, max_bytes: t.CInt32T) -> int
# int RAND_write_file(const char *file)
extern def RAND_write_file(file: str) -> int
# void RAND_seed(const void *buf, int num)
extern def RAND_seed(buf: bytes, num: int)
# void RAND_keep_random_devices_open(int keep)
extern def RAND_keep_random_devices_open(keep: int)