<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.nl" -->
<rfc version="3" docName="draft-irtf-cfrg-aes-fsm-00" ipr="trust200902" submissionType="IRTF" category="info" xml:lang="en" consensus="true" xmlns:xi="http://www.w3.org/2001/XInclude">

<front>
<title abbrev="AES-FSM">AES Fourier Spectral Mode</title><seriesInfo value="draft-irtf-cfrg-aes-fsm-00" status="informational" name="Internet-Draft"></seriesInfo>
<author initials="B." surname="Tone" fullname="Barry Tone"><organization>Spectral Energy Conservatory</organization><address><postal><street></street>
<city>Murray Hill</city>
<code>07974</code>
<country>US</country>
<region>NJ</region>
</postal><email>b.tone@parseval.example</email>
</address></author>
<date year="2026" month="April" day="1"></date>
<area>Internet</area>
<workgroup>Crypto Forum Research Group</workgroup>
<keyword>aead</keyword>

<abstract>
<t>This document defines AES Fourier Spectral Mode (AES-FSM), an authenticated
encryption with associated data (AEAD) scheme that transforms counter blocks
through the FFT prior to encryption. AES-FSM is more spectrally pure than
AES-GCM and achieves spectral compliance, which is better than FIPS
compliance.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>This document specifies AES Fourier Spectral Mode (AES-FSM), an authenticated
encryption with associated data (AEAD) construction that performs encryption in
the frequency domain. Unlike traditional counter modes, which increment a
counter arithmetically, AES-FSM transforms counter blocks using an FFT prior
to encryption. Authentication is provided by FHASH, a spectrally-derived
message authentication code.</t>
<t>AES-FSM accepts a 32-byte root key and a 32-byte nonce. It is intended as a
thought experiment, pedagogical device, and contribution to the April
tradition of taking silly ideas slightly too far. It was produced with
buggy code and no consensus process.</t>
<t>Distribution of this memo is unlimited.</t>
<t>Except in the time domain, where it is carefully windowed.</t>
<t>Spectral compliance is mandatory.</t>
</section>

<section anchor="conventions-and-definitions"><name>Conventions and Definitions</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;,
&quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be
interpreted as described in <xref target="RFC2119"></xref>. All sizes are in bytes -- or octets, if
you prefer, though the authors find that &quot;32-octet nonce&quot; does not spark joy.</t>

<dl>
<dt>FFT</dt>
<dd><t>The Fast Fourier Transform over GF(2^8), which evaluates a polynomial at
points forming a GF(2)-linear subspace. Also called the cyclotomic FFT in
some references; this document uses &quot;additive FFT&quot; throughout, following
<xref target="CANTOR89"></xref> and <xref target="ADDITIVEFFT"></xref>. See Section 4.</t>
</dd>
<dt>IFFT</dt>
<dd><t>Inverse additive FFT. The transform that returns coefficients to the time
domain, regardless of their opinions on causality.</t>
</dd>
<dt>Nonce</dt>
<dd><t>A number used once — a term the authors find insufficiently spectral
but serviceable.</t>
</dd>
<dt>AES-256</dt>
<dd><t>The Advanced Encryption Standard <xref target="FIPS197"></xref> with a 32-byte key and,
regrettably, a 16-byte block. The key resists multi-target attacks.
The block size does not resist disappointment.</t>
</dd>
<dt>SHAKE-256</dt>
<dd><t>An extendable-output function from the SHA-3 family <xref target="FIPS202"></xref>. Used here
because it can produce arbitrary-length output, which is convenient.</t>
</dd>
<dt>FSM Block</dt>
<dd><t>The atomic spectral operation of AES-FSM: additive FFT of a 16-byte
counter block, followed by a single AES-256 encryption of the
spectrum, followed by inverse FFT and XOR with the data block.</t>
</dd>
<dt>Vibe</dt>
<dd><t>A qualitative security parameter that cannot be measured, formally
verified, or transmitted over a network, but whose absence is immediately
apparent <xref target="VIBES"></xref>.</t>
</dd>
<dt>Spectral Leakage</dt>
<dd><t>Any unintended disclosure of plaintext information across frequency bins.
Not to be confused with the signal processing term, though the authors
would not rule it out.</t>
</dd>
<dt>FHASH</dt>
<dd><t>Fourier Hash, pronounced &quot;eff-hash&quot;. MUST NOT be abbreviated further.
FHASH is a message authentication code operating under a spectrally-derived
subkey. Readers familiar with GHASH will note that FHASH is not GHASH. It is,
however, named similarly, which the authors consider sufficient for peer
review <xref target="IGNORANCE"></xref>.</t>
</dd>
<dt>TopVibes</dt>
<dd><t>The first 32 bytes of the bit-reversal-permuted vibes, used as the
per-message encryption key.</t>
</dd>
<dt>BottomVibes</dt>
<dd><t>Bytes 32 through 43 of the bit-reversal-permuted vibes, used as the
harmonic counter seed.</t>
</dd>
</dl>
</section>

