-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrmd.hh
1048 lines (925 loc) · 82.2 KB
/
rmd.hh
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
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* NAME
*
* rmd - RACE message digest
*
* SYNOPSIS
*
* auto digest = RMD<128>().update(...).digest();
* auto digest = RMD<160>().update(...).digest();
* auto digest = RMD<256>().update(...).digest();
* auto digest = RMD<320>().update(...).digest();
*
* DESCRIPTION
*
* R[IPE]MD (RACE Integrity Primitives Evaluation Message Digest) is
* a family of cryptographic hash functions that were developed as a
* part of the European Union's RACE project. The original algorithm,
* known as RIPEMD-160, was designed to produce a 160-bit hash value,
* but other variants like RIPEMD-128, RIPEMD-256 and RIPEMD-320 were
* later introduced to produce shorter or longer hash values.
*
* EXAMPLES
*
* #include <crypto/rmd.h>
* using namespace crypto;
*
* auto
* hash(const auto &trivially_copyable_objects) {
*
* auto hasher = RMD<256>();
*
* for (const auto &object: trivially_copyable_objects) {
* hasher.update(object);
* }
*
* return rmd<160>(hasher.update("secret").digest());
* }
*
* COPYRIGHT
*
* Copyright 2022 Quasis - The MIT License
*/
namespace crypto {
template<unsigned state_bits>
class RMD {
using uint8_type = __UINT8_TYPE__;
using uint16_type = __UINT16_TYPE__;
using uint32_type = __UINT32_TYPE__;
using uint64_type = __UINT64_TYPE__;
template<typename value_type, auto count>
struct buffer {
value_type m_data[count];
using size_type = decltype(sizeof(void*));
using pointer = uint8_type*;
using const_pointer = const uint8_type*;
using reference = value_type&;
using const_reference = const value_type&;
constexpr size_type
size() const noexcept {
return count;
}
constexpr const_pointer
data() const noexcept {
return reinterpret_cast<const_pointer>(m_data);
}
constexpr pointer
data() noexcept {
return reinterpret_cast<pointer>(m_data);
}
constexpr reference
operator[](size_type index) noexcept {
return m_data[index];
}
constexpr const_reference
operator[](size_type index) const noexcept {
return m_data[index];
}
};
public:
using size_type = uint64_type;
using word_type = uint32_type;
using state_type = buffer<word_type, state_bits / 32>;
using block_type = buffer<word_type, 16>;
using round_type = buffer<word_type, state_bits % 160 ? 64 : 80>;
using output_type = buffer<uint8_type, state_bits / 8>;
constexpr
RMD() noexcept;
constexpr
~RMD() noexcept {
__builtin_memset(m_block.data(), 0, sizeof(block_type));
}
constexpr size_type
size() const noexcept {
return m_count;
}
constexpr RMD&
update(size_type count, uint8_type input) noexcept {
auto cursor = m_count % sizeof(block_type);
auto excess = (cursor + count) % sizeof(block_type);
auto blocks = (cursor + count) / sizeof(block_type);
while (blocks-- != 0) {
while (cursor < sizeof(block_type)) {
m_block.data()[cursor++] = input;
}
cursor = (compress(m_block), 0);
}
while (cursor < excess) {
m_block.data()[cursor++] = input;
}
return (m_count += count, *this);
}
constexpr RMD&
update(const uint8_type *input, size_type count) noexcept {
auto cursor = m_count % sizeof(block_type);
auto excess = (cursor + count) % sizeof(block_type);
auto blocks = (cursor + count) / sizeof(block_type);
while (blocks-- != 0) {
while (cursor < sizeof(block_type)) {
m_block.data()[cursor++] = *input++;
}
cursor = (compress(m_block), 0);
}
while (cursor < excess) {
m_block.data()[cursor++] = *input++;
}
return (m_count += count, *this);
}
template<typename input_type> constexpr RMD&
update(const input_type *input, size_type count) noexcept requires (__is_trivially_copyable(input_type)) {
return update(reinterpret_cast<const uint8_type*>(input), sizeof(input_type) * count);
}
template<typename input_type, auto count> constexpr RMD&
update(const input_type (&input)[count]) noexcept requires (__is_trivially_copyable(input_type)) {
return update(reinterpret_cast<const uint8_type*>(input), sizeof(input_type) * count);
}
template<typename input_type> constexpr RMD&
update(const input_type *begin, const input_type *end) noexcept requires (__is_trivially_copyable(input_type)) {
return update(reinterpret_cast<const uint8_type*>(begin), sizeof(input_type) * (end - begin));
}
template<typename input_type> constexpr RMD&
update(const input_type &input) noexcept requires (__is_trivially_copyable(input_type)) {
return update(reinterpret_cast<const uint8_type*>(&input), sizeof(input_type));
}
constexpr RMD&
update(const char *input) noexcept {
return update(reinterpret_cast<const uint8_type*>(input), __builtin_strlen(input));
}
template<typename input_type> constexpr RMD&
update(const size_type count, input_type &&input) noexcept {
for (size_type i = 0; i < count; ++i) update(static_cast<input_type&&>(input)); return *this;
}
constexpr output_type
digest() const noexcept {
auto hasher = RMD{*this};
hasher.update(size_type{1}, uint8_type{0x80});
auto length = hasher.size() % sizeof(block_type) + sizeof(size_type);
auto factor = (length + sizeof(block_type) - 1) / sizeof(block_type);
hasher.update(factor * sizeof(block_type) - length, uint8_type{0x00});
hasher.update(m_count << 3);
return *reinterpret_cast<output_type*>(&hasher.m_state);
}
private:
size_type m_count = {};
block_type m_block = {};
state_type m_state = {};
static constexpr uint32_type
rotl(uint32_type value, int count) noexcept {
return __builtin_rotateleft32(value, count);
}
static constexpr void
swap(word_type &word1, word_type &word2) noexcept {
word_type temp = static_cast<word_type&&>(word1);
word1 = static_cast<word_type&&>(word2);
word2 = static_cast<word_type&&>(temp);
}
static constexpr word_type
bop045(word_type word1, word_type word2, word_type word3) noexcept {
return word1 ^ (word2 | ~word3);
}
static constexpr word_type
bop089(word_type word1, word_type word2, word_type word3) noexcept {
return (word1 | ~word2) ^ word3;
}
static constexpr word_type
bop150(word_type word1, word_type word2, word_type word3) noexcept {
return word1 ^ word2 ^ word3;
}
static constexpr word_type
bop202(word_type word1, word_type word2, word_type word3) noexcept {
return (word1 & (word2 ^ word3)) ^ word3;
}
static constexpr word_type
bop228(word_type word1, word_type word2, word_type word3) noexcept {
return (word1 & word3) | (word2 & ~word3);
}
static constexpr void
unshift(state_type &state, word_type value) noexcept;
constexpr void
compress(const block_type &block) noexcept;
};
// 128
template<> constexpr
RMD<128>::RMD() noexcept : m_state{
0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476} {
}
template<> constexpr void
RMD<128>::unshift(state_type &state, word_type value) noexcept {
state[0] = state[3];
state[3] = state[2];
state[2] = state[1];
state[1] = value;
}
template<> constexpr void
RMD<128>::compress(const block_type &block) noexcept {
state_type hash1 = m_state, hash2 = m_state;
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 0], 11));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 5], 8));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 1], 14));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[14], 9));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 2], 15));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 7], 9));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 3], 12));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 0], 11));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 4], 5));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 9], 13));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 5], 8));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 2], 15));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 6], 7));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[11], 15));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 7], 9));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 4], 5));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 8], 11));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[13], 7));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 9], 13));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 6], 7));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[10], 14));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[15], 8));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[11], 15));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 8], 11));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[12], 6));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 1], 14));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[13], 7));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[10], 14));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[14], 9));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 3], 12));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[15], 8));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[12], 6));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 7], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 6], 9));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 4], 6));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[11], 13));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[13], 8));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 3], 15));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 1], 13));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 7], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[10], 11));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 0], 12));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 6], 9));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[13], 8));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[15], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 5], 9));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 3], 15));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[10], 11));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[12], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[14], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 0], 12));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[15], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 9], 15));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 8], 12));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 5], 9));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[12], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 2], 11));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 4], 6));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[14], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 9], 15));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[11], 13));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 1], 13));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 8], 12));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 2], 11));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 3], 11));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[15], 9));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[10], 13));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 5], 7));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[14], 6));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 1], 15));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 4], 7));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 3], 11));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 9], 14));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 7], 8));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[15], 9));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[14], 6));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 8], 13));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 6], 6));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 1], 15));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 9], 14));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 2], 14));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[11], 12));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 7], 8));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 8], 13));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 0], 13));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[12], 5));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 6], 6));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 2], 14));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[13], 5));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[10], 13));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[11], 12));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 0], 13));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 5], 7));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 4], 7));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[12], 5));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[13], 5));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 1], 11));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 8], 15));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 9], 12));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 6], 5));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[11], 14));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 4], 8));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[10], 15));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 1], 11));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 0], 14));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 3], 14));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 8], 15));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[11], 14));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[12], 9));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[15], 6));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 4], 8));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 0], 14));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[13], 9));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 5], 6));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 3], 14));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[12], 9));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 7], 5));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 2], 12));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[15], 6));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[13], 9));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[14], 8));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 9], 12));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 5], 6));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 7], 5));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 6], 5));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[10], 15));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 2], 12));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[14], 8));
auto value = m_state[1] + hash1[2] + hash2[3];
m_state[1] = m_state[2] + hash1[3] + hash2[0];
m_state[2] = m_state[3] + hash1[0] + hash2[1];
m_state[3] = m_state[0] + hash1[1] + hash2[2];
m_state[0] = value;
}
// 160
template<> constexpr
RMD<160>::RMD() noexcept : m_state{
0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0} {
}
template<> constexpr void
RMD<160>::unshift(state_type &state, word_type value) noexcept {
state[0] = state[4];
state[4] = state[3];
state[3] = rotl(state[2], 10);
state[2] = state[1];
state[1] = value;
}
template<> constexpr void
RMD<160>::compress(const block_type &block) noexcept {
state_type hash1 = m_state, hash2 = m_state;
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 0], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 5], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 1], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[14], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 2], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 7], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 3], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 0], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 4], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 9], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 5], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 2], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 6], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[11], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 7], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 4], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 8], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[13], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 9], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 6], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[10], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[15], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[11], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 8], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[12], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 1], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[13], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[10], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[14], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 3], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[15], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[12], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 7], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 6], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 4], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[11], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[13], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 3], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 1], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 7], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[10], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 0], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 6], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[13], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[15], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 5], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 3], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[10], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[12], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[14], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 0], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[15], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 9], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 8], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 5], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[12], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 2], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 4], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[14], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 9], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[11], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 1], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 8], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 2], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 3], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[15], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[10], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 5], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[14], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 1], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 4], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 3], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 9], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 7], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[15], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[14], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 8], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 6], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 1], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 9], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 2], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[11], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 7], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 8], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 0], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[12], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 6], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 2], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[13], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[10], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[11], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 0], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 5], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 4], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[12], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[13], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 1], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 8], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 9], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 6], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[11], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 4], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[10], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 1], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 0], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 3], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 8], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[11], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[12], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[15], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 4], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 0], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[13], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 5], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 3], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[12], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 7], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 2], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[15], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[13], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[14], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 9], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 5], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 7], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 6], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[10], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 2], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[14], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 4], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[12], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 0], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[15], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 5], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[10], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 9], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 4], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 7], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 1], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[12], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 5], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 2], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 8], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[10], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 7], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[14], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 6], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 1], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 2], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 3], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[13], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 8], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[14], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[11], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 0], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 6], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 3], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[15], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 9], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[13], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[11], 11) + hash2[4]);
auto value = m_state[1] + hash1[2] + hash2[3];
m_state[1] = m_state[2] + hash1[3] + hash2[4];
m_state[2] = m_state[3] + hash1[4] + hash2[0];
m_state[3] = m_state[4] + hash1[0] + hash2[1];
m_state[4] = m_state[0] + hash1[1] + hash2[2];
m_state[0] = value;
}
// 256
template<> constexpr
RMD<256>::RMD() noexcept : m_state{
0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476,
0x76543210, 0xFEDCBA98, 0x89ABCDEF, 0x01234567} {
}
template<> constexpr void
RMD<256>::unshift(state_type &state, word_type value) noexcept {
state[0] = state[3];
state[3] = state[2];
state[2] = state[1];
state[1] = value;
}
template<> constexpr void
RMD<256>::compress(const block_type &block) noexcept {
state_type state = m_state, &hash1 = state, &hash2 = *static_cast<state_type*>(static_cast<void*>(&state[4]));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 0], 11));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 5], 8));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 1], 14));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[14], 9));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 2], 15));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 7], 9));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 3], 12));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 0], 11));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 4], 5));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 9], 13));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 5], 8));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 2], 15));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 6], 7));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[11], 15));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 7], 9));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 4], 5));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 8], 11));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[13], 7));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 9], 13));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 6], 7));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[10], 14));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[15], 8));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[11], 15));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 8], 11));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[12], 6));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 1], 14));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[13], 7));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[10], 14));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[14], 9));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 3], 12));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[15], 8));
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[12], 6));
swap(hash1[0], hash2[0]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 7], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 6], 9));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 4], 6));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[11], 13));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[13], 8));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 3], 15));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 1], 13));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 7], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[10], 11));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 0], 12));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 6], 9));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[13], 8));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[15], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 5], 9));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 3], 15));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[10], 11));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[12], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[14], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 0], 12));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[15], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 9], 15));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 8], 12));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 5], 9));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[12], 7));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 2], 11));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 4], 6));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[14], 7));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 9], 15));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[11], 13));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 1], 13));
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 8], 12));
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 2], 11));
swap(hash1[1], hash2[1]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 3], 11));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[15], 9));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[10], 13));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 5], 7));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[14], 6));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 1], 15));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 4], 7));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 3], 11));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 9], 14));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 7], 8));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[15], 9));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[14], 6));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 8], 13));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 6], 6));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 1], 15));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 9], 14));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 2], 14));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[11], 12));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 7], 8));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 8], 13));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 0], 13));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[12], 5));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 6], 6));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 2], 14));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[13], 5));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[10], 13));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[11], 12));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 0], 13));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 5], 7));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 4], 7));
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[12], 5));
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[13], 5));
swap(hash1[2], hash2[2]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 1], 11));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 8], 15));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 9], 12));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 6], 5));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[11], 14));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 4], 8));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[10], 15));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 1], 11));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 0], 14));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 3], 14));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 8], 15));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[11], 14));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[12], 9));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[15], 6));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 4], 8));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 0], 14));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[13], 9));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 5], 6));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 3], 14));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[12], 9));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 7], 5));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 2], 12));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[15], 6));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[13], 9));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[14], 8));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 9], 12));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 5], 6));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 7], 5));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 6], 5));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[10], 15));
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 2], 12));
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[14], 8));
swap(hash1[3], hash2[3]);
for (auto i = 0U; i < state.size(); ++i) {
m_state[i] += state[i];
}
}
// 320
template<> constexpr
RMD<320>::RMD() noexcept : m_state{
0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0,
0x76543210, 0xFEDCBA98, 0x89ABCDEF, 0x01234567, 0x3C2D1E0F} {
}
template<> constexpr void
RMD<320>::unshift(state_type &state, word_type value) noexcept {
state[0] = state[4];
state[4] = state[3];
state[3] = rotl(state[2], 10);
state[2] = state[1];
state[1] = value;
}
template<> constexpr void
RMD<320>::compress(const block_type &block) noexcept {
state_type state = m_state, &hash1 = state, &hash2 = *static_cast<state_type*>(static_cast<void*>(&state[5]));
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 0], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 5], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 1], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[14], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 2], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 7], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 3], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 0], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 4], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 9], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 5], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 2], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 6], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[11], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 7], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 4], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 8], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[13], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[ 9], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 6], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[10], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[15], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[11], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 8], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[12], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 1], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[13], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[10], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[14], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[ 3], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop150(hash1[1], hash1[2], hash1[3]) + 0x00000000 + block[15], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop045(hash2[1], hash2[2], hash2[3]) + 0x50A28BE6 + block[12], 6) + hash2[4]);
swap(hash1[1], hash2[1]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 7], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 6], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 4], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[11], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[13], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 3], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 1], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 7], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[10], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 0], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 6], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[13], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[15], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 5], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 3], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[10], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[12], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[14], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 0], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[15], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 9], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 8], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 5], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[12], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 2], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 4], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[14], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 9], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[11], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 1], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop202(hash1[1], hash1[2], hash1[3]) + 0x5A827999 + block[ 8], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop228(hash2[1], hash2[2], hash2[3]) + 0x5C4DD124 + block[ 2], 11) + hash2[4]);
swap(hash1[3], hash2[3]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 3], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[15], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[10], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 5], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[14], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 1], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 4], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 3], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 9], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 7], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[15], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[14], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 8], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 6], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 1], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 9], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 2], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[11], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 7], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 8], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 0], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[12], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 6], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 2], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[13], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[10], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[11], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 0], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[ 5], 7) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[ 4], 7) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop089(hash1[1], hash1[2], hash1[3]) + 0x6ED9EBA1 + block[12], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop089(hash2[1], hash2[2], hash2[3]) + 0x6D703EF3 + block[13], 5) + hash2[4]);
swap(hash1[0], hash2[0]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 1], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 8], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 9], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 6], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[11], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 4], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[10], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 1], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 0], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 3], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 8], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[11], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[12], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[15], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 4], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 0], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[13], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 5], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 3], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[12], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 7], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 2], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[15], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[13], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[14], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 9], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 5], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[ 7], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 6], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[10], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop228(hash1[1], hash1[2], hash1[3]) + 0x8F1BBCDC + block[ 2], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop202(hash2[1], hash2[2], hash2[3]) + 0x7A6D76E9 + block[14], 8) + hash2[4]);
swap(hash1[2], hash2[2]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 4], 9) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[12], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 0], 15) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[15], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 5], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[10], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 9], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 4], 9) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 7], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 1], 12) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[12], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 5], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 2], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 8], 14) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[10], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 7], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[14], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 6], 8) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 1], 12) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 2], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 3], 13) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[13], 6) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 8], 14) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[14], 5) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[11], 11) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 0], 15) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[ 6], 8) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 3], 13) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[15], 5) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[ 9], 11) + hash2[4]);
unshift(hash1, rotl(hash1[0] + bop045(hash1[1], hash1[2], hash1[3]) + 0xA953FD4E + block[13], 6) + hash1[4]);
unshift(hash2, rotl(hash2[0] + bop150(hash2[1], hash2[2], hash2[3]) + 0x00000000 + block[11], 11) + hash2[4]);
swap(hash1[4], hash2[4]);
for (auto i = 0U; i < state.size(); ++i) {
m_state[i] += state[i];
}
}
template<unsigned state_bits, typename ...input_type> constexpr decltype(auto)
rmd(input_type &&...input) noexcept {
return RMD<state_bits>().update(static_cast<input_type&&>(input)...).digest();
}
}
#if __INCLUDE_LEVEL__
#pragma once
#else
#include <cassert>
using namespace crypto;
template<auto count, typename right_type> constexpr bool
operator==(const char (&left)[count], const right_type &right) noexcept {
return count - 1 == sizeof(right_type) && __builtin_memcmp(&left, &right, sizeof(right_type)) == 0;
}