mirror of
https://github.com/darlinghq/darling-corecrypto.git
synced 2024-11-23 04:09:44 +00:00
Add ECIES_LEGACY_IV definition and fix cczp_init return type
This commit is contained in:
parent
786e202c13
commit
553b0adc8f
@ -9,6 +9,7 @@
|
||||
#define ECIES_EPH_PUBKEY_IN_SHAREDINFO1 1
|
||||
#define ECIES_EXPORT_PUB_STANDARD 2
|
||||
#define ECIES_EXPORT_PUB_COMPACT 4
|
||||
#define ECIES_LEGACY_IV 8 // is this right? someone please check
|
||||
|
||||
typedef struct ccecies_gcm {
|
||||
const struct ccdigest_info *di;
|
||||
|
@ -128,7 +128,7 @@ CC_CONST CC_INLINE ccmod_prime_f *cczp_mod_prime(cczp_const_t zp)
|
||||
return CCZP_CONST_T_ZP(zp)->mod_prime;
|
||||
}
|
||||
|
||||
void cczp_init(cczp_t zp);
|
||||
int cczp_init(cczp_t zp);
|
||||
|
||||
void cczp_mod(cczp_const_t zp, cc_unit *r, const cc_unit *s2n, cc_ws_t ws);
|
||||
|
||||
|
@ -23,13 +23,14 @@ void shift_units_left(cc_size n, cc_unit* result, const cc_unit* operand, cc_siz
|
||||
}
|
||||
};
|
||||
|
||||
void cczp_init(cczp_t zp) {
|
||||
int cczp_init(cczp_t zp) {
|
||||
zp.zp->mod_prime = &cczp_mod;
|
||||
|
||||
const cc_unit* prime = cczp_prime(zp);
|
||||
cc_size n = ccn_n(cczp_n(zp), prime);
|
||||
|
||||
ccn_make_recip(n, CCZP_RECIP(zp), prime);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cczp_mod(cczp_const_t zp, cc_unit* result, const cc_unit* operand, cc_ws_t ws) {
|
||||
|
Loading…
Reference in New Issue
Block a user