From 6a9bed68d7f050c9ac350d5c65574349d2b0d026 Mon Sep 17 00:00:00 2001 From: lcc Date: Fri, 13 Jun 2025 09:28:41 +0800 Subject: [PATCH] =?UTF-8?q?public=20=E6=8E=A5=E5=8F=A3=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lcc --- frameworks/native/src/signature.c | 6 +++--- interfaces/kits/native/include/crypto_digest.h | 12 ++---------- interfaces/kits/native/include/crypto_signature.h | 4 ++-- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/frameworks/native/src/signature.c b/frameworks/native/src/signature.c index 105281c..0168a17 100644 --- a/frameworks/native/src/signature.c +++ b/frameworks/native/src/signature.c @@ -354,20 +354,20 @@ struct OH_CryptoEccSignatureSpec { }; -OH_Crypto_ErrCode OH_CryptoEccSignatureSpec_Create(Crypto_DataBlob *EccSignature, OH_CryptoEccSignatureSpec **spec) +OH_Crypto_ErrCode OH_CryptoEccSignatureSpec_Create(Crypto_DataBlob *eccSignature, OH_CryptoEccSignatureSpec **spec) { if (spec == NULL) { return CRYPTO_PARAMETER_CHECK_FAILED; } HcfResult ret = HCF_INVALID_PARAMS; - if (EccSignature == NULL) { + if (eccSignature == NULL) { *spec = (OH_CryptoEccSignatureSpec *)HcfMalloc(sizeof(OH_CryptoEccSignatureSpec), 0); if (*spec == NULL) { return CRYPTO_MEMORY_ERROR; } return GetOhCryptoErrCodeNew(HCF_SUCCESS); } - ret = HcfGenEcSignatureSpecByData((HcfBlob *)EccSignature, (Sm2EcSignatureDataSpec **)spec); + ret = HcfGenEcSignatureSpecByData((HcfBlob *)eccSignature, (Sm2EcSignatureDataSpec **)spec); return GetOhCryptoErrCodeNew(ret); } diff --git a/interfaces/kits/native/include/crypto_digest.h b/interfaces/kits/native/include/crypto_digest.h index 4d44edd..1af6115 100644 --- a/interfaces/kits/native/include/crypto_digest.h +++ b/interfaces/kits/native/include/crypto_digest.h @@ -97,11 +97,8 @@ OH_Crypto_ErrCode OH_CryptoDigest_Final(OH_CryptoDigest *ctx, Crypto_DataBlob *o * @brief Get the digest length of the digest context. * * @param ctx Indicates the digest context. - * @return {@link OH_Crypto_ErrCode#CRYPTO_SUCCESS} 0 - If the operation is successful. - * {@link OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS} 401 - If parameter is invalid. - * {@link OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED} 801 - If the operation is not supported. - * {@link OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR} 17620001 - If memory operation failed. - * {@link OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR} 17630001 - If crypto opertion failed. + * @return Return the digest length. + * If the input parameter ctx is NULL, 401 is returned, in other failure scenarios, 0 is returned. * @since 12 */ uint32_t OH_CryptoDigest_GetLength(OH_CryptoDigest *ctx); @@ -119,11 +116,6 @@ const char *OH_CryptoDigest_GetAlgoName(OH_CryptoDigest *ctx); * @brief Destroy the digest context. * * @param ctx Indicates the digest context. - * @return {@link OH_Crypto_ErrCode#CRYPTO_SUCCESS} 0 - If the operation is successful. - * {@link OH_Crypto_ErrCode#CRYPTO_INVALID_PARAMS} 401 - If parameter is invalid. - * {@link OH_Crypto_ErrCode#CRYPTO_NOT_SUPPORTED} 801 - If the operation is not supported. - * {@link OH_Crypto_ErrCode#CRYPTO_MEMORY_ERROR} 17620001 - If memory operation failed. - * {@link OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR} 17630001 - If crypto opertion failed. * @since 12 */ void OH_DigestCrypto_Destroy(OH_CryptoDigest *ctx); diff --git a/interfaces/kits/native/include/crypto_signature.h b/interfaces/kits/native/include/crypto_signature.h index 7982b27..9044886 100644 --- a/interfaces/kits/native/include/crypto_signature.h +++ b/interfaces/kits/native/include/crypto_signature.h @@ -323,7 +323,7 @@ typedef struct OH_CryptoEccSignatureSpec OH_CryptoEccSignatureSpec; /** * @brief Creates the ECC signature spec, also support SM2 signature. * - * @param EccSignature Indicates the ECC signature in DER format, if EccSignature parameter is NULL, + * @param eccSignature Indicates the ECC signature in DER format, if eccSignature parameter is NULL, * an empty ECC signature spec will be created. * @param spec Indicates the output ECC signature spec. * @return {@link OH_Crypto_ErrCode#CRYPTO_SUCCESS} 0 - If the operation is successful. @@ -333,7 +333,7 @@ typedef struct OH_CryptoEccSignatureSpec OH_CryptoEccSignatureSpec; * {@link OH_Crypto_ErrCode#CRYPTO_OPERTION_ERROR} 17630001 - If crypto operation failed. * @since 20 */ -OH_Crypto_ErrCode OH_CryptoEccSignatureSpec_Create(Crypto_DataBlob *EccSignature, +OH_Crypto_ErrCode OH_CryptoEccSignatureSpec_Create(Crypto_DataBlob *eccSignature, OH_CryptoEccSignatureSpec **spec); /** -- Gitee