/* =========================================================================
 * Copyright (c) 2020 Qualcomm Technologies, Inc.
 * All Rights Reserved.
 * Confidential and Proprietary - Qualcomm Technologies, Inc.
 * =========================================================================
 */

#ifndef __CRYPTO_HWKM_TEST_VECTORS_H__
#define __CRYPTO_HWKM_TEST_VECTORS_H__

#include "CCipher.h"
#include "ICipher.h"
#include "IHWKeyFactory.h"
#include "CHmac.h"
#include "IHmac.h"
#include "ICrypto.h"

typedef struct
{
    const bool enabled;
    const uint32_t alg;
    const int32_t uid;
    const int32_t mode;
    const uint8_t* key;
    const size_t keylen;
    const uint8_t* pt;
    const uint8_t* ct;
    const size_t datalen;
    const uint8_t* iv;
    const size_t ivlen;

    // CCM specific parameters
    const uint8_t* nonce;
    const size_t noncelen;
    const uint32_t payloadlen;
    const uint32_t headerlen;
    const uint32_t maclen;
} hwkm_cipher_test_vector_t;

// AES-ECB Tests
static const uint8_t hwkm_ecb128_test_key[] = {
    0x4B, 0xCC, 0x7F, 0x18, 0x09, 0xE0, 0xC0, 0xB6,
    0x85, 0x4B, 0xD8, 0xE6, 0xEB, 0xF5, 0xCE, 0x66
};

static const uint8_t hwkm_ecb128_test_pt[] = {
    0xE2, 0xEA, 0x85, 0xC6, 0xAE, 0xFF, 0x1F, 0xB7,
    0xF1, 0x85, 0x69, 0x39, 0x01, 0x91, 0xCC, 0xAA
};

static const uint8_t hwkm_ecb128_test_ct[] = {
    0x25, 0x45, 0x95, 0x3B, 0x7B, 0xCA, 0x3E, 0xA0,
    0x6E, 0x2F, 0x13, 0xEE, 0xFD, 0xA0, 0x7D, 0x4A
};

static const uint8_t hwkm_ecb256_test_key[] = {
    0xB8, 0xE8, 0xC2, 0x68, 0x3C, 0xBD, 0x9D, 0xB7,
    0x7D, 0xE9, 0xA6, 0x57, 0xEC, 0xF2, 0xE2, 0x47,
    0x10, 0xF7, 0x7B, 0xEB, 0xC3, 0x18, 0x00, 0xEB,
    0x3E, 0x2F, 0xE7, 0x60, 0x4C, 0x85, 0x09, 0x46
};

static const uint8_t hwkm_ecb256_test_pt[] = {
    0xE9, 0xA9, 0xAD, 0xAD, 0x2A, 0xBA, 0x57, 0xB1,
    0x39, 0xB6, 0xA5, 0x1F, 0x09, 0x2A, 0x44, 0x6C
};

static const uint8_t hwkm_ecb256_test_ct[] = {
    0xC1, 0x8D, 0x6C, 0xC6, 0xEF, 0x37, 0x8F, 0x02,
    0xCD, 0x11, 0x48, 0xCF, 0x26, 0x23, 0x16, 0xA2
};

// AES-CBC Tests
static const uint8_t hwkm_cbc128_test_key[] = {
    0x02, 0x82, 0xD8, 0x5F, 0x5A, 0x3C, 0xB1, 0xA4,
    0x6B, 0x0C, 0x51, 0x49, 0x03, 0xE2, 0xF1, 0x36
};

static const uint8_t hwkm_cbc128_test_iv[] = {
    0xD3, 0xF7, 0x5A, 0xE7, 0xBE, 0xA6, 0xD3, 0x15,
    0xAA, 0x95, 0x14, 0x29, 0x29, 0x68, 0x76, 0x84
};

static const uint8_t hwkm_cbc128_test_pt[] = {
    0x24, 0xB3, 0xAE, 0x83, 0xAE, 0xB3, 0x09, 0xC9,
    0xA8, 0x34, 0x0B, 0x22, 0x81, 0x1A, 0x4B, 0xCA
};

static const uint8_t hwkm_cbc128_test_ct[] = {
    0x1B, 0xF1, 0x2E, 0x03, 0xCA, 0x89, 0x27, 0x41,
    0xA4, 0x83, 0x6F, 0x36, 0x5F, 0xF5, 0x8B, 0xD6
};

static const uint8_t hwkm_cbc256_test_key[] = {
    0x33, 0x88, 0x84, 0xF4, 0xF4, 0x47, 0xC9, 0x13,
    0xC8, 0x6E, 0x96, 0x8C, 0xF2, 0xB0, 0x32, 0xBC,
    0xE8, 0xF6, 0x8B, 0x74, 0x07, 0x57, 0x74, 0x5C,
    0x6B, 0xF8, 0xDF, 0x29, 0x17, 0x5E, 0xE5, 0xAD
};

static const uint8_t hwkm_cbc256_test_iv[] = {
    0x9E, 0x72, 0xE7, 0x8D, 0x5E, 0x26, 0xBD, 0x04,
    0xCD, 0xF4, 0xA9, 0xD4, 0x21, 0xCC, 0xD3, 0x86
};

static const uint8_t hwkm_cbc256_test_pt[] = {
    0x5B, 0xFA, 0x4F, 0xF1, 0x58, 0x70, 0xB0, 0x30,
    0xC9, 0x4A, 0xBF, 0xD3, 0x37, 0x25, 0x77, 0x9E
};

static const uint8_t hwkm_cbc256_test_ct[] = {
    0x58, 0xF6, 0x4B, 0x2C, 0x78, 0xFD, 0x30, 0x29,
    0xE7, 0xEF, 0xE5, 0xD3, 0x83, 0x29, 0xFC, 0xAD
};

// AES-CTR Tests
static const uint8_t hwkm_ctr128_test_key[] = {
    0xEA, 0x8E, 0x17, 0x0A, 0x2F, 0x1D, 0xE2, 0xE0,
    0x5F, 0x2B, 0x29, 0x96, 0xA7, 0xF9, 0x20, 0xFB
};

static const uint8_t hwkm_ctr128_test_iv[] = {
    0x6C, 0x1A, 0x22, 0x78, 0x9F, 0x91, 0x79, 0xB7,
    0xA4, 0x71, 0x3E, 0x79, 0x85, 0x2D, 0xF7, 0x27
};

static const uint8_t hwkm_ctr128_test_pt[] = {
    0x96, 0x0C, 0x83, 0xFA, 0x74, 0x53, 0xA8, 0xCC,
    0x0D, 0xD7, 0xB0, 0x47, 0x39, 0xCA, 0xD1, 0x8A
};

static const uint8_t hwkm_ctr128_test_ct[] = {
    0xF8, 0x9C, 0xC7, 0x47, 0x60, 0x20, 0x61, 0x07,
    0x75, 0x36, 0x6D, 0x2D, 0xC0, 0xB4, 0x05, 0xED
};

static const uint8_t hwkm_ctr256_test_key[] = {
    0xC7, 0x1F, 0xC1, 0x3D, 0xAE, 0x89, 0x04, 0xD3,
    0x07, 0x28, 0xCE, 0xCC, 0xB9, 0x21, 0xFC, 0x3E,
    0xD3, 0xC3, 0xBA, 0x39, 0x98, 0xFF, 0x45, 0x6B,
    0x7D, 0x57, 0x73, 0x7F, 0x53, 0xDA, 0x2A, 0x75
};

static const uint8_t hwkm_ctr256_test_iv[] = {
    0x3F, 0x18, 0xB3, 0x27, 0x4C, 0xEB, 0x32, 0xA1,
    0xCE, 0x1F, 0x73, 0x1A, 0xF2, 0xB3, 0xE3, 0x68
};

static const uint8_t hwkm_ctr256_test_pt[] = {
    0x93, 0x22, 0x2A, 0x37, 0x68, 0xB4, 0xCA, 0xF9,
    0x51, 0x4C, 0x27, 0x92, 0x57, 0xAF, 0xF8, 0x42
};

static const uint8_t hwkm_ctr256_test_ct[] = {
    0x30, 0x06, 0xB4, 0xA6, 0xCD, 0xF1, 0x6F, 0x97,
    0x0A, 0xAC, 0x98, 0x7E, 0x34, 0xA2, 0xAF, 0x69
};

// TDES-ECB tests
static const uint8_t hwkm_tdes_ecb_test_key[] = {
    0x93, 0x86, 0x60, 0xF8, 0x2C, 0xEF, 0xA0, 0x3E,
    0x1C, 0x57, 0xB2, 0x15, 0x5C, 0x5B, 0x35, 0x29,
    0xFF, 0x86, 0x77, 0x1C, 0xA3, 0x79, 0xDB, 0xE3
};

static const uint8_t hwkm_tdes_ecb_test_pt[] = {
    0xB4, 0x05, 0xD4, 0x98, 0x79, 0x7D, 0x65, 0x63
};

static const uint8_t hwkm_tdes_ecb_test_ct[] = {
    0x3D, 0x59, 0x07, 0xEA, 0xD2, 0xE1, 0xF7, 0xFD
};

// TDES-CBC tests
static const uint8_t hwkm_tdes_cbc_test_key[] = {
    0x2C, 0x60, 0xAC, 0x43, 0x56, 0x03, 0xBC, 0xEC,
    0xDD, 0xEA, 0xDC, 0xF4, 0xAB, 0xEE, 0x91, 0xCA,
    0xFC, 0x94, 0xBA, 0x5A, 0x7E, 0x23, 0x86, 0x18
};

static const uint8_t hwkm_tdes_cbc_test_iv[] = {
    0xF8, 0xE9, 0x44, 0x4F, 0xB7, 0xE5, 0x30, 0xF8
};

static const uint8_t hwkm_tdes_cbc_test_pt[] = {
    0x8E, 0x13, 0xFC, 0xF2, 0xDD, 0xA0, 0xB0, 0x0F
};

static const uint8_t hwkm_tdes_cbc_test_ct[] = {
    0x5E, 0xFE, 0xD6, 0xD4, 0x87, 0xE6, 0x34, 0x54
};

