Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitry Baryshkov
nettle
Commits
b4971114
Commit
b4971114
authored
Oct 3, 2014
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Enable ecc-redc-test, also with mini-gmp.
parent
d6c8f92a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+6
-3
6 additions, 3 deletions
ChangeLog
testsuite/ecc-redc-test.c
+14
-15
14 additions, 15 deletions
testsuite/ecc-redc-test.c
with
20 additions
and
18 deletions
ChangeLog
+
6
−
3
View file @
b4971114
2014-10-03 Niels Möller <nisse@lysator.liu.se>
* testsuite/ecc-redc-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(test_main): Replace gmp_fprintf calls.
* testsuite/ecc-modinv-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(ref_modinv): Use mpz_gcdext, instead of mpn_gcdext.
(test_modulo): Replace gmp_fprintf calls by plain fprintf and
mpn_out_str.
(test_modulo): Replace gmp_fprintf calls.
* testsuite/ecc-mod-test.c [NETTLE_USE_MINI_GMP]: Enable test.
(ref_mod): Use mpz_mod and mpz_limbs_copy, instead of mpn_tdiv_qr.
(test_modulo): Replace gmp_fprintf calls.
(test_modulo): Replace gmp_fprintf calls by plain fprintf and
mpn_out_str.
* testsuite/testutils.c (mpn_out_str): New function, needed to
replace uses of gmp_fprintf.
...
...
This diff is collapsed.
Click to expand it.
testsuite/ecc-redc-test.c
+
14
−
15
View file @
b4971114
#include
"testutils.h"
#if NETTLE_USE_MINI_GMP
void
test_main
(
void
)
{
SKIP
();
}
#else
/* ! NETTLE_USE_MINI_GMP */
static
void
ref_redc
(
mp_limb_t
*
rp
,
const
mp_limb_t
*
ap
,
const
mp_limb_t
*
mp
,
mp_size_t
mn
)
{
...
...
@@ -80,9 +72,13 @@ test_main (void)
{
fprintf
(
stderr
,
"ecc->p.reduce failed: bit_size = %u
\n
"
,
ecc
->
p
.
bit_size
);
gmp_fprintf
(
stderr
,
"a = %Nx
\n
"
,
a
,
2
*
ecc
->
p
.
size
);
gmp_fprintf
(
stderr
,
"m = %Nx (bad)
\n
"
,
m
,
ecc
->
p
.
size
);
gmp_fprintf
(
stderr
,
"ref = %Nx
\n
"
,
ref
,
ecc
->
p
.
size
);
fprintf
(
stderr
,
"a = "
);
mpn_out_str
(
stderr
,
16
,
a
,
2
*
ecc
->
p
.
size
);
fprintf
(
stderr
,
"
\n
m = "
);
mpn_out_str
(
stderr
,
16
,
m
,
ecc
->
p
.
size
);
fprintf
(
stderr
,
" (bad)
\n
ref = "
);
mpn_out_str
(
stderr
,
16
,
ref
,
ecc
->
p
.
size
);
fprintf
(
stderr
,
"
\n
"
);
abort
();
}
}
...
...
@@ -101,9 +97,13 @@ test_main (void)
{
fprintf
(
stderr
,
"ecc_p%c1_redc failed: bit_size = %u
\n
"
,
(
ecc
->
p
.
m
[
0
]
==
1
)
?
'm'
:
'p'
,
ecc
->
p
.
bit_size
);
gmp_fprintf
(
stderr
,
"a = %Nx
\n
"
,
a
,
2
*
ecc
->
p
.
size
);
gmp_fprintf
(
stderr
,
"m = %Nx (bad)
\n
"
,
m
,
ecc
->
p
.
size
);
gmp_fprintf
(
stderr
,
"ref = %Nx
\n
"
,
ref
,
ecc
->
p
.
size
);
fprintf
(
stderr
,
"a = "
);
mpn_out_str
(
stderr
,
16
,
a
,
2
*
ecc
->
p
.
size
);
fprintf
(
stderr
,
"
\n
m = "
);
mpn_out_str
(
stderr
,
16
,
m
,
ecc
->
p
.
size
);
fprintf
(
stderr
,
" (bad)
\n
ref = "
);
mpn_out_str
(
stderr
,
16
,
ref
,
ecc
->
p
.
size
);
fprintf
(
stderr
,
"
\n
"
);
abort
();
}
}
...
...
@@ -113,4 +113,3 @@ test_main (void)
mpz_clear
(
r
);
gmp_randclear
(
rands
);
}
#endif
/* ! NETTLE_USE_MINI_GMP */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment