Remove num_bytes member from curve structure
Reduces code size and size of the structure.
diff --git a/tinycrypt/ecc_dh.c b/tinycrypt/ecc_dh.c
index b3f8f71..a1d7483 100644
--- a/tinycrypt/ecc_dh.c
+++ b/tinycrypt/ecc_dh.c
@@ -92,10 +92,10 @@
BITS_TO_BYTES(curve->num_n_bits),
_private);
uECC_vli_nativeToBytes(public_key,
- curve->num_bytes,
+ NUM_ECC_BYTES,
_public);
- uECC_vli_nativeToBytes(public_key + curve->num_bytes,
- curve->num_bytes,
+ uECC_vli_nativeToBytes(public_key + NUM_ECC_BYTES,
+ NUM_ECC_BYTES,
_public + NUM_ECC_WORDS);
/* erasing temporary buffer used to store secret: */
@@ -133,10 +133,10 @@
BITS_TO_BYTES(curve->num_n_bits),
_private);
uECC_vli_nativeToBytes(public_key,
- curve->num_bytes,
+ NUM_ECC_BYTES,
_public);
- uECC_vli_nativeToBytes(public_key + curve->num_bytes,
- curve->num_bytes,
+ uECC_vli_nativeToBytes(public_key + NUM_ECC_BYTES,
+ NUM_ECC_BYTES,
_public + NUM_ECC_WORDS);
/* erasing temporary buffer that stored secret: */
@@ -155,7 +155,7 @@
uECC_word_t _public[NUM_ECC_WORDS * 2];
uECC_word_t _private[NUM_ECC_WORDS];
wordcount_t num_words = NUM_ECC_WORDS;
- wordcount_t num_bytes = curve->num_bytes;
+ wordcount_t num_bytes = NUM_ECC_BYTES;
int r;
/* Converting buffers to correct bit order: */