crypt_s390.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. /*
  2. * Cryptographic API.
  3. *
  4. * Support for s390 cryptographic instructions.
  5. *
  6. * Copyright IBM Corp. 2003, 2015
  7. * Author(s): Thomas Spatzier
  8. * Jan Glauber (jan.glauber@de.ibm.com)
  9. * Harald Freudenberger (freude@de.ibm.com)
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the Free
  13. * Software Foundation; either version 2 of the License, or (at your option)
  14. * any later version.
  15. *
  16. */
  17. #ifndef _CRYPTO_ARCH_S390_CRYPT_S390_H
  18. #define _CRYPTO_ARCH_S390_CRYPT_S390_H
  19. #include <asm/errno.h>
  20. #include <asm/facility.h>
  21. #define CRYPT_S390_OP_MASK 0xFF00
  22. #define CRYPT_S390_FUNC_MASK 0x00FF
  23. #define CRYPT_S390_PRIORITY 300
  24. #define CRYPT_S390_COMPOSITE_PRIORITY 400
  25. #define CRYPT_S390_MSA 0x1
  26. #define CRYPT_S390_MSA3 0x2
  27. #define CRYPT_S390_MSA4 0x4
  28. #define CRYPT_S390_MSA5 0x8
  29. /* s390 cryptographic operations */
  30. enum crypt_s390_operations {
  31. CRYPT_S390_KM = 0x0100,
  32. CRYPT_S390_KMC = 0x0200,
  33. CRYPT_S390_KIMD = 0x0300,
  34. CRYPT_S390_KLMD = 0x0400,
  35. CRYPT_S390_KMAC = 0x0500,
  36. CRYPT_S390_KMCTR = 0x0600,
  37. CRYPT_S390_PPNO = 0x0700
  38. };
  39. /*
  40. * function codes for KM (CIPHER MESSAGE) instruction
  41. * 0x80 is the decipher modifier bit
  42. */
  43. enum crypt_s390_km_func {
  44. KM_QUERY = CRYPT_S390_KM | 0x0,
  45. KM_DEA_ENCRYPT = CRYPT_S390_KM | 0x1,
  46. KM_DEA_DECRYPT = CRYPT_S390_KM | 0x1 | 0x80,
  47. KM_TDEA_128_ENCRYPT = CRYPT_S390_KM | 0x2,
  48. KM_TDEA_128_DECRYPT = CRYPT_S390_KM | 0x2 | 0x80,
  49. KM_TDEA_192_ENCRYPT = CRYPT_S390_KM | 0x3,
  50. KM_TDEA_192_DECRYPT = CRYPT_S390_KM | 0x3 | 0x80,
  51. KM_AES_128_ENCRYPT = CRYPT_S390_KM | 0x12,
  52. KM_AES_128_DECRYPT = CRYPT_S390_KM | 0x12 | 0x80,
  53. KM_AES_192_ENCRYPT = CRYPT_S390_KM | 0x13,
  54. KM_AES_192_DECRYPT = CRYPT_S390_KM | 0x13 | 0x80,
  55. KM_AES_256_ENCRYPT = CRYPT_S390_KM | 0x14,
  56. KM_AES_256_DECRYPT = CRYPT_S390_KM | 0x14 | 0x80,
  57. KM_XTS_128_ENCRYPT = CRYPT_S390_KM | 0x32,
  58. KM_XTS_128_DECRYPT = CRYPT_S390_KM | 0x32 | 0x80,
  59. KM_XTS_256_ENCRYPT = CRYPT_S390_KM | 0x34,
  60. KM_XTS_256_DECRYPT = CRYPT_S390_KM | 0x34 | 0x80,
  61. };
  62. /*
  63. * function codes for KMC (CIPHER MESSAGE WITH CHAINING)
  64. * instruction
  65. */
  66. enum crypt_s390_kmc_func {
  67. KMC_QUERY = CRYPT_S390_KMC | 0x0,
  68. KMC_DEA_ENCRYPT = CRYPT_S390_KMC | 0x1,
  69. KMC_DEA_DECRYPT = CRYPT_S390_KMC | 0x1 | 0x80,
  70. KMC_TDEA_128_ENCRYPT = CRYPT_S390_KMC | 0x2,
  71. KMC_TDEA_128_DECRYPT = CRYPT_S390_KMC | 0x2 | 0x80,
  72. KMC_TDEA_192_ENCRYPT = CRYPT_S390_KMC | 0x3,
  73. KMC_TDEA_192_DECRYPT = CRYPT_S390_KMC | 0x3 | 0x80,
  74. KMC_AES_128_ENCRYPT = CRYPT_S390_KMC | 0x12,
  75. KMC_AES_128_DECRYPT = CRYPT_S390_KMC | 0x12 | 0x80,
  76. KMC_AES_192_ENCRYPT = CRYPT_S390_KMC | 0x13,
  77. KMC_AES_192_DECRYPT = CRYPT_S390_KMC | 0x13 | 0x80,
  78. KMC_AES_256_ENCRYPT = CRYPT_S390_KMC | 0x14,
  79. KMC_AES_256_DECRYPT = CRYPT_S390_KMC | 0x14 | 0x80,
  80. KMC_PRNG = CRYPT_S390_KMC | 0x43,
  81. };
  82. /*
  83. * function codes for KMCTR (CIPHER MESSAGE WITH COUNTER)
  84. * instruction
  85. */
  86. enum crypt_s390_kmctr_func {
  87. KMCTR_QUERY = CRYPT_S390_KMCTR | 0x0,
  88. KMCTR_DEA_ENCRYPT = CRYPT_S390_KMCTR | 0x1,
  89. KMCTR_DEA_DECRYPT = CRYPT_S390_KMCTR | 0x1 | 0x80,
  90. KMCTR_TDEA_128_ENCRYPT = CRYPT_S390_KMCTR | 0x2,
  91. KMCTR_TDEA_128_DECRYPT = CRYPT_S390_KMCTR | 0x2 | 0x80,
  92. KMCTR_TDEA_192_ENCRYPT = CRYPT_S390_KMCTR | 0x3,
  93. KMCTR_TDEA_192_DECRYPT = CRYPT_S390_KMCTR | 0x3 | 0x80,
  94. KMCTR_AES_128_ENCRYPT = CRYPT_S390_KMCTR | 0x12,
  95. KMCTR_AES_128_DECRYPT = CRYPT_S390_KMCTR | 0x12 | 0x80,
  96. KMCTR_AES_192_ENCRYPT = CRYPT_S390_KMCTR | 0x13,
  97. KMCTR_AES_192_DECRYPT = CRYPT_S390_KMCTR | 0x13 | 0x80,
  98. KMCTR_AES_256_ENCRYPT = CRYPT_S390_KMCTR | 0x14,
  99. KMCTR_AES_256_DECRYPT = CRYPT_S390_KMCTR | 0x14 | 0x80,
  100. };
  101. /*
  102. * function codes for KIMD (COMPUTE INTERMEDIATE MESSAGE DIGEST)
  103. * instruction
  104. */
  105. enum crypt_s390_kimd_func {
  106. KIMD_QUERY = CRYPT_S390_KIMD | 0,
  107. KIMD_SHA_1 = CRYPT_S390_KIMD | 1,
  108. KIMD_SHA_256 = CRYPT_S390_KIMD | 2,
  109. KIMD_SHA_512 = CRYPT_S390_KIMD | 3,
  110. KIMD_GHASH = CRYPT_S390_KIMD | 65,
  111. };
  112. /*
  113. * function codes for KLMD (COMPUTE LAST MESSAGE DIGEST)
  114. * instruction
  115. */
  116. enum crypt_s390_klmd_func {
  117. KLMD_QUERY = CRYPT_S390_KLMD | 0,
  118. KLMD_SHA_1 = CRYPT_S390_KLMD | 1,
  119. KLMD_SHA_256 = CRYPT_S390_KLMD | 2,
  120. KLMD_SHA_512 = CRYPT_S390_KLMD | 3,
  121. };
  122. /*
  123. * function codes for KMAC (COMPUTE MESSAGE AUTHENTICATION CODE)
  124. * instruction
  125. */
  126. enum crypt_s390_kmac_func {
  127. KMAC_QUERY = CRYPT_S390_KMAC | 0,
  128. KMAC_DEA = CRYPT_S390_KMAC | 1,
  129. KMAC_TDEA_128 = CRYPT_S390_KMAC | 2,
  130. KMAC_TDEA_192 = CRYPT_S390_KMAC | 3
  131. };
  132. /*
  133. * function codes for PPNO (PERFORM PSEUDORANDOM NUMBER
  134. * OPERATION) instruction
  135. */
  136. enum crypt_s390_ppno_func {
  137. PPNO_QUERY = CRYPT_S390_PPNO | 0,
  138. PPNO_SHA512_DRNG_GEN = CRYPT_S390_PPNO | 3,
  139. PPNO_SHA512_DRNG_SEED = CRYPT_S390_PPNO | 0x83
  140. };
  141. /**
  142. * crypt_s390_km:
  143. * @func: the function code passed to KM; see crypt_s390_km_func
  144. * @param: address of parameter block; see POP for details on each func
  145. * @dest: address of destination memory area
  146. * @src: address of source memory area
  147. * @src_len: length of src operand in bytes
  148. *
  149. * Executes the KM (CIPHER MESSAGE) operation of the CPU.
  150. *
  151. * Returns -1 for failure, 0 for the query func, number of processed
  152. * bytes for encryption/decryption funcs
  153. */
  154. static inline int crypt_s390_km(long func, void *param,
  155. u8 *dest, const u8 *src, long src_len)
  156. {
  157. register long __func asm("0") = func & CRYPT_S390_FUNC_MASK;
  158. register void *__param asm("1") = param;
  159. register const u8 *__src asm("2") = src;
  160. register long __src_len asm("3") = src_len;
  161. register u8 *__dest asm("4") = dest;
  162. int ret;
  163. asm volatile(
  164. "0: .insn rre,0xb92e0000,%3,%1\n" /* KM opcode */
  165. "1: brc 1,0b\n" /* handle partial completion */
  166. " la %0,0\n"
  167. "2:\n"
  168. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  169. : "=d" (ret), "+a" (__src), "+d" (__src_len), "+a" (__dest)
  170. : "d" (__func), "a" (__param), "0" (-1) : "cc", "memory");
  171. if (ret < 0)
  172. return ret;
  173. return (func & CRYPT_S390_FUNC_MASK) ? src_len - __src_len : __src_len;
  174. }
  175. /**
  176. * crypt_s390_kmc:
  177. * @func: the function code passed to KM; see crypt_s390_kmc_func
  178. * @param: address of parameter block; see POP for details on each func
  179. * @dest: address of destination memory area
  180. * @src: address of source memory area
  181. * @src_len: length of src operand in bytes
  182. *
  183. * Executes the KMC (CIPHER MESSAGE WITH CHAINING) operation of the CPU.
  184. *
  185. * Returns -1 for failure, 0 for the query func, number of processed
  186. * bytes for encryption/decryption funcs
  187. */
  188. static inline int crypt_s390_kmc(long func, void *param,
  189. u8 *dest, const u8 *src, long src_len)
  190. {
  191. register long __func asm("0") = func & CRYPT_S390_FUNC_MASK;
  192. register void *__param asm("1") = param;
  193. register const u8 *__src asm("2") = src;
  194. register long __src_len asm("3") = src_len;
  195. register u8 *__dest asm("4") = dest;
  196. int ret;
  197. asm volatile(
  198. "0: .insn rre,0xb92f0000,%3,%1\n" /* KMC opcode */
  199. "1: brc 1,0b\n" /* handle partial completion */
  200. " la %0,0\n"
  201. "2:\n"
  202. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  203. : "=d" (ret), "+a" (__src), "+d" (__src_len), "+a" (__dest)
  204. : "d" (__func), "a" (__param), "0" (-1) : "cc", "memory");
  205. if (ret < 0)
  206. return ret;
  207. return (func & CRYPT_S390_FUNC_MASK) ? src_len - __src_len : __src_len;
  208. }
  209. /**
  210. * crypt_s390_kimd:
  211. * @func: the function code passed to KM; see crypt_s390_kimd_func
  212. * @param: address of parameter block; see POP for details on each func
  213. * @src: address of source memory area
  214. * @src_len: length of src operand in bytes
  215. *
  216. * Executes the KIMD (COMPUTE INTERMEDIATE MESSAGE DIGEST) operation
  217. * of the CPU.
  218. *
  219. * Returns -1 for failure, 0 for the query func, number of processed
  220. * bytes for digest funcs
  221. */
  222. static inline int crypt_s390_kimd(long func, void *param,
  223. const u8 *src, long src_len)
  224. {
  225. register long __func asm("0") = func & CRYPT_S390_FUNC_MASK;
  226. register void *__param asm("1") = param;
  227. register const u8 *__src asm("2") = src;
  228. register long __src_len asm("3") = src_len;
  229. int ret;
  230. asm volatile(
  231. "0: .insn rre,0xb93e0000,%1,%1\n" /* KIMD opcode */
  232. "1: brc 1,0b\n" /* handle partial completion */
  233. " la %0,0\n"
  234. "2:\n"
  235. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  236. : "=d" (ret), "+a" (__src), "+d" (__src_len)
  237. : "d" (__func), "a" (__param), "0" (-1) : "cc", "memory");
  238. if (ret < 0)
  239. return ret;
  240. return (func & CRYPT_S390_FUNC_MASK) ? src_len - __src_len : __src_len;
  241. }
  242. /**
  243. * crypt_s390_klmd:
  244. * @func: the function code passed to KM; see crypt_s390_klmd_func
  245. * @param: address of parameter block; see POP for details on each func
  246. * @src: address of source memory area
  247. * @src_len: length of src operand in bytes
  248. *
  249. * Executes the KLMD (COMPUTE LAST MESSAGE DIGEST) operation of the CPU.
  250. *
  251. * Returns -1 for failure, 0 for the query func, number of processed
  252. * bytes for digest funcs
  253. */
  254. static inline int crypt_s390_klmd(long func, void *param,
  255. const u8 *src, long src_len)
  256. {
  257. register long __func asm("0") = func & CRYPT_S390_FUNC_MASK;
  258. register void *__param asm("1") = param;
  259. register const u8 *__src asm("2") = src;
  260. register long __src_len asm("3") = src_len;
  261. int ret;
  262. asm volatile(
  263. "0: .insn rre,0xb93f0000,%1,%1\n" /* KLMD opcode */
  264. "1: brc 1,0b\n" /* handle partial completion */
  265. " la %0,0\n"
  266. "2:\n"
  267. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  268. : "=d" (ret), "+a" (__src), "+d" (__src_len)
  269. : "d" (__func), "a" (__param), "0" (-1) : "cc", "memory");
  270. if (ret < 0)
  271. return ret;
  272. return (func & CRYPT_S390_FUNC_MASK) ? src_len - __src_len : __src_len;
  273. }
  274. /**
  275. * crypt_s390_kmac:
  276. * @func: the function code passed to KM; see crypt_s390_klmd_func
  277. * @param: address of parameter block; see POP for details on each func
  278. * @src: address of source memory area
  279. * @src_len: length of src operand in bytes
  280. *
  281. * Executes the KMAC (COMPUTE MESSAGE AUTHENTICATION CODE) operation
  282. * of the CPU.
  283. *
  284. * Returns -1 for failure, 0 for the query func, number of processed
  285. * bytes for digest funcs
  286. */
  287. static inline int crypt_s390_kmac(long func, void *param,
  288. const u8 *src, long src_len)
  289. {
  290. register long __func asm("0") = func & CRYPT_S390_FUNC_MASK;
  291. register void *__param asm("1") = param;
  292. register const u8 *__src asm("2") = src;
  293. register long __src_len asm("3") = src_len;
  294. int ret;
  295. asm volatile(
  296. "0: .insn rre,0xb91e0000,%1,%1\n" /* KLAC opcode */
  297. "1: brc 1,0b\n" /* handle partial completion */
  298. " la %0,0\n"
  299. "2:\n"
  300. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  301. : "=d" (ret), "+a" (__src), "+d" (__src_len)
  302. : "d" (__func), "a" (__param), "0" (-1) : "cc", "memory");
  303. if (ret < 0)
  304. return ret;
  305. return (func & CRYPT_S390_FUNC_MASK) ? src_len - __src_len : __src_len;
  306. }
  307. /**
  308. * crypt_s390_kmctr:
  309. * @func: the function code passed to KMCTR; see crypt_s390_kmctr_func
  310. * @param: address of parameter block; see POP for details on each func
  311. * @dest: address of destination memory area
  312. * @src: address of source memory area
  313. * @src_len: length of src operand in bytes
  314. * @counter: address of counter value
  315. *
  316. * Executes the KMCTR (CIPHER MESSAGE WITH COUNTER) operation of the CPU.
  317. *
  318. * Returns -1 for failure, 0 for the query func, number of processed
  319. * bytes for encryption/decryption funcs
  320. */
  321. static inline int crypt_s390_kmctr(long func, void *param, u8 *dest,
  322. const u8 *src, long src_len, u8 *counter)
  323. {
  324. register long __func asm("0") = func & CRYPT_S390_FUNC_MASK;
  325. register void *__param asm("1") = param;
  326. register const u8 *__src asm("2") = src;
  327. register long __src_len asm("3") = src_len;
  328. register u8 *__dest asm("4") = dest;
  329. register u8 *__ctr asm("6") = counter;
  330. int ret = -1;
  331. asm volatile(
  332. "0: .insn rrf,0xb92d0000,%3,%1,%4,0\n" /* KMCTR opcode */
  333. "1: brc 1,0b\n" /* handle partial completion */
  334. " la %0,0\n"
  335. "2:\n"
  336. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  337. : "+d" (ret), "+a" (__src), "+d" (__src_len), "+a" (__dest),
  338. "+a" (__ctr)
  339. : "d" (__func), "a" (__param) : "cc", "memory");
  340. if (ret < 0)
  341. return ret;
  342. return (func & CRYPT_S390_FUNC_MASK) ? src_len - __src_len : __src_len;
  343. }
  344. /**
  345. * crypt_s390_ppno:
  346. * @func: the function code passed to PPNO; see crypt_s390_ppno_func
  347. * @param: address of parameter block; see POP for details on each func
  348. * @dest: address of destination memory area
  349. * @dest_len: size of destination memory area in bytes
  350. * @seed: address of seed data
  351. * @seed_len: size of seed data in bytes
  352. *
  353. * Executes the PPNO (PERFORM PSEUDORANDOM NUMBER OPERATION)
  354. * operation of the CPU.
  355. *
  356. * Returns -1 for failure, 0 for the query func, number of random
  357. * bytes stored in dest buffer for generate function
  358. */
  359. static inline int crypt_s390_ppno(long func, void *param,
  360. u8 *dest, long dest_len,
  361. const u8 *seed, long seed_len)
  362. {
  363. register long __func asm("0") = func & CRYPT_S390_FUNC_MASK;
  364. register void *__param asm("1") = param; /* param block (240 bytes) */
  365. register u8 *__dest asm("2") = dest; /* buf for recv random bytes */
  366. register long __dest_len asm("3") = dest_len; /* requested random bytes */
  367. register const u8 *__seed asm("4") = seed; /* buf with seed data */
  368. register long __seed_len asm("5") = seed_len; /* bytes in seed buf */
  369. int ret = -1;
  370. asm volatile (
  371. "0: .insn rre,0xb93c0000,%1,%5\n" /* PPNO opcode */
  372. "1: brc 1,0b\n" /* handle partial completion */
  373. " la %0,0\n"
  374. "2:\n"
  375. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  376. : "+d" (ret), "+a"(__dest), "+d"(__dest_len)
  377. : "d"(__func), "a"(__param), "a"(__seed), "d"(__seed_len)
  378. : "cc", "memory");
  379. if (ret < 0)
  380. return ret;
  381. return (func & CRYPT_S390_FUNC_MASK) ? dest_len - __dest_len : 0;
  382. }
  383. /**
  384. * crypt_s390_func_available:
  385. * @func: the function code of the specific function; 0 if op in general
  386. *
  387. * Tests if a specific crypto function is implemented on the machine.
  388. *
  389. * Returns 1 if func available; 0 if func or op in general not available
  390. */
  391. static inline int crypt_s390_func_available(int func,
  392. unsigned int facility_mask)
  393. {
  394. unsigned char status[16];
  395. int ret;
  396. if (facility_mask & CRYPT_S390_MSA && !test_facility(17))
  397. return 0;
  398. if (facility_mask & CRYPT_S390_MSA3 && !test_facility(76))
  399. return 0;
  400. if (facility_mask & CRYPT_S390_MSA4 && !test_facility(77))
  401. return 0;
  402. if (facility_mask & CRYPT_S390_MSA5 && !test_facility(57))
  403. return 0;
  404. switch (func & CRYPT_S390_OP_MASK) {
  405. case CRYPT_S390_KM:
  406. ret = crypt_s390_km(KM_QUERY, &status, NULL, NULL, 0);
  407. break;
  408. case CRYPT_S390_KMC:
  409. ret = crypt_s390_kmc(KMC_QUERY, &status, NULL, NULL, 0);
  410. break;
  411. case CRYPT_S390_KIMD:
  412. ret = crypt_s390_kimd(KIMD_QUERY, &status, NULL, 0);
  413. break;
  414. case CRYPT_S390_KLMD:
  415. ret = crypt_s390_klmd(KLMD_QUERY, &status, NULL, 0);
  416. break;
  417. case CRYPT_S390_KMAC:
  418. ret = crypt_s390_kmac(KMAC_QUERY, &status, NULL, 0);
  419. break;
  420. case CRYPT_S390_KMCTR:
  421. ret = crypt_s390_kmctr(KMCTR_QUERY, &status,
  422. NULL, NULL, 0, NULL);
  423. break;
  424. case CRYPT_S390_PPNO:
  425. ret = crypt_s390_ppno(PPNO_QUERY, &status,
  426. NULL, 0, NULL, 0);
  427. break;
  428. default:
  429. return 0;
  430. }
  431. if (ret < 0)
  432. return 0;
  433. func &= CRYPT_S390_FUNC_MASK;
  434. func &= 0x7f; /* mask modifier bit */
  435. return (status[func >> 3] & (0x80 >> (func & 7))) != 0;
  436. }
  437. /**
  438. * crypt_s390_pcc:
  439. * @func: the function code passed to KM; see crypt_s390_km_func
  440. * @param: address of parameter block; see POP for details on each func
  441. *
  442. * Executes the PCC (PERFORM CRYPTOGRAPHIC COMPUTATION) operation of the CPU.
  443. *
  444. * Returns -1 for failure, 0 for success.
  445. */
  446. static inline int crypt_s390_pcc(long func, void *param)
  447. {
  448. register long __func asm("0") = func & 0x7f; /* encrypt or decrypt */
  449. register void *__param asm("1") = param;
  450. int ret = -1;
  451. asm volatile(
  452. "0: .insn rre,0xb92c0000,0,0\n" /* PCC opcode */
  453. "1: brc 1,0b\n" /* handle partial completion */
  454. " la %0,0\n"
  455. "2:\n"
  456. EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
  457. : "+d" (ret)
  458. : "d" (__func), "a" (__param) : "cc", "memory");
  459. return ret;
  460. }
  461. #endif /* _CRYPTO_ARCH_S390_CRYPT_S390_H */