[java] jni for BN254(old)

update-fork
MITSUNARI Shigeo 5 years ago
parent 977053396a
commit 17d2b0c18d
  1. 1
      ffi/java/Makefile
  2. 88
      ffi/java/com/herumi/mcl/Bn256.java
  3. 68
      ffi/java/com/herumi/mcl/Bn256JNI.java
  4. 66
      ffi/java/com/herumi/mcl/CipherText.java
  5. 38
      ffi/java/com/herumi/mcl/Elgamal.java
  6. 51
      ffi/java/com/herumi/mcl/ElgamalJNI.java
  7. 78
      ffi/java/com/herumi/mcl/Fr.java
  8. 74
      ffi/java/com/herumi/mcl/G1.java
  9. 70
      ffi/java/com/herumi/mcl/G2.java
  10. 62
      ffi/java/com/herumi/mcl/GT.java
  11. 86
      ffi/java/com/herumi/mcl/PrivateKey.java
  12. 82
      ffi/java/com/herumi/mcl/PublicKey.java
  13. 26
      ffi/java/com/herumi/mcl/SWIGTYPE_p_bool.java

@ -9,6 +9,7 @@ else
LDFLAGS+=-lrt
endif
CFLAGS+=$(JAVA_INC) $(JAVA_INC)/linux -I $(TOP_DIR)/include -I $(TOP_DIR)/../xbyak -I $(TOP_DIR)/../cybozulib/include -Wno-strict-aliasing
CFLAGS+=-std=c++03
MCL_LIB=$(TOP_DIR)/lib/libmcl.a
PACKAGE_NAME=com.herumi.mcl

@ -0,0 +1,88 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class Bn256 {
public static void SystemInit() {
Bn256JNI.SystemInit();
}
public static void neg(Fr y, Fr x) {
Bn256JNI.neg__SWIG_0(Fr.getCPtr(y), y, Fr.getCPtr(x), x);
}
public static void add(Fr z, Fr x, Fr y) {
Bn256JNI.add__SWIG_0(Fr.getCPtr(z), z, Fr.getCPtr(x), x, Fr.getCPtr(y), y);
}
public static void sub(Fr z, Fr x, Fr y) {
Bn256JNI.sub__SWIG_0(Fr.getCPtr(z), z, Fr.getCPtr(x), x, Fr.getCPtr(y), y);
}
public static void mul(Fr z, Fr x, Fr y) {
Bn256JNI.mul__SWIG_0(Fr.getCPtr(z), z, Fr.getCPtr(x), x, Fr.getCPtr(y), y);
}
public static void mul(G1 z, G1 x, Fr y) {
Bn256JNI.mul__SWIG_1(G1.getCPtr(z), z, G1.getCPtr(x), x, Fr.getCPtr(y), y);
}
public static void mul(G2 z, G2 x, Fr y) {
Bn256JNI.mul__SWIG_2(G2.getCPtr(z), z, G2.getCPtr(x), x, Fr.getCPtr(y), y);
}
public static void div(Fr z, Fr x, Fr y) {
Bn256JNI.div(Fr.getCPtr(z), z, Fr.getCPtr(x), x, Fr.getCPtr(y), y);
}
public static void pow(GT z, GT x, Fr y) {
Bn256JNI.pow(GT.getCPtr(z), z, GT.getCPtr(x), x, Fr.getCPtr(y), y);
}
public static void neg(G1 y, G1 x) {
Bn256JNI.neg__SWIG_1(G1.getCPtr(y), y, G1.getCPtr(x), x);
}
public static void dbl(G1 y, G1 x) {
Bn256JNI.dbl__SWIG_0(G1.getCPtr(y), y, G1.getCPtr(x), x);
}
public static void add(G1 z, G1 x, G1 y) {
Bn256JNI.add__SWIG_1(G1.getCPtr(z), z, G1.getCPtr(x), x, G1.getCPtr(y), y);
}
public static void sub(G1 z, G1 x, G1 y) {
Bn256JNI.sub__SWIG_1(G1.getCPtr(z), z, G1.getCPtr(x), x, G1.getCPtr(y), y);
}
public static void pairing(GT e, G1 P, G2 Q) {
Bn256JNI.pairing(GT.getCPtr(e), e, G1.getCPtr(P), P, G2.getCPtr(Q), Q);
}
public static void neg(G2 y, G2 x) {
Bn256JNI.neg__SWIG_2(G2.getCPtr(y), y, G2.getCPtr(x), x);
}
public static void dbl(G2 y, G2 x) {
Bn256JNI.dbl__SWIG_1(G2.getCPtr(y), y, G2.getCPtr(x), x);
}
public static void add(G2 z, G2 x, G2 y) {
Bn256JNI.add__SWIG_2(G2.getCPtr(z), z, G2.getCPtr(x), x, G2.getCPtr(y), y);
}
public static void sub(G2 z, G2 x, G2 y) {
Bn256JNI.sub__SWIG_2(G2.getCPtr(z), z, G2.getCPtr(x), x, G2.getCPtr(y), y);
}
public static void mul(GT z, GT x, GT y) {
Bn256JNI.mul__SWIG_3(GT.getCPtr(z), z, GT.getCPtr(x), x, GT.getCPtr(y), y);
}
}

