GMSm2Def.h 883 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // GMSm2Def.h
  3. // GMPro
  4. //
  5. // Created by lifei on 2019/7/17.
  6. // Copyright © 2019 lifei. All rights reserved.
  7. /**
  8. * Sm2 加密后密文为 ASN1 编码,此处编解码所用结构体
  9. */
  10. #ifndef GMSm2Def_h
  11. #define GMSm2Def_h
  12. #import <openssl/asn1t.h>
  13. // 定义 ASN1 编解码存储数据的结构体
  14. typedef struct SM2_Ciphertext_st_1 SM2_Ciphertext_1;
  15. DECLARE_ASN1_FUNCTIONS(SM2_Ciphertext_1)
  16. struct SM2_Ciphertext_st_1 {
  17. BIGNUM *C1x;
  18. BIGNUM *C1y;
  19. ASN1_OCTET_STRING *C3;
  20. ASN1_OCTET_STRING *C2;
  21. };
  22. ASN1_SEQUENCE(SM2_Ciphertext_1) = {
  23. ASN1_SIMPLE(SM2_Ciphertext_1, C1x, BIGNUM),
  24. ASN1_SIMPLE(SM2_Ciphertext_1, C1y, BIGNUM),
  25. ASN1_SIMPLE(SM2_Ciphertext_1, C3, ASN1_OCTET_STRING),
  26. ASN1_SIMPLE(SM2_Ciphertext_1, C2, ASN1_OCTET_STRING),
  27. } ASN1_SEQUENCE_END(SM2_Ciphertext_1)
  28. IMPLEMENT_ASN1_FUNCTIONS(SM2_Ciphertext_1)
  29. #endif /* GMSm2Def_h */