Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Commitment.java « crypto « spongycastle « org « java « main « src « core - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9f5bcdf92fe7898fcb92b734bdc300a87542efdb (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package org.spongycastle.crypto;

/**
 * General holding class for a commitment.
 */
public class Commitment
{
    private final byte[] secret;
    private final byte[] commitment;

    /**
     * Base constructor.
     *
     * @param secret  an encoding of the secret required to reveal the commitment.
     * @param commitment  an encoding of the sealed commitment.
     */
    public Commitment(byte[] secret, byte[] commitment)
    {
        this.secret = secret;
        this.commitment = commitment;
    }

    /**
     * The secret required to reveal the commitment.
     *
     * @return an encoding of the secret associated with the commitment.
     */
    public byte[] getSecret()
    {
        return secret;
    }

    /**
     * The sealed commitment.
     *
     * @return an encoding of the sealed commitment.
     */
    public byte[] getCommitment()
    {
        return commitment;
    }
}