"Fossies" - the Fresh Open Source Software Archive

Member "hashcat-6.2.6/OpenCL/m04710_a3-optimized.cl" (2 Sep 2022, 76346 Bytes) of package /linux/privat/hashcat-6.2.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lisp source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "m04710_a3-optimized.cl": 6.2.5_vs_6.2.6.

A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.


    1 /**
    2  * Author......: See docs/credits.txt
    3  * License.....: MIT
    4  */
    5 
    6 #define NEW_SIMD_CODE
    7 
    8 #ifdef KERNEL_STATIC
    9 #include M2S(INCLUDE_PATH/inc_vendor.h)
   10 #include M2S(INCLUDE_PATH/inc_types.h)
   11 #include M2S(INCLUDE_PATH/inc_platform.cl)
   12 #include M2S(INCLUDE_PATH/inc_common.cl)
   13 #include M2S(INCLUDE_PATH/inc_simd.cl)
   14 #include M2S(INCLUDE_PATH/inc_hash_md5.cl)
   15 #include M2S(INCLUDE_PATH/inc_hash_sha1.cl)
   16 #endif
   17 
   18 #if   VECT_SIZE == 1
   19 #define uint_to_hex_lower8_le(i) make_u32x (l_bin2asc[(i)])
   20 #elif VECT_SIZE == 2
   21 #define uint_to_hex_lower8_le(i) make_u32x (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
   22 #elif VECT_SIZE == 4
   23 #define uint_to_hex_lower8_le(i) make_u32x (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
   24 #elif VECT_SIZE == 8
   25 #define uint_to_hex_lower8_le(i) make_u32x (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
   26 #elif VECT_SIZE == 16
   27 #define uint_to_hex_lower8_le(i) make_u32x (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
   28 #endif
   29 
   30 DECLSPEC void m04710m (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 pw_len, KERN_ATTR_FUNC_BASIC (), LOCAL_AS u32 *l_bin2asc)
   31 {
   32   /**
   33    * modifiers are taken from args
   34    */
   35 
   36   /**
   37    * salt
   38    */
   39 
   40   u32 salt_buf0[4];
   41   u32 salt_buf1[4];
   42   u32 salt_buf2[4];
   43   u32 salt_buf3[4];
   44 
   45   salt_buf0[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 0]);
   46   salt_buf0[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 1]);
   47   salt_buf0[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 2]);
   48   salt_buf0[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 3]);
   49   salt_buf1[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 4]);
   50   salt_buf1[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 5]);
   51   salt_buf1[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 6]);
   52   salt_buf1[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 7]);
   53   salt_buf2[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 8]);
   54   salt_buf2[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 9]);
   55   salt_buf2[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[10]);
   56   salt_buf2[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[11]);
   57   salt_buf3[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[12]);
   58   salt_buf3[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[13]);
   59   salt_buf3[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[14]);
   60   salt_buf3[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[15]);
   61 
   62   const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
   63 
   64   /**
   65    * loop
   66    */
   67 
   68   u32 w0l = w0[0];
   69 
   70   for (u32 il_pos = 0; il_pos < IL_CNT; il_pos += VECT_SIZE)
   71   {
   72     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
   73 
   74     const u32x w0lr = w0l | w0r;
   75 
   76     u32x w0_t = w0lr;
   77     u32x w1_t = w0[1];
   78     u32x w2_t = w0[2];
   79     u32x w3_t = w0[3];
   80     u32x w4_t = w1[0];
   81     u32x w5_t = w1[1];
   82     u32x w6_t = w1[2];
   83     u32x w7_t = w1[3];
   84     u32x w8_t = w2[0];
   85     u32x w9_t = w2[1];
   86     u32x wa_t = w2[2];
   87     u32x wb_t = w2[3];
   88     u32x wc_t = w3[0];
   89     u32x wd_t = w3[1];
   90     u32x we_t = w3[2];
   91     u32x wf_t = w3[3];
   92 
   93     /**
   94      * md5(pass)
   95      */
   96 
   97     u32x a = MD5M_A;
   98     u32x b = MD5M_B;
   99     u32x c = MD5M_C;
  100     u32x d = MD5M_D;
  101     u32x e = 0;
  102 
  103     MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
  104     MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
  105     MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
  106     MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
  107     MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
  108     MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
  109     MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
  110     MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
  111     MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
  112     MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
  113     MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
  114     MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
  115     MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
  116     MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
  117     MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
  118     MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
  119 
  120     MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
  121     MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
  122     MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
  123     MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
  124     MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
  125     MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
  126     MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
  127     MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
  128     MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
  129     MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
  130     MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
  131     MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
  132     MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
  133     MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
  134     MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
  135     MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
  136 
  137     u32x t;
  138 
  139     MD5_STEP (MD5_H1, a, b, c, d, w5_t, MD5C20, MD5S20);
  140     MD5_STEP (MD5_H2, d, a, b, c, w8_t, MD5C21, MD5S21);
  141     MD5_STEP (MD5_H1, c, d, a, b, wb_t, MD5C22, MD5S22);
  142     MD5_STEP (MD5_H2, b, c, d, a, we_t, MD5C23, MD5S23);
  143     MD5_STEP (MD5_H1, a, b, c, d, w1_t, MD5C24, MD5S20);
  144     MD5_STEP (MD5_H2, d, a, b, c, w4_t, MD5C25, MD5S21);
  145     MD5_STEP (MD5_H1, c, d, a, b, w7_t, MD5C26, MD5S22);
  146     MD5_STEP (MD5_H2, b, c, d, a, wa_t, MD5C27, MD5S23);
  147     MD5_STEP (MD5_H1, a, b, c, d, wd_t, MD5C28, MD5S20);
  148     MD5_STEP (MD5_H2, d, a, b, c, w0_t, MD5C29, MD5S21);
  149     MD5_STEP (MD5_H1, c, d, a, b, w3_t, MD5C2a, MD5S22);
  150     MD5_STEP (MD5_H2, b, c, d, a, w6_t, MD5C2b, MD5S23);
  151     MD5_STEP (MD5_H1, a, b, c, d, w9_t, MD5C2c, MD5S20);
  152     MD5_STEP (MD5_H2, d, a, b, c, wc_t, MD5C2d, MD5S21);
  153     MD5_STEP (MD5_H1, c, d, a, b, wf_t, MD5C2e, MD5S22);
  154     MD5_STEP (MD5_H2, b, c, d, a, w2_t, MD5C2f, MD5S23);
  155 
  156     MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
  157     MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
  158     MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
  159     MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
  160     MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
  161     MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
  162     MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
  163     MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
  164     MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
  165     MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
  166     MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
  167     MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
  168     MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
  169     MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
  170     MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
  171     MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
  172 
  173     a += make_u32x (MD5M_A);
  174     b += make_u32x (MD5M_B);
  175     c += make_u32x (MD5M_C);
  176     d += make_u32x (MD5M_D);
  177 
  178     // sha1
  179 
  180     w0_t = uint_to_hex_lower8_le ((a >>  8) & 255) <<  0
  181          | uint_to_hex_lower8_le ((a >>  0) & 255) << 16;
  182     w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) <<  0
  183          | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
  184     w2_t = uint_to_hex_lower8_le ((b >>  8) & 255) <<  0
  185          | uint_to_hex_lower8_le ((b >>  0) & 255) << 16;
  186     w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) <<  0
  187          | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
  188     w4_t = uint_to_hex_lower8_le ((c >>  8) & 255) <<  0
  189          | uint_to_hex_lower8_le ((c >>  0) & 255) << 16;
  190     w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) <<  0
  191          | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
  192     w6_t = uint_to_hex_lower8_le ((d >>  8) & 255) <<  0
  193          | uint_to_hex_lower8_le ((d >>  0) & 255) << 16;
  194     w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) <<  0
  195          | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
  196     w8_t = 0;
  197     w9_t = 0;
  198     wa_t = 0;
  199     wb_t = 0;
  200     wc_t = 0;
  201     wd_t = 0;
  202     we_t = 0;
  203     wf_t = 0;
  204 
  205     a = SHA1M_A;
  206     b = SHA1M_B;
  207     c = SHA1M_C;
  208     d = SHA1M_D;
  209     e = SHA1M_E;
  210 
  211     u32x digest[8];
  212 
  213     digest[0] = a;
  214     digest[1] = b;
  215     digest[2] = c;
  216     digest[3] = d;
  217     digest[4] = e;
  218 
  219     // append salt
  220 
  221     // ctx_len 32, pos 32
  222 
  223     int pos = 32;
  224 
  225     u32x s0[4];
  226     u32x s1[4];
  227     u32x s2[4];
  228     u32x s3[4];
  229 
  230     s0[0] = salt_buf0[0];
  231     s0[1] = salt_buf0[1];
  232     s0[2] = salt_buf0[2];
  233     s0[3] = salt_buf0[3];
  234     s1[0] = salt_buf1[0];
  235     s1[1] = salt_buf1[1];
  236     s1[2] = salt_buf1[2];
  237     s1[3] = salt_buf1[3];
  238     s2[0] = salt_buf2[0];
  239     s2[1] = salt_buf2[1];
  240     s2[2] = salt_buf2[2];
  241     s2[3] = salt_buf2[3];
  242     s3[0] = salt_buf3[0];
  243     s3[1] = salt_buf3[1];
  244     s3[2] = salt_buf3[2];
  245     s3[3] = salt_buf3[3];
  246 
  247     if ((pos + salt_len) < 64)
  248     {
  249       switch_buffer_by_offset_be (s0, s1, s2, s3, pos);
  250 
  251       w0_t |= s0[0];
  252       w1_t |= s0[1];
  253       w2_t |= s0[2];
  254       w3_t |= s0[3];
  255       w4_t |= s1[0];
  256       w5_t |= s1[1];
  257       w6_t |= s1[2];
  258       w7_t |= s1[3];
  259       w8_t |= s2[0];
  260       w9_t |= s2[1];
  261       wa_t |= s2[2];
  262       wb_t |= s2[3];
  263       wc_t |= s3[0];
  264       wd_t |= s3[1];
  265       we_t |= s3[2];
  266       wf_t |= s3[3];
  267     }
  268     else
  269     {
  270       u32x _w0[4] = { 0 };
  271       u32x _w1[4] = { 0 };
  272       u32x _w2[4] = { 0 };
  273       u32x _w3[4] = { 0 };
  274 
  275       switch_buffer_by_offset_carry_be (s0, s1, s2, s3, _w0, _w1, _w2, _w3, pos);
  276 
  277       w0_t |= s0[0];
  278       w1_t |= s0[1];
  279       w2_t |= s0[2];
  280       w3_t |= s0[3];
  281       w4_t |= s1[0];
  282       w5_t |= s1[1];
  283       w6_t |= s1[2];
  284       w7_t |= s1[3];
  285       w8_t |= s2[0];
  286       w9_t |= s2[1];
  287       wa_t |= s2[2];
  288       wb_t |= s2[3];
  289       wc_t |= s3[0];
  290       wd_t |= s3[1];
  291       we_t |= s3[2];
  292       wf_t |= s3[3];
  293 
  294       // sha1 transform
  295 
  296       #undef K
  297       #define K SHA1C00
  298 
  299       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
  300       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
  301       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
  302       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
  303       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
  304       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
  305       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
  306       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
  307       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
  308       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
  309       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
  310       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
  311       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
  312       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
  313       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
  314       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
  315       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
  316       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
  317       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
  318       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
  319 
  320       #undef K
  321       #define K SHA1C01
  322 
  323       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
  324       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
  325       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
  326       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
  327       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
  328       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
  329       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
  330       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
  331       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
  332       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
  333       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
  334       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
  335       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
  336       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
  337       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
  338       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
  339       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
  340       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
  341       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
  342       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
  343 
  344       #undef K
  345       #define K SHA1C02
  346 
  347       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
  348       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
  349       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
  350       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
  351       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
  352       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
  353       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
  354       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
  355       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
  356       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
  357       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
  358       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
  359       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
  360       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
  361       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
  362       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
  363       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
  364       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
  365       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
  366       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
  367 
  368       #undef K
  369       #define K SHA1C03
  370 
  371       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
  372       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
  373       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
  374       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
  375       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
  376       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
  377       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
  378       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
  379       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
  380       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
  381       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
  382       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
  383       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
  384       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
  385       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
  386       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
  387       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
  388       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
  389       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
  390       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
  391 
  392       digest[0] += a;
  393       digest[1] += b;
  394       digest[2] += c;
  395       digest[3] += d;
  396       digest[4] += e;
  397 
  398       w0_t = _w0[0];
  399       w1_t = _w0[1];
  400       w2_t = _w0[2];
  401       w3_t = _w0[3];
  402       w4_t = _w1[0];
  403       w5_t = _w1[1];
  404       w6_t = _w1[2];
  405       w7_t = _w1[3];
  406       w8_t = _w2[0];
  407       w9_t = _w2[1];
  408       wa_t = _w2[2];
  409       wb_t = _w2[3];
  410       wc_t = _w3[0];
  411       wd_t = _w3[1];
  412       we_t = _w3[2];
  413       wf_t = _w3[3];
  414     }
  415 
  416     const int ctx_len = 32 + salt_len;
  417 
  418     pos = ctx_len & 63;
  419 
  420     // append_0x80_4x4
  421 
  422     const u32 off = pos ^ 3;
  423 
  424     const u32 c0 = (off & 15) / 4;
  425 
  426     const u32 r0 = 0xff << ((off & 3) * 8);
  427 
  428     const u32 m0[4] = { ((c0 == 0) ? r0 : 0), ((c0 == 1) ? r0 : 0), ((c0 == 2) ? r0 : 0), ((c0 == 3) ? r0 : 0) };
  429 
  430     const u32 off16 = off / 16;
  431 
  432     const u32 v0[4] = { ((off16 == 0) ? 0x80808080 : 0), ((off16 == 1) ? 0x80808080 : 0), ((off16 == 2) ? 0x80808080 : 0), ((off16 == 3) ? 0x80808080 : 0) };
  433 
  434     w0_t |= v0[0] & m0[0];
  435     w1_t |= v0[0] & m0[1];
  436     w2_t |= v0[0] & m0[2];
  437     w3_t |= v0[0] & m0[3];
  438     w4_t |= v0[1] & m0[0];
  439     w5_t |= v0[1] & m0[1];
  440     w6_t |= v0[1] & m0[2];
  441     w7_t |= v0[1] & m0[3];
  442     w8_t |= v0[2] & m0[0];
  443     w9_t |= v0[2] & m0[1];
  444     wa_t |= v0[2] & m0[2];
  445     wb_t |= v0[2] & m0[3];
  446     wc_t |= v0[3] & m0[0];
  447     wd_t |= v0[3] & m0[1];
  448     we_t |= v0[3] & m0[2];
  449     wf_t |= v0[3] & m0[3];
  450 
  451     if (pos >= 56)
  452     {
  453       a = digest[0];
  454       b = digest[1];
  455       c = digest[2];
  456       d = digest[3];
  457       e = digest[4];
  458 
  459       #undef K
  460       #define K SHA1C00
  461 
  462       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
  463       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
  464       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
  465       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
  466       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
  467       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
  468       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
  469       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
  470       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
  471       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
  472       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
  473       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
  474       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
  475       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
  476       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
  477       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
  478       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
  479       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
  480       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
  481       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
  482 
  483       #undef K
  484       #define K SHA1C01
  485 
  486       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
  487       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
  488       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
  489       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
  490       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
  491       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
  492       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
  493       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
  494       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
  495       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
  496       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
  497       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
  498       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
  499       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
  500       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
  501       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
  502       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
  503       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
  504       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
  505       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
  506 
  507       #undef K
  508       #define K SHA1C02
  509 
  510       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
  511       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
  512       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
  513       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
  514       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
  515       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
  516       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
  517       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
  518       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
  519       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
  520       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
  521       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
  522       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
  523       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
  524       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
  525       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
  526       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
  527       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
  528       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
  529       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
  530 
  531       #undef K
  532       #define K SHA1C03
  533 
  534       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
  535       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
  536       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
  537       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
  538       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
  539       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
  540       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
  541       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
  542       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
  543       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
  544       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
  545       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
  546       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
  547       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
  548       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
  549       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
  550       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
  551       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
  552       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
  553       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
  554 
  555       digest[0] += a;
  556       digest[1] += b;
  557       digest[2] += c;
  558       digest[3] += d;
  559       digest[4] += e;
  560 
  561       w0_t = 0;
  562       w1_t = 0;
  563       w2_t = 0;
  564       w3_t = 0;
  565       w4_t = 0;
  566       w5_t = 0;
  567       w6_t = 0;
  568       w7_t = 0;
  569       w8_t = 0;
  570       w9_t = 0;
  571       wa_t = 0;
  572       wb_t = 0;
  573       wc_t = 0;
  574       wd_t = 0;
  575       we_t = 0;
  576       wf_t = 0;
  577     }
  578 
  579     // last sha1 transform
  580 
  581     we_t = 0;
  582     wf_t = ctx_len * 8;
  583 
  584     a = digest[0];
  585     b = digest[1];
  586     c = digest[2];
  587     d = digest[3];
  588     e = digest[4];
  589 
  590     #undef K
  591     #define K SHA1C00
  592 
  593     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
  594     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
  595     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
  596     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
  597     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
  598     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
  599     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
  600     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
  601     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
  602     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
  603     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
  604     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
  605     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
  606     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
  607     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
  608     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
  609     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
  610     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
  611     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
  612     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
  613 
  614     #undef K
  615     #define K SHA1C01
  616 
  617     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
  618     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
  619     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
  620     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
  621     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
  622     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
  623     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
  624     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
  625     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
  626     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
  627     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
  628     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
  629     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
  630     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
  631     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
  632     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
  633     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
  634     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
  635     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
  636     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
  637 
  638     #undef K
  639     #define K SHA1C02
  640 
  641     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
  642     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
  643     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
  644     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
  645     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
  646     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
  647     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
  648     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
  649     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
  650     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
  651     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
  652     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
  653     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
  654     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
  655     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
  656     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
  657     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
  658     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
  659     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
  660     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
  661 
  662     #undef K
  663     #define K SHA1C03
  664 
  665     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
  666     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
  667     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
  668     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
  669     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
  670     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
  671     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
  672     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
  673     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
  674     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
  675     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
  676     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
  677     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
  678     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
  679     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
  680     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
  681     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
  682     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
  683     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
  684     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
  685 
  686     b += digest[1] - make_u32x (SHA1M_B);
  687     c += digest[2] - make_u32x (SHA1M_C);
  688     d += digest[3] - make_u32x (SHA1M_D);
  689     e += digest[4] - make_u32x (SHA1M_E);
  690 
  691     COMPARE_M_SIMD (d, e, c, b);
  692   }
  693 }
  694 
  695 DECLSPEC void m04710s (PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const u32 pw_len, KERN_ATTR_FUNC_BASIC (), LOCAL_AS u32 *l_bin2asc)
  696 {
  697   /**
  698    * modifiers are taken from args
  699    */
  700 
  701   /**
  702    * salt
  703    */
  704 
  705   u32 salt_buf0[4];
  706   u32 salt_buf1[4];
  707   u32 salt_buf2[4];
  708   u32 salt_buf3[4];
  709 
  710   salt_buf0[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 0]);
  711   salt_buf0[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 1]);
  712   salt_buf0[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 2]);
  713   salt_buf0[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 3]);
  714   salt_buf1[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 4]);
  715   salt_buf1[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 5]);
  716   salt_buf1[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 6]);
  717   salt_buf1[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 7]);
  718   salt_buf2[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 8]);
  719   salt_buf2[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 9]);
  720   salt_buf2[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[10]);
  721   salt_buf2[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[11]);
  722   salt_buf3[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[12]);
  723   salt_buf3[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[13]);
  724   salt_buf3[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[14]);
  725   salt_buf3[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[15]);
  726 
  727   const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
  728 
  729   /**
  730    * digest
  731    */
  732 
  733   const u32 search[4] =
  734   {
  735     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R0],
  736     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R1],
  737     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R2],
  738     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R3]
  739   };
  740 
  741   /**
  742    * loop
  743    */
  744 
  745   u32 w0l = w0[0];
  746 
  747   for (u32 il_pos = 0; il_pos < IL_CNT; il_pos += VECT_SIZE)
  748   {
  749     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
  750 
  751     const u32x w0lr = w0l | w0r;
  752 
  753     u32x w0_t = w0lr;
  754     u32x w1_t = w0[1];
  755     u32x w2_t = w0[2];
  756     u32x w3_t = w0[3];
  757     u32x w4_t = w1[0];
  758     u32x w5_t = w1[1];
  759     u32x w6_t = w1[2];
  760     u32x w7_t = w1[3];
  761     u32x w8_t = w2[0];
  762     u32x w9_t = w2[1];
  763     u32x wa_t = w2[2];
  764     u32x wb_t = w2[3];
  765     u32x wc_t = w3[0];
  766     u32x wd_t = w3[1];
  767     u32x we_t = w3[2];
  768     u32x wf_t = w3[3];
  769 
  770     /**
  771      * md5(pass)
  772      */
  773 
  774     u32x a = MD5M_A;
  775     u32x b = MD5M_B;
  776     u32x c = MD5M_C;
  777     u32x d = MD5M_D;
  778     u32x e = 0;
  779 
  780     MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
  781     MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
  782     MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
  783     MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
  784     MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
  785     MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
  786     MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
  787     MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
  788     MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
  789     MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
  790     MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
  791     MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
  792     MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
  793     MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
  794     MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
  795     MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
  796 
  797     MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
  798     MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
  799     MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
  800     MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
  801     MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
  802     MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
  803     MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
  804     MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
  805     MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
  806     MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
  807     MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
  808     MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
  809     MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
  810     MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
  811     MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
  812     MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
  813 
  814     u32x t;
  815 
  816     MD5_STEP (MD5_H1, a, b, c, d, w5_t, MD5C20, MD5S20);
  817     MD5_STEP (MD5_H2, d, a, b, c, w8_t, MD5C21, MD5S21);
  818     MD5_STEP (MD5_H1, c, d, a, b, wb_t, MD5C22, MD5S22);
  819     MD5_STEP (MD5_H2, b, c, d, a, we_t, MD5C23, MD5S23);
  820     MD5_STEP (MD5_H1, a, b, c, d, w1_t, MD5C24, MD5S20);
  821     MD5_STEP (MD5_H2, d, a, b, c, w4_t, MD5C25, MD5S21);
  822     MD5_STEP (MD5_H1, c, d, a, b, w7_t, MD5C26, MD5S22);
  823     MD5_STEP (MD5_H2, b, c, d, a, wa_t, MD5C27, MD5S23);
  824     MD5_STEP (MD5_H1, a, b, c, d, wd_t, MD5C28, MD5S20);
  825     MD5_STEP (MD5_H2, d, a, b, c, w0_t, MD5C29, MD5S21);
  826     MD5_STEP (MD5_H1, c, d, a, b, w3_t, MD5C2a, MD5S22);
  827     MD5_STEP (MD5_H2, b, c, d, a, w6_t, MD5C2b, MD5S23);
  828     MD5_STEP (MD5_H1, a, b, c, d, w9_t, MD5C2c, MD5S20);
  829     MD5_STEP (MD5_H2, d, a, b, c, wc_t, MD5C2d, MD5S21);
  830     MD5_STEP (MD5_H1, c, d, a, b, wf_t, MD5C2e, MD5S22);
  831     MD5_STEP (MD5_H2, b, c, d, a, w2_t, MD5C2f, MD5S23);
  832 
  833     MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
  834     MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
  835     MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
  836     MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
  837     MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
  838     MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
  839     MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
  840     MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
  841     MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
  842     MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
  843     MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
  844     MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
  845     MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
  846     MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
  847     MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
  848     MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
  849 
  850     a += make_u32x (MD5M_A);
  851     b += make_u32x (MD5M_B);
  852     c += make_u32x (MD5M_C);
  853     d += make_u32x (MD5M_D);
  854 
  855     // sha1
  856 
  857     w0_t = uint_to_hex_lower8_le ((a >>  8) & 255) <<  0
  858          | uint_to_hex_lower8_le ((a >>  0) & 255) << 16;
  859     w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) <<  0
  860          | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
  861     w2_t = uint_to_hex_lower8_le ((b >>  8) & 255) <<  0
  862          | uint_to_hex_lower8_le ((b >>  0) & 255) << 16;
  863     w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) <<  0
  864          | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
  865     w4_t = uint_to_hex_lower8_le ((c >>  8) & 255) <<  0
  866          | uint_to_hex_lower8_le ((c >>  0) & 255) << 16;
  867     w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) <<  0
  868          | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
  869     w6_t = uint_to_hex_lower8_le ((d >>  8) & 255) <<  0
  870          | uint_to_hex_lower8_le ((d >>  0) & 255) << 16;
  871     w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) <<  0
  872          | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
  873     w8_t = 0;
  874     w9_t = 0;
  875     wa_t = 0;
  876     wb_t = 0;
  877     wc_t = 0;
  878     wd_t = 0;
  879     we_t = 0;
  880     wf_t = 0;
  881 
  882     a = SHA1M_A;
  883     b = SHA1M_B;
  884     c = SHA1M_C;
  885     d = SHA1M_D;
  886     e = SHA1M_E;
  887 
  888     u32x digest[8];
  889 
  890     digest[0] = a;
  891     digest[1] = b;
  892     digest[2] = c;
  893     digest[3] = d;
  894     digest[4] = e;
  895 
  896     // append salt
  897 
  898     // ctx_len 32, pos 32
  899 
  900     int pos = 32;
  901 
  902     u32x s0[4];
  903     u32x s1[4];
  904     u32x s2[4];
  905     u32x s3[4];
  906 
  907     s0[0] = salt_buf0[0];
  908     s0[1] = salt_buf0[1];
  909     s0[2] = salt_buf0[2];
  910     s0[3] = salt_buf0[3];
  911     s1[0] = salt_buf1[0];
  912     s1[1] = salt_buf1[1];
  913     s1[2] = salt_buf1[2];
  914     s1[3] = salt_buf1[3];
  915     s2[0] = salt_buf2[0];
  916     s2[1] = salt_buf2[1];
  917     s2[2] = salt_buf2[2];
  918     s2[3] = salt_buf2[3];
  919     s3[0] = salt_buf3[0];
  920     s3[1] = salt_buf3[1];
  921     s3[2] = salt_buf3[2];
  922     s3[3] = salt_buf3[3];
  923 
  924     if ((pos + salt_len) < 64)
  925     {
  926       switch_buffer_by_offset_be (s0, s1, s2, s3, pos);
  927 
  928       w0_t |= s0[0];
  929       w1_t |= s0[1];
  930       w2_t |= s0[2];
  931       w3_t |= s0[3];
  932       w4_t |= s1[0];
  933       w5_t |= s1[1];
  934       w6_t |= s1[2];
  935       w7_t |= s1[3];
  936       w8_t |= s2[0];
  937       w9_t |= s2[1];
  938       wa_t |= s2[2];
  939       wb_t |= s2[3];
  940       wc_t |= s3[0];
  941       wd_t |= s3[1];
  942       we_t |= s3[2];
  943       wf_t |= s3[3];
  944     }
  945     else
  946     {
  947       u32x _w0[4] = { 0 };
  948       u32x _w1[4] = { 0 };
  949       u32x _w2[4] = { 0 };
  950       u32x _w3[4] = { 0 };
  951 
  952       switch_buffer_by_offset_carry_be (s0, s1, s2, s3, _w0, _w1, _w2, _w3, pos);
  953 
  954       w0_t |= s0[0];
  955       w1_t |= s0[1];
  956       w2_t |= s0[2];
  957       w3_t |= s0[3];
  958       w4_t |= s1[0];
  959       w5_t |= s1[1];
  960       w6_t |= s1[2];
  961       w7_t |= s1[3];
  962       w8_t |= s2[0];
  963       w9_t |= s2[1];
  964       wa_t |= s2[2];
  965       wb_t |= s2[3];
  966       wc_t |= s3[0];
  967       wd_t |= s3[1];
  968       we_t |= s3[2];
  969       wf_t |= s3[3];
  970 
  971       // sha1 transform
  972 
  973       #undef K
  974       #define K SHA1C00
  975 
  976       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
  977       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
  978       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
  979       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
  980       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
  981       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
  982       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
  983       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
  984       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
  985       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
  986       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
  987       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
  988       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
  989       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
  990       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
  991       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
  992       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
  993       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
  994       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
  995       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
  996 
  997       #undef K
  998       #define K SHA1C01
  999 
 1000       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
 1001       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
 1002       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
 1003       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
 1004       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
 1005       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
 1006       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
 1007       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
 1008       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
 1009       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
 1010       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
 1011       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
 1012       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
 1013       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
 1014       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
 1015       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
 1016       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
 1017       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
 1018       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
 1019       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
 1020 
 1021       #undef K
 1022       #define K SHA1C02
 1023 
 1024       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
 1025       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
 1026       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
 1027       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
 1028       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
 1029       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
 1030       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
 1031       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
 1032       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
 1033       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
 1034       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
 1035       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
 1036       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
 1037       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
 1038       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
 1039       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
 1040       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
 1041       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
 1042       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
 1043       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
 1044 
 1045       #undef K
 1046       #define K SHA1C03
 1047 
 1048       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
 1049       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
 1050       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
 1051       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
 1052       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
 1053       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
 1054       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
 1055       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
 1056       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
 1057       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
 1058       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
 1059       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
 1060       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
 1061       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
 1062       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
 1063       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
 1064       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
 1065       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
 1066       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
 1067       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
 1068 
 1069       digest[0] += a;
 1070       digest[1] += b;
 1071       digest[2] += c;
 1072       digest[3] += d;
 1073       digest[4] += e;
 1074 
 1075       w0_t = _w0[0];
 1076       w1_t = _w0[1];
 1077       w2_t = _w0[2];
 1078       w3_t = _w0[3];
 1079       w4_t = _w1[0];
 1080       w5_t = _w1[1];
 1081       w6_t = _w1[2];
 1082       w7_t = _w1[3];
 1083       w8_t = _w2[0];
 1084       w9_t = _w2[1];
 1085       wa_t = _w2[2];
 1086       wb_t = _w2[3];
 1087       wc_t = _w3[0];
 1088       wd_t = _w3[1];
 1089       we_t = _w3[2];
 1090       wf_t = _w3[3];
 1091     }
 1092 
 1093     const int ctx_len = 32 + salt_len;
 1094 
 1095     pos = ctx_len & 63;
 1096 
 1097     // append_0x80_4x4
 1098 
 1099     const u32 off = pos ^ 3;
 1100 
 1101     const u32 c0 = (off & 15) / 4;
 1102 
 1103     const u32 r0 = 0xff << ((off & 3) * 8);
 1104 
 1105     const u32 m0[4] = { ((c0 == 0) ? r0 : 0), ((c0 == 1) ? r0 : 0), ((c0 == 2) ? r0 : 0), ((c0 == 3) ? r0 : 0) };
 1106 
 1107     const u32 off16 = off / 16;
 1108 
 1109     const u32 v0[4] = { ((off16 == 0) ? 0x80808080 : 0), ((off16 == 1) ? 0x80808080 : 0), ((off16 == 2) ? 0x80808080 : 0), ((off16 == 3) ? 0x80808080 : 0) };
 1110 
 1111     w0_t |= v0[0] & m0[0];
 1112     w1_t |= v0[0] & m0[1];
 1113     w2_t |= v0[0] & m0[2];
 1114     w3_t |= v0[0] & m0[3];
 1115     w4_t |= v0[1] & m0[0];
 1116     w5_t |= v0[1] & m0[1];
 1117     w6_t |= v0[1] & m0[2];
 1118     w7_t |= v0[1] & m0[3];
 1119     w8_t |= v0[2] & m0[0];
 1120     w9_t |= v0[2] & m0[1];
 1121     wa_t |= v0[2] & m0[2];
 1122     wb_t |= v0[2] & m0[3];
 1123     wc_t |= v0[3] & m0[0];
 1124     wd_t |= v0[3] & m0[1];
 1125     we_t |= v0[3] & m0[2];
 1126     wf_t |= v0[3] & m0[3];
 1127 
 1128     if (pos >= 56)
 1129     {
 1130       a = digest[0];
 1131       b = digest[1];
 1132       c = digest[2];
 1133       d = digest[3];
 1134       e = digest[4];
 1135 
 1136       #undef K
 1137       #define K SHA1C00
 1138 
 1139       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
 1140       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
 1141       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
 1142       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
 1143       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
 1144       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
 1145       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
 1146       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
 1147       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
 1148       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
 1149       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
 1150       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
 1151       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
 1152       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
 1153       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
 1154       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
 1155       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
 1156       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
 1157       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
 1158       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
 1159 
 1160       #undef K
 1161       #define K SHA1C01
 1162 
 1163       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
 1164       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
 1165       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
 1166       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
 1167       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
 1168       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
 1169       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
 1170       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
 1171       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
 1172       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
 1173       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
 1174       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
 1175       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
 1176       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
 1177       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
 1178       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
 1179       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
 1180       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
 1181       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
 1182       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
 1183 
 1184       #undef K
 1185       #define K SHA1C02
 1186 
 1187       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
 1188       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
 1189       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
 1190       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
 1191       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
 1192       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
 1193       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
 1194       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
 1195       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
 1196       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
 1197       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
 1198       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
 1199       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
 1200       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
 1201       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
 1202       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
 1203       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
 1204       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
 1205       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
 1206       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
 1207 
 1208       #undef K
 1209       #define K SHA1C03
 1210 
 1211       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
 1212       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
 1213       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
 1214       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
 1215       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
 1216       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
 1217       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
 1218       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
 1219       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
 1220       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
 1221       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
 1222       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
 1223       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
 1224       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
 1225       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
 1226       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
 1227       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
 1228       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
 1229       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
 1230       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
 1231 
 1232       digest[0] += a;
 1233       digest[1] += b;
 1234       digest[2] += c;
 1235       digest[3] += d;
 1236       digest[4] += e;
 1237 
 1238       w0_t = 0;
 1239       w1_t = 0;
 1240       w2_t = 0;
 1241       w3_t = 0;
 1242       w4_t = 0;
 1243       w5_t = 0;
 1244       w6_t = 0;
 1245       w7_t = 0;
 1246       w8_t = 0;
 1247       w9_t = 0;
 1248       wa_t = 0;
 1249       wb_t = 0;
 1250       wc_t = 0;
 1251       wd_t = 0;
 1252       we_t = 0;
 1253       wf_t = 0;
 1254     }
 1255 
 1256     // last sha1 transform
 1257 
 1258     we_t = 0;
 1259     wf_t = ctx_len * 8;
 1260 
 1261     a = digest[0];
 1262     b = digest[1];
 1263     c = digest[2];
 1264     d = digest[3];
 1265     e = digest[4];
 1266 
 1267     #undef K
 1268     #define K SHA1C00
 1269 
 1270     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
 1271     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
 1272     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
 1273     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
 1274     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
 1275     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
 1276     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
 1277     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
 1278     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
 1279     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
 1280     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
 1281     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
 1282     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
 1283     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
 1284     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
 1285     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
 1286     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
 1287     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
 1288     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
 1289     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
 1290 
 1291     #undef K
 1292     #define K SHA1C01
 1293 
 1294     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
 1295     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
 1296     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
 1297     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
 1298     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
 1299     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
 1300     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
 1301     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
 1302     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
 1303     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
 1304     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
 1305     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
 1306     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
 1307     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
 1308     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
 1309     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
 1310     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
 1311     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
 1312     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
 1313     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
 1314 
 1315     #undef K
 1316     #define K SHA1C02
 1317 
 1318     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
 1319     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
 1320     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
 1321     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
 1322     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
 1323     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
 1324     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
 1325     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
 1326     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
 1327     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
 1328     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
 1329     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
 1330     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
 1331     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
 1332     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
 1333     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
 1334     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
 1335     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
 1336     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
 1337     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
 1338 
 1339     #undef K
 1340     #define K SHA1C03
 1341 
 1342     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
 1343     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
 1344     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
 1345     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
 1346     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
 1347     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
 1348     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
 1349     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
 1350     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
 1351     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
 1352     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
 1353     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
 1354     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
 1355     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
 1356     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
 1357     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
 1358     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
 1359     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
 1360 
 1361     if (MATCHES_NONE_VS ((e + digest[4] - make_u32x (SHA1M_E)), search[1]))
 1362       continue;
 1363 
 1364     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
 1365     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
 1366 
 1367     b += digest[1] - make_u32x (SHA1M_B);
 1368     c += digest[2] - make_u32x (SHA1M_C);
 1369     d += digest[3] - make_u32x (SHA1M_D);
 1370     e += digest[4] - make_u32x (SHA1M_E);
 1371 
 1372     COMPARE_S_SIMD (d, e, c, b);
 1373   }
 1374 }
 1375 
 1376 KERNEL_FQ void m04710_m04 (KERN_ATTR_BASIC ())
 1377 {
 1378   /**
 1379    * base
 1380    */
 1381 
 1382   const u64 lid = get_local_id (0);
 1383   const u64 gid = get_global_id (0);
 1384   const u64 lsz = get_local_size (0);
 1385 
 1386   /**
 1387    * bin2asc table
 1388    */
 1389 
 1390   LOCAL_VK u32 l_bin2asc[256];
 1391 
 1392   for (u32 i = lid; i < 256; i += lsz)
 1393   {
 1394     const u32 i0 = (i >> 0) & 15;
 1395     const u32 i1 = (i >> 4) & 15;
 1396 
 1397     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
 1398                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
 1399   }
 1400 
 1401   SYNC_THREADS ();
 1402 
 1403   if (gid >= GID_CNT) return;
 1404 
 1405   /**
 1406    * modifier
 1407    */
 1408 
 1409   u32 w0[4];
 1410 
 1411   w0[0] = pws[gid].i[ 0];
 1412   w0[1] = pws[gid].i[ 1];
 1413   w0[2] = pws[gid].i[ 2];
 1414   w0[3] = pws[gid].i[ 3];
 1415 
 1416   u32 w1[4];
 1417 
 1418   w1[0] = 0;
 1419   w1[1] = 0;
 1420   w1[2] = 0;
 1421   w1[3] = 0;
 1422 
 1423   u32 w2[4];
 1424 
 1425   w2[0] = 0;
 1426   w2[1] = 0;
 1427   w2[2] = 0;
 1428   w2[3] = 0;
 1429 
 1430   u32 w3[4];
 1431 
 1432   w3[0] = 0;
 1433   w3[1] = 0;
 1434   w3[2] = pws[gid].i[14];
 1435   w3[3] = 0;
 1436 
 1437   const u32 pw_len = pws[gid].pw_len & 63;
 1438 
 1439   /**
 1440    * main
 1441    */
 1442 
 1443   m04710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_extra0_buf, d_extra1_buf, d_extra2_buf, d_extra3_buf, kernel_param, gid, lid, lsz, l_bin2asc);
 1444 }
 1445 
 1446 KERNEL_FQ void m04710_m08 (KERN_ATTR_BASIC ())
 1447 {
 1448   /**
 1449    * base
 1450    */
 1451 
 1452   const u64 lid = get_local_id (0);
 1453   const u64 gid = get_global_id (0);
 1454   const u64 lsz = get_local_size (0);
 1455 
 1456   /**
 1457    * bin2asc table
 1458    */
 1459 
 1460   LOCAL_VK u32 l_bin2asc[256];
 1461 
 1462   for (u32 i = lid; i < 256; i += lsz)
 1463   {
 1464     const u32 i0 = (i >> 0) & 15;
 1465     const u32 i1 = (i >> 4) & 15;
 1466 
 1467     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
 1468                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
 1469   }
 1470 
 1471   SYNC_THREADS ();
 1472 
 1473   if (gid >= GID_CNT) return;
 1474 
 1475   /**
 1476    * modifier
 1477    */
 1478 
 1479   u32 w0[4];
 1480 
 1481   w0[0] = pws[gid].i[ 0];
 1482   w0[1] = pws[gid].i[ 1];
 1483   w0[2] = pws[gid].i[ 2];
 1484   w0[3] = pws[gid].i[ 3];
 1485 
 1486   u32 w1[4];
 1487 
 1488   w1[0] = pws[gid].i[ 4];
 1489   w1[1] = pws[gid].i[ 5];
 1490   w1[2] = pws[gid].i[ 6];
 1491   w1[3] = pws[gid].i[ 7];
 1492 
 1493   u32 w2[4];
 1494 
 1495   w2[0] = 0;
 1496   w2[1] = 0;
 1497   w2[2] = 0;
 1498   w2[3] = 0;
 1499 
 1500   u32 w3[4];
 1501 
 1502   w3[0] = 0;
 1503   w3[1] = 0;
 1504   w3[2] = pws[gid].i[14];
 1505   w3[3] = 0;
 1506 
 1507   const u32 pw_len = pws[gid].pw_len & 63;
 1508 
 1509   /**
 1510    * main
 1511    */
 1512 
 1513   m04710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_extra0_buf, d_extra1_buf, d_extra2_buf, d_extra3_buf, kernel_param, gid, lid, lsz, l_bin2asc);
 1514 }
 1515 
 1516 KERNEL_FQ void m04710_m16 (KERN_ATTR_BASIC ())
 1517 {
 1518   /**
 1519    * base
 1520    */
 1521 
 1522   const u64 lid = get_local_id (0);
 1523   const u64 gid = get_global_id (0);
 1524   const u64 lsz = get_local_size (0);
 1525 
 1526   /**
 1527    * bin2asc table
 1528    */
 1529 
 1530   LOCAL_VK u32 l_bin2asc[256];
 1531 
 1532   for (u32 i = lid; i < 256; i += lsz)
 1533   {
 1534     const u32 i0 = (i >> 0) & 15;
 1535     const u32 i1 = (i >> 4) & 15;
 1536 
 1537     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
 1538                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
 1539   }
 1540 
 1541   SYNC_THREADS ();
 1542 
 1543   if (gid >= GID_CNT) return;
 1544 
 1545   /**
 1546    * modifier
 1547    */
 1548 
 1549   u32 w0[4];
 1550 
 1551   w0[0] = pws[gid].i[ 0];
 1552   w0[1] = pws[gid].i[ 1];
 1553   w0[2] = pws[gid].i[ 2];
 1554   w0[3] = pws[gid].i[ 3];
 1555 
 1556   u32 w1[4];
 1557 
 1558   w1[0] = pws[gid].i[ 4];
 1559   w1[1] = pws[gid].i[ 5];
 1560   w1[2] = pws[gid].i[ 6];
 1561   w1[3] = pws[gid].i[ 7];
 1562 
 1563   u32 w2[4];
 1564 
 1565   w2[0] = pws[gid].i[ 8];
 1566   w2[1] = pws[gid].i[ 9];
 1567   w2[2] = pws[gid].i[10];
 1568   w2[3] = pws[gid].i[11];
 1569 
 1570   u32 w3[4];
 1571 
 1572   w3[0] = pws[gid].i[12];
 1573   w3[1] = pws[gid].i[13];
 1574   w3[2] = pws[gid].i[14];
 1575   w3[3] = pws[gid].i[15];
 1576 
 1577   const u32 pw_len = pws[gid].pw_len & 63;
 1578 
 1579   /**
 1580    * main
 1581    */
 1582 
 1583   m04710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_extra0_buf, d_extra1_buf, d_extra2_buf, d_extra3_buf, kernel_param, gid, lid, lsz, l_bin2asc);
 1584 }
 1585 
 1586 KERNEL_FQ void m04710_s04 (KERN_ATTR_BASIC ())
 1587 {
 1588   /**
 1589    * base
 1590    */
 1591 
 1592   const u64 lid = get_local_id (0);
 1593   const u64 gid = get_global_id (0);
 1594   const u64 lsz = get_local_size (0);
 1595 
 1596   /**
 1597    * bin2asc table
 1598    */
 1599 
 1600   LOCAL_VK u32 l_bin2asc[256];
 1601 
 1602   for (u32 i = lid; i < 256; i += lsz)
 1603   {
 1604     const u32 i0 = (i >> 0) & 15;
 1605     const u32 i1 = (i >> 4) & 15;
 1606 
 1607     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
 1608                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
 1609   }
 1610 
 1611   SYNC_THREADS ();
 1612 
 1613   if (gid >= GID_CNT) return;
 1614 
 1615   /**
 1616    * modifier
 1617    */
 1618 
 1619   u32 w0[4];
 1620 
 1621   w0[0] = pws[gid].i[ 0];
 1622   w0[1] = pws[gid].i[ 1];
 1623   w0[2] = pws[gid].i[ 2];
 1624   w0[3] = pws[gid].i[ 3];
 1625 
 1626   u32 w1[4];
 1627 
 1628   w1[0] = 0;
 1629   w1[1] = 0;
 1630   w1[2] = 0;
 1631   w1[3] = 0;
 1632 
 1633   u32 w2[4];
 1634 
 1635   w2[0] = 0;
 1636   w2[1] = 0;
 1637   w2[2] = 0;
 1638   w2[3] = 0;
 1639 
 1640   u32 w3[4];
 1641 
 1642   w3[0] = 0;
 1643   w3[1] = 0;
 1644   w3[2] = pws[gid].i[14];
 1645   w3[3] = 0;
 1646 
 1647   const u32 pw_len = pws[gid].pw_len & 63;
 1648 
 1649   /**
 1650    * main
 1651    */
 1652 
 1653   m04710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_extra0_buf, d_extra1_buf, d_extra2_buf, d_extra3_buf, kernel_param, gid, lid, lsz, l_bin2asc);
 1654 }
 1655 
 1656 KERNEL_FQ void m04710_s08 (KERN_ATTR_BASIC ())
 1657 {
 1658   /**
 1659    * base
 1660    */
 1661 
 1662   const u64 lid = get_local_id (0);
 1663   const u64 gid = get_global_id (0);
 1664   const u64 lsz = get_local_size (0);
 1665 
 1666   /**
 1667    * bin2asc table
 1668    */
 1669 
 1670   LOCAL_VK u32 l_bin2asc[256];
 1671 
 1672   for (u32 i = lid; i < 256; i += lsz)
 1673   {
 1674     const u32 i0 = (i >> 0) & 15;
 1675     const u32 i1 = (i >> 4) & 15;
 1676 
 1677     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
 1678                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
 1679   }
 1680 
 1681   SYNC_THREADS ();
 1682 
 1683   if (gid >= GID_CNT) return;
 1684 
 1685   /**
 1686    * modifier
 1687    */
 1688 
 1689   u32 w0[4];
 1690 
 1691   w0[0] = pws[gid].i[ 0];
 1692   w0[1] = pws[gid].i[ 1];
 1693   w0[2] = pws[gid].i[ 2];
 1694   w0[3] = pws[gid].i[ 3];
 1695 
 1696   u32 w1[4];
 1697 
 1698   w1[0] = pws[gid].i[ 4];
 1699   w1[1] = pws[gid].i[ 5];
 1700   w1[2] = pws[gid].i[ 6];
 1701   w1[3] = pws[gid].i[ 7];
 1702 
 1703   u32 w2[4];
 1704 
 1705   w2[0] = 0;
 1706   w2[1] = 0;
 1707   w2[2] = 0;
 1708   w2[3] = 0;
 1709 
 1710   u32 w3[4];
 1711 
 1712   w3[0] = 0;
 1713   w3[1] = 0;
 1714   w3[2] = pws[gid].i[14];
 1715   w3[3] = 0;
 1716 
 1717   const u32 pw_len = pws[gid].pw_len & 63;
 1718 
 1719   /**
 1720    * main
 1721    */
 1722 
 1723   m04710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_extra0_buf, d_extra1_buf, d_extra2_buf, d_extra3_buf, kernel_param, gid, lid, lsz, l_bin2asc);
 1724 }
 1725 
 1726 KERNEL_FQ void m04710_s16 (KERN_ATTR_BASIC ())
 1727 {
 1728   /**
 1729    * base
 1730    */
 1731 
 1732   const u64 lid = get_local_id (0);
 1733   const u64 gid = get_global_id (0);
 1734   const u64 lsz = get_local_size (0);
 1735 
 1736   /**
 1737    * bin2asc table
 1738    */
 1739 
 1740   LOCAL_VK u32 l_bin2asc[256];
 1741 
 1742   for (u32 i = lid; i < 256; i += lsz)
 1743   {
 1744     const u32 i0 = (i >> 0) & 15;
 1745     const u32 i1 = (i >> 4) & 15;
 1746 
 1747     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
 1748                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
 1749   }
 1750 
 1751   SYNC_THREADS ();
 1752 
 1753   if (gid >= GID_CNT) return;
 1754 
 1755   /**
 1756    * modifier
 1757    */
 1758 
 1759   u32 w0[4];
 1760 
 1761   w0[0] = pws[gid].i[ 0];
 1762   w0[1] = pws[gid].i[ 1];
 1763   w0[2] = pws[gid].i[ 2];
 1764   w0[3] = pws[gid].i[ 3];
 1765 
 1766   u32 w1[4];
 1767 
 1768   w1[0] = pws[gid].i[ 4];
 1769   w1[1] = pws[gid].i[ 5];
 1770   w1[2] = pws[gid].i[ 6];
 1771   w1[3] = pws[gid].i[ 7];
 1772 
 1773   u32 w2[4];
 1774 
 1775   w2[0] = pws[gid].i[ 8];
 1776   w2[1] = pws[gid].i[ 9];
 1777   w2[2] = pws[gid].i[10];
 1778   w2[3] = pws[gid].i[11];
 1779 
 1780   u32 w3[4];
 1781 
 1782   w3[0] = pws[gid].i[12];
 1783   w3[1] = pws[gid].i[13];
 1784   w3[2] = pws[gid].i[14];
 1785   w3[3] = pws[gid].i[15];
 1786 
 1787   const u32 pw_len = pws[gid].pw_len & 63;
 1788 
 1789   /**
 1790    * main
 1791    */
 1792 
 1793   m04710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_extra0_buf, d_extra1_buf, d_extra2_buf, d_extra3_buf, kernel_param, gid, lid, lsz, l_bin2asc);
 1794 }