mirror of
https://github.com/darlinghq/darling-corecrypto.git
synced 2024-11-23 12:19:44 +00:00
Add ccec_export_pub_size_cp
and CCEC_GENKEY_DETERMINISTIC_LEGACY
These are used in `secd`.
This commit is contained in:
parent
978407ad2f
commit
ce66765c0e
@ -262,9 +262,14 @@ int ccec_verify(ccec_pub_ctx_t key, size_t digest_len, const uint8_t *digest,
|
|||||||
CC_NONNULL_TU((1)) CC_NONNULL2
|
CC_NONNULL_TU((1)) CC_NONNULL2
|
||||||
void ccec_export_pub(ccec_pub_ctx_t key, void *out);
|
void ccec_export_pub(ccec_pub_ctx_t key, void *out);
|
||||||
|
|
||||||
|
CC_INLINE CC_CONST
|
||||||
|
size_t ccec_export_pub_size_cp(ccec_const_cp_t cp) {
|
||||||
|
return 1 + 2 * ccec_cp_prime_size(cp);
|
||||||
|
}
|
||||||
|
|
||||||
CC_INLINE CC_CONST CC_NONNULL_TU((1))
|
CC_INLINE CC_CONST CC_NONNULL_TU((1))
|
||||||
size_t ccec_export_pub_size(ccec_pub_ctx_t key) {
|
size_t ccec_export_pub_size(ccec_pub_ctx_t key) {
|
||||||
return 1 + 2 * ccec_cp_prime_size(ccec_ctx_cp(key));
|
return ccec_export_pub_size_cp(ccec_ctx_cp(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
CC_NONNULL_TU((1,4)) CC_NONNULL((3))
|
CC_NONNULL_TU((1,4)) CC_NONNULL((3))
|
||||||
@ -351,6 +356,7 @@ int ccec_generate_key_deterministic(ccec_const_cp_t arg0, int arg1, unsigned cha
|
|||||||
|
|
||||||
#define CCEC_GENKEY_DETERMINISTIC_COMPACT 0
|
#define CCEC_GENKEY_DETERMINISTIC_COMPACT 0
|
||||||
#define CCEC_GENKEY_DETERMINISTIC_SECBKP 1
|
#define CCEC_GENKEY_DETERMINISTIC_SECBKP 1
|
||||||
|
#define CCEC_GENKEY_DETERMINISTIC_LEGACY 2 /* arbitrary guess */
|
||||||
|
|
||||||
size_t ccec_diversify_min_entropy_len(ccec_const_cp_t cp);
|
size_t ccec_diversify_min_entropy_len(ccec_const_cp_t cp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user