kyber: go.dedis.ch/kyber/group/nist Index | Files

package nist

import "go.dedis.ch/kyber/group/nist"

Package nist implements cryptographic groups and ciphersuites based on the NIST standards, using Go's built-in crypto library.

Index

Package Files

curve.go doc.go p256.go qrsuite.go residue.go suite.go

type QrSuite Uses

type QrSuite struct {
    ResidueGroup
}

QrSuite is a quadratic residue suite

func NewBlakeSHA256QR512 Uses

func NewBlakeSHA256QR512() *QrSuite

NewBlakeSHA256QR512 returns a cipher suite based on package go.dedis.ch/kyber/v4/xof/blake2xb, SHA-256, and a residue group of quadratic residues modulo a 512-bit prime.

This group size should be used only for testing and experimentation. 512-bit DSA-style groups are no longer considered secure.

func (QrSuite) Hash Uses

func (s QrSuite) Hash() hash.Hash

Hash returns the instance associated with the suite

func (*QrSuite) New Uses

func (s *QrSuite) New(t reflect.Type) interface{}

New implements the kyber.encoding interface

func (QrSuite) RandomStream Uses

func (s QrSuite) RandomStream() cipher.Stream

RandomStream returns a cipher.Stream that returns a key stream from crypto/rand.

func (*QrSuite) Read Uses

func (s *QrSuite) Read(r io.Reader, objs ...interface{}) error

func (*QrSuite) Write Uses

func (s *QrSuite) Write(w io.Writer, objs ...interface{}) error

func (QrSuite) XOF Uses

func (s QrSuite) XOF(key []byte) kyber.XOF

XOF creates the XOF associated with the suite

type ResidueGroup Uses

type ResidueGroup struct {
    dsa.Parameters
    R   *big.Int
}

A ResidueGroup represents a DSA-style modular integer arithmetic group, defined by two primes P and Q and an integer R, such that P = Q*R+1. Points in a ResidueGroup are R-residues modulo P, and Scalars are integer exponents modulo the group order Q.

In traditional DSA groups P is typically much larger than Q, and hence use a large multiple R. This is done to minimize the computational cost of modular exponentiation while maximizing security against known classes of attacks: P must be on the order of thousands of bits long while for security Q is believed to require only hundreds of bits. Such computation-optimized groups are suitable for Diffie-Hellman agreement, DSA or ElGamal signatures, etc., which depend on Point.Mul() and homomorphic properties.

However, residue groups with large R are less suitable for public-key cryptographic techniques that require choosing Points pseudo-randomly or to contain embedded data, as required by ElGamal encryption for example. For such purposes quadratic residue groups are more suitable - representing the special case where R=2 and hence P=2Q+1. As a result, the Point.Pick() method should be expected to work efficiently ONLY on quadratic residue groups in which R=2.

func (*ResidueGroup) Order Uses

func (g *ResidueGroup) Order() *big.Int

Order returns the order of this Residue group, namely the prime Q.

func (*ResidueGroup) Point Uses

func (g *ResidueGroup) Point() kyber.Point

Point creates a Point associated with this Residue group, with an initial value of nil.

func (*ResidueGroup) PointLen Uses

func (g *ResidueGroup) PointLen() int

PointLen returns the number of bytes in the encoding of a Point for this Residue group.

func (*ResidueGroup) QuadraticResidueGroup Uses

func (g *ResidueGroup) QuadraticResidueGroup(bitlen uint, rand cipher.Stream)

QuadraticResidueGroup initializes Residue group parameters for a quadratic residue group, by picking primes P and Q such that P=2Q+1 and the smallest valid generator G for this group.

func (*ResidueGroup) Scalar Uses

func (g *ResidueGroup) Scalar() kyber.Scalar

Scalar creates a Scalar associated with this Residue group, with an initial value of nil.

func (*ResidueGroup) ScalarLen Uses

func (g *ResidueGroup) ScalarLen() int

ScalarLen returns the number of bytes in the encoding of a Scalar for this Residue group.

func (*ResidueGroup) SetParams Uses

func (g *ResidueGroup) SetParams(P, Q, R, G *big.Int)

SetParams explicitly initializes a ResidueGroup with given parameters.

func (*ResidueGroup) String Uses

func (g *ResidueGroup) String() string

func (*ResidueGroup) Valid Uses

func (g *ResidueGroup) Valid() bool

Valid validates the parameters for a Residue group, checking that P and Q are prime, P=Q*R+1, and that G is a valid generator for this group.

type Suite128 Uses

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

Suite128 is the suite for P256 curve

func NewBlakeSHA256P256 Uses

func NewBlakeSHA256P256() *Suite128

NewBlakeSHA256P256 returns a cipher suite based on package go.dedis.ch/kyber/v4/xof/blake2xb, SHA-256, and the NIST P-256 elliptic curve. It returns random streams from Go's crypto/rand.

The scalars created by this group implement kyber.Scalar's SetBytes method, interpreting the bytes as a big-endian integer, so as to be compatible with the Go standard library's big.Int type.

func (*Suite128) Hash Uses

func (s *Suite128) Hash() hash.Hash

Hash returns the instance associated with the suite

func (*Suite128) Init Uses

func (curve *Suite128) Init() curve

Init initializes standard Curve instances

func (*Suite128) New Uses

func (s *Suite128) New(t reflect.Type) interface{}

New implements the kyber.encoding interface

func (*Suite128) RandomStream Uses

func (s *Suite128) RandomStream() cipher.Stream

RandomStream returns a cipher.Stream that returns a key stream from crypto/rand.

func (*Suite128) Read Uses

func (s *Suite128) Read(r io.Reader, objs ...interface{}) error

func (*Suite128) String Uses

func (curve *Suite128) String() string

func (*Suite128) Write Uses

func (s *Suite128) Write(w io.Writer, objs ...interface{}) error

func (*Suite128) XOF Uses

func (s *Suite128) XOF(key []byte) kyber.XOF

XOF creates the XOF associated with the suite

Package nist imports 16 packages (graph). Updated 2019-10-19. Refresh now. Tools for package owners.