Skip to content

Commit 1c33224

Browse files
committed
dsa: Make compilation work on thumbv7em-none-eabi
1 parent 84715de commit 1c33224

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

.github/workflows/dsa.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- thumbv7em-none-eabi
2525
- wasm32-unknown-unknown
2626
toolchain:
27-
- 1.60.0 # MSRV
27+
- 1.57.0 # MSRV
2828
- stable
2929
steps:
3030
- uses: actions/checkout@v2
@@ -43,7 +43,7 @@ jobs:
4343
- macos-latest
4444
- windows-latest
4545
toolchain:
46-
- 1.60.0 # MSRV
46+
- 1.57.0 # MSRV
4747
- stable
4848
runs-on: ${{ matrix.platform }}
4949
steps:

dsa/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ license = "Apache-2.0 OR MIT"
66
readme = "README.md"
77
categories = ["cryptography"]
88
keywords = ["crypto", "nist", "signature"]
9-
rust-version = "1.60" # MSRV because of the feature syntax
9+
rust-version = "1.57"
1010

1111
[dependencies]
1212
digest = "0.10.3"
1313
num-bigint = { package = "num-bigint-dig", version = "0.8.1", default-features = false, features = ["prime", "rand", "zeroize"] }
1414
num-traits = { version = "0.2.15", default-features = false }
1515
opaque-debug = "0.3.0"
1616
paste = "1.0.7"
17-
pkcs8 = { version = "0.9.0", default-features = false, features = ["std"] }
17+
pkcs8 = { version = "0.9.0", default-features = false, features = ["alloc"] }
1818
rand = { version = "0.8.5", default-features = false }
1919
signature = { version = "1.5.0", optional = true }
2020
zeroize = { version = "1.5.5", default-features = false }
2121

2222
[features]
23-
default = ["signature"]
24-
signature = ["dep:signature", "rand/std", "rand/std_rng"]
23+
default = ["signature-compat"]
24+
signature-compat = ["signature", "pkcs8/std", "rand/std", "rand/std_rng"]
2525

2626
[dev-dependencies]
2727
pkcs8 = { version = "0.9.0", default-features = false, features = ["pem"] }

dsa/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
//! ```
5555
//!
5656
57+
#![cfg_attr(not(feature = "signature-compat"), no_std)]
5758
#![forbid(missing_docs, unsafe_code)]
5859
#![deny(rust_2018_idioms)]
5960

@@ -68,8 +69,8 @@ pub use self::signature::Signature;
6869
// Re-export the types needed for de-/serialising keys to DER and PEM
6970
pub use pkcs8;
7071

71-
#[cfg(feature = "signature")]
72-
#[cfg_attr(doc_cfg, doc(cfg(feature = "signature")))]
72+
#[cfg(feature = "signature-compat")]
73+
#[cfg_attr(doc_cfg, doc(cfg(feature = "signature-compat")))]
7374
pub mod compat;
7475
pub mod consts;
7576

dsa/src/privatekey.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
//!
44
55
use crate::{Components, PublicKey, Signature, DSA_OID};
6+
use core::cmp::min;
67
use digest::Digest;
78
use num_bigint::BigUint;
89
use pkcs8::{
910
der::{asn1::UIntRef, AnyRef, Decode, Encode},
1011
AlgorithmIdentifier, DecodePrivateKey, EncodePrivateKey, PrivateKeyInfo, SecretDocument,
1112
};
1213
use rand::{CryptoRng, RngCore};
13-
use std::cmp::min;
1414
use zeroize::Zeroizing;
1515

1616
/// DSA private key

dsa/src/publickey.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
//!
44
55
use crate::{Components, Signature, DSA_OID};
6+
use core::cmp::min;
67
use digest::Digest;
78
use num_bigint::{BigUint, ModInverse};
89
use num_traits::One;
910
use pkcs8::{
1011
der::{asn1::UIntRef, AnyRef, Decode, Encode},
1112
spki, AlgorithmIdentifier, DecodePublicKey, EncodePublicKey, SubjectPublicKeyInfo,
1213
};
13-
use std::cmp::min;
1414

1515
/// DSA public key
1616
#[derive(Clone, PartialEq, PartialOrd)]

0 commit comments

Comments
 (0)