Merge branch 'master' of https://github.com/upbcuk/mcl into upbcuk-master

update-fork
MITSUNARI Shigeo 4 years ago
commit 09e954e637
  1. 2
      ffi/java/com/herumi/mcl/Fp.java
  2. 2
      ffi/java/com/herumi/mcl/Fr.java
  3. 2
      ffi/java/com/herumi/mcl/G1.java
  4. 2
      ffi/java/com/herumi/mcl/G2.java
  5. 2
      ffi/java/com/herumi/mcl/GT.java
  6. 6
      ffi/java/com/herumi/mcl/Mcl.java
  7. 2
      ffi/java/com/herumi/mcl/MclConstants.java
  8. 3
      ffi/java/com/herumi/mcl/MclJNI.java
  9. 1
      ffi/java/java.md
  10. 5
      ffi/java/mcl_impl.hpp
  11. 34
      ffi/java/mcl_wrap.cxx

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

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

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

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

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

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.0 * Version 4.0.2
* *
* Do not make changes to this file unless you know what you are doing--modify * Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead. * the SWIG interface file instead.
@ -113,4 +113,8 @@ public class Mcl implements MclConstants {
MclJNI.mul__SWIG_4(GT.getCPtr(z), z, GT.getCPtr(x), x, GT.getCPtr(y), y); MclJNI.mul__SWIG_4(GT.getCPtr(z), z, GT.getCPtr(x), x, GT.getCPtr(y), y);
} }
public static void inv(GT y, GT x) {
MclJNI.inv(GT.getCPtr(y), y, GT.getCPtr(x), x);
}
} }

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

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.0 * Version 4.0.2
* *
* Do not make changes to this file unless you know what you are doing--modify * Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead. * the SWIG interface file instead.
@ -93,6 +93,7 @@ public class MclJNI {
public final static native byte[] G2_serialize(long jarg1, G2 jarg1_); public final static native byte[] G2_serialize(long jarg1, G2 jarg1_);
public final static native void delete_G2(long jarg1); public final static native void delete_G2(long jarg1);
public final static native void mul__SWIG_4(long jarg1, GT jarg1_, long jarg2, GT jarg2_, long jarg3, GT jarg3_); public final static native void mul__SWIG_4(long jarg1, GT jarg1_, long jarg2, GT jarg2_, long jarg3, GT jarg3_);
public final static native void inv(long jarg1, GT jarg1_, long jarg2, GT jarg2_);
public final static native long new_GT__SWIG_0(); 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 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 boolean GT_equals(long jarg1, GT jarg1_, long jarg2, GT jarg2_);

@ -50,6 +50,7 @@ Mcl.SystemInit(curveType); // curveType = Mcl.BN254 or Mcl.BLS12_381
* `GT::setStr(String str)` ; set by the result of `toString()` method * `GT::setStr(String str)` ; set by the result of `toString()` method
* `Mcl.mul(GT z, GT x, GT y)` ; `z = x * y` * `Mcl.mul(GT z, GT x, GT y)` ; `z = x * y`
* `Mcl.pow(GT z, GT x, Fr y)` ; `z = x ^ y` * `Mcl.pow(GT z, GT x, Fr y)` ; `z = x ^ y`
* `Mcl.inv(GT y, GT x)` ; `y = x^{-1}`
## pairing ## pairing
* `Mcl.pairing(GT e, G1 P, G2 Q)` ; e = e(P, Q) * `Mcl.pairing(GT e, G1 P, G2 Q)` ; e = e(P, Q)

@ -335,6 +335,7 @@ void mul(G2& z, const G2& x, const Fr& y)
class GT { class GT {
mcl::bn::Fp12 self_; mcl::bn::Fp12 self_;
friend void mul(GT& z, const GT& x, const GT& y); friend void mul(GT& z, const GT& x, const GT& y);
friend void inv(GT& y, GT& x);
friend void pow(GT& z, const GT& x, const Fr& y); friend void pow(GT& z, const GT& x, const Fr& y);
friend void pairing(GT& e, const G1& P, const G2& Q); friend void pairing(GT& e, const G1& P, const G2& Q);
public: public:
@ -367,6 +368,10 @@ void mul(GT& z, const GT& x, const GT& y)
{ {
mcl::bn::Fp12::mul(z.self_, x.self_, y.self_); mcl::bn::Fp12::mul(z.self_, x.self_, y.self_);
} }
void inv(GT& y, GT& x)
{
mcl::bn::Fp12::inv(y.self_, x.self_);
}
void pow(GT& z, const GT& x, const Fr& y) void pow(GT& z, const GT& x, const Fr& y)
{ {
mcl::bn::Fp12::pow(z.self_, x.self_, y.self_); mcl::bn::Fp12::pow(z.self_, x.self_, y.self_);

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.0 * Version 4.0.2
* *
* This file is not intended to be easily readable and contains a number of * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make * coding conventions designed to improve portability and efficiency. Do not make
@ -182,15 +182,16 @@ template <typename T> T SwigValueInit() {
/* Support for throwing Java exceptions */ /* Support for throwing Java exceptions */
typedef enum { typedef enum {
SWIG_JavaOutOfMemoryError = 1, SWIG_JavaOutOfMemoryError = 1,
SWIG_JavaIOException, SWIG_JavaIOException,
SWIG_JavaRuntimeException, SWIG_JavaRuntimeException,
SWIG_JavaIndexOutOfBoundsException, SWIG_JavaIndexOutOfBoundsException,
SWIG_JavaArithmeticException, SWIG_JavaArithmeticException,
SWIG_JavaIllegalArgumentException, SWIG_JavaIllegalArgumentException,
SWIG_JavaNullPointerException, SWIG_JavaNullPointerException,
SWIG_JavaDirectorPureVirtual, SWIG_JavaDirectorPureVirtual,
SWIG_JavaUnknownError SWIG_JavaUnknownError,
SWIG_JavaIllegalStateException,
} SWIG_JavaExceptionCodes; } SWIG_JavaExceptionCodes;
typedef struct { typedef struct {
@ -211,6 +212,7 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
{ SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
{ SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
{ SWIG_JavaUnknownError, "java/lang/UnknownError" }, { SWIG_JavaUnknownError, "java/lang/UnknownError" },
{ SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" },
{ (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
}; };
const SWIG_JavaExceptions_t *except_ptr = java_exceptions; const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
@ -2199,6 +2201,28 @@ SWIGEXPORT void JNICALL Java_com_herumi_mcl_MclJNI_mul_1_1SWIG_14(JNIEnv *jenv,
} }
SWIGEXPORT void JNICALL Java_com_herumi_mcl_MclJNI_inv(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
GT *arg1 = 0 ;
GT *arg2 = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(GT **)&jarg1;
if (!arg1) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "GT & reference is null");
return ;
}
arg2 = *(GT **)&jarg2;
if (!arg2) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "GT & reference is null");
return ;
}
inv(*arg1,*arg2);
}
SWIGEXPORT jlong JNICALL Java_com_herumi_mcl_MclJNI_new_1GT_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { SWIGEXPORT jlong JNICALL Java_com_herumi_mcl_MclJNI_new_1GT_1_1SWIG_10(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ; jlong jresult = 0 ;
GT *result = 0 ; GT *result = 0 ;

Loading…
Cancel
Save