aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/BasicAgreement.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/BasicAgreement.java')
-rw-r--r--libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/BasicAgreement.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/BasicAgreement.java b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/BasicAgreement.java
new file mode 100644
index 000000000..e6e003c63
--- /dev/null
+++ b/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/BasicAgreement.java
@@ -0,0 +1,26 @@
+package org.spongycastle.crypto;
+
+import java.math.BigInteger;
+
+/**
+ * The basic interface that basic Diffie-Hellman implementations
+ * conforms to.
+ */
+public interface BasicAgreement
+{
+ /**
+ * initialise the agreement engine.
+ */
+ void init(CipherParameters param);
+
+ /**
+ * return the field size for the agreement algorithm in bytes.
+ */
+ int getFieldSize();
+
+ /**
+ * given a public key from a given party calculate the next
+ * message in the agreement sequence.
+ */
+ BigInteger calculateAgreement(CipherParameters pubKey);
+}