what-the-bank/sources/org/bouncycastle/crypto/engines/RSAEngine.java

37 lines
1.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto.engines;
import org.bouncycastle.crypto.AsymmetricBlockCipher;
import org.bouncycastle.crypto.CipherParameters;
/* loaded from: classes6.dex */
public class RSAEngine implements AsymmetricBlockCipher {
private RSACoreEngine core;
@Override // org.bouncycastle.crypto.AsymmetricBlockCipher
public byte[] processBlock(byte[] bArr, int i, int i2) {
RSACoreEngine rSACoreEngine = this.core;
if (rSACoreEngine != null) {
return rSACoreEngine.convertOutput(rSACoreEngine.processBlock(rSACoreEngine.convertInput(bArr, i, i2)));
}
throw new IllegalStateException("RSA engine not initialised");
}
@Override // org.bouncycastle.crypto.AsymmetricBlockCipher
public void init(boolean z, CipherParameters cipherParameters) {
if (this.core == null) {
this.core = new RSACoreEngine();
}
this.core.init(z, cipherParameters);
}
@Override // org.bouncycastle.crypto.AsymmetricBlockCipher
public int getOutputBlockSize() {
return this.core.getOutputBlockSize();
}
@Override // org.bouncycastle.crypto.AsymmetricBlockCipher
public int getInputBlockSize() {
return this.core.getInputBlockSize();
}
}