Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 868 Bytes

readme.md

File metadata and controls

42 lines (32 loc) · 868 Bytes

mcl-android

This is a sample of how to use mcl on Android

How to use

git clone --recursive https://github.com/herumi/mcl-android
cd mcl-android/app/src/main/cpp/mcl
make android # make static libraries in mcl/lib/android/

Open mcl-android with Android Studio and build it. You can use C/C++ APIs.

header

#include <mcl/bn_c384_256.h>
#define MCL_DONT_USE_XBYAK
#define MCL_MAX_BIT_SIZE 384
#define MCL_MAX_FP_BIT_SIZE 384
#define MCL_MAX_FR_BIT_SIZE 256
#include <mcl/bn.hpp>

initialization

int ret = mclBn_init(MCL_BLS12_381, MCLBN_COMPILED_TIME_VAR);
if (ret != 0) {
  throw std::runtime_error("mcl init err");
}
mcl::bn::initPairing(mcl::BLS12_381);

See hello-libs.cpp.