Only impl. fmt for messages in test
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
#[cfg(test)]
|
||||
use hex;
|
||||
|
||||
#[cfg(test)]
|
||||
use std::fmt;
|
||||
|
||||
use byteorder::LittleEndian;
|
||||
@@ -30,7 +33,8 @@ impl Default for Initiation {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
f_type: <U32<LittleEndian>>::new(TYPE_INITIATION as u32),
|
||||
f_sender: <U32<LittleEndian>>::new(0),
|
||||
|
||||
f_sender: <U32<LittleEndian>>::ZERO,
|
||||
f_ephemeral: [0u8; SIZE_X25519_POINT],
|
||||
f_static: [0u8; SIZE_X25519_POINT],
|
||||
f_static_tag: [0u8; SIZE_TAG],
|
||||
@@ -53,6 +57,7 @@ impl Initiation {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl fmt::Debug for Initiation {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f,
|
||||
@@ -119,6 +124,7 @@ impl Default for Response {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl fmt::Debug for Response {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f,
|
||||
|
||||
@@ -376,8 +376,10 @@ pub fn create_response<T: Copy>(
|
||||
))
|
||||
}
|
||||
|
||||
pub fn consume_response<T: Copy>(device: &Device<T>, msg: &[u8]) -> Result<Output<T>, HandshakeError> {
|
||||
|
||||
pub fn consume_response<T: Copy>(
|
||||
device: &Device<T>,
|
||||
msg: &[u8],
|
||||
) -> Result<Output<T>, HandshakeError> {
|
||||
// parse message
|
||||
|
||||
let msg = Response::parse(msg)?;
|
||||
|
||||
Reference in New Issue
Block a user