X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=sha1%2Fsha1.c;h=d8249a4ca9346816f2e4a174521848c95ed24446;hb=4ca48ee2409ad28c9e25168e96695b6caf22ac6d;hp=f944d5a9d673c79a36ad7babe128aaaf946dde9d;hpb=5f46191d2615ebe2caa6e111b478031a34f20b9e;p=arm-crypto-lib.git diff --git a/sha1/sha1.c b/sha1/sha1.c index f944d5a..d8249a4 100644 --- a/sha1/sha1.c +++ b/sha1/sha1.c @@ -52,12 +52,12 @@ void sha1_init(sha1_ctx_t *state){ /********************************************************************************************************/ /* some helping functions */ -const +static const uint32_t rotl32(uint32_t n, uint8_t bits){ return ((n<>(32-bits))); } -const +static const uint32_t change_endian32(uint32_t x){ return (((x)<<24) | ((x)>>24) | (((x)& 0x0000ff00)<<8) | (((x)& 0x00ff0000)>>8)); } @@ -88,7 +88,7 @@ uint32_t parity(uint32_t x, uint32_t y, uint32_t z){ #define MASK 0x0000000f -typedef uint32_t (*pf_t)(uint32_t x, uint32_t y, uint32_t z); +typedef const uint32_t (*pf_t)(uint32_t x, uint32_t y, uint32_t z); void sha1_nextBlock (sha1_ctx_t *state, const void* block){ uint32_t a[5]; @@ -183,7 +183,7 @@ void sha1_lastBlock(sha1_ctx_t *state, const void* block, uint16_t length){ /********************************************************************************************************/ -void sha1_ctx2hash (sha1_hash_t *dest, sha1_ctx_t *state){ +void sha1_ctx2hash (void *dest, sha1_ctx_t *state){ #if defined LITTLE_ENDIAN uint8_t i; for(i=0; i<5; ++i){ @@ -202,7 +202,7 @@ void sha1_ctx2hash (sha1_hash_t *dest, sha1_ctx_t *state){ * * */ -void sha1 (sha1_hash_t *dest, const void* msg, uint32_t length){ +void sha1 (void *dest, const void* msg, uint32_t length){ sha1_ctx_t s; sha1_init(&s); while(length & (~0x0001ff)){ /* length>=512 */