Add test cases for DTLS_get_data_mtu()
[openssl.git] / test / wp_test.c
index 2ea6251a58ef92692254866ed31ab458b3e54276..7b5cc04a164842397c9c5ccc20d53ba7e3a0d95c 100644 (file)
@@ -1,7 +1,12 @@
-/* ====================================================================
- * Copyright (c) 2005 The OpenSSL Project.  All rights reserved.
- * ====================================================================
+/*
+ * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
  */
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -18,7 +23,7 @@ int main(int argc, char *argv[])
 #else
 
 /* ISO/IEC 10118-3 test vector set */
-unsigned char iso_test_1[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_1[WHIRLPOOL_DIGEST_LENGTH] = {
     0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66,
     0x9B, 0x44, 0xE3, 0x9C, 0x1D, 0x2E, 0x17, 0x26,
     0xC5, 0x30, 0x23, 0x21, 0x30, 0xD4, 0x07, 0xF8,
@@ -29,7 +34,7 @@ unsigned char iso_test_1[WHIRLPOOL_DIGEST_LENGTH] = {
     0x08, 0xB1, 0x38, 0xCC, 0x42, 0xA6, 0x6E, 0xB3
 };
 
-unsigned char iso_test_2[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_2[WHIRLPOOL_DIGEST_LENGTH] = {
     0x8A, 0xCA, 0x26, 0x02, 0x79, 0x2A, 0xEC, 0x6F,
     0x11, 0xA6, 0x72, 0x06, 0x53, 0x1F, 0xB7, 0xD7,
     0xF0, 0xDF, 0xF5, 0x94, 0x13, 0x14, 0x5E, 0x69,
@@ -40,7 +45,7 @@ unsigned char iso_test_2[WHIRLPOOL_DIGEST_LENGTH] = {
     0x3B, 0x47, 0x85, 0x84, 0xFD, 0xAE, 0x23, 0x1A
 };
 
-unsigned char iso_test_3[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_3[WHIRLPOOL_DIGEST_LENGTH] = {
     0x4E, 0x24, 0x48, 0xA4, 0xC6, 0xF4, 0x86, 0xBB,
     0x16, 0xB6, 0x56, 0x2C, 0x73, 0xB4, 0x02, 0x0B,
     0xF3, 0x04, 0x3E, 0x3A, 0x73, 0x1B, 0xCE, 0x72,
@@ -51,7 +56,7 @@ unsigned char iso_test_3[WHIRLPOOL_DIGEST_LENGTH] = {
     0xD2, 0x25, 0x29, 0x20, 0x76, 0xD4, 0xEE, 0xF5
 };
 
-unsigned char iso_test_4[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_4[WHIRLPOOL_DIGEST_LENGTH] = {
     0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6,
     0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC,
     0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C,
@@ -62,7 +67,7 @@ unsigned char iso_test_4[WHIRLPOOL_DIGEST_LENGTH] = {
     0x62, 0xE8, 0x6D, 0xBD, 0x37, 0xA8, 0x90, 0x3E
 };
 
-unsigned char iso_test_5[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_5[WHIRLPOOL_DIGEST_LENGTH] = {
     0xF1, 0xD7, 0x54, 0x66, 0x26, 0x36, 0xFF, 0xE9,
     0x2C, 0x82, 0xEB, 0xB9, 0x21, 0x2A, 0x48, 0x4A,
     0x8D, 0x38, 0x63, 0x1E, 0xAD, 0x42, 0x38, 0xF5,
@@ -73,7 +78,7 @@ unsigned char iso_test_5[WHIRLPOOL_DIGEST_LENGTH] = {
     0x5D, 0x98, 0x19, 0xA3, 0xDB, 0xA4, 0xEB, 0x3B
 };
 
-unsigned char iso_test_6[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_6[WHIRLPOOL_DIGEST_LENGTH] = {
     0xDC, 0x37, 0xE0, 0x08, 0xCF, 0x9E, 0xE6, 0x9B,
     0xF1, 0x1F, 0x00, 0xED, 0x9A, 0xBA, 0x26, 0x90,
     0x1D, 0xD7, 0xC2, 0x8C, 0xDE, 0xC0, 0x66, 0xCC,
@@ -84,7 +89,7 @@ unsigned char iso_test_6[WHIRLPOOL_DIGEST_LENGTH] = {
     0x42, 0xC6, 0x5F, 0x5A, 0x7A, 0xF0, 0x14, 0x67
 };
 
-unsigned char iso_test_7[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_7[WHIRLPOOL_DIGEST_LENGTH] = {
     0x46, 0x6E, 0xF1, 0x8B, 0xAB, 0xB0, 0x15, 0x4D,
     0x25, 0xB9, 0xD3, 0x8A, 0x64, 0x14, 0xF5, 0xC0,
     0x87, 0x84, 0x37, 0x2B, 0xCC, 0xB2, 0x04, 0xD6,
@@ -95,7 +100,7 @@ unsigned char iso_test_7[WHIRLPOOL_DIGEST_LENGTH] = {
     0x2C, 0x2A, 0x80, 0xCF, 0x3A, 0x9A, 0x08, 0x3B
 };
 
-unsigned char iso_test_8[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_8[WHIRLPOOL_DIGEST_LENGTH] = {
     0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61,
     0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48,
     0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62,
@@ -106,7 +111,7 @@ unsigned char iso_test_8[WHIRLPOOL_DIGEST_LENGTH] = {
     0x74, 0x5B, 0x7B, 0x18, 0x1C, 0x3B, 0xE3, 0xFD
 };
 
-unsigned char iso_test_9[WHIRLPOOL_DIGEST_LENGTH] = {
+static const unsigned char iso_test_9[WHIRLPOOL_DIGEST_LENGTH] = {
     0x0C, 0x99, 0x00, 0x5B, 0xEB, 0x57, 0xEF, 0xF5,
     0x0A, 0x7C, 0xF0, 0x05, 0x56, 0x0D, 0xDF, 0x5D,
     0x29, 0x05, 0x7F, 0xD8, 0x6B, 0x20, 0xBF, 0xD6,
@@ -123,19 +128,6 @@ int main(int argc, char *argv[])
     int i;
     WHIRLPOOL_CTX ctx;
 
-# ifdef OPENSSL_IA32_SSE2
-    /*
-     * Alternative to this is to call OpenSSL_add_all_algorithms... The below
-     * code is retained exclusively for debugging purposes.
-     */
-    {
-        char *env;
-
-        if ((env = getenv("OPENSSL_ia32cap")))
-            OPENSSL_ia32cap = strtoul(env, NULL, 0);
-    }
-# endif
-
     fprintf(stdout, "Testing Whirlpool ");
 
     WHIRLPOOL("", 0, md);