Anoma.Crypto.Encrypt (Anoma v0.34.0)

Summary

Functions

I seal the given message for the publicly known recipient.

Types

box_public()

@type box_public() :: <<_::256>>

box_secret()

@type box_secret() :: <<_::256>>

public()

@type public() :: box_public()

secret()

@type secret() :: box_secret()

Functions

new_keypair()

@spec new_keypair() :: %{public: box_public(), secret: box_secret()}

seal(message, pub)

@spec seal(any(), box_public()) :: binary()

I seal the given message for the publicly known recipient.

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

unseal(cipher, pub, sec)

@spec unseal(binary(), box_public(), box_secret()) ::
  {:ok, any()} | {:error, :failed_verification}