| /crypto/ |
| A D | sm4.c | 76 out = (u32)sbox[x & 0xff]; in sm4_t_non_lin_sub() 77 out |= (u32)sbox[(x >> 8) & 0xff] << 8; in sm4_t_non_lin_sub() 86 return x ^ rol32(x, 13) ^ rol32(x, 23); in sm4_key_lin_sub() 91 return x ^ rol32(x, 2) ^ rol32(x, 10) ^ rol32(x, 18) ^ rol32(x, 24); in sm4_enc_lin_sub() 94 static inline u32 sm4_key_sub(u32 x) in sm4_key_sub() argument 99 static inline u32 sm4_enc_sub(u32 x) in sm4_enc_sub() argument 162 u32 x[4], i; in sm4_crypt_block() local 170 x[0] = sm4_round(x[0], x[1], x[2], x[3], rk[i + 0]); in sm4_crypt_block() 171 x[1] = sm4_round(x[1], x[2], x[3], x[0], rk[i + 1]); in sm4_crypt_block() 172 x[2] = sm4_round(x[2], x[3], x[0], x[1], rk[i + 2]); in sm4_crypt_block() [all …]
|
| A D | twofish_generic.c | 54 x = G1 (a); y = G2 (b); \ 55 x += y; y += x + ctx->k[2 * (n) + 1]; \ 56 (c) ^= x + ctx->k[2 * (n)]; \ 61 x = G1 (a); y = G2 (b); \ 62 x += y; y += x; \ 66 (c) ^= (x + ctx->k[2 * (n)]) 85 #define INPACK(n, x, m) \ argument 88 #define OUTUNPACK(n, x, m) \ argument 89 x ^= ctx->w[m]; \ 103 u32 x, y; in twofish_encrypt() local [all …]
|
| A D | blowfish_common.c | 297 #define GET32_3(x) (((x) & 0xff)) argument 298 #define GET32_2(x) (((x) >> (8)) & (0xff)) argument 299 #define GET32_1(x) (((x) >> (16)) & (0xff)) argument 300 #define GET32_0(x) (((x) >> (24)) & (0xff)) argument 302 #define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \ argument 303 S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])
|
| A D | blowfish_generic.c | 27 #define GET32_3(x) (((x) & 0xff)) argument 28 #define GET32_2(x) (((x) >> (8)) & (0xff)) argument 29 #define GET32_1(x) (((x) >> (16)) & (0xff)) argument 30 #define GET32_0(x) (((x) >> (24)) & (0xff)) argument 32 #define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \ argument 33 S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])
|
| A D | streebog_generic.c | 856 z->qword[0] = x->qword[0] ^ y->qword[0]; in streebog_xor() 857 z->qword[1] = x->qword[1] ^ y->qword[1]; in streebog_xor() 858 z->qword[2] = x->qword[2] ^ y->qword[2]; in streebog_xor() 859 z->qword[3] = x->qword[3] ^ y->qword[3]; in streebog_xor() 860 z->qword[4] = x->qword[4] ^ y->qword[4]; in streebog_xor() 861 z->qword[5] = x->qword[5] ^ y->qword[5]; in streebog_xor() 862 z->qword[6] = x->qword[6] ^ y->qword[6]; in streebog_xor() 863 z->qword[7] = x->qword[7] ^ y->qword[7]; in streebog_xor() 873 r0 = le64_to_cpu(x->qword[0] ^ y->qword[0]); in streebog_xlps() 874 r1 = le64_to_cpu(x->qword[1] ^ y->qword[1]); in streebog_xlps() [all …]
|
| A D | cast5_generic.c | 400 static void key_schedule(u32 *x, u32 *z, u32 *k) in key_schedule() argument 403 #define xi(i) ((x[(i)/4] >> (8*(3-((i)%4)))) & 0xff) in key_schedule() 408 z[1] = x[2] ^ s5[zi(0)] ^ s6[zi(2)] ^ s7[zi(1)] ^ sb8[zi(3)] ^ in key_schedule() 410 z[2] = x[3] ^ s5[zi(7)] ^ s6[zi(6)] ^ s7[zi(5)] ^ sb8[zi(4)] ^ in key_schedule() 479 u32 x[4]; in cast5_setkey() local 490 x[0] = be32_to_cpu(p_key[0]); in cast5_setkey() 491 x[1] = be32_to_cpu(p_key[1]); in cast5_setkey() 492 x[2] = be32_to_cpu(p_key[2]); in cast5_setkey() 493 x[3] = be32_to_cpu(p_key[3]); in cast5_setkey() 495 key_schedule(x, z, k); in cast5_setkey() [all …]
|
| A D | twofish_common.c | 468 #define CALC_S(a, b, c, d, i, w, x, y, z) \ argument 472 (b) ^= exp_to_poly[tmp + (x)]; \ 536 x = CALC_K_2 (k, l, k, l, 0); \ 539 x += y; y += x; ctx->a[j] = x; \ 549 x = CALC_K192_2 (l, l, k, k, 0); \ 552 x += y; y += x; ctx->a[j] = x; \ 562 x = CALC_K256_2 (k, l, 0); \ 565 x += y; y += x; ctx->a[j] = x; \ 575 u32 x, y; in __twofish_setkey() local
|
| A D | md4.c | 42 static inline u32 lshift(u32 x, unsigned int s) in lshift() argument 44 x &= 0xFFFFFFFF; in lshift() 45 return ((x << s) & 0xFFFFFFFF) | (x >> (32 - s)); in lshift() 48 static inline u32 F(u32 x, u32 y, u32 z) in F() argument 50 return (x & y) | ((~x) & z); in F() 53 static inline u32 G(u32 x, u32 y, u32 z) in G() argument 55 return (x & y) | (x & z) | (y & z); in G() 58 static inline u32 H(u32 x, u32 y, u32 z) in H() argument 60 return x ^ y ^ z; in H()
|
| A D | ecc_curve_defs.h | 22 .x = nist_p192_g_x, 49 .x = nist_p256_g_x, 82 .x = nist_p384_g_x, 127 .x = nist_p521_g_x, 148 .x = curve25519_g_x,
|
| A D | ecrdsa_defs.h | 52 .x = cp256a_g_x, 86 .x = cp256b_g_x, 124 .x = cp256c_g_x, 174 .x = tc512a_g_x, 220 .x = tc512b_g_x,
|
| A D | md5.c | 30 #define F1(x, y, z) (z ^ (x & (y ^ z))) argument 31 #define F2(x, y, z) F1(z, x, y) argument 32 #define F3(x, y, z) (x ^ y ^ z) argument 33 #define F4(x, y, z) (y ^ (x | ~z)) argument 35 #define MD5STEP(f, w, x, y, z, in, s) \ argument 36 (w += f(x, y, z) + in, w = (w<<s | w>>(32-s)) + x)
|
| A D | ecdsa.c | 18 u64 x[ECC_MAX_DIGITS]; /* pub key x and y coordinates */ member 53 if (unlikely(vli_cmp(res.x, curve->n, ndigits) == 1)) in _ecdsa_verify() 55 vli_sub(res.x, res.x, curve->n, ndigits); in _ecdsa_verify() 57 if (!vli_cmp(res.x, r, ndigits)) in _ecdsa_verify() 113 ctx->pub_key = ECC_POINT_INIT(ctx->x, ctx->y, in ecdsa_ecc_ctx_reset() 149 ecc_digits_from_bytes(d, digitlen, ctx->pub_key.x, ndigits); in ecdsa_set_pub_key()
|
| A D | ecrdsa.c | 94 !ctx->pub_key.x || in ecrdsa_verify() 132 if (vli_cmp(cc.x, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify() 133 vli_sub(cc.x, cc.x, ctx->curve->n, ndigits); in ecrdsa_verify() 136 if (!vli_cmp(cc.x, r, ndigits)) in ecrdsa_verify() 234 vli_from_le64(ctx->pub_key.x, ctx->key, ndigits); in ecrdsa_set_pub_key()
|
| A D | ecc.c | 115 p->x = ecc_alloc_digits_space(ndigits); in ecc_alloc_point() 116 if (!p->x) in ecc_alloc_point() 128 ecc_free_digits_space(p->x); in ecc_alloc_point() 140 kfree_sensitive(p->x); in ecc_free_point() 1352 vli_set(rx[1], point->x, ndigits); in ecc_point_mult() 1401 vli_set(result->x, q->x, ndigits); in ecc_point_add() 1403 vli_mod_sub(z, result->x, p->x, curve->p, ndigits); in ecc_point_add() 1404 vli_set(px, p->x, ndigits); in ecc_point_add() 1421 u64 *rx = result->x; in ecc_point_mult_shamir() 1443 vli_set(rx, point->x, ndigits); in ecc_point_mult_shamir() [all …]
|
| A D | adiantum.c | 188 u64 x = le64_to_cpu(v1->b); in le128_add() local 191 r->b = cpu_to_le64(x + y); in le128_add() 193 (x + y < x)); in le128_add() 199 u64 x = le64_to_cpu(v1->b); in le128_sub() local 202 r->b = cpu_to_le64(x - y); in le128_sub() 204 (x - y > x)); in le128_sub()
|
| A D | rmd160.c | 33 #define F1(x, y, z) (x ^ y ^ z) /* XOR */ argument 34 #define F2(x, y, z) (z ^ (x & (y ^ z))) /* x ? y : z */ argument 35 #define F3(x, y, z) ((x | ~y) ^ z) argument 36 #define F4(x, y, z) (y ^ (z & (x ^ y))) /* z ? x : y */ argument 37 #define F5(x, y, z) (x ^ (y | ~z)) argument 39 #define ROUND(a, b, c, d, e, f, k, x, s) { \ argument 40 (a) += f((b), (c), (d)) + le32_to_cpup(&(x)) + (k); \
|
| A D | xor.c | 20 #define XOR_SELECT_TEMPLATE(x) (x) argument
|
| A D | fcrypt.c | 73 #define Z(x) cpu_to_be32(x << 3) argument 110 #define Z(x) cpu_to_be32(((x & 0x1f) << 27) | (x >> 5)) argument 147 #define Z(x) cpu_to_be32(x << 11) argument 184 #define Z(x) cpu_to_be32(x << 19) argument
|
| A D | crypto_user.c | 24 #define null_terminated(x) (strnlen(x, sizeof(x)) < sizeof(x)) argument
|
| A D | rsa.c | 27 static int rsa_check_payload(MPI x, MPI n) in rsa_check_payload() argument 31 if (mpi_cmp_ui(x, 1) <= 0) in rsa_check_payload() 38 if (mpi_sub_ui(n1, n, 1) || mpi_cmp(x, n1) >= 0) { in rsa_check_payload()
|
| A D | aes_generic.c | 59 static inline u8 byte(const u32 x, const unsigned n) in byte() argument 61 return x >> (n << 3); in byte()
|
| A D | seed.c | 27 byte(const u32 x, const unsigned n) in byte() argument 29 return x >> (n << 3); in byte()
|
| /crypto/asymmetric_keys/ |
| A D | verify_pefile.c | 36 #define chkaddr(base, x, s) \ in pefile_parse_binary() argument 38 if ((x) < base || (s) >= datalen || (x) > datalen - (s)) \ in pefile_parse_binary()
|
| A D | x509_cert_parser.c | 661 #define dec2bin(X) ({ unsigned char x = (X) - '0'; if (x > 9) goto invalid_time; x; }) in x509_decode_time() 662 #define DD2bin(P) ({ unsigned x = dec2bin(P[0]) * 10 + dec2bin(P[1]); P += 2; x; }) in x509_decode_time()
|
| /crypto/krb5/ |
| A D | internal.h | 115 #define round16(x) (((x) + 15) & ~15) argument
|