Skip to content

Commit

Permalink
Update README to reflect prng struct wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zane Beckwith committed Sep 21, 2017
1 parent 62c99b9 commit 3f036c8
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A C implementation of elliptic-curve-based Direct Anonymous Attestation signatur

- The CMake build system is used for building.
- gcc
- libsodium >= 1.0.11 (optionally, see below)
- For building the AMCL dependency:
- python3

Expand All @@ -37,17 +38,21 @@ ctest -V
## Random number generator

Many of the functions provided by this library (particularly, those used by an Issuer or a Member)
require a pointer to a pseudo-random number generator (type `csprng`).
require a pseudo random number generator (type `ecdaa_prng`).
The security of these algorithms depends critically on the proper seeding of this prng.
This means that the first use of any `ecdaa_prng` MUST be preceeded by a call to
`ecdaa_prng_init` on the prng.
`ecdaa_prng_init` (or `ecdaa_prng_init_custom`, see below) on the prng.

The seed for the `ecdaa_prng` is generated using code adapted from Libsodium's
`randombytes_buf`.
In `ecdaa_prng_init`, the seed for the `ecdaa_prng` is generated from Libsodium's
`randombytes_buf` function.
A discussion on how this function works and any caveats can be found at Libsodium's webpage.
Specifically, the procedure for using a non-standard random number generator
(e.g. in environments where `/dev/urandom` isn't available but a hardware rng is)
may be useful.

To use a different function for obtaining cryptographically-secure random data for a seed,
pass the option `-DDISABLE_LIBSODIUM_RNG_SEED_FUNCTION=ON` to cmake (this will remove the dependency on libsodium)
and use the function `ecdaa_prng_init_custom` rather than `ecdaa_prng_init`,
passing in a function pointer of type `ecdaa_prng_custom_seed_function_type` pointing
to a function that is able to provide cryptographically-secure random bytes.
Any initialization of the random source must be done prior to calling `ecdaa_prng_init_custom`.

## Naming Convention in API

Expand Down

0 comments on commit 3f036c8

Please sign in to comment.