Documentation ¶
Overview ¶
Package curve4q implements Diffie-Hellman operations using the FourQ curve at the 128-bit security level.
References:
Index ¶
Examples ¶
Constants ¶
View Source
const Size = 32
Size is the size in bytes of keys.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Key ¶
Key represents a public or private key of FourQ.
Example ¶
var AliceSecret, BobSecret, AlicePublic, BobPublic, AliceShared, BobShared Key // Generating Alice's secret and public keys _, _ = io.ReadFull(rand.Reader, AliceSecret[:]) KeyGen(&AlicePublic, &AliceSecret) // Generating Bob's secret and public keys _, _ = io.ReadFull(rand.Reader, BobSecret[:]) KeyGen(&BobPublic, &BobSecret) // Deriving Alice's shared key Shared(&AliceShared, &AliceSecret, &BobPublic) // Deriving Bob's shared key Shared(&BobShared, &BobSecret, &AlicePublic) fmt.Println(AliceShared == BobShared)
Output: true
Click to show internal directories.
Click to hide internal directories.