Skip to content

snp-labs/Android-CRV

 
 

Repository files navigation

libsnark-porting

This android-studio project only ported libsnark to arm64. armeabi-v7a(arm32) have some error at prove and verify.


Elliptic curve choices

use ALT_BN128. more detail https://github.com/scipr-lab/libsnark


CMake option

vi ~/your-workspace/snarkportingtest/app/build.gradle

  • ANDROID_TOOLCHAIN=4.7 : Select compiler version
  • _ANDROID_STL=c++shared : If you link library, you need this option
  • WITH_PROCPS=OFF : libprocps is not necessary to link the library.
  • CURVE=ALT_BN128 : use ALT_BN128
  • WITH_SUPERCOP=OFF : supercop is assembly language.(can't use at arm machine)
  • OPT_FLAGS=-Os -march=armv8-a : select machine
  • PERFORMANCE=ON : OFF DEBUG MODE

Project Structure

  • MINIMUM SDK VERSION : 23(ANDROID 6.0 Marshmallow)
  • NDK VERSION : 21.3.6528147
  • Android Gradle Plugin Version : 4.0.1
  • Gradle Version : 6.1.1

Verify using Libsnark library

use https://github.com/snp-labs/CRV

build libsnark library as command

cmake -DCURVE=ALT_BN128 -DWITH_PROCPS=OFF -DWITH_SUPERCOP=OFF -DMULTICORE=OFF -DUSE_ASM=OFF -DBINARY_OUTPUT=ON -DMONTGOMERY_OUTPUT=OFF ..

these cmake options must be defined to use CRS and proofs derived from Android

copy your CRS and proofs to ~/your-workspace/CRV/JsnarkCircuitBuilder/datafiles

use command described in link above to run libsnark library

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 42.1%
  • C++ 41.5%
  • Assembly 6.9%
  • Perl 4.3%
  • Python 2.4%
  • Java 1.1%
  • Other 1.7%