We could make it easy to specifiy different PRNGs.
- Currently we are using HmacSha256 which creates 32 byte random numbers.
- However, Prng.next() gives a Long.
- Switching to variable length byte arrays would allow arbitrary cryptographic functions to be used.
- The PRNG has to be reproducible in any number of languages/frameworks.
- In egk-ec, we store ByteArrays, and HmacSha256 return Uint256, which is always and exactly 32 bytes. It serializes using base 64 encoding of byte arrays. See Base64 class for encoding and decoding.
The "guarenteed soundness" paper doesnt specify what to use, just:
"In practice, the random oracle PRG is instantiated using a cryptographic function such as AES, SHA2, or SHA3, as is standard [24]."
SHA-2 Family Byte Lengths:
SHA-224: 28 bytes
SHA-256: 32 bytes
SHA-384: 48 bytes
SHA-512: 64 bytes
The standard SHA-3 functions and their corresponding output sizes in bytes are:
SHA3-224: produces a 28-byte hash (224 bits).
SHA3-256: produces a 32-byte hash (256 bits).
SHA3-384: produces a 48-byte hash (384 bits).
SHA3-512: produces a 64-byte hash (512 bits).
We could make it easy to specifiy different PRNGs.
The "guarenteed soundness" paper doesnt specify what to use, just:
SHA-2 Family Byte Lengths:
SHA-224: 28 bytes
SHA-256: 32 bytes
SHA-384: 48 bytes
SHA-512: 64 bytes
The standard SHA-3 functions and their corresponding output sizes in bytes are:
SHA3-224: produces a 28-byte hash (224 bits).
SHA3-256: produces a 32-byte hash (256 bits).
SHA3-384: produces a 48-byte hash (384 bits).
SHA3-512: produces a 64-byte hash (512 bits).