All Projects → otrv4 → libgoldilocks

otrv4 / libgoldilocks

Licence: other
An implementation of Mike Hamburg's Ed448 (Goldilocks) curve - derived from libdecaf. This is a mirror of https://bugs.otr.im/otrv4/libgoldilocks

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
M4
1887 projects
Makefile
30231 projects

Projects that are alternatives of or similar to libgoldilocks

noble-ed25519
Fastest JS implementation of ed25519, x25519 & ristretto255. Independently audited, high-security, 0-dependency EDDSA signatures and ECDH key agreement
Stars: ✭ 220 (+1194.12%)
Mutual labels:  ecc, elliptic-curves, edwards-curve
elliptic-curve
A polymorphic interface for elliptic curve operations
Stars: ✭ 37 (+117.65%)
Mutual labels:  ecc, elliptic-curves, edwards-curve
hazmat-math
Hazmat ECC arithmetic for Cryptography.io
Stars: ✭ 28 (+64.71%)
Mutual labels:  ecc, elliptic-curves
Practical Cryptography For Developers Book
Practical Cryptography for Developers: Hashes, MAC, Key Derivation, DHKE, Symmetric and Asymmetric Ciphers, Public Key Cryptosystems, RSA, Elliptic Curves, ECC, secp256k1, ECDH, ECIES, Digital Signatures, ECDSA, EdDSA
Stars: ✭ 2,400 (+14017.65%)
Mutual labels:  ecc, elliptic-curves
keystore-idb
In-browser key management with IndexedDB and the Web Crypto API
Stars: ✭ 37 (+117.65%)
Mutual labels:  ecc, elliptic-curves
pairing
Optimised bilinear pairings over elliptic curves
Stars: ✭ 44 (+158.82%)
Mutual labels:  ecc, elliptic-curves
EllipticCurve
An elliptic curve library written in Swift 4
Stars: ✭ 18 (+5.88%)
Mutual labels:  ecc, elliptic-curves
btclib
btclib: a Python3 library for 'bitcoin cryptography'
Stars: ✭ 16 (-5.88%)
Mutual labels:  elliptic-curves
oseid
Microchip AVR based smartcard/token with ECC and RSA cryptography
Stars: ✭ 17 (+0%)
Mutual labels:  ecc
sodalite
tweetnacl in rust
Stars: ✭ 26 (+52.94%)
Mutual labels:  ecc
Udpspeeder
A Tunnel which Improves your Network Quality on a High-latency Lossy Link by using Forward Error Correction, possible for All Traffics(TCP/UDP/ICMP)
Stars: ✭ 3,699 (+21658.82%)
Mutual labels:  ecc
h2c-rust-ref
Hash to curves - Rust reference implementation
Stars: ✭ 21 (+23.53%)
Mutual labels:  elliptic-curves
Decaf-Compiler
Compiler for Decaf Programming Language
Stars: ✭ 36 (+111.76%)
Mutual labels:  decaf
frechet
Discrete Fréchet distance and of the minimum path required for traversing with it
Stars: ✭ 14 (-17.65%)
Mutual labels:  curve
Number-Theory-Python
Python code to implement various number theory, elliptic curve and finite field computations.
Stars: ✭ 85 (+400%)
Mutual labels:  elliptic-curves
public
BitDust project source codes : official Public Git repository (mirror on GitHub) : https://bitdust.io
Stars: ✭ 19 (+11.76%)
Mutual labels:  ecc
optiga-trust-m
OPTIGA™ Trust M Software Framework
Stars: ✭ 86 (+405.88%)
Mutual labels:  ecc
cryptotools
No description or website provided.
Stars: ✭ 182 (+970.59%)
Mutual labels:  elliptic-curves
btc-bash-ng
math and bitcoin tools in gnu bc and bash
Stars: ✭ 25 (+47.06%)
Mutual labels:  curve
crypto-in-action
algebra arithmetic, finite fields, elliptic curves, zero-knowledge
Stars: ✭ 65 (+282.35%)
Mutual labels:  elliptic-curves

Goldilocks library

