diff options
author | Hans Nilsson <[email protected]> | 2018-08-02 15:08:21 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2018-08-23 12:45:26 +0200 |
commit | 41f75ef413c7ce53aefcfea080e22217d607daf1 (patch) | |
tree | 9c60973742496559dd2862ddbd61db04c39450bf | |
parent | b477eba47bda21a034c7610fdb41e6fd005b83df (diff) | |
download | otp-41f75ef413c7ce53aefcfea080e22217d607daf1.tar.gz otp-41f75ef413c7ce53aefcfea080e22217d607daf1.tar.bz2 otp-41f75ef413c7ce53aefcfea080e22217d607daf1.zip |
crypto: -spec
-rw-r--r-- | lib/crypto/src/crypto.erl | 7 |
1 files changed, 7 insertions, 0 deletions
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. |