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 /include/linux | |
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 'include/linux')
-rw-r--r-- | include/linux/crypto.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 3c89df6e7768..d88bf8aa8b47 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -3,6 +3,7 @@ | |||
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) 2002 David S. Miller (davem@redhat.com) | 5 | * Copyright (c) 2002 David S. Miller (davem@redhat.com) |
6 | * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au> | ||
6 | * | 7 | * |
7 | * Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@fast.no> | 8 | * Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@fast.no> |
8 | * and Nettle, by Niels Möller. | 9 | * and Nettle, by Niels Möller. |
@@ -126,7 +127,11 @@ struct crypto_alg { | |||
126 | unsigned int cra_blocksize; | 127 | unsigned int cra_blocksize; |
127 | unsigned int cra_ctxsize; | 128 | unsigned int cra_ctxsize; |
128 | unsigned int cra_alignmask; | 129 | unsigned int cra_alignmask; |
130 | |||
131 | int cra_priority; | ||
132 | |||
129 | const char cra_name[CRYPTO_MAX_ALG_NAME]; | 133 | const char cra_name[CRYPTO_MAX_ALG_NAME]; |
134 | const char cra_driver_name[CRYPTO_MAX_ALG_NAME]; | ||
130 | 135 | ||
131 | union { | 136 | union { |
132 | struct cipher_alg cipher; | 137 | struct cipher_alg cipher; |