const G1_SIZE
pub const G1_SIZE = 65Purpose
Constant G1_SIZE, defining protocol or algorithm parameters.
#crypto/sm9SM9 identity-based sign/encrypt/exchange. Pure Xu, not commercial-crypto certified.
const G1_SIZEpub const G1_SIZE = 65Constant G1_SIZE, defining protocol or algorithm parameters.
const G2_SIZEpub const G2_SIZE = 129Constant G2_SIZE, defining protocol or algorithm parameters.
const SIGNATURE_SIZEpub const SIGNATURE_SIZE = 97Constant SIGNATURE_SIZE, defining protocol or algorithm parameters.
const HID_SIGNpub const HID_SIGN = 1Constant HID_SIGN, defining protocol or algorithm parameters.
const HID_ENCpub const HID_ENC = 3Constant HID_ENC, defining protocol or algorithm parameters.
const HID_EXCHpub const HID_EXCH = 2Constant HID_EXCH, defining protocol or algorithm parameters.
sign_master_publicpub fn sign_master_public(ks &string) stringSign master public. Throws on failure; handle the error or propagate it to the caller.
ks &stringstring — result string
sign_user_keypub fn sign_user_key(ks &string, id &string) stringSign user key. Throws on failure; handle the error or propagate it to the caller.
ks &stringid &stringstring — result string
enc_master_publicpub fn enc_master_public(ke &string) stringEnc master public. Throws on failure; handle the error or propagate it to the caller.
ke &stringstring — result string
enc_user_keypub fn enc_user_key(ke &string, id &string) stringEnc user key.
ke &stringid &stringstring — result string
exch_user_keypub fn exch_user_key(ke &string, id &string) stringExch user key.
ke &stringid &stringstring — result string
sign_rpub fn sign_r(dsa &string, mpk &string, msg &string, r &string) stringSign r. Throws on failure; handle the error or propagate it to the caller.
dsa &stringmpk &stringmsg &stringr &stringstring — result string
signpub fn sign(dsa &string, mpk &string, msg &string) stringCompute digital signature using private key. Throws on failure; handle the error or propagate it to the caller.
dsa &stringmpk &stringmsg &stringstring — result string
verifypub fn verify(mpk &string, id &string, msg &string, sig &string) boolVerify whether digital signature matches message.
mpk &stringid &stringmsg &stringsig &stringbool — true or false
encrypt_rpub fn encrypt_r(mpk &string, id &string, msg &string, r &string) stringEncrypt r. Throws on failure; handle the error or propagate it to the caller.
mpk &stringid &stringmsg &stringr &stringstring — result string
encryptpub fn encrypt(mpk &string, id &string, msg &string) stringEncrypt. Throws on failure; handle the error or propagate it to the caller.
mpk &stringid &stringmsg &stringstring — result string
decryptpub fn decrypt(d &string, id &string, ct &string) stringDecrypt. Throws on failure; handle the error or propagate it to the caller.
d &stringid &stringct &stringstring — result string
struct ExchCappub struct ExchCap {
pub point string
pub mac string
pub key string
}Structure encapsulating point, mac, key.
point stringmac stringkey stringstruct Exchpub struct Exch {
}Exch context or state structure.
This type has no public fields.
exch_newpub fn exch_new(duk &string, mpk &string, uid &string, peer &string, klen int, gen_sig bool) ExchExch new. Throws on failure; handle the error or propagate it to the caller.
duk &stringmpk &stringuid &stringpeer &stringklen intgen_sig boolExch — a value of this type
($&Exch) init_rpub fn (e $&Exch) init_r(r &string) stringOperation on $&Exch: init r. Throws on failure; handle the error or propagate it to the caller.
e $&ExchExch instance used by this call (exclusive borrow).r &stringstring — result string
($&Exch) initpub fn (e $&Exch) init() stringInitialize internal state and default parameters. Throws on failure; handle the error or propagate it to the caller.
e $&ExchExch instance used by this call (exclusive borrow).string — result string
($&Exch) respond_rpub fn (e $&Exch) respond_r(r &string, ra &string) ExchCapOperation on $&Exch: respond r. Throws on failure; handle the error or propagate it to the caller.
e $&ExchExch instance used by this call (exclusive borrow).r &stringra &stringExchCap — a value of this type
($&Exch) respondpub fn (e $&Exch) respond(ra &string) ExchCapExecute respond on $&Exch. Throws on failure; handle the error or propagate it to the caller.
e $&ExchExch instance used by this call (exclusive borrow).ra &stringExchCap — a value of this type
($&Exch) confirm_responderpub fn (e $&Exch) confirm_responder(rb &string, sb &string) ExchCapOperation on $&Exch: confirm responder. Throws on failure; handle the error or propagate it to the caller.
e $&ExchExch instance used by this call (exclusive borrow).rb &stringsb &stringExchCap — a value of this type
($&Exch) confirm_initiatorpub fn (e $&Exch) confirm_initiator(sa &string) stringOperation on $&Exch: confirm initiator. Throws on failure; handle the error or propagate it to the caller.
e $&ExchExch instance used by this call (exclusive borrow).sa &stringstring — result string