mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Add no_std support to transcript, dalek-ff-group, ed448, ciphersuite, multiexp, schnorr, and monero-generators
transcript, dalek-ff-group, ed449, and ciphersuite are all usable with no_std alone. The rest additionally require alloc. Part of #279.
This commit is contained in:
@@ -15,18 +15,24 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[dependencies]
|
||||
rustversion = "1"
|
||||
|
||||
std-shims = { path = "../../common/std-shims", version = "0.1", default-features = false }
|
||||
|
||||
zeroize = { version = "^1.5", features = ["zeroize_derive"] }
|
||||
|
||||
ff = "0.13"
|
||||
group = "0.13"
|
||||
ff = { version = "0.13", default-features = false, features = ["bits"] }
|
||||
group = { version = "0.13", default-features = false }
|
||||
|
||||
rand_core = { version = "0.6", optional = true }
|
||||
rand_core = { version = "0.6", default-features = false, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
rand_core = "0.6"
|
||||
rand_core = { version = "0.6", features = ["std"] }
|
||||
|
||||
k256 = { version = "^0.13.1", default-features = false, features = ["std", "arithmetic", "bits"] }
|
||||
k256 = { version = "^0.13.1", default-features = false, features = ["arithmetic", "bits"] }
|
||||
dalek-ff-group = { path = "../dalek-ff-group" }
|
||||
|
||||
[features]
|
||||
std = ["std-shims/std"]
|
||||
|
||||
batch = ["rand_core"]
|
||||
|
||||
default = ["std"]
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
A multiexp implementation for ff/group implementing Straus and Pippenger. A
|
||||
batch verification API is also available via the "batch" feature, which enables
|
||||
secure multiexponentation batch verification given a series of values which
|
||||
should sum to 0, identifying which doesn't via binary search if they don't.
|
||||
should sum to the identity, identifying which doesn't via binary search if they
|
||||
don't.
|
||||
|
||||
This library was
|
||||
[audited by Cypher Stack in March 2023](https://github.com/serai-dex/serai/raw/e1bb2c191b7123fd260d008e31656d090d559d21/audits/Cypher%20Stack%20crypto%20March%202023/Audit.pdf),
|
||||
culminating in commit
|
||||
[669d2dbffc1dafb82a09d9419ea182667115df06](https://github.com/serai-dex/serai/tree/669d2dbffc1dafb82a09d9419ea182667115df06).
|
||||
Any subsequent changes have not undergone auditing.
|
||||
|
||||
This library is usable under no_std, via alloc, when the default features are
|
||||
disabled.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use std_shims::vec::Vec;
|
||||
|
||||
use rand_core::{RngCore, CryptoRng};
|
||||
|
||||
use zeroize::{Zeroize, Zeroizing};
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use core::ops::DerefMut;
|
||||
#[cfg(not(feature = "std"))]
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
use std_shims::vec::Vec;
|
||||
|
||||
use zeroize::Zeroize;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use std_shims::vec::Vec;
|
||||
|
||||
use zeroize::Zeroize;
|
||||
|
||||
use ff::PrimeFieldBits;
|
||||
|
||||
Reference in New Issue
Block a user