mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 12:16:20 +08:00
use efforf instead of fatalf
This commit is contained in:
parent
223d593817
commit
bf891d841e
@ -47,7 +47,7 @@ func testP256FromMont(v *big.Int, t *testing.T) {
|
|||||||
res := new(p256Element)
|
res := new(p256Element)
|
||||||
p256FromMont(res, val)
|
p256FromMont(res, val)
|
||||||
if toBigInt(res).Cmp(v) != 0 {
|
if toBigInt(res).Cmp(v) != 0 {
|
||||||
t.Fatalf("p256FromMont failed for %x", v.Bytes())
|
t.Errorf("p256FromMont failed for %x", v.Bytes())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,11 +66,10 @@ func testP256OrderReduce(v, expected *big.Int, t *testing.T) {
|
|||||||
fromBig((*[4]uint64)(val), v)
|
fromBig((*[4]uint64)(val), v)
|
||||||
p256OrdReduce(val)
|
p256OrdReduce(val)
|
||||||
if ordElmToBigInt(val).Cmp(expected) != 0 {
|
if ordElmToBigInt(val).Cmp(expected) != 0 {
|
||||||
t.Fatalf("p256OrdReduce failed for %x", v.Bytes())
|
t.Errorf("p256OrdReduce failed for %x", v.Bytes())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestP256OrderReduce(t *testing.T) {
|
func TestP256OrderReduce(t *testing.T) {
|
||||||
p, _ := new(big.Int).SetString("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", 16)
|
p, _ := new(big.Int).SetString("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", 16)
|
||||||
for i := 0; i < 20; i++ {
|
for i := 0; i < 20; i++ {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user