rust-libp2p/identity/tests/keypair_api.rs
Thomas Eizinger 77149f08c4
fix(identity): correctly follow extract-expand for HKDF
As @mxinden pointed out in https://github.com/libp2p/rust-libp2p/pull/4554#discussion_r1344747938, we were not correctly following the HKDF steps of extract and expand.

Pull-Request: #4589.
2023-10-09 01:31:10 +00:00

15 lines
322 B
Rust

use libp2p_identity::Keypair;
#[test]
fn calling_keypair_api() {
let _ = Keypair::from_protobuf_encoding(&[]);
}
#[allow(dead_code)]
fn using_keypair(kp: Keypair) {
let _ = kp.to_protobuf_encoding();
let _ = kp.sign(&[]);
let _ = kp.public();
let _: Option<[u8; 32]> = kp.derive_secret(b"foobar");
}