Git Product home page Git Product logo

beechatnetworksystemsltd / kyber-jni Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 666.57 MB

Java Native Interface wrappers for the kyber PQC KEM.

License: MIT License

CMake 0.03% Java 0.08% C 77.09% Makefile 0.04% 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% JavaScript 0.01%
pqc pqcrypto crypto jni-wrapper kyber java

kyber-jni's Introduction

kyber-JNI

This repository contains the reference implementation of the Kyber key encapsulation mechanism, Post Quantum Cryptography algorithms usable through Java Native Interface wrappers.

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 (network_beechat_Kyber512_90s.h and network_beechat_Kyber512.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 = Kyber512.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.

Example for Windows:

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

Example for Unix-like:

static {
    System.loadLibrary("libkyber512_ref_jni.so");
}

The necessary shared libraries are placed in /build/Release directory. It is not necessary to use all classes (with _90s 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/KyberTest.apk. Just install and run.

kyber-jni's People

Contributors

beechatnetworksystemsltd avatar simonows avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.