-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move bounds check for poly mulcache computation
In the default backend, mulcaches are subject to the coefficient-wise bound by q, and this bound is currently checked for in poly_mulcache_compute(), including the case of a native backend implementation. Native backends, however, are free to not use the mulcache (as is the case for AVX2, for example), in which case the bounds check would force them to zeroize the mulcache structure for no benefit. This commit moves the bounds check on the poly mulcache from the time of compute to the time of use, in poly_basemul_montgomery_cached(). That is, if a native implementation merely replaces the mulcache computation, but not the base multiplication (unlikely as it may be), the bounds will still be checked. If a native backend to use a custom base multiplication not requiring a mulcache, it can just return immediately from poly_mulcache_compute_native(). Signed-off-by: Hanno Becker <[email protected]>
- Loading branch information
1 parent
cb1941f
commit 2d0c904
Showing
3 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters