请问产生真随随机数是不是需要一个物理信号? 这个信号怎么获得呢?

发布于 2023-12-08 09: 11: 55

在调用 tls_crypto_trng () 函数时, 在开始阶段, 是不是需要收到物理信号才会产生随机数? 那么这端程序逻辑是什么流程呢? 如何搭配物理设备可以收到这个信号? 现在有温湿度传感器, 陀螺仪, 气压传感器.

image. png

image. png

image. png

查看更多

关注者
0
被浏览
891
abcd
abcd 2024-04-18
我只是个路过的老年人~

g_crypto_ctx. gpsec_lock 定义的是一个互斥锁, 在 SDK 的初始化时有调用 tls_crypto_init, 在这里创建了该信号量, 初始值是 1, 所以在没有其他地方用到该模块时, 调用 tls_os_sem_acquire (g_crypto_ctx. gpsec_lock, 0) ; 会立即返回接着往下执行. 如果有其他地方调用了就会等待, 直到能获取到信号量才能接着往下执行, 起到一个互斥锁的功能. 调用 tls_os_sem_acquire 获取, 信号量的个数会减一, 调用 tls_os_sem_release 释放, 信号量的个数会加一, 这两个接口是成对使用的. 在使用信号量实现互斥锁的功能时, 创建信号量时初始值会设置为 1, 这样有一个地方获取了锁的使用权后, 其他地方就需要等待这里释放了才能获取, 起到防止出现同一个模块或者变量或者接口被同时操作的情况. 并不是一个物理信号.

2 个回答
AnatolSher
AnatolSher 认证专家 2023-12-08
Lover of the ocean, yachts and Arduino

Hello! SDK for w80x is still at the conceptual stage in our team.
We have not yet thoroughly understood how this pie works : ) ) For HAL 0. 6. 0, extracting true random numbers was easy. You can see this technique in our Arduino core. Methods trng_init () and rng_Get () . There is no need for a special signal to generate a random number. A noise-like signal is generated on the cryptomodule crystal. There is a description of this in the datasheet.

撰写答案

请登录后再发布答案, 点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览