Documentation
¶
Index ¶
- Constants
- func AffinePointFromMontgomery(d_points unsafe.Pointer, len int) (int, error)
- func Commit(d_out, d_scalars, d_points unsafe.Pointer, count, bucketFactor int) int
- func CommitBatch(d_out, d_scalars, d_points unsafe.Pointer, count, batch_size int) int
- func CommitG2(d_out, d_scalars, d_points unsafe.Pointer, count, bucketFactor int) int
- func CommitG2Batch(d_out, d_scalars, d_points unsafe.Pointer, count, batch_size int) int
- func ConvertUint32ArrToUint64Arr(arr32 [8]uint32) [4]uint64
- func ConvertUint64ArrToUint32Arr(arr64 [4]uint64) [8]uint32
- func EcNtt(values *[]G1ProjectivePoint, isInverse bool, deviceId int) uint64
- func EcNttBatch(values *[]G1ProjectivePoint, isInverse bool, batchSize, deviceId int) uint64
- func Evaluate(scalars_out, scalars, twiddles, coset_powers unsafe.Pointer, ...) int
- func FromMontgomery(d_scalars unsafe.Pointer, len int) (int, error)
- func G2AffinePointFromMontgomery(d_points unsafe.Pointer, len int) (int, error)
- func GenerateTwiddles(d_size int, log_d_size int, inverse bool) (up unsafe.Pointer, err error)
- func GetFixedLimbs(slice *[]uint32) [BASE_SIZE]uint32
- func Interpolate(scalars, twiddles, cosetPowers unsafe.Pointer, size int, isCoset bool) unsafe.Pointer
- func MultiplyMatrix(a []G1ScalarField, b []G1ScalarField, deviceID int)
- func MultiplyScalar(a []G1ScalarField, b []G1ScalarField, deviceID int)
- func MultiplyVec(a []G1ProjectivePoint, b []G1ScalarField, deviceID int)
- func Ntt(scalars *[]G1ScalarField, isInverse bool, deviceId int) uint64
- func NttBatch(scalars *[]G1ScalarField, isInverse bool, batchSize, deviceId int) uint64
- func ReverseScalars(d_scalars unsafe.Pointer, len int) (int, error)
- func TimeTrack(start time.Time)
- func ToMontgomery(d_scalars unsafe.Pointer, len int) (int, error)
- func VecScalarAdd(in1_d, in2_d unsafe.Pointer, size int) int
- func VecScalarMulMod(scalarVec1, scalarVec2 unsafe.Pointer, size int) int
- func VecScalarSub(in1_d, in2_d unsafe.Pointer, size int) int
- type ExtentionField
- type G1BaseField
- type G1PointAffine
- type G1ProjectivePoint
- func (p *G1ProjectivePoint) Eq(pCompare *G1ProjectivePoint) bool
- func (p *G1ProjectivePoint) FromAffine(affine *G1PointAffine) *G1ProjectivePoint
- func (p *G1ProjectivePoint) FromLimbs(x, y, z *[]uint32) *G1ProjectivePoint
- func (p *G1ProjectivePoint) IsOnCurve() bool
- func (p *G1ProjectivePoint) Random() *G1ProjectivePoint
- func (f *G1ProjectivePoint) SetZero() *G1ProjectivePoint
- func (p *G1ProjectivePoint) StripZ() *G1PointAffine
- type G1ScalarField
- type G2Element
- type G2Point
- type G2PointAffine
Constants ¶
View Source
const ( NONE = 0 DIF = 1 DIT = 2 )
View Source
const BASE_SIZE = 8
View Source
const SCALAR_SIZE = 8
Variables ¶
This section is empty.
Functions ¶
func CommitBatch ¶
func CommitG2Batch ¶
func ConvertUint32ArrToUint64Arr ¶
Function to convert [8]uint32 to [4]uint64
func EcNttBatch ¶
func EcNttBatch(values *[]G1ProjectivePoint, isInverse bool, batchSize, deviceId int) uint64
func GenerateTwiddles ¶
func GetFixedLimbs ¶
func Interpolate ¶
func MultiplyMatrix ¶
func MultiplyMatrix(a []G1ScalarField, b []G1ScalarField, deviceID int)
Multiply a matrix by a scalar:
`a` - flattenned matrix; `b` - vector to multiply `a` by;
func MultiplyScalar ¶
func MultiplyScalar(a []G1ScalarField, b []G1ScalarField, deviceID int)
func MultiplyVec ¶
func MultiplyVec(a []G1ProjectivePoint, b []G1ScalarField, deviceID int)
func NttBatch ¶
func NttBatch(scalars *[]G1ScalarField, isInverse bool, batchSize, deviceId int) uint64
func ReverseScalars ¶
Reverses d_scalars in-place
Types ¶
type ExtentionField ¶
type ExtentionField struct {
A0, A1 G2Element
}
type G1BaseField ¶
func (*G1BaseField) FromLimbs ¶
func (f *G1BaseField) FromLimbs(limbs [BASE_SIZE]uint32) *G1BaseField
func (*G1BaseField) Limbs ¶
func (f *G1BaseField) Limbs() [BASE_SIZE]uint32
func (*G1BaseField) SetOne ¶
func (f *G1BaseField) SetOne() *G1BaseField
func (*G1BaseField) SetZero ¶
func (f *G1BaseField) SetZero() *G1BaseField
func (*G1BaseField) ToBytesLe ¶
func (f *G1BaseField) ToBytesLe() []byte
type G1PointAffine ¶
type G1PointAffine struct {
X, Y G1BaseField
}
func (*G1PointAffine) FromLimbs ¶
func (p *G1PointAffine) FromLimbs(X, Y *[]uint32) *G1PointAffine
func (*G1PointAffine) FromProjective ¶
func (p *G1PointAffine) FromProjective(projective *G1ProjectivePoint) *G1PointAffine
func (*G1PointAffine) ToProjective ¶
func (p *G1PointAffine) ToProjective() *G1ProjectivePoint
type G1ProjectivePoint ¶
type G1ProjectivePoint struct {
X, Y, Z G1BaseField
}
func Msm ¶
func Msm(out *G1ProjectivePoint, points []G1PointAffine, scalars []G1ScalarField, device_id int) (*G1ProjectivePoint, error)
func MsmBatch ¶
func MsmBatch(points *[]G1PointAffine, scalars *[]G1ScalarField, batchSize, deviceId int) ([]G1ProjectivePoint, error)
func (*G1ProjectivePoint) Eq ¶
func (p *G1ProjectivePoint) Eq(pCompare *G1ProjectivePoint) bool
func (*G1ProjectivePoint) FromAffine ¶
func (p *G1ProjectivePoint) FromAffine(affine *G1PointAffine) *G1ProjectivePoint
func (*G1ProjectivePoint) FromLimbs ¶
func (p *G1ProjectivePoint) FromLimbs(x, y, z *[]uint32) *G1ProjectivePoint
func (*G1ProjectivePoint) IsOnCurve ¶
func (p *G1ProjectivePoint) IsOnCurve() bool
func (*G1ProjectivePoint) Random ¶
func (p *G1ProjectivePoint) Random() *G1ProjectivePoint
func (*G1ProjectivePoint) SetZero ¶
func (f *G1ProjectivePoint) SetZero() *G1ProjectivePoint
func (*G1ProjectivePoint) StripZ ¶
func (p *G1ProjectivePoint) StripZ() *G1PointAffine
type G1ScalarField ¶
type G1ScalarField struct {
S [SCALAR_SIZE]uint32
}
func (*G1ScalarField) Eq ¶
func (a *G1ScalarField) Eq(b *G1ScalarField) bool
func (*G1ScalarField) Limbs ¶
func (f *G1ScalarField) Limbs() [SCALAR_SIZE]uint32
func (*G1ScalarField) Random ¶
func (p *G1ScalarField) Random() *G1ScalarField
func (*G1ScalarField) SetOne ¶
func (f *G1ScalarField) SetOne() *G1ScalarField
func (*G1ScalarField) SetZero ¶
func (f *G1ScalarField) SetZero() *G1ScalarField
func (*G1ScalarField) ToBytesLe ¶
func (f *G1ScalarField) ToBytesLe() []byte
type G2Point ¶
type G2Point struct {
X, Y, Z ExtentionField
}
func MsmG2 ¶
func MsmG2(out *G2Point, points []G2PointAffine, scalars []G1ScalarField, device_id int) (*G2Point, error)
func MsmG2Batch ¶
func MsmG2Batch(points *[]G2PointAffine, scalars *[]G1ScalarField, batchSize, deviceId int) ([]G2Point, error)
func (*G2Point) FromAffine ¶
func (p *G2Point) FromAffine(affine *G2PointAffine) *G2Point
type G2PointAffine ¶
type G2PointAffine struct {
X, Y ExtentionField
}
func (*G2PointAffine) FromProjective ¶
func (p *G2PointAffine) FromProjective(projective *G2Point) *G2PointAffine
Click to show internal directories.
Click to hide internal directories.