diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-02-02 06:21:09 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-02-02 06:21:09 +0100 |
commit | cd846d601227db0047c35b551858d62d6b794127 (patch) | |
tree | 1107f66259c455dc74df44752fd6b1f8c0470e6c /ecp/src/crypto/crypto.h | |
parent | c5d4f45893cd3a70c2387f13fcf5ac97550bbfa0 (diff) |
fixed new crypto
Diffstat (limited to 'ecp/src/crypto/crypto.h')
-rw-r--r-- | ecp/src/crypto/crypto.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/ecp/src/crypto/crypto.h b/ecp/src/crypto/crypto.h index 86b072c..378500c 100644 --- a/ecp/src/crypto/crypto.h +++ b/ecp/src/crypto/crypto.h @@ -9,6 +9,7 @@ #define ECP_AEAD_SIZE_NONCE 8 #define ECP_DSA_SIZE_KEY 32 +#define ECP_DSA_SIZE_SIGNATURE 32 typedef uint8_t ecp_dh_public_t[ECP_ECDH_SIZE_KEY]; typedef uint8_t ecp_dh_private_t[ECP_ECDH_SIZE_KEY]; @@ -17,15 +18,29 @@ typedef uint8_t ecp_dsa_public_t[ECP_DSA_SIZE_KEY]; typedef uint8_t ecp_dsa_private_t[ECP_DSA_SIZE_KEY]; int -aead_chacha20_poly1305_seal(unsigned char *out, size_t *out_len, - size_t max_out_len, unsigned char key[32], unsigned char tag_len, +aead_chacha20_poly1305_seal(unsigned char key[32], unsigned char tag_len, + unsigned char *out, size_t *out_len, size_t max_out_len, const unsigned char *nonce, size_t nonce_len, const unsigned char *in, size_t in_len, const unsigned char *ad, size_t ad_len); int -aead_chacha20_poly1305_open(unsigned char *out, size_t *out_len, - size_t max_out_len, unsigned char key[32], unsigned char tag_len, +aead_chacha20_poly1305_open(unsigned char key[32], unsigned char tag_len, + unsigned char *out, size_t *out_len, size_t max_out_len, + const unsigned char *nonce, size_t nonce_len, + const unsigned char *in, size_t in_len, + const unsigned char *ad, size_t ad_len); + +int +aead_xchacha20_poly1305_seal(unsigned char key[32], unsigned char tag_len, + unsigned char *out, size_t *out_len, size_t max_out_len, + const unsigned char *nonce, size_t nonce_len, + const unsigned char *in, size_t in_len, + const unsigned char *ad, size_t ad_len); + +int +aead_xchacha20_poly1305_open(unsigned char key[32], unsigned char tag_len, + unsigned char *out, size_t *out_len, size_t max_out_len, const unsigned char *nonce, size_t nonce_len, const unsigned char *in, size_t in_len, const unsigned char *ad, size_t ad_len); |