已合并
feat:support ISO9796-2:1997 RSA sig0.2 #951
dsy678创建于 2025年12月26日
feat:support ISO9796-2:1997 RSA sig0.2 #951
已合并
共 9 个文件变更+789-23
| @@ -652,8 +652,9 @@ chacha20poly1305, chacha20, rsa" | |||
| 652 | #endif | 652 | #endif |
| 653 | 653 | ||
| 654 | #if defined(HITLS_CRYPTO_RSA_SIGN) || defined(HITLS_CRYPTO_RSA_VERIFY) | 654 | #if defined(HITLS_CRYPTO_RSA_SIGN) || defined(HITLS_CRYPTO_RSA_VERIFY) |
| 655 | - #if !defined(HITLS_CRYPTO_RSA_EMSA_PSS) && !defined(HITLS_CRYPTO_RSA_EMSA_PKCSV15) | 655 | + #if !defined(HITLS_CRYPTO_RSA_EMSA_PSS) && !defined(HITLS_CRYPTO_RSA_EMSA_PKCSV15) && \ |
| 656 | - #error "[HiTLS] The rsa_sign/rsa_verify must work with rsa_emsa_pss/rsa_emsa_pkcsv15" | 656 | + !defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) |
| 657 | + #error "[HiTLS] The rsa_sign/rsa_verify must work with rsa_emsa_pss/rsa_emsa_pkcsv15/rsa_emsa_iso9796_2" | ||
| 657 | #endif | 658 | #endif |
| 658 | #endif | 659 | #endif |
| 659 | 660 | ||
| @@ -671,9 +672,10 @@ chacha20poly1305, chacha20, rsa" | |||
| 671 | #endif | 672 | #endif |
| 672 | #endif | 673 | #endif |
| 673 | 674 | ||
| 674 | -#if defined(HITLS_CRYPTO_RSA_EMSA_PSS) || defined(HITLS_CRYPTO_RSA_EMSA_PKCSV15) | 675 | +#if defined(HITLS_CRYPTO_RSA_EMSA_PSS) || defined(HITLS_CRYPTO_RSA_EMSA_PKCSV15) || \ |
| 676 | + defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) | ||
| 675 | #if !defined(HITLS_CRYPTO_RSA_SIGN) && !defined(HITLS_CRYPTO_RSA_VERIFY) | 677 | #if !defined(HITLS_CRYPTO_RSA_SIGN) && !defined(HITLS_CRYPTO_RSA_VERIFY) |
| 676 | - #error "[HiTLS] The rsa_emsa_pss/rsa_emsa_pkcsv15 must work with rsa_sign/rsa_verify" | 678 | + #error "[HiTLS] The rsa_emsa_pss/rsa_emsa_pkcsv15/rsa_emsa_iso9796_2 must work with rsa_sign/rsa_verify" |
| 677 | #endif | 679 | #endif |
| 678 | #endif | 680 | #endif |
| 679 | 681 | ||
| @@ -394,6 +394,9 @@ | |||
| 394 | #ifndef HITLS_CRYPTO_RSA_EMSA_PSS | 394 | #ifndef HITLS_CRYPTO_RSA_EMSA_PSS |
| 395 | #define HITLS_CRYPTO_RSA_EMSA_PSS | 395 | #define HITLS_CRYPTO_RSA_EMSA_PSS |
| 396 | #endif | 396 | #endif |
| 397 | + #ifndef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 398 | + #define HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 399 | + #endif | ||
| 397 | #ifndef HITLS_CRYPTO_RSA_EMSA_PKCSV15 | 400 | #ifndef HITLS_CRYPTO_RSA_EMSA_PKCSV15 |
| 398 | #define HITLS_CRYPTO_RSA_EMSA_PKCSV15 | 401 | #define HITLS_CRYPTO_RSA_EMSA_PKCSV15 |
| 399 | #endif | 402 | #endif |
| @@ -412,6 +415,7 @@ | |||
| 412 | #endif | 415 | #endif |
| 413 | 416 | ||
| 414 | #if defined(HITLS_CRYPTO_RSA_EMSA_PSS) || defined(HITLS_CRYPTO_RSA_EMSA_PKCSV15) || \ | 417 | #if defined(HITLS_CRYPTO_RSA_EMSA_PSS) || defined(HITLS_CRYPTO_RSA_EMSA_PKCSV15) || \ |
| 418 | + defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) || \ | ||
| 415 | defined(HITLS_CRYPTO_RSAES_OAEP) || defined(HITLS_CRYPTO_RSAES_PKCSV15) || \ | 419 | defined(HITLS_CRYPTO_RSAES_OAEP) || defined(HITLS_CRYPTO_RSAES_PKCSV15) || \ |
| 416 | defined(HITLS_CRYPTO_RSAES_PKCSV15_TLS) || defined(HITLS_CRYPTO_RSA_NO_PAD) | 420 | defined(HITLS_CRYPTO_RSAES_PKCSV15_TLS) || defined(HITLS_CRYPTO_RSA_NO_PAD) |
| 417 | #ifndef HITLS_CRYPTO_RSA_PAD | 421 | #ifndef HITLS_CRYPTO_RSA_PAD |
| @@ -87,6 +87,21 @@ static int32_t SetEmsaPss(CRYPT_RSA_Ctx *ctx, RSA_PadingPara *pad) | |||
| 87 | } | 87 | } |
| 88 | #endif // HITLS_CRYPTO_RSA_EMSA_PSS | 88 | #endif // HITLS_CRYPTO_RSA_EMSA_PSS |
| 89 | 89 | ||
| 90 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 91 | +static int32_t SetEmsaIso9796_2(CRYPT_RSA_Ctx *ctx, RSA_PadingPara *pad) | ||
| 92 | +{ | ||
| 93 | + uint32_t bits = CRYPT_RSA_GetBits(ctx); | ||
| 94 | + if (bits == 0) { | ||
| 95 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_NO_KEY_INFO); | ||
| 96 | + return CRYPT_RSA_NO_KEY_INFO; | ||
| 97 | + } | ||
| 98 | + (void)memset_s(&(ctx->pad), sizeof(RSAPad), 0, sizeof(RSAPad)); | ||
| 99 | + (void)memcpy_s(&(ctx->pad.para.iso9796_2), sizeof(RSA_PadingPara), pad, sizeof(RSA_PadingPara)); | ||
| 100 | + ctx->pad.type = EMSA_ISO9796_2; | ||
| 101 | + return CRYPT_SUCCESS; | ||
| 102 | +} | ||
| 103 | +#endif // HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 104 | + | ||
| 90 | #ifdef HITLS_CRYPTO_RSAES_OAEP | 105 | #ifdef HITLS_CRYPTO_RSAES_OAEP |
| 91 | 106 | ||
| 92 | void SetOaep(CRYPT_RSA_Ctx *ctx, const RSA_PadingPara *val) | 107 | void SetOaep(CRYPT_RSA_Ctx *ctx, const RSA_PadingPara *val) |
| @@ -255,20 +270,23 @@ static int32_t GetPadding(CRYPT_RSA_Ctx *ctx, void *val, uint32_t len) | |||
| 255 | static int32_t GetMd(CRYPT_RSA_Ctx *ctx, void *val, uint32_t len) | 270 | static int32_t GetMd(CRYPT_RSA_Ctx *ctx, void *val, uint32_t len) |
| 256 | { | 271 | { |
| 257 | CRYPT_MD_AlgId *valTmp = val; | 272 | CRYPT_MD_AlgId *valTmp = val; |
| 258 | - if (val == NULL) { | 273 | + RETURN_RET_IF(val == NULL, CRYPT_NULL_INPUT); |
| 259 | - BSL_ERR_PUSH_ERROR(CRYPT_NULL_INPUT); | 274 | + RETURN_RET_IF(len != sizeof(int32_t), CRYPT_INVALID_ARG); |
| 260 | - return CRYPT_NULL_INPUT; | ||
| 261 | - } | ||
| 262 | - if (len != sizeof(int32_t)) { | ||
| 263 | - BSL_ERR_PUSH_ERROR(CRYPT_INVALID_ARG); | ||
| 264 | - return CRYPT_INVALID_ARG; | ||
| 265 | - } | ||
| 266 | - if (ctx->pad.type == EMSA_PKCSV15) { | ||
| 267 | - *valTmp = ctx->pad.para.pkcsv15.mdId; | ||
| 268 | - return CRYPT_SUCCESS; | ||
| 269 | - } | ||
| 270 | - *valTmp = ctx->pad.para.pss.mdId; | ||
| 271 | 275 | ||
| 276 | + switch (ctx->pad.type) { | ||
| 277 | + case EMSA_PKCSV15: | ||
| 278 | + *valTmp = ctx->pad.para.pkcsv15.mdId; | ||
| 279 | + break; | ||
| 280 | + case EMSA_PSS: | ||
| 281 | + *valTmp = ctx->pad.para.pss.mdId; | ||
| 282 | + break; | ||
| 283 | + case EMSA_ISO9796_2: | ||
| 284 | + *valTmp = ctx->pad.para.iso9796_2.mdId; | ||
| 285 | + break; | ||
| 286 | + default: | ||
| 287 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_PAD_NO_SET_ERROR); | ||
| 288 | + return CRYPT_RSA_PAD_NO_SET_ERROR; | ||
| 289 | + } | ||
| 272 | return CRYPT_SUCCESS; | 290 | return CRYPT_SUCCESS; |
| 273 | } | 291 | } |
| 274 | 292 | ||
| @@ -360,7 +378,8 @@ static int32_t SetRsaPad(CRYPT_RSA_Ctx *ctx, const void *val, uint32_t len) | |||
| 360 | return CRYPT_SUCCESS; | 378 | return CRYPT_SUCCESS; |
| 361 | } | 379 | } |
| 362 | 380 | ||
| 363 | -#if defined(HITLS_CRYPTO_RSAES_OAEP) || defined(HITLS_CRYPTO_RSA_EMSA_PSS) | 381 | +#if defined(HITLS_CRYPTO_RSAES_OAEP) || defined(HITLS_CRYPTO_RSA_EMSA_PSS) || \ |
| 382 | + defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) | ||
| 364 | static int32_t MdIdCheckSha1Sha2(CRYPT_MD_AlgId id) | 383 | static int32_t MdIdCheckSha1Sha2(CRYPT_MD_AlgId id) |
| 365 | { | 384 | { |
| 366 | if (id < CRYPT_MD_MD5 || id > CRYPT_MD_SHA512) { | 385 | if (id < CRYPT_MD_MD5 || id > CRYPT_MD_SHA512) { |
| @@ -465,6 +484,38 @@ ERR: | |||
| 465 | } | 484 | } |
| 466 | #endif | 485 | #endif |
| 467 | 486 | ||
| 487 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 488 | +static int32_t RsaSetIso9796_2(CRYPT_RSA_Ctx *ctx, BSL_Param *param) | ||
| 489 | +{ | ||
| 490 | + RSA_PadingPara padPara = {0}; | ||
| 491 | + if (param == NULL) { | ||
| 492 | + BSL_ERR_PUSH_ERROR(CRYPT_NULL_INPUT); | ||
| 493 | + return CRYPT_NULL_INPUT; | ||
| 494 | + } | ||
| 495 | + | ||
| 496 | + const BSL_Param *temp = BSL_PARAM_FindConstParam(param, CRYPT_PARAM_RSA_MD_ID); | ||
| 497 | + if (temp == NULL || temp->value == NULL || temp->valueLen == 0) { | ||
| 498 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_ERR_INPUT_VALUE); | ||
| 499 | + return CRYPT_RSA_ERR_INPUT_VALUE; | ||
| 500 | + } | ||
| 501 | + uint32_t len = sizeof(padPara.mdId); | ||
| 502 | + int32_t ret = CRYPT_SUCCESS; | ||
| 503 | + GOTO_ERR_IF(BSL_PARAM_GetValue(temp, CRYPT_PARAM_RSA_MD_ID, BSL_PARAM_TYPE_INT32, &padPara.mdId, &len), ret); | ||
| 504 | + | ||
| 505 | + padPara.mdMeth = EAL_MdFindMethod(padPara.mdId); | ||
| 506 | + if (padPara.mdMeth == NULL) { | ||
| 507 | + BSL_ERR_PUSH_ERROR(CRYPT_EAL_ERR_ALGID); | ||
| 508 | + return CRYPT_EAL_ERR_ALGID; | ||
| 509 | + } | ||
| 510 | + ret = SetEmsaIso9796_2(ctx, &padPara); | ||
| 511 | + if (ret != CRYPT_SUCCESS) { | ||
| 512 | + BSL_ERR_PUSH_ERROR(ret); | ||
| 513 | + } | ||
| 514 | +ERR: | ||
| 515 | + return ret; | ||
| 516 | +} | ||
| 517 | +#endif | ||
| 518 | + | ||
| 468 | static int32_t RsaCommonCtrl(CRYPT_RSA_Ctx *ctx, int32_t opt, void *val, uint32_t len) | 519 | static int32_t RsaCommonCtrl(CRYPT_RSA_Ctx *ctx, int32_t opt, void *val, uint32_t len) |
| 469 | { | 520 | { |
| 470 | switch (opt) { | 521 | switch (opt) { |
| @@ -573,6 +624,10 @@ int32_t CRYPT_RSA_Ctrl(CRYPT_RSA_Ctx *ctx, int32_t opt, void *val, uint32_t len) | |||
| 573 | return SetSalt(ctx, val, len); | 624 | return SetSalt(ctx, val, len); |
| 574 | case CRYPT_CTRL_GET_RSA_SALTLEN: | 625 | case CRYPT_CTRL_GET_RSA_SALTLEN: |
| 575 | return GetSaltLen(ctx, val, len); | 626 | return GetSaltLen(ctx, val, len); |
| 627 | +#endif | ||
| 628 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 629 | + case CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2: | ||
| 630 | + return RsaSetIso9796_2(ctx, val); | ||
| 576 | #endif | 631 | #endif |
| 577 | case CRYPT_CTRL_GET_RSA_PADDING: | 632 | case CRYPT_CTRL_GET_RSA_PADDING: |
| 578 | return GetPadding(ctx, val, len); | 633 | return GetPadding(ctx, val, len); |
| @@ -507,6 +507,9 @@ static uint32_t GetHashLen(const CRYPT_RSA_Ctx *ctx) | |||
| 507 | if (ctx->pad.type == EMSA_PKCSV15) { | 507 | if (ctx->pad.type == EMSA_PKCSV15) { |
| 508 | return CRYPT_GetMdSizeById(ctx->pad.para.pkcsv15.mdId); | 508 | return CRYPT_GetMdSizeById(ctx->pad.para.pkcsv15.mdId); |
| 509 | } | 509 | } |
| 510 | + if (ctx->pad.type == EMSA_ISO9796_2) { | ||
| 511 | + return (uint32_t)(ctx->pad.para.iso9796_2.mdMeth->mdSize); | ||
| 512 | + } | ||
| 510 | 513 | ||
| 511 | return (uint32_t)(ctx->pad.para.pss.mdMeth->mdSize); | 514 | return (uint32_t)(ctx->pad.para.pss.mdMeth->mdSize); |
| 512 | } | 515 | } |
| @@ -795,6 +798,78 @@ int32_t CRYPT_RSA_UnBlind(const CRYPT_RSA_Ctx *ctx, const uint8_t *input, uint32 | |||
| 795 | #endif // HITLS_CRYPTO_RSA_VERIFY | 798 | #endif // HITLS_CRYPTO_RSA_VERIFY |
| 796 | #endif // HITLS_CRYPTO_RSA_BSSA | 799 | #endif // HITLS_CRYPTO_RSA_BSSA |
| 797 | 800 | ||
| 801 | +#if defined(HITLS_CRYPTO_RSA_SIGN) || defined(HITLS_CRYPTO_RSA_VERIFY) | ||
| 802 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 803 | +static int32_t Iso9796_2_CheckMlHashLen(const CRYPT_RSA_Ctx *ctx, uint32_t mlHashLen) | ||
| 804 | +{ | ||
| 805 | + uint32_t bits = CRYPT_RSA_GetBits(ctx); | ||
| 806 | + uint32_t emLen = BN_BITS_TO_BYTES(bits); | ||
| 807 | + uint32_t hLen = (uint32_t)ctx->pad.para.iso9796_2.mdMeth->mdSize; | ||
| 808 | + | ||
| 809 | + // Verify whether the signature algorithm and hash algorithm match reasonably. | ||
| 810 | + if (emLen < hLen + 2) { | ||
| 811 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_ERR_INPUT_VALUE); | ||
| 812 | + return CRYPT_RSA_ERR_INPUT_VALUE; | ||
| 813 | + } | ||
| 814 | + // To check if the length of mlHashLen is valid: mlHashLen == emLen - 2 | ||
| 815 | + if (mlHashLen != emLen - 2) { | ||
| 816 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_ERR_INPUT_VALUE); | ||
| 817 | + return CRYPT_RSA_ERR_INPUT_VALUE; | ||
| 818 | + } | ||
| 819 | + return CRYPT_SUCCESS; | ||
| 820 | +} | ||
| 821 | +#endif // HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 822 | + | ||
| 823 | +static int32_t RsaGetSignVerifyData(CRYPT_RSA_Ctx *ctx, const uint8_t *hash, uint32_t hashLen, | ||
| 824 | + const uint8_t *msg, uint32_t msgLen, uint8_t **data, uint32_t *dataLen, bool *needFree) | ||
| 825 | +{ | ||
| 826 | + if (ctx->pad.type != EMSA_ISO9796_2) { | ||
| 827 | + *data = (uint8_t *)(uintptr_t)hash; | ||
| 828 | + *dataLen = hashLen; | ||
| 829 | + *needFree = false; | ||
| 830 | + return CRYPT_SUCCESS; | ||
| 831 | + } | ||
| 832 | + uint32_t bits = CRYPT_RSA_GetBits(ctx); | ||
| 833 | + uint32_t emLen = BN_BITS_TO_BYTES(bits); | ||
| 834 | + | ||
| 835 | + uint32_t hLen = (uint32_t)ctx->pad.para.iso9796_2.mdMeth->mdSize; | ||
| 836 | + | ||
| 837 | + // Verify whether the signature algorithm and hash algorithm match reasonably. | ||
| 838 | + if (emLen < hLen + 2) { | ||
| 839 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_ERR_INPUT_VALUE); | ||
| 840 | + return CRYPT_RSA_ERR_INPUT_VALUE; | ||
| 841 | + } | ||
| 842 | + // message length verification | ||
| 843 | + uint32_t mLLen = emLen - hLen - 2; | ||
| 844 | + if (msgLen < mLLen) { | ||
| 845 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_ERR_INPUT_VALUE); | ||
| 846 | + return CRYPT_RSA_ERR_INPUT_VALUE; | ||
| 847 | + } | ||
| 848 | + | ||
| 849 | + // mL + hash | ||
| 850 | + uint32_t mlHashLen = mLLen + hLen; | ||
| 851 | + uint8_t *mlHash = BSL_SAL_Malloc(mlHashLen); | ||
| 852 | + if (mlHash == NULL) { | ||
| 853 | + BSL_ERR_PUSH_ERROR(CRYPT_MEM_ALLOC_FAIL); | ||
| 854 | + return CRYPT_MEM_ALLOC_FAIL; | ||
| 855 | + } | ||
| 856 | + if (mLLen > 0 && memcpy_s(mlHash, mlHashLen, msg, mLLen) != EOK) { | ||
| 857 | + BSL_ERR_PUSH_ERROR(CRYPT_SECUREC_FAIL); | ||
| 858 | + BSL_SAL_FREE(mlHash); | ||
| 859 | + return CRYPT_SECUREC_FAIL; | ||
| 860 | + } | ||
| 861 | + if (memcpy_s(mlHash + mLLen, mlHashLen - mLLen, hash, hLen) != EOK) { | ||
| 862 | + BSL_ERR_PUSH_ERROR(CRYPT_SECUREC_FAIL); | ||
| 863 | + BSL_SAL_FREE(mlHash); | ||
| 864 | + return CRYPT_SECUREC_FAIL; | ||
| 865 | + } | ||
| 866 | + *data = mlHash; | ||
| 867 | + *dataLen = mlHashLen; | ||
| 868 | + *needFree = true; | ||
| 869 | + return CRYPT_SUCCESS; | ||
| 870 | +} | ||
| 871 | +#endif | ||
| 872 | + | ||
| 798 | #ifdef HITLS_CRYPTO_RSA_SIGN | 873 | #ifdef HITLS_CRYPTO_RSA_SIGN |
| 799 | static int32_t SignInputCheck(const CRYPT_RSA_Ctx *ctx, const uint8_t *input, uint32_t inputLen, | 874 | static int32_t SignInputCheck(const CRYPT_RSA_Ctx *ctx, const uint8_t *input, uint32_t inputLen, |
| 800 | const uint8_t *out, const uint32_t *outLen) | 875 | const uint8_t *out, const uint32_t *outLen) |
| @@ -814,7 +889,7 @@ static int32_t SignInputCheck(const CRYPT_RSA_Ctx *ctx, const uint8_t *input, ui | |||
| 814 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_BUFF_LEN_NOT_ENOUGH); | 889 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_BUFF_LEN_NOT_ENOUGH); |
| 815 | return CRYPT_RSA_BUFF_LEN_NOT_ENOUGH; | 890 | return CRYPT_RSA_BUFF_LEN_NOT_ENOUGH; |
| 816 | } | 891 | } |
| 817 | - if (ctx->pad.type != EMSA_PKCSV15 && ctx->pad.type != EMSA_PSS) { | 892 | + if (ctx->pad.type != EMSA_PKCSV15 && ctx->pad.type != EMSA_PSS && ctx->pad.type != EMSA_ISO9796_2) { |
| 818 | // No padding type is set. | 893 | // No padding type is set. |
| 819 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_PAD_NO_SET_ERROR); | 894 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_PAD_NO_SET_ERROR); |
| 820 | return CRYPT_RSA_PAD_NO_SET_ERROR; | 895 | return CRYPT_RSA_PAD_NO_SET_ERROR; |
| @@ -827,6 +902,11 @@ static int32_t SignInputCheck(const CRYPT_RSA_Ctx *ctx, const uint8_t *input, ui | |||
| 827 | } | 902 | } |
| 828 | return CRYPT_SUCCESS; | 903 | return CRYPT_SUCCESS; |
| 829 | } | 904 | } |
| 905 | +#endif | ||
| 906 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 907 | + if (ctx->pad.type == EMSA_ISO9796_2) { | ||
| 908 | + return Iso9796_2_CheckMlHashLen(ctx, inputLen); | ||
| 909 | + } | ||
| 830 | #endif | 910 | #endif |
| 831 | if (GetHashLen(ctx) != inputLen) { | 911 | if (GetHashLen(ctx) != inputLen) { |
| 832 | return CheckHashLen(inputLen); | 912 | return CheckHashLen(inputLen); |
| @@ -860,6 +940,11 @@ int32_t CRYPT_RSA_SignData(CRYPT_RSA_Ctx *ctx, const uint8_t *data, uint32_t dat | |||
| 860 | dataLen, pad, padLen); | 940 | dataLen, pad, padLen); |
| 861 | break; | 941 | break; |
| 862 | #endif | 942 | #endif |
| 943 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 944 | + case EMSA_ISO9796_2: | ||
| 945 | + ret = CRYPT_RSA_SetIso9796_2(data, dataLen, pad, padLen); | ||
| 946 | + break; | ||
| 947 | +#endif | ||
| 863 | #ifdef HITLS_CRYPTO_RSA_EMSA_PSS | 948 | #ifdef HITLS_CRYPTO_RSA_EMSA_PSS |
| 864 | case EMSA_PSS: | 949 | case EMSA_PSS: |
| 865 | ret = PssPad(ctx, data, dataLen, pad, padLen); | 950 | ret = PssPad(ctx, data, dataLen, pad, padLen); |
| @@ -893,7 +978,18 @@ int32_t CRYPT_RSA_Sign(CRYPT_RSA_Ctx *ctx, int32_t algId, const uint8_t *data, u | |||
| 893 | BSL_ERR_PUSH_ERROR(ret); | 978 | BSL_ERR_PUSH_ERROR(ret); |
| 894 | return ret; | 979 | return ret; |
| 895 | } | 980 | } |
| 896 | - return CRYPT_RSA_SignData(ctx, hash, hashLen, sign, signLen); | 981 | + uint8_t *signData = NULL; |
| 982 | + uint32_t signDataLen = 0; | ||
| 983 | + bool needFree = false; | ||
| 984 | + ret = RsaGetSignVerifyData(ctx, hash, hashLen, data, dataLen, &signData, &signDataLen, &needFree); | ||
| 985 | + if (ret != CRYPT_SUCCESS) { | ||
| 986 | + return ret; | ||
| 987 | + } | ||
| 988 | + ret = CRYPT_RSA_SignData(ctx, signData, signDataLen, sign, signLen); | ||
| 989 | + if (needFree) { | ||
| 990 | + BSL_SAL_FREE(signData); | ||
| 991 | + } | ||
| 992 | + return ret; | ||
| 897 | } | 993 | } |
| 898 | #endif // HITLS_CRYPTO_RSA_SIGN | 994 | #endif // HITLS_CRYPTO_RSA_SIGN |
| 899 | 995 | ||
| @@ -910,11 +1006,16 @@ static int32_t VerifyInputCheck(const CRYPT_RSA_Ctx *ctx, const uint8_t *data, u | |||
| 910 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_NO_KEY_INFO); | 1006 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_NO_KEY_INFO); |
| 911 | return CRYPT_RSA_NO_KEY_INFO; | 1007 | return CRYPT_RSA_NO_KEY_INFO; |
| 912 | } | 1008 | } |
| 913 | - if (ctx->pad.type != EMSA_PKCSV15 && ctx->pad.type != EMSA_PSS) { | 1009 | + if (ctx->pad.type != EMSA_PKCSV15 && ctx->pad.type != EMSA_PSS && ctx->pad.type != EMSA_ISO9796_2) { |
| 914 | // No padding type is set. | 1010 | // No padding type is set. |
| 915 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_PAD_NO_SET_ERROR); | 1011 | BSL_ERR_PUSH_ERROR(CRYPT_RSA_PAD_NO_SET_ERROR); |
| 916 | return CRYPT_RSA_PAD_NO_SET_ERROR; | 1012 | return CRYPT_RSA_PAD_NO_SET_ERROR; |
| 917 | } | 1013 | } |
| 1014 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 1015 | + if (ctx->pad.type == EMSA_ISO9796_2) { | ||
| 1016 | + return Iso9796_2_CheckMlHashLen(ctx, dataLen); | ||
| 1017 | + } | ||
| 1018 | +#endif | ||
| 918 | if (GetHashLen(ctx) != dataLen) { | 1019 | if (GetHashLen(ctx) != dataLen) { |
| 919 | return CheckHashLen(dataLen); | 1020 | return CheckHashLen(dataLen); |
| 920 | } | 1021 | } |
| @@ -952,6 +1053,11 @@ int32_t CRYPT_RSA_VerifyData(CRYPT_RSA_Ctx *ctx, const uint8_t *data, uint32_t d | |||
| 952 | data, dataLen); | 1053 | data, dataLen); |
| 953 | break; | 1054 | break; |
| 954 | #endif | 1055 | #endif |
| 1056 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 1057 | + case EMSA_ISO9796_2: | ||
| 1058 | + ret = CRYPT_RSA_VerifyIso9796_2(data, dataLen, pad, padLen); | ||
| 1059 | + break; | ||
| 1060 | +#endif | ||
| 955 | #ifdef HITLS_CRYPTO_RSA_EMSA_PSS | 1061 | #ifdef HITLS_CRYPTO_RSA_EMSA_PSS |
| 956 | case EMSA_PSS: | 1062 | case EMSA_PSS: |
| 957 | saltLen = (uint32_t)ctx->pad.para.pss.saltLen; | 1063 | saltLen = (uint32_t)ctx->pad.para.pss.saltLen; |
| @@ -988,7 +1094,18 @@ int32_t CRYPT_RSA_Verify(CRYPT_RSA_Ctx *ctx, int32_t algId, const uint8_t *data, | |||
| 988 | BSL_ERR_PUSH_ERROR(ret); | 1094 | BSL_ERR_PUSH_ERROR(ret); |
| 989 | return ret; | 1095 | return ret; |
| 990 | } | 1096 | } |
| 991 | - return CRYPT_RSA_VerifyData(ctx, hash, hashLen, sign, signLen); | 1097 | + uint8_t *verifyData = NULL; |
| 1098 | + uint32_t verifyDataLen = 0; | ||
| 1099 | + bool needFree = false; | ||
| 1100 | + ret = RsaGetSignVerifyData(ctx, hash, hashLen, data, dataLen, &verifyData, &verifyDataLen, &needFree); | ||
| 1101 | + if (ret != CRYPT_SUCCESS) { | ||
| 1102 | + return ret; | ||
| 1103 | + } | ||
| 1104 | + ret = CRYPT_RSA_VerifyData(ctx, verifyData, verifyDataLen, sign, signLen); | ||
| 1105 | + if (needFree) { | ||
| 1106 | + BSL_SAL_FREE(verifyData); | ||
| 1107 | + } | ||
| 1108 | + return ret; | ||
| 992 | } | 1109 | } |
| 993 | #endif // HITLS_CRYPTO_RSA_VERIFY | 1110 | #endif // HITLS_CRYPTO_RSA_VERIFY |
| 994 | 1111 | ||
| @@ -90,6 +90,7 @@ typedef enum { | |||
| 90 | RSA_NO_PAD, | 90 | RSA_NO_PAD, |
| 91 | RSAES_PKCSV15_TLS, /* Specific RSA pkcs1.5 padding verification process | 91 | RSAES_PKCSV15_TLS, /* Specific RSA pkcs1.5 padding verification process |
| 92 | to prevent possible Bleichenbacher attacks */ | 92 | to prevent possible Bleichenbacher attacks */ |
| 93 | + EMSA_ISO9796_2, /**< ISO/IEC 9796-2:1997 partial message recovery */ | ||
| 93 | } RSA_PadType; | 94 | } RSA_PadType; |
| 94 | 95 | ||
| 95 | /** | 96 | /** |
| @@ -106,6 +107,7 @@ typedef struct { | |||
| 106 | union { | 107 | union { |
| 107 | RSA_PkcsV15Para pkcsv15; /**< pkcsv15 padding mode */ | 108 | RSA_PkcsV15Para pkcsv15; /**< pkcsv15 padding mode */ |
| 108 | RSA_PadingPara pss; /**< pss padding mode */ | 109 | RSA_PadingPara pss; /**< pss padding mode */ |
| 110 | + RSA_PadingPara iso9796_2; /**< ISO9796-2:1997 partial message recovery */ | ||
| 109 | RSA_PadingPara oaep; /**< oaep padding mode */ | 111 | RSA_PadingPara oaep; /**< oaep padding mode */ |
| 110 | } para; /**< padding mode combination, including pss and pkcsv15 */ | 112 | } para; /**< padding mode combination, including pss and pkcsv15 */ |
| 111 | CRYPT_Data salt; // Used for the KAT test. | 113 | CRYPT_Data salt; // Used for the KAT test. |
| @@ -140,6 +142,13 @@ CRYPT_RSA_Para *CRYPT_RSA_DupPara(const CRYPT_RSA_Para *para); | |||
| 140 | int32_t CRYPT_RSA_UnPackPkcsV15Type1(uint8_t *data, uint32_t dataLen, uint8_t *out, uint32_t *outLen); | 142 | int32_t CRYPT_RSA_UnPackPkcsV15Type1(uint8_t *data, uint32_t dataLen, uint8_t *out, uint32_t *outLen); |
| 141 | #endif | 143 | #endif |
| 142 | 144 | ||
| 145 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 146 | +int32_t CRYPT_RSA_SetIso9796_2(const uint8_t *mlHash, uint32_t mlHashLen, | ||
| 147 | + uint8_t *pad, uint32_t padLen); | ||
| 148 | +int32_t CRYPT_RSA_VerifyIso9796_2(const uint8_t *mlHash, uint32_t mlHashLen, | ||
| 149 | + const uint8_t *pad, uint32_t padLen); | ||
| 150 | +#endif | ||
| 151 | + | ||
| 143 | #if defined(HITLS_CRYPTO_RSA_BLINDING) || defined(HITLS_CRYPTO_RSA_BSSA) | 152 | #if defined(HITLS_CRYPTO_RSA_BLINDING) || defined(HITLS_CRYPTO_RSA_BSSA) |
| 144 | /** | 153 | /** |
| 145 | * @ingroup rsa | 154 | * @ingroup rsa |
| @@ -350,6 +350,35 @@ int32_t CRYPT_RSA_VerifyPss(const EAL_MdMethod *hashMethod, const EAL_MdMethod * | |||
| 350 | #endif // HITLS_CRYPTO_RSA_VERIFY | 350 | #endif // HITLS_CRYPTO_RSA_VERIFY |
| 351 | #endif // HITLS_CRYPTO_RSA_EMSA_PSS | 351 | #endif // HITLS_CRYPTO_RSA_EMSA_PSS |
| 352 | 352 | ||
| 353 | +#ifdef HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 354 | +// EM = 0x6A || mL || h || 0xBC | ||
| 355 | +int32_t CRYPT_RSA_SetIso9796_2(const uint8_t *mlHash, uint32_t mlHashLen, | ||
| 356 | + uint8_t *pad, uint32_t padLen) | ||
| 357 | +{ | ||
| 358 | + pad[0] = 0x6A; | ||
| 359 | + if (memcpy_s(&pad[1], padLen - 2, mlHash, mlHashLen) != EOK) { | ||
| 360 | + BSL_ERR_PUSH_ERROR(CRYPT_SECUREC_FAIL); | ||
| 361 | + return CRYPT_SECUREC_FAIL; | ||
| 362 | + } | ||
| 363 | + pad[padLen - 1] = 0xBC; | ||
| 364 | + return CRYPT_SUCCESS; | ||
| 365 | +} | ||
| 366 | + | ||
| 367 | +int32_t CRYPT_RSA_VerifyIso9796_2(const uint8_t *mlHash, uint32_t mlHashLen, | ||
| 368 | + const uint8_t *pad, uint32_t padLen) | ||
| 369 | +{ | ||
| 370 | + if (pad[0] != 0x6A || pad[padLen - 1] != 0xBC) { | ||
| 371 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_NOR_VERIFY_FAIL); | ||
| 372 | + return CRYPT_RSA_NOR_VERIFY_FAIL; | ||
| 373 | + } | ||
| 374 | + if (memcmp(&pad[1], mlHash, mlHashLen) != EOK) { | ||
| 375 | + BSL_ERR_PUSH_ERROR(CRYPT_RSA_NOR_VERIFY_FAIL); | ||
| 376 | + return CRYPT_RSA_NOR_VERIFY_FAIL; | ||
| 377 | + } | ||
| 378 | + return CRYPT_SUCCESS; | ||
| 379 | +} | ||
| 380 | +#endif // HITLS_CRYPTO_RSA_EMSA_ISO9796_2 | ||
| 381 | + | ||
| 353 | #ifdef HITLS_CRYPTO_RSA_EMSA_PKCSV15 | 382 | #ifdef HITLS_CRYPTO_RSA_EMSA_PKCSV15 |
| 354 | static int32_t PkcsSetLengthCheck(uint32_t emLen, uint32_t hashLen, uint32_t algIdentLen) | 383 | static int32_t PkcsSetLengthCheck(uint32_t emLen, uint32_t hashLen, uint32_t algIdentLen) |
| 355 | { | 384 | { |
| @@ -640,6 +640,7 @@ typedef enum { | |||
| 640 | CRYPT_CTRL_GET_RSA_MGF, /**< Obtain the mgf algorithm when the RSA algorithm padding mode is PSS. */ | 640 | CRYPT_CTRL_GET_RSA_MGF, /**< Obtain the mgf algorithm when the RSA algorithm padding mode is PSS. */ |
| 641 | CRYPT_CTRL_CLR_RSA_FLAG, /**< RSA clear the flag. */ | 641 | CRYPT_CTRL_CLR_RSA_FLAG, /**< RSA clear the flag. */ |
| 642 | CRYPT_CTRL_SET_RSA_BSSA_FACTOR_R, /**< Set the random bytes for RSA-BSSA. */ | 642 | CRYPT_CTRL_SET_RSA_BSSA_FACTOR_R, /**< Set the random bytes for RSA-BSSA. */ |
| 643 | + CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, /**< RSA set the signature padding mode to ISO/IEC 9796-2. */ | ||
| 643 | 644 | ||
| 644 | // ecc | 645 | // ecc |
| 645 | CRYPT_CTRL_SET_SM2_USER_ID = 300, | 646 | CRYPT_CTRL_SET_SM2_USER_ID = 300, |
| @@ -743,6 +744,7 @@ typedef enum { | |||
| 743 | CRYPT_RSA_NO_PAD, | 744 | CRYPT_RSA_NO_PAD, |
| 744 | CRYPT_RSAES_PKCSV15_TLS, /* Specific RSA pkcs1.5 padding verification process to | 745 | CRYPT_RSAES_PKCSV15_TLS, /* Specific RSA pkcs1.5 padding verification process to |
| 745 | prevent possible Bleichenbacher attacks */ | 746 | prevent possible Bleichenbacher attacks */ |
| 747 | + CRYPT_EMSA_ISO9796_2, /**< ISO/IEC 9796-2:1997 partial message recovery. */ | ||
| 746 | CRYPT_RSA_PADDINGMAX, | 748 | CRYPT_RSA_PADDINGMAX, |
| 747 | } CRYPT_RsaPadType; | 749 | } CRYPT_RsaPadType; |
| 748 | 750 | ||
| @@ -25,6 +25,9 @@ | |||
| 25 | #include "bsl_params.h" | 25 | #include "bsl_params.h" |
| 26 | #include "crypt_params_key.h" | 26 | #include "crypt_params_key.h" |
| 27 | #include "crypt_bn.h" | 27 | #include "crypt_bn.h" |
| 28 | +#include "crypt_rsa.h" | ||
| 29 | +#include "rsa_local.h" | ||
| 30 | + | ||
| 28 | /* END_HEADER */ | 31 | /* END_HEADER */ |
| 29 | 32 | ||
| 30 | #define CRYPT_EAL_PKEY_KEYMGMT_OPERATE 0 | 33 | #define CRYPT_EAL_PKEY_KEYMGMT_OPERATE 0 |
| @@ -1490,4 +1493,489 @@ void SDV_CRYPTO_RSA_RSABSSA_BLINDING_INVALID_PARAM_TC001(void) | |||
| 1490 | EXIT: | 1493 | EXIT: |
| 1491 | CRYPT_EAL_PkeyFreeCtx(pkey); | 1494 | CRYPT_EAL_PkeyFreeCtx(pkey); |
| 1492 | } | 1495 | } |
| 1496 | +/* END_CASE */ | ||
| 1497 | + | ||
| 1498 | +/** | ||
| 1499 | + * @test SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001 | ||
| 1500 | + * @title RSA EAL sign/verify: ISO9796-2 PMR, variable bits/hash, |m| = mL_len + 1 | ||
| 1501 | + * @precon nan | ||
| 1502 | + * @brief | ||
| 1503 | + * 1. Create RSA context and set key size and exponent, expected result 1. | ||
| 1504 | + * 2. Generate key pair, expected result 2. | ||
| 1505 | + * 3. Set padding to ISO9796-2 with given hash, expected result 3. | ||
| 1506 | + * 4. Sign a message with length mL_len + 1, expected result 4. | ||
| 1507 | + * 5. Verify the signature, expected result 5. | ||
| 1508 | + * @expect | ||
| 1509 | + * 1-5. CRYPT_SUCCESS. | ||
| 1510 | + */ | ||
| 1511 | +/* BEGIN_CASE */ | ||
| 1512 | +void SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001(int isProvider, int bits, int mdAlgId) | ||
| 1513 | +{ | ||
| 1514 | +#if !defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) || !defined(HITLS_CRYPTO_RSA_SIGN) || \ | ||
| 1515 | + !defined(HITLS_CRYPTO_RSA_VERIFY) | ||
| 1516 | + SKIP_TEST(); | ||
| 1517 | +#endif | ||
| 1518 | + if (IsMdAlgDisabled(mdAlgId)) { | ||
| 1519 | + SKIP_TEST(); | ||
| 1520 | + } | ||
| 1521 | + TestMemInit(); | ||
| 1522 | + CRYPT_EAL_PkeyCtx *pkey = NULL; | ||
| 1523 | + CRYPT_EAL_PkeyPara para = {0}; | ||
| 1524 | + uint8_t e[] = {1, 0, 1}; | ||
| 1525 | + uint8_t *msg = NULL; | ||
| 1526 | + uint8_t *signBuf = NULL; | ||
| 1527 | + uint32_t signLen = 0; | ||
| 1528 | + int32_t mdId = mdAlgId; | ||
| 1529 | + uint32_t keyBytes = (uint32_t)((bits + 7) >> 3); | ||
| 1530 | + uint32_t hashLen = CRYPT_EAL_MdGetDigestSize((CRYPT_MD_AlgId)mdId); | ||
| 1531 | + uint32_t mLLen = 0; | ||
| 1532 | + uint32_t msgLen = 0; | ||
| 1533 | + BSL_Param isoParam[2] = { | ||
| 1534 | + {CRYPT_PARAM_RSA_MD_ID, BSL_PARAM_TYPE_INT32, &mdId, sizeof(mdId), 0}, | ||
| 1535 | + BSL_PARAM_END}; | ||
| 1536 | + | ||
| 1537 | + ASSERT_TRUE(hashLen != 0); | ||
| 1538 | + ASSERT_TRUE(keyBytes >= hashLen + 2); | ||
| 1539 | + mLLen = keyBytes - hashLen - 2; | ||
| 1540 | + msgLen = mLLen + 1; | ||
| 1541 | + | ||
| 1542 | + msg = BSL_SAL_Malloc(msgLen); | ||
| 1543 | + signBuf = BSL_SAL_Malloc(keyBytes); | ||
| 1544 | + ASSERT_TRUE(msg != NULL && signBuf != NULL); | ||
| 1545 | + for (uint32_t i = 0; i < msgLen; i++) { | ||
| 1546 | + msg[i] = (uint8_t)i; | ||
| 1547 | + } | ||
| 1548 | + signLen = keyBytes; | ||
| 1549 | + | ||
| 1550 | + SetRsaPara(¶, e, sizeof(e), bits); | ||
| 1551 | + | ||
| 1552 | + pkey = TestPkeyNewCtx(NULL, CRYPT_PKEY_RSA, | ||
| 1553 | + CRYPT_EAL_PKEY_SIGN_OPERATE, "provider=default", isProvider); | ||
| 1554 | + ASSERT_TRUE(pkey != NULL); | ||
| 1555 | + ASSERT_EQ(CRYPT_EAL_PkeySetPara(pkey, ¶), CRYPT_SUCCESS); | ||
| 1556 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1557 | + ASSERT_EQ(TestRandInit(), CRYPT_SUCCESS); | ||
| 1558 | +#endif | ||
| 1559 | + ASSERT_EQ(CRYPT_EAL_PkeyGen(pkey), CRYPT_SUCCESS); | ||
| 1560 | + ASSERT_EQ(CRYPT_EAL_PkeyCtrl(pkey, CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, isoParam, 0), CRYPT_SUCCESS); | ||
| 1561 | + | ||
| 1562 | + ASSERT_EQ(CRYPT_EAL_PkeySign(pkey, mdId, msg, msgLen, signBuf, &signLen), CRYPT_SUCCESS); | ||
| 1563 | + ASSERT_EQ(CRYPT_EAL_PkeyVerify(pkey, mdId, msg, msgLen, signBuf, signLen), CRYPT_SUCCESS); | ||
| 1564 | + | ||
| 1565 | +EXIT: | ||
| 1566 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1567 | + TestRandDeInit(); | ||
| 1568 | +#endif | ||
| 1569 | + CRYPT_EAL_PkeyFreeCtx(pkey); | ||
| 1570 | + BSL_SAL_Free(msg); | ||
| 1571 | + BSL_SAL_Free(signBuf); | ||
| 1572 | +} | ||
| 1573 | +/* END_CASE */ | ||
| 1574 | + | ||
| 1575 | +/** | ||
| 1576 | + * @test SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_DETER_TC001 | ||
| 1577 | + * @title RSA EAL sign/verify: ISO9796-2 PMR deterministic signature | ||
| 1578 | + * @precon nan | ||
| 1579 | + * @brief | ||
| 1580 | + * 1. Create RSA context and set key size and exponent, expected result 1. | ||
| 1581 | + * 2. Generate key pair, expected result 2. | ||
| 1582 | + * 3. Set padding to ISO9796-2 with given hash, expected result 3. | ||
| 1583 | + * 4. Sign the same message twice, expected result 4. | ||
| 1584 | + * 5. Verify both signatures, expected result 5. | ||
| 1585 | + * 6. Compare the two signatures, expected result 6. | ||
| 1586 | + * @expect | ||
| 1587 | + * 1-6. CRYPT_SUCCESS. | ||
| 1588 | + */ | ||
| 1589 | +/* BEGIN_CASE */ | ||
| 1590 | +void SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_DETER_TC001(int isProvider, int bits, int mdAlgId) | ||
| 1591 | +{ | ||
| 1592 | +#if !defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) || !defined(HITLS_CRYPTO_RSA_SIGN) || \ | ||
| 1593 | + !defined(HITLS_CRYPTO_RSA_VERIFY) | ||
| 1594 | + SKIP_TEST(); | ||
| 1595 | +#endif | ||
| 1596 | + if (IsMdAlgDisabled(mdAlgId)) { | ||
| 1597 | + SKIP_TEST(); | ||
| 1598 | + } | ||
| 1599 | + TestMemInit(); | ||
| 1600 | + CRYPT_EAL_PkeyCtx *pkey = NULL; | ||
| 1601 | + CRYPT_EAL_PkeyPara para = {0}; | ||
| 1602 | + uint8_t e[] = {1, 0, 1}; | ||
| 1603 | + uint8_t *msg = NULL; | ||
| 1604 | + uint8_t *sign1 = NULL; | ||
| 1605 | + uint8_t *sign2 = NULL; | ||
| 1606 | + uint32_t signLen1 = 0; | ||
| 1607 | + uint32_t signLen2 = 0; | ||
| 1608 | + int32_t mdId = mdAlgId; | ||
| 1609 | + uint32_t keyBytes = (uint32_t)((bits + 7) >> 3); | ||
| 1610 | + uint32_t hashLen = CRYPT_EAL_MdGetDigestSize((CRYPT_MD_AlgId)mdId); | ||
| 1611 | + uint32_t mLLen = 0; | ||
| 1612 | + uint32_t msgLen = 0; | ||
| 1613 | + BSL_Param isoParam[2] = { | ||
| 1614 | + {CRYPT_PARAM_RSA_MD_ID, BSL_PARAM_TYPE_INT32, &mdId, sizeof(mdId), 0}, | ||
| 1615 | + BSL_PARAM_END}; | ||
| 1616 | + | ||
| 1617 | + ASSERT_TRUE(hashLen != 0); | ||
| 1618 | + ASSERT_TRUE(keyBytes >= hashLen + 2); | ||
| 1619 | + mLLen = keyBytes - hashLen - 2; | ||
| 1620 | + msgLen = mLLen + 1; | ||
| 1621 | + | ||
| 1622 | + msg = BSL_SAL_Malloc(msgLen); | ||
| 1623 | + sign1 = BSL_SAL_Malloc(keyBytes); | ||
| 1624 | + sign2 = BSL_SAL_Malloc(keyBytes); | ||
| 1625 | + ASSERT_TRUE(msg != NULL && sign1 != NULL && sign2 != NULL); | ||
| 1626 | + for (uint32_t i = 0; i < msgLen; i++) { | ||
| 1627 | + msg[i] = (uint8_t)i; | ||
| 1628 | + } | ||
| 1629 | + signLen1 = keyBytes; | ||
| 1630 | + signLen2 = keyBytes; | ||
| 1631 | + | ||
| 1632 | + SetRsaPara(¶, e, sizeof(e), bits); | ||
| 1633 | + | ||
| 1634 | + pkey = TestPkeyNewCtx(NULL, CRYPT_PKEY_RSA, | ||
| 1635 | + CRYPT_EAL_PKEY_SIGN_OPERATE, "provider=default", isProvider); | ||
| 1636 | + ASSERT_TRUE(pkey != NULL); | ||
| 1637 | + ASSERT_EQ(CRYPT_EAL_PkeySetPara(pkey, ¶), CRYPT_SUCCESS); | ||
| 1638 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1639 | + ASSERT_EQ(TestRandInit(), CRYPT_SUCCESS); | ||
| 1640 | +#endif | ||
| 1641 | + ASSERT_EQ(CRYPT_EAL_PkeyGen(pkey), CRYPT_SUCCESS); | ||
| 1642 | + ASSERT_EQ(CRYPT_EAL_PkeyCtrl(pkey, CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, isoParam, 0), CRYPT_SUCCESS); | ||
| 1643 | + | ||
| 1644 | + ASSERT_EQ(CRYPT_EAL_PkeySign(pkey, mdId, msg, msgLen, sign1, &signLen1), CRYPT_SUCCESS); | ||
| 1645 | + ASSERT_EQ(CRYPT_EAL_PkeySign(pkey, mdId, msg, msgLen, sign2, &signLen2), CRYPT_SUCCESS); | ||
| 1646 | + ASSERT_EQ(CRYPT_EAL_PkeyVerify(pkey, mdId, msg, msgLen, sign1, signLen1), CRYPT_SUCCESS); | ||
| 1647 | + ASSERT_EQ(CRYPT_EAL_PkeyVerify(pkey, mdId, msg, msgLen, sign2, signLen2), CRYPT_SUCCESS); | ||
| 1648 | + ASSERT_EQ(signLen1, signLen2); | ||
| 1649 | + ASSERT_EQ(memcmp(sign1, sign2, signLen1), 0); | ||
| 1650 | + | ||
| 1651 | +EXIT: | ||
| 1652 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1653 | + TestRandDeInit(); | ||
| 1654 | +#endif | ||
| 1655 | + CRYPT_EAL_PkeyFreeCtx(pkey); | ||
| 1656 | + BSL_SAL_Free(msg); | ||
| 1657 | + BSL_SAL_Free(sign1); | ||
| 1658 | + BSL_SAL_Free(sign2); | ||
| 1659 | +} | ||
| 1660 | +/* END_CASE */ | ||
| 1661 | +/** | ||
| 1662 | + * @test SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_BOUNDARY_TC001 | ||
| 1663 | + * @title RSA EAL sign/verify: ISO9796-2 PMR boundary lengths | ||
| 1664 | + * @precon nan | ||
| 1665 | + * @brief | ||
| 1666 | + * 1. Create RSA context and set key size and exponent, expected result 1. | ||
| 1667 | + * 2. Generate key pair, expected result 2. | ||
| 1668 | + * 3. Set padding to ISO9796-2 with given hash, expected result 3. | ||
| 1669 | + * 4. Sign/verify with |m| = mL_len, expected result 4. | ||
| 1670 | + * 5. Sign with |m| = mL_len - 1, expected result 5. | ||
| 1671 | + * @expect | ||
| 1672 | + * 1-4. CRYPT_SUCCESS. | ||
| 1673 | + * 5. CRYPT_RSA_ERR_INPUT_VALUE. | ||
| 1674 | + */ | ||
| 1675 | +/* BEGIN_CASE */ | ||
| 1676 | +void SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_BOUNDARY_TC001(int isProvider, int bits, int mdAlgId) | ||
| 1677 | +{ | ||
| 1678 | +#if !defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) || !defined(HITLS_CRYPTO_RSA_SIGN) || \ | ||
| 1679 | + !defined(HITLS_CRYPTO_RSA_VERIFY) | ||
| 1680 | + SKIP_TEST(); | ||
| 1681 | +#endif | ||
| 1682 | + if (IsMdAlgDisabled(mdAlgId)) { | ||
| 1683 | + SKIP_TEST(); | ||
| 1684 | + } | ||
| 1685 | + TestMemInit(); | ||
| 1686 | + CRYPT_EAL_PkeyCtx *pkey = NULL; | ||
| 1687 | + CRYPT_EAL_PkeyPara para = {0}; | ||
| 1688 | + uint8_t e[] = {1, 0, 1}; | ||
| 1689 | + uint8_t *msg = NULL; | ||
| 1690 | + uint8_t *signBuf = NULL; | ||
| 1691 | + uint32_t signLen = 0; | ||
| 1692 | + int32_t mdId = mdAlgId; | ||
| 1693 | + uint32_t keyBytes = (uint32_t)((bits + 7) >> 3); | ||
| 1694 | + uint32_t hashLen = CRYPT_EAL_MdGetDigestSize((CRYPT_MD_AlgId)mdId); | ||
| 1695 | + uint32_t mLLen = 0; | ||
| 1696 | + uint32_t shortLen = 0; | ||
| 1697 | + BSL_Param isoParam[2] = { | ||
| 1698 | + {CRYPT_PARAM_RSA_MD_ID, BSL_PARAM_TYPE_INT32, &mdId, sizeof(mdId), 0}, | ||
| 1699 | + BSL_PARAM_END}; | ||
| 1700 | + | ||
| 1701 | + ASSERT_TRUE(hashLen != 0); | ||
| 1702 | + ASSERT_TRUE(keyBytes >= hashLen + 2); | ||
| 1703 | + mLLen = keyBytes - hashLen - 2; | ||
| 1704 | + ASSERT_TRUE(mLLen > 0); | ||
| 1705 | + shortLen = mLLen - 1; | ||
| 1706 | + | ||
| 1707 | + msg = BSL_SAL_Malloc(mLLen); | ||
| 1708 | + signBuf = BSL_SAL_Malloc(keyBytes); | ||
| 1709 | + ASSERT_TRUE(msg != NULL && signBuf != NULL); | ||
| 1710 | + for (uint32_t i = 0; i < mLLen; i++) { | ||
| 1711 | + msg[i] = (uint8_t)i; | ||
| 1712 | + } | ||
| 1713 | + | ||
| 1714 | + SetRsaPara(¶, e, sizeof(e), bits); | ||
| 1715 | + | ||
| 1716 | + pkey = TestPkeyNewCtx(NULL, CRYPT_PKEY_RSA, | ||
| 1717 | + CRYPT_EAL_PKEY_SIGN_OPERATE, "provider=default", isProvider); | ||
| 1718 | + ASSERT_TRUE(pkey != NULL); | ||
| 1719 | + ASSERT_EQ(CRYPT_EAL_PkeySetPara(pkey, ¶), CRYPT_SUCCESS); | ||
| 1720 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1721 | + ASSERT_EQ(TestRandInit(), CRYPT_SUCCESS); | ||
| 1722 | +#endif | ||
| 1723 | + ASSERT_EQ(CRYPT_EAL_PkeyGen(pkey), CRYPT_SUCCESS); | ||
| 1724 | + ASSERT_EQ(CRYPT_EAL_PkeyCtrl(pkey, CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, isoParam, 0), CRYPT_SUCCESS); | ||
| 1725 | + | ||
| 1726 | + signLen = keyBytes; | ||
| 1727 | + ASSERT_EQ(CRYPT_EAL_PkeySign(pkey, mdId, msg, mLLen, signBuf, &signLen), CRYPT_SUCCESS); | ||
| 1728 | + ASSERT_EQ(CRYPT_EAL_PkeyVerify(pkey, mdId, msg, mLLen, signBuf, signLen), CRYPT_SUCCESS); | ||
| 1729 | + | ||
| 1730 | + signLen = keyBytes; | ||
| 1731 | + ASSERT_EQ(CRYPT_EAL_PkeySign(pkey, mdId, msg, shortLen, signBuf, &signLen), CRYPT_RSA_ERR_INPUT_VALUE); | ||
| 1732 | + | ||
| 1733 | +EXIT: | ||
| 1734 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1735 | + TestRandDeInit(); | ||
| 1736 | +#endif | ||
| 1737 | + CRYPT_EAL_PkeyFreeCtx(pkey); | ||
| 1738 | + BSL_SAL_Free(msg); | ||
| 1739 | + BSL_SAL_Free(signBuf); | ||
| 1740 | +} | ||
| 1741 | +/* END_CASE */ | ||
| 1742 | +/** | ||
| 1743 | + * @test SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_NEGATIVE_TC001 | ||
| 1744 | + * @title RSA EAL sign/verify: ISO9796-2 PMR negative cases | ||
| 1745 | + * @precon nan | ||
| 1746 | + * @brief | ||
| 1747 | + * 1. Create RSA context and set key size and exponent, expected result 1. | ||
| 1748 | + * 2. Generate key pair, expected result 2. | ||
| 1749 | + * 3. Set padding to ISO9796-2 with given hash, expected result 3. | ||
| 1750 | + * 4. Tamper one bit of signature and verify, expected result 4. | ||
| 1751 | + * 5. Tamper one bit of message and verify, expected result 5. | ||
| 1752 | + * 6. Recover EM and tamper header/trailer, expected result 6. | ||
| 1753 | + * 7. Recover EM and tamper hash, expected result 7. | ||
| 1754 | + * @expect | ||
| 1755 | + * 1-3. CRYPT_SUCCESS. | ||
| 1756 | + * 4-7. CRYPT_RSA_NOR_VERIFY_FAIL. | ||
| 1757 | + */ | ||
| 1758 | +/* BEGIN_CASE */ | ||
| 1759 | +void SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_NEGATIVE_TC001(int isProvider, int bits, int mdAlgId) | ||
| 1760 | +{ | ||
| 1761 | +#if !defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) || !defined(HITLS_CRYPTO_RSA_SIGN) || \ | ||
| 1762 | + !defined(HITLS_CRYPTO_RSA_VERIFY) | ||
| 1763 | + (void)isProvider; | ||
| 1764 | + (void)bits; | ||
| 1765 | + (void)mdAlgId; | ||
| 1766 | + SKIP_TEST(); | ||
| 1767 | + return; | ||
| 1768 | +#else | ||
| 1769 | + if (IsMdAlgDisabled(mdAlgId)) { | ||
| 1770 | + SKIP_TEST(); | ||
| 1771 | + return; | ||
| 1772 | + } | ||
| 1773 | + TestMemInit(); | ||
| 1774 | + CRYPT_EAL_PkeyCtx *pkey = NULL; | ||
| 1775 | + CRYPT_RSA_Ctx *rsaCtx = NULL; | ||
| 1776 | + CRYPT_EAL_PkeyPara para = {0}; | ||
| 1777 | + CRYPT_EAL_PkeyPub pubKey = {0}; | ||
| 1778 | + CRYPT_EAL_MdCTX *mdCtx = NULL; | ||
| 1779 | + uint8_t e[] = {1, 0, 1}; | ||
| 1780 | + uint8_t *msg = NULL; | ||
| 1781 | + uint8_t *msgTamper = NULL; | ||
| 1782 | + uint8_t *sign = NULL; | ||
| 1783 | + uint8_t *signTamper = NULL; | ||
| 1784 | + uint8_t *em = NULL; | ||
| 1785 | + uint8_t *emTamper = NULL; | ||
| 1786 | + uint8_t *hash = NULL; | ||
| 1787 | + uint8_t *mlHash = NULL; | ||
| 1788 | + uint8_t *pubN = NULL; | ||
| 1789 | + uint8_t *pubE = NULL; | ||
| 1790 | + uint32_t signLen = 0; | ||
| 1791 | + uint32_t emLen = 0; | ||
| 1792 | + int32_t mdId = mdAlgId; | ||
| 1793 | + uint32_t keyBytes = (uint32_t)((bits + 7) >> 3); | ||
| 1794 | + uint32_t hashLen = CRYPT_EAL_MdGetDigestSize((CRYPT_MD_AlgId)mdId); | ||
| 1795 | + uint32_t mLLen = 0; | ||
| 1796 | + uint32_t msgLen = 0; | ||
| 1797 | + uint32_t mlHashLen = 0; | ||
| 1798 | + BSL_Param isoParam[2] = { | ||
| 1799 | + {CRYPT_PARAM_RSA_MD_ID, BSL_PARAM_TYPE_INT32, &mdId, sizeof(mdId), 0}, | ||
| 1800 | + BSL_PARAM_END}; | ||
| 1801 | + | ||
| 1802 | + ASSERT_TRUE(hashLen != 0); | ||
| 1803 | + ASSERT_TRUE(keyBytes >= hashLen + 2); | ||
| 1804 | + mLLen = keyBytes - hashLen - 2; | ||
| 1805 | + msgLen = mLLen + 1; | ||
| 1806 | + mlHashLen = mLLen + hashLen; | ||
| 1807 | + | ||
| 1808 | + msg = BSL_SAL_Malloc(msgLen); | ||
| 1809 | + msgTamper = BSL_SAL_Malloc(msgLen); | ||
| 1810 | + sign = BSL_SAL_Malloc(keyBytes); | ||
| 1811 | + signTamper = BSL_SAL_Malloc(keyBytes); | ||
| 1812 | + em = BSL_SAL_Malloc(keyBytes); | ||
| 1813 | + emTamper = BSL_SAL_Malloc(keyBytes); | ||
| 1814 | + hash = BSL_SAL_Malloc(hashLen); | ||
| 1815 | + mlHash = BSL_SAL_Malloc(mlHashLen); | ||
| 1816 | + pubN = BSL_SAL_Malloc(keyBytes); | ||
| 1817 | + pubE = BSL_SAL_Malloc(keyBytes); | ||
| 1818 | + ASSERT_TRUE(msg != NULL && msgTamper != NULL && sign != NULL && signTamper != NULL && | ||
| 1819 | + em != NULL && emTamper != NULL && hash != NULL && mlHash != NULL && | ||
| 1820 | + pubN != NULL && pubE != NULL); | ||
| 1821 | + for (uint32_t i = 0; i < msgLen; i++) { | ||
| 1822 | + msg[i] = (uint8_t)i; | ||
| 1823 | + } | ||
| 1824 | + | ||
| 1825 | + SetRsaPara(¶, e, sizeof(e), bits); | ||
| 1826 | + SetRsaPubKey(&pubKey, pubN, keyBytes, pubE, keyBytes); | ||
| 1827 | + | ||
| 1828 | + pkey = TestPkeyNewCtx(NULL, CRYPT_PKEY_RSA, | ||
| 1829 | + CRYPT_EAL_PKEY_SIGN_OPERATE, "provider=default", isProvider); | ||
| 1830 | + ASSERT_TRUE(pkey != NULL); | ||
| 1831 | + ASSERT_EQ(CRYPT_EAL_PkeySetPara(pkey, ¶), CRYPT_SUCCESS); | ||
| 1832 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1833 | + ASSERT_EQ(TestRandInit(), CRYPT_SUCCESS); | ||
| 1834 | +#endif | ||
| 1835 | + ASSERT_EQ(CRYPT_EAL_PkeyGen(pkey), CRYPT_SUCCESS); | ||
| 1836 | + ASSERT_EQ(CRYPT_EAL_PkeyCtrl(pkey, CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, isoParam, 0), CRYPT_SUCCESS); | ||
| 1837 | + | ||
| 1838 | + signLen = keyBytes; | ||
| 1839 | + ASSERT_EQ(CRYPT_EAL_PkeySign(pkey, mdId, msg, msgLen, sign, &signLen), CRYPT_SUCCESS); | ||
| 1840 | + | ||
| 1841 | + (void)memcpy(signTamper, sign, signLen); | ||
| 1842 | + signTamper[signLen - 1] ^= 0x01; | ||
| 1843 | + ASSERT_EQ(CRYPT_EAL_PkeyVerify(pkey, mdId, msg, msgLen, signTamper, signLen), CRYPT_RSA_NOR_VERIFY_FAIL); | ||
| 1844 | + | ||
| 1845 | + (void)memcpy(msgTamper, msg, msgLen); | ||
| 1846 | + msgTamper[0] ^= 0x01; | ||
| 1847 | + ASSERT_EQ(CRYPT_EAL_PkeyVerify(pkey, mdId, msgTamper, msgLen, sign, signLen), CRYPT_RSA_NOR_VERIFY_FAIL); | ||
| 1848 | + | ||
| 1849 | + ASSERT_EQ(CRYPT_EAL_PkeyGetPub(pkey, &pubKey), CRYPT_SUCCESS); | ||
| 1850 | + rsaCtx = CRYPT_RSA_NewCtx(); | ||
| 1851 | + ASSERT_TRUE(rsaCtx != NULL); | ||
| 1852 | + BSL_Param rsaPubParam[3] = { | ||
| 1853 | + {CRYPT_PARAM_RSA_N, BSL_PARAM_TYPE_OCTETS, pubKey.key.rsaPub.n, pubKey.key.rsaPub.nLen, 0}, | ||
| 1854 | + {CRYPT_PARAM_RSA_E, BSL_PARAM_TYPE_OCTETS, pubKey.key.rsaPub.e, pubKey.key.rsaPub.eLen, 0}, | ||
| 1855 | + BSL_PARAM_END | ||
| 1856 | + }; | ||
| 1857 | + ASSERT_EQ(CRYPT_RSA_SetPubKey(rsaCtx, rsaPubParam), CRYPT_SUCCESS); | ||
| 1858 | + ASSERT_EQ(CRYPT_RSA_Ctrl(rsaCtx, CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, isoParam, 0), CRYPT_SUCCESS); | ||
| 1859 | + | ||
| 1860 | + mdCtx = CRYPT_EAL_MdNewCtx(mdId); | ||
| 1861 | + ASSERT_TRUE(mdCtx != NULL); | ||
| 1862 | + ASSERT_TRUE(CRYPT_EAL_MdInit(mdCtx) == 0); | ||
| 1863 | + ASSERT_TRUE(CRYPT_EAL_MdUpdate(mdCtx, msg, msgLen) == 0); | ||
| 1864 | + ASSERT_TRUE(CRYPT_EAL_MdFinal(mdCtx, hash, &hashLen) == 0); | ||
| 1865 | + CRYPT_EAL_MdFreeCtx(mdCtx); | ||
| 1866 | + mdCtx = NULL; | ||
| 1867 | + | ||
| 1868 | + if (mLLen > 0) { | ||
| 1869 | + (void)memcpy(mlHash, msg, mLLen); | ||
| 1870 | + } | ||
| 1871 | + (void)memcpy(mlHash + mLLen, hash, hashLen); | ||
| 1872 | + emLen = keyBytes; | ||
| 1873 | + ASSERT_EQ(CRYPT_RSA_PubEnc(rsaCtx, sign, signLen, em, &emLen), CRYPT_SUCCESS); | ||
| 1874 | + | ||
| 1875 | + (void)memcpy(emTamper, em, emLen); | ||
| 1876 | + emTamper[0] ^= 0x01; | ||
| 1877 | + ASSERT_EQ(CRYPT_RSA_VerifyIso9796_2(mlHash, mlHashLen, emTamper, emLen), CRYPT_RSA_NOR_VERIFY_FAIL); | ||
| 1878 | + | ||
| 1879 | + (void)memcpy(emTamper, em, emLen); | ||
| 1880 | + emTamper[emLen - 1] ^= 0x01; | ||
| 1881 | + ASSERT_EQ(CRYPT_RSA_VerifyIso9796_2(mlHash, mlHashLen, emTamper, emLen), CRYPT_RSA_NOR_VERIFY_FAIL); | ||
| 1882 | + | ||
| 1883 | + (void)memcpy(emTamper, em, emLen); | ||
| 1884 | + emTamper[emLen - hashLen - 1] ^= 0x01; | ||
| 1885 | + ASSERT_EQ(CRYPT_RSA_VerifyIso9796_2(mlHash, mlHashLen, emTamper, emLen), CRYPT_RSA_NOR_VERIFY_FAIL); | ||
| 1886 | + | ||
| 1887 | +EXIT: | ||
| 1888 | +#ifdef HITLS_CRYPTO_DRBG | ||
| 1889 | + TestRandDeInit(); | ||
| 1890 | +#endif | ||
| 1891 | + CRYPT_EAL_PkeyFreeCtx(pkey); | ||
| 1892 | + CRYPT_RSA_FreeCtx(rsaCtx); | ||
| 1893 | + CRYPT_EAL_MdFreeCtx(mdCtx); | ||
| 1894 | + BSL_SAL_Free(msg); | ||
| 1895 | + BSL_SAL_Free(msgTamper); | ||
| 1896 | + BSL_SAL_Free(sign); | ||
| 1897 | + BSL_SAL_Free(signTamper); | ||
| 1898 | + BSL_SAL_Free(em); | ||
| 1899 | + BSL_SAL_Free(emTamper); | ||
| 1900 | + BSL_SAL_Free(hash); | ||
| 1901 | + BSL_SAL_Free(mlHash); | ||
| 1902 | + BSL_SAL_Free(pubN); | ||
| 1903 | + BSL_SAL_Free(pubE); | ||
| 1904 | +#endif | ||
| 1905 | +} | ||
| 1906 | +/* END_CASE */ | ||
| 1907 | + | ||
| 1908 | +/** | ||
| 1909 | + * @test SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001 | ||
| 1910 | + * @title RSA EAL sign/verify: ISO9796-2 vector | ||
| 1911 | + * @precon nan | ||
| 1912 | + * @brief | ||
| 1913 | + * 1. Create sign/verify contexts, expected result 1. | ||
| 1914 | + * 2. Set private/public key, expected result 2. | ||
| 1915 | + * 3. Set padding to ISO9796-2 with given hash, expected result 3. | ||
| 1916 | + * 4. Call CRYPT_EAL_PkeySign to compute signature, expected result 4. | ||
| 1917 | + * 5. Compare signature with vector, expected result 5. | ||
| 1918 | + * 6. Call CRYPT_EAL_PkeyVerify with vector signature, expected result 6. | ||
| 1919 | + * @expect | ||
| 1920 | + * 1. Success, and contexts are not NULL. | ||
| 1921 | + * 2-4,6. CRYPT_SUCCESS | ||
| 1922 | + * 5. Both are the same. | ||
| 1923 | + */ | ||
| 1924 | +/* BEGIN_CASE */ | ||
| 1925 | +void SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001( | ||
| 1926 | + int mdAlgId, Hex *n, Hex *e, Hex *d, Hex *msg, Hex *sign, int isProvider) | ||
| 1927 | +{ | ||
| 1928 | +#if !defined(HITLS_CRYPTO_RSA_EMSA_ISO9796_2) || !defined(HITLS_CRYPTO_RSA_SIGN) || \ | ||
| 1929 | + !defined(HITLS_CRYPTO_RSA_VERIFY) | ||
| 1930 | + SKIP_TEST(); | ||
| 1931 | +#endif | ||
| 1932 | + if (IsMdAlgDisabled(mdAlgId)) { | ||
| 1933 | + SKIP_TEST(); | ||
| 1934 | + } | ||
| 1935 | + | ||
| 1936 | + CRYPT_EAL_PkeyCtx *pkeySign = NULL; | ||
| 1937 | + CRYPT_EAL_PkeyCtx *pkeyVerify = NULL; | ||
| 1938 | + CRYPT_EAL_PkeyPrv prvKey = {0}; | ||
| 1939 | + CRYPT_EAL_PkeyPub pubKey = {0}; | ||
| 1940 | + uint8_t *signdata = NULL; | ||
| 1941 | + uint32_t signLen = 0; | ||
| 1942 | + int32_t mdId = mdAlgId; | ||
| 1943 | + BSL_Param isoParam[2] = { | ||
| 1944 | + {CRYPT_PARAM_RSA_MD_ID, BSL_PARAM_TYPE_INT32, &mdId, sizeof(mdId), 0}, | ||
| 1945 | + BSL_PARAM_END}; | ||
| 1946 | + | ||
| 1947 | + SetRsaPrvKey(&prvKey, n->x, n->len, d->x, d->len); | ||
| 1948 | + SetRsaPubKey(&pubKey, n->x, n->len, e->x, e->len); | ||
| 1949 | + | ||
| 1950 | + TestMemInit(); | ||
| 1951 | + | ||
| 1952 | + pkeySign = TestPkeyNewCtx(NULL, CRYPT_PKEY_RSA, | ||
| 1953 | + CRYPT_EAL_PKEY_SIGN_OPERATE, "provider=default", isProvider); | ||
| 1954 | + ASSERT_TRUE(pkeySign != NULL); | ||
| 1955 | + | ||
| 1956 | + pkeyVerify = TestPkeyNewCtx(NULL, CRYPT_PKEY_RSA, | ||
| 1957 | + CRYPT_EAL_PKEY_SIGN_OPERATE, "provider=default", isProvider); | ||
| 1958 | + ASSERT_TRUE(pkeyVerify != NULL); | ||
| 1959 | + | ||
| 1960 | + ASSERT_EQ(CRYPT_EAL_PkeySetPrv(pkeySign, &prvKey), CRYPT_SUCCESS); | ||
| 1961 | + ASSERT_EQ(CRYPT_EAL_PkeySetPub(pkeyVerify, &pubKey), CRYPT_SUCCESS); | ||
| 1962 | + | ||
| 1963 | + ASSERT_EQ(CRYPT_EAL_PkeyCtrl(pkeySign, CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, isoParam, 0), CRYPT_SUCCESS); | ||
| 1964 | + ASSERT_EQ(CRYPT_EAL_PkeyCtrl(pkeyVerify, CRYPT_CTRL_SET_RSA_EMSA_ISO9796_2, isoParam, 0), CRYPT_SUCCESS); | ||
| 1965 | + | ||
| 1966 | + signLen = CRYPT_EAL_PkeyGetSignLen(pkeySign); | ||
| 1967 | + ASSERT_EQ(signLen, sign->len); | ||
| 1968 | + signdata = BSL_SAL_Malloc(signLen); | ||
| 1969 | + ASSERT_TRUE(signdata != NULL); | ||
| 1970 | + | ||
| 1971 | + ASSERT_EQ(CRYPT_EAL_PkeySign(pkeySign, mdAlgId, msg->x, msg->len, signdata, &signLen), CRYPT_SUCCESS); | ||
| 1972 | + ASSERT_EQ(signLen, sign->len); | ||
| 1973 | + ASSERT_COMPARE("CRYPT_EAL_PkeySign Compare", sign->x, sign->len, signdata, signLen); | ||
| 1974 | + ASSERT_EQ(CRYPT_EAL_PkeyVerify(pkeyVerify, mdAlgId, msg->x, msg->len, sign->x, sign->len), CRYPT_SUCCESS); | ||
| 1975 | + | ||
| 1976 | +EXIT: | ||
| 1977 | + CRYPT_EAL_PkeyFreeCtx(pkeySign); | ||
| 1978 | + CRYPT_EAL_PkeyFreeCtx(pkeyVerify); | ||
| 1979 | + BSL_SAL_Free(signdata); | ||
| 1980 | +} | ||
| 1493 | /* END_CASE */ | 1981 | /* END_CASE */ |
| @@ -366,4 +366,64 @@ RSABSSA-SHA384-PSSZERO-Deterministic Test Vector 04 | |||
| 366 | SDV_CRYPTO_RSA_RSABSSA_BLINDING_FUNC_TC002:"010001":"aec4d69addc70b990ea66a5e70603b6fee27aafebd08f2d94cbe1250c556e047a928d635c3f45ee9b66d1bc628a03bac9b7c3f416fe20dabea8f3d7b4bbf7f963be335d2328d67e6c13ee4a8f955e05a3283720d3e1f139c38e43e0338ad058a9495c53377fc35be64d208f89b4aa721bf7f7d3fef837be2a80e0f8adf0bcd1eec5bb040443a2b2792fdca522a7472aed74f31a1ebe1eebc1f408660a0543dfe2a850f106a617ec6685573702eaaa21a5640a5dcaf9b74e397fa3af18a2f1b7c03ba91a6336158de420d63188ee143866ee415735d155b7c2d854d795b7bc236cffd71542df34234221a0413e142d8c61355cc44d45bda94204974557ac2704cd8b593f035a5724b1adf442e78c542cd4414fce6f1298182fb6d8e53cef1adfd2e90e1e4deec52999bdc6c29144e8d52a125232c8c6d75c706ea3cc06841c7bda33568c63a6c03817f722b50fcf898237d788a4400869e44d90a3020923dc646388abcc914315215fcd1bae11b1c751fd52443aac8f601087d8d42737c18a3fa11ecd4131ecae017ae0a14acfc4ef85b83c19fed33cfd1cd629da2c4c09e222b398e18d822f77bb378dea3cb360b605e5aa58b20edc29d000a66bd177c682a17e7eb12a63ef7c2e4183e0d898f3d6bf567ba8ae84f84f1d23bf8b8e261c3729e2fa6d07b832e07cddd1d14f55325c6f924267957121902dc19b3b32948bdead5":"0d43242aefe1fb2c13fbc66e20b678c4336d20b1808c558b6e62ad16a287077180b177e1f01b12f9c6cd6c52630257ccef26a45135a990928773f3bd2fc01a313f1dac97a51cec71cb1fd7efc7adffdeb05f1fb04812c924ed7f4a8269925dad88bd7dcfbc4ef01020ebfc60cb3e04c54f981fdbd273e69a8a58b8ceb7c2d83fbcbd6f784d052201b88a9848186f2a45c0d2826870733e6fd9aa46983e0a6e82e35ca20a439c5ee7b502a9062e1066493bdadf8b49eb30d9558ed85abc7afb29b3c9bc644199654a4676681af4babcea4e6f71fe4565c9c1b85d9985b84ec1abf1a820a9bbebee0df1398aae2c85ab580a9f13e7743afd3108eb32100b870648fa6bc17e8abac4d3c99246b1f0ea9f7f93a5dd5458c56d9f3f81ff2216b3c3680a13591673c43194d8e6fc93fc1e37ce2986bd628ac48088bc723d8fbe293861ca7a9f4a73e9fa63b1b6d0074f5dea2a624c5249ff3ad811b6255b299d6bc5451ba7477f19c5a0db690c3e6476398b1483d10314afd38bbaf6e2fbdbcd62c3ca9797a420ca6034ec0a83360a3ee2adf4b9d4ba29731d131b099a38d6a23cc463db754603211260e99d19affc902c915d7854554aabf608e3ac52c19b8aa26ae042249b17b2d29669b5c859103ee53ef9bdc73ba3c6b537d5c34b6d8f034671d7f3a8a6966cc4543df223565343154140fd7391c7e7be03e241f4ecfeb877a051":"8f3dc6fb8c4a02f4d6352edf0907822c1210a9b32f9bdda4c45a698c80023aa6b59f8cfec5fdbb36331372ebefedae7d":"":"80682c48982407b489d53d1261b19ec8627d02b8cda5336750b8cee332ae260de57b02d72609c1e0e9f28e2040fc65b6f02d56dbd6aa9af8fde656f70495dfb723ba01173d4707a12fddac628ca29f3e32340bd8f7ddb557cf819f6b01e445ad96f874ba235584ee71f6581f62d4f43bf03f910f6510deb85e8ef06c7f09d9794a008be7ff2529f0ebb69decef646387dc767b74939265fec0223aa6d84d2a8a1cc912d5ca25b4e144ab8f6ba054b54910176d5737a2cff011da431bd5f2a0d2d66b9e70b39f4b050e45c0d9c16f02deda9ddf2d00f3e4b01037d7029cd49c2d46a8e1fc2c0c17520af1f4b5e25ba396afc4cd60c494a4c426448b35b49635b337cfb08e7c22a39b256dd032c00adddafb51a627f99a0e1704170ac1f1912e49d9db10ec04c19c58f420212973e0cb329524223a6aa56c7937c5dffdb5d966b6cd4cbc26f3201dd25c80960a1a111b32947bb78973d269fac7f5186530930ed19f68507540eed9e1bab8b00f00d8ca09b3f099aae46180e04e3584bd7ca054df18a1504b89d1d1675d0966c4ae1407be325cdf623cf13ff13e4a28b594d59e3eadbadf6136eee7a59d6a444c9eb4e2198e8a974f27a39eb63af2c9af3870488b8adaad444674f512133ad80b9220e09158521614f1faadfe8505ef57b7df6813048603f0dd04f4280177a11380fbfc861dbcbd7418d62155248dad5fdec0991f":"982790826556aabe6004467671a864397eea3b95740e9a11c8b80b99ee0cf4dbc50af860bda81b601a2eceaa6943ef104f13325ad0be2e37f42030b3120e87cfee8cfe59cde1acfb25485a43275ebe777292e2518181ae531e596f988ff16f458daa5a42408939cbe60e7271391a21657276427d195bee6a20054101d4ceb892ecdea402ea1a866acf0e451a3336f07e7589330d96c3883fd5bc1a829a715b618b74a86b2a898764246ad081d4c9f1edb8ab5077e315fde2417ec2dd33cad93e120340b49be89c18a63e62c6bb289037283d3bf18608be11ee4c823c710b0c6b89235fed3f03a7b96ddd25a8f54f20dac37ce8905093ad8e066810f354fb1773236e3d3788ba755de2c9bce8d340078bb1831ddc7314a5018673427ced65cb356281aae08b5e6636f3eb2417e09d6ae476a9abcc410bc8c90813d0740e39ae75efae4c02eed49dbb7aa51258bb71197445d17a6029bf566ba6b36282173af2c42e9b9631366f22eb6a19ef1d92bd3ce0631d3a7fb3288195b0ba380a3828d5411cefd5eba83e52198c001ac9946a333a33d89d4d235fc833239d59837f04eaf065e9563659b00c7624a6263b727d8f2c07959ba2bb592e7ff251b8f09c85995fd2e4474e743586576b518230986b6076b762ae77088a37e4bffd2ef41ae68d6d4e79205290b4f76c42ef039638c41cdc6fe8af9b429c0dee45b2942e3861da2a":"362ef369f9b8c1487e285514702a7cd6fe03e4a2fb854881f3d3f986b7742a0c9bfab6562a6cd5ed71c574af67d7e77e71b33420c08ebb0ff37886b858297f9562fc366066c6d8e77bad1918b04756ba03f5c385d44f06759daf1b7a38b2a64248dee95d0e3886c8afa1f74afd8ac3c56520d0f3fd206df8e0d257312756803b09a79d0cc38112592c3aec32de5a9bc3284c5a0a2d0808b102deafa5cc60f04e3d71c0284cba04f17f88aa8e07d5544fe0265807d515877f79d30ed26d522b9d9c56597647b0dbca5a69d6418f8d1b51481723f272c2a3d48f6f4fd6beeac3576c3edb00e8779964548aeab8e004c7c4f8ef9cb6e680e2d2d49792004bb3e6974fa48f241a361ca449c02bd4c0ad4e66252c55e656f16049908efe59acbafa1171895dfac64d909808e5420469d622c7253ec1de7522b41634d383bf8786bf881cbf1561627f1e62b2d93300ec30ec0f5f0ab32036fce068bc76b0b0c6452079537f8d7f8dcee4b42bbf2d9ad7499d3835cd93cfc7e8ebea3554ab5241e181e5d73241b7bebf0a281b63594a35f4993e2b416d60db966b58b648cfcba2c4bee4c2830aae4a70ff55012480298f549c13b1b2684277bca12f592471b8a99285174f1c0ebb38fc80e74a10b3f02ec3e6682ba873f7ff0e1e79718b470927c74ed754d4f7c3d9a55e22246e829cdb5a1c6fb2a0a6c896df303063c918bcf5eb0017":"4454b6983ff01cb28545329f394936efa42ed231e15efbc025fdaca00277acf0c8e00e3d8b0ecebd35b057b8ebfc14e1a7097368a4abd20b555894ccef3d1b9528c6bcbda6b95376bef230d0f1feff0c1064c62c60a7ae7431d1fdfa43a81eed9235e363e1ffa0b2797aba6aad6082fcd285e14fc8b71de6b9c87cb4059c7dc1e96ae1e63795a1e9af86b9073d1d848aef3eca8a03421bcd116572456b53bcfd4dabb0a9691f1fabda3ed0ce357aee2cfee5b1a0eb226f69716d4e011d96eede5e38a9acb531a64336a0d5b0bae3ab085b658692579a376740ff6ce69e89b06f360520b864e33d82d029c808248a19e18e31f0ecd16fac5cd4870f8d3ebc1c32c718124152dc905672ab0b7af48bf7d1ac1ff7b9c742549c91275ab105458ae37621757add83482bbcf779e777bbd61126e93686635d4766aedf5103cf7978f3856ccac9e28d21a850dbb03c811128616d315d717be1c2b6254f8509acae862042c034530329ce15ca2e2f6b1f5fd59272746e3918c748c0eb810bf76884fa10fcf749326bbfaa5ba285a0186a22e4f628dbf178d3bb5dc7e165ca73f6a55ecc14c4f5a26c4693ce5da032264cbec319b12ddb9787d0efa4fcf1e5ccee35ad85ecd453182df9ed735893f830b570faae8be0f6fe2e571a4e0d927cba4debd368d3b4fca33ec6251897a137cf75474a32ac8256df5e5ffa518b88b43fb6f63a24":1 | 366 | SDV_CRYPTO_RSA_RSABSSA_BLINDING_FUNC_TC002:"010001":"aec4d69addc70b990ea66a5e70603b6fee27aafebd08f2d94cbe1250c556e047a928d635c3f45ee9b66d1bc628a03bac9b7c3f416fe20dabea8f3d7b4bbf7f963be335d2328d67e6c13ee4a8f955e05a3283720d3e1f139c38e43e0338ad058a9495c53377fc35be64d208f89b4aa721bf7f7d3fef837be2a80e0f8adf0bcd1eec5bb040443a2b2792fdca522a7472aed74f31a1ebe1eebc1f408660a0543dfe2a850f106a617ec6685573702eaaa21a5640a5dcaf9b74e397fa3af18a2f1b7c03ba91a6336158de420d63188ee143866ee415735d155b7c2d854d795b7bc236cffd71542df34234221a0413e142d8c61355cc44d45bda94204974557ac2704cd8b593f035a5724b1adf442e78c542cd4414fce6f1298182fb6d8e53cef1adfd2e90e1e4deec52999bdc6c29144e8d52a125232c8c6d75c706ea3cc06841c7bda33568c63a6c03817f722b50fcf898237d788a4400869e44d90a3020923dc646388abcc914315215fcd1bae11b1c751fd52443aac8f601087d8d42737c18a3fa11ecd4131ecae017ae0a14acfc4ef85b83c19fed33cfd1cd629da2c4c09e222b398e18d822f77bb378dea3cb360b605e5aa58b20edc29d000a66bd177c682a17e7eb12a63ef7c2e4183e0d898f3d6bf567ba8ae84f84f1d23bf8b8e261c3729e2fa6d07b832e07cddd1d14f55325c6f924267957121902dc19b3b32948bdead5":"0d43242aefe1fb2c13fbc66e20b678c4336d20b1808c558b6e62ad16a287077180b177e1f01b12f9c6cd6c52630257ccef26a45135a990928773f3bd2fc01a313f1dac97a51cec71cb1fd7efc7adffdeb05f1fb04812c924ed7f4a8269925dad88bd7dcfbc4ef01020ebfc60cb3e04c54f981fdbd273e69a8a58b8ceb7c2d83fbcbd6f784d052201b88a9848186f2a45c0d2826870733e6fd9aa46983e0a6e82e35ca20a439c5ee7b502a9062e1066493bdadf8b49eb30d9558ed85abc7afb29b3c9bc644199654a4676681af4babcea4e6f71fe4565c9c1b85d9985b84ec1abf1a820a9bbebee0df1398aae2c85ab580a9f13e7743afd3108eb32100b870648fa6bc17e8abac4d3c99246b1f0ea9f7f93a5dd5458c56d9f3f81ff2216b3c3680a13591673c43194d8e6fc93fc1e37ce2986bd628ac48088bc723d8fbe293861ca7a9f4a73e9fa63b1b6d0074f5dea2a624c5249ff3ad811b6255b299d6bc5451ba7477f19c5a0db690c3e6476398b1483d10314afd38bbaf6e2fbdbcd62c3ca9797a420ca6034ec0a83360a3ee2adf4b9d4ba29731d131b099a38d6a23cc463db754603211260e99d19affc902c915d7854554aabf608e3ac52c19b8aa26ae042249b17b2d29669b5c859103ee53ef9bdc73ba3c6b537d5c34b6d8f034671d7f3a8a6966cc4543df223565343154140fd7391c7e7be03e241f4ecfeb877a051":"8f3dc6fb8c4a02f4d6352edf0907822c1210a9b32f9bdda4c45a698c80023aa6b59f8cfec5fdbb36331372ebefedae7d":"":"80682c48982407b489d53d1261b19ec8627d02b8cda5336750b8cee332ae260de57b02d72609c1e0e9f28e2040fc65b6f02d56dbd6aa9af8fde656f70495dfb723ba01173d4707a12fddac628ca29f3e32340bd8f7ddb557cf819f6b01e445ad96f874ba235584ee71f6581f62d4f43bf03f910f6510deb85e8ef06c7f09d9794a008be7ff2529f0ebb69decef646387dc767b74939265fec0223aa6d84d2a8a1cc912d5ca25b4e144ab8f6ba054b54910176d5737a2cff011da431bd5f2a0d2d66b9e70b39f4b050e45c0d9c16f02deda9ddf2d00f3e4b01037d7029cd49c2d46a8e1fc2c0c17520af1f4b5e25ba396afc4cd60c494a4c426448b35b49635b337cfb08e7c22a39b256dd032c00adddafb51a627f99a0e1704170ac1f1912e49d9db10ec04c19c58f420212973e0cb329524223a6aa56c7937c5dffdb5d966b6cd4cbc26f3201dd25c80960a1a111b32947bb78973d269fac7f5186530930ed19f68507540eed9e1bab8b00f00d8ca09b3f099aae46180e04e3584bd7ca054df18a1504b89d1d1675d0966c4ae1407be325cdf623cf13ff13e4a28b594d59e3eadbadf6136eee7a59d6a444c9eb4e2198e8a974f27a39eb63af2c9af3870488b8adaad444674f512133ad80b9220e09158521614f1faadfe8505ef57b7df6813048603f0dd04f4280177a11380fbfc861dbcbd7418d62155248dad5fdec0991f":"982790826556aabe6004467671a864397eea3b95740e9a11c8b80b99ee0cf4dbc50af860bda81b601a2eceaa6943ef104f13325ad0be2e37f42030b3120e87cfee8cfe59cde1acfb25485a43275ebe777292e2518181ae531e596f988ff16f458daa5a42408939cbe60e7271391a21657276427d195bee6a20054101d4ceb892ecdea402ea1a866acf0e451a3336f07e7589330d96c3883fd5bc1a829a715b618b74a86b2a898764246ad081d4c9f1edb8ab5077e315fde2417ec2dd33cad93e120340b49be89c18a63e62c6bb289037283d3bf18608be11ee4c823c710b0c6b89235fed3f03a7b96ddd25a8f54f20dac37ce8905093ad8e066810f354fb1773236e3d3788ba755de2c9bce8d340078bb1831ddc7314a5018673427ced65cb356281aae08b5e6636f3eb2417e09d6ae476a9abcc410bc8c90813d0740e39ae75efae4c02eed49dbb7aa51258bb71197445d17a6029bf566ba6b36282173af2c42e9b9631366f22eb6a19ef1d92bd3ce0631d3a7fb3288195b0ba380a3828d5411cefd5eba83e52198c001ac9946a333a33d89d4d235fc833239d59837f04eaf065e9563659b00c7624a6263b727d8f2c07959ba2bb592e7ff251b8f09c85995fd2e4474e743586576b518230986b6076b762ae77088a37e4bffd2ef41ae68d6d4e79205290b4f76c42ef039638c41cdc6fe8af9b429c0dee45b2942e3861da2a":"362ef369f9b8c1487e285514702a7cd6fe03e4a2fb854881f3d3f986b7742a0c9bfab6562a6cd5ed71c574af67d7e77e71b33420c08ebb0ff37886b858297f9562fc366066c6d8e77bad1918b04756ba03f5c385d44f06759daf1b7a38b2a64248dee95d0e3886c8afa1f74afd8ac3c56520d0f3fd206df8e0d257312756803b09a79d0cc38112592c3aec32de5a9bc3284c5a0a2d0808b102deafa5cc60f04e3d71c0284cba04f17f88aa8e07d5544fe0265807d515877f79d30ed26d522b9d9c56597647b0dbca5a69d6418f8d1b51481723f272c2a3d48f6f4fd6beeac3576c3edb00e8779964548aeab8e004c7c4f8ef9cb6e680e2d2d49792004bb3e6974fa48f241a361ca449c02bd4c0ad4e66252c55e656f16049908efe59acbafa1171895dfac64d909808e5420469d622c7253ec1de7522b41634d383bf8786bf881cbf1561627f1e62b2d93300ec30ec0f5f0ab32036fce068bc76b0b0c6452079537f8d7f8dcee4b42bbf2d9ad7499d3835cd93cfc7e8ebea3554ab5241e181e5d73241b7bebf0a281b63594a35f4993e2b416d60db966b58b648cfcba2c4bee4c2830aae4a70ff55012480298f549c13b1b2684277bca12f592471b8a99285174f1c0ebb38fc80e74a10b3f02ec3e6682ba873f7ff0e1e79718b470927c74ed754d4f7c3d9a55e22246e829cdb5a1c6fb2a0a6c896df303063c918bcf5eb0017":"4454b6983ff01cb28545329f394936efa42ed231e15efbc025fdaca00277acf0c8e00e3d8b0ecebd35b057b8ebfc14e1a7097368a4abd20b555894ccef3d1b9528c6bcbda6b95376bef230d0f1feff0c1064c62c60a7ae7431d1fdfa43a81eed9235e363e1ffa0b2797aba6aad6082fcd285e14fc8b71de6b9c87cb4059c7dc1e96ae1e63795a1e9af86b9073d1d848aef3eca8a03421bcd116572456b53bcfd4dabb0a9691f1fabda3ed0ce357aee2cfee5b1a0eb226f69716d4e011d96eede5e38a9acb531a64336a0d5b0bae3ab085b658692579a376740ff6ce69e89b06f360520b864e33d82d029c808248a19e18e31f0ecd16fac5cd4870f8d3ebc1c32c718124152dc905672ab0b7af48bf7d1ac1ff7b9c742549c91275ab105458ae37621757add83482bbcf779e777bbd61126e93686635d4766aedf5103cf7978f3856ccac9e28d21a850dbb03c811128616d315d717be1c2b6254f8509acae862042c034530329ce15ca2e2f6b1f5fd59272746e3918c748c0eb810bf76884fa10fcf749326bbfaa5ba285a0186a22e4f628dbf178d3bb5dc7e165ca73f6a55ecc14c4f5a26c4693ce5da032264cbec319b12ddb9787d0efa4fcf1e5ccee35ad85ecd453182df9ed735893f830b570faae8be0f6fe2e571a4e0d927cba4debd368d3b4fca33ec6251897a137cf75474a32ac8256df5e5ffa518b88b43fb6f63a24":1 |
| 367 | 367 | ||
| 368 | SDV_CRYPTO_RSA_RSABSSA_BLINDING_INVALID_PARAM_TC001 | 368 | SDV_CRYPTO_RSA_RSABSSA_BLINDING_INVALID_PARAM_TC001 |
| 369 | -SDV_CRYPTO_RSA_RSABSSA_BLINDING_INVALID_PARAM_TC001: | 369 | +SDV_CRYPTO_RSA_RSABSSA_BLINDING_INVALID_PARAM_TC001: |
| 370 | + | ||
| 371 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 | ||
| 372 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001:0:1024:CRYPT_MD_SHA1 | ||
| 373 | + | ||
| 374 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 | ||
| 375 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001:1:1024:CRYPT_MD_SHA1 | ||
| 376 | + | ||
| 377 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 | ||
| 378 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001:0:2048:CRYPT_MD_SHA1 | ||
| 379 | + | ||
| 380 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 | ||
| 381 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001:1:2048:CRYPT_MD_SHA1 | ||
| 382 | + | ||
| 383 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 | ||
| 384 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001:0:1024:CRYPT_MD_SHA256 | ||
| 385 | + | ||
| 386 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 | ||
| 387 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_PASS_TC001:1:1024:CRYPT_MD_SHA256 | ||
| 388 | + | ||
| 389 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Deterministic | ||
| 390 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_DETER_TC001:0:1024:CRYPT_MD_SHA1 | ||
| 391 | + | ||
| 392 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Deterministic | ||
| 393 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_DETER_TC001:1:1024:CRYPT_MD_SHA1 | ||
| 394 | + | ||
| 395 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Boundary 1024 | ||
| 396 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_BOUNDARY_TC001:0:1024:CRYPT_MD_SHA1 | ||
| 397 | + | ||
| 398 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Boundary 1024 | ||
| 399 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_BOUNDARY_TC001:1:1024:CRYPT_MD_SHA1 | ||
| 400 | + | ||
| 401 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Boundary 2048 | ||
| 402 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_BOUNDARY_TC001:0:2048:CRYPT_MD_SHA1 | ||
| 403 | + | ||
| 404 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Boundary 2048 | ||
| 405 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_BOUNDARY_TC001:1:2048:CRYPT_MD_SHA1 | ||
| 406 | + | ||
| 407 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Negative | ||
| 408 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_NEGATIVE_TC001:0:1024:CRYPT_MD_SHA1 | ||
| 409 | + | ||
| 410 | +CRYPT_EAL_PKEY_Gen, Sign, Verify ISO9796-2 Negative | ||
| 411 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_NEGATIVE_TC001:1:1024:CRYPT_MD_SHA1 | ||
| 412 | + | ||
| 413 | +CRYPT_EAL_PKEY_Sign, Verify ISO9796-2 Vector1 RSA1024 SHA1 | ||
| 414 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001:CRYPT_MD_SHA1:"ec6c8a4c5fd8f02af97b9fe30a4eccba3bc3e5a20e410e52d3200cb4e23e8ea56d5b17a5344a3d12bbc64dfbf0004ec7d1d275462b990343dba9962f19b61152e4a9eb6b11c0215c54bb70ee8dbe6b75aa3702915f8ae713d3f2a75eac6d2f71d375ff3b6659196474854b3e6cf8ec4426420d25ef460b5b33c28d618039b301":"010001":"4397f09e4f54e5ad53b0ad90aad4c6a1840ec8eb6129e65f75af1712ec1038964142a6eafb9d3202d61ea7131d95e8f0262406956e478bf06daff99933bfa309c45684e1fa47b779f297774ca18937f6e7593eac1d0debb61dec78b574a37eee666ae7021476ed152e693ed70efa9dc9872bdedcba3012e83cb6c954b8bedf01":"dea3b19b8abc6777b15b5ddf2e800ab91be68f115775204ddfb65ed37384b2644b67de79edde0c3118bd808be1abb4f96515c9bc0679cb0ab27674835306fea30669e8c117eec2adf648623fdd030e6e9d9b63850bae4995e38b406359ed8bbd1785e257a021e4f82d81a7":"cc8e71560191cc10f4b7374c5e96773a28aead0ffa8fd41608eb8f28227ff2384f90962b722e7c17abb7c8bdbedafb081a79dc88f5067bcc5d13bf252c2b246b7c83ed67d717640cbb23300976ffa3ada6591f335c6d4d45d01ebec34a1db96296e1a898b9655baf1662737dbb7b18deb06f46b0ccff39e4f30cd0c8f2081f7f":0 | ||
| 415 | + | ||
| 416 | +CRYPT_EAL_PKEY_Sign, Verify ISO9796-2 Vector2 RSA1024 SHA1 | ||
| 417 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001:CRYPT_MD_SHA1:"d68124035734b3ca34c19a0483b48c67d6a680f40d52f36eda4415e6d0cd356a9eee37b132a5cbf2dbcb5345041f805964c8b84b41571ee864c540acf24df90af86f2ad786224d7edf8c21adc6b740e2c3cab77e84daeefae5a300e2ff1ef0be7fd012328a17b9dc7f11f2a24ba5e5d85b789ce55a76c2feca0a12b2e4d889fd":"010001":"74405d022a7af78d78f60bc0b2986117cdaf436800e899e1d40cde49cf93c78557490789d34723b7250396c76aaa9fe6d2c62d8b2b8849c9ed03324008b9d563ecaa99e1a361e6b60e6d73fce0f4480f8622e5435a07625773350098acc0e5a323372f5ed0c1b8c56bce50e86d516dade109dfa47cd8d0fd5adaddefb7124c41":"e1ffdc6fe825cdc47fedc63e749cd6a80763327f1821d4bdb44a8b9cfe7dff4e85a2f774a4ea7956d6d542d6da656748c2c34637323aedbf2aa4ef0530827d51a99e6c3b1585d3fe313d9ba108dd288f82f342939b39ff3b45ce27df1e9e7e5cb3db84aee647b2a3034d94":"86e22decacf2634bffb9a0a0ffe3c4848f8de6aa476c3f6c367fd4e8b7f37ae34bd6e842e9f6a8a20867655d246bfbabf1e038d502d6570c451a332c700addbca919cc4ab4c59f9317da2d6a7c8f85b600d4de7a1037a13d3b090e6c65e8a90d21f50c951e36620c46285fbbb007532e12f66b77992a99e90c91d40c8e523ff4":0 | ||
| 418 | + | ||
| 419 | +CRYPT_EAL_PKEY_Sign, Verify ISO9796-2 Vector3 RSA1024 SHA1 | ||
| 420 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001:CRYPT_MD_SHA1:"a4f572c43fd178086cc3deb3af0ac2fbcccf530b2b90658998209ea41aa4e2646b3eacb07daffffab63c9442cd407d3ef40668e256f87eae0a1d36a966a966f1100814f65be8671c26c838954a0a2c2d77a8f8cffcc8c7074fb7c52b55dd74345d131525cf732afa4f08e5c9bb7f8fec766aa8dba13ed73da7f30a0e58cb0a8f":"010001":"17b7cee396c5787bc59fb8129fd56d49a51e1e3399f4ee148592131d475373d5ba71cd84a6ddba7182e85cece9f41ece016a36846cbad8041022392ccc3d0936ded969eeebfec575566415895583c3e42a805f453caf216daf1b1b35e87b2fb04e5cbf0b2d3a7e90f8ce8bf830f7465850c71c46bb8b07cb6a00c2a5340dcae9":"481c0e9cbed95d9444b5941e23d086fcd56bc40e688b1348120f2e87cd63953d5a1931c31e3efe7456749b28f3100fe30b23defd816127a9906af72e5ac3281a967d88b19d717190335d9fbc13c4a261a47616bf94ed3984d651b95bbedf30daf134269693b56c96795744":"a0d5ac08e001318f9afa983183096ee19ee0da2a135ff4a523b19f0cff469cc3e6baee8a2f4d5332ce92d470fbc237bebaf00fb9323e4ea36b6650fa1255d884ba9da9d19b4eb79b60c73b62c0c748b7d67caaa52c2babebf32702dc13db9fbddd2375ae5cd85135b2297f166c084ed9e725e377087986427888c337cb137212":0 | ||
| 421 | + | ||
| 422 | +CRYPT_EAL_PKEY_Sign, Verify ISO9796-2 Vector4 RSA2048 SHA1 | ||
| 423 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001:CRYPT_MD_SHA1:"b65924e3c5ba791dd7a5eb5ee31a35ea9b2de88f1a3b283e0103a7275ac8d38033ec66dde73737bc194ef3de3397c5491c7f43457b53f753f43a52a80cd61f9ff05bf8057e146f6b697148c2380caa0ca8c8fec842d28870c9a056860840a17e3251226a79bc8447e00d086bd6f93dbbaae291fd88483bfc0713209ab7b5a18eb78182351f1cda4f9378ea95443e7c456005750823b1fc212b88b5a269cfcd26b925d8c8ce0bad03bff7846a9f943aa88a41fac4c9153430c379a9696876a47ad335b043c94eff300ac787fa63f588c6ffd128939722d27cd4fdbb3b5710b5505fa84142bcbe5e560ca53381b7d65f99aa0fadd116f60b8553b323e2ad04f8c7":"010001":"016094fdbf6d94229c915d40bf386075e02c2d987f1b3947969c5f73d5a4b4ac403825e2c12f5295721f7d8a0d1bb55ac303570fbc49bb118043bc82166ebb986aa9572b3b738e0fe2a0ff6ab01fb05d1e1d3e8766b1ce6403b1d95573d48123c1df890202df60a46655d2dd75a736472798448004ba7ef17d60309bda8d5da6020b1684f774390883dd93bb5d76412da29448a6f20ba7e7dfc38048d15e553c56b227c8602e27d8c933e072818116c5ae85390b45bc571b0e35eb54ebaf9abec2a885871c9faf3a8a3758e93460cd2ad65d9329e46a2e1968e921d0febef440c6d9f0e6f51b57d492ee16e91e4d6e1ad3bada0dbc56c0dc33c923ccc7995e11":"848893db53e45071797c4ff63a2422d013bda5083a137c9c58fd37e4e8717afc69dd32b5b516943869ee6d305557beb38a2e1c61e3445fe59108df3282a43b89b9c2f272fe6fa592366f0a5a68f64be2e4821959d2487a286936451829ec40cd9d04f9ecf045718d8112202ef2281e5777db9dc974c6e55e0a8f4aef65e0bd765a6fbb91f091f59bafd279b0a70921e13c704c2fc8f8f6dcad728c3f9b8538de69aa6c52306aed90b534ef3596e92a6c0ff6a30144f71efc9686c8056d2b081a46a03dd61f085201078ab19bff513c08f38c1960afbfac2f111e45f3e130240e79cdb3e5e64b44ad5c962e":"2eb28de3c66812206ad337bfbd0c1d5df7de88e1196455c01030bce69d868e856d9ab90adc97cc0acea435ae432d0446a7c795b89dd7c3bbe7a124494ed458c6351345815dabda3934ab2293bd208348abd3842323d4eb6a1f68e80f23655ce834ac6ff4a50da21fdcb2bb1d7bd37f34a2129f822fa51041bc0d4cc7a08ba52fab004ef11f0ac384920de22c1e6fe63802f58361406893d3f3cf84d7669e89e71d81137a34d6c61d08484aac3346526f5a4e9dcf887c1425d73b627f4a63f25d83900c3c2bbb6d5854c1beddd85950776706a593479da13c66634472e7c256ec639b02d5abdd9740cfb4bc1feaaf09aa763c88a273a08b4779b467b2511dd012":0 | ||
| 424 | + | ||
| 425 | +CRYPT_EAL_PKEY_Sign, Verify ISO9796-2 Vector5 RSA3072 SHA1 | ||
| 426 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001:CRYPT_MD_SHA1:"ac8cf8eaa446769a13b0d04d606fcf435bc4ea273bda487f524a15896fbe58c665aec7e8d0de97bea911deda5cbfe408b2ccafad059414dd8f1ebd19bdc01ddc24ba1b45f276f39532ce24fc3c9d8ea0c40df2b4c14ee437cb84d77a0dcbe1f05984f7cd0cb0b24dc5e19f48e069876d573893f6c54dc52740ba37d46a76aff5665d5bfaf2b8a76b930132560021dffd81e69791b43d5ef7a5aa851505689dcfe808527bc62d01e930f81519410b7a5dd23c821593b7e58d14916438a6a9135792e60a2efa79ce0e075bda00e399470ce4cf5bf3d98b64156940c49664440219ec4103929cd3ff7e49a07775d5f0cc38c3d11eec05c788e3d997b1bfe652549291259300a8fc5f67f7c07d771017e6a3636fa2a364dd52e26de7c261d3b45f126b0d71307e9a5d16eab29a490dc81f093cd0a0178a7ade9a2f33eb2c4958b7f362becae28df3ea9193c17021060250692c707e4b2920b9199b1fefe46c009c05788566c4cc4efdf981b4452be013ee0de8acd8e15429bde0288bdf6dc489e74d":"010001":"1ca678a32f3d22eec0e3bc2688e36fc8e9a927cef5657061b1a66aee8bcf117af9c1bc6048241992970c8851fe11ff994124f2eb79f06549877ccd5dc38fad7592e492e83992ee2d8106d105cfc3c27da7a8003b6a988094d2165fd7dc88149f1da2122a2a1801b71faaef91806f8d44c6b5767e04333e4fdef3bc96e8c985bc6baf87390309cd84b35f40be1e5e018cdc7f8efdaaad810202302ed237787031a7ff8fc08cfe86a17357d1db045d95471444273e516d78b044f0c23114dd20808545f8a70d30712a52e66403a8c8ecc4f85fd938be6387b91489853f79e18935ab1ad2ff549799618ba66d46442686d58d415a671f3259c9a5d4ad74db98cb6b62d5e0f26ca2f4a839b0e796572539263d0e7df23215ed99ec2bfd6ce0f11cf10c9502636f52a43a36244534357b776b0c261dc7d3c742368a47c2ddc8457426bb0db0e1496ec323c215c5d63b135f068464d837024b378c3ccc6fe353ae296a212ac2f29a2102783b06cdcc62ba9042b0f714053e6a4b9fbd7a9c29a3c91b69":"4c8338b46e69792a568db742ee96d2732ca62f2f6ad44dcb81e8f20ff28a8c20f6632274eff59492003ec5c856a48615fbfaf2b0e0eac7c01652baa27f3a765d5940983d8273170e7f220bf38d0e59bebfa9b63c7e27fa50813513a3a115e576c7e80531977e13c57bc6294eb765e86b58d11153ed87c8b7a69626be3e5ff58b161872e4b37da100e0944735f55c1ea8c45edb4d46a2cc208841686b957a3f0814112e428fc4a8e03703638289b99d283a936ec7ca03cfe7987ab970de20616943df4990bcf8531b45f54e2d07a6e52df2cc94fcce8647bc1c3560a0fafdbab7b5fbb9307fc45a4dc5a8666c96369ff19689fb9f0f483d6b0b99350835421f576b7c331c1d7edf466ab6c999f3b688dae75b6e7380f54ae244077d59f9059913831ab787adef218bb7ffa301083a871676133672fbff8cc12fc3a427c3c06535ccdb82a7f7335e51e758896121adcb552a36c21066592b1af6c4cd5071fb5f7e28c9573188294d6a75e2a9":"8fcc165152974c9bd858af0cd911be5e5c37fd2cefbed973bc5cb8bece6580468e03a457d8d6ebf23453a27db1fdb0c3d6f1d2edf4687cb56990ea78d05e47b84cb134aa19d7fa35958c2329389ba5ddecf266f17b69853d121633d990f2d04152ed0081bc440746edee900277cc442b03ec5706493ac6acc9c974d30a168914c5ed50bc2f6dc4d909ce90b38454b789547b44a0f65c6cee9eece8d886a0454b1a39a635febb34907d61062dcc6054949e02c681c5ab301fbe295577a88424c5cd80d10ec1ed82bedc352f0d4fb48db9bf8b50bdb5d9607e5d9147dc9bc7f258afee83df8864e94046d482ad7a75fc9d03d4c62277016d6fc25c1abff691697736c650ab8bfedc1f4cbba46d312670eef118a45c2dc2f1eb00938205ea788a0504ac4485c77e94b74177d9a1ed1848bc3b3cdabc95a82b3df4eae987b5fe6499ba5966f12cb04d24392db1a28d8039ff598e9edbf93101311cedad7a91727536416f9922ddb054a8383b841a54629f12245a36e5e7fe2b2ab1c1858a041c9ca7":0 | ||
| 427 | + | ||
| 428 | +CRYPT_EAL_PKEY_Sign, Verify ISO9796-2 Vector6 RSA4096 SHA1 | ||
| 429 | +SDV_CRYPTO_RSA_SIGN_VERIFY_ISO9796_2_VECTOR_TC001:CRYPT_MD_SHA1:"c065866c4fe9ea4c45d76ebb95e60f6875b0f1b4fca66832b17dc5a9d0b7045f3f2fda3583413b2a088351640298ec95d5abad95b523412e3572a88f19369e968cd18881adc6ccdf29507505403ac8f692ff895bf4693e9f946ad4ac8864fd9a6f3dfabf1f811af8bbbc63fd8741ad14b3ba69c5e71d7dc85ded65761d80c4f9c6978811819ce03afcca9b621663dd6a78d24959e2050e694bf43a8282736c579b5f4da0ad7612c25ee1c16dd866d3040af7826841541f61a43b3e87ccda456466cfc77826b1f8e8d1d4384a977e64881002977d7828fdfa021b42478a159146096231c53d9fe651662a42590e0091213de63fa8947ebab315f8dd8104ba3ba805efd5b362e611ba72652a174ef1beb83018d7b4865f38917eee703bd167ec024771ed1607e8db333c49ca3d01934a6cfdee3a7b498978b55835ead39e474e814f63f082148848f848a7c2afdb67ea1503707278ef1493e4956d7644194e649b82d774c9f5e0c5a8a2a69d2b86c0e43b46f1322e9e57b553bd3b8cf3c5c48a173fc2ae102e799bfff806b9cb4ffe2f65752d046a6f46bd9a8a47fb214dde5a05213af7891eda3632c6c46f9538ae3e3d922c22756aa0d2e1dada9e5511198d8d3ee37b39bbdc7d0bd0c8ddb6c18b5575e349aa1d9d0f45476546b7528a8ec00a373991960d211f0e1b0366f323be5c7cc391a5223dea7d4aa180f4fbdabd43b3":"010001":"02fa82980be0ac981d4be31f93ee500ff42416f0435d0f5ab4c1f11cda8357a295dad798fb49d170ddbfac4d19ddfe36dc6c2cfc63bf4f606b29690fd613e431d67a43f625fdfa1bfcbdf3eea1e0ed80bef0a63924d1b9e5115d5a09228f6f4b442c6ade5c9b194665b9a71ea3159f688ba3c49170c6bbe7fa677b76d675b0e3c77118b861764fae6080b4e2b8766aee1da5eef9fa4133c8e9ef83692d6f6f9e8dfdd4526e49d844e746bd74dfb0fca153fe22f4e76f9c90c303eefc7e07323dd3140c024e6240f871c25ded8819ae3ac1064c727fd2baa3da034c05964f145e7b01825dbec1172c5308c8d9c54c52f2ddcc4224703016e040e43a6e744e14fd2040eba3e4e670ca91c4296c0d0ba1e147d043618b2fc295d7df4947b60bdd06163ddf0233456dbecf578c947d4afbd99f1d4c674797a1206f39fd4681686ab4239661f5559e6b5cdfd620338b5759ce670b276eaa61da0e029741c50e5a9aab32a49b984fbbb2d3989e9fc76348d11d7898877fc5c811e9f47eacb49eb8351bf28ea2b3f06f7534b30945bbbb61d4409fa2f9d779d5a25fab8ddc0d10755833b2df38fa74eeee2b346efeae1874cd93ec9da7b4d6168e1d073235bad4b11cebf72ba01e19fd999b41f7bd01fd6d375683dff5c58c0271b0b89358901ec98f2cc871ad89305e1f461984808396a9f1bf4989946a5780f93245998ab9d379caf9":"dc1aa91193a8e7421fbba3b1d235ddf3c4a270464c13d67d7524517c98769ed6ad8ec7336a1ce1c432b1cba95faf58ca0b4397604e1a4a713fc17a4d1ae4617e36d1aa24966b40520166ec37506e4413a93b7c204032b8c8219bbc4ba9dda5b53c309f4d96997d805d675ea3e0f1b20aeb571d8a48358a01fcdc0d2e2f02d8b34a2bbebbf9ee232c3a6c79ff420468c6095a7f429c04bf5e4ada3376f82d8a0cd15a8ae0c333dd85cf34594879df621c8dcf2ddc3491a4f8cb7f60ad90e15024e93c0d9780f2c19a905f6db0a66b2582653893cb0727e95c884a1fcae720d5a3faf2f56bb26de469183248edd7d2a40971266d1bca94a0bc20a67030cf838b47981f950f2819883fb4d10b2cc8a436cede3eca21e2a84e4935163b25afe45ae935cbe7db3ac4b799bbb847a8af25803ac466e93c3ef9fb8d135163503ab078a0beae4a17cc51d5788068b6a6604b4118433162b2de3662b3598181e2c9843744e95e70ac9506d1638d7e3d6f072bcb5ddf6907055ea5889dd0c1f76d70bf8c57ceac4c3264125a7d4407735576dfaa94171868ac6b56d5d53088820d3695b4cab158e956c0855c3eb20606e5b638176dc8687b8802c1aa0c6129b4948000e2fef86703f44c6de138de76fb1014e372b8b163f195f893d133a682a8eeb24ede127bcc8273169bd8b159e944":"0ed173b2250b4ff82a2a5e7e916fafac6f581efe50bbd26dc07d07b9a81cc232b0a44abc1c0f206f6318a0c2dc757d384205e66775e82d99cfde9654efb9d31852c269f9047686730baa504ed0930802380fb06ef2293481951e031030b14787b8e71d7d7a55a3eb9d040d7089c621ff4eb985d387bb563052999703a397a81057fb14b751fec2b4726b0309d70bb5a39552c04f8d03a27d248c54129d86dbac22555ccdac1385a8b9ef6055291fcf868603f72a99c61bba79647eba81007ef4e1bd15905c49923f5bbaa9a22f4497111e887e494741341238077453f3ca0e919f9b8cb3b2315fed3f0779cba9c437399a7f7ed9c334d62de53ff0ce152669d8dc14bf7cc5f1a86017d11216446456e7c753e42df0106d22e7de2d57a4361b520a084ea87079fb351cbfc5dd6a2619b4da6ecb7adf9aae68489949a8c68e029e531d4a6f926adf6163afcb86a52207df33d4fe61b3d6bdafe04cb4155231af72ca33c463ea33762cafc161182999f0e4c46babb05a0556cfa9a904318e28bda67636b3f4da488ecfc0a56349e0166bdf483f564f88085ae98058495b3a5395042f5c1ea147c7044ff0da8fc61038f4a69b51080ec0c405ae9fd4fe750000d5a505167c5955a64565dcc642a9133dfc46a7ce2acd6fb6c81bce152e972a892a219e37ee7fb55912590583363cd1377a41c5abb24eb043944230df34b67fe35de5":0 | ||