Skip to content

Commit 4ff7547

Browse files
committed
FIXME for later consideration: hard error for lower bound on security strength
1 parent c976c4c commit 4ff7547

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dsa/src/signing_key.rs

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ impl SigningKey {
8686

8787
let n = (q.bits() / 8) as usize;
8888
let block_size = hash.len(); // Hash function output size
89+
// FIXME shouldn't `hash.len() < n` be a hard error (bad API use)? According to DSA documentation: "An approved hash function, as specified in FIPS 180, shall be used during the generation of key pairs and digital signatures. When used during the generation of an RSA key pair (as specified in this Standard), the length in bits of the hash function output block shall meet or exceed the security strength associated with the bit length of the modulus n (see SP 800-57)."
8990

9091
let z_len = min(n, block_size);
9192
let z = BigUint::from_bytes_be(&hash[..z_len]);

0 commit comments

Comments
 (0)