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>>.
-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>>.
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()}.
-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()}.
-callback x25519_secret_to_public(SecretKey :: x25519_secret_key()) -> PublicKey :: x25519_public_key().
Functions
-spec ed25519_sign(message(), eddsa_secret_key()) -> signature().
-spec ed25519_verify(maybe_invalid_signature(), message(), eddsa_public_key()) -> boolean().
-spec ed25519ctx_sign(message(), eddsa_secret_key(), context()) -> signature().
-spec ed25519ctx_verify(maybe_invalid_signature(), message(), eddsa_public_key(), context()) -> boolean().
-spec ed25519ph_sign(message(), eddsa_secret_key()) -> signature().
-spec ed25519ph_sign(message(), eddsa_secret_key(), context()) -> signature().
-spec ed25519ph_verify(maybe_invalid_signature(), message(), eddsa_public_key()) -> boolean().
-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()}.
-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()}.
-spec x25519_secret_to_public(x25519_secret_key()) -> x25519_public_key().