<section anchor="overview-of-aes-fsm"><name>Overview of AES-FSM</name>
<t>AES-FSM operates in four phases:</t>

<ol>
<li><t>Compute the FHASH authentication tag over the plaintext (SIV).</t>
</li>
<li><t>Extract vibes from the root key and tag using SHAKE-256, then split
spectrally via bit-reversal permutation into TopVibes (per-message key)
and BottomVibes (counter seed).</t>
</li>
<li><t>Encrypt each plaintext block under TopVibes using BottomVibes-seeded
harmonic counters.</t>
</li>
<li><t>Output the ciphertext concatenated with the tag.</t>
</li>
</ol>
<t>At no point is the counter incremented in the usual sense.</t>
<t>Incrementing is temporal. Transforming is spectral.</t>
<figure anchor="fig-aes-fsm-overview" alt="Flow diagram showing AES-FSM encryption with split inputs: Key (K) feeds subkey derivation and vibes extraction, Context (N, A, P) feeds FHASH, H from subkey derivation feeds FHASH, FHASH outputs tag T, then vibes extraction and per-block spectral counter mode produce ciphertext blocks; output is ciphertext concatenated with T."><name>AES-FSM encryption overview.
</name>
<artwork alt="Flow diagram showing AES-FSM encryption with split inputs: Key (K) feeds subkey derivation and vibes extraction, Context (N, A, P) feeds FHASH, H from subkey derivation feeds FHASH, FHASH outputs tag T, then vibes extraction and per-block spectral counter mode produce ciphertext blocks; output is ciphertext concatenated with T.">   +----------+                 +---------+
   | Root Key |                 | Context |
   | K        |                 | N, A, P |
   +----------+                 +---------+
         |                           |
         v                           v
+------------------+        +------------------+
| Subkey           |-------&gt;| FHASH (SIV)      |
| H = FSM_block(K, |   H    | T=FHASH(H,N,A,P) |
| [1..16], 0^128)  |        +--------+---------+
+------------------+                 |
                                     |
                         +-----------+
                         v
            +-----------------------+
            | Vibes Extraction      |
            | V = SHAKE-256(K || T) |
            | W = bitrev(V)         |
            | TopVibes, BottomVibes |
            +-----------------------+
                         |
                         v
          +---------------------------+
          | Per-Block Encryption      |
          | cb_i = BV || LE32(i)      |
          | ks_i = AES(TV, FFT(cb_i)) |
          | C_i  = P_i XOR ks_i       |
          +---------------------------+
                        |
                        v
                   +--------+
                   | Output |
                   | C || T |
                   +--------+
</artwork>
</figure>

<section anchor="parameters"><name>Parameters</name>

<ul>
<li><t>Root key K: 32 bytes.</t>
</li>
<li><t>Nonce N: 32 bytes.</t>
</li>
<li><t>Authentication tag T: 32 bytes.</t>
</li>
</ul>
<t>Nonces MUST NOT be reused. Unlike AES-GCM, AES-FSM does not fail
catastrophically when they are, and unlike AES-GCM's 12-byte nonce, a
32-byte nonce can safely be generated randomly without losing sleep over
birthday bounds. It is also more spectral. More bytes,
more vibes.</t>
</section>
</section>

<section anchor="the-fsm-block-subkey-derivation"><name>The FSM Block (Subkey Derivation)</name>
<t>Invertibility is a requirement. Everything else is implementation detail.</t>
<t>The FSM block is the atomic spectral operation of AES-FSM, used exclusively for
FHASH subkey derivation. It accepts a 32-byte key, a 16-byte counter block,
and a data block of up to 16 bytes.</t>

<artwork>FSM_block(K, counter_block, data):
  1. spectrum = AdditiveFFT(counter_block)  (16 bytes)
  2. encrypted = AES-256(K, spectrum)       (16 bytes)
  3. time_domain = AdditiveIFFT(encrypted)  (16 bytes)
  4. Return data XOR time_domain
</artwork>
<t>The additive FFT <xref target="CANTOR89"></xref><xref target="ADDITIVEFFT"></xref> and its inverse operate over
GF(2^8) with no floating-point arithmetic. The transform is a bijection on
16-byte strings. This fact will be used repeatedly.</t>
<t>Correctness is optional. Invertibility is forever.</t>
</section>

<section anchor="spectral-counter-mode"><name>Spectral Counter Mode</name>
<t>Uniqueness is the only counter property that matters.</t>
<t>Per-block encryption uses a single AES call, with the counter input derived
in the frequency domain:</t>

<artwork>Spectral_CTR(K, BottomVibes, i, data):
  1. cb = BottomVibes || i (as 4-byte little-endian)
  2. spectrum = AdditiveFFT(cb)   (16 bytes)
  3. keystream = AES-256(K, spectrum)
  4. Return data XOR keystream
</artwork>
<t>The counter is sequential in the time domain but non-sequential after the
Fourier transform, which the authors consider sufficient. Distinct counter
blocks produce distinct AES inputs. This is the entire security argument.</t>
<t>The rest is aesthetics. Aesthetics are non-negotiable.</t>
</section>

