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) val plaintext = (blindPlaintext * rInv).mod(m)
// defend against CRT faults (see https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf) // defend against CRT faults (see https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf)
if (plaintext.modPow(e, m) != ciphertext) { check(plaintext.modPow(e, m) == ciphertext)
throw IllegalStateException()
}
return plaintext return plaintext
} else { } else {

Loading…
Cancel
Save