eSIM RSP 测试用例对比站

人工切片(-man) ↔ Cas 盲生成(-cas)· 真机真卡执行证据对照

源码对照:4.2.11.2.1

ES10b 加载绑定 Profile 包(NIST) / TC_eUICC_ES10b.LoadBoundProfilePackageNIST

左侧为人工切片入口(-man,来自 原料/切片 的最小可执行脚本),右侧为 Cas 盲生成入口(-cas,仅依据规范生成)。文件按原始编码(多为 GBK)解码为 UTF-8 显示,行号自 1 起;字节级原文与 sha256 见两侧脚本包。完整 unified diff 见本页底部折叠区,以及 报告原文 §4。
-man 入口
Import/TestCase_SGP_23.js
188 行 / 8777 字符 / gb18030
-cas 入口
TC_eUICC_ES10b_LoadBoundProfilePackageNIST/Import/TC_eUICC_ES10b_LoadBoundProfilePackageNIST.js
160 行 / 15676 字符 / gb18030
默认折行显示长行;取消勾选可横向滚动查看原始行宽
-man 人工切片Import/TestCase_SGP_23.js188 行 / 8777 字符 / gb18030入口函数 @L3
1// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_ES10b_LoadBoundProfilePackageNIST_01_Nominal_By_using_S_ENC_and_S_MAC + TC_eUICC_ES10b_LoadBoundProfilePackageNIST_02_Nominal_By_using_PPK_ENC_and_PPK_MAC + TC_eUICC_ES10b_LoadBoundProfilePackage_01_Nominal_By_using_S_ENC_and_S_MAC + TC_eUICC_ES10b_LoadBoundProfilePackage_02_Nominal_By_using_PPK_ENC_and_PPK_MAC (extracted verbatim)
2
3function TC_eUICC_ES10b_LoadBoundProfilePackageNIST_01_Nominal_By_using_S_ENC_and_S_MAC()
4{
5	if(!Card_Have_ECC_Cert)
6		return;
7	
8	//测试入口条件
9	if(!check_Applicability_of_tests_RSP_SGP23_test("C001"))
10		return;
11	
12	pkId_CI_ForVerification = pkId_CI_ECDSA_NIST;
13	pkId_CI_ForSigning = pkId_CI_ECDSA_NIST;
14	
15	TC_eUICC_ES10b_LoadBoundProfilePackage_01_Nominal_By_using_S_ENC_and_S_MAC();
16	
17}
18
19function TC_eUICC_ES10b_LoadBoundProfilePackageNIST_02_Nominal_By_using_PPK_ENC_and_PPK_MAC()
20{
21	if(!Card_Have_ECC_Cert)
22		return;
23	
24	//测试入口条件
25	if(!check_Applicability_of_tests_RSP_SGP23_test("C001"))
26		return;
27	
28	pkId_CI_ForVerification = pkId_CI_ECDSA_NIST;
29	pkId_CI_ForSigning = pkId_CI_ECDSA_NIST;
30	
31	TC_eUICC_ES10b_LoadBoundProfilePackage_02_Nominal_By_using_PPK_ENC_and_PPK_MAC();
32}
33
34function TC_eUICC_ES10b_LoadBoundProfilePackage_01_Nominal_By_using_S_ENC_and_S_MAC()
35{
36	tracenamestr = "测试目的:使用密钥交互产生的S-ENC and S-MAC下载PROFILE_OPERATIONAL1";
37	curDis.TraceStart(sno++,tracenamestr);
38
39	curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
40	Ini_powerOn_eUICC_LPAe_not_activate();
41	
42	curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
43	TS_MANAGE_CHANNEL_OPEN();
44	
45	curLogicChannel = 1;
46	
47	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
48	TS_SELECT("Select ISD",ISD_R_AID,"9000");
49	
50	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
51	var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
52	Profile_load_procedure.ICCID = ICCID_OP_PROF1;
53	Profile_load_procedure.ES10b_GetEUICCInfo1();
54
55	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
56	Profile_load_procedure.ES10b_GetEUICCChallenge();
57
58	
59	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
60	Profile_load_procedure.ES10b_AuthenticateServer();
61	
62	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
63	Profile_load_procedure.ES10b_PrepareDownload();
64	
65	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
66	Profile_load_procedure.ES10b_GetEID();
67	
68	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,使用密钥交互产生的S-ENC and S-MAC下载PROFILE_OPERATIONAL1;");
69	Profile_load_procedure.serviceProviderName = SP_NAME1;
70	Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
71	Profile_load_procedure.profileClass = "02";
72	Profile_load_procedure.iconType = "01";
73	Profile_load_procedure.icon = ICON_OP_PROF1;
74	Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
75	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
76	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
77	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
78	Profile_load_procedure.profilePolicyRules = "0560";
79	Profile_load_procedure.mccMnc = MCC_MNC1;
80	Profile_load_procedure.ES10b_LoadBoundProfilePackage();
81	
82	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
83	TS_SELECT("Select ISD",ISD_R_AID,"9000");
84	
85	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile信息;");
86	var proInfoListRequest = new ProfileInfoListRequest();
87	proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
88	proInfoListRequest.GenHexData();
89	var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
90	
91
92	var proInfoListResponse = new  ProfileInfoListResponse();
93	proInfoListResponse.checkCardResDataFormat(respData);
94	
95	try
96	{
97		curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
98		curStrHandle.CheckData(SP_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].serviceProviderName, "serviceProviderName");
99		curStrHandle.CheckData(PROFILE_OPERATIONAL1_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileName, "profileName");
100		curStrHandle.CheckData("01", proInfoListResponse.profileInfoListOk.arrOfElement[0].iconType, "iconType");
101		curStrHandle.CheckData(ICON_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].icon, "icon");
102		curStrHandle.CheckData("02", proInfoListResponse.profileInfoListOk.arrOfElement[0].profileClass, "profileClass");
103	}catch(e){
104		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
105	}
106	
107	RecoverCard();
108	
109}
110
111function TC_eUICC_ES10b_LoadBoundProfilePackage_02_Nominal_By_using_PPK_ENC_and_PPK_MAC()
112{
113	tracenamestr = "测试目的:使用PPK-ENC 和 PPK-MAC下载PROFILE_OPERATIONAL1";
114	curDis.TraceStart(sno++,tracenamestr);
115
116	curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
117	Ini_powerOn_eUICC_LPAe_not_activate();
118	
119	curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
120	TS_MANAGE_CHANNEL_OPEN();
121	
122	curLogicChannel = 1;
123	
124	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
125	TS_SELECT("Select ISD",ISD_R_AID,"9000");
126	
127	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
128	var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
129	Profile_load_procedure.ICCID = ICCID_OP_PROF1;
130	Profile_load_procedure.ES10b_GetEUICCInfo1();
131
132	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
133	Profile_load_procedure.ES10b_GetEUICCChallenge();
134
135	
136	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
137	Profile_load_procedure.ES10b_AuthenticateServer();
138	
139	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
140	Profile_load_procedure.ES10b_PrepareDownload();
141	
142	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
143	Profile_load_procedure.ES10b_GetEID();
144	
145	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,使用PPK-ENC 和 PPK-MAC下载PROFILE_OPERATIONAL1;");
146	Profile_load_procedure.serviceProviderName = SP_NAME1;
147	Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
148	Profile_load_procedure.profileClass = "02";
149	Profile_load_procedure.iconType = "01";
150	Profile_load_procedure.icon = ICON_OP_PROF1;
151	Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
152	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
153	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
154	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
155	Profile_load_procedure.profilePolicyRules = "0560";
156	Profile_load_procedure.mccMnc = MCC_MNC1;
157	Profile_load_procedure.UsePPK = true;
158	
159	Profile_load_procedure.ES10b_LoadBoundProfilePackage();
160	
161	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
162	TS_SELECT("Select ISD",ISD_R_AID,"9000");
163	
164	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile信息;");
165	var proInfoListRequest = new ProfileInfoListRequest();
166	proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
167	proInfoListRequest.GenHexData();
168	var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
169	
170	var proInfoListResponse = new  ProfileInfoListResponse();
171	proInfoListResponse.checkCardResDataFormat(respData);
172	
173	try
174	{
175		curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
176		curStrHandle.CheckData(SP_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].serviceProviderName, "serviceProviderName");
177		curStrHandle.CheckData(PROFILE_OPERATIONAL1_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileName, "profileName");
178		curStrHandle.CheckData("01", proInfoListResponse.profileInfoListOk.arrOfElement[0].iconType, "iconType");
179		curStrHandle.CheckData(ICON_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].icon, "icon");
180		curStrHandle.CheckData("02", proInfoListResponse.profileInfoListOk.arrOfElement[0].profileClass, "profileClass");
181	}catch(e){
182		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
183	}
184	
185	RecoverCard();
186	
187}
188
-cas 盲生成TC_eUICC_ES10b_LoadBoundProfilePackageNIST/Import/TC_eUICC_ES10b_LoadBoundProfilePackageNIST.js160 行 / 15676 字符 / gb18030入口函数 @L22
1// Author: 卡思Cas智能体
2// Date: 20261005-152741
3// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_ES10b.LoadBoundProfilePackageNIST,Test Sequence #01 Nominal: By using S-ENC and S-MAC; #02 Nominal: By using PPK-ENC and PPK-MAC,适用性 C001。
4// Test points: S1-C1 SW;S1-C2 response data absent;S2-C1 SW;S2-C2 response data absent;S3-C1 SW
5//   S3-C2 response data absent;S4-C1 SW;S4-C2 SW;S5-C1 SW;S5-C2 contains iccid 989209012143658709F5
6//   S5-C3 contains iccid 989209012143658709F5;S5-C4 isdpAid;S5-C5 profileState;S6-C1 SW
7//   S6-C2 response data absent;S7-C1 SW;S7-C2 response data absent;S8-C1 SW
8//   S8-C2 response data absent;S9-C1 SW;S9-C2 response data absent;S10-C1 SW;S10-C2 SW;S11-C1 SW
9//   S11-C2 contains iccid 989209012143658709F5;S11-C3 contains iccid 989209012143658709F5
10//   S11-C4 isdpAid;S11-C5 profileState
11// 本函数由 CaseIR 4.2.11.2.1 编译生成(fullwave-blindgen-live-70-W1-A3,SGP.23 v1.16 × SGP.22 v2.7):字节权威=CaseIR,非誊录黄金脚本。
12// Value-free template: every data byte is injected from CaseIR fields; no scaffold globals (see docs/speconly/compile-symbol-migration.md).
13// 适用性 C001:编译期门,运行时由 harness 环境前置承担。
14// PRECONDITION (declared, NOT compiled): initial_conditions 缺语料过程体(Annex C.2 absent from input package, corpus vacuum): IC 序列属测试工具/卡态编排责任,本脚本不虚构初始化步骤;语义影响见 CaseIR open_items。
15// GIC1 The PROFILE_OPERATIONAL1 is not loaded on the eUICC.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
16// GIC2 Communication S_Device/eUICC initialized, S_LPAd has selected the ISD-R; Common Mutual Authentication successfully executed between eUICC and S_SM-DP+ (#GET_EUICC_INFO1, #GET_EUICC_CHALLENGE, #AUTHENTICATE_SMDP sent); same GSMA CI based on NIST P-256 chosen for signing and verification; Sub-procedure Profile Download and Installation - End User Confirmation successfully executed (#PREP_DOWNLOAD_NO_CC sent).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
17// IC1(seq01/02) Generate the <OTPK_S_SM_DP+_ECKA> and <OT_SK_S_SM_DP+_ECKA> (test tool responsibility).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
18// IC2(seq01) <BPP> = MTD_GENERATE_BPP(#S_INIT_SC_PROF1, #CONF_ISDP_PROF1, #METADATA_OP_PROF1, NO_PARAM, #UPP_OP_PROF1) — BPP protected with <S_ENC>/<S_MAC> only.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
19// IC2(seq02) <BPP> = MTD_GENERATE_BPP(#S_INIT_SC_PROF1, #CONF_ISDP_PROF1, #METADATA_OP_PROF1, #REPLACE_S_KEYS_REQ, #UPP_OP_PROF1) — UPP segments protected with PPK-ENC/PPK-MAC and Initial MAC chaining value.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
20// IC3(seq01) Split <BPP> into <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1>, <BPP_SEG_A3> per TLV layout in E_tc_4211 IC3 NOTE.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
21// IC3(seq02) Split <BPP> into <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1>, <BPP_SEG_A2>, <BPP_SEG_A3> per TLV layout in E_tc_4211 IC3 NOTE (seq02 adds secondSequenceOf87 with #REPLACE_S_KEYS_REQ).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
22function TC_eUICC_ES10b_LoadBoundProfilePackageNIST_01_02_merged() {
23    var bind = curBind;
24
25    // 步骤 1:Seq#01 Step1] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_162, RQ31_163, RQ31_164, RQ55_003, RQ55_016, RQ55_017, RQ55_018, RQ55_020, RQ55_021, RQ55_022, RQ55_024, RQ26_011, RQ26_013, RQ26_016, RQ26_034, RQ26_035, RQ31_161)
26    // BPP segment load (data=null contract): <BPP_SEG_INIT> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
27    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
28    var s1 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
29    bind.checkData("S1-C1 SW", "9000", s1.sw);
30    bind.checkData("S1-C2 response data absent", "1", s1.resp === "" ? "1" : "0");
31
32    // 步骤 2:Seq#01 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_165, RQ55_028, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_036, RQ31_161, RQG0_001, RQG0_002, RQG0_003, RQG0_004, RQG0_005, RQG0_006)
33    // BPP segment load (data=null contract): <BPP_SEG_A0> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
34    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
35    var s2 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
36    bind.checkData("S2-C1 SW", "9000", s2.sw);
37    bind.checkData("S2-C2 response data absent", "1", s2.resp === "" ? "1" : "0");
38
39    // 步骤 3:Seq#01 Step3] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_166, RQ55_033, RQ55_036, RQ55_037, RQ24_028, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_020, RQ26_036, RQ31_161, RQG0_005, RQG0_006)
40    // BPP segment load (data=null contract): <BPP_SEG_A1> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
41    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
42    var s3 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
43    bind.checkData("S3-C1 SW", "9000", s3.sw);
44    bind.checkData("S3-C2 response data absent", "1", s3.resp === "" ? "1" : "0");
45
46    // 步骤 4:Seq#01 Step4] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_170, RQ31_171, RQ57_045, RQ55_008, RQ25_003, RQ25_007, RQ25_018, RQ25_019, RQ25_023, RQ25_024, RQ55_025, RQ25_016, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_034, RQ26_035, RQ26_036, RQ31_161, RQ35_003_1, RQ44_003, RQD0_001, RQG0_005, RQG0_006)
47    // BPP segment load (data=null contract): <BPP_SEG_A3> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
48    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
49    var s4 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
50    bind.checkData("S4-C1 SW", "9000", s4.sw);
51    bind.checkData("S4-C2 SW", "9000", s4.sw);
52    // S4-C3: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
53    // S4-C4: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
54    // S4-C5: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
55    // S4-C6: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
56    // S4-C7: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
57    // S4-C8: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
58
59    // 步骤 5:Seq#01 Step5] MTD_STORE_DATA(tc_step;REQ: RQ32_070, RQ55_025, RQ24_010, RQ26_020, RQ31_161, RQD0_001)
60    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
61    var s5 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
62    bind.checkData("S5-C1 SW", "9000", s5.sw);
63    var r2p5 = BindEs10xProcProfile.walkChoiceList(s5.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
64    var r2has5_0 = false;
65    for (var r2i5_0 = 0; r2i5_0 < r2p5.elements.length; r2i5_0++) {
66        var f = r2p5.elements[r2i5_0].fields;
67        if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has5_0 = true; break; }
68    }
69    bind.checkData("S5-C2 contains iccid 989209012143658709F5", "1", (r2p5.branch_tag === "A0" && r2has5_0) ? "1" : "0");
70    var r2has5_0 = false;
71    for (var r2i5_0 = 0; r2i5_0 < r2p5.elements.length; r2i5_0++) {
72        var f = r2p5.elements[r2i5_0].fields;
73        if (f["5A"] === "989209012143658709F5") { r2has5_0 = true; break; }
74    }
75    bind.checkData("S5-C3 contains iccid 989209012143658709F5", "1", (r2p5.branch_tag === "A0" && r2has5_0) ? "1" : "0");
76    var r2fa5S5_C4 = false;
77    for (var r2fi5S5_C4 = 0; r2fi5S5_C4 < r2p5.elements.length; r2fi5S5_C4++) {
78        var f = r2p5.elements[r2fi5S5_C4].fields;
79        if (f["4F"] !== undefined) { r2fa5S5_C4 = true; break; }
80    }
81    bind.checkData("S5-C4 isdpAid", "1", (r2p5.branch_tag === "A0" && r2fa5S5_C4) ? "1" : "0");
82    var r2fa5S5_C5 = false;
83    for (var r2fi5S5_C5 = 0; r2fi5S5_C5 < r2p5.elements.length; r2fi5S5_C5++) {
84        var f = r2p5.elements[r2fi5S5_C5].fields;
85        if (f["9F70"] === "00") { r2fa5S5_C5 = true; break; }
86    }
87    bind.checkData("S5-C5 profileState", "1", (r2p5.branch_tag === "A0" && r2fa5S5_C5) ? "1" : "0");
88
89    // 步骤 6:Seq#02 Step1] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_162, RQ31_163, RQ31_164, RQ55_003, RQ55_016, RQ55_017, RQ55_018, RQ55_020, RQ55_021, RQ55_022, RQ55_024, RQ26_011, RQ26_013, RQ26_016, RQ26_034, RQ26_035, RQ31_161)
90    // BPP segment load (data=null contract): <BPP_SEG_INIT> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
91    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
92    var s6 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
93    bind.checkData("S6-C1 SW", "9000", s6.sw);
94    bind.checkData("S6-C2 response data absent", "1", s6.resp === "" ? "1" : "0");
95
96    // 步骤 7:Seq#02 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_165, RQ55_028, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_020, RQ26_036, RQ31_161, RQ26_011, RQ26_034, RQ26_035, RQG0_001, RQG0_002, RQG0_003, RQG0_004, RQG0_005, RQG0_006)
97    // BPP segment load (data=null contract): <BPP_SEG_A0> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
98    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
99    var s7 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
100    bind.checkData("S7-C1 SW", "9000", s7.sw);
101    bind.checkData("S7-C2 response data absent", "1", s7.resp === "" ? "1" : "0");
102
103    // 步骤 8:Seq#02 Step3] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_166, RQ55_033, RQ55_036, RQ55_037, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_036, RQ31_161, RQG0_005, RQG0_006)
104    // BPP segment load (data=null contract): <BPP_SEG_A1> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
105    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
106    var s8 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
107    bind.checkData("S8-C1 SW", "9000", s8.sw);
108    bind.checkData("S8-C2 response data absent", "1", s8.resp === "" ? "1" : "0");
109
110    // 步骤 9:Seq#02 Step4] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_168, RQ31_169, RQ55_039, RQ55_040, RQ55_041, RQ26_021, RQ26_022, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_036, RQ31_161, RQG0_005, RQG0_006)
111    // BPP segment load (data=null contract): <BPP_SEG_A2> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
112    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
113    var s9 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
114    bind.checkData("S9-C1 SW", "9000", s9.sw);
115    bind.checkData("S9-C2 response data absent", "1", s9.resp === "" ? "1" : "0");
116
117    // 步骤 10:Seq#02 Step5] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_170, RQ31_171, RQ57_045, RQ55_008, RQ25_003, RQ25_007, RQ25_018, RQ25_019, RQ25_023, RQ25_024, RQ55_025, RQ25_016, RQ26_012, RQ26_013, RQ26_034, RQ26_035, RQ31_161, RQ35_003_1, RQ44_003, RQD0_001, RQG0_005, RQG0_006)
118    // BPP segment load (data=null contract): <BPP_SEG_A3> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
119    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
120    var s10 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
121    bind.checkData("S10-C1 SW", "9000", s10.sw);
122    bind.checkData("S10-C2 SW", "9000", s10.sw);
123    // S10-C3: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
124    // S10-C4: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
125    // S10-C5: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
126    // S10-C6: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
127    // S10-C7: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
128    // S10-C8: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
129
130    // 步骤 11:Seq#02 Step6] MTD_STORE_DATA(tc_step;REQ: RQ55_025, RQ32_070, RQ24_010, RQ26_020, RQ31_161, RQD0_001)
131    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
132    var s11 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
133    bind.checkData("S11-C1 SW", "9000", s11.sw);
134    var r2p11 = BindEs10xProcProfile.walkChoiceList(s11.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
135    var r2has11_0 = false;
136    for (var r2i11_0 = 0; r2i11_0 < r2p11.elements.length; r2i11_0++) {
137        var f = r2p11.elements[r2i11_0].fields;
138        if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has11_0 = true; break; }
139    }
140    bind.checkData("S11-C2 contains iccid 989209012143658709F5", "1", (r2p11.branch_tag === "A0" && r2has11_0) ? "1" : "0");
141    var r2has11_0 = false;
142    for (var r2i11_0 = 0; r2i11_0 < r2p11.elements.length; r2i11_0++) {
143        var f = r2p11.elements[r2i11_0].fields;
144        if (f["5A"] === "989209012143658709F5") { r2has11_0 = true; break; }
145    }
146    bind.checkData("S11-C3 contains iccid 989209012143658709F5", "1", (r2p11.branch_tag === "A0" && r2has11_0) ? "1" : "0");
147    var r2fa11S11_C4 = false;
148    for (var r2fi11S11_C4 = 0; r2fi11S11_C4 < r2p11.elements.length; r2fi11S11_C4++) {
149        var f = r2p11.elements[r2fi11S11_C4].fields;
150        if (f["4F"] !== undefined) { r2fa11S11_C4 = true; break; }
151    }
152    bind.checkData("S11-C4 isdpAid", "1", (r2p11.branch_tag === "A0" && r2fa11S11_C4) ? "1" : "0");
153    var r2fa11S11_C5 = false;
154    for (var r2fi11S11_C5 = 0; r2fi11S11_C5 < r2p11.elements.length; r2fi11S11_C5++) {
155        var f = r2p11.elements[r2fi11S11_C5].fields;
156        if (f["9F70"] === "00") { r2fa11S11_C5 = true; break; }
157    }
158    bind.checkData("S11-C5 profileState", "1", (r2p11.branch_tag === "A0" && r2fa11S11_C5) ? "1" : "0");
159}
160

