summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/crypto/include/zinc/poly1305.h6
-rw-r--r--src/crypto/zinc/chacha20poly1305.c8
-rw-r--r--src/crypto/zinc/poly1305/poly1305.c6
-rw-r--r--src/crypto/zinc/selftest/chacha20poly1305.h2
-rw-r--r--src/crypto/zinc/selftest/poly1305.h4
5 files changed, 13 insertions, 13 deletions
diff --git a/src/crypto/include/zinc/poly1305.h b/src/crypto/include/zinc/poly1305.h
index 5c9220f..338430c 100644
--- a/src/crypto/include/zinc/poly1305.h
+++ b/src/crypto/include/zinc/poly1305.h
@@ -26,10 +26,10 @@ void poly1305_fpu_init(void);
void poly1305_init(struct poly1305_ctx *ctx, const u8 key[POLY1305_KEY_SIZE],
simd_context_t simd_context);
-void poly1305_update(struct poly1305_ctx *ctx, const u8 *inp, const size_t len,
- simd_context_t simd_context);
-void poly1305_finish(struct poly1305_ctx *ctx, u8 mac[POLY1305_MAC_SIZE],
+void poly1305_update(struct poly1305_ctx *ctx, const u8 *input, size_t len,
simd_context_t simd_context);
+void poly1305_final(struct poly1305_ctx *ctx, u8 mac[POLY1305_MAC_SIZE],
+ simd_context_t simd_context);
#ifdef DEBUG
bool poly1305_selftest(void);
diff --git a/src/crypto/zinc/chacha20poly1305.c b/src/crypto/zinc/chacha20poly1305.c
index 3991482..4b00c83 100644
--- a/src/crypto/zinc/chacha20poly1305.c
+++ b/src/crypto/zinc/chacha20poly1305.c
@@ -62,7 +62,7 @@ __chacha20poly1305_encrypt(u8 *dst, const u8 *src, const size_t src_len,
poly1305_update(&poly1305_state, (u8 *)b.lens, sizeof(b.lens),
simd_context);
- poly1305_finish(&poly1305_state, dst + src_len, simd_context);
+ poly1305_final(&poly1305_state, dst + src_len, simd_context);
memzero_explicit(&chacha20_state, sizeof(chacha20_state));
memzero_explicit(&b, sizeof(b));
@@ -142,7 +142,7 @@ bool chacha20poly1305_encrypt_sg(struct scatterlist *dst,
poly1305_update(&poly1305_state, (u8 *)b.lens, sizeof(b.lens),
simd_context);
- poly1305_finish(&poly1305_state, b.mac, simd_context);
+ poly1305_final(&poly1305_state, b.mac, simd_context);
scatterwalk_map_and_copy(b.mac, dst, src_len, sizeof(b.mac), 1);
err:
memzero_explicit(&chacha20_state, sizeof(chacha20_state));
@@ -189,7 +189,7 @@ __chacha20poly1305_decrypt(u8 *dst, const u8 *src, const size_t src_len,
poly1305_update(&poly1305_state, (u8 *)b.lens, sizeof(b.lens),
simd_context);
- poly1305_finish(&poly1305_state, b.mac, simd_context);
+ poly1305_final(&poly1305_state, b.mac, simd_context);
ret = crypto_memneq(b.mac, src + dst_len, POLY1305_MAC_SIZE);
if (likely(!ret))
@@ -284,7 +284,7 @@ bool chacha20poly1305_decrypt_sg(struct scatterlist *dst,
poly1305_update(&poly1305_state, (u8 *)b.lens, sizeof(b.lens),
simd_context);
- poly1305_finish(&poly1305_state, b.computed_mac, simd_context);
+ poly1305_final(&poly1305_state, b.computed_mac, simd_context);
scatterwalk_map_and_copy(b.read_mac, src, dst_len, POLY1305_MAC_SIZE, 0);
ret = crypto_memneq(b.read_mac, b.computed_mac, POLY1305_MAC_SIZE);
diff --git a/src/crypto/zinc/poly1305/poly1305.c b/src/crypto/zinc/poly1305/poly1305.c
index c09b092..9a71ac1 100644
--- a/src/crypto/zinc/poly1305/poly1305.c
+++ b/src/crypto/zinc/poly1305/poly1305.c
@@ -109,8 +109,8 @@ void poly1305_update(struct poly1305_ctx *ctx, const u8 *input, size_t len,
}
EXPORT_SYMBOL(poly1305_update);
-void poly1305_finish(struct poly1305_ctx *ctx, u8 mac[POLY1305_MAC_SIZE],
- simd_context_t simd_context)
+void poly1305_final(struct poly1305_ctx *ctx, u8 mac[POLY1305_MAC_SIZE],
+ simd_context_t simd_context)
{
size_t num = ctx->num % POLY1305_BLOCK_SIZE;
@@ -126,6 +126,6 @@ void poly1305_finish(struct poly1305_ctx *ctx, u8 mac[POLY1305_MAC_SIZE],
memzero_explicit(ctx, sizeof(*ctx));
}
-EXPORT_SYMBOL(poly1305_finish);
+EXPORT_SYMBOL(poly1305_final);
#include "../selftest/poly1305.h"
diff --git a/src/crypto/zinc/selftest/chacha20poly1305.h b/src/crypto/zinc/selftest/chacha20poly1305.h
index 607153d..9d170a2 100644
--- a/src/crypto/zinc/selftest/chacha20poly1305.h
+++ b/src/crypto/zinc/selftest/chacha20poly1305.h
@@ -7661,7 +7661,7 @@ chacha20poly1305_selftest_encrypt_bignonce(u8 *dst, const u8 *src,
b.lens[1] = cpu_to_le64(src_len);
poly1305_update(&poly1305_state, (u8 *)b.lens, sizeof(b.lens),
simd_context);
- poly1305_finish(&poly1305_state, dst + src_len, simd_context);
+ poly1305_final(&poly1305_state, dst + src_len, simd_context);
simd_put(simd_context);
memzero_explicit(&chacha20_state, sizeof(chacha20_state));
memzero_explicit(&b, sizeof(b));
diff --git a/src/crypto/zinc/selftest/poly1305.h b/src/crypto/zinc/selftest/poly1305.h
index 9cd291f..8138a93 100644
--- a/src/crypto/zinc/selftest/poly1305.h
+++ b/src/crypto/zinc/selftest/poly1305.h
@@ -834,7 +834,7 @@ bool __init poly1305_selftest(void)
simd_context);
poly1305_update(&poly1305, poly1305_testvecs[i].input,
poly1305_testvecs[i].ilen, simd_context);
- poly1305_finish(&poly1305, out, simd_context);
+ poly1305_final(&poly1305, out, simd_context);
if (memcmp(out, poly1305_testvecs[i].output,
POLY1305_MAC_SIZE)) {
pr_info("poly1305 self-test %zu: FAIL\n", i + 1);
@@ -856,7 +856,7 @@ bool __init poly1305_selftest(void)
poly1305_testvecs[i].input + j,
poly1305_testvecs[i].ilen - j,
simd_context);
- poly1305_finish(&poly1305, out, simd_context);
+ poly1305_final(&poly1305, out, simd_context);
if (memcmp(out, poly1305_testvecs[i].output,
POLY1305_MAC_SIZE)) {
pr_info("poly1305 self-test %zu (split %zu): FAIL\n",