Implement Phase 1: AES-256-GCM algorithm negotiation and cipher mode setting
Performance optimization Phase 1 implementation: - Add aes-gcm crate dependency (v0.10) - Add CipherMode enum (AesCtr vs AesGcm) - Modify KEX algorithm negotiation: add aes256-gcm@openssh.com - Dynamic cipher mode setting based on KEX result - Fix HMAC trait conflict with fully-qualified syntax Strategy: Conservative approach - Support AES-GCM algorithm negotiation (OpenSSH compatible) - Dynamic cipher mode setting - AES-CTR fallback preserved (packet processing unchanged) Next steps: - Test OpenSSH client AES-GCM negotiation - Implement AES-GCM packet processing if needed - Continue to Phase 4 (parallel encryption)
This commit is contained in:
@@ -50,9 +50,9 @@ impl KexProposal {
|
||||
// 主机密钥算法:优先Ed25519
|
||||
server_host_key_algorithms: "ssh-ed25519,rsa-sha2-256,rsa-sha2-512".to_string(),
|
||||
|
||||
// 加密算法:AES-256-CTR(推荐)
|
||||
encryption_algorithms_ctos: "aes256-ctr,aes128-ctr".to_string(),
|
||||
encryption_algorithms_stoc: "aes256-ctr,aes128-ctr".to_string(),
|
||||
// 加密算法:优先 AES-256-GCM(AEAD,性能优化),fallback 到 AES-CTR
|
||||
encryption_algorithms_ctos: "aes256-gcm@openssh.com,aes256-ctr,aes128-ctr".to_string(),
|
||||
encryption_algorithms_stoc: "aes256-gcm@openssh.com,aes256-ctr,aes128-ctr".to_string(),
|
||||
|
||||
// MAC算法:HMAC-SHA256
|
||||
mac_algorithms_ctos: "hmac-sha2-256,hmac-sha2-512".to_string(),
|
||||
@@ -76,8 +76,8 @@ impl KexProposal {
|
||||
Self {
|
||||
kex_algorithms: "curve25519-sha256,diffie-hellman-group14-sha256".to_string(),
|
||||
server_host_key_algorithms: "ssh-ed25519,rsa-sha2-256".to_string(),
|
||||
encryption_algorithms_ctos: "aes256-ctr,aes128-ctr".to_string(),
|
||||
encryption_algorithms_stoc: "aes256-ctr,aes128-ctr".to_string(),
|
||||
encryption_algorithms_ctos: "aes256-gcm@openssh.com,aes256-ctr,aes128-ctr".to_string(),
|
||||
encryption_algorithms_stoc: "aes256-gcm@openssh.com,aes256-ctr,aes128-ctr".to_string(),
|
||||
mac_algorithms_ctos: "hmac-sha2-256".to_string(),
|
||||
mac_algorithms_stoc: "hmac-sha2-256".to_string(),
|
||||
compression_algorithms_ctos: "none".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user