1e1051a39Sopenharmony_ci/*
2e1051a39Sopenharmony_ci * Copyright 2005-2021 The OpenSSL Project Authors. All Rights Reserved.
3e1051a39Sopenharmony_ci *
4e1051a39Sopenharmony_ci * Licensed under the Apache License 2.0 (the "License").  You may not use
5e1051a39Sopenharmony_ci * this file except in compliance with the License.  You can obtain a copy
6e1051a39Sopenharmony_ci * in the file LICENSE in the source distribution or at
7e1051a39Sopenharmony_ci * https://www.openssl.org/source/license.html
8e1051a39Sopenharmony_ci */
9e1051a39Sopenharmony_ci
10e1051a39Sopenharmony_ci/**
11e1051a39Sopenharmony_ci * The Whirlpool hashing function.
12e1051a39Sopenharmony_ci *
13e1051a39Sopenharmony_ci * See
14e1051a39Sopenharmony_ci *      P.S.L.M. Barreto, V. Rijmen,
15e1051a39Sopenharmony_ci *      ``The Whirlpool hashing function,''
16e1051a39Sopenharmony_ci *      NESSIE submission, 2000 (tweaked version, 2001),
17e1051a39Sopenharmony_ci *      <https://www.cosic.esat.kuleuven.ac.be/nessie/workshop/submissions/whirlpool.zip>
18e1051a39Sopenharmony_ci *
19e1051a39Sopenharmony_ci * Based on "@version 3.0 (2003.03.12)" by Paulo S.L.M. Barreto and
20e1051a39Sopenharmony_ci * Vincent Rijmen. Lookup "reference implementations" on
21e1051a39Sopenharmony_ci * <http://planeta.terra.com.br/informatica/paulobarreto/>
22e1051a39Sopenharmony_ci *
23e1051a39Sopenharmony_ci * =============================================================================
24e1051a39Sopenharmony_ci *
25e1051a39Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
26e1051a39Sopenharmony_ci * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27e1051a39Sopenharmony_ci * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28e1051a39Sopenharmony_ci * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
29e1051a39Sopenharmony_ci * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30e1051a39Sopenharmony_ci * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31e1051a39Sopenharmony_ci * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32e1051a39Sopenharmony_ci * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33e1051a39Sopenharmony_ci * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
34e1051a39Sopenharmony_ci * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35e1051a39Sopenharmony_ci * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36e1051a39Sopenharmony_ci *
37e1051a39Sopenharmony_ci */
38e1051a39Sopenharmony_ci
39e1051a39Sopenharmony_ci/*
40e1051a39Sopenharmony_ci * Whirlpool low level APIs are deprecated for public use, but still ok for
41e1051a39Sopenharmony_ci * internal use.
42e1051a39Sopenharmony_ci */
43e1051a39Sopenharmony_ci#include "internal/deprecated.h"
44e1051a39Sopenharmony_ci
45e1051a39Sopenharmony_ci#include "internal/cryptlib.h"
46e1051a39Sopenharmony_ci#include "wp_local.h"
47e1051a39Sopenharmony_ci#include <string.h>
48e1051a39Sopenharmony_ci
49e1051a39Sopenharmony_citypedef unsigned char u8;
50e1051a39Sopenharmony_ci#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32)
51e1051a39Sopenharmony_citypedef unsigned __int64 u64;
52e1051a39Sopenharmony_ci#elif defined(__arch64__)
53e1051a39Sopenharmony_citypedef unsigned long u64;
54e1051a39Sopenharmony_ci#else
55e1051a39Sopenharmony_citypedef unsigned long long u64;
56e1051a39Sopenharmony_ci#endif
57e1051a39Sopenharmony_ci
58e1051a39Sopenharmony_ci#define ROUNDS  10
59e1051a39Sopenharmony_ci
60e1051a39Sopenharmony_ci#define STRICT_ALIGNMENT
61e1051a39Sopenharmony_ci#if !defined(PEDANTIC) && (defined(__i386) || defined(__i386__) || \
62e1051a39Sopenharmony_ci                           defined(__x86_64) || defined(__x86_64__) || \
63e1051a39Sopenharmony_ci                           defined(_M_IX86) || defined(_M_AMD64) || \
64e1051a39Sopenharmony_ci                           defined(_M_X64))
65e1051a39Sopenharmony_ci/*
66e1051a39Sopenharmony_ci * Well, formally there're couple of other architectures, which permit
67e1051a39Sopenharmony_ci * unaligned loads, specifically those not crossing cache lines, IA-64 and
68e1051a39Sopenharmony_ci * PowerPC...
69e1051a39Sopenharmony_ci */
70e1051a39Sopenharmony_ci# undef STRICT_ALIGNMENT
71e1051a39Sopenharmony_ci#endif
72e1051a39Sopenharmony_ci
73e1051a39Sopenharmony_ci#ifndef STRICT_ALIGNMENT
74e1051a39Sopenharmony_ci# ifdef __GNUC__
75e1051a39Sopenharmony_citypedef u64 u64_a1 __attribute((__aligned__(1)));
76e1051a39Sopenharmony_ci# else
77e1051a39Sopenharmony_citypedef u64 u64_a1;
78e1051a39Sopenharmony_ci# endif
79e1051a39Sopenharmony_ci#endif
80e1051a39Sopenharmony_ci
81e1051a39Sopenharmony_ci#if defined(__GNUC__) && !defined(STRICT_ALIGNMENT)
82e1051a39Sopenharmony_citypedef u64 u64_aX __attribute((__aligned__(1)));
83e1051a39Sopenharmony_ci#else
84e1051a39Sopenharmony_citypedef u64 u64_aX;
85e1051a39Sopenharmony_ci#endif
86e1051a39Sopenharmony_ci
87e1051a39Sopenharmony_ci#undef SMALL_REGISTER_BANK
88e1051a39Sopenharmony_ci#if defined(__i386) || defined(__i386__) || defined(_M_IX86)
89e1051a39Sopenharmony_ci# define SMALL_REGISTER_BANK
90e1051a39Sopenharmony_ci# if defined(WHIRLPOOL_ASM)
91e1051a39Sopenharmony_ci#  ifndef OPENSSL_SMALL_FOOTPRINT
92e1051a39Sopenharmony_ci/*
93e1051a39Sopenharmony_ci * it appears that for elder non-MMX
94e1051a39Sopenharmony_ci * CPUs this is actually faster!
95e1051a39Sopenharmony_ci */
96e1051a39Sopenharmony_ci#   define OPENSSL_SMALL_FOOTPRINT
97e1051a39Sopenharmony_ci#  endif
98e1051a39Sopenharmony_ci#  define GO_FOR_MMX(ctx,inp,num)     do {                    \
99e1051a39Sopenharmony_ci        void whirlpool_block_mmx(void *,const void *,size_t);   \
100e1051a39Sopenharmony_ci        if (!(OPENSSL_ia32cap_P[0] & (1<<23)))  break;          \
101e1051a39Sopenharmony_ci        whirlpool_block_mmx(ctx->H.c,inp,num);  return;         \
102e1051a39Sopenharmony_ci                                        } while (0)
103e1051a39Sopenharmony_ci# endif
104e1051a39Sopenharmony_ci#endif
105e1051a39Sopenharmony_ci
106e1051a39Sopenharmony_ci#undef ROTATE
107e1051a39Sopenharmony_ci#ifndef PEDANTIC
108e1051a39Sopenharmony_ci# if defined(_MSC_VER)
109e1051a39Sopenharmony_ci#  if defined(_WIN64)            /* applies to both IA-64 and AMD64 */
110e1051a39Sopenharmony_ci#   include <stdlib.h>
111e1051a39Sopenharmony_ci#   pragma intrinsic(_rotl64)
112e1051a39Sopenharmony_ci#   define ROTATE(a,n) _rotl64((a),n)
113e1051a39Sopenharmony_ci#  endif
114e1051a39Sopenharmony_ci# elif defined(__GNUC__) && __GNUC__>=2
115e1051a39Sopenharmony_ci#  if defined(__x86_64) || defined(__x86_64__)
116e1051a39Sopenharmony_ci#   if defined(L_ENDIAN)
117e1051a39Sopenharmony_ci#    define ROTATE(a,n)       ({ u64 ret; asm ("rolq %1,%0"   \
118e1051a39Sopenharmony_ci                                   : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; })
119e1051a39Sopenharmony_ci#   elif defined(B_ENDIAN)
120e1051a39Sopenharmony_ci       /*
121e1051a39Sopenharmony_ci        * Most will argue that x86_64 is always little-endian. Well, yes, but
122e1051a39Sopenharmony_ci        * then we have stratus.com who has modified gcc to "emulate"
123e1051a39Sopenharmony_ci        * big-endian on x86. Is there evidence that they [or somebody else]
124e1051a39Sopenharmony_ci        * won't do same for x86_64? Naturally no. And this line is waiting
125e1051a39Sopenharmony_ci        * ready for that brave soul:-)
126e1051a39Sopenharmony_ci        */
127e1051a39Sopenharmony_ci#    define ROTATE(a,n)       ({ u64 ret; asm ("rorq %1,%0"   \
128e1051a39Sopenharmony_ci                                   : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; })
129e1051a39Sopenharmony_ci#   endif
130e1051a39Sopenharmony_ci#  elif defined(__ia64) || defined(__ia64__)
131e1051a39Sopenharmony_ci#   if defined(L_ENDIAN)
132e1051a39Sopenharmony_ci#    define ROTATE(a,n)       ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
133e1051a39Sopenharmony_ci                                   : "=r"(ret) : "r"(a),"M"(64-(n))); ret; })
134e1051a39Sopenharmony_ci#   elif defined(B_ENDIAN)
135e1051a39Sopenharmony_ci#    define ROTATE(a,n)       ({ u64 ret; asm ("shrp %0=%1,%1,%2"     \
136e1051a39Sopenharmony_ci                                   : "=r"(ret) : "r"(a),"M"(n)); ret; })
137e1051a39Sopenharmony_ci#   endif
138e1051a39Sopenharmony_ci#  endif
139e1051a39Sopenharmony_ci# endif
140e1051a39Sopenharmony_ci#endif
141e1051a39Sopenharmony_ci
142e1051a39Sopenharmony_ci#if defined(OPENSSL_SMALL_FOOTPRINT)
143e1051a39Sopenharmony_ci# if !defined(ROTATE)
144e1051a39Sopenharmony_ci#  if defined(L_ENDIAN)         /* little-endians have to rotate left */
145e1051a39Sopenharmony_ci#   define ROTATE(i,n)       ((i)<<(n) ^ (i)>>(64-n))
146e1051a39Sopenharmony_ci#  elif defined(B_ENDIAN)       /* big-endians have to rotate right */
147e1051a39Sopenharmony_ci#   define ROTATE(i,n)       ((i)>>(n) ^ (i)<<(64-n))
148e1051a39Sopenharmony_ci#  endif
149e1051a39Sopenharmony_ci# endif
150e1051a39Sopenharmony_ci# if defined(ROTATE) && !defined(STRICT_ALIGNMENT)
151e1051a39Sopenharmony_ci#  define STRICT_ALIGNMENT      /* ensure smallest table size */
152e1051a39Sopenharmony_ci# endif
153e1051a39Sopenharmony_ci#endif
154e1051a39Sopenharmony_ci
155e1051a39Sopenharmony_ci/*
156e1051a39Sopenharmony_ci * Table size depends on STRICT_ALIGNMENT and whether or not endian-
157e1051a39Sopenharmony_ci * specific ROTATE macro is defined. If STRICT_ALIGNMENT is not
158e1051a39Sopenharmony_ci * defined, which is normally the case on x86[_64] CPUs, the table is
159e1051a39Sopenharmony_ci * 4KB large unconditionally. Otherwise if ROTATE is defined, the
160e1051a39Sopenharmony_ci * table is 2KB large, and otherwise - 16KB. 2KB table requires a
161e1051a39Sopenharmony_ci * whole bunch of additional rotations, but I'm willing to "trade,"
162e1051a39Sopenharmony_ci * because 16KB table certainly trashes L1 cache. I wish all CPUs
163e1051a39Sopenharmony_ci * could handle unaligned load as 4KB table doesn't trash the cache,
164e1051a39Sopenharmony_ci * nor does it require additional rotations.
165e1051a39Sopenharmony_ci */
166e1051a39Sopenharmony_ci/*
167e1051a39Sopenharmony_ci * Note that every Cn macro expands as two loads: one byte load and
168e1051a39Sopenharmony_ci * one quadword load. One can argue that many single-byte loads
169e1051a39Sopenharmony_ci * is too excessive, as one could load a quadword and "milk" it for
170e1051a39Sopenharmony_ci * eight 8-bit values instead. Well, yes, but in order to do so *and*
171e1051a39Sopenharmony_ci * avoid excessive loads you have to accommodate a handful of 64-bit
172e1051a39Sopenharmony_ci * values in the register bank and issue a bunch of shifts and mask.
173e1051a39Sopenharmony_ci * It's a tradeoff: loads vs. shift and mask in big register bank[!].
174e1051a39Sopenharmony_ci * On most CPUs eight single-byte loads are faster and I let other
175e1051a39Sopenharmony_ci * ones to depend on smart compiler to fold byte loads if beneficial.
176e1051a39Sopenharmony_ci * Hand-coded assembler would be another alternative:-)
177e1051a39Sopenharmony_ci */
178e1051a39Sopenharmony_ci#ifdef STRICT_ALIGNMENT
179e1051a39Sopenharmony_ci# if defined(ROTATE)
180e1051a39Sopenharmony_ci#  define N   1
181e1051a39Sopenharmony_ci#  define LL(c0,c1,c2,c3,c4,c5,c6,c7) c0,c1,c2,c3,c4,c5,c6,c7
182e1051a39Sopenharmony_ci#  define C0(K,i)     (Cx.q[K.c[(i)*8+0]])
183e1051a39Sopenharmony_ci#  define C1(K,i)     ROTATE(Cx.q[K.c[(i)*8+1]],8)
184e1051a39Sopenharmony_ci#  define C2(K,i)     ROTATE(Cx.q[K.c[(i)*8+2]],16)
185e1051a39Sopenharmony_ci#  define C3(K,i)     ROTATE(Cx.q[K.c[(i)*8+3]],24)
186e1051a39Sopenharmony_ci#  define C4(K,i)     ROTATE(Cx.q[K.c[(i)*8+4]],32)
187e1051a39Sopenharmony_ci#  define C5(K,i)     ROTATE(Cx.q[K.c[(i)*8+5]],40)
188e1051a39Sopenharmony_ci#  define C6(K,i)     ROTATE(Cx.q[K.c[(i)*8+6]],48)
189e1051a39Sopenharmony_ci#  define C7(K,i)     ROTATE(Cx.q[K.c[(i)*8+7]],56)
190e1051a39Sopenharmony_ci# else
191e1051a39Sopenharmony_ci#  define N   8
192e1051a39Sopenharmony_ci#  define LL(c0,c1,c2,c3,c4,c5,c6,c7) c0,c1,c2,c3,c4,c5,c6,c7, \
193e1051a39Sopenharmony_ci                                        c7,c0,c1,c2,c3,c4,c5,c6, \
194e1051a39Sopenharmony_ci                                        c6,c7,c0,c1,c2,c3,c4,c5, \
195e1051a39Sopenharmony_ci                                        c5,c6,c7,c0,c1,c2,c3,c4, \
196e1051a39Sopenharmony_ci                                        c4,c5,c6,c7,c0,c1,c2,c3, \
197e1051a39Sopenharmony_ci                                        c3,c4,c5,c6,c7,c0,c1,c2, \
198e1051a39Sopenharmony_ci                                        c2,c3,c4,c5,c6,c7,c0,c1, \
199e1051a39Sopenharmony_ci                                        c1,c2,c3,c4,c5,c6,c7,c0
200e1051a39Sopenharmony_ci#  define C0(K,i)     (Cx.q[0+8*K.c[(i)*8+0]])
201e1051a39Sopenharmony_ci#  define C1(K,i)     (Cx.q[1+8*K.c[(i)*8+1]])
202e1051a39Sopenharmony_ci#  define C2(K,i)     (Cx.q[2+8*K.c[(i)*8+2]])
203e1051a39Sopenharmony_ci#  define C3(K,i)     (Cx.q[3+8*K.c[(i)*8+3]])
204e1051a39Sopenharmony_ci#  define C4(K,i)     (Cx.q[4+8*K.c[(i)*8+4]])
205e1051a39Sopenharmony_ci#  define C5(K,i)     (Cx.q[5+8*K.c[(i)*8+5]])
206e1051a39Sopenharmony_ci#  define C6(K,i)     (Cx.q[6+8*K.c[(i)*8+6]])
207e1051a39Sopenharmony_ci#  define C7(K,i)     (Cx.q[7+8*K.c[(i)*8+7]])
208e1051a39Sopenharmony_ci# endif
209e1051a39Sopenharmony_ci#else
210e1051a39Sopenharmony_ci# define N     2
211e1051a39Sopenharmony_ci# define LL(c0,c1,c2,c3,c4,c5,c6,c7)   c0,c1,c2,c3,c4,c5,c6,c7, \
212e1051a39Sopenharmony_ci                                        c0,c1,c2,c3,c4,c5,c6,c7
213e1051a39Sopenharmony_ci# define C0(K,i)       (((u64*)(Cx.c+0))[2*K.c[(i)*8+0]])
214e1051a39Sopenharmony_ci# define C1(K,i)       (((u64_a1*)(Cx.c+7))[2*K.c[(i)*8+1]])
215e1051a39Sopenharmony_ci# define C2(K,i)       (((u64_a1*)(Cx.c+6))[2*K.c[(i)*8+2]])
216e1051a39Sopenharmony_ci# define C3(K,i)       (((u64_a1*)(Cx.c+5))[2*K.c[(i)*8+3]])
217e1051a39Sopenharmony_ci# define C4(K,i)       (((u64_a1*)(Cx.c+4))[2*K.c[(i)*8+4]])
218e1051a39Sopenharmony_ci# define C5(K,i)       (((u64_a1*)(Cx.c+3))[2*K.c[(i)*8+5]])
219e1051a39Sopenharmony_ci# define C6(K,i)       (((u64_a1*)(Cx.c+2))[2*K.c[(i)*8+6]])
220e1051a39Sopenharmony_ci# define C7(K,i)       (((u64_a1*)(Cx.c+1))[2*K.c[(i)*8+7]])
221e1051a39Sopenharmony_ci#endif
222e1051a39Sopenharmony_ci
223e1051a39Sopenharmony_cistatic const
224e1051a39Sopenharmony_ci    union {
225e1051a39Sopenharmony_ci    u8 c[(256 * N + ROUNDS) * sizeof(u64)];
226e1051a39Sopenharmony_ci    u64 q[(256 * N + ROUNDS)];
227e1051a39Sopenharmony_ci} Cx = {
228e1051a39Sopenharmony_ci        {
229e1051a39Sopenharmony_ci            /* Note endian-neutral representation:-) */
230e1051a39Sopenharmony_ci            LL(0x18, 0x18, 0x60, 0x18, 0xc0, 0x78, 0x30, 0xd8),
231e1051a39Sopenharmony_ci            LL(0x23, 0x23, 0x8c, 0x23, 0x05, 0xaf, 0x46, 0x26),
232e1051a39Sopenharmony_ci            LL(0xc6, 0xc6, 0x3f, 0xc6, 0x7e, 0xf9, 0x91, 0xb8),
233e1051a39Sopenharmony_ci            LL(0xe8, 0xe8, 0x87, 0xe8, 0x13, 0x6f, 0xcd, 0xfb),
234e1051a39Sopenharmony_ci            LL(0x87, 0x87, 0x26, 0x87, 0x4c, 0xa1, 0x13, 0xcb),
235e1051a39Sopenharmony_ci            LL(0xb8, 0xb8, 0xda, 0xb8, 0xa9, 0x62, 0x6d, 0x11),
236e1051a39Sopenharmony_ci            LL(0x01, 0x01, 0x04, 0x01, 0x08, 0x05, 0x02, 0x09),
237e1051a39Sopenharmony_ci            LL(0x4f, 0x4f, 0x21, 0x4f, 0x42, 0x6e, 0x9e, 0x0d),
238e1051a39Sopenharmony_ci            LL(0x36, 0x36, 0xd8, 0x36, 0xad, 0xee, 0x6c, 0x9b),
239e1051a39Sopenharmony_ci            LL(0xa6, 0xa6, 0xa2, 0xa6, 0x59, 0x04, 0x51, 0xff),
240e1051a39Sopenharmony_ci            LL(0xd2, 0xd2, 0x6f, 0xd2, 0xde, 0xbd, 0xb9, 0x0c),
241e1051a39Sopenharmony_ci            LL(0xf5, 0xf5, 0xf3, 0xf5, 0xfb, 0x06, 0xf7, 0x0e),
242e1051a39Sopenharmony_ci            LL(0x79, 0x79, 0xf9, 0x79, 0xef, 0x80, 0xf2, 0x96),
243e1051a39Sopenharmony_ci            LL(0x6f, 0x6f, 0xa1, 0x6f, 0x5f, 0xce, 0xde, 0x30),
244e1051a39Sopenharmony_ci            LL(0x91, 0x91, 0x7e, 0x91, 0xfc, 0xef, 0x3f, 0x6d),
245e1051a39Sopenharmony_ci            LL(0x52, 0x52, 0x55, 0x52, 0xaa, 0x07, 0xa4, 0xf8),
246e1051a39Sopenharmony_ci            LL(0x60, 0x60, 0x9d, 0x60, 0x27, 0xfd, 0xc0, 0x47),
247e1051a39Sopenharmony_ci            LL(0xbc, 0xbc, 0xca, 0xbc, 0x89, 0x76, 0x65, 0x35),
248e1051a39Sopenharmony_ci            LL(0x9b, 0x9b, 0x56, 0x9b, 0xac, 0xcd, 0x2b, 0x37),
249e1051a39Sopenharmony_ci            LL(0x8e, 0x8e, 0x02, 0x8e, 0x04, 0x8c, 0x01, 0x8a),
250e1051a39Sopenharmony_ci            LL(0xa3, 0xa3, 0xb6, 0xa3, 0x71, 0x15, 0x5b, 0xd2),
251e1051a39Sopenharmony_ci            LL(0x0c, 0x0c, 0x30, 0x0c, 0x60, 0x3c, 0x18, 0x6c),
252e1051a39Sopenharmony_ci            LL(0x7b, 0x7b, 0xf1, 0x7b, 0xff, 0x8a, 0xf6, 0x84),
253e1051a39Sopenharmony_ci            LL(0x35, 0x35, 0xd4, 0x35, 0xb5, 0xe1, 0x6a, 0x80),
254e1051a39Sopenharmony_ci            LL(0x1d, 0x1d, 0x74, 0x1d, 0xe8, 0x69, 0x3a, 0xf5),
255e1051a39Sopenharmony_ci            LL(0xe0, 0xe0, 0xa7, 0xe0, 0x53, 0x47, 0xdd, 0xb3),
256e1051a39Sopenharmony_ci            LL(0xd7, 0xd7, 0x7b, 0xd7, 0xf6, 0xac, 0xb3, 0x21),
257e1051a39Sopenharmony_ci            LL(0xc2, 0xc2, 0x2f, 0xc2, 0x5e, 0xed, 0x99, 0x9c),
258e1051a39Sopenharmony_ci            LL(0x2e, 0x2e, 0xb8, 0x2e, 0x6d, 0x96, 0x5c, 0x43),
259e1051a39Sopenharmony_ci            LL(0x4b, 0x4b, 0x31, 0x4b, 0x62, 0x7a, 0x96, 0x29),
260e1051a39Sopenharmony_ci            LL(0xfe, 0xfe, 0xdf, 0xfe, 0xa3, 0x21, 0xe1, 0x5d),
261e1051a39Sopenharmony_ci            LL(0x57, 0x57, 0x41, 0x57, 0x82, 0x16, 0xae, 0xd5),
262e1051a39Sopenharmony_ci            LL(0x15, 0x15, 0x54, 0x15, 0xa8, 0x41, 0x2a, 0xbd),
263e1051a39Sopenharmony_ci            LL(0x77, 0x77, 0xc1, 0x77, 0x9f, 0xb6, 0xee, 0xe8),
264e1051a39Sopenharmony_ci            LL(0x37, 0x37, 0xdc, 0x37, 0xa5, 0xeb, 0x6e, 0x92),
265e1051a39Sopenharmony_ci            LL(0xe5, 0xe5, 0xb3, 0xe5, 0x7b, 0x56, 0xd7, 0x9e),
266e1051a39Sopenharmony_ci            LL(0x9f, 0x9f, 0x46, 0x9f, 0x8c, 0xd9, 0x23, 0x13),
267e1051a39Sopenharmony_ci            LL(0xf0, 0xf0, 0xe7, 0xf0, 0xd3, 0x17, 0xfd, 0x23),
268e1051a39Sopenharmony_ci            LL(0x4a, 0x4a, 0x35, 0x4a, 0x6a, 0x7f, 0x94, 0x20),
269e1051a39Sopenharmony_ci            LL(0xda, 0xda, 0x4f, 0xda, 0x9e, 0x95, 0xa9, 0x44),
270e1051a39Sopenharmony_ci            LL(0x58, 0x58, 0x7d, 0x58, 0xfa, 0x25, 0xb0, 0xa2),
271e1051a39Sopenharmony_ci            LL(0xc9, 0xc9, 0x03, 0xc9, 0x06, 0xca, 0x8f, 0xcf),
272e1051a39Sopenharmony_ci            LL(0x29, 0x29, 0xa4, 0x29, 0x55, 0x8d, 0x52, 0x7c),
273e1051a39Sopenharmony_ci            LL(0x0a, 0x0a, 0x28, 0x0a, 0x50, 0x22, 0x14, 0x5a),
274e1051a39Sopenharmony_ci            LL(0xb1, 0xb1, 0xfe, 0xb1, 0xe1, 0x4f, 0x7f, 0x50),
275e1051a39Sopenharmony_ci            LL(0xa0, 0xa0, 0xba, 0xa0, 0x69, 0x1a, 0x5d, 0xc9),
276e1051a39Sopenharmony_ci            LL(0x6b, 0x6b, 0xb1, 0x6b, 0x7f, 0xda, 0xd6, 0x14),
277e1051a39Sopenharmony_ci            LL(0x85, 0x85, 0x2e, 0x85, 0x5c, 0xab, 0x17, 0xd9),
278e1051a39Sopenharmony_ci            LL(0xbd, 0xbd, 0xce, 0xbd, 0x81, 0x73, 0x67, 0x3c),
279e1051a39Sopenharmony_ci            LL(0x5d, 0x5d, 0x69, 0x5d, 0xd2, 0x34, 0xba, 0x8f),
280e1051a39Sopenharmony_ci            LL(0x10, 0x10, 0x40, 0x10, 0x80, 0x50, 0x20, 0x90),
281e1051a39Sopenharmony_ci            LL(0xf4, 0xf4, 0xf7, 0xf4, 0xf3, 0x03, 0xf5, 0x07),
282e1051a39Sopenharmony_ci            LL(0xcb, 0xcb, 0x0b, 0xcb, 0x16, 0xc0, 0x8b, 0xdd),
283e1051a39Sopenharmony_ci            LL(0x3e, 0x3e, 0xf8, 0x3e, 0xed, 0xc6, 0x7c, 0xd3),
284e1051a39Sopenharmony_ci            LL(0x05, 0x05, 0x14, 0x05, 0x28, 0x11, 0x0a, 0x2d),
285e1051a39Sopenharmony_ci            LL(0x67, 0x67, 0x81, 0x67, 0x1f, 0xe6, 0xce, 0x78),
286e1051a39Sopenharmony_ci            LL(0xe4, 0xe4, 0xb7, 0xe4, 0x73, 0x53, 0xd5, 0x97),
287e1051a39Sopenharmony_ci            LL(0x27, 0x27, 0x9c, 0x27, 0x25, 0xbb, 0x4e, 0x02),
288e1051a39Sopenharmony_ci            LL(0x41, 0x41, 0x19, 0x41, 0x32, 0x58, 0x82, 0x73),
289e1051a39Sopenharmony_ci            LL(0x8b, 0x8b, 0x16, 0x8b, 0x2c, 0x9d, 0x0b, 0xa7),
290e1051a39Sopenharmony_ci            LL(0xa7, 0xa7, 0xa6, 0xa7, 0x51, 0x01, 0x53, 0xf6),
291e1051a39Sopenharmony_ci            LL(0x7d, 0x7d, 0xe9, 0x7d, 0xcf, 0x94, 0xfa, 0xb2),
292e1051a39Sopenharmony_ci            LL(0x95, 0x95, 0x6e, 0x95, 0xdc, 0xfb, 0x37, 0x49),
293e1051a39Sopenharmony_ci            LL(0xd8, 0xd8, 0x47, 0xd8, 0x8e, 0x9f, 0xad, 0x56),
294e1051a39Sopenharmony_ci            LL(0xfb, 0xfb, 0xcb, 0xfb, 0x8b, 0x30, 0xeb, 0x70),
295e1051a39Sopenharmony_ci            LL(0xee, 0xee, 0x9f, 0xee, 0x23, 0x71, 0xc1, 0xcd),
296e1051a39Sopenharmony_ci            LL(0x7c, 0x7c, 0xed, 0x7c, 0xc7, 0x91, 0xf8, 0xbb),
297e1051a39Sopenharmony_ci            LL(0x66, 0x66, 0x85, 0x66, 0x17, 0xe3, 0xcc, 0x71),
298e1051a39Sopenharmony_ci            LL(0xdd, 0xdd, 0x53, 0xdd, 0xa6, 0x8e, 0xa7, 0x7b),
299e1051a39Sopenharmony_ci            LL(0x17, 0x17, 0x5c, 0x17, 0xb8, 0x4b, 0x2e, 0xaf),
300e1051a39Sopenharmony_ci            LL(0x47, 0x47, 0x01, 0x47, 0x02, 0x46, 0x8e, 0x45),
301e1051a39Sopenharmony_ci            LL(0x9e, 0x9e, 0x42, 0x9e, 0x84, 0xdc, 0x21, 0x1a),
302e1051a39Sopenharmony_ci            LL(0xca, 0xca, 0x0f, 0xca, 0x1e, 0xc5, 0x89, 0xd4),
303e1051a39Sopenharmony_ci            LL(0x2d, 0x2d, 0xb4, 0x2d, 0x75, 0x99, 0x5a, 0x58),
304e1051a39Sopenharmony_ci            LL(0xbf, 0xbf, 0xc6, 0xbf, 0x91, 0x79, 0x63, 0x2e),
305e1051a39Sopenharmony_ci            LL(0x07, 0x07, 0x1c, 0x07, 0x38, 0x1b, 0x0e, 0x3f),
306e1051a39Sopenharmony_ci            LL(0xad, 0xad, 0x8e, 0xad, 0x01, 0x23, 0x47, 0xac),
307e1051a39Sopenharmony_ci            LL(0x5a, 0x5a, 0x75, 0x5a, 0xea, 0x2f, 0xb4, 0xb0),
308e1051a39Sopenharmony_ci            LL(0x83, 0x83, 0x36, 0x83, 0x6c, 0xb5, 0x1b, 0xef),
309e1051a39Sopenharmony_ci            LL(0x33, 0x33, 0xcc, 0x33, 0x85, 0xff, 0x66, 0xb6),
310e1051a39Sopenharmony_ci            LL(0x63, 0x63, 0x91, 0x63, 0x3f, 0xf2, 0xc6, 0x5c),
311e1051a39Sopenharmony_ci            LL(0x02, 0x02, 0x08, 0x02, 0x10, 0x0a, 0x04, 0x12),
312e1051a39Sopenharmony_ci            LL(0xaa, 0xaa, 0x92, 0xaa, 0x39, 0x38, 0x49, 0x93),
313e1051a39Sopenharmony_ci            LL(0x71, 0x71, 0xd9, 0x71, 0xaf, 0xa8, 0xe2, 0xde),
314e1051a39Sopenharmony_ci            LL(0xc8, 0xc8, 0x07, 0xc8, 0x0e, 0xcf, 0x8d, 0xc6),
315e1051a39Sopenharmony_ci            LL(0x19, 0x19, 0x64, 0x19, 0xc8, 0x7d, 0x32, 0xd1),
316e1051a39Sopenharmony_ci            LL(0x49, 0x49, 0x39, 0x49, 0x72, 0x70, 0x92, 0x3b),
317e1051a39Sopenharmony_ci            LL(0xd9, 0xd9, 0x43, 0xd9, 0x86, 0x9a, 0xaf, 0x5f),
318e1051a39Sopenharmony_ci            LL(0xf2, 0xf2, 0xef, 0xf2, 0xc3, 0x1d, 0xf9, 0x31),
319e1051a39Sopenharmony_ci            LL(0xe3, 0xe3, 0xab, 0xe3, 0x4b, 0x48, 0xdb, 0xa8),
320e1051a39Sopenharmony_ci            LL(0x5b, 0x5b, 0x71, 0x5b, 0xe2, 0x2a, 0xb6, 0xb9),
321e1051a39Sopenharmony_ci            LL(0x88, 0x88, 0x1a, 0x88, 0x34, 0x92, 0x0d, 0xbc),
322e1051a39Sopenharmony_ci            LL(0x9a, 0x9a, 0x52, 0x9a, 0xa4, 0xc8, 0x29, 0x3e),
323e1051a39Sopenharmony_ci            LL(0x26, 0x26, 0x98, 0x26, 0x2d, 0xbe, 0x4c, 0x0b),
324e1051a39Sopenharmony_ci            LL(0x32, 0x32, 0xc8, 0x32, 0x8d, 0xfa, 0x64, 0xbf),
325e1051a39Sopenharmony_ci            LL(0xb0, 0xb0, 0xfa, 0xb0, 0xe9, 0x4a, 0x7d, 0x59),
326e1051a39Sopenharmony_ci            LL(0xe9, 0xe9, 0x83, 0xe9, 0x1b, 0x6a, 0xcf, 0xf2),
327e1051a39Sopenharmony_ci            LL(0x0f, 0x0f, 0x3c, 0x0f, 0x78, 0x33, 0x1e, 0x77),
328e1051a39Sopenharmony_ci            LL(0xd5, 0xd5, 0x73, 0xd5, 0xe6, 0xa6, 0xb7, 0x33),
329e1051a39Sopenharmony_ci            LL(0x80, 0x80, 0x3a, 0x80, 0x74, 0xba, 0x1d, 0xf4),
330e1051a39Sopenharmony_ci            LL(0xbe, 0xbe, 0xc2, 0xbe, 0x99, 0x7c, 0x61, 0x27),
331e1051a39Sopenharmony_ci            LL(0xcd, 0xcd, 0x13, 0xcd, 0x26, 0xde, 0x87, 0xeb),
332e1051a39Sopenharmony_ci            LL(0x34, 0x34, 0xd0, 0x34, 0xbd, 0xe4, 0x68, 0x89),
333e1051a39Sopenharmony_ci            LL(0x48, 0x48, 0x3d, 0x48, 0x7a, 0x75, 0x90, 0x32),
334e1051a39Sopenharmony_ci            LL(0xff, 0xff, 0xdb, 0xff, 0xab, 0x24, 0xe3, 0x54),
335e1051a39Sopenharmony_ci            LL(0x7a, 0x7a, 0xf5, 0x7a, 0xf7, 0x8f, 0xf4, 0x8d),
336e1051a39Sopenharmony_ci            LL(0x90, 0x90, 0x7a, 0x90, 0xf4, 0xea, 0x3d, 0x64),
337e1051a39Sopenharmony_ci            LL(0x5f, 0x5f, 0x61, 0x5f, 0xc2, 0x3e, 0xbe, 0x9d),
338e1051a39Sopenharmony_ci            LL(0x20, 0x20, 0x80, 0x20, 0x1d, 0xa0, 0x40, 0x3d),
339e1051a39Sopenharmony_ci            LL(0x68, 0x68, 0xbd, 0x68, 0x67, 0xd5, 0xd0, 0x0f),
340e1051a39Sopenharmony_ci            LL(0x1a, 0x1a, 0x68, 0x1a, 0xd0, 0x72, 0x34, 0xca),
341e1051a39Sopenharmony_ci            LL(0xae, 0xae, 0x82, 0xae, 0x19, 0x2c, 0x41, 0xb7),
342e1051a39Sopenharmony_ci            LL(0xb4, 0xb4, 0xea, 0xb4, 0xc9, 0x5e, 0x75, 0x7d),
343e1051a39Sopenharmony_ci            LL(0x54, 0x54, 0x4d, 0x54, 0x9a, 0x19, 0xa8, 0xce),
344e1051a39Sopenharmony_ci            LL(0x93, 0x93, 0x76, 0x93, 0xec, 0xe5, 0x3b, 0x7f),
345e1051a39Sopenharmony_ci            LL(0x22, 0x22, 0x88, 0x22, 0x0d, 0xaa, 0x44, 0x2f),
346e1051a39Sopenharmony_ci            LL(0x64, 0x64, 0x8d, 0x64, 0x07, 0xe9, 0xc8, 0x63),
347e1051a39Sopenharmony_ci            LL(0xf1, 0xf1, 0xe3, 0xf1, 0xdb, 0x12, 0xff, 0x2a),
348e1051a39Sopenharmony_ci            LL(0x73, 0x73, 0xd1, 0x73, 0xbf, 0xa2, 0xe6, 0xcc),
349e1051a39Sopenharmony_ci            LL(0x12, 0x12, 0x48, 0x12, 0x90, 0x5a, 0x24, 0x82),
350e1051a39Sopenharmony_ci            LL(0x40, 0x40, 0x1d, 0x40, 0x3a, 0x5d, 0x80, 0x7a),
351e1051a39Sopenharmony_ci            LL(0x08, 0x08, 0x20, 0x08, 0x40, 0x28, 0x10, 0x48),
352e1051a39Sopenharmony_ci            LL(0xc3, 0xc3, 0x2b, 0xc3, 0x56, 0xe8, 0x9b, 0x95),
353e1051a39Sopenharmony_ci            LL(0xec, 0xec, 0x97, 0xec, 0x33, 0x7b, 0xc5, 0xdf),
354e1051a39Sopenharmony_ci            LL(0xdb, 0xdb, 0x4b, 0xdb, 0x96, 0x90, 0xab, 0x4d),
355e1051a39Sopenharmony_ci            LL(0xa1, 0xa1, 0xbe, 0xa1, 0x61, 0x1f, 0x5f, 0xc0),
356e1051a39Sopenharmony_ci            LL(0x8d, 0x8d, 0x0e, 0x8d, 0x1c, 0x83, 0x07, 0x91),
357e1051a39Sopenharmony_ci            LL(0x3d, 0x3d, 0xf4, 0x3d, 0xf5, 0xc9, 0x7a, 0xc8),
358e1051a39Sopenharmony_ci            LL(0x97, 0x97, 0x66, 0x97, 0xcc, 0xf1, 0x33, 0x5b),
359e1051a39Sopenharmony_ci            LL(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
360e1051a39Sopenharmony_ci            LL(0xcf, 0xcf, 0x1b, 0xcf, 0x36, 0xd4, 0x83, 0xf9),
361e1051a39Sopenharmony_ci            LL(0x2b, 0x2b, 0xac, 0x2b, 0x45, 0x87, 0x56, 0x6e),
362e1051a39Sopenharmony_ci            LL(0x76, 0x76, 0xc5, 0x76, 0x97, 0xb3, 0xec, 0xe1),
363e1051a39Sopenharmony_ci            LL(0x82, 0x82, 0x32, 0x82, 0x64, 0xb0, 0x19, 0xe6),
364e1051a39Sopenharmony_ci            LL(0xd6, 0xd6, 0x7f, 0xd6, 0xfe, 0xa9, 0xb1, 0x28),
365e1051a39Sopenharmony_ci            LL(0x1b, 0x1b, 0x6c, 0x1b, 0xd8, 0x77, 0x36, 0xc3),
366e1051a39Sopenharmony_ci            LL(0xb5, 0xb5, 0xee, 0xb5, 0xc1, 0x5b, 0x77, 0x74),
367e1051a39Sopenharmony_ci            LL(0xaf, 0xaf, 0x86, 0xaf, 0x11, 0x29, 0x43, 0xbe),
368e1051a39Sopenharmony_ci            LL(0x6a, 0x6a, 0xb5, 0x6a, 0x77, 0xdf, 0xd4, 0x1d),
369e1051a39Sopenharmony_ci            LL(0x50, 0x50, 0x5d, 0x50, 0xba, 0x0d, 0xa0, 0xea),
370e1051a39Sopenharmony_ci            LL(0x45, 0x45, 0x09, 0x45, 0x12, 0x4c, 0x8a, 0x57),
371e1051a39Sopenharmony_ci            LL(0xf3, 0xf3, 0xeb, 0xf3, 0xcb, 0x18, 0xfb, 0x38),
372e1051a39Sopenharmony_ci            LL(0x30, 0x30, 0xc0, 0x30, 0x9d, 0xf0, 0x60, 0xad),
373e1051a39Sopenharmony_ci            LL(0xef, 0xef, 0x9b, 0xef, 0x2b, 0x74, 0xc3, 0xc4),
374e1051a39Sopenharmony_ci            LL(0x3f, 0x3f, 0xfc, 0x3f, 0xe5, 0xc3, 0x7e, 0xda),
375e1051a39Sopenharmony_ci            LL(0x55, 0x55, 0x49, 0x55, 0x92, 0x1c, 0xaa, 0xc7),
376e1051a39Sopenharmony_ci            LL(0xa2, 0xa2, 0xb2, 0xa2, 0x79, 0x10, 0x59, 0xdb),
377e1051a39Sopenharmony_ci            LL(0xea, 0xea, 0x8f, 0xea, 0x03, 0x65, 0xc9, 0xe9),
378e1051a39Sopenharmony_ci            LL(0x65, 0x65, 0x89, 0x65, 0x0f, 0xec, 0xca, 0x6a),
379e1051a39Sopenharmony_ci            LL(0xba, 0xba, 0xd2, 0xba, 0xb9, 0x68, 0x69, 0x03),
380e1051a39Sopenharmony_ci            LL(0x2f, 0x2f, 0xbc, 0x2f, 0x65, 0x93, 0x5e, 0x4a),
381e1051a39Sopenharmony_ci            LL(0xc0, 0xc0, 0x27, 0xc0, 0x4e, 0xe7, 0x9d, 0x8e),
382e1051a39Sopenharmony_ci            LL(0xde, 0xde, 0x5f, 0xde, 0xbe, 0x81, 0xa1, 0x60),
383e1051a39Sopenharmony_ci            LL(0x1c, 0x1c, 0x70, 0x1c, 0xe0, 0x6c, 0x38, 0xfc),
384e1051a39Sopenharmony_ci            LL(0xfd, 0xfd, 0xd3, 0xfd, 0xbb, 0x2e, 0xe7, 0x46),
385e1051a39Sopenharmony_ci            LL(0x4d, 0x4d, 0x29, 0x4d, 0x52, 0x64, 0x9a, 0x1f),
386e1051a39Sopenharmony_ci            LL(0x92, 0x92, 0x72, 0x92, 0xe4, 0xe0, 0x39, 0x76),
387e1051a39Sopenharmony_ci            LL(0x75, 0x75, 0xc9, 0x75, 0x8f, 0xbc, 0xea, 0xfa),
388e1051a39Sopenharmony_ci            LL(0x06, 0x06, 0x18, 0x06, 0x30, 0x1e, 0x0c, 0x36),
389e1051a39Sopenharmony_ci            LL(0x8a, 0x8a, 0x12, 0x8a, 0x24, 0x98, 0x09, 0xae),
390e1051a39Sopenharmony_ci            LL(0xb2, 0xb2, 0xf2, 0xb2, 0xf9, 0x40, 0x79, 0x4b),
391e1051a39Sopenharmony_ci            LL(0xe6, 0xe6, 0xbf, 0xe6, 0x63, 0x59, 0xd1, 0x85),
392e1051a39Sopenharmony_ci            LL(0x0e, 0x0e, 0x38, 0x0e, 0x70, 0x36, 0x1c, 0x7e),
393e1051a39Sopenharmony_ci            LL(0x1f, 0x1f, 0x7c, 0x1f, 0xf8, 0x63, 0x3e, 0xe7),
394e1051a39Sopenharmony_ci            LL(0x62, 0x62, 0x95, 0x62, 0x37, 0xf7, 0xc4, 0x55),
395e1051a39Sopenharmony_ci            LL(0xd4, 0xd4, 0x77, 0xd4, 0xee, 0xa3, 0xb5, 0x3a),
396e1051a39Sopenharmony_ci            LL(0xa8, 0xa8, 0x9a, 0xa8, 0x29, 0x32, 0x4d, 0x81),
397e1051a39Sopenharmony_ci            LL(0x96, 0x96, 0x62, 0x96, 0xc4, 0xf4, 0x31, 0x52),
398e1051a39Sopenharmony_ci            LL(0xf9, 0xf9, 0xc3, 0xf9, 0x9b, 0x3a, 0xef, 0x62),
399e1051a39Sopenharmony_ci            LL(0xc5, 0xc5, 0x33, 0xc5, 0x66, 0xf6, 0x97, 0xa3),
400e1051a39Sopenharmony_ci            LL(0x25, 0x25, 0x94, 0x25, 0x35, 0xb1, 0x4a, 0x10),
401e1051a39Sopenharmony_ci            LL(0x59, 0x59, 0x79, 0x59, 0xf2, 0x20, 0xb2, 0xab),
402e1051a39Sopenharmony_ci            LL(0x84, 0x84, 0x2a, 0x84, 0x54, 0xae, 0x15, 0xd0),
403e1051a39Sopenharmony_ci            LL(0x72, 0x72, 0xd5, 0x72, 0xb7, 0xa7, 0xe4, 0xc5),
404e1051a39Sopenharmony_ci            LL(0x39, 0x39, 0xe4, 0x39, 0xd5, 0xdd, 0x72, 0xec),
405e1051a39Sopenharmony_ci            LL(0x4c, 0x4c, 0x2d, 0x4c, 0x5a, 0x61, 0x98, 0x16),
406e1051a39Sopenharmony_ci            LL(0x5e, 0x5e, 0x65, 0x5e, 0xca, 0x3b, 0xbc, 0x94),
407e1051a39Sopenharmony_ci            LL(0x78, 0x78, 0xfd, 0x78, 0xe7, 0x85, 0xf0, 0x9f),
408e1051a39Sopenharmony_ci            LL(0x38, 0x38, 0xe0, 0x38, 0xdd, 0xd8, 0x70, 0xe5),
409e1051a39Sopenharmony_ci            LL(0x8c, 0x8c, 0x0a, 0x8c, 0x14, 0x86, 0x05, 0x98),
410e1051a39Sopenharmony_ci            LL(0xd1, 0xd1, 0x63, 0xd1, 0xc6, 0xb2, 0xbf, 0x17),
411e1051a39Sopenharmony_ci            LL(0xa5, 0xa5, 0xae, 0xa5, 0x41, 0x0b, 0x57, 0xe4),
412e1051a39Sopenharmony_ci            LL(0xe2, 0xe2, 0xaf, 0xe2, 0x43, 0x4d, 0xd9, 0xa1),
413e1051a39Sopenharmony_ci            LL(0x61, 0x61, 0x99, 0x61, 0x2f, 0xf8, 0xc2, 0x4e),
414e1051a39Sopenharmony_ci            LL(0xb3, 0xb3, 0xf6, 0xb3, 0xf1, 0x45, 0x7b, 0x42),
415e1051a39Sopenharmony_ci            LL(0x21, 0x21, 0x84, 0x21, 0x15, 0xa5, 0x42, 0x34),
416e1051a39Sopenharmony_ci            LL(0x9c, 0x9c, 0x4a, 0x9c, 0x94, 0xd6, 0x25, 0x08),
417e1051a39Sopenharmony_ci            LL(0x1e, 0x1e, 0x78, 0x1e, 0xf0, 0x66, 0x3c, 0xee),
418e1051a39Sopenharmony_ci            LL(0x43, 0x43, 0x11, 0x43, 0x22, 0x52, 0x86, 0x61),
419e1051a39Sopenharmony_ci            LL(0xc7, 0xc7, 0x3b, 0xc7, 0x76, 0xfc, 0x93, 0xb1),
420e1051a39Sopenharmony_ci            LL(0xfc, 0xfc, 0xd7, 0xfc, 0xb3, 0x2b, 0xe5, 0x4f),
421e1051a39Sopenharmony_ci            LL(0x04, 0x04, 0x10, 0x04, 0x20, 0x14, 0x08, 0x24),
422e1051a39Sopenharmony_ci            LL(0x51, 0x51, 0x59, 0x51, 0xb2, 0x08, 0xa2, 0xe3),
423e1051a39Sopenharmony_ci            LL(0x99, 0x99, 0x5e, 0x99, 0xbc, 0xc7, 0x2f, 0x25),
424e1051a39Sopenharmony_ci            LL(0x6d, 0x6d, 0xa9, 0x6d, 0x4f, 0xc4, 0xda, 0x22),
425e1051a39Sopenharmony_ci            LL(0x0d, 0x0d, 0x34, 0x0d, 0x68, 0x39, 0x1a, 0x65),
426e1051a39Sopenharmony_ci            LL(0xfa, 0xfa, 0xcf, 0xfa, 0x83, 0x35, 0xe9, 0x79),
427e1051a39Sopenharmony_ci            LL(0xdf, 0xdf, 0x5b, 0xdf, 0xb6, 0x84, 0xa3, 0x69),
428e1051a39Sopenharmony_ci            LL(0x7e, 0x7e, 0xe5, 0x7e, 0xd7, 0x9b, 0xfc, 0xa9),
429e1051a39Sopenharmony_ci            LL(0x24, 0x24, 0x90, 0x24, 0x3d, 0xb4, 0x48, 0x19),
430e1051a39Sopenharmony_ci            LL(0x3b, 0x3b, 0xec, 0x3b, 0xc5, 0xd7, 0x76, 0xfe),
431e1051a39Sopenharmony_ci            LL(0xab, 0xab, 0x96, 0xab, 0x31, 0x3d, 0x4b, 0x9a),
432e1051a39Sopenharmony_ci            LL(0xce, 0xce, 0x1f, 0xce, 0x3e, 0xd1, 0x81, 0xf0),
433e1051a39Sopenharmony_ci            LL(0x11, 0x11, 0x44, 0x11, 0x88, 0x55, 0x22, 0x99),
434e1051a39Sopenharmony_ci            LL(0x8f, 0x8f, 0x06, 0x8f, 0x0c, 0x89, 0x03, 0x83),
435e1051a39Sopenharmony_ci            LL(0x4e, 0x4e, 0x25, 0x4e, 0x4a, 0x6b, 0x9c, 0x04),
436e1051a39Sopenharmony_ci            LL(0xb7, 0xb7, 0xe6, 0xb7, 0xd1, 0x51, 0x73, 0x66),
437e1051a39Sopenharmony_ci            LL(0xeb, 0xeb, 0x8b, 0xeb, 0x0b, 0x60, 0xcb, 0xe0),
438e1051a39Sopenharmony_ci            LL(0x3c, 0x3c, 0xf0, 0x3c, 0xfd, 0xcc, 0x78, 0xc1),
439e1051a39Sopenharmony_ci            LL(0x81, 0x81, 0x3e, 0x81, 0x7c, 0xbf, 0x1f, 0xfd),
440e1051a39Sopenharmony_ci            LL(0x94, 0x94, 0x6a, 0x94, 0xd4, 0xfe, 0x35, 0x40),
441e1051a39Sopenharmony_ci            LL(0xf7, 0xf7, 0xfb, 0xf7, 0xeb, 0x0c, 0xf3, 0x1c),
442e1051a39Sopenharmony_ci            LL(0xb9, 0xb9, 0xde, 0xb9, 0xa1, 0x67, 0x6f, 0x18),
443e1051a39Sopenharmony_ci            LL(0x13, 0x13, 0x4c, 0x13, 0x98, 0x5f, 0x26, 0x8b),
444e1051a39Sopenharmony_ci            LL(0x2c, 0x2c, 0xb0, 0x2c, 0x7d, 0x9c, 0x58, 0x51),
445e1051a39Sopenharmony_ci            LL(0xd3, 0xd3, 0x6b, 0xd3, 0xd6, 0xb8, 0xbb, 0x05),
446e1051a39Sopenharmony_ci            LL(0xe7, 0xe7, 0xbb, 0xe7, 0x6b, 0x5c, 0xd3, 0x8c),
447e1051a39Sopenharmony_ci            LL(0x6e, 0x6e, 0xa5, 0x6e, 0x57, 0xcb, 0xdc, 0x39),
448e1051a39Sopenharmony_ci            LL(0xc4, 0xc4, 0x37, 0xc4, 0x6e, 0xf3, 0x95, 0xaa),
449e1051a39Sopenharmony_ci            LL(0x03, 0x03, 0x0c, 0x03, 0x18, 0x0f, 0x06, 0x1b),
450e1051a39Sopenharmony_ci            LL(0x56, 0x56, 0x45, 0x56, 0x8a, 0x13, 0xac, 0xdc),
451e1051a39Sopenharmony_ci            LL(0x44, 0x44, 0x0d, 0x44, 0x1a, 0x49, 0x88, 0x5e),
452e1051a39Sopenharmony_ci            LL(0x7f, 0x7f, 0xe1, 0x7f, 0xdf, 0x9e, 0xfe, 0xa0),
453e1051a39Sopenharmony_ci            LL(0xa9, 0xa9, 0x9e, 0xa9, 0x21, 0x37, 0x4f, 0x88),
454e1051a39Sopenharmony_ci            LL(0x2a, 0x2a, 0xa8, 0x2a, 0x4d, 0x82, 0x54, 0x67),
455e1051a39Sopenharmony_ci            LL(0xbb, 0xbb, 0xd6, 0xbb, 0xb1, 0x6d, 0x6b, 0x0a),
456e1051a39Sopenharmony_ci            LL(0xc1, 0xc1, 0x23, 0xc1, 0x46, 0xe2, 0x9f, 0x87),
457e1051a39Sopenharmony_ci            LL(0x53, 0x53, 0x51, 0x53, 0xa2, 0x02, 0xa6, 0xf1),
458e1051a39Sopenharmony_ci            LL(0xdc, 0xdc, 0x57, 0xdc, 0xae, 0x8b, 0xa5, 0x72),
459e1051a39Sopenharmony_ci            LL(0x0b, 0x0b, 0x2c, 0x0b, 0x58, 0x27, 0x16, 0x53),
460e1051a39Sopenharmony_ci            LL(0x9d, 0x9d, 0x4e, 0x9d, 0x9c, 0xd3, 0x27, 0x01),
461e1051a39Sopenharmony_ci            LL(0x6c, 0x6c, 0xad, 0x6c, 0x47, 0xc1, 0xd8, 0x2b),
462e1051a39Sopenharmony_ci            LL(0x31, 0x31, 0xc4, 0x31, 0x95, 0xf5, 0x62, 0xa4),
463e1051a39Sopenharmony_ci            LL(0x74, 0x74, 0xcd, 0x74, 0x87, 0xb9, 0xe8, 0xf3),
464e1051a39Sopenharmony_ci            LL(0xf6, 0xf6, 0xff, 0xf6, 0xe3, 0x09, 0xf1, 0x15),
465e1051a39Sopenharmony_ci            LL(0x46, 0x46, 0x05, 0x46, 0x0a, 0x43, 0x8c, 0x4c),
466e1051a39Sopenharmony_ci            LL(0xac, 0xac, 0x8a, 0xac, 0x09, 0x26, 0x45, 0xa5),
467e1051a39Sopenharmony_ci            LL(0x89, 0x89, 0x1e, 0x89, 0x3c, 0x97, 0x0f, 0xb5),
468e1051a39Sopenharmony_ci            LL(0x14, 0x14, 0x50, 0x14, 0xa0, 0x44, 0x28, 0xb4),
469e1051a39Sopenharmony_ci            LL(0xe1, 0xe1, 0xa3, 0xe1, 0x5b, 0x42, 0xdf, 0xba),
470e1051a39Sopenharmony_ci            LL(0x16, 0x16, 0x58, 0x16, 0xb0, 0x4e, 0x2c, 0xa6),
471e1051a39Sopenharmony_ci            LL(0x3a, 0x3a, 0xe8, 0x3a, 0xcd, 0xd2, 0x74, 0xf7),
472e1051a39Sopenharmony_ci            LL(0x69, 0x69, 0xb9, 0x69, 0x6f, 0xd0, 0xd2, 0x06),
473e1051a39Sopenharmony_ci            LL(0x09, 0x09, 0x24, 0x09, 0x48, 0x2d, 0x12, 0x41),
474e1051a39Sopenharmony_ci            LL(0x70, 0x70, 0xdd, 0x70, 0xa7, 0xad, 0xe0, 0xd7),
475e1051a39Sopenharmony_ci            LL(0xb6, 0xb6, 0xe2, 0xb6, 0xd9, 0x54, 0x71, 0x6f),
476e1051a39Sopenharmony_ci            LL(0xd0, 0xd0, 0x67, 0xd0, 0xce, 0xb7, 0xbd, 0x1e),
477e1051a39Sopenharmony_ci            LL(0xed, 0xed, 0x93, 0xed, 0x3b, 0x7e, 0xc7, 0xd6),
478e1051a39Sopenharmony_ci            LL(0xcc, 0xcc, 0x17, 0xcc, 0x2e, 0xdb, 0x85, 0xe2),
479e1051a39Sopenharmony_ci            LL(0x42, 0x42, 0x15, 0x42, 0x2a, 0x57, 0x84, 0x68),
480e1051a39Sopenharmony_ci            LL(0x98, 0x98, 0x5a, 0x98, 0xb4, 0xc2, 0x2d, 0x2c),
481e1051a39Sopenharmony_ci            LL(0xa4, 0xa4, 0xaa, 0xa4, 0x49, 0x0e, 0x55, 0xed),
482e1051a39Sopenharmony_ci            LL(0x28, 0x28, 0xa0, 0x28, 0x5d, 0x88, 0x50, 0x75),
483e1051a39Sopenharmony_ci            LL(0x5c, 0x5c, 0x6d, 0x5c, 0xda, 0x31, 0xb8, 0x86),
484e1051a39Sopenharmony_ci            LL(0xf8, 0xf8, 0xc7, 0xf8, 0x93, 0x3f, 0xed, 0x6b),
485e1051a39Sopenharmony_ci            LL(0x86, 0x86, 0x22, 0x86, 0x44, 0xa4, 0x11, 0xc2),
486e1051a39Sopenharmony_ci#define RC      (&(Cx.q[256*N]))
487e1051a39Sopenharmony_ci            0x18, 0x23, 0xc6, 0xe8, 0x87, 0xb8, 0x01, 0x4f,
488e1051a39Sopenharmony_ci            /* rc[ROUNDS] */
489e1051a39Sopenharmony_ci            0x36, 0xa6, 0xd2, 0xf5, 0x79, 0x6f, 0x91, 0x52, 0x60, 0xbc, 0x9b,
490e1051a39Sopenharmony_ci            0x8e, 0xa3, 0x0c, 0x7b, 0x35, 0x1d, 0xe0, 0xd7, 0xc2, 0x2e, 0x4b,
491e1051a39Sopenharmony_ci            0xfe, 0x57, 0x15, 0x77, 0x37, 0xe5, 0x9f, 0xf0, 0x4a, 0xda, 0x58,
492e1051a39Sopenharmony_ci            0xc9, 0x29, 0x0a, 0xb1, 0xa0, 0x6b, 0x85, 0xbd, 0x5d, 0x10, 0xf4,
493e1051a39Sopenharmony_ci            0xcb, 0x3e, 0x05, 0x67, 0xe4, 0x27, 0x41, 0x8b, 0xa7, 0x7d, 0x95,
494e1051a39Sopenharmony_ci            0xd8, 0xfb, 0xee, 0x7c, 0x66, 0xdd, 0x17, 0x47, 0x9e, 0xca, 0x2d,
495e1051a39Sopenharmony_ci            0xbf, 0x07, 0xad, 0x5a, 0x83, 0x33
496e1051a39Sopenharmony_ci        }
497e1051a39Sopenharmony_ci    };
498e1051a39Sopenharmony_ci
499e1051a39Sopenharmony_civoid whirlpool_block(WHIRLPOOL_CTX *ctx, const void *inp, size_t n)
500e1051a39Sopenharmony_ci{
501e1051a39Sopenharmony_ci    int r;
502e1051a39Sopenharmony_ci    const u8 *p = inp;
503e1051a39Sopenharmony_ci    union {
504e1051a39Sopenharmony_ci        u64 q[8];
505e1051a39Sopenharmony_ci        u8 c[64];
506e1051a39Sopenharmony_ci    } S, K, *H = (void *)ctx->H.q;
507e1051a39Sopenharmony_ci
508e1051a39Sopenharmony_ci#ifdef GO_FOR_MMX
509e1051a39Sopenharmony_ci    GO_FOR_MMX(ctx, inp, n);
510e1051a39Sopenharmony_ci#endif
511e1051a39Sopenharmony_ci    do {
512e1051a39Sopenharmony_ci#ifdef OPENSSL_SMALL_FOOTPRINT
513e1051a39Sopenharmony_ci        u64 L[8];
514e1051a39Sopenharmony_ci        int i;
515e1051a39Sopenharmony_ci
516e1051a39Sopenharmony_ci        for (i = 0; i < 64; i++)
517e1051a39Sopenharmony_ci            S.c[i] = (K.c[i] = H->c[i]) ^ p[i];
518e1051a39Sopenharmony_ci        for (r = 0; r < ROUNDS; r++) {
519e1051a39Sopenharmony_ci            for (i = 0; i < 8; i++) {
520e1051a39Sopenharmony_ci                L[i] = i ? 0 : RC[r];
521e1051a39Sopenharmony_ci                L[i] ^= C0(K, i) ^ C1(K, (i - 1) & 7) ^
522e1051a39Sopenharmony_ci                    C2(K, (i - 2) & 7) ^ C3(K, (i - 3) & 7) ^
523e1051a39Sopenharmony_ci                    C4(K, (i - 4) & 7) ^ C5(K, (i - 5) & 7) ^
524e1051a39Sopenharmony_ci                    C6(K, (i - 6) & 7) ^ C7(K, (i - 7) & 7);
525e1051a39Sopenharmony_ci            }
526e1051a39Sopenharmony_ci            memcpy(K.q, L, 64);
527e1051a39Sopenharmony_ci            for (i = 0; i < 8; i++) {
528e1051a39Sopenharmony_ci                L[i] ^= C0(S, i) ^ C1(S, (i - 1) & 7) ^
529e1051a39Sopenharmony_ci                    C2(S, (i - 2) & 7) ^ C3(S, (i - 3) & 7) ^
530e1051a39Sopenharmony_ci                    C4(S, (i - 4) & 7) ^ C5(S, (i - 5) & 7) ^
531e1051a39Sopenharmony_ci                    C6(S, (i - 6) & 7) ^ C7(S, (i - 7) & 7);
532e1051a39Sopenharmony_ci            }
533e1051a39Sopenharmony_ci            memcpy(S.q, L, 64);
534e1051a39Sopenharmony_ci        }
535e1051a39Sopenharmony_ci        for (i = 0; i < 64; i++)
536e1051a39Sopenharmony_ci            H->c[i] ^= S.c[i] ^ p[i];
537e1051a39Sopenharmony_ci#else
538e1051a39Sopenharmony_ci        u64 L0, L1, L2, L3, L4, L5, L6, L7;
539e1051a39Sopenharmony_ci
540e1051a39Sopenharmony_ci# ifdef STRICT_ALIGNMENT
541e1051a39Sopenharmony_ci        if ((size_t)p & 7) {
542e1051a39Sopenharmony_ci            memcpy(S.c, p, 64);
543e1051a39Sopenharmony_ci            S.q[0] ^= (K.q[0] = H->q[0]);
544e1051a39Sopenharmony_ci            S.q[1] ^= (K.q[1] = H->q[1]);
545e1051a39Sopenharmony_ci            S.q[2] ^= (K.q[2] = H->q[2]);
546e1051a39Sopenharmony_ci            S.q[3] ^= (K.q[3] = H->q[3]);
547e1051a39Sopenharmony_ci            S.q[4] ^= (K.q[4] = H->q[4]);
548e1051a39Sopenharmony_ci            S.q[5] ^= (K.q[5] = H->q[5]);
549e1051a39Sopenharmony_ci            S.q[6] ^= (K.q[6] = H->q[6]);
550e1051a39Sopenharmony_ci            S.q[7] ^= (K.q[7] = H->q[7]);
551e1051a39Sopenharmony_ci        } else
552e1051a39Sopenharmony_ci# endif
553e1051a39Sopenharmony_ci        {
554e1051a39Sopenharmony_ci            const u64_aX *pa = (const u64_aX *)p;
555e1051a39Sopenharmony_ci            S.q[0] = (K.q[0] = H->q[0]) ^ pa[0];
556e1051a39Sopenharmony_ci            S.q[1] = (K.q[1] = H->q[1]) ^ pa[1];
557e1051a39Sopenharmony_ci            S.q[2] = (K.q[2] = H->q[2]) ^ pa[2];
558e1051a39Sopenharmony_ci            S.q[3] = (K.q[3] = H->q[3]) ^ pa[3];
559e1051a39Sopenharmony_ci            S.q[4] = (K.q[4] = H->q[4]) ^ pa[4];
560e1051a39Sopenharmony_ci            S.q[5] = (K.q[5] = H->q[5]) ^ pa[5];
561e1051a39Sopenharmony_ci            S.q[6] = (K.q[6] = H->q[6]) ^ pa[6];
562e1051a39Sopenharmony_ci            S.q[7] = (K.q[7] = H->q[7]) ^ pa[7];
563e1051a39Sopenharmony_ci        }
564e1051a39Sopenharmony_ci
565e1051a39Sopenharmony_ci        for (r = 0; r < ROUNDS; r++) {
566e1051a39Sopenharmony_ci# ifdef SMALL_REGISTER_BANK
567e1051a39Sopenharmony_ci            L0 = C0(K, 0) ^ C1(K, 7) ^ C2(K, 6) ^ C3(K, 5) ^
568e1051a39Sopenharmony_ci                C4(K, 4) ^ C5(K, 3) ^ C6(K, 2) ^ C7(K, 1) ^ RC[r];
569e1051a39Sopenharmony_ci            L1 = C0(K, 1) ^ C1(K, 0) ^ C2(K, 7) ^ C3(K, 6) ^
570e1051a39Sopenharmony_ci                C4(K, 5) ^ C5(K, 4) ^ C6(K, 3) ^ C7(K, 2);
571e1051a39Sopenharmony_ci            L2 = C0(K, 2) ^ C1(K, 1) ^ C2(K, 0) ^ C3(K, 7) ^
572e1051a39Sopenharmony_ci                C4(K, 6) ^ C5(K, 5) ^ C6(K, 4) ^ C7(K, 3);
573e1051a39Sopenharmony_ci            L3 = C0(K, 3) ^ C1(K, 2) ^ C2(K, 1) ^ C3(K, 0) ^
574e1051a39Sopenharmony_ci                C4(K, 7) ^ C5(K, 6) ^ C6(K, 5) ^ C7(K, 4);
575e1051a39Sopenharmony_ci            L4 = C0(K, 4) ^ C1(K, 3) ^ C2(K, 2) ^ C3(K, 1) ^
576e1051a39Sopenharmony_ci                C4(K, 0) ^ C5(K, 7) ^ C6(K, 6) ^ C7(K, 5);
577e1051a39Sopenharmony_ci            L5 = C0(K, 5) ^ C1(K, 4) ^ C2(K, 3) ^ C3(K, 2) ^
578e1051a39Sopenharmony_ci                C4(K, 1) ^ C5(K, 0) ^ C6(K, 7) ^ C7(K, 6);
579e1051a39Sopenharmony_ci            L6 = C0(K, 6) ^ C1(K, 5) ^ C2(K, 4) ^ C3(K, 3) ^
580e1051a39Sopenharmony_ci                C4(K, 2) ^ C5(K, 1) ^ C6(K, 0) ^ C7(K, 7);
581e1051a39Sopenharmony_ci            L7 = C0(K, 7) ^ C1(K, 6) ^ C2(K, 5) ^ C3(K, 4) ^
582e1051a39Sopenharmony_ci                C4(K, 3) ^ C5(K, 2) ^ C6(K, 1) ^ C7(K, 0);
583e1051a39Sopenharmony_ci
584e1051a39Sopenharmony_ci            K.q[0] = L0;
585e1051a39Sopenharmony_ci            K.q[1] = L1;
586e1051a39Sopenharmony_ci            K.q[2] = L2;
587e1051a39Sopenharmony_ci            K.q[3] = L3;
588e1051a39Sopenharmony_ci            K.q[4] = L4;
589e1051a39Sopenharmony_ci            K.q[5] = L5;
590e1051a39Sopenharmony_ci            K.q[6] = L6;
591e1051a39Sopenharmony_ci            K.q[7] = L7;
592e1051a39Sopenharmony_ci
593e1051a39Sopenharmony_ci            L0 ^= C0(S, 0) ^ C1(S, 7) ^ C2(S, 6) ^ C3(S, 5) ^
594e1051a39Sopenharmony_ci                C4(S, 4) ^ C5(S, 3) ^ C6(S, 2) ^ C7(S, 1);
595e1051a39Sopenharmony_ci            L1 ^= C0(S, 1) ^ C1(S, 0) ^ C2(S, 7) ^ C3(S, 6) ^
596e1051a39Sopenharmony_ci                C4(S, 5) ^ C5(S, 4) ^ C6(S, 3) ^ C7(S, 2);
597e1051a39Sopenharmony_ci            L2 ^= C0(S, 2) ^ C1(S, 1) ^ C2(S, 0) ^ C3(S, 7) ^
598e1051a39Sopenharmony_ci                C4(S, 6) ^ C5(S, 5) ^ C6(S, 4) ^ C7(S, 3);
599e1051a39Sopenharmony_ci            L3 ^= C0(S, 3) ^ C1(S, 2) ^ C2(S, 1) ^ C3(S, 0) ^
600e1051a39Sopenharmony_ci                C4(S, 7) ^ C5(S, 6) ^ C6(S, 5) ^ C7(S, 4);
601e1051a39Sopenharmony_ci            L4 ^= C0(S, 4) ^ C1(S, 3) ^ C2(S, 2) ^ C3(S, 1) ^
602e1051a39Sopenharmony_ci                C4(S, 0) ^ C5(S, 7) ^ C6(S, 6) ^ C7(S, 5);
603e1051a39Sopenharmony_ci            L5 ^= C0(S, 5) ^ C1(S, 4) ^ C2(S, 3) ^ C3(S, 2) ^
604e1051a39Sopenharmony_ci                C4(S, 1) ^ C5(S, 0) ^ C6(S, 7) ^ C7(S, 6);
605e1051a39Sopenharmony_ci            L6 ^= C0(S, 6) ^ C1(S, 5) ^ C2(S, 4) ^ C3(S, 3) ^
606e1051a39Sopenharmony_ci                C4(S, 2) ^ C5(S, 1) ^ C6(S, 0) ^ C7(S, 7);
607e1051a39Sopenharmony_ci            L7 ^= C0(S, 7) ^ C1(S, 6) ^ C2(S, 5) ^ C3(S, 4) ^
608e1051a39Sopenharmony_ci                C4(S, 3) ^ C5(S, 2) ^ C6(S, 1) ^ C7(S, 0);
609e1051a39Sopenharmony_ci
610e1051a39Sopenharmony_ci            S.q[0] = L0;
611e1051a39Sopenharmony_ci            S.q[1] = L1;
612e1051a39Sopenharmony_ci            S.q[2] = L2;
613e1051a39Sopenharmony_ci            S.q[3] = L3;
614e1051a39Sopenharmony_ci            S.q[4] = L4;
615e1051a39Sopenharmony_ci            S.q[5] = L5;
616e1051a39Sopenharmony_ci            S.q[6] = L6;
617e1051a39Sopenharmony_ci            S.q[7] = L7;
618e1051a39Sopenharmony_ci# else
619e1051a39Sopenharmony_ci            L0 = C0(K, 0);
620e1051a39Sopenharmony_ci            L1 = C1(K, 0);
621e1051a39Sopenharmony_ci            L2 = C2(K, 0);
622e1051a39Sopenharmony_ci            L3 = C3(K, 0);
623e1051a39Sopenharmony_ci            L4 = C4(K, 0);
624e1051a39Sopenharmony_ci            L5 = C5(K, 0);
625e1051a39Sopenharmony_ci            L6 = C6(K, 0);
626e1051a39Sopenharmony_ci            L7 = C7(K, 0);
627e1051a39Sopenharmony_ci            L0 ^= RC[r];
628e1051a39Sopenharmony_ci
629e1051a39Sopenharmony_ci            L1 ^= C0(K, 1);
630e1051a39Sopenharmony_ci            L2 ^= C1(K, 1);
631e1051a39Sopenharmony_ci            L3 ^= C2(K, 1);
632e1051a39Sopenharmony_ci            L4 ^= C3(K, 1);
633e1051a39Sopenharmony_ci            L5 ^= C4(K, 1);
634e1051a39Sopenharmony_ci            L6 ^= C5(K, 1);
635e1051a39Sopenharmony_ci            L7 ^= C6(K, 1);
636e1051a39Sopenharmony_ci            L0 ^= C7(K, 1);
637e1051a39Sopenharmony_ci
638e1051a39Sopenharmony_ci            L2 ^= C0(K, 2);
639e1051a39Sopenharmony_ci            L3 ^= C1(K, 2);
640e1051a39Sopenharmony_ci            L4 ^= C2(K, 2);
641e1051a39Sopenharmony_ci            L5 ^= C3(K, 2);
642e1051a39Sopenharmony_ci            L6 ^= C4(K, 2);
643e1051a39Sopenharmony_ci            L7 ^= C5(K, 2);
644e1051a39Sopenharmony_ci            L0 ^= C6(K, 2);
645e1051a39Sopenharmony_ci            L1 ^= C7(K, 2);
646e1051a39Sopenharmony_ci
647e1051a39Sopenharmony_ci            L3 ^= C0(K, 3);
648e1051a39Sopenharmony_ci            L4 ^= C1(K, 3);
649e1051a39Sopenharmony_ci            L5 ^= C2(K, 3);
650e1051a39Sopenharmony_ci            L6 ^= C3(K, 3);
651e1051a39Sopenharmony_ci            L7 ^= C4(K, 3);
652e1051a39Sopenharmony_ci            L0 ^= C5(K, 3);
653e1051a39Sopenharmony_ci            L1 ^= C6(K, 3);
654e1051a39Sopenharmony_ci            L2 ^= C7(K, 3);
655e1051a39Sopenharmony_ci
656e1051a39Sopenharmony_ci            L4 ^= C0(K, 4);
657e1051a39Sopenharmony_ci            L5 ^= C1(K, 4);
658e1051a39Sopenharmony_ci            L6 ^= C2(K, 4);
659e1051a39Sopenharmony_ci            L7 ^= C3(K, 4);
660e1051a39Sopenharmony_ci            L0 ^= C4(K, 4);
661e1051a39Sopenharmony_ci            L1 ^= C5(K, 4);
662e1051a39Sopenharmony_ci            L2 ^= C6(K, 4);
663e1051a39Sopenharmony_ci            L3 ^= C7(K, 4);
664e1051a39Sopenharmony_ci
665e1051a39Sopenharmony_ci            L5 ^= C0(K, 5);
666e1051a39Sopenharmony_ci            L6 ^= C1(K, 5);
667e1051a39Sopenharmony_ci            L7 ^= C2(K, 5);
668e1051a39Sopenharmony_ci            L0 ^= C3(K, 5);
669e1051a39Sopenharmony_ci            L1 ^= C4(K, 5);
670e1051a39Sopenharmony_ci            L2 ^= C5(K, 5);
671e1051a39Sopenharmony_ci            L3 ^= C6(K, 5);
672e1051a39Sopenharmony_ci            L4 ^= C7(K, 5);
673e1051a39Sopenharmony_ci
674e1051a39Sopenharmony_ci            L6 ^= C0(K, 6);
675e1051a39Sopenharmony_ci            L7 ^= C1(K, 6);
676e1051a39Sopenharmony_ci            L0 ^= C2(K, 6);
677e1051a39Sopenharmony_ci            L1 ^= C3(K, 6);
678e1051a39Sopenharmony_ci            L2 ^= C4(K, 6);
679e1051a39Sopenharmony_ci            L3 ^= C5(K, 6);
680e1051a39Sopenharmony_ci            L4 ^= C6(K, 6);
681e1051a39Sopenharmony_ci            L5 ^= C7(K, 6);
682e1051a39Sopenharmony_ci
683e1051a39Sopenharmony_ci            L7 ^= C0(K, 7);
684e1051a39Sopenharmony_ci            L0 ^= C1(K, 7);
685e1051a39Sopenharmony_ci            L1 ^= C2(K, 7);
686e1051a39Sopenharmony_ci            L2 ^= C3(K, 7);
687e1051a39Sopenharmony_ci            L3 ^= C4(K, 7);
688e1051a39Sopenharmony_ci            L4 ^= C5(K, 7);
689e1051a39Sopenharmony_ci            L5 ^= C6(K, 7);
690e1051a39Sopenharmony_ci            L6 ^= C7(K, 7);
691e1051a39Sopenharmony_ci
692e1051a39Sopenharmony_ci            K.q[0] = L0;
693e1051a39Sopenharmony_ci            K.q[1] = L1;
694e1051a39Sopenharmony_ci            K.q[2] = L2;
695e1051a39Sopenharmony_ci            K.q[3] = L3;
696e1051a39Sopenharmony_ci            K.q[4] = L4;
697e1051a39Sopenharmony_ci            K.q[5] = L5;
698e1051a39Sopenharmony_ci            K.q[6] = L6;
699e1051a39Sopenharmony_ci            K.q[7] = L7;
700e1051a39Sopenharmony_ci
701e1051a39Sopenharmony_ci            L0 ^= C0(S, 0);
702e1051a39Sopenharmony_ci            L1 ^= C1(S, 0);
703e1051a39Sopenharmony_ci            L2 ^= C2(S, 0);
704e1051a39Sopenharmony_ci            L3 ^= C3(S, 0);
705e1051a39Sopenharmony_ci            L4 ^= C4(S, 0);
706e1051a39Sopenharmony_ci            L5 ^= C5(S, 0);
707e1051a39Sopenharmony_ci            L6 ^= C6(S, 0);
708e1051a39Sopenharmony_ci            L7 ^= C7(S, 0);
709e1051a39Sopenharmony_ci
710e1051a39Sopenharmony_ci            L1 ^= C0(S, 1);
711e1051a39Sopenharmony_ci            L2 ^= C1(S, 1);
712e1051a39Sopenharmony_ci            L3 ^= C2(S, 1);
713e1051a39Sopenharmony_ci            L4 ^= C3(S, 1);
714e1051a39Sopenharmony_ci            L5 ^= C4(S, 1);
715e1051a39Sopenharmony_ci            L6 ^= C5(S, 1);
716e1051a39Sopenharmony_ci            L7 ^= C6(S, 1);
717e1051a39Sopenharmony_ci            L0 ^= C7(S, 1);
718e1051a39Sopenharmony_ci
719e1051a39Sopenharmony_ci            L2 ^= C0(S, 2);
720e1051a39Sopenharmony_ci            L3 ^= C1(S, 2);
721e1051a39Sopenharmony_ci            L4 ^= C2(S, 2);
722e1051a39Sopenharmony_ci            L5 ^= C3(S, 2);
723e1051a39Sopenharmony_ci            L6 ^= C4(S, 2);
724e1051a39Sopenharmony_ci            L7 ^= C5(S, 2);
725e1051a39Sopenharmony_ci            L0 ^= C6(S, 2);
726e1051a39Sopenharmony_ci            L1 ^= C7(S, 2);
727e1051a39Sopenharmony_ci
728e1051a39Sopenharmony_ci            L3 ^= C0(S, 3);
729e1051a39Sopenharmony_ci            L4 ^= C1(S, 3);
730e1051a39Sopenharmony_ci            L5 ^= C2(S, 3);
731e1051a39Sopenharmony_ci            L6 ^= C3(S, 3);
732e1051a39Sopenharmony_ci            L7 ^= C4(S, 3);
733e1051a39Sopenharmony_ci            L0 ^= C5(S, 3);
734e1051a39Sopenharmony_ci            L1 ^= C6(S, 3);
735e1051a39Sopenharmony_ci            L2 ^= C7(S, 3);
736e1051a39Sopenharmony_ci
737e1051a39Sopenharmony_ci            L4 ^= C0(S, 4);
738e1051a39Sopenharmony_ci            L5 ^= C1(S, 4);
739e1051a39Sopenharmony_ci            L6 ^= C2(S, 4);
740e1051a39Sopenharmony_ci            L7 ^= C3(S, 4);
741e1051a39Sopenharmony_ci            L0 ^= C4(S, 4);
742e1051a39Sopenharmony_ci            L1 ^= C5(S, 4);
743e1051a39Sopenharmony_ci            L2 ^= C6(S, 4);
744e1051a39Sopenharmony_ci            L3 ^= C7(S, 4);
745e1051a39Sopenharmony_ci
746e1051a39Sopenharmony_ci            L5 ^= C0(S, 5);
747e1051a39Sopenharmony_ci            L6 ^= C1(S, 5);
748e1051a39Sopenharmony_ci            L7 ^= C2(S, 5);
749e1051a39Sopenharmony_ci            L0 ^= C3(S, 5);
750e1051a39Sopenharmony_ci            L1 ^= C4(S, 5);
751e1051a39Sopenharmony_ci            L2 ^= C5(S, 5);
752e1051a39Sopenharmony_ci            L3 ^= C6(S, 5);
753e1051a39Sopenharmony_ci            L4 ^= C7(S, 5);
754e1051a39Sopenharmony_ci
755e1051a39Sopenharmony_ci            L6 ^= C0(S, 6);
756e1051a39Sopenharmony_ci            L7 ^= C1(S, 6);
757e1051a39Sopenharmony_ci            L0 ^= C2(S, 6);
758e1051a39Sopenharmony_ci            L1 ^= C3(S, 6);
759e1051a39Sopenharmony_ci            L2 ^= C4(S, 6);
760e1051a39Sopenharmony_ci            L3 ^= C5(S, 6);
761e1051a39Sopenharmony_ci            L4 ^= C6(S, 6);
762e1051a39Sopenharmony_ci            L5 ^= C7(S, 6);
763e1051a39Sopenharmony_ci
764e1051a39Sopenharmony_ci            L7 ^= C0(S, 7);
765e1051a39Sopenharmony_ci            L0 ^= C1(S, 7);
766e1051a39Sopenharmony_ci            L1 ^= C2(S, 7);
767e1051a39Sopenharmony_ci            L2 ^= C3(S, 7);
768e1051a39Sopenharmony_ci            L3 ^= C4(S, 7);
769e1051a39Sopenharmony_ci            L4 ^= C5(S, 7);
770e1051a39Sopenharmony_ci            L5 ^= C6(S, 7);
771e1051a39Sopenharmony_ci            L6 ^= C7(S, 7);
772e1051a39Sopenharmony_ci
773e1051a39Sopenharmony_ci            S.q[0] = L0;
774e1051a39Sopenharmony_ci            S.q[1] = L1;
775e1051a39Sopenharmony_ci            S.q[2] = L2;
776e1051a39Sopenharmony_ci            S.q[3] = L3;
777e1051a39Sopenharmony_ci            S.q[4] = L4;
778e1051a39Sopenharmony_ci            S.q[5] = L5;
779e1051a39Sopenharmony_ci            S.q[6] = L6;
780e1051a39Sopenharmony_ci            S.q[7] = L7;
781e1051a39Sopenharmony_ci# endif
782e1051a39Sopenharmony_ci        }
783e1051a39Sopenharmony_ci
784e1051a39Sopenharmony_ci# ifdef STRICT_ALIGNMENT
785e1051a39Sopenharmony_ci        if ((size_t)p & 7) {
786e1051a39Sopenharmony_ci            int i;
787e1051a39Sopenharmony_ci            for (i = 0; i < 64; i++)
788e1051a39Sopenharmony_ci                H->c[i] ^= S.c[i] ^ p[i];
789e1051a39Sopenharmony_ci        } else
790e1051a39Sopenharmony_ci# endif
791e1051a39Sopenharmony_ci        {
792e1051a39Sopenharmony_ci            const u64_aX *pa = (const u64_aX *)p;
793e1051a39Sopenharmony_ci            H->q[0] ^= S.q[0] ^ pa[0];
794e1051a39Sopenharmony_ci            H->q[1] ^= S.q[1] ^ pa[1];
795e1051a39Sopenharmony_ci            H->q[2] ^= S.q[2] ^ pa[2];
796e1051a39Sopenharmony_ci            H->q[3] ^= S.q[3] ^ pa[3];
797e1051a39Sopenharmony_ci            H->q[4] ^= S.q[4] ^ pa[4];
798e1051a39Sopenharmony_ci            H->q[5] ^= S.q[5] ^ pa[5];
799e1051a39Sopenharmony_ci            H->q[6] ^= S.q[6] ^ pa[6];
800e1051a39Sopenharmony_ci            H->q[7] ^= S.q[7] ^ pa[7];
801e1051a39Sopenharmony_ci        }
802e1051a39Sopenharmony_ci#endif
803e1051a39Sopenharmony_ci        p += 64;
804e1051a39Sopenharmony_ci    } while (--n);
805e1051a39Sopenharmony_ci}
806