1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/sys/crypto_aes_ccm/tests-crypto-modes-ccm-256.c

2471 lines
83 KiB
C

/*
* Copyright (C) 2021 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "embUnit.h"
#include "crypto/ciphers.h"
#include "crypto/modes/ccm.h"
#include "tests-crypto.h"
/**
* AES CCM DVTP test vectors (SP 800-38C) for 256 bit keys.
* https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/cavp-testing-block-cipher-modes
*/
static const size_t nonce_and_len_encoding_size = 15;
/* Alen = 0, Plen = 0, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_0_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_0_KEY[] = {
0xed, 0xa3, 0x2f, 0x75, 0x14, 0x56, 0xe3, 0x31,
0x95, 0xf1, 0xf4, 0x99, 0xcf, 0x2d, 0xc7, 0xc9,
0x7e, 0xa1, 0x27, 0xb6, 0xd4, 0x88, 0xf2, 0x11,
0xcc, 0xc5, 0x12, 0x6f, 0xbb, 0x24, 0xaf, 0xa6,
};
static const size_t TEST_DVPT256_GROUP_0_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_0_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_0_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_0_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_0_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_0_EXPECTED[] = {
0x46, 0x9c, 0x90, 0xbb,
};
static const size_t TEST_DVPT256_0_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_0_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_0_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_4_NONCE[] = {
0xdb, 0xb3, 0x92, 0x31, 0x56, 0xcf, 0xd6,
};
static const size_t TEST_DVPT256_4_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_4_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_4_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_4_EXPECTED[] = {
0x13, 0x02, 0xd5, 0x15,
};
static const size_t TEST_DVPT256_4_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_4_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_4_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_6_NONCE[] = {
0xa2, 0x59, 0xc1, 0x14, 0xea, 0xac, 0x89,
};
static const size_t TEST_DVPT256_6_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_6_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_6_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_6_EXPECTED[] = {
0x4f, 0xe0, 0x6e, 0x92,
};
static const size_t TEST_DVPT256_6_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_6_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_6_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_11_NONCE[] = {
0xe1, 0xbe, 0x89, 0xaf, 0x98, 0xff, 0xd7,
};
static const size_t TEST_DVPT256_11_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_11_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_11_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_11_EXPECTED[] = {
0xe5, 0x41, 0x7f, 0x6b,
};
static const size_t TEST_DVPT256_11_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_11_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_11_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_13_NONCE[] = {
0x1a, 0xa7, 0x58, 0xeb, 0x2f, 0x9a, 0x28,
};
static const size_t TEST_DVPT256_13_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_13_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_13_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_13_EXPECTED[] = {
0xf8, 0xfa, 0x8e, 0x71,
};
static const size_t TEST_DVPT256_13_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_13_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_13_INPUT_LEN = 0;
/* Alen = 0, Plen = 0, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_1_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_1_KEY[] = {
0xe1, 0xb8, 0xa9, 0x27, 0xa9, 0x5e, 0xfe, 0x94,
0x65, 0x66, 0x77, 0xb6, 0x92, 0x66, 0x20, 0x00,
0x27, 0x8b, 0x44, 0x1c, 0x79, 0xe8, 0x79, 0xdd,
0x5c, 0x0d, 0xdc, 0x75, 0x8b, 0xdc, 0x9e, 0xe8,
};
static const size_t TEST_DVPT256_GROUP_1_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_15_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_15_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_15_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_15_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_15_EXPECTED[] = {
0x82, 0x07, 0xeb, 0x14, 0xd3, 0x38, 0x55, 0xa5,
0x2a, 0xcc, 0xee, 0xd1, 0x7d, 0xbc, 0xbf, 0x6e,
};
static const size_t TEST_DVPT256_15_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_15_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_15_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_19_NONCE[] = {
0xdb, 0xb3, 0x92, 0x31, 0x56, 0xcf, 0xd6,
};
static const size_t TEST_DVPT256_19_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_19_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_19_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_19_EXPECTED[] = {
0xe4, 0xdc, 0x5e, 0x03, 0xaa, 0xce, 0xa6, 0x91,
0x26, 0x2e, 0xe6, 0x9c, 0xee, 0x8f, 0xfb, 0xbe,
};
static const size_t TEST_DVPT256_19_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_19_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_19_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_21_NONCE[] = {
0xa2, 0x59, 0xc1, 0x14, 0xea, 0xac, 0x89,
};
static const size_t TEST_DVPT256_21_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_21_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_21_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_21_EXPECTED[] = {
0xf7, 0x9c, 0x53, 0xfd, 0x5e, 0x69, 0x83, 0x5b,
0x7e, 0x70, 0x49, 0x6e, 0xa9, 0x99, 0x71, 0x8b,
};
static const size_t TEST_DVPT256_21_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_21_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_21_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_26_NONCE[] = {
0xe1, 0xbe, 0x89, 0xaf, 0x98, 0xff, 0xd7,
};
static const size_t TEST_DVPT256_26_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_26_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_26_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_26_EXPECTED[] = {
0x10, 0xd3, 0xf6, 0xfe, 0x08, 0x28, 0x0d, 0x45,
0xe6, 0x7e, 0x58, 0xfe, 0x41, 0xa7, 0xf0, 0x36,
};
static const size_t TEST_DVPT256_26_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_26_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_26_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_28_NONCE[] = {
0x1a, 0xa7, 0x58, 0xeb, 0x2f, 0x9a, 0x28,
};
static const size_t TEST_DVPT256_28_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_28_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_28_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_28_EXPECTED[] = {
0x25, 0x90, 0xdf, 0x24, 0x53, 0xcb, 0x94, 0xc3,
0x04, 0xba, 0x0a, 0x2b, 0xff, 0x3f, 0x3c, 0x71,
};
static const size_t TEST_DVPT256_28_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_28_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_28_INPUT_LEN = 0;
/* Alen = 0, Plen = 0, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_2_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_2_KEY[] = {
0xe1, 0xb8, 0xa9, 0x27, 0xa9, 0x5e, 0xfe, 0x94,
0x65, 0x66, 0x77, 0xb6, 0x92, 0x66, 0x20, 0x00,
0x27, 0x8b, 0x44, 0x1c, 0x79, 0xe8, 0x79, 0xdd,
0x5c, 0x0d, 0xdc, 0x75, 0x8b, 0xdc, 0x9e, 0xe8,
};
static const size_t TEST_DVPT256_GROUP_2_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_30_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_30_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_30_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_30_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_30_EXPECTED[] = {
0x8a, 0x19, 0xa1, 0x33,
};
static const size_t TEST_DVPT256_30_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_30_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_30_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_34_NONCE[] = {
0x79, 0xac, 0x20, 0x4a, 0x26, 0xb9, 0xfe, 0xe1,
0x13, 0x23, 0x70, 0xc2, 0x0f,
};
static const size_t TEST_DVPT256_34_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_34_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_34_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_34_EXPECTED[] = {
0x15, 0x40, 0x24, 0xb2,
};
static const size_t TEST_DVPT256_34_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_34_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_34_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_36_NONCE[] = {
0x05, 0x45, 0xfd, 0x9e, 0xcb, 0xc7, 0x3c, 0xcd,
0xbb, 0xbd, 0x42, 0x44, 0xfd,
};
static const size_t TEST_DVPT256_36_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_36_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_36_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_36_EXPECTED[] = {
0x5c, 0x34, 0x9f, 0xb2,
};
static const size_t TEST_DVPT256_36_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_36_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_36_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_41_NONCE[] = {
0x0a, 0x37, 0xf2, 0xe7, 0xc6, 0x64, 0x90, 0xe9,
0x72, 0x85, 0xf1, 0xb0, 0x9e,
};
static const size_t TEST_DVPT256_41_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_41_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_41_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_41_EXPECTED[] = {
0xc5, 0x9b, 0xf1, 0x4c,
};
static const size_t TEST_DVPT256_41_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_41_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_41_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_43_NONCE[] = {
0xc1, 0xad, 0x81, 0x2b, 0xf2, 0xbb, 0xb2, 0xcd,
0xae, 0xe4, 0x63, 0x6e, 0xe7,
};
static const size_t TEST_DVPT256_43_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_43_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_43_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_43_EXPECTED[] = {
0x5b, 0x96, 0xf4, 0x1d,
};
static const size_t TEST_DVPT256_43_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_43_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_43_INPUT_LEN = 0;
/* Alen = 0, Plen = 0, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_3_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_3_KEY[] = {
0xaf, 0x06, 0x36, 0x39, 0xe6, 0x6c, 0x28, 0x40,
0x83, 0xc5, 0xcf, 0x72, 0xb7, 0x0d, 0x8b, 0xc2,
0x77, 0xf5, 0x97, 0x8e, 0x80, 0xd9, 0x32, 0x2d,
0x99, 0xf2, 0xfd, 0xc7, 0x18, 0xcd, 0xa5, 0x69,
};
static const size_t TEST_DVPT256_GROUP_3_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_45_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_45_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_45_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_45_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_45_EXPECTED[] = {
0x97, 0xe1, 0xa8, 0xdd, 0x42, 0x59, 0xcc, 0xd2,
0xe4, 0x31, 0xe0, 0x57, 0xb0, 0x39, 0x7f, 0xcf,
};
static const size_t TEST_DVPT256_45_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_45_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_45_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_49_NONCE[] = {
0x79, 0xac, 0x20, 0x4a, 0x26, 0xb9, 0xfe, 0xe1,
0x13, 0x23, 0x70, 0xc2, 0x0f,
};
static const size_t TEST_DVPT256_49_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_49_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_49_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_49_EXPECTED[] = {
0x5c, 0x8c, 0x9a, 0x5b, 0x97, 0xbe, 0x8c, 0x7b,
0xc0, 0x1c, 0xa8, 0xd6, 0x93, 0xb8, 0x09, 0xf9,
};
static const size_t TEST_DVPT256_49_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_49_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_49_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_51_NONCE[] = {
0x05, 0x45, 0xfd, 0x9e, 0xcb, 0xc7, 0x3c, 0xcd,
0xbb, 0xbd, 0x42, 0x44, 0xfd,
};
static const size_t TEST_DVPT256_51_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_51_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_51_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_51_EXPECTED[] = {
0x84, 0x20, 0x16, 0x62, 0xb2, 0x13, 0xc7, 0xa1,
0xff, 0x0c, 0x1b, 0x3c, 0x25, 0xe4, 0xec, 0x45,
};
static const size_t TEST_DVPT256_51_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_51_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_51_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_56_NONCE[] = {
0x0a, 0x37, 0xf2, 0xe7, 0xc6, 0x64, 0x90, 0xe9,
0x72, 0x85, 0xf1, 0xb0, 0x9e,
};
static const size_t TEST_DVPT256_56_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_56_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_56_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_56_EXPECTED[] = {
0x58, 0x6e, 0x72, 0x81, 0x93, 0xce, 0x6d, 0xb9,
0xa9, 0x26, 0xb0, 0x3b, 0x2d, 0x77, 0xdd, 0x6e,
};
static const size_t TEST_DVPT256_56_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_56_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_56_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_58_NONCE[] = {
0xc1, 0xad, 0x81, 0x2b, 0xf2, 0xbb, 0xb2, 0xcd,
0xae, 0xe4, 0x63, 0x6e, 0xe7,
};
static const size_t TEST_DVPT256_58_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_58_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_58_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_58_EXPECTED[] = {
0x64, 0x86, 0x4d, 0x21, 0xb6, 0xee, 0x3f, 0xca,
0x13, 0xf0, 0x7f, 0xc0, 0x48, 0x6e, 0x23, 0x2d,
};
static const size_t TEST_DVPT256_58_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_58_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_58_INPUT_LEN = 0;
/* Alen = 0, Plen = 24, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_4_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_4_KEY[] = {
0xaf, 0x06, 0x36, 0x39, 0xe6, 0x6c, 0x28, 0x40,
0x83, 0xc5, 0xcf, 0x72, 0xb7, 0x0d, 0x8b, 0xc2,
0x77, 0xf5, 0x97, 0x8e, 0x80, 0xd9, 0x32, 0x2d,
0x99, 0xf2, 0xfd, 0xc7, 0x18, 0xcd, 0xa5, 0x69,
};
static const size_t TEST_DVPT256_GROUP_4_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_60_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_60_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_60_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_60_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_60_EXPECTED[] = {
0x64, 0xa1, 0x34, 0x16, 0x79, 0x97, 0x2d, 0xc5,
0x86, 0x9f, 0xcf, 0x69, 0xb1, 0x9d, 0x5c, 0x5e,
0xa5, 0x0a, 0xa0, 0xb5, 0xe9, 0x85, 0xf5, 0xb7,
0x22, 0xaa, 0x8d, 0x59,
};
static const size_t TEST_DVPT256_60_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_60_INPUT[] = {
0xd3, 0xd5, 0x42, 0x4e, 0x20, 0xfb, 0xec, 0x43,
0xae, 0x49, 0x53, 0x53, 0xed, 0x83, 0x02, 0x71,
0x51, 0x5a, 0xb1, 0x04, 0xf8, 0x86, 0x0c, 0x98,
};
static const size_t TEST_DVPT256_60_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_64_NONCE[] = {
0x9d, 0x77, 0x3a, 0x31, 0xfe, 0x2e, 0xc7,
};
static const size_t TEST_DVPT256_64_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_64_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_64_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_64_EXPECTED[] = {
0x5a, 0xcf, 0xbe, 0x5e, 0x48, 0x89, 0x76, 0xd8,
0xb9, 0xb7, 0x7e, 0x69, 0xa7, 0x36, 0xe8, 0xc9,
0x19, 0x05, 0x3f, 0x94, 0x15, 0x55, 0x12, 0x09,
0xdc, 0xe2, 0xd2, 0x5e,
};
static const size_t TEST_DVPT256_64_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_64_INPUT[] = {
0x83, 0x9d, 0x8c, 0xfa, 0x2c, 0x92, 0x1c, 0x3c,
0xce, 0xb7, 0xd1, 0xf4, 0x6b, 0xd2, 0xea, 0xad,
0x70, 0x6e, 0x53, 0xf6, 0x45, 0x23, 0xd8, 0xc0,
};
static const size_t TEST_DVPT256_64_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_66_NONCE[] = {
0x24, 0xb7, 0xa6, 0x53, 0x91, 0xf8, 0x8b,
};
static const size_t TEST_DVPT256_66_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_66_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_66_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_66_EXPECTED[] = {
0xf0, 0x06, 0x28, 0xe1, 0x0e, 0x8e, 0x01, 0x15,
0xb4, 0xa4, 0x53, 0x2a, 0x12, 0x12, 0xa2, 0x3a,
0xad, 0xe4, 0x09, 0x08, 0x32, 0xc1, 0x97, 0x2d,
0x75, 0x01, 0x25, 0xf3,
};
static const size_t TEST_DVPT256_66_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_66_INPUT[] = {
0x3b, 0xed, 0x52, 0x23, 0x61, 0x82, 0xc1, 0x94,
0x18, 0x86, 0x7d, 0x46, 0x8d, 0xbf, 0x47, 0xc8,
0xaa, 0xc4, 0x6c, 0x02, 0x44, 0x5f, 0x99, 0xbb,
};
static const size_t TEST_DVPT256_66_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_71_NONCE[] = {
0xb6, 0x72, 0xc9, 0x13, 0x76, 0xf5, 0x33,
};
static const size_t TEST_DVPT256_71_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_71_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_71_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_71_EXPECTED[] = {
0x75, 0x8a, 0xa0, 0x3d, 0xc7, 0x2c, 0x36, 0x2c,
0x43, 0xb5, 0xf8, 0x5b, 0xfa, 0xa3, 0xdb, 0x4a,
0x74, 0x86, 0x08, 0x87, 0xa8, 0xc2, 0x9e, 0x47,
0xd5, 0x64, 0x28, 0x30,
};
static const size_t TEST_DVPT256_71_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_71_INPUT[] = {
0x4f, 0x7a, 0x56, 0x1e, 0x61, 0xb7, 0x86, 0x17,
0x19, 0xe4, 0x44, 0x50, 0x57, 0xac, 0x9b, 0x74,
0xa9, 0xbe, 0x95, 0x3b, 0x77, 0x2b, 0x09, 0xec,
};
static const size_t TEST_DVPT256_71_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_73_NONCE[] = {
0xa6, 0xd0, 0x1f, 0xb8, 0x8c, 0xa5, 0x47,
};
static const size_t TEST_DVPT256_73_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_73_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_73_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_73_EXPECTED[] = {
0x61, 0x5c, 0xbe, 0xab, 0xbe, 0x16, 0x3b, 0xa8,
0xbc, 0x9c, 0x07, 0x3d, 0xf9, 0xad, 0x40, 0x83,
0x3f, 0xcf, 0x3f, 0x42, 0x46, 0x44, 0xcc, 0xc3,
0x7a, 0xa9, 0x99, 0xd7,
};
static const size_t TEST_DVPT256_73_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_73_INPUT[] = {
0xa3, 0x61, 0x55, 0xde, 0x47, 0x73, 0x64, 0x23,
0x65, 0x91, 0xe4, 0x53, 0x00, 0x81, 0x14, 0x07,
0x5b, 0x48, 0x72, 0x12, 0x0e, 0xf1, 0x72, 0x64,
};
static const size_t TEST_DVPT256_73_INPUT_LEN = 24;
/* Alen = 0, Plen = 24, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_5_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_5_KEY[] = {
0xf7, 0x07, 0x9d, 0xfa, 0x3b, 0x5c, 0x7b, 0x05,
0x63, 0x47, 0xd7, 0xe4, 0x37, 0xbc, 0xde, 0xd6,
0x83, 0xab, 0xd6, 0xe2, 0xc9, 0xe0, 0x69, 0xd3,
0x33, 0x28, 0x40, 0x82, 0xcb, 0xb5, 0xd4, 0x53,
};
static const size_t TEST_DVPT256_GROUP_5_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_75_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_75_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_75_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_75_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_75_EXPECTED[] = {
0xbc, 0x51, 0xc3, 0x92, 0x5a, 0x96, 0x0e, 0x77,
0x32, 0x53, 0x3e, 0x4e, 0xf3, 0xa4, 0xf6, 0x9e,
0xe6, 0x82, 0x6d, 0xe9, 0x52, 0xbc, 0xb0, 0xfd,
0x37, 0x4f, 0x3b, 0xb6, 0xdb, 0x83, 0x77, 0xeb,
0xfc, 0x79, 0x67, 0x48, 0x58, 0xc4, 0xf3, 0x05,
};
static const size_t TEST_DVPT256_75_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_75_INPUT[] = {
0xd3, 0xd5, 0x42, 0x4e, 0x20, 0xfb, 0xec, 0x43,
0xae, 0x49, 0x53, 0x53, 0xed, 0x83, 0x02, 0x71,
0x51, 0x5a, 0xb1, 0x04, 0xf8, 0x86, 0x0c, 0x98,
};
static const size_t TEST_DVPT256_75_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_79_NONCE[] = {
0x9d, 0x77, 0x3a, 0x31, 0xfe, 0x2e, 0xc7,
};
static const size_t TEST_DVPT256_79_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_79_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_79_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_79_EXPECTED[] = {
0x45, 0x39, 0xbb, 0x13, 0x38, 0x2b, 0x03, 0x4d,
0xdb, 0x16, 0xa3, 0x32, 0x91, 0x48, 0xf9, 0x24,
0x3a, 0x4e, 0xee, 0x99, 0x8f, 0xe4, 0x44, 0xaf,
0xf2, 0x87, 0x0c, 0xe1, 0x98, 0xaf, 0x11, 0xf4,
0xfb, 0x69, 0x8a, 0x67, 0xaf, 0x6c, 0x89, 0xad,
};
static const size_t TEST_DVPT256_79_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_79_INPUT[] = {
0x83, 0x9d, 0x8c, 0xfa, 0x2c, 0x92, 0x1c, 0x3c,
0xce, 0xb7, 0xd1, 0xf4, 0x6b, 0xd2, 0xea, 0xad,
0x70, 0x6e, 0x53, 0xf6, 0x45, 0x23, 0xd8, 0xc0,
};
static const size_t TEST_DVPT256_79_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_81_NONCE[] = {
0x24, 0xb7, 0xa6, 0x53, 0x91, 0xf8, 0x8b,
};
static const size_t TEST_DVPT256_81_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_81_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_81_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_81_EXPECTED[] = {
0x6d, 0x0f, 0x92, 0x83, 0x52, 0xa1, 0x7d, 0x63,
0xac, 0xa1, 0x89, 0x9c, 0xbd, 0x30, 0x5e, 0x1f,
0x83, 0x1f, 0x16, 0x38, 0xd2, 0x7c, 0x1e, 0x24,
0x43, 0x27, 0x04, 0xef, 0xf9, 0xb6, 0x83, 0x04,
0x76, 0xdb, 0x3d, 0x30, 0xd4, 0xc1, 0x03, 0xe4,
};
static const size_t TEST_DVPT256_81_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_81_INPUT[] = {
0x3b, 0xed, 0x52, 0x23, 0x61, 0x82, 0xc1, 0x94,
0x18, 0x86, 0x7d, 0x46, 0x8d, 0xbf, 0x47, 0xc8,
0xaa, 0xc4, 0x6c, 0x02, 0x44, 0x5f, 0x99, 0xbb,
};
static const size_t TEST_DVPT256_81_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_86_NONCE[] = {
0xb6, 0x72, 0xc9, 0x13, 0x76, 0xf5, 0x33,
};
static const size_t TEST_DVPT256_86_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_86_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_86_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_86_EXPECTED[] = {
0xf2, 0x3a, 0xc1, 0x42, 0x6c, 0xb1, 0x13, 0x0c,
0x9a, 0x09, 0x13, 0xb3, 0x47, 0xd8, 0xef, 0xaf,
0xb6, 0xed, 0x12, 0x59, 0x13, 0xaa, 0x67, 0x8a,
0x9d, 0xc4, 0x2d, 0x22, 0xa5, 0x43, 0x6b, 0xc1,
0x2e, 0xff, 0x55, 0x05, 0xed, 0xb2, 0x5e, 0x19,
};
static const size_t TEST_DVPT256_86_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_86_INPUT[] = {
0x4f, 0x7a, 0x56, 0x1e, 0x61, 0xb7, 0x86, 0x17,
0x19, 0xe4, 0x44, 0x50, 0x57, 0xac, 0x9b, 0x74,
0xa9, 0xbe, 0x95, 0x3b, 0x77, 0x2b, 0x09, 0xec,
};
static const size_t TEST_DVPT256_86_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_88_NONCE[] = {
0xa6, 0xd0, 0x1f, 0xb8, 0x8c, 0xa5, 0x47,
};
static const size_t TEST_DVPT256_88_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_88_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_88_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_88_EXPECTED[] = {
0x77, 0x3b, 0x8e, 0xea, 0x2e, 0x98, 0x30, 0x29,
0x7a, 0xc1, 0x1d, 0x3c, 0x1f, 0x6e, 0xa4, 0x00,
0x8c, 0x96, 0x04, 0x0e, 0x83, 0xd7, 0x6d, 0x55,
0x78, 0x9d, 0x20, 0x43, 0x17, 0x9f, 0xdd, 0x8f,
0xdc, 0xbd, 0x52, 0x31, 0x3b, 0x7b, 0x15, 0xcb,
};
static const size_t TEST_DVPT256_88_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_88_INPUT[] = {
0xa3, 0x61, 0x55, 0xde, 0x47, 0x73, 0x64, 0x23,
0x65, 0x91, 0xe4, 0x53, 0x00, 0x81, 0x14, 0x07,
0x5b, 0x48, 0x72, 0x12, 0x0e, 0xf1, 0x72, 0x64,
};
static const size_t TEST_DVPT256_88_INPUT_LEN = 24;
/* Alen = 0, Plen = 24, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_6_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_6_KEY[] = {
0xf7, 0x07, 0x9d, 0xfa, 0x3b, 0x5c, 0x7b, 0x05,
0x63, 0x47, 0xd7, 0xe4, 0x37, 0xbc, 0xde, 0xd6,
0x83, 0xab, 0xd6, 0xe2, 0xc9, 0xe0, 0x69, 0xd3,
0x33, 0x28, 0x40, 0x82, 0xcb, 0xb5, 0xd4, 0x53,
};
static const size_t TEST_DVPT256_GROUP_6_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_90_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_90_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_90_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_90_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_90_EXPECTED[] = {
0x63, 0xe0, 0x0d, 0x30, 0xe4, 0xb0, 0x8f, 0xd2,
0xa1, 0xcc, 0x8d, 0x70, 0xfa, 0xb3, 0x27, 0xb2,
0x36, 0x8e, 0x77, 0xa9, 0x3b, 0xe4, 0xf4, 0x12,
0x3d, 0x14, 0xfb, 0x3f,
};
static const size_t TEST_DVPT256_90_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_90_INPUT[] = {
0x3c, 0x0e, 0x28, 0x15, 0xd3, 0x7d, 0x84, 0x4f,
0x7a, 0xc2, 0x40, 0xba, 0x9d, 0x6e, 0x3a, 0x0b,
0x2a, 0x86, 0xf7, 0x06, 0xe8, 0x85, 0x95, 0x9e,
};
static const size_t TEST_DVPT256_90_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_94_NONCE[] = {
0x15, 0x01, 0xa2, 0x43, 0xbf, 0x60, 0xb2, 0xcb,
0x40, 0xd5, 0xaa, 0x20, 0xca,
};
static const size_t TEST_DVPT256_94_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_94_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_94_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_94_EXPECTED[] = {
0x37, 0x7b, 0x2f, 0x1e, 0x7b, 0xd9, 0xe3, 0xd1,
0x07, 0x70, 0x38, 0xe0, 0x84, 0xf6, 0x19, 0x50,
0x76, 0x13, 0x61, 0x09, 0x5f, 0x7e, 0xee, 0xbb,
0xf1, 0xa7, 0x2a, 0xfc,
};
static const size_t TEST_DVPT256_94_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_94_INPUT[] = {
0xf5, 0x73, 0x0a, 0x05, 0xfe, 0xc3, 0x1a, 0x11,
0x66, 0x2e, 0x2e, 0x14, 0xe3, 0x62, 0xcc, 0xc7,
0x5c, 0x7c, 0x30, 0xcd, 0xfc, 0xcb, 0xf9, 0x94,
};
static const size_t TEST_DVPT256_94_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_96_NONCE[] = {
0xd6, 0x5e, 0x0e, 0x53, 0xf7, 0x65, 0xf9, 0xd5,
0xe6, 0x79, 0x5c, 0x0c, 0x5e,
};
static const size_t TEST_DVPT256_96_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_96_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_96_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_96_EXPECTED[] = {
0x6c, 0xab, 0x30, 0x60, 0xbf, 0x3b, 0x33, 0xb1,
0x63, 0xb9, 0x33, 0xc2, 0xed, 0x0b, 0xa5, 0x14,
0x06, 0x81, 0x0b, 0x54, 0xd0, 0xed, 0xcf, 0x5c,
0x9d, 0x0e, 0xf4, 0xf7,
};
static const size_t TEST_DVPT256_96_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_96_INPUT[] = {
0x20, 0xe3, 0x94, 0xc7, 0xcc, 0x90, 0xbd, 0xfa,
0x61, 0x86, 0xfc, 0x1b, 0xa6, 0xff, 0xf1, 0x58,
0xdf, 0xc6, 0x90, 0xe2, 0x4b, 0xa4, 0xc9, 0xfb,
};
static const size_t TEST_DVPT256_96_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_101_NONCE[] = {
0xa6, 0xb2, 0x37, 0x1a, 0xcf, 0x83, 0x21, 0x86,
0x4c, 0x08, 0xdd, 0xb4, 0xd8,
};
static const size_t TEST_DVPT256_101_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_101_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_101_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_101_EXPECTED[] = {
0xc5, 0xaa, 0x50, 0x0d, 0x1f, 0x7c, 0x09, 0xa5,
0x90, 0xe9, 0xd1, 0x5d, 0x68, 0x60, 0xc4, 0x43,
0x36, 0x84, 0xe0, 0x4d, 0xd6, 0xbc, 0x5c, 0x8f,
0x94, 0xf2, 0x23, 0xf0,
};
static const size_t TEST_DVPT256_101_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_101_INPUT[] = {
0x1a, 0x43, 0xca, 0x62, 0x80, 0x26, 0x21, 0x9c,
0x5a, 0x43, 0x0c, 0x54, 0x02, 0x1a, 0x5a, 0x31,
0x52, 0xae, 0x51, 0x71, 0x67, 0x39, 0x96, 0x35,
};
static const size_t TEST_DVPT256_101_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_103_NONCE[] = {
0xc2, 0xb6, 0x0f, 0x14, 0xc8, 0x94, 0xec, 0x61,
0x78, 0xfe, 0x79, 0x91, 0x9f,
};
static const size_t TEST_DVPT256_103_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_103_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_103_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_103_EXPECTED[] = {
0x85, 0x2c, 0xca, 0x90, 0x3d, 0x7f, 0xdf, 0x89,
0x98, 0x07, 0xbd, 0x14, 0x64, 0x20, 0x57, 0x53,
0x4c, 0x8a, 0x0c, 0xca, 0xcb, 0x8c, 0x7b, 0x8f,
0xb4, 0xd3, 0x5d, 0x44,
};
static const size_t TEST_DVPT256_103_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_103_INPUT[] = {
0x3e, 0x70, 0x7d, 0x98, 0xf1, 0x99, 0x72, 0xa6,
0x3d, 0x91, 0x3e, 0x6e, 0xa7, 0x53, 0x3a, 0xf2,
0xf4, 0x1f, 0xf9, 0x8a, 0xee, 0x2b, 0x2a, 0x36,
};
static const size_t TEST_DVPT256_103_INPUT_LEN = 24;
/* Alen = 0, Plen = 24, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_7_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_7_KEY[] = {
0x1b, 0x0e, 0x8d, 0xf6, 0x3c, 0x57, 0xf0, 0x5d,
0x9a, 0xc4, 0x57, 0x57, 0x5e, 0xa7, 0x64, 0x52,
0x4b, 0x86, 0x10, 0xae, 0x51, 0x64, 0xe6, 0x21,
0x5f, 0x42, 0x6f, 0x5a, 0x7a, 0xe6, 0xed, 0xe4,
};
static const size_t TEST_DVPT256_GROUP_7_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_105_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_105_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_105_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_105_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_105_EXPECTED[] = {
0xf0, 0x05, 0x0a, 0xd1, 0x63, 0x92, 0x02, 0x1a,
0x3f, 0x40, 0x20, 0x7b, 0xed, 0x35, 0x21, 0xfb,
0x1e, 0x9f, 0x80, 0x8f, 0x49, 0x83, 0x0c, 0x42,
0x3a, 0x57, 0x8d, 0x17, 0x99, 0x02, 0xf9, 0x12,
0xf9, 0xea, 0x1a, 0xfb, 0xce, 0x11, 0x20, 0xb3,
};
static const size_t TEST_DVPT256_105_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_105_INPUT[] = {
0x3c, 0x0e, 0x28, 0x15, 0xd3, 0x7d, 0x84, 0x4f,
0x7a, 0xc2, 0x40, 0xba, 0x9d, 0x6e, 0x3a, 0x0b,
0x2a, 0x86, 0xf7, 0x06, 0xe8, 0x85, 0x95, 0x9e,
};
static const size_t TEST_DVPT256_105_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_109_NONCE[] = {
0x15, 0x01, 0xa2, 0x43, 0xbf, 0x60, 0xb2, 0xcb,
0x40, 0xd5, 0xaa, 0x20, 0xca,
};
static const size_t TEST_DVPT256_109_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_109_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_109_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_109_EXPECTED[] = {
0x25, 0x4b, 0x84, 0x7d, 0x41, 0x75, 0xbb, 0xb4,
0x4a, 0x82, 0xb4, 0xe8, 0x05, 0x51, 0x4f, 0xa4,
0x44, 0xc2, 0x24, 0x71, 0x09, 0x33, 0xf3, 0xec,
0x8a, 0xaa, 0x3f, 0x01, 0x33, 0x23, 0x4c, 0x0c,
0xd9, 0x16, 0x09, 0x98, 0x2a, 0xdc, 0x03, 0x4b,
};
static const size_t TEST_DVPT256_109_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_109_INPUT[] = {
0xf5, 0x73, 0x0a, 0x05, 0xfe, 0xc3, 0x1a, 0x11,
0x66, 0x2e, 0x2e, 0x14, 0xe3, 0x62, 0xcc, 0xc7,
0x5c, 0x7c, 0x30, 0xcd, 0xfc, 0xcb, 0xf9, 0x94,
};
static const size_t TEST_DVPT256_109_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_111_NONCE[] = {
0xd6, 0x5e, 0x0e, 0x53, 0xf7, 0x65, 0xf9, 0xd5,
0xe6, 0x79, 0x5c, 0x0c, 0x5e,
};
static const size_t TEST_DVPT256_111_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_111_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_111_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_111_EXPECTED[] = {
0xc3, 0x61, 0x8c, 0x99, 0x1b, 0x15, 0xde, 0x64,
0x1d, 0x29, 0x14, 0x19, 0xff, 0x69, 0x57, 0xe8,
0xb9, 0xae, 0x50, 0x46, 0xdd, 0x8c, 0x6f, 0x08,
0xfa, 0xfb, 0x76, 0xad, 0xf1, 0x2f, 0x36, 0x74,
0x03, 0x47, 0xe3, 0xed, 0xae, 0x62, 0xbc, 0xa4,
};
static const size_t TEST_DVPT256_111_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_111_INPUT[] = {
0x20, 0xe3, 0x94, 0xc7, 0xcc, 0x90, 0xbd, 0xfa,
0x61, 0x86, 0xfc, 0x1b, 0xa6, 0xff, 0xf1, 0x58,
0xdf, 0xc6, 0x90, 0xe2, 0x4b, 0xa4, 0xc9, 0xfb,
};
static const size_t TEST_DVPT256_111_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_116_NONCE[] = {
0xa6, 0xb2, 0x37, 0x1a, 0xcf, 0x83, 0x21, 0x86,
0x4c, 0x08, 0xdd, 0xb4, 0xd8,
};
static const size_t TEST_DVPT256_116_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_116_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_116_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_116_EXPECTED[] = {
0xbd, 0x37, 0x32, 0x6d, 0xa1, 0x8e, 0x5a, 0xc7,
0x9a, 0x1a, 0x95, 0x12, 0xf7, 0x24, 0xbb, 0x53,
0x95, 0x30, 0x86, 0x85, 0x76, 0xb7, 0x9c, 0x67,
0xac, 0xb5, 0xa5, 0x1d, 0x10, 0xa5, 0x8d, 0x65,
0x84, 0xfb, 0xe7, 0x3f, 0x10, 0x63, 0xc3, 0x1b,
};
static const size_t TEST_DVPT256_116_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_116_INPUT[] = {
0x1a, 0x43, 0xca, 0x62, 0x80, 0x26, 0x21, 0x9c,
0x5a, 0x43, 0x0c, 0x54, 0x02, 0x1a, 0x5a, 0x31,
0x52, 0xae, 0x51, 0x71, 0x67, 0x39, 0x96, 0x35,
};
static const size_t TEST_DVPT256_116_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_118_NONCE[] = {
0xc2, 0xb6, 0x0f, 0x14, 0xc8, 0x94, 0xec, 0x61,
0x78, 0xfe, 0x79, 0x91, 0x9f,
};
static const size_t TEST_DVPT256_118_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_118_ADATA[] = {
0x00,
};
static const size_t TEST_DVPT256_118_ADATA_LEN = 0;
static const uint8_t TEST_DVPT256_118_EXPECTED[] = {
0xec, 0xd3, 0x37, 0x64, 0x00, 0x22, 0x63, 0x5c,
0xe1, 0xed, 0x27, 0x37, 0x56, 0xd0, 0x2b, 0x7f,
0xee, 0xb2, 0x51, 0x56, 0x14, 0xc1, 0xfa, 0xdc,
0x95, 0xc6, 0x6d, 0x3f, 0x41, 0x1b, 0x47, 0x88,
0x53, 0x88, 0x6a, 0xfd, 0x17, 0x7d, 0x88, 0xc3,
};
static const size_t TEST_DVPT256_118_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_118_INPUT[] = {
0x3e, 0x70, 0x7d, 0x98, 0xf1, 0x99, 0x72, 0xa6,
0x3d, 0x91, 0x3e, 0x6e, 0xa7, 0x53, 0x3a, 0xf2,
0xf4, 0x1f, 0xf9, 0x8a, 0xee, 0x2b, 0x2a, 0x36,
};
static const size_t TEST_DVPT256_118_INPUT_LEN = 24;
/* Alen = 32, Plen = 0, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_8_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_8_KEY[] = {
0x1b, 0x0e, 0x8d, 0xf6, 0x3c, 0x57, 0xf0, 0x5d,
0x9a, 0xc4, 0x57, 0x57, 0x5e, 0xa7, 0x64, 0x52,
0x4b, 0x86, 0x10, 0xae, 0x51, 0x64, 0xe6, 0x21,
0x5f, 0x42, 0x6f, 0x5a, 0x7a, 0xe6, 0xed, 0xe4,
};
static const size_t TEST_DVPT256_GROUP_8_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_120_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_120_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_120_ADATA[] = {
0xd3, 0xd5, 0x42, 0x4e, 0x20, 0xfb, 0xec, 0x43,
0xae, 0x49, 0x53, 0x53, 0xed, 0x83, 0x02, 0x71,
0x51, 0x5a, 0xb1, 0x04, 0xf8, 0x86, 0x0c, 0x98,
0x8d, 0x15, 0xb6, 0xd3, 0x6c, 0x03, 0x8e, 0xab,
};
static const size_t TEST_DVPT256_120_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_120_EXPECTED[] = {
0x92, 0xd0, 0x0f, 0xbe,
};
static const size_t TEST_DVPT256_120_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_120_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_120_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_124_NONCE[] = {
0x3f, 0xcb, 0x32, 0x8b, 0xc9, 0x64, 0x04,
};
static const size_t TEST_DVPT256_124_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_124_ADATA[] = {
0x10, 0xb2, 0xff, 0xed, 0x4f, 0x95, 0xaf, 0x0f,
0x98, 0xed, 0x4f, 0x77, 0xc6, 0x77, 0xb5, 0x78,
0x6a, 0xd0, 0x1b, 0x31, 0xc0, 0x95, 0xbb, 0xc6,
0xe1, 0xc9, 0x9c, 0xf1, 0x39, 0x77, 0xab, 0xba,
};
static const size_t TEST_DVPT256_124_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_124_EXPECTED[] = {
0x11, 0x25, 0x00, 0x56,
};
static const size_t TEST_DVPT256_124_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_124_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_124_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_126_NONCE[] = {
0xc4, 0x2a, 0xc6, 0x3d, 0xe6, 0xf1, 0x2a,
};
static const size_t TEST_DVPT256_126_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_126_ADATA[] = {
0x7f, 0xf8, 0xd0, 0x6c, 0x5a, 0xbc, 0xc5, 0x0d,
0x38, 0x20, 0xde, 0x34, 0xb0, 0x30, 0x89, 0xe6,
0xc5, 0xb2, 0x02, 0xbc, 0xba, 0xab, 0xca, 0x89,
0x28, 0x25, 0x55, 0x3d, 0x4d, 0x30, 0x02, 0x0a,
};
static const size_t TEST_DVPT256_126_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_126_EXPECTED[] = {
0x4e, 0xed, 0x80, 0xfd,
};
static const size_t TEST_DVPT256_126_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_126_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_126_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_131_NONCE[] = {
0x3a, 0x17, 0x01, 0xb1, 0x85, 0xd3, 0x3a,
};
static const size_t TEST_DVPT256_131_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_131_ADATA[] = {
0xe5, 0xd5, 0x4d, 0xf8, 0xed, 0x9f, 0x89, 0xb9,
0x8c, 0x5e, 0xbb, 0x1b, 0xc5, 0xd5, 0x27, 0x9c,
0x2e, 0x18, 0x27, 0x84, 0xff, 0x4c, 0xd9, 0xc8,
0x69, 0xae, 0x15, 0x2e, 0x29, 0xd7, 0xa2, 0xb2,
};
static const size_t TEST_DVPT256_131_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_131_EXPECTED[] = {
0x9a, 0x53, 0x82, 0xc3,
};
static const size_t TEST_DVPT256_131_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_131_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_131_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_133_NONCE[] = {
0x4f, 0x49, 0x0c, 0xe0, 0x7e, 0x01, 0x50,
};
static const size_t TEST_DVPT256_133_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_133_ADATA[] = {
0x3e, 0x12, 0xd0, 0x96, 0x32, 0xc6, 0x44, 0xc5,
0x40, 0x07, 0x7c, 0x6f, 0x90, 0x72, 0x6d, 0x41,
0x67, 0x42, 0x3a, 0x67, 0x93, 0x22, 0xb2, 0x00,
0x0a, 0x3f, 0x19, 0xcf, 0xce, 0xa0, 0x2b, 0x33,
};
static const size_t TEST_DVPT256_133_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_133_EXPECTED[] = {
0xe1, 0x84, 0x2c, 0x46,
};
static const size_t TEST_DVPT256_133_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_133_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_133_INPUT_LEN = 0;
/* Alen = 32, Plen = 0, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_9_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_9_KEY[] = {
0xa4, 0xbc, 0x10, 0xb1, 0xa6, 0x2c, 0x96, 0xd4,
0x59, 0xfb, 0xaf, 0x3a, 0x5a, 0xa3, 0xfa, 0xce,
0x73, 0x13, 0xbb, 0x9e, 0x12, 0x53, 0xe6, 0x96,
0xf9, 0x6a, 0x7a, 0x8e, 0x36, 0x80, 0x10, 0x88,
};
static const size_t TEST_DVPT256_GROUP_9_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_135_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_135_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_135_ADATA[] = {
0xd3, 0xd5, 0x42, 0x4e, 0x20, 0xfb, 0xec, 0x43,
0xae, 0x49, 0x53, 0x53, 0xed, 0x83, 0x02, 0x71,
0x51, 0x5a, 0xb1, 0x04, 0xf8, 0x86, 0x0c, 0x98,
0x8d, 0x15, 0xb6, 0xd3, 0x6c, 0x03, 0x8e, 0xab,
};
static const size_t TEST_DVPT256_135_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_135_EXPECTED[] = {
0x93, 0xaf, 0x11, 0xa0, 0x83, 0x79, 0xeb, 0x37,
0xa1, 0x6a, 0xa2, 0x83, 0x7f, 0x09, 0xd6, 0x9d,
};
static const size_t TEST_DVPT256_135_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_135_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_135_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_139_NONCE[] = {
0x3f, 0xcb, 0x32, 0x8b, 0xc9, 0x64, 0x04,
};
static const size_t TEST_DVPT256_139_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_139_ADATA[] = {
0x10, 0xb2, 0xff, 0xed, 0x4f, 0x95, 0xaf, 0x0f,
0x98, 0xed, 0x4f, 0x77, 0xc6, 0x77, 0xb5, 0x78,
0x6a, 0xd0, 0x1b, 0x31, 0xc0, 0x95, 0xbb, 0xc6,
0xe1, 0xc9, 0x9c, 0xf1, 0x39, 0x77, 0xab, 0xba,
};
static const size_t TEST_DVPT256_139_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_139_EXPECTED[] = {
0xb3, 0x88, 0x4b, 0x69, 0xd1, 0x17, 0x14, 0x6c,
0xfa, 0x55, 0x29, 0x90, 0x17, 0x53, 0xdd, 0xc0,
};
static const size_t TEST_DVPT256_139_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_139_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_139_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_141_NONCE[] = {
0xc4, 0x2a, 0xc6, 0x3d, 0xe6, 0xf1, 0x2a,
};
static const size_t TEST_DVPT256_141_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_141_ADATA[] = {
0x7f, 0xf8, 0xd0, 0x6c, 0x5a, 0xbc, 0xc5, 0x0d,
0x38, 0x20, 0xde, 0x34, 0xb0, 0x30, 0x89, 0xe6,
0xc5, 0xb2, 0x02, 0xbc, 0xba, 0xab, 0xca, 0x89,
0x28, 0x25, 0x55, 0x3d, 0x4d, 0x30, 0x02, 0x0a,
};
static const size_t TEST_DVPT256_141_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_141_EXPECTED[] = {
0xb5, 0x3d, 0x93, 0xcb, 0xfd, 0x3d, 0x5c, 0xf3,
0x72, 0x0c, 0xef, 0x50, 0x80, 0xbc, 0x72, 0x24,
};
static const size_t TEST_DVPT256_141_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_141_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_141_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_146_NONCE[] = {
0x3a, 0x17, 0x01, 0xb1, 0x85, 0xd3, 0x3a,
};
static const size_t TEST_DVPT256_146_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_146_ADATA[] = {
0xe5, 0xd5, 0x4d, 0xf8, 0xed, 0x9f, 0x89, 0xb9,
0x8c, 0x5e, 0xbb, 0x1b, 0xc5, 0xd5, 0x27, 0x9c,
0x2e, 0x18, 0x27, 0x84, 0xff, 0x4c, 0xd9, 0xc8,
0x69, 0xae, 0x15, 0x2e, 0x29, 0xd7, 0xa2, 0xb2,
};
static const size_t TEST_DVPT256_146_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_146_EXPECTED[] = {
0x0a, 0x5d, 0x1b, 0xc0, 0x2c, 0x5f, 0xe0, 0x96,
0xa8, 0xb9, 0xd9, 0x4d, 0x12, 0x67, 0xc4, 0x9a,
};
static const size_t TEST_DVPT256_146_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_146_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_146_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_148_NONCE[] = {
0x4f, 0x49, 0x0c, 0xe0, 0x7e, 0x01, 0x50,
};
static const size_t TEST_DVPT256_148_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_148_ADATA[] = {
0x3e, 0x12, 0xd0, 0x96, 0x32, 0xc6, 0x44, 0xc5,
0x40, 0x07, 0x7c, 0x6f, 0x90, 0x72, 0x6d, 0x41,
0x67, 0x42, 0x3a, 0x67, 0x93, 0x22, 0xb2, 0x00,
0x0a, 0x3f, 0x19, 0xcf, 0xce, 0xa0, 0x2b, 0x33,
};
static const size_t TEST_DVPT256_148_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_148_EXPECTED[] = {
0x1e, 0xda, 0x43, 0xbf, 0x07, 0xf2, 0xbf, 0x00,
0x31, 0x07, 0xf3, 0xa0, 0xba, 0x3a, 0x4c, 0x18,
};
static const size_t TEST_DVPT256_148_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_148_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_148_INPUT_LEN = 0;
/* Alen = 32, Plen = 0, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_10_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_10_KEY[] = {
0xa4, 0xbc, 0x10, 0xb1, 0xa6, 0x2c, 0x96, 0xd4,
0x59, 0xfb, 0xaf, 0x3a, 0x5a, 0xa3, 0xfa, 0xce,
0x73, 0x13, 0xbb, 0x9e, 0x12, 0x53, 0xe6, 0x96,
0xf9, 0x6a, 0x7a, 0x8e, 0x36, 0x80, 0x10, 0x88,
};
static const size_t TEST_DVPT256_GROUP_10_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_150_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_150_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_150_ADATA[] = {
0x3c, 0x0e, 0x28, 0x15, 0xd3, 0x7d, 0x84, 0x4f,
0x7a, 0xc2, 0x40, 0xba, 0x9d, 0x6e, 0x3a, 0x0b,
0x2a, 0x86, 0xf7, 0x06, 0xe8, 0x85, 0x95, 0x9e,
0x09, 0xa1, 0x00, 0x5e, 0x02, 0x4f, 0x69, 0x07,
};
static const size_t TEST_DVPT256_150_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_150_EXPECTED[] = {
0x86, 0x6d, 0x42, 0x27,
};
static const size_t TEST_DVPT256_150_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_150_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_150_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_154_NONCE[] = {
0xdf, 0xdc, 0xbd, 0xff, 0x32, 0x9f, 0x7a, 0xf7,
0x07, 0x31, 0xd8, 0xe2, 0x76,
};
static const size_t TEST_DVPT256_154_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_154_ADATA[] = {
0x2a, 0xe5, 0x6d, 0xdd, 0xe2, 0x87, 0x6d, 0x70,
0xb3, 0xb3, 0x4e, 0xda, 0x8c, 0x2b, 0x1d, 0x09,
0x6c, 0x83, 0x6d, 0x52, 0x25, 0xd5, 0x3e, 0xc4,
0x60, 0xb7, 0x24, 0xb6, 0xe1, 0x6a, 0xa5, 0xa3,
};
static const size_t TEST_DVPT256_154_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_154_EXPECTED[] = {
0xc4, 0xac, 0x09, 0x52,
};
static const size_t TEST_DVPT256_154_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_154_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_154_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_156_NONCE[] = {
0x60, 0xf2, 0x49, 0x0b, 0xa0, 0xc6, 0x58, 0x84,
0x88, 0x59, 0xfc, 0xbe, 0xa8,
};
static const size_t TEST_DVPT256_156_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_156_ADATA[] = {
0x3a, 0xd7, 0x43, 0x28, 0x30, 0x64, 0x92, 0x9b,
0xf4, 0xfe, 0x4e, 0x08, 0x07, 0xf7, 0x10, 0xf5,
0xe6, 0xa2, 0x73, 0xe2, 0x26, 0x14, 0xc7, 0x28,
0xc3, 0x28, 0x0a, 0x27, 0xb6, 0xc6, 0x14, 0xa0,
};
static const size_t TEST_DVPT256_156_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_156_EXPECTED[] = {
0x27, 0xc3, 0x95, 0x3d,
};
static const size_t TEST_DVPT256_156_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_156_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_156_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_161_NONCE[] = {
0xdb, 0x11, 0x3f, 0x38, 0xf0, 0x50, 0x46, 0x15,
0xc5, 0xc9, 0x34, 0x7c, 0x3d,
};
static const size_t TEST_DVPT256_161_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_161_ADATA[] = {
0x3b, 0x71, 0xbc, 0x84, 0xe4, 0x8c, 0x6d, 0xad,
0xf6, 0xea, 0xd1, 0x46, 0x21, 0xd2, 0x24, 0x68,
0xa3, 0xd4, 0xc9, 0xc1, 0x03, 0xac, 0x96, 0x97,
0x02, 0x69, 0x73, 0x0b, 0xcf, 0xce, 0x23, 0x9b,
};
static const size_t TEST_DVPT256_161_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_161_EXPECTED[] = {
0xc3, 0x8f, 0xbd, 0xff,
};
static const size_t TEST_DVPT256_161_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_161_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_161_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_163_NONCE[] = {
0xd3, 0x5f, 0x53, 0x1f, 0x71, 0x46, 0x94, 0xb5,
0xe4, 0x93, 0x03, 0xa9, 0x80,
};
static const size_t TEST_DVPT256_163_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_163_ADATA[] = {
0x55, 0xb7, 0x91, 0xee, 0x49, 0x52, 0x99, 0x91,
0x6f, 0xf3, 0xc2, 0x32, 0x7b, 0x49, 0x90, 0x95,
0x2b, 0xeb, 0xd0, 0xa2, 0xda, 0x9a, 0xcf, 0xc5,
0x53, 0xc6, 0xc9, 0x96, 0xe3, 0x54, 0xa4, 0xb5,
};
static const size_t TEST_DVPT256_163_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_163_EXPECTED[] = {
0xd3, 0x4e, 0x90, 0xbb,
};
static const size_t TEST_DVPT256_163_EXPECTED_LEN = 4;
static const uint8_t TEST_DVPT256_163_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_163_INPUT_LEN = 0;
/* Alen = 32, Plen = 0, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_11_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_11_KEY[] = {
0x8c, 0x5c, 0xf3, 0x45, 0x7f, 0xf2, 0x22, 0x28,
0xc3, 0x9c, 0x05, 0x1c, 0x4e, 0x05, 0xed, 0x40,
0x93, 0x65, 0x7e, 0xb3, 0x03, 0xf8, 0x59, 0xa9,
0xd4, 0xb0, 0xf8, 0xbe, 0x01, 0x27, 0xd8, 0x8a,
};
static const size_t TEST_DVPT256_GROUP_11_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_165_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_165_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_165_ADATA[] = {
0x3c, 0x0e, 0x28, 0x15, 0xd3, 0x7d, 0x84, 0x4f,
0x7a, 0xc2, 0x40, 0xba, 0x9d, 0x6e, 0x3a, 0x0b,
0x2a, 0x86, 0xf7, 0x06, 0xe8, 0x85, 0x95, 0x9e,
0x09, 0xa1, 0x00, 0x5e, 0x02, 0x4f, 0x69, 0x07,
};
static const size_t TEST_DVPT256_165_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_165_EXPECTED[] = {
0x86, 0x7b, 0x0d, 0x87, 0xcf, 0x6e, 0x0f, 0x71,
0x82, 0x00, 0xa9, 0x7b, 0x4f, 0x6d, 0x5a, 0xd5,
};
static const size_t TEST_DVPT256_165_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_165_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_165_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_169_NONCE[] = {
0xdf, 0xdc, 0xbd, 0xff, 0x32, 0x9f, 0x7a, 0xf7,
0x07, 0x31, 0xd8, 0xe2, 0x76,
};
static const size_t TEST_DVPT256_169_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_169_ADATA[] = {
0x2a, 0xe5, 0x6d, 0xdd, 0xe2, 0x87, 0x6d, 0x70,
0xb3, 0xb3, 0x4e, 0xda, 0x8c, 0x2b, 0x1d, 0x09,
0x6c, 0x83, 0x6d, 0x52, 0x25, 0xd5, 0x3e, 0xc4,
0x60, 0xb7, 0x24, 0xb6, 0xe1, 0x6a, 0xa5, 0xa3,
};
static const size_t TEST_DVPT256_169_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_169_EXPECTED[] = {
0xad, 0x87, 0x9c, 0x64, 0x42, 0x5e, 0x6c, 0x1e,
0xc4, 0x84, 0x1b, 0xbb, 0x0f, 0x99, 0xaa, 0x8b,
};
static const size_t TEST_DVPT256_169_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_169_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_169_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_171_NONCE[] = {
0x60, 0xf2, 0x49, 0x0b, 0xa0, 0xc6, 0x58, 0x84,
0x88, 0x59, 0xfc, 0xbe, 0xa8,
};
static const size_t TEST_DVPT256_171_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_171_ADATA[] = {
0x3a, 0xd7, 0x43, 0x28, 0x30, 0x64, 0x92, 0x9b,
0xf4, 0xfe, 0x4e, 0x08, 0x07, 0xf7, 0x10, 0xf5,
0xe6, 0xa2, 0x73, 0xe2, 0x26, 0x14, 0xc7, 0x28,
0xc3, 0x28, 0x0a, 0x27, 0xb6, 0xc6, 0x14, 0xa0,
};
static const size_t TEST_DVPT256_171_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_171_EXPECTED[] = {
0xe2, 0x75, 0x1f, 0x15, 0x3f, 0xc7, 0x6c, 0x0d,
0xec, 0x5e, 0x0c, 0xf2, 0xd3, 0x0c, 0x1a, 0x28,
};
static const size_t TEST_DVPT256_171_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_171_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_171_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_176_NONCE[] = {
0xdb, 0x11, 0x3f, 0x38, 0xf0, 0x50, 0x46, 0x15,
0xc5, 0xc9, 0x34, 0x7c, 0x3d,
};
static const size_t TEST_DVPT256_176_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_176_ADATA[] = {
0x3b, 0x71, 0xbc, 0x84, 0xe4, 0x8c, 0x6d, 0xad,
0xf6, 0xea, 0xd1, 0x46, 0x21, 0xd2, 0x24, 0x68,
0xa3, 0xd4, 0xc9, 0xc1, 0x03, 0xac, 0x96, 0x97,
0x02, 0x69, 0x73, 0x0b, 0xcf, 0xce, 0x23, 0x9b,
};
static const size_t TEST_DVPT256_176_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_176_EXPECTED[] = {
0xfc, 0x85, 0x46, 0x4a, 0x81, 0xfe, 0x37, 0x2c,
0x12, 0xc9, 0xe4, 0xf0, 0xf3, 0xbf, 0x9c, 0x37,
};
static const size_t TEST_DVPT256_176_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_176_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_176_INPUT_LEN = 0;
static const uint8_t TEST_DVPT256_178_NONCE[] = {
0xd3, 0x5f, 0x53, 0x1f, 0x71, 0x46, 0x94, 0xb5,
0xe4, 0x93, 0x03, 0xa9, 0x80,
};
static const size_t TEST_DVPT256_178_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_178_ADATA[] = {
0x55, 0xb7, 0x91, 0xee, 0x49, 0x52, 0x99, 0x91,
0x6f, 0xf3, 0xc2, 0x32, 0x7b, 0x49, 0x90, 0x95,
0x2b, 0xeb, 0xd0, 0xa2, 0xda, 0x9a, 0xcf, 0xc5,
0x53, 0xc6, 0xc9, 0x96, 0xe3, 0x54, 0xa4, 0xb5,
};
static const size_t TEST_DVPT256_178_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_178_EXPECTED[] = {
0xb1, 0xc0, 0x9b, 0x09, 0x37, 0x88, 0xda, 0x19,
0xe3, 0x3c, 0x5a, 0x6e, 0x82, 0xed, 0x96, 0x27,
};
static const size_t TEST_DVPT256_178_EXPECTED_LEN = 16;
static const uint8_t TEST_DVPT256_178_INPUT[] = {
0x00,
};
static const size_t TEST_DVPT256_178_INPUT_LEN = 0;
/* Alen = 32, Plen = 24, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_12_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_12_KEY[] = {
0x8c, 0x5c, 0xf3, 0x45, 0x7f, 0xf2, 0x22, 0x28,
0xc3, 0x9c, 0x05, 0x1c, 0x4e, 0x05, 0xed, 0x40,
0x93, 0x65, 0x7e, 0xb3, 0x03, 0xf8, 0x59, 0xa9,
0xd4, 0xb0, 0xf8, 0xbe, 0x01, 0x27, 0xd8, 0x8a,
};
static const size_t TEST_DVPT256_GROUP_12_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_180_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_180_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_180_ADATA[] = {
0xd3, 0xd5, 0x42, 0x4e, 0x20, 0xfb, 0xec, 0x43,
0xae, 0x49, 0x53, 0x53, 0xed, 0x83, 0x02, 0x71,
0x51, 0x5a, 0xb1, 0x04, 0xf8, 0x86, 0x0c, 0x98,
0x8d, 0x15, 0xb6, 0xd3, 0x6c, 0x03, 0x8e, 0xab,
};
static const size_t TEST_DVPT256_180_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_180_EXPECTED[] = {
0xc2, 0xfe, 0x12, 0x65, 0x81, 0x39, 0xf5, 0xd0,
0xdd, 0x22, 0xca, 0xdf, 0x2e, 0x90, 0x16, 0x95,
0xb5, 0x79, 0x30, 0x2a, 0x72, 0xfc, 0x56, 0x08,
0x3e, 0xbc, 0x77, 0x20,
};
static const size_t TEST_DVPT256_180_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_180_INPUT[] = {
0x78, 0xc4, 0x6e, 0x32, 0x49, 0xca, 0x28, 0xe1,
0xef, 0x05, 0x31, 0xd8, 0x0f, 0xd3, 0x7c, 0x12,
0x4d, 0x9a, 0xec, 0xb7, 0xbe, 0x66, 0x68, 0xe3,
};
static const size_t TEST_DVPT256_180_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_184_NONCE[] = {
0x57, 0xb9, 0x40, 0x55, 0x0a, 0x38, 0x3b,
};
static const size_t TEST_DVPT256_184_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_184_ADATA[] = {
0x33, 0xc2, 0xc3, 0xa5, 0x7b, 0xf8, 0x39, 0x3b,
0x12, 0x69, 0x82, 0xc9, 0x6d, 0x87, 0xda, 0xea,
0xcd, 0x5e, 0xad, 0xad, 0x15, 0x19, 0x07, 0x3a,
0xd8, 0xc8, 0x4c, 0xb9, 0xb7, 0x60, 0x29, 0x6f,
};
static const size_t TEST_DVPT256_184_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_184_EXPECTED[] = {
0xe1, 0xb4, 0xec, 0x42, 0x79, 0xbb, 0x62, 0x90,
0x2c, 0x12, 0x52, 0x1e, 0x6b, 0x87, 0x41, 0x71,
0x69, 0x5c, 0x5d, 0xa4, 0x6c, 0x64, 0x7c, 0xc0,
0x3b, 0x91, 0xff, 0x03,
};
static const size_t TEST_DVPT256_184_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_184_INPUT[] = {
0x6f, 0xb5, 0xce, 0x32, 0xa8, 0x51, 0x67, 0x67,
0x53, 0xba, 0x35, 0x23, 0xed, 0xc5, 0xca, 0x82,
0xaf, 0x18, 0x43, 0xff, 0xc0, 0x8f, 0x1e, 0xf0,
};
static const size_t TEST_DVPT256_184_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_186_NONCE[] = {
0xf3, 0x22, 0x22, 0xe9, 0xee, 0xc4, 0xbd,
};
static const size_t TEST_DVPT256_186_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_186_ADATA[] = {
0x68, 0x45, 0x95, 0xe3, 0x6e, 0xda, 0x1d, 0xb5,
0xf5, 0x86, 0x94, 0x1c, 0x9f, 0x34, 0xc9, 0xf8,
0xd4, 0x77, 0x97, 0x0d, 0x5c, 0xcc, 0x14, 0x63,
0x2d, 0x1f, 0x0c, 0xec, 0x81, 0x90, 0xae, 0x68,
};
static const size_t TEST_DVPT256_186_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_186_EXPECTED[] = {
0x22, 0x4d, 0xb2, 0x1b, 0xeb, 0x8c, 0xd0, 0x06,
0x90, 0x07, 0x66, 0x0e, 0x78, 0x3c, 0x3f, 0x85,
0x70, 0x6b, 0x01, 0x41, 0x28, 0x36, 0x8a, 0xab,
0x2a, 0x4e, 0x56, 0xa7,
};
static const size_t TEST_DVPT256_186_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_186_INPUT[] = {
0x2c, 0x29, 0xd4, 0xe2, 0xbb, 0x92, 0x94, 0xe9,
0x0c, 0xb0, 0x4e, 0xc6, 0x97, 0xe6, 0x63, 0xa1,
0xf7, 0x38, 0x5a, 0x39, 0xf9, 0x0c, 0x8c, 0xcf,
};
static const size_t TEST_DVPT256_186_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_191_NONCE[] = {
0x14, 0xc9, 0xbd, 0x56, 0x1c, 0x47, 0xc1,
};
static const size_t TEST_DVPT256_191_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_191_ADATA[] = {
0x14, 0x1a, 0xe3, 0x65, 0xf8, 0xe6, 0x5a, 0xb9,
0x19, 0x6c, 0x4e, 0x8c, 0xd4, 0xe6, 0x21, 0x89,
0xb3, 0x04, 0xd6, 0x7d, 0xe3, 0x8f, 0x21, 0x17,
0xe8, 0x4e, 0xc0, 0xec, 0x8f, 0x26, 0x0e, 0xbd,
};
static const size_t TEST_DVPT256_191_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_191_EXPECTED[] = {
0x61, 0xb4, 0x6c, 0x90, 0x24, 0xee, 0xd3, 0x98,
0x90, 0x64, 0xa5, 0x2d, 0xf9, 0x03, 0x49, 0xc1,
0x8e, 0x14, 0xe4, 0xb5, 0x52, 0x77, 0x9d, 0x3f,
0x8f, 0x9d, 0x68, 0x14,
};
static const size_t TEST_DVPT256_191_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_191_INPUT[] = {
0xc2, 0x25, 0x24, 0xa1, 0xea, 0x44, 0x4b, 0xe3,
0x41, 0x2b, 0x0d, 0x77, 0x3d, 0x4e, 0xa2, 0xff,
0x0a, 0xf4, 0xc1, 0xad, 0x23, 0x83, 0xcb, 0xa8,
};
static const size_t TEST_DVPT256_191_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_193_NONCE[] = {
0x1c, 0xce, 0xc9, 0x92, 0x3a, 0xa6, 0xe8,
};
static const size_t TEST_DVPT256_193_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_193_ADATA[] = {
0x88, 0xa6, 0xd0, 0x37, 0x00, 0x9a, 0x1c, 0x17,
0x56, 0xf7, 0x2b, 0xb4, 0x58, 0x9d, 0x6d, 0x94,
0x0b, 0xd5, 0x14, 0xed, 0x55, 0x38, 0x6b, 0xae,
0xfa, 0xcc, 0x6a, 0xc3, 0xca, 0x6f, 0x87, 0x95,
};
static const size_t TEST_DVPT256_193_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_193_EXPECTED[] = {
0x52, 0xf8, 0x20, 0x55, 0x34, 0x44, 0x7d, 0x72,
0x2b, 0xe2, 0xb9, 0x37, 0x7f, 0x73, 0x95, 0x93,
0x8c, 0xc8, 0x8a, 0xf0, 0x81, 0xa1, 0x1c, 0xcb,
0x0d, 0x83, 0xfa, 0x19,
};
static const size_t TEST_DVPT256_193_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_193_INPUT[] = {
0x51, 0x8a, 0x7f, 0xb1, 0x1c, 0x46, 0x3b, 0xf2,
0x37, 0x98, 0x98, 0x21, 0x18, 0xf3, 0xcf, 0xe4,
0xd7, 0xdd, 0xde, 0x91, 0x84, 0xf3, 0x7d, 0x4f,
};
static const size_t TEST_DVPT256_193_INPUT_LEN = 24;
/* Alen = 32, Plen = 24, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_13_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_13_KEY[] = {
0x70, 0x53, 0x34, 0xe3, 0x0f, 0x53, 0xdd, 0x2f,
0x92, 0xd1, 0x90, 0xd2, 0xc1, 0x43, 0x7c, 0x87,
0x72, 0xf9, 0x40, 0xc5, 0x5a, 0xa3, 0x5e, 0x56,
0x22, 0x14, 0xed, 0x45, 0xbd, 0x45, 0x8f, 0xfe,
};
static const size_t TEST_DVPT256_GROUP_13_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_195_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1,
};
static const size_t TEST_DVPT256_195_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_195_ADATA[] = {
0xd3, 0xd5, 0x42, 0x4e, 0x20, 0xfb, 0xec, 0x43,
0xae, 0x49, 0x53, 0x53, 0xed, 0x83, 0x02, 0x71,
0x51, 0x5a, 0xb1, 0x04, 0xf8, 0x86, 0x0c, 0x98,
0x8d, 0x15, 0xb6, 0xd3, 0x6c, 0x03, 0x8e, 0xab,
};
static const size_t TEST_DVPT256_195_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_195_EXPECTED[] = {
0x33, 0x41, 0x16, 0x8e, 0xb8, 0xc4, 0x84, 0x68,
0xc4, 0x14, 0x34, 0x7f, 0xb0, 0x8f, 0x71, 0xd2,
0x08, 0x6f, 0x7c, 0x2d, 0x1b, 0xd5, 0x81, 0xce,
0x1a, 0xc6, 0x8b, 0xd4, 0x2f, 0x5e, 0xc7, 0xfa,
0x7e, 0x06, 0x8c, 0xc0, 0xec, 0xd7, 0x9c, 0x2a,
};
static const size_t TEST_DVPT256_195_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_195_INPUT[] = {
0x78, 0xc4, 0x6e, 0x32, 0x49, 0xca, 0x28, 0xe1,
0xef, 0x05, 0x31, 0xd8, 0x0f, 0xd3, 0x7c, 0x12,
0x4d, 0x9a, 0xec, 0xb7, 0xbe, 0x66, 0x68, 0xe3,
};
static const size_t TEST_DVPT256_195_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_199_NONCE[] = {
0x57, 0xb9, 0x40, 0x55, 0x0a, 0x38, 0x3b,
};
static const size_t TEST_DVPT256_199_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_199_ADATA[] = {
0x33, 0xc2, 0xc3, 0xa5, 0x7b, 0xf8, 0x39, 0x3b,
0x12, 0x69, 0x82, 0xc9, 0x6d, 0x87, 0xda, 0xea,
0xcd, 0x5e, 0xad, 0xad, 0x15, 0x19, 0x07, 0x3a,
0xd8, 0xc8, 0x4c, 0xb9, 0xb7, 0x60, 0x29, 0x6f,
};
static const size_t TEST_DVPT256_199_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_199_EXPECTED[] = {
0xfb, 0xfe, 0xd2, 0xc9, 0x4f, 0x50, 0xca, 0x10,
0x46, 0x6d, 0xa9, 0x90, 0x3e, 0xf8, 0x58, 0x33,
0xad, 0x48, 0xca, 0x00, 0x55, 0x6e, 0x66, 0xd1,
0x4d, 0x8b, 0x30, 0xdf, 0x94, 0x1f, 0x35, 0x36,
0xff, 0xb4, 0x20, 0x83, 0xef, 0x0e, 0x1c, 0x30,
};
static const size_t TEST_DVPT256_199_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_199_INPUT[] = {
0x6f, 0xb5, 0xce, 0x32, 0xa8, 0x51, 0x67, 0x67,
0x53, 0xba, 0x35, 0x23, 0xed, 0xc5, 0xca, 0x82,
0xaf, 0x18, 0x43, 0xff, 0xc0, 0x8f, 0x1e, 0xf0,
};
static const size_t TEST_DVPT256_199_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_201_NONCE[] = {
0xf3, 0x22, 0x22, 0xe9, 0xee, 0xc4, 0xbd,
};
static const size_t TEST_DVPT256_201_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_201_ADATA[] = {
0x68, 0x45, 0x95, 0xe3, 0x6e, 0xda, 0x1d, 0xb5,
0xf5, 0x86, 0x94, 0x1c, 0x9f, 0x34, 0xc9, 0xf8,
0xd4, 0x77, 0x97, 0x0d, 0x5c, 0xcc, 0x14, 0x63,
0x2d, 0x1f, 0x0c, 0xec, 0x81, 0x90, 0xae, 0x68,
};
static const size_t TEST_DVPT256_201_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_201_EXPECTED[] = {
0xda, 0xe1, 0x3e, 0x69, 0x67, 0xc8, 0xb1, 0xee,
0x0d, 0xd2, 0xd5, 0xba, 0x1d, 0xd1, 0xde, 0x69,
0xf2, 0x2c, 0x95, 0xda, 0x39, 0x52, 0x8f, 0x9e,
0xf7, 0x8e, 0x9e, 0x5e, 0x9f, 0xaa, 0x05, 0x81,
0x12, 0xaf, 0x57, 0xf4, 0xac, 0x78, 0xdb, 0x2c,
};
static const size_t TEST_DVPT256_201_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_201_INPUT[] = {
0x2c, 0x29, 0xd4, 0xe2, 0xbb, 0x92, 0x94, 0xe9,
0x0c, 0xb0, 0x4e, 0xc6, 0x97, 0xe6, 0x63, 0xa1,
0xf7, 0x38, 0x5a, 0x39, 0xf9, 0x0c, 0x8c, 0xcf,
};
static const size_t TEST_DVPT256_201_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_206_NONCE[] = {
0x14, 0xc9, 0xbd, 0x56, 0x1c, 0x47, 0xc1,
};
static const size_t TEST_DVPT256_206_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_206_ADATA[] = {
0x14, 0x1a, 0xe3, 0x65, 0xf8, 0xe6, 0x5a, 0xb9,
0x19, 0x6c, 0x4e, 0x8c, 0xd4, 0xe6, 0x21, 0x89,
0xb3, 0x04, 0xd6, 0x7d, 0xe3, 0x8f, 0x21, 0x17,
0xe8, 0x4e, 0xc0, 0xec, 0x8f, 0x26, 0x0e, 0xbd,
};
static const size_t TEST_DVPT256_206_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_206_EXPECTED[] = {
0xa6, 0x54, 0x23, 0x8f, 0xb8, 0xb0, 0x5e, 0x29,
0x3d, 0xba, 0x07, 0xf9, 0xd6, 0x8d, 0x75, 0xa7,
0xf0, 0xfb, 0xf4, 0x0f, 0xe2, 0x0e, 0xda, 0xeb,
0xa1, 0x58, 0x6b, 0xf9, 0x22, 0x41, 0x2e, 0x73,
0xce, 0x33, 0x8e, 0x37, 0x26, 0x15, 0xc3, 0xbc,
};
static const size_t TEST_DVPT256_206_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_206_INPUT[] = {
0xc2, 0x25, 0x24, 0xa1, 0xea, 0x44, 0x4b, 0xe3,
0x41, 0x2b, 0x0d, 0x77, 0x3d, 0x4e, 0xa2, 0xff,
0x0a, 0xf4, 0xc1, 0xad, 0x23, 0x83, 0xcb, 0xa8,
};
static const size_t TEST_DVPT256_206_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_208_NONCE[] = {
0x1c, 0xce, 0xc9, 0x92, 0x3a, 0xa6, 0xe8,
};
static const size_t TEST_DVPT256_208_NONCE_LEN = 7;
static const uint8_t TEST_DVPT256_208_ADATA[] = {
0x88, 0xa6, 0xd0, 0x37, 0x00, 0x9a, 0x1c, 0x17,
0x56, 0xf7, 0x2b, 0xb4, 0x58, 0x9d, 0x6d, 0x94,
0x0b, 0xd5, 0x14, 0xed, 0x55, 0x38, 0x6b, 0xae,
0xfa, 0xcc, 0x6a, 0xc3, 0xca, 0x6f, 0x87, 0x95,
};
static const size_t TEST_DVPT256_208_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_208_EXPECTED[] = {
0x76, 0x50, 0x67, 0xef, 0x76, 0x89, 0x08, 0xd9,
0x1e, 0xe4, 0xc3, 0x92, 0x39, 0x43, 0xe0, 0xc7,
0xbe, 0x70, 0xe2, 0xe0, 0x6d, 0xb9, 0x9a, 0x4b,
0x3e, 0x3f, 0x51, 0xee, 0x37, 0xfd, 0xcc, 0x5d,
0x81, 0xdd, 0x85, 0xd9, 0xe9, 0xd4, 0xf4, 0x4e,
};
static const size_t TEST_DVPT256_208_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_208_INPUT[] = {
0x51, 0x8a, 0x7f, 0xb1, 0x1c, 0x46, 0x3b, 0xf2,
0x37, 0x98, 0x98, 0x21, 0x18, 0xf3, 0xcf, 0xe4,
0xd7, 0xdd, 0xde, 0x91, 0x84, 0xf3, 0x7d, 0x4f,
};
static const size_t TEST_DVPT256_208_INPUT_LEN = 24;
/* Alen = 32, Plen = 24, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT256_GROUP_14_MAC_LEN = 4;
static const uint8_t TEST_DVPT256_GROUP_14_KEY[] = {
0x70, 0x53, 0x34, 0xe3, 0x0f, 0x53, 0xdd, 0x2f,
0x92, 0xd1, 0x90, 0xd2, 0xc1, 0x43, 0x7c, 0x87,
0x72, 0xf9, 0x40, 0xc5, 0x5a, 0xa3, 0x5e, 0x56,
0x22, 0x14, 0xed, 0x45, 0xbd, 0x45, 0x8f, 0xfe,
};
static const size_t TEST_DVPT256_GROUP_14_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_210_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_210_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_210_ADATA[] = {
0x3c, 0x0e, 0x28, 0x15, 0xd3, 0x7d, 0x84, 0x4f,
0x7a, 0xc2, 0x40, 0xba, 0x9d, 0x6e, 0x3a, 0x0b,
0x2a, 0x86, 0xf7, 0x06, 0xe8, 0x85, 0x95, 0x9e,
0x09, 0xa1, 0x00, 0x5e, 0x02, 0x4f, 0x69, 0x07,
};
static const size_t TEST_DVPT256_210_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_210_EXPECTED[] = {
0xc0, 0xea, 0x40, 0x0b, 0x59, 0x95, 0x61, 0xe7,
0x90, 0x5b, 0x99, 0x26, 0x2b, 0x45, 0x65, 0xd5,
0xc3, 0xdc, 0x49, 0xfa, 0xd8, 0x4d, 0x7c, 0x69,
0xef, 0x89, 0x13, 0x39,
};
static const size_t TEST_DVPT256_210_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_210_INPUT[] = {
0xe8, 0xde, 0x97, 0x0f, 0x6e, 0xe8, 0xe8, 0x0e,
0xde, 0x93, 0x35, 0x81, 0xb5, 0xbc, 0xf4, 0xd8,
0x37, 0xe2, 0xb7, 0x2b, 0xaa, 0x8b, 0x00, 0xc3,
};
static const size_t TEST_DVPT256_210_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_214_NONCE[] = {
0x0d, 0xd6, 0x13, 0xc0, 0xfe, 0x28, 0xe9, 0x13,
0xc0, 0xed, 0xbb, 0x84, 0x04,
};
static const size_t TEST_DVPT256_214_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_214_ADATA[] = {
0x2a, 0xd3, 0x06, 0x57, 0x5b, 0x57, 0x7c, 0x2f,
0x61, 0xda, 0x72, 0x12, 0xab, 0x63, 0xe3, 0xdb,
0x39, 0x41, 0xf1, 0xf7, 0x51, 0xf2, 0x35, 0x6c,
0x74, 0x43, 0x53, 0x1a, 0x90, 0xb9, 0xd1, 0x41,
};
static const size_t TEST_DVPT256_214_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_214_EXPECTED[] = {
0xfa, 0xbe, 0x11, 0xc9, 0x62, 0x9e, 0x59, 0x82,
0x28, 0xf5, 0x20, 0x9f, 0x3d, 0xbc, 0xc6, 0x41,
0xfe, 0x4b, 0x1a, 0x22, 0xca, 0xdb, 0x08, 0x21,
0xd2, 0x89, 0x8c, 0x3b,
};
static const size_t TEST_DVPT256_214_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_214_INPUT[] = {
0x95, 0x22, 0xfb, 0x1f, 0x1a, 0xa5, 0x84, 0x93,
0xcb, 0xa6, 0x82, 0xd7, 0x88, 0x18, 0x6d, 0x90,
0x2c, 0xfc, 0x93, 0xe8, 0x0f, 0xd6, 0xb9, 0x98,
};
static const size_t TEST_DVPT256_214_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_216_NONCE[] = {
0x3e, 0x0f, 0xe3, 0x42, 0x7e, 0xed, 0xa8, 0x0f,
0x02, 0xdd, 0xa4, 0xfe, 0xd5,
};
static const size_t TEST_DVPT256_216_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_216_ADATA[] = {
0xae, 0x0d, 0x1c, 0x9c, 0x83, 0x4d, 0x60, 0xff,
0x0e, 0xcf, 0xb3, 0xc0, 0xd7, 0x8c, 0x72, 0xdd,
0xb7, 0x89, 0xe5, 0x8a, 0xdf, 0xc1, 0x66, 0xc8,
0x1d, 0x5f, 0xc6, 0x39, 0x5b, 0x31, 0xec, 0x33,
};
static const size_t TEST_DVPT256_216_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_216_EXPECTED[] = {
0xd8, 0x8f, 0x8f, 0xcd, 0x77, 0x21, 0x25, 0x21,
0x2c, 0xe0, 0x9c, 0x2a, 0x6e, 0x5b, 0x56, 0x93,
0xdd, 0x35, 0x07, 0x3f, 0x99, 0x20, 0x04, 0xf0,
0xd1, 0x8f, 0xc8, 0x89,
};
static const size_t TEST_DVPT256_216_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_216_INPUT[] = {
0x38, 0x33, 0x3c, 0xe7, 0x81, 0x10, 0xbf, 0x53,
0xa2, 0xc2, 0xab, 0xc7, 0xdb, 0x99, 0xe1, 0x33,
0xad, 0x21, 0x8c, 0xa4, 0x3f, 0xf7, 0xa7, 0xbc,
};
static const size_t TEST_DVPT256_216_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_221_NONCE[] = {
0x60, 0x12, 0x2c, 0xbd, 0x21, 0x9e, 0x5c, 0xf1,
0x74, 0x15, 0xe8, 0xbc, 0x09,
};
static const size_t TEST_DVPT256_221_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_221_ADATA[] = {
0x89, 0x5a, 0x45, 0xdd, 0xbe, 0x0c, 0x80, 0x79,
0x3e, 0xcc, 0xbf, 0x82, 0x0d, 0xe1, 0x3a, 0x23,
0x3b, 0x6a, 0xa7, 0x04, 0x5c, 0xfd, 0x53, 0x13,
0x38, 0x8e, 0x71, 0x84, 0xc3, 0x92, 0xb2, 0x16,
};
static const size_t TEST_DVPT256_221_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_221_EXPECTED[] = {
0x76, 0xbd, 0xd9, 0xa7, 0xb3, 0x4b, 0xf1, 0x4a,
0xe1, 0x21, 0xa8, 0x7f, 0xdf, 0xa1, 0x44, 0xf7,
0x1b, 0x84, 0x87, 0x44, 0xaf, 0x6a, 0x2f, 0x0b,
0x1c, 0x0d, 0x06, 0x7c,
};
static const size_t TEST_DVPT256_221_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_221_INPUT[] = {
0x79, 0x4e, 0x73, 0x49, 0x66, 0xe6, 0xd0, 0x00,
0x16, 0x99, 0xae, 0xc3, 0xf8, 0xab, 0x8f, 0x19,
0x4d, 0xe7, 0x65, 0x3d, 0x30, 0x91, 0xb1, 0xb9,
};
static const size_t TEST_DVPT256_221_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_223_NONCE[] = {
0x35, 0x42, 0xfb, 0xe0, 0xf5, 0x9a, 0x6d, 0x5f,
0x3a, 0xbf, 0x61, 0x9b, 0x7d,
};
static const size_t TEST_DVPT256_223_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_223_ADATA[] = {
0xdd, 0x45, 0x31, 0xf1, 0x58, 0xa2, 0xfa, 0x3b,
0xc8, 0xa3, 0x39, 0xf7, 0x70, 0x59, 0x50, 0x48,
0xf4, 0xa4, 0x2b, 0xc1, 0xb0, 0x3f, 0x2e, 0x82,
0x4e, 0xfc, 0x6b, 0xa4, 0x98, 0x51, 0x19, 0xd8,
};
static const size_t TEST_DVPT256_223_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_223_EXPECTED[] = {
0x61, 0x7d, 0x80, 0x36, 0xe2, 0x03, 0x9d, 0x51,
0x67, 0x09, 0x06, 0x23, 0x79, 0xe0, 0x55, 0x0c,
0xbd, 0x71, 0xeb, 0xb9, 0x0f, 0xea, 0x96, 0x7c,
0x79, 0x01, 0x8a, 0xd5,
};
static const size_t TEST_DVPT256_223_EXPECTED_LEN = 28;
static const uint8_t TEST_DVPT256_223_INPUT[] = {
0xc5, 0xb3, 0xd7, 0x13, 0x12, 0xea, 0x14, 0xf2,
0xf8, 0xfa, 0xe5, 0xbd, 0x1a, 0x45, 0x31, 0x92,
0xb6, 0x60, 0x4a, 0x45, 0xdb, 0x75, 0xc5, 0xed,
};
static const size_t TEST_DVPT256_223_INPUT_LEN = 24;
/* Alen = 32, Plen = 24, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT256_GROUP_15_MAC_LEN = 16;
static const uint8_t TEST_DVPT256_GROUP_15_KEY[] = {
0x31, 0x4a, 0x20, 0x2f, 0x83, 0x6f, 0x9f, 0x25,
0x7e, 0x22, 0xd8, 0xc1, 0x17, 0x57, 0x83, 0x2a,
0xe5, 0x13, 0x1d, 0x35, 0x7a, 0x72, 0xdf, 0x88,
0xf3, 0xef, 0xf0, 0xff, 0xce, 0xe0, 0xda, 0x4e,
};
static const size_t TEST_DVPT256_GROUP_15_KEY_LEN = 32;
static const uint8_t TEST_DVPT256_225_NONCE[] = {
0xa5, 0x44, 0x21, 0x8d, 0xad, 0xd3, 0xc1, 0x05,
0x83, 0xdb, 0x49, 0xcf, 0x39,
};
static const size_t TEST_DVPT256_225_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_225_ADATA[] = {
0x3c, 0x0e, 0x28, 0x15, 0xd3, 0x7d, 0x84, 0x4f,
0x7a, 0xc2, 0x40, 0xba, 0x9d, 0x6e, 0x3a, 0x0b,
0x2a, 0x86, 0xf7, 0x06, 0xe8, 0x85, 0x95, 0x9e,
0x09, 0xa1, 0x00, 0x5e, 0x02, 0x4f, 0x69, 0x07,
};
static const size_t TEST_DVPT256_225_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_225_EXPECTED[] = {
0x8d, 0x34, 0xcd, 0xca, 0x37, 0xce, 0x77, 0xbe,
0x68, 0xf6, 0x5b, 0xaf, 0x33, 0x82, 0xe3, 0x1e,
0xfa, 0x69, 0x3e, 0x63, 0xf9, 0x14, 0xa7, 0x81,
0x36, 0x7f, 0x30, 0xf2, 0xea, 0xad, 0x8c, 0x06,
0x3c, 0xa5, 0x07, 0x95, 0xac, 0xd9, 0x02, 0x03,
};
static const size_t TEST_DVPT256_225_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_225_INPUT[] = {
0xe8, 0xde, 0x97, 0x0f, 0x6e, 0xe8, 0xe8, 0x0e,
0xde, 0x93, 0x35, 0x81, 0xb5, 0xbc, 0xf4, 0xd8,
0x37, 0xe2, 0xb7, 0x2b, 0xaa, 0x8b, 0x00, 0xc3,
};
static const size_t TEST_DVPT256_225_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_229_NONCE[] = {
0x0d, 0xd6, 0x13, 0xc0, 0xfe, 0x28, 0xe9, 0x13,
0xc0, 0xed, 0xbb, 0x84, 0x04,
};
static const size_t TEST_DVPT256_229_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_229_ADATA[] = {
0x2a, 0xd3, 0x06, 0x57, 0x5b, 0x57, 0x7c, 0x2f,
0x61, 0xda, 0x72, 0x12, 0xab, 0x63, 0xe3, 0xdb,
0x39, 0x41, 0xf1, 0xf7, 0x51, 0xf2, 0x35, 0x6c,
0x74, 0x43, 0x53, 0x1a, 0x90, 0xb9, 0xd1, 0x41,
};
static const size_t TEST_DVPT256_229_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_229_EXPECTED[] = {
0x6d, 0xf0, 0x96, 0x13, 0xea, 0x98, 0x6c, 0x2d,
0x91, 0xa5, 0x7a, 0x45, 0xa0, 0x94, 0x2c, 0xbf,
0x20, 0xe0, 0xdf, 0xca, 0x12, 0xfb, 0xda, 0x8c,
0x94, 0x5e, 0xe6, 0xdb, 0x24, 0xae, 0xa5, 0xf5,
0x09, 0x89, 0x52, 0xf1, 0x20, 0x33, 0x39, 0xce,
};
static const size_t TEST_DVPT256_229_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_229_INPUT[] = {
0x95, 0x22, 0xfb, 0x1f, 0x1a, 0xa5, 0x84, 0x93,
0xcb, 0xa6, 0x82, 0xd7, 0x88, 0x18, 0x6d, 0x90,
0x2c, 0xfc, 0x93, 0xe8, 0x0f, 0xd6, 0xb9, 0x98,
};
static const size_t TEST_DVPT256_229_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_231_NONCE[] = {
0x3e, 0x0f, 0xe3, 0x42, 0x7e, 0xed, 0xa8, 0x0f,
0x02, 0xdd, 0xa4, 0xfe, 0xd5,
};
static const size_t TEST_DVPT256_231_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_231_ADATA[] = {
0xae, 0x0d, 0x1c, 0x9c, 0x83, 0x4d, 0x60, 0xff,
0x0e, 0xcf, 0xb3, 0xc0, 0xd7, 0x8c, 0x72, 0xdd,
0xb7, 0x89, 0xe5, 0x8a, 0xdf, 0xc1, 0x66, 0xc8,
0x1d, 0x5f, 0xc6, 0x39, 0x5b, 0x31, 0xec, 0x33,
};
static const size_t TEST_DVPT256_231_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_231_EXPECTED[] = {
0x2b, 0xfe, 0x51, 0xf1, 0xf4, 0x3b, 0x98, 0x2d,
0x47, 0xf7, 0x6e, 0xa8, 0x20, 0x6d, 0xdb, 0xf5,
0x85, 0xd6, 0xf3, 0x0c, 0xec, 0x0d, 0x4e, 0xf1,
0x6b, 0x15, 0x56, 0x63, 0x1d, 0x3b, 0x52, 0xbf,
0x24, 0x15, 0x4a, 0xfe, 0xc1, 0x44, 0x8e, 0xf6,
};
static const size_t TEST_DVPT256_231_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_231_INPUT[] = {
0x38, 0x33, 0x3c, 0xe7, 0x81, 0x10, 0xbf, 0x53,
0xa2, 0xc2, 0xab, 0xc7, 0xdb, 0x99, 0xe1, 0x33,
0xad, 0x21, 0x8c, 0xa4, 0x3f, 0xf7, 0xa7, 0xbc,
};
static const size_t TEST_DVPT256_231_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_236_NONCE[] = {
0x60, 0x12, 0x2c, 0xbd, 0x21, 0x9e, 0x5c, 0xf1,
0x74, 0x15, 0xe8, 0xbc, 0x09,
};
static const size_t TEST_DVPT256_236_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_236_ADATA[] = {
0x89, 0x5a, 0x45, 0xdd, 0xbe, 0x0c, 0x80, 0x79,
0x3e, 0xcc, 0xbf, 0x82, 0x0d, 0xe1, 0x3a, 0x23,
0x3b, 0x6a, 0xa7, 0x04, 0x5c, 0xfd, 0x53, 0x13,
0x38, 0x8e, 0x71, 0x84, 0xc3, 0x92, 0xb2, 0x16,
};
static const size_t TEST_DVPT256_236_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_236_EXPECTED[] = {
0xbf, 0x0d, 0x21, 0x9b, 0xb5, 0x0f, 0xcc, 0x1d,
0x51, 0xf6, 0x54, 0xbb, 0x0f, 0xd8, 0xb4, 0x4e,
0xfa, 0x25, 0xae, 0xf3, 0x9e, 0x2f, 0x11, 0xaf,
0xe4, 0x7d, 0x00, 0xf2, 0xee, 0xbb, 0x54, 0x4e,
0x6b, 0xa7, 0x55, 0x9a, 0xc2, 0xf3, 0x4e, 0xdb,
};
static const size_t TEST_DVPT256_236_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_236_INPUT[] = {
0x79, 0x4e, 0x73, 0x49, 0x66, 0xe6, 0xd0, 0x00,
0x16, 0x99, 0xae, 0xc3, 0xf8, 0xab, 0x8f, 0x19,
0x4d, 0xe7, 0x65, 0x3d, 0x30, 0x91, 0xb1, 0xb9,
};
static const size_t TEST_DVPT256_236_INPUT_LEN = 24;
static const uint8_t TEST_DVPT256_238_NONCE[] = {
0x35, 0x42, 0xfb, 0xe0, 0xf5, 0x9a, 0x6d, 0x5f,
0x3a, 0xbf, 0x61, 0x9b, 0x7d,
};
static const size_t TEST_DVPT256_238_NONCE_LEN = 13;
static const uint8_t TEST_DVPT256_238_ADATA[] = {
0xdd, 0x45, 0x31, 0xf1, 0x58, 0xa2, 0xfa, 0x3b,
0xc8, 0xa3, 0x39, 0xf7, 0x70, 0x59, 0x50, 0x48,
0xf4, 0xa4, 0x2b, 0xc1, 0xb0, 0x3f, 0x2e, 0x82,
0x4e, 0xfc, 0x6b, 0xa4, 0x98, 0x51, 0x19, 0xd8,
};
static const size_t TEST_DVPT256_238_ADATA_LEN = 32;
static const uint8_t TEST_DVPT256_238_EXPECTED[] = {
0x39, 0xc2, 0xe8, 0xf6, 0xed, 0xfe, 0x66, 0x3b,
0x90, 0x96, 0x3b, 0x98, 0xeb, 0x79, 0xe2, 0xd4,
0xf7, 0xf2, 0x8a, 0x50, 0x53, 0xae, 0x88, 0x81,
0x56, 0x7a, 0x6b, 0x44, 0x26, 0xf1, 0x66, 0x71,
0x36, 0xbe, 0xd4, 0xa5, 0xe3, 0x2a, 0x2b, 0xc1,
};
static const size_t TEST_DVPT256_238_EXPECTED_LEN = 40;
static const uint8_t TEST_DVPT256_238_INPUT[] = {
0xc5, 0xb3, 0xd7, 0x13, 0x12, 0xea, 0x14, 0xf2,
0xf8, 0xfa, 0xe5, 0xbd, 0x1a, 0x45, 0x31, 0x92,
0xb6, 0x60, 0x4a, 0x45, 0xdb, 0x75, 0xc5, 0xed,
};
static const size_t TEST_DVPT256_238_INPUT_LEN = 24;
/* Share test buffer output */
static uint8_t data[512];
static void test_encrypt_op(const uint8_t *key, uint8_t key_len,
const uint8_t *adata, size_t adata_len,
const uint8_t *nonce, uint8_t nonce_len,
const uint8_t *plain, size_t plain_len,
const uint8_t *output_expected,
size_t output_expected_len,
uint8_t mac_length)
{
cipher_t cipher;
int len, err, cmp;
size_t len_encoding = nonce_and_len_encoding_size - nonce_len;
TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len,
"Output buffer too small");
err = cipher_init(&cipher, CIPHER_AES, key, key_len);
TEST_ASSERT_EQUAL_INT(1, err);
len = cipher_encrypt_ccm(&cipher, adata, adata_len,
mac_length, len_encoding,
nonce, nonce_len, plain, plain_len, data);
TEST_ASSERT_MESSAGE(len > 0, "Encryption failed");
TEST_ASSERT_EQUAL_INT(output_expected_len, len);
cmp = compare(output_expected, data, len);
TEST_ASSERT_MESSAGE(1 == cmp, "wrong ciphertext");
}
static void test_decrypt_op(const uint8_t *key, uint8_t key_len,
const uint8_t *adata, size_t adata_len,
const uint8_t *nonce, uint8_t nonce_len,
const uint8_t *encrypted, size_t encrypted_len,
const uint8_t *output_expected,
size_t output_expected_len,
uint8_t mac_length)
{
cipher_t cipher;
int len, err, cmp;
size_t len_encoding = nonce_and_len_encoding_size - nonce_len;
TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len,
"Output buffer too small");
err = cipher_init(&cipher, CIPHER_AES, key, key_len);
TEST_ASSERT_EQUAL_INT(1, err);
len = cipher_decrypt_ccm(&cipher, adata, adata_len,
mac_length, len_encoding,
nonce, nonce_len, encrypted, encrypted_len, data);
TEST_ASSERT_MESSAGE(len >= 0, "Decryption failed");
TEST_ASSERT_EQUAL_INT(output_expected_len, len);
cmp = compare(output_expected, data, len);
TEST_ASSERT_MESSAGE(1 == cmp, "wrong ciphertext");
}
#define do_test_encrypt_op(prefix, test_num, group_num) do { \
test_encrypt_op(TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY, \
TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY_LEN, \
TEST_ ## prefix ## _ ## test_num ## _ADATA, \
TEST_ ## prefix ## _ ## test_num ## _ADATA_LEN, \
TEST_ ## prefix ## _ ## test_num ## _NONCE, \
TEST_ ## prefix ## _ ## test_num ## _NONCE_LEN, \
TEST_ ## prefix ## _ ## test_num ## _INPUT, \
TEST_ ## prefix ## _ ## test_num ## _INPUT_LEN, \
TEST_ ## prefix ## _ ## test_num ## _EXPECTED, \
TEST_ ## prefix ## _ ## test_num ## _EXPECTED_LEN, \
TEST_ ## prefix ## _GROUP_ ## group_num ## _MAC_LEN \
); \
} while (0)
#define do_test_decrypt_op(prefix, test_num, group_num) do { \
test_decrypt_op(TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY, \
TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY_LEN, \
TEST_ ## prefix ## _ ## test_num ## _ADATA, \
TEST_ ## prefix ## _ ## test_num ## _ADATA_LEN, \
TEST_ ## prefix ## _ ## test_num ## _NONCE, \
TEST_ ## prefix ## _ ## test_num ## _NONCE_LEN, \
TEST_ ## prefix ## _ ## test_num ## _EXPECTED, \
TEST_ ## prefix ## _ ## test_num ## _EXPECTED_LEN, \
TEST_ ## prefix ## _ ## test_num ## _INPUT, \
TEST_ ## prefix ## _ ## test_num ## _INPUT_LEN, \
TEST_ ## prefix ## _GROUP_ ## group_num ## _MAC_LEN \
); \
} while (0)
static void test_crypto_modes_ccm_decrypt(void)
{
do_test_decrypt_op(DVPT256, 0, 0);
do_test_decrypt_op(DVPT256, 4, 0);
do_test_decrypt_op(DVPT256, 6, 0);
do_test_decrypt_op(DVPT256, 11, 0);
do_test_decrypt_op(DVPT256, 13, 0);
do_test_decrypt_op(DVPT256, 15, 1);
do_test_decrypt_op(DVPT256, 19, 1);
do_test_decrypt_op(DVPT256, 21, 1);
do_test_decrypt_op(DVPT256, 26, 1);
do_test_decrypt_op(DVPT256, 28, 1);
do_test_decrypt_op(DVPT256, 30, 2);
do_test_decrypt_op(DVPT256, 34, 2);
do_test_decrypt_op(DVPT256, 36, 2);
do_test_decrypt_op(DVPT256, 41, 2);
do_test_decrypt_op(DVPT256, 43, 2);
do_test_decrypt_op(DVPT256, 45, 3);
do_test_decrypt_op(DVPT256, 49, 3);
do_test_decrypt_op(DVPT256, 51, 3);
do_test_decrypt_op(DVPT256, 56, 3);
do_test_decrypt_op(DVPT256, 58, 3);
do_test_decrypt_op(DVPT256, 60, 4);
do_test_decrypt_op(DVPT256, 64, 4);
do_test_decrypt_op(DVPT256, 66, 4);
do_test_decrypt_op(DVPT256, 71, 4);
do_test_decrypt_op(DVPT256, 73, 4);
do_test_decrypt_op(DVPT256, 75, 5);
do_test_decrypt_op(DVPT256, 79, 5);
do_test_decrypt_op(DVPT256, 81, 5);
do_test_decrypt_op(DVPT256, 86, 5);
do_test_decrypt_op(DVPT256, 88, 5);
do_test_decrypt_op(DVPT256, 90, 6);
do_test_decrypt_op(DVPT256, 94, 6);
do_test_decrypt_op(DVPT256, 96, 6);
do_test_decrypt_op(DVPT256, 101, 6);
do_test_decrypt_op(DVPT256, 103, 6);
do_test_decrypt_op(DVPT256, 105, 7);
do_test_decrypt_op(DVPT256, 109, 7);
do_test_decrypt_op(DVPT256, 111, 7);
do_test_decrypt_op(DVPT256, 116, 7);
do_test_decrypt_op(DVPT256, 118, 7);
do_test_decrypt_op(DVPT256, 120, 8);
do_test_decrypt_op(DVPT256, 124, 8);
do_test_decrypt_op(DVPT256, 126, 8);
do_test_decrypt_op(DVPT256, 131, 8);
do_test_decrypt_op(DVPT256, 133, 8);
do_test_decrypt_op(DVPT256, 135, 9);
do_test_decrypt_op(DVPT256, 139, 9);
do_test_decrypt_op(DVPT256, 141, 9);
do_test_decrypt_op(DVPT256, 146, 9);
do_test_decrypt_op(DVPT256, 148, 9);
do_test_decrypt_op(DVPT256, 150, 10);
do_test_decrypt_op(DVPT256, 154, 10);
do_test_decrypt_op(DVPT256, 156, 10);
do_test_decrypt_op(DVPT256, 161, 10);
do_test_decrypt_op(DVPT256, 163, 10);
do_test_decrypt_op(DVPT256, 165, 11);
do_test_decrypt_op(DVPT256, 169, 11);
do_test_decrypt_op(DVPT256, 171, 11);
do_test_decrypt_op(DVPT256, 176, 11);
do_test_decrypt_op(DVPT256, 178, 11);
do_test_decrypt_op(DVPT256, 180, 12);
do_test_decrypt_op(DVPT256, 184, 12);
do_test_decrypt_op(DVPT256, 186, 12);
do_test_decrypt_op(DVPT256, 191, 12);
do_test_decrypt_op(DVPT256, 193, 12);
do_test_decrypt_op(DVPT256, 195, 13);
do_test_decrypt_op(DVPT256, 199, 13);
do_test_decrypt_op(DVPT256, 201, 13);
do_test_decrypt_op(DVPT256, 206, 13);
do_test_decrypt_op(DVPT256, 208, 13);
do_test_decrypt_op(DVPT256, 210, 14);
do_test_decrypt_op(DVPT256, 214, 14);
do_test_decrypt_op(DVPT256, 216, 14);
do_test_decrypt_op(DVPT256, 221, 14);
do_test_decrypt_op(DVPT256, 223, 14);
do_test_decrypt_op(DVPT256, 225, 15);
do_test_decrypt_op(DVPT256, 229, 15);
do_test_decrypt_op(DVPT256, 231, 15);
do_test_decrypt_op(DVPT256, 236, 15);
do_test_decrypt_op(DVPT256, 238, 15);
}
static void test_crypto_modes_ccm_encrypt(void)
{
do_test_encrypt_op(DVPT256, 0, 0);
do_test_encrypt_op(DVPT256, 4, 0);
do_test_encrypt_op(DVPT256, 6, 0);
do_test_encrypt_op(DVPT256, 11, 0);
do_test_encrypt_op(DVPT256, 13, 0);
do_test_encrypt_op(DVPT256, 15, 1);
do_test_encrypt_op(DVPT256, 19, 1);
do_test_encrypt_op(DVPT256, 21, 1);
do_test_encrypt_op(DVPT256, 26, 1);
do_test_encrypt_op(DVPT256, 28, 1);
do_test_encrypt_op(DVPT256, 30, 2);
do_test_encrypt_op(DVPT256, 34, 2);
do_test_encrypt_op(DVPT256, 36, 2);
do_test_encrypt_op(DVPT256, 41, 2);
do_test_encrypt_op(DVPT256, 43, 2);
do_test_encrypt_op(DVPT256, 45, 3);
do_test_encrypt_op(DVPT256, 49, 3);
do_test_encrypt_op(DVPT256, 51, 3);
do_test_encrypt_op(DVPT256, 56, 3);
do_test_encrypt_op(DVPT256, 58, 3);
do_test_encrypt_op(DVPT256, 60, 4);
do_test_encrypt_op(DVPT256, 64, 4);
do_test_encrypt_op(DVPT256, 66, 4);
do_test_encrypt_op(DVPT256, 71, 4);
do_test_encrypt_op(DVPT256, 73, 4);
do_test_encrypt_op(DVPT256, 75, 5);
do_test_encrypt_op(DVPT256, 79, 5);
do_test_encrypt_op(DVPT256, 81, 5);
do_test_encrypt_op(DVPT256, 86, 5);
do_test_encrypt_op(DVPT256, 88, 5);
do_test_encrypt_op(DVPT256, 90, 6);
do_test_encrypt_op(DVPT256, 94, 6);
do_test_encrypt_op(DVPT256, 96, 6);
do_test_encrypt_op(DVPT256, 101, 6);
do_test_encrypt_op(DVPT256, 103, 6);
do_test_encrypt_op(DVPT256, 105, 7);
do_test_encrypt_op(DVPT256, 109, 7);
do_test_encrypt_op(DVPT256, 111, 7);
do_test_encrypt_op(DVPT256, 116, 7);
do_test_encrypt_op(DVPT256, 118, 7);
do_test_encrypt_op(DVPT256, 120, 8);
do_test_encrypt_op(DVPT256, 124, 8);
do_test_encrypt_op(DVPT256, 126, 8);
do_test_encrypt_op(DVPT256, 131, 8);
do_test_encrypt_op(DVPT256, 133, 8);
do_test_encrypt_op(DVPT256, 135, 9);
do_test_encrypt_op(DVPT256, 139, 9);
do_test_encrypt_op(DVPT256, 141, 9);
do_test_encrypt_op(DVPT256, 146, 9);
do_test_encrypt_op(DVPT256, 148, 9);
do_test_encrypt_op(DVPT256, 150, 10);
do_test_encrypt_op(DVPT256, 154, 10);
do_test_encrypt_op(DVPT256, 156, 10);
do_test_encrypt_op(DVPT256, 161, 10);
do_test_encrypt_op(DVPT256, 163, 10);
do_test_encrypt_op(DVPT256, 165, 11);
do_test_encrypt_op(DVPT256, 169, 11);
do_test_encrypt_op(DVPT256, 171, 11);
do_test_encrypt_op(DVPT256, 176, 11);
do_test_encrypt_op(DVPT256, 178, 11);
do_test_encrypt_op(DVPT256, 180, 12);
do_test_encrypt_op(DVPT256, 184, 12);
do_test_encrypt_op(DVPT256, 186, 12);
do_test_encrypt_op(DVPT256, 191, 12);
do_test_encrypt_op(DVPT256, 193, 12);
do_test_encrypt_op(DVPT256, 195, 13);
do_test_encrypt_op(DVPT256, 199, 13);
do_test_encrypt_op(DVPT256, 201, 13);
do_test_encrypt_op(DVPT256, 206, 13);
do_test_encrypt_op(DVPT256, 208, 13);
do_test_encrypt_op(DVPT256, 210, 14);
do_test_encrypt_op(DVPT256, 214, 14);
do_test_encrypt_op(DVPT256, 216, 14);
do_test_encrypt_op(DVPT256, 221, 14);
do_test_encrypt_op(DVPT256, 223, 14);
do_test_encrypt_op(DVPT256, 225, 15);
do_test_encrypt_op(DVPT256, 229, 15);
do_test_encrypt_op(DVPT256, 231, 15);
do_test_encrypt_op(DVPT256, 236, 15);
do_test_encrypt_op(DVPT256, 238, 15);
}
Test *tests_crypto_modes_ccm_tests_256(void)
{
EMB_UNIT_TESTFIXTURES(fixtures) {
new_TestFixture(test_crypto_modes_ccm_encrypt),
new_TestFixture(test_crypto_modes_ccm_decrypt),
};
EMB_UNIT_TESTCALLER(crypto_modes_ccm_tests_256, NULL, NULL, fixtures);
return (Test *)&crypto_modes_ccm_tests_256;
}