Skip to content

Commit

Permalink
explicit void declaration, remove unused arg. thanks ccomp
Browse files Browse the repository at this point in the history
  • Loading branch information
cathugger committed Oct 23, 2017
1 parent 7281403 commit e6a8799
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cpucount.c
Expand Up @@ -109,7 +109,7 @@ static int parsecpuinfo()
}
#endif

int cpucount()
int cpucount(void)
{
int ncpu;
#ifdef _SC_NPROCESSORS_ONLN
Expand Down
2 changes: 1 addition & 1 deletion cpucount.h
@@ -1 +1 @@
int cpucount();
int cpucount(void);
2 changes: 1 addition & 1 deletion keccak.c
Expand Up @@ -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; } }
Expand Down
14 changes: 7 additions & 7 deletions 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); }

0 comments on commit e6a8799

Please sign in to comment.