Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Brian Smith
nettle
Commits
5ff8ded5
Commit
5ff8ded5
authored
Apr 13, 2012
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanup of SUBBYTE mmacro.
parent
9550fd19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
ChangeLog
ChangeLog
+5
-0
aes-internal.h
aes-internal.h
+5
-5
No files found.
ChangeLog
View file @
5ff8ded5
2012-04-13 Niels Möller <nisse@lysator.liu.se>
* aes-internal.h (SUBBYTE): Cast to uint32_t. Use B0, ..., B3
macros.
2012-04-09 Niels Möller <nisse@lysator.liu.se>
Timing resistant RSA decryption, based on RSA blinding code
...
...
aes-internal.h
View file @
5ff8ded5
...
...
@@ -63,17 +63,17 @@ _aes_decrypt(const struct aes_ctx *ctx,
const
uint8_t
*
src
);
/* Macros */
#define SUBBYTE(x, box) (((box)[((x) & 0xff)]) | \
((box)[(((x) >> 8) & 0xff)] << 8) | \
((box)[(((x) >> 16) & 0xff)] << 16) | \
((box)[(((x) >> 24) & 0xff)] << 24))
/* Get the byte with index 0, 1, 2 and 3 */
#define B0(x) ((x) & 0xff)
#define B1(x) (((x) >> 8) & 0xff)
#define B2(x) (((x) >> 16) & 0xff)
#define B3(x) (((x) >> 24) & 0xff)
#define SUBBYTE(x, box) ((uint32_t)(box)[B0(x)] \
| ((uint32_t)(box)[B1(x)] << 8) \
| ((uint32_t)(box)[B2(x)] << 16) \
| ((uint32_t)(box)[B3(x)] << 24))
#define AES_ROUND(T, w0, w1, w2, w3, k) \
(( T->table[0][ B0(w0) ] \
^ T->table[1][ B1(w1) ] \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment