aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/core/src/main/java/org/spongycastle/crypto/BasicAgreement.java
blob: e6e003c637e028fcdfd28e41f4f2e37f97923236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
}