webmcp

changeset 503:218219b7a15e

Removed unused parameter c from Keccak function
author jbe
date Tue Aug 15 20:46:13 2017 +0200 (12 months ago)
parents fa902b26589f
children cf948f219056
files libraries/moonhash/moonhash_sha3.c
line diff
     1.1 --- a/libraries/moonhash/moonhash_sha3.c	Mon Aug 14 12:07:37 2017 +0200
     1.2 +++ b/libraries/moonhash/moonhash_sha3.c	Tue Aug 15 20:46:13 2017 +0200
     1.3 @@ -8,13 +8,13 @@
     1.4  typedef uint64_t u64;
     1.5  typedef unsigned int ui;
     1.6  
     1.7 -static void Keccak(ui r, ui c, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen);
     1.8 -void FIPS202_SHAKE128(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1344, 256, in, inLen, 0x1F, out, outLen); }
     1.9 -void FIPS202_SHAKE256(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1088, 512, in, inLen, 0x1F, out, outLen); }
    1.10 -void FIPS202_SHA3_224(const u8 *in, u64 inLen, u8 *out) { Keccak(1152, 448, in, inLen, 0x06, out, 28); }
    1.11 -void FIPS202_SHA3_256(const u8 *in, u64 inLen, u8 *out) { Keccak(1088, 512, in, inLen, 0x06, out, 32); }
    1.12 -void FIPS202_SHA3_384(const u8 *in, u64 inLen, u8 *out) { Keccak(832, 768, in, inLen, 0x06, out, 48); }
    1.13 -void FIPS202_SHA3_512(const u8 *in, u64 inLen, u8 *out) { Keccak(576, 1024, in, inLen, 0x06, out, 64); }
    1.14 +static void Keccak(ui r, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen);
    1.15 +void FIPS202_SHAKE128(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1344, /*256,*/ in, inLen, 0x1F, out, outLen); }
    1.16 +void FIPS202_SHAKE256(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1088, /*512,*/ in, inLen, 0x1F, out, outLen); }
    1.17 +void FIPS202_SHA3_224(const u8 *in, u64 inLen, u8 *out) { Keccak(1152, /*448,*/ in, inLen, 0x06, out, 28); }
    1.18 +void FIPS202_SHA3_256(const u8 *in, u64 inLen, u8 *out) { Keccak(1088, /*512,*/ in, inLen, 0x06, out, 32); }
    1.19 +void FIPS202_SHA3_384(const u8 *in, u64 inLen, u8 *out) { Keccak(832, /*768,*/ in, inLen, 0x06, out, 48); }
    1.20 +void FIPS202_SHA3_512(const u8 *in, u64 inLen, u8 *out) { Keccak(576, /*1024,*/ in, inLen, 0x06, out, 64); }
    1.21  
    1.22  static int LFSR86540(u8 *R) { (*R)=((*R)<<1)^(((*R)&0x80)?0x71:0); return ((*R)&2)>>1; }
    1.23  #define ROL(a,o) ((((u64)a)<<o)^(((u64)a)>>(64-o)))
    1.24 @@ -40,7 +40,7 @@
    1.25          /*ι*/ FOR(j,7) if (LFSR86540(&R)) XL(0,0,(u64)1<<((1<<j)-1));
    1.26      }
    1.27  }
    1.28 -static void Keccak(ui r, ui c, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen)
    1.29 +static void Keccak(ui r, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen)
    1.30  {
    1.31      /*initialize*/ u8 s[200]; ui R=r/8; ui i,b=0; FOR(i,200) s[i]=0;
    1.32      /*absorb*/ while(inLen>0) { b=(inLen<R)?inLen:R; FOR(i,b) s[i]^=in[i]; in+=b; inLen-=b; if (b==R) { KeccakF1600(s); b=0; } }

Impressum / About Us