1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
|
/* MIT License
*
* Copyright (c) 2016-2020 INRIA, CMU and Microsoft Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "Hacl_Chacha20_Vec128.h"
static inline void
double_round_128(Lib_IntVector_Intrinsics_vec128 *st)
{
st[0U] = Lib_IntVector_Intrinsics_vec128_add32(st[0U], st[4U]);
Lib_IntVector_Intrinsics_vec128 std = Lib_IntVector_Intrinsics_vec128_xor(st[12U], st[0U]);
st[12U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std, (uint32_t)16U);
st[8U] = Lib_IntVector_Intrinsics_vec128_add32(st[8U], st[12U]);
Lib_IntVector_Intrinsics_vec128 std0 = Lib_IntVector_Intrinsics_vec128_xor(st[4U], st[8U]);
st[4U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std0, (uint32_t)12U);
st[0U] = Lib_IntVector_Intrinsics_vec128_add32(st[0U], st[4U]);
Lib_IntVector_Intrinsics_vec128 std1 = Lib_IntVector_Intrinsics_vec128_xor(st[12U], st[0U]);
st[12U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std1, (uint32_t)8U);
st[8U] = Lib_IntVector_Intrinsics_vec128_add32(st[8U], st[12U]);
Lib_IntVector_Intrinsics_vec128 std2 = Lib_IntVector_Intrinsics_vec128_xor(st[4U], st[8U]);
st[4U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std2, (uint32_t)7U);
st[1U] = Lib_IntVector_Intrinsics_vec128_add32(st[1U], st[5U]);
Lib_IntVector_Intrinsics_vec128 std3 = Lib_IntVector_Intrinsics_vec128_xor(st[13U], st[1U]);
st[13U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std3, (uint32_t)16U);
st[9U] = Lib_IntVector_Intrinsics_vec128_add32(st[9U], st[13U]);
Lib_IntVector_Intrinsics_vec128 std4 = Lib_IntVector_Intrinsics_vec128_xor(st[5U], st[9U]);
st[5U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std4, (uint32_t)12U);
st[1U] = Lib_IntVector_Intrinsics_vec128_add32(st[1U], st[5U]);
Lib_IntVector_Intrinsics_vec128 std5 = Lib_IntVector_Intrinsics_vec128_xor(st[13U], st[1U]);
st[13U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std5, (uint32_t)8U);
st[9U] = Lib_IntVector_Intrinsics_vec128_add32(st[9U], st[13U]);
Lib_IntVector_Intrinsics_vec128 std6 = Lib_IntVector_Intrinsics_vec128_xor(st[5U], st[9U]);
st[5U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std6, (uint32_t)7U);
st[2U] = Lib_IntVector_Intrinsics_vec128_add32(st[2U], st[6U]);
Lib_IntVector_Intrinsics_vec128 std7 = Lib_IntVector_Intrinsics_vec128_xor(st[14U], st[2U]);
st[14U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std7, (uint32_t)16U);
st[10U] = Lib_IntVector_Intrinsics_vec128_add32(st[10U], st[14U]);
Lib_IntVector_Intrinsics_vec128 std8 = Lib_IntVector_Intrinsics_vec128_xor(st[6U], st[10U]);
st[6U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std8, (uint32_t)12U);
st[2U] = Lib_IntVector_Intrinsics_vec128_add32(st[2U], st[6U]);
Lib_IntVector_Intrinsics_vec128 std9 = Lib_IntVector_Intrinsics_vec128_xor(st[14U], st[2U]);
st[14U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std9, (uint32_t)8U);
st[10U] = Lib_IntVector_Intrinsics_vec128_add32(st[10U], st[14U]);
Lib_IntVector_Intrinsics_vec128 std10 = Lib_IntVector_Intrinsics_vec128_xor(st[6U], st[10U]);
st[6U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std10, (uint32_t)7U);
st[3U] = Lib_IntVector_Intrinsics_vec128_add32(st[3U], st[7U]);
Lib_IntVector_Intrinsics_vec128 std11 = Lib_IntVector_Intrinsics_vec128_xor(st[15U], st[3U]);
st[15U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std11, (uint32_t)16U);
st[11U] = Lib_IntVector_Intrinsics_vec128_add32(st[11U], st[15U]);
Lib_IntVector_Intrinsics_vec128 std12 = Lib_IntVector_Intrinsics_vec128_xor(st[7U], st[11U]);
st[7U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std12, (uint32_t)12U);
st[3U] = Lib_IntVector_Intrinsics_vec128_add32(st[3U], st[7U]);
Lib_IntVector_Intrinsics_vec128 std13 = Lib_IntVector_Intrinsics_vec128_xor(st[15U], st[3U]);
st[15U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std13, (uint32_t)8U);
st[11U] = Lib_IntVector_Intrinsics_vec128_add32(st[11U], st[15U]);
Lib_IntVector_Intrinsics_vec128 std14 = Lib_IntVector_Intrinsics_vec128_xor(st[7U], st[11U]);
st[7U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std14, (uint32_t)7U);
st[0U] = Lib_IntVector_Intrinsics_vec128_add32(st[0U], st[5U]);
Lib_IntVector_Intrinsics_vec128 std15 = Lib_IntVector_Intrinsics_vec128_xor(st[15U], st[0U]);
st[15U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std15, (uint32_t)16U);
st[10U] = Lib_IntVector_Intrinsics_vec128_add32(st[10U], st[15U]);
Lib_IntVector_Intrinsics_vec128 std16 = Lib_IntVector_Intrinsics_vec128_xor(st[5U], st[10U]);
st[5U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std16, (uint32_t)12U);
st[0U] = Lib_IntVector_Intrinsics_vec128_add32(st[0U], st[5U]);
Lib_IntVector_Intrinsics_vec128 std17 = Lib_IntVector_Intrinsics_vec128_xor(st[15U], st[0U]);
st[15U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std17, (uint32_t)8U);
st[10U] = Lib_IntVector_Intrinsics_vec128_add32(st[10U], st[15U]);
Lib_IntVector_Intrinsics_vec128 std18 = Lib_IntVector_Intrinsics_vec128_xor(st[5U], st[10U]);
st[5U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std18, (uint32_t)7U);
st[1U] = Lib_IntVector_Intrinsics_vec128_add32(st[1U], st[6U]);
Lib_IntVector_Intrinsics_vec128 std19 = Lib_IntVector_Intrinsics_vec128_xor(st[12U], st[1U]);
st[12U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std19, (uint32_t)16U);
st[11U] = Lib_IntVector_Intrinsics_vec128_add32(st[11U], st[12U]);
Lib_IntVector_Intrinsics_vec128 std20 = Lib_IntVector_Intrinsics_vec128_xor(st[6U], st[11U]);
st[6U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std20, (uint32_t)12U);
st[1U] = Lib_IntVector_Intrinsics_vec128_add32(st[1U], st[6U]);
Lib_IntVector_Intrinsics_vec128 std21 = Lib_IntVector_Intrinsics_vec128_xor(st[12U], st[1U]);
st[12U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std21, (uint32_t)8U);
st[11U] = Lib_IntVector_Intrinsics_vec128_add32(st[11U], st[12U]);
Lib_IntVector_Intrinsics_vec128 std22 = Lib_IntVector_Intrinsics_vec128_xor(st[6U], st[11U]);
st[6U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std22, (uint32_t)7U);
st[2U] = Lib_IntVector_Intrinsics_vec128_add32(st[2U], st[7U]);
Lib_IntVector_Intrinsics_vec128 std23 = Lib_IntVector_Intrinsics_vec128_xor(st[13U], st[2U]);
st[13U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std23, (uint32_t)16U);
st[8U] = Lib_IntVector_Intrinsics_vec128_add32(st[8U], st[13U]);
Lib_IntVector_Intrinsics_vec128 std24 = Lib_IntVector_Intrinsics_vec128_xor(st[7U], st[8U]);
st[7U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std24, (uint32_t)12U);
st[2U] = Lib_IntVector_Intrinsics_vec128_add32(st[2U], st[7U]);
Lib_IntVector_Intrinsics_vec128 std25 = Lib_IntVector_Intrinsics_vec128_xor(st[13U], st[2U]);
st[13U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std25, (uint32_t)8U);
st[8U] = Lib_IntVector_Intrinsics_vec128_add32(st[8U], st[13U]);
Lib_IntVector_Intrinsics_vec128 std26 = Lib_IntVector_Intrinsics_vec128_xor(st[7U], st[8U]);
st[7U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std26, (uint32_t)7U);
st[3U] = Lib_IntVector_Intrinsics_vec128_add32(st[3U], st[4U]);
Lib_IntVector_Intrinsics_vec128 std27 = Lib_IntVector_Intrinsics_vec128_xor(st[14U], st[3U]);
st[14U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std27, (uint32_t)16U);
st[9U] = Lib_IntVector_Intrinsics_vec128_add32(st[9U], st[14U]);
Lib_IntVector_Intrinsics_vec128 std28 = Lib_IntVector_Intrinsics_vec128_xor(st[4U], st[9U]);
st[4U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std28, (uint32_t)12U);
st[3U] = Lib_IntVector_Intrinsics_vec128_add32(st[3U], st[4U]);
Lib_IntVector_Intrinsics_vec128 std29 = Lib_IntVector_Intrinsics_vec128_xor(st[14U], st[3U]);
st[14U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std29, (uint32_t)8U);
st[9U] = Lib_IntVector_Intrinsics_vec128_add32(st[9U], st[14U]);
Lib_IntVector_Intrinsics_vec128 std30 = Lib_IntVector_Intrinsics_vec128_xor(st[4U], st[9U]);
st[4U] = Lib_IntVector_Intrinsics_vec128_rotate_left32(std30, (uint32_t)7U);
}
static inline void
chacha20_core_128(
Lib_IntVector_Intrinsics_vec128 *k,
Lib_IntVector_Intrinsics_vec128 *ctx,
uint32_t ctr)
{
memcpy(k, ctx, (uint32_t)16U * sizeof(ctx[0U]));
uint32_t ctr_u32 = (uint32_t)4U * ctr;
Lib_IntVector_Intrinsics_vec128 cv = Lib_IntVector_Intrinsics_vec128_load32(ctr_u32);
k[12U] = Lib_IntVector_Intrinsics_vec128_add32(k[12U], cv);
double_round_128(k);
double_round_128(k);
double_round_128(k);
double_round_128(k);
double_round_128(k);
double_round_128(k);
double_round_128(k);
double_round_128(k);
double_round_128(k);
double_round_128(k);
for (uint32_t i = (uint32_t)0U; i < (uint32_t)16U; i++) {
Lib_IntVector_Intrinsics_vec128 *os = k;
Lib_IntVector_Intrinsics_vec128 x = Lib_IntVector_Intrinsics_vec128_add32(k[i], ctx[i]);
os[i] = x;
}
k[12U] = Lib_IntVector_Intrinsics_vec128_add32(k[12U], cv);
}
static inline void
chacha20_init_128(Lib_IntVector_Intrinsics_vec128 *ctx, uint8_t *k, uint8_t *n, uint32_t ctr)
{
uint32_t ctx1[16U] = { 0U };
uint32_t *uu____0 = ctx1;
for (uint32_t i = (uint32_t)0U; i < (uint32_t)4U; i++) {
uint32_t *os = uu____0;
uint32_t x = Hacl_Impl_Chacha20_Vec_chacha20_constants[i];
os[i] = x;
}
uint32_t *uu____1 = ctx1 + (uint32_t)4U;
for (uint32_t i = (uint32_t)0U; i < (uint32_t)8U; i++) {
uint32_t *os = uu____1;
uint8_t *bj = k + i * (uint32_t)4U;
uint32_t u = load32_le(bj);
uint32_t r = u;
uint32_t x = r;
os[i] = x;
}
ctx1[12U] = ctr;
uint32_t *uu____2 = ctx1 + (uint32_t)13U;
for (uint32_t i = (uint32_t)0U; i < (uint32_t)3U; i++) {
uint32_t *os = uu____2;
uint8_t *bj = n + i * (uint32_t)4U;
uint32_t u = load32_le(bj);
uint32_t r = u;
uint32_t x = r;
os[i] = x;
}
for (uint32_t i = (uint32_t)0U; i < (uint32_t)16U; i++) {
Lib_IntVector_Intrinsics_vec128 *os = ctx;
uint32_t x = ctx1[i];
Lib_IntVector_Intrinsics_vec128 x0 = Lib_IntVector_Intrinsics_vec128_load32(x);
os[i] = x0;
}
Lib_IntVector_Intrinsics_vec128
ctr1 =
Lib_IntVector_Intrinsics_vec128_load32s((uint32_t)0U,
(uint32_t)1U,
(uint32_t)2U,
(uint32_t)3U);
Lib_IntVector_Intrinsics_vec128 c12 = ctx[12U];
ctx[12U] = Lib_IntVector_Intrinsics_vec128_add32(c12, ctr1);
}
void
Hacl_Chacha20_Vec128_chacha20_encrypt_128(
uint32_t len,
uint8_t *out,
uint8_t *text,
uint8_t *key,
uint8_t *n,
uint32_t ctr)
{
Lib_IntVector_Intrinsics_vec128 ctx[16U];
for (uint32_t _i = 0U; _i < (uint32_t)16U; ++_i)
ctx[_i] = Lib_IntVector_Intrinsics_vec128_zero;
chacha20_init_128(ctx, key, n, ctr);
uint32_t rem = len % (uint32_t)256U;
uint32_t nb = len / (uint32_t)256U;
uint32_t rem1 = len % (uint32_t)256U;
for (uint32_t i = (uint32_t)0U; i < nb; i++) {
uint8_t *uu____0 = out + i * (uint32_t)256U;
uint8_t *uu____1 = text + i * (uint32_t)256U;
Lib_IntVector_Intrinsics_vec128 k[16U];
for (uint32_t _i = 0U; _i < (uint32_t)16U; ++_i)
k[_i] = Lib_IntVector_Intrinsics_vec128_zero;
chacha20_core_128(k, ctx, i);
Lib_IntVector_Intrinsics_vec128 v00 = k[0U];
Lib_IntVector_Intrinsics_vec128 v16 = k[1U];
Lib_IntVector_Intrinsics_vec128 v20 = k[2U];
Lib_IntVector_Intrinsics_vec128 v30 = k[3U];
Lib_IntVector_Intrinsics_vec128
v0_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v1_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v2_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v3_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v0__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v1__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v2__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128
v3__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128 v0 = v0__;
Lib_IntVector_Intrinsics_vec128 v1 = v1__;
Lib_IntVector_Intrinsics_vec128 v2 = v2__;
Lib_IntVector_Intrinsics_vec128 v3 = v3__;
Lib_IntVector_Intrinsics_vec128 v010 = k[4U];
Lib_IntVector_Intrinsics_vec128 v110 = k[5U];
Lib_IntVector_Intrinsics_vec128 v210 = k[6U];
Lib_IntVector_Intrinsics_vec128 v310 = k[7U];
Lib_IntVector_Intrinsics_vec128
v0_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v1_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v2_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v3_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v0__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v1__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v2__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128
v3__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128 v4 = v0__0;
Lib_IntVector_Intrinsics_vec128 v5 = v1__0;
Lib_IntVector_Intrinsics_vec128 v6 = v2__0;
Lib_IntVector_Intrinsics_vec128 v7 = v3__0;
Lib_IntVector_Intrinsics_vec128 v011 = k[8U];
Lib_IntVector_Intrinsics_vec128 v111 = k[9U];
Lib_IntVector_Intrinsics_vec128 v211 = k[10U];
Lib_IntVector_Intrinsics_vec128 v311 = k[11U];
Lib_IntVector_Intrinsics_vec128
v0_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v1_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v2_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v3_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v0__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v1__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v2__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128
v3__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128 v8 = v0__1;
Lib_IntVector_Intrinsics_vec128 v9 = v1__1;
Lib_IntVector_Intrinsics_vec128 v10 = v2__1;
Lib_IntVector_Intrinsics_vec128 v11 = v3__1;
Lib_IntVector_Intrinsics_vec128 v01 = k[12U];
Lib_IntVector_Intrinsics_vec128 v120 = k[13U];
Lib_IntVector_Intrinsics_vec128 v21 = k[14U];
Lib_IntVector_Intrinsics_vec128 v31 = k[15U];
Lib_IntVector_Intrinsics_vec128
v0_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v1_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v2_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v3_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v0__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v1__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v2__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128
v3__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128 v12 = v0__2;
Lib_IntVector_Intrinsics_vec128 v13 = v1__2;
Lib_IntVector_Intrinsics_vec128 v14 = v2__2;
Lib_IntVector_Intrinsics_vec128 v15 = v3__2;
k[0U] = v0;
k[1U] = v4;
k[2U] = v8;
k[3U] = v12;
k[4U] = v1;
k[5U] = v5;
k[6U] = v9;
k[7U] = v13;
k[8U] = v2;
k[9U] = v6;
k[10U] = v10;
k[11U] = v14;
k[12U] = v3;
k[13U] = v7;
k[14U] = v11;
k[15U] = v15;
for (uint32_t i0 = (uint32_t)0U; i0 < (uint32_t)16U; i0++) {
Lib_IntVector_Intrinsics_vec128
x = Lib_IntVector_Intrinsics_vec128_load_le(uu____1 + i0 * (uint32_t)16U);
Lib_IntVector_Intrinsics_vec128 y = Lib_IntVector_Intrinsics_vec128_xor(x, k[i0]);
Lib_IntVector_Intrinsics_vec128_store_le(uu____0 + i0 * (uint32_t)16U, y);
}
}
if (rem1 > (uint32_t)0U) {
uint8_t *uu____2 = out + nb * (uint32_t)256U;
uint8_t *uu____3 = text + nb * (uint32_t)256U;
uint8_t plain[256U] = { 0U };
memcpy(plain, uu____3, rem * sizeof(uu____3[0U]));
Lib_IntVector_Intrinsics_vec128 k[16U];
for (uint32_t _i = 0U; _i < (uint32_t)16U; ++_i)
k[_i] = Lib_IntVector_Intrinsics_vec128_zero;
chacha20_core_128(k, ctx, nb);
Lib_IntVector_Intrinsics_vec128 v00 = k[0U];
Lib_IntVector_Intrinsics_vec128 v16 = k[1U];
Lib_IntVector_Intrinsics_vec128 v20 = k[2U];
Lib_IntVector_Intrinsics_vec128 v30 = k[3U];
Lib_IntVector_Intrinsics_vec128
v0_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v1_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v2_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v3_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v0__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v1__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v2__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128
v3__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128 v0 = v0__;
Lib_IntVector_Intrinsics_vec128 v1 = v1__;
Lib_IntVector_Intrinsics_vec128 v2 = v2__;
Lib_IntVector_Intrinsics_vec128 v3 = v3__;
Lib_IntVector_Intrinsics_vec128 v010 = k[4U];
Lib_IntVector_Intrinsics_vec128 v110 = k[5U];
Lib_IntVector_Intrinsics_vec128 v210 = k[6U];
Lib_IntVector_Intrinsics_vec128 v310 = k[7U];
Lib_IntVector_Intrinsics_vec128
v0_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v1_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v2_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v3_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v0__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v1__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v2__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128
v3__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128 v4 = v0__0;
Lib_IntVector_Intrinsics_vec128 v5 = v1__0;
Lib_IntVector_Intrinsics_vec128 v6 = v2__0;
Lib_IntVector_Intrinsics_vec128 v7 = v3__0;
Lib_IntVector_Intrinsics_vec128 v011 = k[8U];
Lib_IntVector_Intrinsics_vec128 v111 = k[9U];
Lib_IntVector_Intrinsics_vec128 v211 = k[10U];
Lib_IntVector_Intrinsics_vec128 v311 = k[11U];
Lib_IntVector_Intrinsics_vec128
v0_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v1_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v2_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v3_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v0__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v1__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v2__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128
v3__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128 v8 = v0__1;
Lib_IntVector_Intrinsics_vec128 v9 = v1__1;
Lib_IntVector_Intrinsics_vec128 v10 = v2__1;
Lib_IntVector_Intrinsics_vec128 v11 = v3__1;
Lib_IntVector_Intrinsics_vec128 v01 = k[12U];
Lib_IntVector_Intrinsics_vec128 v120 = k[13U];
Lib_IntVector_Intrinsics_vec128 v21 = k[14U];
Lib_IntVector_Intrinsics_vec128 v31 = k[15U];
Lib_IntVector_Intrinsics_vec128
v0_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v1_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v2_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v3_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v0__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v1__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v2__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128
v3__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128 v12 = v0__2;
Lib_IntVector_Intrinsics_vec128 v13 = v1__2;
Lib_IntVector_Intrinsics_vec128 v14 = v2__2;
Lib_IntVector_Intrinsics_vec128 v15 = v3__2;
k[0U] = v0;
k[1U] = v4;
k[2U] = v8;
k[3U] = v12;
k[4U] = v1;
k[5U] = v5;
k[6U] = v9;
k[7U] = v13;
k[8U] = v2;
k[9U] = v6;
k[10U] = v10;
k[11U] = v14;
k[12U] = v3;
k[13U] = v7;
k[14U] = v11;
k[15U] = v15;
for (uint32_t i = (uint32_t)0U; i < (uint32_t)16U; i++) {
Lib_IntVector_Intrinsics_vec128
x = Lib_IntVector_Intrinsics_vec128_load_le(plain + i * (uint32_t)16U);
Lib_IntVector_Intrinsics_vec128 y = Lib_IntVector_Intrinsics_vec128_xor(x, k[i]);
Lib_IntVector_Intrinsics_vec128_store_le(plain + i * (uint32_t)16U, y);
}
memcpy(uu____2, plain, rem * sizeof(plain[0U]));
}
}
void
Hacl_Chacha20_Vec128_chacha20_decrypt_128(
uint32_t len,
uint8_t *out,
uint8_t *cipher,
uint8_t *key,
uint8_t *n,
uint32_t ctr)
{
Lib_IntVector_Intrinsics_vec128 ctx[16U];
for (uint32_t _i = 0U; _i < (uint32_t)16U; ++_i)
ctx[_i] = Lib_IntVector_Intrinsics_vec128_zero;
chacha20_init_128(ctx, key, n, ctr);
uint32_t rem = len % (uint32_t)256U;
uint32_t nb = len / (uint32_t)256U;
uint32_t rem1 = len % (uint32_t)256U;
for (uint32_t i = (uint32_t)0U; i < nb; i++) {
uint8_t *uu____0 = out + i * (uint32_t)256U;
uint8_t *uu____1 = cipher + i * (uint32_t)256U;
Lib_IntVector_Intrinsics_vec128 k[16U];
for (uint32_t _i = 0U; _i < (uint32_t)16U; ++_i)
k[_i] = Lib_IntVector_Intrinsics_vec128_zero;
chacha20_core_128(k, ctx, i);
Lib_IntVector_Intrinsics_vec128 v00 = k[0U];
Lib_IntVector_Intrinsics_vec128 v16 = k[1U];
Lib_IntVector_Intrinsics_vec128 v20 = k[2U];
Lib_IntVector_Intrinsics_vec128 v30 = k[3U];
Lib_IntVector_Intrinsics_vec128
v0_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v1_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v2_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v3_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v0__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v1__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v2__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128
v3__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128 v0 = v0__;
Lib_IntVector_Intrinsics_vec128 v1 = v1__;
Lib_IntVector_Intrinsics_vec128 v2 = v2__;
Lib_IntVector_Intrinsics_vec128 v3 = v3__;
Lib_IntVector_Intrinsics_vec128 v010 = k[4U];
Lib_IntVector_Intrinsics_vec128 v110 = k[5U];
Lib_IntVector_Intrinsics_vec128 v210 = k[6U];
Lib_IntVector_Intrinsics_vec128 v310 = k[7U];
Lib_IntVector_Intrinsics_vec128
v0_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v1_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v2_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v3_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v0__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v1__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v2__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128
v3__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128 v4 = v0__0;
Lib_IntVector_Intrinsics_vec128 v5 = v1__0;
Lib_IntVector_Intrinsics_vec128 v6 = v2__0;
Lib_IntVector_Intrinsics_vec128 v7 = v3__0;
Lib_IntVector_Intrinsics_vec128 v011 = k[8U];
Lib_IntVector_Intrinsics_vec128 v111 = k[9U];
Lib_IntVector_Intrinsics_vec128 v211 = k[10U];
Lib_IntVector_Intrinsics_vec128 v311 = k[11U];
Lib_IntVector_Intrinsics_vec128
v0_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v1_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v2_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v3_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v0__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v1__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v2__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128
v3__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128 v8 = v0__1;
Lib_IntVector_Intrinsics_vec128 v9 = v1__1;
Lib_IntVector_Intrinsics_vec128 v10 = v2__1;
Lib_IntVector_Intrinsics_vec128 v11 = v3__1;
Lib_IntVector_Intrinsics_vec128 v01 = k[12U];
Lib_IntVector_Intrinsics_vec128 v120 = k[13U];
Lib_IntVector_Intrinsics_vec128 v21 = k[14U];
Lib_IntVector_Intrinsics_vec128 v31 = k[15U];
Lib_IntVector_Intrinsics_vec128
v0_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v1_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v2_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v3_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v0__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v1__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v2__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128
v3__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128 v12 = v0__2;
Lib_IntVector_Intrinsics_vec128 v13 = v1__2;
Lib_IntVector_Intrinsics_vec128 v14 = v2__2;
Lib_IntVector_Intrinsics_vec128 v15 = v3__2;
k[0U] = v0;
k[1U] = v4;
k[2U] = v8;
k[3U] = v12;
k[4U] = v1;
k[5U] = v5;
k[6U] = v9;
k[7U] = v13;
k[8U] = v2;
k[9U] = v6;
k[10U] = v10;
k[11U] = v14;
k[12U] = v3;
k[13U] = v7;
k[14U] = v11;
k[15U] = v15;
for (uint32_t i0 = (uint32_t)0U; i0 < (uint32_t)16U; i0++) {
Lib_IntVector_Intrinsics_vec128
x = Lib_IntVector_Intrinsics_vec128_load_le(uu____1 + i0 * (uint32_t)16U);
Lib_IntVector_Intrinsics_vec128 y = Lib_IntVector_Intrinsics_vec128_xor(x, k[i0]);
Lib_IntVector_Intrinsics_vec128_store_le(uu____0 + i0 * (uint32_t)16U, y);
}
}
if (rem1 > (uint32_t)0U) {
uint8_t *uu____2 = out + nb * (uint32_t)256U;
uint8_t *uu____3 = cipher + nb * (uint32_t)256U;
uint8_t plain[256U] = { 0U };
memcpy(plain, uu____3, rem * sizeof(uu____3[0U]));
Lib_IntVector_Intrinsics_vec128 k[16U];
for (uint32_t _i = 0U; _i < (uint32_t)16U; ++_i)
k[_i] = Lib_IntVector_Intrinsics_vec128_zero;
chacha20_core_128(k, ctx, nb);
Lib_IntVector_Intrinsics_vec128 v00 = k[0U];
Lib_IntVector_Intrinsics_vec128 v16 = k[1U];
Lib_IntVector_Intrinsics_vec128 v20 = k[2U];
Lib_IntVector_Intrinsics_vec128 v30 = k[3U];
Lib_IntVector_Intrinsics_vec128
v0_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v1_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v00, v16);
Lib_IntVector_Intrinsics_vec128
v2_ = Lib_IntVector_Intrinsics_vec128_interleave_low32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v3_ = Lib_IntVector_Intrinsics_vec128_interleave_high32(v20, v30);
Lib_IntVector_Intrinsics_vec128
v0__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v1__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_, v2_);
Lib_IntVector_Intrinsics_vec128
v2__ = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128
v3__ = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_, v3_);
Lib_IntVector_Intrinsics_vec128 v0 = v0__;
Lib_IntVector_Intrinsics_vec128 v1 = v1__;
Lib_IntVector_Intrinsics_vec128 v2 = v2__;
Lib_IntVector_Intrinsics_vec128 v3 = v3__;
Lib_IntVector_Intrinsics_vec128 v010 = k[4U];
Lib_IntVector_Intrinsics_vec128 v110 = k[5U];
Lib_IntVector_Intrinsics_vec128 v210 = k[6U];
Lib_IntVector_Intrinsics_vec128 v310 = k[7U];
Lib_IntVector_Intrinsics_vec128
v0_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v1_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v010, v110);
Lib_IntVector_Intrinsics_vec128
v2_0 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v3_0 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v210, v310);
Lib_IntVector_Intrinsics_vec128
v0__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v1__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_0, v2_0);
Lib_IntVector_Intrinsics_vec128
v2__0 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128
v3__0 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_0, v3_0);
Lib_IntVector_Intrinsics_vec128 v4 = v0__0;
Lib_IntVector_Intrinsics_vec128 v5 = v1__0;
Lib_IntVector_Intrinsics_vec128 v6 = v2__0;
Lib_IntVector_Intrinsics_vec128 v7 = v3__0;
Lib_IntVector_Intrinsics_vec128 v011 = k[8U];
Lib_IntVector_Intrinsics_vec128 v111 = k[9U];
Lib_IntVector_Intrinsics_vec128 v211 = k[10U];
Lib_IntVector_Intrinsics_vec128 v311 = k[11U];
Lib_IntVector_Intrinsics_vec128
v0_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v1_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v011, v111);
Lib_IntVector_Intrinsics_vec128
v2_1 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v3_1 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v211, v311);
Lib_IntVector_Intrinsics_vec128
v0__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v1__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_1, v2_1);
Lib_IntVector_Intrinsics_vec128
v2__1 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128
v3__1 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_1, v3_1);
Lib_IntVector_Intrinsics_vec128 v8 = v0__1;
Lib_IntVector_Intrinsics_vec128 v9 = v1__1;
Lib_IntVector_Intrinsics_vec128 v10 = v2__1;
Lib_IntVector_Intrinsics_vec128 v11 = v3__1;
Lib_IntVector_Intrinsics_vec128 v01 = k[12U];
Lib_IntVector_Intrinsics_vec128 v120 = k[13U];
Lib_IntVector_Intrinsics_vec128 v21 = k[14U];
Lib_IntVector_Intrinsics_vec128 v31 = k[15U];
Lib_IntVector_Intrinsics_vec128
v0_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v1_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v01, v120);
Lib_IntVector_Intrinsics_vec128
v2_2 = Lib_IntVector_Intrinsics_vec128_interleave_low32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v3_2 = Lib_IntVector_Intrinsics_vec128_interleave_high32(v21, v31);
Lib_IntVector_Intrinsics_vec128
v0__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v1__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v0_2, v2_2);
Lib_IntVector_Intrinsics_vec128
v2__2 = Lib_IntVector_Intrinsics_vec128_interleave_low64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128
v3__2 = Lib_IntVector_Intrinsics_vec128_interleave_high64(v1_2, v3_2);
Lib_IntVector_Intrinsics_vec128 v12 = v0__2;
Lib_IntVector_Intrinsics_vec128 v13 = v1__2;
Lib_IntVector_Intrinsics_vec128 v14 = v2__2;
Lib_IntVector_Intrinsics_vec128 v15 = v3__2;
k[0U] = v0;
k[1U] = v4;
k[2U] = v8;
k[3U] = v12;
k[4U] = v1;
k[5U] = v5;
k[6U] = v9;
k[7U] = v13;
k[8U] = v2;
k[9U] = v6;
k[10U] = v10;
k[11U] = v14;
k[12U] = v3;
k[13U] = v7;
k[14U] = v11;
k[15U] = v15;
for (uint32_t i = (uint32_t)0U; i < (uint32_t)16U; i++) {
Lib_IntVector_Intrinsics_vec128
x = Lib_IntVector_Intrinsics_vec128_load_le(plain + i * (uint32_t)16U);
Lib_IntVector_Intrinsics_vec128 y = Lib_IntVector_Intrinsics_vec128_xor(x, k[i]);
Lib_IntVector_Intrinsics_vec128_store_le(plain + i * (uint32_t)16U, y);
}
memcpy(uu____2, plain, rem * sizeof(plain[0U]));
}
}
|