Files
xgcl/tpc/sm2/sm2a/util.go
T
2026-05-27 23:03:00 +08:00

28 lines
376 B
Go

package sm2a
import (
"fmt"
"math/big"
"xdx.jelly/xgcl/sm/sm2"
)
// pointToInt hash a point (x,y) to a big Int
func pointToInt(r, x, y *big.Int) {
r.Add(x, y)
r.Mod(r, sm2.OrderN())
}
func printLog(info string, data []byte) {
fmt.Println(info)
i := 0
for _, c := range data {
fmt.Printf("%02X", c)
i++
if i%40 == 0 {
fmt.Println()
}
}
fmt.Println()
}