Przeglądaj źródła

disabling KECCAK and NEM

xtruan 2 lat temu
rodzic
commit
820aaa5e4d

+ 6 - 0
crypto/ed25519-donna/ed25519-hash-custom-keccak.h

@@ -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
 
@@ -21,3 +25,5 @@
 #define ed25519_hash(hash, in, inlen) keccak_512((in), (inlen), (hash))
 
 #endif // ED25519_HASH_CUSTOM
+
+#endif // USE_KECCAK

+ 6 - 0
crypto/ed25519-donna/ed25519-keccak.c

@@ -1,3 +1,7 @@
+#include "../options.h"
+
+#if USE_KECCAK
+
 #include <stddef.h>
 
 #include "ed25519-keccak.h"
@@ -6,3 +10,5 @@
 #define ED25519_SUFFIX _keccak
 
 #include "ed25519.c"
+
+#endif // USE_KECCAK

+ 6 - 0
crypto/ed25519-donna/ed25519-keccak.h

@@ -1,3 +1,7 @@
+#include "../options.h"
+
+#if USE_KECCAK
+
 #ifndef ED25519_KECCAK_H
 #define ED25519_KECCAK_H
 
@@ -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 - 0
crypto/nem.c

@@ -20,6 +20,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include "options.h"
+
+#if USE_NEM
+
 #include "nem.h"
 
 #include <string.h>
@@ -505,3 +509,5 @@ bool nem_transaction_create_importance_transfer(
 
   return true;
 }
+
+#endif // USE_NEM

+ 6 - 0
crypto/nem.h

@@ -20,6 +20,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include "../options.h"
+
+#if USE_NEM
+
 #ifndef __NEM_H__
 #define __NEM_H__
 
@@ -154,3 +158,5 @@ bool nem_transaction_create_importance_transfer(
     uint32_t mode, const ed25519_public_key remote);
 
 #endif
+
+#endif // USE_NEM

+ 1 - 1
crypto/options.h

@@ -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

+ 1 - 2
views/flipbip_scene_1.c

@@ -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);