explicit void declaration, remove unused arg. thanks ccomp
This commit is contained in:
parent
7281403328
commit
e6a879949b
@ -109,7 +109,7 @@ static int parsecpuinfo()
|
||||
}
|
||||
#endif
|
||||
|
||||
int cpucount()
|
||||
int cpucount(void)
|
||||
{
|
||||
int ncpu;
|
||||
#ifdef _SC_NPROCESSORS_ONLN
|
||||
|
@ -1 +1 @@
|
||||
int cpucount();
|
||||
int cpucount(void);
|
||||
|
2
keccak.c
2
keccak.c
@ -22,7 +22,7 @@ static void KeccakF1600(void *s)
|
||||
/*ι*/ FOR(j,7) if (LFSR86540(&R)) XL(0,0,(u64)1<<((1<<j)-1));
|
||||
}
|
||||
}
|
||||
void Keccak(u32 r, u32 c, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen)
|
||||
void Keccak(u32 r, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen)
|
||||
{
|
||||
/*initialize*/ u8 s[200]; ui R=r/8; ui i,b=0; FOR(i,200) s[i]=0;
|
||||
/*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; } }
|
||||
|
14
keccak.h
14
keccak.h
@ -1,14 +1,14 @@
|
||||
|
||||
void Keccak(u32 r, u32 c, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen);
|
||||
void Keccak(u32 r, const u8 *in, u64 inLen, u8 sfx, u8 *out, u64 outLen);
|
||||
|
||||
#define FIPS202_SHA3_224_LEN 28
|
||||
#define FIPS202_SHA3_256_LEN 32
|
||||
#define FIPS202_SHA3_384_LEN 48
|
||||
#define FIPS202_SHA3_512_LEN 64
|
||||
|
||||
static inline void FIPS202_SHAKE128(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1344, 256, in, inLen, 0x1F, out, outLen); }
|
||||
static inline void FIPS202_SHAKE256(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1088, 512, in, inLen, 0x1F, out, outLen); }
|
||||
static inline void FIPS202_SHA3_224(const u8 *in, u64 inLen, u8 *out) { Keccak(1152, 448, in, inLen, 0x06, out, 28); }
|
||||
static inline void FIPS202_SHA3_256(const u8 *in, u64 inLen, u8 *out) { Keccak(1088, 512, in, inLen, 0x06, out, 32); }
|
||||
static inline void FIPS202_SHA3_384(const u8 *in, u64 inLen, u8 *out) { Keccak(832, 768, in, inLen, 0x06, out, 48); }
|
||||
static inline void FIPS202_SHA3_512(const u8 *in, u64 inLen, u8 *out) { Keccak(576, 1024, in, inLen, 0x06, out, 64); }
|
||||
static inline void FIPS202_SHAKE128(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1344, in, inLen, 0x1F, out, outLen); }
|
||||
static inline void FIPS202_SHAKE256(const u8 *in, u64 inLen, u8 *out, u64 outLen) { Keccak(1088, in, inLen, 0x1F, out, outLen); }
|
||||
static inline void FIPS202_SHA3_224(const u8 *in, u64 inLen, u8 *out) { Keccak(1152, in, inLen, 0x06, out, 28); }
|
||||
static inline void FIPS202_SHA3_256(const u8 *in, u64 inLen, u8 *out) { Keccak(1088, in, inLen, 0x06, out, 32); }
|
||||
static inline void FIPS202_SHA3_384(const u8 *in, u64 inLen, u8 *out) { Keccak(832, in, inLen, 0x06, out, 48); }
|
||||
static inline void FIPS202_SHA3_512(const u8 *in, u64 inLen, u8 *out) { Keccak(576, in, inLen, 0x06, out, 64); }
|
||||
|
Loading…
Reference in New Issue
Block a user