padlock-aes.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /*
  2. * Cryptographic API.
  3. *
  4. * Support for VIA PadLock hardware crypto engine.
  5. *
  6. * Copyright (c) 2004 Michal Ludvig <michal@logix.cz>
  7. *
  8. * Key expansion routine taken from crypto/aes.c
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * ---------------------------------------------------------------------------
  16. * Copyright (c) 2002, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
  17. * All rights reserved.
  18. *
  19. * LICENSE TERMS
  20. *
  21. * The free distribution and use of this software in both source and binary
  22. * form is allowed (with or without changes) provided that:
  23. *
  24. * 1. distributions of this source code include the above copyright
  25. * notice, this list of conditions and the following disclaimer;
  26. *
  27. * 2. distributions in binary form include the above copyright
  28. * notice, this list of conditions and the following disclaimer
  29. * in the documentation and/or other associated materials;
  30. *
  31. * 3. the copyright holder's name is not used to endorse products
  32. * built using this software without specific written permission.
  33. *
  34. * ALTERNATIVELY, provided that this notice is retained in full, this product
  35. * may be distributed under the terms of the GNU General Public License (GPL),
  36. * in which case the provisions of the GPL apply INSTEAD OF those given above.
  37. *
  38. * DISCLAIMER
  39. *
  40. * This software is provided 'as is' with no explicit or implied warranties
  41. * in respect of its properties, including, but not limited to, correctness
  42. * and/or fitness for purpose.
  43. * ---------------------------------------------------------------------------
  44. */
  45. #include <linux/module.h>
  46. #include <linux/init.h>
  47. #include <linux/types.h>
  48. #include <linux/errno.h>
  49. #include <linux/crypto.h>
  50. #include <linux/interrupt.h>
  51. #include <linux/kernel.h>
  52. #include <asm/byteorder.h>
  53. #include "padlock.h"
  54. #define AES_MIN_KEY_SIZE 16 /* in uint8_t units */
  55. #define AES_MAX_KEY_SIZE 32 /* ditto */
  56. #define AES_BLOCK_SIZE 16 /* ditto */
  57. #define AES_EXTENDED_KEY_SIZE 64 /* in uint32_t units */
  58. #define AES_EXTENDED_KEY_SIZE_B (AES_EXTENDED_KEY_SIZE * sizeof(uint32_t))
  59. /* Control word. */
  60. struct cword {
  61. unsigned int __attribute__ ((__packed__))
  62. rounds:4,
  63. algo:3,
  64. keygen:1,
  65. interm:1,
  66. encdec:1,
  67. ksize:2;
  68. } __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
  69. /* Whenever making any changes to the following
  70. * structure *make sure* you keep E, d_data
  71. * and cword aligned on 16 Bytes boundaries!!! */
  72. struct aes_ctx {
  73. struct {
  74. struct cword encrypt;
  75. struct cword decrypt;
  76. } cword;
  77. u32 *D;
  78. int key_length;
  79. u32 E[AES_EXTENDED_KEY_SIZE]
  80. __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
  81. u32 d_data[AES_EXTENDED_KEY_SIZE]
  82. __attribute__ ((__aligned__(PADLOCK_ALIGNMENT)));
  83. };
  84. /* ====== Key management routines ====== */
  85. static inline uint32_t
  86. generic_rotr32 (const uint32_t x, const unsigned bits)
  87. {
  88. const unsigned n = bits % 32;
  89. return (x >> n) | (x << (32 - n));
  90. }
  91. static inline uint32_t
  92. generic_rotl32 (const uint32_t x, const unsigned bits)
  93. {
  94. const unsigned n = bits % 32;
  95. return (x << n) | (x >> (32 - n));
  96. }
  97. #define rotl generic_rotl32
  98. #define rotr generic_rotr32
  99. /*
  100. * #define byte(x, nr) ((unsigned char)((x) >> (nr*8)))
  101. */
  102. static inline uint8_t
  103. byte(const uint32_t x, const unsigned n)
  104. {
  105. return x >> (n << 3);
  106. }
  107. #define E_KEY ctx->E
  108. #define D_KEY ctx->D
  109. static uint8_t pow_tab[256];
  110. static uint8_t log_tab[256];
  111. static uint8_t sbx_tab[256];
  112. static uint8_t isb_tab[256];
  113. static uint32_t rco_tab[10];
  114. static uint32_t ft_tab[4][256];
  115. static uint32_t it_tab[4][256];
  116. static uint32_t fl_tab[4][256];
  117. static uint32_t il_tab[4][256];
  118. static inline uint8_t
  119. f_mult (uint8_t a, uint8_t b)
  120. {
  121. uint8_t aa = log_tab[a], cc = aa + log_tab[b];
  122. return pow_tab[cc + (cc < aa ? 1 : 0)];
  123. }
  124. #define ff_mult(a,b) (a && b ? f_mult(a, b) : 0)
  125. #define f_rn(bo, bi, n, k) \
  126. bo[n] = ft_tab[0][byte(bi[n],0)] ^ \
  127. ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
  128. ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
  129. ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
  130. #define i_rn(bo, bi, n, k) \
  131. bo[n] = it_tab[0][byte(bi[n],0)] ^ \
  132. it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
  133. it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
  134. it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
  135. #define ls_box(x) \
  136. ( fl_tab[0][byte(x, 0)] ^ \
  137. fl_tab[1][byte(x, 1)] ^ \
  138. fl_tab[2][byte(x, 2)] ^ \
  139. fl_tab[3][byte(x, 3)] )
  140. #define f_rl(bo, bi, n, k) \
  141. bo[n] = fl_tab[0][byte(bi[n],0)] ^ \
  142. fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
  143. fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
  144. fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
  145. #define i_rl(bo, bi, n, k) \
  146. bo[n] = il_tab[0][byte(bi[n],0)] ^ \
  147. il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
  148. il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
  149. il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
  150. static void
  151. gen_tabs (void)
  152. {
  153. uint32_t i, t;
  154. uint8_t p, q;
  155. /* log and power tables for GF(2**8) finite field with
  156. 0x011b as modular polynomial - the simplest prmitive
  157. root is 0x03, used here to generate the tables */
  158. for (i = 0, p = 1; i < 256; ++i) {
  159. pow_tab[i] = (uint8_t) p;
  160. log_tab[p] = (uint8_t) i;
  161. p ^= (p << 1) ^ (p & 0x80 ? 0x01b : 0);
  162. }
  163. log_tab[1] = 0;
  164. for (i = 0, p = 1; i < 10; ++i) {
  165. rco_tab[i] = p;
  166. p = (p << 1) ^ (p & 0x80 ? 0x01b : 0);
  167. }
  168. for (i = 0; i < 256; ++i) {
  169. p = (i ? pow_tab[255 - log_tab[i]] : 0);
  170. q = ((p >> 7) | (p << 1)) ^ ((p >> 6) | (p << 2));
  171. p ^= 0x63 ^ q ^ ((q >> 6) | (q << 2));
  172. sbx_tab[i] = p;
  173. isb_tab[p] = (uint8_t) i;
  174. }
  175. for (i = 0; i < 256; ++i) {
  176. p = sbx_tab[i];
  177. t = p;
  178. fl_tab[0][i] = t;
  179. fl_tab[1][i] = rotl (t, 8);
  180. fl_tab[2][i] = rotl (t, 16);
  181. fl_tab[3][i] = rotl (t, 24);
  182. t = ((uint32_t) ff_mult (2, p)) |
  183. ((uint32_t) p << 8) |
  184. ((uint32_t) p << 16) | ((uint32_t) ff_mult (3, p) << 24);
  185. ft_tab[0][i] = t;
  186. ft_tab[1][i] = rotl (t, 8);
  187. ft_tab[2][i] = rotl (t, 16);
  188. ft_tab[3][i] = rotl (t, 24);
  189. p = isb_tab[i];
  190. t = p;
  191. il_tab[0][i] = t;
  192. il_tab[1][i] = rotl (t, 8);
  193. il_tab[2][i] = rotl (t, 16);
  194. il_tab[3][i] = rotl (t, 24);
  195. t = ((uint32_t) ff_mult (14, p)) |
  196. ((uint32_t) ff_mult (9, p) << 8) |
  197. ((uint32_t) ff_mult (13, p) << 16) |
  198. ((uint32_t) ff_mult (11, p) << 24);
  199. it_tab[0][i] = t;
  200. it_tab[1][i] = rotl (t, 8);
  201. it_tab[2][i] = rotl (t, 16);
  202. it_tab[3][i] = rotl (t, 24);
  203. }
  204. }
  205. #define star_x(x) (((x) & 0x7f7f7f7f) << 1) ^ ((((x) & 0x80808080) >> 7) * 0x1b)
  206. #define imix_col(y,x) \
  207. u = star_x(x); \
  208. v = star_x(u); \
  209. w = star_x(v); \
  210. t = w ^ (x); \
  211. (y) = u ^ v ^ w; \
  212. (y) ^= rotr(u ^ t, 8) ^ \
  213. rotr(v ^ t, 16) ^ \
  214. rotr(t,24)
  215. /* initialise the key schedule from the user supplied key */
  216. #define loop4(i) \
  217. { t = rotr(t, 8); t = ls_box(t) ^ rco_tab[i]; \
  218. t ^= E_KEY[4 * i]; E_KEY[4 * i + 4] = t; \
  219. t ^= E_KEY[4 * i + 1]; E_KEY[4 * i + 5] = t; \
  220. t ^= E_KEY[4 * i + 2]; E_KEY[4 * i + 6] = t; \
  221. t ^= E_KEY[4 * i + 3]; E_KEY[4 * i + 7] = t; \
  222. }
  223. #define loop6(i) \
  224. { t = rotr(t, 8); t = ls_box(t) ^ rco_tab[i]; \
  225. t ^= E_KEY[6 * i]; E_KEY[6 * i + 6] = t; \
  226. t ^= E_KEY[6 * i + 1]; E_KEY[6 * i + 7] = t; \
  227. t ^= E_KEY[6 * i + 2]; E_KEY[6 * i + 8] = t; \
  228. t ^= E_KEY[6 * i + 3]; E_KEY[6 * i + 9] = t; \
  229. t ^= E_KEY[6 * i + 4]; E_KEY[6 * i + 10] = t; \
  230. t ^= E_KEY[6 * i + 5]; E_KEY[6 * i + 11] = t; \
  231. }
  232. #define loop8(i) \
  233. { t = rotr(t, 8); ; t = ls_box(t) ^ rco_tab[i]; \
  234. t ^= E_KEY[8 * i]; E_KEY[8 * i + 8] = t; \
  235. t ^= E_KEY[8 * i + 1]; E_KEY[8 * i + 9] = t; \
  236. t ^= E_KEY[8 * i + 2]; E_KEY[8 * i + 10] = t; \
  237. t ^= E_KEY[8 * i + 3]; E_KEY[8 * i + 11] = t; \
  238. t = E_KEY[8 * i + 4] ^ ls_box(t); \
  239. E_KEY[8 * i + 12] = t; \
  240. t ^= E_KEY[8 * i + 5]; E_KEY[8 * i + 13] = t; \
  241. t ^= E_KEY[8 * i + 6]; E_KEY[8 * i + 14] = t; \
  242. t ^= E_KEY[8 * i + 7]; E_KEY[8 * i + 15] = t; \
  243. }
  244. /* Tells whether the ACE is capable to generate
  245. the extended key for a given key_len. */
  246. static inline int
  247. aes_hw_extkey_available(uint8_t key_len)
  248. {
  249. /* TODO: We should check the actual CPU model/stepping
  250. as it's possible that the capability will be
  251. added in the next CPU revisions. */
  252. if (key_len == 16)
  253. return 1;
  254. return 0;
  255. }
  256. static inline struct aes_ctx *aes_ctx(struct crypto_tfm *tfm)
  257. {
  258. unsigned long addr = (unsigned long)crypto_tfm_ctx(tfm);
  259. unsigned long align = PADLOCK_ALIGNMENT;
  260. if (align <= crypto_tfm_ctx_alignment())
  261. align = 1;
  262. return (struct aes_ctx *)ALIGN(addr, align);
  263. }
  264. static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
  265. unsigned int key_len, u32 *flags)
  266. {
  267. struct aes_ctx *ctx = aes_ctx(tfm);
  268. const __le32 *key = (const __le32 *)in_key;
  269. uint32_t i, t, u, v, w;
  270. uint32_t P[AES_EXTENDED_KEY_SIZE];
  271. uint32_t rounds;
  272. if (key_len != 16 && key_len != 24 && key_len != 32) {
  273. *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
  274. return -EINVAL;
  275. }
  276. ctx->key_length = key_len;
  277. /*
  278. * If the hardware is capable of generating the extended key
  279. * itself we must supply the plain key for both encryption
  280. * and decryption.
  281. */
  282. ctx->D = ctx->E;
  283. E_KEY[0] = le32_to_cpu(key[0]);
  284. E_KEY[1] = le32_to_cpu(key[1]);
  285. E_KEY[2] = le32_to_cpu(key[2]);
  286. E_KEY[3] = le32_to_cpu(key[3]);
  287. /* Prepare control words. */
  288. memset(&ctx->cword, 0, sizeof(ctx->cword));
  289. ctx->cword.decrypt.encdec = 1;
  290. ctx->cword.encrypt.rounds = 10 + (key_len - 16) / 4;
  291. ctx->cword.decrypt.rounds = ctx->cword.encrypt.rounds;
  292. ctx->cword.encrypt.ksize = (key_len - 16) / 8;
  293. ctx->cword.decrypt.ksize = ctx->cword.encrypt.ksize;
  294. /* Don't generate extended keys if the hardware can do it. */
  295. if (aes_hw_extkey_available(key_len))
  296. return 0;
  297. ctx->D = ctx->d_data;
  298. ctx->cword.encrypt.keygen = 1;
  299. ctx->cword.decrypt.keygen = 1;
  300. switch (key_len) {
  301. case 16:
  302. t = E_KEY[3];
  303. for (i = 0; i < 10; ++i)
  304. loop4 (i);
  305. break;
  306. case 24:
  307. E_KEY[4] = le32_to_cpu(key[4]);
  308. t = E_KEY[5] = le32_to_cpu(key[5]);
  309. for (i = 0; i < 8; ++i)
  310. loop6 (i);
  311. break;
  312. case 32:
  313. E_KEY[4] = le32_to_cpu(key[4]);
  314. E_KEY[5] = le32_to_cpu(key[5]);
  315. E_KEY[6] = le32_to_cpu(key[6]);
  316. t = E_KEY[7] = le32_to_cpu(key[7]);
  317. for (i = 0; i < 7; ++i)
  318. loop8 (i);
  319. break;
  320. }
  321. D_KEY[0] = E_KEY[0];
  322. D_KEY[1] = E_KEY[1];
  323. D_KEY[2] = E_KEY[2];
  324. D_KEY[3] = E_KEY[3];
  325. for (i = 4; i < key_len + 24; ++i) {
  326. imix_col (D_KEY[i], E_KEY[i]);
  327. }
  328. /* PadLock needs a different format of the decryption key. */
  329. rounds = 10 + (key_len - 16) / 4;
  330. for (i = 0; i < rounds; i++) {
  331. P[((i + 1) * 4) + 0] = D_KEY[((rounds - i - 1) * 4) + 0];
  332. P[((i + 1) * 4) + 1] = D_KEY[((rounds - i - 1) * 4) + 1];
  333. P[((i + 1) * 4) + 2] = D_KEY[((rounds - i - 1) * 4) + 2];
  334. P[((i + 1) * 4) + 3] = D_KEY[((rounds - i - 1) * 4) + 3];
  335. }
  336. P[0] = E_KEY[(rounds * 4) + 0];
  337. P[1] = E_KEY[(rounds * 4) + 1];
  338. P[2] = E_KEY[(rounds * 4) + 2];
  339. P[3] = E_KEY[(rounds * 4) + 3];
  340. memcpy(D_KEY, P, AES_EXTENDED_KEY_SIZE_B);
  341. return 0;
  342. }
  343. /* ====== Encryption/decryption routines ====== */
  344. /* These are the real call to PadLock. */
  345. static inline void padlock_xcrypt_ecb(const u8 *input, u8 *output, void *key,
  346. void *control_word, u32 count)
  347. {
  348. asm volatile ("pushfl; popfl"); /* enforce key reload. */
  349. asm volatile (".byte 0xf3,0x0f,0xa7,0xc8" /* rep xcryptecb */
  350. : "+S"(input), "+D"(output)
  351. : "d"(control_word), "b"(key), "c"(count));
  352. }
  353. static inline u8 *padlock_xcrypt_cbc(const u8 *input, u8 *output, void *key,
  354. u8 *iv, void *control_word, u32 count)
  355. {
  356. /* Enforce key reload. */
  357. asm volatile ("pushfl; popfl");
  358. /* rep xcryptcbc */
  359. asm volatile (".byte 0xf3,0x0f,0xa7,0xd0"
  360. : "+S" (input), "+D" (output), "+a" (iv)
  361. : "d" (control_word), "b" (key), "c" (count));
  362. return iv;
  363. }
  364. static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
  365. {
  366. struct aes_ctx *ctx = aes_ctx(tfm);
  367. padlock_xcrypt_ecb(in, out, ctx->E, &ctx->cword.encrypt, 1);
  368. }
  369. static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
  370. {
  371. struct aes_ctx *ctx = aes_ctx(tfm);
  372. padlock_xcrypt_ecb(in, out, ctx->D, &ctx->cword.decrypt, 1);
  373. }
  374. static unsigned int aes_encrypt_ecb(const struct cipher_desc *desc, u8 *out,
  375. const u8 *in, unsigned int nbytes)
  376. {
  377. struct aes_ctx *ctx = aes_ctx(desc->tfm);
  378. padlock_xcrypt_ecb(in, out, ctx->E, &ctx->cword.encrypt,
  379. nbytes / AES_BLOCK_SIZE);
  380. return nbytes & ~(AES_BLOCK_SIZE - 1);
  381. }
  382. static unsigned int aes_decrypt_ecb(const struct cipher_desc *desc, u8 *out,
  383. const u8 *in, unsigned int nbytes)
  384. {
  385. struct aes_ctx *ctx = aes_ctx(desc->tfm);
  386. padlock_xcrypt_ecb(in, out, ctx->D, &ctx->cword.decrypt,
  387. nbytes / AES_BLOCK_SIZE);
  388. return nbytes & ~(AES_BLOCK_SIZE - 1);
  389. }
  390. static unsigned int aes_encrypt_cbc(const struct cipher_desc *desc, u8 *out,
  391. const u8 *in, unsigned int nbytes)
  392. {
  393. struct aes_ctx *ctx = aes_ctx(desc->tfm);
  394. u8 *iv;
  395. iv = padlock_xcrypt_cbc(in, out, ctx->E, desc->info,
  396. &ctx->cword.encrypt, nbytes / AES_BLOCK_SIZE);
  397. memcpy(desc->info, iv, AES_BLOCK_SIZE);
  398. return nbytes & ~(AES_BLOCK_SIZE - 1);
  399. }
  400. static unsigned int aes_decrypt_cbc(const struct cipher_desc *desc, u8 *out,
  401. const u8 *in, unsigned int nbytes)
  402. {
  403. struct aes_ctx *ctx = aes_ctx(desc->tfm);
  404. padlock_xcrypt_cbc(in, out, ctx->D, desc->info, &ctx->cword.decrypt,
  405. nbytes / AES_BLOCK_SIZE);
  406. return nbytes & ~(AES_BLOCK_SIZE - 1);
  407. }
  408. static struct crypto_alg aes_alg = {
  409. .cra_name = "aes",
  410. .cra_driver_name = "aes-padlock",
  411. .cra_priority = PADLOCK_CRA_PRIORITY,
  412. .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
  413. .cra_blocksize = AES_BLOCK_SIZE,
  414. .cra_ctxsize = sizeof(struct aes_ctx),
  415. .cra_alignmask = PADLOCK_ALIGNMENT - 1,
  416. .cra_module = THIS_MODULE,
  417. .cra_list = LIST_HEAD_INIT(aes_alg.cra_list),
  418. .cra_u = {
  419. .cipher = {
  420. .cia_min_keysize = AES_MIN_KEY_SIZE,
  421. .cia_max_keysize = AES_MAX_KEY_SIZE,
  422. .cia_setkey = aes_set_key,
  423. .cia_encrypt = aes_encrypt,
  424. .cia_decrypt = aes_decrypt,
  425. .cia_encrypt_ecb = aes_encrypt_ecb,
  426. .cia_decrypt_ecb = aes_decrypt_ecb,
  427. .cia_encrypt_cbc = aes_encrypt_cbc,
  428. .cia_decrypt_cbc = aes_decrypt_cbc,
  429. }
  430. }
  431. };
  432. static int __init padlock_init(void)
  433. {
  434. int ret;
  435. if (!cpu_has_xcrypt) {
  436. printk(KERN_ERR PFX "VIA PadLock not detected.\n");
  437. return -ENODEV;
  438. }
  439. if (!cpu_has_xcrypt_enabled) {
  440. printk(KERN_ERR PFX "VIA PadLock detected, but not enabled. Hmm, strange...\n");
  441. return -ENODEV;
  442. }
  443. gen_tabs();
  444. if ((ret = crypto_register_alg(&aes_alg))) {
  445. printk(KERN_ERR PFX "VIA PadLock AES initialization failed.\n");
  446. return ret;
  447. }
  448. printk(KERN_NOTICE PFX "Using VIA PadLock ACE for AES algorithm.\n");
  449. return ret;
  450. }
  451. static void __exit padlock_fini(void)
  452. {
  453. crypto_unregister_alg(&aes_alg);
  454. }
  455. module_init(padlock_init);
  456. module_exit(padlock_fini);
  457. MODULE_DESCRIPTION("VIA PadLock AES algorithm support");
  458. MODULE_LICENSE("GPL");
  459. MODULE_AUTHOR("Michal Ludvig");
  460. MODULE_ALIAS("aes-padlock");
  461. /* This module used to be called padlock. */
  462. MODULE_ALIAS("padlock");