pub fn encode_message_1<B: AsRef<[u8]>>(&mut self, payload: B) -> OckamResult<Vec<u8>> {
        let ephemeral_public_key = self
            .0
            .ephemeral_key_pair
            .as_ref()
            .ok_or_else(|| Error::InvalidState.into())?
            .public_key
            .clone();

        let payload = payload.as_ref();
        self.0.mix_hash(ephemeral_public_key.as_ref())?;
        self.0.mix_hash(payload)?;

        let mut output = ephemeral_public_key.as_ref().to_vec();
        output.extend_from_slice(payload);
        Ok(output)
    }
/// Encode the first message to be sent
Encode the first message to be sent
Encode the first message to be sent
pub fn encode_message_1<B: AsRef<[u8]>>(&mut self, payload: B) -> OckamResult<Vec<u8>> {
        let ephemeral_public_key = self
            .0
            .ephemeral_key_pair
            .as_ref()
            .ok_or_else(|| Error::InvalidState.into())?
            .public_key
            .clone();
        let payload = payload.as_ref();
        self.0.mix_hash(ephemeral_public_key.as_ref())?;
        self.0.mix_hash(payload)?;
        let mut output = ephemeral_public_key.as_ref().to_vec();
        output.extend_from_slice(payload);
        Ok(output)
    }
pub fn encode_message_1 < B : AsRef < [ u8 ] > > ( & mut self , payload : B ) -> OckamResult < Vec < u8 > > { let ephemeral_public_key = self . 0 . ephemeral_key_pair . as_ref ( ) . ok_or_else ( | | Error :: InvalidState . into ( ) ) ? . public_key . clone ( ) ; let payload = payload . as_ref ( ) ; self . 0 . mix_hash ( ephemeral_public_key . as_ref ( ) ) ? ; self . 0 . mix_hash ( payload ) ? ; let mut output = ephemeral_public_key . as_ref ( ) . to_vec ( ) ; output . extend_from_slice ( payload ) ; Ok ( output ) }
Encode the first message to be sent
Encode the first message to be sent
&mut self
payload
B
&mut self
payload
B