X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_cryptodev_snow3g_test_vectors.h;h=cb9dc4b35080a9adfa4908fb6a678905c9b363f0;hb=e9c659426416c95c4469b16e6bcc7700f1898278;hp=403406d5388d3e0f5ae73f6a471d3465d0585bcb;hpb=8bdf665fe6c017a8b236c405a689d170264f7b1d;p=dpdk.git diff --git a/app/test/test_cryptodev_snow3g_test_vectors.h b/app/test/test_cryptodev_snow3g_test_vectors.h index 403406d538..cb9dc4b350 100644 --- a/app/test/test_cryptodev_snow3g_test_vectors.h +++ b/app/test/test_cryptodev_snow3g_test_vectors.h @@ -1,33 +1,5 @@ -/*- - * BSD LICENSE - * - * Copyright(c) 2015 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2015-2017 Intel Corporation */ #ifndef TEST_CRYPTODEV_SNOW3G_TEST_VECTORS_H_ @@ -42,26 +14,34 @@ struct snow3g_test_data { struct { uint8_t data[64] __rte_aligned(16); unsigned len; - } iv; + } cipher_iv; struct { uint8_t data[1024]; - unsigned len; + unsigned len; /* length must be in Bits */ } plaintext; struct { uint8_t data[1024]; - unsigned len; + unsigned len; /* length must be in Bits */ } ciphertext; struct { unsigned len; } validDataLenInBits; + struct { + unsigned len; + } validCipherLenInBits; + + struct { + unsigned len; + } validAuthLenInBits; + struct { uint8_t data[64]; unsigned len; - } aad; + } auth_iv; struct { uint8_t data[64]; @@ -76,7 +56,7 @@ struct snow3g_test_data snow3g_test_case_1 = { }, .len = 16 }, - .iv = { + .cipher_iv = { .data = { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00, 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 @@ -99,7 +79,7 @@ struct snow3g_test_data snow3g_test_case_1 = { 0x39, 0x01, 0xA0, 0x8F, 0x4A, 0xB4, 0x1A, 0xAB, 0x9B, 0x13, 0x48, 0x80 }, - .len = 100 + .len = 800 }, .ciphertext = { .data = { @@ -117,12 +97,15 @@ struct snow3g_test_data snow3g_test_case_1 = { 0x05, 0x3D, 0xB5, 0x5A, 0x88, 0xC4, 0xC4, 0xF9, 0x60, 0x5E, 0x41, 0x40 }, - .len = 100 + .len = 800 }, .validDataLenInBits = { .len = 798 }, - .aad = { + .validCipherLenInBits = { + .len = 800 + }, + .auth_iv = { .data = { 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00, 0x72, 0xA4, 0xF2, 0x0F, 0x64, 0x00, 0x00, 0x00 @@ -139,7 +122,7 @@ struct snow3g_test_data snow3g_test_case_2 = { }, .len = 16 }, - .iv = { + .cipher_iv = { .data = { 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00, 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00 @@ -157,7 +140,7 @@ struct snow3g_test_data snow3g_test_case_2 = { 0x1C, 0xF9, 0x3B, 0x15, 0x10, 0x37, 0x6B, 0x02, 0x13, 0x0F, 0x81, 0x2A, 0x9F, 0xA1, 0x69, 0xD8 }, - .len = 64 + .len = 512 }, .ciphertext = { .data = { @@ -170,12 +153,15 @@ struct snow3g_test_data snow3g_test_case_2 = { 0x0D, 0xB0, 0xA9, 0xCD, 0x36, 0xC3, 0x4A, 0xE4, 0x18, 0x14, 0x90, 0xB2, 0x9F, 0x5F, 0xA2, 0xFC }, - .len = 64 + .len = 512 }, .validDataLenInBits = { .len = 510 }, - .aad = { + .validCipherLenInBits = { + .len = 512 + }, + .auth_iv = { .data = { 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00, 0xE2, 0x8B, 0xCF, 0x7B, 0xC0, 0x00, 0x00, 0x00 @@ -192,7 +178,7 @@ struct snow3g_test_data snow3g_test_case_3 = { }, .len = 16 }, - .iv = { + .cipher_iv = { .data = { 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00, 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00 @@ -204,19 +190,22 @@ struct snow3g_test_data snow3g_test_case_3 = { 0xAD, 0x9C, 0x44, 0x1F, 0x89, 0x0B, 0x38, 0xC4, 0x57, 0xA4, 0x9D, 0x42, 0x14, 0x07, 0xE8 }, - .len = 15 + .len = 120 }, .ciphertext = { .data = { 0xBA, 0x0F, 0x31, 0x30, 0x03, 0x34, 0xC5, 0x6B, 0x52, 0xA7, 0x49, 0x7C, 0xBA, 0xC0, 0x46 }, - .len = 15 + .len = 120 }, .validDataLenInBits = { .len = 120 }, - .aad = { + .validCipherLenInBits = { + .len = 120 + }, + .auth_iv = { .data = { 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00, 0xFA, 0x55, 0x6B, 0x26, 0x1C, 0x00, 0x00, 0x00 @@ -226,6 +215,9 @@ struct snow3g_test_data snow3g_test_case_3 = { .digest = { .data = {0xE8, 0x60, 0x5A, 0x3E}, .len = 4 + }, + .validAuthLenInBits = { + .len = 120 } }; @@ -237,7 +229,7 @@ struct snow3g_test_data snow3g_test_case_4 = { }, .len = 16 }, - .iv = { + .cipher_iv = { .data = { 0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00, 0x39, 0x8A, 0x59, 0xB4, 0x2C, 0x00, 0x00, 0x00 @@ -251,7 +243,7 @@ struct snow3g_test_data snow3g_test_case_4 = { 0x8C, 0xE3, 0x3E, 0x2C, 0xC3, 0xC0, 0xB5, 0xFC, 0x1F, 0x3D, 0xE8, 0xA6, 0xDC, 0x66, 0xB1, 0xF0 }, - .len = 32 + .len = 256 }, .ciphertext = { .data = { @@ -260,10 +252,13 @@ struct snow3g_test_data snow3g_test_case_4 = { 0xA5, 0x6C, 0x40, 0xC0, 0xAB, 0x9D, 0x81, 0xF7, 0xA2, 0xA9, 0xBA, 0xC6, 0x0E, 0x11, 0xC4, 0xB0 }, - .len = 32 + .len = 256 }, .validDataLenInBits = { .len = 253 + }, + .validCipherLenInBits = { + .len = 256 } }; @@ -275,7 +270,7 @@ struct snow3g_test_data snow3g_test_case_5 = { }, .len = 16 }, - .iv = { + .cipher_iv = { .data = { 0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00, 0x72, 0xA4, 0xF2, 0x0F, 0x48, 0x00, 0x00, 0x00 @@ -298,7 +293,7 @@ struct snow3g_test_data snow3g_test_case_5 = { 0x98, 0x76, 0x45, 0x98, 0x7A, 0x98, 0x6F, 0x2C, 0xB0 }, - .len = 105 + .len = 840 }, .ciphertext = { .data = { @@ -317,11 +312,14 @@ struct snow3g_test_data snow3g_test_case_5 = { 0x43, 0x24, 0x85, 0x50, 0x92, 0x2A, 0xC1, 0x28, 0x18 }, - .len = 105 + .len = 840 }, .validDataLenInBits = { .len = 837 - } + }, + .validCipherLenInBits = { + .len = 840 + }, }; struct snow3g_test_data snow3g_test_case_6 = { .key = { @@ -331,14 +329,14 @@ struct snow3g_test_data snow3g_test_case_6 = { }, .len = 16 }, - .iv = { + .cipher_iv = { .data = { 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD }, .len = 16 }, - .aad = { + .auth_iv = { .data = { 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD @@ -354,7 +352,7 @@ struct snow3g_test_data snow3g_test_case_6 = { 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 }, - .len = 48 + .len = 384 }, .ciphertext = { .data = { @@ -365,7 +363,7 @@ struct snow3g_test_data snow3g_test_case_6 = { 0xBD, 0x91, 0xAA, 0xB6, 0xA4, 0xDC, 0x64, 0xB4, 0xCB, 0xEB, 0x97, 0x06, 0x4C, 0xF7, 0x02, 0x3D }, - .len = 48 + .len = 384 }, .digest = { .data = {0x38, 0xB5, 0x54, 0xC0 }, @@ -373,7 +371,13 @@ struct snow3g_test_data snow3g_test_case_6 = { }, .validDataLenInBits = { .len = 384 - } + }, + .validCipherLenInBits = { + .len = 384 + }, + .validAuthLenInBits = { + .len = 384 + }, }; #endif /* TEST_CRYPTODEV_SNOW3G_TEST_VECTORS_H_ */