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
1dba1acf
Commit
1dba1acf
authored
Jul 15, 2014
by
Niels Möller
Browse files
Minor improvement of curve25519-add-test.
parent
346cfb55
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
1dba1acf
2014-07-15 Niels Möller <nisse@lysator.liu.se>
* testsuite/curve25519-add-test.c (test_main): Additonal test for
g2+g2. Free allocated storage.
2014-07-14 Niels Möller <nisse@lysator.liu.se>
* testsuite/curve25519-add-test.c: New test case.
...
...
testsuite/curve25519-add-test.c
View file @
1dba1acf
...
...
@@ -28,6 +28,9 @@ test_main (void)
const
struct
ecc_curve
*
ecc
=
&
nettle_curve25519
;
mp_limb_t
*
g
;
mp_limb_t
*
z
;
mp_limb_t
*
g2
;
mp_limb_t
*
g3
;
mp_limb_t
*
g4
;
mp_limb_t
*
pe
;
mp_limb_t
*
pa
;
mp_limb_t
*
scratch
;
...
...
@@ -63,6 +66,9 @@ test_main (void)
g
=
xalloc_limbs
(
ecc_size_j
(
ecc
));
z
=
xalloc_limbs
(
ecc_size_j
(
ecc
));
g2
=
xalloc_limbs
(
ecc_size_j
(
ecc
));
g3
=
xalloc_limbs
(
ecc_size_j
(
ecc
));
g4
=
xalloc_limbs
(
ecc_size_j
(
ecc
));
pe
=
xalloc_limbs
(
ecc_size_j
(
ecc
));
pa
=
xalloc_limbs
(
ecc_size_j
(
ecc
));
scratch
=
xalloc_limbs
(
ECC_ADD_EHH_ITCH
(
ecc
->
size
));
...
...
@@ -84,18 +90,32 @@ test_main (void)
ecc_eh_to_a
(
ecc
,
0
,
pa
,
pe
,
scratch
);
test_ecc_point
(
ecc
,
&
rg
,
pa
);
ecc_add_ehh
(
ecc
,
pe
,
g
,
pe
,
scratch
);
ecc_add_ehh
(
ecc
,
g2
,
g
,
pe
,
scratch
);
ecc_eh_to_a
(
ecc
,
0
,
pa
,
pe
,
scratch
);
ecc_eh_to_a
(
ecc
,
0
,
pa
,
g2
,
scratch
);
test_ecc_point
(
ecc
,
&
rg2
,
pa
);
ecc_add_ehh
(
ecc
,
pe
,
g
,
pe
,
scratch
);
ecc_add_ehh
(
ecc
,
g3
,
g
,
g2
,
scratch
);
ecc_eh_to_a
(
ecc
,
0
,
pa
,
pe
,
scratch
);
ecc_eh_to_a
(
ecc
,
0
,
pa
,
g3
,
scratch
);
test_ecc_point
(
ecc
,
&
rg3
,
pa
);
ecc_add_ehh
(
ecc
,
pe
,
g
,
pe
,
scratch
);
ecc_add_ehh
(
ecc
,
g4
,
g
,
g3
,
scratch
);
ecc_eh_to_a
(
ecc
,
0
,
pa
,
pe
,
scratch
);
ecc_eh_to_a
(
ecc
,
0
,
pa
,
g4
,
scratch
);
test_ecc_point
(
ecc
,
&
rg4
,
pa
);
ecc_add_ehh
(
ecc
,
g4
,
g2
,
g2
,
scratch
);
ecc_eh_to_a
(
ecc
,
0
,
pa
,
g4
,
scratch
);
test_ecc_point
(
ecc
,
&
rg4
,
pa
);
free
(
g
);
free
(
z
);
free
(
g2
);
free
(
g3
);
free
(
g4
);
free
(
pe
);
free
(
pa
);
free
(
scratch
);
}
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