Comments (6)
from gmobjc.
from gmobjc.
from gmobjc.
是的,项目使用时主要匹配的是 NID_sm2、NID_secp256k1、NID_X9_62_prime256v1 这几种 256 位的曲线,其他位的曲线未匹配,稍等我给你一种解决方案。
from gmobjc.
把签名长度计算方法修改一下就可以了。源码不复杂,都是调用 OpenSSL 实现的,如果有需求,项目中修改开源代码即可。
// 根据椭圆曲线密钥长度,计算签名长度
size_t outlen = (EC_GROUP_get_degree(group) + 7) / 8;
uint8_t *ecdh_text = (uint8_t *)OPENSSL_zalloc(outlen + 1);
int ret = ECDH_compute_key(ecdh_text, outlen, pub_point, key, 0);
if (ret <= 0) {
break;
}
NSData *ecdhData = [NSData dataWithBytes:ecdh_text length:ret];
ecdhStr = [GMUtils dataToHex:ecdhData];
from gmobjc.
感谢,我自己hook了一下,改成了128 然后判断返回的字符串是否有 00的后缀,如果有的话就去掉,返回最后生成的可以对上了,不过你的这个新的写法更精确一些
from gmobjc.
Related Issues (20)
- 关于典型类型与openSSL的类型对应的问题 HOT 1
- 读取 .cer 后缀的证书为nil HOT 2
- EC_GROUP_new_by_curve_name(); // 椭圆曲线 方法返回NULL HOT 1
- 02开头的SM2压缩公钥如何还原成04开头的公钥呢 HOT 1
- mac app支持 HOT 2
- 使用GMSm2Utils加密无效 HOT 6
- SM2 秘钥协商问题 HOT 1
- ECPrivateKeyParameters 如何实现? HOT 11
- 请问大佬是否有计划出一个swift 的版本毕竟objc用的人不多了
- 苹果新政 privacy manifest HOT 5
- GMSm2Utils 加密后返回空字符串 HOT 1
- carthage编译的gmobjc动态度里面的引用可以单独引用用其自身的openssl HOT 14
- 苹果审核被拒:使用了OpenSSL.xcframework HOT 5
- 在 Swift PM 中直接添加该库报错 HOT 6
- 老铁 使用 SPM 方式添加依赖,真机安装失败 HOT 9
- EC_GROUP_new_by_curve_name(); // 椭圆曲线 方法返回NUL (项目里OPENSSL就一个版本 ) HOT 2
- 运行报错,所有文件的头文件都是两个 HOT 8
- sm2加解密,公私钥格式
- 希望在加签和验签是时候添加是否需要hash的选项 HOT 1
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 gmobjc.