tcp: drop box_pk_of until something calls it

It has no caller here or in the servers; the responder that would keep
only the secret half does not exist yet, so it belongs to that change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab
This commit is contained in:
rustdesk
2026-09-21 18:33:33 +08:00
co-authored by Claude Opus 5
parent 955621899e
commit 445486ccaa
+1 -12
View File
@@ -4,7 +4,7 @@ use bytes::{BufMut, Bytes, BytesMut};
use futures::{SinkExt, StreamExt};
use protobuf::Message;
use sodiumoxide::crypto::{
box_, generichash, scalarmult,
box_, generichash,
secretbox::{self, Key, Nonce},
};
use std::{
@@ -56,11 +56,6 @@ pub struct KxTranscript<'a> {
pub picked: u32,
}
/// The public half of an X25519 secret key, for a responder that kept only the secret half.
pub fn box_pk_of(sk: &box_::SecretKey) -> box_::PublicKey {
box_::PublicKey(scalarmult::scalarmult_base(&scalarmult::Scalar(sk.0)).0)
}
/// The sending key, the send and receive counters, the receiving key where it differs, and
/// the server's advertised version as this side saw it, while its echo is still awaited.
#[derive(Clone)]
@@ -618,10 +613,4 @@ mod tests {
let mut later = BytesMut::from(&server.enc(&rendezvous_frame(KX_VERSION_LATEST + 9))[..]);
client.dec(&mut later).unwrap();
}
#[test]
fn test_box_pk_of_matches_the_generated_pair() {
let (pk, sk) = box_::gen_keypair();
assert_eq!(box_pk_of(&sk), pk);
}
}