Lines Matching +full:0 +full:- +full:127

1 /* SPDX-License-Identifier: GPL-2.0 */
6 * This is an efficient implementation of POLYVAL using intel PCLMULQDQ-NI
16 * modulus g(x) = x^128 + x^127 + x^126 + x^121 + 1.
20 * two-step process only requires 1 finite field reduction for every 8
49 .quad 0xc200000000000000, 0xc200000000000000
54 * Performs schoolbook1_iteration on two lists of 128-bit polynomials of length
58 .set i, 0
60 schoolbook1_iteration i 0
66 * Computes the product of two 128-bit polynomials at the memory locations
68 * the 256-bit product into LO, MI, HI.
79 * Later, the 256-bit result can be extracted as:
89 .if (\i == 0 && \xor_sum == 1)
92 vpclmulqdq $0x01, (16*\i)(KEY_POWERS), %xmm0, %xmm2
93 vpclmulqdq $0x00, (16*\i)(KEY_POWERS), %xmm0, %xmm1
94 vpclmulqdq $0x10, (16*\i)(KEY_POWERS), %xmm0, %xmm3
95 vpclmulqdq $0x11, (16*\i)(KEY_POWERS), %xmm0, %xmm4
108 vpclmulqdq $0x01, %xmm0, %xmm1, MI
109 vpclmulqdq $0x10, %xmm0, %xmm1, %xmm2
110 vpclmulqdq $0x00, %xmm0, %xmm1, LO
111 vpclmulqdq $0x11, %xmm0, %xmm1, HI
116 * Computes the 256-bit polynomial represented by LO, HI, MI. Stores
128 * Computes the 128-bit reduction of PH : PL. Stores the result in dest.
131 * x^128 + x^127 + x^126 + x^121 + 1.
133 * We have a 256-bit polynomial PH : PL = P_3 : P_2 : P_1 : P_0 that is the
134 * product of two 128-bit polynomials in Montgomery form. We need to reduce it
146 * x^64 * g*(x) * P_0 + P_0, where g*(x) is bits 64-127 of g(x). Adding this to
147 * the original polynomial gives P_3 : P_2 + P_0 + T_1 : P_1 + T_0 : 0, where T
148 * = T_1 : T_0 = g*(x) * P_0. Thus, bits 0-63 got "folded" into bits 64-191.
150 * Repeating this same process on the next 64 bits "folds" bits 64-127 into bits
151 * 128-255, giving the answer in bits 128-255. This time, we need to cancel P_1
152 * + T_0 in bits 64-127. The multiple of g(x) required is (P_1 + T_0) * g(x) *
154 * P_2 + P_0 + T_1 + V_0 : 0 : 0, where V = V_1 : V_0 = g*(x) * (P_1 + T_0).
166 vpclmulqdq $0x00, PL, GSTAR, TMP_XMM # TMP_XMM = T_1 : T_0 = P_0 * g*(x)
167 pshufd $0b01001110, TMP_XMM, TMP_XMM # TMP_XMM = T_0 : T_1
170 pclmulqdq $0x11, GSTAR, TMP_XMM # TMP_XMM = V_1 : V_0 = V = [(P_1 + T_0) * g*(x)]
188 schoolbook1_iteration 7 0
190 vpclmulqdq $0x00, PL, GSTAR, TMP_XMM
193 schoolbook1_iteration 6 0
195 pshufd $0b01001110, TMP_XMM, TMP_XMM
198 schoolbook1_iteration 5 0
203 schoolbook1_iteration 4 0
208 schoolbook1_iteration 3 0
210 pclmulqdq $0x11, GSTAR, TMP_XMM
213 schoolbook1_iteration 2 0
218 schoolbook1_iteration 1 0
220 schoolbook1_iteration 0 1
227 * Process BLOCKS_LEFT blocks, where 0 < BLOCKS_LEFT < STRIDE_BLOCKS
266 * Computes op1*op2*x^{-128} mod x^128 + x^127 + x^126 + x^121 + 1
287 * h^n * accumulator + h^n * m_0 + ... + h^1 * m_{n-1}
290 * rdi - pointer to precomputed key powers h^8 ... h^1
291 * rsi - pointer to message blocks
292 * rdx - number of blocks to hash
293 * rcx - pointer to the accumulator
304 full_stride 0