public interface Argon2Library
extends com.sun.jna.Library
| Modifier and Type | Field and Description |
|---|---|
static int |
ARGON2_OK
Return code if everything is okay.
|
static Argon2Library |
INSTANCE
Singleton instance.
|
| Modifier and Type | Method and Description |
|---|---|
Size_t |
argon2_encodedlen(Uint32_t t_cost,
Uint32_t m_cost,
Uint32_t parallelism,
Uint32_t saltlen,
Uint32_t hashlen,
Argon2_type type)
Returns the encoded hash length for the given input parameters.
|
java.lang.String |
argon2_error_message(int error_code)
Get the associated error message for given error code.
|
int |
argon2d_hash_encoded(Uint32_t t_cost,
Uint32_t m_cost,
Uint32_t parallelism,
byte[] pwd,
Size_t pwdlen,
byte[] salt,
Size_t saltlen,
Size_t hashlen,
byte[] encoded,
Size_t encodedlen)
Hashes a password with Argon2d, producing an encoded hash.
|
int |
argon2d_verify(byte[] encoded,
byte[] pwd,
Size_t pwdlen)
Verifies a password against an Argon2d encoded string.
|
int |
argon2i_hash_encoded(Uint32_t t_cost,
Uint32_t m_cost,
Uint32_t parallelism,
byte[] pwd,
Size_t pwdlen,
byte[] salt,
Size_t saltlen,
Size_t hashlen,
byte[] encoded,
Size_t encodedlen)
Hashes a password with Argon2i, producing an encoded hash.
|
int |
argon2i_verify(byte[] encoded,
byte[] pwd,
Size_t pwdlen)
Verifies a password against an Argon2i encoded string.
|
int |
argon2id_hash_encoded(Uint32_t t_cost,
Uint32_t m_cost,
Uint32_t parallelism,
byte[] pwd,
Size_t pwdlen,
byte[] salt,
Size_t saltlen,
Size_t hashlen,
byte[] encoded,
Size_t encodedlen)
Hashes a password with Argon2id, producing an encoded hash.
|
int |
argon2id_verify(byte[] encoded,
byte[] pwd,
Size_t pwdlen)
Verifies a password against an Argon2id encoded string.
|
static final Argon2Library INSTANCE
static final int ARGON2_OK
int argon2i_hash_encoded(Uint32_t t_cost, Uint32_t m_cost, Uint32_t parallelism, byte[] pwd, Size_t pwdlen, byte[] salt, Size_t saltlen, Size_t hashlen, byte[] encoded, Size_t encodedlen)
t_cost - Number of iterationsm_cost - Sets memory usage to m_cost kibibytesparallelism - Number of threads and compute lanespwd - Pointer to passwordpwdlen - Password size in bytessalt - Pointer to saltsaltlen - Salt size in byteshashlen - Desired length of the hash in bytesencoded - Buffer where to write the encoded hashencodedlen - Size of the buffer (thus max size of the encoded hash)ARGON2_OK if successfulint argon2id_hash_encoded(Uint32_t t_cost, Uint32_t m_cost, Uint32_t parallelism, byte[] pwd, Size_t pwdlen, byte[] salt, Size_t saltlen, Size_t hashlen, byte[] encoded, Size_t encodedlen)
t_cost - Number of iterationsm_cost - Sets memory usage to m_cost kibibytesparallelism - Number of threads and compute lanespwd - Pointer to passwordpwdlen - Password size in bytessalt - Pointer to saltsaltlen - Salt size in byteshashlen - Desired length of the hash in bytesencoded - Buffer where to write the encoded hashencodedlen - Size of the buffer (thus max size of the encoded hash)ARGON2_OK if successfulint argon2d_hash_encoded(Uint32_t t_cost, Uint32_t m_cost, Uint32_t parallelism, byte[] pwd, Size_t pwdlen, byte[] salt, Size_t saltlen, Size_t hashlen, byte[] encoded, Size_t encodedlen)
t_cost - Number of iterationsm_cost - Sets memory usage to m_cost kibibytesparallelism - Number of threads and compute lanespwd - Pointer to passwordpwdlen - Password size in bytessalt - Pointer to saltsaltlen - Salt size in byteshashlen - Desired length of the hash in bytesencoded - Buffer where to write the encoded hashencodedlen - Size of the buffer (thus max size of the encoded hash)ARGON2_OK if successfulint argon2i_verify(byte[] encoded,
byte[] pwd,
Size_t pwdlen)
encoded - String encoding parameters, salt, hashpwd - Pointer to passwordpwdlen - Password size in bytesint argon2d_verify(byte[] encoded,
byte[] pwd,
Size_t pwdlen)
encoded - String encoding parameters, salt, hashpwd - Pointer to passwordpwdlen - Password size in bytesint argon2id_verify(byte[] encoded,
byte[] pwd,
Size_t pwdlen)
encoded - String encoding parameters, salt, hashpwd - Pointer to passwordpwdlen - Password size in bytesSize_t argon2_encodedlen(Uint32_t t_cost, Uint32_t m_cost, Uint32_t parallelism, Uint32_t saltlen, Uint32_t hashlen, Argon2_type type)
t_cost - Number of iterations.m_cost - Memory usage in kibibytes.parallelism - Number of threads; used to compute lanes.saltlen - Salt size in bytes.hashlen - Hash size in bytes.type - The argon2 type.java.lang.String argon2_error_message(int error_code)
error_code - Numeric error code.