diff --git a/internal/sm2ec/sm2p256_asm_test.go b/internal/sm2ec/sm2p256_asm_test.go index 559f63c..0acd6b2 100644 --- a/internal/sm2ec/sm2p256_asm_test.go +++ b/internal/sm2ec/sm2p256_asm_test.go @@ -205,13 +205,21 @@ func TestPointDouble(t *testing.T) { } if hex.EncodeToString(double1.Bytes()) != "0497662389f36ce643a47dcf644f700651e988794843797b0c4a69c806e78615c2cd4d9449aea5cac5328b8d67d4ae956f5eb06c4515ff01bd17eef58bf866b33f" { - t.Errorf("PointDouble6Times is incorrect %x", double1.Bytes()) + t.Errorf("PointDouble6Times 1 is incorrect %x", double1.Bytes()) + } + + if hex.EncodeToString(double2.Bytes()) != "0497662389f36ce643a47dcf644f700651e988794843797b0c4a69c806e78615c2cd4d9449aea5cac5328b8d67d4ae956f5eb06c4515ff01bd17eef58bf866b33f" { + t.Errorf("PointDouble6Times 2 is incorrect %x", double2.Bytes()) } } func TestPointAdd(t *testing.T) { p := NewSM2P256Point().SetGenerator() var p1, p2, sum1, sum2 SM2P256Point + ret := p256PointAddAsm(&sum1, p, p) + if ret != 1 { + t.Error("Should return 1") + } p256PointDoubleAsm(&p1, p) p256PointAddAsm(&sum1, p, &p1)