mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-28 05:06:18 +08:00
internal/sm2ec: test point double 6 times
This commit is contained in:
parent
ebe5413d1e
commit
c50b71f0af
@ -3,6 +3,7 @@
|
||||
package sm2ec
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"io"
|
||||
@ -187,3 +188,19 @@ func BenchmarkP256SelectAffine(b *testing.B) {
|
||||
p256SelectAffine(&t0, &p256Precomputed[20], 20)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPointDouble(t *testing.T) {
|
||||
var double1, double2 SM2P256Point
|
||||
p := NewSM2P256Point().SetGenerator()
|
||||
p256PointDoubleAsm(&double1, p)
|
||||
p256PointDoubleAsm(&double1, &double1)
|
||||
p256PointDoubleAsm(&double1, &double1)
|
||||
p256PointDoubleAsm(&double1, &double1)
|
||||
p256PointDoubleAsm(&double1, &double1)
|
||||
p256PointDoubleAsm(&double1, &double1)
|
||||
|
||||
p256PointDouble6TimesAsm(&double2, p)
|
||||
if !bytes.Equal(double1.Bytes(), double2.Bytes()) {
|
||||
t.Error("PointDouble6Times is incorrect")
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user