Merge pull request #1297 from Gorachya/develop

Bug fixed
This commit is contained in:
Zhi Guan
2022-08-23 09:24:16 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -216,7 +216,7 @@ int sm9_do_verify(const SM9_SIGN_MASTER_KEY *mpk, const char *id, size_t idlen,
// B6: P = h1 * P2 + Ppubs
sm9_twist_point_mul_generator(&P, h1);
sm9_twist_point_add(&P, &P, &mpk->Ppubs);
sm9_twist_point_add_full(&P, &P, &mpk->Ppubs);
// B7: u = e(S, P)
sm9_pairing(u, &P, &sig->S);

View File

@@ -540,7 +540,7 @@ int test_sm9_sign() {
sm9_verify_init(&ctx);
sm9_verify_update(&ctx, data, sizeof(data));
if (sm9_verify_finish(&ctx, sig, siglen, &mpk, (char *)IDA, sizeof(IDA)) < 0) goto err; ++j;
if (sm9_verify_finish(&ctx, sig, siglen, &mpk, (char *)IDA, sizeof(IDA)) != 1) goto err; ++j;
printf("%s() ok\n", __FUNCTION__);
return 1;