Skip to content

Commit 9a2f757

Browse files
committed
pkey_ctx: add ec key generation test
1 parent fc0b95f commit 9a2f757

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

openssl/src/pkey_ctx.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,19 @@ mod test {
988988
key_ctx.keygen().unwrap();
989989
}
990990

991+
#[test]
992+
fn ec_keygen() {
993+
let mut ctx = PkeyCtx::new_id(Id::EC).unwrap();
994+
ctx.paramgen_init().unwrap();
995+
ctx.set_ec_paramgen_curve_nid(Nid::X9_62_PRIME256V1)
996+
.unwrap();
997+
let params = ctx.paramgen().unwrap();
998+
999+
let mut key_ctx = PkeyCtx::new(&params).unwrap();
1000+
key_ctx.keygen_init().unwrap();
1001+
key_ctx.keygen().unwrap();
1002+
}
1003+
9911004
#[test]
9921005
#[cfg(any(ossl110, boringssl, libressl360, awslc))]
9931006
fn hkdf() {

0 commit comments

Comments
 (0)