Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
talla
enacl
Commits
66cf2751
Commit
66cf2751
authored
Aug 29, 2015
by
Jesper Louis Andersen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce a scalarmult variant which is safe from arguments swaps.
parent
8c567be6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/enacl.erl
src/enacl.erl
+8
-1
No files found.
src/enacl.erl
View file @
66cf2751
...
...
@@ -67,7 +67,7 @@
%% Curve 25519.
-
export
([
curve25519_scalarmult
/
2
curve25519_scalarmult
/
1
,
curve25519_scalarmult
/
2
]).
%% Ed 25519.
...
...
@@ -689,6 +689,13 @@ onetime_auth_key_size() -> enacl_nif:crypto_onetimeauth_KEYBYTES().
curve25519_scalarmult
(
Secret
,
BasePoint
)
->
enacl_nif
:
crypto_curve25519_scalarmult
(
Secret
,
BasePoint
).
%% @doc curve25519_scalarmult/1 avoids messing up arguments.
%% Takes as input a map `#{ secret := Secret, base_point := BasePoint }' in order to avoid
%% messing up the calling order.
%% @end
curve25519_scalarmult
(
#
{
secret
:
=
Secret
,
base_point
:
=
BasePoint
})
->
curve25519_scalarmult
(
Secret
,
BasePoint
).
%% Ed 25519 Crypto
%% ---------------
%% @doc crypto_sign_ed25519_keypair/0 creates a new Ed 25519 Public/Secret keypair.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment