Replace if/throw with check() in the Rsa object

bzip2
Graham 5 years ago
parent 89b274077f
commit 06de9d1449
  1. 4
      common/src/main/java/dev/openrs2/common/crypto/Rsa.kt

@ -120,9 +120,7 @@ object Rsa {
val plaintext = (blindPlaintext * rInv).mod(m)
// defend against CRT faults (see https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf)
if (plaintext.modPow(e, m) != ciphertext) {
throw IllegalStateException()
}
check(plaintext.modPow(e, m) == ciphertext)
return plaintext
} else {

Loading…
Cancel
Save