diff --git a/cov/cmdline/locate.c.func-sort-c.html b/cov/cmdline/locate.c.func-sort-c.html new file mode 100644 index 00000000..561c246c --- /dev/null +++ b/cov/cmdline/locate.c.func-sort-c.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - cmdline/locate.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - cmdline - locate.c (source / functions)HitTotalCoverage
Test:lcov.infoLines:11912694.4 %
Date:2026-02-28 16:42:47Functions:77100.0 %
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by hit count
state_locate_mark_tail_blocks_for_resync2
state_locate5
state_locate_info5
add_size_to_sum11267
dump_entry11267
parity_entry_compare61484
collect_parity_block_file78921
+
+
+ + + +
Generated by: LCOV version 1.0
+
+ + + diff --git a/cov/cmdline/locate.c.func.html b/cov/cmdline/locate.c.func.html new file mode 100644 index 00000000..141a6835 --- /dev/null +++ b/cov/cmdline/locate.c.func.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - cmdline/locate.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - cmdline - locate.c (source / functions)HitTotalCoverage
Test:lcov.infoLines:11912694.4 %
Date:2026-02-28 16:42:47Functions:77100.0 %
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Function Name Sort by function nameHit count Sort by hit count
add_size_to_sum11267
collect_parity_block_file78921
dump_entry11267
parity_entry_compare61484
state_locate5
state_locate_info5
state_locate_mark_tail_blocks_for_resync2
+
+
+ + + +
Generated by: LCOV version 1.0
+
+ + + diff --git a/cov/cmdline/locate.c.gcov.html b/cov/cmdline/locate.c.gcov.html new file mode 100644 index 00000000..503a71e3 --- /dev/null +++ b/cov/cmdline/locate.c.gcov.html @@ -0,0 +1,344 @@ + + + + + + + LCOV - lcov.info - cmdline/locate.c + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - cmdline - locate.c (source / functions)HitTotalCoverage
Test:lcov.infoLines:11912694.4 %
Date:2026-02-28 16:42:47Functions:77100.0 %
+
+ + + + + + + + +

+
          Line data    Source code
