Commit 5f720a3d authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu

crypto: arm64/sha512-ce - clean up backwards function names

In the Linux kernel, a function whose name has two leading underscores
is conventionally called by the same-named function without leading
underscores -- not the other way around.  __sha512_ce_transform() and
__sha512_block_data_order() got this backwards.  Fix this, albeit
without changing "sha512_block_data_order" in the perlasm since that is
OpenSSL code.  No change in behavior.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ba30d311
...@@ -102,11 +102,11 @@ ...@@ -102,11 +102,11 @@
.endm .endm
/* /*
* void sha512_ce_transform(struct sha512_state *sst, u8 const *src, * int __sha512_ce_transform(struct sha512_state *sst, u8 const *src,
* int blocks) * int blocks)
*/ */
.text .text
SYM_FUNC_START(sha512_ce_transform) SYM_FUNC_START(__sha512_ce_transform)
/* load state */ /* load state */
ld1 {v8.2d-v11.2d}, [x0] ld1 {v8.2d-v11.2d}, [x0]
...@@ -203,4 +203,4 @@ CPU_LE( rev64 v19.16b, v19.16b ) ...@@ -203,4 +203,4 @@ CPU_LE( rev64 v19.16b, v19.16b )
3: st1 {v8.2d-v11.2d}, [x0] 3: st1 {v8.2d-v11.2d}, [x0]
mov w0, w2 mov w0, w2
ret ret
SYM_FUNC_END(sha512_ce_transform) SYM_FUNC_END(__sha512_ce_transform)
...@@ -26,27 +26,27 @@ MODULE_LICENSE("GPL v2"); ...@@ -26,27 +26,27 @@ MODULE_LICENSE("GPL v2");
MODULE_ALIAS_CRYPTO("sha384"); MODULE_ALIAS_CRYPTO("sha384");
MODULE_ALIAS_CRYPTO("sha512"); MODULE_ALIAS_CRYPTO("sha512");
asmlinkage int sha512_ce_transform(struct sha512_state *sst, u8 const *src, asmlinkage int __sha512_ce_transform(struct sha512_state *sst, u8 const *src,
int blocks); int blocks);
asmlinkage void sha512_block_data_order(u64 *digest, u8 const *src, int blocks); asmlinkage void sha512_block_data_order(u64 *digest, u8 const *src, int blocks);
static void __sha512_ce_transform(struct sha512_state *sst, u8 const *src, static void sha512_ce_transform(struct sha512_state *sst, u8 const *src,
int blocks) int blocks)
{ {
while (blocks) { while (blocks) {
int rem; int rem;
kernel_neon_begin(); kernel_neon_begin();
rem = sha512_ce_transform(sst, src, blocks); rem = __sha512_ce_transform(sst, src, blocks);
kernel_neon_end(); kernel_neon_end();
src += (blocks - rem) * SHA512_BLOCK_SIZE; src += (blocks - rem) * SHA512_BLOCK_SIZE;
blocks = rem; blocks = rem;
} }
} }
static void __sha512_block_data_order(struct sha512_state *sst, u8 const *src, static void sha512_arm64_transform(struct sha512_state *sst, u8 const *src,
int blocks) int blocks)
{ {
sha512_block_data_order(sst->state, src, blocks); sha512_block_data_order(sst->state, src, blocks);
} }
...@@ -54,8 +54,8 @@ static void __sha512_block_data_order(struct sha512_state *sst, u8 const *src, ...@@ -54,8 +54,8 @@ static void __sha512_block_data_order(struct sha512_state *sst, u8 const *src,
static int sha512_ce_update(struct shash_desc *desc, const u8 *data, static int sha512_ce_update(struct shash_desc *desc, const u8 *data,
unsigned int len) unsigned int len)
{ {
sha512_block_fn *fn = crypto_simd_usable() ? __sha512_ce_transform sha512_block_fn *fn = crypto_simd_usable() ? sha512_ce_transform
: __sha512_block_data_order; : sha512_arm64_transform;
sha512_base_do_update(desc, data, len, fn); sha512_base_do_update(desc, data, len, fn);
return 0; return 0;
...@@ -64,8 +64,8 @@ static int sha512_ce_update(struct shash_desc *desc, const u8 *data, ...@@ -64,8 +64,8 @@ static int sha512_ce_update(struct shash_desc *desc, const u8 *data,
static int sha512_ce_finup(struct shash_desc *desc, const u8 *data, static int sha512_ce_finup(struct shash_desc *desc, const u8 *data,
unsigned int len, u8 *out) unsigned int len, u8 *out)
{ {
sha512_block_fn *fn = crypto_simd_usable() ? __sha512_ce_transform sha512_block_fn *fn = crypto_simd_usable() ? sha512_ce_transform
: __sha512_block_data_order; : sha512_arm64_transform;
sha512_base_do_update(desc, data, len, fn); sha512_base_do_update(desc, data, len, fn);
sha512_base_do_finalize(desc, fn); sha512_base_do_finalize(desc, fn);
...@@ -74,8 +74,8 @@ static int sha512_ce_finup(struct shash_desc *desc, const u8 *data, ...@@ -74,8 +74,8 @@ static int sha512_ce_finup(struct shash_desc *desc, const u8 *data,
static int sha512_ce_final(struct shash_desc *desc, u8 *out) static int sha512_ce_final(struct shash_desc *desc, u8 *out)
{ {
sha512_block_fn *fn = crypto_simd_usable() ? __sha512_ce_transform sha512_block_fn *fn = crypto_simd_usable() ? sha512_ce_transform
: __sha512_block_data_order; : sha512_arm64_transform;
sha512_base_do_finalize(desc, fn); sha512_base_do_finalize(desc, fn);
return sha512_base_finish(desc, out); return sha512_base_finish(desc, out);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment