mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-09 07:23:56 +08:00
add CBC-MAC and GM OTP, not tested
This commit is contained in:
@@ -91,6 +91,7 @@ Default ID = "1234567812345678"
|
||||
|
||||
*/
|
||||
|
||||
#if 0
|
||||
typedef struct SM2CiphertextValue_st {
|
||||
ASN1_INTEGER *xCoordinate;
|
||||
ASN1_INTEGER *yCoordinate;
|
||||
@@ -107,6 +108,22 @@ ASN1_SEQUENCE(SM2CiphertextValue) = {
|
||||
IMPLEMENT_ASN1_FUNCTIONS(SM2CiphertextValue)
|
||||
IMPLEMENT_ASN1_DUP_FUNCTION(SM2CiphertextValue)
|
||||
|
||||
typedef struct SM2EnvelopedKey_st {
|
||||
ASN1_ALGOR *symAlgID;
|
||||
SM2CiphertextValue *symEncryptedKey;
|
||||
ASN1_OCTET_STRING *sm2PublicKey;
|
||||
ASN1_BIT_STRING *sm2EncryptedPrivateKey;
|
||||
} SM2EnvelopedKey;
|
||||
|
||||
/* GmSSL specific */
|
||||
ASN1_SEQUENCE(SM2_CIPHERTEXT_VALUE_ASN1) = {
|
||||
ASN1_SIMPLE(SM2_CIPHERTEXT_VALUE_ASN1, ephem_point, ASN1_OCTET_STRING),
|
||||
ASN1_SIMPLE(SM2_CIPHERTEXT_VALUE_ASN1, ciphertext, ASN1_OCTET_STRING),
|
||||
ASN1_SIMPLE(SM2_CIPHERTEXT_VALUE_ASN1, mactag, ASN1_OCTET_STRING)
|
||||
} ASN1_SEQUENCE_END(SM2_CIPHERTEXT_VALUE)
|
||||
IMPLEMENT_ASN1_FUNCTIONS(SM2_CIPHERTEXT_VALUE_ASN1)
|
||||
IMPLEMENT_ASN1_DUP_FUNCTION(SM2_CIPHERTEXT_VALUE_ASN1)
|
||||
|
||||
|
||||
int i2d_SM2_CIPHERTEXT_VALUE(const SM2_CIPHERTEXT_VALUE *c, unsigned char **out)
|
||||
{
|
||||
@@ -145,4 +162,4 @@ SM2_CIPHERTEXT_VALUE *d2i_SM2_CIPHERTEXT_VALUE(SM2_CIPHERTEXT_VALUE **c,
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user