All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.spongycastle.crypto.Commitment Maven / Gradle / Ivy

Go to download

Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for the Android platform. Android unfortunately ships with a stripped-down version of Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full, up-to-date version of the Bouncy Castle cryptographic libs.

There is a newer version: 1.58.0.0
Show newest version
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;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy