Git Product home page Git Product logo

cryspen / hacl-packages Goto Github PK

View Code? Open in Web Editor NEW
13.0 9.0 17.0 18.02 MB

The Cryspen HACL Distribution

Home Page: https://cryspen.com/hacl-packages

License: Other

Shell 0.06% CMake 0.63% Makefile 0.09% C 70.39% Dockerfile 0.08% Python 0.91% OCaml 5.43% Rust 3.86% C++ 4.96% Batchfile 0.01% Assembly 12.67% JavaScript 0.84% HTML 0.07%
cryptography formally-verified aead decryption encryption hkdf hmac signatures digest hashing

hacl-packages's Issues

Mach usability

  • #8
  • #9
  • without cmake mach fails with an unhelpful backtrace FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
  • running ./mach.py test on my M1 gives: FileNotFoundError: [Errno 2] No such file or directory: './blake2b'

Clean Rust API

  • remove deprecated items
  • remove unused APIs
  • consistent naming of APIs (all hacl?)
  • consistent API design (naming, parameter order, ...)
  • documentation

[mach] Update

Tracking the update sub-command

  • #76
  • copy all needed files (msvc, c89)
  • #12
  • write out revision of all dependencies
  • make snapshot of all dependencies in a docker image
  • only copy what's really needed (using dependency analysis)

[mach] Snapshots (dist)

Tracking generation of snapshots (other dists)

  • copy headers
  • allow setting feature restrictions
  • write out config.h

Ensure Toolchain and Platform Checks are correct

The build currently replicates what the upstream configure script. But that's not always correct or complete (see for example hacl-star/hacl-star#519 (comment)).

See https://github.com/cryspen/hacl/blob/main/cpu-features.md for full CPU feature matrix.


  • Check for AES instructions
    • Lib_IntVector_Intrinsics_ni_aes_enc, Lib_IntVector_Intrinsics_ni_aes_enc_last, Lib_IntVector_Intrinsics_ni_aes_keygen_assist
    • x86: AES
  • Check for clmul instructions
    • Lib_IntVector_Intrinsics_ni_clmul
    • x86: PCLMULQDQ
  • Check for SSE2
    • Lib_IntVector_Intrinsics_vec128_xor, Lib_IntVector_Intrinsics_vec128_eq32, Lib_IntVector_Intrinsics_vec128_gt32, Lib_IntVector_Intrinsics_vec128_or, Lib_IntVector_Intrinsics_vec128_and, Lib_IntVector_Intrinsics_vec128_lognot, Lib_IntVector_Intrinsics_vec128_shift_left, Lib_IntVector_Intrinsics_vec128_shift_right, Lib_IntVector_Intrinsics_vec128_shift_left64, Lib_IntVector_Intrinsics_vec128_shift_right64, Lib_IntVector_Intrinsics_vec128_shift_left32, Lib_IntVector_Intrinsics_vec128_shift_right32, Lib_IntVector_Intrinsics_vec128_shuffle32, Lib_IntVector_Intrinsics_vec128_shuffle64, Lib_IntVector_Intrinsics_vec128_rotate_right_lanes32, Lib_IntVector_Intrinsics_vec128_rotate_right_lanes64, Lib_IntVector_Intrinsics_vec128_load32_le, Lib_IntVector_Intrinsics_vec128_load64_le, Lib_IntVector_Intrinsics_vec128_store32_le, Lib_IntVector_Intrinsics_vec128_store64_le, Lib_IntVector_Intrinsics_vec128_zero, Lib_IntVector_Intrinsics_vec128_add64, Lib_IntVector_Intrinsics_vec128_sub64, Lib_IntVector_Intrinsics_vec128_mul64, Lib_IntVector_Intrinsics_vec128_smul64, Lib_IntVector_Intrinsics_vec128_add32, Lib_IntVector_Intrinsics_vec128_sub32, Lib_IntVector_Intrinsics_vec128_load64, Lib_IntVector_Intrinsics_vec128_load64s, Lib_IntVector_Intrinsics_vec128_load32, Lib_IntVector_Intrinsics_vec128_load32s, Lib_IntVector_Intrinsics_vec128_interleave_low32, Lib_IntVector_Intrinsics_vec128_interleave_high32, Lib_IntVector_Intrinsics_vec128_interleave_low64, Lib_IntVector_Intrinsics_vec128_interleave_high64
  • Check for SSE3
    • Lib_IntVector_Intrinsics_vec128_rotate_left32_8, Lib_IntVector_Intrinsics_vec128_rotate_left32_16, Lib_IntVector_Intrinsics_vec128_rotate_left32_24, Lib_IntVector_Intrinsics_vec128_rotate_left32, Lib_IntVector_Intrinsics_vec128_rotate_right32, Lib_IntVector_Intrinsics_vec128_load_be, Lib_IntVector_Intrinsics_vec128_load32_be, Lib_IntVector_Intrinsics_vec128_load64_be, Lib_IntVector_Intrinsics_vec128_store_be, Lib_IntVector_Intrinsics_vec128_store32_be, Lib_IntVector_Intrinsics_vec128_store64_be (all also SSE2)
  • Check for SSE4.1
    • Lib_IntVector_Intrinsics_vec128_eq64, Lib_IntVector_Intrinsics_vec128_insert8, Lib_IntVector_Intrinsics_vec128_insert32, Lib_IntVector_Intrinsics_vec128_insert64, Lib_IntVector_Intrinsics_vec128_extract8, Lib_IntVector_Intrinsics_vec128_extract32, Lib_IntVector_Intrinsics_vec128_extract64, Lib_IntVector_Intrinsics_vec128_mul32, Lib_IntVector_Intrinsics_vec128_smul32 (also sse2)
  • Check for SSE4.2
    • Lib_IntVector_Intrinsics_vec128_gt64,

