Cryptography

interface Cryptography(source)

Provide the specified algorithm implementations.

Functions

Link copied to clipboard
abstract fun agree(privateKey: PrivateKey, publicKey: PublicKey): SharedSecret

X25519 from RFC 7748

Link copied to clipboard
abstract fun decrypt(key: CipherKey, nonce: Nonce, associatedData: AssociatedData, ciphertext: Ciphertext): Plaintext?

ChaCha20-Poly1305 decryption from RFC 8439

Link copied to clipboard
abstract fun encrypt(key: CipherKey, nonce: Nonce, associatedData: AssociatedData, plaintext: Plaintext): Ciphertext

ChaCha20-Poly1305 encryption from RFC 8439

Link copied to clipboard
abstract fun hash(data: Data): Digest

SHA-256 from FIPS 180-4