replace IllegalArgumentException with require
This commit is contained in:
@@ -12,8 +12,8 @@ class PBKDF2(
|
|||||||
function: HashFunction,
|
function: HashFunction,
|
||||||
) : KDF {
|
) : KDF {
|
||||||
init {
|
init {
|
||||||
if (bytes < 1) throw IllegalArgumentException()
|
require(bytes > 0)
|
||||||
if (iterations < 1) throw IllegalArgumentException()
|
require(iterations > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val mac = HMAC(function)
|
private val mac = HMAC(function)
|
||||||
|
|||||||
Reference in New Issue
Block a user