• Home
  • Raw
  • Download

Lines Matching refs:key

62         let key = match curve {  in generate_nist_key()  localVariable
68 Ok(crypto::KeyMaterial::Ec(curve.into(), CurveType::Nist, key.into())) in generate_nist_key()
77 let key = ossl!(pkey.raw_private_key())?; in generate_ed25519_key() localVariable
78 let key: [u8; ec::CURVE25519_PRIV_KEY_LEN] = key.try_into().map_err(|e| { in generate_ed25519_key() localVariable
81 let key = Key::Ed25519(ec::Ed25519Key(key)); in generate_ed25519_key() localVariable
82 Ok(crypto::KeyMaterial::Ec(EcCurve::Curve25519, CurveType::EdDsa, key.into())) in generate_ed25519_key()
91 let key = ossl!(pkey.raw_private_key())?; in generate_x25519_key() localVariable
92 let key: [u8; ec::CURVE25519_PRIV_KEY_LEN] = key.try_into().map_err(|e| { in generate_x25519_key() localVariable
95 let key = Key::X25519(ec::X25519Key(key)); in generate_x25519_key() localVariable
96 Ok(crypto::KeyMaterial::Ec(EcCurve::Curve25519, CurveType::Xdh, key.into())) in generate_x25519_key()
99 fn nist_public_key(&self, key: &ec::NistKey, curve: ec::NistCurve) -> Result<Vec<u8>, Error> { in nist_public_key()
101 let ec_key = ossl!(private_key_from_der_for_group(&key.0, group.as_ref()))?; in nist_public_key()
111 fn ed25519_public_key(&self, key: &ec::Ed25519Key) -> Result<Vec<u8>, Error> { in ed25519_public_key()
113 &key.0, in ed25519_public_key()
119 fn x25519_public_key(&self, key: &ec::X25519Key) -> Result<Vec<u8>, Error> { in x25519_public_key()
121 &key.0, in x25519_public_key()
127 fn begin_agree(&self, key: OpaqueOr<Key>) -> Result<Box<dyn AccumulatingOperation>, Error> { in begin_agree()
128 let key = explicit!(key)?; in begin_agree() localVariable
145 Ok(Box::new(BoringEcAgreeOperation { key, pending_input: Vec::new(), max_size })) in begin_agree()
150 key: OpaqueOr<Key>, in begin_sign()
153 let key = explicit!(key)?; in begin_sign() localVariable
154 let curve = key.curve(); in begin_sign()
155 match key { in begin_sign()
156 Key::P224(key) | Key::P256(key) | Key::P384(key) | Key::P521(key) => { in begin_sign()
159 Ok(Box::new(BoringEcDigestSignOperation::new(key, curve, digest)?)) in begin_sign()
161 Ok(Box::new(BoringEcUndigestSignOperation::new(key, curve)?)) in begin_sign()
164 Key::Ed25519(key) => Ok(Box::new(BoringEd25519SignOperation::new(key)?)), in begin_sign()
172 key: Key, field
190 match &self.key { in finish()
191 Key::P224(key) | Key::P256(key) | Key::P384(key) | Key::P521(key) => { in finish()
192 let group = nist_key_to_group(&self.key)?; in finish()
193 let ec_key = ossl!(private_key_from_der_for_group(&key.0, group.as_ref()))?; in finish()
202 Key::X25519(key) => { in finish()
229 ffi::X25519(sig.as_mut_ptr(), &key.0 as *const u8, peer_key_data.as_ptr()) in finish()
268 fn new(key: ec::NistKey, curve: ec::NistCurve, digest: MessageDigest) -> Result<Self, Error> { in new()
270 let ec_key = ossl!(private_key_from_der_for_group(&key.0, group.as_ref()))?; in new()
338 fn new(key: ec::NistKey, curve: ec::NistCurve) -> Result<Self, Error> { in new()
340 let ec_key = ossl!(private_key_from_der_for_group(&key.0, group.as_ref()))?; in new()
374 fn new(key: ec::Ed25519Key) -> Result<Self, Error> { in new()
376 &key.0, in new()
415 fn nist_key_to_group(key: &ec::Key) -> Result<openssl::ec::EcGroup, Error> { in nist_key_to_group()
417 openssl::ec::EcGroup::from_curve_name(match key { in nist_key_to_group()