diff options
author | Jouni Malinen <jouni@codeaurora.org> | 2019-10-25 11:34:44 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2019-10-25 16:29:53 (GMT) |
commit | de580bf6c46727c8868abfd8d1134bcd4615ee35 (patch) | |
tree | b8e252f873afdd1e01e5253586db6707044bb2a4 /src/crypto | |
parent | 9b292a48f72463628f753d18ea21abca910186bf (diff) | |
download | hostap-de580bf6c46727c8868abfd8d1134bcd4615ee35.zip hostap-de580bf6c46727c8868abfd8d1134bcd4615ee35.tar.gz hostap-de580bf6c46727c8868abfd8d1134bcd4615ee35.tar.bz2 |
crypto: Remove unused crypto_bignum_sqrtmod()
This wrapper function is not used anymore, so drop it instead of trying
to figure out good way of implementing it in constant time with various
crypto libraries.
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'src/crypto')
-rw-r--r-- | src/crypto/crypto.h | 11 | ||||
-rw-r--r-- | src/crypto/crypto_openssl.c | 21 | ||||
-rw-r--r-- | src/crypto/crypto_wolfssl.c | 9 |
3 files changed, 0 insertions, 41 deletions
diff --git a/src/crypto/crypto.h b/src/crypto/crypto.h index 68476db..440da03 100644 --- a/src/crypto/crypto.h +++ b/src/crypto/crypto.h @@ -657,17 +657,6 @@ int crypto_bignum_sqrmod(const struct crypto_bignum *a, struct crypto_bignum *c); /** - * crypto_bignum_sqrtmod - returns sqrt(a) (mod b) - * @a: Bignum - * @b: Bignum - * @c: Bignum; used to store the result - * Returns: 0 on success, -1 on failure - */ -int crypto_bignum_sqrtmod(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c); - -/** * crypto_bignum_rshift - r = a >> n * @a: Bignum * @n: Number of bits diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index ed46310..783b293 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -1533,27 +1533,6 @@ int crypto_bignum_sqrmod(const struct crypto_bignum *a, } -int crypto_bignum_sqrtmod(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c) -{ - BN_CTX *bnctx; - BIGNUM *res; - - if (TEST_FAIL()) - return -1; - - bnctx = BN_CTX_new(); - if (!bnctx) - return -1; - res = BN_mod_sqrt((BIGNUM *) c, (const BIGNUM *) a, (const BIGNUM *) b, - bnctx); - BN_CTX_free(bnctx); - - return res ? 0 : -1; -} - - int crypto_bignum_rshift(const struct crypto_bignum *a, int n, struct crypto_bignum *r) { diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c index 3069b4a..85ce565 100644 --- a/src/crypto/crypto_wolfssl.c +++ b/src/crypto/crypto_wolfssl.c @@ -1226,15 +1226,6 @@ int crypto_bignum_sqrmod(const struct crypto_bignum *a, } -int crypto_bignum_sqrtmod(const struct crypto_bignum *a, - const struct crypto_bignum *b, - struct crypto_bignum *c) -{ - /* TODO */ - return -1; -} - - int crypto_bignum_rshift(const struct crypto_bignum *a, int n, struct crypto_bignum *r) { |