+
+       1             : /*
+       2             :  * Copyright (C) 2026 Andrea Mazzoleni
+       3             :  *
+       4             :  * This program is free software: you can redistribute it and/or modify
+       5             :  * it under the terms of the GNU General Public License as published by
+       6             :  * the Free Software Foundation, either version 3 of the License, or
+       7             :  * (at your option) any later version.
+       8             :  *
+       9             :  * This program is distributed in the hope that it will be useful,
+      10             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+      11             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+      12             :  * GNU General Public License for more details.
+      13             :  *
+      14             :  * You should have received a copy of the GNU General Public License
+      15             :  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+      16             :  */
+      17             : 
+      18             : #include "portable.h"
+      19             : 
+      20             : #include "elem.h"
+      21             : #include "parity.h"
+      22             : #include "state.h"
+      23             : #include "stream.h"
+      24             : #include "locate.h"
+      25             : 
+      26             : struct snapraid_parity_entry {
+      27             :         uint32_t block_size;
+      28             :         block_off_t low; /**< Lower position in the parity */
+      29             :         block_off_t high; /**< Higher position in the parity */
+      30             :         block_off_t fragments; /**< Number of fragments in the parity */
+      31             :         struct snapraid_file* file;
+      32             :         struct snapraid_disk* disk;
+      33             :         tommy_node node;
+      34             : };
+      35             : 
+      36             : struct snapraid_locate_info {
+      37             :         block_off_t block_max; /**< Number of blocks in the parity */
+      38             :         data_off_t parity_size; /**< Size in bytes of the parity */
+      39             :         block_off_t tail_block; /**< Number of blocks of the tail of the parity */
+      40             :         block_off_t low_to_free_tail_block; /**< First block that has to be freed */
+      41             : };
+      42             : 
+      43       61484 : static int parity_entry_compare(const void* void_a, const void* void_b)
+      44             : {
+      45       61484 :         const struct snapraid_parity_entry* entry_a = void_a;
+      46       61484 :         const struct snapraid_parity_entry* entry_b = void_b;
+      47             : 
+      48       61484 :         if (entry_a->high < entry_b->high)
+      49       36483 :                 return -1;
+      50       25001 :         if (entry_a->high > entry_b->high)
+      51       15466 :                 return 1;
+      52             : 
+      53        9535 :         if (entry_a->low < entry_b->low)
+      54        3691 :                 return -1;
+      55        5844 :         if (entry_a->low > entry_b->low)
+      56        3170 :                 return 1;
+      57             : 
+      58        2674 :         return strcmp(entry_a->file->sub, entry_b->file->sub);
+      59             : }
+      60             : 
+      61       11267 : static void dump_entry(void* void_entry)
+      62             : {
+      63             :         char esc_buffer[ESC_MAX];
+      64       11267 :         struct snapraid_parity_entry* entry = void_entry;
+      65       11267 :         printf("%12" PRIu64 " ", entry->low * (uint64_t)entry->block_size);
+      66       11267 :         printf("%12" PRIu64 " ", (entry->high - entry->low + 1) * (uint64_t)entry->block_size);
+      67       11267 :         printf("%8u ", entry->fragments);
+      68       11267 :         printf("%s\n", fmt_term(entry->disk, entry->file->sub, esc_buffer));
+      69       11267 : }
+      70             : 
+      71       11267 : static void add_size_to_sum(void* arg, void* void_entry)
+      72             : {
+      73       11267 :         struct snapraid_parity_entry* entry = void_entry;
+      74       11267 :         data_off_t* size_sum = arg;
+      75             : 
+      76       11267 :         *size_sum += entry->file->size;
+      77       11267 : }
+      78             : 
+      79       78921 : static void collect_parity_block_file(uint32_t block_size, struct snapraid_disk* disk, struct snapraid_file* file, tommy_list* file_list, block_off_t low_to_free_tail_block)
+      80             : {
+      81       78921 :         block_off_t parity_low = 0; /* lower block */
+      82       78921 :         block_off_t parity_high = 0; /* higher block */
+      83       78921 :         block_off_t parity_fragments = 0; /* number of fragments */
+      84             : 
+      85      276775 :         for (block_off_t i = 0; i < file->blockmax; ++i) {
+      86      197854 :                 block_off_t parity_pos = fs_file2par_find(disk, file, i);
+      87             : 
+      88             :                 /* check if a valid position is found */
+      89      197854 :                 if (parity_pos == POS_NULL) {
+      90             :                         /* block not yet allocated */
+      91           0 :                         continue;
+      92             :                 }
+      93             : 
+      94      197854 :                 if (parity_fragments == 0) {
+      95       78802 :                         parity_low = parity_pos;
+      96       78802 :                         parity_high = parity_pos;
+      97       78802 :                         parity_fragments = 1;
+      98             :                 } else {
+      99      119052 :                         if (parity_pos != parity_high + 1)
+     100         241 :                                 ++parity_fragments;
+     101      119052 :                         parity_high = parity_pos;
+     102             :                 }
+     103             :         }
+     104             : 
+     105       78921 :         if (parity_fragments == 0)
+     106         119 :                 return; /* not allocated */
+     107             : 
+     108       78802 :         if (low_to_free_tail_block > 0 && parity_high < low_to_free_tail_block)
+     109       56277 :                 return; /* entry not in the range to free */
+     110             : 
+     111             :         /* found a relevant block so add the corresponding file */
+     112       22525 :         struct snapraid_parity_entry* entry = malloc_nofail(sizeof(struct snapraid_parity_entry));
+     113       22525 :         entry->block_size = block_size;
+     114       22525 :         entry->file = file;
+     115       22525 :         entry->disk = disk;
+     116       22525 :         entry->low = parity_low;
+     117       22525 :         entry->high = parity_high;
+     118       22525 :         entry->fragments = parity_fragments;
+     119       22525 :         tommy_list_insert_tail(file_list, &entry->node, entry);
+     120             : }
+     121             : 
+     122           5 : void state_locate_info(struct snapraid_state* state, uint64_t parity_tail, struct snapraid_locate_info* info)
+     123             : {
+     124           5 :         uint32_t block_size = state->block_size;
+     125             : 
+     126           5 :         info->block_max = parity_allocated_size(state);
+     127           5 :         info->parity_size = info->block_max * (uint64_t)block_size;
+     128             : 
+     129           5 :         info->tail_block = (parity_tail + block_size - 1) / block_size;
+     130             : 
+     131           5 :         if (info->tail_block > info->block_max)
+     132           0 :                 info->low_to_free_tail_block = 0;
+     133             :         else
+     134           5 :                 info->low_to_free_tail_block = info->block_max - info->tail_block;
+     135           5 : }
+     136             : 
+     137           5 : void state_locate(struct snapraid_state* state, uint64_t parity_tail)
+     138             : {
+     139             :         char buf[64];
+     140           5 :         uint32_t block_size = state->block_size;
+     141             :         block_off_t low_to_free_tail_block;
+     142             : 
+     143           5 :         printf("SnapRAID locate report:\n");
+     144           5 :         printf("\n");
+     145             : 
+     146           5 :         if (parity_tail == 0) {
+     147           1 :                 printf("Locate all files\n\n");
+     148           1 :                 low_to_free_tail_block = 0;
+     149             :         } else {
+     150           4 :                 printf("Locate files within the tail of %sB of the parity\n\n", fmt_size(parity_tail, buf, sizeof(buf)));
+     151             : 
+     152             :                 struct snapraid_locate_info info;
+     153           4 :                 state_locate_info(state, parity_tail, &info);
+     154             : 
+     155           4 :                 printf("Current parity size is %sB\n", fmt_size(info.parity_size, buf, sizeof(buf)));
+     156           4 :                 if (info.tail_block > info.block_max) {
+     157           0 :                         printf("Specified tail greater than the parity size! Operate on the full parity\n");
+     158             :                 }
+     159             : 
+     160           4 :                 low_to_free_tail_block = info.low_to_free_tail_block;
+     161             :         }
+     162             : 
+     163           5 :         msg_progress("Collecting files with offset greater or equal to %" PRIu64 "\n", low_to_free_tail_block * (uint64_t)block_size);
+     164             : 
+     165             :         tommy_list files;
+     166           5 :         tommy_list_init(&files);
+     167          35 :         for (tommy_node* i = tommy_list_head(&state->disklist); i != 0; i = i->next) {
+     168          30 :                 struct snapraid_disk* disk = i->data;
+     169       56402 :                 for (tommy_node* j = tommy_list_head(&disk->filelist); j != 0; j = j->next) {
+     170       56372 :                         struct snapraid_file* file = j->data;
+     171       56372 :                         collect_parity_block_file(block_size, disk, file, &files, low_to_free_tail_block);
+     172             :                 }
+     173             :         }
+     174             : 
+     175           5 :         printf("\n");
+     176             : 
+     177           5 :         if (tommy_list_count(&files) == 0) {
+     178           0 :                 printf("No files located in the specified parity tail.\n");
+     179             :         } else {
+     180           5 :                 tommy_list_sort(&files, parity_entry_compare);
+     181             : 
+     182           5 :                 data_off_t total_size_located = 0;
+     183             : 
+     184           5 :                 tommy_list_foreach_arg(&files, add_size_to_sum, &total_size_located);
+     185             : 
+     186           5 :                 printf("Located data in this range: %sB\n", fmt_size(total_size_located, buf, sizeof(buf)));
+     187             : 
+     188           5 :                 printf("\n");
+     189             : 
+     190             :                 /*      |<##################################################################72>|####80>| */
+     191           5 :                 printf("       Offset         Span    Frags\n");
+     192             : 
+     193           5 :                 tommy_list_foreach(&files, dump_entry);
+     194             :         }
+     195             : 
+     196           5 :         tommy_list_foreach(&files, free);
+     197           5 : }
+     198             : 
+     199           2 : void state_locate_mark_tail_blocks_for_resync(struct snapraid_state* state, uint64_t parity_tail)
+     200             : {
+     201             :         char buf[64];
+     202           2 :         uint32_t block_size = state->block_size;
+     203             :         block_off_t low_to_free_tail_block;
+     204             : 
+     205           2 :         if (parity_tail == 0) {
+     206           1 :                 printf("Forcing reallocation of all files\n\n");
+     207           1 :                 low_to_free_tail_block = 0;
+     208             :         } else {
+     209           1 :                 msg_progress("Forcing reallocation of all files within the tail of %sB of the parity\n\n", fmt_size(parity_tail, buf, sizeof(buf)));
+     210             : 
+     211             :                 struct snapraid_locate_info info;
+     212           1 :                 state_locate_info(state, parity_tail, &info);
+     213             : 
+     214           1 :                 printf("Current parity size is %sB\n", fmt_size(info.parity_size, buf, sizeof(buf)));
+     215           1 :                 if (info.tail_block > info.block_max) {
+     216           0 :                         printf("Specified tail greater than the parity size! Operate on the full parity\n");
+     217             :                 }
+     218             : 
+     219           1 :                 low_to_free_tail_block = info.low_to_free_tail_block;
+     220             :         }
+     221             : 
+     222           2 :         msg_progress("Collecting files with offset greater or equal to %" PRIu64 "\n", low_to_free_tail_block * (uint64_t)block_size);
+     223             : 
+     224             :         tommy_list files;
+     225           2 :         tommy_list_init(&files);
+     226          14 :         for (tommy_node* i = tommy_list_head(&state->disklist); i != 0; i = i->next) {
+     227          12 :                 struct snapraid_disk* disk = i->data;
+     228       22561 :                 for (tommy_node* j = tommy_list_head(&disk->filelist); j != 0; j = j->next) {
+     229       22549 :                         struct snapraid_file* file = j->data;
+     230       22549 :                         collect_parity_block_file(block_size, disk, file, &files, low_to_free_tail_block);
+     231             :                 }
+     232             :         }
+     233             : 
+     234           2 :         printf("\n");
+     235             : 
+     236           2 :         if (tommy_list_count(&files) == 0) {
+     237           0 :                 printf("No files located in the specified parity tail.\n");
+     238             :         } else {
+     239             :                 /* process all the files partiall or fully overlapping the free zone */
+     240       11260 :                 for (tommy_node* j = tommy_list_head(&files); j != 0; j = j->next) {
+     241       11258 :                         struct snapraid_parity_entry* entry = j->data;
+     242       11258 :                         struct snapraid_file* file = entry->file;
+     243       11258 :                         struct snapraid_disk* disk = entry->disk;
+     244             : 
+     245             :                         /* reallocate the full file, not only the part of in the free zone */
+     246             :                         /* this is required because the files blocks have to be in order in */
+     247             :                         /* in the parity file. */
+     248             :                         /* not reallocating the file head will prevent the reallocation of the file tail */
+     249       40108 :                         for (block_off_t f = 0; f < file->blockmax; ++f) {
+     250       28850 :                                 block_off_t parity_pos = fs_file2par_find(disk, file, f);
+     251             : 
+     252       28850 :                                 if (parity_pos == POS_NULL) {
+     253             :                                         /* block not yet allocated */
+     254           0 :                                         continue;
+     255             :                                 }
+     256             : 
+     257       28850 :                                 struct snapraid_block* block = fs_file2block_get(file, f);
+     258       28850 :                                 if (block_state_get(block) == BLOCK_STATE_BLK) {
+     259             :                                         /* convert from BLK to REP */
+     260       28850 :                                         block_state_set(block, BLOCK_STATE_REP);
+     261             :                                 }
+     262             :                         }
+     263             :                 }
+     264             :         }
+     265             : 
+     266           2 :         tommy_list_foreach(&files, free);
+     267           2 : }
+     268             : 
+
+
+
+ + + + +
Generated by: LCOV version 1.0
+
+ + + diff --git a/cov/cmdline/museair.c.func-sort-c.html b/cov/cmdline/museair.c.func-sort-c.html new file mode 100644 index 00000000..35609fb3 --- /dev/null +++ b/cov/cmdline/museair.c.func-sort-c.html @@ -0,0 +1,76 @@ + + + + + + + LCOV - lcov.info - cmdline/museair.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - cmdline - museair.c (source / functions)HitTotalCoverage
Test:lcov.infoLines:7878100.0 %
Date:2026-02-28 16:42:47Functions:11100.0 %
+
+ +
+ + + + + + + + + + +

