Discover Packages
github.com/deatil/go-cryptobin
gm
sm9
package
Version:
v1.0.2039
Opens a new window with list of versions in this module.
Published: Dec 21, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
sm9 verify algorithm(given sig (h',S'), message M' and user's id):
B1:compute g = e(P1,Ppub);
B2:compute t = g^h';
B3:compute h1 = H1(id||hid,n);
B4:compute P = h1·P2+Ppub;
B5:compute u = e(S',P);
B6:compute w' = u·t;
B7:compute h2 = H2(M'||w',n), check if h2 = h'.
MasterKey contains a master secret key and a master public key.
generate master key for KGC(Key Generate Center).
Sm9Sig contains a big number and an element in G1.
sm9 sign algorithm:
A1:compute g = e(P1,Ppub);
A2:choose random num r in [1,n-1];
A3:compute w = g^r;
A4:compute h = H2(M||w,n);
A5:compute l = (r-h) mod n, if l = 0 goto A2;
A6:compute S = l·sk.
UserKey contains a secret key.
G1Bytes = G1.Marshal()
generate user's secret key.
Source Files
¶
Directories
¶
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
Click to show internal directories.
Click to hide internal directories.