From 06de9d14499e1e6c1c1cefb101570220bafbb318 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 25 Jan 2020 15:42:41 +0000 Subject: [PATCH] Replace if/throw with check() in the Rsa object --- common/src/main/java/dev/openrs2/common/crypto/Rsa.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/src/main/java/dev/openrs2/common/crypto/Rsa.kt b/common/src/main/java/dev/openrs2/common/crypto/Rsa.kt index 56bff81f..57e8841e 100644 --- a/common/src/main/java/dev/openrs2/common/crypto/Rsa.kt +++ b/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 {