[meta] CI

Tier 1 Targets

Tier 1 targets are guaranteed to work. These targets have automated testing to ensure that changes do not break them.

  • #17
    • GCC-latest, clang-latest, gcc-minimum
  • #18
    • GCC-latest, clang-latest, gcc-minimum
  • #19
  • #20
  • #21

Tier 2 Targets

Tier 2 targets are guaranteed to build. These targets have automated builds to ensure that changes do not break the builds. However, not all of them are always tested.

[mach] Build

Tracking progress on mach for building

  • allow disabling features
  • selectively run tests
  • connect to F*/kremlin config
  • support GCC and clang

[cmake] Build

Tracking the cmake build

  • Allow disabling hardware features
  • setting compiler flags
  • bundle files into units per hardware feature
  • build and run tests
  • build and run benchmarks
  • include vale

Implement benchmarks for all primitives

HACL

  • AEAD
    • Chacha20-Poly1305
    • AES-GCM (only available through EverCrypt)
  • Hash
    • Blake2
      • BLAKE2b
        • One-shot (32, 256)
          • Real-world comparison (OpenSSL, ...)
        • Streaming (32, 256) (#323)
          • Real-world comparison (OpenSSL, ...) (#329)
      • BLAKE2s
        • One-shot (32, 128)
          • Real-world comparison (OpenSSL, ...) (#329)
        • Streaming (32, 256) (#323)
          • Real-world comparison (OpenSSL, ...) (#329)
    • SHA-3
      • One-shot (224, 256, 384, 512, SHAKE128, SHAKE256) (#324)
        • Real-world comparison (OpenSSL, ...) (#329)
      • Streaming (224, 256, 384, 512, SHAKE128, SHAKE256) (#324)
        • Real-world comparison (OpenSSL, ...) (#329)
    • SHA-2 (TODO: all variants?)
      • One-shot
        • Real-world comparison (OpenSSL, ...)
      • Streaming
        • Real-world comparison (OpenSSL, ...)
    • SHA-1
      • One-shot (#327)
        • Real-world comparison (OpenSSL, ...)
      • Streaming (#327)
        • Real-world comparison (OpenSSL, ...)
  • HPKE
  • Signature
    • EdDSA
      • Ed25519 (TODO: All variants?)
        • One-shot (TODO: OpenSSL Verify)
          • Real-world comparison (OpenSSL, ...) (#334)
        • Precomputed (#334)
          • Real-world comparison (OpenSSL, ...) (#334)
    • RSAPSS (#340)
    • ECDSA
      • P-256
        • Real-world comparison (OpenSSL, ...)
      • K-256
        • Real-world comparison (OpenSSL, ...)
  • Diffie-Hellman
    • Elliptic-Curve
      • Curve25519
        • Real-world comparison (OpenSSL, ...)
      • P-256
        • Real-world comparison (OpenSSL, ...)
      • K-256
        • Real-world comparison (OpenSSL, ...)
    • Finite Field
      • One-shot
      • Precomputed
  • MAC
  • KDF
  • Randomness
  • Hazmat
    • Bignum
    • Montgomery Field Arithmetic
  • NaCl
    • Public-key Authenticated Encryption
      • One-shot
        • Combined mode (#326)
        • Detached mode (#326)
      • Precomputed
        • Combined mode (#326)
        • Detached mode (#326)
    • Secret-key Authenticated Encryption
      • Combined mode (#326)
      • Detached mode (#326)

EverCrypt

  • AEAD
  • Hash
    • One-shot
    • Streaming
  • Diffie-Hellman
    • Elliptic-Curve
      • Curve25519
  • KDF
  • MAC
    • HMAC
  • Randomness
    • DRBG

Variants

  • Discuss if we also want to provide examples for variants, i.e., 32/256/512.

Allow algorithm selection for agile APIs

Building with ./mach build -a blake2 (or any other algorithm) disables evercrypt (the agile APIs).
While this is intentional, it's not great. It would be best to add a new well-designed, flexible API on top of HACL that would allow this.

set upstream repository or directory

./mach update should take an argument where to find the hacl-star distribution.
This can be

  • a directory
  • a git repository

If the upstream is a git repository

  • set revision to pull

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.