Skip to content

Commit 23dc2a0

Browse files
ebiggersherbertx
authored andcommitted
crypto: powerpc/sha1 - prefix the "sha1_" functions
Prefix the PowerPC SHA-1 functions with "powerpc_sha1_" rather than "sha1_". This allows us to rename the library function sha_init() to sha1_init() without causing a naming collision. Cc: linuxppc-dev@lists.ozlabs.org Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 1c4b3c4 commit 23dc2a0

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

‎arch/powerpc/crypto/sha1.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
void powerpc_sha_transform(u32 *state, const u8 *src);
2424

25-
static int sha1_init(struct shash_desc *desc)
25+
static int powerpc_sha1_init(struct shash_desc *desc)
2626
{
2727
struct sha1_state *sctx = shash_desc_ctx(desc);
2828

@@ -33,8 +33,8 @@ static int sha1_init(struct shash_desc *desc)
3333
return 0;
3434
}
3535

36-
static int sha1_update(struct shash_desc *desc, const u8 *data,
37-
unsigned int len)
36+
static int powerpc_sha1_update(struct shash_desc *desc, const u8 *data,
37+
unsigned int len)
3838
{
3939
struct sha1_state *sctx = shash_desc_ctx(desc);
4040
unsigned int partial, done;
@@ -68,7 +68,7 @@ static int sha1_update(struct shash_desc *desc, const u8 *data,
6868

6969

7070
/* Add padding and return the message digest. */
71-
static int sha1_final(struct shash_desc *desc, u8 *out)
71+
static int powerpc_sha1_final(struct shash_desc *desc, u8 *out)
7272
{
7373
struct sha1_state *sctx = shash_desc_ctx(desc);
7474
__be32 *dst = (__be32 *)out;
@@ -81,10 +81,10 @@ static int sha1_final(struct shash_desc *desc, u8 *out)
8181
/* Pad out to 56 mod 64 */
8282
index = sctx->count & 0x3f;
8383
padlen = (index < 56) ? (56 - index) : ((64+56) - index);
84-
sha1_update(desc, padding, padlen);
84+
powerpc_sha1_update(desc, padding, padlen);
8585

8686
/* Append length */
87-
sha1_update(desc, (const u8 *)&bits, sizeof(bits));
87+
powerpc_sha1_update(desc, (const u8 *)&bits, sizeof(bits));
8888

8989
/* Store state in digest */
9090
for (i = 0; i < 5; i++)
@@ -96,15 +96,15 @@ static int sha1_final(struct shash_desc *desc, u8 *out)
9696
return 0;
9797
}
9898

99-
static int sha1_export(struct shash_desc *desc, void *out)
99+
static int powerpc_sha1_export(struct shash_desc *desc, void *out)
100100
{
101101
struct sha1_state *sctx = shash_desc_ctx(desc);
102102

103103
memcpy(out, sctx, sizeof(*sctx));
104104
return 0;
105105
}
106106

107-
static int sha1_import(struct shash_desc *desc, const void *in)
107+
static int powerpc_sha1_import(struct shash_desc *desc, const void *in)
108108
{
109109
struct sha1_state *sctx = shash_desc_ctx(desc);
110110

@@ -114,11 +114,11 @@ static int sha1_import(struct shash_desc *desc, const void *in)
114114

115115
static struct shash_alg alg = {
116116
.digestsize = SHA1_DIGEST_SIZE,
117-
.init = sha1_init,
118-
.update = sha1_update,
119-
.final = sha1_final,
120-
.export = sha1_export,
121-
.import = sha1_import,
117+
.init = powerpc_sha1_init,
118+
.update = powerpc_sha1_update,
119+
.final = powerpc_sha1_final,
120+
.export = powerpc_sha1_export,
121+
.import = powerpc_sha1_import,
122122
.descsize = sizeof(struct sha1_state),
123123
.statesize = sizeof(struct sha1_state),
124124
.base = {

0 commit comments

Comments
 (0)