Module ec
ec module to create EC keys and do EC key processes.
Functions
sign (eckey, digest, digest) | do EC sign |
verify (eckey, digest, signature, digest) | do EC verify, input msg is digest result |
Functions
- sign (eckey, digest, digest)
-
do EC sign
Parameters:
- eckey ec_key
- digest evp_md, string or nid digest alg identity, default is sm3
- digest evp_md, string or nid digest alg identity, default is sm3
Returns:
-
string
signature
- verify (eckey, digest, signature, digest)
-
do EC verify, input msg is digest result
Parameters:
- eckey ec_key
- digest evp_md, string or nid digest alg identity
- signature string
- digest evp_md, string or nid digest alg identity
Returns:
- boolean true for verified, false for invalid signature
- nil for error, and followed by error message