scriptprogramlanguage
Programmer'sReferenceManual
Scriptprogramminglanguage网站看简介,点这里窗口介绍,点这里语法介绍,点这里函数列表,点这里收尾部分,点这里示例脚本,点这里
第2页共240页
Scriptprogramminglanguage网站
Aboutthisdocument
为实现apdu脚本简单化以及规范化,taoism3版对常规版的脚本工具进行了较大修改,本手册中涉及的软件为snooperstaoism3版,适用于0.0.0.0以上版本。
第3页共240页
Scriptprogramminglanguage网站
目录
ABOUTTHISDOCUMENT.............................................................................................................................................
3
目录..................................................................................................................................................................................
4
简介....................................................................................................................................................................................
21 SNOOPER的开发历程与特点............................................................................................................................................
21更新变化........................................................................................................................................................................
21使用注意........................................................................................................................................................................
23多个APDU窗口的关系....................................................................................................................................................
23两套自成体系的函数....................................................................................................................................................
24 第一套函数................................................................................................................................................................
24第二套函数................................................................................................................................................................
25两套函数的差别........................................................................................................................................................
25两套函数的联系........................................................................................................................................................
26特别注意....................................................................................................................................................................
26 脚本编辑窗口简介............................................................................................................................................................
28 打开APDU第三版脚本工具窗口....................................................................................................................................
28顶部工具条简介........................................................................................................................................................
29左部工具条简介........................................................................................................................................................
32 右键菜单........................................................................................................................................................................
33快捷键............................................................................................................................................................................
34 脚本快捷键(脚本窗口要求是当前窗口)............................................................................................................
34文件窗口快捷键(文件窗口要求是当前窗口)....................................................................................................
35动态提示功能................................................................................................................................................................
35内部函数提示............................................................................................................................................................
35函数参数提示............................................................................................................................................................
36脚本自定义语句提示................................................................................................................................................
37脚本自定义变量提示................................................................................................................................................
37错误语法分析............................................................................................................................................................
38load_script、读卡器增强提示..............................................................................................................................
38第一个脚本....................................................................................................................................................................
40在屏幕上输出一个hello,world。
.......................................................................................................................
40输出设置........................................................................................................................................................................
40 脚本语法介绍....................................................................................................................................................................
43 数据表示........................................................................................................................................................................
43完整apdu语句..........................................................................................................................................................
43 静态脚本........................................................................................................................................................................
43静态脚本的组成........................................................................................................................................................
43 第4页共240页 Scriptprogramminglanguage网站 增强型静态脚本........................................................................................................................................................
44“<”的长度..............................................................................................................................................................
45注释................................................................................................................................................................................
45变量................................................................................................................................................................................
45标号与过程....................................................................................................................................................................
46MAIN过程与END...............................................................................................................................................................
49数据串连接....................................................................................................................................................................
49编写第一个实用脚本....................................................................................................................................................
50 控制流................................................................................................................................................................................
52 IF-ELSE语句....................................................................................................................................................................
52if判断.......................................................................................................................................................................
52 循环控制........................................................................................................................................................................
54do-loop循环语句.....................................................................................................................................................
54for-next循环语句...................................................................................................................................................
55exitfor语句...........................................................................................................................................................
59hfor-hnext循环与exithfor组合.......................................................................................................................
60 GOTO语句与标号.............................................................................................................................................................
60函数与程序结构............................................................................................................................................................
62 函数的基本知识........................................................................................................................................................
62函数的返回值............................................................................................................................................................
64递归............................................................................................................................................................................
66 关键字................................................................................................................................................................................
68 辅助型关键字+以及内部变量......................................................................................................................................
68前缀关键字....................................................................................................................................................................
69 clear..........................................................................................................................................................................
70reset..........................................................................................................................................................................
70reset2........................................................................................................................................................................
70apdu2..........................................................................................................................................................................
70auto_response..........................................................................................................................................................
70prompt........................................................................................................................................................................
71showapdu....................................................................................................................................................................
71call............................................................................................................................................................................
71return........................................................................................................................................................................
72load_script..............................................................................................................................................................
73loadprofile和run_script....................................................................................................................................
73pause..........................................................................................................................................................................
73sleep..........................................................................................................................................................................
74end..............................................................................................................................................................................
76insert........................................................................................................................................................................
76eject..........................................................................................................................................................................
77?
与message............................................................................................................................................................
77beep............................................................................................................................................................................
79 第5页共240页 Scriptprogramminglanguage网站 clear_fifo................................................................................................................................................................
79write_fifo................................................................................................................................................................
79read_fifo..................................................................................................................................................................
79do................................................................................................................................................................................
80loop............................................................................................................................................................................
80if................................................................................................................................................................................
80else............................................................................................................................................................................
81endif..........................................................................................................................................................................
82for..............................................................................................................................................................................
82next............................................................................................................................................................................
85exit............................................................................................................................................................................
85hfor,hnext,exithfor........................................................................................................................................
85goto............................................................................................................................................................................
86onerrorgoto错误处理标号................................................................................................................................
87onerrorpause........................................................................................................................................................
87timer_begin..............................................................................................................................................................
90timer_end..................................................................................................................................................................
90des_des_mac、des_3des_mac、full_3des_mac..................................................................................................
90des_des_mac_2、des_3des_mac_2........................................................................................................................
90sm4_mac、sm4_mac_2................................................................................................................................................
90jcop22_ext_auth......................................................................................................................................................
92jcop22_ext_auth_2..................................................................................................................................................
92jcop22_ext_auth_kmc..............................................................................................................................................
93jcop22_ext_auth_kmc_2..........................................................................................................................................
93jcop22_ext_auth_nonblock....................................................................................................................................
94jcop22_ext_auth_nonblock_2................................................................................................................................
94jcop22_ext_auth_kmc_nonblock............................................................................................................................
94jcop22_ext_auth_kmc_nonblock_2........................................................................................................................
94mac_auto_mac............................................................................................................................................................
94mac_auto_mac_2........................................................................................................................................................
94selectcardmanager................................................................................................................................................
95select_2cardmanager............................................................................................................................................
95delete........................................................................................................................................................................
95delete_2....................................................................................................................................................................
95upload........................................................................................................................................................................
95upload_2....................................................................................................................................................................
95install......................................................................................................................................................................
95install_2..................................................................................................................................................................
pare......................................................................................................................................................................
99socket_message(已淘汰)..................................................................................................................................
100generatersa_keypair(已淘汰)......................................................................................................................
100generate_keypair(已淘汰)......................................................................................................................
100generatesm2_keypair(已淘汰)......................................................................................................................
101 第6页共240页 Scriptprogramminglanguage网站 main(已淘汰)......................................................................................................................................................
102sendtext(已淘汰)..............................................................................................................................................
102split........................................................................................................................................................................
103push..........................................................................................................................................................................
103inc_indent和dec_indent....................................................................................................................................
104函数..............................................................................................................................................................................
104 SET关键字......................................................................................................................................................................
105 rand..........................................................................................................................................................................
105_curve_id..........................................................................................................................................................
105cipherkey................................................................................................................................................................
105mac_length..............................................................................................................................................................
105 SET函数列表..................................................................................................................................................................
105 加解密部分..................................................................................................................................................................
105des_encode_ecb......................................................................................................................................................
105des_decode_ecb......................................................................................................................................................
1063des_encode_ecb....................................................................................................................................................
1063des_decode_ecb....................................................................................................................................................
1063des_24k_encode_ecb............................................................................................................................................
1063des24_encode_ecb................................................................................................................................................
1063des_24k_decode_ecb............................................................................................................................................
1063des24_decode_ecb................................................................................................................................................
106des_encode_cbc......................................................................................................................................................
106des_decode_cbc......................................................................................................................................................
1063des_encode_cbc....................................................................................................................................................
1063des_decode_cbc....................................................................................................................................................
1063des_24k_encode_cbc............................................................................................................................................
1063des24_encode_cbc................................................................................................................................................
1063des_24k_decode_cbc............................................................................................................................................
1063des24_decode_cbc................................................................................................................................................
106aes128_encode_ecb................................................................................................................................................
107aes128_decode_ecb................................................................................................................................................
107aes128_encode_cbc................................................................................................................................................
107aes128_decode_cbc................................................................................................................................................
107aes192_encode_ecb................................................................................................................................................
107aes192_decode_ecb................................................................................................................................................
107aes192_encode_cbc................................................................................................................................................
107aes192_decode_cbc................................................................................................................................................
107aes256_encode_ecb................................................................................................................................................
107aes256_decode_ecb................................................................................................................................................
107aes256_encode_cbc................................................................................................................................................
107aes256_decode_cbc................................................................................................................................................
108chacha20..................................................................................................................................................................
108 第7页共240页 Scriptprogramminglanguage网站 poly1305_init........................................................................................................................................................
109poly1305_update....................................................................................................................................................
109poly1305_finish....................................................................................................................................................
109数据处理部分..............................................................................................................................................................
110utf8_string............................................................................................................................................................
110utf16_little_string............................................................................................................................................
110utf16_big_string..................................................................................................................................................
111ansi_string............................................................................................................................................................
111shl............................................................................................................................................................................
111shr............................................................................................................................................................................
111mid............................................................................................................................................................................
111hmid..........................................................................................................................................................................
111left..........................................................................................................................................................................
111hleft........................................................................................................................................................................
111right........................................................................................................................................................................
111hright......................................................................................................................................................................
112rightmid..................................................................................................................................................................
112hrightmid................................................................................................................................................................
112dup............................................................................................................................................................................
112hdup..........................................................................................................................................................................
112random......................................................................................................................................................................
112hrandom....................................................................................................................................................................
113reverse_block_byte..............................................................................................................................................
113read_fifo................................................................................................................................................................
113fixed80....................................................................................................................................................................
113fixed80_16..............................................................................................................................................................
113add............................................................................................................................................................................
113sub............................................................................................................................................................................
113datalen....................................................................................................................................................................
113bcdadd......................................................................................................................................................................
113bcdsub......................................................................................................................................................................
113bcdmul......................................................................................................................................................................
113bcddiv......................................................................................................................................................................
114bcdmod......................................................................................................................................................................
114strlen......................................................................................................................................................................
114xor............................................................................................................................................................................
114and............................................................................................................................................................................
114or..............................................................................................................................................................................
114hex2int....................................................................................................................................................................
114int2hex....................................................................................................................................................................
114mul............................................................................................................................................................................
114div............................................................................................................................................................................
114mod............................................................................................................................................................................
115 第8页共240页 Scriptprogramminglanguage网站 itoa,atoi..............................................................................................................................................................
pressed_bcd......................................................................................................................................................
115pressed_bcd..................................................................................................................................................
115gettlv......................................................................................................................................................................
115gettlv_single........................................................................................................................................................
115gettlv_scp11c........................................................................................................................................................
115get_dol_tag............................................................................................................................................................
116一些封装的行业函数..................................................................................................................................................
117get_package_aid....................................................................................................................................................
117get_applet_aid......................................................................................................................................................
117diversify................................................................................................................................................................
118oem_subkey..............................................................................................................................................................
118oem_encrdata..........................................................................................................................................................
118oem_desmac..............................................................................................................................................................
118oem_desjs................................................................................................................................................................
118oem_xortac..............................................................................................................................................................
118oem_strset..............................................................................................................................................................
119calc_afl..................................................................................................................................................................
119calc_cdol_len........................................................................................................................................................
119calc_log_by_pdol..................................................................................................................................................
119calc_pdol_len........................................................................................................................................................
119calc_log_by_cdol..................................................................................................................................................
119calc_ddol_len........................................................................................................................................................
119HASH部分.....................................................................................................................................................................
120sha1_hash................................................................................................................................................................
120sha1_hash_nonfill................................................................................................................................................
120sha1_hash_lastblock............................................................................................................................................
120sha1_hash_init......................................................................................................................................................
120sha1_hash_update..................................................................................................................................................
120sha1_hash_dofinal................................................................................................................................................
120sha256_hash............................................................................................................................................................
120sha256_hash_nonfill............................................................................................................................................
120sha256_hash_lastblock........................................................................................................................................
120sha384_hash............................................................................................................................................................
121sha384_hash_nonfill............................................................................................................................................
121sha384_hash_lastblock........................................................................................................................................
121sha512_hash............................................................................................................................................................
121sha512_hash_nonfill............................................................................................................................................
121sha512_hash_lastblock........................................................................................................................................
121md5_hash..................................................................................................................................................................
121md5_hash_nonfill..................................................................................................................................................
121md5_hash_lastblock..............................................................................................................................................
121sha224_hash............................................................................................................................................................
121 第9页共240页 Scriptprogramminglanguage网站 sha224_hash_init..................................................................................................................................................
121sha224_hash_update..............................................................................................................................................
122sha224_hash_dofinal............................................................................................................................................
122sha3_224_hash........................................................................................................................................................
122sha3_224_hash_init..............................................................................................................................................
122sha3_224_hash_update..........................................................................................................................................
122sha3_224_hash_dofinal........................................................................................................................................
122sha256_hash............................................................................................................................................................
122sha256_hash_init..................................................................................................................................................
122sha256_hash_update..............................................................................................................................................
122sha256_hash_dofinal............................................................................................................................................
122sha384_hash............................................................................................................................................................
122sha384_hash_init..................................................................................................................................................
122sha384_hash_update..............................................................................................................................................
122sha384_hash_dofinal............................................................................................................................................
122sha512_hash............................................................................................................................................................
122sha512_hash_init..................................................................................................................................................
123sha512_hash_update..............................................................................................................................................
123sha512_hash_dofinal............................................................................................................................................
123MAC部分........................................................................................................................................................................
123des_des_mac............................................................................................................................................................
123des_3des_mac..........................................................................................................................................................
123full_3des_mac........................................................................................................................................................
123非对称部分..................................................................................................................................................................
123rsa_nd_decode........................................................................................................................................................
123rsa_crt_decode......................................................................................................................................................
123rsa_pub_encode......................................................................................................................................................
124_sign_verify....................................................................................................................................................
124_sign..................................................................................................................................................................
124_pub_encode......................................................................................................................................................
124_pri_decode......................................................................................................................................................
124国密算法部分..............................................................................................................................................................
124sm2_pub_encode......................................................................................................................................................
124sm2_pri_decode......................................................................................................................................................
124sm2__dh..............................................................................................................................................................
125sm2_sign..................................................................................................................................................................
125sm2_sign_verify....................................................................................................................................................
125sm2_generate_pub_by_pri....................................................................................................................................
125sm3_hash..................................................................................................................................................................
125sm3_hash_nonfill..................................................................................................................................................
125sm3_hash_lastblock..............................................................................................................................................
125sm4_encode_ecb......................................................................................................................................................
125sm4_decode_ecb......................................................................................................................................................
125 第10页共240页 Scriptprogramminglanguage网站 sm4_encode_cbc......................................................................................................................................................
125sm4_decode_cbc......................................................................................................................................................
126sm4_mac....................................................................................................................................................................
126系统参数部分..............................................................................................................................................................
126apdutime..................................................................................................................................................................
126timer........................................................................................................................................................................
126pop............................................................................................................................................................................
126getpara....................................................................................................................................................................
126getprotocol............................................................................................................................................................
126guess_protocol......................................................................................................................................................
126yes_no......................................................................................................................................................................
126messagebox..............................................................................................................................................................
127messagebox_number................................................................................................................................................
127messagebox_amount_hex........................................................................................................................................
128getinput..................................................................................................................................................................
128getinput_utf16_string........................................................................................................................................
128getinput_amount_hex............................................................................................................................................
129dummy........................................................................................................................................................................
129get_first_device_type........................................................................................................................................
129get_second_device_type......................................................................................................................................
129基本不用部分..............................................................................................................................................................
130fileread..................................................................................................................................................................
130epass3003_checksum..............................................................................................................................................
130rockey6_crc32........................................................................................................................................................
130leftpack..................................................................................................................................................................
130not_morethen..........................................................................................................................................................
130not_lessthen..........................................................................................................................................................
130chenqi_crc_file....................................................................................................................................................
130connectless_crc_ab_file....................................................................................................................................
130deletefile..............................................................................................................................................................
130copyfile..................................................................................................................................................................
130calc_ftsafe_serial..............................................................................................................................................
131odd............................................................................................................................................................................
131even..........................................................................................................................................................................
131file_readall(readallfile)............................................................................................................................
131file_length(filelength)....................................................................................................................................
131file_append(appendfile)....................................................................................................................................
131file_write(writefile)........................................................................................................................................
132num2txt....................................................................................................................................................................
132txt2num....................................................................................................................................................................
132reverse_byte_nibble............................................................................................................................................
132direct_write_hid_64x..........................................................................................................................................
132direct_read_hid_64x............................................................................................................................................
132 第11页共240页 Scriptprogramminglanguage网站 readcd......................................................................................................................................................................
133readcd_fc................................................................................................................................................................
133其他部分......................................................................................................................................................................
set......................................................................................................................................................................
send....................................................................................................................................................................
133xorsum......................................................................................................................................................................
133addsum......................................................................................................................................................................
timeout..............................................................................................................................................................
133reset........................................................................................................................................................................
133drawimage................................................................................................................................................................
134drawqrcode..............................................................................................................................................................
134scanqrcode..............................................................................................................................................................
134open_second_reader(openreader)......................................................................................................................
135open_second_reader_by_name(openreader_by_name)......................................................................................135send_odd_byte........................................................................................................................................................
135socket_connect......................................................................................................................................................
135socket_io................................................................................................................................................................
135socket_close..........................................................................................................................................................
136file_read_as_var..................................................................................................................................................
136M1部分(使用专用的读卡器—RF1201读卡器).....................................................................................................
136tk_loadkey..............................................................................................................................................................
136tk_beep....................................................................................................................................................................
137tk_authcard............................................................................................................................................................
137tk_readblock..........................................................................................................................................................
137tk_writeblock........................................................................................................................................................
137tk_readvalue..........................................................................................................................................................
137tk_writevalue........................................................................................................................................................
137tk_increment..........................................................................................................................................................
137tk_decrement..........................................................................................................................................................
137tk_transfer............................................................................................................................................................
137tk_restore..............................................................................................................................................................
137M1部分(使用专用的读卡器—RK501读卡器).......................................................................................................
138rk501_loadkey........................................................................................................................................................
138rk501_beep..............................................................................................................................................................
138rk501_authcard......................................................................................................................................................
138rk501_readblock....................................................................................................................................................
138rk501_writeblock..................................................................................................................................................
138rk501_readvalue....................................................................................................................................................
138rk501_writevalue..................................................................................................................................................
138rk501_increment....................................................................................................................................................
138rk501_decrement....................................................................................................................................................
138rk501_transfer......................................................................................................................................................
139rk501_restore........................................................................................................................................................
139 第12页共240页 Scriptprogramminglanguage网站 0.0.5.2新增加部分...................................................................................................................................................
139setup_m1_essbit..............................................................................................................................................
1398583_mac_ecb..........................................................................................................................................................
139asn1c_der_encode..................................................................................................................................................
139asn1c_der_decode..................................................................................................................................................
139open_first_reader................................................................................................................................................
140open_first_reader_by_name................................................................................................................................
140open_second_reader..............................................................................................................................................
140open_second_reader_by_name..............................................................................................................................
140calc_cdk_by_kmc....................................................................................................................................................
142 0.0.5.3新增加部分...................................................................................................................................................
143new__initialize(p,a,b,Gx,Gy,n,h,hex_len_in_byte)...........................................................143new__generate_keypair()..............................................................................................................................
143new__check_pubkey(pubkey)......................................................................................................................
143new__get_pubkey(prikey)..........................................................................................................................
144new__ecdh_agreement(prikey,other_pubkey)......................................................................................144new__sign(prikey,hash)..........................................................................................................................
144new__verify(pubkey,hash,r_and_s)....................................................................................................
144new__point_add(p,q)................................................................................................................................
145new__point_double(p)................................................................................................................................
145new__j2a(p)..................................................................................................................................................
145new__kp(k,p)..............................................................................................................................................
145new__kp_add_lq(k,p,l,q)....................................................................................................................
145new__check_point(point)..........................................................................................................................
145new_puter_y(pc_02_or_03,x)..........................................................................................................
145new__ecdh_gm_map(k,h)............................................................................................................................
145big_add(a,b)....................................................................................................................................................
146big_sub(a,b)....................................................................................................................................................
146big_mul(a,b)....................................................................................................................................................
146big_mod_add(a,b,n)......................................................................................................................................
146big_mod_sub(a,b,n)......................................................................................................................................
146big_mod_mul(a,b,n)......................................................................................................................................
146big_mod_mul_montgomery(a,b,n)//目前要求n的长度是4字节的倍数.........................................146big_mod_inv(e,n)............................................................................................................................................
146big_mod_inv_2_32(4_byte_e)..........................................................................................................................
146big_mod_exp(m,d)............................................................................................................................................
146big_exp(a,b)....................................................................................................................................................
146big_bcd(a,b)....................................................................................................................................................
146prime_test(prime)............................................................................................................................................
146prime_gen(byte_len_in_hex_format)............................................................................................................
146getnextprime(current_number)......................................................................................................................
146getprevprime(current_number)......................................................................................................................
146new_rsa_genstd(bit_len_in_hex,e)............................................................................................................
150 第13页共240页 Scriptprogramminglanguage网站 new_rsa_gencrt(bit_len_in_hex,e)............................................................................................................
150new_rsa_std_sign(bit_len_in_hex,n,d,plain).....................................................................................150new_rsa_crt_sign(bit_len_in_hex,p,q,dp,dq,qinv,plain).........................................................150new_rsa_verify(bit_len_in_hex,e,n,plain,signature)...................................................................150new_rsa_pub_encrypt(bit_len_in_hex,e,n,cipher).............................................................................150new_rsa_std_decrypt(bit_len_in_hex,n,d,plain)...............................................................................150new_rsa_crt_decrypt(bit_len_in_hex,p,q,dp,dq,qinv,plain)...................................................150new_rsa_calculate_other_by_pqe(bit_len_in_hex,e,p,q).................................................................151new_rsa_calculate_other_by_nde(bit_len_in_hex,e,n,d).................................................................151new_sm2_generate_keypair()..............................................................................................................................
152new_sm2_get_pubkey(prikey)..........................................................................................................................
152new_sm2_sign(prikey,hash)..........................................................................................................................
152new_sm2_verify(pubkey,hash,r_and_s)....................................................................................................
152new_sm2_encrypt_123(pubkey,plain)..........................................................................................................
152new_sm2_decrypt_123(prikey,cipher)........................................................................................................
152new_sm2_encrypt_132(pubkey,plain)..........................................................................................................
152new_sm2_decrypt_132(prikey,cipher)........................................................................................................
152new_sm2_getz(pubkey,id)..............................................................................................................................
152ripemd128_hash(data)......................................................................................................................................
154ripemd160_hash(data)......................................................................................................................................
154aes128_mac..............................................................................................................................................................
154aes192_mac..............................................................................................................................................................
154aes256_mac..............................................................................................................................................................
154file函数族.............................................................................................................................................................
1540.0.5.4新增加部分...................................................................................................................................................
1550.0.5.5新增加部分...................................................................................................................................................
155map_m1_keya............................................................................................................................................................
155map_m1_keyb............................................................................................................................................................
155reader_dialog........................................................................................................................................................
156close_first_device..............................................................................................................................................
1570.0.5.6新增加部分...................................................................................................................................................
157prime_gen................................................................................................................................................................
157big_mod_inv_2_32..................................................................................................................................................
157connectless_crc16_ab..........................................................................................................................................
158obe_crc16................................................................................................................................................................
158unpack80..................................................................................................................................................................
158pack80_len..............................................................................................................................................................
159pack00_len..............................................................................................................................................................
159oem_sm4_encrdata..................................................................................................................................................
159oem_sm4mac..............................................................................................................................................................
159oem_sm4js................................................................................................................................................................
159memset......................................................................................................................................................................
160memcpy......................................................................................................................................................................
160 第14页共240页 Scriptprogramminglanguage网站 memxor......................................................................................................................................................................
160memor........................................................................................................................................................................
160memand......................................................................................................................................................................
160des_subkey..............................................................................................................................................................
160des_diversify........................................................................................................................................................
160sm4_subkey..............................................................................................................................................................
160sm4_diversify........................................................................................................................................................
1600.0.5.7新增加部分...................................................................................................................................................
160new_sm2_keyexchange............................................................................................................................................
160sm3_otp....................................................................................................................................................................
162sm4_otp....................................................................................................................................................................
163pkcs_encrypt_pad..................................................................................................................................................
164pkcs_encrypt_unpad..............................................................................................................................................
164pkcs_sign_pad........................................................................................................................................................
164pkcs_sign_unpad....................................................................................................................................................
164show_ansi_string..................................................................................................................................................
164show_utf8_string..................................................................................................................................................
164show_utf7_string..................................................................................................................................................
164show_utf16_little_string..................................................................................................................................
165show_utf16_big_string........................................................................................................................................
165show_string............................................................................................................................................................
1650.0.5.8新增加部分...................................................................................................................................................
165new_sm2__kdf....................................................................................................................................................
165u2f_mand..............................................................................................................................................
165open_process_lock................................................................................................................................................
165release_process_lock..........................................................................................................................................
165u2f_escape_send....................................................................................................................................................
165u2f_escape_recv....................................................................................................................................................
166getbit......................................................................................................................................................................
166getbit_right..........................................................................................................................................................
166aes128_encode_ofb................................................................................................................................................
166aes128_decode_ofb................................................................................................................................................
166aes192_encode_ofb................................................................................................................................................
166aes192_decode_ofb................................................................................................................................................
166aes256_encode_ofb................................................................................................................................................
166aes256_decode_ofb................................................................................................................................................
166sm4_encode_ofb......................................................................................................................................................
166sm4_decode_ofb......................................................................................................................................................
166aes128_encode_ctr................................................................................................................................................
167aes128_decode_ctr................................................................................................................................................
167aes192_encode_ctr................................................................................................................................................
167aes192_decode_ctr................................................................................................................................................
167aes256_encode_ctr................................................................................................................................................
167 第15页共240页 Scriptprogramminglanguage网站 aes256_decode_ctr................................................................................................................................................
167sm4_encode_ctr......................................................................................................................................................
167sm4_decode_ctr......................................................................................................................................................
167gbk_gb18030............................................................................................................................................................
167utf8_gb18030..........................................................................................................................................................
167utf16_little_gb18030..........................................................................................................................................
167gb18030_utf16_little..........................................................................................................................................
168utf16_big_gb18030................................................................................................................................................
168aes128_cmac............................................................................................................................................................
168aes192_cmac............................................................................................................................................................
168aes192_cmac............................................................................................................................................................
168sm4_cmac..................................................................................................................................................................
168ansi_utf16_little................................................................................................................................................
168aes128_encode_cfb................................................................................................................................................
168aes128_decode_cfb................................................................................................................................................
168aes192_encode_cfb................................................................................................................................................
168aes192_decode_cfb................................................................................................................................................
168aes256_encode_cfb................................................................................................................................................
169aes256_decode_cfb................................................................................................................................................
169sm4_encode_cfb......................................................................................................................................................
169sm4_decode_cfb......................................................................................................................................................
169des_encode_cfb......................................................................................................................................................
169des_decode_cfb......................................................................................................................................................
1693des_encode_cfb....................................................................................................................................................
1693des_decode_cfb....................................................................................................................................................
1693des24_encode_cfb................................................................................................................................................
1693des24_decode_cfb................................................................................................................................................
169des_encode_ofb......................................................................................................................................................
169des_decode_ofb......................................................................................................................................................
1703des_encode_ofb....................................................................................................................................................
1703des_decode_ofb....................................................................................................................................................
1703des24_encode_ofb................................................................................................................................................
1703des24_decode_ofb................................................................................................................................................
170des_encode_ctr......................................................................................................................................................
170des_decode_ctr......................................................................................................................................................
1703des_encode_ctr....................................................................................................................................................
1703des_decode_ctr....................................................................................................................................................
1703des24_encode_ctr................................................................................................................................................
1703des24_decode_ctr................................................................................................................................................
170des_cmac..................................................................................................................................................................
1713des_cmac................................................................................................................................................................
1713des24_cmac............................................................................................................................................................
1710.0.5.9新增加部分...................................................................................................................................................
171 第16页共240页 Scriptprogramminglanguage网站 rockey4_encode......................................................................................................................................................
171rockey4_decode......................................................................................................................................................
171cbor函数组............................................................................................................................................................
171blakehash函数组..................................................................................................................................................
172oid_encrypt............................................................................................................................................................
172oid_decrypt............................................................................................................................................................
172crc32........................................................................................................................................................................
173rc4_crypt................................................................................................................................................................
173enfilename....................................................................................................................................................
173getsavefilename....................................................................................................................................................
173CreateProcess........................................................................................................................................................
1730.0.5.9版----删除记录...........................................................................................................................................
1730.0.6.0新增加部分...................................................................................................................................................
173libusb函数族,返回00成功,非00失败.........................................................................................................
173PLC机械控制函数族,返回00成功,非00失败...............................................................................................
174记号控制函数族,可用于实现全局变量功能,被注册的记号在脚本窗口打开期间有效...............................174json函数族(目前只支持读取功能).................................................................................................................
175h2s............................................................................................................................................................................
176parse........................................................................................................................................................................
176fthub_init..............................................................................................................................................................
176fthub_open..............................................................................................................................................................
176fthub_close............................................................................................................................................................
176unix_utc..................................................................................................................................................................
177utc_unix..................................................................................................................................................................
177fthub_init_2..........................................................................................................................................................
177fthub_open_2..........................................................................................................................................................
177fthub_close_2........................................................................................................................................................
177check_tlv................................................................................................................................................................
178check_dcep_tlv......................................................................................................................................................
178aes128_m................................................................................................................................................
179aes128_m................................................................................................................................................
179aes192_m................................................................................................................................................
179aes192_m................................................................................................................................................
179aes256_m................................................................................................................................................
179aes256_m................................................................................................................................................
1790.0.6.1新增加部分...................................................................................................................................................
180aes128_encode_gcm................................................................................................................................................
180aes128_decode_gcm................................................................................................................................................
180aes192_encode_gcm................................................................................................................................................
180aes192_decode_gcm................................................................................................................................................
180aes256_encode_gcm................................................................................................................................................
180aes256_decode_gcm................................................................................................................................................
180asn1_reset..............................................................................................................................................................
182 第17页共240页 Scriptprogramminglanguage网站 asn1_length_begin................................................................................................................................................
182asn1_data................................................................................................................................................................
182asn1_pushtlv..........................................................................................................................................................
182asn1_length_end....................................................................................................................................................
182asn1_final..............................................................................................................................................................
182settlv......................................................................................................................................................................
183gettlv_bypath........................................................................................................................................................
184settlv_bypath........................................................................................................................................................
184passport_calcdigit..............................................................................................................................................
184ext_euclid..............................................................................................................................................................
184big_mod_u32............................................................................................................................................................
1870.0.6.2新增加部分...................................................................................................................................................
187new_sm9_gen_sign_master_key............................................................................................................................
187new_sm9_get_sign_master_key............................................................................................................................
187new_sm9_gen_sign_pri_key..................................................................................................................................
187new_sm9_sign..........................................................................................................................................................
187new_sm9_verify......................................................................................................................................................
187new_sm9_get_saved_random..................................................................................................................................
189new_sm9_gen_encrypt_master_key......................................................................................................................
189new_sm9_get_encrypt_master_key......................................................................................................................
189new_sm9_gen_encrypt_pri_key............................................................................................................................
189new_sm9_encrypt_block........................................................................................................................................
189new_sm9_encrypt_stream......................................................................................................................................
189new_sm9_decrypt_block........................................................................................................................................
189new_sm9_decrypt_stream......................................................................................................................................
189new_sm9_key_pack..................................................................................................................................................
191new_sm9_key_unpack..............................................................................................................................................
191new_sm9_h1..............................................................................................................................................................
193new_sm9_key_exchange..........................................................................................................................................
193show_wsq_image......................................................................................................................................................
195save_wsq_to_tmp....................................................................................................................................................
195big_div....................................................................................................................................................................
196big_mod....................................................................................................................................................................
196big_mod_div............................................................................................................................................................
196getnextprime..........................................................................................................................................................
196getprevprime..........................................................................................................................................................
196new_sm2_get_yflag(point)..............................................................................................................................
197new_puter_y(yflag,point_x)..........................................................................................................
197new_sm2_check_point(point)..........................................................................................................................
197new_sm2_point_add(p,q)................................................................................................................................
197new_sm2_point_double(p)................................................................................................................................
197new_sm2_check_pubkey(pubkey)......................................................................................................................
197new_sm2_ecdh_gm_map(k,point)....................................................................................................................
197 第18页共240页 Scriptprogramminglanguage网站 new_sm2_kp(k,p)..............................................................................................................................................
197new_sm2_kp_add_lq(k,p,l,q)....................................................................................................................
197new__get_yflag(point)..............................................................................................................................
197file_read_linehex................................................................................................................................................
205get_line_count......................................................................................................................................................
205get_linehex_from_mem..........................................................................................................................................
205big_sqrt..................................................................................................................................................................
205md2_hmac..................................................................................................................................................................
206md4_hmac..................................................................................................................................................................
206md5_hmac..................................................................................................................................................................
206sha1_hmac................................................................................................................................................................
206sha224_hmac............................................................................................................................................................
206sha256_hmac............................................................................................................................................................
206sha384_hmac............................................................................................................................................................
206sha512_hmac............................................................................................................................................................
206sm3_160_hmac..........................................................................................................................................................
206sm3_192_hmac..........................................................................................................................................................
206sm3_256_hmac..........................................................................................................................................................
206blake_224_hmac......................................................................................................................................................
206blake_256_hmac......................................................................................................................................................
206blake_384_hmac......................................................................................................................................................
206blake_512_hmac......................................................................................................................................................
206blake_2b_hmac........................................................................................................................................................
206blake_2s_hmac........................................................................................................................................................
206ripemd_128_hmacI..................................................................................................................................................
206ripemd_160_hmacI..................................................................................................................................................
206sha3_224_hmac........................................................................................................................................................
206sha3_256_hmac........................................................................................................................................................
206sha3_384_hmac........................................................................................................................................................
206sha3_512_hmac........................................................................................................................................................
206rockey4_smart_getcrc..........................................................................................................................................
207ed25519_generate_keypair..................................................................................................................................
207ed25519_get_pubkey..............................................................................................................................................
207ed25519_sign..........................................................................................................................................................
207ed25519_verify......................................................................................................................................................
207x25519_generate_keypair....................................................................................................................................
207x25519_get_pubkey................................................................................................................................................
207x25519......................................................................................................................................................................
207 用户DLL接口..................................................................................................................................................................
208 部分设备类型..................................................................................................................................................................
209 DUMMY函数列表...............................................................................................................................................................
210 脚本示例..........................................................................................................................................................................
227 第19页共240页 Scriptprogramminglanguage网站 SCP02认证...................................................................................................................................................................
227国密计算......................................................................................................................................................................
229SHA256HMAC................................................................................................................................................................
231HASH功能演示.............................................................................................................................................................