-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: add feature flags to support no_std (#2394)
* crypto: add feature flags to support no_std * Update crypto/keys/src/ed25519.rs Co-authored-by: Chris Beck <garbageslamb@gmail.com> * Update crypto/platform/README.md Co-authored-by: Chris Beck <garbageslamb@gmail.com> * Update crypto/digestible/Cargo.toml Co-authored-by: Chris Beck <garbageslamb@gmail.com> * update lockfiles for new packages * remove mc-crypto-platform features * sort deps * cargo fmt * Apply suggestions from code review Co-authored-by: Remoun Metyas <remoun.metyas@gmail.com> * changes per review * moarrr cleanup * swap fingerprint display to hex with colons * rename mc-crypto-{platform,dalek} * fix lint * gettin in fights with clippy Co-authored-by: Chris Beck <garbageslamb@gmail.com> Co-authored-by: Remoun Metyas <remoun.metyas@gmail.com>
- Loading branch information
1 parent
243271d
commit 744fc55
Showing
22 changed files
with
517 additions
and
173 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "mc-crypto-dalek" | ||
description = "MobileCoin Dalek Crypto Configurator Package" | ||
version = "2.0.0" | ||
authors = ["MobileCoin"] | ||
edition = "2021" | ||
|
||
[features] | ||
serde = [ "curve25519-dalek/serde", "ed25519-dalek/serde" ] | ||
|
||
|
||
# Use simd backend for x86_64 platforms with `avx` or `avx2` support | ||
[target.'cfg(all(any(target_feature = "avx2", target_feature = "avx"), target_arch = "x86_64"))'.dependencies] | ||
curve25519-dalek = { version = "4.0.0-pre.2", default-features = false, features = ["simd_backend", "nightly"] } | ||
ed25519-dalek = { version = "2.0.0-pre.1", default-features = false, features = ["nightly", "simd_backend"] } | ||
x25519-dalek = { version = "2.0.0-pre.2", default-features = false, features = ["nightly"] } | ||
|
||
# Use u64 backend for x86_64 platforms without avx or avx2 | ||
[target.'cfg(all(not(any(target_feature = "avx2", target_feature = "avx")), target_arch = "x86_64"))'.dependencies] | ||
curve25519-dalek = { version = "4.0.0-pre.2", default-features = false, features = ["nightly", "u64_backend"] } | ||
ed25519-dalek = { version = "2.0.0-pre.1", default-features = false, features = ["nightly", "u64_backend"] } | ||
x25519-dalek = { version = "2.0.0-pre.2", default-features = false, features = ["nightly"] } | ||
|
||
# Otherwise let the platform folks make their own choices | ||
[target.'cfg(not(target_arch = "x86_64"))'.dependencies] | ||
curve25519-dalek = { version = "4.0.0-pre.2", default-features = false, features = ["nightly"] } | ||
ed25519-dalek = { version = "2.0.0-pre.1", default-features = false, features = ["nightly"] } | ||
x25519-dalek = { version = "2.0.0-pre.2", default-features = false, features = ["nightly"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# mc-crypto-dalek | ||
|
||
A metapackage to configure dalek features based on the target platform (and feature flags) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2018-2022 The MobileCoin Foundation | ||
|
||
//! Meta-package to select dalek features without replicating selection logic | ||
//! -everywhere- | ||
|
||
#![no_std] | ||
|
||
/// Re-export of ed25519_dalek | ||
pub use ed25519_dalek::{self as ed25519}; | ||
|
||
/// Re-export of curve25519_dalek | ||
pub use curve25519_dalek::{self as curve25519}; | ||
|
||
/// Re-export of x25519_dalek | ||
pub use x25519_dalek::{self as x25519}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.