mirror of
https://github.com/emmansun/gmsm.git
synced 2025-10-18 17:18:29 +08:00
internal/sm2ec: loong64 fix p256PointAddAffineAsm
This commit is contained in:
parent
c593434605
commit
2af8167876
@ -1712,7 +1712,7 @@ TEXT ·p256PointAddAffineAsm(SB),0,$264-48
|
||||
MOVV x1, y1
|
||||
MOVV x2, y2
|
||||
MOVV x3, y3
|
||||
LDy(hcub)
|
||||
LDx(hcub)
|
||||
CALL sm2P256Subinternal<>(SB)
|
||||
|
||||
MOVV (8*0)(a_ptr), acc0 // load x1
|
||||
|
@ -307,23 +307,24 @@ func TestP256PointAddAffineAsm(t *testing.T) {
|
||||
p256SelectAffine(&t0, &p256Precomputed[0], 3)
|
||||
p.x, p.y, p.z = t0.x, t0.y, p256One
|
||||
p256SelectAffine(&t0, &p256Precomputed[32], 3)
|
||||
p256PointAddAffineAsm(p, p, &t0, 0, 3, 1)
|
||||
if hex.EncodeToString(p.Bytes()) != "04f1dd662afa8046798bb6dcf34c4b1e1e9d7e88aff4ba8b43de4acf7e8f62a60f16a9cb1bbd2eacb000382c13303ef83b7a0b7a821390db3887c96683af0e7bd6" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p.Bytes())
|
||||
p1 := NewSM2P256Point()
|
||||
p256PointAddAffineAsm(p1, p, &t0, 0, 3, 1)
|
||||
if hex.EncodeToString(p1.Bytes()) != "04f1dd662afa8046798bb6dcf34c4b1e1e9d7e88aff4ba8b43de4acf7e8f62a60f16a9cb1bbd2eacb000382c13303ef83b7a0b7a821390db3887c96683af0e7bd6" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p1.Bytes())
|
||||
}
|
||||
|
||||
p256PointAddAffineAsm(p, p, &t0, 1, 3, 1)
|
||||
if hex.EncodeToString(p.Bytes()) != "04a97f7cd4b3c993b4be2daa8cdb41e24ca13f6bd945302244e26918f1d0509ebf530b5dd88c688ef5ccc5cec08a72150f7c400ee5cd045292aaacdd037458f6e6" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p.Bytes())
|
||||
p256PointAddAffineAsm(p1, p, &t0, 1, 3, 1)
|
||||
if hex.EncodeToString(p1.Bytes()) != "040e0703211fd58fc3f11b675db4317809ca492851eb8bb9feeaa18c4d05282cd875a74e1684fb24b7fd9cce2d1d7bf3072bd04b0edb237e4f31d68af2f6b81470" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p1.Bytes())
|
||||
}
|
||||
|
||||
p256PointAddAffineAsm(p, p, &t0, 0, 0, 1)
|
||||
if hex.EncodeToString(p.Bytes()) != "04a97f7cd4b3c993b4be2daa8cdb41e24ca13f6bd945302244e26918f1d0509ebf530b5dd88c688ef5ccc5cec08a72150f7c400ee5cd045292aaacdd037458f6e6" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p.Bytes())
|
||||
p256PointAddAffineAsm(p1, p, &t0, 0, 0, 1)
|
||||
if hex.EncodeToString(p1.Bytes()) != "04a97f7cd4b3c993b4be2daa8cdb41e24ca13f6bd945302244e26918f1d0509ebf530b5dd88c688ef5ccc5cec08a72150f7c400ee5cd045292aaacdd037458f6e6" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p1.Bytes())
|
||||
}
|
||||
|
||||
p256PointAddAffineAsm(p, p, &t0, 0, 3, 0)
|
||||
if hex.EncodeToString(p.Bytes()) != "04ccc69dcd48c3cdd56e164408eb8f345ff512ce57673bcb32c5b0fd8fe13eb9128fe410fe8bc0792948ad23d074346f66e842857399981e91f0c920e6e0afa3cc" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p.Bytes())
|
||||
p256PointAddAffineAsm(p1, p, &t0, 0, 3, 0)
|
||||
if hex.EncodeToString(p1.Bytes()) != "04ccc69dcd48c3cdd56e164408eb8f345ff512ce57673bcb32c5b0fd8fe13eb9128fe410fe8bc0792948ad23d074346f66e842857399981e91f0c920e6e0afa3cc" {
|
||||
t.Errorf("PointAddAffine is incorrect %x", p1.Bytes())
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user