View Source jose_curve25519 behaviour (JOSE v1.11.10)

Summary

Types

-type context() :: binary().
-type eddsa_public_key() :: <<_:256>>.
-type eddsa_secret_key() :: <<_:512>>.
-type eddsa_seed() :: <<_:256>>.
Link to this type

maybe_invalid_signature/0

View Source
-type maybe_invalid_signature() :: signature() | binary().
-type message() :: binary().
-type signature() :: <<_:512>>.
-type x25519_public_key() :: <<_:256>>.
-type x25519_secret_key() :: <<_:256>>.
-type x25519_seed() :: <<_:256>>.
Link to this type

x25519_shared_secret/0

View Source
-type x25519_shared_secret() :: <<_:256>>.

Callbacks

-callback ed25519_sign(Message :: message(), SecretKey :: eddsa_secret_key()) -> Signature :: signature().
-callback ed25519_verify(Signature :: maybe_invalid_signature(),
               Message :: message(),
               PublicKey :: eddsa_public_key()) ->
                  boolean().
-callback ed25519ctx_sign(Message :: message(), SecretKey :: eddsa_secret_key(), Context :: context()) ->
                   Signature :: signature().
-callback ed25519ctx_verify(Signature :: maybe_invalid_signature(),
                  Message :: message(),
                  PublicKey :: eddsa_public_key(),
                  Context :: context()) ->
                     boolean().
-callback ed25519ph_sign(Message :: message(), SecretKey :: eddsa_secret_key()) -> Signature :: signature().
-callback ed25519ph_sign(Message :: message(), SecretKey :: eddsa_secret_key(), Context :: context()) ->
                  Signature :: signature().
-callback ed25519ph_verify(Signature :: maybe_invalid_signature(),
                 Message :: message(),
                 PublicKey :: eddsa_public_key()) ->
                    boolean().
-callback ed25519ph_verify(Signature :: maybe_invalid_signature(),
                 Message :: message(),
                 PublicKey :: eddsa_public_key(),
                 Context :: context()) ->
                    boolean().
-callback eddsa_keypair() -> {PublicKey :: eddsa_public_key(), SecretKey :: eddsa_secret_key()}.
-callback eddsa_keypair(Seed :: eddsa_seed()) ->
                 {PublicKey :: eddsa_public_key(), SecretKey :: eddsa_secret_key()}.
Link to this callback

eddsa_secret_to_public/1

View Source
-callback eddsa_secret_to_public(SecretKey :: eddsa_secret_key()) -> PublicKey :: eddsa_public_key().
-callback x25519_keypair() -> {PublicKey :: x25519_public_key(), SecretKey :: x25519_secret_key()}.
-callback x25519_keypair(Seed :: x25519_seed()) ->
                  {PublicKey :: x25519_public_key(), SecretKey :: x25519_secret_key()}.
Link to this callback

x25519_secret_to_public/1

View Source
-callback x25519_secret_to_public(SecretKey :: x25519_secret_key()) -> PublicKey :: x25519_public_key().
-callback x25519_shared_secret(MySecretKey :: x25519_secret_key(), YourPublicKey :: x25519_public_key()) ->
                        SharedSecret :: x25519_shared_secret().

Functions

Link to this function

ed25519_sign(Message, SecretKey)

View Source
-spec ed25519_sign(message(), eddsa_secret_key()) -> signature().
Link to this function

ed25519_verify(Signature, Message, PublicKey)

View Source
-spec ed25519_verify(maybe_invalid_signature(), message(), eddsa_public_key()) -> boolean().
Link to this function

ed25519ctx_sign(Message, SecretKey, Context)

View Source
-spec ed25519ctx_sign(message(), eddsa_secret_key(), context()) -> signature().
Link to this function

ed25519ctx_verify(Signature, Message, PublicKey, Context)

View Source
-spec ed25519ctx_verify(maybe_invalid_signature(), message(), eddsa_public_key(), context()) ->
                     boolean().
Link to this function

ed25519ph_sign(Message, SecretKey)

View Source
-spec ed25519ph_sign(message(), eddsa_secret_key()) -> signature().
Link to this function

ed25519ph_sign(Message, SecretKey, Context)

View Source
-spec ed25519ph_sign(message(), eddsa_secret_key(), context()) -> signature().
Link to this function

ed25519ph_verify(Signature, Message, PublicKey)

View Source
-spec ed25519ph_verify(maybe_invalid_signature(), message(), eddsa_public_key()) -> boolean().
Link to this function

ed25519ph_verify(Signature, Message, PublicKey, Context)

View Source
-spec ed25519ph_verify(maybe_invalid_signature(), message(), eddsa_public_key(), context()) -> boolean().
-spec eddsa_keypair() -> {eddsa_public_key(), eddsa_secret_key()}.
-spec eddsa_keypair(eddsa_seed()) -> {eddsa_public_key(), eddsa_secret_key()}.
Link to this function

eddsa_secret_to_public(SecretKey)

View Source
-spec eddsa_secret_to_public(eddsa_secret_key()) -> eddsa_public_key().
-spec x25519_keypair() -> {x25519_public_key(), x25519_secret_key()}.
-spec x25519_keypair(x25519_seed()) -> {x25519_public_key(), x25519_secret_key()}.
Link to this function

x25519_secret_to_public(SecretKey)

View Source
-spec x25519_secret_to_public(x25519_secret_key()) -> x25519_public_key().
Link to this function

x25519_shared_secret(MySecretKey, YourPublicKey)

View Source
-spec x25519_shared_secret(MySecretKey :: x25519_secret_key(), YourPublicKey :: x25519_public_key()) ->
                        x25519_shared_secret().