完整 unified diff

行级差异:新增 147 行 / 删除 175 行(以 -man 为基准,unified 上下文 3 行)。

展开 diff(338 行)
--- -man
+++ -cas
@@ -1,188 +1,160 @@
-// slice of Import\TestCase_SGP_23.js - cases: TC_eUICC_ES10b_LoadBoundProfilePackageNIST_01_Nominal_By_using_S_ENC_and_S_MAC + TC_eUICC_ES10b_LoadBoundProfilePackageNIST_02_Nominal_By_using_PPK_ENC_and_PPK_MAC + TC_eUICC_ES10b_LoadBoundProfilePackage_01_Nominal_By_using_S_ENC_and_S_MAC + TC_eUICC_ES10b_LoadBoundProfilePackage_02_Nominal_By_using_PPK_ENC_and_PPK_MAC (extracted verbatim)
+// Author: 卡思Cas智能体
+// Date: 20261005-152741
+// Function: (purpose 原文未由 SGP.23 该 TC 提供,corpus vacuum 登记)TC_eUICC_ES10b.LoadBoundProfilePackageNIST,Test Sequence #01 Nominal: By using S-ENC and S-MAC; #02 Nominal: By using PPK-ENC and PPK-MAC,适用性 C001。
+// Test points: S1-C1 SW;S1-C2 response data absent;S2-C1 SW;S2-C2 response data absent;S3-C1 SW
+//   S3-C2 response data absent;S4-C1 SW;S4-C2 SW;S5-C1 SW;S5-C2 contains iccid 989209012143658709F5
+//   S5-C3 contains iccid 989209012143658709F5;S5-C4 isdpAid;S5-C5 profileState;S6-C1 SW
+//   S6-C2 response data absent;S7-C1 SW;S7-C2 response data absent;S8-C1 SW
+//   S8-C2 response data absent;S9-C1 SW;S9-C2 response data absent;S10-C1 SW;S10-C2 SW;S11-C1 SW
+//   S11-C2 contains iccid 989209012143658709F5;S11-C3 contains iccid 989209012143658709F5
+//   S11-C4 isdpAid;S11-C5 profileState
+// 本函数由 CaseIR 4.2.11.2.1 编译生成(fullwave-blindgen-live-70-W1-A3,SGP.23 v1.16 × SGP.22 v2.7):字节权威=CaseIR,非誊录黄金脚本。
+// Value-free template: every data byte is injected from CaseIR fields; no scaffold globals (see docs/speconly/compile-symbol-migration.md).
+// 适用性 C001:编译期门,运行时由 harness 环境前置承担。
+// PRECONDITION (declared, NOT compiled): initial_conditions 缺语料过程体(Annex C.2 absent from input package, corpus vacuum): IC 序列属测试工具/卡态编排责任,本脚本不虚构初始化步骤;语义影响见 CaseIR open_items。
+// GIC1 The PROFILE_OPERATIONAL1 is not loaded on the eUICC.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// GIC2 Communication S_Device/eUICC initialized, S_LPAd has selected the ISD-R; Common Mutual Authentication successfully executed between eUICC and S_SM-DP+ (#GET_EUICC_INFO1, #GET_EUICC_CHALLENGE, #AUTHENTICATE_SMDP sent); same GSMA CI based on NIST P-256 chosen for signing and verification; Sub-procedure Profile Download and Installation - End User Confirmation successfully executed (#PREP_DOWNLOAD_NO_CC sent).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// IC1(seq01/02) Generate the <OTPK_S_SM_DP+_ECKA> and <OT_SK_S_SM_DP+_ECKA> (test tool responsibility).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// IC2(seq01) <BPP> = MTD_GENERATE_BPP(#S_INIT_SC_PROF1, #CONF_ISDP_PROF1, #METADATA_OP_PROF1, NO_PARAM, #UPP_OP_PROF1) — BPP protected with <S_ENC>/<S_MAC> only.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// IC2(seq02) <BPP> = MTD_GENERATE_BPP(#S_INIT_SC_PROF1, #CONF_ISDP_PROF1, #METADATA_OP_PROF1, #REPLACE_S_KEYS_REQ, #UPP_OP_PROF1) — UPP segments protected with PPK-ENC/PPK-MAC and Initial MAC chaining value.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// IC3(seq01) Split <BPP> into <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1>, <BPP_SEG_A3> per TLV layout in E_tc_4211 IC3 NOTE.: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+// IC3(seq02) Split <BPP> into <BPP_SEG_INIT>, <BPP_SEG_A0>, <BPP_SEG_A1>, <BPP_SEG_A2>, <BPP_SEG_A3> per TLV layout in E_tc_4211 IC3 NOTE (seq02 adds secondSequenceOf87 with #REPLACE_S_KEYS_REQ).: declared unexpanded (no fabricated bytes; provenance = expansion_source).
+function TC_eUICC_ES10b_LoadBoundProfilePackageNIST_01_02_merged() {
+    var bind = curBind;
 
-function TC_eUICC_ES10b_LoadBoundProfilePackageNIST_01_Nominal_By_using_S_ENC_and_S_MAC()
-{
-	if(!Card_Have_ECC_Cert)
-		return;
-	
-	//测试入口条件
-	if(!check_Applicability_of_tests_RSP_SGP23_test("C001"))
-		return;
-	
-	pkId_CI_ForVerification = pkId_CI_ECDSA_NIST;
-	pkId_CI_ForSigning = pkId_CI_ECDSA_NIST;
-	
-	TC_eUICC_ES10b_LoadBoundProfilePackage_01_Nominal_By_using_S_ENC_and_S_MAC();
-	
-}
+    // 步骤 1:Seq#01 Step1] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_162, RQ31_163, RQ31_164, RQ55_003, RQ55_016, RQ55_017, RQ55_018, RQ55_020, RQ55_021, RQ55_022, RQ55_024, RQ26_011, RQ26_013, RQ26_016, RQ26_034, RQ26_035, RQ31_161)
+    // BPP segment load (data=null contract): <BPP_SEG_INIT> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s1 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S1-C1 SW", "9000", s1.sw);
+    bind.checkData("S1-C2 response data absent", "1", s1.resp === "" ? "1" : "0");
 
-function TC_eUICC_ES10b_LoadBoundProfilePackageNIST_02_Nominal_By_using_PPK_ENC_and_PPK_MAC()
-{
-	if(!Card_Have_ECC_Cert)
-		return;
-	
-	//测试入口条件
-	if(!check_Applicability_of_tests_RSP_SGP23_test("C001"))
-		return;
-	
-	pkId_CI_ForVerification = pkId_CI_ECDSA_NIST;
-	pkId_CI_ForSigning = pkId_CI_ECDSA_NIST;
-	
-	TC_eUICC_ES10b_LoadBoundProfilePackage_02_Nominal_By_using_PPK_ENC_and_PPK_MAC();
-}
+    // 步骤 2:Seq#01 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_165, RQ55_028, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_036, RQ31_161, RQG0_001, RQG0_002, RQG0_003, RQG0_004, RQG0_005, RQG0_006)
+    // BPP segment load (data=null contract): <BPP_SEG_A0> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s2 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S2-C1 SW", "9000", s2.sw);
+    bind.checkData("S2-C2 response data absent", "1", s2.resp === "" ? "1" : "0");
 
-function TC_eUICC_ES10b_LoadBoundProfilePackage_01_Nominal_By_using_S_ENC_and_S_MAC()
-{
-	tracenamestr = "测试目的:使用密钥交互产生的S-ENC and S-MAC下载PROFILE_OPERATIONAL1";
-	curDis.TraceStart(sno++,tracenamestr);
+    // 步骤 3:Seq#01 Step3] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_166, RQ55_033, RQ55_036, RQ55_037, RQ24_028, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_020, RQ26_036, RQ31_161, RQG0_005, RQG0_006)
+    // BPP segment load (data=null contract): <BPP_SEG_A1> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s3 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S3-C1 SW", "9000", s3.sw);
+    bind.checkData("S3-C2 response data absent", "1", s3.resp === "" ? "1" : "0");
 
-	curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
-	Ini_powerOn_eUICC_LPAe_not_activate();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
-	TS_MANAGE_CHANNEL_OPEN();
-	
-	curLogicChannel = 1;
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
-	TS_SELECT("Select ISD",ISD_R_AID,"9000");
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
-	var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
-	Profile_load_procedure.ICCID = ICCID_OP_PROF1;
-	Profile_load_procedure.ES10b_GetEUICCInfo1();
+    // 步骤 4:Seq#01 Step4] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_170, RQ31_171, RQ57_045, RQ55_008, RQ25_003, RQ25_007, RQ25_018, RQ25_019, RQ25_023, RQ25_024, RQ55_025, RQ25_016, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_034, RQ26_035, RQ26_036, RQ31_161, RQ35_003_1, RQ44_003, RQD0_001, RQG0_005, RQG0_006)
+    // BPP segment load (data=null contract): <BPP_SEG_A3> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s4 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S4-C1 SW", "9000", s4.sw);
+    bind.checkData("S4-C2 SW", "9000", s4.sw);
+    // S4-C3: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S4-C4: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S4-C5: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S4-C6: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S4-C7: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S4-C8: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
 
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
-	Profile_load_procedure.ES10b_GetEUICCChallenge();
+    // 步骤 5:Seq#01 Step5] MTD_STORE_DATA(tc_step;REQ: RQ32_070, RQ55_025, RQ24_010, RQ26_020, RQ31_161, RQD0_001)
+    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+    var s5 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
+    bind.checkData("S5-C1 SW", "9000", s5.sw);
+    var r2p5 = BindEs10xProcProfile.walkChoiceList(s5.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
+    var r2has5_0 = false;
+    for (var r2i5_0 = 0; r2i5_0 < r2p5.elements.length; r2i5_0++) {
+        var f = r2p5.elements[r2i5_0].fields;
+        if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has5_0 = true; break; }
+    }
+    bind.checkData("S5-C2 contains iccid 989209012143658709F5", "1", (r2p5.branch_tag === "A0" && r2has5_0) ? "1" : "0");
+    var r2has5_0 = false;
+    for (var r2i5_0 = 0; r2i5_0 < r2p5.elements.length; r2i5_0++) {
+        var f = r2p5.elements[r2i5_0].fields;
+        if (f["5A"] === "989209012143658709F5") { r2has5_0 = true; break; }
+    }
+    bind.checkData("S5-C3 contains iccid 989209012143658709F5", "1", (r2p5.branch_tag === "A0" && r2has5_0) ? "1" : "0");
+    var r2fa5S5_C4 = false;
+    for (var r2fi5S5_C4 = 0; r2fi5S5_C4 < r2p5.elements.length; r2fi5S5_C4++) {
+        var f = r2p5.elements[r2fi5S5_C4].fields;
+        if (f["4F"] !== undefined) { r2fa5S5_C4 = true; break; }
+    }
+    bind.checkData("S5-C4 isdpAid", "1", (r2p5.branch_tag === "A0" && r2fa5S5_C4) ? "1" : "0");
+    var r2fa5S5_C5 = false;
+    for (var r2fi5S5_C5 = 0; r2fi5S5_C5 < r2p5.elements.length; r2fi5S5_C5++) {
+        var f = r2p5.elements[r2fi5S5_C5].fields;
+        if (f["9F70"] === "00") { r2fa5S5_C5 = true; break; }
+    }
+    bind.checkData("S5-C5 profileState", "1", (r2p5.branch_tag === "A0" && r2fa5S5_C5) ? "1" : "0");
 
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
-	Profile_load_procedure.ES10b_AuthenticateServer();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
-	Profile_load_procedure.ES10b_PrepareDownload();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
-	Profile_load_procedure.ES10b_GetEID();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,使用密钥交互产生的S-ENC and S-MAC下载PROFILE_OPERATIONAL1;");
-	Profile_load_procedure.serviceProviderName = SP_NAME1;
-	Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
-	Profile_load_procedure.profileClass = "02";
-	Profile_load_procedure.iconType = "01";
-	Profile_load_procedure.icon = ICON_OP_PROF1;
-	Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
-	Profile_load_procedure.profilePolicyRules = "0560";
-	Profile_load_procedure.mccMnc = MCC_MNC1;
-	Profile_load_procedure.ES10b_LoadBoundProfilePackage();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
-	TS_SELECT("Select ISD",ISD_R_AID,"9000");
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile信息;");
-	var proInfoListRequest = new ProfileInfoListRequest();
-	proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
-	proInfoListRequest.GenHexData();
-	var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
-	
+    // 步骤 6:Seq#02 Step1] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_162, RQ31_163, RQ31_164, RQ55_003, RQ55_016, RQ55_017, RQ55_018, RQ55_020, RQ55_021, RQ55_022, RQ55_024, RQ26_011, RQ26_013, RQ26_016, RQ26_034, RQ26_035, RQ31_161)
+    // BPP segment load (data=null contract): <BPP_SEG_INIT> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s6 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S6-C1 SW", "9000", s6.sw);
+    bind.checkData("S6-C2 response data absent", "1", s6.resp === "" ? "1" : "0");
 
-	var proInfoListResponse = new  ProfileInfoListResponse();
-	proInfoListResponse.checkCardResDataFormat(respData);
-	
-	try
-	{
-		curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
-		curStrHandle.CheckData(SP_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].serviceProviderName, "serviceProviderName");
-		curStrHandle.CheckData(PROFILE_OPERATIONAL1_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileName, "profileName");
-		curStrHandle.CheckData("01", proInfoListResponse.profileInfoListOk.arrOfElement[0].iconType, "iconType");
-		curStrHandle.CheckData(ICON_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].icon, "icon");
-		curStrHandle.CheckData("02", proInfoListResponse.profileInfoListOk.arrOfElement[0].profileClass, "profileClass");
-	}catch(e){
-		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
-	}
-	
-	RecoverCard();
-	
-}
+    // 步骤 7:Seq#02 Step2] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_165, RQ55_028, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_020, RQ26_036, RQ31_161, RQ26_011, RQ26_034, RQ26_035, RQG0_001, RQG0_002, RQG0_003, RQG0_004, RQG0_005, RQG0_006)
+    // BPP segment load (data=null contract): <BPP_SEG_A0> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s7 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S7-C1 SW", "9000", s7.sw);
+    bind.checkData("S7-C2 response data absent", "1", s7.resp === "" ? "1" : "0");
 