@ -0,0 +1,68 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class Bn256JNI {
public final static native void SystemInit();
public final static native void neg__SWIG_0(long jarg1, Fr jarg1_, long jarg2, Fr jarg2_);
public final static native void add__SWIG_0(long jarg1, Fr jarg1_, long jarg2, Fr jarg2_, long jarg3, Fr jarg3_);
public final static native void sub__SWIG_0(long jarg1, Fr jarg1_, long jarg2, Fr jarg2_, long jarg3, Fr jarg3_);
public final static native void mul__SWIG_0(long jarg1, Fr jarg1_, long jarg2, Fr jarg2_, long jarg3, Fr jarg3_);
public final static native void mul__SWIG_1(long jarg1, G1 jarg1_, long jarg2, G1 jarg2_, long jarg3, Fr jarg3_);
public final static native void mul__SWIG_2(long jarg1, G2 jarg1_, long jarg2, G2 jarg2_, long jarg3, Fr jarg3_);
public final static native void div(long jarg1, Fr jarg1_, long jarg2, Fr jarg2_, long jarg3, Fr jarg3_);
public final static native void pow(long jarg1, GT jarg1_, long jarg2, GT jarg2_, long jarg3, Fr jarg3_);
public final static native long new_Fr__SWIG_0();
public final static native long new_Fr__SWIG_1(long jarg1, Fr jarg1_);
public final static native long new_Fr__SWIG_2(int jarg1);
public final static native long new_Fr__SWIG_3(String jarg1);
public final static native boolean Fr_equals(long jarg1, Fr jarg1_, long jarg2, Fr jarg2_);
public final static native void Fr_setStr(long jarg1, Fr jarg1_, String jarg2);
public final static native void Fr_setInt(long jarg1, Fr jarg1_, int jarg2);
public final static native void Fr_clear(long jarg1, Fr jarg1_);
public final static native void Fr_setRand(long jarg1, Fr jarg1_);
public final static native String Fr_toString(long jarg1, Fr jarg1_);
public final static native void delete_Fr(long jarg1);
public final static native void neg__SWIG_1(long jarg1, G1 jarg1_, long jarg2, G1 jarg2_);
public final static native void dbl__SWIG_0(long jarg1, G1 jarg1_, long jarg2, G1 jarg2_);
public final static native void add__SWIG_1(long jarg1, G1 jarg1_, long jarg2, G1 jarg2_, long jarg3, G1 jarg3_);
public final static native void sub__SWIG_1(long jarg1, G1 jarg1_, long jarg2, G1 jarg2_, long jarg3, G1 jarg3_);
public final static native void pairing(long jarg1, GT jarg1_, long jarg2, G1 jarg2_, long jarg3, G2 jarg3_);
public final static native long new_G1__SWIG_0();
public final static native long new_G1__SWIG_1(long jarg1, G1 jarg1_);
public final static native long new_G1__SWIG_2(String jarg1, String jarg2);
public final static native boolean G1_equals(long jarg1, G1 jarg1_, long jarg2, G1 jarg2_);
public final static native void G1_set(long jarg1, G1 jarg1_, String jarg2, String jarg3);
public final static native void G1_hashAndMapToG1(long jarg1, G1 jarg1_, String jarg2);
public final static native void G1_clear(long jarg1, G1 jarg1_);
public final static native void G1_setStr(long jarg1, G1 jarg1_, String jarg2);
public final static native String G1_toString(long jarg1, G1 jarg1_);
public final static native void delete_G1(long jarg1);
public final static native void neg__SWIG_2(long jarg1, G2 jarg1_, long jarg2, G2 jarg2_);
public final static native void dbl__SWIG_1(long jarg1, G2 jarg1_, long jarg2, G2 jarg2_);
public final static native void add__SWIG_2(long jarg1, G2 jarg1_, long jarg2, G2 jarg2_, long jarg3, G2 jarg3_);
public final static native void sub__SWIG_2(long jarg1, G2 jarg1_, long jarg2, G2 jarg2_, long jarg3, G2 jarg3_);
public final static native long new_G2__SWIG_0();
public final static native long new_G2__SWIG_1(long jarg1, G2 jarg1_);
public final static native long new_G2__SWIG_2(String jarg1, String jarg2, String jarg3, String jarg4);
public final static native boolean G2_equals(long jarg1, G2 jarg1_, long jarg2, G2 jarg2_);
public final static native void G2_set(long jarg1, G2 jarg1_, String jarg2, String jarg3, String jarg4, String jarg5);
public final static native void G2_clear(long jarg1, G2 jarg1_);
public final static native void G2_setStr(long jarg1, G2 jarg1_, String jarg2);
public final static native String G2_toString(long jarg1, G2 jarg1_);
public final static native void delete_G2(long jarg1);
public final static native void mul__SWIG_3(long jarg1, GT jarg1_, long jarg2, GT jarg2_, long jarg3, GT jarg3_);
public final static native long new_GT__SWIG_0();
public final static native long new_GT__SWIG_1(long jarg1, GT jarg1_);
public final static native boolean GT_equals(long jarg1, GT jarg1_, long jarg2, GT jarg2_);
public final static native void GT_clear(long jarg1, GT jarg1_);
public final static native void GT_setStr(long jarg1, GT jarg1_, String jarg2);
public final static native String GT_toString(long jarg1, GT jarg1_);
public final static native void delete_GT(long jarg1);
}

