@@ -134,6 +134,71 @@ public interface Argon2Advanced extends Argon2 {
134134 */
135135 HashResult hashAdvanced (int iterations , int memory , int parallelism , byte [] password , byte [] salt , int hashLength , Argon2Version version );
136136
137+ /**
138+ * Hashes a password, using the given salt, secret and associated data.
139+ *
140+ * @param iterations Number of iterations
141+ * @param memory Sets memory usage to x kibibytes
142+ * @param parallelism Number of threads and compute lanes
143+ * @param password Password to hash
144+ * @param charset Charset of the password
145+ * @param salt Salt
146+ * @param secret Secret (sometimes referred as Pepper)
147+ * @param associatedData Associated Data
148+ * @return Hashed password in raw bytes.
149+ */
150+ byte [] rawHashAdvanced (int iterations , int memory , int parallelism , char [] password , Charset charset , byte [] salt , byte [] secret , byte [] associatedData );
151+
152+ /**
153+ * Advanced version of hash, let the caller specify addition parameters such as hash length, salt, secret and associated data.
154+ * Return both the encoded and the raw hash.
155+ *
156+ * @param iterations Number of iterations
157+ * @param memory Sets memory usage to x kibibytes
158+ * @param parallelism Number of threads and compute lanes
159+ * @param password Password to hash
160+ * @param salt Salt
161+ * @param secret Secret (sometimes referred as Pepper)
162+ * @param associatedData Associated Data
163+ * @param hashLength Length of the returned hash in bytes.
164+ * @param version Argon2 version
165+ * @return Hashed password in raw bytes.
166+ */
167+ byte [] rawHashAdvanced (int iterations , int memory , int parallelism , byte [] password , byte [] salt , byte [] secret , byte [] associatedData , int hashLength , Argon2Version version );
168+
169+ /**
170+ * Verifies a password against a hash.
171+ *
172+ * @param iterations Number of iterations
173+ * @param memory Sets memory usage to x kibibytes
174+ * @param parallelism Number of threads and compute lanes
175+ * @param password Password to hash
176+ * @param charset Charset of the password
177+ * @param salt Salt
178+ * @param secret Secret (sometimes referred as Pepper)
179+ * @param associatedData Associated Data
180+ * @param rawHash Raw Hash bytes.
181+ * @return True if the password matches the hash, false otherwise.
182+ */
183+ boolean verifyAdvanced (int iterations , int memory , int parallelism , char [] password , Charset charset , byte [] salt , byte [] secret , byte [] associatedData , byte [] rawHash );
184+
185+ /**
186+ * Verifies a password against a hash.
187+ *
188+ * @param iterations Number of iterations
189+ * @param memory Sets memory usage to x kibibytes
190+ * @param parallelism Number of threads and compute lanes
191+ * @param password Password to hash
192+ * @param salt Salt
193+ * @param secret Secret (sometimes referred as Pepper)
194+ * @param associatedData Associated Data
195+ * @param hashLength Length of the returned hash in bytes.
196+ * @param version Argon2 version
197+ * @param rawHash Raw Hash bytes.
198+ * @return True if the password matches the hash, false otherwise.
199+ */
200+ boolean verifyAdvanced (int iterations , int memory , int parallelism , byte [] password , byte [] salt , byte [] secret , byte [] associatedData , int hashLength , Argon2Version version , byte [] rawHash );
201+
137202 /**
138203 * Generates salt with the default length.
139204 *
0 commit comments