- Added an untested SM implementation, currently only with encryption
- Added utils from OpenPACE git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@51 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
25
ccid/sm.h
Normal file
25
ccid/sm.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <opensc/opensc.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#define SM_ISO_PADDING 0x01
|
||||
#define SM_NO_PADDING 0x02
|
||||
|
||||
struct sm_ctx {
|
||||
u8 padding_indicator;
|
||||
u8 *key_mac;
|
||||
size_t key_mac_len;
|
||||
u8 *key_enc;
|
||||
size_t key_enc_len;
|
||||
|
||||
const EVP_CIPHER *cipher;
|
||||
EVP_CIPHER_CTX *cipher_ctx;
|
||||
ENGINE *cipher_engine;
|
||||
unsigned char *iv;
|
||||
|
||||
const EVP_MD * md;
|
||||
EVP_MD_CTX * md_ctx;
|
||||
ENGINE *md_engine;
|
||||
};
|
||||
|
||||
int sm_encrypt(const struct sm_ctx *ctx, sc_card_t *card, sc_apdu_t *apdu,
|
||||
sc_apdu_t *sm_apdu);
|
||||
Reference in New Issue
Block a user