Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9c2f3041
Commit
9c2f3041
authored
Sep 07, 2016
by
Christian Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26798: for loop initial declarations, take 2
parent
8482ce48
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
17 deletions
+23
-17
Modules/_blake2/impl/blake2b-ref.c
Modules/_blake2/impl/blake2b-ref.c
+6
-4
Modules/_blake2/impl/blake2b.c
Modules/_blake2/impl/blake2b.c
+4
-3
Modules/_blake2/impl/blake2s-ref.c
Modules/_blake2/impl/blake2s-ref.c
+9
-7
Modules/_blake2/impl/blake2s.c
Modules/_blake2/impl/blake2s.c
+4
-3
No files found.
Modules/_blake2/impl/blake2b-ref.c
View file @
9c2f3041
...
...
@@ -157,11 +157,12 @@ BLAKE2_LOCAL_INLINE(int) blake2b_init0( blake2b_state *S )
int
blake2b_init_param
(
blake2b_state
*
S
,
const
blake2b_param
*
P
)
{
const
uint8_t
*
p
=
(
const
uint8_t
*
)(
P
);
size_t
i
;
blake2b_init0
(
S
);
/* IV XOR ParamBlock */
for
(
size_t
i
=
0
;
i
<
8
;
++
i
)
for
(
i
=
0
;
i
<
8
;
++
i
)
S
->
h
[
i
]
^=
load64
(
p
+
sizeof
(
S
->
h
[
i
]
)
*
i
);
return
0
;
...
...
@@ -392,14 +393,15 @@ int main( int argc, char **argv )
{
uint8_t
key
[
BLAKE2B_KEYBYTES
];
uint8_t
buf
[
KAT_LENGTH
];
size_t
i
;
for
(
size_t
i
=
0
;
i
<
BLAKE2B_KEYBYTES
;
++
i
)
for
(
i
=
0
;
i
<
BLAKE2B_KEYBYTES
;
++
i
)
key
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
buf
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
{
uint8_t
hash
[
BLAKE2B_OUTBYTES
];
blake2b
(
hash
,
buf
,
key
,
BLAKE2B_OUTBYTES
,
i
,
BLAKE2B_KEYBYTES
);
...
...
Modules/_blake2/impl/blake2b.c
View file @
9c2f3041
...
...
@@ -426,14 +426,15 @@ int main( int argc, char **argv )
{
uint8_t
key
[
BLAKE2B_KEYBYTES
];
uint8_t
buf
[
KAT_LENGTH
];
size_t
i
;
for
(
size_t
i
=
0
;
i
<
BLAKE2B_KEYBYTES
;
++
i
)
for
(
i
=
0
;
i
<
BLAKE2B_KEYBYTES
;
++
i
)
key
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
buf
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
{
uint8_t
hash
[
BLAKE2B_OUTBYTES
];
blake2b
(
hash
,
buf
,
key
,
BLAKE2B_OUTBYTES
,
i
,
BLAKE2B_KEYBYTES
);
...
...
Modules/_blake2/impl/blake2s-ref.c
View file @
9c2f3041
...
...
@@ -154,7 +154,7 @@ int blake2s_init_param( blake2s_state *S, const blake2s_param *P )
blake2s_init0
(
S
);
/* IV XOR ParamBlock */
for
(
size_t
i
=
0
;
i
<
8
;
++
i
)
for
(
i
=
0
;
i
<
8
;
++
i
)
S
->
h
[
i
]
^=
load32
(
&
p
[
i
]
);
return
0
;
...
...
@@ -219,11 +219,12 @@ static int blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCK
{
uint32_t
m
[
16
];
uint32_t
v
[
16
];
size_t
i
;
for
(
size_t
i
=
0
;
i
<
16
;
++
i
)
for
(
i
=
0
;
i
<
16
;
++
i
)
m
[
i
]
=
load32
(
block
+
i
*
sizeof
(
m
[
i
]
)
);
for
(
size_t
i
=
0
;
i
<
8
;
++
i
)
for
(
i
=
0
;
i
<
8
;
++
i
)
v
[
i
]
=
S
->
h
[
i
];
v
[
8
]
=
blake2s_IV
[
0
];
...
...
@@ -267,7 +268,7 @@ static int blake2s_compress( blake2s_state *S, const uint8_t block[BLAKE2S_BLOCK
ROUND
(
8
);
ROUND
(
9
);
for
(
size_t
i
=
0
;
i
<
8
;
++
i
)
for
(
i
=
0
;
i
<
8
;
++
i
)
S
->
h
[
i
]
=
S
->
h
[
i
]
^
v
[
i
]
^
v
[
i
+
8
];
#undef G
...
...
@@ -381,14 +382,15 @@ int main( int argc, char **argv )
{
uint8_t
key
[
BLAKE2S_KEYBYTES
];
uint8_t
buf
[
KAT_LENGTH
];
size_t
i
;
for
(
size_t
i
=
0
;
i
<
BLAKE2S_KEYBYTES
;
++
i
)
for
(
i
=
0
;
i
<
BLAKE2S_KEYBYTES
;
++
i
)
key
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
buf
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
{
uint8_t
hash
[
BLAKE2S_OUTBYTES
];
blake2s
(
hash
,
buf
,
key
,
BLAKE2S_OUTBYTES
,
i
,
BLAKE2S_KEYBYTES
);
...
...
Modules/_blake2/impl/blake2s.c
View file @
9c2f3041
...
...
@@ -407,14 +407,15 @@ int main( int argc, char **argv )
{
uint8_t
key
[
BLAKE2S_KEYBYTES
];
uint8_t
buf
[
KAT_LENGTH
];
size_t
i
;
for
(
size_t
i
=
0
;
i
<
BLAKE2S_KEYBYTES
;
++
i
)
for
(
i
=
0
;
i
<
BLAKE2S_KEYBYTES
;
++
i
)
key
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
buf
[
i
]
=
(
uint8_t
)
i
;
for
(
size_t
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
for
(
i
=
0
;
i
<
KAT_LENGTH
;
++
i
)
{
uint8_t
hash
[
BLAKE2S_OUTBYTES
];
...
...
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