// AES-CCM tests
static const uint8_t hwkm_ccm128_test_iv[] =
{
   0x07, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const uint8_t hwkm_ccm128_test_key[] =
{
   0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
   0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
};

static const uint8_t hwkm_ccm128_test_nonce[] =
{
   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16
};

static const uint8_t hwkm_ccm128_test_pt[] =
{
   0x00, 0x00,
   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x20, 0x21, 0x22, 0x23,
};

static const uint8_t hwkm_ccm128_test_ct[] =
{
   0x00, 0x00,
   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x71, 0x62, 0x01, 0x5b,
   0x4d, 0xac, 0x25, 0x5d
};

static const uint8_t hwkm_ccm256_test_iv[] =
{
   0x07, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

static const uint8_t hwkm_ccm256_test_key[] =
{
   0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
   0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
   0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
   0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f
};

static const uint8_t hwkm_ccm256_test_nonce[] =
{
   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16
};

static const uint8_t hwkm_ccm256_test_pt[] =
{
   0x00, 0x00,
   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x20, 0x21, 0x22, 0x23,
};

static const uint8_t hwkm_ccm256_test_ct[] =
{
   0x00, 0x00,
   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0xd0, 0xb5, 0x4a, 0x05,
   0x45, 0x50, 0xab, 0xab,
};

static const hwkm_cipher_test_vector_t hwkm_cipher_test_vectors[] = {
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES128_ECB,
    .uid = CCipherAES128_UID,
    .mode = ICipher_MODE_ECB,
    .key = hwkm_ecb128_test_key,
    .keylen = sizeof(hwkm_ecb128_test_key),
    .pt = hwkm_ecb128_test_pt,
    .ct = hwkm_ecb128_test_ct,
    .datalen = sizeof(hwkm_ecb128_test_pt),
    .iv = NULL,
    .ivlen = 0,
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES256_ECB,
    .uid = CCipherAES256_UID,
    .mode = ICipher_MODE_ECB,
    .key = hwkm_ecb256_test_key,
    .keylen = sizeof(hwkm_ecb256_test_key),
    .pt = hwkm_ecb256_test_pt,
    .ct = hwkm_ecb256_test_ct,
    .datalen = sizeof(hwkm_ecb256_test_pt),
    .iv = NULL,
    .ivlen = 0,
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES128_CBC,
    .uid = CCipherAES128_UID,
    .mode = ICipher_MODE_CBC,
    .key = hwkm_cbc128_test_key,
    .keylen = sizeof(hwkm_cbc128_test_key),
    .pt = hwkm_cbc128_test_pt,
    .ct = hwkm_cbc128_test_ct,
    .datalen = sizeof(hwkm_cbc128_test_pt),
    .iv = hwkm_cbc128_test_iv,
    .ivlen = sizeof(hwkm_cbc128_test_iv),
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES256_CBC,
    .uid = CCipherAES256_UID,
    .mode = ICipher_MODE_CBC,
    .key = hwkm_cbc256_test_key,
    .keylen = sizeof(hwkm_cbc256_test_key),
    .pt = hwkm_cbc256_test_pt,
    .ct = hwkm_cbc256_test_ct,
    .datalen = sizeof(hwkm_cbc256_test_pt),
    .iv = hwkm_cbc256_test_iv,
    .ivlen = sizeof(hwkm_cbc256_test_iv),
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES128_CTR,
    .uid = CCipherAES128_UID,
    .mode = ICipher_MODE_CTR,
    .key = hwkm_ctr128_test_key,
    .keylen = sizeof(hwkm_ctr128_test_key),
    .pt = hwkm_ctr128_test_pt,
    .ct = hwkm_ctr128_test_ct,
    .datalen = sizeof(hwkm_ctr128_test_pt),
    .iv = hwkm_ctr128_test_iv,
    .ivlen = sizeof(hwkm_ctr128_test_iv),
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES256_CTR,
    .uid = CCipherAES256_UID,
    .mode = ICipher_MODE_CTR,
    .key = hwkm_ctr256_test_key,
    .keylen = sizeof(hwkm_ctr256_test_key),
    .pt = hwkm_ctr256_test_pt,
    .ct = hwkm_ctr256_test_ct,
    .datalen = sizeof(hwkm_ctr256_test_pt),
    .iv = hwkm_ctr256_test_iv,
    .ivlen = sizeof(hwkm_ctr256_test_iv),
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_TDES_ECB,
    .uid = CCipherTripleDES_UID,
    .mode = ICipher_MODE_ECB,
    .key = hwkm_tdes_ecb_test_key,
    .keylen = sizeof(hwkm_tdes_ecb_test_key),
    .pt = hwkm_tdes_ecb_test_pt,
    .ct = hwkm_tdes_ecb_test_ct,
    .datalen = sizeof(hwkm_tdes_ecb_test_pt),
    .iv = NULL,
    .ivlen = 0,
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_TDES_CBC,
    .uid = CCipherTripleDES_UID,
    .mode = ICipher_MODE_CBC,
    .key = hwkm_tdes_cbc_test_key,
    .keylen = sizeof(hwkm_tdes_cbc_test_key),
    .pt = hwkm_tdes_cbc_test_pt,
    .ct = hwkm_tdes_cbc_test_ct,
    .datalen = sizeof(hwkm_tdes_cbc_test_pt),
    .iv = hwkm_tdes_cbc_test_iv,
    .ivlen = sizeof(hwkm_tdes_cbc_test_iv),
    .payloadlen = 0,
    .headerlen = 0,
    .maclen = 0
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES128_CCM,
    .uid = CCipherAES128_UID,
    .mode = ICipher_MODE_CCM,
    .key = hwkm_ccm128_test_key,
    .keylen = sizeof(hwkm_ccm128_test_key),
    .pt = hwkm_ccm128_test_pt,
    .ct = hwkm_ccm128_test_ct,
    .datalen = sizeof(hwkm_ccm128_test_pt),
    .iv = hwkm_ccm128_test_iv,
    .ivlen = sizeof(hwkm_ccm128_test_iv),
    .nonce = hwkm_ccm128_test_nonce,
    .noncelen = sizeof(hwkm_ccm128_test_nonce),
    .payloadlen = 4,
    .headerlen = 8,
    .maclen = 4
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES256_CCM,
    .uid = CCipherAES256_UID,
    .mode = ICipher_MODE_CCM,
    .key = hwkm_ccm256_test_key,
    .keylen = sizeof(hwkm_ccm256_test_key),
    .pt = hwkm_ccm256_test_pt,
    .ct = hwkm_ccm256_test_ct,
    .datalen = sizeof(hwkm_ccm256_test_pt),
    .iv = hwkm_ccm256_test_iv,
    .ivlen = sizeof(hwkm_ccm256_test_iv),
    .nonce = hwkm_ccm256_test_nonce,
    .noncelen = sizeof(hwkm_ccm256_test_nonce),
    .payloadlen = 4,
    .headerlen = 8,
    .maclen = 4
}
};

typedef struct
{
    const bool enabled;
    const uint32_t alg;
    const int32_t uid;
    const uint8_t* key;
    const size_t keylen;
    const uint8_t* msg;
    const size_t msglen;
    const uint8_t* digest;
    const size_t digestlen;
} hwkm_hmac_test_vector_t;

static const uint8_t hwkm_hmac_sha1_test_key[] =
{
    0x36
};

static const uint8_t hwkm_hmac_sha1_test_msg[] =
{
    0x75, 0x32, 0xDB, 0x28, 0x43, 0x64, 0xBD, 0xE0,
    0x40, 0x0C, 0xA7, 0x7E, 0xF8, 0x09, 0x9C, 0xA7
};

static const uint8_t hwkm_hmac_sha1_test_digest[] =
{
    0xE4, 0x68, 0x1A, 0xAE, 0x84, 0x51, 0xC9, 0xFF,
    0x99, 0x01, 0xD8, 0x87, 0x96, 0x77, 0xCA, 0xD7,
    0x15, 0x3B, 0x35, 0x23
};

static const uint8_t hwkm_hmac_sha256_test_key[] =
{
    0xA1
};

static const uint8_t hwkm_hmac_sha256_test_msg[] =
{
    0xD6, 0xE8, 0xD8, 0x99, 0x35, 0x60, 0xB6, 0x89,
    0xF5, 0x1A, 0x98, 0x68, 0xE1, 0xD9, 0xD7, 0xA4
};

static const uint8_t hwkm_hmac_sha256_test_digest[] =
{
    0x4A, 0xFA, 0x9A, 0x4C, 0x65, 0x7D, 0xBA, 0x0D,
    0x51, 0xAB, 0xF8, 0xC5, 0x4C, 0x13, 0x42, 0xAD,
    0x0E, 0x32, 0xE7, 0xD1, 0xF7, 0x42, 0x7C, 0xBC,
    0x7F, 0xAF, 0xF2, 0x3C, 0xE6, 0xF8, 0x31, 0xC5
};

static const hwkm_hmac_test_vector_t hwkm_hmac_test_vectors[] = {
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_SHA1_HMAC,
    .uid = CHmacSHA1_UID,
    .key = hwkm_hmac_sha1_test_key,
    .keylen = sizeof(hwkm_hmac_sha1_test_key),
    .msg = hwkm_hmac_sha1_test_msg,
    .msglen = sizeof(hwkm_hmac_sha1_test_msg),
    .digest = hwkm_hmac_sha1_test_digest,
    .digestlen = sizeof(hwkm_hmac_sha1_test_digest)
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_SHA256_HMAC,
    .uid = CHmacSHA256_UID,
    .key = hwkm_hmac_sha256_test_key,
    .keylen = sizeof(hwkm_hmac_sha256_test_key),
    .msg = hwkm_hmac_sha256_test_msg,
    .msglen = sizeof(hwkm_hmac_sha256_test_msg),
    .digest = hwkm_hmac_sha256_test_digest,
    .digestlen = sizeof(hwkm_hmac_sha256_test_digest)
}
};

