PBKDF2SHA512: add JavaDoc comment to derive() method

This commit is contained in:
Sean Gilligan 2023-09-16 14:18:27 -07:00 committed by Andreas Schildbach
parent 0d57e1ece1
commit e67401d7a5

View File

@ -45,6 +45,14 @@ public class PBKDF2SHA512 {
// Length of HMAC result
private static final int H_LEN = 64;
/**
* Derive a key using PBKDF2-SHA512
* @param P password
* @param S salt
* @param c iteration count, a positive integer
* @param dkLen intended length in octets of the derived key, a positive integer
* @return derived key
*/
public static byte[] derive(String P, String S, int c, int dkLen) {
Preconditions.checkArgument(c > 0, () -> "count must be greater than zero");
Preconditions.checkArgument(dkLen > 0, () -> "derived key length must be greater than zero");