Blame view

include/crypto/cryptd.h 2 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
1cac2cbc7   Huang Ying   crypto: cryptd - ...
2
3
  /*
   * Software async crypto daemon
298c926c6   Adrian Hoban   crypto: cryptd - ...
4
5
6
7
8
9
10
   *
   * Added AEAD support to cryptd.
   *    Authors: Tadeusz Struk (tadeusz.struk@intel.com)
   *             Adrian Hoban <adrian.hoban@intel.com>
   *             Gabriele Paoloni <gabriele.paoloni@intel.com>
   *             Aidan O'Mahony (aidan.o.mahony@intel.com)
   *    Copyright (c) 2010, Intel Corporation.
1cac2cbc7   Huang Ying   crypto: cryptd - ...
11
12
13
14
   */
  
  #ifndef _CRYPTO_CRYPT_H
  #define _CRYPTO_CRYPT_H
1cac2cbc7   Huang Ying   crypto: cryptd - ...
15
  #include <linux/kernel.h>
53033d4d3   Herbert Xu   crypto: cryptd - ...
16
  #include <crypto/aead.h>
ace136636   Huang Ying   crypto: cryptd - ...
17
  #include <crypto/hash.h>
4e0958d19   Herbert Xu   crypto: cryptd - ...
18
  #include <crypto/skcipher.h>
1cac2cbc7   Huang Ying   crypto: cryptd - ...
19

4e0958d19   Herbert Xu   crypto: cryptd - ...
20
21
22
  struct cryptd_skcipher {
  	struct crypto_skcipher base;
  };
0a877e354   Eric Biggers   crypto: cryptd - ...
23
  /* alg_name should be algorithm to be cryptd-ed */
4e0958d19   Herbert Xu   crypto: cryptd - ...
24
25
26
27
28
29
  struct cryptd_skcipher *cryptd_alloc_skcipher(const char *alg_name,
  					      u32 type, u32 mask);
  struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm);
  /* Must be called without moving CPUs. */
  bool cryptd_skcipher_queued(struct cryptd_skcipher *tfm);
  void cryptd_free_skcipher(struct cryptd_skcipher *tfm);
ace136636   Huang Ying   crypto: cryptd - ...
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  struct cryptd_ahash {
  	struct crypto_ahash base;
  };
  
  static inline struct cryptd_ahash *__cryptd_ahash_cast(
  	struct crypto_ahash *tfm)
  {
  	return (struct cryptd_ahash *)tfm;
  }
  
  /* alg_name should be algorithm to be cryptd-ed */
  struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name,
  					u32 type, u32 mask);
  struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm);
0e1227d35   Huang Ying   crypto: ghash - A...
44
  struct shash_desc *cryptd_shash_desc(struct ahash_request *req);
81760ea6a   Herbert Xu   crypto: cryptd - ...
45
46
  /* Must be called without moving CPUs. */
  bool cryptd_ahash_queued(struct cryptd_ahash *tfm);
ace136636   Huang Ying   crypto: cryptd - ...
47
  void cryptd_free_ahash(struct cryptd_ahash *tfm);
298c926c6   Adrian Hoban   crypto: cryptd - ...
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  struct cryptd_aead {
  	struct crypto_aead base;
  };
  
  static inline struct cryptd_aead *__cryptd_aead_cast(
  	struct crypto_aead *tfm)
  {
  	return (struct cryptd_aead *)tfm;
  }
  
  struct cryptd_aead *cryptd_alloc_aead(const char *alg_name,
  					  u32 type, u32 mask);
  
  struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm);
81760ea6a   Herbert Xu   crypto: cryptd - ...
62
63
  /* Must be called without moving CPUs. */
  bool cryptd_aead_queued(struct cryptd_aead *tfm);
298c926c6   Adrian Hoban   crypto: cryptd - ...
64
65
  
  void cryptd_free_aead(struct cryptd_aead *tfm);
1cac2cbc7   Huang Ying   crypto: cryptd - ...
66
  #endif