Module fcp_cryptoauth::cryptography [] [src]

Modules

crypto_box

crypto_box_curve25519xsalsa20poly1305 , a particular combination of Curve25519, Salsa20, and Poly1305 specified in Cryptography in NaCl.

scalarmult

crypto_scalarmult_curve25519 specified in Cryptography in NaCl, Sections 2, 3, and 4. This function is conjectured to be strong. For background see Bernstein, "Curve25519: new Diffie-Hellman speed records," Lecture Notes in Computer Science 3958 (2006), 207–228, http://cr.yp.to/papers.html#curve25519.

sha256

SHA-256.

Structs

PrecomputedKey

Applications that send several messages to the same receiver can gain speed by splitting seal() into two steps, precompute() and seal_precomputed(). Similarly, applications that receive several messages from the same sender can gain speed by splitting open() into two steps, precompute() and open_precomputed().

PublicKey

PublicKey for asymmetric authenticated encryption

SecretKey

SecretKey for asymmetric authenticated encryption

Constants

PASSWORD_DIGEST_BYTES

Number of bytes in a password digest.

Functions

gen_keypair

Randomly generates a secret key and a corresponding public key.

open_packet_end

unseals the concatenation of fields msg_auth_code, sender_encrypted_temp_pk, and encrypted_data of a packet. If authentication was successful, returns the sender's temp_pk and the data, unencrypted.

shared_secret_from_keys

AuthNone Hello packets: my_sk and their_pk are permanent keys Key packets: my_sk is permanent, their_pk is temporary data packets: my_sk and their_pk are temporary keys

shared_secret_from_password

Implements the fancy password hashing used by the FCP, decribed in paragraph 4 of https://github.com/fc00/spec/blob/10b349ab11/cryptoauth.md#hello-repeathello