Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Wim Lewis
nettle
Commits
5172adc3
Commit
5172adc3
authored
Jan 31, 2013
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nettle_mpz_random: Increased number of extra bits to 64, following FIPS 186-3.
parent
a6671dc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
ChangeLog
ChangeLog
+5
-0
bignum-random.c
bignum-random.c
+3
-2
No files found.
ChangeLog
View file @
5172adc3
2013-01-31 Niels Möller <nisse@lysator.liu.se>
* bignum-random.c (nettle_mpz_random): Increased number of extra
bits to 64, following FIPS 186-3.
2013-01-12 Niels Möller <nisse@lysator.liu.se>
* configure.ac: Use AC_LANG_SOURCE.
...
...
bignum-random.c
View file @
5172adc3
...
...
@@ -75,11 +75,12 @@ nettle_mpz_random(mpz_t x,
*/
/* Add a few bits extra, to decrease the bias from the final modulo
* operation. */
* operation. NIST FIPS 186-3 specifies 64 extra bits, for use with
* DSA. */
nettle_mpz_random_size
(
x
,
ctx
,
random
,
mpz_sizeinbase
(
n
,
2
)
+
1
6
);
mpz_sizeinbase
(
n
,
2
)
+
6
4
);
mpz_fdiv_r
(
x
,
x
,
n
);
}
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