88#include <string.h>
99#include "sha1.h"
1010
11- extern void sha_transform (uint32_t * hash , const unsigned char * data , uint32_t * W );
11+ extern void arm_sha_transform (uint32_t * hash , const unsigned char * data , uint32_t * W );
1212
13- void SHA1_Init ( SHA_CTX * c )
13+ void arm_SHA1_Init ( arm_SHA_CTX * c )
1414{
1515 c -> len = 0 ;
1616 c -> hash [0 ] = 0x67452301 ;
@@ -20,7 +20,7 @@ void SHA1_Init(SHA_CTX *c)
2020 c -> hash [4 ] = 0xc3d2e1f0 ;
2121}
2222
23- void SHA1_Update ( SHA_CTX * c , const void * p , unsigned long n )
23+ void arm_SHA1_Update ( arm_SHA_CTX * c , const void * p , unsigned long n )
2424{
2525 uint32_t workspace [80 ];
2626 unsigned int partial ;
@@ -32,12 +32,12 @@ void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n)
3232 if (partial ) {
3333 done = 64 - partial ;
3434 memcpy (c -> buffer + partial , p , done );
35- sha_transform (c -> hash , c -> buffer , workspace );
35+ arm_sha_transform (c -> hash , c -> buffer , workspace );
3636 partial = 0 ;
3737 } else
3838 done = 0 ;
3939 while (n >= done + 64 ) {
40- sha_transform (c -> hash , p + done , workspace );
40+ arm_sha_transform (c -> hash , p + done , workspace );
4141 done += 64 ;
4242 }
4343 } else
@@ -46,7 +46,7 @@ void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n)
4646 memcpy (c -> buffer + partial , p + done , n - done );
4747}
4848
49- void SHA1_Final (unsigned char * hash , SHA_CTX * c )
49+ void arm_SHA1_Final (unsigned char * hash , arm_SHA_CTX * c )
5050{
5151 uint64_t bitlen ;
5252 uint32_t bitlen_hi , bitlen_lo ;
@@ -57,7 +57,7 @@ void SHA1_Final(unsigned char *hash, SHA_CTX *c)
5757 bitlen = c -> len << 3 ;
5858 offset = c -> len & 0x3f ;
5959 padlen = ((offset < 56 ) ? 56 : (64 + 56 )) - offset ;
60- SHA1_Update (c , padding , padlen );
60+ arm_SHA1_Update (c , padding , padlen );
6161
6262 bitlen_hi = bitlen >> 32 ;
6363 bitlen_lo = bitlen & 0xffffffff ;
@@ -69,7 +69,7 @@ void SHA1_Final(unsigned char *hash, SHA_CTX *c)
6969 bits [5 ] = bitlen_lo >> 16 ;
7070 bits [6 ] = bitlen_lo >> 8 ;
7171 bits [7 ] = bitlen_lo ;
72- SHA1_Update (c , bits , 8 );
72+ arm_SHA1_Update (c , bits , 8 );
7373
7474 for (i = 0 ; i < 5 ; i ++ ) {
7575 uint32_t v = c -> hash [i ];
0 commit comments