def times_x

bend-collections-laws-crypto@1.0.0.0 · spec/crypto/aes/poly.bend:59

import bend-collections-laws-crypto@1.0.0.0/spec/crypto/aes/poly.bend as Poly
import Base

59# Multiplication by x modulo m(x) = x^n + low(x) (deg low < n): shift every
60# coefficient up one degree; the coefficient that reaches x^n is replaced by
61# low(x), since x^n = low(x) modulo m(x).
62def times_x(+n: Nat, +low: Word(n), +r: Word(n)) -> Word(n):
63  Word.xor(n, wscale(n, top(n, r), low), Word.shl(n, r))

Uses (6)

Used by (16)