Anoma.Crypto.Symmetric (Anoma v0.25.0)

Summary

Types

t()

I represent the symmetric types available to the system

Functions

I encrypt data given any known schema and a message.

I encrypt data given any known schema and a message.

Types

@type t() :: xchacha()

I represent the symmetric types available to the system

@type xchacha() :: {:xchacha, xchacha_key(), xchacha_nonce()}
Link to this type

xchacha_key()

@type xchacha_key() :: <<_::256>>
Link to this type

xchacha_nonce()

@type xchacha_nonce() :: <<_::192>>

Functions

Link to this function

decrypt(binary, sym)

@spec decrypt(binary(), t()) :: term() | {:error, any()}
Link to this function

decrypt_raw(binary, arg)

@spec decrypt_raw(binary(), t()) :: binary() | {:error, any()}
Link to this function

encrypt(message, sym)

@spec encrypt(any(), t()) :: binary()

I encrypt data given any known schema and a message.

The message will be turned into binary via :erlang.term_to_binary, so please do not turn it to binary before hand.

Link to this function

encrypt_raw(binary, arg)

@spec encrypt_raw(binary(), t()) :: binary()

I encrypt data given any known schema and a message.

I am raw in that I do not serialize the data, Only use me if you know what you are doing.

Link to this function

random_xchacha()

@spec random_xchacha() :: xchacha()
Link to this function

random_xchacha_key()

@spec random_xchacha_key() :: xchacha_key()
Link to this function

random_xchacha_nonce()

@spec random_xchacha_nonce() :: xchacha_nonce()