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>
This commit is contained in:
Jouni Malinen 2019-10-25 14:34:44 +03:00 committed by Jouni Malinen
parent 9b292a48f7
commit de580bf6c4
3 changed files with 0 additions and 41 deletions

View file

@ -656,17 +656,6 @@ int crypto_bignum_sqrmod(const struct crypto_bignum *a,
const struct crypto_bignum *b, const struct crypto_bignum *b,
struct crypto_bignum *c); 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 * crypto_bignum_rshift - r = a >> n
* @a: Bignum * @a: Bignum

View file

@ -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, int crypto_bignum_rshift(const struct crypto_bignum *a, int n,
struct crypto_bignum *r) struct crypto_bignum *r)
{ {

View file

@ -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, int crypto_bignum_rshift(const struct crypto_bignum *a, int n,
struct crypto_bignum *r) struct crypto_bignum *r)
{ {