1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Cédric Mesnil <cslashm@pm.me>
//! MGF1 mask generation function (PKCS#1 v2.2 / RFC 8017 §B.2.1).
//!
//! `MGF1(seed, len) = T[0..len]` where `T = H(seed ‖ C(0)) ‖ H(seed ‖ C(1)) ‖ …`
//! and `C(i)` is the 4-octet big-endian counter. Generic over any
//! [`Digest`]; used by RSA-OAEP and RSA-PSS.
use crateDigest;
/// Fill `out` with `MGF1` output derived from `seed`, using digest `H`.
///
/// Panics in debug builds if `H::OUTPUT_LEN` exceeds 64 (no hash in this
/// crate does).