/ohos5.0/base/security/crypto_framework/test/unittest/src/ |
H A D | crypto_rsa_cipher_test.cpp | 784 res = cipher->update(cipher, &input, &encoutput); 816 res = cipher->doFinal(cipher, &input, &encoutput); 860 res = cipher->doFinal(cipher, &input, &encoutput); 904 res = cipher->doFinal(cipher, &input, &encoutput); 950 res = cipher->doFinal(cipher, &input, &encoutput); 1045 res = cipher->doFinal(cipher, &input, &encoutput); 1246 res = cipher->doFinal(cipher, &input, nullptr); 1351 res = cipher->doFinal(cipher, &input, &encoutput); 1413 res = cipher->doFinal(cipher, &input, &encoutput); 1474 res = cipher->doFinal(cipher, &input, &encoutput); [all …]
|
H A D | crypto_sm2_cipher_test.cpp | 322 res = cipher->update(cipher, &input, &encoutput); 354 res = cipher->doFinal(cipher, &input, &encoutput); 364 res = cipher->doFinal(cipher, &encoutput, &decoutput); 410 res = cipher->doFinal(cipher, &input, &encoutput); 475 res = cipher->doFinal(cipher, &input, nullptr); 608 res = cipher->doFinal(cipher, nullptr, &encoutput); 761 res = cipher->doFinal(cipher, &input, nullptr); 778 res = cipher->doFinal(cipher, nullptr, &out); 821 res = cipher->doFinal(cipher, &input, &out); 843 res = cipher->doFinal(cipher, &input, &out); [all …]
|
H A D | crypto_sm4_cipher_test.cpp | 775 HcfObjDestroy(cipher); 789 HcfObjDestroy(cipher); 803 HcfObjDestroy(cipher); 845 HcfObjDestroy(cipher); 1028 res = cipher->init(cipher, ENCRYPT_MODE, nullptr, nullptr); 1094 res = cipher->update(cipher, nullptr, &blob); 1118 res = cipher->update(cipher, &input, nullptr); 1156 res = cipher->doFinal(cipher, &input, nullptr); 1177 res = cipher->doFinal(cipher, &input, &out); 1199 res = cipher->doFinal(cipher, &input, &out); [all …]
|
H A D | crypto_sm4_ecb_cipher_test.cpp | 355 HcfObjDestroy(cipher); 377 ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(cipher), nullptr); 384 HcfObjDestroy(cipher); 409 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 420 HcfObjDestroy(cipher); 449 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 489 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 529 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 560 ret = cipher->init(cipher, ENCRYPT_MODE, nullptr, nullptr); 702 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); [all …]
|
H A D | crypto_sm4_cfb_cipher_test.cpp | 53 HcfCipher *cipher = nullptr; variable 101 HcfCipher *cipher = nullptr; variable 149 HcfCipher *cipher = nullptr; variable 639 HcfObjDestroy(cipher); 671 HcfObjDestroy(cipher); 685 HcfObjDestroy(cipher); 700 HcfObjDestroy(cipher); 781 retAlgo = cipher->getAlgorithm(cipher); 793 HcfObjDestroy(cipher); 831 HcfObjDestroy(cipher); [all …]
|
H A D | crypto_3des_cipher_test.cpp | 80 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)key, params); in DesEncrypt() 86 ret = cipher->update(cipher, &input, &output); in DesEncrypt() 100 ret = cipher->doFinal(cipher, nullptr, &output); in DesEncrypt() 129 ret = cipher->update(cipher, &input, &output); in DesDecrypt() 143 ret = cipher->doFinal(cipher, nullptr, &output); in DesDecrypt() 177 ret = cipher->doFinal(cipher, &input, &output); in DesNoUpdateEncrypt() 207 ret = cipher->doFinal(cipher, &input, &output); in DesNoUpdateDecrypt() 1637 ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(cipher), nullptr); 1669 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 1710 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); [all …]
|
H A D | sm4_common.cpp | 78 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); in Sm4EncryptWithInput() 84 ret = cipher->update(cipher, input, &output); in Sm4EncryptWithInput() 98 ret = cipher->doFinal(cipher, nullptr, &output); in Sm4EncryptWithInput() 121 int32_t ret = cipher->init(cipher, DECRYPT_MODE, &(key->key), params); in Sm4DecryptEmptyMsg() 127 ret = cipher->doFinal(cipher, &input, &output); in Sm4DecryptEmptyMsg() 155 ret = cipher->update(cipher, &input, &output); in Sm4Encrypt() 169 ret = cipher->doFinal(cipher, nullptr, &output); in Sm4Encrypt() 198 ret = cipher->update(cipher, &input, &output); in Sm4Decrypt() 212 ret = cipher->doFinal(cipher, nullptr, &output); in Sm4Decrypt() 246 ret = cipher->doFinal(cipher, &input, &output); in Sm4NoUpdateEncrypt() [all …]
|
H A D | crypto_sm4_gcm_cipher_test.cpp | 56 HcfCipher *cipher = nullptr; variable 110 HcfCipher *cipher = nullptr; variable 164 HcfCipher *cipher = nullptr; variable 218 HcfCipher *cipher = nullptr; variable 272 HcfCipher *cipher = nullptr; variable 381 HcfObjDestroy(cipher); 396 HcfObjDestroy(cipher); 435 HcfObjDestroy(cipher); 479 HcfObjDestroy(cipher); 522 HcfObjDestroy(cipher); [all …]
|
H A D | crypto_rsa_cipher_sub_test.cpp | 178 res = cipher->init(cipher, ENCRYPT_MODE, (HcfKey *)keyPair->pubKey, nullptr); 187 res = cipher->doFinal(cipher, &input, &encoutput); 189 HcfObjDestroy(cipher); 222 HcfObjDestroy(cipher); 252 HcfObjDestroy(cipher); 282 HcfObjDestroy(cipher); 311 HcfObjDestroy(cipher); 337 res = cipher->setCipherSpecUint8Array(cipher, OAEP_MD_NAME_STR, retBlob); 340 HcfObjDestroy(cipher); 409 res = cipher->update(cipher, nullptr, nullptr); [all …]
|
/ohos5.0/base/security/crypto_framework/test/unittest/src/aes_cipher/ |
H A D | crypto_aes_ecb_cipher_test.cpp | 507 HcfObjDestroy(cipher); 544 HcfObjDestroy(cipher); 581 HcfObjDestroy(cipher); 610 HcfObjDestroy(cipher); 645 HcfObjDestroy(cipher); 802 ret = cipher->init(cipher, ENCRYPT_MODE, nullptr, nullptr); 944 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 985 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 1063 ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); 1069 ret = cipher->doFinal(cipher, &input, nullptr); [all …]
|
H A D | crypto_aes_cfb_cipher_test.cpp | 1342 HcfObjDestroy(cipher); 1384 HcfObjDestroy(cipher); 1426 HcfObjDestroy(cipher); 1469 HcfObjDestroy(cipher); 1511 HcfObjDestroy(cipher); 1553 HcfObjDestroy(cipher); 1595 HcfObjDestroy(cipher); 1637 HcfObjDestroy(cipher); 1653 retAlgo = cipher->getAlgorithm(cipher); 1665 HcfObjDestroy(cipher); [all …]
|
H A D | crypto_aes_cbc_cipher_test.cpp | 54 HcfCipher *cipher = nullptr; variable 105 HcfCipher *cipher = nullptr; variable 156 HcfCipher *cipher = nullptr; variable 207 HcfCipher *cipher = nullptr; variable 258 HcfCipher *cipher = nullptr; variable 309 HcfCipher *cipher = nullptr; variable 359 HcfCipher *cipher = nullptr; variable 411 HcfCipher *cipher = nullptr; variable 441 HcfObjDestroy(cipher); 453 HcfCipher *cipher = nullptr; variable [all …]
|
H A D | crypto_aes_ctr_cipher_test.cpp | 54 HcfCipher *cipher = nullptr; variable 105 HcfCipher *cipher = nullptr; variable 156 HcfCipher *cipher = nullptr; variable 207 HcfCipher *cipher = nullptr; variable 258 HcfCipher *cipher = nullptr; variable 309 HcfCipher *cipher = nullptr; variable 357 HcfCipher *cipher = nullptr; variable 410 HcfCipher *cipher = nullptr; variable 440 HcfObjDestroy(cipher); 452 HcfCipher *cipher = nullptr; variable [all …]
|
H A D | crypto_aes_ofb_cipher_test.cpp | 54 HcfCipher *cipher = nullptr; variable 105 HcfCipher *cipher = nullptr; variable 156 HcfCipher *cipher = nullptr; variable 206 HcfCipher *cipher = nullptr; variable 257 HcfCipher *cipher = nullptr; variable 308 HcfCipher *cipher = nullptr; variable 355 HcfCipher *cipher = nullptr; variable 408 HcfCipher *cipher = nullptr; variable 438 HcfObjDestroy(cipher); 450 HcfCipher *cipher = nullptr; variable [all …]
|
H A D | crypto_aes_gcm_cipher_test.cpp | 54 HcfCipher *cipher = nullptr; variable 108 HcfCipher *cipher = nullptr; variable 162 HcfCipher *cipher = nullptr; variable 418 HcfObjDestroy(cipher); 471 HcfObjDestroy(cipher); 485 HcfObjDestroy(cipher); 500 HcfObjDestroy(cipher); 539 HcfObjDestroy(cipher); 583 HcfObjDestroy(cipher); 626 HcfObjDestroy(cipher); [all …]
|
H A D | aes_common.cpp | 169 ret = cipher->update(cipher, &input, &output); in AesMultiBlockEncrypt() 182 ret = cipher->doFinal(cipher, nullptr, &output); in AesMultiBlockEncrypt() 236 ret = cipher->doFinal(cipher, nullptr, &output); in AesMultiBlockDecrypt() 268 ret = cipher->update(cipher, input, &output); in AesEncryptWithInput() 282 ret = cipher->doFinal(cipher, nullptr, &output); in AesEncryptWithInput() 313 ret = cipher->update(cipher, &input, &output); in AesEncrypt() 327 ret = cipher->doFinal(cipher, nullptr, &output); in AesEncrypt() 358 ret = cipher->update(cipher, &input, &output); in AesDecrypt() 405 ret = cipher->doFinal(cipher, input, &output); in AesNoUpdateEncWithInput() 435 ret = cipher->doFinal(cipher, &input, &output); in AesDecryptEmptyMsg() [all …]
|
H A D | crypto_aes_ccm_cipher_test.cpp | 54 HcfCipher *cipher = nullptr; variable 107 HcfCipher *cipher = nullptr; variable 160 HcfCipher *cipher = nullptr; variable 412 HcfObjDestroy(cipher); 464 HcfObjDestroy(cipher); 496 HcfObjDestroy(cipher); 538 HcfObjDestroy(cipher); 580 HcfObjDestroy(cipher); 622 HcfObjDestroy(cipher); 648 ret = cipher->init(cipher, ENCRYPT_MODE, reinterpret_cast<HcfKey *>(key), nullptr); [all …]
|
/ohos5.0/base/security/crypto_framework/test/fuzztest/crypto_operation/hcfciphercreate_fuzzer/ |
H A D | hcfciphercreate_fuzzer.cpp | 37 int32_t ret = cipher->init(cipher, ENCRYPT_MODE, &(key->key), nullptr); in AesEncrypt() 42 ret = cipher->update(cipher, input, &output); in AesEncrypt() 54 ret = cipher->doFinal(cipher, nullptr, &output); in AesEncrypt() 82 ret = cipher->update(cipher, input, &output); in AesDecrypt() 95 ret = cipher->doFinal(cipher, nullptr, &output); in AesDecrypt() 123 ret = cipher->update(cipher, input, &output); in Sm4Encrypt() 136 ret = cipher->doFinal(cipher, nullptr, &output); in Sm4Encrypt() 164 ret = cipher->update(cipher, input, &output); in Sm4Decrypt() 177 ret = cipher->doFinal(cipher, nullptr, &output); in Sm4Decrypt() 329 (void)cipher->doFinal(cipher, &input, &encoutput); in TestRsaCipher() [all …]
|
/ohos5.0/base/security/crypto_framework/frameworks/crypto_operation/ |
H A D | cipher.c | 56 CipherAttr *cipherAttr = (CipherAttr *)cipher; in SetKeyType() 84 CipherAttr *cipherAttr = (CipherAttr *)cipher; in SetKeyLength() 132 cipher->md = value; in SetDigest() 137 cipher->mgf1md = value; in SetMgf1Digest() 142 if ((config == NULL) || (cipher == NULL)) { in OnSetParameter() 156 SetMode(config->paraValue, cipher); in OnSetParameter() 320 cipher->super.init = CipherInit; in InitCipher() 321 cipher->super.update = CipherUpdate; in InitCipher() 322 cipher->super.doFinal = CipherFinal; in InitCipher() 323 cipher->super.getAlgorithm = GetAlgorithm; in InitCipher() [all …]
|
/ohos5.0/base/security/device_auth/frameworks/deviceauth_lite/source/struct/ |
H A D | rmv_auth_info_request.c | 50 rmv_auth_info_request->cipher.length = len_rmv_return / BYTE_TO_HEX_OPER_LENGTH; in parse_rmv_auth_info_request() 51 rmv_auth_info_request->cipher.size = rmv_auth_info_request->cipher.length; in parse_rmv_auth_info_request() 52 rmv_auth_info_request->cipher.val = (uint8_t *)MALLOC(rmv_auth_info_request->cipher.size); in parse_rmv_auth_info_request() 53 if (rmv_auth_info_request->cipher.val == NULL) { in parse_rmv_auth_info_request() 57 (void)memset_s(rmv_auth_info_request->cipher.val, rmv_auth_info_request->cipher.size, in parse_rmv_auth_info_request() 58 0, rmv_auth_info_request->cipher.size); in parse_rmv_auth_info_request() 59 … if (hex_string_to_byte(add_return, len_rmv_return, rmv_auth_info_request->cipher.val) != HC_OK) { in parse_rmv_auth_info_request() 74 if (data->cipher.val != NULL) { in free_rmv_auth_info_request() 75 FREE(data->cipher.val); in free_rmv_auth_info_request() 85 uint8_t *tmp_data_hex = raw_byte_to_hex_string(rmv_auth_info_request->cipher.val, in make_rmv_auth_info_request() [all …]
|
H A D | rmv_auth_info_response.c | 50 rmv_auth_info_response->cipher.length = len_rmv_return / BYTE_TO_HEX_OPER_LENGTH; in parse_rmv_auth_info_response() 51 rmv_auth_info_response->cipher.size = rmv_auth_info_response->cipher.length; in parse_rmv_auth_info_response() 52 rmv_auth_info_response->cipher.val = (uint8_t *)MALLOC(rmv_auth_info_response->cipher.size); in parse_rmv_auth_info_response() 53 if (rmv_auth_info_response->cipher.val == NULL) { in parse_rmv_auth_info_response() 57 (void)memset_s(rmv_auth_info_response->cipher.val, rmv_auth_info_response->cipher.size, in parse_rmv_auth_info_response() 58 0, rmv_auth_info_response->cipher.size); in parse_rmv_auth_info_response() 59 … if (hex_string_to_byte(rmv_return, len_rmv_return, rmv_auth_info_response->cipher.val) != HC_OK) { in parse_rmv_auth_info_response() 74 if (data->cipher.val != NULL) { in free_rmv_auth_info_response() 75 FREE(data->cipher.val); in free_rmv_auth_info_response() 85 uint8_t *tmp_data_hex = raw_byte_to_hex_string(rmv_auth_info_response_data->cipher.val, in make_rmv_auth_info_response() [all …]
|
H A D | exchange_response.c | 51 exchange_response->cipher.length = (uint32_t)(len_ex_auth_info / BYTE_TO_HEX_OPER_LENGTH); in parse_exchange_response() 52 exchange_response->cipher.size = exchange_response->cipher.length; in parse_exchange_response() 53 exchange_response->cipher.val = (uint8_t *)MALLOC(exchange_response->cipher.size); in parse_exchange_response() 54 if (exchange_response->cipher.val == NULL) { in parse_exchange_response() 58 …(void)memset_s(exchange_response->cipher.val, exchange_response->cipher.size, 0, exchange_response… in parse_exchange_response() 59 … if (hex_string_to_byte(ex_auth_info, len_ex_auth_info, exchange_response->cipher.val) != HC_OK) { in parse_exchange_response() 74 if (data->cipher.val != NULL) { in free_exchange_response() 75 FREE(data->cipher.val); in free_exchange_response()
|
/ohos5.0/docs/zh-cn/application-dev/reference/apis-crypto-architecture-kit/ |
H A D | js-apis-system-cipher.md | 1 # @system.cipher (加密算法) 13 import cipher from '@system.cipher'; 18 调用cipher接口后,返回的内容。 29 调用cipher rsa方法时,传入的参数。 45 调用cipher aes方法时,传入的参数。 62 ## cipher.rsa 81 cipher.rsa({ 102 cipher.rsa({ 140 ## cipher.aes 159 cipher.aes({ [all …]
|
/ohos5.0/base/security/crypto_framework/frameworks/js/napi/crypto/src/ |
H A D | napi_cipher.cpp | 344 HcfCipher *cipher = context->cipher; in AsyncInitProcess() local 348 context->errCode = cipher->init(cipher, context->opMode, key, params); in AsyncInitProcess() 359 HcfCipher *cipher = context->cipher; in AsyncUpdateProcess() local 370 HcfCipher *cipher = context->cipher; in AsyncDoFinalProcess() local 541 HcfResult res = cipher->init(cipher, opMode, key, paramsSpec); in SyncInit() 650 errCode = cipher->update(cipher, &input, &output); in JsCipherUpdateSync() 723 HcfResult res = cipher->doFinal(cipher, input, &output); in JsCipherDoFinalSync() 762 const char *algo = cipher->getAlgorithm(cipher); in JsGetAlgorithm() 869 HcfResult res = cipher->setCipherSpecUint8Array(cipher, item, *pSource); in JsSetCipherSpec() 885 HcfResult res = cipher->getCipherSpecString(cipher, item, &returnString); in GetCipherSpecString() [all …]
|
/ohos5.0/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
H A D | hks_chipset_platform_decrypt_test.cpp | 64 .cipher = { 94 .cipher = { 124 .cipher = { 154 .cipher = { 186 .cipher = { 278 .cipher = { 308 .cipher = { 338 .cipher = { 368 .cipher = { 400 .cipher = { [all …]
|