mirror of
https://github.com/kmackay/micro-ecc.git
synced 2026-08-04 09:27:46 +00:00
Add functions to get the private/public key size for a curve (#73)
This commit is contained in:
@@ -195,6 +195,14 @@ uECC_RNG_Function uECC_get_rng(void) {
|
||||
return g_rng_function;
|
||||
}
|
||||
|
||||
int uECC_curve_private_key_size(uECC_Curve curve) {
|
||||
return BITS_TO_BYTES(curve->num_n_bits);
|
||||
}
|
||||
|
||||
int uECC_curve_public_key_size(uECC_Curve curve) {
|
||||
return 2 * curve->num_bytes;
|
||||
}
|
||||
|
||||
#if !asm_clear
|
||||
uECC_VLI_API void uECC_vli_clear(uECC_word_t *vli, wordcount_t num_words) {
|
||||
wordcount_t i;
|
||||
|
||||
@@ -130,6 +130,18 @@ Returns the function that will be used to generate random bytes.
|
||||
*/
|
||||
uECC_RNG_Function uECC_get_rng(void);
|
||||
|
||||
/* uECC_curve_private_key_size() function.
|
||||
|
||||
Returns the size of a private key for the curve in bytes.
|
||||
*/
|
||||
int uECC_curve_private_key_size(uECC_Curve curve);
|
||||
|
||||
/* uECC_curve_public_key_size() function.
|
||||
|
||||
Returns the size of a public key for the curve in bytes.
|
||||
*/
|
||||
int uECC_curve_public_key_size(uECC_Curve curve);
|
||||
|
||||
/* uECC_make_key() function.
|
||||
Create a public/private key pair.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user