scalar128

package
v0.0.0-...-1f23a7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package scalar128 implements the fast generation of random 128-bit scalars for the purpose of batch verification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixRawRangeVartime

func FixRawRangeVartime(rawScalar *[scalar.ScalarSize]byte)

FixRawRangeVartime adjusts the raw scalar to be in the correct range, in variable-time.

From the paper:

Of course, it is also safe to simply generate z_i as a uniform
random b-bit integer, disregarding the negligible chance that
z_i == 0; but this requires minor technical modifications to
the security guarantees stated below, so we prefer to require
z != 0.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is a random 128-bit scalar generator.

func NewGenerator

func NewGenerator(rand io.Reader) (*Generator, error)

NewGenerator constructs a new random scalar generator, using entropy from the provided source.

func (*Generator) SetScalarVartime

func (gen *Generator) SetScalarVartime(s *scalar.Scalar) error

SetScalarVartime sets the scalar to a random 128-bit scalar, in variable-time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL