/*
@file crypto_hash_test_vectors.h
@brief This file contains all common definitions used in apt crypto test app
*/
/*===========================================================================
   Copyright (c) {2011, 2021, 2023} by Qualcomm Technologies, Incorporated.  All Rights Reserved.
===========================================================================*/

/*===========================================================================

                            EDIT HISTORY FOR FILE

# when       who     what, where, why
# --------   ---     ---------------------------------------------------------
8/19/2015   vinitp   created a header file for testing HASH APIs
===========================================================================*/
#ifndef __CRYPTO_HASH_TEST_VECTORS_H__
#define __CRYPTO_HASH_TEST_VECTORS_H__

#include "qsee_cipher.h"
#include "qsee_hash.h"
#include "qsee_uf_sha.h"
#include "crypto_common_test_vectors.h"
#include "object.h"
#include "IEnv.h"
#include "IHash.h"
#include "ICipher.h"
#include "qsee_prng.h"

#define TZ_HASH_STRESS_MAX  10000

/* SHA 1 test vectors */
//NULL string
static UINT8_A sha_plain_text_0[] =
{
   ""
};
static UINT8_A sha1_digest_text_0[] =
{
   0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d,
   0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90,
   0xaf, 0xd8, 0x07, 0x09
};
static UINT8_A sha256_digest_text_0[] =
{
   0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14,
   0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24,
   0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c,
   0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55
};
static UINT8_A sha224_digest_text_0[] =
{
   0xd1, 0x4a, 0x02, 0x8c, 0x2a, 0x3a, 0x2b, 0xc9,
   0x47, 0x61, 0x02, 0xbb, 0x28, 0x82, 0x34, 0xc4,
   0x15, 0xa2, 0xb0, 0x1f, 0x82, 0x8e, 0xa6, 0x2a,
   0xc5, 0xb3, 0xe4, 0x2f
};
static UINT8_A sha384_digest_text_0[] =
{
   0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38,
   0x4c, 0xd9, 0x32, 0x7e, 0xb1, 0xb1, 0xe3, 0x6a,
   0x21, 0xfd, 0xb7, 0x11, 0x14, 0xbe, 0x07, 0x43,
   0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda,
   0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb,
   0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b
};
static UINT8_A sha512_digest_text_0[] =
{
   0xcf, 0x83, 0xe1, 0x35, 0x7e, 0xef, 0xb8, 0xbd,
   0xf1, 0x54, 0x28, 0x50, 0xd6, 0x6d, 0x80, 0x07,
   0xd6, 0x20, 0xe4, 0x05, 0x0b, 0x57, 0x15, 0xdc,
   0x83, 0xf4, 0xa9, 0x21, 0xd3, 0x6c, 0xe9, 0xce,
   0x47, 0xd0, 0xd1, 0x3c, 0x5d, 0x85, 0xf2, 0xb0,
   0xff, 0x83, 0x18, 0xd2, 0x87, 0x7e, 0xec, 0x2f,
   0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a, 0x81,
   0xa5, 0x38, 0x32, 0x7a, 0xf9, 0x27, 0xda, 0x3e
};
static UINT8_A md5_digest_text_0[] =
{
   0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,
   0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e
};

//"Test vector from febooti.com"
static UINT8_A sha_plain_text_1[] =
{
   "Test vector from febooti.com"
};
static UINT8_A sha1_digest_text_1[] =
{
   0xa7, 0x63, 0x17, 0x95, 0xf6, 0xd5, 0x9c, 0xd6,
   0xd1, 0x4e, 0xbd, 0x00, 0x58, 0xa6, 0x39, 0x4a,
   0x4b, 0x93, 0xd8, 0x68
};
static UINT8_A sha256_digest_text_1[] =
{
   0x07, 0x7b, 0x18, 0xfe, 0x29, 0x03, 0x6a, 0xda,
   0x48, 0x90, 0xbd, 0xec, 0x19, 0x21, 0x86, 0xe1,
   0x06, 0x78, 0x59, 0x7a, 0x67, 0x88, 0x02, 0x90,
   0x52, 0x1d, 0xf7, 0x0d, 0xf4, 0xba, 0xc9, 0xab
};
static UINT8_A sha224_digest_text_1[] =
{
   0x36, 0x28, 0xb4, 0x02, 0x25, 0x4c, 0xaa, 0x96,
   0x82, 0x7e, 0x3c, 0x79, 0xc0, 0xa5, 0x59, 0xe4,
   0x55, 0x8d, 0xa8, 0xee, 0x2b, 0x65, 0xf1, 0x49,
   0x65, 0x78, 0x13, 0x7d
};
static UINT8_A sha384_digest_text_1[] =
{
   0x38, 0x8b, 0xb2, 0xd4, 0x87, 0xde, 0x48, 0x74,
   0x0f, 0x45, 0xfc, 0xb4, 0x41, 0x52, 0xb0, 0xb6,
   0x65, 0x42, 0x8c, 0x49, 0xde, 0xf1, 0xaa, 0xf7,
   0xc7, 0xf0, 0x9a, 0x40, 0xc1, 0x0a, 0xff, 0x1c,
   0xd7, 0xc3, 0xfe, 0x33, 0x25, 0x19, 0x3c, 0x4d,
   0xd3, 0x5d, 0x4e, 0xaa, 0x03, 0x2f, 0x49, 0xb0
};
static UINT8_A sha512_digest_text_1[] =
{
   0x09, 0xfb, 0x89, 0x8b, 0xc9, 0x73, 0x19, 0xa2,
   0x43, 0xa6, 0x3f, 0x69, 0x71, 0x74, 0x7f, 0x8e,
   0x10, 0x24, 0x81, 0xfb, 0x8d, 0x53, 0x46, 0xc5,
   0x5c, 0xb4, 0x48, 0x55, 0xad, 0xc2, 0xe0, 0xe9,
   0x8f, 0x30, 0x4e, 0x55, 0x2b, 0x0d, 0xb1, 0xd4,
   0xee, 0xba, 0x8a, 0x5c, 0x87, 0x79, 0xf6, 0xa3,
   0x01, 0x0f, 0x0e, 0x1a, 0x2b, 0xeb, 0x5b, 0x95,
   0x47, 0xa1, 0x3b, 0x6e, 0xdc, 0xa1, 0x1e, 0x8a
};
static UINT8_A md5_digest_text_1[] =
{
   0x50, 0x0a, 0xb6, 0x61, 0x3c, 0x6d, 0xb7, 0xfb,
   0xd3, 0x0c, 0x62, 0xf5, 0xff, 0x57, 0x3d, 0x0f
};

//"abc"
static UINT8_A sha_plain_text_2[] =
{
   "abc" //0x61, 0x62, 0x63 //"abc"
};
static UINT8_A sha1_digest_text_2[] =
{
   0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a,
   0xba, 0x3e, 0x25, 0x71, 0x78, 0x50, 0xc2, 0x6c,
   0x9c, 0xd0, 0xd8, 0x9d
};
static UINT8_A sha256_digest_text_2[] =
{
   0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
   0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
   0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
   0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad
};
static UINT8_A sha224_digest_text_2[] =
{
   0x23, 0x09, 0x7d, 0x22, 0x34, 0x05, 0xd8, 0x22,
   0x86, 0x42, 0xa4, 0x77, 0xbd, 0xa2, 0x55, 0xb3,
   0x2a, 0xad, 0xbc, 0xe4, 0xbd, 0xa0, 0xb3, 0xf7,
   0xe3, 0x6c, 0x9d, 0xa7
};
static UINT8_A sha384_digest_text_2[] =
{
   0xcb, 0x00, 0x75, 0x3f, 0x45, 0xa3, 0x5e, 0x8b,
   0xb5, 0xa0, 0x3d, 0x69, 0x9a, 0xc6, 0x50, 0x07,
   0x27, 0x2c, 0x32, 0xab, 0x0e, 0xde, 0xd1, 0x63,
   0x1a, 0x8b, 0x60, 0x5a, 0x43, 0xff, 0x5b, 0xed,
   0x80, 0x86, 0x07, 0x2b, 0xa1, 0xe7, 0xcc, 0x23,
   0x58, 0xba, 0xec, 0xa1, 0x34, 0xc8, 0x25, 0xa7
};
static UINT8_A sha512_digest_text_2[] =
{
   0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba,
   0xcc, 0x41, 0x73, 0x49, 0xae, 0x20, 0x41, 0x31,
   0x12, 0xe6, 0xfa, 0x4e, 0x89, 0xa9, 0x7e, 0xa2,
   0x0a, 0x9e, 0xee, 0xe6, 0x4b, 0x55, 0xd3, 0x9a,
   0x21, 0x92, 0x99, 0x2a, 0x27, 0x4f, 0xc1, 0xa8,
   0x36, 0xba, 0x3c, 0x23, 0xa3, 0xfe, 0xeb, 0xbd,
   0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8, 0x0e,
   0x2a, 0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f
};
static UINT8_A md5_digest_text_2[] =
{
   0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0,
   0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72
};

//"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
static UINT8_A sha_plain_text_3[] =
{
   "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
};
static UINT8_A sha1_digest_text_3[] =
{
   0x84, 0x98, 0x3e, 0x44, 0x1c, 0x3b, 0xd2, 0x6e,
   0xba, 0xae, 0x4a, 0xa1, 0xf9, 0x51, 0x29, 0xe5,
   0xe5, 0x46, 0x70, 0xf1
};
static UINT8_A sha256_digest_text_3[] =
{
   0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
   0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
   0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
   0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1
};
static UINT8_A sha224_digest_text_3[] =
{
   0x75, 0x38, 0x8b, 0x16, 0x51, 0x27, 0x76, 0xcc,
   0x5d, 0xba, 0x5d, 0xa1, 0xfd, 0x89, 0x01, 0x50,
   0xb0, 0xc6, 0x45, 0x5c, 0xb4, 0xf5, 0x8b, 0x19,
   0x52, 0x52, 0x25, 0x25
};
static UINT8_A sha384_digest_text_3[] =
{
   0x33, 0x91, 0xfd, 0xdd, 0xfc, 0x8d, 0xc7, 0x39,
   0x37, 0x07, 0xa6, 0x5b, 0x1b, 0x47, 0x09, 0x39,
   0x7c, 0xf8, 0xb1, 0xd1, 0x62, 0xaf, 0x05, 0xab,
   0xfe, 0x8f, 0x45, 0x0d, 0xe5, 0xf3, 0x6b, 0xc6,
   0xb0, 0x45, 0x5a, 0x85, 0x20, 0xbc, 0x4e, 0x6f,
   0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b
};
static UINT8_A sha512_digest_text_3[] =
{
   0x20, 0x4a, 0x8f, 0xc6, 0xdd, 0xa8, 0x2f, 0x0a,
   0x0c, 0xed, 0x7b, 0xeb, 0x8e, 0x08, 0xa4, 0x16,
   0x57, 0xc1, 0x6e, 0xf4, 0x68, 0xb2, 0x28, 0xa8,
   0x27, 0x9b, 0xe3, 0x31, 0xa7, 0x03, 0xc3, 0x35,
   0x96, 0xfd, 0x15, 0xc1, 0x3b, 0x1b, 0x07, 0xf9,
   0xaa, 0x1d, 0x3b, 0xea, 0x57, 0x78, 0x9c, 0xa0,
   0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7, 0x03,
   0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45
};
static UINT8_A md5_digest_text_3[] =
{
   0x82, 0x15, 0xef, 0x07, 0x96, 0xa2, 0x0b, 0xca,
   0xaa, 0xe1, 0x16, 0xd3, 0x87, 0x6c, 0x66, 0x4a
};

//"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
static UINT8_A sha_plain_text_4[] =
{
   "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
};
static UINT8_A sha1_digest_text_4[] =
{
   0xa4, 0x9b, 0x24, 0x46, 0xa0, 0x2c, 0x64, 0x5b,
   0xf4, 0x19, 0xf9, 0x95, 0xb6, 0x70, 0x91, 0x25,
   0x3a, 0x04, 0xa2, 0x59
};
static UINT8_A sha256_digest_text_4[] =
{
   0xcf, 0x5b, 0x16, 0xa7, 0x78, 0xaf, 0x83, 0x80,
   0x03, 0x6c, 0xe5, 0x9e, 0x7b, 0x04, 0x92, 0x37,
   0x0b, 0x24, 0x9b, 0x11, 0xe8, 0xf0, 0x7a, 0x51,
   0xaf, 0xac, 0x45, 0x03, 0x7a, 0xfe, 0xe9, 0xd1
};
static UINT8_A sha224_digest_text_4[] =
{
   0xc9, 0x7c, 0xa9, 0xa5, 0x59, 0x85, 0x0c, 0xe9,
   0x7a, 0x04, 0xa9, 0x6d, 0xef, 0x6d, 0x99, 0xa9,
   0xe0, 0xe0, 0xe2, 0xab, 0x14, 0xe6, 0xb8, 0xdf,
   0x26, 0x5f, 0xc0, 0xb3
};
static UINT8_A sha384_digest_text_4[] =
{
   0x09, 0x33, 0x0c, 0x33, 0xf7, 0x11, 0x47, 0xe8,
   0x3d, 0x19, 0x2f, 0xc7, 0x82, 0xcd, 0x1b, 0x47,
   0x53, 0x11, 0x1b, 0x17, 0x3b, 0x3b, 0x05, 0xd2,
   0x2f, 0xa0, 0x80, 0x86, 0xe3, 0xb0, 0xf7, 0x12,
   0xfc, 0xc7, 0xc7, 0x1a, 0x55, 0x7e, 0x2d, 0xb9,
   0x66, 0xc3, 0xe9, 0xfa, 0x91, 0x74, 0x60, 0x39
};
static UINT8_A sha512_digest_text_4[] =
{
   0x8e, 0x95, 0x9b, 0x75, 0xda, 0xe3, 0x13, 0xda,
   0x8c, 0xf4, 0xf7, 0x28, 0x14, 0xfc, 0x14, 0x3f,
   0x8f, 0x77, 0x79, 0xc6, 0xeb, 0x9f, 0x7f, 0xa1,
   0x72, 0x99, 0xae, 0xad, 0xb6, 0x88, 0x90, 0x18,
   0x50, 0x1d, 0x28, 0x9e, 0x49, 0x00, 0xf7, 0xe4,
   0x33, 0x1b, 0x99, 0xde, 0xc4, 0xb5, 0x43, 0x3a,
   0xc7, 0xd3, 0x29, 0xee, 0xb6, 0xdd, 0x26, 0x54,
   0x5e, 0x96, 0xe5, 0x5b, 0x87, 0x4b, 0xe9, 0x09
};
static UINT8_A md5_digest_text_4[] =
{
   0x03, 0xdd, 0x88, 0x07, 0xa9, 0x31, 0x75, 0xfb,
   0x06, 0x2d, 0xfb, 0x55, 0xdc, 0x7d, 0x35, 0x9c
};

//"a" repeated 1000000 times
static UINT8_A sha_plain_text_large_0[] =
{
   "a"
};
static UINT8_A sha1_digest_text_large_0[] =
{
   0x34, 0xaa, 0x97, 0x3c, 0xd4, 0xc4, 0xda, 0xa4,
   0xf6, 0x1e, 0xeb, 0x2b, 0xdb, 0xad, 0x27, 0x31,
   0x65, 0x34, 0x01, 0x6f
};
static UINT8_A sha256_digest_text_large_0[] =
{
   0xcd, 0xc7, 0x6e, 0x5c, 0x99, 0x14, 0xfb, 0x92,
   0x81, 0xa1, 0xc7, 0xe2, 0x84, 0xd7, 0x3e, 0x67,
   0xf1, 0x80, 0x9a, 0x48, 0xa4, 0x97, 0x20, 0x0e,
   0x04, 0x6d, 0x39, 0xcc, 0xc7, 0x11, 0x2c, 0xd0
};
static UINT8_A sha224_digest_text_large_0[] =
{
   0x20, 0x79, 0x46, 0x55, 0x98, 0x0c, 0x91, 0xd8,
   0xbb, 0xb4, 0xc1, 0xea, 0x97, 0x61, 0x8a, 0x4b,
   0xf0, 0x3f, 0x42, 0x58, 0x19, 0x48, 0xb2, 0xee,
   0x4e, 0xe7, 0xad, 0x67
};
static UINT8_A sha384_digest_text_large_0[] =
{
   0x9d, 0x0e, 0x18, 0x09, 0x71, 0x64, 0x74, 0xcb,
   0x08, 0x6e, 0x83, 0x4e, 0x31, 0x0a, 0x4a, 0x1c,
   0xed, 0x14, 0x9e, 0x9c, 0x00, 0xf2, 0x48, 0x52,
   0x79, 0x72, 0xce, 0xc5, 0x70, 0x4c, 0x2a, 0x5b,
   0x07, 0xb8, 0xb3, 0xdc, 0x38, 0xec, 0xc4, 0xeb,
   0xae, 0x97, 0xdd, 0xd8, 0x7f, 0x3d, 0x89, 0x85
};
static UINT8_A sha512_digest_text_large_0[] =
{
   0xe7, 0x18, 0x48, 0x3d, 0x0c, 0xe7, 0x69, 0x64,
   0x4e, 0x2e, 0x42, 0xc7, 0xbc, 0x15, 0xb4, 0x63,
   0x8e, 0x1f, 0x98, 0xb1, 0x3b, 0x20, 0x44, 0x28,
   0x56, 0x32, 0xa8, 0x03, 0xaf, 0xa9, 0x73, 0xeb,
   0xde, 0x0f, 0xf2, 0x44, 0x87, 0x7e, 0xa6, 0x0a,
   0x4c, 0xb0, 0x43, 0x2c, 0xe5, 0x77, 0xc3, 0x1b,
   0xeb, 0x00, 0x9c, 0x5c, 0x2c, 0x49, 0xaa, 0x2e,
   0x4e, 0xad, 0xb2, 0x17, 0xad, 0x8c, 0xc0, 0x9b
};

//"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno" repeated 16777216 times (4096 * 4096)
static UINT8_A sha_plain_text_large_1[] =
{
   "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno"
};
static UINT8_A sha1_digest_text_large_1[] =
{
   0x77, 0x89, 0xf0, 0xc9, 0xef, 0x7b, 0xfc, 0x40,
   0xd9, 0x33, 0x11, 0x14, 0x3d, 0xfb, 0xe6, 0x9e,
   0x20, 0x17, 0xf5, 0x92
};
static UINT8_A sha256_digest_text_large_1[] =
{
   0x50, 0xe7, 0x2a, 0x0e, 0x26, 0x44, 0x2f, 0xe2,
   0x55, 0x2d, 0xc3, 0x93, 0x8a, 0xc5, 0x86, 0x58,
   0x22, 0x8c, 0x0c, 0xbf, 0xb1, 0xd2, 0xca, 0x87,
   0x2a, 0xe4, 0x35, 0x26, 0x6f, 0xcd, 0x05, 0x5e
};
static UINT8_A sha224_digest_text_large_1[] =
{
   0xb5, 0x98, 0x97, 0x13, 0xca, 0x4f, 0xe4, 0x7a,
   0x00, 0x9f, 0x86, 0x21, 0x98, 0x0b, 0x34, 0xe6,
   0xd6, 0x3e, 0xd3, 0x06, 0x3b, 0x2a, 0x0a, 0x2c,
   0x86, 0x7d, 0x8a, 0x85
};
static UINT8_A sha384_digest_text_large_1[] =
{
   0x54, 0x41, 0x23, 0x5c, 0xc0, 0x23, 0x53, 0x41,
   0xed, 0x80, 0x6a, 0x64, 0xfb, 0x35, 0x47, 0x42,
   0xb5, 0xe5, 0xc0, 0x2a, 0x3c, 0x5c, 0xb7, 0x1b,
   0x5f, 0x63, 0xfb, 0x79, 0x34, 0x58, 0xd8, 0xfd,
   0xae, 0x59, 0x9c, 0x8c, 0xd8, 0x88, 0x49, 0x43,
   0xc0, 0x4f, 0x11, 0xb3, 0x1b, 0x89, 0xf0, 0x23
};
static UINT8_A sha512_digest_text_large_1[] =
{
   0xb4, 0x7c, 0x93, 0x34, 0x21, 0xea, 0x2d, 0xb1,
   0x49, 0xad, 0x6e, 0x10, 0xfc, 0xe6, 0xc7, 0xf9,
   0x3d, 0x07, 0x52, 0x38, 0x01, 0x80, 0xff, 0xd7,
   0xf4, 0x62, 0x9a, 0x71, 0x21, 0x34, 0x83, 0x1d,
   0x77, 0xbe, 0x60, 0x91, 0xb8, 0x19, 0xed, 0x35,
   0x2c, 0x29, 0x67, 0xa2, 0xe2, 0xd4, 0xfa, 0x50,
   0x50, 0x72, 0x3c, 0x96, 0x30, 0x69, 0x1f, 0x1a,
   0x05, 0xa7, 0x28, 0x1d, 0xbe, 0x6c, 0x10, 0x86
};


/*RIPEMD-160 test vectors */
static UINT8_A ripemd_160_msg1[] = {};

static UINT8_A ripemd_160_md1[] =
{
  0x9C, 0x11, 0x85, 0xA5, 0xC5, 0xE9, 0xFC, 0x54,
  0x61, 0x28, 0x08, 0x97, 0x7E, 0xE8, 0xF5, 0x48,
  0xB2, 0x25, 0x8D, 0x31
};

static UINT8_A ripemd_160_msg2[] = {
  "a"
};

static UINT8_A ripemd_160_md2[] =
{
  0x0B, 0xDC, 0x9D, 0x2D, 0x25, 0x6B, 0x3E, 0xE9,
  0xDA, 0xAE, 0x34, 0x7B, 0xE6, 0xF4, 0xDC, 0x83,
  0x5A, 0x46, 0x7F, 0xFE
};

static UINT8_A ripemd_160_msg3[] = {
  "abc"
};

static UINT8_A ripemd_160_md3[] =
{
  0x8E, 0xB2, 0x08, 0xF7, 0xE0, 0x5D, 0x98, 0x7A,
  0x9B, 0x04, 0x4A, 0x8E, 0x98, 0xC6, 0xB0, 0x87,
  0xF1, 0x5A, 0x0B, 0xFC
};

static UINT8_A ripemd_160_msg4[] = {
  "message digest"
};

static UINT8_A ripemd_160_md4[] =
{
  0x5D, 0x06, 0x89, 0xEF, 0x49, 0xD2, 0xFA, 0xE5,
  0x72, 0xB8, 0x81, 0xB1, 0x23, 0xA8, 0x5F, 0xFA,
  0x21, 0x59, 0x5F, 0x36
};

static UINT8_A ripemd_160_msg5[] = {
  "abcdefghijklmnopqrstuvwxyz"
};

static UINT8_A ripemd_160_md5[] =
{
  0xF7, 0x1C, 0x27, 0x10, 0x9C, 0x69, 0x2C, 0x1B,
  0x56, 0xBB, 0xDC, 0xEB, 0x5B, 0x9D, 0x28, 0x65,
  0xB3, 0x70, 0x8D, 0xBC
};

static UINT8_A ripemd_160_msg6[] = {
  "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
};

static UINT8_A ripemd_160_md6[] =
{
  0x12, 0xA0, 0x53, 0x38, 0x4A, 0x9C, 0x0C, 0x88,
  0xE4, 0x05, 0xA0, 0x6C, 0x27, 0xDC, 0xF4, 0x9A,
  0xDA, 0x62, 0xEB, 0x2B
};


static UINT8_A ripemd_160_msg7[] = {
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
};

static UINT8_A ripemd_160_md7[] =
{
  0xB0, 0xE2, 0x0B, 0x6E, 0x31, 0x16, 0x64, 0x02,
  0x86, 0xED, 0x3A, 0x87, 0xA5, 0x71, 0x30, 0x79,
  0xB2, 0x1F, 0x51, 0x89
};

//Added for RIPEMD160
//Message is of 60 Bytes, abcdef repeated for 19 times
static UINT8_A ripemd_160_large_msg1[] = {
  "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef"
};

static UINT8_A ripemd_160_large_md1[] =
{
	0xE5, 0x0A, 0xE6, 0x7F, 0xE2, 0xC6, 0x5F, 0xD5,
	0xB4, 0x80, 0x02, 0x30, 0x40, 0xB7, 0x79, 0x3C,
	0x8A, 0xB4, 0x8C, 0x56
};

static UINT8_A ripemd_160_large_adverserial_md1[] =
{
	0xE5, 0x0A, 0xE6, 0x7F, 0xE2, 0xC6, 0x5F, 0xD5,
	0xB4, 0x80, 0x02, 0x30, 0x40, 0xB7, 0x79, 0x3C,
	0x8A, 0xB4, 0x8C, 0x50
};

//Message is of 64 Bytes, abcdef repeated for 20 times, this is to ensure that it processes the message which is exactly same as that of the block size.
static UINT8_A ripemd_160_large_msg2[] = {
  "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefab"
};

static UINT8_A ripemd_160_large_md2[] =
{
	0x25, 0xBF, 0xE6, 0x46, 0x23, 0x22, 0x38, 0x1F,
	0xB1, 0x10, 0x92, 0x1A, 0xEF, 0xD7, 0xD7, 0x95,
	0x1D, 0x4A, 0xCF, 0xC5
};

static UINT8_A ripemd_160_large_adverserial_md2[] =
{
	0x25, 0xBF, 0xE6, 0x46, 0x23, 0x22, 0x38, 0x1F,
	0xB1, 0x10, 0x92, 0x1A, 0xEF, 0xD7, 0xD7, 0x95,
	0x1D, 0x4A, 0xCF, 0xC1
};

//Message is of 128 Bytes, abcdef repeated for 40 times, this is to ensure that it processes the message which is twice as that of the block size.
static UINT8_A ripemd_160_large_msg3[] = {
  "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefab"
};

static UINT8_A ripemd_160_large_md3[] =
{
  0x1F, 0x6F, 0xE6, 0xF6, 0x82, 0xE1, 0xF5, 0x0D,
  0xCA, 0x07, 0xED, 0x75, 0xCB, 0xFC, 0x9A, 0x38,
  0x1C, 0x17, 0x36, 0x8F
};

static UINT8_A ripemd_160_large_adverserial_md3[] =
{
  0x1F, 0x6F, 0xE6, 0xF6, 0x82, 0xE1, 0xF5, 0x0D,
  0xCA, 0x07, 0xED, 0x75, 0xCB, 0xFC, 0x9A, 0x38,
  0x1C, 0x17, 0x36, 0x81
};

//Message is of 1KB, abcdef repeated for 320 times, this is to ensure that it processes huge data which is a multiple of lock size(64 bytes).
static UINT8_A ripemd_160_large_msg4[] = {
  "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefab"
};

static UINT8_A ripemd_160_large_md4[] =
{
  0x03, 0xEB, 0xD5, 0x0C, 0x14, 0xFC, 0x7B, 0xF3,
  0xCA, 0x96, 0x34, 0x01, 0xE2, 0x09, 0xA6, 0x39,
  0x89, 0x77, 0x23, 0x51
};

static UINT8_A ripemd_160_large_adverserial_md4[] =
{
  0x03, 0xEB, 0xD5, 0x0C, 0x14, 0xFC, 0x7B, 0xF3,
  0xCA, 0x96, 0x34, 0x01, 0xE2, 0x09, 0xA6, 0x39,
  0x89, 0x77, 0x23, 0x5E
};

//Message is of 1030 Bytes, abcdef repeated for 322 times, this is to ensure that it processes huge data more than the block size.
static UINT8_A ripemd_160_large_msg5[] = {
  "abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefababcdefabcdef"
};

static UINT8_A ripemd_160_large_md5[] =
{
  0xE4, 0x4D, 0xAD, 0x6C, 0xAD, 0xDC, 0xC1, 0x0B,
  0x45, 0x57, 0x7C, 0x94, 0xFE, 0x56, 0x26, 0xC4,
  0x46, 0x94, 0xED, 0x21
};

static UINT8_A ripemd_160_large_adverserial_md5[] =
{
  0xE4, 0x4D, 0xAD, 0x6C, 0xAD, 0xDC, 0xC1, 0x0B,
  0x45, 0x57, 0x7C, 0x94, 0xFE, 0x56, 0x26, 0xC4,
  0x46, 0x94, 0xED, 0x2F
};

typedef struct sha_vector_type
{
   QSEE_HASH_ALGO_ET  alg;
   uint8_t*             msg;
   uint32_t             msg_len;
   uint8_t*             digest;
   uint32_t             digest_len;
} __attribute__ ((packed)) sha_vector_type_t;

/* SHA test vectors array */
sha_vector_type_t sha_test_vectors[] =
{
   {QSEE_HASH_SHA1, sha_plain_text_0, sizeof(sha_plain_text_0) - 1,
      sha1_digest_text_0, QSEE_SHA1_HASH_SZ},
   {QSEE_HASH_SHA256, sha_plain_text_0, sizeof(sha_plain_text_0) - 1,
      sha256_digest_text_0, QSEE_SHA256_HASH_SZ},
   {QSEE_HASH_SHA1, sha_plain_text_1, sizeof(sha_plain_text_1) - 1,
      sha1_digest_text_1, QSEE_SHA1_HASH_SZ},
   {QSEE_HASH_SHA256, sha_plain_text_1, sizeof(sha_plain_text_1) - 1,
      sha256_digest_text_1, QSEE_SHA256_HASH_SZ},
   {QSEE_HASH_SHA1, sha_plain_text_2, sizeof(sha_plain_text_2) - 1,
      sha1_digest_text_2, QSEE_SHA1_HASH_SZ},
   {QSEE_HASH_SHA256, sha_plain_text_2, sizeof(sha_plain_text_2) - 1,
      sha256_digest_text_2, QSEE_SHA256_HASH_SZ},
   {QSEE_HASH_SHA1, sha_plain_text_3, sizeof(sha_plain_text_3) - 1,
      sha1_digest_text_3, QSEE_SHA1_HASH_SZ},
   {QSEE_HASH_SHA256, sha_plain_text_3, sizeof(sha_plain_text_3) - 1,
      sha256_digest_text_3, QSEE_SHA256_HASH_SZ},
   {QSEE_HASH_SHA1, sha_plain_text_4, sizeof(sha_plain_text_4) - 1,
      sha1_digest_text_4, QSEE_SHA1_HASH_SZ},
   {QSEE_HASH_SHA256, sha_plain_text_4, sizeof(sha_plain_text_4) - 1,
      sha256_digest_text_4, QSEE_SHA256_HASH_SZ},
};

typedef struct sha_large_vector_type
{
   QSEE_HASH_ALGO_ET  alg;
   uint8_t*             msg;
   uint32_t             msg_len;
   uint8_t*             digest;
   uint32_t             digest_len;
   uint32_t             iter1;
   uint32_t             iter2;
} __attribute__ ((packed)) sha_large_vector_type_t;

/* SHA Large test vectors array */
sha_large_vector_type_t sha_large_test_vectors[] =
{
   {QSEE_HASH_SHA1, sha_plain_text_large_0, sizeof(sha_plain_text_large_0) - 1,
      sha1_digest_text_large_0, QSEE_SHA1_HASH_SZ, 1000, 1000},
   {QSEE_HASH_SHA256, sha_plain_text_large_0, sizeof(sha_plain_text_large_0) - 1,
      sha256_digest_text_large_0, QSEE_SHA256_HASH_SZ, 1000, 1000},
   {QSEE_HASH_SHA1, sha_plain_text_large_1, sizeof(sha_plain_text_large_1) - 1,
      sha1_digest_text_large_1, QSEE_SHA1_HASH_SZ, 4096, 4096},
   {QSEE_HASH_SHA256, sha_plain_text_large_1, sizeof(sha_plain_text_large_1) - 1,
      sha256_digest_text_large_1, QSEE_SHA256_HASH_SZ, 4096, 4096},
};

typedef struct uf_sha_vector_type
{
   SW_Auth_Alg_Type   alg;
   uint8_t*             msg;
   uint32_t             msg_len;
   uint8_t*             digest;
   uint32_t             digest_len;
} __attribute__ ((packed)) uf_sha_vector_type_t;

/* SW SHA test vectors array */
uf_sha_vector_type_t uf_sha_test_vectors[] =
{
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA1, sha_plain_text_0, sizeof(sha_plain_text_0) - 1, //0
      sha1_digest_text_0, SW_SHA1_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA256, sha_plain_text_0, sizeof(sha_plain_text_0) - 1, //1
      sha256_digest_text_0, SW_SHA256_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA224, sha_plain_text_0, sizeof(sha_plain_text_0) - 1, //2
      sha224_digest_text_0, SW_SHA224_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA384, sha_plain_text_0, sizeof(sha_plain_text_0) - 1, //3
      sha384_digest_text_0, SW_SHA384_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA512, sha_plain_text_0, sizeof(sha_plain_text_0) - 1, //4
      sha512_digest_text_0, SW_SHA512_DIGEST_SIZE},
   {SW_AUTH_ALG_MD5, sha_plain_text_0, sizeof(sha_plain_text_0) - 1, //5
      md5_digest_text_0, SW_MD5_DIGEST_SIZE},

   {SW_AUTH_ALG_SHA1, sha_plain_text_1, sizeof(sha_plain_text_1) - 1, //6
      sha1_digest_text_1, SW_SHA1_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA256, sha_plain_text_1, sizeof(sha_plain_text_1) - 1, //7
      sha256_digest_text_1, SW_SHA256_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA224, sha_plain_text_1, sizeof(sha_plain_text_1) - 1, //8
      sha224_digest_text_1, SW_SHA224_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA384, sha_plain_text_1, sizeof(sha_plain_text_1) - 1, //9
      sha384_digest_text_1, SW_SHA384_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA512, sha_plain_text_1, sizeof(sha_plain_text_1) - 1, //10
      sha512_digest_text_1, SW_SHA512_DIGEST_SIZE},
   {SW_AUTH_ALG_MD5, sha_plain_text_1, sizeof(sha_plain_text_1) - 1, //11
      md5_digest_text_1, SW_MD5_DIGEST_SIZE},

   {SW_AUTH_ALG_SHA1, sha_plain_text_2, sizeof(sha_plain_text_2) - 1, //12
      sha1_digest_text_2, SW_SHA1_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA256, sha_plain_text_2, sizeof(sha_plain_text_2) - 1, //13
      sha256_digest_text_2, SW_SHA256_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA224, sha_plain_text_2, sizeof(sha_plain_text_2) - 1, //14
      sha224_digest_text_2, SW_SHA224_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA384, sha_plain_text_2, sizeof(sha_plain_text_2) - 1, //15
      sha384_digest_text_2, SW_SHA384_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA512, sha_plain_text_2, sizeof(sha_plain_text_2) - 1, //16
      sha512_digest_text_2, SW_SHA512_DIGEST_SIZE},
   {SW_AUTH_ALG_MD5, sha_plain_text_2, sizeof(sha_plain_text_2) - 1, //17
      md5_digest_text_2, SW_MD5_DIGEST_SIZE},

   {SW_AUTH_ALG_SHA1, sha_plain_text_3, sizeof(sha_plain_text_3) - 1, //18
      sha1_digest_text_3, SW_SHA1_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA256, sha_plain_text_3, sizeof(sha_plain_text_3) - 1, //19
      sha256_digest_text_3, SW_SHA256_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA224, sha_plain_text_3, sizeof(sha_plain_text_3) - 1, //20
      sha224_digest_text_3, SW_SHA224_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA384, sha_plain_text_3, sizeof(sha_plain_text_3) - 1, //21
      sha384_digest_text_3, SW_SHA384_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA512, sha_plain_text_3, sizeof(sha_plain_text_3) - 1, //22
      sha512_digest_text_3, SW_SHA512_DIGEST_SIZE},
   {SW_AUTH_ALG_MD5, sha_plain_text_3, sizeof(sha_plain_text_3) - 1, //23
      md5_digest_text_3, SW_MD5_DIGEST_SIZE},

   {SW_AUTH_ALG_SHA1, sha_plain_text_4, sizeof(sha_plain_text_4) - 1, //24
      sha1_digest_text_4, SW_SHA1_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA256, sha_plain_text_4, sizeof(sha_plain_text_4) - 1, //25
      sha256_digest_text_4, SW_SHA256_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA224, sha_plain_text_4, sizeof(sha_plain_text_4) - 1, //26
      sha224_digest_text_4, SW_SHA224_DIGEST_SIZE},
