ndn-lite
Data Structures | Typedefs | Functions
ndn-lite-rng.h File Reference
#include "../ndn-error-code.h"
#include <inttypes.h>

Go to the source code of this file.

Data Structures

struct  ndn_rng_backend
 The structure to represent the backend implementation. More...
 

Typedefs

typedef int(* ndn_rng_impl) (uint8_t *dest, unsigned size)
 ndn_rng_impl type More...
 
typedef struct ndn_rng_backend ndn_rng_backend_t
 The structure to represent the backend implementation. More...
 

Functions

ndn_rng_backend_tndn_rng_get_backend (void)
 
int ndn_rng (uint8_t *dest, unsigned size)
 Generate a random number. More...
 

Typedef Documentation

◆ ndn_rng_backend_t

The structure to represent the backend implementation.

◆ ndn_rng_impl

typedef int(* ndn_rng_impl) (uint8_t *dest, unsigned size)

ndn_rng_impl type

This type is the same as micro-ecc/uECC.huECC_RNG_Function

The RNG function should fill 'size' random bytes into 'dest'. It should return 1 if 'dest' was filled with random data, or 0 if the random data could not be generated. The filled-in values should be either truly random, or from a cryptographically-secure PRNG. Setting a correctly functioning RNG function improves the resistance to side-channel attacks.

Function Documentation

◆ ndn_rng()

int ndn_rng ( uint8_t *  dest,
unsigned  size 
)

Generate a random number.

YOU CANNOT USE THIS FUNCTION IF YOU ARE USING THE DEFAULT SECURITY BACKEND.

Parameters
destBuffer to store random number.
sizeLength of random number to generate.

◆ ndn_rng_get_backend()

ndn_rng_backend_t* ndn_rng_get_backend ( void  )