equal
deleted
inserted
replaced
34 #define CRYPTO_ALG_TYPE_AEAD 0x00000003 |
34 #define CRYPTO_ALG_TYPE_AEAD 0x00000003 |
35 #define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004 |
35 #define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004 |
36 #define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 |
36 #define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 |
37 #define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006 |
37 #define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006 |
38 #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 |
38 #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 |
39 #define CRYPTO_ALG_TYPE_HASH 0x00000009 |
39 #define CRYPTO_ALG_TYPE_HASH 0x00000008 |
|
40 #define CRYPTO_ALG_TYPE_SHASH 0x00000009 |
40 #define CRYPTO_ALG_TYPE_AHASH 0x0000000a |
41 #define CRYPTO_ALG_TYPE_AHASH 0x0000000a |
41 #define CRYPTO_ALG_TYPE_RNG 0x0000000c |
42 #define CRYPTO_ALG_TYPE_RNG 0x0000000c |
42 |
43 |
43 #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e |
44 #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e |
44 #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c |
45 #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c |
218 unsigned int ivsize; |
219 unsigned int ivsize; |
219 }; |
220 }; |
220 |
221 |
221 struct ahash_alg { |
222 struct ahash_alg { |
222 int (*init)(struct ahash_request *req); |
223 int (*init)(struct ahash_request *req); |
|
224 int (*reinit)(struct ahash_request *req); |
223 int (*update)(struct ahash_request *req); |
225 int (*update)(struct ahash_request *req); |
224 int (*final)(struct ahash_request *req); |
226 int (*final)(struct ahash_request *req); |
225 int (*digest)(struct ahash_request *req); |
227 int (*digest)(struct ahash_request *req); |
226 int (*setkey)(struct crypto_ahash *tfm, const u8 *key, |
228 int (*setkey)(struct crypto_ahash *tfm, const u8 *key, |
227 unsigned int keylen); |
229 unsigned int keylen); |
478 struct hash_tfm hash; |
480 struct hash_tfm hash; |
479 struct ahash_tfm ahash; |
481 struct ahash_tfm ahash; |
480 struct compress_tfm compress; |
482 struct compress_tfm compress; |
481 struct rng_tfm rng; |
483 struct rng_tfm rng; |
482 } crt_u; |
484 } crt_u; |
|
485 |
|
486 void (*exit)(struct crypto_tfm *tfm); |
483 |
487 |
484 struct crypto_alg *__crt_alg; |
488 struct crypto_alg *__crt_alg; |
485 |
489 |
486 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; |
490 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR; |
487 }; |
491 }; |
542 |
546 |
543 /* |
547 /* |
544 * Transform user interface. |
548 * Transform user interface. |
545 */ |
549 */ |
546 |
550 |
547 struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); |
551 struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, |
|
552 const struct crypto_type *frontend, |
|
553 u32 type, u32 mask); |
548 struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); |
554 struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); |
549 void crypto_free_tfm(struct crypto_tfm *tfm); |
555 void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm); |
|
556 |
|
557 static inline void crypto_free_tfm(struct crypto_tfm *tfm) |
|
558 { |
|
559 return crypto_destroy_tfm(tfm, tfm); |
|
560 } |
550 |
561 |
551 int alg_test(const char *driver, const char *alg, u32 type, u32 mask); |
562 int alg_test(const char *driver, const char *alg, u32 type, u32 mask); |
552 |
563 |
553 /* |
564 /* |
554 * Transform helpers which query the underlying algorithm. |
565 * Transform helpers which query the underlying algorithm. |