Giter VIP home page Giter VIP logo

sm2349's Introduction

SM2, SM3, SM4, SM9 and ZUC

This repository contains GM/T serial standards implementations (SM2, SM3, SM4, SM9 and ZUC) provided by the Commercial Cryptography Testing Center.

Every source code in this repository can be used for academic, non-profit making or non-commercial use only. All implementation are based on MIRACL Cryptographic SDK, which also requires a proper license which may be obtained from Shamus Software Ltd.

Usage

  1. Clone this repository with Git submodules:

    git clone https://github.com/Arkq/SM2349.git && cd SM2349
    git submodule update --init --recursive
  2. Build MIRACL library:

    NOTE: This step will compile MIRACL library for x64 Linux platforms only. If your target/host platform is different, please compile MIRACL library by yourself - refer to the documentation provided by the MIRACL library codebase.

    make miracl.a
  3. Build SM algorithms reference implementations:

    make

sm2349's People

Contributors

arkq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sm2349's Issues

SM2_ENC.c Floating point exception (core dumped)

int Test_Point(epoint *point) {
big x, y, x_3, tmp;
x = mirvar(0);
y = mirvar(0);
x_3 = mirvar(0);
tmp = mirvar(0);

//test if y^2=x^3+ax+b
epoint_get(point, x, y);
power(x, 3, para_p, x_3);        //x_3=x^3 mod p
multiply(x, para_a, x);           //x=a*x
divide(x, para_p, tmp);          //x=a*x mod p  , tmp=a*x/p
add(x_3, x, x);                     //x=x^3+ax
add(x, para_b, x);                  //x=x^3+ax+b
divide(x, para_p, tmp);             //x=x^3+ax+b mod p
power(y, 2, para_p, y);          //y=y^2 mod p
if (mr_compare(x, y) != 0)
    return ERR_NOT_VALID_POINT;
else return 0;

}

could u please tell me which version of the miral.a that is used by the repo?

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.