Add methods for byte array expansion and compression

These methods convert between:

- A byte array of length NL/8, and
- An array of N blocks of ceil(L/8) bytes.
This commit is contained in:
Jack Grigg
2016-08-13 16:45:53 +12:00
parent d7da4ecc33
commit 881ffbfc87
3 changed files with 113 additions and 0 deletions

View File

@@ -24,6 +24,13 @@ typedef crypto_generichash_blake2b_state eh_HashState;
typedef uint32_t eh_index;
typedef uint8_t eh_trunc;
void ExpandArray(const unsigned char* in, size_t in_len,
unsigned char* out, size_t out_len,
size_t bit_len);
void CompressArray(const unsigned char* in, size_t in_len,
unsigned char* out, size_t out_len,
size_t bit_len);
eh_index ArrayToEhIndex(const unsigned char* array);
eh_trunc TruncateIndex(const eh_index i, const unsigned int ilen);