Added new API functions: uECC_curve_num_bytes() and uECC_curve_num_n_bytes().

This commit is contained in:
Evgeni Margolis
2015-11-01 01:39:57 -07:00
parent 28fdb2c363
commit 61bd1ada6f
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -1464,6 +1464,10 @@ unsigned uECC_curve_num_words(uECC_Curve curve) {
return curve->num_words;
}
unsigned uECC_curve_num_bytes(uECC_Curve curve) {
return curve->num_bytes;
}
unsigned uECC_curve_num_bits(uECC_Curve curve) {
return curve->num_bytes * 8;
}
@@ -1472,6 +1476,10 @@ unsigned uECC_curve_num_n_words(uECC_Curve curve) {
return BITS_TO_WORDS(curve->num_n_bits);
}
unsigned uECC_curve_num_n_bytes(uECC_Curve curve) {
return BITS_TO_BYTES(curve->num_n_bits);
}
unsigned uECC_curve_num_n_bits(uECC_Curve curve) {
return curve->num_n_bits;
}
+2
View File
@@ -136,8 +136,10 @@ void uECC_vli_nativeToBytes(uint8_t *bytes, int num_bytes, const uECC_word_t *na
void uECC_vli_bytesToNative(uECC_word_t *native, const uint8_t *bytes, int num_bytes);
unsigned uECC_curve_num_words(uECC_Curve curve);
unsigned uECC_curve_num_bytes(uECC_Curve curve);
unsigned uECC_curve_num_bits(uECC_Curve curve);
unsigned uECC_curve_num_n_words(uECC_Curve curve);
unsigned uECC_curve_num_n_bytes(uECC_Curve curve);
unsigned uECC_curve_num_n_bits(uECC_Curve curve);
const uECC_word_t *uECC_curve_p(uECC_Curve curve);