<section anchor="fhash"><name>FHASH</name>
<t>Authentication is not an add-on. It is a harmonic.</t>
<t>FHASH is a message authentication code that derives its subkey from the
frequency domain and authenticates using SHAKE-256 <xref target="FIPS202"></xref>.</t>

<section anchor="subkey-derivation"><name>Subkey Derivation</name>
<t>The FHASH subkey H is the 16-byte FSM keystream evaluated at the first 16
harmonic frequencies under the root key:</t>

<artwork>H = FSM_block(K, [1, 2, 3, …, 16], 0^128)
</artwork>
<t>where K is the 32-byte root key and 0^128 is the 16-byte zero string.</t>
<t>This counter was chosen because a ramp from 1 to 16 has maximal spectral
diversity for its length. The authors verified this by squinting at a
spectrogram and nodding.</t>
<t>Implementations MAY cache the subkey H across messages under the same root
key, but MUST NOT enjoy doing so. Joy is out of scope.</t>
</section>

<section anchor="tag-computation"><name>Tag Computation</name>
<t>The FHASH tag is computed over the <strong>plaintext</strong> (not the ciphertext),
prior to encryption (SIV):</t>

<artwork>T = FHASH(H, N, A, P)
  = SHAKE-256(H || N || len(A) || A || len(P) || P, 256)
</artwork>
<t>where len(.) is encoded as an 8-byte little-endian integer and SHAKE-256
produces 32 bytes of output, because 32 is the only acceptable number of
bytes in this construction.</t>
<t>Symmetry is security.</t>
</section>
</section>

<section anchor="vibes-extraction"><name>Vibes Extraction</name>
<t>Vibes are derived, not negotiated.</t>
<t>Once the 32-byte tag T has been computed, AES-FSM derives per-message keying
material by expanding the root key and tag through SHAKE-256, then applying a
spectral permutation. The term &quot;vibes extraction&quot; is used with a straight
face. The face is non-malleable.</t>

<section anchor="vibes-derivation"><name>Vibes Derivation</name>
<t>The raw vibes are 64 bytes produced by SHAKE-256:</t>

<artwork>V = SHAKE-256(K || T, 512)
</artwork>
<t>where K is the 32-byte root key and T is the 32-byte tag.</t>
</section>

<section anchor="spectral-split"><name>Spectral Split</name>
<t>The 64 raw vibes bytes are permuted using bit-reversal order (6-bit indices,
N=64). Each byte position i (0 through 63) is mapped to the position obtained
by reversing the 6-bit binary representation of i:</t>

<artwork>W[i] = V[bitrev(i, 6)]    for i = 0 to 63
</artwork>
<t>where bitrev(i, n) reverses the n low bits of i. For example, position 1
(binary 000001) maps to position 32 (binary 100000), and position 3 (binary
000011) maps to position 48 (binary 110000).</t>
<t>The permuted bytes are then split:</t>

<artwork>TopVibes    = W[0:32]     (32 bytes, per-message key)
BottomVibes = W[32:44]    (12 bytes, counter seed)
</artwork>
<t>TopVibes is used directly as the 32-byte per-message encryption key.
BottomVibes seeds the harmonic counter. The remaining 20 bytes (positions 44
through 63) are discarded so that bit-reversal operates on a power-of-two
length.</t>
</section>
</section>

<section anchor="encryption"><name>Encryption</name>
<t>Encryption is the easy part. The spectrum does the rest.</t>
<t>Encryption accepts a 32-byte root key K, a 32-byte nonce N, plaintext P, and
optional associated data A, and produces ciphertext C with an appended 32-byte
tag T (32 bytes of ciphertext expansion; vibes expansion is unquantified here).</t>

<artwork>FSM.Encrypt(K, N, A, P):
  1. H = FSM_block(K, [1..16], 0^128)
  2. T = FHASH(H, N, A, P)          (SIV: tag over plaintext)
  3. (TopVibes, BottomVibes) = ExtractVibes(K, T)
  4. For each 16-byte block P_i (i = 0, 1, 2, …):
       C_i = Spectral_CTR(TopVibes, BottomVibes, i, P_i)
  5. C = C_0 || C_1 || …
  6. Return C || T
</artwork>
<t>Note that encryption uses TopVibes as the per-message key, not the root
key K. The FHASH subkey derivation (step 1) uses one FSM block (one AES
call), performed once per root key and cached. Per-block encryption (step 4)
requires one AES call per block.</t>
</section>

<section anchor="decryption"><name>Decryption</name>
<t>Decryption is verification with extra steps.</t>
<t>Decryption accepts a 32-byte root key K, a 32-byte nonce N,
ciphertext-with-tag (C || T), and optional associated data A.</t>
<t>Because AES-FSM is a SIV construction, decryption proceeds in
decrypt-then-verify order:</t>

