| /base/security/crypto_framework/test/unittest/src/ |
| D | sm4_common.cpp | 73 uint8_t *cipherText, int *cipherTextLen) in Sm4EncryptWithInput() argument 76 int32_t maxLen = *cipherTextLen; in Sm4EncryptWithInput() 88 *cipherTextLen = output.len; in Sm4EncryptWithInput() 103 …if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK… in Sm4EncryptWithInput() 107 *cipherTextLen += output.len; in Sm4EncryptWithInput() 116 uint8_t *cipherText, int cipherTextLen) in Sm4DecryptEmptyMsg() argument 118 HcfBlob input = { .data = cipherText, .len = cipherTextLen }; in Sm4DecryptEmptyMsg() 142 uint8_t *cipherText, int *cipherTextLen) in Sm4Encrypt() argument 147 int32_t maxLen = *cipherTextLen; in Sm4Encrypt() 159 *cipherTextLen = output.len; in Sm4Encrypt() [all …]
|
| D | crypto_sm4_cfb_cipher_test.cpp | 49 int cipherTextLen = 128; variable 74 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 80 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 97 int cipherTextLen = 128; variable 122 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 128 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 145 int cipherTextLen = 128; variable 170 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 176 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 193 int cipherTextLen = 128; variable [all …]
|
| D | crypto_3des_cipher_test.cpp | 74 uint8_t *cipherText, int *cipherTextLen) in DesEncrypt() argument 79 int32_t maxLen = *cipherTextLen; in DesEncrypt() 91 *cipherTextLen = output.len; in DesEncrypt() 106 …if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK… in DesEncrypt() 110 *cipherTextLen += output.len; in DesEncrypt() 117 uint8_t *cipherText, int cipherTextLen) in DesDecrypt() argument 120 HcfBlob input = {.data = (uint8_t *)cipherText, .len = cipherTextLen}; in DesDecrypt() 122 int32_t maxLen = cipherTextLen; in DesDecrypt() 134 cipherTextLen = output.len; in DesDecrypt() 149 …if (memcpy_s(cipherText + cipherTextLen, maxLen - cipherTextLen, output.data, output.len) != EOK) { in DesDecrypt() [all …]
|
| D | crypto_sm4_cipher_test.cpp | 54 int cipherTextLen = 128; variable 79 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 85 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 102 int cipherTextLen = 128; variable 127 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 132 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 149 int cipherTextLen = 128; variable 172 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 178 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 195 int cipherTextLen = 128; variable [all …]
|
| D | crypto_sm4_ecb_cipher_test.cpp | 49 int cipherTextLen = 128; variable 73 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 79 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 96 int cipherTextLen = 128; variable 120 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 126 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 144 int cipherTextLen = 128; variable 168 ret = Sm4Encrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 174 ret = Sm4Decrypt(cipher, key, nullptr, cipherText, cipherTextLen); 191 int cipherTextLen = 128; variable [all …]
|
| /base/security/crypto_framework/test/unittest/src/aes_cipher/ |
| D | crypto_aes_ccm_cipher_test.cpp | 52 int cipherTextLen = 128; variable 76 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); 82 (void)memcpy_s(spec.tag.data, 12, cipherText + cipherTextLen - 12, 12); 84 cipherTextLen -= 12; 86 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); 105 int cipherTextLen = 128; variable 129 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); 135 (void)memcpy_s(spec.tag.data, 12, cipherText + cipherTextLen - 12, 12); 137 cipherTextLen -= 12; 139 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); [all …]
|
| D | crypto_aes_gcm_cipher_test.cpp | 52 int cipherTextLen = 128; variable 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); 83 (void)memcpy_s(spec.tag.data, 16, cipherText + cipherTextLen - 16, 16); 85 cipherTextLen -= 16; 87 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); 106 int cipherTextLen = 128; variable 131 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, &cipherTextLen); 137 (void)memcpy_s(spec.tag.data, 16, cipherText + cipherTextLen - 16, 16); 139 cipherTextLen -= 16; 141 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&spec, cipherText, cipherTextLen); [all …]
|
| D | aes_common.cpp | 258 uint8_t *cipherText, int *cipherTextLen) in AesEncryptWithInput() argument 261 int32_t maxLen = *cipherTextLen; in AesEncryptWithInput() 273 *cipherTextLen = output.len; in AesEncryptWithInput() 288 …if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK… in AesEncryptWithInput() 292 *cipherTextLen += output.len; in AesEncryptWithInput() 296 PrintfHex("ciphertext", cipherText, *cipherTextLen); in AesEncryptWithInput() 301 uint8_t *cipherText, int *cipherTextLen) in AesEncrypt() argument 306 int32_t maxLen = *cipherTextLen; in AesEncrypt() 318 *cipherTextLen = output.len; in AesEncrypt() 333 …if (memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len) != EOK… in AesEncrypt() [all …]
|
| D | crypto_aes_cfb_cipher_test.cpp | 50 int cipherTextLen = 128; variable 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 101 int cipherTextLen = 128; variable 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 152 int cipherTextLen = 128; variable 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 204 int cipherTextLen = 128; variable [all …]
|
| D | crypto_aes_ecb_cipher_test.cpp | 55 int cipherTextLen = 128; variable 79 ret = AesEncrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 85 ret = AesDecrypt(cipher, key, nullptr, cipherText, cipherTextLen); 107 int cipherTextLen = 128; variable 130 ret = AesEncrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 136 ret = AesDecrypt(cipher, key, nullptr, cipherText, cipherTextLen); 152 int cipherTextLen = 128; variable 175 ret = AesEncrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 181 ret = AesDecrypt(cipher, key, nullptr, cipherText, cipherTextLen); 198 int cipherTextLen = 128; variable [all …]
|
| D | crypto_aes_ofb_cipher_test.cpp | 50 int cipherTextLen = 128; variable 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 101 int cipherTextLen = 128; variable 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 152 int cipherTextLen = 128; variable 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 202 int cipherTextLen = 128; variable [all …]
|
| D | crypto_aes_cbc_cipher_test.cpp | 50 int cipherTextLen = 128; variable 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 101 int cipherTextLen = 128; variable 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 152 int cipherTextLen = 128; variable 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 203 int cipherTextLen = 128; variable [all …]
|
| D | crypto_aes_ctr_cipher_test.cpp | 50 int cipherTextLen = 128; variable 77 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 83 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 101 int cipherTextLen = 128; variable 128 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 134 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 152 int cipherTextLen = 128; variable 179 ret = AesEncrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, &cipherTextLen); 185 ret = AesDecrypt(cipher, key, (HcfParamsSpec *)&ivSpec, cipherText, cipherTextLen); 203 int cipherTextLen = 128; variable [all …]
|
| D | crypto_aes_cipher_test.cpp | 679 int cipherTextLen = CIPHER_TEXT_LEN; variable 696 ret = AesEncrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 702 ret = AesDecrypt(cipher, key, nullptr, cipherText, cipherTextLen); 716 int cipherTextLen = CIPHER_TEXT_LEN; variable 733 ret = AesEncrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 739 ret = AesDecrypt(cipher, key, nullptr, cipherText, cipherTextLen); 753 int cipherTextLen = CIPHER_TEXT_LEN; variable 770 ret = AesEncrypt(cipher, key, nullptr, cipherText, &cipherTextLen); 776 ret = AesDecrypt(cipher, key, nullptr, cipherText, cipherTextLen);
|
| /base/security/crypto_framework/test/fuzztest/crypto_operation/hcfciphercreate_fuzzer/ |
| D | hcfciphercreate_fuzzer.cpp | 34 uint8_t *cipherText, int *cipherTextLen) in AesEncrypt() argument 39 int32_t maxLen = *cipherTextLen; in AesEncrypt() 49 *cipherTextLen = output.len; in AesEncrypt() 62 … (void)memcpy_s(cipherText + *cipherTextLen, maxLen - *cipherTextLen, output.data, output.len); in AesEncrypt() 64 *cipherTextLen += output.len; in AesEncrypt() 73 uint8_t *cipherText, int cipherTextLen) in AesDecrypt() argument 76 HcfBlob input = {.data = cipherText, .len = cipherTextLen}; in AesDecrypt() 78 int32_t maxLen = cipherTextLen; in AesDecrypt() 91 cipherTextLen = output.len; in AesDecrypt() 102 … (void)memcpy_s(cipherText + cipherTextLen, maxLen - cipherTextLen, output.data, output.len); in AesDecrypt() [all …]
|
| /base/security/crypto_framework/test/unittest/include/ |
| D | sm4_common.h | 37 uint8_t *cipherText, int *cipherTextLen); 41 uint8_t *cipherText, int cipherTextLen); 43 uint8_t *cipherText, int *cipherTextLen); 45 uint8_t *cipherText, int cipherTextLen); 47 uint8_t *cipherText, int *cipherTextLen); 49 uint8_t *cipherText, int cipherTextLen);
|
| D | aes_common.h | 59 uint8_t *cipherText, int *cipherTextLen); 61 uint8_t *cipherText, int *cipherTextLen); 63 uint8_t *cipherText, int cipherTextLen); 65 uint8_t *cipherText, int *cipherTextLen); 69 uint8_t *cipherText, int cipherTextLen); 71 uint8_t *cipherText, int *cipherTextLen); 73 uint8_t *cipherText, int cipherTextLen);
|
| /base/security/huks/frameworks/crypto_lite/cipher/src/ |
| D | cipher_rsa.c | 221 …tic int32_t RsaEncryptBase64Encode(int32_t cipherTotalLen, char *cipherText, int32_t cipherTextLen) in RsaEncryptBase64Encode() argument 240 (void)memset_s(cipherText, cipherTextLen, 0, cipherTextLen); in RsaEncryptBase64Encode() 249 ret = mbedtls_base64_encode((unsigned char *)cipherText, cipherTextLen, &dataLen, in RsaEncryptBase64Encode() 261 char *cipherText, int32_t cipherTextLen) in RsaEncryptMultipleBlock() argument 289 if (memcpy_s(cipherText + i * rsaLen, cipherTextLen - i * rsaLen, buf, rsaLen)) { in RsaEncryptMultipleBlock() 304 … if (memcpy_s(cipherText + count * rsaLen, cipherTextLen - count * rsaLen, buf, rsaLen)) { in RsaEncryptMultipleBlock() 309 if (RsaEncryptBase64Encode(cipherTotalLen, cipherText, cipherTextLen)) { in RsaEncryptMultipleBlock()
|
| /base/security/crypto_framework/plugin/openssl_plugin/common/src/ |
| D | openssl_adapter.c | 1178 size_t msgLen, uint8_t *cipherTextBuf, size_t *cipherTextLen) in Openssl_sm2_encrypt() argument 1180 return ossl_sm2_encrypt(key, digest, msg, msgLen, cipherTextBuf, cipherTextLen); in Openssl_sm2_encrypt() 1184 size_t cipherTextLen, uint8_t *plainTextBuf, size_t *plainTextLen) in Openssl_sm2_decrypt() argument 1186 return ossl_sm2_decrypt(key, digest, cipherText, cipherTextLen, plainTextBuf, plainTextLen); in Openssl_sm2_decrypt()
|
| /base/security/crypto_framework/plugin/openssl_plugin/common/inc/ |
| D | openssl_adapter.h | 286 size_t msgLen, uint8_t *cipherTextBuf, size_t *cipherTextLen); 289 size_t cipherTextLen, uint8_t *plainTextBuf, size_t *plainTextLen);
|