Clarify all functions operate modulo N

Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
Werner Lewis 2022-12-14 17:08:43 +00:00
parent a306886b3a
commit 1d89ebf548
2 changed files with 14 additions and 14 deletions

View file

@ -46,15 +46,15 @@
* sizes. Most functions will not check that input values are in canonical
* form (i.e. that \p A < \p N), this is only checked during setup of a
* residue structure.
* - **Modular representatives**: functions that operate modulo \p N expect
* all modular inputs to be in the range [0, \p N - 1] and guarantee outputs
* in the range [0, \p N - 1]. Residues are setup with an associated modulus,
* and operations are only guaranteed to work if the modulus is associated
* with all residue parameters. If a residue is passed with a modulus other
* than the one it is associated with, then it may be out of range. If an
* input is out of range, outputs are fully unspecified, though bignum values
* out of range should not cause buffer overflows (beware that this is not
* extensively tested).
* - **Modular representatives**: all functions expect inputs to be in the
* range [0, \p N - 1] and guarantee outputs in the range [0, \p N - 1].
* Residues are set up with an associated modulus, and operations are only
* guaranteed to work if the modulus is associated with all residue
* parameters. If a residue is passed with a modulus other than the one it
* is associated with, then it may be out of range. If an input is out of
* range, outputs are fully unspecified, though bignum values out of range
* should not cause buffer overflows (beware that this is not extensively
* tested).
*/
/*

View file

@ -51,11 +51,11 @@
* modulus may lead to buffer overflows. Some functions which allocate
* memory or handle reading/writing of bignums will return an error if
* memory allocation fails or if buffer sizes are invalid.
* - **Modular representatives**: functions that operate modulo \p N expect
* all modular inputs to be in the range [0, \p N - 1] and guarantee outputs
* in the range [0, \p N - 1]. If an input is out of range, outputs are
* fully unspecified, though bignum values out of range should not cause
* buffer overflows (beware that this is not extensively tested).
* - **Modular representatives**: all functions expect inputs to be in the
* range [0, \p N - 1] and guarantee outputs in the range [0, \p N - 1]. If
* an input is out of range, outputs are fully unspecified, though bignum
* values out of range should not cause buffer overflows (beware that this is
* not extensively tested).
*/
/*