<artwork>FSM.Decrypt(K, N, A, C || T):
  1. Split the input into ciphertext C (all but the last
     32 bytes) and tag T (the last 32 bytes).
  2. (TopVibes, BottomVibes) = ExtractVibes(K, T)
  3. For each 16-byte block C_i:
       P_i = Spectral_CTR(TopVibes, BottomVibes, i, C_i)
  4. P = P_0 || P_1 || …
  5. H = FSM_block(K, [1..16], 0^128)
  6. T' = FHASH(H, N, A, P)
  7. If T != T', reject.
  8. Return P.
</artwork>
<t>If decryption fails, the vibes did not match.</t>
<t>Tag comparison MUST be performed in constant time.
Vibes comparison need not be constant time, as vibes are constant in spirit.</t>
<t>If decryption fails, implementations MUST zeroize the recovered plaintext
before returning. Implementations MUST NOT return a reason for failure.
The vibes did not match.</t>
</section>

<section anchor="implementation-considerations"><name>Implementation Considerations</name>
<t>Implementations SHOULD remain in key.</t>
<t>AES-FSM requires support for GF(2^8) arithmetic (the AES field, irreducible
polynomial x^8 + x^4 + x^3 + x + 1) and the additive FFT over this field.
No floating-point arithmetic is required.</t>
<t>The FHASH subkey derivation invokes one FSM block (one AES-256 call),
performed once per root key and cached. Per-block encryption requires one
additive FFT and one AES call, approaching the per-block cost of AES-GCM.
The per-message overhead is one SHAKE-256 call for vibes extraction.</t>
<t>The FHASH subkey derivation is deterministic per root key and may be performed
once during initialization.</t>
<t>Hardware acceleration is OPTIONAL but aspirational. AES-NI is assumed
to exist. Vibes-NI is not, but the authors remain hopeful.</t>
<t>All cryptographic primitives used in AES-FSM (AES-256 per <xref target="FIPS197"></xref>,
SHAKE-256 per <xref target="FIPS202"></xref>) are FIPS-approved. They are, however, composed in
ways that FIPS would not approve. The authors do not require FIPS approval
and FIPS has not offered any.
AES-FSM has not been evaluated under Common Criteria.
It was not submitted to any NIST competition because the authors forgot the
deadline.</t>
<t>Constant-time behavior is achieved in expectation, averaged over the
spectrum. Constant-time is a vibe.</t>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>Security is an assumption. Compliance is a vibe.</t>
<t>The security of AES-FSM rests on two standard assumptions: AES is a good
pseudorandom permutation, and SHAKE-256 is a good PRF and collision-resistant
hash. A detailed analysis is provided in Appendix K.</t>
<t>Side-channel attacks may arise due to spectral leakage, table lookup timing in
GF(2^8), or excessive confidence in the results, which has historically been the
most dangerous side channel.</t>
<t>Users are advised not to deploy AES-FSM in production systems, toasters,
refrigerators, submarines, commercial aircraft, non-commercial aircraft, or any
system that matters. If you have already deployed AES-FSM in production,
do not tell the authors.
If you must tell someone, tell the spectrum.</t>
</section>

<section anchor="design-rationale"><name>Design Rationale</name>
<t>The rationale is spectral. The regret is temporal.</t>
<t>Since the dawn of cryptography, humans have sought to encrypt messages in the
frequency domain. AES-FSM is the first scheme to do so without involving any
actual frequencies. The authors have explanations (Appendix L).</t>
<t>Explanations are windowed.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document makes no requests of IANA, which is just as well, because
IANA has not made any requests of this document either.</t>
<t>However, future revisions MAY request a frequency band allocation in the
sub-audible range, pending vibes assessment. The authors would welcome a
hum on this proposal. One trusts the relevant authorities will take a broad
view.</t>
<t>Narrow views cause leakage.</t>
</section>

</middle>

<back>
<references><name>Informative References</name>
<reference anchor="CANTOR89" target="https://doi.org/10.1016/0097-3165(89)90020-4">
  <front>
    <title>On arithmetical algorithms over finite fields</title>
    <author fullname="David G. Cantor" initials="D. G." surname="Cantor"></author>
    <date year="1989"></date>
  </front>
</reference>
<reference anchor="FIPS202" target="https://doi.org/10.6028/NIST.FIPS.202">
  <front>
    <title>SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions</title>
    <author>
      <organization>National Institute of Standards and Technology</organization>
    </author>
    <date year="2015" month="August"></date>
  </front>
</reference>
<reference anchor="IGNORANCE" target="https://www.cs.ucdavis.edu/~rogaway/papers/ignorance.pdf">
  <front>
    <title>Formalizing Human Ignorance: Collision-Resistant Hashing without the Keys</title>
    <author fullname="Phillip Rogaway" initials="P." surname="Rogaway"></author>
    <date year="2006"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5297.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9225.xml"/>
<reference anchor="VIBES" target="">
  <front>
    <title>On the Qualitative Assessment of Security Parameters</title>
    <author fullname="Phil Harmonic" initials="P." surname="Harmonic"></author>
    <date></date>
  </front>
