diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2018-02-03 15:50:56 +0100 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2018-02-03 17:04:29 +0100 |
commit | 202d27af71014169539863cbf81ddf3411a05258 (patch) | |
tree | 5232e8f7ac9f979f89f528e79735dc5306c3b0fc /src/common/crypto_digest.h | |
parent | f8b1493681f8b881adac5f4fbdec61c99d9fb1e1 (diff) | |
download | tor-202d27af71014169539863cbf81ddf3411a05258.tar.gz tor-202d27af71014169539863cbf81ddf3411a05258.zip |
Add xof functions into crypto_digest.[ch]
Added xof functions and operations into xof+digest module.
Follows #24658.
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Diffstat (limited to 'src/common/crypto_digest.h')
-rw-r--r-- | src/common/crypto_digest.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/crypto_digest.h b/src/common/crypto_digest.h index 4471a58797..a716209a71 100644 --- a/src/common/crypto_digest.h +++ b/src/common/crypto_digest.h @@ -67,6 +67,7 @@ typedef struct { } common_digests_t; typedef struct crypto_digest_t crypto_digest_t; +typedef struct crypto_xof_t crypto_xof_t; /* public key crypto digest */ MOCK_DECL(int, crypto_pk_public_checksig_digest,(crypto_pk_t *env, @@ -116,6 +117,14 @@ void crypto_mac_sha3_256(uint8_t *mac_out, size_t len_out, const uint8_t *key, size_t key_len, const uint8_t *msg, size_t msg_len); +/* xof functions*/ +crypto_xof_t *crypto_xof_new(void); +void crypto_xof_add_bytes(crypto_xof_t *xof, const uint8_t *data, size_t len); +void crypto_xof_squeeze_bytes(crypto_xof_t *xof, uint8_t *out, size_t len); +void crypto_xof_free_(crypto_xof_t *xof); +#define crypto_xof_free(xof) \ + FREE_AND_NULL(crypto_xof_t, crypto_xof_free_, (xof)) + #ifdef TOR_UNIT_TESTS digest_algorithm_t crypto_digest_get_algorithm(crypto_digest_t *digest); #endif |