Debian Codegraph @

sources/ippcp/hash/sha3/sha3-224/pcphashmethod_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
24 /*
25 // Name: ippsHashMethod_SHA3_224
26 //
27 // Purpose: Return SHA3_224 method.
28 //
29 // Returns:
30 // Pointer to SHA3_224 hash-method.
31 //
32 */
33
34 IPPFUN(const IppsHashMethod*, ippsHashMethod_SHA3_224, (void))
35 {
36 /* Prevents re-initialization for better multi-threaded/repeated call performance */
37 static volatile int isInitialized = 0;
38
39 static IppsHashMethod method = { ippHashAlg_SHA3_224,
40 IPP_SHA3_224_DIGEST_BITSIZE / 8,
41 MBS_SHA3_224,
42 0,
43 IPP_SHA3_STATE_BYTESIZE,
44 NULL,
45 NULL,
46 NULL,
47 NULL };
48 if (isInitialized) {
49 CP_PREVENT_REORDER();
50 return &method;
51 }
52
53 // don't merge `method` initialization with function pointers assignment
54 // to prevent relocations (indirect calls) to be generated in the binary
55 method.hashInit = cp_sha3_hashInit;
56 method.hashUpdate = cp_sha3_224_hashUpdate;
57 method.hashOctStr = cp_sha3_hashOctString;
58 method.msgLenRep = NULL;
59
60 CP_PREVENT_REORDER();
61 isInitialized = 1;
62
63 return &method;
64 }