Skip to content

Commit

Permalink
[CRYPTO] des: Create header file for common macros
Browse files Browse the repository at this point in the history
This patch creates include/crypto/des.h for common macros shared between
DES implementations.

Signed-off-by: Evgeniy Polyakov <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Evgeniy Polyakov authored and herbertx committed Jan 10, 2008
1 parent f7d0561 commit 16d004a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 1 addition & 7 deletions crypto/des_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@
#include <linux/crypto.h>
#include <linux/types.h>

#define DES_KEY_SIZE 8
#define DES_EXPKEY_WORDS 32
#define DES_BLOCK_SIZE 8

#define DES3_EDE_KEY_SIZE (3 * DES_KEY_SIZE)
#define DES3_EDE_EXPKEY_WORDS (3 * DES_EXPKEY_WORDS)
#define DES3_EDE_BLOCK_SIZE DES_BLOCK_SIZE
#include <crypto/des.h>

#define ROL(x, r) ((x) = rol32((x), (r)))
#define ROR(x, r) ((x) = ror32((x), (r)))
Expand Down
19 changes: 19 additions & 0 deletions include/crypto/des.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* DES & Triple DES EDE Cipher Algorithms.
*/

#ifndef __CRYPTO_DES_H
#define __CRYPTO_DES_H

#define DES_KEY_SIZE 8
#define DES_EXPKEY_WORDS 32
#define DES_BLOCK_SIZE 8

#define DES3_EDE_KEY_SIZE (3 * DES_KEY_SIZE)
#define DES3_EDE_EXPKEY_WORDS (3 * DES_EXPKEY_WORDS)
#define DES3_EDE_BLOCK_SIZE DES_BLOCK_SIZE


extern unsigned long des_ekey(u32 *pe, const u8 *k);

#endif /* __CRYPTO_DES_H */

0 comments on commit 16d004a

Please sign in to comment.