Package org.bouncycastle.bcpg
Class S2K.Argon2Params
java.lang.Object
org.bouncycastle.bcpg.S2K.Argon2Params
- Enclosing class:
S2K
Parameters for Argon2 S2K.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUniformly 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, SecureRandom secureRandom) Create customized Argon2 S2K parameters.Argon2Params
(SecureRandom secureRandom) Uniformly safe and recommended parameters not tailored to any hardware. -
Method Summary
Modifier and TypeMethodDescriptionint
Return the exponent indicating the memory sizeint
Return the factor of parallelismint
Return the number of passesbyte[]
getSalt()
Return a 16-byte byte array containing the saltstatic S2K.Argon2Params
Recommended parameters for memory constrained environments (64MiB RAM).static S2K.Argon2Params
Uniformly safe and recommended parameters not tailored to any hardware.
-
Constructor Details
-
Argon2Params
public Argon2Params()Uniformly safe and recommended parameters not tailored to any hardware. Uses Argon2id, 1 pass, 4 parallelism, 2 GiB RAM.- See Also:
-
Argon2Params
Uniformly safe and recommended parameters not tailored to any hardware. Uses Argon2id, 1 pass, 4 parallelism, 2 GiB RAM.- See Also:
-
Argon2Params
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 Details
-
universallyRecommendedParameters
Uniformly safe and recommended parameters not tailored to any hardware. Uses Argon2id, 1 pass, 4 parallelism, 2 GiB RAM.- See Also:
-
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:
-
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
-