fn sign_remote_challenge(&self) -> [u8; SIGNATURE_LEN] {
        let pubkey = &self.local_key.public;
        let nonce = &self.local_key.nonce;
        let challenge = &self.remote_auth.challenge.unwrap_or([0u8; CHALLENGE_LEN]);
        if pubkey.len() != KEY_LEN || nonce.len() != NONCE_LEN || challenge.len() != CHALLENGE_LEN {
            return [0u8; SIGNATURE_LEN];
        }
        match &self.local_auth.secret_key {
            Some(s) => {
                let mut sign_data = [0u8; KEY_LEN + NONCE_LEN + CHALLENGE_LEN];
                sign_data[0..KEY_LEN].copy_from_slice(pubkey);
                sign_data[KEY_LEN..KEY_LEN+NONCE_LEN].copy_from_slice(nonce);
                sign_data[KEY_LEN+NONCE_LEN..].copy_from_slice(challenge);
                let server_public = self.local_auth.public_key.unwrap_or_default();
                let exp_key = ExpandedSecretKey::from(s);
                exp_key.sign(&sign_data, &server_public).to_bytes()
            },
            None => [0; SIGNATURE_LEN],
        }
    }
/// Sign remote challenge with local public key and nonce
Sign remote challenge with local public key and nonce
Sign remote challenge with local public key and nonce
fn sign_remote_challenge(&self) -> [u8; SIGNATURE_LEN] {
        let pubkey = &self.local_key.public;
        let nonce = &self.local_key.nonce;
        let challenge = &self.remote_auth.challenge.unwrap_or([0u8; CHALLENGE_LEN]);
        if pubkey.len() != KEY_LEN || nonce.len() != NONCE_LEN || challenge.len() != CHALLENGE_LEN {
            return [0u8; SIGNATURE_LEN];
        }
        match &self.local_auth.secret_key {
            Some(s) => {
                let mut sign_data = [0u8; KEY_LEN + NONCE_LEN + CHALLENGE_LEN];
                sign_data[0..KEY_LEN].copy_from_slice(pubkey);
                sign_data[KEY_LEN..KEY_LEN+NONCE_LEN].copy_from_slice(nonce);
                sign_data[KEY_LEN+NONCE_LEN..].copy_from_slice(challenge);
                let server_public = self.local_auth.public_key.unwrap_or_default();
                let exp_key = ExpandedSecretKey::from(s);
                exp_key.sign(&sign_data, &server_public).to_bytes()
            },
            None => [0; SIGNATURE_LEN],
        }
    }
fn sign_remote_challenge ( & self ) -> [ u8 ; SIGNATURE_LEN ] { let pubkey = & self . local_key . public ; let nonce = & self . local_key . nonce ; let challenge = & self . remote_auth . challenge . unwrap_or ( [ 0u8 ; CHALLENGE_LEN ] ) ; if pubkey . len ( ) != KEY_LEN || nonce . len ( ) != NONCE_LEN || challenge . len ( ) != CHALLENGE_LEN { return [ 0u8 ; SIGNATURE_LEN ] ; } match & self . local_auth . secret_key { Some ( s ) => { let mut sign_data = [ 0u8 ; KEY_LEN + NONCE_LEN + CHALLENGE_LEN ] ; sign_data [ 0 .. KEY_LEN ] . copy_from_slice ( pubkey ) ; sign_data [ KEY_LEN .. KEY_LEN + NONCE_LEN ] . copy_from_slice ( nonce ) ; sign_data [ KEY_LEN + NONCE_LEN .. ] . copy_from_slice ( challenge ) ; let server_public = self . local_auth . public_key . unwrap_or_default ( ) ; let exp_key = ExpandedSecretKey :: from ( s ) ; exp_key . sign ( & sign_data , & server_public ) . to_bytes ( ) } , None => [ 0 ; SIGNATURE_LEN ] , } }
Sign remote challenge with local public key and nonce
Sign remote challenge with local public key and nonce
&self
&self