LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
logicalaccess::openssl::CMACCrypto Class Reference

#include <cmac.hpp>

Public Member Functions

 CMACCrypto ()
 
 ~CMACCrypto ()
 

Static Public Member Functions

static ByteVector cmac (const ByteVector &key, std::string crypto, const ByteVector &data, const ByteVector &iv={}, int padding_size=0)
 
static ByteVector cmac (const ByteVector &key, std::shared_ptr< SymmetricCipher > cipherMAC, const ByteVector &data, const ByteVector &lastIV={}, unsigned int padding_size=0, bool forceK2Use=false)
 Return data part for the encrypted communication mode.
 
static ByteVector cmac_iks (const std::string &iks_key_name, const ByteVector &data, const ByteVector &lastIv, unsigned int padding_size, const std::shared_ptr< RemoteCrypto > &remote_crypto)
 
static ByteVector shift_string (const ByteVector &buf, unsigned char xorparam=0x00)
 Shift a string.
 

Detailed Description

NIST SP 800-38B / ISO 9797-1:2011 MAC Algorithm 5

Constructor & Destructor Documentation

◆ CMACCrypto()

logicalaccess::openssl::CMACCrypto::CMACCrypto ( )
inline

◆ ~CMACCrypto()

logicalaccess::openssl::CMACCrypto::~CMACCrypto ( )
inline

Member Function Documentation

◆ cmac() [1/2]

ByteVector logicalaccess::openssl::CMACCrypto::cmac ( const ByteVector key,
std::shared_ptr< SymmetricCipher cipherMAC,
const ByteVector data,
const ByteVector lastIV = {},
unsigned int  padding_size = 0,
bool  forceK2Use = false 
)
static

Return data part for the encrypted communication mode.

Parameters
keyThe key to use, shall be the session key from the previous authentication
cipherThe cypher to use
dataThe data source buffer to calculate MAC
lastIVThe last initialisation vector
Returns
The MAC result for the message.

◆ cmac() [2/2]

ByteVector logicalaccess::openssl::CMACCrypto::cmac ( const ByteVector key,
std::string  crypto,
const ByteVector data,
const ByteVector iv = {},
int  padding_size = 0 
)
static

◆ cmac_iks()

ByteVector logicalaccess::openssl::CMACCrypto::cmac_iks ( const std::string &  iks_key_name,
const ByteVector data,
const ByteVector lastIv,
unsigned int  padding_size,
const std::shared_ptr< RemoteCrypto > &  remote_crypto 
)
static

CMAC computation that delegates AES encryption to IKS.

Parameters
iks_key_name
data
iv
padding_size
Returns

◆ shift_string()

ByteVector logicalaccess::openssl::CMACCrypto::shift_string ( const ByteVector buf,
unsigned char  xorparam = 0x00 
)
static

Shift a string.

Parameters
bufThe buffer string
xorparamThe optional xor for the string.

The documentation for this class was generated from the following files: