EMSA_PSS_ENCODE(mhash,
emBits,
randFunc,
mgf,
sLen)
|
|
Implement the EMSA-PSS-ENCODE function, as defined
in PKCS#1 v2.1 (RFC3447, 9.1.1).
The original EMSA-PSS-ENCODE actually accepts the message M as input,
and hash it internally. Here, we expect that the message has already
been hashed instead.
- Parameters:
mhash (hash object) - The hash object that holds the digest of the message being signed.
emBits (int) - Maximum length of the final encoding, in bits.
randFunc (callable) - An RNG function that accepts as only parameter an int, and returns
a string of random bytes, to be used as salt.
mgf (callable) - A mask generation function that accepts two parameters: a string to
use as seed, and the lenth of the mask to generate, in bytes.
sLen (int) - Length of the salt, in bytes.
- Returns:
- An emLen byte long string that encodes the hash
(with emLen = \ceil(emBits/8)).
- Raises:
ValueError - When digest or salt length are too big.
|