Debian Codegraph @

sources/ippcp/hash/sha3/sha3-224/pcphashstatemethodset_sha3_224.c

raw symbols SCIP
1 /*************************************************************************
2 * Copyright (C) 2025 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *************************************************************************/
16
17 #include "owndefs.h"
18 #include "owncp.h"
19 #include "hash/pcphash.h"
20 #include "hash/pcphash_rmf.h"
21 #include "pcptool.h"
22 #include "hash/sha3/sha3-224/pcpsha3_224_stuff.h"
23 #include "hash/sha3/sha3_stuff.h"
24
25 /*
26 // Name: ippsHashStateMethodSet_SHA3_224
27 //
28 // Purpose: Setup SHA3_224 method inside the hash state.
29 //
30 // Returns: Reason:
31 // ippStsNullPtrErr pMethod == NULL or pState == NULL
32 // ippStsNoErr no errors
33 //
34 */
35 /* clang-format off */
36 IPPFUN(IppStatus, ippsHashStateMethodSet_SHA3_224, (IppsHashState_rmf* pState,
37 IppsHashMethod* pMethod))
38 /* clang-format on */
39 {
40 /* test pointers */
41 IPP_BAD_PTR2_RET(pState, pMethod);
42
43 HASH_METHOD(pState) = pMethod;
44
45 pMethod->hashAlgId = ippHashAlg_SHA3_224;
46 pMethod->hashLen = IPP_SHA3_224_DIGEST_BITSIZE / 8;
47 pMethod->msgBlkSize = MBS_SHA3_224;
48 pMethod->msgLenRepSize = 0;
49 pMethod->stateLen = IPP_SHA3_STATE_BYTESIZE;
50 pMethod->hashInit = cp_sha3_hashInit;
51 pMethod->hashUpdate = cp_sha3_224_hashUpdate;
52 pMethod->hashOctStr = cp_sha3_hashOctString;
53 pMethod->msgLenRep = NULL;
54
55 return ippStsNoErr;
56 }