首页 > 其他分享 >cute

cute

时间:2025-01-15 15:00:07浏览次数:1  
标签:cute NewInt clock Int big fmt Bytes

func TestNameC(t *testing.T) {
c := elliptic.P256()
x, y := c.ScalarBaseMult(big.NewInt(1).Bytes())
for _, v := range []*big.Int{new(big.Int).Set(x), new(big.Int).Set(y)} {
for range []int{1, 2, 3, 4} {
fmt.Print(v.Uint64())
fmt.Print(", ")
v.Rsh(v, 64)
}
fmt.Println()
}
//17627433388654248598, 8575836109218198432, 17923454489921339634, 7716867327612699207,
//14678990851816772085, 3156516839386865358, 10297457778147434006, 5756518291402817435,
s := time.Now()
for i := int64(0); i < 40000; i++ {
c.ScalarMult(x, y, big.NewInt(i).Bytes())
//c.ScalarBaseMult(big.NewInt(i).Bytes())
}
fmt.Println(time.Now().Sub(s))
}


void f(){
const u64 sx[4] = {17627433388654248598ull, 8575836109218198432ull, 17923454489921339634ull, 7716867327612699207ull,},
sy[4] = {14678990851816772085ull, 3156516839386865358ull, 10297457778147434006ull, 5756518291402817435ull,};
clock_t s = clock();
fprintf(stdout, "%lf s\n", (double)(clock() - s)/CLOCKS_PER_SEC);
}

标签:cute,NewInt,clock,Int,big,fmt,Bytes
From: https://www.cnblogs.com/Janly/p/18673024

相关文章