Content deleted Content added
Atropos235 (talk | contribs) m →Definition: format |
→MGF1: formatting |
||
Line 36:
=== MGF1 ===
MGF1 is a Mask Generation Function defined in the Public Key Cryptography Standard #1 published by RSA Laboratories
<blockquote>
====Options====
<math>\mathsf{Hash}</math>
====Input====
<math>Z</math>
▲ Hash hash function (hLen denotes the length in octets of the hash
<math>l</math>
<math>\mathsf{mask}</math>
▲ Z seed from which mask is generated, an octet string
▲ l intended length in octets of the mask, at most 2^32(hLen)
====Steps====
▲ Output:
{{Ordered list | list_style_type=decimal
▲ mask mask, an octet string of length l; or "mask too long"
|
{{Ordered list | list_style_type=lower-alpha
▲ 1.If l > 2^32(hLen), output "mask too long" and stop.
▲ 2.Let T be the empty octet string.
: <math>T = T \shortparallel \mathsf{Hash} (Z \shortparallel C)</math>
▲ 3.For counter from 0 to \lceil{l / hLen}\rceil-1, do the following:
}}
▲ a.Convert counter to an octet string C of length 4 with the primitive
}}
▲ I2OSP: C = I2OSP (counter, 4)
</blockquote>
▲ b.Concatenate the hash of the seed Z and C to the octet string T: T =
▲ 4.Output the leading l octets of T as the octet string mask.
=== Example Code ===
|