Documentation
¶
Overview ¶
Package bcns implements a key exchange based on the Ring Learning With Errors Problem. It is based heavily on the Public Domain implementation by Joppe W. Bos, Craig Costello, Michael Naehrig, and Douglas Stebila.
For more information see: http://eprint.iacr.org/2014/599
Index ¶
Constants ¶
const ( // PublicKeySize is the length of a Ring-LWE public key in bytes. PublicKeySize = 4096 // PrivateKeySize is the length of a Ring-LWE private key in bytes. PrivateKeySize = 4096 // RecDataSize is the length of the reconcilliation data in bytes. RecDataSize = 128 SharedSecretSize = 128 )
Variables ¶
var ( // ErrInvalidPublicKeySize is the error returned when a public key blob // is an invalid length. ErrInvalidPublicKeySize = errors.New("rlwe: invalid public key length") // ErrInvalidRecDataSize is the error returned when a reconcilliation // data blob is an invalid length. ErrInvalidRecDataSize = errors.New("rlwe: invalid reconcilliation data length") )
Functions ¶
func GenerateKeyPair ¶
func GenerateKeyPair(r io.Reader) (*PrivateKey, *PublicKey, error)
GenerateKeyPair returns a private/public key pair. The private key is generated using the given reader which must return random data.
func KeyExchangeAlice ¶
func KeyExchangeAlice(bobPk *PublicKey, aliceSk *PrivateKey, rec *RecData) []byte
KeyExchangeAlice is the Initiator side of the Ring-LWE key exchange.
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey is a Ring-LWE private key.
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey is a Ring-LWE public key.
type RecData ¶
type RecData struct {
// contains filtered or unexported fields
}
RecData is the Ring-LWE reconcilliation data.
func KeyExchangeBob ¶
KeyExchangeBob is the Responder side of the Ring-LWE key exchange. The reconciliation data and shared secret are generated using the given reader which must return random data.