jose_xchacha20_poly1305 behaviour (JOSE v1.11.12)
View SourceSummary
Types
Callbacks
-callback authenticate(Message, Key, Nonce) -> MAC when Message :: message(), Key :: xchacha20_key(), Nonce :: xchacha20_nonce(), MAC :: poly1305_mac().
-callback decrypt(CipherText, CipherTag, AAD, IV, Key) -> PlainText | error when CipherText :: cipher_text(), CipherTag :: poly1305_mac(), AAD :: additional_authenticated_data(), IV :: xchacha20_nonce(), Key :: xchacha20_key(), PlainText :: binary().
-callback encrypt(PlainText, AAD, IV, Key) -> {CipherText, CipherTag} when PlainText :: plain_text(), AAD :: additional_authenticated_data(), IV :: xchacha20_nonce(), Key :: xchacha20_key(), CipherText :: cipher_text(), CipherTag :: poly1305_mac().
-callback verify(MAC, Message, Key, Nonce) -> boolean() when MAC :: poly1305_mac(), Message :: message(), Key :: xchacha20_key(), Nonce :: xchacha20_nonce().