Rename ECDSAKeyPair to EcdsaKeyPair.

This commit is contained in:
Brian Smith 2018-12-21 12:30:49 -10:00
parent 0c407e4c31
commit b0f8ca2532
3 changed files with 12 additions and 12 deletions

View File

@ -110,7 +110,7 @@ impl Key {
/// private key and public key bytes.
///
/// This is intended for use by code that deserializes key pairs. It is
/// recommended to use `ECDSAKeyPair::from_pkcs8()` (with a PKCS#8-encoded
/// recommended to use `RsaPubeyPair::from_pkcs8()` (with a PKCS#8-encoded
/// key) instead.
pub fn from_private_key_and_public_key(
alg: &'static Algorithm, private_key: untrusted::Input, public_key: untrusted::Input,
@ -162,10 +162,10 @@ impl Key {
// private key d (see [SP800-89] Section 6).
//
// The domain parameters are hard-coded into the source code.
// `ECDSAKeyPair::generate_pkcs8()` can be used to meet the second
// `EcdsaKeyPair::generate_pkcs8()` can be used to meet the second
// requirement; otherwise, it is up to the user to ensure the key pair
// was obtained from a trusted private key. The constructors for
// `ECDSAKeyPair` ensure that #3 and #4 are met subject to the caveats
// `EcdsaKeyPair` ensure that #3 and #4 are met subject to the caveats
// in SP800-89 Section 6.
let ops = self.alg.private_scalar_ops;
@ -388,7 +388,7 @@ mod tests {
};
let private_key =
signature::ECDSAKeyPair::from_private_key_and_public_key(alg, d, q).unwrap();
signature::EcdsaKeyPair::from_private_key_and_public_key(alg, d, q).unwrap();
let rng = test::rand::FixedSliceRandom { bytes: &k };
let actual_result = private_key.sign(msg, &rng).unwrap();
@ -432,7 +432,7 @@ mod tests {
};
let private_key =
signature::ECDSAKeyPair::from_private_key_and_public_key(alg, d, q).unwrap();
signature::EcdsaKeyPair::from_private_key_and_public_key(alg, d, q).unwrap();
let rng = test::rand::FixedSliceRandom { bytes: &k };
let actual_result = private_key.sign(msg, &rng).unwrap();

View File

@ -277,7 +277,7 @@ pub use crate::ec::{
},
suite_b::ecdsa::{
signing::{
Key as ECDSAKeyPair, ECDSA_P256_SHA256_ASN1_SIGNING, ECDSA_P256_SHA256_FIXED_SIGNING,
Key as EcdsaKeyPair, ECDSA_P256_SHA256_ASN1_SIGNING, ECDSA_P256_SHA256_FIXED_SIGNING,
ECDSA_P384_SHA384_ASN1_SIGNING, ECDSA_P384_SHA384_FIXED_SIGNING,
},
verification::{

View File

@ -74,7 +74,7 @@ fn ecdsa_from_pkcs8_test() {
let error = test_case.consume_optional_string("Error");
match (
signature::ECDSAKeyPair::from_pkcs8(this_fixed, input),
signature::EcdsaKeyPair::from_pkcs8(this_fixed, input),
error.clone(),
) {
(Ok(_), None) => (),
@ -84,7 +84,7 @@ fn ecdsa_from_pkcs8_test() {
};
match (
signature::ECDSAKeyPair::from_pkcs8(this_asn1, input),
signature::EcdsaKeyPair::from_pkcs8(this_asn1, input),
error.clone(),
) {
(Ok(_), None) => (),
@ -93,8 +93,8 @@ fn ecdsa_from_pkcs8_test() {
(Err(actual), Some(expected)) => assert_eq!(actual.description(), expected),
};
assert!(signature::ECDSAKeyPair::from_pkcs8(other_fixed, input).is_err());
assert!(signature::ECDSAKeyPair::from_pkcs8(other_asn1, input).is_err());
assert!(signature::EcdsaKeyPair::from_pkcs8(other_fixed, input).is_err());
assert!(signature::EcdsaKeyPair::from_pkcs8(other_asn1, input).is_err());
Ok(())
});
@ -111,7 +111,7 @@ fn ecdsa_generate_pkcs8_test() {
&signature::ECDSA_P384_SHA384_ASN1_SIGNING,
&signature::ECDSA_P384_SHA384_FIXED_SIGNING,
] {
let pkcs8 = signature::ECDSAKeyPair::generate_pkcs8(alg, &rng).unwrap();
let pkcs8 = signature::EcdsaKeyPair::generate_pkcs8(alg, &rng).unwrap();
println!();
for b in pkcs8.as_ref() {
print!("{:02x}", *b);
@ -120,7 +120,7 @@ fn ecdsa_generate_pkcs8_test() {
println!();
#[cfg(feature = "use_heap")]
let _ = signature::ECDSAKeyPair::from_pkcs8(*alg, untrusted::Input::from(pkcs8.as_ref()))
let _ = signature::EcdsaKeyPair::from_pkcs8(*alg, untrusted::Input::from(pkcs8.as_ref()))
.unwrap();
}
}