Switch to Rust 2018 Edition.

Switch to Rust 2018 Edition. Fix up some build breakage for different
configurations that were found in the process of testing this,
particularly `--no-default-features`.
This commit is contained in:
Brian Smith 2018-12-08 15:16:17 -10:00
parent ec2a92a4ae
commit 2843931bb7
24 changed files with 92 additions and 128 deletions

View File

@ -4,6 +4,7 @@ build = "build.rs"
categories = ["cryptography", "no-std"]
description = "Safe, fast, small crypto using Rust."
documentation = "https://briansmith.org/rustdoc/ring/"
edition = "2018"
keywords = ["crypto", "cryptography", "rand", "ECC", "RSA"]
license-file = "LICENSE"
name = "ring"

View File

@ -33,8 +33,6 @@
warnings
)]
extern crate cc;
// In the `pregenerate_asm_main()` case we don't want to access (Cargo)
// environment variables at all, so avoid `use std::env` here.

View File

@ -21,24 +21,19 @@
//! `agreement::ECDH_P256`/`agreement::ECDH_P384` for `agreement::X25519`.
//!
//! ```
//! # extern crate untrusted;
//! # extern crate ring;
//! #
//! # fn x25519_agreement_example() -> Result<(), ring::error::Unspecified> {
//! use ring::{agreement, rand};
//! use untrusted;
//!
//! let rng = rand::SystemRandom::new();
//!
//! let my_private_key =
//! agreement::EphemeralPrivateKey::generate(&agreement::X25519, &rng)?;
//! let my_private_key = agreement::EphemeralPrivateKey::generate(&agreement::X25519, &rng)?;
//!
//! // Make `my_public_key` a byte slice containing my public key. In a real
//! // application, this would be sent to the peer in an encoded protocol
//! // message.
//! let mut my_public_key = [0u8; agreement::PUBLIC_KEY_MAX_LEN];
//! let my_public_key =
//! &mut my_public_key[..my_private_key.public_key_len()];
//! let my_public_key = &mut my_public_key[..my_private_key.public_key_len()];
//! my_private_key.compute_public_key(my_public_key)?;
//!
//! // In a real application, the peer public key would be parsed out of a
@ -46,10 +41,8 @@
//! let mut peer_public_key_buf = [0u8; agreement::PUBLIC_KEY_MAX_LEN];
//! let peer_public_key;
//! {
//! let peer_private_key =
//! agreement::EphemeralPrivateKey::generate(&agreement::X25519, &rng)?;
//! peer_public_key =
//! &mut peer_public_key_buf[..peer_private_key.public_key_len()];
//! let peer_private_key = agreement::EphemeralPrivateKey::generate(&agreement::X25519, &rng)?;
//! peer_public_key = &mut peer_public_key_buf[..peer_private_key.public_key_len()];
//! peer_private_key.compute_public_key(peer_public_key)?;
//! }
//! let peer_public_key = untrusted::Input::from(peer_public_key);
@ -59,14 +52,18 @@
//! // is X25519 since we just generated it.
//! let peer_public_key_alg = &agreement::X25519;
//!
//! agreement::agree_ephemeral(my_private_key, peer_public_key_alg,
//! peer_public_key, ring::error::Unspecified,
//! |_key_material| {
//! // In a real application, we'd apply a KDF to the key material and the
//! // public keys (as recommended in RFC 7748) and then derive session
//! // keys from the result. We omit all that here.
//! Ok(())
//! })
//! agreement::agree_ephemeral(
//! my_private_key,
//! peer_public_key_alg,
//! peer_public_key,
//! ring::error::Unspecified,
//! |_key_material| {
//! // In a real application, we'd apply a KDF to the key material and the
//! // public keys (as recommended in RFC 7748) and then derive session
//! // keys from the result. We omit all that here.
//! Ok(())
//! },
//! )
//! # }
//! # fn main() { x25519_agreement_example().unwrap() }
//! ```

View File

@ -29,6 +29,7 @@ impl BitLength {
Ok(BitLength::from_usize_bits(bits))
}
#[cfg(feature = "rsa_signing")]
#[inline]
pub fn half_rounded_up(&self) -> BitLength {
let round_up = self.0 & 1;
@ -38,6 +39,7 @@ impl BitLength {
#[inline]
pub fn as_usize_bits(&self) -> usize { self.0 }
#[cfg(feature = "use_heap")]
#[inline]
pub fn as_usize_bytes_rounded_up(&self) -> usize {
// Equivalent to (self.0 + 7) / 8, except with no potential for
@ -49,11 +51,10 @@ impl BitLength {
(self.0 / 8) + round_up
}
#[cfg(feature = "use_heap")]
#[inline]
pub fn try_sub(self, other: BitLength) -> Result<BitLength, error::Unspecified> {
let sum = self.0.checked_sub(other.0).ok_or(error::Unspecified)?;
pub fn try_sub_1(self) -> Result<BitLength, error::Unspecified> {
let sum = self.0.checked_sub(1).ok_or(error::Unspecified)?;
Ok(BitLength(sum))
}
}
pub const ONE: BitLength = BitLength(1);

View File

@ -273,7 +273,6 @@ pub static ECDSA_P384_SHA384_ASN1: Algorithm = Algorithm {
mod tests {
use super::*;
use crate::test;
use std;
#[test]
fn test_digest_based_test_vectors() {
@ -285,7 +284,7 @@ mod tests {
let curve_name = test_case.consume_string("Curve");
let public_key = {
let mut public_key = std::vec::Vec::new();
let mut public_key = Vec::new();
public_key.push(0x04);
public_key.extend(&test_case.consume_bytes("X"));
public_key.extend(&test_case.consume_bytes("Y"));
@ -295,7 +294,7 @@ mod tests {
let digest = test_case.consume_bytes("Digest");
let sig = {
let mut sig = std::vec::Vec::new();
let mut sig = Vec::new();
sig.extend(&test_case.consume_bytes("R"));
sig.extend(&test_case.consume_bytes("S"));
sig

View File

@ -1036,7 +1036,7 @@ mod tests {
ops: &PrivateKeyOps, test_case: &mut test::TestCase, name: &str,
) -> Point {
let input = test_case.consume_string(name);
let elems = input.split(", ").collect::<std::vec::Vec<&str>>();
let elems = input.split(", ").collect::<Vec<&str>>();
assert_eq!(elems.len(), 3);
let mut p = Point::new_at_infinity();
consume_point_elem(ops.common, &mut p.xyz, &elems, 0);
@ -1053,7 +1053,7 @@ mod tests {
ops: &PrivateKeyOps, test_case: &mut test::TestCase, name: &str,
) -> AffinePoint {
let input = test_case.consume_string(name);
let elems = input.split(", ").collect::<std::vec::Vec<&str>>();
let elems = input.split(", ").collect::<Vec<&str>>();
assert_eq!(elems.len(), 2);
let mut p = AffinePoint {
xy: [0; 2 * MAX_LIMBS],
@ -1063,9 +1063,7 @@ mod tests {
p
}
fn consume_point_elem(
ops: &CommonOps, limbs_out: &mut [Limb], elems: &std::vec::Vec<&str>, i: usize,
) {
fn consume_point_elem(ops: &CommonOps, limbs_out: &mut [Limb], elems: &Vec<&str>, i: usize) {
let bytes = test::from_hex(elems[i]).unwrap();
let bytes = untrusted::Input::from(&bytes);
let r: Elem<Unencoded> = elem_parse_big_endian_fixed_consttime(ops, bytes).unwrap();
@ -1080,7 +1078,7 @@ mod tests {
}
fn consume_point(ops: &PrivateKeyOps, test_case: &mut test::TestCase, name: &str) -> TestPoint {
fn consume_point_elem(ops: &CommonOps, elems: &std::vec::Vec<&str>, i: usize) -> Elem<R> {
fn consume_point_elem(ops: &CommonOps, elems: &Vec<&str>, i: usize) -> Elem<R> {
let bytes = test::from_hex(elems[i]).unwrap();
let bytes = untrusted::Input::from(&bytes);
let unencoded: Elem<Unencoded> =
@ -1097,7 +1095,7 @@ mod tests {
if input == "inf" {
return TestPoint::Infinity;
}
let elems = input.split(", ").collect::<std::vec::Vec<&str>>();
let elems = input.split(", ").collect::<Vec<&str>>();
assert_eq!(elems.len(), 2);
let x = consume_point_elem(ops.common, &elems, 0);
let y = consume_point_elem(ops.common, &elems, 1);
@ -1158,7 +1156,7 @@ mod tests {
fn consume_padded_bytes(
ops: &CommonOps, test_case: &mut test::TestCase, name: &str,
) -> std::vec::Vec<u8> {
) -> Vec<u8> {
let unpadded_bytes = test_case.consume_bytes(name);
let mut bytes = vec![0; (ops.num_limbs * LIMB_BYTES) - unpadded_bytes.len()];
bytes.extend(&unpadded_bytes);

View File

@ -35,7 +35,6 @@ use std;
/// described in [“Error Handling” in the Rust Book]:
///
/// ```
/// extern crate ring;
/// use ring::rand::{self, SecureRandom};
///
/// enum Error {
@ -139,7 +138,8 @@ impl From<untrusted::EndOfInput> for Unspecified {
pub struct KeyRejected(&'static str);
impl KeyRejected {
fn description_(&self) -> &'static str { self.0 }
/// The value returned from <Self as std::error::Error>::description()
pub fn description_(&self) -> &'static str { self.0 }
pub(crate) fn inconsistent_components() -> Self { KeyRejected("InconsistentComponents") }
@ -150,8 +150,10 @@ impl KeyRejected {
pub(crate) fn public_key_is_missing() -> Self { KeyRejected("PublicKeyIsMissing") }
#[cfg(feature = "use_heap")]
pub(crate) fn too_small() -> Self { KeyRejected("TooSmall") }
#[cfg(feature = "use_heap")]
pub(crate) fn too_large() -> Self { KeyRejected("TooLarge") }
pub(crate) fn version_not_supported() -> Self { KeyRejected("VersionNotSupported") }

View File

@ -59,48 +59,37 @@
unused_results,
warnings
)]
#![no_std]
#![cfg_attr(
any(
target_os = "redox",
all(
not(test),
not(feature = "use_heap"),
unix,
not(any(target_os = "macos", target_os = "ios")),
any(not(target_os = "linux"), feature = "dev_urandom_fallback")
)
),
no_std
)]
#![cfg_attr(feature = "internal_benches", allow(unstable_features))]
#![cfg_attr(feature = "internal_benches", feature(test))]
#[cfg(target_os = "linux")]
extern crate libc;
#[cfg(feature = "internal_benches")]
extern crate test as bench;
#[cfg(any(
target_os = "redox",
all(
unix,
not(any(target_os = "macos", target_os = "ios")),
any(not(target_os = "linux"), feature = "dev_urandom_fallback")
)
))]
#[macro_use]
extern crate lazy_static;
#[macro_use]
mod debug;
// `ring::test` uses the formatting & printing stuff in non-test mode.
#[macro_use]
extern crate std;
extern crate untrusted;
mod arithmetic;
#[macro_use]
mod bssl;
#[macro_use]
mod polyfill;
mod arithmetic;
pub mod aead;
pub mod agreement;
#[cfg(feature = "use_heap")]
#[cfg(any(test, feature = "use_heap"))]
mod bits;
mod c;
@ -127,7 +116,6 @@ mod rsa;
pub mod signature;
mod signature_impl;
#[cfg(any(feature = "use_heap", test))]
pub mod test;
mod private {

View File

@ -18,7 +18,11 @@
//! Limbs ordered least-significant-limb to most-significant-limb. The bits
//! limbs use the native endianness.
use crate::{bits, c, error, untrusted};
use crate::{c, error};
use untrusted;
#[cfg(any(test, feature = "use_heap"))]
use crate::bits;
#[cfg(feature = "rsa_signing")]
use core::num::Wrapping;
@ -52,7 +56,8 @@ pub enum LimbMask {
pub const LIMB_BYTES: usize = (LIMB_BITS + 7) / 8;
#[cfg(any(test, feature = "rsa_signing"))]
#[allow(dead_code)]
#[cfg(feature = "use_heap")]
#[inline]
pub fn limbs_equal_limbs_consttime(a: &[Limb], b: &[Limb]) -> LimbMask {
extern "C" {
@ -85,7 +90,7 @@ pub fn limbs_are_zero_constant_time(limbs: &[Limb]) -> LimbMask {
unsafe { LIMBS_are_zero(limbs.as_ptr(), limbs.len()) }
}
#[cfg(feature = "use_heap")]
#[cfg(any(test, feature = "use_heap"))]
#[inline]
pub fn limbs_are_even_constant_time(limbs: &[Limb]) -> LimbMask {
unsafe { LIMBS_are_even(limbs.as_ptr(), limbs.len()) }
@ -104,6 +109,7 @@ pub fn limbs_equal_limb_constant_time(a: &[Limb], b: Limb) -> LimbMask {
// with respect to `a.len()` or the value of the result or the value of the
// most significant bit (It's 1, unless the input is zero, in which case it's
// zero.)
#[cfg(any(test, feature = "use_heap"))]
pub fn limbs_minimal_bits(a: &[Limb]) -> bits::BitLength {
for num_limbs in (1..=a.len()).rev() {
let high_limb = a[num_limbs - 1];
@ -319,7 +325,10 @@ pub fn fold_5_bit_windows<R, I: FnOnce(Window) -> R, F: Fn(R, Window) -> R>(
}
extern "C" {
#[cfg(feature = "use_heap")]
#[cfg(any(test, feature = "use_heap"))]
fn LIMB_shr(a: Limb, shift: c::size_t) -> Limb;
#[cfg(any(test, feature = "use_heap"))]
fn LIMBS_are_even(a: *const Limb, num_limbs: c::size_t) -> LimbMask;
fn LIMBS_are_zero(a: *const Limb, num_limbs: c::size_t) -> LimbMask;
#[cfg(any(test, feature = "rsa_signing"))]
@ -328,7 +337,6 @@ extern "C" {
#[cfg(feature = "use_heap")]
fn LIMBS_less_than_limb(a: *const Limb, b: Limb, num_limbs: c::size_t) -> LimbMask;
fn LIMBS_reduce_once(r: *mut Limb, m: *const Limb, num_limbs: c::size_t);
fn LIMB_shr(a: Limb, shift: c::size_t) -> Limb;
}
#[cfg(test)]

View File

@ -191,6 +191,8 @@ mod urandom {
use std;
pub fn fill(dest: &mut [u8]) -> Result<(), error::Unspecified> {
use lazy_static::lazy_static;
#[cfg(target_os = "redox")]
static RANDOM_PATH: &str = "rand:";
#[cfg(unix)]
@ -222,6 +224,8 @@ mod sysrand_or_urandom {
}
pub fn fill(dest: &mut [u8]) -> Result<(), error::Unspecified> {
use lazy_static::lazy_static;
lazy_static! {
static ref MECHANISM: Mechanism = {
let mut dummy = [0u8; 1];

View File

@ -44,18 +44,16 @@ use crate::{
arithmetic::montgomery::*,
bits, c, error,
limb::{self, Limb, LimbMask, LIMB_BITS, LIMB_BYTES},
untrusted,
};
use core::{
self,
marker::PhantomData,
ops::{Deref, DerefMut},
};
use std;
use untrusted;
#[cfg(feature = "rsa_signing")]
use bssl;
use crate::bssl;
pub unsafe trait Prime {}
@ -68,7 +66,7 @@ struct Width<M> {
/// All `BoxedLimbs<M>` are stored in the same number of limbs.
struct BoxedLimbs<M> {
limbs: std::boxed::Box<[Limb]>,
limbs: Box<[Limb]>,
/// The modulus *m* that determines the size of `limbx`.
m: PhantomData<M>,
@ -812,7 +810,7 @@ impl<M: Prime> PrivateExponent<M> {
pub fn elem_exp_consttime<M>(
base: Elem<M, R>, exponent: &PrivateExponent<M>, m: &Modulus<M>,
) -> Result<Elem<M, Unencoded>, error::Unspecified> {
use limb::Window;
use crate::limb::Window;
const WINDOW_BITS: usize = 5;
const TABLE_ENTRIES: usize = 1 << WINDOW_BITS;
@ -908,7 +906,7 @@ pub fn elem_exp_consttime<M>(
// the awkwardness here stems from trying to use the assembly code like
// OpenSSL does.
use limb::Window;
use crate::limb::Window;
const WINDOW_BITS: usize = 5;
const TABLE_ENTRIES: usize = 1 << WINDOW_BITS;
@ -1085,7 +1083,8 @@ pub fn verify_inverses_consttime<M>(
}
}
#[cfg(any(test, feature = "rsa_signing"))]
#[allow(dead_code)]
#[cfg(feature = "use_heap")]
#[inline]
pub fn elem_verify_equal_consttime<M, E>(
a: &Elem<M, E>, b: &Elem<M, E>,
@ -1100,7 +1099,7 @@ pub fn elem_verify_equal_consttime<M, E>(
/// Nonnegative integers.
#[cfg(feature = "rsa_signing")]
pub struct Nonnegative {
limbs: std::vec::Vec<Limb>,
limbs: Vec<Limb>,
}
#[cfg(feature = "rsa_signing")]

View File

@ -390,7 +390,7 @@ impl PSSMetrics {
fn new(
digest_alg: &'static digest::Algorithm, mod_bits: bits::BitLength,
) -> Result<PSSMetrics, error::Unspecified> {
let em_bits = mod_bits.try_sub(bits::ONE)?;
let em_bits = mod_bits.try_sub_1()?;
let em_len = em_bits.as_usize_bytes_rounded_up();
let leading_zero_bits = (8 * em_len) - em_bits.as_usize_bits();
debug_assert!(leading_zero_bits < 8);

View File

@ -492,7 +492,7 @@ impl SigningState {
/// x86-64, this is done pretty well, but not perfectly. On other
/// platforms, it is done less perfectly.
pub fn sign(
&mut self, padding_alg: &'static ::signature::RSAEncoding, rng: &rand::SecureRandom,
&mut self, padding_alg: &'static crate::signature::RSAEncoding, rng: &rand::SecureRandom,
msg: &[u8], signature: &mut [u8],
) -> Result<(), error::Unspecified> {
let mod_bits = self.key_pair.public_key.n_bits;

View File

@ -127,9 +127,6 @@
//! ## Signing and verifying with Ed25519
//!
//! ```
//! extern crate ring;
//! extern crate untrusted;
//!
//! use ring::{rand, signature};
//!
//! # fn sign_and_verify_ed25519() -> Result<(), ring::error::Unspecified> {
@ -199,9 +196,6 @@
//! ```
//!
//! ```
//! extern crate ring;
//! extern crate untrusted;
//!
//! use ring::{rand, signature};
//!
//! # #[cfg(all(feature = "rsa_signing", feature = "use_heap"))]
@ -306,10 +300,10 @@ pub use crate::ec::curve25519::ed25519::signing::{
};
#[cfg(all(feature = "rsa_signing", feature = "use_heap"))]
pub use rsa::signing::{KeyPair as RSAKeyPair, SigningState as RSASigningState};
pub use crate::rsa::signing::{KeyPair as RSAKeyPair, SigningState as RSASigningState};
#[cfg(all(feature = "rsa_signing", feature = "use_heap"))]
pub use rsa::{
pub use crate::rsa::{
RSAEncoding,
// `RSA_PKCS1_SHA1` is intentionally not exposed. At a minimum, we'd need
@ -349,7 +343,7 @@ pub mod primitive {
#[derive(Debug)]
#[cfg(feature = "use_heap")]
pub struct KeyPair {
inner: std::boxed::Box<KeyPairImpl + Send + Sync>,
inner: Box<KeyPairImpl + Send + Sync>,
}
#[cfg(feature = "use_heap")]
@ -414,9 +408,6 @@ pub trait VerificationAlgorithm: core::fmt::Debug + Sync + private::Sealed {
/// ## Verify a RSA PKCS#1 signature that uses the SHA-256 digest
///
/// ```
/// extern crate ring;
/// extern crate untrusted;
///
/// use ring::signature;
///
/// enum Error {

View File

@ -31,10 +31,7 @@
warnings
)]
extern crate ring;
use ring::{aead, error, test};
use std::vec::Vec;
#[test]
fn aead_aes_gcm_128() { test_aead(&aead::AES_128_GCM, "tests/aead_aes_128_gcm_tests.txt"); }

View File

@ -31,9 +31,6 @@
warnings
)]
extern crate ring;
extern crate untrusted;
use ring::{agreement, error, rand, test};
#[test]

View File

@ -31,10 +31,7 @@
warnings
)]
extern crate ring;
use ring::{digest, test};
use std::vec::Vec;
/// Test vectors from BoringSSL, Go, and other sources.
#[test]
@ -64,7 +61,6 @@ fn digest_misc() {
mod digest_shavs {
use ring::{digest, test};
use std::vec::Vec;
macro_rules! shavs_tests {
( $algorithm_name:ident ) => {

View File

@ -31,13 +31,11 @@
warnings
)]
extern crate ring;
extern crate untrusted;
use ring::{rand, signature, test};
// ECDSA *signing* tests are in src/ec/ecdsa/signing.rs.
#[cfg(feature = "use_heap")]
#[test]
fn ecdsa_from_pkcs8_test() {
test::from_file("tests/ecdsa_from_pkcs8_tests.txt", |section, test_case| {
@ -120,6 +118,8 @@ fn ecdsa_generate_pkcs8_test() {
}
println!();
println!();
#[cfg(feature = "use_heap")]
let _ =
signature::key_pair_from_pkcs8(*alg, untrusted::Input::from(pkcs8.as_ref())).unwrap();
}

View File

@ -31,9 +31,6 @@
warnings
)]
extern crate ring;
extern crate untrusted;
use ring::{
signature::{self, Ed25519KeyPair},
test,
@ -125,8 +122,6 @@ fn test_ed25519_from_pkcs8_unchecked() {
test::from_file(
"tests/ed25519_from_pkcs8_unchecked_tests.txt",
|section, test_case| {
use std::error::Error;
assert_eq!(section, "");
let input = test_case.consume_bytes("Input");
let error = test_case.consume_optional_string("Error");
@ -138,7 +133,7 @@ fn test_ed25519_from_pkcs8_unchecked() {
(Ok(_), None) => (),
(Err(e), None) => panic!("Failed with error \"{}\", but expected to succeed", e),
(Ok(_), Some(e)) => panic!("Succeeded, but expected error \"{}\"", e),
(Err(actual), Some(expected)) => assert_eq!(actual.description(), expected),
(Err(actual), Some(expected)) => assert_eq!(actual.description_(), expected),
};
Ok(())
@ -152,8 +147,6 @@ fn test_ed25519_from_pkcs8() {
test::from_file(
"tests/ed25519_from_pkcs8_tests.txt",
|section, test_case| {
use std::error::Error;
assert_eq!(section, "");
let input = test_case.consume_bytes("Input");
let error = test_case.consume_optional_string("Error");
@ -165,7 +158,7 @@ fn test_ed25519_from_pkcs8() {
(Ok(_), None) => (),
(Err(e), None) => panic!("Failed with error \"{}\", but expected to succeed", e),
(Ok(_), Some(e)) => panic!("Succeeded, but expected error \"{}\"", e),
(Err(actual), Some(expected)) => assert_eq!(actual.description(), expected),
(Err(actual), Some(expected)) => assert_eq!(actual.description_(), expected),
};
Ok(())

View File

@ -31,8 +31,6 @@
warnings
)]
extern crate ring;
use ring::{error, hkdf, hmac, test};
#[test]
@ -47,7 +45,7 @@ fn hkdf_tests() {
let info = test_case.consume_bytes("info");
// The PRK is an intermediate value that we can't test, but we
// have to consume it to make test::from_file happy.
// have to consume it to make test_util::from_file happy.
let _ = test_case.consume_bytes("PRK");
let expected_out = test_case.consume_bytes("OKM");

View File

@ -31,8 +31,6 @@
warnings
)]
extern crate ring;
use ring::{digest, error, hmac, test};
#[test]

View File

@ -31,8 +31,6 @@
warnings
)]
extern crate ring;
use ring::{digest, error, pbkdf2, test};
use std::num::NonZeroU32;

View File

@ -31,9 +31,7 @@
warnings
)]
extern crate ring;
extern crate untrusted;
#[cfg(feature = "use_heap")]
use ring::{der, error, signature, test};
#[cfg(feature = "rsa_signing")]
@ -151,6 +149,7 @@ fn test_rsa_key_pair_traits() {
// TODO: Test that RSASigningState is NOT Sync.
}
#[cfg(feature = "use_heap")]
#[test]
fn test_signature_rsa_pkcs1_verify() {
test::from_file("tests/rsa_pkcs1_verify_tests.txt", |section, test_case| {
@ -199,6 +198,7 @@ fn test_signature_rsa_pkcs1_verify() {
});
}
#[cfg(feature = "use_heap")]
#[test]
fn test_signature_rsa_pss_verify() {
test::from_file("tests/rsa_pss_verify_tests.txt", |section, test_case| {
@ -248,6 +248,7 @@ fn test_signature_rsa_pss_verify() {
// Test for `primitive::verify()`. Read public key parts from a file
// and use them to verify a signature.
#[cfg(feature = "use_heap")]
#[test]
fn test_signature_rsa_primitive_verification() {
test::from_file(

View File

@ -1,10 +1,10 @@
extern crate ring;
use ring::{signature, test};
#[test]
fn signature_impl_test() {
#[cfg(feature = "use_heap")]
test::compile_time_assert_debug::<signature::KeyPair>();
#[cfg(feature = "use_heap")]
test::compile_time_assert_send::<signature::KeyPair>();
test::compile_time_assert_clone::<signature::Signature>();