/*
 * Copyright 2018 Scytl Secure Electronic Voting SA
 *
 * All rights reserved
 *
 * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
 */
package com.scytl.products.ov.mixnet.commons.beans.proofs;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.scytl.products.ov.mixnet.commons.proofs.bg.commitments.PublicCommitment;

/**
 * Encapsulates the message generated by a {@link ProductProofGenerator}.
 */
public final class ProductProofMessage {

    private final SingleValueProductProofInitialMessage iniSVA;

    private final SingleValueProductProofAnswer ansSVA;

    private final HadamardProductProofInitialMessage iniHPA;

    private final HadamardProductProofAnswer ansHPA;

    private final PublicCommitment cB;

    @JsonCreator
    public ProductProofMessage(@JsonProperty("commitmentPublicB") final PublicCommitment cB,
            @JsonProperty("iniSVA") final SingleValueProductProofInitialMessage iniSVA,
            @JsonProperty("ansSVA") final SingleValueProductProofAnswer ansSVA,
            @JsonProperty("iniHPA") final HadamardProductProofInitialMessage iniHPA,
            @JsonProperty("ansHPA") final HadamardProductProofAnswer ansHPA) {
    	this.cB = cB;
    	this.iniSVA = iniSVA;
    	this.ansSVA = ansSVA;
    	this.iniHPA = iniHPA;
    	this.ansHPA = ansHPA;
    }

    /**
     * @return Returns the iniSVA.
     */
    public SingleValueProductProofInitialMessage getIniSVA() {
        return iniSVA;
    }

    /**
     * @return Returns the ansSVA.
     */
    public SingleValueProductProofAnswer getAnsSVA() {
        return ansSVA;
    }

    /**
     * @return Returns the iniHPA.
     */
    public HadamardProductProofInitialMessage getIniHPA() {
        return iniHPA;
    }

    /**
     * @return Returns the ansHPA.
     */
    public HadamardProductProofAnswer getAnsHPA() {
        return ansHPA;
    }

    /**
     * @return Returns the cB.
     */
    public PublicCommitment getCommitmentPublicB() {
        return cB;
    }

    @Override
    public String toString() {
        return cB.toString() + iniSVA.toString() + ansSVA.toString() + iniHPA.toString() + ansHPA.toString();
    }
}
