Skip to content

Commit

Permalink
Merge pull request #779 from cryspen/franziskus/hacl-rs-p256
Browse files Browse the repository at this point in the history
hacl rs p256
  • Loading branch information
franziskuskiefer authored Feb 10, 2025
2 parents 02e7788 + 5851f0f commit 0623128
Show file tree
Hide file tree
Showing 24 changed files with 9,222 additions and 450 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ members = [
"poly1305",
"chacha20poly1305",
"rsa",
"ecdsa",
"p256",
"blake2",
]

Expand Down
5 changes: 1 addition & 4 deletions blake2/src/hacl/hash_blake2b.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]
#![allow(clippy::match_single_binding)]
#![allow(clippy::needless_lifetimes)]
#![allow(dead_code)]

use libcrux_hacl_rs::prelude::*;
use libcrux_macros as krml;
Expand Down
5 changes: 1 addition & 4 deletions blake2/src/hacl/hash_blake2s.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(unused_assignments)]
#![allow(unreachable_patterns)]
#![allow(clippy::match_single_binding)]
#![allow(clippy::needless_lifetimes)]
#![allow(dead_code)]

use libcrux_hacl_rs::prelude::*;
use libcrux_macros as krml;
Expand Down
26 changes: 26 additions & 0 deletions ecdsa/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "libcrux-ecdsa"
description = "Formally verified ECDSA signature library"

version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
edition.workspace = true
repository.workspace = true
readme.workspace = true

[dependencies]
libcrux-p256 = { version = "=0.0.2-beta.2", path = "../p256", features = [
"expose-hacl",
] }
libcrux-sha2 = { version = "=0.0.2-beta.2", path = "../sha2" }
rand = { version = "0.8", optional = true }

[features]
default = ["rand"]
rand = ["dep:rand"]

[dev-dependencies]
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.138"
29 changes: 29 additions & 0 deletions ecdsa/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//! # ECDSA
//!
//! A formally verified implementation of ECDSA on P-curves.
//!
//! For now only P-256 is supported.
#![no_std]
#![forbid(unsafe_code)]

pub mod p256;

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Error {
InvalidInput,
InvalidScalar,
InvalidPoint,
NoCompressedPoint,
NoUnCompressedPoint,
SigningError,
InvalidSignature,
RandError,
UnsupportedHash,
}

/// The hash algorithm used for signing or verifying.
pub type DigestAlgorithm = libcrux_sha2::Algorithm;

/// The number of iteration for rejection sampling.
pub(crate) const RAND_LIMIT: usize = 100;
Loading

0 comments on commit 0623128

Please sign in to comment.