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
a287f1a9
Commit
a287f1a9
authored
Nov 25, 2018
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testutils.c: Fix high bits of the mpz_urandomb used with mini-gmp.
parent
f0136f46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
ChangeLog
ChangeLog
+3
-0
testsuite/testutils.c
testsuite/testutils.c
+1
-1
No files found.
ChangeLog
View file @
a287f1a9
2018-11-25 Niels Möller <nisse@lysator.liu.se>
* testsuite/testutils.c (mpz_urandomb) [NETTLE_USE_MINI_GMP]: Fix
masking of most significant bits.
* rsa-decrypt-tr.c (rsa_decrypt_tr): Use
NETTLE_OCTET_SIZE_TO_LIMB_SIZE.
...
...
testsuite/testutils.c
View file @
a287f1a9
...
...
@@ -818,7 +818,7 @@ mpz_urandomb (mpz_t r, struct knuth_lfib_ctx *ctx, mp_bitcnt_t bits)
uint8_t
*
buf
=
xalloc
(
bytes
);
knuth_lfib_random
(
ctx
,
bytes
,
buf
);
buf
[
bytes
-
1
]
&=
0xff
>>
(
8
*
bytes
-
bits
);
buf
[
0
]
&=
0xff
>>
(
8
*
bytes
-
bits
);
nettle_mpz_set_str_256_u
(
r
,
bytes
,
buf
);
free
(
buf
);
}
...
...
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