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
0276b45a
Commit
0276b45a
authored
Aug 28, 2014
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ecc_25519_modq: Access q via the ecc struct.
parent
1e14955a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ChangeLog
ChangeLog
+2
-0
ecc-25519.c
ecc-25519.c
+3
-5
No files found.
ChangeLog
View file @
0276b45a
2014-08-28 Niels Möller <nisse@lysator.liu.se>
* ecc-25519.c (ecc_25519_modq): Access q via the ecc struct.
* ecc-eh-to-a.c (ecc_eh_to_a): Analogous change as for ecc_j_to_a.
The modulo q case (op == 2) is hardcoded for curve25519.
...
...
ecc-25519.c
View file @
0276b45a
...
...
@@ -86,20 +86,18 @@ ecc_25519_modq (const struct ecc_curve *ecc, mp_limb_t *rp)
/* n is the offset where we add in the next term */
for
(
n
=
ECC_LIMB_SIZE
;
n
--
>
0
;)
{
mp_limb_t
cy
;
cy
=
mpn_submul_1
(
rp
+
n
,
ecc
->
Bmodq_shifted
,
ECC_LIMB_SIZE
,
rp
[
n
+
ECC_LIMB_SIZE
]);
/* Top limb of mBmodq_shifted is zero, so we get cy == 0 or 1 */
assert
(
cy
<
2
);
cnd_add_n
(
cy
,
rp
+
n
,
ecc
_
q
,
ECC_LIMB_SIZE
);
cnd_add_n
(
cy
,
rp
+
n
,
ecc
->
q
,
ECC_LIMB_SIZE
);
}
cy
=
mpn_submul_1
(
rp
,
ecc
_
q
,
ECC_LIMB_SIZE
,
cy
=
mpn_submul_1
(
rp
,
ecc
->
q
,
ECC_LIMB_SIZE
,
rp
[
ECC_LIMB_SIZE
-
1
]
>>
(
GMP_NUMB_BITS
-
QHIGH_BITS
));
assert
(
cy
<
2
);
cnd_add_n
(
cy
,
rp
,
ecc
_
q
,
ECC_LIMB_SIZE
);
cnd_add_n
(
cy
,
rp
,
ecc
->
q
,
ECC_LIMB_SIZE
);
}
/* Needs 2*ecc->size limbs at rp, and 2*ecc->size additional limbs of
...
...
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