numam-dpdk/app/test/test_cryptodev_hmac_test_vectors.h
Bruce Richardson a9de470cc7 test: move to app directory
Since all other apps have been moved to the "app" folder, the autotest app
remains alone in the test folder. Rather than having an entire top-level
folder for this, we can move it back to where it all started in early
versions of DPDK - the "app/" folder.

This move has a couple of advantages:
* This reduces clutter at the top level of the project, due to one less
  folder.
* It eliminates the separate build task necessary for building the
  autotests using make "make test-build" which means that developers are
  less likely to miss something in their own compilation tests
* It re-aligns the final location of the test binary in the app folder when
  building with make with it's location in the source tree.

For meson builds, the autotest app is different from the other apps in that
it needs a series of different test cases defined for it for use by "meson
test". Therefore, it does not get built as part of the main loop in the
app folder, but gets built separately at the end.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-02-26 15:29:27 +01:00

94 lines
2.2 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016 Intel Corporation
*/
#ifndef APP_TEST_TEST_CRYPTODEV_HMAC_TEST_VECTORS_H_
#define APP_TEST_TEST_CRYPTODEV_HMAC_TEST_VECTORS_H_
/* *** MD5 test vectors *** */
#define MD5_DIGEST_LEN 16
struct HMAC_MD5_vector {
struct {
uint8_t data[64];
uint16_t len;
} key;
struct {
uint8_t data[1024];
uint16_t len;
} plaintext;
struct {
uint8_t data[16];
uint16_t len;
} auth_tag;
};
static const struct
HMAC_MD5_vector HMAC_MD5_test_case_1 = {
.key = {
.data = {
0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD
},
.len = 16
},
.plaintext = {
.data = {
0x87, 0x4D, 0x61, 0x91, 0xB6, 0x20, 0xE3, 0x26,
0x1B, 0xEF, 0x68, 0x64, 0x99, 0x0D, 0xB6, 0xCE,
0x98, 0x06, 0xF6, 0x6B, 0x79, 0x70, 0xFD, 0xFF,
0x86, 0x17, 0x18, 0x7B, 0xB9, 0xFF, 0xFD, 0xFF,
0x5A, 0xE4, 0xDF, 0x3E, 0xDB, 0xD5, 0xD3, 0x5E,
0x5B, 0x4F, 0x09, 0x02, 0x0D, 0xB0, 0x3E, 0xAB,
0x1E, 0x03, 0x1D, 0xDA, 0x2F, 0xBE, 0x03, 0xD1,
0x79, 0x21, 0x70, 0xA0, 0xF3, 0x00, 0x9C, 0xEE
},
.len = 64
},
.auth_tag = {
.data = {
0x67, 0x83, 0xE1, 0x0F, 0xB0, 0xBF, 0x33, 0x49,
0x22, 0x04, 0x89, 0xDF, 0x86, 0xD0, 0x5F, 0x0C
},
.len = MD5_DIGEST_LEN
}
};
static const struct
HMAC_MD5_vector HMAC_MD5_test_case_2 = {
.key = {
.data = {
0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD
},
.len = 32
},
.plaintext = {
.data = {
0x87, 0x4D, 0x61, 0x91, 0xB6, 0x20, 0xE3, 0x26,
0x1B, 0xEF, 0x68, 0x64, 0x99, 0x0D, 0xB6, 0xCE,
0x98, 0x06, 0xF6, 0x6B, 0x79, 0x70, 0xFD, 0xFF,
0x86, 0x17, 0x18, 0x7B, 0xB9, 0xFF, 0xFD, 0xFF,
0x5A, 0xE4, 0xDF, 0x3E, 0xDB, 0xD5, 0xD3, 0x5E,
0x5B, 0x4F, 0x09, 0x02, 0x0D, 0xB0, 0x3E, 0xAB,
0x1E, 0x03, 0x1D, 0xDA, 0x2F, 0xBE, 0x03, 0xD1,
0x79, 0x21, 0x70, 0xA0, 0xF3, 0x00, 0x9C, 0xEE
},
.len = 64
},
.auth_tag = {
.data = {
0x39, 0x24, 0x70, 0x7A, 0x30, 0x38, 0x1E, 0x2B,
0x9F, 0x6B, 0xD9, 0x3C, 0xAD, 0xC2, 0x73, 0x52
},
.len = MD5_DIGEST_LEN
}
};
#endif /* APP_TEST_TEST_CRYPTODEV_HMAC_TEST_VECTORS_H_ */