Git Product home page Git Product logo

cryptl's Introduction

cryptl: cryptographic C++ template library parameterized by code management


Introduction

The cryptl template library evolved out of snarkfront, a domain specific language for zero knowledge proofs. In snarkfront, cryptographic algorithms appear in two contexts: unmanaged and managed.

The first context, unmanaged, is immediate evaluation. This is the usual sense of application code. Algorithms "eagerly" calculate an answer.

The second context, managed, is "lazy" for domain specific languages. This is the usual way a dynamic language works. Algorithms build up structures for deferred evaluation by a runtime.

I am not aware of other cryptographic libraries that address this situation. That is, templated implementations parameterized in such a way to be used for both unmanaged and managed code. It is not a typical applications programming use case.

Another motivation were growing dependencies between other projects and these templates. It made sense to package them together as a distinct library to avoid duplication.


[TOC]


Cryptographic algorithms


Library build instructions

There is nothing to build in the library itself. It is entirely C++ templates. Applications only need to include the header files.

To install the library:

$ make install PREFIX=/usr/local

The header files are copied to directory $(PREFIX)/include/cryptl .


Download the example AES Known Answer Test (KAT) Vectors from NIST:

$ mkdir AESAVS_testdata
$ cd AESAVS_testdata
$ wget http://csrc.nist.gov/groups/STM/cavp/documents/aes/KAT_AES.zip
$ unzip KAT_AES.zip
$ cd ..

Build the AESAVS binary:

$ make AESAVS

Run the validation tests:

$ ./AESAVS.sh AESAVS_testdata

Download the example Test Vectors for Hashing Byte-Oriented Messages from NIST:

$ mkdir SHAVS_testdata
$ cd SHAVS_testdata
$ wget http://csrc.nist.gov/groups/STM/cavp/documents/shs/shabytetestvectors.zip
$ unzip shabytetestvectors.zip
$ cd ..

Build the SHAVS binary:

$ make SHAVS

Run the validation tests:

$ ./SHAVS.sh SHAVS_testdata

Ed25519 test vectors

Download the test vectors:

$ wget http://ed25519.cr.yp.to/python/sign.input

Build the ED25519_test binary:

$ make ED25519_test

Run the validation tests:

$ ./ED25519_test.sh sign.input

References

cryptl's People

Contributors

jancarlsson 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.