WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
sec_random.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2012-2020. All rights reserved.
3 * Description: The head file of sec_random.c
4 */
5#ifndef SEC_RANDOM_H
6#define SEC_RANDOM_H
7
8#include "chip_definitions.h"
9
10#if !CHIP_WS63 && !CHIP_WS53
11#define HASH_DIGEST_LENGTH 32 // hash digest length
12
13#define DEFAULT_CONST "HRAND CONNECTIVITY CHIP"
14#define DEFAULT_CONST_LEN 23
15#define POOL_LEN HASH_DIGEST_LENGTH
16
17typedef struct {
18 uint8_t v[POOL_LEN];
19 uint8_t c[POOL_LEN];
20} hrand_ctx;
21
22void init_rand(void);
23uint32_t sec_rand(void); // Secure random number
24uint32_t nsec_rand(void); // Unsafe random number
25void sec_rand_bytes(uint8_t *output, uint32_t output_len);
26#endif
27#endif