Coder Social home page Coder Social logo

luishsr / crypto3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alloc-init/crypto3

0.0 0.0 0.0 58.88 MB

Modern Cryptography Suite in C++17

Home Page: https://docs.allocin.it/crypto3

License: MIT License

C++ 98.97% Python 0.11% Nix 0.02% CMake 0.91%

crypto3's Introduction

[[alloc] init] C++ Cryptography Suite

Twitter

Crypto3 cryptography suite's purpose is:

  1. To provide a secure, fast and architecturally clean C++ generic cryptography schemes implementation.
  2. To provide a developer-friendly, modular suite, usable for novel schemes implementation and further extension.
  3. To provide a Standard Template Library-alike C++ interface and concept-based architecture implementation.

Libraries are designed to be state of the art, highly performant and providing a one-stop solution for all cryptographic operations. They are supported on all operating systems (*nix, windows, macOS) and architectures(x86/ARM).

Initially developed by =nil; Crypto3, part of =nil; Foundation and now supported by [[alloc] init].

Rationale, tutorials and references are available here

Contents

  1. Repository Structure
  2. Installation
  3. Usage
  4. Contributing
  5. Community

Repository Structure

This repository is an umbrella-repository for the whole suite. Single-purposed libraries repositories (e.g. block or hash) are not advised to be used outside this suite or properly constructed CMake project and should be handled with great care.

root
├── cmake: cmake sub-module with helper functions/macros to build crypto3 library umbrella-repository
├── docs: documentation , tutorials and guides
├── libs: all directories added as submodules which are independent projects.
│   ├── algebra: algebraic operations and structures being used for elliptic-curve cryptography
│   ├── block: block ciphers
│   ├── blueprint: components and circuits for zk schemes
│   ├── codec: encoding/decoding algorithms
│   ├── containers: containers and generic commitment schemes for accumulating data, includes Merkle Tree
│   ├── hash: hashing algorithms
│   ├── kdf: key derivation functions 
│   ├── mac: message authentication codes
│   ├── marshalling: marshalling libraries for types in crypto3 library
│   ├── math: set of Fast Fourier Transforms evaluation algorithms and Polynomial Arithmetics
│   ├── modes: cipher modes
│   ├── multiprecision: integer, rational, floating-point, complex and interval number types. 
│   ├── passhash: password hashing operations 
│   ├── pbkdf: password based key derivation functions
│   ├── pkmodes: threshold, aggregation modes for public key schemes
│   ├── pkpad: padding module for public key schemes
│   ├── pubkey: pubkey signing APIs
│   ├── random: randomisation primitives 
│   ├── stream: stream ciphers
│   ├── vdf: verifiable delay functions 
│   ├── zk: zk cryptography schemes

Installation

Dependencies

  • clang (>= 11.0)/GCC (>= 10.0)/MSVC (>= 14.20)
  • cmake (>= 3.6)
  • boost (>= 1.76)

Clone & Build

git clone --recurse-submodules https://github.com/nilfoundation/crypto3.git 
cd crypto3 && mkdir build && cd build
cmake ..
make tests

Nix support

This repository provides Nix flake, so once you have installed Nix with flake support, you can use single command to fetch all the dependencies and build:

nix build

To activate Nix development environment:

nix develop

To run all tests:

nix flake check

To run single test:

nix develop . -c cmake -B build -DCMAKE_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=FALSE -DCMAKE_ENABLE_TESTS=TRUE -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug  -DCMAKE_CXX_FLAGS=-ggdb
nix develop -c cmake --build build -t <test_target> // for example multiprecision_modular_adaptor_fixed_test

Usage

Cryptography suite can be used as follows:

  1. Generic.
  2. Selective.

The suite is used as a header-only and is currently statically linked. Future versions will allow dynamic linking.

Generic

Generic usage of cryptography suite consists of all modules available at GitHub =nil; Crypto3 Team Repositories. This is an umbrella-repository where Modules are added as submodules emplaced in libs directory. A developer can thus add this
project as a submodule and would not need to resolve dependencies. See crypto3-template as an example of usage.

The generic module can be added to your c++ project as follows

git submodule add https://github.com/NilFoundation/crypto3.git <dir>

Selective

Developer can select to include a one or more modules to reduce the sources of resulting project and dependencies tree height. This however does require the developer to manually resolve all required dependencies and stay upto date regarding compatibilities across modules.

Example of such embedding is =nil; Foundation's Actor Library. It uses only hashes so the dependency graph requires for the project to submodule block ciphers library and optional codec library for testing purposes. So, the root Actor repository has only related libraries submoduled: block, codec and hash.

Selective modules can be added to your project as follows:

git submodule add https://github.com/NilFoundation/crypto3-<lib>.git <dir>

Contributing

See contributing for contribution guidelines.

Support

This cryptography suite is authored by =nil; Crypto3 team, so you can contact it several ways:

  • E-Mail. Just drop a line to [email protected].
  • Telegram Group. Join our Telegram group @nilfoundation and ask any question in there.
  • Discord channel for discussions.
  • Issue. Issue which does not belong to any particular module (or you just don't know where to put it) can be created in this repository. The team will answer that.
  • Discussion Topic (proposal, tutorial request, suggestion, etc). Would be happy to discuss that in the repository's GitHub Discussions

Licence

The software is provided under MIT Licence.

crypto3's People

Contributors

nemothenoone avatar nkaskov avatar jzmaddock avatar zerg1996 avatar etatuzova avatar swatanabe avatar martun avatar jensmaurer avatar sk0m0r0h avatar andreymlashkin avatar a1falcon avatar rinat229 avatar x-mass avatar tshchelovek avatar madhur4127 avatar vo-nil avatar pabristow avatar iluvmagick avatar noamdev avatar luannet avatar nathompson avatar hgedia avatar ckormanyos avatar mclow avatar ukorvl avatar beman avatar danieljames avatar jasoncoombs avatar kotika avatar dabrahams 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.