Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nettle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Nettle
nettle
Commits
b18472f8
Commit
b18472f8
authored
Apr 25, 2016
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update curve25519_mul, to align with RFC 7748.
parent
dbd02e30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
ChangeLog
ChangeLog
+5
-0
curve25519-mul.c
curve25519-mul.c
+4
-0
No files found.
ChangeLog
View file @
b18472f8
2016-04-25 Niels Möller <nisse@lysator.liu.se>
* curve25519-mul.c (curve25519_mul): Ignore top bit of the input x
coordinate, as erquired by RFC 7748.
2016-03-15 Niels Möller <nisse@lysator.liu.se>
* twofish.c (gf_multiply): Change return value to uint32_t, to
...
...
curve25519-mul.c
View file @
b18472f8
...
...
@@ -72,7 +72,11 @@ curve25519_mul (uint8_t *q, const uint8_t *n, const uint8_t *p)
itch
=
ecc
->
p
.
size
*
12
;
scratch
=
gmp_alloc_limbs
(
itch
);
/* Note that 255 % GMP_NUMB_BITS == 0 isn't supported, so x1 always
holds at least 256 bits. */
mpn_set_base256_le
(
x1
,
ecc
->
p
.
size
,
p
,
CURVE25519_SIZE
);
/* Clear bit 255, as required by RFC 7748. */
x1
[
255
/
GMP_NUMB_BITS
]
&=
~
((
mp_limb_t
)
1
<<
(
255
%
GMP_NUMB_BITS
));
/* Initialize, x2 = x1, z2 = 1 */
mpn_copyi
(
x2
,
x1
,
ecc
->
p
.
size
);
...
...
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