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
Nettle
nettle
Commits
3c87a5aa
Commit
3c87a5aa
authored
Aug 26, 2014
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ecc mod q test unconditional.
parent
14bca47e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
ChangeLog
ChangeLog
+3
-0
testsuite/ecc-mod-test.c
testsuite/ecc-mod-test.c
+12
-15
No files found.
ChangeLog
View file @
3c87a5aa
2014-08-26 Niels Möller <nisse@lysator.liu.se>
* testsuite/ecc-mod-test.c (test_curve): Make modq test
unconditional, partially reverting 2014-07-04 change.
* ecc-25519.c (ecc_25519_modq): New function.
* eccdata.c (output_curve): Precomputation for curve25519 mod q.
...
...
testsuite/ecc-mod-test.c
View file @
3c87a5aa
...
...
@@ -76,22 +76,19 @@ test_curve (gmp_randstate_t rands, const struct ecc_curve *ecc)
ref_mod
(
ref
,
a
,
ecc
->
q
,
ecc
->
size
);
if
(
ecc
->
modq
)
{
mpn_copyi
(
m
,
a
,
2
*
ecc
->
size
);
ecc
->
modq
(
ecc
,
m
);
if
(
mpn_cmp
(
m
,
ecc
->
q
,
ecc
->
size
)
>=
0
)
mpn_sub_n
(
m
,
m
,
ecc
->
q
,
ecc
->
size
);
mpn_copyi
(
m
,
a
,
2
*
ecc
->
size
);
ecc
->
modq
(
ecc
,
m
);
if
(
mpn_cmp
(
m
,
ecc
->
q
,
ecc
->
size
)
>=
0
)
mpn_sub_n
(
m
,
m
,
ecc
->
q
,
ecc
->
size
);
if
(
mpn_cmp
(
m
,
ref
,
ecc
->
size
))
{
fprintf
(
stderr
,
"ecc->modq failed: bit_size = %u
\n
"
,
ecc
->
bit_size
);
gmp_fprintf
(
stderr
,
"a = %Nx
\n
"
,
a
,
2
*
ecc
->
size
);
gmp_fprintf
(
stderr
,
"m = %Nx (bad)
\n
"
,
m
,
ecc
->
size
);
gmp_fprintf
(
stderr
,
"ref = %Nx
\n
"
,
ref
,
ecc
->
size
);
abort
();
}
if
(
mpn_cmp
(
m
,
ref
,
ecc
->
size
))
{
fprintf
(
stderr
,
"ecc->modq failed: bit_size = %u
\n
"
,
ecc
->
bit_size
);
gmp_fprintf
(
stderr
,
"a = %Nx
\n
"
,
a
,
2
*
ecc
->
size
);
gmp_fprintf
(
stderr
,
"m = %Nx (bad)
\n
"
,
m
,
ecc
->
size
);
gmp_fprintf
(
stderr
,
"ref = %Nx
\n
"
,
ref
,
ecc
->
size
);
abort
();
}
if
(
ecc
->
Bmodq_size
<
ecc
->
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