@ -0,0 +1,66 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class CipherText {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected CipherText(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(CipherText obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
ElgamalJNI.delete_CipherText(swigCPtr);
}
swigCPtr = 0;
}
}
public String toStr() {
return ElgamalJNI.CipherText_toStr(swigCPtr, this);
}
public String toString() {
return ElgamalJNI.CipherText_toString(swigCPtr, this);
}
public void fromStr(String str) {
ElgamalJNI.CipherText_fromStr(swigCPtr, this, str);
}
public void add(CipherText c) {
ElgamalJNI.CipherText_add(swigCPtr, this, CipherText.getCPtr(c), c);
}
public void mul(int m) {
ElgamalJNI.CipherText_mul__SWIG_0(swigCPtr, this, m);
}
public void mul(String str) {
ElgamalJNI.CipherText_mul__SWIG_1(swigCPtr, this, str);
}
public CipherText() {
this(ElgamalJNI.new_CipherText(), true);
}
}

@ -0,0 +1,38 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class Elgamal {
public static SWIGTYPE_p_bool new_p_bool() {
long cPtr = ElgamalJNI.new_p_bool();
return (cPtr == 0) ? null : new SWIGTYPE_p_bool(cPtr, false);
}
public static SWIGTYPE_p_bool copy_p_bool(boolean value) {
long cPtr = ElgamalJNI.copy_p_bool(value);
return (cPtr == 0) ? null : new SWIGTYPE_p_bool(cPtr, false);
}
public static void delete_p_bool(SWIGTYPE_p_bool obj) {
ElgamalJNI.delete_p_bool(SWIGTYPE_p_bool.getCPtr(obj));
}
public static void p_bool_assign(SWIGTYPE_p_bool obj, boolean value) {
ElgamalJNI.p_bool_assign(SWIGTYPE_p_bool.getCPtr(obj), value);
}
public static boolean p_bool_value(SWIGTYPE_p_bool obj) {
return ElgamalJNI.p_bool_value(SWIGTYPE_p_bool.getCPtr(obj));
}
public static void SystemInit(String param) {
ElgamalJNI.SystemInit(param);
}
}

