Home
last modified time | relevance | path

Searched refs:cryptoCtx (Results 1 – 17 of 17) sorted by relevance

/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/
Dhks_openssl_hash.c92 int32_t HksOpensslHashInit(void **cryptoCtx, uint32_t alg) in HksOpensslHashInit() argument
115 *cryptoCtx = (void*)tmpctx; in HksOpensslHashInit()
119 int32_t HksOpensslHashUpdate(void *cryptoCtx, const struct HksBlob *msg) in HksOpensslHashUpdate() argument
121 HKS_IF_NULL_LOGE_RETURN(cryptoCtx, HKS_ERROR_INVALID_ARGUMENT, "Invalid param cryptoCtx!") in HksOpensslHashUpdate()
126 int32_t ret = EVP_DigestUpdate(cryptoCtx, msg->data, msg->size); in HksOpensslHashUpdate()
134 int32_t HksOpensslHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash) in HksOpensslHashFinal() argument
136 if (cryptoCtx == NULL || *cryptoCtx == NULL) { in HksOpensslHashFinal()
143 EVP_MD_CTX_free((EVP_MD_CTX *)*cryptoCtx); in HksOpensslHashFinal()
144 *cryptoCtx = NULL; in HksOpensslHashFinal()
149 EVP_MD_CTX_free((EVP_MD_CTX *)*cryptoCtx); in HksOpensslHashFinal()
[all …]
Dhks_openssl_sm4.c91 int32_t HksOpensslSm4EncryptInit(void **cryptoCtx, const struct HksBlob *key, const struct HksUsage… in HksOpensslSm4EncryptInit() argument
101 ret = OpensslBlockCipherCryptInit(key, usageSpec, true, cryptoCtx, GetSm4CipherType); in HksOpensslSm4EncryptInit()
114 int32_t HksOpensslSm4EncryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *… in HksOpensslSm4EncryptUpdate() argument
116 HKS_IF_NULL_LOGE_RETURN(cryptoCtx, HKS_ERROR_INVALID_ARGUMENT, "cryptoCtx is NULL") in HksOpensslSm4EncryptUpdate()
118 struct HksOpensslBlockCipherCtx *context = (struct HksOpensslBlockCipherCtx *)cryptoCtx; in HksOpensslSm4EncryptUpdate()
129 ret = OpensslBlockCipherEncryptUpdate(cryptoCtx, message, cipherText); in HksOpensslSm4EncryptUpdate()
142 int32_t HksOpensslSm4EncryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *… in HksOpensslSm4EncryptFinal() argument
146 struct HksOpensslBlockCipherCtx *ctx = (struct HksOpensslBlockCipherCtx *)*cryptoCtx; in HksOpensslSm4EncryptFinal()
157 ret = OpensslBlockCipherEncryptFinalThree(cryptoCtx, message, cipherText); in HksOpensslSm4EncryptFinal()
170 int32_t HksOpensslSm4DecryptInit(void **cryptoCtx, const struct HksBlob *key, in HksOpensslSm4DecryptInit() argument
[all …]
Dhks_openssl_hmac.c112 int32_t HksOpensslHmacInit(void **cryptoCtx, const struct HksBlob *key, uint32_t digestAlg) in HksOpensslHmacInit() argument
156 *cryptoCtx = (void *)outCtx; in HksOpensslHmacInit()
161 int32_t HksOpensslHmacUpdate(void *cryptoCtx, const struct HksBlob *msg) in HksOpensslHmacUpdate() argument
165 struct HksOpensslHmacCtx *hmacCtx = (struct HksOpensslHmacCtx *)cryptoCtx; in HksOpensslHmacUpdate()
179 int32_t HksOpensslHmacFinal(void **cryptoCtx, struct HksBlob *msg, struct HksBlob *mac) in HksOpensslHmacFinal() argument
181 if ((cryptoCtx == NULL) || (*cryptoCtx == NULL)) { in HksOpensslHmacFinal()
185 struct HksOpensslHmacCtx *hmacCtx = (struct HksOpensslHmacCtx *)*cryptoCtx; in HksOpensslHmacFinal()
188 HKS_FREE_PTR(*cryptoCtx); in HksOpensslHmacFinal()
195 HKS_FREE_PTR(*cryptoCtx); in HksOpensslHmacFinal()
201 HksOpensslHmacHalFreeCtx(cryptoCtx); in HksOpensslHmacFinal()
[all …]
Dhks_openssl_aes.c86 … const struct HksBlob *key, const struct HksUsageSpec *usageSpec, bool isEncrypt, void **cryptoCtx, in ENABLE_CFI() argument
133 *cryptoCtx = (void *)outCtx; in ENABLE_CFI()
140 void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) in OpensslBlockCipherEncryptUpdate() argument
142 struct HksOpensslBlockCipherCtx *blockCipherCtx = (struct HksOpensslBlockCipherCtx *)cryptoCtx; in OpensslBlockCipherEncryptUpdate()
158 void **cryptoCtx, const struct HksBlob *input, struct HksBlob *output, bool isEncrypt) in OpensslBlockCipherHandleFinalThree() argument
160 struct HksOpensslBlockCipherCtx *blockCipherCtx = (struct HksOpensslBlockCipherCtx *)*cryptoCtx; in OpensslBlockCipherHandleFinalThree()
163 HKS_FREE_PTR(*cryptoCtx); in OpensslBlockCipherHandleFinalThree()
195 HKS_FREE_PTR(*cryptoCtx); in OpensslBlockCipherHandleFinalThree()
202 void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText) in OpensslBlockCipherEncryptFinalThree() argument
204 return OpensslBlockCipherHandleFinalThree(cryptoCtx, message, cipherText, true); in OpensslBlockCipherEncryptFinalThree()
[all …]
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/include/
Dhks_openssl_aes.h38 int32_t HksOpensslAesEncryptInit(void **cryptoCtx, const struct HksBlob *key, const struct HksUsage…
40 int32_t HksOpensslAesEncryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *…
42 int32_t HksOpensslAesEncryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *…
45 int32_t HksOpensslAesDecryptInit(void **cryptoCtx, const struct HksBlob *key, const struct HksUsage…
47 int32_t HksOpensslAesDecryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *…
49 int32_t HksOpensslAesDecryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *…
52 void HksOpensslAesHalFreeCtx(void **cryptoCtx);
87 … const struct HksBlob *key, const struct HksUsageSpec *usageSpec, bool isEncrypt, void **cryptoCtx,
91 void *cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText);
94 void **cryptoCtx, const struct HksBlob *message, struct HksBlob *cipherText);
[all …]
Dhks_openssl_sm4.h33 int32_t HksOpensslSm4EncryptInit(void **cryptoCtx, const struct HksBlob *key, const struct HksUsage…
35 int32_t HksOpensslSm4EncryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *…
37 int32_t HksOpensslSm4EncryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *…
40 int32_t HksOpensslSm4DecryptInit(void **cryptoCtx, const struct HksBlob *key, const struct HksUsage…
42 int32_t HksOpensslSm4DecryptUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *…
44 int32_t HksOpensslSm4DecryptFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *…
47 void HksOpensslSm4HalFreeCtx(void **cryptoCtx);
Dhks_openssl_hash.h29 int32_t HksOpensslHashInit(void **cryptoCtx, uint32_t alg);
31 int32_t HksOpensslHashUpdate(void *cryptoCtx, const struct HksBlob *msg);
33 int32_t HksOpensslHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash);
35 void HksOpensslHashFreeCtx(void **cryptoCtx);
Dhks_openssl_hmac.h44 int32_t HksOpensslHmacInit(void **cryptoCtx, const struct HksBlob *key, uint32_t digestAlg);
46 int32_t HksOpensslHmacUpdate(void *cryptoCtx, const struct HksBlob *msg);
48 int32_t HksOpensslHmacFinal(void **cryptoCtx, struct HksBlob *msg, struct HksBlob *mac);
50 void HksOpensslHmacHalFreeCtx(void **cryptoCtx);
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/src/
Ddlp_crypt.cpp215 … const struct DlpBlob* key, const struct DlpUsageSpec* usageSpec, bool isEncrypt, void** cryptoCtx) in OpensslAesCipherCryptInit() argument
261 *cryptoCtx = static_cast<void*>(outCtx); in OpensslAesCipherCryptInit()
266 static int32_t OpensslAesCipherEncryptUpdate(void* cryptoCtx, const struct DlpBlob* message, struct… in OpensslAesCipherEncryptUpdate() argument
268 struct DlpOpensslAesCtx* aesCtx = static_cast<struct DlpOpensslAesCtx*>(cryptoCtx); in OpensslAesCipherEncryptUpdate()
285 void** cryptoCtx, const struct DlpBlob* message, struct DlpBlob* cipherText) in OpensslAesCipherEncryptFinalThree() argument
287 struct DlpOpensslAesCtx* aesCtx = (struct DlpOpensslAesCtx*)*cryptoCtx; in OpensslAesCipherEncryptFinalThree()
291 DLP_FREE_PTR(*cryptoCtx); in OpensslAesCipherEncryptFinalThree()
318 DLP_FREE_PTR(*cryptoCtx); in OpensslAesCipherEncryptFinalThree()
323 static int32_t OpensslAesCipherDecryptUpdate(void* cryptoCtx, const struct DlpBlob* message, struct… in OpensslAesCipherDecryptUpdate() argument
325 struct DlpOpensslAesCtx* aesCtx = static_cast<struct DlpOpensslAesCtx*>(cryptoCtx); in OpensslAesCipherDecryptUpdate()
[all …]
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/include/
Ddlp_crypt.h107 int32_t DlpOpensslAesEncryptInit(void** cryptoCtx, const struct DlpBlob* key, const struct DlpUsage…
109 int32_t DlpOpensslAesEncryptUpdate(void* cryptoCtx, const struct DlpBlob* message, struct DlpBlob* …
111 int32_t DlpOpensslAesEncryptFinal(void** cryptoCtx, const struct DlpBlob* message, struct DlpBlob* …
113 int32_t DlpOpensslAesDecryptInit(void** cryptoCtx, const struct DlpBlob* key, const struct DlpUsage…
115 int32_t DlpOpensslAesDecryptUpdate(void* cryptoCtx, const struct DlpBlob* message, struct DlpBlob* …
117 int32_t DlpOpensslAesDecryptFinal(void** cryptoCtx, const struct DlpBlob* message, struct DlpBlob* …
119 void DlpOpensslAesHalFreeCtx(void** cryptoCtx);
123 int32_t DlpOpensslHashInit(void** cryptoCtx, uint32_t alg);
125 int32_t DlpOpensslHashUpdate(void* cryptoCtx, const struct DlpBlob* msg);
127 int32_t DlpOpensslHashFinal(void** cryptoCtx, const struct DlpBlob* msg, struct DlpBlob* hash);
[all …]
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/
Dhks_mbedtls_hash.c418 static void HksMbedtlsMd5HashFreeCtx(void **cryptoCtx) in HksMbedtlsMd5HashFreeCtx() argument
420 if (cryptoCtx == NULL || *cryptoCtx == NULL) { in HksMbedtlsMd5HashFreeCtx()
424 struct HksMbedtlsHashCtx *hashCtx = (struct HksMbedtlsHashCtx *)*cryptoCtx; in HksMbedtlsMd5HashFreeCtx()
430 static void HksMbedtlsSHA1HashFreeCtx(void **cryptoCtx) in HksMbedtlsSHA1HashFreeCtx() argument
432 if (cryptoCtx == NULL || *cryptoCtx == NULL) { in HksMbedtlsSHA1HashFreeCtx()
436 struct HksMbedtlsHashCtx *hashCtx = (struct HksMbedtlsHashCtx *)*cryptoCtx; in HksMbedtlsSHA1HashFreeCtx()
442 static void HksMbedtlsSha224Sha256HashFreeCtx(void **cryptoCtx) in HksMbedtlsSha224Sha256HashFreeCtx() argument
444 if (cryptoCtx == NULL || *cryptoCtx == NULL) { in HksMbedtlsSha224Sha256HashFreeCtx()
448 struct HksMbedtlsHashCtx *hashCtx = (struct HksMbedtlsHashCtx *)*cryptoCtx; in HksMbedtlsSha224Sha256HashFreeCtx()
454 static void HksMbedtlsSha384Sha512HashFreeCtx(void **cryptoCtx) in HksMbedtlsSha384Sha512HashFreeCtx() argument
[all …]
Dhks_mbedtls_hmac.c115 int32_t HksMbedtlsHmacInit(void **cryptoCtx, const struct HksBlob *key, uint32_t digestAlg) in HksMbedtlsHmacInit() argument
158 *cryptoCtx = (void *)outCtx; in HksMbedtlsHmacInit()
162 int32_t HksMbedtlsHmacUpdate(void *cryptoCtx, const struct HksBlob *msg) in HksMbedtlsHmacUpdate() argument
164 struct HksMbedtlsHmacCtx *hctx = (struct HksMbedtlsHmacCtx *)cryptoCtx; in HksMbedtlsHmacUpdate()
177 int32_t HksMbedtlsHmacFinal(void **cryptoCtx, struct HksBlob *msg, struct HksBlob *mac) in HksMbedtlsHmacFinal() argument
179 struct HksMbedtlsHmacCtx *hctx = (struct HksMbedtlsHmacCtx *)*cryptoCtx; in HksMbedtlsHmacFinal()
182 HKS_FREE_PTR(*cryptoCtx); in HksMbedtlsHmacFinal()
191 HksMbedtlsHmacHalFreeCtx(cryptoCtx); in HksMbedtlsHmacFinal()
200 HksMbedtlsHmacHalFreeCtx(cryptoCtx); in HksMbedtlsHmacFinal()
207 HksMbedtlsHmacHalFreeCtx(cryptoCtx); in HksMbedtlsHmacFinal()
[all …]
Dhks_mbedtls_aes.c143 static int32_t AesCbcNoPaddingCryptInit(void **cryptoCtx, const struct HksBlob *key, in AesCbcNoPaddingCryptInit() argument
177 *cryptoCtx = (void *)outCtx; in AesCbcNoPaddingCryptInit()
182 static int32_t AesCbcNoPaddingCryptUpdate(void *cryptoCtx, in AesCbcNoPaddingCryptUpdate() argument
185 struct HksMbedtlsAesCtx *aesCtx = (struct HksMbedtlsAesCtx *)cryptoCtx; in AesCbcNoPaddingCryptUpdate()
228 static int32_t AesCbcNoPaddingCryptFinal(void **cryptoCtx, in AesCbcNoPaddingCryptFinal() argument
231 struct HksMbedtlsAesCtx *aesCtx = (struct HksMbedtlsAesCtx *)*cryptoCtx; in AesCbcNoPaddingCryptFinal()
235 HKS_FREE_PTR(*cryptoCtx); in AesCbcNoPaddingCryptFinal()
273 HKS_FREE_PTR(*cryptoCtx); in AesCbcNoPaddingCryptFinal()
349 static int32_t AesCbcPkcs7CryptInit(void **cryptoCtx, const struct HksBlob *key, in AesCbcPkcs7CryptInit() argument
392 *cryptoCtx = (void *)outCtx; in AesCbcPkcs7CryptInit()
[all …]
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/include/
Dhks_mbedtls_hash.h33 int32_t HksMbedtlsHashInit(void **cryptoCtx, uint32_t digestAlg);
35 int32_t HksMbedtlsHashUpdate(void *cryptoCtx, const struct HksBlob *msg);
37 int32_t HksMbedtlsHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash);
39 void HksMbedtlsHashFreeCtx(void **cryptoCtx);
Dhks_mbedtls_hmac.h39 int32_t HksMbedtlsHmacInit(void **cryptoCtx, const struct HksBlob *key, uint32_t digestAlg);
41 int32_t HksMbedtlsHmacUpdate(void *cryptoCtx, const struct HksBlob *msg);
43 int32_t HksMbedtlsHmacFinal(void **cryptoCtx, struct HksBlob *msg, struct HksBlob *mac);
45 void HksMbedtlsHmacHalFreeCtx(void **cryptoCtx);
Dhks_mbedtls_aes.h43 int32_t HksMbedtlsAesCryptoInit(void **cryptoCtx, const struct HksBlob *key, const struct HksUsageS…
46 int32_t HksMbedtlsAesCryptoUpdate(void *cryptoCtx, const struct HksBlob *message, struct HksBlob *c…
49 int32_t HksMbedtlsAesCryptoFinal(void **cryptoCtx, const struct HksBlob *message, struct HksBlob *c…
52 void HksMbedtlsAesHalFreeCtx(void **cryptoCtx);
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/test/
Ddlp_crypt_test.cpp502 …DlpOpensslAesCtx* cryptoCtx = reinterpret_cast<DlpOpensslAesCtx*>(calloc(1, sizeof(DlpOpensslAesCt… variable
503 ASSERT_NE(nullptr, cryptoCtx);
504 cryptoCtx->mode = DLP_MODE_CTR;
505 cryptoCtx->padding = OPENSSL_CTX_PADDING_ENABLE;
506 cryptoCtx->append = nullptr;
507 ret = DlpOpensslAesEncryptFinal(reinterpret_cast<void**>(&cryptoCtx), &message, &cipherText);
509 free(cryptoCtx);