Galois/Counter Mode
X i = { 0 for i = 0 ( X i − 1 ⊕ A i ) ⋅ H for i = 1 , ... , m − 1 ( X m − 1 ⊕ ( A m ∗ ‖ 0 128 − v ) ) ⋅ H for i = m ( X i − 1 ⊕ C i − m ) ⋅ H for i = m + 1 , ... , m + n − 1 ( X m + n − 1 ⊕ ( C n ∗ ‖ 0 128 − u ) ) ⋅ H for i = m + n ( X m + n ⊕ ( len  ( A ) ‖ len  ( C ) ) ) ⋅ H for i = m + n + 1 {\displaystyle X_{i}={\begin{cases}0&{\text{for }}i=0\\(X_{i-1}\oplus A_{i})\cdot H&{\text{for }}i=1,\ldots ,m-1\\(X_{m-1}\oplus (A_{m}^{*}\lVert 0^{128-v}))\cdot H&{\text{for }}i=m\\(X_{i-1}\oplus C_{i-m})\cdot H&{\text{for }}i=m+1,\ldots ,m+n-1\\(X_{m+n-1}\oplus (C_{n}^{*}\lVert 0^{128-u}))\cdot H&{\text{for }}i=m+n\\(X_{m+n}\oplus (\operatorname {len} (A)\lVert \operatorname {len} (C)))\cdot H&{\text{for }}i=m+n+1\\\end{cases}}}