mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Resolve #268 by adding a Zeroize to DigestTranscript which writes a full block
This is a 'better-than-nothing' attempt to invalidate its state. Also replaces black_box features with usage of the rustversion crate.
This commit is contained in:
@@ -12,6 +12,8 @@ all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[dependencies]
|
||||
rustversion = "1"
|
||||
|
||||
thiserror = { version = "1", optional = true }
|
||||
rand_core = "0.6"
|
||||
|
||||
@@ -41,7 +43,6 @@ std = []
|
||||
serialize = ["std"]
|
||||
|
||||
# Needed for cross-group DLEqs
|
||||
black_box = []
|
||||
secure_capacity_difference = []
|
||||
experimental = ["std", "thiserror", "multiexp"]
|
||||
|
||||
|
||||
@@ -30,14 +30,11 @@ pub(crate) mod aos;
|
||||
mod bits;
|
||||
use bits::{BitSignature, Bits};
|
||||
|
||||
// Feature gated due to MSRV requirements
|
||||
#[cfg(feature = "black_box")]
|
||||
pub(crate) fn black_box<T>(val: T) -> T {
|
||||
core::hint::black_box(val)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "black_box"))]
|
||||
pub(crate) fn black_box<T>(val: T) -> T {
|
||||
// Use black_box when possible
|
||||
#[rustversion::since(1.66)]
|
||||
use core::hint::black_box;
|
||||
#[rustversion::before(1.66)]
|
||||
fn black_box<T>(val: T) -> T {
|
||||
val
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user