Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
3396725b
Commit
3396725b
authored
Jul 04, 2014
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed gmp_randstate_t variables to "rands".
parent
17352ba7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
23 deletions
+23
-23
testsuite/ecc-mod-test.c
testsuite/ecc-mod-test.c
+5
-5
testsuite/ecc-modinv-test.c
testsuite/ecc-modinv-test.c
+5
-5
testsuite/ecc-mul-a-test.c
testsuite/ecc-mul-a-test.c
+5
-5
testsuite/ecc-mul-g-test.c
testsuite/ecc-mul-g-test.c
+3
-3
testsuite/ecc-redc-test.c
testsuite/ecc-redc-test.c
+5
-5
No files found.
testsuite/ecc-mod-test.c
View file @
3396725b
...
...
@@ -22,14 +22,14 @@ ref_mod (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t mn)
void
test_main
(
void
)
{
gmp_randstate_t
state
;
gmp_randstate_t
rands
;
mp_limb_t
a
[
MAX_SIZE
];
mp_limb_t
m
[
MAX_SIZE
];
mp_limb_t
ref
[
MAX_SIZE
];
unsigned
i
;
mpz_t
r
;
gmp_randinit_default
(
state
);
gmp_randinit_default
(
rands
);
mpz_init
(
r
);
...
...
@@ -40,9 +40,9 @@ test_main (void)
for
(
j
=
0
;
j
<
COUNT
;
j
++
)
{
if
(
j
&
1
)
mpz_rrandomb
(
r
,
state
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_rrandomb
(
r
,
rands
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
else
mpz_urandomb
(
r
,
state
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_urandomb
(
r
,
rands
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_limbs_copy
(
a
,
r
,
2
*
ecc
->
size
);
...
...
@@ -119,6 +119,6 @@ test_main (void)
}
mpz_clear
(
r
);
gmp_randclear
(
state
);
gmp_randclear
(
rands
);
}
#endif
/* ! NETTLE_USE_MINI_GMP */
testsuite/ecc-modinv-test.c
View file @
3396725b
...
...
@@ -40,7 +40,7 @@ ref_modinv (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t m
void
test_main
(
void
)
{
gmp_randstate_t
state
;
gmp_randstate_t
rands
;
mp_limb_t
a
[
MAX_ECC_SIZE
];
mp_limb_t
ai
[
MAX_ECC_SIZE
];
mp_limb_t
ref
[
MAX_ECC_SIZE
];
...
...
@@ -48,7 +48,7 @@ test_main (void)
unsigned
i
;
mpz_t
r
;
gmp_randinit_default
(
state
);
gmp_randinit_default
(
rands
);
mpz_init
(
r
);
for
(
i
=
0
;
ecc_curves
[
i
];
i
++
)
...
...
@@ -58,9 +58,9 @@ test_main (void)
for
(
j
=
0
;
j
<
COUNT
;
j
++
)
{
if
(
j
&
1
)
mpz_rrandomb
(
r
,
state
,
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_rrandomb
(
r
,
rands
,
ecc
->
size
*
GMP_NUMB_BITS
);
else
mpz_urandomb
(
r
,
state
,
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_urandomb
(
r
,
rands
,
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_limbs_copy
(
a
,
r
,
ecc
->
size
);
...
...
@@ -110,7 +110,7 @@ test_main (void)
}
}
}
gmp_randclear
(
state
);
gmp_randclear
(
rands
);
mpz_clear
(
r
);
}
#endif
/* ! NETTLE_USE_MINI_GMP */
testsuite/ecc-mul-a-test.c
View file @
3396725b
...
...
@@ -11,11 +11,11 @@ test_main (void)
void
test_main
(
void
)
{
gmp_randstate_t
state
;
gmp_randstate_t
rands
;
mpz_t
r
;
unsigned
i
;
gmp_randinit_default
(
state
);
gmp_randinit_default
(
rands
);
mpz_init
(
r
);
for
(
i
=
0
;
ecc_curves
[
i
];
i
++
)
...
...
@@ -72,9 +72,9 @@ test_main (void)
for
(
j
=
0
;
j
<
100
;
j
++
)
{
if
(
j
&
1
)
mpz_rrandomb
(
r
,
state
,
size
*
GMP_NUMB_BITS
);
mpz_rrandomb
(
r
,
rands
,
size
*
GMP_NUMB_BITS
);
else
mpz_urandomb
(
r
,
state
,
size
*
GMP_NUMB_BITS
);
mpz_urandomb
(
r
,
rands
,
size
*
GMP_NUMB_BITS
);
/* Reduce so that (almost surely) n < q */
mpz_limbs_copy
(
n
,
r
,
size
);
...
...
@@ -106,6 +106,6 @@ test_main (void)
free
(
scratch
);
}
mpz_clear
(
r
);
gmp_randclear
(
state
);
gmp_randclear
(
rands
);
}
#endif
/* ! NETTLE_USE_MINI_GMP */
testsuite/ecc-mul-g-test.c
View file @
3396725b
...
...
@@ -11,11 +11,11 @@ test_main (void)
void
test_main
(
void
)
{
gmp_randstate_t
state
;
gmp_randstate_t
rands
;
mpz_t
r
;
unsigned
i
;
gmp_randinit_default
(
state
);
gmp_randinit_default
(
rands
);
mpz_init
(
r
);
for
(
i
=
0
;
ecc_curves
[
i
];
i
++
)
...
...
@@ -62,6 +62,6 @@ test_main (void)
free
(
scratch
);
}
mpz_clear
(
r
);
gmp_randclear
(
state
);
gmp_randclear
(
rands
);
}
#endif
/* ! NETTLE_USE_MINI_GMP */
testsuite/ecc-redc-test.c
View file @
3396725b
...
...
@@ -42,14 +42,14 @@ ref_redc (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t mn)
void
test_main
(
void
)
{
gmp_randstate_t
state
;
gmp_randstate_t
rands
;
mp_limb_t
a
[
MAX_SIZE
];
mp_limb_t
m
[
MAX_SIZE
];
mp_limb_t
ref
[
MAX_SIZE
];
unsigned
i
;
mpz_t
r
;
gmp_randinit_default
(
state
);
gmp_randinit_default
(
rands
);
mpz_init
(
r
);
...
...
@@ -63,9 +63,9 @@ test_main (void)
for
(
j
=
0
;
j
<
COUNT
;
j
++
)
{
if
(
j
&
1
)
mpz_rrandomb
(
r
,
state
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_rrandomb
(
r
,
rands
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
else
mpz_urandomb
(
r
,
state
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_urandomb
(
r
,
rands
,
2
*
ecc
->
size
*
GMP_NUMB_BITS
);
mpz_limbs_copy
(
a
,
r
,
2
*
ecc
->
size
);
...
...
@@ -104,6 +104,6 @@ test_main (void)
}
mpz_clear
(
r
);
gmp_randclear
(
state
);
gmp_randclear
(
rands
);
}
#endif
/* ! NETTLE_USE_MINI_GMP */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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