Debian Codegraph @

sources/ippcp/pcpaes_expandkey_ni.c

raw symbols SCIP
1 /*************************************************************************
2 * Copyright (C) 2016 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 /*
18 //
19 // Purpose:
20 // Cryptography Primitive. AES keys expansion
21 //
22 // Contents:
23 // cpExpandAesKey_NI()
24 //
25 */
26
27 #include "owndefs.h"
28 #include "owncp.h"
29 #include "pcpaesm.h"
30 #include "pcpaes_keys_ni.h"
31
32 #if (_AES_NI_ENABLING_ == _FEATURE_ON_) || (_AES_NI_ENABLING_ == _FEATURE_TICKTOCK_)
33
34 IPP_OWN_DEFN(void, cpExpandAesKey_NI, (const Ipp8u* pSecret, IppsAESSpec* pCtx))
35 {
36 int nRounds = RIJ_NR(pCtx);
37 Ipp8u* pEncKeys = RIJ_EKEYS(pCtx);
38 Ipp8u* pDecKeys = RIJ_DKEYS(pCtx);
39
40 switch (nRounds) {
41 case 12:
42 aes192_KeyExpansion_NI(pEncKeys, pSecret);
43 break;
44 case 14:
45 aes256_KeyExpansion_NI(pEncKeys, pSecret);
46 break;
47 default:
48 aes128_KeyExpansion_NI(pEncKeys, pSecret);
49 break;
50 }
51
52 aes_DecKeyExpansion_NI(pDecKeys, pEncKeys, nRounds);
53 }
54
55 #endif /* #if (_AES_NI_ENABLING_==_FEATURE_ON_) || (_AES_NI_ENABLING_==_FEATURE_TICKTOCK_) */