Skip to content

Commit

Permalink
crypto: only allocate enough memory for the corresponding pow algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarshall108 committed Mar 3, 2018
1 parent 286a655 commit ff664ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/slow-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ STATIC INLINE void aesni_pseudo_round(const uint8_t *in, uint8_t *out,

void cn_slow_hash(const void *data, size_t length, char *hash, int dark)
{
uint8_t long_state[MEMORY];
uint8_t long_state[(MEMORY / (dark?4:1))];
uint8_t text[INIT_SIZE_BYTE];
uint8_t a[AES_BLOCK_SIZE];
uint8_t b[AES_BLOCK_SIZE];
Expand Down

0 comments on commit ff664ad

Please sign in to comment.