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
fb2c801d
Commit
fb2c801d
authored
Aug 29, 2014
by
Niels Möller
Browse files
Make more of the testsuite use ecc->h_to_a.
parent
b8242df2
Changes
5
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
fb2c801d
2014-08-29 Niels Möller <nisse@lysator.liu.se>
* examples/ecc-benchmark.c (bench_add_jjj): Renamed, to...
* testsuite/testutils.c (test_ecc_mul_j): Renamed, to ...
(test_ecc_mul_h): ... new name. Use ecc->h_to_a function pointer.
Updated callers.
* examples/ecc-benchmark.c (bench_add_jjj): Renamed, to ...
(bench_add_hhh): ... new name. Use ecc->add_hhh function pointer.
(bench_add_ehh): Deleted.
(bench_curve): Use bench_add_hhh for all curves. Use ecc->mul_itch
...
...
testsuite/ecc-mul-a-test.c
View file @
fb2c801d
...
...
@@ -40,7 +40,7 @@ test_main (void)
for
(
n
[
0
]
=
2
;
n
[
0
]
<=
4
;
n
[
0
]
++
)
{
ecc_mul_a
(
ecc
,
p
,
n
,
ecc
->
g
,
scratch
);
test_ecc_mul_
j
(
i
,
n
[
0
],
p
);
test_ecc_mul_
h
(
i
,
n
[
0
],
p
);
}
/* (order - 1) * g = - g */
...
...
testsuite/ecc-mul-g-test.c
View file @
fb2c801d
...
...
@@ -42,7 +42,7 @@ test_main (void)
for
(
n
[
0
]
=
2
;
n
[
0
]
<=
4
;
n
[
0
]
++
)
{
ecc_mul_g
(
ecc
,
p
,
n
,
scratch
);
test_ecc_mul_
j
(
i
,
n
[
0
],
p
);
test_ecc_mul_
h
(
i
,
n
[
0
],
p
);
}
/* (order - 1) * g = - g */
...
...
testsuite/testutils.c
View file @
fb2c801d
...
...
@@ -1371,12 +1371,12 @@ test_ecc_mul_a (unsigned curve, unsigned n, const mp_limb_t *p)
}
void
test_ecc_mul_
j
(
unsigned
curve
,
unsigned
n
,
const
mp_limb_t
*
p
)
test_ecc_mul_
h
(
unsigned
curve
,
unsigned
n
,
const
mp_limb_t
*
p
)
{
const
struct
ecc_curve
*
ecc
=
ecc_curves
[
curve
];
mp_limb_t
*
np
=
xalloc_limbs
(
ecc_size_a
(
ecc
));
mp_limb_t
*
scratch
=
xalloc_limbs
(
ecc_j_to_a_itch
(
ecc
));
ecc
_j
_to_a
(
ecc
,
0
,
np
,
p
,
scratch
);
ecc
->
h
_to_a
(
ecc
,
0
,
np
,
p
,
scratch
);
test_ecc_mul_a
(
curve
,
n
,
np
);
...
...
testsuite/testutils.h
View file @
fb2c801d
...
...
@@ -239,7 +239,7 @@ void
test_ecc_mul_a
(
unsigned
curve
,
unsigned
n
,
const
mp_limb_t
*
p
);
void
test_ecc_mul_
j
(
unsigned
curve
,
unsigned
n
,
const
mp_limb_t
*
p
);
test_ecc_mul_
h
(
unsigned
curve
,
unsigned
n
,
const
mp_limb_t
*
p
);
#endif
/* WITH_HOGWEED */
...
...
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