Skip to content

Commit

Permalink
disabling KECCAK and NEM
Browse files Browse the repository at this point in the history
  • Loading branch information
xtruan committed Mar 4, 2023
1 parent 6857f79 commit 820aaa5
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions crypto/ed25519-donna/ed25519-hash-custom-keccak.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen);
*/

#include "../options.h"

#if USE_KECCAK

#ifndef ED25519_HASH_CUSTOM
#define ED25519_HASH_CUSTOM

Expand All @@ -21,3 +25,5 @@
#define ed25519_hash(hash, in, inlen) keccak_512((in), (inlen), (hash))

#endif // ED25519_HASH_CUSTOM

#endif // USE_KECCAK
6 changes: 6 additions & 0 deletions crypto/ed25519-donna/ed25519-keccak.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include "../options.h"

#if USE_KECCAK

#include <stddef.h>

#include "ed25519-keccak.h"
Expand All @@ -6,3 +10,5 @@
#define ED25519_SUFFIX _keccak

#include "ed25519.c"

#endif // USE_KECCAK
6 changes: 6 additions & 0 deletions crypto/ed25519-donna/ed25519-keccak.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include "../options.h"

#if USE_KECCAK

#ifndef ED25519_KECCAK_H
#define ED25519_KECCAK_H

Expand All @@ -19,3 +23,5 @@ int ed25519_scalarmult_keccak(ed25519_public_key res, const ed25519_secret_key s
#endif

#endif // ED25519_KECCAK_H

#endif // USE_KECCAK
6 changes: 6 additions & 0 deletions crypto/nem.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/

#include "options.h"

#if USE_NEM

#include "nem.h"

#include <string.h>
Expand Down Expand Up @@ -505,3 +509,5 @@ bool nem_transaction_create_importance_transfer(

return true;
}

#endif // USE_NEM
6 changes: 6 additions & 0 deletions crypto/nem.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/

#include "../options.h"

#if USE_NEM

#ifndef __NEM_H__
#define __NEM_H__

Expand Down Expand Up @@ -154,3 +158,5 @@ bool nem_transaction_create_importance_transfer(
uint32_t mode, const ed25519_public_key remote);

#endif

#endif // USE_NEM
2 changes: 1 addition & 1 deletion crypto/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

// support Keccak hashing
#ifndef USE_KECCAK
#define USE_KECCAK 1
#define USE_KECCAK 0
#endif

// add way how to mark confidential data
Expand Down
3 changes: 1 addition & 2 deletions views/flipbip_scene_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ static void flipbip_scene_1_model_init(FlipBipScene1Model* const model, const in
// Generate a BIP39 seed from the mnemonic
mnemonic_to_seed(model->mnemonic, "", model->seed, 0);

// Generate a BIP32 root key from the mnemonic

// Generate a BIP32 root HD node from the mnemonic
HDNode *root = malloc(sizeof(HDNode));
hdnode_from_seed(model->seed, 64, SECP256K1_NAME, root);

Expand Down

0 comments on commit 820aaa5

Please sign in to comment.