mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-11 16:00:57 +00:00
Use proper option for USE_KECCAK via options.h
This commit is contained in:
parent
23590c05c6
commit
d68906ec4e
@ -56,4 +56,9 @@
|
|||||||
#define BIP39_CACHE_SIZE 4
|
#define BIP39_CACHE_SIZE 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// support Keccak hashing
|
||||||
|
#ifndef USE_KECCAK
|
||||||
|
#define USE_KECCAK 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
2
sha3.c
2
sha3.c
@ -331,7 +331,7 @@ void sha3_Final(SHA3_CTX *ctx, unsigned char* result)
|
|||||||
if (result) me64_to_le_str(result, ctx->hash, digest_length);
|
if (result) me64_to_le_str(result, ctx->hash, digest_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_KECCAK
|
#if USE_KECCAK
|
||||||
/**
|
/**
|
||||||
* Store calculated hash into the given array.
|
* Store calculated hash into the given array.
|
||||||
*
|
*
|
||||||
|
3
sha3.h
3
sha3.h
@ -21,6 +21,7 @@
|
|||||||
#define __SHA3_H__
|
#define __SHA3_H__
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -57,7 +58,7 @@ void sha3_512_Init(SHA3_CTX *ctx);
|
|||||||
void sha3_Update(SHA3_CTX *ctx, const unsigned char* msg, size_t size);
|
void sha3_Update(SHA3_CTX *ctx, const unsigned char* msg, size_t size);
|
||||||
void sha3_Final(SHA3_CTX *ctx, unsigned char* result);
|
void sha3_Final(SHA3_CTX *ctx, unsigned char* result);
|
||||||
|
|
||||||
#ifdef USE_KECCAK
|
#if USE_KECCAK
|
||||||
#define keccak_224_Init sha3_224_Init
|
#define keccak_224_Init sha3_224_Init
|
||||||
#define keccak_256_Init sha3_256_Init
|
#define keccak_256_Init sha3_256_Init
|
||||||
#define keccak_384_Init sha3_384_Init
|
#define keccak_384_Init sha3_384_Init
|
||||||
|
Loading…
Reference in New Issue
Block a user