@ -0,0 +1,51 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class ElgamalJNI {
public final static native long new_p_bool();
public final static native long copy_p_bool(boolean jarg1);
public final static native void delete_p_bool(long jarg1);
public final static native void p_bool_assign(long jarg1, boolean jarg2);
public final static native boolean p_bool_value(long jarg1);
public final static native void SystemInit(String jarg1);
public final static native String CipherText_toStr(long jarg1, CipherText jarg1_);
public final static native String CipherText_toString(long jarg1, CipherText jarg1_);
public final static native void CipherText_fromStr(long jarg1, CipherText jarg1_, String jarg2);
public final static native void CipherText_add(long jarg1, CipherText jarg1_, long jarg2, CipherText jarg2_);
public final static native void CipherText_mul__SWIG_0(long jarg1, CipherText jarg1_, int jarg2);
public final static native void CipherText_mul__SWIG_1(long jarg1, CipherText jarg1_, String jarg2);
public final static native long new_CipherText();
public final static native void delete_CipherText(long jarg1);
public final static native String PublicKey_toStr(long jarg1, PublicKey jarg1_);
public final static native String PublicKey_toString(long jarg1, PublicKey jarg1_);
public final static native void PublicKey_fromStr(long jarg1, PublicKey jarg1_, String jarg2);
public final static native void PublicKey_save(long jarg1, PublicKey jarg1_, String jarg2);
public final static native void PublicKey_load(long jarg1, PublicKey jarg1_, String jarg2);
public final static native void PublicKey_enc__SWIG_0(long jarg1, PublicKey jarg1_, long jarg2, CipherText jarg2_, int jarg3);
public final static native void PublicKey_enc__SWIG_1(long jarg1, PublicKey jarg1_, long jarg2, CipherText jarg2_, String jarg3);
public final static native void PublicKey_rerandomize(long jarg1, PublicKey jarg1_, long jarg2, CipherText jarg2_);
public final static native void PublicKey_add__SWIG_0(long jarg1, PublicKey jarg1_, long jarg2, CipherText jarg2_, int jarg3);
public final static native void PublicKey_add__SWIG_1(long jarg1, PublicKey jarg1_, long jarg2, CipherText jarg2_, String jarg3);
public final static native long new_PublicKey();
public final static native void delete_PublicKey(long jarg1);
public final static native String PrivateKey_toStr(long jarg1, PrivateKey jarg1_);
public final static native String PrivateKey_toString(long jarg1, PrivateKey jarg1_);
public final static native void PrivateKey_fromStr(long jarg1, PrivateKey jarg1_, String jarg2);
public final static native void PrivateKey_save(long jarg1, PrivateKey jarg1_, String jarg2);
public final static native void PrivateKey_load(long jarg1, PrivateKey jarg1_, String jarg2);
public final static native void PrivateKey_init(long jarg1, PrivateKey jarg1_);
public final static native long PrivateKey_getPublicKey(long jarg1, PrivateKey jarg1_);
public final static native int PrivateKey_dec__SWIG_0(long jarg1, PrivateKey jarg1_, long jarg2, CipherText jarg2_, long jarg3);
public final static native int PrivateKey_dec__SWIG_1(long jarg1, PrivateKey jarg1_, long jarg2, CipherText jarg2_);
public final static native void PrivateKey_setCache(long jarg1, PrivateKey jarg1_, int jarg2, int jarg3);
public final static native void PrivateKey_clearCache(long jarg1, PrivateKey jarg1_);
public final static native long new_PrivateKey();
public final static native void delete_PrivateKey(long jarg1);
}

