View Source Eddy.Sig (Eddy v1.0.0)
Module for working with signatures.
Sig structs can be encoded to and from binary data, using any
encoding.
Link to this section Summary
Link to this section Types
@type t() :: %Eddy.Sig{r: Eddy.Point.t(), s: term()}
Signature
An EdDSA signature is a pair of values (r, s) computed from the private key and a hash of the message being signed.
Link to this section Functions
@spec from_bin(binary(), Eddy.encoding() | nil) :: {:ok, t()} | {:error, term()}
Converts the given binary data to a Signature
struct, optionally with the specified encoding.
Returns the result in an :ok / :error tuple pair.
@spec to_bin(t(), Eddy.encoding() | nil) :: binary()
Converts the given Signature struct
to a binary, optionally with the specified encoding.