Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brian Smith
nettle
Commits
982961a5
Commit
982961a5
authored
11 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Fix rotation macros to portably support zero rotation count.
parent
23f108fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
macros.h
+5
-3
5 additions, 3 deletions
macros.h
with
9 additions
and
3 deletions
ChangeLog
+
4
−
0
View file @
982961a5
2013-05-17 Niels Möller <nisse@lysator.liu.se>
* macros.h (ROTL32, ROTL64): Avoid undefined behaviour for zero
rotation count. Unfortunately makes CAST128 a bit slower with
gcc-4.6.3.
* ecc-j-to-a.c (ecc_j_to_a): Fixed ecc_modp_mul call, to avoid
invalid overlap of arguments to mpn_mul_n. Problem tracked down by
Magnus Holmgren.
...
...
This diff is collapsed.
Click to expand it.
macros.h
+
5
−
3
View file @
982961a5
...
...
@@ -141,9 +141,11 @@ do { \
(dst) += (blocksize), \
(src) += (blocksize)) )
#define ROTL32(n,x) (((x)<<(n)) | ((x)>>(32-(n))))
#define ROTL64(n,x) (((x)<<(n)) | ((x)>>(64-(n))))
/* The masking of the right shift is needed to allow n == 0 (using
just 32 - n and 64 - n results in undefined behaviour). */
#define ROTL32(n,x) (((x)<<(n)) | ((x)>>((-(n)&31))))
#define ROTL64(n,x) (((x)<<(n)) | ((x)>>((-(n))&63)))
/* Requires that size > 0 */
#define INCREMENT(size, ctr) \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment