Giter Site home page Giter Site logo

sntrup4591761's Introduction

sntrup4591761

Build Status ISC License GoDoc

Streamlined NTRU Prime 4591^761

sntrup4591761 is a Go library implementing the Streamlined NTRU Prime 4591761 cryptosystem. Most of the code consists of a port of the reference C implementation.

Constants

  • PublicKeySize

The size of an encoded public key.

  • PrivateKeySize

The size of an encoded private key.

  • CiphertextSize

The size of a ciphertext encapsulating a shared key.

  • SharedKeySize

The size of a shared key.

Functions

  • GenerateKey(s io.Reader) (*[PublicKeySize]byte, *[PrivateKeySize]byte, error)

GenerateKey returns a new a public/private key pair with randomness from s. GenerateKey will fail if randomness cannot be obtained from s.

  • Encapsulate(s io.Reader, publicKey *[PublicKeySize]byte) (*[CiphertextSize]byte, *[SharedKeySize]byte, error)

Encapsulate generates a random shared key and encrypts it with the given public key. The shared key and its corresponding ciphertext are returned. Encapsulate will fail if randomness cannot be obtained from s.

  • Decapsulate(ciphertext *[CiphertextSize]byte, privateKey *[PrivateKeySize]byte) (*[SharedKeySize]byte, int)

Decapsulate uses a private key to decrypt a ciphertext, returning an encapsulated shared key. Decapsulate will return zero if the ciphertext is invalid.

Examples

The library is accompanied by three small standalone applications demonstrating its use: keygen, encap, and decap. A test script is provided to exercise these applications comprehensively.

To build the bundled applications, ensure that the repository lies in your GOPATH and run make. Once built, the auxiliary test script can be triggered by invoking ./test.

Sage tests

A set of 128 different instances of NTRU Prime were simulated in Sage and their data compiled in testdata/sage128.gz. The TestSage Go test contrasts the results obtained by the library with those from the Sage implementation. Please note that this test can take seconds to complete.

Running the tests

To run the Sage tests and other tests, ensure that the repository lies in your GOPATH and run go test -v.

License

sntrup4591761 is licensed under the copyfree ISC License.

sntrup4591761's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sntrup4591761's Issues

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.