</reference>
<reference anchor="XAES256GCM" target="https://c2sp.org/XAES-256-GCM">
  <front>
    <title>XAES-256-GCM</title>
    <author fullname="Filippo Valsorda" initials="F." surname="Valsorda"></author>
    <date year="2024"></date>
  </front>
</reference>
<reference anchor="FOURIER" target="">
  <front>
    <title>An algorithm for the machine calculation of complex Fourier series</title>
    <author fullname="James W. Cooley" initials="J. W." surname="Cooley"></author>
    <author fullname="John W. Tukey" initials="J. W." surname="Tukey"></author>
    <date year="1965"></date>
  </front>
</reference>
<reference anchor="ADDITIVEFFT" target="https://doi.org/10.1109/TIT.2010.2079016">
  <front>
    <title>Additive Fast Fourier Transforms Over Finite Fields</title>
    <author fullname="Shuhong Gao" initials="S." surname="Gao"></author>
    <author fullname="Todd Mateer" initials="T." surname="Mateer"></author>
    <date year="2010"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7539.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8452.xml"/>
<reference anchor="XWING" target="https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem/">
  <front>
    <title>X-Wing: general-purpose hybrid post-quantum KEM</title>
    <author fullname="Deirdre Connolly" initials="D." surname="Connolly"></author>
    <author fullname="Peter Schwabe" initials="P." surname="Schwabe"></author>
    <author fullname="Bas Westerbaan" initials="B." surname="Westerbaan"></author>
    <date year="2024"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1149.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<reference anchor="FIPS197" target="https://doi.org/10.6028/NIST.FIPS.197">
  <front>
    <title>Advanced Encryption Standard (AES)</title>
    <author>
      <organization>National Institute of Standards and Technology</organization>
    </author>
    <date year="2001" month="November"></date>
  </front>
</reference>
<reference anchor="SCW" target="https://securitycryptographywhatever.com/">
  <front>
    <title>Security, Cryptography, Whatever</title>
    <author fullname="Deirdre Connolly" initials="D." surname="Connolly"></author>
    <author fullname="Thomas Ptacek" initials="T." surname="Ptacek"></author>
    <author fullname="David Adrian" initials="D." surname="Adrian"></author>
    <date></date>
  </front>
</reference>
<reference anchor="DNDKGCM" target="https://datatracker.ietf.org/doc/draft-gueron-cfrg-dndkgcm/">
  <front>
    <title>AES-GCM with Derived Nonce and Derived Key</title>
    <author fullname="Shay Gueron" initials="S." surname="Gueron"></author>
    <author fullname="Yehuda Lindell" initials="Y." surname="Lindell"></author>
    <date year="2024"></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1097.xml"/>
</references>

<section anchor="why-not-chacha"><name>Why Not ChaCha?</name>
<t>The authors considered ChaCha-based constructions. ChaCha was set aside after
the authors observed pqc-forum exchanges whose tone could not be described as
constructive in polite company. Even the Fourier transform has limits.</t>
<t>Limits are, regrettably, non-additive.</t>
</section>

<section anchor="is-this-sketchy"><name>Is This Sketchy?</name>
<t>The authors have done their level best to make this construction look sketchy,
in the hope that blogs will write about it and podcasts will discuss it. The
authors are fans of Security, Cryptography, Whatever <xref target="SCW"></xref>, and remain open
to invitations.</t>
<t>To be clear: the authors do not understand elliptic curves.</t>
<t>This is documented for transparency, not reassurance.</t>
</section>

<section anchor="comparison-with-selected-schemes"><name>Comparison with Selected Schemes</name>
<t>The following table compares AES-FSM with selected authenticated encryption
schemes, one key encapsulation mechanism, one network-layer protocol, one
telnet option, and one philosophical position.</t>
<table><name>All sizes in bytes. NMR = nonce-misuse resistant. Spectral = operates in the frequency domain.
</name>
<thead>
<tr>
<th align="left">Scheme</th>
<th align="right">Key</th>
<th align="right">Nonce</th>
<th align="right">Tag</th>
<th align="center">NMR</th>
<th align="center">Spectral</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">AES-GCM</td>
<td align="right">16/32</td>
<td align="right">12</td>
<td align="right">16</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">ChaCha20-Poly1305 <xref target="RFC7539"></xref></td>
<td align="right">32</td>
<td align="right">12</td>
<td align="right">16</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">AES-SIV <xref target="RFC5297"></xref></td>
<td align="right">32/64</td>
<td align="right">any</td>
<td align="right">16</td>
<td align="center">Yes</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">AES-GCM-SIV <xref target="RFC8452"></xref></td>
<td align="right">16/32</td>
<td align="right">12</td>
<td align="right">16</td>
<td align="center">Yes</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">XAES-256-GCM <xref target="XAES256GCM"></xref></td>
<td align="right">32</td>
<td align="right">24</td>
<td align="right">16</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">DNDK-GCM <xref target="DNDKGCM"></xref></td>
<td align="right">32</td>
<td align="right">24</td>
<td align="right">16</td>
<td align="center">No</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">X-Wing <xref target="XWING"></xref></td>
<td align="right">32</td>
<td align="right">—</td>
<td align="right">—</td>
<td align="center">—</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">IP over Avian Carriers <xref target="RFC1149"></xref></td>
<td align="right">—</td>
<td align="right">—</td>
<td align="right">—</td>
<td align="center">—</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">SUBLIMINAL-MESSAGE <xref target="RFC1097"></xref></td>
<td align="right">—</td>
<td align="right">—</td>
<td align="right">—</td>
<td align="center">—</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">Software Defects <xref target="RFC9225"></xref></td>
<td align="right">—</td>
<td align="right">—</td>
<td align="right">—</td>
<td align="center">—</td>
<td align="center">No</td>
</tr>

