Git Product home page Git Product logo

gridiron's Introduction

Gridiron

This library is a work in progress. To use it, you can either use one of the provided finite fields, or you can call the macro to create your own. The two that are included are:

  • fp_480::Fp480
  • fp_256::Fp256

These were created like so:

// p = 65000549695646603732796438742359905742825358107623003571877145026864184071783
fp!(
    fp_256,   // Name of mod
    Fp256,    // Name of class
    256,      // Number of bits for prime
    4,        // Number of limbs (ceil(bits/64))
    [
        1755467536201717351,  // prime number in limbs, least sig first
        17175472035685840286, // get this from sage with p.digits(2^64)
        12281294985516866593,
        10355184993929758713
    ],
    [
        // Constant used by the Barrett reduction to reduce values up to twice
        // the number of prime bits (double limbs) mod p:
        // floor(2^(64*numlimbs*2)/p)
        4057416362780367814,
        12897237271039966353,
        2174143271902072370,
        14414317039193118239,
        1
    ]
);

To use it, you'll need to import headers for the math operations you want. So, for example:

use std::ops::Add;
let one = fp_256::Fp256::one();
let two = one + one;

This is a work in progress and we hope to make it more performant and constant time.

gridiron's People

Contributors

bobwall23 avatar coltfred 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.