Documentation ¶
Overview ¶
Package crypto contains the cryptographic routines for CONIKS: hashing, cryptographic commitments, digital signatures, VRF, and random number generation.
These cryptographic routines are used to:
- hash arbitrary data (Digest) using SHA3 (SHAKE128),
- create a cryptographic commit to arbitrary data,
- generate a random slice of bytes,
- sign data and verify signatures using Ed25519,
- apply a VRF to data and verify the VRF proof.
Index ¶
Constants ¶
const ( // HashSizeByte is the size of the hash output in bytes. HashSizeByte = 32 // HashID identifies the used hash as a string. HashID = "SHAKE128" )
Variables ¶
This section is empty.
Functions ¶
func MakeRand ¶
MakeRand returns a random slice of bytes. It returns an error if there was a problem while generating the random slice. It is different from the 'standard' random byte generation as it hashes its output before returning it; by hashing the system's PRNG output before it is send over the wire, we aim to make the random output less predictable (even if the system's PRNG isn't as unpredictable as desired). See https://trac.torproject.org/projects/tor/ticket/17694
func NewStaticTestSigningKey ¶
func NewStaticTestSigningKey() sign.PrivateKey
NewStaticTestSigningKey returns a static private signing key for _tests_.
func NewStaticTestVRFKey ¶
func NewStaticTestVRFKey() vrf.PrivateKey
NewStaticTestVRFKey returns a static VRF private key for _tests_.
Types ¶
type Commit ¶
type Commit struct { // Salt is a cryptographic salt which will be hashed in addition // to the value. Salt []byte // Value is the actual value to commit to. Value []byte }
Commit can be used to create a cryptographic commit to some value (use NewCommit() for this purpose.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
ed25519/edwards25519
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
|
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519. |
Package sign implements a digital signature scheme using the Edwards form of Curve25519.
|
Package sign implements a digital signature scheme using the Edwards form of Curve25519. |
Package vrf implements a verifiable random function using the Edwards form of Curve25519, SHA3 and the Elligator map.
|
Package vrf implements a verifiable random function using the Edwards form of Curve25519, SHA3 and the Elligator map. |