update crypto

This commit is contained in:
Zhi Guan
2017-03-08 15:02:42 +08:00
parent 4d84dd7557
commit 002096751c
29 changed files with 1062 additions and 134 deletions

View File

@@ -169,6 +169,13 @@ int BN_GFP2_cmp(const BN_GFP2 *a, const BN_GFP2 *b)
return ((BN_cmp(a->a0, b->a0) == 0) && (BN_cmp(a->a1, b->a1) == 0));
}
int BN_GFP2_equ(const BN_GFP2 *a, const BN_GFP2 *b)
{
//FIXME
return 0;
}
int BN_GFP2_add(BN_GFP2 *r, const BN_GFP2 *a, const BN_GFP2 *b,
const BIGNUM *p, BN_CTX *ctx)
{
@@ -494,4 +501,3 @@ int BN_gfp22bn(const BN_GFP2 *gfp2, BIGNUM *bn, const BIGNUM *p, BN_CTX *ctx)
}
return 1;
}

View File

@@ -127,14 +127,14 @@ int BN_bn2solinas(const BIGNUM *bn, BN_SOLINAS *solinas)
}
end:
return 0;
return ret;
}
int BN_solinas2bn(const BN_SOLINAS *solinas, BIGNUM *bn)
{
int ret = 0;
BIGNUM *tmp = NULL;
#if 0
BIGNUM *tmp = NULL;
if (b <= 0 || a <= b || (s != 1 && s != -1) ||
(c != 1 && c != -1)) {
BNerr(BN_F_BN_SOLINAS2BN, BN_R_INVALID_SOLINAS_PARAMETERS);