padlock-sha.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. /*
  2. * Cryptographic API.
  3. *
  4. * Support for VIA PadLock hardware crypto engine.
  5. *
  6. * Copyright (c) 2006 Michal Ludvig <michal@logix.cz>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. */
  14. #include <crypto/internal/hash.h>
  15. #include <crypto/padlock.h>
  16. #include <crypto/sha.h>
  17. #include <linux/err.h>
  18. #include <linux/module.h>
  19. #include <linux/init.h>
  20. #include <linux/errno.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/kernel.h>
  23. #include <linux/scatterlist.h>
  24. #include <asm/cpu_device_id.h>
  25. #include <asm/fpu/api.h>
  26. struct padlock_sha_desc {
  27. struct shash_desc fallback;
  28. };
  29. struct padlock_sha_ctx {
  30. struct crypto_shash *fallback;
  31. };
  32. static int padlock_sha_init(struct shash_desc *desc)
  33. {
  34. struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  35. struct padlock_sha_ctx *ctx = crypto_shash_ctx(desc->tfm);
  36. dctx->fallback.tfm = ctx->fallback;
  37. dctx->fallback.flags = desc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
  38. return crypto_shash_init(&dctx->fallback);
  39. }
  40. static int padlock_sha_update(struct shash_desc *desc,
  41. const u8 *data, unsigned int length)
  42. {
  43. struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  44. dctx->fallback.flags = desc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
  45. return crypto_shash_update(&dctx->fallback, data, length);
  46. }
  47. static int padlock_sha_export(struct shash_desc *desc, void *out)
  48. {
  49. struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  50. return crypto_shash_export(&dctx->fallback, out);
  51. }
  52. static int padlock_sha_import(struct shash_desc *desc, const void *in)
  53. {
  54. struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  55. struct padlock_sha_ctx *ctx = crypto_shash_ctx(desc->tfm);
  56. dctx->fallback.tfm = ctx->fallback;
  57. dctx->fallback.flags = desc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
  58. return crypto_shash_import(&dctx->fallback, in);
  59. }
  60. static inline void padlock_output_block(uint32_t *src,
  61. uint32_t *dst, size_t count)
  62. {
  63. while (count--)
  64. *dst++ = swab32(*src++);
  65. }
  66. static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in,
  67. unsigned int count, u8 *out)
  68. {
  69. /* We can't store directly to *out as it may be unaligned. */
  70. /* BTW Don't reduce the buffer size below 128 Bytes!
  71. * PadLock microcode needs it that big. */
  72. char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__
  73. ((aligned(STACK_ALIGN)));
  74. char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
  75. struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  76. struct sha1_state state;
  77. unsigned int space;
  78. unsigned int leftover;
  79. int ts_state;
  80. int err;
  81. dctx->fallback.flags = desc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
  82. err = crypto_shash_export(&dctx->fallback, &state);
  83. if (err)
  84. goto out;
  85. if (state.count + count > ULONG_MAX)
  86. return crypto_shash_finup(&dctx->fallback, in, count, out);
  87. leftover = ((state.count - 1) & (SHA1_BLOCK_SIZE - 1)) + 1;
  88. space = SHA1_BLOCK_SIZE - leftover;
  89. if (space) {
  90. if (count > space) {
  91. err = crypto_shash_update(&dctx->fallback, in, space) ?:
  92. crypto_shash_export(&dctx->fallback, &state);
  93. if (err)
  94. goto out;
  95. count -= space;
  96. in += space;
  97. } else {
  98. memcpy(state.buffer + leftover, in, count);
  99. in = state.buffer;
  100. count += leftover;
  101. state.count &= ~(SHA1_BLOCK_SIZE - 1);
  102. }
  103. }
  104. memcpy(result, &state.state, SHA1_DIGEST_SIZE);
  105. /* prevent taking the spurious DNA fault with padlock. */
  106. ts_state = irq_ts_save();
  107. asm volatile (".byte 0xf3,0x0f,0xa6,0xc8" /* rep xsha1 */
  108. : \
  109. : "c"((unsigned long)state.count + count), \
  110. "a"((unsigned long)state.count), \
  111. "S"(in), "D"(result));
  112. irq_ts_restore(ts_state);
  113. padlock_output_block((uint32_t *)result, (uint32_t *)out, 5);
  114. out:
  115. return err;
  116. }
  117. static int padlock_sha1_final(struct shash_desc *desc, u8 *out)
  118. {
  119. u8 buf[4];
  120. return padlock_sha1_finup(desc, buf, 0, out);
  121. }
  122. static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in,
  123. unsigned int count, u8 *out)
  124. {
  125. /* We can't store directly to *out as it may be unaligned. */
  126. /* BTW Don't reduce the buffer size below 128 Bytes!
  127. * PadLock microcode needs it that big. */
  128. char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__
  129. ((aligned(STACK_ALIGN)));
  130. char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
  131. struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  132. struct sha256_state state;
  133. unsigned int space;
  134. unsigned int leftover;
  135. int ts_state;
  136. int err;
  137. dctx->fallback.flags = desc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
  138. err = crypto_shash_export(&dctx->fallback, &state);
  139. if (err)
  140. goto out;
  141. if (state.count + count > ULONG_MAX)
  142. return crypto_shash_finup(&dctx->fallback, in, count, out);
  143. leftover = ((state.count - 1) & (SHA256_BLOCK_SIZE - 1)) + 1;
  144. space = SHA256_BLOCK_SIZE - leftover;
  145. if (space) {
  146. if (count > space) {
  147. err = crypto_shash_update(&dctx->fallback, in, space) ?:
  148. crypto_shash_export(&dctx->fallback, &state);
  149. if (err)
  150. goto out;
  151. count -= space;
  152. in += space;
  153. } else {
  154. memcpy(state.buf + leftover, in, count);
  155. in = state.buf;
  156. count += leftover;
  157. state.count &= ~(SHA1_BLOCK_SIZE - 1);
  158. }
  159. }
  160. memcpy(result, &state.state, SHA256_DIGEST_SIZE);
  161. /* prevent taking the spurious DNA fault with padlock. */
  162. ts_state = irq_ts_save();
  163. asm volatile (".byte 0xf3,0x0f,0xa6,0xd0" /* rep xsha256 */
  164. : \
  165. : "c"((unsigned long)state.count + count), \
  166. "a"((unsigned long)state.count), \
  167. "S"(in), "D"(result));
  168. irq_ts_restore(ts_state);
  169. padlock_output_block((uint32_t *)result, (uint32_t *)out, 8);
  170. out:
  171. return err;
  172. }
  173. static int padlock_sha256_final(struct shash_desc *desc, u8 *out)
  174. {
  175. u8 buf[4];
  176. return padlock_sha256_finup(desc, buf, 0, out);
  177. }
  178. static int padlock_cra_init(struct crypto_tfm *tfm)
  179. {
  180. struct crypto_shash *hash = __crypto_shash_cast(tfm);
  181. const char *fallback_driver_name = crypto_tfm_alg_name(tfm);
  182. struct padlock_sha_ctx *ctx = crypto_tfm_ctx(tfm);
  183. struct crypto_shash *fallback_tfm;
  184. int err = -ENOMEM;
  185. /* Allocate a fallback and abort if it failed. */
  186. fallback_tfm = crypto_alloc_shash(fallback_driver_name, 0,
  187. CRYPTO_ALG_NEED_FALLBACK);
  188. if (IS_ERR(fallback_tfm)) {
  189. printk(KERN_WARNING PFX "Fallback driver '%s' could not be loaded!\n",
  190. fallback_driver_name);
  191. err = PTR_ERR(fallback_tfm);
  192. goto out;
  193. }
  194. ctx->fallback = fallback_tfm;
  195. hash->descsize += crypto_shash_descsize(fallback_tfm);
  196. return 0;
  197. out:
  198. return err;
  199. }
  200. static void padlock_cra_exit(struct crypto_tfm *tfm)
  201. {
  202. struct padlock_sha_ctx *ctx = crypto_tfm_ctx(tfm);
  203. crypto_free_shash(ctx->fallback);
  204. }
  205. static struct shash_alg sha1_alg = {
  206. .digestsize = SHA1_DIGEST_SIZE,
  207. .init = padlock_sha_init,
  208. .update = padlock_sha_update,
  209. .finup = padlock_sha1_finup,
  210. .final = padlock_sha1_final,
  211. .export = padlock_sha_export,
  212. .import = padlock_sha_import,
  213. .descsize = sizeof(struct padlock_sha_desc),
  214. .statesize = sizeof(struct sha1_state),
  215. .base = {
  216. .cra_name = "sha1",
  217. .cra_driver_name = "sha1-padlock",
  218. .cra_priority = PADLOCK_CRA_PRIORITY,
  219. .cra_flags = CRYPTO_ALG_TYPE_SHASH |
  220. CRYPTO_ALG_NEED_FALLBACK,
  221. .cra_blocksize = SHA1_BLOCK_SIZE,
  222. .cra_ctxsize = sizeof(struct padlock_sha_ctx),
  223. .cra_module = THIS_MODULE,
  224. .cra_init = padlock_cra_init,
  225. .cra_exit = padlock_cra_exit,
  226. }
  227. };
  228. static struct shash_alg sha256_alg = {
  229. .digestsize = SHA256_DIGEST_SIZE,
  230. .init = padlock_sha_init,
  231. .update = padlock_sha_update,
  232. .finup = padlock_sha256_finup,
  233. .final = padlock_sha256_final,
  234. .export = padlock_sha_export,
  235. .import = padlock_sha_import,
  236. .descsize = sizeof(struct padlock_sha_desc),
  237. .statesize = sizeof(struct sha256_state),
  238. .base = {
  239. .cra_name = "sha256",
  240. .cra_driver_name = "sha256-padlock",
  241. .cra_priority = PADLOCK_CRA_PRIORITY,
  242. .cra_flags = CRYPTO_ALG_TYPE_SHASH |
  243. CRYPTO_ALG_NEED_FALLBACK,
  244. .cra_blocksize = SHA256_BLOCK_SIZE,
  245. .cra_ctxsize = sizeof(struct padlock_sha_ctx),
  246. .cra_module = THIS_MODULE,
  247. .cra_init = padlock_cra_init,
  248. .cra_exit = padlock_cra_exit,
  249. }
  250. };
  251. /* Add two shash_alg instance for hardware-implemented *
  252. * multiple-parts hash supported by VIA Nano Processor.*/
  253. static int padlock_sha1_init_nano(struct shash_desc *desc)
  254. {
  255. struct sha1_state *sctx = shash_desc_ctx(desc);
  256. *sctx = (struct sha1_state){
  257. .state = { SHA1_H0, SHA1_H1, SHA1_H2, SHA1_H3, SHA1_H4 },
  258. };
  259. return 0;
  260. }
  261. static int padlock_sha1_update_nano(struct shash_desc *desc,
  262. const u8 *data, unsigned int len)
  263. {
  264. struct sha1_state *sctx = shash_desc_ctx(desc);
  265. unsigned int partial, done;
  266. const u8 *src;
  267. /*The PHE require the out buffer must 128 bytes and 16-bytes aligned*/
  268. u8 buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__
  269. ((aligned(STACK_ALIGN)));
  270. u8 *dst = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
  271. int ts_state;
  272. partial = sctx->count & 0x3f;
  273. sctx->count += len;
  274. done = 0;
  275. src = data;
  276. memcpy(dst, (u8 *)(sctx->state), SHA1_DIGEST_SIZE);
  277. if ((partial + len) >= SHA1_BLOCK_SIZE) {
  278. /* Append the bytes in state's buffer to a block to handle */
  279. if (partial) {
  280. done = -partial;
  281. memcpy(sctx->buffer + partial, data,
  282. done + SHA1_BLOCK_SIZE);
  283. src = sctx->buffer;
  284. ts_state = irq_ts_save();
  285. asm volatile (".byte 0xf3,0x0f,0xa6,0xc8"
  286. : "+S"(src), "+D"(dst) \
  287. : "a"((long)-1), "c"((unsigned long)1));
  288. irq_ts_restore(ts_state);
  289. done += SHA1_BLOCK_SIZE;
  290. src = data + done;
  291. }
  292. /* Process the left bytes from the input data */
  293. if (len - done >= SHA1_BLOCK_SIZE) {
  294. ts_state = irq_ts_save();
  295. asm volatile (".byte 0xf3,0x0f,0xa6,0xc8"
  296. : "+S"(src), "+D"(dst)
  297. : "a"((long)-1),
  298. "c"((unsigned long)((len - done) / SHA1_BLOCK_SIZE)));
  299. irq_ts_restore(ts_state);
  300. done += ((len - done) - (len - done) % SHA1_BLOCK_SIZE);
  301. src = data + done;
  302. }
  303. partial = 0;
  304. }
  305. memcpy((u8 *)(sctx->state), dst, SHA1_DIGEST_SIZE);
  306. memcpy(sctx->buffer + partial, src, len - done);
  307. return 0;
  308. }
  309. static int padlock_sha1_final_nano(struct shash_desc *desc, u8 *out)
  310. {
  311. struct sha1_state *state = (struct sha1_state *)shash_desc_ctx(desc);
  312. unsigned int partial, padlen;
  313. __be64 bits;
  314. static const u8 padding[64] = { 0x80, };
  315. bits = cpu_to_be64(state->count << 3);
  316. /* Pad out to 56 mod 64 */
  317. partial = state->count & 0x3f;
  318. padlen = (partial < 56) ? (56 - partial) : ((64+56) - partial);
  319. padlock_sha1_update_nano(desc, padding, padlen);
  320. /* Append length field bytes */
  321. padlock_sha1_update_nano(desc, (const u8 *)&bits, sizeof(bits));
  322. /* Swap to output */
  323. padlock_output_block((uint32_t *)(state->state), (uint32_t *)out, 5);
  324. return 0;
  325. }
  326. static int padlock_sha256_init_nano(struct shash_desc *desc)
  327. {
  328. struct sha256_state *sctx = shash_desc_ctx(desc);
  329. *sctx = (struct sha256_state){
  330. .state = { SHA256_H0, SHA256_H1, SHA256_H2, SHA256_H3, \
  331. SHA256_H4, SHA256_H5, SHA256_H6, SHA256_H7},
  332. };
  333. return 0;
  334. }
  335. static int padlock_sha256_update_nano(struct shash_desc *desc, const u8 *data,
  336. unsigned int len)
  337. {
  338. struct sha256_state *sctx = shash_desc_ctx(desc);
  339. unsigned int partial, done;
  340. const u8 *src;
  341. /*The PHE require the out buffer must 128 bytes and 16-bytes aligned*/
  342. u8 buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__
  343. ((aligned(STACK_ALIGN)));
  344. u8 *dst = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
  345. int ts_state;
  346. partial = sctx->count & 0x3f;
  347. sctx->count += len;
  348. done = 0;
  349. src = data;
  350. memcpy(dst, (u8 *)(sctx->state), SHA256_DIGEST_SIZE);
  351. if ((partial + len) >= SHA256_BLOCK_SIZE) {
  352. /* Append the bytes in state's buffer to a block to handle */
  353. if (partial) {
  354. done = -partial;
  355. memcpy(sctx->buf + partial, data,
  356. done + SHA256_BLOCK_SIZE);
  357. src = sctx->buf;
  358. ts_state = irq_ts_save();
  359. asm volatile (".byte 0xf3,0x0f,0xa6,0xd0"
  360. : "+S"(src), "+D"(dst)
  361. : "a"((long)-1), "c"((unsigned long)1));
  362. irq_ts_restore(ts_state);
  363. done += SHA256_BLOCK_SIZE;
  364. src = data + done;
  365. }
  366. /* Process the left bytes from input data*/
  367. if (len - done >= SHA256_BLOCK_SIZE) {
  368. ts_state = irq_ts_save();
  369. asm volatile (".byte 0xf3,0x0f,0xa6,0xd0"
  370. : "+S"(src), "+D"(dst)
  371. : "a"((long)-1),
  372. "c"((unsigned long)((len - done) / 64)));
  373. irq_ts_restore(ts_state);
  374. done += ((len - done) - (len - done) % 64);
  375. src = data + done;
  376. }
  377. partial = 0;
  378. }
  379. memcpy((u8 *)(sctx->state), dst, SHA256_DIGEST_SIZE);
  380. memcpy(sctx->buf + partial, src, len - done);
  381. return 0;
  382. }
  383. static int padlock_sha256_final_nano(struct shash_desc *desc, u8 *out)
  384. {
  385. struct sha256_state *state =
  386. (struct sha256_state *)shash_desc_ctx(desc);
  387. unsigned int partial, padlen;
  388. __be64 bits;
  389. static const u8 padding[64] = { 0x80, };
  390. bits = cpu_to_be64(state->count << 3);
  391. /* Pad out to 56 mod 64 */
  392. partial = state->count & 0x3f;
  393. padlen = (partial < 56) ? (56 - partial) : ((64+56) - partial);
  394. padlock_sha256_update_nano(desc, padding, padlen);
  395. /* Append length field bytes */
  396. padlock_sha256_update_nano(desc, (const u8 *)&bits, sizeof(bits));
  397. /* Swap to output */
  398. padlock_output_block((uint32_t *)(state->state), (uint32_t *)out, 8);
  399. return 0;
  400. }
  401. static int padlock_sha_export_nano(struct shash_desc *desc,
  402. void *out)
  403. {
  404. int statesize = crypto_shash_statesize(desc->tfm);
  405. void *sctx = shash_desc_ctx(desc);
  406. memcpy(out, sctx, statesize);
  407. return 0;
  408. }
  409. static int padlock_sha_import_nano(struct shash_desc *desc,
  410. const void *in)
  411. {
  412. int statesize = crypto_shash_statesize(desc->tfm);
  413. void *sctx = shash_desc_ctx(desc);
  414. memcpy(sctx, in, statesize);
  415. return 0;
  416. }
  417. static struct shash_alg sha1_alg_nano = {
  418. .digestsize = SHA1_DIGEST_SIZE,
  419. .init = padlock_sha1_init_nano,
  420. .update = padlock_sha1_update_nano,
  421. .final = padlock_sha1_final_nano,
  422. .export = padlock_sha_export_nano,
  423. .import = padlock_sha_import_nano,
  424. .descsize = sizeof(struct sha1_state),
  425. .statesize = sizeof(struct sha1_state),
  426. .base = {
  427. .cra_name = "sha1",
  428. .cra_driver_name = "sha1-padlock-nano",
  429. .cra_priority = PADLOCK_CRA_PRIORITY,
  430. .cra_flags = CRYPTO_ALG_TYPE_SHASH,
  431. .cra_blocksize = SHA1_BLOCK_SIZE,
  432. .cra_module = THIS_MODULE,
  433. }
  434. };
  435. static struct shash_alg sha256_alg_nano = {
  436. .digestsize = SHA256_DIGEST_SIZE,
  437. .init = padlock_sha256_init_nano,
  438. .update = padlock_sha256_update_nano,
  439. .final = padlock_sha256_final_nano,
  440. .export = padlock_sha_export_nano,
  441. .import = padlock_sha_import_nano,
  442. .descsize = sizeof(struct sha256_state),
  443. .statesize = sizeof(struct sha256_state),
  444. .base = {
  445. .cra_name = "sha256",
  446. .cra_driver_name = "sha256-padlock-nano",
  447. .cra_priority = PADLOCK_CRA_PRIORITY,
  448. .cra_flags = CRYPTO_ALG_TYPE_SHASH,
  449. .cra_blocksize = SHA256_BLOCK_SIZE,
  450. .cra_module = THIS_MODULE,
  451. }
  452. };
  453. static struct x86_cpu_id padlock_sha_ids[] = {
  454. X86_FEATURE_MATCH(X86_FEATURE_PHE),
  455. {}
  456. };
  457. MODULE_DEVICE_TABLE(x86cpu, padlock_sha_ids);
  458. static int __init padlock_init(void)
  459. {
  460. int rc = -ENODEV;
  461. struct cpuinfo_x86 *c = &cpu_data(0);
  462. struct shash_alg *sha1;
  463. struct shash_alg *sha256;
  464. if (!x86_match_cpu(padlock_sha_ids) || !boot_cpu_has(X86_FEATURE_PHE_EN))
  465. return -ENODEV;
  466. /* Register the newly added algorithm module if on *
  467. * VIA Nano processor, or else just do as before */
  468. if (c->x86_model < 0x0f) {
  469. sha1 = &sha1_alg;
  470. sha256 = &sha256_alg;
  471. } else {
  472. sha1 = &sha1_alg_nano;
  473. sha256 = &sha256_alg_nano;
  474. }
  475. rc = crypto_register_shash(sha1);
  476. if (rc)
  477. goto out;
  478. rc = crypto_register_shash(sha256);
  479. if (rc)
  480. goto out_unreg1;
  481. printk(KERN_NOTICE PFX "Using VIA PadLock ACE for SHA1/SHA256 algorithms.\n");
  482. return 0;
  483. out_unreg1:
  484. crypto_unregister_shash(sha1);
  485. out:
  486. printk(KERN_ERR PFX "VIA PadLock SHA1/SHA256 initialization failed.\n");
  487. return rc;
  488. }
  489. static void __exit padlock_fini(void)
  490. {
  491. struct cpuinfo_x86 *c = &cpu_data(0);
  492. if (c->x86_model >= 0x0f) {
  493. crypto_unregister_shash(&sha1_alg_nano);
  494. crypto_unregister_shash(&sha256_alg_nano);
  495. } else {
  496. crypto_unregister_shash(&sha1_alg);
  497. crypto_unregister_shash(&sha256_alg);
  498. }
  499. }
  500. module_init(padlock_init);
  501. module_exit(padlock_fini);
  502. MODULE_DESCRIPTION("VIA PadLock SHA1/SHA256 algorithms support.");
  503. MODULE_LICENSE("GPL");
  504. MODULE_AUTHOR("Michal Ludvig");
  505. MODULE_ALIAS_CRYPTO("sha1-all");
  506. MODULE_ALIAS_CRYPTO("sha256-all");
  507. MODULE_ALIAS_CRYPTO("sha1-padlock");
  508. MODULE_ALIAS_CRYPTO("sha256-padlock");