typedef struct
{
    const bool enabled;
    const uint32_t alg;
    const int32_t cmac_alg;
    const uint8_t* key;
    const size_t keylen;
    const uint8_t* msg;
    const size_t msglen;
    const uint8_t* digest;
    const size_t digestlen;
} hwkm_cmac_test_vector_t;

static const uint8_t hwkm_cmac_aes128_test_key[] =
{
    0xD5, 0x54, 0x4E, 0x72, 0x63, 0x28, 0x1C, 0xEF,
    0x84, 0x1E, 0x76, 0xBA, 0x47, 0x24, 0x6C, 0x88
};

static const uint8_t hwkm_cmac_aes128_test_msg[] =
{
    0x33, 0x76, 0x93, 0x4D, 0x75, 0xCB, 0xB3, 0x6A,
    0x47, 0xC8, 0xAA, 0x38, 0xAA, 0x66, 0xD4, 0x00
};

static const uint8_t hwkm_cmac_aes128_test_digest[] =
{
    0x12, 0xE5, 0x94, 0x28, 0x0B, 0x86, 0x06, 0x95,
    0x5F, 0x0C, 0x12, 0xD4, 0xDF, 0x3C, 0x84, 0x86
};

static const uint8_t hwkm_cmac_aes256_test_key[] =
{
    0xAF, 0xEC, 0xA2, 0x8B, 0x41, 0xA2, 0x22, 0x02,
    0xFA, 0xF4, 0x71, 0x23, 0x48, 0xE1, 0x8C, 0xC7,
    0xD6, 0x51, 0xC2, 0x6C, 0xD1, 0x70, 0x01, 0x59,
    0xCC, 0x12, 0x09, 0x22, 0x4F, 0xBB, 0xFD, 0x9C
};

