mirror of
https://github.com/emmansun/gmsm.git
synced 2025-10-16 08:10:45 +08:00
internal/sm2ec: loong64 test p256PointAddAsm
This commit is contained in:
parent
8bb8364b43
commit
ed43a82f8f
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user