kaccak: remove unused return value

This commit is contained in:
moneromooo-monero 2017-11-11 11:20:48 +00:00
parent 4877aca2b6
commit e3e838d0cf
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
3 changed files with 3 additions and 9 deletions

View File

@ -75,7 +75,7 @@ void keccakf(uint64_t st[25], int rounds)
// compute a keccak hash (md) of given byte length from "in" // compute a keccak hash (md) of given byte length from "in"
typedef uint64_t state_t[25]; typedef uint64_t state_t[25];
int keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen) void keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen)
{ {
state_t st; state_t st;
uint8_t temp[144]; uint8_t temp[144];
@ -116,8 +116,6 @@ int keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen)
keccakf(st, KECCAK_ROUNDS); keccakf(st, KECCAK_ROUNDS);
memcpy(md, st, mdlen); memcpy(md, st, mdlen);
return 0;
} }
void keccak1600(const uint8_t *in, size_t inlen, uint8_t *md) void keccak1600(const uint8_t *in, size_t inlen, uint8_t *md)

View File

@ -16,7 +16,7 @@
#endif #endif
// compute a keccak hash (md) of given byte length from "in" // compute a keccak hash (md) of given byte length from "in"
int keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen); void keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen);
// update the state // update the state
void keccakf(uint64_t st[25], int norounds); void keccakf(uint64_t st[25], int norounds);

View File

@ -74,16 +74,12 @@ namespace
{ {
size_t inlen = sizeof(source); size_t inlen = sizeof(source);
int mdlen = (int)sizeof(md); int mdlen = (int)sizeof(md);
int ret = keccak(source, inlen, md, mdlen); keccak(source, inlen, md, mdlen);
if (md[0] != 0x00) if (md[0] != 0x00)
{ {
return true; return true;
} }
else if (!ret)
{
return true;
}
else else
{ {
return false; return false;