mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
dalek 4.0
This commit is contained in:
@@ -261,10 +261,11 @@ impl ClassicSeed {
|
||||
let (lang, entropy) = seed_to_bytes(&words)?;
|
||||
|
||||
// Make sure this is a valid scalar
|
||||
let mut scalar = Scalar::from_canonical_bytes(*entropy);
|
||||
if scalar.is_none() {
|
||||
let scalar = Scalar::from_canonical_bytes(*entropy);
|
||||
if scalar.is_none().into() {
|
||||
Err(SeedError::InvalidSeed)?;
|
||||
}
|
||||
let mut scalar = scalar.unwrap();
|
||||
scalar.zeroize();
|
||||
|
||||
// Call from_entropy so a trimmed seed becomes a full seed
|
||||
@@ -272,7 +273,7 @@ impl ClassicSeed {
|
||||
}
|
||||
|
||||
pub fn from_entropy(lang: Language, entropy: Zeroizing<[u8; 32]>) -> Option<ClassicSeed> {
|
||||
Scalar::from_canonical_bytes(*entropy).map(|scalar| key_to_seed(lang, Zeroizing::new(scalar)))
|
||||
Option::from(Scalar::from_canonical_bytes(*entropy)).map(|scalar| key_to_seed(lang, Zeroizing::new(scalar)))
|
||||
}
|
||||
|
||||
pub(crate) fn to_string(&self) -> Zeroizing<String> {
|
||||
|
||||
Reference in New Issue
Block a user