Home
last modified time | relevance | path

Searched refs:x (Results 1 – 25 of 28) sorted by relevance

12

/crypto/
Dsm4.c72 static inline u32 sm4_t_non_lin_sub(u32 x) in sm4_t_non_lin_sub() argument
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()
78 out |= (u32)sbox[(x >> 16) & 0xff] << 16; in sm4_t_non_lin_sub()
79 out |= (u32)sbox[(x >> 24) & 0xff] << 24; in sm4_t_non_lin_sub()
84 static inline u32 sm4_key_lin_sub(u32 x) in sm4_key_lin_sub() argument
86 return x ^ rol32(x, 13) ^ rol32(x, 23); in sm4_key_lin_sub()
89 static inline u32 sm4_enc_lin_sub(u32 x) in sm4_enc_lin_sub() argument
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
[all …]
Dtwofish_generic.c54 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
86 x = get_unaligned_le32(in + (n) * 4) ^ ctx->w[m]
88 #define OUTUNPACK(n, x, m) \ argument
89 x ^= ctx->w[m]; \
[all …]
Dsha512_generic.c43 static inline u64 Ch(u64 x, u64 y, u64 z) in Ch() argument
45 return z ^ (x & (y ^ z)); in Ch()
48 static inline u64 Maj(u64 x, u64 y, u64 z) in Maj() argument
50 return (x & y) | (z & (x | y)); in Maj()
83 #define e0(x) (ror64(x,28) ^ ror64(x,34) ^ ror64(x,39)) argument
84 #define e1(x) (ror64(x,14) ^ ror64(x,18) ^ ror64(x,41)) argument
85 #define s0(x) (ror64(x, 1) ^ ror64(x, 8) ^ (x >> 7)) argument
86 #define s1(x) (ror64(x,19) ^ ror64(x,61) ^ (x >> 6)) argument
Dblowfish_common.c297 #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)])
Dblowfish_generic.c27 #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)])
Dstreebog_generic.c851 static void streebog_xor(const struct streebog_uint512 *x, in streebog_xor() argument
855 z->qword[0] = x->qword[0] ^ y->qword[0]; in streebog_xor()
856 z->qword[1] = x->qword[1] ^ y->qword[1]; in streebog_xor()
857 z->qword[2] = x->qword[2] ^ y->qword[2]; in streebog_xor()
858 z->qword[3] = x->qword[3] ^ y->qword[3]; in streebog_xor()
859 z->qword[4] = x->qword[4] ^ y->qword[4]; in streebog_xor()
860 z->qword[5] = x->qword[5] ^ y->qword[5]; in streebog_xor()
861 z->qword[6] = x->qword[6] ^ y->qword[6]; in streebog_xor()
862 z->qword[7] = x->qword[7] ^ y->qword[7]; in streebog_xor()
865 static void streebog_xlps(const struct streebog_uint512 *x, in streebog_xlps() argument
[all …]
Dcast5_generic.c400 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()
406 z[0] = x[0] ^ s5[xi(13)] ^ s6[xi(15)] ^ s7[xi(12)] ^ sb8[xi(14)] ^ 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()
412 z[3] = x[1] ^ s5[zi(10)] ^ s6[zi(9)] ^ s7[zi(11)] ^ sb8[zi(8)] ^ in key_schedule()
422 x[0] = z[2] ^ s5[zi(5)] ^ s6[zi(7)] ^ s7[zi(4)] ^ sb8[zi(6)] ^ in key_schedule()
424 x[1] = z[0] ^ s5[xi(0)] ^ s6[xi(2)] ^ s7[xi(1)] ^ sb8[xi(3)] ^ in key_schedule()
426 x[2] = z[1] ^ s5[xi(7)] ^ s6[xi(6)] ^ s7[xi(5)] ^ sb8[xi(4)] ^ in key_schedule()
428 x[3] = z[3] ^ s5[xi(10)] ^ s6[xi(9)] ^ s7[xi(11)] ^ sb8[xi(8)] ^ in key_schedule()
[all …]
Dsm2.c73 MPI x, y; in sm2_ec_ctx_init() local
82 x = mpi_scanval(ecp->g_x); in sm2_ec_ctx_init()
84 if (!x || !y) in sm2_ec_ctx_init()
100 mpi_set(ec->G->x, x); in sm2_ec_ctx_init()
119 mpi_free(x); in sm2_ec_ctx_init()
144 MPI x, y; in sm2_ecc_os2ec() local
164 x = mpi_read_raw_data(buf + 1, n); in sm2_ecc_os2ec()
165 if (!x) in sm2_ecc_os2ec()
171 mpi_normalize(x); in sm2_ecc_os2ec()
173 mpi_set(result->x, x); in sm2_ecc_os2ec()
[all …]
Dtwofish_common.c468 #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
Dmd4.c42 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()
Decrdsa_defs.h51 .x = cp256a_g_x,
84 .x = cp256b_g_x,
121 .x = cp256c_g_x,
170 .x = tc512a_g_x,
215 .x = tc512b_g_x,
Dsm3.c54 #define FF1(x, y, z) (x ^ y ^ z) argument
55 #define FF2(x, y, z) ((x & y) | (x & z) | (y & z)) argument
57 #define GG1(x, y, z) FF1(x, y, z) argument
58 #define GG2(x, y, z) ((x & y) | (~x & z)) argument
61 #define P0(x) ((x) ^ rol32((x), 9) ^ rol32((x), 17)) argument
62 #define P1(x) ((x) ^ rol32((x), 15) ^ rol32((x), 23)) argument
Decc_curve_defs.h21 .x = nist_p192_g_x,
47 .x = nist_p256_g_x,
79 .x = nist_p384_g_x,
99 .x = curve25519_g_x,
Dmd5.c32 #define F1(x, y, z) (z ^ (x & (y ^ z))) argument
33 #define F2(x, y, z) F1(z, x, y) argument
34 #define F3(x, y, z) (x ^ y ^ z) argument
35 #define F4(x, y, z) (y ^ (x | ~z)) argument
37 #define MD5STEP(f, w, x, y, z, in, s) \ argument
38 (w += f(x, y, z) + in, w = (w<<s | w>>(32-s)) + x)
Decdsa.c21 u64 x[ECC_MAX_DIGITS]; /* pub key x and y coordinates */ member
124 if (unlikely(vli_cmp(res.x, curve->n, ndigits) == 1)) in _ecdsa_verify()
126 vli_sub(res.x, res.x, curve->n, ndigits); in _ecdsa_verify()
128 if (!vli_cmp(res.x, r, ndigits)) in _ecdsa_verify()
212 ctx->pub_key = ECC_POINT_INIT(ctx->x, ctx->y, in ecdsa_ecc_ctx_reset()
245 ecc_swap_digits(digits, ctx->pub_key.x, ndigits); in ecdsa_set_pub_key()
Decrdsa.c95 !ctx->pub_key.x || in ecrdsa_verify()
140 if (vli_cmp(cc.x, ctx->curve->n, ndigits) >= 0) in ecrdsa_verify()
141 vli_sub(cc.x, cc.x, ctx->curve->n, ndigits); in ecrdsa_verify()
144 if (!vli_cmp(cc.x, r, ndigits)) in ecrdsa_verify()
242 vli_from_le64(ctx->pub_key.x, ctx->key, ndigits); in ecrdsa_set_pub_key()
Dcrypto_user_stat.c18 #define null_terminated(x) (strnlen(x, sizeof(x)) < sizeof(x)) argument
Decc.c91 p->x = ecc_alloc_digits_space(ndigits); in ecc_alloc_point()
92 if (!p->x) in ecc_alloc_point()
104 ecc_free_digits_space(p->x); in ecc_alloc_point()
116 kfree_sensitive(p->x); in ecc_free_point()
1070 return (vli_is_zero(point->x, point->ndigits) && in ecc_point_is_zero()
1300 vli_set(rx[1], point->x, ndigits); in ecc_point_mult()
1320 vli_mod_mult_fast(z, z, point->x, curve); in ecc_point_mult()
1335 vli_set(result->x, rx[0], ndigits); in ecc_point_mult()
1349 vli_set(result->x, q->x, ndigits); in ecc_point_add()
1351 vli_mod_sub(z, result->x, p->x, curve->p, ndigits); in ecc_point_add()
[all …]
Dadiantum.c188 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()
Drmd160.c37 #define F1(x, y, z) (x ^ y ^ z) /* XOR */ argument
38 #define F2(x, y, z) (z ^ (x & (y ^ z))) /* x ? y : z */ argument
39 #define F3(x, y, z) ((x | ~y) ^ z) argument
40 #define F4(x, y, z) (y ^ (z & (x ^ y))) /* z ? x : y */ argument
41 #define F5(x, y, z) (x ^ (y | ~z)) argument
43 #define ROUND(a, b, c, d, e, f, k, x, s) { \ argument
44 (a) += f((b), (c), (d)) + le32_to_cpup(&(x)) + (k); \
Dfcrypt.c73 #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
Dxor.c20 #define XOR_SELECT_TEMPLATE(x) (x) argument
Dcrypto_user_base.c25 #define null_terminated(x) (strnlen(x, sizeof(x)) < sizeof(x)) argument
/crypto/asymmetric_keys/
Dverify_pefile.c36 #define chkaddr(base, x, s) \ in pefile_parse_binary() argument
38 if ((x) < base || (s) >= datalen || (x) > datalen - (s)) \ in pefile_parse_binary()
Dx509_cert_parser.c669 #define dec2bin(X) ({ unsigned char x = (X) - '0'; if (x > 9) goto invalid_time; x; }) in x509_decode_time()
670 #define DD2bin(P) ({ unsigned x = dec2bin(P[0]) * 10 + dec2bin(P[1]); P += 2; x; }) in x509_decode_time()

12