#endif
   {SW_AUTH_ALG_SHA384, sha_plain_text_4, sizeof(sha_plain_text_4) - 1, //27
      sha384_digest_text_4, SW_SHA384_DIGEST_SIZE},
#ifndef SKIP_IMG_OPT_TEST
   {SW_AUTH_ALG_SHA512, sha_plain_text_4, sizeof(sha_plain_text_4) - 1, //28
      sha512_digest_text_4, SW_SHA512_DIGEST_SIZE},
   {SW_AUTH_ALG_MD5, sha_plain_text_4, sizeof(sha_plain_text_4) - 1, //29
      md5_digest_text_4, SW_MD5_DIGEST_SIZE},
#endif
	/* RIPEMD-160 RFC: https://tools.ietf.org/doc/tcllib/html/ripemd160.html#section4
    * Test vectors from referenced document: http://www.esat.kuleuven.ac.be/~cosicart/pdf/AB-9601/AB-9601.pdf */
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_msg1, 0, ripemd_160_md1, SW_RIPEMD160_DIGEST_SIZE}, //30
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_msg2, sizeof(ripemd_160_msg2) -1, ripemd_160_md2, SW_RIPEMD160_DIGEST_SIZE}, //31
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_msg3, sizeof(ripemd_160_msg3) -1, ripemd_160_md3, SW_RIPEMD160_DIGEST_SIZE}, //32
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_msg4, sizeof(ripemd_160_msg4) -1, ripemd_160_md4, SW_RIPEMD160_DIGEST_SIZE}, //33
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_msg5, sizeof(ripemd_160_msg5) -1, ripemd_160_md5, SW_RIPEMD160_DIGEST_SIZE}, //34
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_msg6, sizeof(ripemd_160_msg6) -1, ripemd_160_md6, SW_RIPEMD160_DIGEST_SIZE}, //35
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_msg7, sizeof(ripemd_160_msg7) -1, ripemd_160_md7, SW_RIPEMD160_DIGEST_SIZE}, //36
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg1, sizeof(ripemd_160_large_msg1) -1, ripemd_160_large_md1, SW_RIPEMD160_DIGEST_SIZE}, //37
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg2, sizeof(ripemd_160_large_msg2) -1, ripemd_160_large_md2, SW_RIPEMD160_DIGEST_SIZE}, //38
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg3, sizeof(ripemd_160_large_msg3) -1, ripemd_160_large_md3, SW_RIPEMD160_DIGEST_SIZE}, //39
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg4, sizeof(ripemd_160_large_msg4) -1, ripemd_160_large_md4, SW_RIPEMD160_DIGEST_SIZE}, //40
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg5, sizeof(ripemd_160_large_msg5) -1, ripemd_160_large_md5, SW_RIPEMD160_DIGEST_SIZE}, //41
};

uf_sha_vector_type_t uf_sha_adverserial_test_vectors[] =
{
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg1, sizeof(ripemd_160_large_msg1) -1, ripemd_160_large_adverserial_md1, SW_RIPEMD160_DIGEST_SIZE},
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg2, sizeof(ripemd_160_large_msg2) -1, ripemd_160_large_adverserial_md2, SW_RIPEMD160_DIGEST_SIZE},
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg3, sizeof(ripemd_160_large_msg3) -1, ripemd_160_large_adverserial_md3, SW_RIPEMD160_DIGEST_SIZE},
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg4, sizeof(ripemd_160_large_msg4) -1, ripemd_160_large_adverserial_md4, SW_RIPEMD160_DIGEST_SIZE},
   {SW_AUTH_ALG_RIPEMD160, ripemd_160_large_msg5, sizeof(ripemd_160_large_msg5) -1, ripemd_160_large_adverserial_md5, SW_RIPEMD160_DIGEST_SIZE},
};

typedef struct uf_sha_large_vector_type
{
   SW_Auth_Alg_Type   alg;
   uint8_t*             msg;
   uint32_t             msg_len;
   uint8_t*             digest;
   uint32_t             digest_len;
   uint32_t             iter1;
   uint32_t             iter2;
} __attribute__ ((packed)) uf_sha_large_vector_type_t;

/* SW SHA test vectors array */
uf_sha_large_vector_type_t uf_sha_large_test_vectors[] =
{
   {SW_AUTH_ALG_SHA1, sha_plain_text_large_0, sizeof(sha_plain_text_large_0) - 1, //0
      sha1_digest_text_large_0, SW_SHA1_DIGEST_SIZE, 1000, 1000},
   {SW_AUTH_ALG_SHA256, sha_plain_text_large_0, sizeof(sha_plain_text_large_0) - 1, //1
      sha256_digest_text_large_0, SW_SHA256_DIGEST_SIZE, 1000, 1000},
   {SW_AUTH_ALG_SHA224, sha_plain_text_large_0, sizeof(sha_plain_text_large_0) - 1, //2
      sha224_digest_text_large_0, SW_SHA224_DIGEST_SIZE, 1000, 1000},
   {SW_AUTH_ALG_SHA384, sha_plain_text_large_0, sizeof(sha_plain_text_large_0) - 1, //3
      sha384_digest_text_large_0, SW_SHA384_DIGEST_SIZE, 1000, 1000},
   {SW_AUTH_ALG_SHA512, sha_plain_text_large_0, sizeof(sha_plain_text_large_0) - 1, //4
      sha512_digest_text_large_0, SW_SHA512_DIGEST_SIZE, 1000, 1000},

   {SW_AUTH_ALG_SHA1, sha_plain_text_large_1, sizeof(sha_plain_text_large_1) - 1, //6
      sha1_digest_text_large_1, SW_SHA1_DIGEST_SIZE, 4096, 4096},
   {SW_AUTH_ALG_SHA256, sha_plain_text_large_1, sizeof(sha_plain_text_large_1) - 1, //7
      sha256_digest_text_large_1, SW_SHA256_DIGEST_SIZE, 4096, 4096},
   {SW_AUTH_ALG_SHA224, sha_plain_text_large_1, sizeof(sha_plain_text_large_1) - 1, //8
      sha224_digest_text_large_1, SW_SHA224_DIGEST_SIZE, 4096, 4096},
   {SW_AUTH_ALG_SHA384, sha_plain_text_large_1, sizeof(sha_plain_text_large_1) - 1, //9
      sha384_digest_text_large_1, SW_SHA384_DIGEST_SIZE, 4096, 4096},
   {SW_AUTH_ALG_SHA512, sha_plain_text_large_1, sizeof(sha_plain_text_large_1) - 1, //10
      sha512_digest_text_large_1, SW_SHA512_DIGEST_SIZE, 4096, 4096}
};

/* Simultaneous HASH/AES CBC test vectors */
static UINT8_A hash_aes_key_128[] =
{
   0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
   0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c
};
static UINT8_A hash_aes_key_256[] =
{
   0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
   0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c,
   0x3c, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
   0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x2b
};
static UINT8_A hash_aes_iv_1[] =
{
   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
   0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
};

typedef struct
{
   QSEE_HASH_ALGO_ET     hash_algo;
   QSEE_CIPHER_ALGO_ET   cipher_algo;
   QSEE_CIPHER_MODE_ET   cipher_mode;
   uint8_t*                pt;
   uint32_t                pt_len;
   uint8_t*                key;
   uint32_t                key_len;
   uint8_t*                iv;
   uint8_t*                ct;
   uint8_t*                ct2;
} __attribute__ ((packed)) hash_aes_vector_type;

/* Simultaneous Hash/AES AES-128/256 and SHA1/SHA256 test vectors array */
hash_aes_vector_type hash_aes_test_vectors[] =
{
   {QSEE_HASH_SHA1, QSEE_CIPHER_ALGO_AES_128, QSEE_CIPHER_MODE_CTS,
      aes_large_plain_text2, sizeof(aes_large_plain_text2),
      hash_aes_key_128, sizeof(hash_aes_key_128),
      hash_aes_iv_1, aes_large_cipher_text2, aes_large_cipher_text3},

   {QSEE_HASH_SHA1, QSEE_CIPHER_ALGO_AES_128, QSEE_CIPHER_MODE_CBC,
      aes_large_plain_text2, sizeof(aes_large_plain_text2),
      hash_aes_key_128, sizeof(hash_aes_key_128),
      hash_aes_iv_1, aes_large_cipher_text2, aes_large_cipher_text3},

   {QSEE_HASH_SHA1, QSEE_CIPHER_ALGO_AES_256, QSEE_CIPHER_MODE_CBC,
      aes_large_plain_text2, sizeof(aes_large_plain_text2),
      hash_aes_key_256, sizeof(hash_aes_key_256),
      hash_aes_iv_1, aes_large_cipher_text2, aes_large_cipher_text3},

   {QSEE_HASH_SHA256, QSEE_CIPHER_ALGO_AES_128,QSEE_CIPHER_MODE_CBC,
      aes_large_plain_text2, sizeof(aes_large_plain_text2),
      hash_aes_key_128, sizeof(hash_aes_key_128),
      hash_aes_iv_1, aes_large_cipher_text2, aes_large_cipher_text3},

   {QSEE_HASH_SHA256, QSEE_CIPHER_ALGO_AES_256, QSEE_CIPHER_MODE_CBC,
      aes_large_plain_text2, sizeof(aes_large_plain_text2),
      hash_aes_key_256, sizeof(hash_aes_key_256),
      hash_aes_iv_1, aes_large_cipher_text2, aes_large_cipher_text3},
};

#endif // __CRYPTO_HASH_TEST_VECTORS_H__