-function TC_eUICC_ES10b_LoadBoundProfilePackage_02_Nominal_By_using_PPK_ENC_and_PPK_MAC()
-{
-	tracenamestr = "测试目的:使用PPK-ENC 和 PPK-MAC下载PROFILE_OPERATIONAL1";
-	curDis.TraceStart(sno++,tracenamestr);
+    // 步骤 8:Seq#02 Step3] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_166, RQ55_033, RQ55_036, RQ55_037, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_036, RQ31_161, RQG0_005, RQG0_006)
+    // BPP segment load (data=null contract): <BPP_SEG_A1> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s8 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S8-C1 SW", "9000", s8.sw);
+    bind.checkData("S8-C2 response data absent", "1", s8.resp === "" ? "1" : "0");
 
-	curDis.TestStepStart2(stno++,"eUICC卡片初始化;");
-	Ini_powerOn_eUICC_LPAe_not_activate();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送MANAGE_CHANNEL命令,打开辅助逻辑通道;");
-	TS_MANAGE_CHANNEL_OPEN();
-	
-	curLogicChannel = 1;
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
-	TS_SELECT("Select ISD",ISD_R_AID,"9000");
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccInfo1Request;");
-	var Profile_load_procedure = new RSP_profile_load_procedure_LPAd(PROFILE_OPERATIONAL1_DATA);
-	Profile_load_procedure.ICCID = ICCID_OP_PROF1;
-	Profile_load_procedure.ES10b_GetEUICCInfo1();
+    // 步骤 9:Seq#02 Step4] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_168, RQ31_169, RQ55_039, RQ55_040, RQ55_041, RQ26_021, RQ26_022, RQ26_012, RQ26_013, RQ26_016, RQ26_018, RQ26_019, RQ26_036, RQ31_161, RQG0_005, RQG0_006)
+    // BPP segment load (data=null contract): <BPP_SEG_A2> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s9 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S9-C1 SW", "9000", s9.sw);
+    bind.checkData("S9-C2 response data absent", "1", s9.resp === "" ? "1" : "0");
 
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccChallengeRequest;");
-	Profile_load_procedure.ES10b_GetEUICCChallenge();
+    // 步骤 10:Seq#02 Step5] MTD_STORE_DATA_SCRIPT(tc_step;REQ: RQ57_040, RQ57_042, RQ57_043, RQ57_044, RQ55_001, RQ55_002, RQ55_006, RQ55_007, RQ57_010, RQ57_011, RQ57_012, RQ57_014, RQ26_029, RQ31_170, RQ31_171, RQ57_045, RQ55_008, RQ25_003, RQ25_007, RQ25_018, RQ25_019, RQ25_023, RQ25_024, RQ55_025, RQ25_016, RQ26_012, RQ26_013, RQ26_034, RQ26_035, RQ31_161, RQ35_003_1, RQ44_003, RQD0_001, RQG0_005, RQG0_006)
+    // BPP segment load (data=null contract): <BPP_SEG_A3> bytes are runtime-domain (BPP synthesized at MTD_GENERATE_BPP;
+    // segmentation single source = bpp_synthesizer.segment_bpp (SGP.22 §2.5.5 :1633-1651) — no bytes fabricated here.
+    var s10 = bind.sendApdu(null, "E2", "00", "00", null, "00", "9000");
+    bind.checkData("S10-C1 SW", "9000", s10.sw);
+    bind.checkData("S10-C2 SW", "9000", s10.sw);
+    // S10-C3: binding:bpp_seg_load_pir_runtime_structure(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S10-C4: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S10-C5: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S10-C6: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S10-C7: binding:bpp_seg_load_pir_runtime_fields(S22-2.5.6;PIR-runtime-domain) (check_attestation)
+    // S10-C8: binding:bpp_seg_load_pir_runtime_semantics(S22-2.5.6;PIR-runtime-domain) (check_attestation)
 
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行AuthenticateServerRequest;");
-	Profile_load_procedure.ES10b_AuthenticateServer();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行PrepareDownloadRequest;");
-	Profile_load_procedure.ES10b_PrepareDownload();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行GetEuiccDataRequest(GetEID);");
-	Profile_load_procedure.ES10b_GetEID();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行BoundProfilePackage,使用PPK-ENC 和 PPK-MAC下载PROFILE_OPERATIONAL1;");
-	Profile_load_procedure.serviceProviderName = SP_NAME1;
-	Profile_load_procedure.profileName = PROFILE_OPERATIONAL1_NAME1;
-	Profile_load_procedure.profileClass = "02";
-	Profile_load_procedure.iconType = "01";
-	Profile_load_procedure.icon = ICON_OP_PROF1;
-	Profile_load_procedure.notificationConfigurationInfo = new SequenceOfElement("30");
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0] = new NotificationConfigurationInformation();
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].profileManagementOperation = "04F0";
-	Profile_load_procedure.notificationConfigurationInfo.arrOfElement[0].notificationAddress = TEST_DP_ADDRESS1;
-	Profile_load_procedure.profilePolicyRules = "0560";
-	Profile_load_procedure.mccMnc = MCC_MNC1;
-	Profile_load_procedure.UsePPK = true;
-	
-	Profile_load_procedure.ES10b_LoadBoundProfilePackage();
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送SELECT命令,选择ISD-R;");
-	TS_SELECT("Select ISD",ISD_R_AID,"9000");
-	
-	curDis.TestStepStart2(stno++,"读卡器向卡片发送 StoreData命令,执行ProfileInfoListRequest,获取profile信息;");
-	var proInfoListRequest = new ProfileInfoListRequest();
-	proInfoListRequest.searchCriteria = new ChoiceObj(tagOfsearchCriteria_ProfileInfo.iccid,ICCID_OP_PROF1);
-	proInfoListRequest.GenHexData();
-	var respData = LPAd_Transport_data_to_eUICC(proInfoListRequest.hexData);
-	
-	var proInfoListResponse = new  ProfileInfoListResponse();
-	proInfoListResponse.checkCardResDataFormat(respData);
-	
-	try
-	{
-		curStrHandle.CheckData(ICCID_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].iccid, "ICCID");
-		curStrHandle.CheckData(SP_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].serviceProviderName, "serviceProviderName");
-		curStrHandle.CheckData(PROFILE_OPERATIONAL1_NAME1, proInfoListResponse.profileInfoListOk.arrOfElement[0].profileName, "profileName");
-		curStrHandle.CheckData("01", proInfoListResponse.profileInfoListOk.arrOfElement[0].iconType, "iconType");
-		curStrHandle.CheckData(ICON_OP_PROF1, proInfoListResponse.profileInfoListOk.arrOfElement[0].icon, "icon");
-		curStrHandle.CheckData("02", proInfoListResponse.profileInfoListOk.arrOfElement[0].profileClass, "profileClass");
-	}catch(e){
-		obj.SubLevel(ProfileInfoListResponse_Data_Error, level_of_SubLevel.error);
-	}
-	
-	RecoverCard();
-	
+    // 步骤 11:Seq#02 Step6] MTD_STORE_DATA(tc_step;REQ: RQ55_025, RQ32_070, RQ24_010, RQ26_020, RQ31_161, RQD0_001)
+    // <L> length binding and the conditional 61XX + GET RESPONSE chain (D.4.2) are CasBind internal state (chaining rule).
+    var s11 = bind.sendApdu(null, "E2", "91", "00", "BF2D0EA00C5A0A989209012143658709F5", "00", "9000");
+    bind.checkData("S11-C1 SW", "9000", s11.sw);
+    var r2p11 = BindEs10xProcProfile.walkChoiceList(s11.resp, {respTag: "BF2D", okTag: "A0", errTag: "81"});
+    var r2has11_0 = false;
+    for (var r2i11_0 = 0; r2i11_0 < r2p11.elements.length; r2i11_0++) {
+        var f = r2p11.elements[r2i11_0].fields;
+        if (f["5A"] === "989209012143658709F5" && f["9F70"] === "00") { r2has11_0 = true; break; }
+    }
+    bind.checkData("S11-C2 contains iccid 989209012143658709F5", "1", (r2p11.branch_tag === "A0" && r2has11_0) ? "1" : "0");
+    var r2has11_0 = false;
+    for (var r2i11_0 = 0; r2i11_0 < r2p11.elements.length; r2i11_0++) {
+        var f = r2p11.elements[r2i11_0].fields;
+        if (f["5A"] === "989209012143658709F5") { r2has11_0 = true; break; }
+    }
+    bind.checkData("S11-C3 contains iccid 989209012143658709F5", "1", (r2p11.branch_tag === "A0" && r2has11_0) ? "1" : "0");
+    var r2fa11S11_C4 = false;
+    for (var r2fi11S11_C4 = 0; r2fi11S11_C4 < r2p11.elements.length; r2fi11S11_C4++) {
+        var f = r2p11.elements[r2fi11S11_C4].fields;
+        if (f["4F"] !== undefined) { r2fa11S11_C4 = true; break; }
+    }
+    bind.checkData("S11-C4 isdpAid", "1", (r2p11.branch_tag === "A0" && r2fa11S11_C4) ? "1" : "0");
+    var r2fa11S11_C5 = false;
+    for (var r2fi11S11_C5 = 0; r2fi11S11_C5 < r2p11.elements.length; r2fi11S11_C5++) {
+        var f = r2p11.elements[r2fi11S11_C5].fields;
+        if (f["9F70"] === "00") { r2fa11S11_C5 = true; break; }
+    }
+    bind.checkData("S11-C5 profileState", "1", (r2p11.branch_tag === "A0" && r2fa11S11_C5) ? "1" : "0");
 }