@ -0,0 +1,78 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class Fr {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected Fr(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(Fr obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
Bn256JNI.delete_Fr(swigCPtr);
}
swigCPtr = 0;
}
}
public Fr() {
this(Bn256JNI.new_Fr__SWIG_0(), true);
}
public Fr(Fr rhs) {
this(Bn256JNI.new_Fr__SWIG_1(Fr.getCPtr(rhs), rhs), true);
}
public Fr(int x) {
this(Bn256JNI.new_Fr__SWIG_2(x), true);
}
public Fr(String str) {
this(Bn256JNI.new_Fr__SWIG_3(str), true);
}
public boolean equals(Fr rhs) {
return Bn256JNI.Fr_equals(swigCPtr, this, Fr.getCPtr(rhs), rhs);
}
public void setStr(String str) {
Bn256JNI.Fr_setStr(swigCPtr, this, str);
}
public void setInt(int x) {
Bn256JNI.Fr_setInt(swigCPtr, this, x);
}
public void clear() {
Bn256JNI.Fr_clear(swigCPtr, this);
}
public void setRand() {
Bn256JNI.Fr_setRand(swigCPtr, this);
}
public String toString() {
return Bn256JNI.Fr_toString(swigCPtr, this);
}
}

@ -0,0 +1,74 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class G1 {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected G1(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(G1 obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
Bn256JNI.delete_G1(swigCPtr);
}
swigCPtr = 0;
}
}
public G1() {
this(Bn256JNI.new_G1__SWIG_0(), true);
}
public G1(G1 rhs) {
this(Bn256JNI.new_G1__SWIG_1(G1.getCPtr(rhs), rhs), true);
}
public G1(String x, String y) {
this(Bn256JNI.new_G1__SWIG_2(x, y), true);
}
public boolean equals(G1 rhs) {
return Bn256JNI.G1_equals(swigCPtr, this, G1.getCPtr(rhs), rhs);
}
public void set(String x, String y) {
Bn256JNI.G1_set(swigCPtr, this, x, y);
}
public void hashAndMapToG1(String m) {
Bn256JNI.G1_hashAndMapToG1(swigCPtr, this, m);
}
public void clear() {
Bn256JNI.G1_clear(swigCPtr, this);
}
public void setStr(String str) {
Bn256JNI.G1_setStr(swigCPtr, this, str);
}
public String toString() {
return Bn256JNI.G1_toString(swigCPtr, this);
}
}

@ -0,0 +1,70 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class G2 {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected G2(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(G2 obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
Bn256JNI.delete_G2(swigCPtr);
}
swigCPtr = 0;
}
}
public G2() {
this(Bn256JNI.new_G2__SWIG_0(), true);
}
public G2(G2 rhs) {
this(Bn256JNI.new_G2__SWIG_1(G2.getCPtr(rhs), rhs), true);
}
public G2(String xa, String xb, String ya, String yb) {
this(Bn256JNI.new_G2__SWIG_2(xa, xb, ya, yb), true);
}
public boolean equals(G2 rhs) {
return Bn256JNI.G2_equals(swigCPtr, this, G2.getCPtr(rhs), rhs);
}
public void set(String xa, String xb, String ya, String yb) {
Bn256JNI.G2_set(swigCPtr, this, xa, xb, ya, yb);
}
public void clear() {
Bn256JNI.G2_clear(swigCPtr, this);
}
public void setStr(String str) {
Bn256JNI.G2_setStr(swigCPtr, this, str);
}
public String toString() {
return Bn256JNI.G2_toString(swigCPtr, this);
}
}

@ -0,0 +1,62 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class GT {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected GT(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(GT obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
Bn256JNI.delete_GT(swigCPtr);
}
swigCPtr = 0;
}
}
public GT() {
this(Bn256JNI.new_GT__SWIG_0(), true);
}
public GT(GT rhs) {
this(Bn256JNI.new_GT__SWIG_1(GT.getCPtr(rhs), rhs), true);
}
public boolean equals(GT rhs) {
return Bn256JNI.GT_equals(swigCPtr, this, GT.getCPtr(rhs), rhs);
}
public void clear() {
Bn256JNI.GT_clear(swigCPtr, this);
}
public void setStr(String str) {
Bn256JNI.GT_setStr(swigCPtr, this, str);
}
public String toString() {
return Bn256JNI.GT_toString(swigCPtr, this);
}
}

