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
5420c8f7
Commit
5420c8f7
authored
May 30, 2018
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/crypto_bench: add missing RC4 implementation from gcrypt
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
cd62f9d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
crypto_bench.c
tools/crypto_bench.c
+10
-8
No files found.
tools/crypto_bench.c
View file @
5420c8f7
...
...
@@ -312,23 +312,24 @@ DEFINE_GCRYPT_WRAPPER(sha256, SHA256)
DEFINE_GCRYPT_WRAPPER
(
sha512
,
SHA512
)
DEFINE_GCRYPT_WRAPPER
(
ripemd160
,
RMD160
)
#define DEFINE_GCRYPT_CYPHER_WRAPPER(suffix, cypher,
sz)
\
#define DEFINE_GCRYPT_CYPHER_WRAPPER(suffix, cypher,
mode, sz)
\
static void run_gcrypt_ ## suffix(uint8_t *output, \
const uint8_t *input, unsigned size) \
{ \
static gcry_cipher_hd_t suffix; \
if (!suffix) \
gcry_cipher_open(&suffix, GCRY_CIPHER_ ## cypher, GCRY_CIPHER_MODE_
ECB
, 0); \
gcry_cipher_open(&suffix, GCRY_CIPHER_ ## cypher, GCRY_CIPHER_MODE_
## mode
, 0); \
gcry_cipher_setkey(suffix, hardcoded_key, sz); \
gcry_cipher_encrypt(suffix, output, size, input, size); \
}
DEFINE_GCRYPT_CYPHER_WRAPPER
(
aes128
,
AES128
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
blowfish
,
BLOWFISH
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
camellia
,
CAMELLIA128
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
cast128
,
CAST5
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
des
,
DES
,
8
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
twofish
,
TWOFISH128
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
aes128
,
AES128
,
ECB
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
blowfish
,
BLOWFISH
,
ECB
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
camellia
,
CAMELLIA128
,
ECB
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
cast128
,
CAST5
,
ECB
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
des
,
DES
,
ECB
,
8
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
twofish
,
TWOFISH128
,
ECB
,
16
)
DEFINE_GCRYPT_CYPHER_WRAPPER
(
rc4
,
ARCFOUR
,
STREAM
,
16
)
#define IMPL_USE_gcrypt(...) IMPL_USE(__VA_ARGS__)
#else
...
...
@@ -648,6 +649,7 @@ struct hash_impl implementations[] = {
IMPL
(
tomcrypt
,
"TWOFISH"
,
twofish
,
"crc:9edbd5c1"
)
IMPL
(
lavu
,
"RC4"
,
rc4
,
"crc:538d37b2"
)
IMPL
(
crypto
,
"RC4"
,
rc4
,
"crc:538d37b2"
)
IMPL
(
gcrypt
,
"RC4"
,
rc4
,
"crc:538d37b2"
)
IMPL
(
mbedcrypto
,
"RC4"
,
rc4
,
"crc:538d37b2"
)
IMPL
(
lavu
,
"XTEA"
,
xtea
,
"crc:931fc270"
)
IMPL
(
mbedcrypto
,
"XTEA"
,
xtea
,
"crc:931fc270"
)
...
...
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