Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking uses of fiat-crypto #902

Open
JasonGross opened this issue Dec 18, 2020 · 21 comments
Open

Tracking uses of fiat-crypto #902

JasonGross opened this issue Dec 18, 2020 · 21 comments

Comments

@JasonGross
Copy link
Collaborator

Maybe we should create a wiki page tracking uses of fiat-crypto?

The ones I'm aware of:

@huitseeker
Copy link
Contributor

huitseeker commented Dec 18, 2020

@vincenthz
Copy link

my modest addition : eccoxide

@chjj
Copy link

chjj commented Dec 25, 2020

libtorsion

@huitseeker
Copy link
Contributor

@bbbrumley
Copy link

Yes these are ECCKiila deployments but IMO you def should track them for your own visibility.

@hannesm
Copy link
Contributor

hannesm commented Jan 17, 2021

In MirageOS (OCaml) we use fiat (the exported C source code, bound and wrapped https://github.com/mirage/fiat) for ECDH on P256. This is packaged in opam as fiat-p256 and used by OCaml-TLS - a TLS implementation in pure OCaml).

Upcoming is ECDSA support (to be integrated into X.509, once I find time to figure #885) and "more curves" (P384, P521, secp256k1, Ed448). From the list of "things that would be nice" there's for sure "try the OCaml code extraction and measure speed differences between C and OCaml", and also "provide a build rule to run the extraction on local machine").

@jvz
Copy link

jvz commented Jan 19, 2021

I've imported the curve25519 code into https://github.com/o1c-dev/o1c recently. I tried using the Java sources originally, but I couldn't get its output to match the C code, so I'm not sure if that works properly. I did get the C code working after referring to the BoringSSL notes page.

@JasonGross
Copy link
Collaborator Author

JasonGross commented Jan 19, 2021

It's cool to see how many projects are using fiat-crypto!

I tried using the Java sources originally, but I couldn't get its output to match the C code, so I'm not sure if that works properly

I believe the Java code is only synthesizing 32-bit operations (see #681), so that might be the discrepancy you're hitting. If it's not, please do open an issue, or comment on #707 with an example discrepancy, since we are lacking tests for the Java output (and may have gotten casting wrong).

I did get the C code working after referring to the BoringSSL notes page.

If you think the code could use more comments on how to use it, or if you think the README could benefit from more instructions, please feel free to open an issue or PR.

@jvz
Copy link

jvz commented Jan 19, 2021

I tried using curve25519_32.c for comparison with the Java variant. One of the confusing aspects is that the field elements are unpacked from int arrays rather than byte arrays as the other APIs work, though even converting a byte array to that form or manually constructing one gives different results as demoed in https://gist.github.com/jvz/0bd0ff04b47524da8b8aedc16e79a4eb which I've commented in #707.

@jvz
Copy link

jvz commented Jan 25, 2021

I just noticed that OpenBSD is using fiat-crypto, though it's somewhat transitive since it's related to WireGuard code.

@dfaranha
Copy link
Contributor

Touting my own horn, but RELIC also supports Fiat-Crypto as a field arithmetic backend.

@huitseeker
Copy link
Contributor

huitseeker commented Apr 15, 2021

Available directly as a backend in dalek-crypto, as of version 3.1.

@JasonGross
Copy link
Collaborator Author

@huitseeker Nice! 9cb5fdd066d6caea2056f5bb591b2b8390a40224 is not a commit of mit-plv/fiat-crypto, though, and doesn't seem to be in https://github.com/dalek-cryptography/curve25519-dalek nor https://github.com/novifinancial/curve25519-dalek-fiat...

Btw, should we update the CI test of

################################################################################
# Tests for calibra/curve25519-dalek
################################################################################
git clone https://github.com/calibra/curve25519-dalek.git --branch=fiat2 curve25519-dalek || exit $?
pushd curve25519-dalek >/dev/null || exit $?
cat >> Cargo.toml <<EOF
[patch.crates-io]
fiat-crypto = { path = "../fiat-rust" }
EOF
cargo test --features="std fiat_u64_backend" --no-default-features || exit $?

?

@jedisct1
Copy link
Contributor

A small addition, that's been using it since day one: ed25519-compact (rust)

It is also planned to be used in the standard library of the Zig programming language, as well as the reference implementation of the standard cryptography interface for WebAssembly using the Zig code.

@JasonGross JasonGross pinned this issue Apr 20, 2021
@hannesm
Copy link
Contributor

hannesm commented Apr 23, 2021

coming back here, we in MirageOS (+OCaml) finally have the stack released and in use (for ECDH and ECDSA / Ed25519)-- I published a post about that https://hannes.robur.coop/Posts/EC -- once again thanks for fiat :)

code https://github.com/mirage/mirage-crypto/tree/main/ec (extraction infrastructure https://github.com/mirage/mirage-crypto/tree/main/ec/native)

@armfazh
Copy link
Contributor

armfazh commented Jul 27, 2021

Soon-ish CIRCL Go cryptography library.
See cloudflare/circl#252

@brycx
Copy link
Contributor

brycx commented Oct 26, 2021

FWIW, Orion uses fiat-crypto for X25519 in the upcoming release.

Edit: Poly1305 using fiat-crypto is included in the next release.

@apetcher-amazon
Copy link

AWS libcrypto incorporates the P-384 code in addition to the curves that are provided by BoringSSL. Addition of P-521 is currently under review.

@andres-erbsen
Copy link
Contributor

@0x0ece
Copy link

0x0ece commented Mar 12, 2024

Firedancer: https://github.com/firedancer-io/firedancer
(first added here: firedancer-io/firedancer#1311)

@emmansun
Copy link
Contributor

gmsm for SM2 Elliptic Curve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests