Documentation ¶
Index ¶
- Constants
- Variables
- func NewKeyPair(n uint16) (privKey *PrivateKey, pubKey *PublicKey, err error)
- func NewKeyPairFromPrivateKey(n uint16, polys [4][]int16) (privKey *PrivateKey, pubKey *PublicKey, err error)
- func Verify(pubkey []int16, message []byte, signature []byte) bool
- func VerifyBytes(inputBytes []byte) bool
- type Falcon
- type PrivateKey
- type PublicKey
- type PublicParameters
Constants ¶
const HeadLen = 1
Bytelength of the signing salt and header
const SaltLen = 40 // {0, 1}^320
const SeedLen = 56
Variables ¶
var ( // ErrInvalidDegree is returned when the degree is not a power of 2 ErrInvalidDegree = errors.New("n is not valid dimension/degree of the cyclotomic ring") // ErrInvalidPolysLenght is returned when the lenght of the polynomials is not equal to each other ErrInvalidPolysLength = errors.New("lenght of polynomials is not equal") )
var LOGN = map[uint16]uint8{
2: 1,
4: 2,
8: 3,
16: 4,
32: 5,
64: 6,
128: 7,
256: 8,
512: 9,
1024: 10,
}
the degree is provided logarithmically as the 'LOGN' parameter: LOGN ranges from 1 to 10, and represents the degree 2^LOGN. use :
LOGN=9 for Falcon-512 LOGN=10 for Falcon-1024
Valid values for LOGN range from 1 to 10 (values 1 to 8 correspond to reduced variants of Falcon that do not provided adequate security and are meant for research purposes only).
The sizes are provided as macros that evaluate to constant expressions, as long as the 'LOGN' parameter is itself a constant expression. Moreover, all sizes are monotonic (for each size category, increasing LOGN cannot result in a shorter length).
var ParamSets = map[uint16]PublicParameters{ 2: { // contains filtered or unexported fields }, 4: { // contains filtered or unexported fields }, 8: { // contains filtered or unexported fields }, 16: { // contains filtered or unexported fields }, 32: { // contains filtered or unexported fields }, 64: { // contains filtered or unexported fields }, 128: { // contains filtered or unexported fields }, 256: { // contains filtered or unexported fields }, 512: { // contains filtered or unexported fields }, 1024: { // contains filtered or unexported fields }, }
Functions ¶
func NewKeyPair ¶
func NewKeyPair(n uint16) (privKey *PrivateKey, pubKey *PublicKey, err error)
NewKeyPair generates a new keypair coresponding to the valid degree n.
func NewKeyPairFromPrivateKey ¶
func NewKeyPairFromPrivateKey(n uint16, polys [4][]int16) (privKey *PrivateKey, pubKey *PublicKey, err error)
func VerifyBytes ¶
Types ¶
type Falcon ¶
type Falcon struct { //ParamSets PrivateKey B0FFT [][][]complex128 TFFT internal.FFTtree // contains filtered or unexported fields }
type PrivateKey ¶
func GeneratePrivateKey ¶
func GeneratePrivateKey(n uint16) (*PrivateKey, error)
GeneratePrivateKey generates a new private key.
func GetPrivateKey ¶
func GetPrivateKey(n uint16, f, g, F, G []int16) (*PrivateKey, error)
GetPrivateKey returns a private key from the given polynomials.
func NewPrivateKey ¶
func NewPrivateKey() *PrivateKey
NewPrivateKey returns a new private key struct with empty fields.
func (*PrivateKey) GetPublicKey ¶
func (privKey *PrivateKey) GetPublicKey() *PublicKey
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKey ¶
func NewPublicKey() *PublicKey
type PublicParameters ¶
type PublicParameters struct {
// contains filtered or unexported fields
}
Parameter sets for Falcon: - n is the dimension/degree of the cyclotomic ring - sigma is the std. dev. of signatures (Gaussians over a lattice) - sigmin is a lower bounds on the std. dev. of each Gaussian over Z - sigbound is the upper bound on ||s0||^2 + ||s1||^2 - sigbytelen is the bytelength of signatures
func GetParamSet ¶
func GetParamSet(n uint16) PublicParameters