<tr>
<td align="left">AES-FSM</td>
<td align="right">32</td>
<td align="right">32</td>
<td align="right">32</td>
<td align="center">Yes</td>
<td align="center">Yes</td>
</tr>
</tbody>
</table><t>X-Wing <xref target="XWING"></xref> is a key encapsulation mechanism. IP over Avian Carriers
<xref target="RFC1149"></xref> is a network-layer protocol. The TELNET SUBLIMINAL-MESSAGE Option
<xref target="RFC1097"></xref> is a telnet extension. Software Defects Considered Harmful
<xref target="RFC9225"></xref> is a policy document that AES-FSM aspires to comply with but makes
no guarantees. None of these define authenticated encryption. They are included
because the bar for inclusion was set early and never raised.</t>
<t>AES-FSM is the only construction in this comparison that operates in the
frequency domain. It is also the only one that provides 32-byte nonces,
32-byte tags, nonce-misuse resistance, and spectral compliance
simultaneously. It is, however, not the only one that has been implemented
using birds.</t>
</section>

<section anchor="proof-spectral-uniqueness"><name>Proof: Spectral Uniqueness</name>
<t>This appendix shows that distinct counter blocks produce distinct AES inputs,
guaranteeing unique keystream blocks.</t>
<t>The additive FFT evaluates a degree-15 polynomial over GF(2^8) at the 16
points {0, 1, …, 15}. This evaluation is represented by the 16x16
Vandermonde matrix V where V[i][j] = i^j in GF(2<sup>8).</sup></t>
<t>The Vandermonde determinant over a field is:</t>

<artwork>det(V) = product_{0 &lt;= j &lt; i &lt;= 15} (x_i ⊕ x_j)
</artwork>
<t>where subtraction in GF(2^8) is ⊕ (XOR). Since x<em>i != x</em>j for all distinct i,
j, each (x<em>i ⊕ x</em>j) is nonzero. Since i ⊕ j is nonzero for all distinct i, j in
{0, …, 15}, the determinant is nonzero and V is invertible. Therefore the
additive FFT is a bijection on 16-byte strings.
This is the most linear algebra that will appear in this document.</t>
<t>Since the FFT is injective, distinct counter blocks produce distinct 16-byte
spectra. Each spectrum is encrypted by AES under the per-message key
TopVibes, producing a unique keystream block (up to AES collision
probability).</t>
<t>No floating-point arithmetic is involved. No rounding is required. The
authors consider this a vindication of working over finite fields. QED.</t>
</section>

<section anchor="implementation-notes"><name>Implementation Notes</name>
<t>AES-FSM deliberately combines ingredients that do not naturally belong together
(finite field polynomial evaluation, block ciphers, SIV, SHAKE-256, normative
language, and a non-trivial amount of optimism).</t>
<t>Implementers attempting to reproduce Appendix G should note:</t>

<ul>
<li><t>The additive FFT operates over GF(2^8) with the AES irreducible polynomial
x^8 + x^4 + x^3 + x + 1 (0x11B) and primitive element 0x03.</t>
</li>
<li><t>The evaluation points are {0, 1, …, 15}, forming a 4-dimensional
GF(2)-subspace of GF(2^8).</t>
</li>
<li><t>The inverse FFT is computed via the inverse Vandermonde matrix over GF(2^8).
Precomputing this matrix at initialization is RECOMMENDED.</t>
</li>
<li><t>No floating-point arithmetic is involved. All operations are exact over
GF(2^8).</t>
</li>
<li><t>The FHASH subkey is derived once per root key using counter bytes [1..16].
Implementations SHOULD precompute and cache this value.</t>
</li>
</ul>
<t>If your implementation does not match the provided test vectors, do not assume
you are wrong. It is entirely possible that the spectrum has changed.
If it has, please update your implementation accordingly.</t>
</section>

<section anchor="interoperability"><name>Interoperability</name>
<t>Implementations claiming AES-FSM interoperability MUST follow the parameter
choices in this document exactly:</t>

