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
615bdd0c
Commit
615bdd0c
authored
Sep 17, 2014
by
Niels Möller
Browse files
Move mpn_zero_p to testutils.c.
parent
2b372dfd
Changes
4
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
615bdd0c
2014-09-17 Niels Möller <nisse@lysator.liu.se>
* testsuite/ecc-modinv-test.c (mpn_zero_p): Moved function, to...
* testsuite/testutils.c (mpn_zero_p): New location. Also make
non-static.
* testsuite/testutils.c (ecc_curves): Include curve25519 in list.
(test_ecc_mul_a): Include reference points for curve25519 (with
Edwards coordinates). Allow n == 1, and compare to the generator.
...
...
testsuite/ecc-modinv-test.c
View file @
615bdd0c
...
...
@@ -37,17 +37,6 @@ ref_modinv (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t m
#define MAX_ECC_SIZE (1 + 521 / GMP_NUMB_BITS)
#define COUNT 500
static
int
mpn_zero_p
(
mp_srcptr
ap
,
mp_size_t
n
)
{
while
(
--
n
>=
0
)
{
if
(
ap
[
n
]
!=
0
)
return
0
;
}
return
1
;
}
void
test_main
(
void
)
{
...
...
testsuite/testutils.c
View file @
615bdd0c
...
...
@@ -686,6 +686,19 @@ mpz_combit (mpz_t x, unsigned long int bit)
}
#endif
#ifndef mpn_zero_p
int
mpn_zero_p
(
mp_srcptr
ap
,
mp_size_t
n
)
{
while
(
--
n
>=
0
)
{
if
(
ap
[
n
]
!=
0
)
return
0
;
}
return
1
;
}
#endif
mp_limb_t
*
xalloc_limbs
(
mp_size_t
n
)
{
...
...
testsuite/testutils.h
View file @
615bdd0c
...
...
@@ -157,6 +157,11 @@ test_armor(const struct nettle_armor *armor,
const
uint8_t
*
ascii
);
#if WITH_HOGWEED
#ifndef mpn_zero_p
int
mpn_zero_p
(
mp_srcptr
ap
,
mp_size_t
n
);
#endif
mp_limb_t
*
xalloc_limbs
(
mp_size_t
n
);
...
...
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