Comments (11)
@Gsealy , em... what's your point with sm3util?
use
SM3Digest
constructor lightweight api, don't need involve BC provider (Security.addProvider()
)if use
MessageDigest.getInstance("SM3", "BC")
, need add this code
java-gm/src/main/java/SM3Util.java
Line 29 in 5b5f58e
you mean we don't need Security.addProvider()
right?
from java-gm.
Thanks for raise up this interesting issue.
Is it related to this? https://cloud.tencent.com/developer/article/1605908
from java-gm.
em.... for sm2, from my point of view, we'd better use default, so the code will upgrade with BC.
and it is a good founding, we can adding supports for the mode for sm2.
from java-gm.
Thanks for raise up this interesting issue.
Is it related to this? https://cloud.tencent.com/developer/article/1605908
ahh, cant see link in comment.. refer can see it
from java-gm.
em.... for sm2, from my point of view, we'd better use default, so the code will upgrade with BC.
but default mode was modified in official standard.sm2 Public key encryption algorithm
from java-gm.
em.... for sm2, from my point of view, we'd better use default, so the code will upgrade with BC.
but default mode was modified in official standard.sm2 Public key encryption algorithm
some correction,
- from point of view from interface design, we should add this support.
- from point of view as dependency management, the default mode will keep same with BC.
which means, I would like to change the code as BC did.
https://github.com/bcgit/bc-java/blob/r1rv68/core/src/main/java/org/bouncycastle/crypto/engines/SM2Engine.java#L43-L66
an interface and a method variable maybe.
the mode was modified, and personally I hope you are able to ask BC to make the change.
Plan A:java-gm depends on BC to create SM2 xxxx in xxx mode.
but not
Plan B:java-gm has it own logic and base on BC to create SM2 xxxx in xxx mode.
For Plan A, when BC upgrade, java-gm can just use latest BC code without any code change.
For Plan B, java-gm should and will monitoring any changes in BC for sm2 and change the code ....
from java-gm.
yes, default mode can keep same with BC. And add another method for other mode.
from java-gm.
@Gsealy , em... what's your point with sm3util?
from java-gm.
My opinion about mode support in java-gm is to adopt C1C3C2 only, although I see some SM2Engine constructor use C1C2C3 as default.
from java-gm.
@Gsealy , em... what's your point with sm3util?
use SM3Digest
constructor lightweight api, don't need involve BC provider (Security.addProvider()
)
if use MessageDigest.getInstance("SM3", "BC")
, need add this code
from java-gm.
My opinion about mode support in java-gm is to adopt C1C3C2 only, although I see some SM2Engine constructor use C1C2C3 as default.
see my comments above.
from java-gm.
Related Issues (20)
- update azp for release. HOT 13
- generate key pair supports password HOT 1
- sm3/sm4 check each other between different languages HOT 1
- 缺少通过私钥生成对应公钥的实现
- upgrade bouncycastle to latest
- add support/test sample for different hash function HOT 1
- sm4 Enum
- SDK SM2/3/4 Sample
- Benchmark as JMH HOT 1
- SM4Util重构后的问题 HOT 3
- azp ci badge显示没跑 HOT 2
- sm2/3 factory
- impl for java sdk(sm2/3 part)
- sm4 chaincode sample? HOT 1
- EnvelopeMessage Encryption failed
- use github action replace with azp
- 资源泄漏的问题比较多 HOT 11
- [提议] 支持通过直接读取公私钥字符串来加载其对象 HOT 12
- publish java package HOT 4
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 java-gm.