Documentation

Cryptlib.Primitives.Cipher.ChaChaPoly

ChaCha20-Poly1305 (RFC 8439) #

The IETF ChaCha20 block (32-bit counter, 96-bit nonce) is the original block with the first nonce word in the counter's high half, so ChaCha20.block serves both.

RFC 8439 §2.3: one 64-byte block at a 32-bit counter.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    RFC 8439 §2.4: encryption starts at counter 1, block 0 being reserved for the Poly1305 key.

    Equations
    Instances For

      RFC 8439 §2.5. Field arithmetic over Nat modulo 2^130 - 5.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        RFC 8439 §2.8: Poly1305 keyed from block 0, over pad(ad) ‖ pad(ct) ‖ LE64 |ad| ‖ LE64 |ct|.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Structural equality on the tag; a deployed implementation must compare in constant time.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Cryptlib.Primitives.Cipher.ChaChaPoly.decrypt_sound (key : Key) (n : Nonce) (ad ct pt : ByteArray) (h : decrypt key n ad ct = some pt) :
              encrypt key n ad pt = ct
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For