208 Commits

Author SHA1 Message Date
YuanHongYe
fe532e12b4 sm9: Prevent PublicKey() returning nil after unmarshaling master private key
During unmarshaling of SignMasterPrivateKey and EncryptMasterPrivateKey,
now generate the corresponding public key.
This ensures that PublicKey() does not return nil.

Test cases included to validate the changes.

Signed-off-by: YuanHongYe <yuanhongye@chinatelecom.cn>
2025-04-15 17:01:27 +08:00
Sun Yimin
88df15c64c
sm9: implement crypto.Singer crypto.Decrypter interface 2025-03-25 14:58:16 +08:00
Sun Yimin
3eea15b3b8
internal/sm9,sm9: refactor all keys 2025-03-25 11:10:53 +08:00
Sun Yimin
82ccb95527
sm9,internal/sm9: update comments #314 2025-03-14 15:26:34 +08:00
Sun Yimin
c32a9849f8
sm9: refactoring #314 2025-03-13 16:50:28 +08:00
Sun Yimin
7a5253bfb5
change to use go's own XORBytes function #315 2025-03-13 15:15:46 +08:00
Sun Yimin
bdb169b06b
sm9: refactoring, do not expose bn256 types to caller #314 2025-03-13 14:14:45 +08:00
Sun Yimin
43ffd49e2f
sm9: refactoring, do not expose bn256 types to caller #314 2025-03-13 13:46:14 +08:00
Sun Yimin
d7a6169fbf
internal/cpu: import codes from golang.org/x/sys/cpu #310 2025-03-05 14:54:51 +08:00
Sun Yimin
a71e806a2d
sm9: code review 2024-12-17 18:06:15 +08:00
Sun Yimin
bf14e70c4b
internal/byteorder: new package #275 2024-11-21 14:32:32 +08:00
Sun Yimin
9624b43515
internal/bigmod: drop math/big dependency #273 2024-11-20 18:06:29 +08:00
Sun Yimin
c8a803369a
update README 2024-10-06 11:44:26 +08:00
Sun Yimin
fcdfc40cf0
sm9/bn256: ppc64x conditional move fix #256 2024-10-06 11:39:19 +08:00
Sun Yimin
9740519bb3
sm9/bn256: ppc64x test move #256 2024-10-06 11:29:58 +08:00
Sun Yimin
42e1018e36
sm9/bn256: ppc64x test move 2024-10-06 11:25:45 +08:00
Sun Yimin
2455a45871
sm9/bn256: ppc64x value copy/conditional move #256 2024-10-06 10:45:20 +08:00
Sun Yimin
74d1bb82e4
sm9/bn256: ppc64x gfp #256 2024-10-06 09:45:50 +08:00
Sun Yimin
ed4eafdc3e
sm9/bn256: ppc64x gfp sqr 2024-10-05 17:17:51 +08:00
Sun Yimin
9477b78fec
sm9/bn256: ppc64x gfp mul 2024-10-05 16:33:01 +08:00
Sun Yimin
fca2c5e936
sm9/bn256: ppc64x test sub self 2024-10-05 14:02:28 +08:00
Sun Yimin
9a3d21eaec
sm9/bn256: gfp ppc64x fix neg 2024-10-05 13:42:54 +08:00
Sun Yimin
23b4d7ef72
sm9/bn256: gfp ppc64x add/sub/neg fix 3 2024-10-05 13:15:59 +08:00
Sun Yimin
354560331f
sm9/bn256: gfp add/sub fix 2 2024-10-05 12:39:20 +08:00
Sun Yimin
81c4bd077c
sm9/bn256: gfp ppc64x add/sub fix 2024-10-05 12:28:59 +08:00
Sun Yimin
da7a9d6ef0
fix compile error 2024-10-05 12:04:58 +08:00
Sun Yimin
60799ec2e9
fix compile error 2024-10-05 12:00:02 +08:00
Sun Yimin
d2262c4d61
fix compile error 2024-10-05 11:56:00 +08:00
Sun Yimin
d1eb7b386b
rename functions 2024-10-05 11:53:44 +08:00
Sun Yimin
0ef82b1be5
sm9/bn256: gfp ppc64x add/sub 2024-10-05 11:51:31 +08:00
Sun Yimin
1b512e5772
internal/cryptotest: add tests for the hash.Hash cipher.BlockMode cipher.Block interfaces 2024-08-02 13:02:25 +08:00
Sun Yimin
2c688bb9d3
subtle: align byte equal alg 2024-05-28 17:33:48 +08:00
Sun Yimin
c99ad27ce1
kdf: share Z hash state #220 2024-05-15 08:28:47 +08:00
Sun Yimin
5adc912824
refine build tags 2024-03-05 09:47:49 +08:00
Sun Yimin
18cc283af2
internal/sm2ec: add comments 2024-02-26 08:25:37 +08:00
emmansun
35466446d4 internal/sm2ec: order sqr/mul WWMM sub first 2024-02-24 13:36:46 +08:00
Sun Yimin
0f3d76705b
sm2: fix enveloped key issue #188 2023-12-13 13:43:05 +08:00
Sun Yimin
1b200746af
fix bug #74 2023-11-09 08:50:13 +08:00
Sun Yimin
83cf55a137
sm2p256_asm.go中切片直接转数组指针 #74 2023-11-09 08:44:50 +08:00
Sun Yimin
17a3dd8d4b
change interface{} to any, and remove "+build" build tag #77 2023-11-09 08:34:50 +08:00
Sun Yimin
ef55df3657
sm9/bn256: use neon inst. for conditional move 2023-11-07 15:33:52 +08:00
Sun Yimin
55e8c795e5
sm9/bn256: fix arm64 non-avx2 issue 2023-10-24 14:50:51 +08:00
Sun Yimin
429c2db8aa
plugin: sm2 sm9 use BP carefully 2023-09-11 08:47:02 +08:00
Sun Yimin
3bb540d45f
sm9/bn256: amd64 asm support plugin, eliminate usage of R15 #154 2023-09-08 16:36:43 +08:00
Sun Yimin
58121ac8cc
build: support plugin flag for amd64 #154 2023-09-07 08:50:10 +08:00
Sun Yimin
c813a1fb65
internal/sm2ec: add boundary test 2023-07-28 15:26:42 +08:00
Sun Yimin
ca474a67ba
sm9/bn256: remove useless tmp value storage 2023-07-28 11:19:58 +08:00
Sun Yimin
9035a35b64
sm9/bn256: fix arm64 grammatical errors 2023-07-27 16:12:56 +08:00
Sun Yimin
0ee8177079
sm9/bn256: gfp2MulU1 2023-07-27 15:59:52 +08:00
Sun Yimin
e3d14fb41a
sm9/bn256: reduce register move 2023-07-27 13:03:25 +08:00