summaryrefslogtreecommitdiffhomepage
path: root/src/crypto/include/zinc
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-17 05:49:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-17 06:03:01 +0200
commitb5d6181c6f56aaaee4da1a747e84a54b769df0a6 (patch)
tree0bfc4c506d50439a8f76f3c9f2e395d05b085dde /src/crypto/include/zinc
parent399d5bb850b0e0d0269ef14bb52720221cb526a4 (diff)
crypto: pass simd by reference
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/include/zinc')
-rw-r--r--src/crypto/include/zinc/chacha20.h4
-rw-r--r--src/crypto/include/zinc/chacha20poly1305.h4
-rw-r--r--src/crypto/include/zinc/poly1305.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/crypto/include/zinc/chacha20.h b/src/crypto/include/zinc/chacha20.h
index 43e67cb..8b3cc8c 100644
--- a/src/crypto/include/zinc/chacha20.h
+++ b/src/crypto/include/zinc/chacha20.h
@@ -44,11 +44,11 @@ static inline void chacha20_init(struct chacha20_ctx *state,
state->counter[3] = nonce >> 32;
}
void chacha20(struct chacha20_ctx *state, u8 *dst, const u8 *src, u32 len,
- simd_context_t simd_context);
+ simd_context_t *simd_context);
/* Derived key should be 32-bit aligned */
void hchacha20(u8 derived_key[CHACHA20_KEY_SIZE],
const u8 nonce[HCHACHA20_NONCE_SIZE],
- const u8 key[HCHACHA20_KEY_SIZE], simd_context_t simd_context);
+ const u8 key[HCHACHA20_KEY_SIZE], simd_context_t *simd_context);
#endif /* _ZINC_CHACHA20_H */
diff --git a/src/crypto/include/zinc/chacha20poly1305.h b/src/crypto/include/zinc/chacha20poly1305.h
index 0212685..03979b6 100644
--- a/src/crypto/include/zinc/chacha20poly1305.h
+++ b/src/crypto/include/zinc/chacha20poly1305.h
@@ -25,7 +25,7 @@ void chacha20poly1305_encrypt(u8 *dst, const u8 *src, const size_t src_len,
bool __must_check chacha20poly1305_encrypt_sg(
struct scatterlist *dst, struct scatterlist *src, const size_t src_len,
const u8 *ad, const size_t ad_len, const u64 nonce,
- const u8 key[CHACHA20POLY1305_KEYLEN], simd_context_t simd_context);
+ const u8 key[CHACHA20POLY1305_KEYLEN], simd_context_t *simd_context);
bool __must_check
chacha20poly1305_decrypt(u8 *dst, const u8 *src, const size_t src_len,
@@ -35,7 +35,7 @@ chacha20poly1305_decrypt(u8 *dst, const u8 *src, const size_t src_len,
bool __must_check chacha20poly1305_decrypt_sg(
struct scatterlist *dst, struct scatterlist *src, const size_t src_len,
const u8 *ad, const size_t ad_len, const u64 nonce,
- const u8 key[CHACHA20POLY1305_KEYLEN], simd_context_t simd_context);
+ const u8 key[CHACHA20POLY1305_KEYLEN], simd_context_t *simd_context);
void xchacha20poly1305_encrypt(u8 *dst, const u8 *src, const size_t src_len,
const u8 *ad, const size_t ad_len,
diff --git a/src/crypto/include/zinc/poly1305.h b/src/crypto/include/zinc/poly1305.h
index a7f552c..1cdbadd 100644
--- a/src/crypto/include/zinc/poly1305.h
+++ b/src/crypto/include/zinc/poly1305.h
@@ -26,9 +26,9 @@ void poly1305_fpu_init(void);
void poly1305_init(struct poly1305_ctx *ctx, const u8 key[POLY1305_KEY_SIZE]);
void poly1305_update(struct poly1305_ctx *ctx, const u8 *input, size_t len,
- simd_context_t simd_context);
+ simd_context_t *simd_context);
void poly1305_final(struct poly1305_ctx *ctx, u8 mac[POLY1305_MAC_SIZE],
- simd_context_t simd_context);
+ simd_context_t *simd_context);
#ifdef DEBUG
bool poly1305_selftest(void);