/*
 * 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.cryptolib.mathematical.groups.impl.Exponent;
import com.scytl.products.ov.mixnet.commons.homomorphic.Randomness;

/**
 * This class encapsulates the answer that is generated by the {@link BasicAnswerGenerator}.
 */
public class MultiExponentiationBasicProofAnswer {

    private final Exponent[] a;

    private final Exponent r;

    private final Exponent b;

    private final Exponent s;

    private final Randomness tau;

    @JsonCreator
    public MultiExponentiationBasicProofAnswer(@JsonProperty("exponentsA") final Exponent[] a,
            @JsonProperty("exponentR") final Exponent r, @JsonProperty("exponentsB") final Exponent b,
            @JsonProperty("exponentS") final Exponent s, @JsonProperty("randomnessTau") final Randomness tau) {
        this.a = a;
        this.r = r;
        this.b = b;
        this.s = s;
        this.tau = tau;
    }

    /**
     * @return Returns the a.
     */
    public Exponent[] getExponentsA() {
        return a;
    }

    /**
     * @return Returns the r.
     */
    public Exponent getExponentR() {
        return r;
    }

    /**
     * @return Returns the b.
     */
    public Exponent getExponentsB() {
        return b;
    }

    /**
     * @return Returns the s.
     */
    public Exponent getExponentS() {
        return s;
    }

    /**
     * @return Returns the tau.
     */
    public Randomness getRandomnessTau() {
        return tau;
    }

    @Override
    public String toString() {
        final StringBuilder strbldr = new StringBuilder();
        for (final Exponent a_a : a) {
            strbldr.append(a_a.toString());
        }
        strbldr.append(r.toString());

        strbldr.append(b.toString());

        strbldr.append(s.toString());

        return strbldr.toString();
    }
}
