feat: Add SE050 hardware RNG integration
- Added system RNG fallback using /dev/urandom - Created se050_wireguard_se050_rng.c for SE050 TRNG integration - WireGuard can now use SE050's built-in hardware random number generator - Improved test coverage: 28 passing tests Usage for SE050 RNG: For standalone (no SE050):
This commit is contained in:
@@ -170,12 +170,32 @@ int se050_wireguard_compute_mac2(se050_wireguard_session_t *session,
|
||||
/**
|
||||
* @brief Generate a new WireGuard keypair
|
||||
*
|
||||
* Uses system RNG (/dev/urandom on POSIX).
|
||||
* For SE050 hardware RNG, use se050_wireguard_generate_keypair_se050().
|
||||
*
|
||||
* @param private_key Output: private key (32 bytes)
|
||||
* @param public_key Output: public key (32 bytes)
|
||||
* @return 0 on success, -1 on error
|
||||
*/
|
||||
int se050_wireguard_generate_keypair(uint8_t *private_key, uint8_t *public_key);
|
||||
|
||||
/**
|
||||
* @brief Generate WireGuard keypair using SE050 hardware RNG
|
||||
*
|
||||
* This function uses the SE050 chip's built-in True Random Number Generator
|
||||
* for cryptographically secure key generation.
|
||||
*
|
||||
* @param session SE050 session context (initialized via se050_session_init())
|
||||
* @param private_key Output: private key (32 bytes)
|
||||
* @param public_key Output: public key (32 bytes)
|
||||
* @return 0 on success, -1 on error
|
||||
*/
|
||||
#ifdef SE050_ENABLED
|
||||
int se050_wireguard_generate_keypair_se050(se050_session_ctx_t *session,
|
||||
uint8_t *private_key,
|
||||
uint8_t *public_key);
|
||||
#endif
|
||||
|
||||
/* =========================================================================
|
||||
* Constants
|
||||
* ========================================================================= */
|
||||
|
||||
Reference in New Issue
Block a user