Add sm9 and paillier pem support

This commit is contained in:
Zhi Guan
2018-11-16 15:26:30 +08:00
parent 5baad7e043
commit 9a999ae907
38 changed files with 7956 additions and 6992 deletions

View File

@@ -52,6 +52,7 @@
#include <openssl/err.h>
#include <openssl/sm9.h>
#include "e_os.h"
/* private key extract algorithms */
#define SM9_HID_SIGN 0x01
@@ -86,38 +87,38 @@ extern "C" {
#endif
struct SM9MasterSecret_st {
struct SM9_MASTER_KEY_st {
/* public */
ASN1_OBJECT *pairing;
ASN1_OBJECT *scheme;
ASN1_OBJECT *hash1;
ASN1_OCTET_STRING *pointPpub;
/* private */
BIGNUM *masterSecret;
int references;
int flags;
CRYPTO_EX_DATA ex_data;
CRYPTO_RWLOCK *lock;
};
struct SM9PublicParameters_st {
ASN1_OBJECT *pairing;
ASN1_OBJECT *scheme;
ASN1_OBJECT *hash1;
ASN1_OCTET_STRING *pointPpub;
};
struct SM9PrivateKey_st {
struct SM9_KEY_st {
/* public */
ASN1_OBJECT *pairing;
ASN1_OBJECT *scheme;
ASN1_OBJECT *hash1;
ASN1_OCTET_STRING *pointPpub;
ASN1_OCTET_STRING *identity;
ASN1_OCTET_STRING *publicPoint;
/* private */
ASN1_OCTET_STRING *privatePoint;
};
struct SM9PublicKey_st {
ASN1_OBJECT *pairing;
ASN1_OBJECT *scheme;
ASN1_OBJECT *hash1;
ASN1_OCTET_STRING *pointPpub;
ASN1_OCTET_STRING *identity;
ASN1_OCTET_STRING *publicPoint;
int references;
int flags;
CRYPTO_EX_DATA ex_data;
CRYPTO_RWLOCK *lock;
};
struct SM9Ciphertext_st {