diff options
author | Isis Lovecruft <isis@torproject.org> | 2018-04-21 01:01:04 +0000 |
---|---|---|
committer | Isis Lovecruft <isis@torproject.org> | 2018-05-08 21:03:37 +0000 |
commit | af182d4ab51d6a1a70559bbdcd4ab842aa855684 (patch) | |
tree | a39ec19013bdb85e4ad9aef1dd001747446923f2 /src/common | |
parent | 3df37d7b6be4f7d6ece0cd12812595d5f91ea72f (diff) | |
download | tor-af182d4ab51d6a1a70559bbdcd4ab842aa855684.tar.gz tor-af182d4ab51d6a1a70559bbdcd4ab842aa855684.zip |
rust: Add crypto crate and implement Rust wrappers for SHA2 code.
* FIXES #24659: https://bugs.torproject.org/24659
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/crypto_digest.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/common/crypto_digest.c b/src/common/crypto_digest.c index f7163de133..9f9a1a1e2c 100644 --- a/src/common/crypto_digest.c +++ b/src/common/crypto_digest.c @@ -268,7 +268,11 @@ crypto_digest_new(void) } /** Allocate and return a new digest object to compute 256-bit digests - * using <b>algorithm</b>. */ + * using <b>algorithm</b>. + * + * C_RUST_COUPLED: `external::crypto_digest::crypto_digest256_new` + * C_RUST_COUPLED: `crypto::digest::Sha256::default` + */ crypto_digest_t * crypto_digest256_new(digest_algorithm_t algorithm) { @@ -298,6 +302,9 @@ crypto_digest_free_(crypto_digest_t *digest) } /** Add <b>len</b> bytes from <b>data</b> to the digest object. + * + * C_RUST_COUPLED: `external::crypto_digest::crypto_digest_add_bytess` + * C_RUST_COUPLED: `crypto::digest::Sha256::process` */ void crypto_digest_add_bytes(crypto_digest_t *digest, const char *data, @@ -335,6 +342,9 @@ crypto_digest_add_bytes(crypto_digest_t *digest, const char *data, /** Compute the hash of the data that has been passed to the digest * object; write the first out_len bytes of the result to <b>out</b>. * <b>out_len</b> must be \<= DIGEST512_LEN. + * + * C_RUST_COUPLED: `external::crypto_digest::crypto_digest_get_digest` + * C_RUST_COUPLED: `impl digest::FixedOutput for Sha256` */ void crypto_digest_get_digest(crypto_digest_t *digest, @@ -383,6 +393,9 @@ crypto_digest_get_digest(crypto_digest_t *digest, /** Allocate and return a new digest object with the same state as * <b>digest</b> + * + * C_RUST_COUPLED: `external::crypto_digest::crypto_digest_dup` + * C_RUST_COUPLED: `impl Clone for crypto::digest::Sha256` */ crypto_digest_t * crypto_digest_dup(const crypto_digest_t *digest) |