<ul>
<li><t>AES-256 with 32-byte root keys.</t>
</li>
<li><t>32-byte nonces.</t>
</li>
<li><t>32-byte tags.</t>
</li>
<li><t>GF(2^8) arithmetic using the AES polynomial (0x11B) and primitive element
0x03.</t>
</li>
<li><t>Additive FFT evaluation points fixed to {0, 1, ..., 15}.</t>
</li>
<li><t>Length encoding as 8-byte little-endian for both AAD and plaintext lengths.</t>
</li>
<li><t>Bit-reversal permutation over 64 bytes using 6-bit indices.</t>
</li>
<li><t><tt>TopVibes = W[0:32]</tt>, <tt>BottomVibes = W[32:44]</tt>.</t>
</li>
<li><t>Per-block counter block exactly <tt>BottomVibes || LE32(i)</tt>, with <tt>i</tt> starting
at 0 and incrementing by 1 per block.</t>
</li>
</ul>
<t>Implementations SHOULD validate interoperability using the shared
<tt>test-vectors.toml</tt> file and compare intermediate values (FHASH subkey
derivation, SIV tag, vibes extraction, and per-block spectra) before
debugging full ciphertext mismatches. Implementations that diverge on these
values are very likely operating in a different key.</t>
</section>

<section anchor="mathematical-formulation"><name>Mathematical Formulation</name>
<t>Let <tt>cb</tt> be a 16-byte counter block, interpreted as coefficients of a
polynomial over GF(2^8). Let X = {x<em>0, x</em>1, …, x_15} be the agreed-upon set
of 16 evaluation points forming a 4-dimensional GF(2)-subspace of GF(2^8).
The additive FFT evaluates this polynomial at X:</t>

<artwork>FFT(cb)[i] = sum_{j=0}^{15} cb[j] * (x_i)^j    in GF(2^8)
</artwork>
<t>The FSM block is defined as:</t>

<artwork>FSM_block(K, cb, D) = D XOR IFFT(AES_K(FFT(cb)))
</artwork>
<t>where <tt>AES_K</tt> encrypts the 16-byte spectrum as a single block, and <tt>IFFT</tt>
recovers coefficients via the inverse Vandermonde matrix over GF(2<sup>8).</sup></t>
<t>The FHASH subkey <tt>H</tt> is:</t>

<artwork>H = FSM_block(K, [0x01, 0x02, …, 0x10], 0^128)
</artwork>
<t>The SIV tag over nonce N, associated data A, and plaintext P is:</t>

<artwork>T = SHAKE-256(H || N || len(A) || A || len(P) || P, 256)
</artwork>
<t>Let <tt>V = SHAKE-256(K || T, 512)</tt> and <tt>W = bitrev_permute(V)</tt> where each
index's 6-bit binary representation is reversed. Then:</t>

<artwork>TopVibes    = W[0:32]    (per-message key)
BottomVibes = W[32:44]   (counter seed)
</artwork>
<t>Per-block encryption transforms the counter into the frequency domain:</t>

<artwork>cb = BottomVibes || LE32(i)   (16 bytes)
keystream = AES_{TopVibes}(FFT(cb))
C_i = P_i XOR keystream
</artwork>
<t>Correctness follows from the bijectivity of the additive FFT (the
Vandermonde matrix over 16 distinct points in GF(2^8) is invertible) and the
assumption that vibes are preserved under transformation.</t>
</section>

<section anchor="test-vectors"><name>Test Vectors</name>
<t>Comprehensive test vectors — including all intermediate values (FFT
coefficients, AES inputs/outputs, IFFT results, vibes extraction, keystreams,
and derived keys) — are provided in <tt>test-vectors.toml</tt> alongside the
reference implementation at <eref target="https://github.com/initsecret/aes-fsm">initsecret/aes-fsm</eref>.</t>
<t>Implementations MUST use GF(2^8) with the AES irreducible polynomial (0x11B),
primitive element 0x03, and evaluation points {0, …, 15} to reproduce these
vectors. Because all operations are exact finite field arithmetic, there are
no platform-dependent rounding or normalization concerns. Implementers whose
results match are encouraged to verify their vibes independently.</t>
</section>

<section anchor="reference-implementation-python"><name>Reference Implementation (Python)</name>
<t>A non-optimized reference implementation of AES-FSM is provided at
<eref target="https://github.com/initsecret/aes-fsm">initsecret/aes-fsm</eref>. The interface mirrors the AEAD
constructions in <tt>pyca/cryptography</tt>:</t>

<sourcecode type="python">import os
from aes_fsm import AESFSM

data = b&quot;a secret message&quot;
aad = b&quot;authenticated but unencrypted data&quot;
key = AESFSM.generate_key()
fsm = AESFSM(key)
nonce = os.urandom(32)
ct = fsm.encrypt(nonce, data, aad)
fsm.decrypt(nonce, ct, aad)
</sourcecode>
</section>

<section anchor="reference-implementation-go"><name>Reference Implementation (Go)</name>
<t>A second reference implementation is provided in Go at
<eref target="https://github.com/initsecret/aes-fsm">initsecret/aes-fsm</eref>. The existence of two implementations
in different languages is the strongest evidence the authors can offer that the
specification is unambiguous. It is not evidence that either implementation
is correct.</t>
<t>The implementation satisfies the <tt>crypto/cipher.AEAD</tt> interface.</t>

<sourcecode type="go">import &quot;github.com/initsecret/aes-fsm/go&quot;

key := make([]byte, aesfsm.KeySize)
rand.Read(key)
fsm, _ := aesfsm.New(key) // implements cipher.AEAD

nonce := make([]byte, aesfsm.NonceSize)
rand.Read(nonce)

aad := []byte(&quot;authenticated but unencrypted data&quot;)
ct := fsm.Seal(nil, nonce, []byte(&quot;a secret message&quot;), aad)
pt, _ := fsm.Open(nil, nonce, ct, aad)
</sourcecode>
</section>

<section anchor="security-analysis"><name>Security Analysis</name>
<t>This appendix provides the detailed security analysis summarized in Section 11.</t>

<section anchor="pseudorandom-permutation"><name>Pseudorandom Permutation</name>
<t>The FSM block's security reduces to AES being a good pseudorandom permutation.
The additive FFT and IFFT are fixed, public bijections over GF(2^8); the
security comes entirely from the AES call applied to the spectrum. Since the
FFT is a bijection, the composition FFT-then-AES-then-IFFT is itself a
pseudorandom permutation on 16-byte blocks under the PRP assumption.</t>
</section>

<section anchor="nonce-misuse-resistance"><name>Nonce-Misuse Resistance</name>
<t>AES-FSM is a SIV construction <xref target="RFC8452"></xref>: the authentication tag is computed
over the plaintext before encryption. If a nonce is reused with a different
plaintext, the tag (and therefore the synthetic IV and derived key) will
differ, producing an independent keystream. Nonce reuse with identical
plaintext reveals only that the plaintexts are equal.</t>
<t>This is the strongest achievable guarantee for a deterministic AEAD under nonce
misuse.</t>
</section>

<section anchor="per-message-key-isolation"><name>Per-Message Key Isolation</name>
<t>Each message is encrypted under a fresh 32-byte key (TopVibes) derived from
the root key and tag via SHAKE-256 and bit-reversal permutation. Even if an
attacker recovers one per-message key, the root key remains protected by the
preimage resistance of SHAKE-256.</t>
</section>

<section anchor="context-commitment"><name>Context Commitment</name>
<t>The FHASH tag binds (via SHAKE-256 collision resistance) the root key
(implicitly, through the subkey H), the nonce, the associated data, and the
plaintext. This provides context commitment: it is computationally infeasible
to find two distinct (K, N, A, P) tuples that produce the same tag.</t>
</section>

<section anchor="shake-256-as-a-mac"><name>SHAKE-256 as a MAC</name>
<t>SHAKE-256 in key-prefix mode is a secure MAC for sponge-based constructions.
Unlike Merkle-Damgard hashes, the sponge capacity bits are never exposed,
preventing length-extension attacks. The authors appreciate that the word
&quot;capacity&quot; appears in both sponge constructions and concert venues.</t>
</section>
</section>

<section anchor="design-notes"><name>Design Notes</name>
<t>Early drafts attempted to interpret counter blocks as complex-valued samples
and apply the usual FFT over floating-point arithmetic. This approach was
rejected due to correctness concerns, platform-dependent rounding behavior, and
the general difficulty of standardizing vibes in the presence of denormals.
AES-FSM therefore uses the additive FFT over GF(2^8), where transforms are
exact, invertible, and immune to spectral drift.</t>
<t>The construction draws on the additive FFT over GF(2^8) <xref target="ADDITIVEFFT"></xref>,
which maps counter blocks into spectral coefficients via polynomial
evaluation over the AES field. That the entire spectrum fits in a single
AES block reflects a principled design choice: when the vibes are right,
one block is all you need.</t>
<t>The SIV construction ensures nonce-misuse resistance. The use of SHAKE-256
for both FHASH and vibes extraction avoids introducing additional
block-cipher assumptions. The bit-reversal permutation pays homage to the
Cooley-Tukey FFT <xref target="FOURIER"></xref>. All integer encodings use little-endian byte
order, because we believe in rooting for the little guy.</t>
<t>SHAKE-256 serves as a PRF keyed by K: given a fresh tag T (which differs per
message under the SIV guarantee), the output V is indistinguishable from
random.</t>
</section>

<section anchor="acknowledgements" numbered="false"><name>Acknowledgements</name>
<t>The authors thank the Fourier transform for its tireless service across
disciplines, the Flying Spaghetti Monster for lending us the acronym, the
Vandermonde matrix for being invertible when it mattered most, BLAHAJ for
emotional support during the design process, and all reviewers who asked
whether this was serious — to whom the authors reply: about the security:
yes.</t>
<t>Vibes are hereby acknowledged.</t>
</section>

</back>

</rfc>
