Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3c7707e0
Commit
3c7707e0
authored
Nov 18, 2002
by
James Morris
Committed by
Jeff Garzik
Nov 18, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CRYPTO]: Add null algorithms and minor cleanups.
parent
889cb525
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
11 deletions
+29
-11
Documentation/crypto/api-intro.txt
Documentation/crypto/api-intro.txt
+7
-0
crypto/Kconfig
crypto/Kconfig
+6
-0
crypto/Makefile
crypto/Makefile
+1
-0
crypto/api.c
crypto/api.c
+2
-2
crypto/compress.c
crypto/compress.c
+6
-6
include/linux/crypto.h
include/linux/crypto.h
+7
-3
No files found.
Documentation/crypto/api-intro.txt
View file @
3c7707e0
...
...
@@ -73,6 +73,13 @@ add the following line to /etc/modules.conf:
alias des3_ede des
The Null algorithms reside in the crypto_null module, so these lines
should also be added:
alias cipher_null crypto_null
alias digest_null crypto_null
alias compress_null crypto_null
DEVELOPER NOTES
...
...
crypto/Kconfig
View file @
3c7707e0
...
...
@@ -16,6 +16,12 @@ config CRYPTO_HMAC
HMAC: Keyed-Hashing for Message Authentication (RFC2104).
This is required for IPSec.
config CRYPTO_NULL
tristate "Null algorithms"
depends on CRYPTO
help
These are 'Null' algorithms, used by IPsec, which do nothing.
config CRYPTO_MD4
tristate "MD4 digest algorithm"
depends on CRYPTO
...
...
crypto/Makefile
View file @
3c7707e0
...
...
@@ -9,6 +9,7 @@ autoload-crypto-$(CONFIG_KMOD) = autoload.o
obj-$(CONFIG_CRYPTO)
+=
api.o cipher.o digest.o compress.o
$
(
autoload-crypto-y
)
obj-$(CONFIG_CRYPTO_HMAC)
+=
hmac.o
obj-$(CONFIG_CRYPTO_NULL)
+=
crypto_null.o
obj-$(CONFIG_CRYPTO_MD4)
+=
md4.o
obj-$(CONFIG_CRYPTO_MD5)
+=
md5.o
obj-$(CONFIG_CRYPTO_SHA1)
+=
sha1.o
...
...
crypto/api.c
View file @
3c7707e0
...
...
@@ -63,7 +63,7 @@ static int crypto_init_flags(struct crypto_tfm *tfm, u32 flags)
case
CRYPTO_ALG_TYPE_DIGEST
:
return
crypto_init_digest_flags
(
tfm
,
flags
);
case
CRYPTO_ALG_TYPE_COMP
:
case
CRYPTO_ALG_TYPE_COMP
RESS
:
return
crypto_init_compress_flags
(
tfm
,
flags
);
default:
...
...
@@ -83,7 +83,7 @@ static int crypto_init_ops(struct crypto_tfm *tfm)
case
CRYPTO_ALG_TYPE_DIGEST
:
return
crypto_init_digest_ops
(
tfm
);
case
CRYPTO_ALG_TYPE_COMP
:
case
CRYPTO_ALG_TYPE_COMP
RESS
:
return
crypto_init_compress_ops
(
tfm
);
default:
...
...
crypto/compress.c
View file @
3c7707e0
...
...
@@ -18,15 +18,15 @@
#include <linux/string.h>
#include "internal.h"
/*
* This code currently implements blazingly fast and
* lossless Quadruple ROT13 compression.
*/
static
void
crypto_compress
(
struct
crypto_tfm
*
tfm
)
{
}
{
tfm
->
__crt_alg
->
cra_compress
.
coa_compress
();
}
static
void
crypto_decompress
(
struct
crypto_tfm
*
tfm
)
{
}
{
tfm
->
__crt_alg
->
cra_compress
.
coa_decompress
();
}
int
crypto_init_compress_flags
(
struct
crypto_tfm
*
tfm
,
u32
flags
)
{
...
...
include/linux/crypto.h
View file @
3c7707e0
...
...
@@ -29,7 +29,7 @@
#define CRYPTO_ALG_TYPE_MASK 0x000000ff
#define CRYPTO_ALG_TYPE_CIPHER 0x00000001
#define CRYPTO_ALG_TYPE_DIGEST 0x00000002
#define CRYPTO_ALG_TYPE_COMP
0x00000004
#define CRYPTO_ALG_TYPE_COMP
RESS
0x00000004
/*
...
...
@@ -209,16 +209,19 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
static
inline
unsigned
int
crypto_tfm_alg_min_keysize
(
struct
crypto_tfm
*
tfm
)
{
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_CIPHER
);
return
tfm
->
__crt_alg
->
cra_cipher
.
cia_min_keysize
;
}
static
inline
unsigned
int
crypto_tfm_alg_max_keysize
(
struct
crypto_tfm
*
tfm
)
{
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_CIPHER
);
return
tfm
->
__crt_alg
->
cra_cipher
.
cia_max_keysize
;
}
static
inline
unsigned
int
crypto_tfm_alg_ivsize
(
struct
crypto_tfm
*
tfm
)
{
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_CIPHER
);
return
tfm
->
__crt_alg
->
cra_cipher
.
cia_ivsize
;
}
...
...
@@ -229,6 +232,7 @@ static inline unsigned int crypto_tfm_alg_blocksize(struct crypto_tfm *tfm)
static
inline
unsigned
int
crypto_tfm_alg_digestsize
(
struct
crypto_tfm
*
tfm
)
{
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_DIGEST
);
return
tfm
->
__crt_alg
->
cra_digest
.
dia_digestsize
;
}
...
...
@@ -302,13 +306,13 @@ static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
static
inline
void
crypto_comp_compress
(
struct
crypto_tfm
*
tfm
)
{
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_COMP
);
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_COMP
RESS
);
tfm
->
crt_compress
.
cot_compress
(
tfm
);
}
static
inline
void
crypto_comp_decompress
(
struct
crypto_tfm
*
tfm
)
{
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_COMP
);
BUG_ON
(
crypto_tfm_alg_type
(
tfm
)
!=
CRYPTO_ALG_TYPE_COMP
RESS
);
tfm
->
crt_compress
.
cot_decompress
(
tfm
);
}
...
...
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