@ -0,0 +1,86 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class PrivateKey {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected PrivateKey(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(PrivateKey obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
ElgamalJNI.delete_PrivateKey(swigCPtr);
}
swigCPtr = 0;
}
}
public String toStr() {
return ElgamalJNI.PrivateKey_toStr(swigCPtr, this);
}
public String toString() {
return ElgamalJNI.PrivateKey_toString(swigCPtr, this);
}
public void fromStr(String str) {
ElgamalJNI.PrivateKey_fromStr(swigCPtr, this, str);
}
public void save(String fileName) {
ElgamalJNI.PrivateKey_save(swigCPtr, this, fileName);
}
public void load(String fileName) {
ElgamalJNI.PrivateKey_load(swigCPtr, this, fileName);
}
public void init() {
ElgamalJNI.PrivateKey_init(swigCPtr, this);
}
public PublicKey getPublicKey() {
return new PublicKey(ElgamalJNI.PrivateKey_getPublicKey(swigCPtr, this), true);
}
public int dec(CipherText c, SWIGTYPE_p_bool b) {
return ElgamalJNI.PrivateKey_dec__SWIG_0(swigCPtr, this, CipherText.getCPtr(c), c, SWIGTYPE_p_bool.getCPtr(b));
}
public int dec(CipherText c) {
return ElgamalJNI.PrivateKey_dec__SWIG_1(swigCPtr, this, CipherText.getCPtr(c), c);
}
public void setCache(int rangeMin, int rangeMax) {
ElgamalJNI.PrivateKey_setCache(swigCPtr, this, rangeMin, rangeMax);
}
public void clearCache() {
ElgamalJNI.PrivateKey_clearCache(swigCPtr, this);
}
public PrivateKey() {
this(ElgamalJNI.new_PrivateKey(), true);
}
}

@ -0,0 +1,82 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class PublicKey {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected PublicKey(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(PublicKey obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
ElgamalJNI.delete_PublicKey(swigCPtr);
}
swigCPtr = 0;
}
}
public String toStr() {
return ElgamalJNI.PublicKey_toStr(swigCPtr, this);
}
public String toString() {
return ElgamalJNI.PublicKey_toString(swigCPtr, this);
}
public void fromStr(String str) {
ElgamalJNI.PublicKey_fromStr(swigCPtr, this, str);
}
public void save(String fileName) {
ElgamalJNI.PublicKey_save(swigCPtr, this, fileName);
}
public void load(String fileName) {
ElgamalJNI.PublicKey_load(swigCPtr, this, fileName);
}
public void enc(CipherText c, int m) {
ElgamalJNI.PublicKey_enc__SWIG_0(swigCPtr, this, CipherText.getCPtr(c), c, m);
}
public void enc(CipherText c, String str) {
ElgamalJNI.PublicKey_enc__SWIG_1(swigCPtr, this, CipherText.getCPtr(c), c, str);
}
public void rerandomize(CipherText c) {
ElgamalJNI.PublicKey_rerandomize(swigCPtr, this, CipherText.getCPtr(c), c);
}
public void add(CipherText c, int m) {
ElgamalJNI.PublicKey_add__SWIG_0(swigCPtr, this, CipherText.getCPtr(c), c, m);
}
public void add(CipherText c, String str) {
ElgamalJNI.PublicKey_add__SWIG_1(swigCPtr, this, CipherText.getCPtr(c), c, str);
}
public PublicKey() {
this(ElgamalJNI.new_PublicKey(), true);
}
}

@ -0,0 +1,26 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.12
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.herumi.mcl;
public class SWIGTYPE_p_bool {
private transient long swigCPtr;
protected SWIGTYPE_p_bool(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
swigCPtr = cPtr;
}
protected SWIGTYPE_p_bool() {
swigCPtr = 0;
}
protected static long getCPtr(SWIGTYPE_p_bool obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}
Loading…
Cancel
Save