sm2.h 884 B

12345678910111213141516171819202122232425
  1. // \file:sm2.h
  2. //SM2 Algorithm
  3. //2011-11-09
  4. //author:goldboar
  5. //email:[email protected]
  6. //comment:2011-11-10 sm2-sign-verify sm2-dh
  7. //SM2_sign_setup
  8. int SM2_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
  9. //SM2_sign_ex
  10. int SM2_sign_ex(int type, const unsigned char *dgst, int dlen, unsigned char
  11. *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey);
  12. //SM2_sign
  13. int SM2_sign(int type, const unsigned char *dgst, int dlen, unsigned char
  14. *sig, unsigned int *siglen, EC_KEY *eckey);
  15. //SM2_verify
  16. int SM2_verify(int type, const unsigned char *dgst, int dgst_len,
  17. const unsigned char *sigbuf, int sig_len, EC_KEY *eckey);
  18. //SM2 DH, comupting shared point
  19. int SM2_DH_key(const EC_GROUP * group,const EC_POINT *b_pub_key_r, const EC_POINT *b_pub_key, const BIGNUM *a_r,EC_KEY *a_eckey,
  20. unsigned char *outkey,size_t keylen);