Linear workspace for table-free binary-polynomial operations #
This is a scalar kernel for the generator, not its native logspace certificate (#6747).
fieldMulMod_inSpace concerns the existing total evaluator, including padding and truncation,
with no irreducibility or nonempty-word assumptions. Coefficients are little-endian Boolean
lists. Each bit uses the existing framed-list encoding; its length is three times the word
length. The modulus and operands are retained while the multiplication fold executes. Remainder uses
the same fold and native step, initialized with the coefficient word for one instead of an
operand. The fold rule charges the callee as well as both live coefficient words at every prefix.
This is an original resource analysis of the existing executable algorithm. Modulus search, binary dimension processing, Horner composition and seed-tape queries remain under #6747.
Main results #
Turing.BinaryField.fieldMulMod_inSpace: native linear workspace for the supplied modulus and two coefficient words, including their normalization.Turing.BinaryField.xor_inSpace: coefficient-wise XOR in linear workspace.Turing.BinaryField.modBits_inSpace: native linear workspace for the existing total supplied-modulus remainder scan.
Inputs to the supplied-modulus multiplication kernel.
Little-endian modulus coefficients.
Left coefficient word, padded or truncated by the evaluator.
Right coefficient word, padded or truncated by the evaluator.
Coefficient-wise XOR uses linear workspace in the encoded pair of coefficient words. The output ends at the shorter word.
The existing table-free evaluator is computable by a native machine in workspace linear in its three framed coefficient words. This includes all intermediate fold states and scalar callees, with no assumptions about the supplied modulus.
Modulus followed by dividend, both framed Boolean lists; the modulus field is additionally framed by the record encoding. Each coefficient contributes three symbols before record framing.
Native linear workspace for the existing total supplied-modulus modBits evaluator.
The modulus is retained throughout the scan; at every prefix both registers have at most
modulus.length - 1 coefficients. The native fold also charges each shift/XOR callee.
For monic moduli, algebraic remainder agreement is supplied by Cslib.mk_polyOfBits_modBits;
no algebraic meaning is asserted here for malformed modulus words.