[][src]Module dsf_core::crypto

Crypto module provides cryptographic interfaces and implementations for DSF

Constants

SK_META

Traits

Decrypter

Decrypter trait, used to decrypt data for a given service

Encrypter

Encrypter trait, used to encrypt data for a given service

Signer

Signer trait, used for generating page signatures

Validator

Validator trait, used for checking page signatures. This should return Ok(true) for success, Ok(false) for an unknown ID:Key pair or an error on a signature mismatch

Functions

hash

Hash performs a hash function over the provided slice

new_pk

new_pk creates a new public/private key pair

new_sk

new_sk creates a new secret key for symmetric encryption and decryption

pk_sign

pk_sign generates a signature for the provided slice of data

pk_validate

pk_validate checks a provided signature against a public key and slice of data

sk_decrypt
sk_decrypt2

sk_decrypt2 decrypts the data in-place in the provided buffer, this will strip NONCE and TAG information, and returns the data length (decrypted data w/out overheads)

sk_encrypt
sk_encrypt2

sk_encrypt2 encrypts data_len bytes of the data in-place in the provided buffer, appends NONCE and TAG information to the buffer, and returns the complete length (encrypted data + overheads)