mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix word
This commit is contained in:
parent
5d99de9b89
commit
1364656855
@ -12,6 +12,7 @@
|
|||||||
* 【core】 修改错别字(pr#568@Github)
|
* 【core】 修改错别字(pr#568@Github)
|
||||||
* 【core】 增加DateUtil.parseCST方法(issue#570@Github)
|
* 【core】 增加DateUtil.parseCST方法(issue#570@Github)
|
||||||
* 【core】 增加defaultIfEmpty方法
|
* 【core】 增加defaultIfEmpty方法
|
||||||
|
* 【crypto】 修改bigIntToFixexLengthBytes为bigIntToFixedLengthBytes(pr#575@Github)
|
||||||
|
|
||||||
### Bug修复
|
### Bug修复
|
||||||
* 【all】 修复阶乘计算错误bug(issue#I12XE4@Gitee)
|
* 【all】 修复阶乘计算错误bug(issue#I12XE4@Gitee)
|
||||||
|
@ -189,8 +189,8 @@ public class SmUtil {
|
|||||||
*/
|
*/
|
||||||
public static byte[] rsAsn1ToPlain(byte[] rsDer) {
|
public static byte[] rsAsn1ToPlain(byte[] rsDer) {
|
||||||
ASN1Sequence seq = ASN1Sequence.getInstance(rsDer);
|
ASN1Sequence seq = ASN1Sequence.getInstance(rsDer);
|
||||||
byte[] r = bigIntToFixexLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(0)).getValue());
|
byte[] r = bigIntToFixedLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(0)).getValue());
|
||||||
byte[] s = bigIntToFixexLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(1)).getValue());
|
byte[] s = bigIntToFixedLengthBytes(ASN1Integer.getInstance(seq.getObjectAt(1)).getValue());
|
||||||
byte[] result = new byte[RS_LEN * 2];
|
byte[] result = new byte[RS_LEN * 2];
|
||||||
System.arraycopy(r, 0, result, 0, r.length);
|
System.arraycopy(r, 0, result, 0, r.length);
|
||||||
System.arraycopy(s, 0, result, RS_LEN, s.length);
|
System.arraycopy(s, 0, result, RS_LEN, s.length);
|
||||||
@ -251,7 +251,7 @@ public class SmUtil {
|
|||||||
* @return 固定长度bytes
|
* @return 固定长度bytes
|
||||||
* @since 4.5.0
|
* @since 4.5.0
|
||||||
*/
|
*/
|
||||||
private static byte[] bigIntToFixexLengthBytes(BigInteger rOrS) {
|
private static byte[] bigIntToFixedLengthBytes(BigInteger rOrS) {
|
||||||
// for sm2p256v1, n is 00fffffffeffffffffffffffffffffffff7203df6b21c6052b53bbf40939d54123,
|
// for sm2p256v1, n is 00fffffffeffffffffffffffffffffffff7203df6b21c6052b53bbf40939d54123,
|
||||||
// r and s are the result of mod n, so they should be less than n and have length<=32
|
// r and s are the result of mod n, so they should be less than n and have length<=32
|
||||||
byte[] rs = rOrS.toByteArray();
|
byte[] rs = rOrS.toByteArray();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user