static const uint8_t hwkm_cmac_aes256_test_msg[] =
{
    0xEC, 0x86, 0x5D, 0xBE, 0x4A, 0x9D, 0xF3, 0x14,
    0xCC, 0xF0, 0x2A, 0x0A, 0x3F, 0xD1, 0x0E, 0x1F
};

static const uint8_t hwkm_cmac_aes256_test_digest[] =
{
    0xF7, 0x7A, 0xB5, 0x44, 0xEA, 0xA7, 0xCE, 0x72,
    0xDA, 0x20, 0x27, 0x6D, 0xD2, 0xD2, 0xA6, 0x81
};

static const hwkm_cmac_test_vector_t hwkm_cmac_test_vectors[] = {
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES128_CMAC,
    .cmac_alg = ICrypto_CMAC_ALGO_AES_128,
    .key = hwkm_cmac_aes128_test_key,
    .keylen = sizeof(hwkm_cmac_aes128_test_key),
    .msg = hwkm_cmac_aes128_test_msg,
    .msglen = sizeof(hwkm_cmac_aes128_test_msg),
    .digest = hwkm_cmac_aes128_test_digest,
    .digestlen = sizeof(hwkm_cmac_aes128_test_digest)
},
{
    .enabled = true,
    .alg = IHWKey_ALGORITHM_AES256_CMAC,
    .cmac_alg = ICrypto_CMAC_ALGO_AES_256,
    .key = hwkm_cmac_aes256_test_key,
    .keylen = sizeof(hwkm_cmac_aes256_test_key),
    .msg = hwkm_cmac_aes256_test_msg,
    .msglen = sizeof(hwkm_cmac_aes256_test_msg),
    .digest = hwkm_cmac_aes256_test_digest,
    .digestlen = sizeof(hwkm_cmac_aes256_test_digest)
}
};

#endif
