Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
83aa4c60
Commit
83aa4c60
authored
Oct 03, 2014
by
Niels Möller
Browse files
Enable ecc-mul-a-test, also with mini-gmp.
parent
b4971114
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
83aa4c60
2014-10-03 Niels Möller <nisse@lysator.liu.se>
* testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test.
* testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(test_main): Replace gmp_fprintf calls.
* testsuite/ecc-mul-a-test.c: Likewise.
* testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(ref_modinv): Use mpz_gcdext, instead of mpn_gcdext.
...
...
testsuite/ecc-mul-a-test.c
View file @
83aa4c60
#include
"testutils.h"
#if NETTLE_USE_MINI_GMP
void
test_main
(
void
)
{
SKIP
();
}
#else
/* ! NETTLE_USE_MINI_GMP */
void
test_main
(
void
)
{
...
...
@@ -80,15 +72,23 @@ test_main (void)
if
(
mpn_cmp
(
p
,
q
,
2
*
size
))
{
gmp_fprintf
(
stderr
,
"Different results from ecc->mul and ecc->mul_g.
\n
"
" bits = %u
\n
"
" n = %Nx
\n
"
,
ecc
->
p
.
bit_size
,
n
,
size
);
gmp_fprintf
(
stderr
,
"p = %Nx,
\n
%Nx
\n
"
,
p
,
size
,
p
+
size
,
size
);
gmp_fprintf
(
stderr
,
"q = %Nx,
\n
%Nx
\n
"
,
q
,
size
,
q
+
size
,
size
);
fprintf
(
stderr
,
"Different results from ecc->mul and ecc->mul_g.
\n
"
" bits = %u
\n
"
,
ecc
->
p
.
bit_size
);
fprintf
(
stderr
,
" n = "
);
mpn_out_str
(
stderr
,
16
,
n
,
size
);
fprintf
(
stderr
,
"
\n
p = "
);
mpn_out_str
(
stderr
,
16
,
p
,
size
);
fprintf
(
stderr
,
",
\n
"
);
mpn_out_str
(
stderr
,
16
,
p
+
size
,
size
);
fprintf
(
stderr
,
"
\n
q = "
);
mpn_out_str
(
stderr
,
16
,
q
,
size
);
fprintf
(
stderr
,
",
\n
"
);
mpn_out_str
(
stderr
,
16
,
q
+
size
,
size
);
fprintf
(
stderr
,
"
\n
"
);
abort
();
}
}
...
...
@@ -100,4 +100,3 @@ test_main (void)
mpz_clear
(
r
);
gmp_randclear
(
rands
);
}
#endif
/* ! NETTLE_USE_MINI_GMP */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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