Interface GenericHash.Lazy
- All Known Implementing Classes:
LazySodium,LazySodiumJava
- Enclosing interface:
- GenericHash
public static interface GenericHash.Lazy
-
Method Summary
Modifier and TypeMethodDescriptionHash a string without a key.cryptoGenericHash(String in, Key key) Hash a string with a key, so later on you can verify the hashed string with the key.cryptoGenericHashFinal(byte[] state, int outLen) Finalise the hashing operation.booleancryptoGenericHashInit(byte[] state, Key key, int outLen) Initialise a multi-part hashing operation.Generate a hashing key.cryptoGenericHashKeygen(int size) Generate a hashing key with a size.booleancryptoGenericHashUpdate(byte[] state, String in) Hash a part of a multi-part hash.
-
Method Details
-
cryptoGenericHashKeygen
Key cryptoGenericHashKeygen()Generate a hashing key.- Returns:
- A hashing key.
-
cryptoGenericHashKeygen
Generate a hashing key with a size.- Parameters:
size- The size of the hashing key betweenGenericHash.KEYBYTESandGenericHash.KEYBYTES_MAX.- Returns:
- A hashing key.
- Throws:
SodiumException
-
cryptoGenericHash
Hash a string without a key.- Parameters:
in- The string to hash.- Returns:
- The hashed string.
- Throws:
SodiumException
-
cryptoGenericHash
Hash a string with a key, so later on you can verify the hashed string with the key. If you're hashing a password please seePwHash.Lazy.cryptoPwHashStr(String, long, NativeLong)} instead.- Parameters:
in- The string to hash.key- Can be null.- Returns:
- A hashed string.
- Throws:
SodiumException
-
cryptoGenericHashInit
Initialise a multi-part hashing operation.- Parameters:
state- The state which holds the key and operation.key- The key as generated bycryptoGenericHashKeygen().outLen- The size of the final hash.- Returns:
- True if initialised.
-
cryptoGenericHashUpdate
Hash a part of a multi-part hash.- Parameters:
state- State as put intocryptoGenericHashInit(byte[], Key, int).in- A part of a string to hash.- Returns:
- True if hashed successfully.
- Throws:
SodiumException
-
cryptoGenericHashFinal
Finalise the hashing operation.- Parameters:
state- State as put intocryptoGenericHashInit(byte[], Key, int).outLen- The size of the final hash.- Returns:
- The final hash.
- Throws:
SodiumException
-