OpenPACE
|
Macros | |
#define | EAC_ID_PACE 0 |
Identifies the PACE context. | |
#define | EAC_ID_CA 1 |
Identifies the CA context. | |
#define | EAC_ID_TA 2 |
Identifies the TA context. | |
#define | EAC_ID_EAC 3 |
Identifies the currently used channel for encryption/decryption. | |
Functions | |
BUF_MEM * | EAC_add_iso_pad (const EAC_CTX *ctx, const BUF_MEM *unpadded) |
Pad a buffer using ISO/IEC 9797-1 padding method 2. More... | |
BUF_MEM * | EAC_remove_iso_pad (const BUF_MEM *padded) |
Remove ISO/IEC 9797-1 padding method 2 from a message. More... | |
int | EAC_increment_ssc (const EAC_CTX *ctx) |
Increment the Send Sequence Counter. More... | |
int | EAC_reset_ssc (const EAC_CTX *ctx) |
Reset the Send Sequence Counter. More... | |
int | EAC_set_ssc (const EAC_CTX *ctx, unsigned long ssc) |
Set the Send Sequence Counter. More... | |
BUF_MEM * | EAC_encrypt (const EAC_CTX *ctx, const BUF_MEM *data) |
Encrypts data according to TR-03110 F.2. More... | |
BUF_MEM * | EAC_decrypt (const EAC_CTX *ctx, const BUF_MEM *data) |
Decrypt data according to TR-03110 F.2. More... | |
BUF_MEM * | EAC_authenticate (const EAC_CTX *ctx, const BUF_MEM *data) |
Authenticate data according to TR-03110 F.2. More... | |
int | EAC_verify_authentication (const EAC_CTX *ctx, const BUF_MEM *data, const BUF_MEM *mac) |
Verify authenticated data according to TR-03110 F.2. More... | |
BUF_MEM * | EAC_Comp (const EAC_CTX *ctx, int id, const BUF_MEM *pub) |
Compresse a public key according to TR-03110 Table A.2. More... | |
BUF_MEM * | EAC_hash_certificate_description (const unsigned char *cert_desc, size_t cert_desc_len) |
Compute the hash of a CV certificate description. More... | |
int | EAC_CTX_set_encryption_ctx (EAC_CTX *ctx, int id) |
Set the SM context for encryption, decryption and authentication. More... | |
BUF_MEM* EAC_add_iso_pad | ( | const EAC_CTX * | ctx, |
const BUF_MEM * | unpadded | ||
) |
Pad a buffer using ISO/IEC 9797-1 padding method 2.
The block size is calculated from the currently selected SM context.
[in] | ctx | EAC context |
[in] | unpadded | Buffer to pad |
BUF_MEM* EAC_authenticate | ( | const EAC_CTX * | ctx, |
const BUF_MEM * | data | ||
) |
Authenticate data according to TR-03110 F.2.
[in] | ctx | EAC context |
[in] | data | Data to authenticate |
BUF_MEM* EAC_Comp | ( | const EAC_CTX * | ctx, |
int | id, | ||
const BUF_MEM * | pub | ||
) |
Compresse a public key according to TR-03110 Table A.2.
[in] | ctx | EAC context |
[in] | id | accepts EAC_ID_PACE , EAC_ID_CA , EAC_ID_TA |
[in] | pub | Raw public key |
int EAC_CTX_set_encryption_ctx | ( | EAC_CTX * | ctx, |
int | id | ||
) |
Set the SM context for encryption, decryption and authentication.
Calls EAC_reset_ssc()
[in,out] | ctx | EAC context |
[in] | id | accepts EAC_ID_PACE , EAC_ID_CA , EAC_ID_EAC |
BUF_MEM* EAC_decrypt | ( | const EAC_CTX * | ctx, |
const BUF_MEM * | data | ||
) |
Decrypt data according to TR-03110 F.2.
[in] | ctx | EAC context |
[in] | data | Data to decrypt |
BUF_MEM* EAC_encrypt | ( | const EAC_CTX * | ctx, |
const BUF_MEM * | data | ||
) |
Encrypts data according to TR-03110 F.2.
[in] | ctx | EAC context |
[in] | data | Data to encrypt |
BUF_MEM* EAC_hash_certificate_description | ( | const unsigned char * | cert_desc, |
size_t | cert_desc_len | ||
) |
Compute the hash of a CV certificate description.
The hash can then be compared to the hash contained in the corresponding CV certificate.
[in] | cert_desc | ASN1 encoded CV certificate description |
[in] | cert_desc_len | Length of cert_desc |
int EAC_increment_ssc | ( | const EAC_CTX * | ctx | ) |
Increment the Send Sequence Counter.
ctx |
BUF_MEM* EAC_remove_iso_pad | ( | const BUF_MEM * | padded | ) |
Remove ISO/IEC 9797-1 padding method 2 from a message.
[in] | padded | Padded message |
int EAC_reset_ssc | ( | const EAC_CTX * | ctx | ) |
Reset the Send Sequence Counter.
ctx |
int EAC_set_ssc | ( | const EAC_CTX * | ctx, |
unsigned long | ssc | ||
) |
Set the Send Sequence Counter.
ctx | |
ssc |
int EAC_verify_authentication | ( | const EAC_CTX * | ctx, |
const BUF_MEM * | data, | ||
const BUF_MEM * | mac | ||
) |
Verify authenticated data according to TR-03110 F.2.
[in] | ctx | EAC context |
[in] | data | Data to authenticate |
[in] | mac | The MAC that is going to be verified |