@Immutable public class LegacyFullPrf extends Object implements Prf
| Modifier and Type | Method and Description |
|---|---|
byte[] |
compute(byte[] input,
int outputLength)
Computes the PRF selected by the underlying key on input and returns the first outputLength
bytes.
|
static Prf |
create(LegacyProtoKey key)
This method covers the cases where users created their own prf/key classes.
|
public static Prf create(LegacyProtoKey key) throws GeneralSecurityException
GeneralSecurityExceptionpublic byte[] compute(byte[] input,
int outputLength)
throws GeneralSecurityException
Prfcompute in interface Prfinput - the input to compute the PRF on.outputLength - the desired length of the output in bytes. When choosing this parameter
keep the birthday paradox in mind. If you have 2^n different inputs that your system has to
handle set the output length to ceil(n/4 + 4) This corresponds to 2*n + 32 bits, meaning a
collision will occur with a probability less than 1:2^32. When in doubt, request a security
review.GeneralSecurityException - if the algorithm fails or if the output of algorithm is less
than outputLength.