diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-11-05 00:58:14 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-09 17:15:37 -0500 |
commit | 5cb1454b862ab3040b78364d58330262fea1ddba (patch) | |
tree | 7e62126fa1f1398bb6a6b7f9e136aece32b0e112 /crypto/internal.h | |
parent | 06ace7a9bafeb9047352707eb79e8eaa0dfdf5f2 (diff) |
[CRYPTO] Allow multiple implementations of the same algorithm
This is the first step on the road towards asynchronous support in
the Crypto API. It adds support for having multiple crypto_alg objects
for the same algorithm registered in the system.
For example, each device driver would register a crypto_alg object
for each algorithm that it supports. While at the same time the
user may load software implementations of those same algorithms.
Users of the Crypto API may then select a specific implementation
by name, or choose any implementation for a given algorithm with
the highest priority.
The priority field is a 32-bit signed integer. In future it will be
possible to modify it from user-space.
This also provides a solution to the problem of selecting amongst
various AES implementations, that is, aes vs. aes-i586 vs. aes-padlock.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r-- | crypto/internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/internal.h b/crypto/internal.h index 37aa652ce5ce..959e602909a6 100644 --- a/crypto/internal.h +++ b/crypto/internal.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * Cryptographic API. | 2 | * Cryptographic API. |
3 | * | 3 | * |
4 | * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> | 4 | * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> |
5 | * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au> | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License as published by the Free | 8 | * under the terms of the GNU General Public License as published by the Free |
@@ -16,10 +17,15 @@ | |||
16 | #include <linux/highmem.h> | 17 | #include <linux/highmem.h> |
17 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/list.h> | ||
19 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/rwsem.h> | ||
20 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
21 | #include <asm/kmap_types.h> | 24 | #include <asm/kmap_types.h> |
22 | 25 | ||
26 | extern struct list_head crypto_alg_list; | ||
27 | extern struct rw_semaphore crypto_alg_sem; | ||
28 | |||
23 | extern enum km_type crypto_km_types[]; | 29 | extern enum km_type crypto_km_types[]; |
24 | 30 | ||
25 | static inline enum km_type crypto_kmap_type(int out) | 31 | static inline enum km_type crypto_kmap_type(int out) |