Open hanno-becker opened 5 months ago
The README now states C99. It is documented in https://github.com/pq-code-package/mlkem-native/blob/348c5a08c87059970de5f4c2360eec3131ee734e/mlkem/reduce.c#L23 that we rely on implementation-defined behavior for unsigned to signed conversion.
@hanno-becker Is that sufficient to close this issue? As literally all compilers implement this behavior, I suppose it is.
Document which version of C and which implementation-defined behaviour of the C implementation we are assuming.
Notably, the correctness of
montgomery_reduce()
relies on implementation-defined behavior for conversions to signed integer types if the input values are not within the bounds of the target type.