Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
a3a69311
Commit
a3a69311
authored
Jan 14, 2013
by
Ulrik Sverdrup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
siphash: Write siphash_epilogue in nicer style
parent
bbfec6b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
ccan/siphash/siphash.c
ccan/siphash/siphash.c
+9
-9
No files found.
ccan/siphash/siphash.c
View file @
a3a69311
...
...
@@ -43,18 +43,18 @@ static void siphash_init(u64 v[5], const unsigned char key[16])
}
/* Load the last 0-7 bytes of `in` and put in len & 255 */
static
void
siphash_epilogue
(
u64
*
m
,
const
void
*
in
,
size_t
len
)
static
void
siphash_epilogue
(
u64
*
m
,
const
unsigned
char
*
in
,
size_t
len
)
{
in
=
(
char
*
)
in
+
(
len
&
~
7
);
in
+=
(
len
&
~
7
);
*
m
=
(
u64
)(
len
&
255
)
<<
56
;
switch
(
len
&
7
)
{
case
7
:
*
m
|=
(
u64
)
*
((
unsigned
char
*
)
in
+
6
)
<<
48
;
case
6
:
*
m
|=
(
u64
)
*
((
unsigned
char
*
)
in
+
5
)
<<
40
;
case
5
:
*
m
|=
(
u64
)
*
((
unsigned
char
*
)
in
+
4
)
<<
32
;
case
4
:
*
m
|=
(
u64
)
*
((
unsigned
char
*
)
in
+
3
)
<<
24
;
case
3
:
*
m
|=
(
u64
)
*
((
unsigned
char
*
)
in
+
2
)
<<
16
;
case
2
:
*
m
|=
(
u64
)
*
((
unsigned
char
*
)
in
+
1
)
<<
8
;
case
1
:
*
m
|=
(
u64
)
*
((
unsigned
char
*
)
in
+
0
)
;
case
7
:
*
m
|=
(
u64
)
in
[
6
]
<<
48
;
case
6
:
*
m
|=
(
u64
)
in
[
5
]
<<
40
;
case
5
:
*
m
|=
(
u64
)
in
[
4
]
<<
32
;
case
4
:
*
m
|=
(
u64
)
in
[
3
]
<<
24
;
case
3
:
*
m
|=
(
u64
)
in
[
2
]
<<
16
;
case
2
:
*
m
|=
(
u64
)
in
[
1
]
<<
8
;
case
1
:
*
m
|=
(
u64
)
in
[
0
]
;
case
0
:
;
}
}
...
...
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