You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds setters for the ANSI X9.63 KDFs (`EcKdf::sha1`, etc) and the NIST
SP800-56A KDFs (`EcKdf::sha1_sp800`) to `EcKdf`.
Fixes `EcKdf::sha256`.
Fixes#281.
Signed-off-by: Neal H. Walfield <[email protected]>
let key = dehex("F00670C5F139E7E6C2511EA04FF507AFBBE237CE3C71A89CA59A1C5CF8856562").expect("valid hex");
720
+
let ephemeral_key = dehex("533B3F09E53B3DEED661A13F7A7D9694AB71CE156C728E00DEE87A1EE3A14C4A").expect("valid hex");
721
+
let kdf_param = dehex("0A2B0601040197550105011203010807416E6F6E796D6F75732053656E646572202020205633A4C5AE4305BC0FE2ABB699A8EE54632790A0").expect("valid hex");
722
+
let derivation = dehex("AF8CE51D0139A6D60831A9BABAB20186").expect("valid hex");
723
+
724
+
let template = [
725
+
Attribute::Class(ObjectClass::PRIVATE_KEY),
726
+
Attribute::KeyType(KeyType::EC_MONTGOMERY),
727
+
Attribute::EcParams(vec![
728
+
0x13,0x0a,0x63,0x75,0x72,0x76,0x65,0x32,
729
+
0x35,0x35,0x31,0x39
730
+
]),
731
+
Attribute::Value(key),
732
+
Attribute::Id(b"foo".to_vec()),
733
+
Attribute::Label(b"bar".to_vec()),
734
+
Attribute::Sensitive(true),
735
+
Attribute::Token(true),
736
+
Attribute::Derive(true),
737
+
];
738
+
739
+
let private = session.create_object(&template)?;
740
+
741
+
let kdf = EcKdf::sha256_sp800(&kdf_param);
742
+
743
+
let params = Ecdh1DeriveParams::new(kdf,&ephemeral_key);
0 commit comments