Giter Club home page Giter Club logo

libfinite's Introduction

libfinite

   Copyright 2016 naehrwert
   Copyright 2016 Luka Malisa <[email protected]>
   Licensed under the terms of the GNU GPL, version 2
   http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

Introduction

libfinite is a small and fast bignum library. In our tests (timing modular exponentiation, with modulus of 4096 bits), libfinite was only 3 (if compiled with clang), or 4 times slower (if compiled with gcc) than a libgmp and OpenSSL implementation. Not bad for an example that compiles to ~5KB of code! Furthermore, libfinite can be compiled with arbitrary limb sizes. For example, if you need this code to run on a 16 bit processor, you could set BN_LIMB_SIZE to 8 in config.h. However, if you want maximum speed, use BN_LIMB_SIZE of 64.

bn.c

Bignum library for arithmetic in Z/nZ (the positive half, since we don't care about signs) which can also be used to describe operations over some finite field GF(p) (F_p). Note that in some of the cases below, the use of a finite field can be substituted for a more general Z/nZ.

dh.c

This implements Diffie-Hellman key exchange.

ec.c

Given an elliptic curve in Weierstrass form (y^2 = x^3 + ax + b) over a finite field, this gives a representation of the group of points on the elliptic curve, i.e. point addition, point doubling, multiplication by a number.

ecdsa.c

This implements the Elliptic Curve Digital Signature Algorithm (ECDSA).

ecnr.c

This implements Elliptic Curve Nyberg Rueppel (ECNR), the Nyberg-Rueppel signature scheme over the elliptic curve group.

inr.c

This implements the Nyberg-Rueppel signature scheme over a finite field.

pc.c

Given a Pell conic (x^2 - Dy^2 = 1) over a finite field, this gives a representation of the group of points on the Pell conic, i.e. point addition, multiplication by a number. Assuming the finite field is F_p, the parameter D should be a non-square in the field since then the group is known to be isomorphic to the multiplicative subgroup of F_p^2. Otherwise it will simply be isomorphic to the multiplicative subgroup of F_p.

pcnr.c

This implements Pell Conic Nyberg Rueppel (PCNR), the Nyberg-Rueppel signature scheme over the Pell conic group.

poly.c

This implements operations for the ring of polynomials R over some finite field F_p (R = F_p[X]), i.e. addition, subtraction, multiplication, division and remainder.

pqr.c

Given a polynomial ring R and a polynomial I in R, this implements operations for the polynomial quotient ring R/(I), i.e. addition, subtraction, multiplication, inversion, exponentiation. This can be used to construct a representation of certain finite fields, e.g. F_q where q = p^n, p prime, n some positive integer, i.e. take I to be an irreducible polynomial of degree n over the finite field F_p.

ssecrets.c

This implements Shamir's Secret Sharing.

Examples

TODO

libfinite's People

Contributors

malisal avatar naehrwert 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.