"Fossies" - the Fresh Open Source Software Archive

Member "hashcat-6.2.6/OpenCL/m04710_a0-optimized.cl" (2 Sep 2022, 69347 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_a0-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_rp_optimized.h)
   14 #include M2S(INCLUDE_PATH/inc_rp_optimized.cl)
   15 #include M2S(INCLUDE_PATH/inc_simd.cl)
   16 #include M2S(INCLUDE_PATH/inc_hash_md5.cl)
   17 #include M2S(INCLUDE_PATH/inc_hash_sha1.cl)
   18 #endif
   19 
   20 #if   VECT_SIZE == 1
   21 #define uint_to_hex_lower8_le(i) make_u32x (l_bin2asc[(i)])
   22 #elif VECT_SIZE == 2
   23 #define uint_to_hex_lower8_le(i) make_u32x (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
   24 #elif VECT_SIZE == 4
   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])
   26 #elif VECT_SIZE == 8
   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])
   28 #elif VECT_SIZE == 16
   29 #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])
   30 #endif
   31 
   32 KERNEL_FQ void m04710_m04 (KERN_ATTR_RULES ())
   33 {
   34   /**
   35    * modifier
   36    */
   37 
   38   const u64 gid = get_global_id (0);
   39   const u64 lid = get_local_id (0);
   40   const u64 lsz = get_local_size (0);
   41 
   42   /**
   43    * bin2asc table
   44    */
   45 
   46   LOCAL_VK u32 l_bin2asc[256];
   47 
   48   for (u32 i = lid; i < 256; i += lsz)
   49   {
   50     const u32 i0 = (i >> 0) & 15;
   51     const u32 i1 = (i >> 4) & 15;
   52 
   53     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
   54                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
   55   }
   56 
   57   SYNC_THREADS ();
   58 
   59   if (gid >= GID_CNT) return;
   60 
   61   /**
   62    * base
   63    */
   64 
   65   u32 pw_buf0[4];
   66   u32 pw_buf1[4];
   67 
   68   pw_buf0[0] = pws[gid].i[0];
   69   pw_buf0[1] = pws[gid].i[1];
   70   pw_buf0[2] = pws[gid].i[2];
   71   pw_buf0[3] = pws[gid].i[3];
   72   pw_buf1[0] = pws[gid].i[4];
   73   pw_buf1[1] = pws[gid].i[5];
   74   pw_buf1[2] = pws[gid].i[6];
   75   pw_buf1[3] = pws[gid].i[7];
   76 
   77   const u32 pw_len = pws[gid].pw_len & 63;
   78 
   79   /**
   80    * salt
   81    */
   82 
   83   u32 salt_buf0[4];
   84   u32 salt_buf1[4];
   85   u32 salt_buf2[4];
   86   u32 salt_buf3[4];
   87 
   88   salt_buf0[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 0]);
   89   salt_buf0[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 1]);
   90   salt_buf0[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 2]);
   91   salt_buf0[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 3]);
   92   salt_buf1[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 4]);
   93   salt_buf1[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 5]);
   94   salt_buf1[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 6]);
   95   salt_buf1[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 7]);
   96   salt_buf2[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 8]);
   97   salt_buf2[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 9]);
   98   salt_buf2[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[10]);
   99   salt_buf2[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[11]);
  100   salt_buf3[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[12]);
  101   salt_buf3[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[13]);
  102   salt_buf3[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[14]);
  103   salt_buf3[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[15]);
  104 
  105   const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
  106 
  107   /**
  108    * loop
  109    */
  110 
  111   for (u32 il_pos = 0; il_pos < IL_CNT; il_pos += VECT_SIZE)
  112   {
  113     u32x w0[4] = { 0 };
  114     u32x w1[4] = { 0 };
  115     u32x w2[4] = { 0 };
  116     u32x w3[4] = { 0 };
  117 
  118     const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
  119 
  120     append_0x80_2x4_VV (w0, w1, out_len);
  121 
  122     w3[2] = out_len * 8;
  123     w3[3] = 0;
  124 
  125     /**
  126      * md5(pass)
  127      */
  128 
  129     u32x a = MD5M_A;
  130     u32x b = MD5M_B;
  131     u32x c = MD5M_C;
  132     u32x d = MD5M_D;
  133     u32x e = 0;
  134 
  135     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
  136     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
  137     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
  138     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
  139     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
  140     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
  141     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
  142     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
  143     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
  144     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
  145     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
  146     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
  147     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
  148     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
  149     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
  150     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
  151 
  152     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
  153     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
  154     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
  155     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
  156     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
  157     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
  158     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
  159     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
  160     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
  161     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
  162     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
  163     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
  164     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
  165     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
  166     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
  167     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
  168 
  169     u32x t;
  170 
  171     MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20);
  172     MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21);
  173     MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22);
  174     MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23);
  175     MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20);
  176     MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21);
  177     MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22);
  178     MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23);
  179     MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20);
  180     MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21);
  181     MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22);
  182     MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23);
  183     MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20);
  184     MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21);
  185     MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22);
  186     MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23);
  187 
  188     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
  189     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
  190     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
  191     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
  192     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
  193     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
  194     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
  195     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
  196     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
  197     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
  198     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
  199     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
  200     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
  201     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
  202     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
  203     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
  204 
  205     a += make_u32x (MD5M_A);
  206     b += make_u32x (MD5M_B);
  207     c += make_u32x (MD5M_C);
  208     d += make_u32x (MD5M_D);
  209 
  210     // sha1
  211 
  212     u32x w0_t = uint_to_hex_lower8_le ((a >>  8) & 255) <<  0
  213               | uint_to_hex_lower8_le ((a >>  0) & 255) << 16;
  214     u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) <<  0
  215               | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
  216     u32x w2_t = uint_to_hex_lower8_le ((b >>  8) & 255) <<  0
  217               | uint_to_hex_lower8_le ((b >>  0) & 255) << 16;
  218     u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) <<  0
  219               | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
  220     u32x w4_t = uint_to_hex_lower8_le ((c >>  8) & 255) <<  0
  221               | uint_to_hex_lower8_le ((c >>  0) & 255) << 16;
  222     u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) <<  0
  223               | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
  224     u32x w6_t = uint_to_hex_lower8_le ((d >>  8) & 255) <<  0
  225               | uint_to_hex_lower8_le ((d >>  0) & 255) << 16;
  226     u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) <<  0
  227               | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
  228     u32x w8_t = 0;
  229     u32x w9_t = 0;
  230     u32x wa_t = 0;
  231     u32x wb_t = 0;
  232     u32x wc_t = 0;
  233     u32x wd_t = 0;
  234     u32x we_t = 0;
  235     u32x wf_t = 0;
  236 
  237     a = SHA1M_A;
  238     b = SHA1M_B;
  239     c = SHA1M_C;
  240     d = SHA1M_D;
  241     e = SHA1M_E;
  242 
  243     u32x digest[8];
  244 
  245     digest[0] = a;
  246     digest[1] = b;
  247     digest[2] = c;
  248     digest[3] = d;
  249     digest[4] = e;
  250 
  251     // append salt
  252 
  253     // ctx_len 32, pos 32
  254 
  255     int pos = 32;
  256 
  257     u32x s0[4];
  258     u32x s1[4];
  259     u32x s2[4];
  260     u32x s3[4];
  261 
  262     s0[0] = salt_buf0[0];
  263     s0[1] = salt_buf0[1];
  264     s0[2] = salt_buf0[2];
  265     s0[3] = salt_buf0[3];
  266     s1[0] = salt_buf1[0];
  267     s1[1] = salt_buf1[1];
  268     s1[2] = salt_buf1[2];
  269     s1[3] = salt_buf1[3];
  270     s2[0] = salt_buf2[0];
  271     s2[1] = salt_buf2[1];
  272     s2[2] = salt_buf2[2];
  273     s2[3] = salt_buf2[3];
  274     s3[0] = salt_buf3[0];
  275     s3[1] = salt_buf3[1];
  276     s3[2] = salt_buf3[2];
  277     s3[3] = salt_buf3[3];
  278 
  279     if ((pos + salt_len) < 64)
  280     {
  281       switch_buffer_by_offset_be (s0, s1, s2, s3, pos);
  282 
  283       w0_t |= s0[0];
  284       w1_t |= s0[1];
  285       w2_t |= s0[2];
  286       w3_t |= s0[3];
  287       w4_t |= s1[0];
  288       w5_t |= s1[1];
  289       w6_t |= s1[2];
  290       w7_t |= s1[3];
  291       w8_t |= s2[0];
  292       w9_t |= s2[1];
  293       wa_t |= s2[2];
  294       wb_t |= s2[3];
  295       wc_t |= s3[0];
  296       wd_t |= s3[1];
  297       we_t |= s3[2];
  298       wf_t |= s3[3];
  299     }
  300     else
  301     {
  302       u32x _w0[4] = { 0 };
  303       u32x _w1[4] = { 0 };
  304       u32x _w2[4] = { 0 };
  305       u32x _w3[4] = { 0 };
  306 
  307       switch_buffer_by_offset_carry_be (s0, s1, s2, s3, _w0, _w1, _w2, _w3, pos);
  308 
  309       w0_t |= s0[0];
  310       w1_t |= s0[1];
  311       w2_t |= s0[2];
  312       w3_t |= s0[3];
  313       w4_t |= s1[0];
  314       w5_t |= s1[1];
  315       w6_t |= s1[2];
  316       w7_t |= s1[3];
  317       w8_t |= s2[0];
  318       w9_t |= s2[1];
  319       wa_t |= s2[2];
  320       wb_t |= s2[3];
  321       wc_t |= s3[0];
  322       wd_t |= s3[1];
  323       we_t |= s3[2];
  324       wf_t |= s3[3];
  325 
  326       // sha1 transform
  327 
  328       #undef K
  329       #define K SHA1C00
  330 
  331       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
  332       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
  333       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
  334       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
  335       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
  336       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
  337       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
  338       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
  339       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
  340       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
  341       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
  342       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
  343       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
  344       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
  345       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
  346       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
  347       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
  348       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
  349       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
  350       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
  351 
  352       #undef K
  353       #define K SHA1C01
  354 
  355       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
  356       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
  357       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
  358       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
  359       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
  360       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
  361       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
  362       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
  363       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
  364       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
  365       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
  366       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
  367       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
  368       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
  369       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
  370       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
  371       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
  372       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
  373       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
  374       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
  375 
  376       #undef K
  377       #define K SHA1C02
  378 
  379       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
  380       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
  381       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
  382       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
  383       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
  384       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
  385       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
  386       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
  387       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
  388       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
  389       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
  390       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
  391       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
  392       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
  393       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
  394       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
  395       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
  396       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
  397       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
  398       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
  399 
  400       #undef K
  401       #define K SHA1C03
  402 
  403       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
  404       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
  405       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
  406       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
  407       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
  408       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
  409       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
  410       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
  411       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
  412       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
  413       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
  414       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
  415       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
  416       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
  417       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
  418       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
  419       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
  420       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
  421       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
  422       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
  423 
  424       digest[0] += a;
  425       digest[1] += b;
  426       digest[2] += c;
  427       digest[3] += d;
  428       digest[4] += e;
  429 
  430       w0_t = _w0[0];
  431       w1_t = _w0[1];
  432       w2_t = _w0[2];
  433       w3_t = _w0[3];
  434       w4_t = _w1[0];
  435       w5_t = _w1[1];
  436       w6_t = _w1[2];
  437       w7_t = _w1[3];
  438       w8_t = _w2[0];
  439       w9_t = _w2[1];
  440       wa_t = _w2[2];
  441       wb_t = _w2[3];
  442       wc_t = _w3[0];
  443       wd_t = _w3[1];
  444       we_t = _w3[2];
  445       wf_t = _w3[3];
  446     }
  447 
  448     const int ctx_len = 32 + salt_len;
  449 
  450     pos = ctx_len & 63;
  451 
  452     // append_0x80_4x4
  453 
  454     const u32 off = pos ^ 3;
  455 
  456     const u32 c0 = (off & 15) / 4;
  457 
  458     const u32 r0 = 0xff << ((off & 3) * 8);
  459 
  460     const u32 m0[4] = { ((c0 == 0) ? r0 : 0), ((c0 == 1) ? r0 : 0), ((c0 == 2) ? r0 : 0), ((c0 == 3) ? r0 : 0) };
  461 
  462     const u32 off16 = off / 16;
  463 
  464     const u32 v0[4] = { ((off16 == 0) ? 0x80808080 : 0), ((off16 == 1) ? 0x80808080 : 0), ((off16 == 2) ? 0x80808080 : 0), ((off16 == 3) ? 0x80808080 : 0) };
  465 
  466     w0_t |= v0[0] & m0[0];
  467     w1_t |= v0[0] & m0[1];
  468     w2_t |= v0[0] & m0[2];
  469     w3_t |= v0[0] & m0[3];
  470     w4_t |= v0[1] & m0[0];
  471     w5_t |= v0[1] & m0[1];
  472     w6_t |= v0[1] & m0[2];
  473     w7_t |= v0[1] & m0[3];
  474     w8_t |= v0[2] & m0[0];
  475     w9_t |= v0[2] & m0[1];
  476     wa_t |= v0[2] & m0[2];
  477     wb_t |= v0[2] & m0[3];
  478     wc_t |= v0[3] & m0[0];
  479     wd_t |= v0[3] & m0[1];
  480     we_t |= v0[3] & m0[2];
  481     wf_t |= v0[3] & m0[3];
  482 
  483     if (pos >= 56)
  484     {
  485       a = digest[0];
  486       b = digest[1];
  487       c = digest[2];
  488       d = digest[3];
  489       e = digest[4];
  490 
  491       #undef K
  492       #define K SHA1C00
  493 
  494       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
  495       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
  496       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
  497       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
  498       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
  499       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
  500       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
  501       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
  502       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
  503       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
  504       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
  505       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
  506       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
  507       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
  508       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
  509       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
  510       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
  511       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
  512       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
  513       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
  514 
  515       #undef K
  516       #define K SHA1C01
  517 
  518       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
  519       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
  520       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
  521       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
  522       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
  523       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
  524       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
  525       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
  526       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
  527       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
  528       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
  529       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
  530       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
  531       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
  532       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
  533       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
  534       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
  535       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
  536       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
  537       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
  538 
  539       #undef K
  540       #define K SHA1C02
  541 
  542       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
  543       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
  544       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
  545       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
  546       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
  547       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
  548       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
  549       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
  550       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
  551       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
  552       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
  553       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
  554       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
  555       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
  556       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
  557       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
  558       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
  559       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
  560       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
  561       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
  562 
  563       #undef K
  564       #define K SHA1C03
  565 
  566       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
  567       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
  568       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
  569       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
  570       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
  571       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
  572       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
  573       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
  574       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
  575       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
  576       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
  577       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
  578       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
  579       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
  580       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
  581       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
  582       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
  583       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
  584       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
  585       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
  586 
  587       digest[0] += a;
  588       digest[1] += b;
  589       digest[2] += c;
  590       digest[3] += d;
  591       digest[4] += e;
  592 
  593       w0_t = 0;
  594       w1_t = 0;
  595       w2_t = 0;
  596       w3_t = 0;
  597       w4_t = 0;
  598       w5_t = 0;
  599       w6_t = 0;
  600       w7_t = 0;
  601       w8_t = 0;
  602       w9_t = 0;
  603       wa_t = 0;
  604       wb_t = 0;
  605       wc_t = 0;
  606       wd_t = 0;
  607       we_t = 0;
  608       wf_t = 0;
  609     }
  610 
  611     // last sha1 transform
  612 
  613     we_t = 0;
  614     wf_t = ctx_len * 8;
  615 
  616     a = digest[0];
  617     b = digest[1];
  618     c = digest[2];
  619     d = digest[3];
  620     e = digest[4];
  621 
  622     #undef K
  623     #define K SHA1C00
  624 
  625     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
  626     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
  627     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
  628     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
  629     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
  630     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
  631     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
  632     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
  633     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
  634     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
  635     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
  636     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
  637     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
  638     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
  639     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
  640     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
  641     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
  642     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
  643     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
  644     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
  645 
  646     #undef K
  647     #define K SHA1C01
  648 
  649     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
  650     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
  651     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
  652     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
  653     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
  654     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
  655     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
  656     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
  657     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
  658     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
  659     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
  660     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
  661     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
  662     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
  663     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
  664     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
  665     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
  666     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
  667     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
  668     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
  669 
  670     #undef K
  671     #define K SHA1C02
  672 
  673     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
  674     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
  675     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
  676     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
  677     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
  678     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
  679     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
  680     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
  681     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
  682     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
  683     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
  684     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
  685     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
  686     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
  687     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
  688     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
  689     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
  690     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
  691     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
  692     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
  693 
  694     #undef K
  695     #define K SHA1C03
  696 
  697     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
  698     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
  699     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
  700     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
  701     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
  702     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
  703     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
  704     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
  705     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
  706     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
  707     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
  708     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
  709     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
  710     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
  711     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
  712     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
  713     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
  714     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
  715     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
  716     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
  717 
  718     b += digest[1] - make_u32x (SHA1M_B);
  719     c += digest[2] - make_u32x (SHA1M_C);
  720     d += digest[3] - make_u32x (SHA1M_D);
  721     e += digest[4] - make_u32x (SHA1M_E);
  722 
  723     COMPARE_M_SIMD (d, e, c, b);
  724   }
  725 }
  726 
  727 KERNEL_FQ void m04710_m08 (KERN_ATTR_RULES ())
  728 {
  729 }
  730 
  731 KERNEL_FQ void m04710_m16 (KERN_ATTR_RULES ())
  732 {
  733 }
  734 
  735 KERNEL_FQ void m04710_s04 (KERN_ATTR_RULES ())
  736 {
  737   /**
  738    * modifier
  739    */
  740 
  741   const u64 gid = get_global_id (0);
  742   const u64 lid = get_local_id (0);
  743   const u64 lsz = get_local_size (0);
  744 
  745   /**
  746    * bin2asc table
  747    */
  748 
  749   LOCAL_VK u32 l_bin2asc[256];
  750 
  751   for (u32 i = lid; i < 256; i += lsz)
  752   {
  753     const u32 i0 = (i >> 0) & 15;
  754     const u32 i1 = (i >> 4) & 15;
  755 
  756     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 0
  757                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 8;
  758   }
  759 
  760   SYNC_THREADS ();
  761 
  762   if (gid >= GID_CNT) return;
  763 
  764   /**
  765    * base
  766    */
  767 
  768   u32 pw_buf0[4];
  769   u32 pw_buf1[4];
  770 
  771   pw_buf0[0] = pws[gid].i[0];
  772   pw_buf0[1] = pws[gid].i[1];
  773   pw_buf0[2] = pws[gid].i[2];
  774   pw_buf0[3] = pws[gid].i[3];
  775   pw_buf1[0] = pws[gid].i[4];
  776   pw_buf1[1] = pws[gid].i[5];
  777   pw_buf1[2] = pws[gid].i[6];
  778   pw_buf1[3] = pws[gid].i[7];
  779 
  780   const u32 pw_len = pws[gid].pw_len & 63;
  781 
  782   /**
  783    * salt
  784    */
  785 
  786   u32 salt_buf0[4];
  787   u32 salt_buf1[4];
  788   u32 salt_buf2[4];
  789   u32 salt_buf3[4];
  790 
  791   salt_buf0[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 0]);
  792   salt_buf0[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 1]);
  793   salt_buf0[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 2]);
  794   salt_buf0[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 3]);
  795   salt_buf1[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 4]);
  796   salt_buf1[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 5]);
  797   salt_buf1[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 6]);
  798   salt_buf1[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 7]);
  799   salt_buf2[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 8]);
  800   salt_buf2[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[ 9]);
  801   salt_buf2[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[10]);
  802   salt_buf2[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[11]);
  803   salt_buf3[0] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[12]);
  804   salt_buf3[1] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[13]);
  805   salt_buf3[2] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[14]);
  806   salt_buf3[3] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[15]);
  807 
  808   const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
  809 
  810   /**
  811    * digest
  812    */
  813 
  814   const u32 search[4] =
  815   {
  816     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R0],
  817     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R1],
  818     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R2],
  819     digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R3]
  820   };
  821 
  822   /**
  823    * loop
  824    */
  825 
  826   for (u32 il_pos = 0; il_pos < IL_CNT; il_pos += VECT_SIZE)
  827   {
  828     u32x w0[4] = { 0 };
  829     u32x w1[4] = { 0 };
  830     u32x w2[4] = { 0 };
  831     u32x w3[4] = { 0 };
  832 
  833     const u32x out_len = apply_rules_vect_optimized (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
  834 
  835     append_0x80_2x4_VV (w0, w1, out_len);
  836 
  837     w3[2] = out_len * 8;
  838     w3[3] = 0;
  839 
  840     /**
  841      * md5(pass)
  842      */
  843 
  844     u32x a = MD5M_A;
  845     u32x b = MD5M_B;
  846     u32x c = MD5M_C;
  847     u32x d = MD5M_D;
  848     u32x e = 0;
  849 
  850     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
  851     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
  852     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
  853     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
  854     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
  855     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
  856     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
  857     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
  858     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
  859     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
  860     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
  861     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
  862     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
  863     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
  864     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
  865     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
  866 
  867     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
  868     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
  869     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
  870     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
  871     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
  872     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
  873     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
  874     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
  875     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
  876     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
  877     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
  878     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
  879     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
  880     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
  881     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
  882     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
  883 
  884     u32x t;
  885 
  886     MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20);
  887     MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21);
  888     MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22);
  889     MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23);
  890     MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20);
  891     MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21);
  892     MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22);
  893     MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23);
  894     MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20);
  895     MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21);
  896     MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22);
  897     MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23);
  898     MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20);
  899     MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21);
  900     MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22);
  901     MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23);
  902 
  903     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
  904     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
  905     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
  906     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
  907     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
  908     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
  909     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
  910     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
  911     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
  912     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
  913     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
  914     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
  915     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
  916     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
  917     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
  918     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
  919 
  920     a += make_u32x (MD5M_A);
  921     b += make_u32x (MD5M_B);
  922     c += make_u32x (MD5M_C);
  923     d += make_u32x (MD5M_D);
  924 
  925     // sha1
  926 
  927     u32x w0_t = uint_to_hex_lower8_le ((a >>  8) & 255) <<  0
  928               | uint_to_hex_lower8_le ((a >>  0) & 255) << 16;
  929     u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) <<  0
  930               | uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
  931     u32x w2_t = uint_to_hex_lower8_le ((b >>  8) & 255) <<  0
  932               | uint_to_hex_lower8_le ((b >>  0) & 255) << 16;
  933     u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) <<  0
  934               | uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
  935     u32x w4_t = uint_to_hex_lower8_le ((c >>  8) & 255) <<  0
  936               | uint_to_hex_lower8_le ((c >>  0) & 255) << 16;
  937     u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) <<  0
  938               | uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
  939     u32x w6_t = uint_to_hex_lower8_le ((d >>  8) & 255) <<  0
  940               | uint_to_hex_lower8_le ((d >>  0) & 255) << 16;
  941     u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) <<  0
  942               | uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
  943     u32x w8_t = 0;
  944     u32x w9_t = 0;
  945     u32x wa_t = 0;
  946     u32x wb_t = 0;
  947     u32x wc_t = 0;
  948     u32x wd_t = 0;
  949     u32x we_t = 0;
  950     u32x wf_t = 0;
  951 
  952     a = SHA1M_A;
  953     b = SHA1M_B;
  954     c = SHA1M_C;
  955     d = SHA1M_D;
  956     e = SHA1M_E;
  957 
  958     u32x digest[8];
  959 
  960     digest[0] = a;
  961     digest[1] = b;
  962     digest[2] = c;
  963     digest[3] = d;
  964     digest[4] = e;
  965 
  966     // append salt
  967 
  968     // ctx_len 32, pos 32
  969 
  970     int pos = 32;
  971 
  972     u32x s0[4];
  973     u32x s1[4];
  974     u32x s2[4];
  975     u32x s3[4];
  976 
  977     s0[0] = salt_buf0[0];
  978     s0[1] = salt_buf0[1];
  979     s0[2] = salt_buf0[2];
  980     s0[3] = salt_buf0[3];
  981     s1[0] = salt_buf1[0];
  982     s1[1] = salt_buf1[1];
  983     s1[2] = salt_buf1[2];
  984     s1[3] = salt_buf1[3];
  985     s2[0] = salt_buf2[0];
  986     s2[1] = salt_buf2[1];
  987     s2[2] = salt_buf2[2];
  988     s2[3] = salt_buf2[3];
  989     s3[0] = salt_buf3[0];
  990     s3[1] = salt_buf3[1];
  991     s3[2] = salt_buf3[2];
  992     s3[3] = salt_buf3[3];
  993 
  994     if ((pos + salt_len) < 64)
  995     {
  996       switch_buffer_by_offset_be (s0, s1, s2, s3, pos);
  997 
  998       w0_t |= s0[0];
  999       w1_t |= s0[1];
 1000       w2_t |= s0[2];
 1001       w3_t |= s0[3];
 1002       w4_t |= s1[0];
 1003       w5_t |= s1[1];
 1004       w6_t |= s1[2];
 1005       w7_t |= s1[3];
 1006       w8_t |= s2[0];
 1007       w9_t |= s2[1];
 1008       wa_t |= s2[2];
 1009       wb_t |= s2[3];
 1010       wc_t |= s3[0];
 1011       wd_t |= s3[1];
 1012       we_t |= s3[2];
 1013       wf_t |= s3[3];
 1014     }
 1015     else
 1016     {
 1017       u32x _w0[4] = { 0 };
 1018       u32x _w1[4] = { 0 };
 1019       u32x _w2[4] = { 0 };
 1020       u32x _w3[4] = { 0 };
 1021 
 1022       switch_buffer_by_offset_carry_be (s0, s1, s2, s3, _w0, _w1, _w2, _w3, pos);
 1023 
 1024       w0_t |= s0[0];
 1025       w1_t |= s0[1];
 1026       w2_t |= s0[2];
 1027       w3_t |= s0[3];
 1028       w4_t |= s1[0];
 1029       w5_t |= s1[1];
 1030       w6_t |= s1[2];
 1031       w7_t |= s1[3];
 1032       w8_t |= s2[0];
 1033       w9_t |= s2[1];
 1034       wa_t |= s2[2];
 1035       wb_t |= s2[3];
 1036       wc_t |= s3[0];
 1037       wd_t |= s3[1];
 1038       we_t |= s3[2];
 1039       wf_t |= s3[3];
 1040 
 1041       // sha1 transform
 1042 
 1043       #undef K
 1044       #define K SHA1C00
 1045 
 1046       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
 1047       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
 1048       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
 1049       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
 1050       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
 1051       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
 1052       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
 1053       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
 1054       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
 1055       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
 1056       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
 1057       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
 1058       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
 1059       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
 1060       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
 1061       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
 1062       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
 1063       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
 1064       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
 1065       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
 1066 
 1067       #undef K
 1068       #define K SHA1C01
 1069 
 1070       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
 1071       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
 1072       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
 1073       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
 1074       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
 1075       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
 1076       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
 1077       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
 1078       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
 1079       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
 1080       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
 1081       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
 1082       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
 1083       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
 1084       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
 1085       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
 1086       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
 1087       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
 1088       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
 1089       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
 1090 
 1091       #undef K
 1092       #define K SHA1C02
 1093 
 1094       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
 1095       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
 1096       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
 1097       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
 1098       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
 1099       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
 1100       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
 1101       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
 1102       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
 1103       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
 1104       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
 1105       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
 1106       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
 1107       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
 1108       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
 1109       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
 1110       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
 1111       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
 1112       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
 1113       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
 1114 
 1115       #undef K
 1116       #define K SHA1C03
 1117 
 1118       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
 1119       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
 1120       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
 1121       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
 1122       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
 1123       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
 1124       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
 1125       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
 1126       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
 1127       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
 1128       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
 1129       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
 1130       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
 1131       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
 1132       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
 1133       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
 1134       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
 1135       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
 1136       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
 1137       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
 1138 
 1139       digest[0] += a;
 1140       digest[1] += b;
 1141       digest[2] += c;
 1142       digest[3] += d;
 1143       digest[4] += e;
 1144 
 1145       w0_t = _w0[0];
 1146       w1_t = _w0[1];
 1147       w2_t = _w0[2];
 1148       w3_t = _w0[3];
 1149       w4_t = _w1[0];
 1150       w5_t = _w1[1];
 1151       w6_t = _w1[2];
 1152       w7_t = _w1[3];
 1153       w8_t = _w2[0];
 1154       w9_t = _w2[1];
 1155       wa_t = _w2[2];
 1156       wb_t = _w2[3];
 1157       wc_t = _w3[0];
 1158       wd_t = _w3[1];
 1159       we_t = _w3[2];
 1160       wf_t = _w3[3];
 1161     }
 1162 
 1163     const int ctx_len = 32 + salt_len;
 1164 
 1165     pos = ctx_len & 63;
 1166 
 1167     // append_0x80_4x4
 1168 
 1169     const u32 off = pos ^ 3;
 1170 
 1171     const u32 c0 = (off & 15) / 4;
 1172 
 1173     const u32 r0 = 0xff << ((off & 3) * 8);
 1174 
 1175     const u32 m0[4] = { ((c0 == 0) ? r0 : 0), ((c0 == 1) ? r0 : 0), ((c0 == 2) ? r0 : 0), ((c0 == 3) ? r0 : 0) };
 1176 
 1177     const u32 off16 = off / 16;
 1178 
 1179     const u32 v0[4] = { ((off16 == 0) ? 0x80808080 : 0), ((off16 == 1) ? 0x80808080 : 0), ((off16 == 2) ? 0x80808080 : 0), ((off16 == 3) ? 0x80808080 : 0) };
 1180 
 1181     w0_t |= v0[0] & m0[0];
 1182     w1_t |= v0[0] & m0[1];
 1183     w2_t |= v0[0] & m0[2];
 1184     w3_t |= v0[0] & m0[3];
 1185     w4_t |= v0[1] & m0[0];
 1186     w5_t |= v0[1] & m0[1];
 1187     w6_t |= v0[1] & m0[2];
 1188     w7_t |= v0[1] & m0[3];
 1189     w8_t |= v0[2] & m0[0];
 1190     w9_t |= v0[2] & m0[1];
 1191     wa_t |= v0[2] & m0[2];
 1192     wb_t |= v0[2] & m0[3];
 1193     wc_t |= v0[3] & m0[0];
 1194     wd_t |= v0[3] & m0[1];
 1195     we_t |= v0[3] & m0[2];
 1196     wf_t |= v0[3] & m0[3];
 1197 
 1198     if (pos >= 56)
 1199     {
 1200       a = digest[0];
 1201       b = digest[1];
 1202       c = digest[2];
 1203       d = digest[3];
 1204       e = digest[4];
 1205 
 1206       #undef K
 1207       #define K SHA1C00
 1208 
 1209       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
 1210       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
 1211       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
 1212       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
 1213       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
 1214       SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
 1215       SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
 1216       SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
 1217       SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
 1218       SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
 1219       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
 1220       SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
 1221       SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
 1222       SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
 1223       SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
 1224       SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
 1225       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
 1226       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
 1227       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
 1228       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
 1229 
 1230       #undef K
 1231       #define K SHA1C01
 1232 
 1233       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
 1234       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
 1235       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
 1236       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
 1237       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
 1238       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
 1239       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
 1240       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
 1241       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
 1242       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
 1243       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
 1244       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
 1245       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
 1246       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
 1247       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
 1248       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
 1249       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
 1250       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
 1251       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
 1252       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
 1253 
 1254       #undef K
 1255       #define K SHA1C02
 1256 
 1257       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
 1258       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
 1259       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
 1260       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
 1261       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
 1262       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
 1263       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
 1264       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
 1265       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
 1266       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
 1267       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
 1268       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
 1269       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
 1270       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
 1271       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
 1272       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
 1273       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
 1274       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
 1275       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
 1276       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
 1277 
 1278       #undef K
 1279       #define K SHA1C03
 1280 
 1281       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
 1282       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
 1283       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
 1284       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
 1285       w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
 1286       w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
 1287       w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
 1288       w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
 1289       w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
 1290       w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
 1291       w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
 1292       w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
 1293       w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
 1294       w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
 1295       wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
 1296       wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
 1297       wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
 1298       wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
 1299       we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
 1300       wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
 1301 
 1302       digest[0] += a;
 1303       digest[1] += b;
 1304       digest[2] += c;
 1305       digest[3] += d;
 1306       digest[4] += e;
 1307 
 1308       w0_t = 0;
 1309       w1_t = 0;
 1310       w2_t = 0;
 1311       w3_t = 0;
 1312       w4_t = 0;
 1313       w5_t = 0;
 1314       w6_t = 0;
 1315       w7_t = 0;
 1316       w8_t = 0;
 1317       w9_t = 0;
 1318       wa_t = 0;
 1319       wb_t = 0;
 1320       wc_t = 0;
 1321       wd_t = 0;
 1322       we_t = 0;
 1323       wf_t = 0;
 1324     }
 1325 
 1326     // last sha1 transform
 1327 
 1328     we_t = 0;
 1329     wf_t = ctx_len * 8;
 1330 
 1331     a = digest[0];
 1332     b = digest[1];
 1333     c = digest[2];
 1334     d = digest[3];
 1335     e = digest[4];
 1336 
 1337     #undef K
 1338     #define K SHA1C00
 1339 
 1340     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t);
 1341     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t);
 1342     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w2_t);
 1343     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t);
 1344     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w4_t);
 1345     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w5_t);
 1346     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w6_t);
 1347     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w7_t);
 1348     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w8_t);
 1349     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w9_t);
 1350     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wa_t);
 1351     SHA1_STEP (SHA1_F0o, e, a, b, c, d, wb_t);
 1352     SHA1_STEP (SHA1_F0o, d, e, a, b, c, wc_t);
 1353     SHA1_STEP (SHA1_F0o, c, d, e, a, b, wd_t);
 1354     SHA1_STEP (SHA1_F0o, b, c, d, e, a, we_t);
 1355     SHA1_STEP (SHA1_F0o, a, b, c, d, e, wf_t);
 1356     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t);
 1357     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t);
 1358     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t);
 1359     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t);
 1360 
 1361     #undef K
 1362     #define K SHA1C01
 1363 
 1364     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w4_t);
 1365     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w5_t);
 1366     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w6_t);
 1367     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w7_t);
 1368     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w8_t);
 1369     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w9_t);
 1370     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wa_t);
 1371     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wb_t);
 1372     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wc_t);
 1373     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wd_t);
 1374     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, we_t);
 1375     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wf_t);
 1376     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t);
 1377     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t);
 1378     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t);
 1379     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t);
 1380     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w4_t);
 1381     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w5_t);
 1382     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w6_t);
 1383     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w7_t);
 1384 
 1385     #undef K
 1386     #define K SHA1C02
 1387 
 1388     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w8_t);
 1389     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w9_t);
 1390     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wa_t);
 1391     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wb_t);
 1392     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wc_t);
 1393     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, wd_t);
 1394     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, we_t);
 1395     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, wf_t);
 1396     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t);
 1397     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t);
 1398     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t);
 1399     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t);
 1400     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w4_t);
 1401     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w5_t);
 1402     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w6_t);
 1403     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w7_t);
 1404     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w8_t);
 1405     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w9_t);
 1406     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, wa_t);
 1407     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, wb_t);
 1408 
 1409     #undef K
 1410     #define K SHA1C03
 1411 
 1412     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wc_t);
 1413     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wd_t);
 1414     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, we_t);
 1415     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, wf_t);
 1416     w0_t = hc_rotl32 ((wd_t ^ w8_t ^ w2_t ^ w0_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t);
 1417     w1_t = hc_rotl32 ((we_t ^ w9_t ^ w3_t ^ w1_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t);
 1418     w2_t = hc_rotl32 ((wf_t ^ wa_t ^ w4_t ^ w2_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t);
 1419     w3_t = hc_rotl32 ((w0_t ^ wb_t ^ w5_t ^ w3_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t);
 1420     w4_t = hc_rotl32 ((w1_t ^ wc_t ^ w6_t ^ w4_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w4_t);
 1421     w5_t = hc_rotl32 ((w2_t ^ wd_t ^ w7_t ^ w5_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w5_t);
 1422     w6_t = hc_rotl32 ((w3_t ^ we_t ^ w8_t ^ w6_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w6_t);
 1423     w7_t = hc_rotl32 ((w4_t ^ wf_t ^ w9_t ^ w7_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w7_t);
 1424     w8_t = hc_rotl32 ((w5_t ^ w0_t ^ wa_t ^ w8_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w8_t);
 1425     w9_t = hc_rotl32 ((w6_t ^ w1_t ^ wb_t ^ w9_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w9_t);
 1426     wa_t = hc_rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
 1427     wb_t = hc_rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
 1428     wc_t = hc_rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
 1429     wd_t = hc_rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
 1430 
 1431     if (MATCHES_NONE_VS ((e + digest[4] - make_u32x (SHA1M_E)), search[1]))
 1432       continue;
 1433 
 1434     we_t = hc_rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
 1435     wf_t = hc_rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
 1436 
 1437     b += digest[1] - make_u32x (SHA1M_B);
 1438     c += digest[2] - make_u32x (SHA1M_C);
 1439     d += digest[3] - make_u32x (SHA1M_D);
 1440     e += digest[4] - make_u32x (SHA1M_E);
 1441 
 1442     COMPARE_S_SIMD (d, e, c, b);
 1443   }
 1444 }
 1445 
 1446 KERNEL_FQ void m04710_s08 (KERN_ATTR_RULES ())
 1447 {
 1448 }
 1449 
 1450 KERNEL_FQ void m04710_s16 (KERN_ATTR_RULES ())
 1451 {
 1452 }