Comments (4)
请看GM/T 0009-2012 SM2算法使用规范
from gmssl.
@conezxy 谢谢,已在 GM/T 0009-2012 7. 2节中找到报文对应的格式。
但是不解 GM/T 0003.4-2012 中 SM2公钥加密输出密文( C=C1 || C2 || C3 )难道不就是 指 GM/T 0009-2012 的 ‘加密数据格式’,两者难道含义不一样?
@guanzhi GMSSL有函数可以 decode&decrypt GM/T 0009-2012 7. 2 中定义的密文数据吗?(没有的话我自己写也行)
from gmssl.
对于同样的数据,在不同场景和层次中的表达和定义不同:
- GM/T 0003-2012的定义( C=C1 || C2 || C3 )是数学意义上的表达。如果要对应到编程实现,则需要将其定义为C语言的结构。
- GM/T 0016/0017/0018-2012(SDF和SKF规范)中的定义是基于C编程的表达
typedef struct Struct_ECCCIPHERBLOB{
BYTE XCoordinate[ECC_MAX_XCOORDINATE_BITS_LEN/8];
BYTE YCoordinate[ECC_MAX_YCOORDINATE_BITS_LEN/8];
BYTE HASH[32];
ULONG CipherLen;
BYTE Cipher[128];
} ECCCIPHERBLOB, *PECCCIPHERBLOB;
- 但仅有C编程上的定义,还无法解决不同系统之间数据互通的问题(比如大小端问题)。因此在GM/T 0009-2012中定义了适用于序列化的表达(ASN.1)
SM2Cipher:: = Sequence {
XCoordinate INTEGER,
YCoordinate INTEGER,
HASH OCTET STRING SIZE(32),
C OCTET STRING,
}
from gmssl.
@mrpre 还没有,请参考 sm2/sm2_asn1.c
from gmssl.
Related Issues (20)
- 无密码的私钥key,怎么读取 HOT 5
- 解析加密的私钥key失败 HOT 1
- SM2密钥对封装格式,概率性无法解密 HOT 4
- [2.0版本考古求助,3.0已解决]gmssl 2.0产生带密码的私钥怎么提取未加密的私钥出来啊? HOT 13
- Intel芯片的Mac版本下,编译出错 HOT 1
- 如何打出支持iOS的静态库 HOT 3
- 曲线参数a的定义 HOT 2
- gmssl3.0 当前是线程安全吗?
- 为什么使用gmssl sm2keygen生成的key算法是1.2.840.113549.1.5.13 HOT 1
- 强烈建议给加密函数开放更多的可选项 HOT 3
- SM9模运算函数 与 正常运算的结果不一致 HOT 1
- 使用国密提供的cUrl工具(gmcurl_linux_x64)测试openresty+gmssl2.5.4国密双证书时,时通时不通,详细信息如下: HOT 2
- 您好,我想要一份开发者文档
- 可否调整WIndows版release可执行文件的依赖库
- 能否增加去除sm2私钥密码保护的功能
- V3.1.1使用windows 10 Visual studio 2022 编译时报错 HOT 1
- 按 README 所说无法得到 Linux 下的静态库 HOT 1
- 3.0比2.0的并发加解密性能低?
- 3.0比2.0的并发加解密性能低?
- 官网 403
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gmssl.