View Source K256.Schnorr (k256 v0.0.7)

Link to this section Summary

Functions

Creates an returns a signature of the given message given a signing key

Generates a random signing key

Validates the signature of message given a signature and a verifying key

Validates a message digest given a signature and a verifying key

Creates a verifying key given a signing key

Link to this section Types

@type errors() ::
  :signing_key_decoding_failed
  | :verifying_key_decoding_failed
  | :signature_decoding_failed
  | :invalid_signature
@type signature() :: binary()
@type signing_key() :: binary()
@type verifying_key() :: binary()

Link to this section Functions

Link to this function

create_signature(message, signing_key)

View Source
@spec create_signature(
  message :: binary(),
  signing_key :: signing_key()
) :: {:ok, signature()} | {:error, :signing_key_decoding_failed}

Creates an returns a signature of the given message given a signing key

Link to this function

generate_random_signing_key()

View Source
@spec generate_random_signing_key() :: signing_key()

Generates a random signing key

Link to this function

verify_message(message, signature, verifying_key)

View Source
@spec verify_message(
  message :: binary(),
  signature :: signature(),
  verifying_key :: verifying_key()
) ::
  :ok
  | {:error, :invalid_signature}
  | {:error, :signature_decoding_failed}
  | {:error, :verifying_key_decoding_failed}

Validates the signature of message given a signature and a verifying key

Link to this function

verify_message_digest(message_digest, signature, verifying_key)

View Source
@spec verify_message_digest(
  message_digest :: binary(),
  signature :: signature(),
  verifying_key :: verifying_key()
) ::
  :ok
  | {:error, :message_digest_invalid}
  | {:error, :invalid_signature}
  | {:error, :signature_decoding_failed}
  | {:error, :verifying_key_decoding_failed}

Validates a message digest given a signature and a verifying key

Link to this function

verifying_key_from_signing_key(signing_key)

View Source
@spec verifying_key_from_signing_key(signing_key :: signing_key()) ::
  {:ok, verifying_key()} | {:error, :signing_key_decoding_failed}

Creates a verifying key given a signing key