public class MGF1 extends java.lang.Object implements DerivationFunction
A mask generation function takes an octet string of variable length and a desired output length as input, and outputs an octet string of the desired length. There may be restrictions on the length of the input and output octet strings, but such bounds are generally very large. Mask generation functions are deterministic; the octet string output is completely determined by the input octet string. The output of a mask generation function should be pseudorandom, that is, it should be infeasible to predict, given one part of the output but not the input, another part of the output.
Constructor and Description |
---|
MGF1(IMessageDigest hash) |
Modifier and Type | Method and Description |
---|---|
static byte[] |
generateBytes(byte[] seed,
int l,
IMessageDigest hash) |
byte[] |
generateBytes(int len) |
void |
init(byte[] seed,
DerivationFuncParams params) |
public MGF1(IMessageDigest hash)
hash
- the hash to be used as the source of generated bytespublic void init(byte[] seed, DerivationFuncParams params)
init
in interface DerivationFunction
public byte[] generateBytes(int len)
generateBytes
in interface DerivationFunction
len
- desired output lengthpublic static byte[] generateBytes(byte[] seed, int l, IMessageDigest hash)
Copyright © 2025. All rights reserved.