add get key size function
This commit is contained in:
1 parent
850e36ab31
commit
7af924eadd
2 files changed
+19
No files matched your search
@@ -407,6 +407,24 @@ size_t key_block_size(const desfirekey_t key) {
|
||||
return block_size;
|
||||
}
|
||||
|
||||
size_t key_size(const enum DESFIRE_CRYPTOALGO algo) {
|
||||
switch (algo) {
|
||||
case T_DES:
|
||||
return 8;
|
||||
break;
|
||||
case T_3DES:
|
||||
return 16;
|
||||
break;
|
||||
case T_3K3DES:
|
||||
return 24;
|
||||
break;
|
||||
case T_AES:
|
||||
return 16;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Size of MACing produced with the key.
|
||||
*/
|
||||
|
||||
@@ -126,6 +126,7 @@ void *mifare_cryto_postprocess_data(desfiretag_t tag, void *data, size_t *nbytes
|
||||
void mifare_cypher_single_block(desfirekey_t key, uint8_t *data, uint8_t *ivect, MifareCryptoDirection direction, MifareCryptoOperation operation, size_t block_size);
|
||||
void mifare_cypher_blocks_chained(desfiretag_t tag, desfirekey_t key, uint8_t *ivect, uint8_t *data, size_t data_size, MifareCryptoDirection direction, MifareCryptoOperation operation);
|
||||
size_t key_block_size(const desfirekey_t key);
|
||||
size_t key_size(const enum DESFIRE_CRYPTOALGO algo);
|
||||
size_t padded_data_length(const size_t nbytes, const size_t block_size);
|
||||
size_t maced_data_length(const desfirekey_t key, const size_t nbytes);
|
||||
size_t enciphered_data_length(const desfiretag_t tag, const size_t nbytes, int communication_settings);
|
||||
|
||||
Reference in new issue
Block a user