Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
669bbedf
Commit
669bbedf
authored
Jul 05, 2012
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blowfish: invert branch and loop precedence
Should slightly improve performance depending on the compiler used.
parent
5b54a90c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
blowfish.c
libavutil/blowfish.c
+13
-7
No files found.
libavutil/blowfish.c
View file @
669bbedf
...
...
@@ -381,8 +381,8 @@ void av_blowfish_crypt(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
uint32_t
v0
,
v1
;
int
i
;
while
(
count
>
0
)
{
if
(
decrypt
)
{
if
(
decrypt
)
{
while
(
count
>
0
)
{
v0
=
AV_RB32
(
src
);
v1
=
AV_RB32
(
src
+
4
);
...
...
@@ -396,7 +396,13 @@ void av_blowfish_crypt(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
dst
[
i
]
=
dst
[
i
]
^
iv
[
i
];
memcpy
(
iv
,
src
,
8
);
}
}
else
{
src
+=
8
;
dst
+=
8
;
count
-=
8
;
}
}
else
{
while
(
count
>
0
)
{
if
(
iv
)
{
for
(
i
=
0
;
i
<
8
;
i
++
)
dst
[
i
]
=
src
[
i
]
^
iv
[
i
];
...
...
@@ -414,11 +420,11 @@ void av_blowfish_crypt(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
if
(
iv
)
memcpy
(
iv
,
dst
,
8
);
}
src
+=
8
;
dst
+=
8
;
count
-=
8
;
src
+=
8
;
dst
+=
8
;
count
-=
8
;
}
}
}
...
...
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