ahash.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. /*
  2. * Asynchronous Cryptographic Hash operations.
  3. *
  4. * This is the asynchronous version of hash.c with notification of
  5. * completion via a callback.
  6. *
  7. * Copyright (c) 2008 Loc Ho <lho@amcc.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the Free
  11. * Software Foundation; either version 2 of the License, or (at your option)
  12. * any later version.
  13. *
  14. */
  15. #include <crypto/internal/hash.h>
  16. #include <crypto/scatterwalk.h>
  17. #include <linux/bug.h>
  18. #include <linux/err.h>
  19. #include <linux/kernel.h>
  20. #include <linux/module.h>
  21. #include <linux/sched.h>
  22. #include <linux/slab.h>
  23. #include <linux/seq_file.h>
  24. #include <linux/cryptouser.h>
  25. #include <linux/compiler.h>
  26. #include <net/netlink.h>
  27. #include "internal.h"
  28. struct ahash_request_priv {
  29. crypto_completion_t complete;
  30. void *data;
  31. u8 *result;
  32. u32 flags;
  33. void *ubuf[] CRYPTO_MINALIGN_ATTR;
  34. };
  35. static inline struct ahash_alg *crypto_ahash_alg(struct crypto_ahash *hash)
  36. {
  37. return container_of(crypto_hash_alg_common(hash), struct ahash_alg,
  38. halg);
  39. }
  40. static int hash_walk_next(struct crypto_hash_walk *walk)
  41. {
  42. unsigned int alignmask = walk->alignmask;
  43. unsigned int offset = walk->offset;
  44. unsigned int nbytes = min(walk->entrylen,
  45. ((unsigned int)(PAGE_SIZE)) - offset);
  46. if (walk->flags & CRYPTO_ALG_ASYNC)
  47. walk->data = kmap(walk->pg);
  48. else
  49. walk->data = kmap_atomic(walk->pg);
  50. walk->data += offset;
  51. if (offset & alignmask) {
  52. unsigned int unaligned = alignmask + 1 - (offset & alignmask);
  53. if (nbytes > unaligned)
  54. nbytes = unaligned;
  55. }
  56. walk->entrylen -= nbytes;
  57. return nbytes;
  58. }
  59. static int hash_walk_new_entry(struct crypto_hash_walk *walk)
  60. {
  61. struct scatterlist *sg;
  62. sg = walk->sg;
  63. walk->offset = sg->offset;
  64. walk->pg = sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT);
  65. walk->offset = offset_in_page(walk->offset);
  66. walk->entrylen = sg->length;
  67. if (walk->entrylen > walk->total)
  68. walk->entrylen = walk->total;
  69. walk->total -= walk->entrylen;
  70. return hash_walk_next(walk);
  71. }
  72. int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
  73. {
  74. unsigned int alignmask = walk->alignmask;
  75. walk->data -= walk->offset;
  76. if (walk->entrylen && (walk->offset & alignmask) && !err) {
  77. unsigned int nbytes;
  78. walk->offset = ALIGN(walk->offset, alignmask + 1);
  79. nbytes = min(walk->entrylen,
  80. (unsigned int)(PAGE_SIZE - walk->offset));
  81. if (nbytes) {
  82. walk->entrylen -= nbytes;
  83. walk->data += walk->offset;
  84. return nbytes;
  85. }
  86. }
  87. if (walk->flags & CRYPTO_ALG_ASYNC)
  88. kunmap(walk->pg);
  89. else {
  90. kunmap_atomic(walk->data);
  91. /*
  92. * The may sleep test only makes sense for sync users.
  93. * Async users don't need to sleep here anyway.
  94. */
  95. crypto_yield(walk->flags);
  96. }
  97. if (err)
  98. return err;
  99. if (walk->entrylen) {
  100. walk->offset = 0;
  101. walk->pg++;
  102. return hash_walk_next(walk);
  103. }
  104. if (!walk->total)
  105. return 0;
  106. walk->sg = sg_next(walk->sg);
  107. return hash_walk_new_entry(walk);
  108. }
  109. EXPORT_SYMBOL_GPL(crypto_hash_walk_done);
  110. int crypto_hash_walk_first(struct ahash_request *req,
  111. struct crypto_hash_walk *walk)
  112. {
  113. walk->total = req->nbytes;
  114. if (!walk->total) {
  115. walk->entrylen = 0;
  116. return 0;
  117. }
  118. walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req));
  119. walk->sg = req->src;
  120. walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK;
  121. return hash_walk_new_entry(walk);
  122. }
  123. EXPORT_SYMBOL_GPL(crypto_hash_walk_first);
  124. int crypto_ahash_walk_first(struct ahash_request *req,
  125. struct crypto_hash_walk *walk)
  126. {
  127. walk->total = req->nbytes;
  128. if (!walk->total) {
  129. walk->entrylen = 0;
  130. return 0;
  131. }
  132. walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req));
  133. walk->sg = req->src;
  134. walk->flags = req->base.flags & CRYPTO_TFM_REQ_MASK;
  135. walk->flags |= CRYPTO_ALG_ASYNC;
  136. BUILD_BUG_ON(CRYPTO_TFM_REQ_MASK & CRYPTO_ALG_ASYNC);
  137. return hash_walk_new_entry(walk);
  138. }
  139. EXPORT_SYMBOL_GPL(crypto_ahash_walk_first);
  140. static int ahash_setkey_unaligned(struct crypto_ahash *tfm, const u8 *key,
  141. unsigned int keylen)
  142. {
  143. unsigned long alignmask = crypto_ahash_alignmask(tfm);
  144. int ret;
  145. u8 *buffer, *alignbuffer;
  146. unsigned long absize;
  147. absize = keylen + alignmask;
  148. buffer = kmalloc(absize, GFP_KERNEL);
  149. if (!buffer)
  150. return -ENOMEM;
  151. alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
  152. memcpy(alignbuffer, key, keylen);
  153. ret = tfm->setkey(tfm, alignbuffer, keylen);
  154. kzfree(buffer);
  155. return ret;
  156. }
  157. static int ahash_nosetkey(struct crypto_ahash *tfm, const u8 *key,
  158. unsigned int keylen)
  159. {
  160. return -ENOSYS;
  161. }
  162. static void ahash_set_needkey(struct crypto_ahash *tfm)
  163. {
  164. const struct hash_alg_common *alg = crypto_hash_alg_common(tfm);
  165. if (tfm->setkey != ahash_nosetkey &&
  166. !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY))
  167. crypto_ahash_set_flags(tfm, CRYPTO_TFM_NEED_KEY);
  168. }
  169. int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key,
  170. unsigned int keylen)
  171. {
  172. unsigned long alignmask = crypto_ahash_alignmask(tfm);
  173. int err;
  174. if ((unsigned long)key & alignmask)
  175. err = ahash_setkey_unaligned(tfm, key, keylen);
  176. else
  177. err = tfm->setkey(tfm, key, keylen);
  178. if (unlikely(err)) {
  179. ahash_set_needkey(tfm);
  180. return err;
  181. }
  182. crypto_ahash_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
  183. return 0;
  184. }
  185. EXPORT_SYMBOL_GPL(crypto_ahash_setkey);
  186. static inline unsigned int ahash_align_buffer_size(unsigned len,
  187. unsigned long mask)
  188. {
  189. return len + (mask & ~(crypto_tfm_ctx_alignment() - 1));
  190. }
  191. static int ahash_save_req(struct ahash_request *req, crypto_completion_t cplt)
  192. {
  193. struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
  194. unsigned long alignmask = crypto_ahash_alignmask(tfm);
  195. unsigned int ds = crypto_ahash_digestsize(tfm);
  196. struct ahash_request_priv *priv;
  197. priv = kmalloc(sizeof(*priv) + ahash_align_buffer_size(ds, alignmask),
  198. (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ?
  199. GFP_KERNEL : GFP_ATOMIC);
  200. if (!priv)
  201. return -ENOMEM;
  202. /*
  203. * WARNING: Voodoo programming below!
  204. *
  205. * The code below is obscure and hard to understand, thus explanation
  206. * is necessary. See include/crypto/hash.h and include/linux/crypto.h
  207. * to understand the layout of structures used here!
  208. *
  209. * The code here will replace portions of the ORIGINAL request with
  210. * pointers to new code and buffers so the hashing operation can store
  211. * the result in aligned buffer. We will call the modified request
  212. * an ADJUSTED request.
  213. *
  214. * The newly mangled request will look as such:
  215. *
  216. * req {
  217. * .result = ADJUSTED[new aligned buffer]
  218. * .base.complete = ADJUSTED[pointer to completion function]
  219. * .base.data = ADJUSTED[*req (pointer to self)]
  220. * .priv = ADJUSTED[new priv] {
  221. * .result = ORIGINAL(result)
  222. * .complete = ORIGINAL(base.complete)
  223. * .data = ORIGINAL(base.data)
  224. * }
  225. */
  226. priv->result = req->result;
  227. priv->complete = req->base.complete;
  228. priv->data = req->base.data;
  229. priv->flags = req->base.flags;
  230. /*
  231. * WARNING: We do not backup req->priv here! The req->priv
  232. * is for internal use of the Crypto API and the
  233. * user must _NOT_ _EVER_ depend on it's content!
  234. */
  235. req->result = PTR_ALIGN((u8 *)priv->ubuf, alignmask + 1);
  236. req->base.complete = cplt;
  237. req->base.data = req;
  238. req->priv = priv;
  239. return 0;
  240. }
  241. static void ahash_restore_req(struct ahash_request *req, int err)
  242. {
  243. struct ahash_request_priv *priv = req->priv;
  244. if (!err)
  245. memcpy(priv->result, req->result,
  246. crypto_ahash_digestsize(crypto_ahash_reqtfm(req)));
  247. /* Restore the original crypto request. */
  248. req->result = priv->result;
  249. ahash_request_set_callback(req, priv->flags,
  250. priv->complete, priv->data);
  251. req->priv = NULL;
  252. /* Free the req->priv.priv from the ADJUSTED request. */
  253. kzfree(priv);
  254. }
  255. static void ahash_notify_einprogress(struct ahash_request *req)
  256. {
  257. struct ahash_request_priv *priv = req->priv;
  258. struct crypto_async_request oreq;
  259. oreq.data = priv->data;
  260. priv->complete(&oreq, -EINPROGRESS);
  261. }
  262. static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)
  263. {
  264. struct ahash_request *areq = req->data;
  265. if (err == -EINPROGRESS) {
  266. ahash_notify_einprogress(areq);
  267. return;
  268. }
  269. /*
  270. * Restore the original request, see ahash_op_unaligned() for what
  271. * goes where.
  272. *
  273. * The "struct ahash_request *req" here is in fact the "req.base"
  274. * from the ADJUSTED request from ahash_op_unaligned(), thus as it
  275. * is a pointer to self, it is also the ADJUSTED "req" .
  276. */
  277. /* First copy req->result into req->priv.result */
  278. ahash_restore_req(areq, err);
  279. /* Complete the ORIGINAL request. */
  280. areq->base.complete(&areq->base, err);
  281. }
  282. static int ahash_op_unaligned(struct ahash_request *req,
  283. int (*op)(struct ahash_request *))
  284. {
  285. int err;
  286. err = ahash_save_req(req, ahash_op_unaligned_done);
  287. if (err)
  288. return err;
  289. err = op(req);
  290. if (err == -EINPROGRESS || err == -EBUSY)
  291. return err;
  292. ahash_restore_req(req, err);
  293. return err;
  294. }
  295. static int crypto_ahash_op(struct ahash_request *req,
  296. int (*op)(struct ahash_request *))
  297. {
  298. struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
  299. unsigned long alignmask = crypto_ahash_alignmask(tfm);
  300. if ((unsigned long)req->result & alignmask)
  301. return ahash_op_unaligned(req, op);
  302. return op(req);
  303. }
  304. int crypto_ahash_final(struct ahash_request *req)
  305. {
  306. return crypto_ahash_op(req, crypto_ahash_reqtfm(req)->final);
  307. }
  308. EXPORT_SYMBOL_GPL(crypto_ahash_final);
  309. int crypto_ahash_finup(struct ahash_request *req)
  310. {
  311. return crypto_ahash_op(req, crypto_ahash_reqtfm(req)->finup);
  312. }
  313. EXPORT_SYMBOL_GPL(crypto_ahash_finup);
  314. int crypto_ahash_digest(struct ahash_request *req)
  315. {
  316. struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
  317. if (crypto_ahash_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
  318. return -ENOKEY;
  319. return crypto_ahash_op(req, tfm->digest);
  320. }
  321. EXPORT_SYMBOL_GPL(crypto_ahash_digest);
  322. static void ahash_def_finup_done2(struct crypto_async_request *req, int err)
  323. {
  324. struct ahash_request *areq = req->data;
  325. if (err == -EINPROGRESS)
  326. return;
  327. ahash_restore_req(areq, err);
  328. areq->base.complete(&areq->base, err);
  329. }
  330. static int ahash_def_finup_finish1(struct ahash_request *req, int err)
  331. {
  332. if (err)
  333. goto out;
  334. req->base.complete = ahash_def_finup_done2;
  335. err = crypto_ahash_reqtfm(req)->final(req);
  336. if (err == -EINPROGRESS || err == -EBUSY)
  337. return err;
  338. out:
  339. ahash_restore_req(req, err);
  340. return err;
  341. }
  342. static void ahash_def_finup_done1(struct crypto_async_request *req, int err)
  343. {
  344. struct ahash_request *areq = req->data;
  345. if (err == -EINPROGRESS) {
  346. ahash_notify_einprogress(areq);
  347. return;
  348. }
  349. areq->base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
  350. err = ahash_def_finup_finish1(areq, err);
  351. if (areq->priv)
  352. return;
  353. areq->base.complete(&areq->base, err);
  354. }
  355. static int ahash_def_finup(struct ahash_request *req)
  356. {
  357. struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
  358. int err;
  359. err = ahash_save_req(req, ahash_def_finup_done1);
  360. if (err)
  361. return err;
  362. err = tfm->update(req);
  363. if (err == -EINPROGRESS || err == -EBUSY)
  364. return err;
  365. return ahash_def_finup_finish1(req, err);
  366. }
  367. static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
  368. {
  369. struct crypto_ahash *hash = __crypto_ahash_cast(tfm);
  370. struct ahash_alg *alg = crypto_ahash_alg(hash);
  371. hash->setkey = ahash_nosetkey;
  372. if (tfm->__crt_alg->cra_type != &crypto_ahash_type)
  373. return crypto_init_shash_ops_async(tfm);
  374. hash->init = alg->init;
  375. hash->update = alg->update;
  376. hash->final = alg->final;
  377. hash->finup = alg->finup ?: ahash_def_finup;
  378. hash->digest = alg->digest;
  379. hash->export = alg->export;
  380. hash->import = alg->import;
  381. if (alg->setkey) {
  382. hash->setkey = alg->setkey;
  383. ahash_set_needkey(hash);
  384. }
  385. return 0;
  386. }
  387. static unsigned int crypto_ahash_extsize(struct crypto_alg *alg)
  388. {
  389. if (alg->cra_type != &crypto_ahash_type)
  390. return sizeof(struct crypto_shash *);
  391. return crypto_alg_extsize(alg);
  392. }
  393. #ifdef CONFIG_NET
  394. static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg)
  395. {
  396. struct crypto_report_hash rhash;
  397. strncpy(rhash.type, "ahash", sizeof(rhash.type));
  398. rhash.blocksize = alg->cra_blocksize;
  399. rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize;
  400. if (nla_put(skb, CRYPTOCFGA_REPORT_HASH,
  401. sizeof(struct crypto_report_hash), &rhash))
  402. goto nla_put_failure;
  403. return 0;
  404. nla_put_failure:
  405. return -EMSGSIZE;
  406. }
  407. #else
  408. static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg)
  409. {
  410. return -ENOSYS;
  411. }
  412. #endif
  413. static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
  414. __maybe_unused;
  415. static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
  416. {
  417. seq_printf(m, "type : ahash\n");
  418. seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ?
  419. "yes" : "no");
  420. seq_printf(m, "blocksize : %u\n", alg->cra_blocksize);
  421. seq_printf(m, "digestsize : %u\n",
  422. __crypto_hash_alg_common(alg)->digestsize);
  423. }
  424. const struct crypto_type crypto_ahash_type = {
  425. .extsize = crypto_ahash_extsize,
  426. .init_tfm = crypto_ahash_init_tfm,
  427. #ifdef CONFIG_PROC_FS
  428. .show = crypto_ahash_show,
  429. #endif
  430. .report = crypto_ahash_report,
  431. .maskclear = ~CRYPTO_ALG_TYPE_MASK,
  432. .maskset = CRYPTO_ALG_TYPE_AHASH_MASK,
  433. .type = CRYPTO_ALG_TYPE_AHASH,
  434. .tfmsize = offsetof(struct crypto_ahash, base),
  435. };
  436. EXPORT_SYMBOL_GPL(crypto_ahash_type);
  437. struct crypto_ahash *crypto_alloc_ahash(const char *alg_name, u32 type,
  438. u32 mask)
  439. {
  440. return crypto_alloc_tfm(alg_name, &crypto_ahash_type, type, mask);
  441. }
  442. EXPORT_SYMBOL_GPL(crypto_alloc_ahash);
  443. int crypto_has_ahash(const char *alg_name, u32 type, u32 mask)
  444. {
  445. return crypto_type_has_alg(alg_name, &crypto_ahash_type, type, mask);
  446. }
  447. EXPORT_SYMBOL_GPL(crypto_has_ahash);
  448. static int ahash_prepare_alg(struct ahash_alg *alg)
  449. {
  450. struct crypto_alg *base = &alg->halg.base;
  451. if (alg->halg.digestsize > PAGE_SIZE / 8 ||
  452. alg->halg.statesize > PAGE_SIZE / 8 ||
  453. alg->halg.statesize == 0)
  454. return -EINVAL;
  455. base->cra_type = &crypto_ahash_type;
  456. base->cra_flags &= ~CRYPTO_ALG_TYPE_MASK;
  457. base->cra_flags |= CRYPTO_ALG_TYPE_AHASH;
  458. return 0;
  459. }
  460. int crypto_register_ahash(struct ahash_alg *alg)
  461. {
  462. struct crypto_alg *base = &alg->halg.base;
  463. int err;
  464. err = ahash_prepare_alg(alg);
  465. if (err)
  466. return err;
  467. return crypto_register_alg(base);
  468. }
  469. EXPORT_SYMBOL_GPL(crypto_register_ahash);
  470. int crypto_unregister_ahash(struct ahash_alg *alg)
  471. {
  472. return crypto_unregister_alg(&alg->halg.base);
  473. }
  474. EXPORT_SYMBOL_GPL(crypto_unregister_ahash);
  475. int crypto_register_ahashes(struct ahash_alg *algs, int count)
  476. {
  477. int i, ret;
  478. for (i = 0; i < count; i++) {
  479. ret = crypto_register_ahash(&algs[i]);
  480. if (ret)
  481. goto err;
  482. }
  483. return 0;
  484. err:
  485. for (--i; i >= 0; --i)
  486. crypto_unregister_ahash(&algs[i]);
  487. return ret;
  488. }
  489. EXPORT_SYMBOL_GPL(crypto_register_ahashes);
  490. void crypto_unregister_ahashes(struct ahash_alg *algs, int count)
  491. {
  492. int i;
  493. for (i = count - 1; i >= 0; --i)
  494. crypto_unregister_ahash(&algs[i]);
  495. }
  496. EXPORT_SYMBOL_GPL(crypto_unregister_ahashes);
  497. int ahash_register_instance(struct crypto_template *tmpl,
  498. struct ahash_instance *inst)
  499. {
  500. int err;
  501. err = ahash_prepare_alg(&inst->alg);
  502. if (err)
  503. return err;
  504. return crypto_register_instance(tmpl, ahash_crypto_instance(inst));
  505. }
  506. EXPORT_SYMBOL_GPL(ahash_register_instance);
  507. void ahash_free_instance(struct crypto_instance *inst)
  508. {
  509. crypto_drop_spawn(crypto_instance_ctx(inst));
  510. kfree(ahash_instance(inst));
  511. }
  512. EXPORT_SYMBOL_GPL(ahash_free_instance);
  513. int crypto_init_ahash_spawn(struct crypto_ahash_spawn *spawn,
  514. struct hash_alg_common *alg,
  515. struct crypto_instance *inst)
  516. {
  517. return crypto_init_spawn2(&spawn->base, &alg->base, inst,
  518. &crypto_ahash_type);
  519. }
  520. EXPORT_SYMBOL_GPL(crypto_init_ahash_spawn);
  521. struct hash_alg_common *ahash_attr_alg(struct rtattr *rta, u32 type, u32 mask)
  522. {
  523. struct crypto_alg *alg;
  524. alg = crypto_attr_alg2(rta, &crypto_ahash_type, type, mask);
  525. return IS_ERR(alg) ? ERR_CAST(alg) : __crypto_hash_alg_common(alg);
  526. }
  527. EXPORT_SYMBOL_GPL(ahash_attr_alg);
  528. bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg)
  529. {
  530. struct crypto_alg *alg = &halg->base;
  531. if (alg->cra_type != &crypto_ahash_type)
  532. return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg));
  533. return __crypto_ahash_alg(alg)->setkey != NULL;
  534. }
  535. EXPORT_SYMBOL_GPL(crypto_hash_alg_has_setkey);
  536. MODULE_LICENSE("GPL");
  537. MODULE_DESCRIPTION("Asynchronous cryptographic hash type");