The Goldilocks library is a production library, providing the ed448 elliptic curve. It is based on Mike Hamburg's libdecaf library: ed448goldilocks.

This library is intended for developers who have experience with cryptography. It doesn't (yet?) include documentation on how to use digital signatures or key exchange securely. Consult your local cryptographer for advice.

Building the library

Before you try to build libgoldilocks, verify you have installed:

To generate project configuration:

$ autoreconf --install

To configure the project:

$ ./configure

To build and install:

$ make && make install

To run the tests:

$ make test

Using the library

  • To run the python wrapper: python setup.py install --user
  • To generate the code based on the curve data, per field and the decaf tables: make gen-code
  • To generate the code based on the curve data and per field: make gen-code-static
  • To test the programs: make test
  • To generate the main decaf library and its symlinks: make lib

Mailing lists

Because this is new software, please expect it to have bugs, perhaps even critical security bugs. If you are using it, please sign up for updates on Mike Hamburg's library (note here that any update that we consider useful for this library from libdecaf will be incorporated):

General elliptic curve operations.

This is a multi-purpose elliptic curve library. There is a C library, and a set of C++ wrapper headers. The C++ code consists entirely of inline calls, and has no compiled component.

The library implements a fairly complete suite of operations on ed448-Goldilocks:

  • Point and scalar serialization and deserialization.
  • Point addition, subtraction, doubling, and equality.
  • Point multiplication by scalars. Accelerated double- and dual-scalar multiply.
  • Scalar addition, subtraction, multiplication, division, and equality.
  • Construction of precomputed tables from points. Precomputed scalarmul.
  • Hashing to the curve with an Elligator variant. Inverse of elligator for steganography. These are useful for advanced protocols such as password-authenticated key exchange (PAKE) and verifiable random functions (VRFs).

Internally, the library uses twisted Edwards curves with the "decaf" and "ristretto" technique to remove the curve's cofactor of 4. The upshot is that systems using the "decaf" interface will be using a prime-order group, which mitigates one of the few disadvantages of Edwards curves. However, this means that it is not able to implement systems which care about cofactor information.

The goal of this library is not only to follow best practices, but to make it easier for clients of the library to follow best practices. With a few well-marked exceptions, the functions in this library should be strongly constant-time: they do not allow secret data to flow to array indices, nor to control decisions except for a final failure check. Furthermore, the C++ wrapping uses RAII to automatically clear sensitive data, and has interfaces designed to prevent certain mistakes.

CFRG cryptosystems.

The library additionally supports the two cryptosystem defined by the Crypto Forum Research Group (CFRG): the X448 Diffie-Hellman functions (RFC 7748), and the EdDSA signature scheme (RFC 8032). Future versions might support additional operations on these curves, such as precomputed signature verification.

Symmetric crypto and hashing

The Goldilocks library doesn't implement much symmetric crypto, but it does contain the hash functions required by the CFRG cryptosystems: SHA-3 and SHAKE.

Internals

The "decaf" technique is described in https://eprint.iacr.org/2015/673 While the title of that paper is "removing cofactors through point compression", it might be more accurate to say "through quotients and isogenies". The internal representation of points is as "even" elements of a twisted Edwards curve with a=-1. Using this subgroup removes a factor of 2 from the cofactor. The remaining factor of 2 or 4 is removed with a quotient group: any two points which differ by an element of the 2- or 4-torsion subgroup are considered equal to each other.

When a point is written out to wire format, it is converted (by isogeny) to a Jacobi quartic curve, which is halfway between an Edwards curve and a Montgomery curve. One of the 4 or 8 equivalent points on the Jacobi quartic is chosen (it is "distinguished" according to certain criteria, such as having a positive x-coordinate). The x-coordinate of this point is written out. The y-coordinate is not written out, but the decoder knows which of the two possible y-coordinates is correct because of the distinguishing rules. See the paper for more details.

Licensing

See LICENSE.txt.

Caveats

As mentioned in the license, there is absolutely NO WARRANTY on any of this code. This code might well have security-critical bugs despite best efforts.

It has been attempted to protect against timing attacks and invalid point attacks, but as of yet there is no attempt to protect against power analysis.

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