/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.herumi.bls;

public class Signature {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected Signature(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(Signature obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        BlsJNI.delete_Signature(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public Signature() {
    this(BlsJNI.new_Signature__SWIG_0(), true);
  }

  public Signature(Signature rhs) {
    this(BlsJNI.new_Signature__SWIG_1(Signature.getCPtr(rhs), rhs), true);
  }

  public boolean equals(Signature rhs) {
    return BlsJNI.Signature_equals(swigCPtr, this, Signature.getCPtr(rhs), rhs);
  }

  public boolean isZero() {
    return BlsJNI.Signature_isZero(swigCPtr, this);
  }

  public void setStr(String str) {
    BlsJNI.Signature_setStr(swigCPtr, this, str);
  }

  public void clear() {
    BlsJNI.Signature_clear(swigCPtr, this);
  }

  public String toString() {
    return BlsJNI.Signature_toString(swigCPtr, this);
  }

  public void deserialize(byte[] cbuf) {
    BlsJNI.Signature_deserialize(swigCPtr, this, cbuf);
  }

  public byte[] serialize() { return BlsJNI.Signature_serialize(swigCPtr, this); }

  public void add(Signature rhs) {
    BlsJNI.Signature_add(swigCPtr, this, Signature.getCPtr(rhs), rhs);
  }

  public void sub(Signature rhs) {
    BlsJNI.Signature_sub(swigCPtr, this, Signature.getCPtr(rhs), rhs);
  }

  public void mul(SecretKey rhs) {
    BlsJNI.Signature_mul(swigCPtr, this, SecretKey.getCPtr(rhs), rhs);
  }

  public void neg() {
    BlsJNI.Signature_neg(swigCPtr, this);
  }

  public boolean verify(PublicKey pub, byte[] cbuf) {
    return BlsJNI.Signature_verify(swigCPtr, this, PublicKey.getCPtr(pub), pub, cbuf);
  }

  public boolean verifyHash(PublicKey pub, byte[] cbuf) {
    return BlsJNI.Signature_verifyHash(swigCPtr, this, PublicKey.getCPtr(pub), pub, cbuf);
  }

  public void recover(SignatureVec sigVec, SecretKeyVec idVec) {
    BlsJNI.Signature_recover(swigCPtr, this, SignatureVec.getCPtr(sigVec), sigVec, SecretKeyVec.getCPtr(idVec), idVec);
  }

  public void setHashOf(byte[] cbuf) {
    BlsJNI.Signature_setHashOf(swigCPtr, this, cbuf);
  }

  public void aggregate(SignatureVec sigVec) {
    BlsJNI.Signature_aggregate(swigCPtr, this, SignatureVec.getCPtr(sigVec), sigVec);
  }

  public boolean fastAggregateVerify(PublicKeyVec pubVec, byte[] cbuf) {
    return BlsJNI.Signature_fastAggregateVerify(swigCPtr, this, PublicKeyVec.getCPtr(pubVec), pubVec, cbuf);
  }

  public boolean aggregateVerifyNoCheck(PublicKeyVec pubVec, byte[] cbuf) {
    return BlsJNI.Signature_aggregateVerifyNoCheck(swigCPtr, this, PublicKeyVec.getCPtr(pubVec), pubVec, cbuf);
  }

  public boolean aggregateVerify(PublicKeyVec pubVec, byte[] cbuf) {
    return BlsJNI.Signature_aggregateVerify(swigCPtr, this, PublicKeyVec.getCPtr(pubVec), pubVec, cbuf);
  }

}
