Home
last modified time | relevance | path

Searched refs:opMode (Results 1 - 16 of 16) sorted by relevance

/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/
H A Dcipher_sm2_openssl.c44 static HcfResult CheckCipherInitParams(enum HcfCryptoMode opMode, HcfKey *key) in CheckCipherInitParams() argument
46 switch (opMode) { in CheckCipherInitParams()
60 LOGE("Invalid opMode %d", opMode); in CheckCipherInitParams()
67 static HcfResult InitSm2Key(HcfCipherSm2GeneratorSpiImpl *impl, HcfKey *key, enum HcfCryptoMode opMode) in InitSm2Key() argument
69 if (opMode == ENCRYPT_MODE) { in InitSm2Key()
71 } else if (opMode == DECRYPT_MODE) { in InitSm2Key()
119 static HcfResult EngineInit(HcfCipherGeneratorSpi *self, enum HcfCryptoMode opMode, in EngineInit() argument
136 // check opMode is matched with Key in EngineInit()
137 if (CheckCipherInitParams(opMode, ke in EngineInit()
[all...]
H A Dcipher_rsa_openssl.c43 static HcfResult CheckCipherInitParams(enum HcfCryptoMode opMode, HcfKey *key) in CheckCipherInitParams() argument
45 switch (opMode) { in CheckCipherInitParams()
59 LOGE("Invalid opMode %u", opMode); in CheckCipherInitParams()
66 static HcfResult DuplicateRsaFromKey(HcfKey *key, enum HcfCryptoMode opMode, RSA **dupRsa) in DuplicateRsaFromKey() argument
69 if (opMode == ENCRYPT_MODE) { in DuplicateRsaFromKey()
75 } else if (opMode == DECRYPT_MODE) { in DuplicateRsaFromKey()
89 static HcfResult InitEvpPkeyCtx(HcfCipherRsaGeneratorSpiImpl *impl, HcfKey *key, enum HcfCryptoMode opMode) in InitEvpPkeyCtx() argument
93 ret = DuplicateRsaFromKey(key, opMode, &rsa); in InitEvpPkeyCtx()
113 if (opMode in InitEvpPkeyCtx()
325 EngineInit(HcfCipherGeneratorSpi *self, enum HcfCryptoMode opMode, HcfKey *key, HcfParamsSpec *params) EngineInit() argument
[all...]
H A Dcipher_sm4_openssl.c177 static HcfResult InitAadAndTagFromGcmParams(enum HcfCryptoMode opMode, HcfGcmParamsSpec *params, CipherData *data) in InitAadAndTagFromGcmParams() argument
199 if (opMode == ENCRYPT_MODE) { in InitAadAndTagFromGcmParams()
213 static HcfResult InitCipherData(HcfCipherGeneratorSpi* self, enum HcfCryptoMode opMode, in InitCipherData() argument
225 (*cipherData)->enc = opMode; in InitCipherData()
243 ret = InitAadAndTagFromGcmParams(opMode, (HcfGcmParamsSpec *)params, *cipherData); in InitCipherData()
277 static HcfResult CheckParam(HcfCipherGeneratorSpi* self, enum HcfCryptoMode opMode, HcfKey* key) in CheckParam() argument
291 if (opMode != ENCRYPT_MODE && opMode != DECRYPT_MODE) { in CheckParam()
292 LOGE("Invalid opMode %d", opMode); in CheckParam()
355 EngineCipherInit(HcfCipherGeneratorSpi* self, enum HcfCryptoMode opMode, HcfKey* key, HcfParamsSpec* params) EngineCipherInit() argument
[all...]
H A Dcipher_3des_openssl.c69 static HcfResult InitCipherData(enum HcfCryptoMode opMode, CipherData **cipherData) in InitCipherData() argument
79 (*cipherData)->enc = opMode; in InitCipherData()
94 static HcfResult EngineCipherInit(HcfCipherGeneratorSpi *self, enum HcfCryptoMode opMode, in EngineCipherInit() argument
112 int32_t enc = (opMode == ENCRYPT_MODE) ? 1 : 0; in EngineCipherInit()
118 if (InitCipherData(opMode, &(cipherImpl->cipherData)) != HCF_SUCCESS) { in EngineCipherInit()
H A Dcipher_aes_openssl.c248 static HcfResult InitAadAndTagFromGcmParams(enum HcfCryptoMode opMode, HcfGcmParamsSpec *params, CipherData *data) in InitAadAndTagFromGcmParams() argument
270 if (opMode == ENCRYPT_MODE) { in InitAadAndTagFromGcmParams()
284 static HcfResult InitAadAndTagFromCcmParams(enum HcfCryptoMode opMode, HcfCcmParamsSpec *params, CipherData *data) in InitAadAndTagFromCcmParams() argument
301 if (opMode == ENCRYPT_MODE) { in InitAadAndTagFromCcmParams()
315 static HcfResult InitCipherData(HcfCipherGeneratorSpi *self, enum HcfCryptoMode opMode, in InitCipherData() argument
327 (*cipherData)->enc = opMode; in InitCipherData()
347 ret = InitAadAndTagFromCcmParams(opMode, (HcfCcmParamsSpec *)params, *cipherData); in InitCipherData()
350 ret = InitAadAndTagFromGcmParams(opMode, (HcfGcmParamsSpec *)params, *cipherData); in InitCipherData()
400 static HcfResult EngineCipherInit(HcfCipherGeneratorSpi *self, enum HcfCryptoMode opMode, in EngineCipherInit() argument
414 int enc = (opMode in EngineCipherInit()
[all...]
/base/security/crypto_framework/frameworks/cj/src/
H A Dcipher_impl.cpp30 HcfResult CipherImpl::CipherInit(HcfCryptoMode opMode, HcfKey *key, HcfParamsSpec *params) in CipherInit() argument
36 HcfResult res = cipher_->init(cipher_, opMode, key, params); in CipherInit()
H A Dcrypto_ffi.cpp378 int32_t FfiOHOSCipherInitByIv(int64_t id, int32_t opMode, void* key, HcfBlob blob1) in FfiOHOSCipherInitByIv() argument
398 HcfCryptoMode mode = HcfCryptoMode(opMode); in FfiOHOSCipherInitByIv()
408 int32_t FfiOHOSCipherInitByGcm(int64_t id, int32_t opMode, void* key, CParamsSpec spec) in FfiOHOSCipherInitByGcm() argument
426 HcfCryptoMode mode = HcfCryptoMode(opMode); in FfiOHOSCipherInitByGcm()
452 int32_t FfiOHOSCipherInitByCcm(int64_t id, int32_t opMode, void* key, CParamsSpec spec) in FfiOHOSCipherInitByCcm() argument
471 HcfCryptoMode mode = HcfCryptoMode(opMode); in FfiOHOSCipherInitByCcm()
496 int32_t FfiOHOSCipherInitWithOutParams(int64_t id, int32_t opMode, void* key) in FfiOHOSCipherInitWithOutParams() argument
509 HcfCryptoMode mode = HcfCryptoMode(opMode); in FfiOHOSCipherInitWithOutParams()
/base/security/crypto_framework/frameworks/spi/
H A Dcipher_factory_spi.h32 HcfResult (*init)(HcfCipherGeneratorSpi *self, enum HcfCryptoMode opMode,
/base/security/crypto_framework/frameworks/cj/include/
H A Dcipher_impl.h31 HcfResult CipherInit(HcfCryptoMode opMode, HcfKey *key, HcfParamsSpec *params);
H A Dcrypto_ffi.h80 FFI_EXPORT int32_t FfiOHOSCipherInitByIv(int64_t id, int32_t opMode, void* key, HcfBlob blob1);
81 FFI_EXPORT int32_t FfiOHOSCipherInitByGcm(int64_t id, int32_t opMode, void* key, CParamsSpec spec);
82 FFI_EXPORT int32_t FfiOHOSCipherInitByCcm(int64_t id, int32_t opMode, void* key, CParamsSpec spec);
83 FFI_EXPORT int32_t FfiOHOSCipherInitWithOutParams(int64_t id, int32_t opMode, void* key);
/base/security/crypto_framework/interfaces/inner_api/crypto_operation/
H A Dcipher.h58 HcfResult (*init)(HcfCipher *self, enum HcfCryptoMode opMode,
/base/security/crypto_framework/frameworks/js/napi/crypto/src/
H A Dnapi_cipher.cpp48 enum HcfCryptoMode opMode = ENCRYPT_MODE; member
177 // get opMode, type is uint32 in BuildContextForInit()
179 if (napi_get_value_uint32(env, argv[index++], reinterpret_cast<uint32_t *>(&(context->opMode))) != napi_ok) { in BuildContextForInit()
180 LOGE("get opMode failed!"); in BuildContextForInit()
196 if (!GetParamsSpecFromNapiValue(env, argv[index], context->opMode, &context->paramsSpec)) { in BuildContextForInit()
348 context->errCode = cipher->init(cipher, context->opMode, key, params); in AsyncInitProcess()
538 static napi_value SyncInit(napi_env env, HcfCipher *cipher, HcfCryptoMode opMode, HcfKey *key, in SyncInit() argument
541 HcfResult res = cipher->init(cipher, opMode, key, paramsSpec); in SyncInit()
569 // get opMode, type is uint32 in JsCipherInitSync()
571 enum HcfCryptoMode opMode in JsCipherInitSync() local
[all...]
H A Dnapi_utils.cpp404 static bool GetGcmParamsSpec(napi_env env, napi_value arg, HcfCryptoMode opMode, HcfParamsSpec **paramsSpec) in GetGcmParamsSpec() argument
424 if (opMode == DECRYPT_MODE) { in GetGcmParamsSpec()
430 } else if (opMode == ENCRYPT_MODE) { in GetGcmParamsSpec()
444 gcmParamsSpec->tag = opMode == DECRYPT_MODE ? *tag : authTag; in GetGcmParamsSpec()
460 static bool GetCcmParamsSpec(napi_env env, napi_value arg, HcfCryptoMode opMode, HcfParamsSpec **paramsSpec) in GetCcmParamsSpec() argument
479 if (opMode == DECRYPT_MODE) { in GetCcmParamsSpec()
485 } else if (opMode == ENCRYPT_MODE) { in GetCcmParamsSpec()
498 ccmParamsSpec->tag = opMode == DECRYPT_MODE ? *tag : authTag; in GetCcmParamsSpec()
514 bool GetParamsSpecFromNapiValue(napi_env env, napi_value arg, HcfCryptoMode opMode, HcfParamsSpec **paramsSpec) in GetParamsSpecFromNapiValue() argument
541 return GetGcmParamsSpec(env, arg, opMode, paramsSpe in GetParamsSpecFromNapiValue()
[all...]
/base/security/crypto_framework/frameworks/js/napi/crypto/inc/
H A Dnapi_utils.h56 bool GetParamsSpecFromNapiValue(napi_env env, napi_value arg, HcfCryptoMode opMode, HcfParamsSpec **paramsSpec);
/base/security/crypto_framework/frameworks/crypto_operation/
H A Dcipher.c275 static HcfResult CipherInit(HcfCipher *self, enum HcfCryptoMode opMode, in CipherInit() argument
287 return impl->spiObj->init(impl->spiObj, opMode, key, params); in CipherInit()
/base/security/crypto_framework/frameworks/native/src/
H A Dsym_cipher.c30 HcfResult (*init)(HcfCipher *self, enum HcfCryptoMode opMode,

Completed in 12 milliseconds