• ANNOUNCE: nacl 1.3 released

    From =?UTF-8?Q?Alexander_Sch=C3=B6pe?=@ete-sep@mxbo.de to comp.lang.tcl on Fri Jul 31 15:45:29 2026
    From Newsgroup: comp.lang.tcl

    ANNOUNCE: nacl 1.3 released
    ===========================

    nacl is a Tcl extension binding the NaCl / TweetNaCl crypto library: authenticated public-key encryption (box) and secret-key encryption (secretbox), Ed25519 signatures, HMAC and Poly1305 authentication,
    Curve25519 scalar multiplication, SHA-256/SHA-512 hashing and CSPRNG
    byte generation. Developed by Alexander Schoepe on top of TweetNaCl by
    Daniel J. Bernstein, Bernard van Gastel, Wesley Janssen, Tanja Lange,
    Peter Schwabe and Sjaak Smetsers, it requires Tcl 8.6 or newer and
    nothing else.

    1.3 lifts the fixed key length of nacl::auth: HMAC keys of any length
    are now prepared the way RFC 2104 prescribes, which is what makes the
    command usable for JWT HS256 and for webhook signatures, where the
    secret is chosen by the other side. Two labels of the info output are corrected and nacl::build-info is completed on Tcl 8.6.

    Download / Repository: https://fossil.sowaswie.de/nacl


    English
    -------

    Changes since 1.2:

    * nacl::auth takes a key of any length. It is prepared as RFC 2104
    section 2 requires: longer than the block size of the hash the key is
    replaced by its hash, shorter it is padded with zero bytes; the block
    size is 64 bytes for -hmac256 and 128 bytes for -hmac512256. Previously anything but exactly 32 bytes was rejected, which ruled out JWT HS256
    and comparable protocols, and made a rotated client secret break the
    check. A key of exactly 32 bytes produces the same tag as before, so
    nothing that used to work changes.
    * nacl::auth info now reports "key" where it said "nonce", and
    nacl::stream info reports "key" instead of "public-key". HMAC
    authentication has no nonce and a stream cipher no public key; both
    labels were wrong and disagreed with the documentation. Scripts that
    parse these strings need adjusting.
    * nacl::build-info is registered on interpreters that bring no
    tcl::build-info of their own, Tcl 8.6 among them, where the command was missing altogether. Its commit field no longer carries literal quotation marks.
    * Internally all command handlers take void* rather than ClientData.

    Tests:

    * The suite covers the RFC 4231 test vectors, test cases 1 to 7, for
    both algorithms, together with a key of exactly block size, an empty
    key, and verification against a wrong key. It grew from 54 to 79 tests.
    * Verified on Tcl 8.6.18, 9.0.4 and 9.1b0.

    Documentation:

    * A skill for using the package from Tcl ships in claude/nacl-tcl, with
    two ready made reference modules: keeping secrets at rest with
    secretbox, and verifying a JWT signed with HS256.


    Deutsch
    -------

    |anderungen seit 1.2:

    * nacl::auth nimmt einen Schl|+ssel beliebiger L|nnge entgegen. Er wird aufbereitet, wie es RFC 2104 Abschnitt 2 verlangt: Ist er l|nnger als die Blockl|nnge der Hashfunktion, wird er durch seinen Hash ersetzt, ist er k|+rzer, mit Nullbytes aufgef|+llt; die Blockl|nnge betr|ngt 64 Byte bei -hmac256 und 128 Byte bei -hmac512256. Zuvor wurde alles au|fer genau 32
    Byte abgewiesen, was JWT HS256 und vergleichbare Verfahren ausschloss
    und dazu f|+hrte, dass ein rotiertes Client-Secret die Pr|+fung brach. Ein Schl|+ssel von genau 32 Byte liefert denselben Tag wie bisher, es |nndert
    sich also nichts, was vorher funktionierte.
    * nacl::auth info meldet jetzt "key" statt "nonce", nacl::stream info
    meldet "key" statt "public-key". Bei der HMAC-Authentifizierung gibt es
    keine Nonce und bei einer Stromchiffre keinen ||ffentlichen Schl|+ssel;
    beide Bezeichnungen waren falsch und widersprachen der Dokumentation.
    Skripte, die diese Ausgaben auswerten, m|+ssen angepasst werden.
    * nacl::build-info wird auch auf Interpretern eingerichtet, die kein
    eigenes tcl::build-info mitbringen, darunter Tcl 8.6, wo das Kommando
    bislang ganz fehlte. Das commit-Feld enth|nlt keine Anf|+hrungszeichen mehr.
    * Intern nehmen alle Kommando-Handler void* statt ClientData.

    Tests:

    * Die Suite deckt die Testvektoren aus RFC 4231, Testf|nlle 1 bis 7, f|+r beide Verfahren ab, dazu einen Schl|+ssel von genau Blockl|nnge, einen
    leeren Schl|+ssel und die Pr|+fung gegen einen falschen Schl|+ssel. Sie ist von 54 auf 79 Tests gewachsen.
    * Gepr|+ft mit Tcl 8.6.18, 9.0.4 und 9.1b0.

    Dokumentation:

    * Ein Skill zur Nutzung des Pakets aus Tcl liegt unter claude/nacl-tcl
    bei, mit zwei fertigen Referenzmodulen: Geheimnisse mit secretbox verschl|+sselt ablegen und ein mit HS256 signiertes JWT pr|+fen.
    --- Synchronet 3.22a-Linux NewsLink 1.2