Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e0be5c4f
Commit
e0be5c4f
authored
Feb 18, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/sha: Protect macro arguments with ()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
80d278a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
sha.c
libavutil/sha.c
+6
-6
No files found.
libavutil/sha.c
View file @
e0be5c4f
...
@@ -51,13 +51,13 @@ struct AVSHA *av_sha_alloc(void)
...
@@ -51,13 +51,13 @@ struct AVSHA *av_sha_alloc(void)
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
#define blk0(i) (block[i] = AV_RB32(buffer + 4 * (i)))
#define blk0(i) (block[i] = AV_RB32(buffer + 4 * (i)))
#define blk(i) (block[i] = rol(block[
i-3] ^ block[i-8] ^ block[i-14] ^ block[i
-16], 1))
#define blk(i) (block[i] = rol(block[
(i)-3] ^ block[(i)-8] ^ block[(i)-14] ^ block[(i)
-16], 1))
#define R0(v,w,x,y,z,i) z += ((
w&(x^y))^y)
+ blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
#define R0(v,w,x,y,z,i) z += ((
(w)&((x)^(y)))^(y))
+ blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
#define R1(v,w,x,y,z,i) z += ((
w&(x^y))^y)
+ blk (i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
#define R1(v,w,x,y,z,i) z += ((
(w)&((x)^(y)))^(y))
+ blk (i) + 0x5A827999 + rol(v, 5); w = rol(w, 30);
#define R2(v,w,x,y,z,i) z += (
w^x ^y)
+ blk (i) + 0x6ED9EBA1 + rol(v, 5); w = rol(w, 30);
#define R2(v,w,x,y,z,i) z += (
(w)^(x) ^(y))
+ blk (i) + 0x6ED9EBA1 + rol(v, 5); w = rol(w, 30);
#define R3(v,w,x,y,z,i) z += (((
w|x)&y)|(w&x
)) + blk (i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30);
#define R3(v,w,x,y,z,i) z += (((
(w)|(x))&(y))|((w)&(x)
)) + blk (i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30);
#define R4(v,w,x,y,z,i) z += (
w^x ^y)
+ blk (i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30);
#define R4(v,w,x,y,z,i) z += (
(w)^(x) ^(y))
+ blk (i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30);
/* Hash a single 512-bit block. This is the core of the algorithm. */
/* Hash a single 512-bit block. This is the core of the algorithm. */
...
...
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