无法使用 Plug & Trust Nano 软件包从 SE050 检索 ECC 曲线详细信息 嗨,团队、 我目前正在使用 Plug & Trust Nano 代码包来读取 SE050 中的 ECC 曲线细节。 然而,尽管函数调用返回了成功状态,我却始终收到曲线细节的零值。 我查看了 APDU 配置,并根据以下恩智浦社区讨论验证了我的设置,但没有发现任何问题: https://community.nxp.com/t5/Secure-Authentication/Read-ECC-Curvelist-fails-when-SCP03-enabled/m-p/1664562?profile.language=zh-CN 请告知出现此问题的可能原因,以及我如何从 SE050 中正确检索 ECC 曲线的详细信息? 环境详情: SE050 变体:SE050-C 和 SE050-F 代码包:Plug & Trust Nano SCP03 状态:已启用 主机平台:树莓派 代码详情: status = Se05x_API_ReadECCurveList(&se05x_session, curveList,&curveListLen); printf("curveListLen:%d\n", curveListLen); if (status == SM_OK) { printf("Supported ECC Curves:\n"); for (i = 0; i< curveListLen; i++) { printf(" Curve ID: 0x%02X\n", curveList[i]); } } else { printf("Failed to read curve list\n"); } smStatus_t Se05x_API_ReadECCurveList(pSe05xSession_t session_ctx, uint8_t *data, size_t *pdataLen) { smStatus_t retStatus = SM_NOT_OK; tlvHeader_t hdr ={{kSE05x_CLA, kSE05x_INS_READ, kSE05x_P1_CURVE, kSE05x_P2_LIST}}; size_t cmdbufLen = 0; uint8_t *pCmdbuf = NULL; int tlvRet = 0; uint8_t *pRspbuf = NULL; size_t rspbufLen = 0; ENSURE_OR_GO_CLEANUP(session_ctx != NULL); memset(session_ctx->apdu_buffer, 0, sizeof(session_ctx->apdu_buffer)); pCmdbuf =&session_ctx->apdu_buffer[0]; pRspbuf =&session_ctx->apdu_buffer[0]; rspbufLen = sizeof(session_ctx->apdu_buffer); SMLOG_D("APDU - Se05x_API_ReadECCurveList [] \n"); retStatus = DoAPDUTxRx(session_ctx,&hdr, session_ctx->apdu_buffer, cmdbufLen, pRspbuf,&rspbufLen, 1); if (retStatus == SM_OK) { size_t rspIndex = 0; tlvRet = tlvGet_u8buf(pRspbuf,&rspIndex, rspbufLen, kSE05x_TAG_1, data, pdataLen); /* */ if (0 != tlvRet) { goto cleanup; } if ((rspIndex + 2) == rspbufLen) { retStatus = (pRspbuf[rspIndex]<< 8 | (pRspbuf[rspIndex + 1])); } } if (retStatus == SM_ERR_ACCESS_DENIED_BASED_ON_POLICY) { SMLOG_I("Denied to ReadECCurveList"); } 清理: return retStatus; } 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好@krsuresh、
我用 OM-SE051ARD 和 raspberry Pi 3B+ 测试了你在 ex_se05x_sign 演示中使用的代码,结果与预期的一样好。
Kan_Li_0-1763104753432.png
是否可以使用最新版本再试一次?也许您也可以尝试删除所有 ECCurves,然后在测试前重新创建您需要的 ECCurves。
祝您愉快, Kan
------------------------------------------------------------------------------- 注: - 如果本帖回答了您的问题,请点击"标记正确" 按钮。谢谢! - 我们会在最后一次发帖后的 7 周内跟踪主题,之后的回复将被忽略 如果您以后有相关问题,请另开新主题,并参考已关闭的主题。 -------------------------------------------------------------------------------
Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好@Kan_Li..、 我认为这个问题是在执行kSE05x_ECCurve_NIST_P384/ kSE05x_ECCurve_NIST_P521样本后出现的。 基于 Plug & Trust 完整代码包,se05x_minimal 和 se05x_GetInfo 示例运行正常;但是,ex_ecc 和 ex_ecc_rsa 示例失败了。会不会是安全存储器被锁定了?我还能使用 Nano 代码包执行 Se05x_API_WriteBinary 操作。 请告知是否有任何选项可以对 SE050 设备进行完全 RESET。 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 我没有修改任何代码。我使用的是较早的 Plug & Trust 代码包版本 v1.2.1,因为在最新版本中,我在启用 SCP03 模式 (PLUGANDTRUST_SCP03) 的情况下进行构建时会遇到版本问题。 我在 SCP 模式下版本时遵循的步骤是: mkdir 版本 && cd 版本 cmake -DPLUGANDTRUST_SCP03=ON . make /usr/bin/ld:版本/libse05x_lib.a (se05x_apdu_impl.c.o):在函数 `se05x_api_SessionOpen' 中: se05x_APDU_impl.c:(.text+0x384):对 “se05x_api_scp03_createSession” 的未定义参考 /usr/bin/ld:版本/libse05x_lib.a (se05x_tlv.c.o):在函数 `doapdUTX' 中: se05x_tlv.c:(.text+0xe90):对 “se05x_api_scp03_encrypt” 的未定义参考 /usr/bin/ld: se05x_tlv.c:(.text+0xf0c):对 “se05x_api_scp03_decrypt” 的未定义参考 /usr/bin/ld:版本/libse05x_lib.a (se05x_tlv.c.o):在函数 `doapdutxRX'中: se05x_tlv.c:(.text+0x11d0):对 “se05x_api_scp03_encrypt” 的未定义参考 /usr/bin/ld: se05x_tlv.c:(.text+0x1248):对 “se05x_api_scp03_decrypt” 的未定义参考 collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/ex_se05x_GetInfo.dir/版本.make:114:ex_se05x_GetInfo] 错误 1 make[1]:*** [CMakeFiles/Makefile2:100: CMakeFiles/ex_se05x_GetInfo.dir/all].错误 2 make:*** [Makefile:91: all] 错误 2 即使在开放(非 SCP)模式下运行,旧版本和最新版本的代码都会出现同样的问题。 ./ex_se05x_sign Se05x 信号示例 ! Plug and Trust nano 代码包 -版本:1.5.4 I2C 驱动程序支持普通 i2c 级命令。 生成 ecc 密钥 Se05x_API_WriteECKey 中的错误 SE05x 信号示例失败 ! ./ex_se05x_sign Se05x 信号示例 ! Plug and Trust nano 代码包-版本:1.2.1 I2C 驱动程序支持普通 i2c 级命令。 生成 ecc 密钥 Se05x_API_WriteECKey 中的错误 SE05x 信号示例失败 ! 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好@krsuresh、
感谢您提供的信息!你修改过纳米代码包的源代码吗?看来你的代码与 Github 仓库中的代码不同。详情请参阅https://github.com/NXPPlugNTrust/nano-package/blob/737b61c527d4145f6dc96db9b51e22a4067ca09c/lib/apdu/se05x_APDU_impl.c#L998。
祝您愉快, Kan
------------------------------------------------------------------------------- 注: - 如果本帖回答了您的问题,请点击"标记正确" 按钮。谢谢! - 我们会在最后一次发帖后的 7 周内跟踪主题,之后的回复将被忽略 如果您以后有相关问题,请另开新主题,并参考已关闭的主题。 ------------------------------------------------------------------------------- Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 嗨,@Kan_Li、 生成 ECC 密钥对时,SE05x_API_WriteECKey 函数在 SE050-C 板上返回 0x6985。 之前同样的代码在这块板上运行良好,但在 SE050-F 板上仍然可以正常运行。 这个问题是突然发生的,我无法确定原因。请帮我解决这个问题。 SE05x_ECCurve_t curveID = kSE05x_ECCurve_NIST_P256; status = Se05x_API_WriteECKey( &se05x_session,NULL,0,keyID,curveID,NULL,0,NULL,0,kSE05x_INS_NA,kSE05x_KeyPart_Pair); if (status != SM_OK) { SMLOG_E("Error in Se05x_API_WriteECKey \n"); 返回 1; } 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 嗨,@Kan_Li、 感谢您的及时回复。 请在附件中找到在开放模式下捕获的 APDU 日志详细信息。我发现 Se05x_API_ReadECCurveList API 在开放模式下会返回失败,而在安全模式下却能成功执行。 请查看所提供的详细信息,并告知我在流程中是否遗漏了任何步骤或配置。 版本步骤如下: $ cmake.. $ 赚钱。/build/src/se05x_app krsuresh_0-1762830074736.png 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好@krsuresh,
感谢您提供的信息!您尝试过与 SE050C 进行普通通信吗? 日志应该如下所示:
Kan_Li_0-1762828359549.png
祝您愉快, Kan
------------------------------------------------------------------------------- 注: - 如果本帖回答了您的问题,请点击"标记正确" 按钮。谢谢! - 我们会在最后一次发帖后的 7 周内跟踪主题,之后的回复将被忽略 如果您以后有相关问题,请另开新主题,并参考已关闭的主题。 -------------------------------------------------------------------------------
Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 请查看 APDU 日志详情。 krsuresh_0-1762823698890.png Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 嗨,@Kan_Li、 感谢您提供的信息。我尝试使用 Se05x_API_DeleteECCurve 删除曲线,但仍遇到相同的 0x6985 错误。 请确认这是否是删除曲线的正确步骤,或者我是否遗漏了任何步骤?请在附件中找到调试日志以供参考。 status = Se05x_API_DeleteECCurve(session_ctx, kSE05x_ECCurve_NIST_P256); if (status != SM_OK) { SMLOG_E("Error in Se05x_API_DeleteECCurve \n"); return 1; } else { SMLOG_I("Curve Deleted Success.... \n"); } status = ex_se05x_create_curve(session_ctx, curveID); if (status != SM_OK) { SMLOG_I("Error in ex_se05x_create_curve \n"); goto exit; } 日志详情: ex_get_version, PASSED APDU - CheckObjectExists [] APDU :DEBUG:kSE05x_TAG_1["object id"] = 0x7B0001F3 SCP03: Encrypted Data ==>:84 04 00 27 18 d3 f3 89 46 7d af 66 e8 67 09 59 27 f3 cb f8 35 b2 3f 88 79 c3 50 2d 3f APDU Tx> :84 04 00 27 18 d3 f3 89 46 7d af 66 e8 67 09 59 27 f3 cb f8 35 b2 3f 88 79 c3 50 2d 3f APDU Rx<:7b 78 12 39 41 5e 28 e6 ef 8f 93 9c 4b 79 aa 3d 91 a6 7c fe fd 2d 88 15 90 00 SCP03: RMAC 校验成功。..解密响应数据 SCP03: 解密数据 ==>:41 01 02 90 00 APDU - Se05x_API_DeleteECCurve [] APDU :DEBUG:kSE05x_TAG_1["curve id"] = 0x3 SCP03: 加密数据 ==> :84 04 0b 28 18 4d d7 f6 7c 76 5b c8 d8 70 bb 72 9d 7e f1 7c 59 ea 04 a3 4c c8 37 65 56 APDU Tx> :84 04 0b 28 18 4d d7 f6 7c 76 5b c8 d8 70 bb 72 9d 7e f1 7c 59 ea 04 a3 4c c8 37 65 56 APDU Rx<:17 58 65 57 b6 41 08 ca 90 00 SCP03: RMAC 校验成功。.. Decrypt Response Data SCP03: Decrypted Data ==>:90 00 Curve Deleted Success.... APDU - Se05x_API_CreateECCurve [] APDU :DEBUG:kSE05x_TAG_1["curve id"] = 0x3 SCP03: 加密数据 ==>:84 01 0b 04 18 2c 27 d5 77 43 c8 76 d8 29 04 8b d9 66 d4 db 3e f8 a4 85 a1 26 8c 91 d4 APDU Tx> :84 01 0b 04 18 2c 27 d5 77 43 c8 76 d8 29 04 8b d9 66 d4 db 3e f8 a4 85 a1 26 8c 91 d4 APDU Rx<:bf c3 26 f8 16 8a e0 d0 90 00 SCP03: RMAC 校验成功。..解密响应数据 SCP03: 解密数据 ==>:90 00 APDU - Se05x_API_SetECCurveParam [] APDU :DEBUG:kSE05x_TAG_1["curve id"] = 0x3 APDU :DEBUG:kSE05x_TAG_2["ecCurveParam"] = 0x1 APDU :DEBUG:kSE05x_TAG_3["inputData"] :ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff fe ff ff ff ff 00 00 00 00 00 00 00 00 ff ff ff fc SCP03:加密数据 ==> :84 01 0b 40 48 0b a5 d4 2e 76 eb 95 a5 b0 44 a3 51 ff 9e ec 9d 5f d5 3f c6 98 fc 7c cf 0f 80 e2 59 d6 7b a6 14 07 01 a3DF BB 86 8B 2A 0E D5 F3 4C F3 C9 6B 07 02 1C 77 83 6E 85 E1 F6 DD 9B 9C 4C 6D C8 69 3D A1 DF D3 45 E1 DD 6D 7A APDU Tx> :84 01 0b 40 48 0b a5 d4 2e 76 eb 95 a5 b0 44 a3 51 ff 9e ec 9d 5f d5 3f c6 98 fc 7c cf 0f 80 e2 59 d6 7b a6 14 07 01 a3DF BB 86 8B 2A 0E D5 F3 4C F3 C9 6B 07 02 1C 77 83 6E 85 E1 F6 DD 9B 9C 4C 6D C8 69 3D A1 DF D3 45 E1 DD 6D 7A APDU Rx< :69 85 Error in ex_se05x_create_curve ex_generate_nist256_key, FAILED APDU - CheckObjectExists [] APDU :DEBUG:kSE05x_TAG_1["object id"] = 0x7B00022C SCP03: Encrypted数据 ==>:84 04 00 27 18 94 09 fd ce 6b 42 04 6a f0 08 94 b7 b8 ff 23 63 08 c3 57 ed 9c 2f 1f 0b APDU Tx>:84 04 00 27 18 94 09 fd ce 6b 42 04 6a f0 08 94 b7 b8 ff 23 63 08 c3 57 ed 9c 2f 1f 0b APDU Rx< :be 03 06 02 b6 29 d7 d3 76 1b 10 bc 4a 6b 22 6b 83 8b f2 21 1b 48 67 e1 90 00 SCP03: RMAC 校验成功。..解密响应数据 SCP03: 解密数据 ==>:41 01 02 90 00 APDU - WriteECKey [] APDU :DEBUG:kSE05x_TAG_MAX_ATTEMPTS["maxAttempt"] = 0x0 APDU :DEBUG:kSE05x_TAG_1["object id"] = 0x7B00022C APDU :DEBUG:kSE05x_TAG_2["curveID"] = 0x3 APDU :DEBUG:kSE05x_TAG_3["privKey"] :E4 EE 5F 99 D9 D8 37 8F 39 C2 C9 FD A9 12 5E A7 3F B8 FD 00 B5 19 E6 94 1E F1 34 75 8D 33 59 8A APDU :DEBUG:kSE05x_TAG_4["pubKey"] :04 f2 24 bc 5e ea 74 28 a1 20 d3 d2 69 fe 22 f3 59 9c 20 33 a2 e0 cb 81 c2 ce a9 d6 d4 66 c3 68 f8 b6 a8 9c de 08 88 b5 49 cd ed 85 d3 b5 88 72 0a dc 26 32 b0 30 bf b1 67 d0 fd bc 89 e7 2b 9c c1 SCP03:加密数据 ==> :84 01 61 00 78 4b c2 7d c9 fc a3 f5 01 27 7c d2 8d d3 03 01 bd bf 56 c6 04 9f 7e 58 40 fa c3 13 67 b2 9a 0e 1e c6 22 a9 87 06 23 74 6c 46 b0 0b 1f 9a e8 eb f3 78 c8 c9 88 a1 d8 ca 71 20 eb 86ca d8 86 85 13 51 ba bc 3d ed 99 5d 5e f3 ea 79 5c 64 5b 09 bf 0d e2 6a 8e b3 a7 61 c8 e3 0e b4 bf 18 af 56 13 5a e2 4b dc bf 8e f2 db 9c a5 1e 16 df f7 45 cd a0 21 1a 82 78 b3 9f e2 APDU Tx> :84 01 61 00 78 4b C2 7D C9 FC A3 F5 01 27 7C D2 8D D3 03 01 BD BF 56 C6 04 9F 7E 58 40 FA C3 13 67 B2 9A 0E 1E C6 22 A9 87 06 23 74 6C 46 B0 0B 1F 9A E8 EB F3 78 C8 C9 88 A1 D8 CA 71 20 EB 86 CA D8 8685 13 51 ba bc 3d ed 99 5d 5e f3 ea 79 5c 64 5b 09 bf 0d e2 6a 8e b3 a7 61 c8 e3 0e b4 bf 18 af 56 13 5a e2 4b dc bf 8e f2 db 9c a5 1e 16 df f7 45 cd a0 21 1a 82 78 b3 9f e2 APDU Rx< :69 85 Se05x_API_WriteECKey 中的错误 ex_set_get_nist256_key, FAILED 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好@krsuresh、
感谢您提供的信息!我可以看出 se05x_api_setecCurveParam 出现了 6985 错误,这意味着曲线已经安装完毕,但可能安装不正确,因此你无法再次进行安装,也无法使用它来创建密钥对,所以请先移除这条曲线。然后重新运行 se05x_crypto 演示。
详情请参见下文。
Kan_Li_0-1764053560292.png
祝您愉快, Kan
------------------------------------------------------------------------------- 注: - 如果本帖回答了您的问题,请点击"标记正确" 按钮。谢谢! - 我们会在最后一次发帖后的 7 周内跟踪主题,之后的回复将被忽略 如果您以后有相关问题,请另开新主题,并参考已关闭的主题。 -------------------------------------------------------------------------------
Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好@krsuresh,
看起来您使用 api 为 nist384 生成 ECC 曲线,为 nist256 生成 ECC 曲线,但 ECC 参数保持不变,因此导致此错误,您必须使用 nist256 的参数。
#define EC_PARAM_prime256v1_prime \ 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00、0xFF, 0xFF, 0xFF, 0xFF, \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF #define EC_PARAM_prime256v1_a \ 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, \ 0x00, 0x00、0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC #define EC_PARAM_prime256v1_b \ 0x5A、0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7, \ 0xB3, 0xEB, 0xBD, 0x55, 0x76, 0x98, 0x86, 0xBC, \ 0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53, 0xB0, 0xF6, \ 0x3B, 0xCE、0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B #define EC_PARAM_prime256v1_x \ 0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5, 0x63, 0xA4, 0x40, 0xF2、\ 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0, 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96 #define EC_PARAM_prime256v1_y \ 0x4F, 0xE3, 0x42, 0xE2, 0xFE、0x1A, 0x7F, 0x9B, \ 0x8E, 0xE7, 0xEB, 0x4A, 0x7C, 0x0F, 0x9E, 0x16, \ 0x2B, 0xCE, 0x33, 0x57, 0x6B, 0x31, 0x5E, 0xCE, \ 0xCB, 0xB6, 0x40, 0x68, 0x37, 0xBF, 0x51、0xF5 #define EC_PARAM_prime256v1_order\ 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD、 0xA7, 0x17, 0x9E, 0x84, \ 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51 #endif
希望对你有所帮助、
祝您愉快, Kan
------------------------------------------------------------------------------- 注: - 如果本帖回答了您的问题,请点击"标记正确" 按钮。谢谢! - 我们会在最后一次发帖后的 7 周内跟踪主题,之后的回复将被忽略 如果您以后有相关问题,请另开新主题,并参考已关闭的主题。 ------------------------------------------------------------------------------- Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 嗨,@Kan_Li、 谢谢你的澄清。 应用正确的参数后,NIST256和NIST384ECC 曲线现在都能按预期运行。你能否提供与你提到的 SetECCCurveParam 程序相关的文档或引用材料?掌握这些信息有助于我更好地理解所需的参数设置和基本行为。 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好@krsuresh、
很高兴知道这个问题已经解决了!我指的是完整版的 MW,ECC 曲线参数的定义可以在"C:\SE-PLUG-TRUST-MW_04.07.01\simw-top\hostlib\hostLib\inc\se05x_ecc_curves_values.h" 中找到。
希望对你有所帮助、
祝您愉快, Kan
------------------------------------------------------------------------------- 注: - 如果本帖回答了您的问题,请点击"标记正确" 按钮。谢谢! - 我们会在最后一次发帖后的 7 周内跟踪主题,之后的回复将被忽略 如果您以后有相关问题,请另开新主题,并参考已关闭的主题。 ------------------------------------------------------------------------------- Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 嗨,@Kan_Li、 感谢您提供的信息。 在 OM-SE050ARD 板上生成和读取 NIST-P521 公钥时,我遇到了总线错误。但是,在 OM-SE050ARD-F 板上,我没有收到总线错误,但是生成的公钥似乎无效。如能提供任何指导或调试步骤,将不胜感激。 以下是触发信号的 P-521 公钥(133 字节): 0x04、0x00、0xf0、0x6f、0x02、0x09、0x86、0xd8、0x11、0x6a、0x1c、0x52、0x2b、0x25、0x1f、0x51、 0x92、0x94、0xa5、0x1a、0x67、0x02、0xe0、0x4f、0x45、0x86、0x43、0x9e、0x6b、0x17、0x83、0x3b、 0xbd、0xcf、0x36、0xaf、0xa7、0x35、0x28、0xf7、0x10、0x02、0x32、0x60、0xdb、0x72、0x38、0xbb、 0x43、0x32、0x5c、0x48、0x86、0x32、0x53、0x95、0x6e、0x4f、0x18、0x59、0xc8、0xde、0x81、0xb4、 0x1b、0x30、0xd7、0x00、0x16、0x17、0x93、0x83、0x0a、0x4c、0x0d、0x90、0x80、0x2d、0x1b、0xf2、 0xfc、0x75、0x7d、0xc2、0xdb、0x2f、0x3a、0x68、0xda、0xbc、0xce、0xd5、0xfd、0x35、0x48、0x15、 0x6c、0xe8、0x19、0xde、0xef、0x25、0x3b、0x0b、0xf4、0xe1、0x17、0xad、0xa2、0x0d、0x86、0xc2、 0x20、0x61、0xca、0x4c、0x8a、0x05、0x5c、0x0c、0x5a、0x16、0xa6、0xe5、0x09、0x74、0xc0、0x9d、 0xc1、0xd5、0x37、0x36、0xeb、 总线错误 来自 OM-SE050ARD-F 板的密钥是: 0x04、0x00、0xe5、0x6a、0x9c、0x58、0x0b、0xa0、0x2b、0x97、0xf6、0xc7、0x05、0x70、0x09、0xb5、 0x12、0xa6、0x89、0x45、0xf0、0x28、0xb5、0x05、0xf4、0x4c、0x5c、0x63、0x7e、0xf0、0x7c、0x2c、 0x79、0x2a、0x59、0x88、0x7b、0xa0、0x8e、0x38、0x78、0x59、0xc2、0xa6、0x9a、0xe5、0xa0、0x47、 0x67、0xd1、0xf5、0x1f、0x45、0x55、0x55、0x84、0xfe、0x33、0xaa、0xe0、0x97、0xd1、0xeb、0x5b、 0xd3、0x3a、0x31、0x01、0x4e、0xdb、0xd2、0x5a、0x93、0xde、0x3a、0x86、0x8b、0x20、0xd5、0xff、 0x2c、0x96、0x45、0x51、0x55、0x3f、0x5b、0x47、0x58、0x5f、0x42、0xb9、0x4d、0xe1、0xda、0x4b、 0xf0、0x49、0xb7、0xc9、0x8e、0xf3、0x12、0xf1、0xae、0x35、0x02、0xb9、0x88、0x5b、0x3d、0x6c、 0x04、0x91、0x6f、0x49、0xd3、0x7b、0xa0、0xe9、0x87、0x09、0x49、0xd8、0x54、0xd1、0x5f、0xae、 0xa8、0x54、0xac、0x88、0x02、 代码详情: /* secp521r1 : 521 位素数域上的 NIST/SECG 曲线 */ #define EC_PARAM_secp521r1_prime \\ 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF #define EC_PARAM_secp521r1_a \ 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF、0xFC #define EC_PARAM_secp521r1_b \ 0x00,0x51,0x95,0x3E,0xB9,0x61,0x8E,0x1C,(... 0x9A、0x1F、0x92、0x9A、0x21、0xA0、0xB6、0x85、( )。 0x40,0xEE,0xA2,0xDA,0x72,0x5B,0x99,0xB3,( )。 0x15,0xF3,0xB8,0xB4,0x89,0x91,0x8E,0xF1,( )。 0x09, 0xE1, 0x56, 0x19, 0x39, 0x51, 0xEC, 0x7E,\ 0x93,0x7B,0x16,0x52,0xC0,0xBD,0x3B,0xB1,(... 0xBF、0x07、0x35、0x73、0xDF、0x88、0x3D、0x2C 0x34, 0xF1, 0xEF, 0x45, 0x1F, 0xD4, 0x6B, 0x50,\ 0x3F,0x00 #define EC_PARAM_secp521r1_x \ 0x00, 0xC6, 0x85, 0x8E, 0x06, 0xB7, 0x04, 0x04, \ 0xE9, 0xCD, 0x9E, 0x3E, 0xCB, 0x66, 0x23, 0x95,\ 0xB4、0x42、0x9C、0x64、0x81、0x39、0x05、0x3F、( )。 0xB5, 0x21, 0xF8, 0x28, 0xAF, 0x60, 0x6B, 0x4D,\ 0x3D、0xBA、0xA1、0x4B、0x5E、0x77、0xEF、0xE7 0x59, 0x28, 0xFE, 0x1D, 0xC1, 0x27, 0xA2, 0xFF,\ 0xA8、0xDE、0x33、0x48、0xB3、0xC1、0x85、0x6A、( )。 0x42, 0x9B, 0xF9, 0x7E, 0x7E, 0x31, 0xC2, 0xE5,\ 0xBD、0x66 #define EC_PARAM_secp521r1_y \ 0x01, 0x18, 0x39, 0x29, 0x6A, 0x78, 0x9A, 0x3B,\ 0xC0, 0x04, 0x5C, 0x8A, 0x5F, 0xB4, 0x2C, 0x7D,\ 0x1B, 0xD9, 0x98, 0xF5, 0x44, 0x49, 0x57, 0x9B,\ 0x44, 0x68, 0x17, 0xAF, 0xBD, 0x17, 0x27, 0x3E,\ 0x66, 0x2C, 0x97, 0xEE, 0x72, 0x99, 0x5E, 0xF4,\ 0x26, 0x40, 0xC5, 0x50, 0xB9, 0x01, 0x3F, 0xAD,\ 0x07, 0x61, 0x35, 0x3C, 0x70, 0x86, 0xA2, 0x72,\ 0xC2、0x40、0x88、0xBE、0x94、0x76、0x9F、0xD1、0xD1 0x66, 0x50 #define EC_PARAM_secp521r1_order \ 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF 0xFF, 0xFA, 0x51, 0x86, 0x87, 0x83, 0xBF, 0x2F,\ 0x96,0x6B,0x7F,0xCC,0x01,0x48,0xF7,0x09,( )。 0xA5, 0xD0, 0x3B, 0xB5, 0xC9, 0xB8, 0x89, 0x9C,\ 0x47, 0xAE, 0xBB, 0x6F, 0xB7, 0x1E, 0x91, 0x38,\ 0x64,0x09 curveID = kSE05x_ECCurve_NIST_P521; status = Se05x_API_ReadECCurveList(&se05x_session,curveList,&curveListLen); if (status != SM_OK) { SMLOG_E("Error in Se05x_API_ReadECCurveList \n"); } 否则 { 如果 (curveList[curveID - 1] == kSE05x_SetIndicator_SET) { SMLOG_I("curveID =%0x already exists \n", curveID); } 否则 { status = ex_se05x_create_curve_p521(&se05x_session,curveID); if (status != SM_OK) { SMLOG_I("Error in ex_se05x_create_curve \n"); } } } status = Se05x_API_CheckObjectExists(&se05x_session,keyID,&result); if (status != SM_OK) { SMLOG_E("[SE050] Error in Se05x_API_CheckObjectExists \n"); 返回 SE050_FAILURE; } 如果 (result == kSE05x_Result_SUCCESS) { curveID = kSE05x_ECCurve_NA; } status = Se05x_API_WriteECKey( &se05x_session,NULL,0,keyID,curveID,NULL,0,NULL,0,kSE05x_INS_NA,kSE05x_KeyPart_Pair); if (status != SM_OK) { SMLOG_E("[SE050] Error in Se05x_API_WriteECKey \n"); Se05x_Delete_Session(keyID); 返回 SE050_FAILURE; } uint8_t key_buf[256] = { 0, }; size_t key_buflen = sizeof(key_buf); status = Se05x_API_ReadObject(&se05x_session,keyID,0,0,key_buf,&key_buflen); if (status != SM_OK) { SMLOG_E("Error in Se05x_API_ReadObject \n"); 返回 SE050_FAILURE; } 谢谢! Sureshkumar R Re: Unable to Retrieve ECC Curve Details from SE050 using Plug & Trust Nano Package 你好,恩智浦、 如果您能就上述询问提供帮助,将不胜感激。 谢谢。
記事全体を表示