Skip to main content

encode_challenge_response

Function encode_challenge_response 

Source
pub fn encode_challenge_response(
    response: &ChallengeResponse,
    buf: &mut [u8],
) -> Result<usize, ProtocolError>
Expand description

Encode a client’s auth challenge-response into buf, as the frame payload without the 4-byte length prefix: [tag:u8][signature:64][pubkey:32].

The inverse of decode_challenge_response, kept beside it so the layout has one home. Returns Err(Truncated) if buf is shorter than CHALLENGE_RESPONSE_LEN.