Function Name Sort by function nameHit count Sort by hit count
MuseAirLoong361
+
+
+ + + +
Generated by: LCOV version 1.0
+
+ + + diff --git a/cov/cmdline/museair.c.func.html b/cov/cmdline/museair.c.func.html new file mode 100644 index 00000000..d0fd584f --- /dev/null +++ b/cov/cmdline/museair.c.func.html @@ -0,0 +1,76 @@ + + + + + + + LCOV - lcov.info - cmdline/museair.c - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - cmdline - museair.c (source / functions)HitTotalCoverage
Test:lcov.infoLines:7878100.0 %
Date:2026-02-28 16:42:47Functions:11100.0 %
+
+ +
+ + + + + + + + + + +

Function Name Sort by function nameHit count Sort by hit count
MuseAirLoong361
+
+
+ + + +
Generated by: LCOV version 1.0
+
+ + + diff --git a/cov/cmdline/museair.c.gcov.html b/cov/cmdline/museair.c.gcov.html new file mode 100644 index 00000000..37a9d122 --- /dev/null +++ b/cov/cmdline/museair.c.gcov.html @@ -0,0 +1,257 @@ + + + + + + + LCOV - lcov.info - cmdline/museair.c + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - cmdline - museair.c (source / functions)HitTotalCoverage
Test:lcov.infoLines:7878100.0 %
Date:2026-02-28 16:42:47Functions:11100.0 %
+
+ + + + + + + + +

