1 /******************************************************************************* 2 * Copyright 2002-2018 Intel Corporation 3 * All Rights Reserved. 4 * 5 * If this software was obtained under the Intel Simplified Software License, 6 * the following terms apply: 7 * 8 * The source code, information and material ("Material") contained herein is 9 * owned by Intel Corporation or its suppliers or licensors, and title to such 10 * Material remains with Intel Corporation or its suppliers or licensors. The 11 * Material contains proprietary information of Intel or its suppliers and 12 * licensors. The Material is protected by worldwide copyright laws and treaty 13 * provisions. No part of the Material may be used, copied, reproduced, 14 * modified, published, uploaded, posted, transmitted, distributed or disclosed 15 * in any way without Intel's prior express written permission. No license under 16 * any patent, copyright or other intellectual property rights in the Material 17 * is granted to or conferred upon you, either expressly, by implication, 18 * inducement, estoppel or otherwise. Any license under such intellectual 19 * property rights must be express and approved by Intel in writing. 20 * 21 * Unless otherwise agreed by Intel in writing, you may not remove or alter this 22 * notice or any other notice embedded in Materials by Intel or Intel's 23 * suppliers or licensors in any way. 24 * 25 * 26 * If this software was obtained under the Apache License, Version 2.0 (the 27 * "License"), the following terms apply: 28 * 29 * You may not use this file except in compliance with the License. You may 30 * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 31 * 32 * 33 * Unless required by applicable law or agreed to in writing, software 34 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 35 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 36 * 37 * See the License for the specific language governing permissions and 38 * limitations under the License. 39 *******************************************************************************/ 40 /******* FILE MODIFIED FROM ORIGINAL 2019u1 RELEASE TO AVOID WARNINGS *********/ 41 /* 42 // Intel(R) Integrated Performance Primitives 43 // Cryptographic Primitives (ippcp) 44 */ 45 46 #ifndef __OWNCP_H__ 47 #define __OWNCP_H__ 48 49 #ifndef __OWNDEFS_H__ 50 #include "owndefs.h" 51 #endif 52 53 #ifndef IPPCP_H__ 54 55 #define ippcpGetLibVersion OWNAPI(ippcpGetLibVersion) 56 #define ippsDESGetSize OWNAPI(ippsDESGetSize) 57 #define ippsDESInit OWNAPI(ippsDESInit) 58 #define ippsDESPack OWNAPI(ippsDESPack) 59 #define ippsDESUnpack OWNAPI(ippsDESUnpack) 60 #define ippsTDESEncryptECB OWNAPI(ippsTDESEncryptECB) 61 #define ippsTDESDecryptECB OWNAPI(ippsTDESDecryptECB) 62 #define ippsTDESEncryptCBC OWNAPI(ippsTDESEncryptCBC) 63 #define ippsTDESDecryptCBC OWNAPI(ippsTDESDecryptCBC) 64 #define ippsTDESEncryptCFB OWNAPI(ippsTDESEncryptCFB) 65 #define ippsTDESDecryptCFB OWNAPI(ippsTDESDecryptCFB) 66 #define ippsTDESEncryptOFB OWNAPI(ippsTDESEncryptOFB) 67 #define ippsTDESDecryptOFB OWNAPI(ippsTDESDecryptOFB) 68 #define ippsTDESEncryptCTR OWNAPI(ippsTDESEncryptCTR) 69 #define ippsTDESDecryptCTR OWNAPI(ippsTDESDecryptCTR) 70 #define ippsAESGetSize OWNAPI(ippsAESGetSize) 71 #define ippsAESInit OWNAPI(ippsAESInit) 72 #define ippsAESSetKey OWNAPI(ippsAESSetKey) 73 #define ippsAESPack OWNAPI(ippsAESPack) 74 #define ippsAESUnpack OWNAPI(ippsAESUnpack) 75 #define ippsAESEncryptECB OWNAPI(ippsAESEncryptECB) 76 #define ippsAESDecryptECB OWNAPI(ippsAESDecryptECB) 77 #define ippsAESEncryptCBC OWNAPI(ippsAESEncryptCBC) 78 #define ippsAESEncryptCBC_CS1 OWNAPI(ippsAESEncryptCBC_CS1) 79 #define ippsAESEncryptCBC_CS2 OWNAPI(ippsAESEncryptCBC_CS2) 80 #define ippsAESEncryptCBC_CS3 OWNAPI(ippsAESEncryptCBC_CS3) 81 #define ippsAESDecryptCBC OWNAPI(ippsAESDecryptCBC) 82 #define ippsAESDecryptCBC_CS1 OWNAPI(ippsAESDecryptCBC_CS1) 83 #define ippsAESDecryptCBC_CS2 OWNAPI(ippsAESDecryptCBC_CS2) 84 #define ippsAESDecryptCBC_CS3 OWNAPI(ippsAESDecryptCBC_CS3) 85 #define ippsAESEncryptCFB OWNAPI(ippsAESEncryptCFB) 86 #define ippsAESDecryptCFB OWNAPI(ippsAESDecryptCFB) 87 #define ippsAESEncryptOFB OWNAPI(ippsAESEncryptOFB) 88 #define ippsAESDecryptOFB OWNAPI(ippsAESDecryptOFB) 89 #define ippsAESEncryptCTR OWNAPI(ippsAESEncryptCTR) 90 #define ippsAESDecryptCTR OWNAPI(ippsAESDecryptCTR) 91 #define ippsAESEncryptXTS_Direct OWNAPI(ippsAESEncryptXTS_Direct) 92 #define ippsAESDecryptXTS_Direct OWNAPI(ippsAESDecryptXTS_Direct) 93 #define ippsSMS4GetSize OWNAPI(ippsSMS4GetSize) 94 #define ippsSMS4Init OWNAPI(ippsSMS4Init) 95 #define ippsSMS4SetKey OWNAPI(ippsSMS4SetKey) 96 #define ippsSMS4EncryptECB OWNAPI(ippsSMS4EncryptECB) 97 #define ippsSMS4DecryptECB OWNAPI(ippsSMS4DecryptECB) 98 #define ippsSMS4EncryptCBC OWNAPI(ippsSMS4EncryptCBC) 99 #define ippsSMS4EncryptCBC_CS1 OWNAPI(ippsSMS4EncryptCBC_CS1) 100 #define ippsSMS4EncryptCBC_CS2 OWNAPI(ippsSMS4EncryptCBC_CS2) 101 #define ippsSMS4EncryptCBC_CS3 OWNAPI(ippsSMS4EncryptCBC_CS3) 102 #define ippsSMS4DecryptCBC OWNAPI(ippsSMS4DecryptCBC) 103 #define ippsSMS4DecryptCBC_CS1 OWNAPI(ippsSMS4DecryptCBC_CS1) 104 #define ippsSMS4DecryptCBC_CS2 OWNAPI(ippsSMS4DecryptCBC_CS2) 105 #define ippsSMS4DecryptCBC_CS3 OWNAPI(ippsSMS4DecryptCBC_CS3) 106 #define ippsSMS4EncryptCFB OWNAPI(ippsSMS4EncryptCFB) 107 #define ippsSMS4DecryptCFB OWNAPI(ippsSMS4DecryptCFB) 108 #define ippsSMS4EncryptOFB OWNAPI(ippsSMS4EncryptOFB) 109 #define ippsSMS4DecryptOFB OWNAPI(ippsSMS4DecryptOFB) 110 #define ippsSMS4EncryptCTR OWNAPI(ippsSMS4EncryptCTR) 111 #define ippsSMS4DecryptCTR OWNAPI(ippsSMS4DecryptCTR) 112 #define ippsSMS4_CCMGetSize OWNAPI(ippsSMS4_CCMGetSize) 113 #define ippsSMS4_CCMInit OWNAPI(ippsSMS4_CCMInit) 114 #define ippsSMS4_CCMMessageLen OWNAPI(ippsSMS4_CCMMessageLen) 115 #define ippsSMS4_CCMTagLen OWNAPI(ippsSMS4_CCMTagLen) 116 #define ippsSMS4_CCMStart OWNAPI(ippsSMS4_CCMStart) 117 #define ippsSMS4_CCMEncrypt OWNAPI(ippsSMS4_CCMEncrypt) 118 #define ippsSMS4_CCMDecrypt OWNAPI(ippsSMS4_CCMDecrypt) 119 #define ippsSMS4_CCMGetTag OWNAPI(ippsSMS4_CCMGetTag) 120 #define ippsAES_CCMGetSize OWNAPI(ippsAES_CCMGetSize) 121 #define ippsAES_CCMInit OWNAPI(ippsAES_CCMInit) 122 #define ippsAES_CCMMessageLen OWNAPI(ippsAES_CCMMessageLen) 123 #define ippsAES_CCMTagLen OWNAPI(ippsAES_CCMTagLen) 124 #define ippsAES_CCMStart OWNAPI(ippsAES_CCMStart) 125 #define ippsAES_CCMEncrypt OWNAPI(ippsAES_CCMEncrypt) 126 #define ippsAES_CCMDecrypt OWNAPI(ippsAES_CCMDecrypt) 127 #define ippsAES_CCMGetTag OWNAPI(ippsAES_CCMGetTag) 128 #define ippsAES_GCMGetSize OWNAPI(ippsAES_GCMGetSize) 129 #define ippsAES_GCMInit OWNAPI(ippsAES_GCMInit) 130 #define ippsAES_GCMReset OWNAPI(ippsAES_GCMReset) 131 #define ippsAES_GCMProcessIV OWNAPI(ippsAES_GCMProcessIV) 132 #define ippsAES_GCMProcessAAD OWNAPI(ippsAES_GCMProcessAAD) 133 #define ippsAES_GCMStart OWNAPI(ippsAES_GCMStart) 134 #define ippsAES_GCMEncrypt OWNAPI(ippsAES_GCMEncrypt) 135 #define ippsAES_GCMDecrypt OWNAPI(ippsAES_GCMDecrypt) 136 #define ippsAES_GCMGetTag OWNAPI(ippsAES_GCMGetTag) 137 #define ippsAES_XTSGetSize OWNAPI(ippsAES_XTSGetSize) 138 #define ippsAES_XTSInit OWNAPI(ippsAES_XTSInit) 139 #define ippsAES_XTSEncrypt OWNAPI(ippsAES_XTSEncrypt) 140 #define ippsAES_XTSDecrypt OWNAPI(ippsAES_XTSDecrypt) 141 #define ippsAES_S2V_CMAC OWNAPI(ippsAES_S2V_CMAC) 142 #define ippsAES_SIVEncrypt OWNAPI(ippsAES_SIVEncrypt) 143 #define ippsAES_SIVDecrypt OWNAPI(ippsAES_SIVDecrypt) 144 #define ippsAES_CMACGetSize OWNAPI(ippsAES_CMACGetSize) 145 #define ippsAES_CMACInit OWNAPI(ippsAES_CMACInit) 146 #define ippsAES_CMACUpdate OWNAPI(ippsAES_CMACUpdate) 147 #define ippsAES_CMACFinal OWNAPI(ippsAES_CMACFinal) 148 #define ippsAES_CMACGetTag OWNAPI(ippsAES_CMACGetTag) 149 #define ippsARCFourCheckKey OWNAPI(ippsARCFourCheckKey) 150 #define ippsARCFourGetSize OWNAPI(ippsARCFourGetSize) 151 #define ippsARCFourInit OWNAPI(ippsARCFourInit) 152 #define ippsARCFourReset OWNAPI(ippsARCFourReset) 153 #define ippsARCFourPack OWNAPI(ippsARCFourPack) 154 #define ippsARCFourUnpack OWNAPI(ippsARCFourUnpack) 155 #define ippsARCFourEncrypt OWNAPI(ippsARCFourEncrypt) 156 #define ippsARCFourDecrypt OWNAPI(ippsARCFourDecrypt) 157 #define ippsSHA1GetSize OWNAPI(ippsSHA1GetSize) 158 #define ippsSHA1Init OWNAPI(ippsSHA1Init) 159 #define ippsSHA1Duplicate OWNAPI(ippsSHA1Duplicate) 160 #define ippsSHA1Pack OWNAPI(ippsSHA1Pack) 161 #define ippsSHA1Unpack OWNAPI(ippsSHA1Unpack) 162 #define ippsSHA1Update OWNAPI(ippsSHA1Update) 163 #define ippsSHA1GetTag OWNAPI(ippsSHA1GetTag) 164 #define ippsSHA1Final OWNAPI(ippsSHA1Final) 165 #define ippsSHA1MessageDigest OWNAPI(ippsSHA1MessageDigest) 166 #define ippsSHA224GetSize OWNAPI(ippsSHA224GetSize) 167 #define ippsSHA224Init OWNAPI(ippsSHA224Init) 168 #define ippsSHA224Duplicate OWNAPI(ippsSHA224Duplicate) 169 #define ippsSHA224Pack OWNAPI(ippsSHA224Pack) 170 #define ippsSHA224Unpack OWNAPI(ippsSHA224Unpack) 171 #define ippsSHA224Update OWNAPI(ippsSHA224Update) 172 #define ippsSHA224GetTag OWNAPI(ippsSHA224GetTag) 173 #define ippsSHA224Final OWNAPI(ippsSHA224Final) 174 #define ippsSHA224MessageDigest OWNAPI(ippsSHA224MessageDigest) 175 #define ippsSHA256GetSize OWNAPI(ippsSHA256GetSize) 176 #define ippsSHA256Init OWNAPI(ippsSHA256Init) 177 #define ippsSHA256Duplicate OWNAPI(ippsSHA256Duplicate) 178 #define ippsSHA256Pack OWNAPI(ippsSHA256Pack) 179 #define ippsSHA256Unpack OWNAPI(ippsSHA256Unpack) 180 #define ippsSHA256Update OWNAPI(ippsSHA256Update) 181 #define ippsSHA256GetTag OWNAPI(ippsSHA256GetTag) 182 #define ippsSHA256Final OWNAPI(ippsSHA256Final) 183 #define ippsSHA256MessageDigest OWNAPI(ippsSHA256MessageDigest) 184 #define ippsSHA384GetSize OWNAPI(ippsSHA384GetSize) 185 #define ippsSHA384Init OWNAPI(ippsSHA384Init) 186 #define ippsSHA384Duplicate OWNAPI(ippsSHA384Duplicate) 187 #define ippsSHA384Pack OWNAPI(ippsSHA384Pack) 188 #define ippsSHA384Unpack OWNAPI(ippsSHA384Unpack) 189 #define ippsSHA384Update OWNAPI(ippsSHA384Update) 190 #define ippsSHA384GetTag OWNAPI(ippsSHA384GetTag) 191 #define ippsSHA384Final OWNAPI(ippsSHA384Final) 192 #define ippsSHA384MessageDigest OWNAPI(ippsSHA384MessageDigest) 193 #define ippsSHA512GetSize OWNAPI(ippsSHA512GetSize) 194 #define ippsSHA512Init OWNAPI(ippsSHA512Init) 195 #define ippsSHA512Duplicate OWNAPI(ippsSHA512Duplicate) 196 #define ippsSHA512Pack OWNAPI(ippsSHA512Pack) 197 #define ippsSHA512Unpack OWNAPI(ippsSHA512Unpack) 198 #define ippsSHA512Update OWNAPI(ippsSHA512Update) 199 #define ippsSHA512GetTag OWNAPI(ippsSHA512GetTag) 200 #define ippsSHA512Final OWNAPI(ippsSHA512Final) 201 #define ippsSHA512MessageDigest OWNAPI(ippsSHA512MessageDigest) 202 #define ippsMD5GetSize OWNAPI(ippsMD5GetSize) 203 #define ippsMD5Init OWNAPI(ippsMD5Init) 204 #define ippsMD5Duplicate OWNAPI(ippsMD5Duplicate) 205 #define ippsMD5Pack OWNAPI(ippsMD5Pack) 206 #define ippsMD5Unpack OWNAPI(ippsMD5Unpack) 207 #define ippsMD5Update OWNAPI(ippsMD5Update) 208 #define ippsMD5GetTag OWNAPI(ippsMD5GetTag) 209 #define ippsMD5Final OWNAPI(ippsMD5Final) 210 #define ippsMD5MessageDigest OWNAPI(ippsMD5MessageDigest) 211 #define ippsSM3GetSize OWNAPI(ippsSM3GetSize) 212 #define ippsSM3Init OWNAPI(ippsSM3Init) 213 #define ippsSM3Duplicate OWNAPI(ippsSM3Duplicate) 214 #define ippsSM3Pack OWNAPI(ippsSM3Pack) 215 #define ippsSM3Unpack OWNAPI(ippsSM3Unpack) 216 #define ippsSM3Update OWNAPI(ippsSM3Update) 217 #define ippsSM3GetTag OWNAPI(ippsSM3GetTag) 218 #define ippsSM3Final OWNAPI(ippsSM3Final) 219 #define ippsSM3MessageDigest OWNAPI(ippsSM3MessageDigest) 220 #define ippsHashGetSize OWNAPI(ippsHashGetSize) 221 #define ippsHashInit OWNAPI(ippsHashInit) 222 #define ippsHashPack OWNAPI(ippsHashPack) 223 #define ippsHashUnpack OWNAPI(ippsHashUnpack) 224 #define ippsHashDuplicate OWNAPI(ippsHashDuplicate) 225 #define ippsHashUpdate OWNAPI(ippsHashUpdate) 226 #define ippsHashGetTag OWNAPI(ippsHashGetTag) 227 #define ippsHashFinal OWNAPI(ippsHashFinal) 228 #define ippsHashMessage OWNAPI(ippsHashMessage) 229 #define ippsHashMethod_MD5 OWNAPI(ippsHashMethod_MD5) 230 #define ippsHashMethod_SM3 OWNAPI(ippsHashMethod_SM3) 231 #define ippsHashMethod_SHA1 OWNAPI(ippsHashMethod_SHA1) 232 #define ippsHashMethod_SHA1_NI OWNAPI(ippsHashMethod_SHA1_NI) 233 #define ippsHashMethod_SHA1_TT OWNAPI(ippsHashMethod_SHA1_TT) 234 #define ippsHashMethod_SHA256 OWNAPI(ippsHashMethod_SHA256) 235 #define ippsHashMethod_SHA256_NI OWNAPI(ippsHashMethod_SHA256_NI) 236 #define ippsHashMethod_SHA256_TT OWNAPI(ippsHashMethod_SHA256_TT) 237 #define ippsHashMethod_SHA224 OWNAPI(ippsHashMethod_SHA224) 238 #define ippsHashMethod_SHA224_NI OWNAPI(ippsHashMethod_SHA224_NI) 239 #define ippsHashMethod_SHA224_TT OWNAPI(ippsHashMethod_SHA224_TT) 240 #define ippsHashMethod_SHA512 OWNAPI(ippsHashMethod_SHA512) 241 #define ippsHashMethod_SHA384 OWNAPI(ippsHashMethod_SHA384) 242 #define ippsHashMethod_SHA512_256 OWNAPI(ippsHashMethod_SHA512_256) 243 #define ippsHashMethod_SHA512_224 OWNAPI(ippsHashMethod_SHA512_224) 244 #define ippsHashGetSize_rmf OWNAPI(ippsHashGetSize_rmf) 245 #define ippsHashInit_rmf OWNAPI(ippsHashInit_rmf) 246 #define ippsHashPack_rmf OWNAPI(ippsHashPack_rmf) 247 #define ippsHashUnpack_rmf OWNAPI(ippsHashUnpack_rmf) 248 #define ippsHashDuplicate_rmf OWNAPI(ippsHashDuplicate_rmf) 249 #define ippsHashUpdate_rmf OWNAPI(ippsHashUpdate_rmf) 250 #define ippsHashGetTag_rmf OWNAPI(ippsHashGetTag_rmf) 251 #define ippsHashFinal_rmf OWNAPI(ippsHashFinal_rmf) 252 #define ippsHashMessage_rmf OWNAPI(ippsHashMessage_rmf) 253 #define ippsMGF OWNAPI(ippsMGF) 254 #define ippsMGF1_rmf OWNAPI(ippsMGF1_rmf) 255 #define ippsMGF2_rmf OWNAPI(ippsMGF2_rmf) 256 #define ippsHMAC_GetSize OWNAPI(ippsHMAC_GetSize) 257 #define ippsHMAC_Init OWNAPI(ippsHMAC_Init) 258 #define ippsHMAC_Pack OWNAPI(ippsHMAC_Pack) 259 #define ippsHMAC_Unpack OWNAPI(ippsHMAC_Unpack) 260 #define ippsHMAC_Duplicate OWNAPI(ippsHMAC_Duplicate) 261 #define ippsHMAC_Update OWNAPI(ippsHMAC_Update) 262 #define ippsHMAC_Final OWNAPI(ippsHMAC_Final) 263 #define ippsHMAC_GetTag OWNAPI(ippsHMAC_GetTag) 264 #define ippsHMAC_Message OWNAPI(ippsHMAC_Message) 265 #define ippsHMACGetSize_rmf OWNAPI(ippsHMACGetSize_rmf) 266 #define ippsHMACInit_rmf OWNAPI(ippsHMACInit_rmf) 267 #define ippsHMACPack_rmf OWNAPI(ippsHMACPack_rmf) 268 #define ippsHMACUnpack_rmf OWNAPI(ippsHMACUnpack_rmf) 269 #define ippsHMACDuplicate_rmf OWNAPI(ippsHMACDuplicate_rmf) 270 #define ippsHMACUpdate_rmf OWNAPI(ippsHMACUpdate_rmf) 271 #define ippsHMACFinal_rmf OWNAPI(ippsHMACFinal_rmf) 272 #define ippsHMACGetTag_rmf OWNAPI(ippsHMACGetTag_rmf) 273 #define ippsHMACMessage_rmf OWNAPI(ippsHMACMessage_rmf) 274 #define ippsBigNumGetSize OWNAPI(ippsBigNumGetSize) 275 #define ippsBigNumInit OWNAPI(ippsBigNumInit) 276 #define ippsCmpZero_BN OWNAPI(ippsCmpZero_BN) 277 #define ippsCmp_BN OWNAPI(ippsCmp_BN) 278 #define ippsGetSize_BN OWNAPI(ippsGetSize_BN) 279 #define ippsSet_BN OWNAPI(ippsSet_BN) 280 #define ippsGet_BN OWNAPI(ippsGet_BN) 281 #define ippsRef_BN OWNAPI(ippsRef_BN) 282 #define ippsExtGet_BN OWNAPI(ippsExtGet_BN) 283 #define ippsAdd_BN OWNAPI(ippsAdd_BN) 284 #define ippsSub_BN OWNAPI(ippsSub_BN) 285 #define ippsMul_BN OWNAPI(ippsMul_BN) 286 #define ippsMAC_BN_I OWNAPI(ippsMAC_BN_I) 287 #define ippsDiv_BN OWNAPI(ippsDiv_BN) 288 #define ippsMod_BN OWNAPI(ippsMod_BN) 289 #define ippsGcd_BN OWNAPI(ippsGcd_BN) 290 #define ippsModInv_BN OWNAPI(ippsModInv_BN) 291 #define ippsSetOctString_BN OWNAPI(ippsSetOctString_BN) 292 #define ippsGetOctString_BN OWNAPI(ippsGetOctString_BN) 293 #define ippsMontGetSize OWNAPI(ippsMontGetSize) 294 #define ippsMontInit OWNAPI(ippsMontInit) 295 #define ippsMontSet OWNAPI(ippsMontSet) 296 #define ippsMontGet OWNAPI(ippsMontGet) 297 #define ippsMontForm OWNAPI(ippsMontForm) 298 #define ippsMontMul OWNAPI(ippsMontMul) 299 #define ippsMontExp OWNAPI(ippsMontExp) 300 #define ippsPRNGGetSize OWNAPI(ippsPRNGGetSize) 301 #define ippsPRNGInit OWNAPI(ippsPRNGInit) 302 #define ippsPRNGSetModulus OWNAPI(ippsPRNGSetModulus) 303 #define ippsPRNGSetH0 OWNAPI(ippsPRNGSetH0) 304 #define ippsPRNGSetAugment OWNAPI(ippsPRNGSetAugment) 305 #define ippsPRNGSetSeed OWNAPI(ippsPRNGSetSeed) 306 #define ippsPRNGGetSeed OWNAPI(ippsPRNGGetSeed) 307 #define ippsPRNGen OWNAPI(ippsPRNGen) 308 #define ippsPRNGen_BN OWNAPI(ippsPRNGen_BN) 309 #define ippsPRNGenRDRAND OWNAPI(ippsPRNGenRDRAND) 310 #define ippsPRNGenRDRAND_BN OWNAPI(ippsPRNGenRDRAND_BN) 311 #define ippsTRNGenRDSEED OWNAPI(ippsTRNGenRDSEED) 312 #define ippsTRNGenRDSEED_BN OWNAPI(ippsTRNGenRDSEED_BN) 313 #define ippsPrimeGetSize OWNAPI(ippsPrimeGetSize) 314 #define ippsPrimeInit OWNAPI(ippsPrimeInit) 315 #define ippsPrimeGen OWNAPI(ippsPrimeGen) 316 #define ippsPrimeTest OWNAPI(ippsPrimeTest) 317 #define ippsPrimeGen_BN OWNAPI(ippsPrimeGen_BN) 318 #define ippsPrimeTest_BN OWNAPI(ippsPrimeTest_BN) 319 #define ippsPrimeGet OWNAPI(ippsPrimeGet) 320 #define ippsPrimeGet_BN OWNAPI(ippsPrimeGet_BN) 321 #define ippsPrimeSet OWNAPI(ippsPrimeSet) 322 #define ippsPrimeSet_BN OWNAPI(ippsPrimeSet_BN) 323 #define ippsRSA_GetSizePublicKey OWNAPI(ippsRSA_GetSizePublicKey) 324 #define ippsRSA_InitPublicKey OWNAPI(ippsRSA_InitPublicKey) 325 #define ippsRSA_SetPublicKey OWNAPI(ippsRSA_SetPublicKey) 326 #define ippsRSA_GetPublicKey OWNAPI(ippsRSA_GetPublicKey) 327 #define ippsRSA_GetSizePrivateKeyType1 OWNAPI(ippsRSA_GetSizePrivateKeyType1) 328 #define ippsRSA_InitPrivateKeyType1 OWNAPI(ippsRSA_InitPrivateKeyType1) 329 #define ippsRSA_SetPrivateKeyType1 OWNAPI(ippsRSA_SetPrivateKeyType1) 330 #define ippsRSA_GetPrivateKeyType1 OWNAPI(ippsRSA_GetPrivateKeyType1) 331 #define ippsRSA_GetSizePrivateKeyType2 OWNAPI(ippsRSA_GetSizePrivateKeyType2) 332 #define ippsRSA_InitPrivateKeyType2 OWNAPI(ippsRSA_InitPrivateKeyType2) 333 #define ippsRSA_SetPrivateKeyType2 OWNAPI(ippsRSA_SetPrivateKeyType2) 334 #define ippsRSA_GetPrivateKeyType2 OWNAPI(ippsRSA_GetPrivateKeyType2) 335 #define ippsRSA_GetBufferSizePublicKey OWNAPI(ippsRSA_GetBufferSizePublicKey) 336 #define ippsRSA_GetBufferSizePrivateKey OWNAPI(ippsRSA_GetBufferSizePrivateKey) 337 #define ippsRSA_Encrypt OWNAPI(ippsRSA_Encrypt) 338 #define ippsRSA_Decrypt OWNAPI(ippsRSA_Decrypt) 339 #define ippsRSA_GenerateKeys OWNAPI(ippsRSA_GenerateKeys) 340 #define ippsRSA_ValidateKeys OWNAPI(ippsRSA_ValidateKeys) 341 #define ippsRSAEncrypt_OAEP OWNAPI(ippsRSAEncrypt_OAEP) 342 #define ippsRSADecrypt_OAEP OWNAPI(ippsRSADecrypt_OAEP) 343 #define ippsRSAEncrypt_OAEP_rmf OWNAPI(ippsRSAEncrypt_OAEP_rmf) 344 #define ippsRSADecrypt_OAEP_rmf OWNAPI(ippsRSADecrypt_OAEP_rmf) 345 #define ippsRSAEncrypt_PKCSv15 OWNAPI(ippsRSAEncrypt_PKCSv15) 346 #define ippsRSADecrypt_PKCSv15 OWNAPI(ippsRSADecrypt_PKCSv15) 347 #define ippsRSASign_PSS OWNAPI(ippsRSASign_PSS) 348 #define ippsRSAVerify_PSS OWNAPI(ippsRSAVerify_PSS) 349 #define ippsRSASign_PSS_rmf OWNAPI(ippsRSASign_PSS_rmf) 350 #define ippsRSAVerify_PSS_rmf OWNAPI(ippsRSAVerify_PSS_rmf) 351 #define ippsRSASign_PKCS1v15 OWNAPI(ippsRSASign_PKCS1v15) 352 #define ippsRSAVerify_PKCS1v15 OWNAPI(ippsRSAVerify_PKCS1v15) 353 #define ippsRSASign_PKCS1v15_rmf OWNAPI(ippsRSASign_PKCS1v15_rmf) 354 #define ippsRSAVerify_PKCS1v15_rmf OWNAPI(ippsRSAVerify_PKCS1v15_rmf) 355 #define ippsDLGetResultString OWNAPI(ippsDLGetResultString) 356 #define ippsDLPGetSize OWNAPI(ippsDLPGetSize) 357 #define ippsDLPInit OWNAPI(ippsDLPInit) 358 #define ippsDLPPack OWNAPI(ippsDLPPack) 359 #define ippsDLPUnpack OWNAPI(ippsDLPUnpack) 360 #define ippsDLPSet OWNAPI(ippsDLPSet) 361 #define ippsDLPGet OWNAPI(ippsDLPGet) 362 #define ippsDLPSetDP OWNAPI(ippsDLPSetDP) 363 #define ippsDLPGetDP OWNAPI(ippsDLPGetDP) 364 #define ippsDLPGenKeyPair OWNAPI(ippsDLPGenKeyPair) 365 #define ippsDLPPublicKey OWNAPI(ippsDLPPublicKey) 366 #define ippsDLPValidateKeyPair OWNAPI(ippsDLPValidateKeyPair) 367 #define ippsDLPSetKeyPair OWNAPI(ippsDLPSetKeyPair) 368 #define ippsDLPSignDSA OWNAPI(ippsDLPSignDSA) 369 #define ippsDLPVerifyDSA OWNAPI(ippsDLPVerifyDSA) 370 #define ippsDLPSharedSecretDH OWNAPI(ippsDLPSharedSecretDH) 371 #define ippsDLPGenerateDSA OWNAPI(ippsDLPGenerateDSA) 372 #define ippsDLPValidateDSA OWNAPI(ippsDLPValidateDSA) 373 #define ippsDLPGenerateDH OWNAPI(ippsDLPGenerateDH) 374 #define ippsDLPValidateDH OWNAPI(ippsDLPValidateDH) 375 #define ippsECCGetResultString OWNAPI(ippsECCGetResultString) 376 #define ippsECCPGetSize OWNAPI(ippsECCPGetSize) 377 #define ippsECCPGetSizeStd128r1 OWNAPI(ippsECCPGetSizeStd128r1) 378 #define ippsECCPGetSizeStd128r2 OWNAPI(ippsECCPGetSizeStd128r2) 379 #define ippsECCPGetSizeStd192r1 OWNAPI(ippsECCPGetSizeStd192r1) 380 #define ippsECCPGetSizeStd224r1 OWNAPI(ippsECCPGetSizeStd224r1) 381 #define ippsECCPGetSizeStd256r1 OWNAPI(ippsECCPGetSizeStd256r1) 382 #define ippsECCPGetSizeStd384r1 OWNAPI(ippsECCPGetSizeStd384r1) 383 #define ippsECCPGetSizeStd521r1 OWNAPI(ippsECCPGetSizeStd521r1) 384 #define ippsECCPGetSizeStdSM2 OWNAPI(ippsECCPGetSizeStdSM2) 385 #define ippsECCPInit OWNAPI(ippsECCPInit) 386 #define ippsECCPInitStd128r1 OWNAPI(ippsECCPInitStd128r1) 387 #define ippsECCPInitStd128r2 OWNAPI(ippsECCPInitStd128r2) 388 #define ippsECCPInitStd192r1 OWNAPI(ippsECCPInitStd192r1) 389 #define ippsECCPInitStd224r1 OWNAPI(ippsECCPInitStd224r1) 390 #define ippsECCPInitStd256r1 OWNAPI(ippsECCPInitStd256r1) 391 #define ippsECCPInitStd384r1 OWNAPI(ippsECCPInitStd384r1) 392 #define ippsECCPInitStd521r1 OWNAPI(ippsECCPInitStd521r1) 393 #define ippsECCPInitStdSM2 OWNAPI(ippsECCPInitStdSM2) 394 #define ippsECCPSet OWNAPI(ippsECCPSet) 395 #define ippsECCPSetStd OWNAPI(ippsECCPSetStd) 396 #define ippsECCPSetStd128r1 OWNAPI(ippsECCPSetStd128r1) 397 #define ippsECCPSetStd128r2 OWNAPI(ippsECCPSetStd128r2) 398 #define ippsECCPSetStd192r1 OWNAPI(ippsECCPSetStd192r1) 399 #define ippsECCPSetStd224r1 OWNAPI(ippsECCPSetStd224r1) 400 #define ippsECCPSetStd256r1 OWNAPI(ippsECCPSetStd256r1) 401 #define ippsECCPSetStd384r1 OWNAPI(ippsECCPSetStd384r1) 402 #define ippsECCPSetStd521r1 OWNAPI(ippsECCPSetStd521r1) 403 #define ippsECCPSetStdSM2 OWNAPI(ippsECCPSetStdSM2) 404 #define ippsECCPBindGxyTblStd192r1 OWNAPI(ippsECCPBindGxyTblStd192r1) 405 #define ippsECCPBindGxyTblStd224r1 OWNAPI(ippsECCPBindGxyTblStd224r1) 406 #define ippsECCPBindGxyTblStd256r1 OWNAPI(ippsECCPBindGxyTblStd256r1) 407 #define ippsECCPBindGxyTblStd384r1 OWNAPI(ippsECCPBindGxyTblStd384r1) 408 #define ippsECCPBindGxyTblStd521r1 OWNAPI(ippsECCPBindGxyTblStd521r1) 409 #define ippsECCPBindGxyTblStdSM2 OWNAPI(ippsECCPBindGxyTblStdSM2) 410 #define ippsECCPGet OWNAPI(ippsECCPGet) 411 #define ippsECCPGetOrderBitSize OWNAPI(ippsECCPGetOrderBitSize) 412 #define ippsECCPValidate OWNAPI(ippsECCPValidate) 413 #define ippsECCPPointGetSize OWNAPI(ippsECCPPointGetSize) 414 #define ippsECCPPointInit OWNAPI(ippsECCPPointInit) 415 #define ippsECCPSetPoint OWNAPI(ippsECCPSetPoint) 416 #define ippsECCPSetPointAtInfinity OWNAPI(ippsECCPSetPointAtInfinity) 417 #define ippsECCPGetPoint OWNAPI(ippsECCPGetPoint) 418 #define ippsECCPCheckPoint OWNAPI(ippsECCPCheckPoint) 419 #define ippsECCPComparePoint OWNAPI(ippsECCPComparePoint) 420 #define ippsECCPNegativePoint OWNAPI(ippsECCPNegativePoint) 421 #define ippsECCPAddPoint OWNAPI(ippsECCPAddPoint) 422 #define ippsECCPMulPointScalar OWNAPI(ippsECCPMulPointScalar) 423 #define ippsECCPGenKeyPair OWNAPI(ippsECCPGenKeyPair) 424 #define ippsECCPPublicKey OWNAPI(ippsECCPPublicKey) 425 #define ippsECCPValidateKeyPair OWNAPI(ippsECCPValidateKeyPair) 426 #define ippsECCPSetKeyPair OWNAPI(ippsECCPSetKeyPair) 427 #define ippsECCPSharedSecretDH OWNAPI(ippsECCPSharedSecretDH) 428 #define ippsECCPSharedSecretDHC OWNAPI(ippsECCPSharedSecretDHC) 429 #define ippsECCPSignDSA OWNAPI(ippsECCPSignDSA) 430 #define ippsECCPVerifyDSA OWNAPI(ippsECCPVerifyDSA) 431 #define ippsECCPSignNR OWNAPI(ippsECCPSignNR) 432 #define ippsECCPVerifyNR OWNAPI(ippsECCPVerifyNR) 433 #define ippsECCPSignSM2 OWNAPI(ippsECCPSignSM2) 434 #define ippsECCPVerifySM2 OWNAPI(ippsECCPVerifySM2) 435 #define ippsGFpGetSize OWNAPI(ippsGFpGetSize) 436 #define ippsGFpInitArbitrary OWNAPI(ippsGFpInitArbitrary) 437 #define ippsGFpInitFixed OWNAPI(ippsGFpInitFixed) 438 #define ippsGFpInit OWNAPI(ippsGFpInit) 439 #define ippsGFpMethod_p192r1 OWNAPI(ippsGFpMethod_p192r1) 440 #define ippsGFpMethod_p224r1 OWNAPI(ippsGFpMethod_p224r1) 441 #define ippsGFpMethod_p256r1 OWNAPI(ippsGFpMethod_p256r1) 442 #define ippsGFpMethod_p384r1 OWNAPI(ippsGFpMethod_p384r1) 443 #define ippsGFpMethod_p521r1 OWNAPI(ippsGFpMethod_p521r1) 444 #define ippsGFpMethod_p256sm2 OWNAPI(ippsGFpMethod_p256sm2) 445 #define ippsGFpMethod_p256bn OWNAPI(ippsGFpMethod_p256bn) 446 #define ippsGFpMethod_p256 OWNAPI(ippsGFpMethod_p256) 447 #define ippsGFpMethod_pArb OWNAPI(ippsGFpMethod_pArb) 448 #define ippsGFpxGetSize OWNAPI(ippsGFpxGetSize) 449 #define ippsGFpxInit OWNAPI(ippsGFpxInit) 450 #define ippsGFpxInitBinomial OWNAPI(ippsGFpxInitBinomial) 451 #define ippsGFpxMethod_binom2_epid2 OWNAPI(ippsGFpxMethod_binom2_epid2) 452 #define ippsGFpxMethod_binom3_epid2 OWNAPI(ippsGFpxMethod_binom3_epid2) 453 #define ippsGFpxMethod_binom2 OWNAPI(ippsGFpxMethod_binom2) 454 #define ippsGFpxMethod_binom3 OWNAPI(ippsGFpxMethod_binom3) 455 #define ippsGFpxMethod_binom OWNAPI(ippsGFpxMethod_binom) 456 #define ippsGFpxMethod_com OWNAPI(ippsGFpxMethod_com) 457 #define ippsGFpScratchBufferSize OWNAPI(ippsGFpScratchBufferSize) 458 #define ippsGFpElementGetSize OWNAPI(ippsGFpElementGetSize) 459 #define ippsGFpElementInit OWNAPI(ippsGFpElementInit) 460 #define ippsGFpSetElement OWNAPI(ippsGFpSetElement) 461 #define ippsGFpSetElementRegular OWNAPI(ippsGFpSetElementRegular) 462 #define ippsGFpSetElementOctString OWNAPI(ippsGFpSetElementOctString) 463 #define ippsGFpSetElementRandom OWNAPI(ippsGFpSetElementRandom) 464 #define ippsGFpSetElementHash OWNAPI(ippsGFpSetElementHash) 465 #define ippsGFpSetElementHash_rmf OWNAPI(ippsGFpSetElementHash_rmf) 466 #define ippsGFpCpyElement OWNAPI(ippsGFpCpyElement) 467 #define ippsGFpGetElement OWNAPI(ippsGFpGetElement) 468 #define ippsGFpGetElementOctString OWNAPI(ippsGFpGetElementOctString) 469 #define ippsGFpCmpElement OWNAPI(ippsGFpCmpElement) 470 #define ippsGFpIsZeroElement OWNAPI(ippsGFpIsZeroElement) 471 #define ippsGFpIsUnityElement OWNAPI(ippsGFpIsUnityElement) 472 #define ippsGFpConj OWNAPI(ippsGFpConj) 473 #define ippsGFpNeg OWNAPI(ippsGFpNeg) 474 #define ippsGFpInv OWNAPI(ippsGFpInv) 475 #define ippsGFpSqrt OWNAPI(ippsGFpSqrt) 476 #define ippsGFpSqr OWNAPI(ippsGFpSqr) 477 #define ippsGFpAdd OWNAPI(ippsGFpAdd) 478 #define ippsGFpSub OWNAPI(ippsGFpSub) 479 #define ippsGFpMul OWNAPI(ippsGFpMul) 480 #define ippsGFpExp OWNAPI(ippsGFpExp) 481 #define ippsGFpMultiExp OWNAPI(ippsGFpMultiExp) 482 #define ippsGFpAdd_PE OWNAPI(ippsGFpAdd_PE) 483 #define ippsGFpSub_PE OWNAPI(ippsGFpSub_PE) 484 #define ippsGFpMul_PE OWNAPI(ippsGFpMul_PE) 485 #define ippsGFpECGetSize OWNAPI(ippsGFpECGetSize) 486 #define ippsGFpECInit OWNAPI(ippsGFpECInit) 487 #define ippsGFpECSet OWNAPI(ippsGFpECSet) 488 #define ippsGFpECSetSubgroup OWNAPI(ippsGFpECSetSubgroup) 489 #define ippsGFpECInitStd128r1 OWNAPI(ippsGFpECInitStd128r1) 490 #define ippsGFpECInitStd128r2 OWNAPI(ippsGFpECInitStd128r2) 491 #define ippsGFpECInitStd192r1 OWNAPI(ippsGFpECInitStd192r1) 492 #define ippsGFpECInitStd224r1 OWNAPI(ippsGFpECInitStd224r1) 493 #define ippsGFpECInitStd256r1 OWNAPI(ippsGFpECInitStd256r1) 494 #define ippsGFpECInitStd384r1 OWNAPI(ippsGFpECInitStd384r1) 495 #define ippsGFpECInitStd521r1 OWNAPI(ippsGFpECInitStd521r1) 496 #define ippsGFpECInitStdSM2 OWNAPI(ippsGFpECInitStdSM2) 497 #define ippsGFpECInitStdBN256 OWNAPI(ippsGFpECInitStdBN256) 498 #define ippsGFpECBindGxyTblStd192r1 OWNAPI(ippsGFpECBindGxyTblStd192r1) 499 #define ippsGFpECBindGxyTblStd224r1 OWNAPI(ippsGFpECBindGxyTblStd224r1) 500 #define ippsGFpECBindGxyTblStd256r1 OWNAPI(ippsGFpECBindGxyTblStd256r1) 501 #define ippsGFpECBindGxyTblStd384r1 OWNAPI(ippsGFpECBindGxyTblStd384r1) 502 #define ippsGFpECBindGxyTblStd521r1 OWNAPI(ippsGFpECBindGxyTblStd521r1) 503 #define ippsGFpECBindGxyTblStdSM2 OWNAPI(ippsGFpECBindGxyTblStdSM2) 504 #define ippsGFpECGet OWNAPI(ippsGFpECGet) 505 #define ippsGFpECGetSubgroup OWNAPI(ippsGFpECGetSubgroup) 506 #define ippsGFpECScratchBufferSize OWNAPI(ippsGFpECScratchBufferSize) 507 #define ippsGFpECVerify OWNAPI(ippsGFpECVerify) 508 #define ippsGFpECPointGetSize OWNAPI(ippsGFpECPointGetSize) 509 #define ippsGFpECPointInit OWNAPI(ippsGFpECPointInit) 510 #define ippsGFpECSetPointAtInfinity OWNAPI(ippsGFpECSetPointAtInfinity) 511 #define ippsGFpECSetPoint OWNAPI(ippsGFpECSetPoint) 512 #define ippsGFpECSetPointRegular OWNAPI(ippsGFpECSetPointRegular) 513 #define ippsGFpECSetPointRandom OWNAPI(ippsGFpECSetPointRandom) 514 #define ippsGFpECMakePoint OWNAPI(ippsGFpECMakePoint) 515 #define ippsGFpECSetPointHash OWNAPI(ippsGFpECSetPointHash) 516 #define ippsGFpECSetPointHash_rmf OWNAPI(ippsGFpECSetPointHash_rmf) 517 #define ippsGFpECGetPoint OWNAPI(ippsGFpECGetPoint) 518 #define ippsGFpECGetPointRegular OWNAPI(ippsGFpECGetPointRegular) 519 #define ippsGFpECSetPointOctString OWNAPI(ippsGFpECSetPointOctString) 520 #define ippsGFpECGetPointOctString OWNAPI(ippsGFpECGetPointOctString) 521 #define ippsGFpECTstPoint OWNAPI(ippsGFpECTstPoint) 522 #define ippsGFpECTstPointInSubgroup OWNAPI(ippsGFpECTstPointInSubgroup) 523 #define ippsGFpECCpyPoint OWNAPI(ippsGFpECCpyPoint) 524 #define ippsGFpECCmpPoint OWNAPI(ippsGFpECCmpPoint) 525 #define ippsGFpECNegPoint OWNAPI(ippsGFpECNegPoint) 526 #define ippsGFpECAddPoint OWNAPI(ippsGFpECAddPoint) 527 #define ippsGFpECMulPoint OWNAPI(ippsGFpECMulPoint) 528 #define ippsGFpECPrivateKey OWNAPI(ippsGFpECPrivateKey) 529 #define ippsGFpECPublicKey OWNAPI(ippsGFpECPublicKey) 530 #define ippsGFpECTstKeyPair OWNAPI(ippsGFpECTstKeyPair) 531 #define ippsGFpECSharedSecretDH OWNAPI(ippsGFpECSharedSecretDH) 532 #define ippsGFpECSharedSecretDHC OWNAPI(ippsGFpECSharedSecretDHC) 533 #define ippsGFpECSignDSA OWNAPI(ippsGFpECSignDSA) 534 #define ippsGFpECVerifyDSA OWNAPI(ippsGFpECVerifyDSA) 535 #define ippsGFpECSignNR OWNAPI(ippsGFpECSignNR) 536 #define ippsGFpECVerifyNR OWNAPI(ippsGFpECVerifyNR) 537 #define ippsGFpECSignSM2 OWNAPI(ippsGFpECSignSM2) 538 #define ippsGFpECVerifySM2 OWNAPI(ippsGFpECVerifySM2) 539 #define ippsGFpECESGetSize_SM2 OWNAPI(ippsGFpECESGetSize_SM2) 540 #define ippsGFpECESInit_SM2 OWNAPI(ippsGFpECESInit_SM2) 541 #define ippsGFpECESSetKey_SM2 OWNAPI(ippsGFpECESSetKey_SM2) 542 #define ippsGFpECESStart_SM2 OWNAPI(ippsGFpECESStart_SM2) 543 #define ippsGFpECESEncrypt_SM2 OWNAPI(ippsGFpECESEncrypt_SM2) 544 #define ippsGFpECESDecrypt_SM2 OWNAPI(ippsGFpECESDecrypt_SM2) 545 #define ippsGFpECESFinal_SM2 OWNAPI(ippsGFpECESFinal_SM2) 546 #define ippsGFpECESGetBuffersSize_SM2 OWNAPI(ippsGFpECESGetBuffersSize_SM2) 547 548 #include "ippcp.h" 549 #endif 550 551 /* 552 // modes of the CPU feature 553 */ 554 #define _FEATURE_OFF_ (0) /* feature is OFF a priori */ 555 #define _FEATURE_ON_ (1) /* feature is ON a priori */ 556 #define _FEATURE_TICKTOCK_ (2) /* dectect is feature OFF/ON */ 557 558 #include "pcpvariant.h" 559 560 #pragma warning( disable : 4996 4324 4206) 561 562 /* ippCP length */ 563 typedef int cpSize; 564 565 /* 566 // Common ippCP Macros 567 */ 568 569 /* size of cache line (bytes) */ 570 #if (_IPP==_IPP_M5) 571 #define CACHE_LINE_SIZE (16) 572 #define LOG_CACHE_LINE_SIZE (4) 573 #else 574 #define CACHE_LINE_SIZE (64) 575 #define LOG_CACHE_LINE_SIZE (6) 576 #endif 577 578 /* swap data & pointers */ 579 #define SWAP_PTR(ATYPE, pX,pY) { ATYPE* aPtr=(pX); (pX)=(pY); (pY)=aPtr; } 580 #define SWAP(x,y) {(x)^=(y); (y)^=(x); (x)^=(y);} 581 582 /* alignment value */ 583 #define ALIGN_VAL ((int)sizeof(void*)) 584 585 /* bitsize */ 586 #define BYTESIZE (8) 587 #define BITSIZE(x) ((int)(sizeof(x)*BYTESIZE)) 588 589 /* bit length -> byte/word length conversion */ 590 #define BITS2WORD8_SIZE(x) (((x)+ 7)>>3) 591 #define BITS2WORD16_SIZE(x) (((x)+15)>>4) 592 #define BITS2WORD32_SIZE(x) (((x)+31)>>5) 593 #define BITS2WORD64_SIZE(x) (((x)+63)>>6) 594 595 /* WORD and DWORD manipulators */ 596 #define LODWORD(x) ((Ipp32u)(x)) 597 #define HIDWORD(x) ((Ipp32u)(((Ipp64u)(x) >>32) & 0xFFFFFFFF)) 598 599 #define MAKEHWORD(bLo,bHi) ((Ipp16u)(((Ipp8u)(bLo)) | ((Ipp16u)((Ipp8u)(bHi))) << 8)) 600 #define MAKEWORD(hLo,hHi) ((Ipp32u)(((Ipp16u)(hLo)) | ((Ipp32u)((Ipp16u)(hHi))) << 16)) 601 #define MAKEDWORD(wLo,wHi) ((Ipp64u)(((Ipp32u)(wLo)) | ((Ipp64u)((Ipp32u)(wHi))) << 32)) 602 603 /* extract byte */ 604 #define EBYTE(w,n) ((Ipp8u)((w) >> (8 * (n)))) 605 606 /* hexString <-> Ipp32u conversion */ 607 #define HSTRING_TO_U32(ptrByte) \ 608 ((((ptrByte)[0]) <<24) \ 609 +(((ptrByte)[1]) <<16) \ 610 +(((ptrByte)[2]) <<8) \ 611 +((ptrByte)[3])) 612 #define U32_TO_HSTRING(ptrByte, x) \ 613 (ptrByte)[0] = (Ipp8u)((x)>>24); \ 614 (ptrByte)[1] = (Ipp8u)((x)>>16); \ 615 (ptrByte)[2] = (Ipp8u)((x)>>8); \ 616 (ptrByte)[3] = (Ipp8u)(x) 617 618 /* 32- and 64-bit masks for MSB of nbits-sequence */ 619 #define MAKEMASK32(nbits) (0xFFFFFFFF >>((32 - ((nbits)&0x1F)) &0x1F)) 620 #define MAKEMASK64(nbits) (0xFFFFFFFFFFFFFFFF >>((64 - ((nbits)&0x3F)) &0x3F)) 621 622 /* Logical Shifts (right and left) of WORD */ 623 #define LSR32(x,nBits) ((x)>>(nBits)) 624 #define LSL32(x,nBits) ((x)<<(nBits)) 625 626 /* Rorate (right and left) of WORD */ 627 #if defined(_MSC_VER) && !defined( __ICL ) 628 # include <stdlib.h> 629 # define ROR32(x, nBits) _lrotr((x),(nBits)) 630 # define ROL32(x, nBits) _lrotl((x),(nBits)) 631 #else 632 # define ROR32(x, nBits) (LSR32((x),(nBits)) | LSL32((x),32-(nBits))) 633 # define ROL32(x, nBits) ROR32((x),(32-(nBits))) 634 #endif 635 636 /* Logical Shifts (right and left) of DWORD */ 637 #define LSR64(x,nBits) ((x)>>(nBits)) 638 #define LSL64(x,nBits) ((x)<<(nBits)) 639 640 /* Rorate (right and left) of DWORD */ 641 #define ROR64(x, nBits) (LSR64((x),(nBits)) | LSL64((x),64-(nBits))) 642 #define ROL64(x, nBits) ROR64((x),(64-(nBits))) 643 644 /* change endian */ 645 #if defined(_MSC_VER) 646 # define ENDIANNESS(x) _byteswap_ulong((x)) 647 # define ENDIANNESS32(x) ENDIANNESS((x)) 648 # define ENDIANNESS64(x) _byteswap_uint64((x)) 649 #elif defined(__ICL) 650 # define ENDIANNESS(x) _bswap((x)) 651 # define ENDIANNESS32(x) ENDIANNESS((x)) 652 # define ENDIANNESS64(x) _bswap64((x)) 653 #else 654 # define ENDIANNESS(x) ((ROR32((x), 24) & 0x00ff00ff) | (ROR32((x), 8) & 0xff00ff00)) 655 # define ENDIANNESS32(x) ENDIANNESS((x)) 656 # define ENDIANNESS64(x) MAKEDWORD(ENDIANNESS(HIDWORD((x))), ENDIANNESS(LODWORD((x)))) 657 #endif 658 659 #define IPP_MAKE_MULTIPLE_OF_8(x) ((x) = ((x)+7)&(~7)) 660 #define IPP_MAKE_MULTIPLE_OF_16(x) ((x) = ((x)+15)&(~15)) 661 662 /* define 64-bit constant */ 663 #if !defined(__GNUC__) 664 #define CONST_64(x) (x) /*(x##i64)*/ 665 #else 666 #define CONST_64(x) (x##LL) 667 #endif 668 669 /* define 64-bit constant or pair of 32-bit dependding on architecture */ 670 #if ((_IPP_ARCH == _IPP_ARCH_EM64T) || (_IPP_ARCH == _IPP_ARCH_LP64) || (_IPP_ARCH == _IPP_ARCH_LRB) || (_IPP_ARCH == _IPP_ARCH_LRB2)) 671 #define LL(lo,hi) ((Ipp64u)(((Ipp32u)(lo)) | ((Ipp64u)((Ipp32u)(hi))) << 32)) 672 #define L_(lo) ((Ipp64u)(lo)) 673 #else 674 #define LL(lo,hi) (lo),(hi) 675 #define L_(lo) (lo) 676 #endif 677 678 679 /* test if library's feature is ON */ 680 int cpGetFeature( Ipp64u Feature ); 681 /* test CPU crypto features */ 682 __INLINE Ipp32u IsFeatureEnabled(Ipp64u niMmask) 683 { 684 return cpGetFeature(niMmask); 685 } 686 687 #define IPPCP_GET_NUM_THREADS() ( ippcpGetEnabledNumThreads() ) 688 #define IPPCP_OMP_NUM_THREADS() num_threads( IPPCP_GET_NUM_THREADS() ) 689 #define IPPCP_OMP_LIMIT_MAX_NUM_THREADS(n) num_threads( IPP_MIN(IPPCP_GET_NUM_THREADS(),(n))) 690 691 /* copy under mask */ 692 #define MASKED_COPY_BNU(dst, mask, src1, src2, len) { \ 693 cpSize i; \ 694 for(i=0; i<(len); i++) (dst)[i] = ((mask) & (src1)[i]) | (~(mask) & (src2)[i]); \ 695 } 696 697 #if !defined( _M_X64 ) && defined ( _MSC_VER ) && !defined(__INTEL_COMPILER) 698 #if (_AES_NI_ENABLING_ == _FEATURE_ON_) || \ 699 (_AES_NI_ENABLING_ == _FEATURE_TICKTOCK_) || (_IPP >= _IPP_W7) 700 __inline __m128i 701 _mm_cvtsi64_si128(__int64 a) 702 { 703 __m128i x; 704 x.m128i_i64[0] = a; 705 x.m128i_i64[1] = 0; 706 return x; 707 } 708 #endif 709 #endif 710 711 #endif /* __OWNCP_H__ */ 712