Git Product home page Git Product logo

beechatnetworksystemsltd / dilithium-jni Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 666.56 MB

Java Native Interface wrappers for the dilithium PQC Signature Scheme.

License: MIT License

CMake 0.03% Java 0.07% Makefile 0.04% C 77.11% Gnuplot 0.01% Shell 0.04% C++ 14.49% Python 6.50% Batchfile 0.01% Roff 0.02% VBScript 0.01% PLSQL 0.01% HTML 1.33% GDB 0.01% CSS 0.10% Assembly 0.01% XC 0.12% XS 0.12% Ruby 0.01% Perl 0.03%
dilithium java

dilithium-jni's Introduction

Dilithium-JNI

This repository contains the reference implementation of the Dilithium key encapsulation mechanism.

Build

For make a JNI wrapper you should use cmake:

mkdir build
cd build
cmake ..
make

The build result will be available in the /build/Release directory. Or you can just open the project in Visual Studio and build it inside the IDE.

Usage

To use the Kyber functions in a JAVA project, you must use the classes located in the /build/Release/ref directory. By default, everything is packaged in the network package.beuchat; If you want to change the package name, you need to change the headers (ssign.h and ssign_aes.h) in jni/ref directory.

Insert JNI classes into your application and use necessary functions. For example:

import network.beechat.*;
...
public static void main(String[] args) {
    char[] pk = new char[32];
    char[] sk = new char[32];
    int rc = Dilithium.crypto_kem_keypair(pk, sk);
    System.exit(rc);
}

When importing classes (from jni/java), you can change the path to the dynamic library. By default, it is set to the current startup directory. Do not forget about this parameter, because it depends on place of the library.

static {
    System.loadLibrary("kyber512_90s_ref_jni");
}

The necessary shared libraries are placed in /build/Release directory. It is not necessary to use all classes (with _aes and without). Just choose what you want to use.

For Android Test

Paste this commands:

cd test/android
./build_apk.sh

Result APK will be test/android/build/DilithiumTest.apk. Just install and run.

dilithium-jni's People

Contributors

beechatnetworksystemsltd avatar simonows avatar

Watchers

 avatar

Forkers

gu-cryptography

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.