+
          Line data    Source code
+
+       1             : /*
+       2             :  * Copyright (C) 2026 Andrea Mazzoleni
+       3             :  *
+       4             :  * This program is free software: you can redistribute it and/or modify
+       5             :  * it under the terms of the GNU General Public License as published by
+       6             :  * the Free Software Foundation, either version 3 of the License, or
+       7             :  * (at your option) any later version.
+       8             :  *
+       9             :  * This program is distributed in the hope that it will be useful,
+      10             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+      11             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+      12             :  * GNU General Public License for more details.
+      13             :  *
+      14             :  * You should have received a copy of the GNU General Public License
+      15             :  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+      16             :  */
+      17             : 
+      18             : /*
+      19             :  * Derivative work from MuseAir 0.4-rc4 in the "Bfast" configuration
+      20             :  *
+      21             :  * This version extends the original MuseAirLoong to accept a full 128-bit seed.
+      22             :  *
+      23             :  * Note: The original algorithm's behavior can be perfectly replicated by
+      24             :  * setting the low and high part of the seed to the same 64-bit value.
+      25             :  *
+      26             :  * https://github.com/eternal-io/museair
+      27             :  */
+      28             : 
+      29             : /*
+      30             :  * MuseAir hash algorithm itself and its reference implementation (this file)
+      31             :  * by  K--Aethiax  are released into the public domain under the CC0 1.0 license.
+      32             :  * To view a copy of this license, visit: https://creativecommons.org/publicdomain/zero/1.0/
+      33             :  */
+      34             : 
+      35             : #define MUSEAIR_ALGORITHM_VERSION "0.4-rc4"
+      36             : 
+      37             : #define u64x(N) (N * 8)
+      38             : 
+      39             : /* AiryAi(0) fractional part calculated by Y-Cruncher */
+      40             : static const uint64_t MUSEAIR_CONSTANT[7] = {
+      41             :         0x5ae31e589c56e17aULL,
+      42             :         0x96d7bb04e64f6da9ULL,
+      43             :         0x7ab1006b26f9eb64ULL,
+      44             :         0x21233394220b8457ULL,
+      45             :         0x047cb9557c9f3b43ULL,
+      46             :         0xd24f2590c0bcee28ULL,
+      47             :         0x33ea8f71bb6016d8ULL
+      48             : };
+      49             : 
+      50             : #define mult64_128(l, h, a, b) \
+      51             :         do { \
+      52             :                 l = a; \
+      53             :                 h = b; \
+      54             :                 util_mum(&l, &h); \
+      55             :         } while (0)
+      56             : 
+      57             : #define likely(a) tommy_likely(a)
+      58             : #define unlikely(a) tommy_unlikely(a)
+      59             : 
+      60         361 : static void MuseAirLoong(const void* bytes, size_t len, const uint8_t* seed, uint8_t* out)
+      61             : {
+      62         361 :         const uint8_t* p = bytes;
+      63         361 :         size_t q = len;
+      64             : 
+      65             :         /* EXTENSION: This algo doesn't support shorter lengths */
+      66         361 :         assert(len >= 32);
+      67             : 
+      68             :         uint64_t i, j, k;
+      69             : 
+      70         361 :         uint64_t lo0, lo1, lo2, lo3, lo4, lo5 = MUSEAIR_CONSTANT[6];
+      71             :         uint64_t hi0, hi1, hi2, hi3, hi4, hi5;
+      72             : 
+      73             :         /*
+      74             :          * EXTENSION: Initialize primary state with 128-bit seed (seed0 and seed1)
+      75             :          * Ensures both halves influence the hash.
+      76             :          *
+      77             :          * Original code was:
+      78             :          * uint64_t state[6] = {MUSEAIR_CONSTANT[0] + seed, MUSEAIR_CONSTANT[1] - seed, MUSEAIR_CONSTANT[2] ^ seed,
+      79             :          *                      MUSEAIR_CONSTANT[3] + seed, MUSEAIR_CONSTANT[4] - seed, MUSEAIR_CONSTANT[5] ^ seed};
+      80             :          */
+      81         361 :         uint64_t seed0 = util_read64(seed);
+      82         361 :         uint64_t seed1 = util_read64(seed + 8);
+      83         361 :         uint64_t state[6] = { MUSEAIR_CONSTANT[0] + seed0, MUSEAIR_CONSTANT[1] - seed1, MUSEAIR_CONSTANT[2] ^ seed0,
+      84         361 :                               MUSEAIR_CONSTANT[3] + seed1, MUSEAIR_CONSTANT[4] - seed0, MUSEAIR_CONSTANT[5] ^ seed1 };
+      85             : 
+      86         361 :         if (unlikely(q > u64x(12))) {
+      87             :                 do {
+      88      371504 :                         state[0] ^= util_read64(p + u64x(0));
+      89      371504 :                         state[1] ^= util_read64(p + u64x(1));
+      90      371504 :                         mult64_128(lo0, hi0, state[0], state[1]);
+      91      371504 :                         state[0] = lo5 ^ hi0;
+      92             : 
+      93      371504 :                         state[1] ^= util_read64(p + u64x(2));
+      94      371504 :                         state[2] ^= util_read64(p + u64x(3));
+      95      371504 :                         mult64_128(lo1, hi1, state[1], state[2]);
+      96      371504 :                         state[1] = lo0 ^ hi1;
+      97             : 
+      98      371504 :                         state[2] ^= util_read64(p + u64x(4));
+      99      371504 :                         state[3] ^= util_read64(p + u64x(5));
+     100      371504 :                         mult64_128(lo2, hi2, state[2], state[3]);
+     101      371504 :                         state[2] = lo1 ^ hi2;
+     102             : 
+     103      371504 :                         state[3] ^= util_read64(p + u64x(6));
+     104      371504 :                         state[4] ^= util_read64(p + u64x(7));
+     105      371504 :                         mult64_128(lo3, hi3, state[3], state[4]);
+     106      371504 :                         state[3] = lo2 ^ hi3;
+     107             : 
+     108      371504 :                         state[4] ^= util_read64(p + u64x(8));
+     109      371504 :                         state[5] ^= util_read64(p + u64x(9));
+     110      371504 :                         mult64_128(lo4, hi4, state[4], state[5]);
+     111      371504 :                         state[4] = lo3 ^ hi4;
+     112             : 
+     113      371504 :                         state[5] ^= util_read64(p + u64x(10));
+     114      371504 :                         state[0] ^= util_read64(p + u64x(11));
+     115      371504 :                         mult64_128(lo5, hi5, state[5], state[0]);
+     116      371504 :                         state[5] = lo4 ^ hi5;
+     117             : 
+     118      371504 :                         p += u64x(12);
+     119      371504 :                         q -= u64x(12);
+     120             : 
+     121      371504 :                 } while (likely(q > u64x(12)));
+     122             : 
+     123         296 :                 state[0] ^= lo5;
+     124             :         }
+     125             : 
+     126         361 :         lo0 = 0, lo1 = 0, lo2 = 0, lo3 = 0, lo4 = 0, lo5 = 0;
+     127         361 :         hi0 = 0, hi1 = 0, hi2 = 0, hi3 = 0, hi4 = 0, hi5 = 0;
+     128             : 
+     129         361 :         if (likely(q > u64x(4))) {
+     130         296 :                 state[0] ^= util_read64(p + u64x(0));
+     131         296 :                 state[1] ^= util_read64(p + u64x(1));
+     132         296 :                 mult64_128(lo0, hi0, state[0], state[1]);
+     133             : 
+     134         296 :                 if (likely(q > u64x(6))) {
+     135         248 :                         state[1] ^= util_read64(p + u64x(2));
+     136         248 :                         state[2] ^= util_read64(p + u64x(3));
+     137         248 :                         mult64_128(lo1, hi1, state[1], state[2]);
+     138             : 
+     139         248 :                         if (likely(q > u64x(8))) {
+     140          64 :                                 state[2] ^= util_read64(p + u64x(4));
+     141          64 :                                 state[3] ^= util_read64(p + u64x(5));
+     142          64 :                                 mult64_128(lo2, hi2, state[2], state[3]);
+     143             : 
+     144          64 :                                 if (likely(q > u64x(10))) {
+     145          32 :                                         state[3] ^= util_read64(p + u64x(6));
+     146          32 :                                         state[4] ^= util_read64(p + u64x(7));
+     147          32 :                                         mult64_128(lo3, hi3, state[3], state[4]);
+     148             :                                 }
+     149             :                         }
+     150             :                 }
+     151             :         }
+     152             : 
+     153         361 :         state[4] ^= util_read64(p + q - u64x(4));
+     154         361 :         state[5] ^= util_read64(p + q - u64x(3));
+     155         361 :         mult64_128(lo4, hi4, state[4], state[5]);
+     156             : 
+     157         361 :         state[5] ^= util_read64(p + q - u64x(2));
+     158         361 :         state[0] ^= util_read64(p + q - u64x(1));
+     159         361 :         mult64_128(lo5, hi5, state[5], state[0]);
+     160             : 
+     161         361 :         i = state[0] - state[1];
+     162         361 :         j = state[2] - state[3];
+     163         361 :         k = state[4] - state[5];
+     164             : 
+     165         361 :         int rot = len & 63;
+     166         361 :         i = util_rotl64(i, rot);
+     167         361 :         j = util_rotr64(j, rot);
+     168         361 :         k ^= len;
+     169             : 
+     170         361 :         i += lo3 ^ hi3 ^ lo4 ^ hi4;
+     171         361 :         j += lo5 ^ hi5 ^ lo0 ^ hi0;
+     172         361 :         k += lo1 ^ hi1 ^ lo2 ^ hi2;
+     173             : 
+     174         361 :         mult64_128(lo0, hi0, i, j);
+     175         361 :         mult64_128(lo1, hi1, j, k);
+     176         361 :         mult64_128(lo2, hi2, k, i);
+     177             : 
+     178         361 :         util_write64(out, lo0 ^ lo1 ^ hi2);
+     179         361 :         util_write64(out + 8, hi0 ^ hi1 ^ lo2);
+     180         361 : }
+     181             : 
+
+
+
+ + + + +
Generated by: LCOV version 1.0
+
+ + +