Package org.bouncycastle.crypto.params
Class Argon2Parameters
java.lang.Object
org.bouncycastle.crypto.params.Argon2Parameters
Configuration parameters for the
Argon2 PBKDF.
Build instances with Argon2Parameters.Builder, e.g.
Argon2Parameters params = new Argon2Parameters.Builder(Argon2Parameters.ARGON2_id)
.withVersion(Argon2Parameters.ARGON2_VERSION_13)
.withSalt(salt)
.withIterations(3)
.withMemoryPowOfTwo(16)
.withParallelism(4)
.build();
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intArgon2d - data-dependent memory access.static final intArgon2i - data-independent memory access.static final intstatic final intArgon2 v1.0 (legacy).static final intArgon2 v1.3 - the version standardised by RFC 9106.static final StringSystem/security property setting the maximum permitted memory exponent (i.e. -
Method Summary
-
Field Details
-
MAX_MEMORY_EXP
System/security property setting the maximum permitted memory exponent (i.e.memory <= 1 << MAX_MEMORY_EXP). Default and ceiling are 30.- See Also:
-
ARGON2_d
public static final int ARGON2_dArgon2d - data-dependent memory access.- See Also:
-
ARGON2_i
public static final int ARGON2_iArgon2i - data-independent memory access.- See Also:
-
ARGON2_id
public static final int ARGON2_id- See Also:
-
ARGON2_VERSION_10
public static final int ARGON2_VERSION_10Argon2 v1.0 (legacy).- See Also:
-
ARGON2_VERSION_13
public static final int ARGON2_VERSION_13Argon2 v1.3 - the version standardised by RFC 9106.- See Also:
-
-
Method Details
-
getSalt
public byte[] getSalt()- Returns:
- a defensive copy of the salt, or null if none was set.
-
getSecret
public byte[] getSecret()- Returns:
- a defensive copy of the secret value, or null if none was set.
-
getAdditional
public byte[] getAdditional()- Returns:
- a defensive copy of the additional data, or null if none was set.
-
getIterations
public int getIterations()- Returns:
- the number of passes (time cost).
-
getMemory
public int getMemory()- Returns:
- the memory cost in KiB.
-
getLanes
public int getLanes()- Returns:
- the parallelism (lane count).
-
getVersion
public int getVersion()- Returns:
- the Argon2 version constant (
ARGON2_VERSION_10orARGON2_VERSION_13).
-
getType
public int getType() -
getCharToByteConverter
- Returns:
- the character-to-byte converter used to encode
char[]passwords.
-
getBlockPool
- Returns:
- the user-supplied
Argon2BytesGenerator.BlockPool, or null if the generator should use its default per-call pool.
-
clear
public void clear()Zeroise sensitive state (salt, secret, additional) held by these parameters.
-