public NoPadding() { super(new ElGamalEngine()); } }
: getInputBlockSize(); byte[] output = new byte[this.getOutputBlockSize()];
: getInputBlockSize(); byte[] output = new byte[this.getOutputBlockSize()];
public NoPadding() { super(new ElGamalEngine()); } }
public PKCS1v1_5Padding() { super(new PKCS1Encoding(new ElGamalEngine())); } }
public PKCS1v1_5Padding() { super(new PKCS1Encoding(new ElGamalEngine())); } }
private void initFromSpec( OAEPParameterSpec pSpec) throws NoSuchPaddingException { MGF1ParameterSpec mgfParams = (MGF1ParameterSpec)pSpec.getMGFParameters(); Digest digest = DigestFactory.getDigest(mgfParams.getDigestAlgorithm()); if (digest == null) { throw new NoSuchPaddingException("no match on OAEP constructor for digest algorithm: "+ mgfParams.getDigestAlgorithm()); } cipher = new BufferedAsymmetricBlockCipher(new OAEPEncoding(new ElGamalEngine(), digest, ((PSource.PSpecified)pSpec.getPSource()).getValue())); paramSpec = pSpec; }
private void initFromSpec( OAEPParameterSpec pSpec) throws NoSuchPaddingException { MGF1ParameterSpec mgfParams = (MGF1ParameterSpec)pSpec.getMGFParameters(); Digest digest = DigestFactory.getDigest(mgfParams.getDigestAlgorithm()); if (digest == null) { throw new NoSuchPaddingException("no match on OAEP constructor for digest algorithm: "+ mgfParams.getDigestAlgorithm()); } cipher = new BufferedAsymmetricBlockCipher(new OAEPEncoding(new ElGamalEngine(), digest, ((PSource.PSpecified)pSpec.getPSource()).getValue())); paramSpec = pSpec; }
cipher = new BufferedAsymmetricBlockCipher(new ElGamalEngine()); cipher = new BufferedAsymmetricBlockCipher(new PKCS1Encoding(new ElGamalEngine())); cipher = new BufferedAsymmetricBlockCipher(new ISO9796d1Encoding(new ElGamalEngine()));
cipher = new BufferedAsymmetricBlockCipher(new ElGamalEngine()); cipher = new BufferedAsymmetricBlockCipher(new PKCS1Encoding(new ElGamalEngine())); cipher = new BufferedAsymmetricBlockCipher(new ISO9796d1Encoding(new ElGamalEngine()));
static AsymmetricBlockCipher createPublicKeyCipher(int encAlgorithm) throws PGPException { AsymmetricBlockCipher c; switch (encAlgorithm) { case PGPPublicKey.RSA_ENCRYPT: case PGPPublicKey.RSA_GENERAL: c = new PKCS1Encoding(new RSABlindedEngine()); break; case PGPPublicKey.ELGAMAL_ENCRYPT: case PGPPublicKey.ELGAMAL_GENERAL: c = new PKCS1Encoding(new ElGamalEngine()); break; case PGPPublicKey.DSA: throw new PGPException("Can't use DSA for encryption."); case PGPPublicKey.ECDSA: throw new PGPException("Can't use ECDSA for encryption."); case PGPPublicKey.ECDH: throw new PGPException("Not implemented."); default: throw new PGPException("unknown asymmetric algorithm: " + encAlgorithm); } return c; } }