Package org.bouncycastle.bcpg
Class S2K.Argon2Params
- java.lang.Object
-
- org.bouncycastle.bcpg.S2K.Argon2Params
-
- Enclosing class:
- S2K
public static class S2K.Argon2Params extends java.lang.Object
Parameters for Argon2 S2K.- See Also:
- OpenPGP - Argon2
-
-
Constructor Summary
Constructors Constructor Description Argon2Params()
Uniformly safe and recommended parameters not tailored to any hardware.Argon2Params(byte[] salt, int passes, int parallelism, int memSizeExp)
Create customized Argon2 S2K parameters.Argon2Params(int passes, int parallelism, int memSizeExp, java.security.SecureRandom secureRandom)
Create customized Argon2 S2K parameters.Argon2Params(java.security.SecureRandom secureRandom)
Uniformly safe and recommended parameters not tailored to any hardware.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMemSizeExp()
Return the exponent indicating the memory sizeint
getParallelism()
Return the factor of parallelismint
getPasses()
Return the number of passesbyte[]
getSalt()
Return a 16-byte byte array containing the saltstatic S2K.Argon2Params
memoryConstrainedParameters()
Recommended parameters for memory constrained environments (64MiB RAM).static S2K.Argon2Params
universallyRecommendedParameters()
Uniformly safe and recommended parameters not tailored to any hardware.
-
-
-
Constructor Detail
-
Argon2Params
public Argon2Params()
Uniformly safe and recommended parameters not tailored to any hardware. Uses Argon2id, 1 pass, 4 parallelism, 2 GiB RAM.- See Also:
- RFC 9106: §4. Parameter Choice
-
Argon2Params
public Argon2Params(java.security.SecureRandom secureRandom)
Uniformly safe and recommended parameters not tailored to any hardware. Uses Argon2id, 1 pass, 4 parallelism, 2 GiB RAM.- See Also:
- RFC 9106: §4. Parameter Choice
-
Argon2Params
public Argon2Params(int passes, int parallelism, int memSizeExp, java.security.SecureRandom secureRandom)
Create customized Argon2 S2K parameters.- Parameters:
passes
- number of iterations, must be greater than 0parallelism
- number of lanes, must be greater 0memSizeExp
- exponent for memory consumption, must be between3 + ⌈log₂p⌉
and31
secureRandom
- secure random generator to initialize the salt vector
-
Argon2Params
public Argon2Params(byte[] salt, int passes, int parallelism, int memSizeExp)
Create customized Argon2 S2K parameters.- Parameters:
salt
- 16 bytes of random saltpasses
- number of iterations, must be greater than 0parallelism
- number of lanes, must be greater 0memSizeExp
- exponent for memory consumption, must be between3 + ⌈log₂p⌉
and31
-
-
Method Detail
-
universallyRecommendedParameters
public static S2K.Argon2Params universallyRecommendedParameters()
Uniformly safe and recommended parameters not tailored to any hardware. Uses Argon2id, 1 pass, 4 parallelism, 2 GiB RAM.- See Also:
- RFC 9106: §4. Parameter Choice
-
memoryConstrainedParameters
public static S2K.Argon2Params memoryConstrainedParameters()
Recommended parameters for memory constrained environments (64MiB RAM). Uses Argon2id with 3 passes, 4 lanes and 64 MiB RAM.- Returns:
- safe parameters for memory constrained environments
- See Also:
- RFC9106: §4. Parameter Choice
-
getSalt
public byte[] getSalt()
Return a 16-byte byte array containing the saltS
.- Returns:
- salt
-
getPasses
public int getPasses()
Return the number of passest
.- Returns:
- number of passes
-
getParallelism
public int getParallelism()
Return the factor of parallelismp
.- Returns:
- parallelism
-
getMemSizeExp
public int getMemSizeExp()
Return the exponent indicating the memory sizem
.- Returns:
- memory size exponent
-
-