소스 검색

cln16sidh: generalize toBigInt to work on slices

trials/prep_p503_trial3
Henry de Valence 7 년 전
부모
커밋
01b4238748
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. +5
    -1
      field_test.go

+ 5
- 1
field_test.go 파일 보기

@@ -11,7 +11,7 @@ import (
// Convert an Fp751Element to a big.Int for testing. Because this is only
// for testing, no big.Int to Fp751Element conversion is provided.

func (x *Fp751Element) toBigInt() *big.Int {
func radix64ToBigInt(x []uint64) *big.Int {
radix := new(big.Int)
// 2^64
radix.UnmarshalText(([]byte)("18446744073709551616"))
@@ -30,6 +30,10 @@ func (x *Fp751Element) toBigInt() *big.Int {
return val
}

func (x *Fp751Element) toBigInt() *big.Int {
return radix64ToBigInt(x[:])
}

func (x Fp751Element) Generate(rand *rand.Rand, size int) reflect.Value {
// Generation strategy: low limbs taken from [0,2^64); high limb
// taken from smaller range


불러오는 중...
취소
저장