internal/sm2ec: fix test assert bug

This commit is contained in:
Sun Yimin 2023-03-09 14:52:55 +08:00 committed by GitHub
parent 1d1382f085
commit b70f6bb374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@ func TestImplicitSig(t *testing.T) {
res2.Mul(ePriv, k) res2.Mul(ePriv, k)
res2.Add(res2, sPriv) res2.Add(res2, sPriv)
res2.Mod(res2, n) res2.Mod(res2, n)
if !bytes.Equal(res1, res2.Bytes()) { if !bytes.Equal(new(big.Int).SetBytes(res1).Bytes(), res2.Bytes()) {
t.Errorf("expected %s, got %s", hex.EncodeToString(res1), hex.EncodeToString(res2.Bytes())) t.Errorf("expected %s, got %s", hex.EncodeToString(res1), hex.EncodeToString(res2.Bytes()))
} }
} }