
TRNG Crypto Driver

This hardware abstracted driver can be used to interact with a external ring-oscillator circutit or any other random bit generator. The hardware layer is fully abstract an can be switched between different plattforms.
File Structure

drivers/
└── crypto/
└── trng/
├── trng.c
└── trng.h
Downloads
The library can be downloaded (zip or tar), cloned or used as submodule in a project.
| Type | File | Description |
| Library | zip / tar | TRNG crypto library |
Using with git clone
mkdir -p ./drivers/crypto/
git clone https://github.com/0x007E/drivers-crypto-trng.git ./drivers/crypto
mv ./drivers/crypto/drivers-crypto-trng ./drivers/crypto/trng
Using as git submodule
git submodule add https://github.com/0x007E/drivers-crypto-trng.git drivers/crypto/trng
Programming
#include "../lib/drivers/crypto/trng/trng.h"
ISR(...)
{
}
int main(void)
{
while(1)
{
{
{
}
}
}
}
void trng_next_bit(unsigned char bit)
Processes a single entropy bit and adds it to the TRNG buffer.
Definition trng.c:62
TRNG_Buffer trng_buffer_status(void)
Returns the current fill status of the TRNG buffer.
Definition trng.c:124
void trng_reset(void)
Returns a pointer to the internal TRNG buffer.
Definition trng.c:173
volatile unsigned char * trng_buffer(void)
Returns a pointer to the internal TRNG buffer.
Definition trng.c:154
void trng_init(void)
Initializes the True Random Number Generator (TRNG) module.
Definition trng.c:38
@ TRNG_Buffer_Full
Definition trng.h:51
#define TRNG_BUFFER_SIZE
Size of the internal random data buffer in bytes.
Definition trng.h:37
Additional Information
| Type | Link | Description |
| Ring-Oscillator | pdf | Ring-Oscillator circuit with NAND and XOR |
R. GAECHTER