1 /* SPDX-License-Identifier: BSD-3-Clause */ 2 /* Copyright(c) 2007-2022 Intel Corporation */ 3 /* $FreeBSD$ */ 4 /** 5 ***************************************************************************** 6 * 7 * @file lac_stubs.c 8 * 9 * @defgroup kernel stubs 10 * 11 * All PKE and KPT API won't be supported in kernel API 12 * 13 *****************************************************************************/ 14 15 /* 16 ******************************************************************************* 17 * Include public/global header files 18 ******************************************************************************* 19 */ 20 21 /* API Includes */ 22 #include "cpa.h" 23 #include "cpa_cy_dh.h" 24 #include "cpa_cy_dsa.h" 25 #include "cpa_cy_ecdh.h" 26 #include "cpa_cy_ecdsa.h" 27 #include "cpa_cy_ec.h" 28 #include "cpa_cy_prime.h" 29 #include "cpa_cy_rsa.h" 30 #include "cpa_cy_ln.h" 31 #include "cpa_dc.h" 32 #include "cpa_dc_chain.h" 33 #include "cpa_cy_ecsm2.h" 34 #include "cpa_cy_kpt.h" 35 #include "icp_accel_devices.h" 36 #include "icp_adf_init.h" 37 #include "icp_adf_transport.h" 38 #include "icp_sal_poll.h" 39 #include "cpa_cy_sym.h" 40 #include "cpa_cy_sym_dp.h" 41 #include "cpa_cy_key.h" 42 #include "cpa_cy_common.h" 43 #include "cpa_cy_im.h" 44 #include "icp_sal_user.h" 45 46 /* Diffie Hellman */ 47 CpaStatus 48 cpaCyDhKeyGenPhase1(const CpaInstanceHandle instanceHandle, 49 const CpaCyGenFlatBufCbFunc pDhPhase1Cb, 50 void *pCallbackTag, 51 const CpaCyDhPhase1KeyGenOpData *pPhase1KeyGenData, 52 CpaFlatBuffer *pLocalOctetStringPV) 53 { 54 return CPA_STATUS_UNSUPPORTED; 55 } 56 57 CpaStatus 58 cpaCyDhKeyGenPhase2Secret( 59 const CpaInstanceHandle instanceHandle, 60 const CpaCyGenFlatBufCbFunc pDhPhase2Cb, 61 void *pCallbackTag, 62 const CpaCyDhPhase2SecretKeyGenOpData *pPhase2SecretKeyGenData, 63 CpaFlatBuffer *pOctetStringSecretKey) 64 { 65 return CPA_STATUS_UNSUPPORTED; 66 } 67 68 CpaStatus 69 cpaCyDhQueryStats64(const CpaInstanceHandle instanceHandle, 70 CpaCyDhStats64 *pDhStats) 71 { 72 return CPA_STATUS_UNSUPPORTED; 73 } 74 75 CpaStatus 76 cpaCyDhQueryStats(const CpaInstanceHandle instanceHandle, 77 CpaCyDhStats *pDhStats) 78 { 79 return CPA_STATUS_UNSUPPORTED; 80 } 81 82 /* DSA */ 83 CpaStatus 84 cpaCyDsaGenPParam(const CpaInstanceHandle instanceHandle, 85 const CpaCyDsaGenCbFunc pCb, 86 void *pCallbackTag, 87 const CpaCyDsaPParamGenOpData *pOpData, 88 CpaBoolean *pProtocolStatus, 89 CpaFlatBuffer *pP) 90 { 91 return CPA_STATUS_UNSUPPORTED; 92 } 93 94 CpaStatus 95 cpaCyDsaGenGParam(const CpaInstanceHandle instanceHandle, 96 const CpaCyDsaGenCbFunc pCb, 97 void *pCallbackTag, 98 const CpaCyDsaGParamGenOpData *pOpData, 99 CpaBoolean *pProtocolStatus, 100 CpaFlatBuffer *pG) 101 { 102 return CPA_STATUS_UNSUPPORTED; 103 } 104 105 CpaStatus 106 cpaCyDsaGenYParam(const CpaInstanceHandle instanceHandle, 107 const CpaCyDsaGenCbFunc pCb, 108 void *pCallbackTag, 109 const CpaCyDsaYParamGenOpData *pOpData, 110 CpaBoolean *pProtocolStatus, 111 CpaFlatBuffer *pY) 112 { 113 return CPA_STATUS_UNSUPPORTED; 114 } 115 116 CpaStatus 117 cpaCyDsaSignR(const CpaInstanceHandle instanceHandle, 118 const CpaCyDsaGenCbFunc pCb, 119 void *pCallbackTag, 120 const CpaCyDsaRSignOpData *pOpData, 121 CpaBoolean *pProtocolStatus, 122 CpaFlatBuffer *pR) 123 { 124 return CPA_STATUS_UNSUPPORTED; 125 } 126 127 CpaStatus 128 cpaCyDsaSignS(const CpaInstanceHandle instanceHandle, 129 const CpaCyDsaGenCbFunc pCb, 130 void *pCallbackTag, 131 const CpaCyDsaSSignOpData *pOpData, 132 CpaBoolean *pProtocolStatus, 133 CpaFlatBuffer *pS) 134 { 135 return CPA_STATUS_UNSUPPORTED; 136 } 137 138 CpaStatus 139 cpaCyDsaSignRS(const CpaInstanceHandle instanceHandle, 140 const CpaCyDsaRSSignCbFunc pCb, 141 void *pCallbackTag, 142 const CpaCyDsaRSSignOpData *pOpData, 143 CpaBoolean *pProtocolStatus, 144 CpaFlatBuffer *pR, 145 CpaFlatBuffer *pS) 146 { 147 return CPA_STATUS_UNSUPPORTED; 148 } 149 150 CpaStatus 151 cpaCyDsaVerify(const CpaInstanceHandle instanceHandle, 152 const CpaCyDsaVerifyCbFunc pCb, 153 void *pCallbackTag, 154 const CpaCyDsaVerifyOpData *pOpData, 155 CpaBoolean *pVerifyStatus) 156 { 157 return CPA_STATUS_UNSUPPORTED; 158 } 159 160 CpaStatus 161 cpaCyDsaQueryStats(const CpaInstanceHandle instanceHandle, 162 CpaCyDsaStats *pDsaStats) 163 { 164 return CPA_STATUS_UNSUPPORTED; 165 } 166 167 CpaStatus 168 cpaCyDsaQueryStats64(const CpaInstanceHandle instanceHandle, 169 CpaCyDsaStats64 *pDsaStats) 170 { 171 return CPA_STATUS_UNSUPPORTED; 172 } 173 174 /* ECDH */ 175 CpaStatus 176 cpaCyEcdhPointMultiply(const CpaInstanceHandle instanceHandle, 177 const CpaCyEcdhPointMultiplyCbFunc pCb, 178 void *pCallbackTag, 179 const CpaCyEcdhPointMultiplyOpData *pOpData, 180 CpaBoolean *pMultiplyStatus, 181 CpaFlatBuffer *pXk, 182 CpaFlatBuffer *pYk) 183 { 184 return CPA_STATUS_UNSUPPORTED; 185 } 186 187 CpaStatus 188 cpaCyEcdhQueryStats64(const CpaInstanceHandle instanceHandle, 189 CpaCyEcdhStats64 *pEcdhStats) 190 { 191 return CPA_STATUS_UNSUPPORTED; 192 } 193 194 /* ECDSA */ 195 CpaStatus 196 cpaCyEcdsaSignR(const CpaInstanceHandle instanceHandle, 197 const CpaCyEcdsaGenSignCbFunc pCb, 198 void *pCallbackTag, 199 const CpaCyEcdsaSignROpData *pOpData, 200 CpaBoolean *pSignStatus, 201 CpaFlatBuffer *pR) 202 { 203 return CPA_STATUS_UNSUPPORTED; 204 } 205 206 CpaStatus 207 cpaCyEcdsaSignS(const CpaInstanceHandle instanceHandle, 208 const CpaCyEcdsaGenSignCbFunc pCb, 209 void *pCallbackTag, 210 const CpaCyEcdsaSignSOpData *pOpData, 211 CpaBoolean *pSignStatus, 212 CpaFlatBuffer *pS) 213 { 214 return CPA_STATUS_UNSUPPORTED; 215 } 216 217 CpaStatus 218 cpaCyEcdsaSignRS(const CpaInstanceHandle instanceHandle, 219 const CpaCyEcdsaSignRSCbFunc pCb, 220 void *pCallbackTag, 221 const CpaCyEcdsaSignRSOpData *pOpData, 222 CpaBoolean *pSignStatus, 223 CpaFlatBuffer *pR, 224 CpaFlatBuffer *pS) 225 { 226 return CPA_STATUS_UNSUPPORTED; 227 } 228 229 CpaStatus 230 cpaCyEcdsaVerify(const CpaInstanceHandle instanceHandle, 231 const CpaCyEcdsaVerifyCbFunc pCb, 232 void *pCallbackTag, 233 const CpaCyEcdsaVerifyOpData *pOpData, 234 CpaBoolean *pVerifyStatus) 235 { 236 return CPA_STATUS_UNSUPPORTED; 237 } 238 239 CpaStatus 240 cpaCyEcdsaQueryStats64(const CpaInstanceHandle instanceHandle, 241 CpaCyEcdsaStats64 *pEcdsaStats) 242 { 243 return CPA_STATUS_UNSUPPORTED; 244 } 245 246 /* EC */ 247 CpaStatus 248 cpaCyEcPointMultiply(const CpaInstanceHandle instanceHandle, 249 const CpaCyEcPointMultiplyCbFunc pCb, 250 void *pCallbackTag, 251 const CpaCyEcPointMultiplyOpData *pOpData, 252 CpaBoolean *pMultiplyStatus, 253 CpaFlatBuffer *pXk, 254 CpaFlatBuffer *pYk) 255 { 256 return CPA_STATUS_UNSUPPORTED; 257 } 258 259 CpaStatus 260 cpaCyEcPointVerify(const CpaInstanceHandle instanceHandle, 261 const CpaCyEcPointVerifyCbFunc pCb, 262 void *pCallbackTag, 263 const CpaCyEcPointVerifyOpData *pOpData, 264 CpaBoolean *pVerifyStatus) 265 { 266 return CPA_STATUS_UNSUPPORTED; 267 } 268 269 CpaStatus 270 cpaCyEcQueryStats64(const CpaInstanceHandle instanceHandle, 271 CpaCyEcStats64 *pEcStats) 272 { 273 return CPA_STATUS_UNSUPPORTED; 274 } 275 276 CpaStatus 277 cpaCyEcMontEdwdsPointMultiply( 278 const CpaInstanceHandle instanceHandle, 279 const CpaCyEcPointMultiplyCbFunc pCb, 280 void *pCallbackTag, 281 const CpaCyEcMontEdwdsPointMultiplyOpData *pOpData, 282 CpaBoolean *pMultiplyStatus, 283 CpaFlatBuffer *pXk, 284 CpaFlatBuffer *pYk) 285 { 286 return CPA_STATUS_UNSUPPORTED; 287 } 288 289 CpaStatus 290 cpaCyEcGenericPointVerify(const CpaInstanceHandle instanceHandle, 291 const CpaCyEcPointVerifyCbFunc pCb, 292 void *pCallbackTag, 293 const CpaCyEcGenericPointVerifyOpData *pOpData, 294 CpaBoolean *pVerifyStatus) 295 { 296 return CPA_STATUS_UNSUPPORTED; 297 } 298 299 CpaStatus 300 cpaCyEcGenericPointMultiply(const CpaInstanceHandle instanceHandle, 301 const CpaCyEcPointMultiplyCbFunc pCb, 302 void *pCallbackTag, 303 const CpaCyEcGenericPointMultiplyOpData *pOpData, 304 CpaBoolean *pMultiplyStatus, 305 CpaFlatBuffer *pOutX, 306 CpaFlatBuffer *pOutY) 307 { 308 return CPA_STATUS_UNSUPPORTED; 309 } 310 311 CpaStatus 312 cpaCyEcsm2PointMultiply( 313 const CpaInstanceHandle instanceHandle_in, 314 const CpaCyEcPointMultiplyCbFunc pEcsm2PointMulCb, 315 void *pCallbackTag, 316 const CpaCyEcsm2PointMultiplyOpData *pEcsm2PointMulOpData, 317 CpaBoolean *pMultiplyStatus, 318 CpaFlatBuffer *pXk, 319 CpaFlatBuffer *pYk) 320 { 321 return CPA_STATUS_UNSUPPORTED; 322 } 323 324 CpaStatus 325 cpaCyEcsm2GeneratorMultiply( 326 const CpaInstanceHandle instanceHandle_in, 327 const CpaCyEcPointMultiplyCbFunc pEcsm2GenMulCb, 328 void *pCallbackTag, 329 const CpaCyEcsm2GeneratorMultiplyOpData *pEcsm2GenMulOpData, 330 CpaBoolean *pMultiplyStatus, 331 CpaFlatBuffer *pXk, 332 CpaFlatBuffer *pYk) 333 { 334 return CPA_STATUS_UNSUPPORTED; 335 } 336 337 CpaStatus 338 cpaCyEcsm2PointVerify( 339 const CpaInstanceHandle instanceHandle_in, 340 const CpaCyEcPointVerifyCbFunc pEcsm2PointVeirfyCb, 341 void *pCallbackTag, 342 const CpaCyEcsm2PointVerifyOpData *pEcsm2PointVerifyOpData, 343 CpaBoolean *pPointVerifyStatus) 344 { 345 return CPA_STATUS_UNSUPPORTED; 346 } 347 348 CpaStatus 349 cpaCyEcsm2Sign(const CpaInstanceHandle instanceHandle_in, 350 const CpaCyEcsm2SignCbFunc pEcsm2SignCb, 351 void *pCallbackTag, 352 const CpaCyEcsm2SignOpData *pEcsm2SignOpData, 353 CpaBoolean *pSignStatus, 354 CpaFlatBuffer *pR, 355 CpaFlatBuffer *pS) 356 { 357 return CPA_STATUS_UNSUPPORTED; 358 } 359 360 CpaStatus 361 cpaCyEcsm2Verify(const CpaInstanceHandle instanceHandle_in, 362 const CpaCyEcsm2VerifyCbFunc pEcsm2VerifyCb, 363 void *pCallbackTag, 364 const CpaCyEcsm2VerifyOpData *pEcsm2VerifyOpData, 365 CpaBoolean *pVerifyStatus) 366 { 367 return CPA_STATUS_UNSUPPORTED; 368 } 369 370 CpaStatus 371 cpaCyEcsm2Encrypt(const CpaInstanceHandle instanceHandle_in, 372 const CpaCyGenFlatBufCbFunc pEcsm2EncCb, 373 void *pCallbackTag, 374 const CpaCyEcsm2EncryptOpData *pEcsm2EncOpData, 375 CpaCyEcsm2EncryptOutputData *pEcsm2EncOutputData) 376 { 377 return CPA_STATUS_UNSUPPORTED; 378 } 379 380 CpaStatus 381 cpaCyEcsm2Decrypt(const CpaInstanceHandle instanceHandle_in, 382 const CpaCyGenFlatBufCbFunc pEcsm2DecCb, 383 void *pCallbackTag, 384 const CpaCyEcsm2DecryptOpData *pEcsm2DecOpData, 385 CpaCyEcsm2DecryptOutputData *pEcsm2DecOutputData) 386 { 387 return CPA_STATUS_UNSUPPORTED; 388 } 389 390 CpaStatus 391 cpaCyEcsm2KeyExPhase1( 392 const CpaInstanceHandle instanceHandle_in, 393 const CpaCyGenFlatBufCbFunc pEcsm2KeyExPhase1Cb, 394 void *pCallbackTag, 395 const CpaCyEcsm2KeyExPhase1OpData *pEcsm2KeyExPhase1OpData, 396 CpaCyEcsm2KeyExOutputData *pEcsm2KeyExPhase1OutputData) 397 { 398 return CPA_STATUS_UNSUPPORTED; 399 } 400 401 CpaStatus 402 cpaCyEcsm2KeyExPhase2( 403 const CpaInstanceHandle instanceHandle_in, 404 const CpaCyGenFlatBufCbFunc pEcsm2KeyExPhase2Cb, 405 void *pCallbackTag, 406 const CpaCyEcsm2KeyExPhase2OpData *pEcsm2KeyExPhase2OpData, 407 CpaCyEcsm2KeyExOutputData *pEcsm2KeyExPhase2OutputData) 408 { 409 return CPA_STATUS_UNSUPPORTED; 410 } 411 412 CpaStatus 413 cpaCyEcsm2QueryStats64(const CpaInstanceHandle instanceHandle_in, 414 CpaCyEcsm2Stats64 *pEcsm2Stats) 415 { 416 return CPA_STATUS_UNSUPPORTED; 417 } 418 419 CpaStatus 420 cpaCyKptEcdsaSignRS(const CpaInstanceHandle instanceHandle, 421 const CpaCyEcdsaSignRSCbFunc pCb, 422 void *pCallbackTag, 423 const CpaCyKptEcdsaSignRSOpData *pOpData, 424 CpaBoolean *pSignStatus, 425 CpaFlatBuffer *pR, 426 CpaFlatBuffer *pS, 427 CpaCyKptUnwrapContext *pKptUnwrapContext) 428 { 429 return CPA_STATUS_UNSUPPORTED; 430 } 431 432 CpaStatus 433 cpaCyKptRsaDecrypt(const CpaInstanceHandle instanceHandle, 434 const CpaCyGenFlatBufCbFunc pRsaDecryptCb, 435 void *pCallbackTag, 436 const CpaCyKptRsaDecryptOpData *pDecryptOpData, 437 CpaFlatBuffer *pOutputData, 438 CpaCyKptUnwrapContext *pKptUnwrapContext) 439 440 { 441 return CPA_STATUS_UNSUPPORTED; 442 } 443 444 CpaStatus 445 cpaCyKptQueryIssuingKeys(const CpaInstanceHandle instanceHandle_in, 446 CpaFlatBuffer *pPublicX509IssueCert, 447 CpaCyKptKeyManagementStatus *pKptStatus) 448 { 449 return CPA_STATUS_UNSUPPORTED; 450 } 451 452 CpaStatus 453 cpaCyKptQueryDeviceCredentials(const CpaInstanceHandle instanceHandle, 454 CpaCyKptValidationKey *pDevCredential, 455 CpaCyKptKeyManagementStatus *pKptStatus) 456 { 457 return CPA_STATUS_UNSUPPORTED; 458 } 459 460 CpaStatus 461 cpaCyKptLoadKey(CpaInstanceHandle instanceHandle, 462 CpaCyKptLoadKey *pSWK, 463 CpaCyKptHandle *keyHandle, 464 CpaCyKptKeyManagementStatus *pKptStatus) 465 { 466 return CPA_STATUS_UNSUPPORTED; 467 } 468 469 CpaStatus 470 cpaCyKptDeleteKey(CpaInstanceHandle instanceHandle, 471 CpaCyKptHandle keyHandle, 472 CpaCyKptKeyManagementStatus *pKptStatus) 473 { 474 return CPA_STATUS_UNSUPPORTED; 475 } 476 477 /* Prime */ 478 CpaStatus 479 cpaCyPrimeTest(const CpaInstanceHandle instanceHandle, 480 const CpaCyPrimeTestCbFunc pCb, 481 void *pCallbackTag, 482 const CpaCyPrimeTestOpData *pOpData, 483 CpaBoolean *pTestPassed) 484 { 485 return CPA_STATUS_UNSUPPORTED; 486 } 487 488 CpaStatus 489 cpaCyPrimeQueryStats64(const CpaInstanceHandle instanceHandle, 490 CpaCyPrimeStats64 *pPrimeStats) 491 { 492 return CPA_STATUS_UNSUPPORTED; 493 } 494 495 CpaStatus 496 cpaCyPrimeQueryStats(const CpaInstanceHandle instanceHandle, 497 CpaCyPrimeStats *pPrimeStats) 498 { 499 return CPA_STATUS_UNSUPPORTED; 500 } 501 502 /* RSA */ 503 CpaStatus 504 cpaCyRsaGenKey(const CpaInstanceHandle instanceHandle, 505 const CpaCyRsaKeyGenCbFunc pRsaKeyGenCb, 506 void *pCallbackTag, 507 const CpaCyRsaKeyGenOpData *pKeyGenOpData, 508 CpaCyRsaPrivateKey *pPrivateKey, 509 CpaCyRsaPublicKey *pPublicKey) 510 { 511 return CPA_STATUS_UNSUPPORTED; 512 } 513 514 CpaStatus 515 cpaCyRsaEncrypt(const CpaInstanceHandle instanceHandle, 516 const CpaCyGenFlatBufCbFunc pRsaEncryptCb, 517 void *pCallbackTag, 518 const CpaCyRsaEncryptOpData *pEncryptOpData, 519 CpaFlatBuffer *pOutputData) 520 { 521 return CPA_STATUS_UNSUPPORTED; 522 } 523 524 CpaStatus 525 cpaCyRsaDecrypt(const CpaInstanceHandle instanceHandle, 526 const CpaCyGenFlatBufCbFunc pRsaDecryptCb, 527 void *pCallbackTag, 528 const CpaCyRsaDecryptOpData *pDecryptOpData, 529 CpaFlatBuffer *pOutputData) 530 { 531 return CPA_STATUS_UNSUPPORTED; 532 } 533 534 CpaStatus 535 cpaCyRsaQueryStats64(const CpaInstanceHandle instanceHandle, 536 CpaCyRsaStats64 *pRsaStats) 537 { 538 return CPA_STATUS_UNSUPPORTED; 539 } 540 541 CpaStatus 542 cpaCyRsaQueryStats(const CpaInstanceHandle instanceHandle, 543 CpaCyRsaStats *pRsaStats) 544 { 545 return CPA_STATUS_UNSUPPORTED; 546 } 547 548 /* Large Number */ 549 CpaStatus 550 cpaCyLnModExp(const CpaInstanceHandle instanceHandle, 551 const CpaCyGenFlatBufCbFunc pLnModExpCb, 552 void *pCallbackTag, 553 const CpaCyLnModExpOpData *pLnModExpOpData, 554 CpaFlatBuffer *pResult) 555 { 556 return CPA_STATUS_UNSUPPORTED; 557 } 558 559 CpaStatus 560 cpaCyLnModInv(const CpaInstanceHandle instanceHandle, 561 const CpaCyGenFlatBufCbFunc pLnModInvCb, 562 void *pCallbackTag, 563 const CpaCyLnModInvOpData *pLnModInvOpData, 564 CpaFlatBuffer *pResult) 565 { 566 return CPA_STATUS_UNSUPPORTED; 567 } 568 569 CpaStatus 570 cpaCyLnStatsQuery64(const CpaInstanceHandle instanceHandle, 571 CpaCyLnStats64 *pLnStats) 572 { 573 return CPA_STATUS_UNSUPPORTED; 574 } 575 576 /* Dynamic Instance */ 577 CpaStatus 578 icp_adf_putDynInstance(icp_accel_dev_t *accel_dev, 579 adf_service_type_t stype, 580 Cpa32U instance_id) 581 { 582 return CPA_STATUS_FAIL; 583 } 584 585 CpaStatus 586 icp_sal_CyPollAsymRing(CpaInstanceHandle instanceHandle_in, 587 Cpa32U response_quota) 588 { 589 return CPA_STATUS_UNSUPPORTED; 590 } 591 592 CpaStatus 593 icp_sal_AsymGetInflightRequests(CpaInstanceHandle instanceHandle, 594 Cpa32U *maxInflightRequests, 595 Cpa32U *numInflightRequests) 596 { 597 return CPA_STATUS_UNSUPPORTED; 598 } 599 600 CpaStatus 601 icp_sal_AsymPerformOpNow(CpaInstanceHandle instanceHandle) 602 { 603 return CPA_STATUS_UNSUPPORTED; 604 } 605