37 lines
1.2 KiB
Java
37 lines
1.2 KiB
Java
|
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();
|
||
|
}
|
||
|
}
|