]> git.cryptolib.org Git - arm-crypto-lib.git/blobdiff - sha1/sha1.c
now with rsassa-pkcs1v15 (old rsa signatures) + many new things
[arm-crypto-lib.git] / sha1 / sha1.c
index f944d5a9d673c79a36ad7babe128aaaf946dde9d..d8249a4ca9346816f2e4a174521848c95ed24446 100644 (file)
@@ -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<<bits) | (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 */