aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 12:24:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 12:24:41 -0400
commitdc47d3810cdcb4f32bfa31d50f26af97aced0638 (patch)
treef1574adeaae857d935ad9c2e08a19727e54ef14a /include
parentf6d90b4f9ce018bff429d6e01ee672de712b8641 (diff)
parent5db017aa2809c49ca0a43b0f3ed1267e6be60883 (diff)
Merge git://github.com/herbertx/crypto
* git://github.com/herbertx/crypto: (48 commits) crypto: user - Depend on NET instead of selecting it crypto: user - Add dependency on NET crypto: talitos - handle descriptor not found in error path crypto: user - Initialise match in crypto_alg_match crypto: testmgr - add twofish tests crypto: testmgr - add blowfish test-vectors crypto: Make hifn_795x build depend on !ARCH_DMA_ADDR_T_64BIT crypto: twofish-x86_64-3way - fix ctr blocksize to 1 crypto: blowfish-x86_64 - fix ctr blocksize to 1 crypto: whirlpool - count rounds from 0 crypto: Add userspace report for compress type algorithms crypto: Add userspace report for cipher type algorithms crypto: Add userspace report for rng type algorithms crypto: Add userspace report for pcompress type algorithms crypto: Add userspace report for nivaead type algorithms crypto: Add userspace report for aead type algorithms crypto: Add userspace report for givcipher type algorithms crypto: Add userspace report for ablkcipher type algorithms crypto: Add userspace report for blkcipher type algorithms crypto: Add userspace report for ahash type algorithms ...
Diffstat (limited to 'include')
-rw-r--r--include/crypto/algapi.h2
-rw-r--r--include/crypto/blowfish.h23
-rw-r--r--include/crypto/sha.h5
-rw-r--r--include/linux/crypto.h5
-rw-r--r--include/linux/cryptouser.h102
-rw-r--r--include/linux/netlink.h1
6 files changed, 138 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 59c3e5bd2c06..ecc721def10c 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -15,6 +15,7 @@
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/skbuff.h>
18 19
19struct module; 20struct module;
20struct rtattr; 21struct rtattr;
@@ -26,6 +27,7 @@ struct crypto_type {
26 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); 27 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
27 int (*init_tfm)(struct crypto_tfm *tfm); 28 int (*init_tfm)(struct crypto_tfm *tfm);
28 void (*show)(struct seq_file *m, struct crypto_alg *alg); 29 void (*show)(struct seq_file *m, struct crypto_alg *alg);
30 int (*report)(struct sk_buff *skb, struct crypto_alg *alg);
29 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); 31 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask);
30 32
31 unsigned int type; 33 unsigned int type;
diff --git a/include/crypto/blowfish.h b/include/crypto/blowfish.h
new file mode 100644
index 000000000000..1450d4a27980
--- /dev/null
+++ b/include/crypto/blowfish.h
@@ -0,0 +1,23 @@
1/*
2 * Common values for blowfish algorithms
3 */
4
5#ifndef _CRYPTO_BLOWFISH_H
6#define _CRYPTO_BLOWFISH_H
7
8#include <linux/types.h>
9#include <linux/crypto.h>
10
11#define BF_BLOCK_SIZE 8
12#define BF_MIN_KEY_SIZE 4
13#define BF_MAX_KEY_SIZE 56
14
15struct bf_ctx {
16 u32 p[18];
17 u32 s[1024];
18};
19
20int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key,
21 unsigned int key_len);
22
23#endif
diff --git a/include/crypto/sha.h b/include/crypto/sha.h
index 069e85ba97e1..c6c9c1fe460c 100644
--- a/include/crypto/sha.h
+++ b/include/crypto/sha.h
@@ -82,4 +82,9 @@ struct sha512_state {
82 u8 buf[SHA512_BLOCK_SIZE]; 82 u8 buf[SHA512_BLOCK_SIZE];
83}; 83};
84 84
85struct shash_desc;
86
87extern int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
88 unsigned int len);
89
85#endif 90#endif
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index e5e468e9133d..de9adec5693c 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -72,6 +72,11 @@
72#define CRYPTO_ALG_TESTED 0x00000400 72#define CRYPTO_ALG_TESTED 0x00000400
73 73
74/* 74/*
75 * Set if the algorithm is an instance that is build from templates.
76 */
77#define CRYPTO_ALG_INSTANCE 0x00000800
78
79/*
75 * Transform masks and values (for crt_flags). 80 * Transform masks and values (for crt_flags).
76 */ 81 */
77#define CRYPTO_TFM_REQ_MASK 0x000fff00 82#define CRYPTO_TFM_REQ_MASK 0x000fff00
diff --git a/include/linux/cryptouser.h b/include/linux/cryptouser.h
new file mode 100644
index 000000000000..532fb58f16bf
--- /dev/null
+++ b/include/linux/cryptouser.h
@@ -0,0 +1,102 @@
1/*
2 * Crypto user configuration API.
3 *
4 * Copyright (C) 2011 secunet Security Networks AG
5 * Copyright (C) 2011 Steffen Klassert <steffen.klassert@secunet.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21/* Netlink configuration messages. */
22enum {
23 CRYPTO_MSG_BASE = 0x10,
24 CRYPTO_MSG_NEWALG = 0x10,
25 CRYPTO_MSG_DELALG,
26 CRYPTO_MSG_UPDATEALG,
27 CRYPTO_MSG_GETALG,
28 __CRYPTO_MSG_MAX
29};
30#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
31#define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
32
33#define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME
34
35/* Netlink message attributes. */
36enum crypto_attr_type_t {
37 CRYPTOCFGA_UNSPEC,
38 CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
39 CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
40 CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
41 CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
42 CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
43 CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */
44 CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */
45 CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */
46 __CRYPTOCFGA_MAX
47
48#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
49};
50
51struct crypto_user_alg {
52 char cru_name[CRYPTO_MAX_ALG_NAME];
53 char cru_driver_name[CRYPTO_MAX_ALG_NAME];
54 char cru_module_name[CRYPTO_MAX_ALG_NAME];
55 __u32 cru_type;
56 __u32 cru_mask;
57 __u32 cru_refcnt;
58 __u32 cru_flags;
59};
60
61struct crypto_report_larval {
62 char type[CRYPTO_MAX_NAME];
63};
64
65struct crypto_report_hash {
66 char type[CRYPTO_MAX_NAME];
67 unsigned int blocksize;
68 unsigned int digestsize;
69};
70
71struct crypto_report_cipher {
72 char type[CRYPTO_MAX_ALG_NAME];
73 unsigned int blocksize;
74 unsigned int min_keysize;
75 unsigned int max_keysize;
76};
77
78struct crypto_report_blkcipher {
79 char type[CRYPTO_MAX_NAME];
80 char geniv[CRYPTO_MAX_NAME];
81 unsigned int blocksize;
82 unsigned int min_keysize;
83 unsigned int max_keysize;
84 unsigned int ivsize;
85};
86
87struct crypto_report_aead {
88 char type[CRYPTO_MAX_NAME];
89 char geniv[CRYPTO_MAX_NAME];
90 unsigned int blocksize;
91 unsigned int maxauthsize;
92 unsigned int ivsize;
93};
94
95struct crypto_report_comp {
96 char type[CRYPTO_MAX_NAME];
97};
98
99struct crypto_report_rng {
100 char type[CRYPTO_MAX_NAME];
101 unsigned int seedsize;
102};
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 8180cd9d73d5..8374d2967362 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -25,6 +25,7 @@
25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ 25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
26#define NETLINK_ECRYPTFS 19 26#define NETLINK_ECRYPTFS 19
27#define NETLINK_RDMA 20 27#define NETLINK_RDMA 20
28#define NETLINK_CRYPTO 21 /* Crypto layer */
28 29
29#define MAX_LINKS 32 30#define MAX_LINKS 32
30 31