Take BoringSSL 12f7737: Remove BN_MONT_CTX_init.
This commit is contained in:
commit
2c30f81d46
@ -130,16 +130,12 @@ BN_MONT_CTX *BN_MONT_CTX_new(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BN_MONT_CTX_init(ret);
|
||||
ret->flags = BN_FLG_MALLOCED;
|
||||
return ret;
|
||||
}
|
||||
memset(ret, 0, sizeof(BN_MONT_CTX));
|
||||
BN_init(&ret->RR);
|
||||
BN_init(&ret->N);
|
||||
BN_init(&ret->Ni);
|
||||
|
||||
void BN_MONT_CTX_init(BN_MONT_CTX *mont) {
|
||||
memset(mont, 0, sizeof(BN_MONT_CTX));
|
||||
BN_init(&mont->RR);
|
||||
BN_init(&mont->N);
|
||||
BN_init(&mont->Ni);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void BN_MONT_CTX_free(BN_MONT_CTX *mont) {
|
||||
@ -150,9 +146,7 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont) {
|
||||
BN_free(&mont->RR);
|
||||
BN_free(&mont->N);
|
||||
BN_free(&mont->Ni);
|
||||
if (mont->flags & BN_FLG_MALLOCED) {
|
||||
OPENSSL_free(mont);
|
||||
}
|
||||
OPENSSL_free(mont);
|
||||
}
|
||||
|
||||
int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) {
|
||||
|
@ -672,11 +672,7 @@ OPENSSL_EXPORT BIGNUM *BN_mod_inverse_ex(BIGNUM *out, int *out_no_inverse,
|
||||
/* BN_MONT_CTX_new returns a fresh BN_MONT_CTX or NULL on allocation failure. */
|
||||
OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new(void);
|
||||
|
||||
/* BN_MONT_CTX_init initialises a stack allocated |BN_MONT_CTX|. */
|
||||
OPENSSL_EXPORT void BN_MONT_CTX_init(BN_MONT_CTX *mont);
|
||||
|
||||
/* BN_MONT_CTX_free frees the contexts of |mont| and, if it was originally
|
||||
* allocated with |BN_MONT_CTX_new|, |mont| itself. */
|
||||
/* BN_MONT_CTX_free frees memory associated with |mont|. */
|
||||
OPENSSL_EXPORT void BN_MONT_CTX_free(BN_MONT_CTX *mont);
|
||||
|
||||
/* BN_MONT_CTX_set sets up a Montgomery context given the modulus, |mod|. It
|
||||
@ -756,7 +752,6 @@ struct bn_mont_ctx_st {
|
||||
* (Ni is only stored for bignum algorithm) */
|
||||
BN_ULONG n0[2]; /* least significant word(s) of Ni;
|
||||
(type changed with 0.9.9, was "BN_ULONG n0;" before) */
|
||||
int flags;
|
||||
int ri; /* number of bits in R */
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user