xref: /isa-l_crypto/sha256_mb/sha256_mb_mgr_init_avx2.c (revision 0a437795c8360736f38dfa5934aa03a1861d784c)
16df3ef80SGreg Tucker /**********************************************************************
26df3ef80SGreg Tucker   Copyright(c) 2011-2016 Intel Corporation All rights reserved.
36df3ef80SGreg Tucker 
46df3ef80SGreg Tucker   Redistribution and use in source and binary forms, with or without
56df3ef80SGreg Tucker   modification, are permitted provided that the following conditions
66df3ef80SGreg Tucker   are met:
76df3ef80SGreg Tucker     * Redistributions of source code must retain the above copyright
86df3ef80SGreg Tucker       notice, this list of conditions and the following disclaimer.
96df3ef80SGreg Tucker     * Redistributions in binary form must reproduce the above copyright
106df3ef80SGreg Tucker       notice, this list of conditions and the following disclaimer in
116df3ef80SGreg Tucker       the documentation and/or other materials provided with the
126df3ef80SGreg Tucker       distribution.
136df3ef80SGreg Tucker     * Neither the name of Intel Corporation nor the names of its
146df3ef80SGreg Tucker       contributors may be used to endorse or promote products derived
156df3ef80SGreg Tucker       from this software without specific prior written permission.
166df3ef80SGreg Tucker 
176df3ef80SGreg Tucker   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
186df3ef80SGreg Tucker   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
196df3ef80SGreg Tucker   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
206df3ef80SGreg Tucker   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216df3ef80SGreg Tucker   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
226df3ef80SGreg Tucker   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
236df3ef80SGreg Tucker   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
246df3ef80SGreg Tucker   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
256df3ef80SGreg Tucker   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266df3ef80SGreg Tucker   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
276df3ef80SGreg Tucker   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
286df3ef80SGreg Tucker **********************************************************************/
296df3ef80SGreg Tucker 
30ae9fc3e1SPablo de Lara #include "sha256_mb_internal.h"
316df3ef80SGreg Tucker 
329ba6f238SMarcel Cornu void
_sha256_mb_mgr_init_avx2(ISAL_SHA256_MB_JOB_MGR * state)33*0a437795SPablo de Lara _sha256_mb_mgr_init_avx2(ISAL_SHA256_MB_JOB_MGR *state)
346df3ef80SGreg Tucker {
356df3ef80SGreg Tucker         unsigned int j;
36fabd0c36SMarcel Cornu 
37fabd0c36SMarcel Cornu         memset(state, 0, sizeof(*state));
386df3ef80SGreg Tucker         state->unused_lanes = 0xF76543210;
39246221b0SXiaodong Liu         state->num_lanes_inuse = 0;
40*0a437795SPablo de Lara         for (j = 0; j < ISAL_SHA256_X8_LANES; j++) {
416df3ef80SGreg Tucker                 state->lens[j] = 0;
426df3ef80SGreg Tucker                 state->ldata[j].job_in_lane = 0;
436df3ef80SGreg Tucker         }
446df3ef80SGreg Tucker }
45