• src/ssh/mac/hmac-sha2-256.c none.c src/ssh/ssh-trans.c ssh-trans.h

    From Deucе@VERT to Git commit to main/sbbs/master on Sun Mar 22 10:57:01 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/658a66720c5b854170d56b4b
    Modified Files:
    src/ssh/mac/hmac-sha2-256.c none.c src/ssh/ssh-trans.c ssh-trans.h
    Log Message:
    DeuceSSH: persistent MAC context, eliminate per-packet EVP_MAC re-creation

    Add mac_init callback to the MAC interface (parallel to enc_init).
    HMAC-SHA-256 now creates EVP_MAC + EVP_MAC_CTX once during key
    derivation and reuses it across all packets via EVP_MAC_init(ctx,
    NULL, 0, NULL) to reset HMAC state without re-fetching the algorithm.

    Previously, every packet did EVP_MAC_fetch + EVP_MAC_CTX_new +
    EVP_MAC_init + update + final + EVP_MAC_CTX_free + EVP_MAC_free.

    Tested: DeuceSSH<->DeuceSSH, Synchronet/cryptlib (DH-GEX + RSA).

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net