Skip to content

Commit a9a8ba9

Browse files
zx2c4herbertx
authored andcommitted
crypto: arch/nhpoly1305 - process in explicit 4k chunks
Rather than chunking via PAGE_SIZE, this commit changes the arch implementations to chunk in explicit 4k parts, so that calculations on maximum acceptable latency don't suddenly become invalid on platforms where PAGE_SIZE isn't 4k, such as arm64. Fixes: 0f961f9 ("crypto: x86/nhpoly1305 - add AVX2 accelerated NHPoly1305") Fixes: 012c823 ("crypto: x86/nhpoly1305 - add SSE2 accelerated NHPoly1305") Fixes: a00fa0c ("crypto: arm64/nhpoly1305 - add NEON-accelerated NHPoly1305") Fixes: 16aae35 ("crypto: arm/nhpoly1305 - add NEON-accelerated NHPoly1305") Cc: [email protected] Signed-off-by: Jason A. Donenfeld <[email protected]> Reviewed-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 706024a commit a9a8ba9

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/arm/crypto/nhpoly1305-neon-glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc,
3030
return crypto_nhpoly1305_update(desc, src, srclen);
3131

3232
do {
33-
unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
33+
unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3434

3535
kernel_neon_begin();
3636
crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);

arch/arm64/crypto/nhpoly1305-neon-glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static int nhpoly1305_neon_update(struct shash_desc *desc,
3030
return crypto_nhpoly1305_update(desc, src, srclen);
3131

3232
do {
33-
unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
33+
unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3434

3535
kernel_neon_begin();
3636
crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon);

arch/x86/crypto/nhpoly1305-avx2-glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int nhpoly1305_avx2_update(struct shash_desc *desc,
2929
return crypto_nhpoly1305_update(desc, src, srclen);
3030

3131
do {
32-
unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
32+
unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3333

3434
kernel_fpu_begin();
3535
crypto_nhpoly1305_update_helper(desc, src, n, _nh_avx2);

arch/x86/crypto/nhpoly1305-sse2-glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int nhpoly1305_sse2_update(struct shash_desc *desc,
2929
return crypto_nhpoly1305_update(desc, src, srclen);
3030

3131
do {
32-
unsigned int n = min_t(unsigned int, srclen, PAGE_SIZE);
32+
unsigned int n = min_t(unsigned int, srclen, SZ_4K);
3333

3434
kernel_fpu_begin();
3535
crypto_nhpoly1305_update_helper(desc, src, n, _nh_sse2);

0 commit comments

Comments
 (0)