Home
last modified time | relevance | path

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

12

/crypto/
Dsalsa20_generic.c37 u32 x[16]; in salsa20_block() local
40 memcpy(x, state, sizeof(x)); in salsa20_block()
43 x[ 4] ^= rol32((x[ 0] + x[12]), 7); in salsa20_block()
44 x[ 8] ^= rol32((x[ 4] + x[ 0]), 9); in salsa20_block()
45 x[12] ^= rol32((x[ 8] + x[ 4]), 13); in salsa20_block()
46 x[ 0] ^= rol32((x[12] + x[ 8]), 18); in salsa20_block()
47 x[ 9] ^= rol32((x[ 5] + x[ 1]), 7); in salsa20_block()
48 x[13] ^= rol32((x[ 9] + x[ 5]), 9); in salsa20_block()
49 x[ 1] ^= rol32((x[13] + x[ 9]), 13); in salsa20_block()
50 x[ 5] ^= rol32((x[ 1] + x[13]), 18); in salsa20_block()
[all …]
Dtgr192.c397 static void tgr192_round(u64 * ra, u64 * rb, u64 * rc, u64 x, int mul) in tgr192_round() argument
403 c ^= x; in tgr192_round()
416 static void tgr192_pass(u64 * ra, u64 * rb, u64 * rc, u64 * x, int mul) in tgr192_pass() argument
422 tgr192_round(&a, &b, &c, x[0], mul); in tgr192_pass()
423 tgr192_round(&b, &c, &a, x[1], mul); in tgr192_pass()
424 tgr192_round(&c, &a, &b, x[2], mul); in tgr192_pass()
425 tgr192_round(&a, &b, &c, x[3], mul); in tgr192_pass()
426 tgr192_round(&b, &c, &a, x[4], mul); in tgr192_pass()
427 tgr192_round(&c, &a, &b, x[5], mul); in tgr192_pass()
428 tgr192_round(&a, &b, &c, x[6], mul); in tgr192_pass()
[all …]
Dsm4_generic.c69 static u32 sm4_t_non_lin_sub(u32 x) in sm4_t_non_lin_sub() argument
72 u8 *b = (u8 *)&x; in sm4_t_non_lin_sub()
77 return x; in sm4_t_non_lin_sub()
80 static u32 sm4_key_lin_sub(u32 x) in sm4_key_lin_sub() argument
82 return x ^ rol32(x, 13) ^ rol32(x, 23); in sm4_key_lin_sub()
86 static u32 sm4_enc_lin_sub(u32 x) in sm4_enc_lin_sub() argument
88 return x ^ rol32(x, 2) ^ rol32(x, 10) ^ rol32(x, 18) ^ rol32(x, 24); in sm4_enc_lin_sub()
91 static u32 sm4_key_sub(u32 x) in sm4_key_sub() argument
93 return sm4_key_lin_sub(sm4_t_non_lin_sub(x)); in sm4_key_sub()
96 static u32 sm4_enc_sub(u32 x) in sm4_enc_sub() argument
[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
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 = le32_to_cpu(src[n]) ^ ctx->w[m]
88 #define OUTUNPACK(n, x, m) \ argument
89 x ^= ctx->w[m]; \
[all …]
Dblowfish_common.c296 #define GET32_3(x) (((x) & 0xff)) argument
297 #define GET32_2(x) (((x) >> (8)) & (0xff)) argument
298 #define GET32_1(x) (((x) >> (16)) & (0xff)) argument
299 #define GET32_0(x) (((x) >> (24)) & (0xff)) argument
301 #define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \ argument
302 S[512 + GET32_2(x)]) + S[768 + GET32_3(x)])
Dblowfish_generic.c26 #define GET32_3(x) (((x) & 0xff)) argument
27 #define GET32_2(x) (((x) >> (8)) & (0xff)) argument
28 #define GET32_1(x) (((x) >> (16)) & (0xff)) argument
29 #define GET32_0(x) (((x) >> (24)) & (0xff)) argument
31 #define bf_F(x) (((S[GET32_0(x)] + S[256 + GET32_1(x)]) ^ \ argument
32 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.c404 static void key_schedule(u32 *x, u32 *z, u32 *k) in key_schedule() argument
407 #define xi(i) ((x[(i)/4] >> (8*(3-((i)%4)))) & 0xff) in key_schedule()
410 z[0] = x[0] ^ s5[xi(13)] ^ s6[xi(15)] ^ s7[xi(12)] ^ sb8[xi(14)] ^ in key_schedule()
412 z[1] = x[2] ^ s5[zi(0)] ^ s6[zi(2)] ^ s7[zi(1)] ^ sb8[zi(3)] ^ in key_schedule()
414 z[2] = x[3] ^ s5[zi(7)] ^ s6[zi(6)] ^ s7[zi(5)] ^ sb8[zi(4)] ^ in key_schedule()
416 z[3] = x[1] ^ s5[zi(10)] ^ s6[zi(9)] ^ s7[zi(11)] ^ sb8[zi(8)] ^ in key_schedule()
426 x[0] = z[2] ^ s5[zi(5)] ^ s6[zi(7)] ^ s7[zi(4)] ^ sb8[zi(6)] ^ in key_schedule()
428 x[1] = z[0] ^ s5[xi(0)] ^ s6[xi(2)] ^ s7[xi(1)] ^ sb8[xi(3)] ^ in key_schedule()
430 x[2] = z[1] ^ s5[xi(7)] ^ s6[xi(6)] ^ s7[xi(5)] ^ sb8[xi(4)] ^ in key_schedule()
432 x[3] = z[3] ^ s5[xi(10)] ^ s6[xi(9)] ^ s7[xi(11)] ^ sb8[xi(8)] ^ in key_schedule()
[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()
Dsm3_generic.c29 static inline u32 p0(u32 x) in p0() argument
31 return x ^ rol32(x, 9) ^ rol32(x, 17); in p0()
34 static inline u32 p1(u32 x) in p1() argument
36 return x ^ rol32(x, 15) ^ rol32(x, 23); in p1()
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,
Dgf128mul.c139 static void gf128mul_x8_lle(be128 *x) in gf128mul_x8_lle() argument
141 u64 a = be64_to_cpu(x->a); in gf128mul_x8_lle()
142 u64 b = be64_to_cpu(x->b); in gf128mul_x8_lle()
145 x->b = cpu_to_be64((b >> 8) | (a << 56)); in gf128mul_x8_lle()
146 x->a = cpu_to_be64((a >> 8) ^ (_tt << 48)); in gf128mul_x8_lle()
149 static void gf128mul_x8_bbe(be128 *x) in gf128mul_x8_bbe() argument
151 u64 a = be64_to_cpu(x->a); in gf128mul_x8_bbe()
152 u64 b = be64_to_cpu(x->b); in gf128mul_x8_bbe()
155 x->a = cpu_to_be64((a << 8) | (b >> 56)); in gf128mul_x8_bbe()
156 x->b = cpu_to_be64((b << 8) ^ _tt); in gf128mul_x8_bbe()
[all …]
Dmd5.c35 #define F1(x, y, z) (z ^ (x & (y ^ z))) argument
36 #define F2(x, y, z) F1(z, x, y) argument
37 #define F3(x, y, z) (x ^ y ^ z) argument
38 #define F4(x, y, z) (y ^ (x | ~z)) argument
40 #define MD5STEP(f, w, x, y, z, in, s) \ argument
41 (w += f(x, y, z) + in, w = (w<<s | w>>(32-s)) + x)
Decc.h44 u64 *x; member
49 #define ECC_POINT_INIT(x, y, ndigits) (struct ecc_point) { x, y, ndigits } argument
242 const u64 *x, const struct ecc_point *p,
Decrdsa.c94 !ctx->pub_key.x || in ecrdsa_verify()
139 if (vli_cmp(cc.x, ctx->curve->n, ndigits) == 1) in ecrdsa_verify()
140 vli_sub(cc.x, cc.x, ctx->curve->n, ndigits); in ecrdsa_verify()
143 if (!vli_cmp(cc.x, r, ndigits)) in ecrdsa_verify()
241 vli_from_le64(ctx->pub_key.x, ctx->key, ndigits); in ecrdsa_set_pub_key()
Decc.c80 p->x = ecc_alloc_digits_space(ndigits); in ecc_alloc_point()
81 if (!p->x) in ecc_alloc_point()
93 ecc_free_digits_space(p->x); in ecc_alloc_point()
104 kzfree(p->x); in ecc_free_point()
938 return (vli_is_zero(point->x, point->ndigits) && in ecc_point_is_zero()
1162 vli_set(rx[1], point->x, ndigits); in ecc_point_mult()
1186 vli_mod_mult_fast(z, z, point->x, curve_prime, ndigits); in ecc_point_mult()
1201 vli_set(result->x, rx[0], ndigits); in ecc_point_mult()
1215 vli_set(result->x, q->x, ndigits); in ecc_point_add()
1217 vli_mod_sub(z, result->x, p->x, curve->p, ndigits); in ecc_point_add()
[all …]
Decc_curve_defs.h21 .x = nist_p192_g_x,
47 .x = nist_p256_g_x,
Drmd256.c35 #define F1(x, y, z) (x ^ y ^ z) /* XOR */ argument
36 #define F2(x, y, z) (z ^ (x & (y ^ z))) /* x ? y : z */ argument
37 #define F3(x, y, z) ((x | ~y) ^ z) argument
38 #define F4(x, y, z) (y ^ (z & (x ^ y))) /* z ? x : y */ argument
40 #define ROUND(a, b, c, d, f, k, x, s) { \ argument
41 (a) += f((b), (c), (d)) + le32_to_cpup(&(x)) + (k); \
Drmd128.c35 #define F1(x, y, z) (x ^ y ^ z) /* XOR */ argument
36 #define F2(x, y, z) (z ^ (x & (y ^ z))) /* x ? y : z */ argument
37 #define F3(x, y, z) ((x | ~y) ^ z) argument
38 #define F4(x, y, z) (y ^ (z & (x ^ y))) /* z ? x : y */ argument
40 #define ROUND(a, b, c, d, f, k, x, s) { \ argument
41 (a) += f((b), (c), (d)) + le32_to_cpup(&(x)) + (k); \
Dadiantum.c196 u64 x = le64_to_cpu(v1->b); in le128_add() local
199 r->b = cpu_to_le64(x + y); in le128_add()
201 (x + y < x)); in le128_add()
207 u64 x = le64_to_cpu(v1->b); in le128_sub() local
210 r->b = cpu_to_le64(x - y); in le128_sub()
212 (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); \
Drmd320.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); \
Dxor.c20 #define XOR_SELECT_TEMPLATE(x) (x) argument

12