Rename constant to be in line with libsodium

This commit is contained in:
Jesper Louis Andersen 2020-02-05 13:34:27 +01:00
parent 41045fed85
commit dea9ce62ed
3 changed files with 14 additions and 17 deletions

View File

@ -9,8 +9,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Go through all calls and make them return streamlined exceptions if applicable. - Go through all calls and make them return streamlined exceptions if applicable.
Pretty large change, but OTOH, this ought to happen before a 1.0 release as well. Pretty large change, but OTOH, this ought to happen before a 1.0 release as well.
- kx
- Rename the key sizes so they follow libsodium.
- secret - secret
- sign - sign
@ -19,7 +17,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Multi-part generic hash - Multi-part generic hash
- pwhash - pwhash
- Extend with limit for ops and memory as well. - Extend with limit for ops and memory as well.
- kx
## [Unreleased] ## [Unreleased]
@ -33,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
carefully as we have made changes to these functions. TL;DR: look for carefully as we have made changes to these functions. TL;DR: look for
`aead_chacha20poly1305_ietf_*` but note it is *not* just a simple substitution `aead_chacha20poly1305_ietf_*` but note it is *not* just a simple substitution
into your code. into your code.
- The `kx` constants have been renamed to follow libsodium one-to-one.
### Removed ### Removed
- The functions of the form `aead_chacha20poly1305_*` were removed. They implement - The functions of the form `aead_chacha20poly1305_*` were removed. They implement

View File

@ -171,9 +171,9 @@
kx_keypair/0, kx_keypair/0,
kx_client_session_keys/3, kx_client_session_keys/3,
kx_server_session_keys/3, kx_server_session_keys/3,
kx_public_key_size/0, kx_PUBLICKEYBYTES/0,
kx_secret_key_size/0, kx_SECRETKEYBYTES/0,
kx_session_key_size/0 kx_SESSIONKEYBYTES/0
]). ]).
%% Internal verification of the system %% Internal verification of the system
@ -1132,22 +1132,22 @@ kx_server_session_keys(ServerPk, ServerSk, ClientPk) ->
{Rx, Tx} = enacl_nif:crypto_kx_server_session_keys(ServerPk, ServerSk, ClientPk), {Rx, Tx} = enacl_nif:crypto_kx_server_session_keys(ServerPk, ServerSk, ClientPk),
#{ server_rx => Rx, server_tx => Tx}. #{ server_rx => Rx, server_tx => Tx}.
%% @doc kx_session_key_size/0 returns the number of bytes of the generated during key exchange session key. %% @doc kx_SESSIONKEYBYTES/0 returns the number of bytes of the generated during key exchange session key.
%% @end %% @end
-spec kx_session_key_size() -> pos_integer(). -spec kx_SESSIONKEYBYTES() -> pos_integer().
kx_session_key_size() -> kx_SESSIONKEYBYTES() ->
enacl_nif:crypto_kx_SESSIONKEYBYTES(). enacl_nif:crypto_kx_SESSIONKEYBYTES().
%% @doc kx_public_key_size/0 returns the number of bytes of the public key used in key exchange. %% @doc kx_PUBLICKEYBYTES/0 returns the number of bytes of the public key used in key exchange.
%% @end %% @end
-spec kx_public_key_size() -> pos_integer(). -spec kx_PUBLICKEYBYTES() -> pos_integer().
kx_public_key_size() -> kx_PUBLICKEYBYTES() ->
enacl_nif:crypto_kx_PUBLICKEYBYTES(). enacl_nif:crypto_kx_PUBLICKEYBYTES().
%% @doc kx_secret_key_size/0 returns the number of bytes of the secret key used in key exchange. %% @doc kx_SECRETKEYBYTES/0 returns the number of bytes of the secret key used in key exchange.
%% @end %% @end
-spec kx_secret_key_size() -> pos_integer(). -spec kx_SECRETKEYBYTES() -> pos_integer().
kx_secret_key_size() -> kx_SECRETKEYBYTES() ->
enacl_nif:crypto_kx_SECRETKEYBYTES(). enacl_nif:crypto_kx_SECRETKEYBYTES().
%% AEAD ChaCha20 Poly1305 %% AEAD ChaCha20 Poly1305

View File

@ -44,8 +44,7 @@ groups() ->
aead_chacha20poly1305_ietf, aead_chacha20poly1305_ietf,
pwhash, pwhash,
sign, sign,
kx, kx]},
randombytes]},
[Neg, Pos]. [Neg, Pos].