From 41f75ef413c7ce53aefcfea080e22217d607daf1 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Thu, 2 Aug 2018 15:08:21 +0200 Subject: crypto: -spec --- lib/crypto/src/crypto.erl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index 443e7fc12a..f6a785303b 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -195,6 +195,8 @@ cmac(Type, Key, Data) -> cmac(Type, Key, Data, MacSize) -> erlang:binary_part(cmac(Type, Key, Data), 0, MacSize). +-spec poly1305(iodata(), iodata()) -> binary(). + poly1305(Key, Data) -> poly1305_nif(Key, Data). @@ -1167,6 +1169,11 @@ rc4_encrypt_with_state(_State, _Data) -> ?nif_stub. %% %% CHACHA20 - stream cipher %% +-type chacha20_state() :: term(). +-spec chacha20_stream_init(iodata(), binary()) -> chacha20_state(). +-spec chacha20_stream_encrypt(chacha20_state(), binary()) -> {chacha20_state(), binary()}. +-spec chacha20_stream_decrypt(chacha20_state(), binary()) -> {chacha20_state(), binary()}. + chacha20_stream_init(_Key, _IVec) -> ?nif_stub. chacha20_stream_encrypt(_State, _Data) -> ?nif_stub. chacha20_stream_decrypt(_State, _Data) -> ?nif_stub. -- cgit v1.2.3