All Projects → Componolit → libsparkcrypto

Componolit / libsparkcrypto

Licence: other
A cryptographic library in SPARK 2014

Programming Languages

Ada
118 projects
Isabelle
26 projects

Projects that are alternatives of or similar to libsparkcrypto

pqcrypto
Rust Post-Quantum cryptography
Stars: ✭ 124 (+396%)
Mutual labels:  crypto-library
nimcrypto
Nim cryptographic library
Stars: ✭ 129 (+416%)
Mutual labels:  crypto-library
Cross-platform-AES-encryption-128bit
No description or website provided.
Stars: ✭ 19 (-24%)
Mutual labels:  crypto-library
awesome-rust-formalized-reasoning
An exhaustive list of all Rust resources regarding automated or semi-automated formalization efforts in any area, constructive mathematics, formal algorithms, and program verification.
Stars: ✭ 185 (+640%)
Mutual labels:  formal-verification
high-assurance-legacy
Legacy code connected to the high-assurance implementation of the Ouroboros protocol family
Stars: ✭ 81 (+224%)
Mutual labels:  formal-verification
avr
Reads a state transition system and performs property checking
Stars: ✭ 41 (+64%)
Mutual labels:  formal-verification
tm-proposer-idris
Formalization of Tendermint proposer election properties
Stars: ✭ 15 (-40%)
Mutual labels:  formal-verification
ArduinoSpritzCipher
Spritz encryption system portable C library, CSPRNG, cryptographic hash and MAC functions, symmetric-key data encryption, and general-purpose functions. It's also an Arduino library.
Stars: ✭ 67 (+168%)
Mutual labels:  crypto-library
fm-notes
Unassorted scribbles on formal methods, type theory, category theory, and so on, and so on
Stars: ✭ 19 (-24%)
Mutual labels:  formal-verification
RiscvSpecFormal
The RiscvSpecKami package provides SiFive's RISC-V processor model. Built using Coq, this processor model can be used for simulation, model checking, and semantics analysis. The RISC-V processor model can be output as Verilog and simulated/synthesized using standard Verilog tools.
Stars: ✭ 69 (+176%)
Mutual labels:  formal-verification
pldi19-equivalence-checker
Source code for the equivalence checker presented in the PLDI 2019 paper, "Semantic Program Alignment for Equivalence Checking"
Stars: ✭ 30 (+20%)
Mutual labels:  formal-verification
reasonml-tic-tac-toe
www.imandra.ai
Stars: ✭ 19 (-24%)
Mutual labels:  formal-verification
hermes-core
Security framework for building multi-user end-to-end encrypted data storage and sharing/processing with zero leakage risks from storage and transport infrastructure.
Stars: ✭ 72 (+188%)
Mutual labels:  crypto-library
HElib
HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.
Stars: ✭ 2,913 (+11552%)
Mutual labels:  crypto-library
Blockchain
Implementation of a Blockchain as a school project
Stars: ✭ 16 (-36%)
Mutual labels:  crypto-library
acsl-proved
Fully proved small C functions (examples for verification course).
Stars: ✭ 14 (-44%)
Mutual labels:  formal-verification
formal hw verification
Trying to verify Verilog/VHDL designs with formal methods and tools
Stars: ✭ 32 (+28%)
Mutual labels:  formal-verification
tutoriel wp
Frama-C and WP tutorial
Stars: ✭ 31 (+24%)
Mutual labels:  formal-verification
FreeSpec
A framework for implementing and certifying impure computations in Coq
Stars: ✭ 48 (+92%)
Mutual labels:  formal-verification
tezedge-specification
TLA+ specs and models for the TezEdge node's p2p overlay network, shell, and consensus
Stars: ✭ 19 (-24%)
Mutual labels:  formal-verification
https://travis-ci.org/Componolit/libsparkcrypto.svg?branch=componolit

libsparkcrypto - A cryptographic library implemented in SPARK 2014.

libsparkcrypto is a formally verified implementation of several widely used cryptographic algorithms using the SPARK 2014 programming language and toolset [1]. For the complete library proofs of the absence of run-time errors like type range violations, division by zero and numerical overflows are available. Some of its subprograms include proofs of partial correctness.

The distribution contains test cases for all implemented algorithms and a benchmark to compare its performance with the OpenSSL library [2].

Copyright, Warranty and Licensing

Copyright (C) 2011-2017 Stefan Berghofer
Copyright (C) 2010-2011,2018 Alexander Senier
Copyright (C) 2010-2017 secunet Security Networks AG
All rights reserved.

libsparkcrypto is released under the simplified BSD license:

Redistribution  and  use  in  source  and  binary  forms,  with  or  without
modification, are permitted provided that the following conditions are met:

   * Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.

   * Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.

   * Neither the name of the  nor the names of its contributors may be used
     to endorse or promote products derived from this software without
     specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE  COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY  EXPRESS OR IMPLIED WARRANTIES,  INCLUDING, BUT NOT LIMITED  TO, THE
IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS FOR  A PARTICULAR PURPOSE
ARE  DISCLAIMED. IN  NO EVENT  SHALL  THE COPYRIGHT  HOLDER OR  CONTRIBUTORS
BE  LIABLE FOR  ANY  DIRECT, INDIRECT,  INCIDENTAL,  SPECIAL, EXEMPLARY,  OR
CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT  LIMITED  TO,  PROCUREMENT  OF
SUBSTITUTE GOODS  OR SERVICES; LOSS  OF USE,  DATA, OR PROFITS;  OR BUSINESS
INTERRUPTION)  HOWEVER CAUSED  AND ON  ANY THEORY  OF LIABILITY,  WHETHER IN
CONTRACT,  STRICT LIABILITY,  OR  TORT (INCLUDING  NEGLIGENCE OR  OTHERWISE)
ARISING IN ANY WAY  OUT OF THE USE OF THIS SOFTWARE, EVEN  IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Features

This version of libsparkcrypto implements the following cryptographic algorithms and modes:

  • AES-128, AES-192, AES-256
  • AES-CBC (all supported AES modes)
  • SHA-1
  • HMAC-SHA1
  • SHA-256, SHA-384, SHA-512
  • HMAC-SHA-256, HMAC-SHA-384, HMAC-SHA-512
  • PRF-HMAC-SHA-256, PRF-HMAC-SHA-384, PRF-HMAC-SHA-512
  • RIPEMD-160
  • HMAC-RIPEMD-160
  • ECDSA, ECGDSA

Development version

The current development version of libsparkcrypto is available through its GIT [3] repository: https://github.com/Componolit/libsparkcrypto.git

A browsable version of the repository is also available here: https://github.com/Componolit/libsparkcrypto

Building and installing

Required tools

To build and prove libsparkcrypto, the following tools are required:

  • GNAT (recent Pro or FSF)
  • SPARK 2014 (tested with Pro 19.0 and Community 2018)
  • GNU make
  • OpenSSL (for building the benchmark, tested with 1.1.1j)

The primary development environments of libsparkcrypto are Debian (x86_64) and Ubuntu (x86_64). Though the source and project files should be system independent, the Makefiles assume a UNIXish system (cygwin seems to work). Tools like mkdir, uname, tail and install must be present in the systems search path.

Build process

To build libsparkcrypto, change to the source directory and type:

$ make

You can install the library to <destination>, by typing:

$ make DESTDIR=<destination> install

Supported systems

libsparkcrypto was successfully built and tested on the following systems:

operating system architecture toolchain
Debian 9 x86_64 SPARK Pro 19.0, GNAT Pro 19.0
Debian 9 x86_64 GNAT Community 2018

Please send bug reports and comments to Alexander Senier <[email protected]>.

Using libsparkcrypto

Examples for using libsparkcrypto can be found in the tests subdirectory.

A user of the library has to provide a shadow for the package Interfaces providing a type definition for at least Unsigned_8, Unsigned_32 and Unsigned_64.

Extending libsparkcrypto

You are welcome to extend libsparkcrypto according to the terms of the simplified BSD license referenced above. Please obey the following rules when contributing changes back to the project:

  • Make sure no undischarged VCs remain.
  • Make sure the code compiles in both modes MODE=release and MODE=debug.
  • Provide reference to documents and test cases for the parts you implemented.
  • Make sure you successfully ran the test suite (make test).
  • Try to stay consistent with the current style of the source.
  • If feasible, implement a benchmark for your code.
  • Create a pull request on GitHub

The Directory structure of libsparkcrypto is as follows:

directory content
src/shared sources analyzed by SPARK and used by Ada compiler
src/spark sources only analyzed by SPARK
src/ada sources only used by Ada compiler

The directories src/ada and src/shared have a sub-directory generic, which contains platform independent code. Furthermore, there are feature-specific directories like little_endian and architecture-specific directories like x86_64 which are included to proof and build steps as configured.

Configuration is performed automatically by the top-level Makefile and can be altered by passing the following variables to make:

variable description
ARCH CPU architecture as reported by uname -m.
MODE Build mode (release or debug).
OPT Optimization level to use (s, 0, 1, 2 or 3).
SHARED Build a shared library (0, 1).
RUNTIME Runtime to build for (native or zfp).
NO_TESTS Disable tests step.
NO_SPARK Disable SPARK proof step.
NO_ISABELLE Disable ISABELLE proof step.
TARGET_CFG Target system configuration.
SPARK_DIR Base directory of the SPARK installation.
DESTDIR Installation base directory.

Credits

  • Thanks to Adrian-Ken Rüegsegger and Reto Buerki for hosting the project's GIT repository.
  • Thanks to Adacore and Altran Praxis for review, comments and support with many tricky problems.
[1]SPARK 2014 - https://www.adacore.com/about-spark
[2]OpenSSL: The Open Source toolkit for SSL/TLS - http://www.openssl.org
[3]GIT - the fast version control system, http://git-scm.com
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].