X-Git-Url: https://git.cryptolib.org/?p=arm-crypto-lib.git;a=blobdiff_plain;f=sha256%2Fsha256.c;h=c121466bc37685b5ccc755d1d740f29b6f2b67a6;hp=83b3a438c21ff5d41fd7a65b0a65e4218d46af6f;hb=b9d6e1eb867eaa431c4c555a7409342805fa2706;hpb=1ee55d2589fee6c40acb72a24c04528a8cc1772f diff --git a/sha256/sha256.c b/sha256/sha256.c index 83b3a43..c121466 100644 --- a/sha256/sha256.c +++ b/sha256/sha256.c @@ -68,6 +68,7 @@ void sha256_init(sha256_ctx_t *state){ /** * rotate x right by n positions */ +static uint32_t rotr32( uint32_t x, uint8_t n){ return ((x>>n) | (x<<(32-n))); } @@ -76,7 +77,7 @@ uint32_t rotr32( uint32_t x, uint8_t n){ /*************************************************************************/ // #define CHANGE_ENDIAN32(x) (((x)<<24) | ((x)>>24) | (((x)& 0x0000ff00)<<8) | (((x)& 0x00ff0000)>>8)) - +static uint32_t change_endian32(uint32_t x){ return (((x)<<24) | ((x)>>24) | (((x)& 0x0000ff00)<<8) | (((x)& 0x00ff0000)>>8)); }