aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECElGamalDecryptor.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECElGamalDecryptor.java')
-rw-r--r--libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECElGamalDecryptor.java48
1 files changed, 0 insertions, 48 deletions
diff --git a/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECElGamalDecryptor.java b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECElGamalDecryptor.java
deleted file mode 100644
index 31bd6381c..000000000
--- a/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/ec/ECElGamalDecryptor.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.spongycastle.crypto.ec;
-
-import org.spongycastle.crypto.CipherParameters;
-import org.spongycastle.crypto.params.ECPrivateKeyParameters;
-import org.spongycastle.math.ec.ECPoint;
-
-/**
- * this does your basic decryption ElGamal style using EC
- */
-public class ECElGamalDecryptor
- implements ECDecryptor
-{
- private ECPrivateKeyParameters key;
-
- /**
- * initialise the decryptor.
- *
- * @param param the necessary EC key parameters.
- */
- public void init(
- CipherParameters param)
- {
- if (!(param instanceof ECPrivateKeyParameters))
- {
- throw new IllegalArgumentException("ECPrivateKeyParameters are required for decryption.");
- }
-
- this.key = (ECPrivateKeyParameters)param;
- }
-
- /**
- * Decrypt an EC pair producing the original EC point.
- *
- * @param pair the EC point pair to process.
- * @return the result of the Elgamal process.
- */
- public ECPoint decrypt(ECPair pair)
- {
- if (key == null)
- {
- throw new IllegalStateException("ECElGamalDecryptor not initialised");
- }
-
- ECPoint tmp = pair.getX().multiply(key.getD());
-
- return pair.getY().add(tmp.negate()).normalize();
- }
-}