dfregress - An automated test driver and framework
authorAlex Hornung <ahornung@gmail.com>
Sun, 30 Oct 2011 01:21:59 +0000 (01:21 +0000)
committerAlex Hornung <ahornung@gmail.com>
Mon, 14 Nov 2011 20:33:51 +0000 (20:33 +0000)
 * dfregress is a simple test framework and test automation driver. It
   supports both normal userland testcases and kernel test cases.

 * It's key aim is to make it simple, if not outright dead easy, to
   write test cases. A test case is a simple program using
   printf/fprintf and exit - no magic needed. A kernel test case is a
   very small module that just needs to implement a few functions and
   call a logging and result function.

 * Sample output of the text frontend (Frontends are explained further
   down the text): http://leaf.dragonflybsd.org/~alexh/dfregress.txt

 * dfregress is very UNIXy, it uses makefiles to build the testcases,
   stdout/stderr redirection from the testcases (no fancy output
   functions needed in the testcases) and evaluates the normal return
   value of the testcase (no need to call fancy functions).

 * For kernel testcases it is a bit different - you do have to call
   functions to log output and to log the result, but it is very simple,
   hardly any overhead.

 * The test driver assumes that testcases are in the testcases/
   directory, but it supports several command line options.

 * The tests to run, including several options, are specified in the
   runlist file. An example runlist including all the testcases is
   included as config/runlist.run. Options that can be specified are:
   - timeout: (in seconds) after which the test is aborted if it hasn't
     finished.
   - test type (userland, kernel or buildonly)
   - make: which 'make' tool to use to build the test cases. Defaults to
     'make', but could also be 'gmake', etc.
   - nobuild: doesn't build the testcase and tries to directly execute
     it.
   - pre, post: external pre-run and post-run commands, e.g. to set up a
     vn device and to tear it down. This is to avoid duplication in test
     cases, the common setup can be factored out.
   - intpre, intpost: similar to the above, but it assumes that the
     testcase, when passed the parameter 'pre', will do the pre-setup,
     and when passed 'post' will do the post-test cleanup/setup/etc.
   - any number of command line arguments that are passed to the test
     case. (See the crypto/ test examples in the runlist).

 * A range of sample testcases are available in
   test/dfregress/testcases/sample, including a kernel testcase sample.

 * Note that many of the test cases in the testcases/ directory have
   been copied from elsewhere in the main repository and are,
   temporarily at least, duplicated.

 * The test driver is completely separated from the frontends. The test
   driver outputs the test run results in an XML-like format (plist)
   that can easily be parsed using proplib. Python and Ruby also have
   plist modules that could be used to parse the output.

 * The only available frontend is a simple C program that will parse the
   intermediate format to an easy to read plain text format. Additional
   frontends can be written in any language, as long as it is possible
   to load plists. Frontends are in the fe/ directory.

 * XXX: the default options (currently just the timeout) are still
   hardcoded in config.c.

 * The NOTES file gives details on how the test execution occurs and
   what result code can be raised at which point. This document, and a look
   at the generated plist, is all you need to write a new frontend that,
   for example, generates beautiful HTML output.
   For completeness sake, a part of NOTES is reproduced under the main commit
   message - specifically the part detailing the execution of a single test
   case.

======
Execution of a single test case:
======
1) chdir to testcase directory
        - if it fails, set RESULT_PREFAIL (sysbuf is of interest), goto (6)

2) build testcase (make) (unless nobuild flag is set).
        + build_buf is used for stdout/stderr
        - if there is an internal driver error (that leads to not running the
          build command), set RESULT_PREFAIL (sysbuf is of interest), goto (6)
        - if the build command has a non-zero exit value, set the result to
          BUILDFAIL, unless it's a buildonly test case, in which it is set to
          the actual result value (TIMEOUT, SIGNALLED, FAIL)
          goto (6)

3) run 'pre' command if intpre or pre is set.
        + precmd_buf is used for stdout/stderr
        - if there is an internal driver error (that leads to not running the
          command), set RESULT_PREFAIL (sysbuf is of interest), goto (6)
        - if the pre command has a non-zero exit value, set RESULT_PREFAIL and
          goto (6)

4) run actual testcase, depending on type
        + stdout_buf is used for stdout
        + stderr_buf is used for stderr
        - for BUILDONLY: set RESULT_PASS since the build already succeeded
        - for userland and kernel: run the testcase, possibly as a different
          user (depending on the runas option), set the result to the actual
          result value (TIMEOUT, SIGNALLED, FAIL, NOTRUN)
        - if there is an internal driver error (that leads to not running the
          command), RESULT_NOTRUN is set (sysbuf is of interest)

5) run 'post' command if intpost or post is set.
        + postcmd_buf is used for stdout/stderr
        - if there is an internal driver error (that leads to not running the
          command), set RESULT_POSTFAIL (sysbuf is of interest), goto (6)
        - if the post command has a non-zero exit value, set RESULT_POSTFAIL
          and goto (6)

6) clean testcase directory (make clean) (unless nobuild flag is set).
        + cleanup_buf is used for stdout/stderr and system (driver error) buffer
        - no further action.

7) results are saved.

100 files changed:
test/dfregress/NOTES [new file with mode: 0644]
test/dfregress/config/defaults.conf [new file with mode: 0644]
test/dfregress/config/runlist.run [new file with mode: 0644]
test/dfregress/driver/Makefile [new file with mode: 0644]
test/dfregress/driver/config.c [new file with mode: 0644]
test/dfregress/driver/config.h [new file with mode: 0644]
test/dfregress/driver/kernel.c [new file with mode: 0644]
test/dfregress/driver/kernel.h [new file with mode: 0644]
test/dfregress/driver/main.c [new file with mode: 0644]
test/dfregress/driver/parser.c [new file with mode: 0644]
test/dfregress/driver/parser.h [new file with mode: 0644]
test/dfregress/driver/runlist.c [new file with mode: 0644]
test/dfregress/driver/runlist.h [new file with mode: 0644]
test/dfregress/driver/testcase.c [new file with mode: 0644]
test/dfregress/driver/testcase.h [new file with mode: 0644]
test/dfregress/driver/userland.c [new file with mode: 0644]
test/dfregress/driver/userland.h [new file with mode: 0644]
test/dfregress/fe/text/Makefile [new file with mode: 0644]
test/dfregress/fe/text/fe_text.c [new file with mode: 0644]
test/dfregress/framework/dfregress.h [new file with mode: 0644]
test/dfregress/framework/tbridge.h [new file with mode: 0644]
test/dfregress/framework/test.txt [new file with mode: 0644]
test/dfregress/kernel_bridge/Makefile [new file with mode: 0644]
test/dfregress/kernel_bridge/dfregress_bridge.c [new file with mode: 0644]
test/dfregress/kernel_bridge/safe_mem.c [new file with mode: 0644]
test/dfregress/testcases/Makefile [new file with mode: 0644]
test/dfregress/testcases/compiler/Makefile [new file with mode: 0644]
test/dfregress/testcases/compiler/div128/Makefile [new file with mode: 0644]
test/dfregress/testcases/compiler/div128/div128.c [new file with mode: 0644]
test/dfregress/testcases/crypto/Makefile [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/Makefile [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/aestest.c [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbnk44.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbnk48.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbnt44.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbnt48.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbvk44.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbvk48.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbvt44.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aes/ecbvt48.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/aesctr/Makefile [new file with mode: 0644]
test/dfregress/testcases/crypto/aesctr/aesctr.c [new file with mode: 0644]
test/dfregress/testcases/crypto/aesxts/Makefile [new file with mode: 0644]
test/dfregress/testcases/crypto/aesxts/aes_xts.c [new file with mode: 0644]
test/dfregress/testcases/crypto/serpent/Makefile [new file with mode: 0644]
test/dfregress/testcases/crypto/serpent/serpent_test.c [new file with mode: 0644]
test/dfregress/testcases/crypto/serpent/serpentecb_vk.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/serpent/serpentecb_vt.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/twofish/Makefile [new file with mode: 0644]
test/dfregress/testcases/crypto/twofish/twofish_test.c [new file with mode: 0644]
test/dfregress/testcases/crypto/twofish/twofishecb_vk.txt [new file with mode: 0644]
test/dfregress/testcases/crypto/twofish/twofishecb_vt.txt [new file with mode: 0644]
test/dfregress/testcases/io/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/kqueue_1/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/kqueue_1/kqueue_1.c [new file with mode: 0644]
test/dfregress/testcases/io/kqueue_2/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/kqueue_2/kqueue_2.c [new file with mode: 0644]
test/dfregress/testcases/io/pselect_1/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/pselect_1/pselect_1.c [new file with mode: 0644]
test/dfregress/testcases/io/select_1/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/select_1/select_1.c [new file with mode: 0644]
test/dfregress/testcases/io/select_2/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/select_2/select_2.c [new file with mode: 0644]
test/dfregress/testcases/io/select_3/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/select_3/select_3.c [new file with mode: 0644]
test/dfregress/testcases/io/select_4/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/select_4/select_4.c [new file with mode: 0644]
test/dfregress/testcases/io/sendfd_1/Makefile [new file with mode: 0644]
test/dfregress/testcases/io/sendfd_1/sendfd_1.c [new file with mode: 0644]
test/dfregress/testcases/mem/Makefile [new file with mode: 0644]
test/dfregress/testcases/mem/mmap_1/Makefile [new file with mode: 0644]
test/dfregress/testcases/mem/mmap_1/mmap_1.c [new file with mode: 0644]
test/dfregress/testcases/mem/mmap_madvise_1/Makefile [new file with mode: 0644]
test/dfregress/testcases/mem/mmap_madvise_1/mmap_madvise_1.c [new file with mode: 0644]
test/dfregress/testcases/misc/Makefile [new file with mode: 0644]
test/dfregress/testcases/misc/sh_1/Makefile [new file with mode: 0644]
test/dfregress/testcases/misc/sh_1/sh_1.sh [new file with mode: 0644]
test/dfregress/testcases/priv/Makefile [new file with mode: 0644]
test/dfregress/testcases/priv/setreuid/Makefile [new file with mode: 0644]
test/dfregress/testcases/priv/setreuid/setreuid.c [new file with mode: 0644]
test/dfregress/testcases/sample/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/test1/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/test1/test1.c [new file with mode: 0644]
test/dfregress/testcases/sample/test2/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/test2/test2.c [new file with mode: 0644]
test/dfregress/testcases/sample/test3/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/test3/test3.c [new file with mode: 0644]
test/dfregress/testcases/sample/test4/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/test4/test4.c [new file with mode: 0644]
test/dfregress/testcases/sample/test5/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/test5/test5.c [new file with mode: 0644]
test/dfregress/testcases/sample/testb1/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/testb1/testb1.c [new file with mode: 0644]
test/dfregress/testcases/sample/testk1/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/testk1/testk1.c [new file with mode: 0644]
test/dfregress/testcases/sample/testk2/Makefile [new file with mode: 0644]
test/dfregress/testcases/sample/testk2/testk1.c [new file with mode: 0644]
test/dfregress/testcases/threads/Makefile [new file with mode: 0644]
test/dfregress/testcases/threads/umtx_errno/Makefile [new file with mode: 0644]
test/dfregress/testcases/threads/umtx_errno/umtx_errno.c [new file with mode: 0644]

diff --git a/test/dfregress/NOTES b/test/dfregress/NOTES
new file mode 100644 (file)
index 0000000..9237be3
--- /dev/null
@@ -0,0 +1,76 @@
+======
+Result values:
+======
+
+#define RESULT_TIMEOUT         0x01
+#define RESULT_SIGNALLED       0x02
+#define RESULT_NOTRUN          0x03
+#define RESULT_FAIL            0x04
+#define RESULT_PASS            0x05
+#define RESULT_UNKNOWN         0x06
+#define RESULT_PREFAIL         0x07
+#define RESULT_POSTFAIL                0x08
+#define RESULT_BUILDFAIL       0x09
+
+
+A testcase can be considered not run when the result is any of the following:
+RESULT_BUILDFAIL, RESULT_PREFAIL, RESULT_NOTRUN, RESULT_UNKNOWN
+
+A testcase can be considered run when the result is any of the following:
+RESULT_TIMEOUT, RESULT_SIGNALLED, RESULT_FAIL, RESULT_PASS, RESULT_POSTFAIL
+
+
+
+
+======
+Execution of a single test case:
+======
+1) chdir to testcase directory
+       - if it fails, set RESULT_PREFAIL (sysbuf is of interest), goto (6)
+
+2) build testcase (make) (unless nobuild flag is set).
+       + build_buf is used for stdout/stderr
+       - if there is an internal driver error (that leads to not running the
+          build command), set RESULT_PREFAIL (sysbuf is of interest), goto (6)
+       - if the build command has a non-zero exit value, set the result to
+         BUILDFAIL, unless it's a buildonly test case, in which it is set to
+         the actual result value (TIMEOUT, SIGNALLED, FAIL)
+         goto (6)
+
+3) run 'pre' command if intpre or pre is set.
+       + precmd_buf is used for stdout/stderr
+       - if there is an internal driver error (that leads to not running the
+         command), set RESULT_PREFAIL (sysbuf is of interest), goto (6)
+       - if the pre command has a non-zero exit value, set RESULT_PREFAIL and
+         goto (6)
+
+4) run actual testcase, depending on type
+       + stdout_buf is used for stdout
+       + stderr_buf is used for stderr
+       - for BUILDONLY: set RESULT_PASS since the build already succeeded
+       - for userland and kernel: run the testcase, possibly as a different
+         user (depending on the runas option), set the result to the actual
+         result value (TIMEOUT, SIGNALLED, FAIL, NOTRUN)
+       - if there is an internal driver error (that leads to not running the
+         command), RESULT_NOTRUN is set (sysbuf is of interest)
+
+5) run 'post' command if intpost or post is set.
+       + postcmd_buf is used for stdout/stderr
+       - if there is an internal driver error (that leads to not running the
+         command), set RESULT_POSTFAIL (sysbuf is of interest), goto (6)
+       - if the post command has a non-zero exit value, set RESULT_POSTFAIL
+         and goto (6)
+
+6) clean testcase directory (make clean) (unless nobuild flag is set).
+       + cleanup_buf is used for stdout/stderr and system (driver error) buffer
+       - no further action.
+
+7) results are saved.
+
+
+
+======
+TODO
+======
+ - read config defaults from file, not statically coded into config.c
+ - add collected rusage into output dictionary
diff --git a/test/dfregress/config/defaults.conf b/test/dfregress/config/defaults.conf
new file mode 100644 (file)
index 0000000..918e437
--- /dev/null
@@ -0,0 +1,4 @@
+#Parameter     Value
+
+# Default timeout in seconds
+timeout                60
diff --git a/test/dfregress/config/runlist.run b/test/dfregress/config/runlist.run
new file mode 100644 (file)
index 0000000..9336fa0
--- /dev/null
@@ -0,0 +1,53 @@
+# Testcase                             type            Options                 Command line arguments
+sample/test1/test1                     userland        defaults                arg1 "arg 2" arg3 arg4
+sample/test1/test1                     userland        make=gmake
+sample/test2/test2                     userland        defaults
+sample/test3/test3                     userland        defaults
+sample/test4/test4                     userland        timeout=30
+sample/test5/test5                     userland        defaults
+sample/test5/test5                     userland        nobuild
+sample/testk1/testk1.ko                        kernel          defaults
+sample/testb1/testb1                   buildonly       defaults
+
+io/kqueue_1/kqueue_1                   userland        defaults
+io/kqueue_2/kqueue_2                   userland        defaults
+io/pselect_1/pselect_1                 userland        defaults
+io/select_1/select_1                   userland        defaults
+io/select_2/select_2                   userland        defaults
+io/select_3/select_3                   userland        defaults
+io/select_4/select_4                   userland        defaults
+io/sendfd_1/sendfd_1                   userland        timeout=20
+
+mem/mmap_madvise_1/mmap_madvise_1      userland        defaults
+mem/mmap_1/mmap_1                      userland        timeout=300             200000
+
+priv/setreuid/setreuid                 userland        runas=nobody
+
+compiler/div128/div128                 buildonly       defaults
+
+threads/umtx_errno/umtx_errno          userland        timeout=300             20000
+
+crypto/aes/aestest                     userland        defaults                ecbnk44.txt
+crypto/aes/aestest                     userland        defaults                ecbnk48.txt
+crypto/aes/aestest                     userland        defaults                ecbnt44.txt
+crypto/aes/aestest                     userland        defaults                ecbnt48.txt
+crypto/aes/aestest                     userland        defaults                ecbvk44.txt
+crypto/aes/aestest                     userland        defaults                ecbvk48.txt
+crypto/aes/aestest                     userland        defaults                ecbvt44.txt
+crypto/aes/aestest                     userland        defaults                ecbvt48.txt
+crypto/aesctr/aesctr                   userland        defaults
+crypto/aesxts/aes_xts                  userland        defaults
+crypto/serpent/serpent_test            userland        defaults                serpentecb_vk.txt
+crypto/serpent/serpent_test            userland        defaults                serpentecb_vt.txt
+crypto/twofish/twofish_test            userland        defaults                twofishecb_vk.txt
+crypto/twofish/twofish_test            userland        defaults                twofishecb_vt.txt
+
+#openat_1              userland        intpre,intpost,timeout=100
+#openat_1              userland        intpre,intpost,timeout=100
+#openat_1              userland        intpre,intpost,timeout=100
+#openat_1              userland        intpre,intpost,timeout=100
+#openat_1              userland        intpre,intpost,timeout=100
+#openat_1              userland        intpre,intpost,timeout=100
+#openat_1              userland        intpre,intpost,timeout=100
+#openat_2              userland        defaults
+#openat_3              userland        pre=openat_pre,post=openat_post
diff --git a/test/dfregress/driver/Makefile b/test/dfregress/driver/Makefile
new file mode 100644 (file)
index 0000000..3009300
--- /dev/null
@@ -0,0 +1,13 @@
+PROG=          dfregress
+NOMAN=
+DEBUG_FLAGS=   -O0 -g3
+WARNS=         6
+
+SRCS+=         main.c config.c parser.c
+SRCS+=         runlist.c testcase.c
+SRCS+=         kernel.c userland.c
+
+LDADD+=                -lprop -lutil
+DPADD+=                ${LIBPROP} ${LIBUITL}
+
+.include <bsd.prog.mk>
diff --git a/test/dfregress/driver/config.c b/test/dfregress/driver/config.c
new file mode 100644 (file)
index 0000000..688460f
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+
+#include <err.h>
+
+#include <libprop/proplib.h>
+
+#include "parser.h"
+#include "testcase.h"
+#include "runlist.h"
+#include "config.h"
+#include "../framework/dfregress.h"
+
+int config_get_defaults(struct testcase_options *opts)
+{
+       opts->timeout_in_secs = 300;
+
+       return 0;
+}
diff --git a/test/dfregress/driver/config.h b/test/dfregress/driver/config.h
new file mode 100644 (file)
index 0000000..44ca675
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+int config_get_defaults(struct testcase_options *opts);
diff --git a/test/dfregress/driver/kernel.c b/test/dfregress/driver/kernel.c
new file mode 100644 (file)
index 0000000..892b2f8
--- /dev/null
@@ -0,0 +1,145 @@
+ /*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/linker.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+
+#include <err.h>
+
+#include <libprop/proplib.h>
+
+#include "parser.h"
+#include "testcase.h"
+#include "runlist.h"
+#include "config.h"
+#include "kernel.h"
+#include "../framework/dfregress.h"
+#include "../framework/tbridge.h"
+
+
+int
+run_kernel(const char *kmod, prop_dictionary_t testcase)
+{
+       char errmsg[1024];
+       prop_dictionary_t tkcase = NULL;
+       struct stat sb;
+       int fd, r, kmod_id, ret = 0;
+
+       if ((r = stat("/dev/tbridge", &sb)) != 0) {
+               sprintf(errmsg, "Kernel bridge module probably not loaded: %s",
+                   strerror(errno));
+               testcase_set_sys_buf(testcase, errmsg);
+               testcase_set_result(testcase, RESULT_PREFAIL);
+
+               return -1;
+       }
+
+       /* First kldload the testcase */
+       kmod_id = kldload(kmod);
+       if (kmod_id < 0) {
+               sprintf(errmsg, "Could not load testcase kmod %s: %s", kmod,
+                   strerror(errno));
+               testcase_set_sys_buf(testcase, errmsg);
+               testcase_set_result(testcase, RESULT_PREFAIL);
+
+               return -1;
+       }
+
+       /* Open control device */
+       fd = open("/dev/tbridge", O_RDWR);
+       if (fd < 0) {
+               sprintf(errmsg, "Could not open kernel bridge interface: %s",
+                   strerror(errno));
+               testcase_set_sys_buf(testcase, errmsg);
+               testcase_set_result(testcase, RESULT_PREFAIL);
+
+               ret = -1;
+               goto unload;
+       }
+
+       /* Then load the testcase description into the kernel */
+       r = prop_dictionary_send_ioctl(testcase, fd, TBRIDGE_LOADTEST);
+       if (r < 0) {
+               sprintf(errmsg, "sending testcase to kernel failed: %s",
+                   strerror(errno));
+               testcase_set_sys_buf(testcase, errmsg);
+               testcase_set_result(testcase, RESULT_PREFAIL);
+
+               ret = -1;
+               goto unload;
+       }
+
+       /* Then wait for the result */
+       r = prop_dictionary_recv_ioctl(fd, TBRIDGE_GETRESULT, &tkcase);
+       if (r < 0) {
+               sprintf(errmsg, "receiving test results from kernel failed: %s",
+                   strerror(errno));
+               testcase_set_sys_buf(testcase, errmsg);
+               testcase_set_result(testcase, RESULT_PREFAIL);
+
+               ret = -1;
+               goto unload;
+       }
+
+       /* Copy over the values of interest */
+       testcase_set_result(testcase, testcase_get_result(tkcase));
+       testcase_set_stdout_buf(testcase, testcase_get_stdout_buf(tkcase));
+
+       /* Release copy received from kernel */
+       prop_object_release(tkcase);
+
+unload:
+       r = kldunload(kmod_id);
+       if (r < 0) {
+               sprintf(errmsg, "kldunload for %s failed: %s", kmod,
+                   strerror(errno));
+               testcase_set_sys_buf(testcase, errmsg);
+
+               ret = -1;
+       }
+
+       return ret;
+}
diff --git a/test/dfregress/driver/kernel.h b/test/dfregress/driver/kernel.h
new file mode 100644 (file)
index 0000000..5df1709
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+int run_kernel(const char *kmod, prop_dictionary_t testcase);
diff --git a/test/dfregress/driver/main.c b/test/dfregress/driver/main.c
new file mode 100644 (file)
index 0000000..d69e660
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+
+#include <err.h>
+
+#include <libprop/proplib.h>
+
+#include "parser.h"
+#include "testcase.h"
+#include "runlist.h"
+#include "../framework/dfregress.h"
+
+
+static void
+usage(void)
+{
+       fprintf(stderr, "Usage: dfregress -o <output plist file> \n"
+            "  -t <testcase directory>\n"
+           "  -p <pre/post command directory>\n"
+           "  -r <input runlist file>\n");
+       exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+       const char *runlist_file = "runlist.run";
+       int ch;
+
+       while ((ch = getopt(argc, argv, "h?o:r:t:p:")) != -1) {
+               switch (ch) {
+               case 'o':
+                       output_file = optarg;
+                       break;
+
+               case 't':
+                       testcase_dir = optarg;
+                       break;
+
+               case 'r':
+                       runlist_file = optarg;
+                       break;
+
+               case 'p':
+                       prepost_dir = optarg;
+                       break;
+
+               case '?':
+               case 'h':
+                       usage();
+                       /* NOTREACHED */
+                       break;
+               }
+       }
+
+       argc -= optind;
+       argv += optind;
+
+       prop_array_t runlist = runlist_load_from_text(runlist_file);
+       runlist_iterate(runlist, runlist_run_test, runlist);
+
+       return 0;
+}
diff --git a/test/dfregress/driver/parser.c b/test/dfregress/driver/parser.c
new file mode 100644 (file)
index 0000000..a42a2c6
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2009-2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <err.h>
+#include "parser.h"
+
+#define _iswhitespace(X)       ((((X) == ' ') || ((X) == '\t'))?1:0)
+
+
+static int line_no = 1;
+
+static int iswhitespace(char c)
+{
+       return _iswhitespace(c);
+}
+
+static int iscomma(char c)
+{
+       return (c == ',');
+}
+
+void
+syntax_error(const char *fmt, ...)
+{
+       char buf[1024];
+       va_list ap;
+
+       va_start(ap, fmt);
+       vsnprintf(buf, sizeof(buf), fmt, ap);
+       va_end(ap);
+       errx(1, "syntax error on line %d: %s\n", line_no, buf);
+}
+
+
+int
+entry_check_num_args(char **tokens, int num)
+{
+       int i;
+
+       for (i = 0; tokens[i] != NULL; i++)
+               ;
+
+       if (i < num) {
+               syntax_error("at least %d tokens were expected but only %d "
+                   "were found", num, i);
+               return 1;
+       }
+       return 0;
+}
+
+static int
+line_tokenize(char *buffer, int (*is_sep)(char), char comment_char, char **tokens)
+{
+       int c, n, i;
+       int quote = 0;
+
+       i = strlen(buffer) + 1;
+       c = 0;
+
+       /* Skip leading white-space */
+       while ((_iswhitespace(buffer[c])) && (c < i)) c++;
+
+       /*
+        * If this line effectively (after indentation) begins with the comment
+        * character, we ignore the rest of the line.
+        */
+       if (buffer[c] == comment_char)
+               return 0;
+
+       tokens[0] = &buffer[c];
+       for (n = 1; c < i; c++) {
+               if (buffer[c] == '"') {
+                       quote = !quote;
+                       if (quote) {
+                               if ((c >= 1) && (&buffer[c] != tokens[n-1])) {
+#if 0
+                                       syntax_error("stray opening quote not "
+                                           "at beginning of token");
+                                       /* NOTREACHED */
+#endif
+                               } else {
+                                       tokens[n-1] = &buffer[c+1];
+                               }
+                       } else {
+                               if ((c < i-1) && (!is_sep(buffer[c+1]))) {
+#if 0
+                                       syntax_error("stray closing quote not "
+                                           "at end of token");
+                                       /* NOTREACHED */
+#endif
+                               } else {
+                                       buffer[c] = '\0';
+                               }
+                       }
+               }
+
+               if (quote) {
+                       continue;
+               }
+
+               if (is_sep(buffer[c])) {
+                       buffer[c++] = '\0';
+                       while ((_iswhitespace(buffer[c])) && (c < i)) c++;
+                       tokens[n++] = &buffer[c--];
+               }
+       }
+       tokens[n] = NULL;
+
+       if (quote) {
+               tokens[0] = NULL;
+               return 0;
+       }
+
+       return n;
+}
+
+static int
+process_line(FILE* fd, parser_t parser, void *arg)
+{
+       char buffer[4096];
+       char *tokens[256];
+       int c, n, i = 0;
+       int ret = 0;
+
+       while (((c = fgetc(fd)) != EOF) && (c != '\n')) {
+               buffer[i++] = (char)c;
+               if (i == (sizeof(buffer) -1))
+                       break;
+       }
+       buffer[i] = '\0';
+
+       if (feof(fd) || ferror(fd))
+               ret = 1;
+
+
+       n = line_tokenize(buffer, &iswhitespace, '#', tokens);
+
+       /*
+        * If there are not enough arguments for any function or it is
+        * a line full of whitespaces, we just return here. Or if a
+        * quote wasn't closed.
+        */
+       if ((n < 1) || (tokens[0][0] == '\0'))
+               return ret;
+
+       parser(arg, tokens);
+
+       return ret;
+}
+
+int
+parse_options(char *str, char **options)
+{
+       int i;
+
+       i = line_tokenize(str, &iscomma, '#', options);
+       if (i == 0)
+               syntax_error("Invalid expression in options token");
+               /* NOTREACHED */
+
+       return i;
+}
+
+int
+process_file(const char *file, parser_t parser, void *arg, int *nlines)
+{
+       FILE *fd;
+
+       line_no = 0;
+
+       fd = fopen(file, "r");
+       if (fd == NULL)
+               err(1, "fopen");
+               /* NOTREACHED */
+
+       while (process_line(fd, parser, arg) == 0)
+               ++line_no;
+
+       fclose(fd);
+
+       if (nlines != NULL)
+               *nlines = line_no;
+
+       return 0;
+}
+
diff --git a/test/dfregress/driver/parser.h b/test/dfregress/driver/parser.h
new file mode 100644 (file)
index 0000000..c6004ec
--- /dev/null
@@ -0,0 +1,35 @@
+ /*
+ * Copyright (c) 2009-2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+typedef void (*parser_t)(void *, char **);
+
+void syntax_error(const char *, ...) __printflike(1, 2);
+int entry_check_num_args(char **tokens, int num);
+int parse_options(char *str, char **options);
+int process_file(const char *file, parser_t parser, void *arg, int *nlines);
diff --git a/test/dfregress/driver/runlist.c b/test/dfregress/driver/runlist.c
new file mode 100644 (file)
index 0000000..ea5989a
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+
+#include <err.h>
+
+#include <libprop/proplib.h>
+
+#include "parser.h"
+#include "testcase.h"
+#include "runlist.h"
+#include "userland.h"
+#include "kernel.h"
+#include "../framework/dfregress.h"
+
+const char *output_file = "/tmp/results.plist";
+const char *testcase_dir = ".";
+const char *prepost_dir = ".";
+
+prop_array_t
+runlist_load_from_text(const char *runlist_file)
+{
+       prop_array_t runlist;
+
+       runlist = prop_array_create_with_capacity(2048);
+
+       process_file(runlist_file, testcase_entry_parser, runlist, NULL);
+
+       return runlist;
+}
+
+prop_array_t
+runlist_load(const char *runlist_file)
+{
+       return prop_array_internalize_from_file(runlist_file);
+}
+
+int
+runlist_save(const char *runlist_file, prop_array_t runlist)
+{
+       return !prop_array_externalize_to_file(runlist, runlist_file);
+}
+
+int
+runlist_iterate(prop_array_t runlist, runlist_iterator_t iterator, void *arg)
+{
+       prop_object_iterator_t it;
+       prop_dictionary_t testcase;
+       int r = 0;
+
+       it = prop_array_iterator(runlist);
+       if (it == NULL)
+               err(1, "could not get runlist iterator");
+
+       while ((testcase = prop_object_iterator_next(it)) != NULL) {
+               r = iterator(arg, testcase);
+               if (r != 0)
+                       break;
+       }
+
+       prop_object_iterator_release(it);
+       return r;
+}
+
+int
+runlist_run_test(void *arg, prop_dictionary_t testcase)
+{
+       prop_array_t runlist = (prop_array_t)arg;
+       struct testcase_result tr;
+       char testcase_path[FILENAME_MAX];
+       char testcase_dir_only[FILENAME_MAX];
+       char prepost_path[FILENAME_MAX];
+       char errbuf[FILENAME_MAX*2];
+       int r, nopre, nopost;
+       char *str;
+
+       sprintf(testcase_path, "%s/%s", testcase_dir,
+           testcase_get_name(testcase));
+       strcpy(testcase_dir_only, testcase_path);
+       str = strrchr(testcase_dir_only, '/');
+       if (str != NULL)
+               *str = '\0';
+
+       /* Switch to testcase directory */
+       r = chdir(testcase_dir_only);
+       if (r < 0) {
+               sprintf(errbuf, "could not switch working directory to %s: %s\n",
+                   testcase_dir_only, strerror(errno));
+               testcase_set_result(testcase, RESULT_PREFAIL);
+               testcase_set_sys_buf(testcase, errbuf);
+               goto out;
+       }
+
+       /* build unless nobuild flag is set */
+       if ((testcase_get_flags(testcase) & TESTCASE_NOBUILD) == 0) {
+               r = run_simple_cmd(testcase_get_make_cmd(testcase), NULL,
+                   errbuf, sizeof(errbuf), &tr);
+               if (r != 0) {
+                       testcase_set_sys_buf(testcase, errbuf);
+                       testcase_set_result(testcase, RESULT_PREFAIL);
+                       goto out;
+               }
+
+               if (tr.stdout_buf != NULL) {
+                       testcase_set_build_buf(testcase, tr.stdout_buf);
+                       free(tr.stdout_buf);
+               }
+
+               if (tr.result != RESULT_PASS) {
+                       if (testcase_get_type(testcase)
+                           == TESTCASE_TYPE_BUILDONLY)
+                               testcase_set_result(testcase, tr.result);
+                       else
+                               testcase_set_result(testcase, RESULT_BUILDFAIL);
+
+                       testcase_set_exit_value(testcase, tr.exit_value);
+                       testcase_set_signal(testcase, tr.signal);
+
+                       goto out;
+               }
+       }
+
+
+       /* Pre-execution run */
+       switch (testcase_get_precmd_type(testcase)) {
+       case TESTCASE_INT_PRE:
+               /* Test case has internal but explicit PRE - code */
+               r = run_simple_cmd(testcase_path, "pre", errbuf,
+                   sizeof(errbuf), &tr);
+               nopre = 0;
+               break;
+
+       case TESTCASE_CUSTOM_PRE:
+               /* Test case uses external and explicit PRE command */
+               sprintf(prepost_path, "%s/%s", prepost_dir,
+                   testcase_get_custom_precmd(testcase));
+
+               r = run_simple_cmd(prepost_path, NULL, errbuf, sizeof(errbuf),
+                   &tr);
+               nopre = 0;
+               break;
+
+       default:
+               nopre = 1;
+               r = 0;
+               break;
+       }
+
+       if (!nopre) {
+               if (r != 0) {
+                       testcase_set_sys_buf(testcase, errbuf);
+                       testcase_set_result(testcase, RESULT_PREFAIL);
+                       goto out;
+               }
+
+               if (tr.stdout_buf != NULL) {
+                       testcase_set_precmd_buf(testcase, tr.stdout_buf);
+                       free(tr.stdout_buf);
+               }
+
+               if (tr.result != RESULT_PASS) {
+                       testcase_set_result(testcase, RESULT_PREFAIL);
+                       goto out;
+               }
+       }
+
+       switch (testcase_get_type(testcase)) {
+       case TESTCASE_TYPE_BUILDONLY:
+               testcase_set_result(testcase, RESULT_PASS);
+               testcase_set_exit_value(testcase, 0);
+               break;
+
+       case TESTCASE_TYPE_USERLAND:
+               /* Main testcase execution */
+               r = run_userland(testcase_path, testcase_get_args(testcase),
+                   testcase_needs_setuid(testcase),
+                   testcase_get_runas_uid(testcase),
+                   testcase_get_timeout(testcase), 0, errbuf, sizeof(errbuf),
+                   &tr);
+
+               if (r == 0) {
+                       testcase_set_result(testcase, tr.result);
+                       testcase_set_exit_value(testcase, tr.exit_value);
+                       testcase_set_signal(testcase, tr.signal);
+
+                       if (tr.stdout_buf != NULL) {
+                               testcase_set_stdout_buf(testcase, tr.stdout_buf);
+                               free(tr.stdout_buf);
+                       }
+
+                       if (tr.stderr_buf != NULL) {
+                               testcase_set_stderr_buf(testcase, tr.stderr_buf);
+                               free(tr.stderr_buf);
+                       }
+               } else {
+                       /* driver/monitor error */
+                       testcase_set_sys_buf(testcase, errbuf);
+               }
+
+               break;
+
+       case TESTCASE_TYPE_KERNEL:
+               run_kernel(testcase_path, testcase);
+               break;
+       }
+
+
+       /* Post-execution run */
+       switch (testcase_get_postcmd_type(testcase)) {
+       case TESTCASE_INT_POST:
+               /* Test case has internal but explicit POST - code */
+               r = run_simple_cmd(testcase_path, "post", errbuf,
+                   sizeof(errbuf), &tr);
+               nopost = 0;
+               break;
+
+       case TESTCASE_CUSTOM_POST:
+               /* Test case uses external and explicit POST command */
+               sprintf(prepost_path, "%s/%s", prepost_dir,
+                   testcase_get_custom_postcmd(testcase));
+
+               r = run_simple_cmd(prepost_path, NULL, errbuf, sizeof(errbuf),
+                   &tr);
+               nopost = 0;
+               break;
+
+       default:
+               r = 0;
+               nopost = 1;
+               break;
+       }
+
+       if (!nopost) {
+               if (r != 0) {
+                       testcase_set_sys_buf(testcase, errbuf);
+                       testcase_set_result(testcase, RESULT_POSTFAIL);
+                       goto out;
+               }
+
+               if (tr.stdout_buf != NULL) {
+                       testcase_set_postcmd_buf(testcase, tr.stdout_buf);
+                       free(tr.stdout_buf);
+               }
+
+               if (tr.result != RESULT_PASS) {
+                       testcase_set_result(testcase, RESULT_POSTFAIL);
+                       goto out;
+               }
+       }
+
+
+
+out:
+       /* clean build unless nobuild flag is set */
+       if ((testcase_get_flags(testcase) & TESTCASE_NOBUILD) == 0) {
+               r = run_simple_cmd(testcase_get_make_cmd(testcase), "clean",
+                   errbuf, sizeof(errbuf), &tr);
+
+               if (tr.stdout_buf != NULL) {
+                       testcase_set_cleanup_buf(testcase, tr.stdout_buf);
+                       free(tr.stdout_buf);
+               }
+
+               if (r != 0)
+                       testcase_set_cleanup_buf(testcase, errbuf);
+       }
+
+
+       /* ... and save results */
+       runlist_save(output_file, runlist);
+       return 0;
+}
diff --git a/test/dfregress/driver/runlist.h b/test/dfregress/driver/runlist.h
new file mode 100644 (file)
index 0000000..d8d119b
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+extern const char *testcase_dir;
+extern const char *output_file;
+extern const char *prepost_dir;
+
+typedef int (*runlist_iterator_t)(void *, prop_dictionary_t);
+
+prop_array_t runlist_load_from_text(const char *runlist_file);
+prop_array_t runlist_load(const char *runlist_file);
+int runlist_save(const char *runlist_file, prop_array_t runlist);
+int runlist_iterate(prop_array_t runlist, runlist_iterator_t iterator, void *arg);
+int runlist_run_test(void *arg, prop_dictionary_t testcase);
diff --git a/test/dfregress/driver/testcase.c b/test/dfregress/driver/testcase.c
new file mode 100644 (file)
index 0000000..2a001e1
--- /dev/null
@@ -0,0 +1,695 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+
+#include <err.h>
+
+#include <libprop/proplib.h>
+
+#include "parser.h"
+#include "testcase.h"
+#include "runlist.h"
+#include "config.h"
+#include "../framework/dfregress.h"
+
+prop_dictionary_t
+testcase_from_struct(struct testcase *testcase)
+{
+       int i, r;
+       prop_dictionary_t dict, testcase_dict;
+       prop_array_t a;
+       char *s;
+
+       testcase_dict = prop_dictionary_create();
+       if (testcase_dict == NULL)
+               err(1, "could not create testcase dict");
+       r = prop_dictionary_set_cstring(testcase_dict, "name", testcase->name);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+       r = prop_dictionary_set_cstring(testcase_dict, "type", testcase->type_str);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       a = prop_array_create_with_capacity(testcase->argc+1);
+       if (a == NULL)
+               err(1, "prop_array_create for argv failed");
+
+       s = strrchr(testcase->name, '/');
+       r = prop_array_set_cstring(a, 0, (s == NULL) ? testcase->name : s+1);
+       if (r == 0)
+               err(1, "prop_array_set_cstring operation failed");
+
+       for (i = 1; i <= testcase->argc; i++) {
+               r = prop_array_set_cstring(a, i, testcase->argv[i-1]);
+               if (r == 0)
+                       err(1, "prop_array_set_cstring operation failed");
+       }
+
+       r = prop_dictionary_set(testcase_dict, "args", a);
+       if (r == 0)
+               err(1, "prop_dictionary_set \"args\" failed");
+
+       dict = prop_dictionary_create();
+       if (dict == NULL)
+               err(1, "could not create dict");
+
+       r = prop_dictionary_set_int32(dict, "timeout_in_secs",
+           (int32_t)testcase->opts.timeout_in_secs);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       r = prop_dictionary_set_uint32(dict, "flags", testcase->opts.flags);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       if (testcase->opts.pre_cmd != NULL) {
+               r = prop_dictionary_set_cstring(dict, "pre_cmd",
+                   testcase->opts.pre_cmd);
+               if (r == 0)
+                       err(1, "prop_dictionary operation failed");
+       }
+
+       if (testcase->opts.post_cmd != NULL) {
+               r = prop_dictionary_set_cstring(dict, "post_cmd",
+                   testcase->opts.post_cmd);
+               if (r == 0)
+                       err(1, "prop_dictionary operation failed");
+       }
+
+       r = prop_dictionary_set_uint32(dict, "runas_uid",
+           (uint32_t)testcase->opts.runas_uid);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       r = prop_dictionary_set_cstring(dict, "make_cmd",
+           (testcase->opts.make_cmd != NULL) ? testcase->opts.make_cmd : "make");
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       r = prop_dictionary_set(testcase_dict, "opts", dict);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return testcase_dict;
+}
+
+struct timeval *
+testcase_get_timeout(prop_dictionary_t testcase)
+{
+       static struct timeval tv;
+       int32_t val;
+       int r;
+
+       r = prop_dictionary_get_int32(prop_dictionary_get(testcase, "opts"),
+           "timeout_in_secs", &val);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       tv.tv_usec = 0;
+       tv.tv_sec = (long)val;
+
+       return &tv;
+}
+
+int
+testcase_get_type(prop_dictionary_t testcase)
+{
+       const char *type;
+       int r;
+
+       r = prop_dictionary_get_cstring_nocopy(testcase, "type", &type);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       if (strcmp(type, "userland") == 0)
+               return TESTCASE_TYPE_USERLAND;
+       else if (strcmp(type, "kernel") == 0)
+               return TESTCASE_TYPE_KERNEL;
+       else if (strcmp(type, "buildonly") == 0)
+               return TESTCASE_TYPE_BUILDONLY;
+
+       return 0;
+}
+
+const char *
+testcase_get_type_desc(prop_dictionary_t testcase)
+{
+       const char *str;
+       int r;
+
+       r = prop_dictionary_get_cstring_nocopy(testcase, "type", &str);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+       
+       return str;
+}
+
+const char *
+testcase_get_name(prop_dictionary_t testcase)
+{
+       const char *str;
+       int r;
+
+       r = prop_dictionary_get_cstring_nocopy(testcase, "name", &str);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return str;
+}
+
+const char **
+testcase_get_args(prop_dictionary_t testcase)
+{
+       /* Sane limit of 63 arguments... who wants more than that? */
+       static const char *argv[64];
+       unsigned int i, count;
+       prop_array_t a;
+       int r;
+
+       a = prop_dictionary_get(testcase, "args");
+       if (a == NULL)
+               err(1, "testcase_get_args NULL array");
+
+       count = prop_array_count(a);
+
+       for (i = 0; i < count; i++) {
+               r = prop_array_get_cstring_nocopy(a, i, &argv[i]);
+               if (r == 0)
+                       err(1, "error building argv");
+       }
+
+       argv[i] = NULL;
+
+       return argv;
+}
+
+uint32_t
+testcase_get_flags(prop_dictionary_t testcase)
+{
+       uint32_t flags;
+       int r;
+
+       r = prop_dictionary_get_uint32(prop_dictionary_get(testcase, "opts"),
+           "flags", &flags);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return flags;
+}
+
+int
+testcase_get_precmd_type(prop_dictionary_t testcase)
+{
+       uint32_t flags = testcase_get_flags(testcase);
+
+       return (flags & (TESTCASE_INT_PRE | TESTCASE_CUSTOM_PRE));
+}
+
+int
+testcase_get_postcmd_type(prop_dictionary_t testcase)
+{
+       uint32_t flags = testcase_get_flags(testcase);
+
+       return (flags & (TESTCASE_INT_POST | TESTCASE_CUSTOM_POST));
+}
+
+int
+testcase_needs_setuid(prop_dictionary_t testcase)
+{
+       uint32_t flags = testcase_get_flags(testcase);
+
+       return (flags & TESTCASE_RUN_AS);
+}
+
+uid_t
+testcase_get_runas_uid(prop_dictionary_t testcase)
+{
+       uint32_t uid = 0;
+       int r;
+
+       r = prop_dictionary_get_uint32(
+           prop_dictionary_get(testcase, "opts"), "runas_uid", &uid);
+
+       return (uid_t)uid;
+}
+
+const char *
+testcase_get_custom_precmd(prop_dictionary_t testcase)
+{
+       const char *str;
+       int r;
+
+       r = prop_dictionary_get_cstring_nocopy(
+           prop_dictionary_get(testcase, "opts"), "pre_cmd", &str);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return str;
+}
+
+const char *
+testcase_get_custom_postcmd(prop_dictionary_t testcase)
+{
+       const char *str;
+       int r;
+
+       r = prop_dictionary_get_cstring_nocopy(
+           prop_dictionary_get(testcase, "opts"), "pre_cmd", &str);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return str;
+}
+
+const char *
+testcase_get_make_cmd(prop_dictionary_t testcase)
+{
+       const char *str;
+       int r;
+
+       r = prop_dictionary_get_cstring_nocopy(
+           prop_dictionary_get(testcase, "opts"), "make_cmd", &str);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return str;
+}
+
+prop_dictionary_t
+testcase_get_result_dict(prop_dictionary_t testcase)
+{
+       prop_dictionary_t result_dict;
+       int r;
+
+       result_dict = prop_dictionary_get(testcase, "result");
+       if (result_dict == NULL) {
+               result_dict = prop_dictionary_create();
+               if (result_dict == NULL)
+                       err(1, "could not allocate new result dict");
+
+               r = prop_dictionary_set(testcase, "result", result_dict);
+               if (r == 0)
+                       err(1, "prop_dictionary operation failed");
+       }
+
+       return result_dict;
+}
+
+int
+testcase_set_build_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "build_buf", buf);
+}
+
+int
+testcase_set_cleanup_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "cleanup_buf", buf);
+}
+
+int
+testcase_set_sys_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "sys_buf", buf);
+}
+
+int
+testcase_set_precmd_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "precmd_buf", buf);
+}
+
+int
+testcase_set_postcmd_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "postcmd_buf", buf);
+}
+
+int
+testcase_set_stdout_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "stdout_buf", buf);
+}
+
+int
+testcase_set_stderr_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "stderr_buf", buf);
+}
+
+int
+testcase_set_result(prop_dictionary_t testcase, int result)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_int32(dict, "result", result);
+}
+
+int
+testcase_set_exit_value(prop_dictionary_t testcase, int exitval)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_int32(dict, "exit_value", exitval);
+}
+
+int
+testcase_set_signal(prop_dictionary_t testcase, int sig)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_int32(dict, "signal", sig);
+}
+
+const char *
+testcase_get_build_buf(prop_dictionary_t testcase)
+{
+       const char *str = "";
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_cstring_nocopy(dict, "build_buf", &str);
+
+       return str;
+}
+
+const char *
+testcase_get_cleanup_buf(prop_dictionary_t testcase)
+{
+       const char *str = "";
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_cstring_nocopy(dict, "cleanup_buf", &str);
+
+       return str;
+}
+
+const char *
+testcase_get_sys_buf(prop_dictionary_t testcase)
+{
+       const char *str = "";
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_cstring_nocopy(dict, "sys_buf", &str);
+
+       return str;
+}
+
+const char *
+testcase_get_precmd_buf(prop_dictionary_t testcase)
+{
+       const char *str = "";
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_cstring_nocopy(dict, "precmd_buf", &str);
+
+       return str;
+}
+
+const char *
+testcase_get_postcmd_buf(prop_dictionary_t testcase)
+{
+       const char *str = "";
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_cstring_nocopy(dict, "postcmd_buf", &str);
+
+       return str;
+}
+
+const char *
+testcase_get_stdout_buf(prop_dictionary_t testcase)
+{
+       const char *str = "";
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_cstring_nocopy(dict, "stdout_buf", &str);
+
+       return str;
+}
+
+const char *
+testcase_get_stderr_buf(prop_dictionary_t testcase)
+{
+       const char *str = "";
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_cstring_nocopy(dict, "stderr_buf", &str);
+
+       return str;
+}
+
+int
+testcase_get_result(prop_dictionary_t testcase)
+{
+       int32_t result = RESULT_NOTRUN;
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       prop_dictionary_get_int32(dict, "result", &result);
+
+       return (int)result;
+}
+
+const char *
+testcase_get_result_desc(prop_dictionary_t testcase)
+{
+       int result = testcase_get_result(testcase);
+
+       switch(result) {
+       case RESULT_TIMEOUT:    return "TIMEOUT";
+       case RESULT_SIGNALLED:  return "SIGNALLED";
+       case RESULT_NOTRUN:     return "NOT RUN";
+       case RESULT_FAIL:       return "FAIL";
+       case RESULT_PASS:       return "PASS";
+       case RESULT_PREFAIL:    return "PREFAIL";
+       case RESULT_POSTFAIL:   return "POSTFAIL";
+       case RESULT_BUILDFAIL:  return "BUILDFAIL";
+       default:                return "UNKNOWN";
+       }
+}
+
+int
+testcase_get_exit_value(prop_dictionary_t testcase)
+{
+       int32_t exitval;
+       int r;
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       r = prop_dictionary_get_int32(dict, "exit_value", &exitval);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return (int)exitval;
+}
+
+int
+testcase_get_signal(prop_dictionary_t testcase)
+{
+       int32_t sig;
+       int r;
+
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+       r = prop_dictionary_get_int32(dict, "signal", &sig);
+       if (r == 0)
+               err(1, "prop_dictionary operation failed");
+
+       return (int)sig;
+}
+
+int
+parse_testcase_option(struct testcase_options *opts, char *option)
+{
+       struct passwd *pwd;
+       char    *parameter, *endptr;
+       long    lval;
+       int     noparam = 0;
+
+       parameter = strchr(option, '=');
+       noparam = (parameter == NULL);
+       if (!noparam)
+       {
+               *parameter = '\0';
+               ++parameter;
+       }
+
+       if (strcmp(option, "timeout") == 0) {
+               if (noparam)
+                       syntax_error("The option 'timeout' needs a parameter");
+                       /* NOTREACHED */
+
+               lval = strtol(parameter, &endptr, 10);
+               if (*endptr != '\0')
+                       syntax_error("The option 'timeout' expects an integer "
+                           "parameter, not '%s'", parameter);
+                       /* NOTREACHED */
+
+               opts->timeout_in_secs = (long int)lval;
+       } else if (strcmp(option, "intpre") == 0) {
+               opts->flags |= TESTCASE_INT_PRE;
+       } else if (strcmp(option, "intpost") == 0) {
+               opts->flags |= TESTCASE_INT_POST;
+       } else if (strcmp(option, "pre") == 0) {
+               if (noparam)
+                       syntax_error("The option 'pre' needs a parameter");
+                       /* NOTREACHED */
+
+               opts->flags |= TESTCASE_CUSTOM_PRE;
+               opts->pre_cmd = strdup(parameter);
+       } else if (strcmp(option, "post") == 0) {
+               if (noparam)
+                       syntax_error("The option 'post' needs a parameter");
+                       /* NOTREACHED */
+
+               opts->flags |= TESTCASE_CUSTOM_POST;
+               opts->post_cmd = strdup(parameter);
+       } else if (strcmp(option, "runas") == 0) {
+               if (noparam)
+                       syntax_error("The option 'runas' needs a parameter");
+                       /* NOTREACHED */
+
+               if ((pwd = getpwnam(parameter))) {
+                       opts->runas_uid = pwd->pw_uid;
+                       opts->flags |= TESTCASE_RUN_AS;
+               } else {
+                       syntax_error("invalid user name for 'runas': %s",
+                           parameter);
+               }
+       } else if (strcmp(option, "nobuild") == 0) {
+               opts->flags |= TESTCASE_NOBUILD;
+       } else if (strcmp(option, "make") == 0) {
+               if (noparam)
+                       syntax_error("The option 'make' needs a parameter");
+                       /* NOTREACHED */
+
+               opts->make_cmd = strdup(parameter);
+       } else if (strcmp(option, "defaults") == 0) {
+               /* Valid option, does nothing */
+       } else {
+               syntax_error("Unknown option: %s", option);
+               /* NOTREACHED */
+       }
+
+       return 0;
+}
+
+void
+testcase_entry_parser(void *arg, char **tokens)
+{
+       prop_array_t runlist;
+       prop_dictionary_t testcase_dict;
+       struct testcase *testcase;
+       char *options[256];
+       int i, r, nopts;
+
+       runlist = (prop_array_t)arg;
+
+       testcase = malloc(sizeof(struct testcase));
+       if (testcase == NULL)
+               err(1, "could not malloc testcase memory");
+
+       bzero(testcase, sizeof(struct testcase));
+
+       entry_check_num_args(tokens, 3);
+
+       testcase->argv = &tokens[3];
+       for (testcase->argc = 0; testcase->argv[testcase->argc] != NULL;
+            testcase->argc++)
+               ;
+
+       nopts = parse_options(tokens[2], options);
+
+       testcase->name = tokens[0];
+
+       if (strcmp(tokens[1], "userland") == 0) {
+               testcase->type = TESTCASE_TYPE_USERLAND;
+       } else if (strcmp(tokens[1], "kernel") == 0) {
+               testcase->type = TESTCASE_TYPE_KERNEL;
+       } else if (strcmp(tokens[1], "buildonly") == 0) {
+               testcase->type = TESTCASE_TYPE_BUILDONLY;
+       } else {
+               syntax_error("Unknown type: %s", tokens[1]);
+               /* NOTREACHED */
+       }
+
+       testcase->type_str = tokens[1];
+
+       config_get_defaults(&testcase->opts);
+
+       for (i = 0; i < nopts; i++)
+               parse_testcase_option(&testcase->opts, options[i]);
+
+       if ((testcase->type != TESTCASE_TYPE_USERLAND) &&
+           (testcase->opts.flags & (TESTCASE_INT_PRE | TESTCASE_INT_POST)))
+               syntax_error("'intpre' and 'intpost' options are only valid "
+                   "with testcase type 'userland'");
+
+       if ((testcase->type == TESTCASE_TYPE_BUILDONLY) &&
+           (testcase->opts.flags & TESTCASE_NOBUILD))
+               syntax_error("'nobuild' option is incompatible with type "
+                   "'buildonly'");
+
+       testcase_dict = testcase_from_struct(testcase);
+       if (testcase->opts.pre_cmd != NULL)
+               free(testcase->opts.pre_cmd);
+       if (testcase->opts.post_cmd != NULL)
+               free(testcase->opts.post_cmd);
+       if (testcase->opts.make_cmd != NULL)
+               free(testcase->opts.make_cmd);
+       free(testcase);
+
+       r = prop_array_add(runlist, testcase_dict);
+       if (r == 0)
+               err(1, "prop_array_add failed");
+}
diff --git a/test/dfregress/driver/testcase.h b/test/dfregress/driver/testcase.h
new file mode 100644 (file)
index 0000000..3b06c51
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#define TESTCASE_TYPE_USERLAND 0x01
+#define TESTCASE_TYPE_KERNEL   0x02
+#define TESTCASE_TYPE_BUILDONLY        0x03
+
+#define TESTCASE_INT_PRE       0x001
+#define TESTCASE_INT_POST      0x002
+#define TESTCASE_CUSTOM_PRE    0x004
+#define TESTCASE_CUSTOM_POST   0x008
+#define TESTCASE_NOBUILD       0x010
+#define TESTCASE_RUN_AS                0x020
+
+
+struct testcase_options {
+       long int        timeout_in_secs;
+       uint32_t        flags;
+       uid_t           runas_uid;
+
+       char            *pre_cmd;
+       char            *post_cmd;
+       char            *make_cmd;
+};
+
+struct testcase_result {
+       int             result;
+       int             exit_value;
+       int             signal;
+       int             core_dumped;
+
+       char            *stdout_buf;
+       char            *stderr_buf;
+
+       struct rusage   rusage;
+};
+
+struct testcase {
+       char            *name;
+       char            **argv;
+       int             argc;
+       char            *type_str;
+       int             type;
+
+       struct testcase_options opts;
+       struct testcase_result  results;
+};
+
+prop_dictionary_t testcase_from_struct(struct testcase *testcase);
+
+struct timeval *testcase_get_timeout(prop_dictionary_t testcase);
+int testcase_get_type(prop_dictionary_t testcase);
+const char *testcase_get_type_desc(prop_dictionary_t testcase);
+const char *testcase_get_name(prop_dictionary_t testcase);
+const char **testcase_get_args(prop_dictionary_t testcase);
+uint32_t testcase_get_flags(prop_dictionary_t testcase);
+int testcase_get_precmd_type(prop_dictionary_t testcase);
+int testcase_get_postcmd_type(prop_dictionary_t testcase);
+int testcase_needs_setuid(prop_dictionary_t testcase);
+uid_t testcase_get_runas_uid(prop_dictionary_t testcase);
+const char *testcase_get_custom_precmd(prop_dictionary_t testcase);
+const char *testcase_get_custom_postcmd(prop_dictionary_t testcase);
+const char *testcase_get_make_cmd(prop_dictionary_t testcase);
+prop_dictionary_t testcase_get_result_dict(prop_dictionary_t testcase);
+int testcase_set_build_buf(prop_dictionary_t testcase, const char *buf);
+int testcase_set_cleanup_buf(prop_dictionary_t testcase, const char *buf);
+int testcase_set_sys_buf(prop_dictionary_t testcase, const char *buf);
+int testcase_set_precmd_buf(prop_dictionary_t testcase, const char *buf);
+int testcase_set_postcmd_buf(prop_dictionary_t testcase, const char *buf);
+int testcase_set_stdout_buf(prop_dictionary_t testcase, const char *buf);
+int testcase_set_stderr_buf(prop_dictionary_t testcase, const char *buf);
+int testcase_set_stdout_buf_from_file(prop_dictionary_t testcase, const char *file);
+int testcase_set_stderr_buf_from_file(prop_dictionary_t testcase, const char *file);
+int testcase_set_result(prop_dictionary_t testcase, int result);
+int testcase_set_exit_value(prop_dictionary_t testcase, int exitval);
+int testcase_set_signal(prop_dictionary_t testcase, int sig);
+const char *testcase_get_build_buf(prop_dictionary_t testcase);
+const char *testcase_get_cleanup_buf(prop_dictionary_t testcase);
+const char *testcase_get_sys_buf(prop_dictionary_t testcase);
+const char *testcase_get_precmd_buf(prop_dictionary_t testcase);
+const char *testcase_get_postcmd_buf(prop_dictionary_t testcase);
+const char *testcase_get_stdout_buf(prop_dictionary_t testcase);
+const char *testcase_get_stderr_buf(prop_dictionary_t testcase);
+int testcase_get_result(prop_dictionary_t testcase);
+const char *testcase_get_result_desc(prop_dictionary_t testcase);
+int testcase_get_exit_value(prop_dictionary_t testcase);
+int testcase_get_signal(prop_dictionary_t testcase);
+
+int parse_testcase_option(struct testcase_options *opts, char *option);
+void testcase_entry_parser(void *arg, char **tokens);
diff --git a/test/dfregress/driver/userland.c b/test/dfregress/driver/userland.c
new file mode 100644 (file)
index 0000000..c74a7c0
--- /dev/null
@@ -0,0 +1,295 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <pwd.h>
+
+#include <err.h>
+
+#include <libprop/proplib.h>
+
+#include "testcase.h"
+#include "runlist.h"
+#include "userland.h"
+#include "../framework/dfregress.h"
+
+static void
+clean_child(pid_t pid)
+{
+       kill(pid, SIGKILL);
+}
+
+static void
+sig_handle(int sig __unused)
+{
+       return;
+}
+
+int
+run_userland(const char *binary, const char **argv, int need_setuid, uid_t uid,
+    struct timeval *timeout, int unify_output, char *errbuf, size_t errbuf_sz,
+    struct testcase_result *tr)
+{
+       struct itimerval itim;
+       struct sigaction sa;
+       pid_t pid, r_pid;
+       int r, status;
+       int fd_stdout = -1, fd_stderr = -1;
+       size_t sz_stdout, sz_stderr;
+       char stdout_file[256];
+       char stderr_file[256];
+       char *str;
+
+       /* Set sane defaults */
+       bzero(tr, sizeof(*tr));
+       tr->result = RESULT_NOTRUN;
+
+       strcpy(stdout_file, "/tmp/dfregress.XXXXXXXXXXXX");
+       strcpy(stderr_file, "/tmp/dfregress.XXXXXXXXXXXX");
+       str = mktemp(stdout_file);
+       if (str == NULL) {
+               if (errbuf)
+                       snprintf(errbuf, errbuf_sz, "Could not mktemp(): "
+                           "%s\n", strerror(errno));
+               return -1;
+       }
+
+       if (!unify_output) {
+               str = mktemp(stderr_file);
+               if (str == NULL) {
+                       if (errbuf)
+                               snprintf(errbuf, errbuf_sz, "Could not mktemp(): "
+                               "%s\n", strerror(errno));
+                       return -1;
+               }
+       }
+
+       fd_stdout = open(stdout_file, O_RDWR | O_CREAT | O_FSYNC);
+       if (fd_stdout < 0) {
+               if (errbuf)
+                       snprintf(errbuf, errbuf_sz, "Could not open() temp file "
+                           "for stdout: %s\n", strerror(errno));
+               goto err_out;
+       }
+
+       if (!unify_output) {
+               fd_stderr = open(stderr_file, O_RDWR | O_CREAT | O_FSYNC);
+               if (fd_stderr < 0) {
+                       if (errbuf)
+                               snprintf(errbuf, errbuf_sz, "Could not open() "
+                               "temp file for stderr: %s\n", strerror(errno));
+                       goto err_out;
+               }
+       }
+
+
+       if ((pid = fork()) == -1) {
+               if (errbuf)
+                       snprintf(errbuf, errbuf_sz, "Could not fork to run "
+                           "binary %s: %s\n", binary, strerror(errno));
+
+               goto err_out;
+       } else if (pid > 0) {
+               /* parent */
+
+               if (timeout != NULL) {
+                       /* Ignore SIGALRM */
+                       bzero(&sa, sizeof(sa));
+                       sa.sa_handler = sig_handle;
+                       sigaction(SIGALRM, &sa, NULL);
+
+                       /* Set up timeout */
+                       itim.it_interval.tv_sec = 0;
+                       itim.it_interval.tv_usec = 0;
+                       itim.it_value = *timeout;
+                       r = setitimer(ITIMER_REAL, &itim, NULL);
+                       if (r == -1) {
+                               if (errbuf)
+                                       snprintf(errbuf, errbuf_sz, "Could not "
+                                           "set up timer: %s", strerror(errno));
+
+                               /* Clean up child process! */
+                               goto err_out;
+                       }
+               }
+
+               r_pid = wait4(pid, &status, 0, &tr->rusage);
+               if (r_pid == -1) {
+                       if (errno == EINTR) {
+                               /* Alarm timed out */
+                               tr->result = RESULT_TIMEOUT;
+
+                               /* Clean up child process! */
+                               clean_child(pid);
+                       } else if (errno == ECHILD) {
+                               /* Child already exited somehow */
+                               tr->result = RESULT_UNKNOWN;
+                       } else {
+                               /* EFAULT */
+                               if (errbuf)
+                                       snprintf(errbuf, errbuf_sz, "Could not "
+                                           "wait4(): %s", strerror(errno));
+
+                               goto err_out;
+                       }
+               } else {
+                       if (WIFEXITED(status)) {
+                               tr->result = (WEXITSTATUS(status) == 0) ?
+                                   RESULT_PASS :
+                                   (WEXITSTATUS(status) == EXIT_NOTRUN) ?
+                                   RESULT_NOTRUN : RESULT_FAIL;
+
+                               tr->exit_value = WEXITSTATUS(status);
+                       } else if (WIFSIGNALED(status)) {
+                               tr->result = RESULT_SIGNALLED;
+                               tr->signal = WTERMSIG(status);
+                               tr->core_dumped = (WCOREDUMP(status)) ? 1 : 0;
+                       } else {
+                               tr->result = RESULT_UNKNOWN;
+                       }
+               }
+
+               if (timeout != NULL) {
+                       /* Disable timer */
+                       itim.it_value.tv_sec = 0;
+                       itim.it_value.tv_usec = 0;
+                       setitimer(ITIMER_REAL, &itim, NULL);
+               }
+       } else {
+               /* pid == 0, so we are the child */
+
+               /* Redirect stdout and stderr */
+               if (fd_stdout >= 0) {
+                       dup2(fd_stdout, 1);
+                       setvbuf(stdout, NULL, _IONBF, 0);
+               }
+
+               if ((fd_stderr >= 0) || (unify_output && fd_stdout >= 0)) {
+                       dup2((unify_output) ? fd_stdout : fd_stderr, 2);
+                       setvbuf((unify_output) ? stdout : stderr,
+                           NULL, _IONBF, 0);
+               }
+
+               /* Set uid if necessary */
+               if (need_setuid) {
+                       r = setuid(uid);
+                       if (r == -1) {
+                               fprintf(stderr, "ERR: NOT RUN (setuid): %s",
+                                   strerror(errno));
+                               exit(EXIT_NOTRUN);
+                       }
+               }
+
+               /* Try to exec() */
+               r = execvp(binary, __DECONST(char **, argv));
+               if (r == -1) {
+                       /*
+                        * If we couldn't exec(), notify parent that we didn't
+                        * run.
+                        */
+                       fprintf(stderr, "ERR: NOT RUN: %s", strerror(errno));
+                       exit(EXIT_NOTRUN);
+               }
+       }
+
+       /* Read stdout and stderr redirected file contents into memory */
+       sz_stdout = (size_t)lseek(fd_stdout, 0, SEEK_END);
+       lseek(fd_stdout, 0, SEEK_SET);
+
+       tr->stdout_buf = malloc(sz_stdout + 1);
+       if (tr->stdout_buf == NULL)
+               err(1, "could not malloc fd buf memory");
+
+       read(fd_stdout, tr->stdout_buf, sz_stdout);
+       tr->stdout_buf[sz_stdout] = '\0';
+
+       close(fd_stdout);
+       unlink(stdout_file);
+
+       if (!unify_output) {
+               sz_stderr = (size_t)lseek(fd_stderr, 0, SEEK_END);
+               lseek(fd_stderr, 0, SEEK_SET);
+
+               tr->stderr_buf = malloc(sz_stderr + 1);
+               if (tr->stderr_buf == NULL)
+                       err(1, "could not malloc fd buf memory");
+
+               read(fd_stderr, tr->stderr_buf, sz_stderr);
+               tr->stderr_buf[sz_stderr] = '\0';
+
+               close(fd_stderr);
+               unlink(stderr_file);
+       }
+
+
+       return 0;
+       /* NOTREACHED */
+
+err_out:
+       if (pid != -1)
+               clean_child(pid);
+
+       if (fd_stdout >= 0)
+               close(fd_stdout);
+               unlink(stdout_file);
+
+       if (fd_stderr >= 0)
+               close(fd_stderr);
+               unlink(stderr_file);
+
+       return -1;
+}
+
+int
+run_simple_cmd(const char *binary, const char *arg, char *errbuf,
+    size_t errbuf_sz, struct testcase_result *tr)
+{
+       const char *argv[3];
+       char *s;
+
+       s = strrchr(binary, '/');
+
+       argv[0] = (s == NULL) ? __DECONST(char *, binary) : s+1;
+       argv[1] = __DECONST(char *, arg);
+       argv[2] = NULL;
+
+       return run_userland(binary, argv, 0, 0, NULL, 1, errbuf, errbuf_sz, tr);
+}
diff --git a/test/dfregress/driver/userland.h b/test/dfregress/driver/userland.h
new file mode 100644 (file)
index 0000000..762395b
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+int run_userland(const char *binary, const char **argv, int need_setuid, uid_t uid,
+    struct timeval *timeout, int unify_output, char *errbuf, size_t errbuf_sz,
+    struct testcase_result *tr);
+int run_simple_cmd(const char *binary, const char *arg, char *errbuf,
+    size_t errbuf_sz, struct testcase_result *tr);
diff --git a/test/dfregress/fe/text/Makefile b/test/dfregress/fe/text/Makefile
new file mode 100644 (file)
index 0000000..e85aa13
--- /dev/null
@@ -0,0 +1,18 @@
+DRIVER_DIR=    ${.CURDIR}/../../driver
+
+PROG=          dfregress2text
+NOMAN=
+DEBUG_FLAGS=   -O0 -g3
+
+SRCS+=         fe_text.c config.c parser.c
+SRCS+=         runlist.c testcase.c
+SRCS+=         kernel.c userland.c
+
+LDADD+=                -lprop -lutil
+DPADD+=                ${LIBPROP} ${LIBUITL}
+
+CFLAGS+=       -I${DRIVER_DIR}
+
+.PATH: ${DRIVER_DIR}
+
+.include <bsd.prog.mk>
diff --git a/test/dfregress/fe/text/fe_text.c b/test/dfregress/fe/text/fe_text.c
new file mode 100644 (file)
index 0000000..c567b7e
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <err.h>
+
+#include <libprop/proplib.h>
+
+#include "parser.h"
+#include "testcase.h"
+#include "runlist.h"
+#include "../../framework/dfregress.h"
+
+static int count_by_result[10];
+
+static void
+print_row(char c)
+{
+       int i;
+
+       for (i = 0; i < 80; i++)
+               printf("%c", c);
+       printf("\n");
+}
+
+static void
+print_header(void)
+{
+       int i, j;
+
+       i = printf("Test case");
+       for (j = 60 - i; j > 0; j--)
+               printf(" ");
+       printf("Result\n");
+
+       print_row('-');
+}
+
+static char *get_arg_string(prop_dictionary_t testcase)
+{
+       static char buf[2048];
+       const char **argv;
+       int i;
+
+       buf[0] = '\0';
+
+       argv = testcase_get_args(testcase);
+
+       /* Skip the first argument, since it's just the test's name */
+       for (i = 1; argv[i] != NULL; i++) {
+               strcat(buf, argv[i]);
+               if (argv[i+1] != NULL)
+                       strcat(buf, " ");
+       }
+
+       return (i > 1) ? buf : NULL;
+}
+
+static void
+print_summary(prop_array_t runlist)
+{
+       int i;
+       float total_run;
+       float total_tests;
+
+       total_tests = 0.0 + prop_array_count(runlist);
+       total_run = 0.0 + total_tests - count_by_result[RESULT_BUILDFAIL] -
+           count_by_result[RESULT_PREFAIL] - count_by_result[RESULT_NOTRUN] -
+           count_by_result[RESULT_UNKNOWN];
+
+       printf("\n\n");
+       print_row('=');
+       printf("Summary:\n\n");
+
+
+       printf("Tests not built:\t%d\n", count_by_result[RESULT_BUILDFAIL]);
+
+       printf("Tests not run:\t\t%.0f\n", total_tests - total_run);
+
+       printf("Tests pre-failed:\t%d\n", count_by_result[RESULT_PREFAIL]);
+
+       printf("Tests post-failed:\t%d\n", count_by_result[RESULT_POSTFAIL]);
+
+       printf("Tests passed:\t\t%d\n", count_by_result[RESULT_PASS]);
+
+       printf("Tests failed:\t\t%d\n", count_by_result[RESULT_FAIL]);
+
+       printf("Tests crashed:\t\t%d\n", count_by_result[RESULT_SIGNALLED]);
+
+       printf("Tests timed out:\t%d\n", count_by_result[RESULT_TIMEOUT]);
+
+
+       printf("------\n");
+
+       printf("Run rate:\t\t%.2f\n", total_run/total_tests);
+       printf("Pass rate:\t\t%.2f\n", count_by_result[RESULT_PASS]/total_run);
+}
+
+static int
+runlist_parse_summary(void *arg, prop_dictionary_t testcase)
+{
+       char *args;
+       int i, j;
+
+       ++count_by_result[testcase_get_result(testcase)];
+       args = get_arg_string(testcase);
+
+       i = printf("%s", testcase_get_name(testcase));
+       if (args != NULL)
+               i+= printf(" (%s)", args);
+
+       for (j = 60 - i; j > 0; j--)
+               printf(" ");
+
+       printf("%s\n", testcase_get_result_desc(testcase));
+
+       return 0;
+}
+
+static int
+runlist_parse_detail(void *arg, prop_dictionary_t testcase)
+{
+       char *args;
+       int i;
+
+       args = get_arg_string(testcase);
+
+       printf("\n");
+       print_row('=');
+
+       printf("Test: %s\n", testcase_get_name(testcase));
+       if (args != NULL)
+               printf("Command line arguments: %s\n", args);
+
+       printf("Type: %s\n", testcase_get_type_desc(testcase));
+       printf("Result: %s\n", testcase_get_result_desc(testcase));
+
+       switch (testcase_get_result(testcase)) {
+       case RESULT_FAIL:
+               printf("Exit code: %d\n", testcase_get_exit_value(testcase));
+               break;
+
+       case RESULT_SIGNALLED:
+               printf("Signal: %d\n", testcase_get_signal(testcase));
+               break;
+       };
+
+       print_row('-');
+       printf("driver sysbuf:\n%s\n", testcase_get_sys_buf(testcase));
+       print_row('-');
+       printf("build log:\n%s\n", testcase_get_build_buf(testcase));
+       print_row('-');
+       printf("'pre' log:\n%s\n", testcase_get_precmd_buf(testcase));
+       print_row('-');
+       printf("testcase stdout:\n%s\n", testcase_get_stdout_buf(testcase));
+       print_row('-');
+       printf("testcase stderr:\n%s\n", testcase_get_stderr_buf(testcase));
+       print_row('-');
+       printf("'post' log:\n%s\n", testcase_get_postcmd_buf(testcase));
+       print_row('-');
+       printf("cleanup log:\n%s\n", testcase_get_cleanup_buf(testcase));
+
+       return 0;
+}
+
+int
+main(int argc, char *argv[])
+{
+       if (argc != 2) {
+               fprintf(stderr, "Usage: dfregress2text <foo.plist>\n");
+               exit(1);
+       }
+
+       prop_array_t runlist = runlist_load(argv[1]);
+
+       memset(count_by_result, 0, sizeof(count_by_result));
+       print_header();
+       runlist_iterate(runlist, runlist_parse_summary, runlist);
+       print_summary(runlist);
+       printf("\n\nDETAILED RESULTS:\n");
+
+       runlist_iterate(runlist, runlist_parse_detail, runlist);
+       return 0;
+}
+
diff --git a/test/dfregress/framework/dfregress.h b/test/dfregress/framework/dfregress.h
new file mode 100644 (file)
index 0000000..53561e2
--- /dev/null
@@ -0,0 +1,11 @@
+#define RESULT_TIMEOUT         0x01
+#define RESULT_SIGNALLED       0x02
+#define RESULT_NOTRUN          0x03
+#define RESULT_FAIL            0x04
+#define RESULT_PASS            0x05
+#define RESULT_UNKNOWN         0x06
+#define RESULT_PREFAIL         0x07
+#define RESULT_POSTFAIL                0x08
+#define RESULT_BUILDFAIL       0x09
+
+#define EXIT_NOTRUN            127
diff --git a/test/dfregress/framework/tbridge.h b/test/dfregress/framework/tbridge.h
new file mode 100644 (file)
index 0000000..2d03acb
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#define TBRIDGE_LOADTEST       _IOW('T', 0xBB, struct plistref)
+#define TBRIDGE_GETRESULT      _IOR('T', 0xBC, struct plistref)
+
+#if defined(_KERNEL)
+
+typedef int (*tbridge_abort_t)(void);
+typedef void (*tbridge_run_t)(void *);
+
+struct tbridge_testcase {
+       tbridge_abort_t tb_abort;
+       tbridge_run_t   tb_run;
+};
+
+int tbridge_printf(const char *fmt, ...);
+void tbridge_test_done(int result);
+
+/* safemem functions */
+void *_alloc_safe_mem(size_t req_sz, const char *file, int line);
+void _free_safe_mem(void *mem, const char *file, int line);
+void check_and_purge_safe_mem(void);
+void safemem_reset_error_count(void);
+int safemem_get_error_count(void);
+
+#define alloc_testcase_mem(x) \
+       _alloc_safe_mem(x, __FILE__, __LINE__)
+
+#define free_testcase_mem(x) \
+       _free_safe_mem(x, __FILE__, __LINE__)
+
+
+
+/* module magic */
+int tbridge_testcase_modhandler(module_t mod, int type, void *arg);
+
+#define TBRIDGE_TESTCASE_MODULE(name, testcase)                        \
+static moduledata_t name##_mod = {                             \
+       #name,                                                  \
+       tbridge_testcase_modhandler,                            \
+       testcase                                                \
+};                                                             \
+DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_ANY)
+
+#endif
diff --git a/test/dfregress/framework/test.txt b/test/dfregress/framework/test.txt
new file mode 100644 (file)
index 0000000..fd40726
--- /dev/null
@@ -0,0 +1,2 @@
+- assertions
+- logging levels
diff --git a/test/dfregress/kernel_bridge/Makefile b/test/dfregress/kernel_bridge/Makefile
new file mode 100644 (file)
index 0000000..585758d
--- /dev/null
@@ -0,0 +1,4 @@
+KMOD=   testbridge
+SRCS=   dfregress_bridge.c safe_mem.c
+
+.include <bsd.kmod.mk>
diff --git a/test/dfregress/kernel_bridge/dfregress_bridge.c b/test/dfregress/kernel_bridge/dfregress_bridge.c
new file mode 100644 (file)
index 0000000..0d8230f
--- /dev/null
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/conf.h>
+#include <sys/malloc.h>
+#include <machine/md_var.h>
+#include <sys/ctype.h>
+#include <sys/kthread.h>
+#include <sys/device.h>
+#include <sys/fcntl.h>
+#include <sys/ioccom.h>
+#include <machine/varargs.h>
+#include <sys/module.h>
+#include <libprop/proplib.h>
+#include "../framework/dfregress.h"
+#include "../framework/tbridge.h"
+
+static cdev_t          tbridge_dev;
+static d_open_t                tbridge_dev_open;
+static d_close_t       tbridge_dev_close;
+static d_ioctl_t       tbridge_dev_ioctl;
+
+
+static struct dev_ops tbridge_dev_ops = {
+       { "tbridge", 0, 0 },
+       .d_open = tbridge_dev_open,
+       .d_close = tbridge_dev_close,
+       .d_ioctl = tbridge_dev_ioctl
+};
+
+static struct tbridge_testcase *tbridge_curtest = NULL;
+static prop_dictionary_t tbridge_testcase = NULL;
+static int tbridge_result_ready = 0;
+static char tbridge_msgbuf[131072]; /* 128 kB message buffer */
+static char *tbridge_msgbuf_ptr;
+size_t tbridge_msgbuf_remsz;
+
+static prop_dictionary_t
+testcase_get_result_dict(prop_dictionary_t testcase)
+{
+       prop_dictionary_t result_dict;
+       int r;
+
+       result_dict = prop_dictionary_get(testcase, "result");
+       if (result_dict == NULL) {
+               result_dict = prop_dictionary_create();
+               if (result_dict == NULL) {
+                       kprintf("could not allocate new result dict");
+                       return NULL;
+               }
+
+               r = prop_dictionary_set(testcase, "result", result_dict);
+               if (r == 0) {
+                       kprintf("prop_dictionary operation failed");
+                       return NULL;
+               }
+       }
+
+       return result_dict;
+}
+
+static int
+testcase_get_timeout(prop_dictionary_t testcase)
+{
+       int32_t val;
+       int r;
+
+       r = prop_dictionary_get_int32(prop_dictionary_get(testcase, "opts"),
+           "timeout_in_secs", &val);
+       if (r == 0)
+               val = 600/* default timeout = 10min */;
+               
+       return val;
+}
+
+static int
+testcase_set_stdout_buf(prop_dictionary_t testcase, const char *buf)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_cstring(dict, "stdout_buf", buf);
+}
+
+static int
+testcase_set_result(prop_dictionary_t testcase, int result)
+{
+       prop_dictionary_t dict = testcase_get_result_dict(testcase);
+
+       return !prop_dictionary_set_int32(dict, "result", result);
+}
+
+static const char *
+testcase_get_name(prop_dictionary_t testcase)
+{
+       const char *str;
+       int r;
+
+       r = prop_dictionary_get_cstring_nocopy(testcase, "name", &str);
+       if (r == 0)
+               str = "???";
+
+       return str;
+}
+
+int
+tbridge_printf(const char *fmt, ...)
+{
+       __va_list args;
+       int i;
+
+       __va_start(args,fmt);
+       i = kvsnprintf(tbridge_msgbuf_ptr, tbridge_msgbuf_remsz, fmt, args);
+       __va_end(args);
+
+       tbridge_msgbuf_ptr += i;
+       tbridge_msgbuf_remsz -= i;
+
+       return i;
+}
+
+static int
+tbridge_register(struct tbridge_testcase *test)
+{
+       if (tbridge_curtest != NULL)
+               return EBUSY;
+
+       tbridge_curtest = test;
+
+       return 0;
+}
+
+static int
+tbridge_unregister(void)
+{
+       tbridge_curtest = NULL;
+
+       return 0;
+}
+
+int
+tbridge_testcase_modhandler(module_t mod, int type, void *arg)
+{
+       struct tbridge_testcase *tcase = (struct tbridge_testcase *)arg;
+       int error = 0;
+
+       switch (type) {
+       case MOD_LOAD:
+               error = tbridge_register(tcase);
+               break;
+
+       case MOD_UNLOAD:
+               if (tcase->tb_abort != NULL)
+                       error = tcase->tb_abort();
+
+               if (!error)
+                       tbridge_unregister();
+               break;
+
+       default:
+               break;
+       }
+
+       return error;
+}
+
+void
+tbridge_test_done(int result)
+{
+       KKASSERT(tbridge_testcase != NULL);
+
+       kprintf("testcase '%s' called test_done with result=%d\n",
+           testcase_get_name(tbridge_testcase), result);
+
+       testcase_set_result(tbridge_testcase, result);
+       testcase_set_stdout_buf(tbridge_testcase, tbridge_msgbuf);
+
+       tbridge_result_ready = 1;
+       wakeup(&tbridge_result_ready);
+}
+
+static void
+tbridge_reset(void)
+{
+       tbridge_msgbuf_ptr = tbridge_msgbuf;
+       tbridge_msgbuf_remsz = sizeof(tbridge_msgbuf);
+
+       if (tbridge_testcase != NULL) {
+               prop_object_release(tbridge_testcase);
+               tbridge_testcase = NULL;
+       }
+
+       safemem_reset_error_count();
+       tbridge_result_ready = 0;
+}
+
+
+/*
+ * dev stuff
+ */
+static int
+tbridge_dev_open(struct dev_open_args *ap)
+{
+       return 0;
+}
+
+static int
+tbridge_dev_close(struct dev_close_args *ap)
+{
+       return 0;
+}
+
+static int
+tbridge_dev_ioctl(struct dev_ioctl_args *ap)
+{
+       struct plistref *pref;
+       struct thread *td;
+       int error, r;
+
+       error = 0;
+
+       /* Use proplib(3) for userspace/kernel communication */
+       pref = (struct plistref *)ap->a_data;
+
+       switch(ap->a_cmd) {
+       case TBRIDGE_LOADTEST:
+               tbridge_reset();
+
+               if (tbridge_curtest == NULL)
+                       return EINVAL;
+
+               error = prop_dictionary_copyin_ioctl(pref, ap->a_cmd,
+                   &tbridge_testcase);
+               if (error)
+                       return error;
+
+               break;
+
+       case TBRIDGE_GETRESULT:
+               error = kthread_create(tbridge_curtest->tb_run, NULL, &td,
+                   "testrunner");
+               if (error)
+                       tbridge_test_done(RESULT_PREFAIL);
+
+               /* The following won't be called if the thread wasn't created */
+               if (!tbridge_result_ready) {
+                       r = tsleep(&tbridge_result_ready, 0, "tbridgeres",
+                           hz * testcase_get_timeout(tbridge_testcase));
+                       if (r != 0) {
+                               if (tbridge_curtest->tb_abort != NULL)
+                                       tbridge_curtest->tb_abort();
+
+                               tbridge_test_done(RESULT_TIMEOUT);
+                       }
+               }
+
+               if (safemem_get_error_count() != 0) {
+                       /*
+                        * If there were any double-frees or buffer over- or
+                        * underflows, we mark the result as 'signalled', i.e.
+                        * the equivalent of a SIGSEGV/SIGBUS in userland.
+                        */
+                       testcase_set_result(tbridge_testcase, RESULT_SIGNALLED);
+               }
+
+               error = prop_dictionary_copyout_ioctl(pref, ap->a_cmd,
+                   tbridge_testcase);
+               if (error)
+                       return error;
+
+               break;
+       default:
+               error = ENOTTY; /* Inappropriate ioctl for device */
+               break;
+       }
+
+       return(error);
+}
+
+
+static int
+testbridge_modevent(module_t mod, int type, void *unused)
+{
+       switch (type) {
+       case MOD_LOAD:
+               tbridge_dev = make_dev(&tbridge_dev_ops,
+                   0,
+                   UID_ROOT,
+                   GID_WHEEL,
+                   0600,
+                   "tbridge");
+
+               tbridge_testcase = NULL;
+               tbridge_reset();
+
+               kprintf("dfregress kernel test bridge ready!\n");
+               return 0;
+
+       case MOD_UNLOAD:
+               destroy_dev(tbridge_dev);
+               kprintf("dfregress kernel test bridge unloaded.\n");
+               return 0;
+       }
+
+       return EINVAL;
+}
+
+static moduledata_t testbridge_mod = {
+       "testbridge",
+       testbridge_modevent,
+       0
+};
+
+DECLARE_MODULE(testbridge, testbridge_mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
+MODULE_VERSION(testbridge, 1);
diff --git a/test/dfregress/kernel_bridge/safe_mem.c b/test/dfregress/kernel_bridge/safe_mem.c
new file mode 100644 (file)
index 0000000..9c6ea8d
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2011 Alex Hornung <alex@alexhornung.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 HOLDERS 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.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/libkern.h>
+
+#include "../framework/tbridge.h"
+
+MALLOC_DEFINE(M_SAFEMEM, "safemem", "safemem kernel port");
+
+struct safe_mem_hdr {
+       struct safe_mem_hdr     *prev;
+       struct safe_mem_hdr     *next;
+       struct safe_mem_tail    *tail;
+       const char      *file;
+       int             line;
+       size_t          alloc_sz;
+       char            sig[8]; /* SAFEMEM */
+};
+
+struct safe_mem_tail {
+       char sig[8]; /* SAFEMEM */
+};
+
+static struct safe_mem_hdr *safe_mem_hdr_first = NULL;
+
+static int safemem_error_count = 0;
+
+void
+safemem_reset_error_count(void)
+{
+       safemem_error_count = 0;
+}
+
+int
+safemem_get_error_count(void)
+{
+       return safemem_error_count;
+}
+
+void *
+_alloc_safe_mem(size_t req_sz, const char *file, int line)
+{
+       struct safe_mem_hdr *hdr, *hdrp;
+       struct safe_mem_tail *tail;
+       size_t alloc_sz;
+       char *mem, *user_mem;
+
+       /* only shift, to make sure things (TM) keep aligned */
+       alloc_sz = req_sz;
+       mem = kmalloc(alloc_sz << 2, M_SAFEMEM, M_WAITOK);
+
+       bzero(mem, alloc_sz << 2);
+
+       user_mem = mem + alloc_sz;
+       hdr = (struct safe_mem_hdr *)(user_mem - sizeof(*hdr));
+       tail = (struct safe_mem_tail *)(user_mem + alloc_sz);
+
+       strcpy(hdr->sig, "SAFEMEM");
+       strcpy(tail->sig, "SAFEMEM");
+       hdr->tail = tail;
+       hdr->alloc_sz = alloc_sz;
+       hdr->file = file;
+       hdr->line = line;
+       hdr->next = NULL;
+
+       if (safe_mem_hdr_first == NULL) {
+               safe_mem_hdr_first = hdr;
+       } else {
+               hdrp = safe_mem_hdr_first;
+               while (hdrp->next != NULL)
+                       hdrp = hdrp->next;
+               hdr->prev = hdrp;
+               hdrp->next = hdr;
+       }
+
+       return user_mem;
+}
+
+void
+_free_safe_mem(void *mem_ptr, const char *file, int line)
+{
+       struct safe_mem_hdr *hdr;
+       struct safe_mem_tail *tail;
+       size_t alloc_sz;
+       char *mem = mem_ptr;
+       char *user_mem = mem_ptr;
+
+       hdr = (struct safe_mem_hdr *)(user_mem - sizeof(*hdr));
+       tail = (struct safe_mem_tail *)(user_mem + hdr->alloc_sz);
+       mem -= hdr->alloc_sz;
+
+#ifdef DEBUG
+       kprintf("freeing safe_mem (hdr): %#lx (%s:%d)\n",
+                   (unsigned long)(void *)hdr, hdr->file, hdr->line);
+#endif
+
+       if (hdr->alloc_sz == 0) {
+               tbridge_printf("SAFEMEM BUG: double-free at %s:%d !!!\n", file,
+                   line);
+               return;
+       }
+
+       /* Integrity checks */
+       if ((memcmp(hdr->sig, "SAFEMEM\0", 8) != 0) ||
+           (memcmp(tail->sig, "SAFEMEM\0", 8) != 0)) {
+               tbridge_printf("SAFEMEM BUG: safe_mem buffer under- or overflow "
+                   "at %s:%d !!!\n", file, line);
+               return;
+       }
+
+       if (safe_mem_hdr_first == NULL) {
+               tbridge_printf("SAFEMEM BUG: safe_mem list should not be empty "
+                   "at %s:%d !!!\n", file, line);
+               return;
+       }
+
+       if (hdr->prev != NULL)
+               hdr->prev->next = hdr->next;
+       if (hdr->next != NULL)
+               hdr->next->prev = hdr->prev;
+       if (safe_mem_hdr_first == hdr)
+               safe_mem_hdr_first = hdr->next;
+
+       alloc_sz = hdr->alloc_sz;
+
+       bzero(mem, alloc_sz << 2);
+       kfree(mem, M_SAFEMEM);
+}
+
+void
+check_and_purge_safe_mem(void)
+{
+       struct safe_mem_hdr *hdr;
+       char *mem;
+#ifdef DEBUG
+       int ok;
+#endif
+
+       if (safe_mem_hdr_first == NULL)
+               return;
+
+       hdr = safe_mem_hdr_first;
+       while ((hdr = safe_mem_hdr_first) != NULL) {
+#ifdef DEBUG
+               if ((hdr->alloc_sz > 0) &&
+                   (memcmp(hdr->sig, "SAFEMEM\0", 8) == 0) &&
+                   (memcmp(hdr->tail->sig, "SAFEMEM\0", 8) == 0))
+                       ok = 1;
+               else
+                       ok = 0;
+
+               kprintf("SAFEMEM: un-freed safe_mem: %#lx (%s:%d) [integrity=%s]\n",
+                   (unsigned long)(void *)hdr, hdr->file, hdr->line,
+                   ok? "ok" : "failed");
+#endif
+               mem = (void *)hdr;
+               mem += sizeof(*hdr);
+               _free_safe_mem(mem, "check_and_purge_safe_mem", 0);
+       }
+}
diff --git a/test/dfregress/testcases/Makefile b/test/dfregress/testcases/Makefile
new file mode 100644 (file)
index 0000000..7920e76
--- /dev/null
@@ -0,0 +1,10 @@
+SUBDIR+= sample
+SUBDIR+= mem
+SUBDIR+= priv
+SUBDIR+= io
+SUBDIR+= threads
+SUBDIR+= compiler
+SUBDIR+= misc
+SUBDIR+= crypto
+
+.include <bsd.subdir.mk>
diff --git a/test/dfregress/testcases/compiler/Makefile b/test/dfregress/testcases/compiler/Makefile
new file mode 100644 (file)
index 0000000..e6d8f9c
--- /dev/null
@@ -0,0 +1,3 @@
+SUBDIR+= div128
+
+.include <bsd.subdir.mk>
diff --git a/test/dfregress/testcases/compiler/div128/Makefile b/test/dfregress/testcases/compiler/div128/Makefile
new file mode 100644 (file)
index 0000000..9bbf493
--- /dev/null
@@ -0,0 +1,4 @@
+PROG=          div128
+NOMAN=
+
+.include <bsd.prog.mk>
diff --git a/test/dfregress/testcases/compiler/div128/div128.c b/test/dfregress/testcases/compiler/div128/div128.c
new file mode 100644 (file)
index 0000000..849eed4
--- /dev/null
@@ -0,0 +1,12 @@
+#include <inttypes.h>
+#include <stdio.h>
+
+int main(void)
+{
+  __uint128_t num = 1000;
+  __uint128_t denom = 10;
+  __uint128_t res = num / denom;
+  printf("Result = %ju\n", (uintmax_t)res); 
+  return 0;
+}
+
diff --git a/test/dfregress/testcases/crypto/Makefile b/test/dfregress/testcases/crypto/Makefile
new file mode 100644 (file)
index 0000000..f1e70fb
--- /dev/null
@@ -0,0 +1,3 @@
+SUBDIR+= aes aesctr aesxts serpent twofish
+
+.include <bsd.subdir.mk>
diff --git a/test/dfregress/testcases/crypto/aes/Makefile b/test/dfregress/testcases/crypto/aes/Makefile
new file mode 100644 (file)
index 0000000..2a7b4ad
--- /dev/null
@@ -0,0 +1,4 @@
+PROG=  aestest
+NOMAN=
+
+.include <bsd.prog.mk>
diff --git a/test/dfregress/testcases/crypto/aes/aestest.c b/test/dfregress/testcases/crypto/aes/aestest.c
new file mode 100644 (file)
index 0000000..77ea583
--- /dev/null
@@ -0,0 +1,366 @@
+/*      $OpenBSD: djm $  */
+
+/*
+ * Copyright (c) 2002 Markus Friedl.  All rights reserved.
+ * Copyright (c) 2008 Damien Miller.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+/*
+ * Test crypto(4) AES with test vectors provided by Dr Brian Gladman:
+ * http://fp.gladman.plus.com/AES/
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <crypto/cryptodev.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+
+static int
+syscrypt(const unsigned char *key, size_t klen, const unsigned char *in,
+    unsigned char *out, size_t len, int do_encrypt)
+{
+       struct session_op session;
+       struct crypt_op cryp;
+       int cryptodev_fd = -1, fd = -1;
+       u_char iv[32];
+
+       /*
+        * Kludge; the kernel doesn't support ECB encryption so we
+        * use a all-zero IV and encrypt a single block only, so the
+        * result should be the same.
+        */
+       bzero(iv, sizeof(iv));
+
+       if ((cryptodev_fd = open("/dev/crypto", O_RDWR, 0)) < 0) {
+               warn("/dev/crypto");
+               goto err;
+       }
+       if (ioctl(cryptodev_fd, CRIOGET, &fd) == -1) {
+               warn("CRIOGET failed");
+               goto err;
+       }
+       memset(&session, 0, sizeof(session));
+       session.cipher = CRYPTO_AES_CBC;
+       session.key = (caddr_t) key;
+       session.keylen = klen;
+       if (ioctl(fd, CIOCGSESSION, &session) == -1) {
+               warn("CIOCGSESSION");
+               goto err;
+       }
+       memset(&cryp, 0, sizeof(cryp));
+       cryp.ses = session.ses;
+       cryp.op = do_encrypt ? COP_ENCRYPT : COP_DECRYPT;
+       cryp.flags = 0;
+       cryp.len = len;
+       cryp.src = (caddr_t) in;
+       cryp.dst = (caddr_t) out;
+       cryp.iv = (caddr_t) iv;
+       cryp.mac = 0;
+       if (ioctl(fd, CIOCCRYPT, &cryp) == -1) {
+               warn("CIOCCRYPT");
+               goto err;
+       }
+       if (ioctl(fd, CIOCFSESSION, &session.ses) == -1) {
+               warn("CIOCFSESSION");
+               goto err;
+       }
+       close(fd);
+       close(cryptodev_fd);
+       return (0);
+
+err:
+       if (fd != -1)
+               close(fd);
+       if (cryptodev_fd != -1)
+               close(cryptodev_fd);
+       return (-1);
+}
+
+static int
+getallowsoft(void)
+{
+       int mib[2], old;
+       size_t olen;
+
+       olen = sizeof(old);
+
+       if (sysctlbyname("kern.cryptodevallowsoft", &old, &olen, NULL, 0) < 0)
+               err(1, "sysctl failed");
+
+       return old;
+}
+
+static void
+setallowsoft(int new)
+{
+       int mib[2], old;
+       size_t olen, nlen;
+
+       olen = nlen = sizeof(new);
+
+       if (sysctlbyname("kern.cryptodevallowsoft", &old, &olen, &new, nlen) < 0)
+               err(1, "sysctl failed");
+}
+
+static int
+match(unsigned char *a, unsigned char *b, size_t len)
+{
+       size_t i;
+
+       if (memcmp(a, b, len) == 0)
+               return (1);
+
+       warnx("decrypt/plaintext mismatch");
+
+       for (i = 0; i < len; i++)
+               printf("%2.2x", a[i]);
+       printf("\n");
+       for (i = 0; i < len; i++)
+               printf("%2.2x", b[i]);
+       printf("\n");
+
+       return (0);
+}
+
+/*
+ * Match expected substring at start of line. If sequence is match, return
+ * a pointer to the first character in the string past the sequence and and
+ * following whitespace.
+ * returns NULL is the start of the line does not match.
+ */
+static const char *
+startswith(const char *line, const char *startswith)
+{
+       size_t len = strlen(startswith);
+
+       if (strncmp(line, startswith, len) != 0)
+               return NULL;
+       line = line + len;
+       while (isspace(*line))
+               line++;
+       return line;
+}
+
+/* Read a hex string and convert to bytes */
+static void
+parsehex(const char *hex, u_char **s, u_int *lenp)
+{
+       u_char *ret, v;
+       u_int i, len;
+       char c;
+
+       len = i = 0;
+       ret = NULL;
+       v = 0;
+       while ((c = *(hex++)) != '\0') {
+               if (strchr(" \t\r\n", c) != NULL)
+                       continue;
+               if (c >= '0' && c <= '9')
+                       v |= c - '0';
+               else if (c >= 'a' && c <= 'f')
+                       v |= 10 + (c - 'a');
+               else if (c >= 'A' && c <= 'F')
+                       v |= 10 + c - 'A';
+               else
+                       errx(1, "%s: invalid character \"%c\" in hex string",
+                           __func__, c);
+               switch (++i) {
+               case 1:
+                       v <<= 4;
+                       break;
+               case 2:
+                       if ((ret = realloc(ret, ++len)) == NULL)
+                               errx(1, "realloc(%u)", len);
+                       ret[len - 1] = v;
+                       v = 0;
+                       i = 0;
+               }
+       }
+       if (i != 0)
+               errx(1, "%s: odd number of characters in hex string", __func__);
+       *lenp = len;
+       *s = ret;
+}
+
+static int
+do_tests(const char *filename, int test_num, u_char *key, u_int keylen,
+    u_char *plaintext, u_char *ciphertext, u_int textlen)
+{
+       char result[32];
+       int fail = 0;
+
+       /* Encrypt test */
+       if (syscrypt(key, keylen, plaintext, result, textlen, 1) < 0) {
+               warnx("encrypt with /dev/crypto failed");
+               fail++;
+       } else if (!match(result, ciphertext, textlen)) {
+               fail++;
+       } else
+               printf("OK encrypt test vector %s %u\n", filename, test_num);
+
+       /* Decrypt test */
+       if (syscrypt(key, keylen, ciphertext, result, textlen, 0) < 0) {
+               warnx("decrypt with /dev/crypto failed");
+               fail++;
+       } else if (!match(result, plaintext, textlen)) {
+               fail++;
+       } else
+               printf("OK decrypt test vector %s %u\n", filename, test_num);
+
+       return fail;
+}
+
+static int
+run_file(const char *filename)
+{
+       FILE *tv;
+       char buf[1024], *eol;
+       const char *cp, *errstr;
+       int lnum = 0, fail = 0;
+       u_char *key, *plaintext, *ciphertext;
+       u_int keylen, textlen, tmp;
+       int blocksize, keysize, test;
+
+       if ((tv = fopen(filename, "r")) == NULL)
+               err(1, "fopen(\"%s\")", filename);
+
+       keylen = textlen = tmp = 0;
+       key = ciphertext = plaintext = NULL;
+       blocksize = keysize = test = -1;
+       while ((fgets(buf, sizeof(buf), tv)) != NULL) {
+               lnum++;
+               eol = buf + strlen(buf) - 1;
+               if (*eol != '\n')
+                       errx(1, "line %d: too long", lnum);
+               if (eol > buf && *(eol - 1) == '\r')
+                       eol--;
+               *eol = '\0';
+               if ((cp = startswith(buf, "BLOCKSIZE=")) != NULL) {
+                       if (blocksize != -1)
+                               errx(1, "line %d: blocksize already set", lnum);
+                       blocksize = (int)strtonum(cp, 128, 128, &errstr);
+                       if (errstr)
+                               errx(1, "line %d: blocksize is %s: \"%s\"",
+                                   lnum, errstr, cp);
+               } else if ((cp = startswith(buf, "KEYSIZE=")) != NULL) {
+                       if (keysize != -1)
+                               errx(1, "line %d: keysize already set", lnum);
+                       keysize = (int)strtonum(cp, 128, 256, &errstr);
+                       if (errstr)
+                               errx(1, "line %d: keysize is %s: \"%s\"",
+                                   lnum, errstr, cp);
+                       if (keysize != 128 && keysize != 256)
+                               errx(1, "line %d: XXX only 128 or 256 "
+                                   "bit keys for now (keysize = %d)",
+                                   lnum, keysize);
+               } else if ((cp = startswith(buf, "PT=")) != NULL) {
+                       if (plaintext != NULL)
+                               free(plaintext);
+                       parsehex(cp, &plaintext, &tmp);
+                       if (tmp * 8 != (u_int)blocksize)
+                               errx(1, "line %d: plaintext len %u != "
+                                   "blocklen %d", lnum, tmp, blocksize);
+                       if (textlen != 0) {
+                               if (textlen != tmp)
+                                       errx(1, "line %d: plaintext len %u != "
+                                           "ciphertext len %d", lnum, tmp,
+                                           textlen);
+                       } else
+                               textlen = tmp;
+               } else if ((cp = startswith(buf, "CT=")) != NULL) {
+                       if (ciphertext != NULL)
+                               free(ciphertext);
+                       parsehex(cp, &ciphertext, &tmp);
+                       if (tmp * 8 != (u_int)blocksize)
+                               errx(1, "line %d: ciphertext len %u != "
+                                   "blocklen %d", lnum, tmp, blocksize);
+                       if (textlen != 0) {
+                               if (textlen != tmp)
+                                       errx(1, "line %d: ciphertext len %u != "
+                                           "plaintext len %d", lnum, tmp,
+                                           textlen);
+                       } else
+                               textlen = tmp;
+               } else if ((cp = startswith(buf, "KEY=")) != NULL) {
+                       if (key != NULL)
+                               free(key);
+                       parsehex(cp, &key, &keylen);
+                       if (keylen * 8 != (u_int)keysize)
+                               errx(1, "line %d: ciphertext len %u != "
+                                   "blocklen %d", lnum, tmp, textlen);
+               } else if ((cp = startswith(buf, "TEST=")) != NULL) {
+                       if (plaintext == NULL || ciphertext == NULL ||
+                           key == NULL || blocksize == -1 || keysize == -1) {
+                               if (test != -1)
+                                       errx(1, "line %d: new test before "
+                                           "parameters", lnum);
+                               goto parsetest;
+                       }
+                       /* do the tests */
+                       fail += do_tests(filename, test, key, keylen,
+                           plaintext, ciphertext, textlen);
+ parsetest:
+                       test = (int)strtonum(cp, 0, 65536, &errstr);
+                       if (errstr)
+                               errx(1, "line %d: test is %s: \"%s\"",
+                                   lnum, errstr, cp);
+               } else {
+                       /* don't care */
+                       continue;
+               }
+       }
+       fclose(tv);
+
+       return fail;
+}
+
+int
+main(int argc, char **argv)
+{
+       int allowed = 0, fail = 0, i;
+
+       if (argc < 2)
+               errx(1, "usage: aestest [test-vector-file]");
+
+       if (geteuid() == 0) {
+               allowed = getallowsoft();
+               if (allowed == 0)
+                       setallowsoft(1);
+       }
+
+       for (i = 1; i < argc; i++)
+               fail += run_file(argv[1]);
+
+       if (geteuid() == 0 && allowed == 0)
+               setallowsoft(0);
+
+       return fail > 0 ? 1 : 0;
+}
diff --git a/test/dfregress/testcases/crypto/aes/ecbnk44.txt b/test/dfregress/testcases/crypto/aes/ecbnk44.txt
new file mode 100644 (file)
index 0000000..7047566
--- /dev/null
@@ -0,0 +1,779 @@
+==============================================\r
+Author:    Dr B R Gladman (                 )\r
+Test:      ECB Variable Key Known Answer Tests\r
+Algorithm: Extended Rijndael (an AES Superset)\r
+Filename:  ecbnk44.txt\r
+==============================================\r
+\r
+BLOCKSIZE=128\r
+KEYSIZE=  128\r
+\r
+PT=   00000000000000000000000000000000\r
+TEST= 0\r
+KEY=  00000000000000000000000000000000\r
+CT=   66e94bd4ef8a2c3b884cfa59ca342b2e\r
+TEST= 1\r
+KEY=  00000000000000000000000000000001\r
+CT=   0545aad56da2a97c3663d1432a3d1c84\r
+TEST= 2\r
+KEY=  00000000000000000000000000000003\r
+CT=   0d00c6457a47c6bb8cfe076f6e2b1e15\r
+TEST= 3\r
+KEY=  00000000000000000000000000000007\r
+CT=   429c3c22dc979510833529cb64de09e3\r
+TEST= 4\r
+KEY=  0000000000000000000000000000000f\r
+CT=   0d68e0da8ec69a1854cc16be884ade2f\r
+TEST= 5\r
+KEY=  0000000000000000000000000000001f\r
+CT=   9a2daa4fac08769bbb1ca4f2353b1a3e\r
+TEST= 6\r
+KEY=  0000000000000000000000000000003f\r
+CT=   88325854766eba22ceaa99abd630f258\r
+TEST= 7\r
+KEY=  0000000000000000000000000000007f\r
+CT=   e0f2198deda952b01ea8ffea4171e66d\r
+TEST= 8\r
+KEY=  000000000000000000000000000000ff\r
+CT=   d5c98c48255f78cc47e149e55cfc3ffd\r
+TEST= 9\r
+KEY=  000000000000000000000000000001ff\r
+CT=   09ccb66c1f0ce1854dc191c1373acb8c\r
+TEST= 10\r
+KEY=  000000000000000000000000000003ff\r
+CT=   14dfa44b544d2ca39a9a1c9a3d75fed8\r
+TEST= 11\r
+KEY=  000000000000000000000000000007ff\r
+CT=   e7df1b3adc7ebbdce19f15c82f173126\r
+TEST= 12\r
+KEY=  00000000000000000000000000000fff\r
+CT=   8dc8a75eaf822ddf416988713e9b6e4d\r
+TEST= 13\r
+KEY=  00000000000000000000000000001fff\r
+CT=   bc435a1dcdf8830d82cd5abe7bf71e46\r
+TEST= 14\r
+KEY=  00000000000000000000000000003fff\r
+CT=   81835a69fe117b54fdb7916bcc091e71\r
+TEST= 15\r
+KEY=  00000000000000000000000000007fff\r
+CT=   e0af87cd4468c740ab180289f3738b6f\r
+TEST= 16\r
+KEY=  0000000000000000000000000000ffff\r
+CT=   fc84885326b157843a4d200d86021b33\r
+TEST= 17\r
+KEY=  0000000000000000000000000001ffff\r
+CT=   be337b0bcabab18d3392a4d29f8d419d\r
+TEST= 18\r
+KEY=  0000000000000000000000000003ffff\r
+CT=   33a78574fedc6dcca40ee0f51ef11037\r
+TEST= 19\r
+KEY=  0000000000000000000000000007ffff\r
+CT=   db1821758c24162b81dc8ca0add209ab\r
+TEST= 20\r
+KEY=  000000000000000000000000000fffff\r
+CT=   d3d6d60115e9043b119649ad2e7f7f84\r
+TEST= 21\r
+KEY=  000000000000000000000000001fffff\r
+CT=   750d9e49b62cb695ae2f6680ed434451\r
+TEST= 22\r
+KEY=  000000000000000000000000003fffff\r
+CT=   818e95e5c0e00179e04c08dbc357ddd8\r
+TEST= 23\r
+KEY=  000000000000000000000000007fffff\r
+CT=   3803f7220b65bbc880ba1488241cb1ba\r
+TEST= 24\r
+KEY=  00000000000000000000000000ffffff\r
+CT=   2fcebd84763a9de4709973f5e0621ed6\r
+TEST= 25\r
+KEY=  00000000000000000000000001ffffff\r
+CT=   effa0eb04d6f22f209bb143bc736fac2\r
+TEST= 26\r
+KEY=  00000000000000000000000003ffffff\r
+CT=   85bdbf034b7ee6ae3b4fae3792aa9d39\r
+TEST= 27\r
+KEY=  00000000000000000000000007ffffff\r
+CT=   7b775b78421acd32973a4f437df7ed52\r
+TEST= 28\r
+KEY=  0000000000000000000000000fffffff\r
+CT=   49377373c74f6ef924210fc45883fdc6\r
+TEST= 29\r
+KEY=  0000000000000000000000001fffffff\r
+CT=   7d0a9cad70099b5133f09161e91d6c32\r
+TEST= 30\r
+KEY=  0000000000000000000000003fffffff\r
+CT=   1a9106be9d21a2bdeaf6d78bc8b2cba5\r
+TEST= 31\r
+KEY=  0000000000000000000000007fffffff\r
+CT=   21b574eb8ea8c3de03a75ad887b513eb\r
+TEST= 32\r
+KEY=  000000000000000000000000ffffffff\r
+CT=   51c039a643c8c227e8a1ed4a68eb9764\r
+TEST= 33\r
+KEY=  000000000000000000000001ffffffff\r
+CT=   182e9a760136eed736c8aa8ec57fa714\r
+TEST= 34\r
+KEY=  000000000000000000000003ffffffff\r
+CT=   1ed5c7412ccfa01e857787d5ac380884\r
+TEST= 35\r
+KEY=  000000000000000000000007ffffffff\r
+CT=   22ba5de0abcef81dd10f91478713d525\r
+TEST= 36\r
+KEY=  00000000000000000000000fffffffff\r
+CT=   85bc221981c0018f764f0008d07205fe\r
+TEST= 37\r
+KEY=  00000000000000000000001fffffffff\r
+CT=   f137a8dbbf79f953d6e264937567c63d\r
+TEST= 38\r
+KEY=  00000000000000000000003fffffffff\r
+CT=   4aa85f7a1bebafea39994f8301b71604\r
+TEST= 39\r
+KEY=  00000000000000000000007fffffffff\r
+CT=   4a42c5efe9d37cc1863c47329e01a848\r
+TEST= 40\r
+KEY=  0000000000000000000000ffffffffff\r
+CT=   93b1dd3660968ecb7028c3907f75a286\r
+TEST= 41\r
+KEY=  0000000000000000000001ffffffffff\r
+CT=   380d90a2b2bd02a88077709b541f3abc\r
+TEST= 42\r
+KEY=  0000000000000000000003ffffffffff\r
+CT=   244082dad08c1fcfc2c103e4c7076dc2\r
+TEST= 43\r
+KEY=  0000000000000000000007ffffffffff\r
+CT=   a409417dac7f965837ca5502e4eab343\r
+TEST= 44\r
+KEY=  000000000000000000000fffffffffff\r
+CT=   0e3a5b0efffbc3ef35965d1f96372901\r
+TEST= 45\r
+KEY=  000000000000000000001fffffffffff\r
+CT=   fe6fb6d8c48c115c20a8158885c2b72b\r
+TEST= 46\r
+KEY=  000000000000000000003fffffffffff\r
+CT=   2d9d8b3ebf6817c337abc8c2ab535e25\r
+TEST= 47\r
+KEY=  000000000000000000007fffffffffff\r
+CT=   f1ede289f8af21cde3da4c91c10d810e\r
+TEST= 48\r
+KEY=  00000000000000000000ffffffffffff\r
+CT=   433680649d361d1fd7222bfdad181b85\r
+TEST= 49\r
+KEY=  00000000000000000001ffffffffffff\r
+CT=   aad4b99b596fb1eb563a503b1cffc818\r
+TEST= 50\r
+KEY=  00000000000000000003ffffffffffff\r
+CT=   c5aefd373d76a68ec6e8cff783822665\r
+TEST= 51\r
+KEY=  00000000000000000007ffffffffffff\r
+CT=   c0488fe94a2c4a29ad3dfa851e829d2e\r
+TEST= 52\r
+KEY=  0000000000000000000fffffffffffff\r
+CT=   0e8a24d5ef8e75a7c880fa6a834cf2c9\r
+TEST= 53\r
+KEY=  0000000000000000001fffffffffffff\r
+CT=   2791b95644f63234749903c3e8657735\r
+TEST= 54\r
+KEY=  0000000000000000003fffffffffffff\r
+CT=   ef7221d5a82ee71fe8d8bfdd2a3c7c4f\r
+TEST= 55\r
+KEY=  0000000000000000007fffffffffffff\r
+CT=   0d2e8d964b6514c4bd3ac5d34db87522\r
+TEST= 56\r
+KEY=  000000000000000000ffffffffffffff\r
+CT=   d47c25a5ece3b4add6ca0d8a09e410ad\r
+TEST= 57\r
+KEY=  000000000000000001ffffffffffffff\r
+CT=   c282027f20ed3d235475b85304bfcb80\r
+TEST= 58\r
+KEY=  000000000000000003ffffffffffffff\r
+CT=   b664b7bc37d4b8d04b3b70ded0c800fd\r
+TEST= 59\r
+KEY=  000000000000000007ffffffffffffff\r
+CT=   6e4fe62c2551f5cbd49f08a6de8f339e\r
+TEST= 60\r
+KEY=  00000000000000000fffffffffffffff\r
+CT=   002e821880c0628eb48ac598f258413c\r
+TEST= 61\r
+KEY=  00000000000000001fffffffffffffff\r
+CT=   e00fe46582572be60b8e9c464675df11\r
+TEST= 62\r
+KEY=  00000000000000003fffffffffffffff\r
+CT=   ed6af7fdbf5c4298d898556982998411\r
+TEST= 63\r
+KEY=  00000000000000007fffffffffffffff\r
+CT=   274b684f6dabfad23f01c7b984611dd2\r
+TEST= 64\r
+KEY=  0000000000000000ffffffffffffffff\r
+CT=   abac70797275a2dcf35b582fcd10dc18\r
+TEST= 65\r
+KEY=  0000000000000001ffffffffffffffff\r
+CT=   706e2bfc072301e86538a2d0d525a52f\r
+TEST= 66\r
+KEY=  0000000000000003ffffffffffffffff\r
+CT=   f76a0e2d34f589c53f5041b9cb170bcb\r
+TEST= 67\r
+KEY=  0000000000000007ffffffffffffffff\r
+CT=   15565da70a000eb5e74b4020405771ac\r
+TEST= 68\r
+KEY=  000000000000000fffffffffffffffff\r
+CT=   7aee27c41842b40b3e4ad6816d7eec87\r
+TEST= 69\r
+KEY=  000000000000001fffffffffffffffff\r
+CT=   a1340a8aa71385395877f04ec2c2ba71\r
+TEST= 70\r
+KEY=  000000000000003fffffffffffffffff\r
+CT=   2e078a39d5468409298e29b3c818f780\r
+TEST= 71\r
+KEY=  000000000000007fffffffffffffffff\r
+CT=   9fb0a3e2755523deac574629f1a5e57f\r
+TEST= 72\r
+KEY=  00000000000000ffffffffffffffffff\r
+CT=   0cae2d1e7c2eb298d284ac574de4c76c\r
+TEST= 73\r
+KEY=  00000000000001ffffffffffffffffff\r
+CT=   60e24a939a75ac7f93d506f1c66f6e72\r
+TEST= 74\r
+KEY=  00000000000003ffffffffffffffffff\r
+CT=   f7fd3c15500723d2fc8094fc7ab51c7b\r
+TEST= 75\r
+KEY=  00000000000007ffffffffffffffffff\r
+CT=   793219b3e13a29e06697ede1506fc83f\r
+TEST= 76\r
+KEY=  0000000000000fffffffffffffffffff\r
+CT=   6339e5eac05d5e33a32251f938b52951\r
+TEST= 77\r
+KEY=  0000000000001fffffffffffffffffff\r
+CT=   6d175edd5529c35f0a1f418766769e66\r
+TEST= 78\r
+KEY=  0000000000003fffffffffffffffffff\r
+CT=   d0fab53306f97905f35b19384b326053\r
+TEST= 79\r
+KEY=  0000000000007fffffffffffffffffff\r
+CT=   c6b449923a561f851029e402c1fc49df\r
+TEST= 80\r
+KEY=  000000000000ffffffffffffffffffff\r
+CT=   4e73dcce8d61edc8f3c465ceacf333e3\r
+TEST= 81\r
+KEY=  000000000001ffffffffffffffffffff\r
+CT=   d1a141490a078d9259ba518ba3bbbfa9\r
+TEST= 82\r
+KEY=  000000000003ffffffffffffffffffff\r
+CT=   4a6dac3718f39c88449fc0fdbba49cbc\r
+TEST= 83\r
+KEY=  000000000007ffffffffffffffffffff\r
+CT=   47df1ff232572297c46683a199cd6605\r
+TEST= 84\r
+KEY=  00000000000fffffffffffffffffffff\r
+CT=   0a25afc437fee47a0cdb3cf8520b701e\r
+TEST= 85\r
+KEY=  00000000001fffffffffffffffffffff\r
+CT=   b7c82cf69cc9bc03d36538b74728a742\r
+TEST= 86\r
+KEY=  00000000003fffffffffffffffffffff\r
+CT=   aa3d05f2c51fd6abbdcad6fb85175093\r
+TEST= 87\r
+KEY=  00000000007fffffffffffffffffffff\r
+CT=   9c40db129e0cd180af762a3ca08cf6cb\r
+TEST= 88\r
+KEY=  0000000000ffffffffffffffffffffff\r
+CT=   55fe4362db10d26a4c3a1b5d37a139ca\r
+TEST= 89\r
+KEY=  0000000001ffffffffffffffffffffff\r
+CT=   9cde8814ee1b6639115a62067d023804\r
+TEST= 90\r
+KEY=  0000000003ffffffffffffffffffffff\r
+CT=   c8d421b6b0bf145eefbdc64034f37c37\r
+TEST= 91\r
+KEY=  0000000007ffffffffffffffffffffff\r
+CT=   bed798d5e64b21c985bab744d1406b57\r
+TEST= 92\r
+KEY=  000000000fffffffffffffffffffffff\r
+CT=   862b819572c86a65026a3b513ba8de2e\r
+TEST= 93\r
+KEY=  000000001fffffffffffffffffffffff\r
+CT=   744e164e4a960c94f588d694eb2021d6\r
+TEST= 94\r
+KEY=  000000003fffffffffffffffffffffff\r
+CT=   6f8f8fe5670d0c9929086664b2313b24\r
+TEST= 95\r
+KEY=  000000007fffffffffffffffffffffff\r
+CT=   bf9cfc9b0b15dfe1ed0f8e980f80b0d1\r
+TEST= 96\r
+KEY=  00000000ffffffffffffffffffffffff\r
+CT=   123dca99ffbe6e12ec372190e66f6712\r
+TEST= 97\r
+KEY=  00000001ffffffffffffffffffffffff\r
+CT=   13a1836cef7c653c58dcebbd13a976a7\r
+TEST= 98\r
+KEY=  00000003ffffffffffffffffffffffff\r
+CT=   02e2958e680f7d5ef8f82c2408deb15b\r
+TEST= 99\r
+KEY=  00000007ffffffffffffffffffffffff\r
+CT=   ef04bd62c0081225e99271850a6308a0\r
+TEST= 100\r
+KEY=  0000000fffffffffffffffffffffffff\r
+CT=   f28a7944ab6ac69782ba27f39b4a4381\r
+TEST= 101\r
+KEY=  0000001fffffffffffffffffffffffff\r
+CT=   670d8c6ae12c74e19f9883b2b776a4aa\r
+TEST= 102\r
+KEY=  0000003fffffffffffffffffffffffff\r
+CT=   459f3fc2e1e503af2fa39b06592c8c22\r
+TEST= 103\r
+KEY=  0000007fffffffffffffffffffffffff\r
+CT=   f993a6cc25dbd950419352cc0009b583\r
+TEST= 104\r
+KEY=  000000ffffffffffffffffffffffffff\r
+CT=   9caddd77d32c233af1d3147365662a99\r
+TEST= 105\r
+KEY=  000001ffffffffffffffffffffffffff\r
+CT=   211a1a7e4e47e0d86b9fd96b531cc08f\r
+TEST= 106\r
+KEY=  000003ffffffffffffffffffffffffff\r
+CT=   82e28dbfda3ec2f04d1aa61dca2c83c9\r
+TEST= 107\r
+KEY=  000007ffffffffffffffffffffffffff\r
+CT=   ecb28ad52f46457198f2ad210d47d8cf\r
+TEST= 108\r
+KEY=  00000fffffffffffffffffffffffffff\r
+CT=   65a479ff2c04a745433dab12747f6fba\r
+TEST= 109\r
+KEY=  00001fffffffffffffffffffffffffff\r
+CT=   74e682913c9a0722d8a46a8f2deff793\r
+TEST= 110\r
+KEY=  00003fffffffffffffffffffffffffff\r
+CT=   6bd7490b35e70ae742cfd3611549b272\r
+TEST= 111\r
+KEY=  00007fffffffffffffffffffffffffff\r
+CT=   de0e697b067e14cc3b4096e2e169bb10\r
+TEST= 112\r
+KEY=  0000ffffffffffffffffffffffffffff\r
+CT=   46b9672025cd89d39cd2d185ce454b28\r
+TEST= 113\r
+KEY=  0001ffffffffffffffffffffffffffff\r
+CT=   69a8d73c318abca454188b4302a2c0f2\r
+TEST= 114\r
+KEY=  0003ffffffffffffffffffffffffffff\r
+CT=   2c31d234634cb3b71e11e6c2dc2af783\r
+TEST= 115\r
+KEY=  0007ffffffffffffffffffffffffffff\r
+CT=   748893329ec47a06fc22e8608ffc6a6a\r
+TEST= 116\r
+KEY=  000fffffffffffffffffffffffffffff\r
+CT=   72a5216e693f4e75f55858dc87e6894b\r
+TEST= 117\r
+KEY=  001fffffffffffffffffffffffffffff\r
+CT=   fd01a6bff2c00495b6e6a2658ad80276\r
+TEST= 118\r
+KEY=  003fffffffffffffffffffffffffffff\r
+CT=   f8332e3bee556b953cb2326a69f1959b\r
+TEST= 119\r
+KEY=  007fffffffffffffffffffffffffffff\r
+CT=   4335264b64726e36fb4aebce0e80f36d\r
+TEST= 120\r
+KEY=  00ffffffffffffffffffffffffffffff\r
+CT=   e01f3360843bb429c79ef44f71649784\r
+TEST= 121\r
+KEY=  01ffffffffffffffffffffffffffffff\r
+CT=   af39755faf0b5e23cca27bb948d4d2aa\r
+TEST= 122\r
+KEY=  03ffffffffffffffffffffffffffffff\r
+CT=   b983e0592bf2727bd855187ba2cd737a\r
+TEST= 123\r
+KEY=  07ffffffffffffffffffffffffffffff\r
+CT=   12a7a792f5c23de85eb6240c011f7317\r
+TEST= 124\r
+KEY=  0fffffffffffffffffffffffffffffff\r
+CT=   144cfff87e64622607b4f69e1e203f3e\r
+TEST= 125\r
+KEY=  1fffffffffffffffffffffffffffffff\r
+CT=   0b3d901bcf69f99400fafa534f78ecef\r
+TEST= 126\r
+KEY=  3fffffffffffffffffffffffffffffff\r
+CT=   2490fcfe98dbc1a40df667e32c3ee670\r
+TEST= 127\r
+KEY=  7fffffffffffffffffffffffffffffff\r
+CT=   c0b9045be82d79ef711fb79e957de3b9\r
+TEST= 128\r
+KEY=  ffffffffffffffffffffffffffffffff\r
+CT=   a1f6258c877d5fcd8964484538bfc92c\r
+TEST= 129\r
+KEY=  fffffffffffffffffffffffffffffffe\r
+CT=   9ba4a9143f4e5d4048521c4f8877d88e\r
+TEST= 130\r
+KEY=  fffffffffffffffffffffffffffffffc\r
+CT=   02bc96846b3fdc71643f384cd3cc3eaf\r
+TEST= 131\r
+KEY=  fffffffffffffffffffffffffffffff8\r
+CT=   5a4d404d8917e353e92a21072c3b2305\r
+TEST= 132\r
+KEY=  fffffffffffffffffffffffffffffff0\r
+CT=   41c78c135ed9e98c096640647265da1e\r
+TEST= 133\r
+KEY=  ffffffffffffffffffffffffffffffe0\r
+CT=   25d6cfe6881f2bf497dd14cd4ddf445b\r
+TEST= 134\r
+KEY=  ffffffffffffffffffffffffffffffc0\r
+CT=   41a8a947766635dec37553d9a6c0cbb7\r
+TEST= 135\r
+KEY=  ffffffffffffffffffffffffffffff80\r
+CT=   5160474d504b9b3eefb68d35f245f4b3\r
+TEST= 136\r
+KEY=  ffffffffffffffffffffffffffffff00\r
+CT=   2dce3acb727cd13ccd76d425ea56e4f6\r
+TEST= 137\r
+KEY=  fffffffffffffffffffffffffffffe00\r
+CT=   ba4f970c0a25c41814bdae2e506be3b4\r
+TEST= 138\r
+KEY=  fffffffffffffffffffffffffffffc00\r
+CT=   3a0c53fa37311fc10bd2a9981f513174\r
+TEST= 139\r
+KEY=  fffffffffffffffffffffffffffff800\r
+CT=   dfa5c097cdc1532ac071d57b1d28d1bd\r
+TEST= 140\r
+KEY=  fffffffffffffffffffffffffffff000\r
+CT=   1dbf57877b7b17385c85d0b54851e371\r
+TEST= 141\r
+KEY=  ffffffffffffffffffffffffffffe000\r
+CT=   323994cfb9da285a5d9642e1759b224a\r
+TEST= 142\r
+KEY=  ffffffffffffffffffffffffffffc000\r
+CT=   70c46bb30692be657f7eaa93ebad9897\r
+TEST= 143\r
+KEY=  ffffffffffffffffffffffffffff8000\r
+CT=   62d0662d6eaeddedebae7f7ea3a4f6b6\r
+TEST= 144\r
+KEY=  ffffffffffffffffffffffffffff0000\r
+CT=   b4750ff263a65e1f9e924ccfd98f3e37\r
+TEST= 145\r
+KEY=  fffffffffffffffffffffffffffe0000\r
+CT=   674d2b61633d162be59dde04222f4740\r
+TEST= 146\r
+KEY=  fffffffffffffffffffffffffffc0000\r
+CT=   44fb5c4d4f5cb79be5c174a3b1c97348\r
+TEST= 147\r
+KEY=  fffffffffffffffffffffffffff80000\r
+CT=   16591c0f27d60e29b85a96c33861a7ef\r
+TEST= 148\r
+KEY=  fffffffffffffffffffffffffff00000\r
+CT=   793de39236570aba83ab9b737cb521c9\r
+TEST= 149\r
+KEY=  ffffffffffffffffffffffffffe00000\r
+CT=   c14574d9cd00cf2b5a7f77e53cd57885\r
+TEST= 150\r
+KEY=  ffffffffffffffffffffffffffc00000\r
+CT=   9241daca4fdd034a82372db50e1a0f3f\r
+TEST= 151\r
+KEY=  ffffffffffffffffffffffffff800000\r
+CT=   36aeaa3a213e968d4b5b679d3a2c97fe\r
+TEST= 152\r
+KEY=  ffffffffffffffffffffffffff000000\r
+CT=   2cb1dc3a9c72972e425ae2ef3eb597cd\r
+TEST= 153\r
+KEY=  fffffffffffffffffffffffffe000000\r
+CT=   277167f3812afff1ffacb4a934379fc3\r
+TEST= 154\r
+KEY=  fffffffffffffffffffffffffc000000\r
+CT=   f17af0e895dda5eb98efc68066e84c54\r
+TEST= 155\r
+KEY=  fffffffffffffffffffffffff8000000\r
+CT=   829c04ff4c07513c0b3ef05c03e337b5\r
+TEST= 156\r
+KEY=  fffffffffffffffffffffffff0000000\r
+CT=   307c5b8fcd0533ab98bc51e27a6ce461\r
+TEST= 157\r
+KEY=  ffffffffffffffffffffffffe0000000\r
+CT=   36bbaab22a6bd4925a99a2b408d2dbae\r
+TEST= 158\r
+KEY=  ffffffffffffffffffffffffc0000000\r
+CT=   b63305c72bedfab97382c406d0c49bc6\r
+TEST= 159\r
+KEY=  ffffffffffffffffffffffff80000000\r
+CT=   3e40c3901cd7effc22bffc35dee0b4d9\r
+TEST= 160\r
+KEY=  ffffffffffffffffffffffff00000000\r
+CT=   f0c5c6ffa5e0bd3a94c88f6b6f7c16b9\r
+TEST= 161\r
+KEY=  fffffffffffffffffffffffe00000000\r
+CT=   c440de014d3d610707279b13242a5c36\r
+TEST= 162\r
+KEY=  fffffffffffffffffffffffc00000000\r
+CT=   d06e3195b5376f109d5c4ec6c5d62ced\r
+TEST= 163\r
+KEY=  fffffffffffffffffffffff800000000\r
+CT=   36cf44c92d550bfb1ed28ef583ddf5d7\r
+TEST= 164\r
+KEY=  fffffffffffffffffffffff000000000\r
+CT=   6838af1f4f69bae9d85dd188dcdf0688\r
+TEST= 165\r
+KEY=  ffffffffffffffffffffffe000000000\r
+CT=   ff13806cf19cc38721554d7c0fcdcd4b\r
+TEST= 166\r
+KEY=  ffffffffffffffffffffffc000000000\r
+CT=   f0ea23af08534011c60009ab29ada2f1\r
+TEST= 167\r
+KEY=  ffffffffffffffffffffff8000000000\r
+CT=   6da0490ba0ba0343b935681d2cce5ba1\r
+TEST= 168\r
+KEY=  ffffffffffffffffffffff0000000000\r
+CT=   ea3695e1351b9d6858bd958cf513ef6c\r
+TEST= 169\r
+KEY=  fffffffffffffffffffffe0000000000\r
+CT=   6a7980ce7b105cf530952d74daaf798c\r
+TEST= 170\r
+KEY=  fffffffffffffffffffffc0000000000\r
+CT=   192afffb2c880e82b05926d0fc6c448b\r
+TEST= 171\r
+KEY=  fffffffffffffffffffff80000000000\r
+CT=   38f67b9e98e4a97b6df030a9fcdd0104\r
+TEST= 172\r
+KEY=  fffffffffffffffffffff00000000000\r
+CT=   8785b1a75b0f3bd958dcd0e29318c521\r
+TEST= 173\r
+KEY=  ffffffffffffffffffffe00000000000\r
+CT=   9cfa1322ea33da2173a024f2ff0d896d\r
+TEST= 174\r
+KEY=  ffffffffffffffffffffc00000000000\r
+CT=   dbdfb527060e0a71009c7bb0c68f1d44\r
+TEST= 175\r
+KEY=  ffffffffffffffffffff800000000000\r
+CT=   545d50ebd919e4a6949d96ad47e46a80\r
+TEST= 176\r
+KEY=  ffffffffffffffffffff000000000000\r
+CT=   ec198a18e10e532403b7e20887c8dd80\r
+TEST= 177\r
+KEY=  fffffffffffffffffffe000000000000\r
+CT=   f2e976875755f9401d54f36e2a23a594\r
+TEST= 178\r
+KEY=  fffffffffffffffffffc000000000000\r
+CT=   284ca2fa35807b8b0ae4d19e11d7dbd7\r
+TEST= 179\r
+KEY=  fffffffffffffffffff8000000000000\r
+CT=   ef1623cc44313cff440b1594a7e21cc6\r
+TEST= 180\r
+KEY=  fffffffffffffffffff0000000000000\r
+CT=   96d9b017d302df410a937dcdb8bb6e43\r
+TEST= 181\r
+KEY=  ffffffffffffffffffe0000000000000\r
+CT=   1b0d02893683b9f180458e4aa6b73982\r
+TEST= 182\r
+KEY=  ffffffffffffffffffc0000000000000\r
+CT=   d8764468bb103828cf7e1473ce895073\r
+TEST= 183\r
+KEY=  ffffffffffffffffff80000000000000\r
+CT=   acc5599dd8ac02239a0fef4a36dd1668\r
+TEST= 184\r
+KEY=  ffffffffffffffffff00000000000000\r
+CT=   1ea448c2aac954f5d812e9d78494446a\r
+TEST= 185\r
+KEY=  fffffffffffffffffe00000000000000\r
+CT=   7866373f24a0b6ed56e0d96fcdafb877\r
+TEST= 186\r
+KEY=  fffffffffffffffffc00000000000000\r
+CT=   ab69cfadf51f8e604d9cc37182f6635a\r
+TEST= 187\r
+KEY=  fffffffffffffffff800000000000000\r
+CT=   f60e91fc3269eecf3231c6e9945697c6\r
+TEST= 188\r
+KEY=  fffffffffffffffff000000000000000\r
+CT=   3535d565ace3f31eb249ba2cc6765d7a\r
+TEST= 189\r
+KEY=  ffffffffffffffffe000000000000000\r
+CT=   d9bff7ff454b0ec5a4a2a69566e2cb84\r
+TEST= 190\r
+KEY=  ffffffffffffffffc000000000000000\r
+CT=   493d4a4f38ebb337d10aa84e9171a554\r
+TEST= 191\r
+KEY=  ffffffffffffffff8000000000000000\r
+CT=   32cd652842926aea4aa6137bb2be2b5e\r
+TEST= 192\r
+KEY=  ffffffffffffffff0000000000000000\r
+CT=   84be19e053635f09f2665e7bae85b42d\r
+TEST= 193\r
+KEY=  fffffffffffffffe0000000000000000\r
+CT=   77a4d96d56dda398b9aabecfc75729fd\r
+TEST= 194\r
+KEY=  fffffffffffffffc0000000000000000\r
+CT=   995c9dc0b689f03c45867b5faa5c18d1\r
+TEST= 195\r
+KEY=  fffffffffffffff80000000000000000\r
+CT=   653317b9362b6f9b9e1a580e68d494b5\r
+TEST= 196\r
+KEY=  fffffffffffffff00000000000000000\r
+CT=   7a181e84bd5457d26a88fbae96018fb0\r
+TEST= 197\r
+KEY=  ffffffffffffffe00000000000000000\r
+CT=   fd8687f0757a210e9fdf181204c30863\r
+TEST= 198\r
+KEY=  ffffffffffffffc00000000000000000\r
+CT=   a35a63f5343ebe9ef8167bcb48ad122e\r
+TEST= 199\r
+KEY=  ffffffffffffff800000000000000000\r
+CT=   7470469be9723030fdcc73a8cd4fbb10\r
+TEST= 200\r
+KEY=  ffffffffffffff000000000000000000\r
+CT=   b5ab3013dd1e61df06cbaf34ca2aee78\r
+TEST= 201\r
+KEY=  fffffffffffffe000000000000000000\r
+CT=   53786104b9744b98f052c46f1c850d0b\r
+TEST= 202\r
+KEY=  fffffffffffffc000000000000000000\r
+CT=   43fdaf53ebbc9880c228617d6a9b548b\r
+TEST= 203\r
+KEY=  fffffffffffff8000000000000000000\r
+CT=   8b527a6aebdaec9eaef8eda2cb7783e5\r
+TEST= 204\r
+KEY=  fffffffffffff0000000000000000000\r
+CT=   7b90785125505fad59b13c186dd66ce3\r
+TEST= 205\r
+KEY=  ffffffffffffe0000000000000000000\r
+CT=   ff4e66c07bae3e79fb7d210847a3b0ba\r
+TEST= 206\r
+KEY=  ffffffffffffc0000000000000000000\r
+CT=   cb2f430383f9084e03a653571e065de6\r
+TEST= 207\r
+KEY=  ffffffffffff80000000000000000000\r
+CT=   b6768473ce9843ea66a81405dd50b345\r
+TEST= 208\r
+KEY=  ffffffffffff00000000000000000000\r
+CT=   75550e6cb5a88e49634c9ab69eda0430\r
+TEST= 209\r
+KEY=  fffffffffffe00000000000000000000\r
+CT=   04497110efb9dceb13e2b13fb4465564\r
+TEST= 210\r
+KEY=  fffffffffffc00000000000000000000\r
+CT=   4fb288cc2040049001d2c7585ad123fc\r
+TEST= 211\r
+KEY=  fffffffffff800000000000000000000\r
+CT=   8ebf73aad49c82007f77a5c1ccec6ab4\r
+TEST= 212\r
+KEY=  fffffffffff000000000000000000000\r
+CT=   e6c4807ae11f36f091c57d9fb68548d1\r
+TEST= 213\r
+KEY=  ffffffffffe000000000000000000000\r
+CT=   8e4d8e699119e1fc87545a647fb1d34f\r
+TEST= 214\r
+KEY=  ffffffffffc000000000000000000000\r
+CT=   1df9b76112dc6531e07d2cfda04411f0\r
+TEST= 215\r
+KEY=  ffffffffff8000000000000000000000\r
+CT=   c72954a48d0774db0b4971c526260415\r
+TEST= 216\r
+KEY=  ffffffffff0000000000000000000000\r
+CT=   7df4daf4ad29a3615a9b6ece5c99518a\r
+TEST= 217\r
+KEY=  fffffffffe0000000000000000000000\r
+CT=   303ff996947f0c7d1f43c8f3027b9b75\r
+TEST= 218\r
+KEY=  fffffffffc0000000000000000000000\r
+CT=   82408571c3e2424540207f833b6dda69\r
+TEST= 219\r
+KEY=  fffffffff80000000000000000000000\r
+CT=   0f18aff94274696d9b61848bd50ac5e5\r
+TEST= 220\r
+KEY=  fffffffff00000000000000000000000\r
+CT=   44a98bf11e163f632c47ec6a49683a89\r
+TEST= 221\r
+KEY=  ffffffffe00000000000000000000000\r
+CT=   23f710842b9bb9c32f26648c786807ca\r
+TEST= 222\r
+KEY=  ffffffffc00000000000000000000000\r
+CT=   5a8688f0b2a2c16224c161658ffd4044\r
+TEST= 223\r
+KEY=  ffffffff800000000000000000000000\r
+CT=   ed62e16363638360fdd6ad62112794f0\r
+TEST= 224\r
+KEY=  ffffffff000000000000000000000000\r
+CT=   9c28524a16a1e1c1452971caa8d13476\r
+TEST= 225\r
+KEY=  fffffffe000000000000000000000000\r
+CT=   1114bc2028009b923f0b01915ce5e7c4\r
+TEST= 226\r
+KEY=  fffffffc000000000000000000000000\r
+CT=   e17bc79f30eaab2fac2cbbe3458d687a\r
+TEST= 227\r
+KEY=  fffffff8000000000000000000000000\r
+CT=   6c7c64dc84a8bba758ed17eb025a57e3\r
+TEST= 228\r
+KEY=  fffffff0000000000000000000000000\r
+CT=   99693e6a59d1366c74d823562d7e1431\r
+TEST= 229\r
+KEY=  ffffffe0000000000000000000000000\r
+CT=   18c1b6e2157122056d0243d8a165cddb\r
+TEST= 230\r
+KEY=  ffffffc0000000000000000000000000\r
+CT=   5ce37e17eb4646ecfac29b9cc38d9340\r
+TEST= 231\r
+KEY=  ffffff80000000000000000000000000\r
+CT=   6d114ccb27bf391012e8974c546d9bf2\r
+TEST= 232\r
+KEY=  ffffff00000000000000000000000000\r
+CT=   de11722d893e9f9121c381becc1da59a\r
+TEST= 233\r
+KEY=  fffffe00000000000000000000000000\r
+CT=   95b1703fc57ba09fe0c3580febdd7ed4\r
+TEST= 234\r
+KEY=  fffffc00000000000000000000000000\r
+CT=   12acd89b13cd5f8726e34d44fd486108\r
+TEST= 235\r
+KEY=  fffff800000000000000000000000000\r
+CT=   a6cb761d61f8292d0df393a279ad0380\r
+TEST= 236\r
+KEY=  fffff000000000000000000000000000\r
+CT=   26298e9c1db517c215fadfb7d2a8d691\r
+TEST= 237\r
+KEY=  ffffe000000000000000000000000000\r
+CT=   90fb128d3a1af6e548521bb962bf1f05\r
+TEST= 238\r
+KEY=  ffffc000000000000000000000000000\r
+CT=   df556a33438db87bc41b1752c55e5e49\r
+TEST= 239\r
+KEY=  ffff8000000000000000000000000000\r
+CT=   c6a0b3e998d05068a5399778405200b4\r
+TEST= 240\r
+KEY=  ffff0000000000000000000000000000\r
+CT=   97d0754fe68f11b9e375d070a608c884\r
+TEST= 241\r
+KEY=  fffe0000000000000000000000000000\r
+CT=   113ecbe4a453269a0dd26069467fb5b5\r
+TEST= 242\r
+KEY=  fffc0000000000000000000000000000\r
+CT=   2637050c9fc0d4817e2d69de878aee8d\r
+TEST= 243\r
+KEY=  fff80000000000000000000000000000\r
+CT=   b5f1a33e50d40d103764c76bd4c6b6f8\r
+TEST= 244\r
+KEY=  fff00000000000000000000000000000\r
+CT=   a01bf44f2d16be928ca44aaf7b9b106b\r
+TEST= 245\r
+KEY=  ffe00000000000000000000000000000\r
+CT=   956d7798fac20f82a8823f984d06f7f5\r
+TEST= 246\r
+KEY=  ffc00000000000000000000000000000\r
+CT=   9958f0ecea8b2172c0c1995f9182c0f3\r
+TEST= 247\r
+KEY=  ff800000000000000000000000000000\r
+CT=   42ffb34c743de4d88ca38011c990890b\r
+TEST= 248\r
+KEY=  ff000000000000000000000000000000\r
+CT=   b1d758256b28fd850ad4944208cf1155\r
+TEST= 249\r
+KEY=  fe000000000000000000000000000000\r
+CT=   c4295f83465c7755e8fa364bac6a7ea5\r
+TEST= 250\r
+KEY=  fc000000000000000000000000000000\r
+CT=   9ed5a75136a940d0963da379db4af26a\r
+TEST= 251\r
+KEY=  f8000000000000000000000000000000\r
+CT=   f17e79aed0db7e279e955b5f493875a7\r
+TEST= 252\r
+KEY=  f0000000000000000000000000000000\r
+CT=   970014d634e2b7650777e8e84d03ccd8\r
+TEST= 253\r
+KEY=  e0000000000000000000000000000000\r
+CT=   72a1da770f5d7ac4c9ef94d822affd97\r
+TEST= 254\r
+KEY=  c0000000000000000000000000000000\r
+CT=   4bc3f883450c113c64ca42e1112a9e87\r
+TEST= 255\r
+KEY=  80000000000000000000000000000000\r
+CT=   0edd33d3c621e546455bd8ba1418bec8\r
diff --git a/test/dfregress/testcases/crypto/aes/ecbnk48.txt b/test/dfregress/testcases/crypto/aes/ecbnk48.txt
new file mode 100644 (file)
index 0000000..0cf0074
--- /dev/null
@@ -0,0 +1,1547 @@
+==============================================\r
+Author:    Dr B R Gladman (                 )\r
+Test:      ECB Variable Key Known Answer Tests\r
+Algorithm: Extended Rijndael (an AES Superset)\r
+Filename:  ecbnk48.txt\r
+==============================================\r
+\r
+BLOCKSIZE=128\r
+KEYSIZE=  256\r
+\r
+PT=   00000000000000000000000000000000\r
+TEST= 0\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000000\r
+CT=   dc95c078a2408989ad48a21492842087\r
+TEST= 1\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000001\r
+CT=   6b6cfe160a6263631b292f879eeff926\r
+TEST= 2\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000003\r
+CT=   bf701e7f51c292f1cc242a991578eb2a\r
+TEST= 3\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000007\r
+CT=   ab749ad085ee539d8baf1621853d3fb2\r
+TEST= 4\r
+KEY=  000000000000000000000000000000000000000000000000000000000000000f\r
+CT=   4bcef4dbc203f06aa5fb72ed1a70fb89\r
+TEST= 5\r
+KEY=  000000000000000000000000000000000000000000000000000000000000001f\r
+CT=   be406db48b9b2aa8559ed5b173fd658b\r
+TEST= 6\r
+KEY=  000000000000000000000000000000000000000000000000000000000000003f\r
+CT=   e93766e59507d341537d0c62072d8a55\r
+TEST= 7\r
+KEY=  000000000000000000000000000000000000000000000000000000000000007f\r
+CT=   58ed5fbb416960f5f06159b76a6d7738\r
+TEST= 8\r
+KEY=  00000000000000000000000000000000000000000000000000000000000000ff\r
+CT=   bc2546f4768081ceb295a72b31e6ab05\r
+TEST= 9\r
+KEY=  00000000000000000000000000000000000000000000000000000000000001ff\r
+CT=   1e85b10b69d7e5994438da340674b012\r
+TEST= 10\r
+KEY=  00000000000000000000000000000000000000000000000000000000000003ff\r
+CT=   027d266cf77aa9f5365aa549254323cf\r
+TEST= 11\r
+KEY=  00000000000000000000000000000000000000000000000000000000000007ff\r
+CT=   fbde91184125dc0d0f229e09db5a8da2\r
+TEST= 12\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000fff\r
+CT=   53a77656d1bc4e33ac9a4ae98a912b35\r
+TEST= 13\r
+KEY=  0000000000000000000000000000000000000000000000000000000000001fff\r
+CT=   af5628c2a562fce45b3e3265b17d57c1\r
+TEST= 14\r
+KEY=  0000000000000000000000000000000000000000000000000000000000003fff\r
+CT=   b835c0732fbfd73f3c428877dceefbfd\r
+TEST= 15\r
+KEY=  0000000000000000000000000000000000000000000000000000000000007fff\r
+CT=   03f6669af1df61abcf54024353c3048d\r
+TEST= 16\r
+KEY=  000000000000000000000000000000000000000000000000000000000000ffff\r
+CT=   fe3dec93582172729ca562db3a24da23\r
+TEST= 17\r
+KEY=  000000000000000000000000000000000000000000000000000000000001ffff\r
+CT=   ed696865926ecabb1e5013e1dc4862c9\r
+TEST= 18\r
+KEY=  000000000000000000000000000000000000000000000000000000000003ffff\r
+CT=   c9a918af1b5a4ce363fd5bdbbbe94dd6\r
+TEST= 19\r
+KEY=  000000000000000000000000000000000000000000000000000000000007ffff\r
+CT=   c213d9c2a23584883d25823549daa369\r
+TEST= 20\r
+KEY=  00000000000000000000000000000000000000000000000000000000000fffff\r
+CT=   cbd19b0ac8fd6e5de946d1866ff0014e\r
+TEST= 21\r
+KEY=  00000000000000000000000000000000000000000000000000000000001fffff\r
+CT=   913b89d6540f1f26eae1ce75d65a3373\r
+TEST= 22\r
+KEY=  00000000000000000000000000000000000000000000000000000000003fffff\r
+CT=   c71ad528b5ed428b29b05e90696065ef\r
+TEST= 23\r
+KEY=  00000000000000000000000000000000000000000000000000000000007fffff\r
+CT=   537013a5f3fd7e97612798bca85edce1\r
+TEST= 24\r
+KEY=  0000000000000000000000000000000000000000000000000000000000ffffff\r
+CT=   af63b3b30ad065a7c686c6c53687575d\r
+TEST= 25\r
+KEY=  0000000000000000000000000000000000000000000000000000000001ffffff\r
+CT=   d0ab26758ce397c61b0160b682761a96\r
+TEST= 26\r
+KEY=  0000000000000000000000000000000000000000000000000000000003ffffff\r
+CT=   942e760423b6ea3cfe6da21186ae47ac\r
+TEST= 27\r
+KEY=  0000000000000000000000000000000000000000000000000000000007ffffff\r
+CT=   45685f766771cdebcaad2fb3c792fe51\r
+TEST= 28\r
+KEY=  000000000000000000000000000000000000000000000000000000000fffffff\r
+CT=   cb0a8a91aa019fdf83c4ffbbdcf7447d\r
+TEST= 29\r
+KEY=  000000000000000000000000000000000000000000000000000000001fffffff\r
+CT=   19c871011b3afd00c834caf416ef4cf9\r
+TEST= 30\r
+KEY=  000000000000000000000000000000000000000000000000000000003fffffff\r
+CT=   3761ba9ab369230a061af0080936bb35\r
+TEST= 31\r
+KEY=  000000000000000000000000000000000000000000000000000000007fffffff\r
+CT=   63587d81d0dd0af99cb71b848d8055b4\r
+TEST= 32\r
+KEY=  00000000000000000000000000000000000000000000000000000000ffffffff\r
+CT=   543f94b1e7458f38994515b2f82b56e5\r
+TEST= 33\r
+KEY=  00000000000000000000000000000000000000000000000000000001ffffffff\r
+CT=   96fe07bbda459956adc2dff0e112c4b6\r
+TEST= 34\r
+KEY=  00000000000000000000000000000000000000000000000000000003ffffffff\r
+CT=   855e83b75c30bf564d78b8ead29898a1\r
+TEST= 35\r
+KEY=  00000000000000000000000000000000000000000000000000000007ffffffff\r
+CT=   971f085cfd3672e8d648894e833372f6\r
+TEST= 36\r
+KEY=  0000000000000000000000000000000000000000000000000000000fffffffff\r
+CT=   45d75757285fa13740f9335135811c62\r
+TEST= 37\r
+KEY=  0000000000000000000000000000000000000000000000000000001fffffffff\r
+CT=   e7d8cfd6c8393169a8e1ef610ea8ff04\r
+TEST= 38\r
+KEY=  0000000000000000000000000000000000000000000000000000003fffffffff\r
+CT=   6e079973ba11f4eca6ac2d1875a7a5d1\r
+TEST= 39\r
+KEY=  0000000000000000000000000000000000000000000000000000007fffffffff\r
+CT=   ed2252c561bbb86172664a7e6f4f588f\r
+TEST= 40\r
+KEY=  000000000000000000000000000000000000000000000000000000ffffffffff\r
+CT=   6a326677187d8636bd0cf410707150d2\r
+TEST= 41\r
+KEY=  000000000000000000000000000000000000000000000000000001ffffffffff\r
+CT=   6d005cea1a4e54fb2becfe7f84da2690\r
+TEST= 42\r
+KEY=  000000000000000000000000000000000000000000000000000003ffffffffff\r
+CT=   dbf008f42a12b68d5d976b19c03dbf8f\r
+TEST= 43\r
+KEY=  000000000000000000000000000000000000000000000000000007ffffffffff\r
+CT=   d2c675869612e5e8e997c2f40c124b4f\r
+TEST= 44\r
+KEY=  00000000000000000000000000000000000000000000000000000fffffffffff\r
+CT=   34b24616843e26e04ae07e30f1d37c14\r
+TEST= 45\r
+KEY=  00000000000000000000000000000000000000000000000000001fffffffffff\r
+CT=   66261a57903dcd9e7b99ffee603d52ea\r
+TEST= 46\r
+KEY=  00000000000000000000000000000000000000000000000000003fffffffffff\r
+CT=   41044ecff55d2f1b74ac503a026b69f1\r
+TEST= 47\r
+KEY=  00000000000000000000000000000000000000000000000000007fffffffffff\r
+CT=   fdf60bb3857a923412e5549ceb47a06b\r
+TEST= 48\r
+KEY=  0000000000000000000000000000000000000000000000000000ffffffffffff\r
+CT=   4afd474c849e7435dbc189033056ffaf\r
+TEST= 49\r
+KEY=  0000000000000000000000000000000000000000000000000001ffffffffffff\r
+CT=   0a1b1c700a9de96f6382199b58c3f156\r
+TEST= 50\r
+KEY=  0000000000000000000000000000000000000000000000000003ffffffffffff\r
+CT=   2cc0ac48f4b609e07ff191f7e201cd4d\r
+TEST= 51\r
+KEY=  0000000000000000000000000000000000000000000000000007ffffffffffff\r
+CT=   b73f7c95679e7b2a4142b95962216d47\r
+TEST= 52\r
+KEY=  000000000000000000000000000000000000000000000000000fffffffffffff\r
+CT=   eb0b3ad0cfe4a029402a8ae1b59effab\r
+TEST= 53\r
+KEY=  000000000000000000000000000000000000000000000000001fffffffffffff\r
+CT=   3d504ad4b4029094043778ce3c2d3517\r
+TEST= 54\r
+KEY=  000000000000000000000000000000000000000000000000003fffffffffffff\r
+CT=   23d88a19ac10ce9d878b8bafb2559c42\r
+TEST= 55\r
+KEY=  000000000000000000000000000000000000000000000000007fffffffffffff\r
+CT=   75aa63f4ed7deb513b2c60a49f26ed5b\r
+TEST= 56\r
+KEY=  00000000000000000000000000000000000000000000000000ffffffffffffff\r
+CT=   e2d7fd533d6e2f03cbd2e89eeff058bf\r
+TEST= 57\r
+KEY=  00000000000000000000000000000000000000000000000001ffffffffffffff\r
+CT=   27118699661cd6dbe6118cd339f08ace\r
+TEST= 58\r
+KEY=  00000000000000000000000000000000000000000000000003ffffffffffffff\r
+CT=   ec355421e48d3fef18e00fe0ba13afeb\r
+TEST= 59\r
+KEY=  00000000000000000000000000000000000000000000000007ffffffffffffff\r
+CT=   b4df72723b9a101f4dcf20afddbb6cd4\r
+TEST= 60\r
+KEY=  0000000000000000000000000000000000000000000000000fffffffffffffff\r
+CT=   427b5f8e6b9372c65dee4b33256bc571\r
+TEST= 61\r
+KEY=  0000000000000000000000000000000000000000000000001fffffffffffffff\r
+CT=   890accefa77cbf872f5296f1cc843d6d\r
+TEST= 62\r
+KEY=  0000000000000000000000000000000000000000000000003fffffffffffffff\r
+CT=   45f132aeedfcaeada0354232e8e0ecd6\r
+TEST= 63\r
+KEY=  0000000000000000000000000000000000000000000000007fffffffffffffff\r
+CT=   e00b07ddb7ac13b03ff48988211fe71f\r
+TEST= 64\r
+KEY=  000000000000000000000000000000000000000000000000ffffffffffffffff\r
+CT=   9d386993f184e5805fb0e987455809ed\r
+TEST= 65\r
+KEY=  000000000000000000000000000000000000000000000001ffffffffffffffff\r
+CT=   475b5ab6722d43f715436a8cb59cbf4f\r
+TEST= 66\r
+KEY=  000000000000000000000000000000000000000000000003ffffffffffffffff\r
+CT=   a82590572fd07fbf1d23fc81b49e8756\r
+TEST= 67\r
+KEY=  000000000000000000000000000000000000000000000007ffffffffffffffff\r
+CT=   3adce472e6c7a99fa7d3017ad75f5cdf\r
+TEST= 68\r
+KEY=  00000000000000000000000000000000000000000000000fffffffffffffffff\r
+CT=   524797e0cf9c9dea956962ef7136f546\r
+TEST= 69\r
+KEY=  00000000000000000000000000000000000000000000001fffffffffffffffff\r
+CT=   075d0316aedd8df2ae66eb838e2ed485\r
+TEST= 70\r
+KEY=  00000000000000000000000000000000000000000000003fffffffffffffffff\r
+CT=   187849162a0b56eeaae2425c2e494b78\r
+TEST= 71\r
+KEY=  00000000000000000000000000000000000000000000007fffffffffffffffff\r
+CT=   c278f398882137eaac01c3275a9a2722\r
+TEST= 72\r
+KEY=  0000000000000000000000000000000000000000000000ffffffffffffffffff\r
+CT=   f1e8b6e7114b02918877a995784fcb74\r
+TEST= 73\r
+KEY=  0000000000000000000000000000000000000000000001ffffffffffffffffff\r
+CT=   e7f582f29d8d332087bda8514372c900\r
+TEST= 74\r
+KEY=  0000000000000000000000000000000000000000000003ffffffffffffffffff\r
+CT=   0a4585f81b68c921331c1f9110df528e\r
+TEST= 75\r
+KEY=  0000000000000000000000000000000000000000000007ffffffffffffffffff\r
+CT=   203c4d0dba823937bd66680f47cf5511\r
+TEST= 76\r
+KEY=  000000000000000000000000000000000000000000000fffffffffffffffffff\r
+CT=   d757358180429b7112e006a53eb5467f\r
+TEST= 77\r
+KEY=  000000000000000000000000000000000000000000001fffffffffffffffffff\r
+CT=   202b92ded713c6c754fab7ab9235ab3c\r
+TEST= 78\r
+KEY=  000000000000000000000000000000000000000000003fffffffffffffffffff\r
+CT=   a226249ea4d82542a878009a495bd4ca\r
+TEST= 79\r
+KEY=  000000000000000000000000000000000000000000007fffffffffffffffffff\r
+CT=   0d62e8c60b22be37888eef8fafd374a4\r
+TEST= 80\r
+KEY=  00000000000000000000000000000000000000000000ffffffffffffffffffff\r
+CT=   6e16ce6a174705eb4dea7391d180f6e9\r
+TEST= 81\r
+KEY=  00000000000000000000000000000000000000000001ffffffffffffffffffff\r
+CT=   53a295a307cc07aeda9618fe12268bfa\r
+TEST= 82\r
+KEY=  00000000000000000000000000000000000000000003ffffffffffffffffffff\r
+CT=   6fb67e2d8a5b1ddb8f3b37458f03fdba\r
+TEST= 83\r
+KEY=  00000000000000000000000000000000000000000007ffffffffffffffffffff\r
+CT=   9eb298a14e534f5bd08380dd0949d312\r
+TEST= 84\r
+KEY=  0000000000000000000000000000000000000000000fffffffffffffffffffff\r
+CT=   30a6d04751b2211b19099024ef052fbe\r
+TEST= 85\r
+KEY=  0000000000000000000000000000000000000000001fffffffffffffffffffff\r
+CT=   1c32545f6246937f70aec5fe8603c6c3\r
+TEST= 86\r
+KEY=  0000000000000000000000000000000000000000003fffffffffffffffffffff\r
+CT=   a6b1755b086923fdfb82a3906228ba16\r
+TEST= 87\r
+KEY=  0000000000000000000000000000000000000000007fffffffffffffffffffff\r
+CT=   3efc4aceca70357daa5425e77370d01c\r
+TEST= 88\r
+KEY=  000000000000000000000000000000000000000000ffffffffffffffffffffff\r
+CT=   e8d7761c2afd674da8f72505515df6d9\r
+TEST= 89\r
+KEY=  000000000000000000000000000000000000000001ffffffffffffffffffffff\r
+CT=   6e9927c90c684eef8314933f3bdbd17d\r
+TEST= 90\r
+KEY=  000000000000000000000000000000000000000003ffffffffffffffffffffff\r
+CT=   020d04983f9bdc77750af373febcfda4\r
+TEST= 91\r
+KEY=  000000000000000000000000000000000000000007ffffffffffffffffffffff\r
+CT=   d7fdd1e21e7284aab3caae27f4c3ac2e\r
+TEST= 92\r
+KEY=  00000000000000000000000000000000000000000fffffffffffffffffffffff\r
+CT=   59279905253bbe0390b6ee5f4d913035\r
+TEST= 93\r
+KEY=  00000000000000000000000000000000000000001fffffffffffffffffffffff\r
+CT=   5939a3a8a64eb06498880eb69c06108a\r
+TEST= 94\r
+KEY=  00000000000000000000000000000000000000003fffffffffffffffffffffff\r
+CT=   fbcce6048c4cbe51db5b792dec5f7fa4\r
+TEST= 95\r
+KEY=  00000000000000000000000000000000000000007fffffffffffffffffffffff\r
+CT=   6e61dd46de31a0b83f441a175e5a68c5\r
+TEST= 96\r
+KEY=  0000000000000000000000000000000000000000ffffffffffffffffffffffff\r
+CT=   517488ed7136e987df9900dc032cf104\r
+TEST= 97\r
+KEY=  0000000000000000000000000000000000000001ffffffffffffffffffffffff\r
+CT=   75c590ae01382faa02f3fc94ac094c25\r
+TEST= 98\r
+KEY=  0000000000000000000000000000000000000003ffffffffffffffffffffffff\r
+CT=   7add6d12d7e627f64341fa7cc8f9d1bd\r
+TEST= 99\r
+KEY=  0000000000000000000000000000000000000007ffffffffffffffffffffffff\r
+CT=   f5debd1f635e9bc7fea99c5b5cc4a23f\r
+TEST= 100\r
+KEY=  000000000000000000000000000000000000000fffffffffffffffffffffffff\r
+CT=   cf63aefa7f89f106dd941e9e439e4882\r
+TEST= 101\r
+KEY=  000000000000000000000000000000000000001fffffffffffffffffffffffff\r
+CT=   007d5db50703e395b7f0319bd47bced0\r
+TEST= 102\r
+KEY=  000000000000000000000000000000000000003fffffffffffffffffffffffff\r
+CT=   b30da57079a61f274ea7bad1a1f968f9\r
+TEST= 103\r
+KEY=  000000000000000000000000000000000000007fffffffffffffffffffffffff\r
+CT=   2861cea007f459e060ec30a35bf77f3e\r
+TEST= 104\r
+KEY=  00000000000000000000000000000000000000ffffffffffffffffffffffffff\r
+CT=   76ea45daa3ac5419f94c083df1f6eed6\r
+TEST= 105\r
+KEY=  00000000000000000000000000000000000001ffffffffffffffffffffffffff\r
+CT=   f763116ab6713769978256008da81f21\r
+TEST= 106\r
+KEY=  00000000000000000000000000000000000003ffffffffffffffffffffffffff\r
+CT=   0ab5cc550c106a3893269ea47faa55b5\r
+TEST= 107\r
+KEY=  00000000000000000000000000000000000007ffffffffffffffffffffffffff\r
+CT=   d6721c1e6eb846a73c74dd218e983e68\r
+TEST= 108\r
+KEY=  0000000000000000000000000000000000000fffffffffffffffffffffffffff\r
+CT=   695cb975fce7307b7b66a834532886e0\r
+TEST= 109\r
+KEY=  0000000000000000000000000000000000001fffffffffffffffffffffffffff\r
+CT=   2b208ab1ee6448d185e487ccd48e6e21\r
+TEST= 110\r
+KEY=  0000000000000000000000000000000000003fffffffffffffffffffffffffff\r
+CT=   fb83cf7f34b08873c8d69d261055e20b\r
+TEST= 111\r
+KEY=  0000000000000000000000000000000000007fffffffffffffffffffffffffff\r
+CT=   b5028a49edef6b356c3a650e2cb9e8ec\r
+TEST= 112\r
+KEY=  000000000000000000000000000000000000ffffffffffffffffffffffffffff\r
+CT=   95334335ed4c4a760562ae7d2a495632\r
+TEST= 113\r
+KEY=  000000000000000000000000000000000001ffffffffffffffffffffffffffff\r
+CT=   6a462fa7c99e2f712c68589060ba5ea8\r
+TEST= 114\r
+KEY=  000000000000000000000000000000000003ffffffffffffffffffffffffffff\r
+CT=   a6d665b7058a2afb5d8733f68cd5a3ad\r
+TEST= 115\r
+KEY=  000000000000000000000000000000000007ffffffffffffffffffffffffffff\r
+CT=   e83ca68a268587bced34cb8c7921295e\r
+TEST= 116\r
+KEY=  00000000000000000000000000000000000fffffffffffffffffffffffffffff\r
+CT=   b071d09822e2057cf9340dd7cab746e1\r
+TEST= 117\r
+KEY=  00000000000000000000000000000000001fffffffffffffffffffffffffffff\r
+CT=   56b2e0652b99419a4ee106208d93dcfe\r
+TEST= 118\r
+KEY=  00000000000000000000000000000000003fffffffffffffffffffffffffffff\r
+CT=   007124f92a4d45b728573441e9f9056e\r
+TEST= 119\r
+KEY=  00000000000000000000000000000000007fffffffffffffffffffffffffffff\r
+CT=   16793534f4253cbc98b5566034922535\r
+TEST= 120\r
+KEY=  0000000000000000000000000000000000ffffffffffffffffffffffffffffff\r
+CT=   52ef58a3745fb284b5dc0d3b1461e83f\r
+TEST= 121\r
+KEY=  0000000000000000000000000000000001ffffffffffffffffffffffffffffff\r
+CT=   5d0437caa6e87e7edaaef69b9f2a939c\r
+TEST= 122\r
+KEY=  0000000000000000000000000000000003ffffffffffffffffffffffffffffff\r
+CT=   6b0fcfd7c7a9f906612bd19d56a5eb92\r
+TEST= 123\r
+KEY=  0000000000000000000000000000000007ffffffffffffffffffffffffffffff\r
+CT=   1b70f1055cd41e7b4baaf811d1dc2107\r
+TEST= 124\r
+KEY=  000000000000000000000000000000000fffffffffffffffffffffffffffffff\r
+CT=   44af7f02410db127a4df787fc95dbeba\r
+TEST= 125\r
+KEY=  000000000000000000000000000000001fffffffffffffffffffffffffffffff\r
+CT=   4e257c57d75263d0f8e332a840eb5d91\r
+TEST= 126\r
+KEY=  000000000000000000000000000000003fffffffffffffffffffffffffffffff\r
+CT=   5bf2a1b829ac2b77694ba7e9cd5fe696\r
+TEST= 127\r
+KEY=  000000000000000000000000000000007fffffffffffffffffffffffffffffff\r
+CT=   16bde095575a3fce86d6a2048efdfda5\r
+TEST= 128\r
+KEY=  00000000000000000000000000000000ffffffffffffffffffffffffffffffff\r
+CT=   3eba4327813f079e4e35ff0f96294c45\r
+TEST= 129\r
+KEY=  00000000000000000000000000000001ffffffffffffffffffffffffffffffff\r
+CT=   8e44354ada179283f48a9a823ed12dde\r
+TEST= 130\r
+KEY=  00000000000000000000000000000003ffffffffffffffffffffffffffffffff\r
+CT=   947c7bf988d6c4337a287fd07e315eb6\r
+TEST= 131\r
+KEY=  00000000000000000000000000000007ffffffffffffffffffffffffffffffff\r
+CT=   8f40a2be60fc9199c33107784cd8680a\r
+TEST= 132\r
+KEY=  0000000000000000000000000000000fffffffffffffffffffffffffffffffff\r
+CT=   24d8df70bc270b725a061ffbae9908aa\r
+TEST= 133\r
+KEY=  0000000000000000000000000000001fffffffffffffffffffffffffffffffff\r
+CT=   75bb95c01ee27cfa20942a3248bf2c15\r
+TEST= 134\r
+KEY=  0000000000000000000000000000003fffffffffffffffffffffffffffffffff\r
+CT=   6dd74f7f74ebfcbe2ea9003eea9dc895\r
+TEST= 135\r
+KEY=  0000000000000000000000000000007fffffffffffffffffffffffffffffffff\r
+CT=   e7ba9be6d67eb735faab4e51c42c358a\r
+TEST= 136\r
+KEY=  000000000000000000000000000000ffffffffffffffffffffffffffffffffff\r
+CT=   31f9d4202468e6bf9ae926396c09d75d\r
+TEST= 137\r
+KEY=  000000000000000000000000000001ffffffffffffffffffffffffffffffffff\r
+CT=   c8021f0215b26d90a9957381134db197\r
+TEST= 138\r
+KEY=  000000000000000000000000000003ffffffffffffffffffffffffffffffffff\r
+CT=   57a95c3742317d577d00653f90a57214\r
+TEST= 139\r
+KEY=  000000000000000000000000000007ffffffffffffffffffffffffffffffffff\r
+CT=   0d2d79b82fa7b36ee766c1ffd9b61610\r
+TEST= 140\r
+KEY=  00000000000000000000000000000fffffffffffffffffffffffffffffffffff\r
+CT=   e571bc3cc6b85ace8d9b4d1136d962d7\r
+TEST= 141\r
+KEY=  00000000000000000000000000001fffffffffffffffffffffffffffffffffff\r
+CT=   ffa28032523f41d01de868f5545188bf\r
+TEST= 142\r
+KEY=  00000000000000000000000000003fffffffffffffffffffffffffffffffffff\r
+CT=   2734d5d8c9ad438077f9308a8de9d544\r
+TEST= 143\r
+KEY=  00000000000000000000000000007fffffffffffffffffffffffffffffffffff\r
+CT=   99d9f28f5127ea200c9de6d5c8d0fc1c\r
+TEST= 144\r
+KEY=  0000000000000000000000000000ffffffffffffffffffffffffffffffffffff\r
+CT=   0fdca399ded08ed42b085da22d93326d\r
+TEST= 145\r
+KEY=  0000000000000000000000000001ffffffffffffffffffffffffffffffffffff\r
+CT=   3f30ddd5a713d5d8ab216a8b4d7d52a4\r
+TEST= 146\r
+KEY=  0000000000000000000000000003ffffffffffffffffffffffffffffffffffff\r
+CT=   c3d85f4ea35417559b1407d39c149fc7\r
+TEST= 147\r
+KEY=  0000000000000000000000000007ffffffffffffffffffffffffffffffffffff\r
+CT=   e3d276628c8cf02c42ad2d758de155ce\r
+TEST= 148\r
+KEY=  000000000000000000000000000fffffffffffffffffffffffffffffffffffff\r
+CT=   b84399d6053263e6472304e26f5e0ec7\r
+TEST= 149\r
+KEY=  000000000000000000000000001fffffffffffffffffffffffffffffffffffff\r
+CT=   6e20742b02838468dd51e5a3a7f2b8ba\r
+TEST= 150\r
+KEY=  000000000000000000000000003fffffffffffffffffffffffffffffffffffff\r
+CT=   9a9dbab97ca1f7a2da7f965ee1dfb4e6\r
+TEST= 151\r
+KEY=  000000000000000000000000007fffffffffffffffffffffffffffffffffffff\r
+CT=   41aacaa89e1399a108a80716fd0e0f55\r
+TEST= 152\r
+KEY=  00000000000000000000000000ffffffffffffffffffffffffffffffffffffff\r
+CT=   582be6d22c815bc81fde4c0d234d626a\r
+TEST= 153\r
+KEY=  00000000000000000000000001ffffffffffffffffffffffffffffffffffffff\r
+CT=   4499f256fe699e5e994d887be48fe2ec\r
+TEST= 154\r
+KEY=  00000000000000000000000003ffffffffffffffffffffffffffffffffffffff\r
+CT=   ee26c00ac7b5df7bfe5e3a07df721147\r
+TEST= 155\r
+KEY=  00000000000000000000000007ffffffffffffffffffffffffffffffffffffff\r
+CT=   8b8f6e74e2f3f90647d0fd8bb9bebad4\r
+TEST= 156\r
+KEY=  0000000000000000000000000fffffffffffffffffffffffffffffffffffffff\r
+CT=   863784b8bedd5e5136653c117640cf73\r
+TEST= 157\r
+KEY=  0000000000000000000000001fffffffffffffffffffffffffffffffffffffff\r
+CT=   649734b5a45c46804993680b7430ee16\r
+TEST= 158\r
+KEY=  0000000000000000000000003fffffffffffffffffffffffffffffffffffffff\r
+CT=   4300c7495e4f60051bf81b41efd60937\r
+TEST= 159\r
+KEY=  0000000000000000000000007fffffffffffffffffffffffffffffffffffffff\r
+CT=   175c302f8c69865e4b29998654d7df56\r
+TEST= 160\r
+KEY=  000000000000000000000000ffffffffffffffffffffffffffffffffffffffff\r
+CT=   7fa83d9963562b275db0b9f8a2741abf\r
+TEST= 161\r
+KEY=  000000000000000000000001ffffffffffffffffffffffffffffffffffffffff\r
+CT=   dff04cd44b1770cdc3dfd13076cdd20d\r
+TEST= 162\r
+KEY=  000000000000000000000003ffffffffffffffffffffffffffffffffffffffff\r
+CT=   576bd4bad89d83bd47543b49d43bfbac\r
+TEST= 163\r
+KEY=  000000000000000000000007ffffffffffffffffffffffffffffffffffffffff\r
+CT=   d38e87363016d48279fa8a8f89514ec2\r
+TEST= 164\r
+KEY=  00000000000000000000000fffffffffffffffffffffffffffffffffffffffff\r
+CT=   48a1b62e83e17d43f94367380efe6d3c\r
+TEST= 165\r
+KEY=  00000000000000000000001fffffffffffffffffffffffffffffffffffffffff\r
+CT=   c1bb7aefd3613e4e54fbc55263089094\r
+TEST= 166\r
+KEY=  00000000000000000000003fffffffffffffffffffffffffffffffffffffffff\r
+CT=   b2f12fd11d9fc28942e293cafd564697\r
+TEST= 167\r
+KEY=  00000000000000000000007fffffffffffffffffffffffffffffffffffffffff\r
+CT=   9f7d86077298836c7a051cdcdc01b0a3\r
+TEST= 168\r
+KEY=  0000000000000000000000ffffffffffffffffffffffffffffffffffffffffff\r
+CT=   837980614116768f301d4eaf74c8f61c\r
+TEST= 169\r
+KEY=  0000000000000000000001ffffffffffffffffffffffffffffffffffffffffff\r
+CT=   bebe2da4f22916c758713300653954f2\r
+TEST= 170\r
+KEY=  0000000000000000000003ffffffffffffffffffffffffffffffffffffffffff\r
+CT=   a854fef10367e2717f0c1477c276ba51\r
+TEST= 171\r
+KEY=  0000000000000000000007ffffffffffffffffffffffffffffffffffffffffff\r
+CT=   8062587d0399c57034691b224b7458f9\r
+TEST= 172\r
+KEY=  000000000000000000000fffffffffffffffffffffffffffffffffffffffffff\r
+CT=   6eff435d904f9331194a9390aab9bbc6\r
+TEST= 173\r
+KEY=  000000000000000000001fffffffffffffffffffffffffffffffffffffffffff\r
+CT=   51cca7c89eb5cf85513f4d4cc012367d\r
+TEST= 174\r
+KEY=  000000000000000000003fffffffffffffffffffffffffffffffffffffffffff\r
+CT=   7266ab510d9fba7ef7f5b091771ce3b6\r
+TEST= 175\r
+KEY=  000000000000000000007fffffffffffffffffffffffffffffffffffffffffff\r
+CT=   a7fea44379f62e4c084762cf57fcff2e\r
+TEST= 176\r
+KEY=  00000000000000000000ffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   cfe5b834dc50762e7f664736fe01314c\r
+TEST= 177\r
+KEY=  00000000000000000001ffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   b161bcc5b60fdee9f42f01ad7cb577cc\r
+TEST= 178\r
+KEY=  00000000000000000003ffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   619203acd2578302f9fd58878bb7e6e9\r
+TEST= 179\r
+KEY=  00000000000000000007ffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   3b8c4d30824b1c30b654982f3b11c690\r
+TEST= 180\r
+KEY=  0000000000000000000fffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   ca5f8704dffde917707fbee0e6d47d91\r
+TEST= 181\r
+KEY=  0000000000000000001fffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   e47af77c9156d7b189d60302bba2abc7\r
+TEST= 182\r
+KEY=  0000000000000000003fffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   672728b55b4987f66df36174c601ee79\r
+TEST= 183\r
+KEY=  0000000000000000007fffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   ecf4ad0de7dc2b747cd6bd672661cf20\r
+TEST= 184\r
+KEY=  000000000000000000ffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   90ec729bd49587be52d69a48d2101241\r
+TEST= 185\r
+KEY=  000000000000000001ffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   3f47dd56e94bdcc88fc15f92680fae2b\r
+TEST= 186\r
+KEY=  000000000000000003ffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   8a2db427a64ffd3d4a1351c2926f6c88\r
+TEST= 187\r
+KEY=  000000000000000007ffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   fbb09231e2d67b2292c4aad76eba7f24\r
+TEST= 188\r
+KEY=  00000000000000000fffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   dbc986b4365cb5de13e66e8b61f2b7a7\r
+TEST= 189\r
+KEY=  00000000000000001fffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   d8bb9b81c245521987e35293c8dc1c5b\r
+TEST= 190\r
+KEY=  00000000000000003fffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   2f8abe972cbef8e44333f6fc7b546b47\r
+TEST= 191\r
+KEY=  00000000000000007fffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   c4f400720ac847b949efbb88465c4a03\r
+TEST= 192\r
+KEY=  0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   13af71f5b184afa7a6b2076fda139c3e\r
+TEST= 193\r
+KEY=  0000000000000001ffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   343f57ab0bcaf1d0a6da2a4bb8548eb3\r
+TEST= 194\r
+KEY=  0000000000000003ffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   186664c6155d822512d9ee6235fe8ae6\r
+TEST= 195\r
+KEY=  0000000000000007ffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   84cb0d12ca2606e32d74352e70b46eb4\r
+TEST= 196\r
+KEY=  000000000000000fffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   1b4a2fce431cc884592074df060a8e3a\r
+TEST= 197\r
+KEY=  000000000000001fffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   6a03c8a609c994bf05968eee7a92352f\r
+TEST= 198\r
+KEY=  000000000000003fffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   886b0ebef192f7822f761e3638ee4cf8\r
+TEST= 199\r
+KEY=  000000000000007fffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   855afdfa6f111b1307e6aefd2ca99cf7\r
+TEST= 200\r
+KEY=  00000000000000ffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   30038bd599a496cfd937de42958fec6d\r
+TEST= 201\r
+KEY=  00000000000001ffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   bf2de78771bbc0612c5b124b05b0c91a\r
+TEST= 202\r
+KEY=  00000000000003ffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   51d5ad97f39309054b7f3a3d3c4a5fcd\r
+TEST= 203\r
+KEY=  00000000000007ffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   05c656dbd95072ca76c837eca96b7be7\r
+TEST= 204\r
+KEY=  0000000000000fffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   19c4955ce3fbb5d075309f4236c95d40\r
+TEST= 205\r
+KEY=  0000000000001fffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   3e82296fc30beae5bfc99dc34d098bd1\r
+TEST= 206\r
+KEY=  0000000000003fffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   946792d61dc8f87428316dd660acb0d7\r
+TEST= 207\r
+KEY=  0000000000007fffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   23877a45e455d3583850765e02e74f85\r
+TEST= 208\r
+KEY=  000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   a78b350037a786ea1dccb496695c4853\r
+TEST= 209\r
+KEY=  000000000001ffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   07a773a8e323e590728d8d908a70bb9c\r
+TEST= 210\r
+KEY=  000000000003ffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   bc916f318e1616cef19b497f5fd57e70\r
+TEST= 211\r
+KEY=  000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   4955b47dc1bdb73bf4ff96d6b2ca9b60\r
+TEST= 212\r
+KEY=  00000000000fffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   301db4ae59999c76d1dafeec928bb274\r
+TEST= 213\r
+KEY=  00000000001fffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   1ae328b4d92d60cb4ac726ba7882dbae\r
+TEST= 214\r
+KEY=  00000000003fffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   baafaebb3c980d05b72abee6756e80cd\r
+TEST= 215\r
+KEY=  00000000007fffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   1dd5d46789807814a37f1d9bdcf1f1f0\r
+TEST= 216\r
+KEY=  0000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   29258975ad47bb2fef85792c6edba0cf\r
+TEST= 217\r
+KEY=  0000000001ffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   6ba3d4297e1c46611c91a4bd5f469c16\r
+TEST= 218\r
+KEY=  0000000003ffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   db3db8c9e6dfb466554180bfaafbd7d5\r
+TEST= 219\r
+KEY=  0000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   dbe0f4c8a53653227f9420f3c8a4217e\r
+TEST= 220\r
+KEY=  000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   0a68a6d3efed7b6602bdba3affd12679\r
+TEST= 221\r
+KEY=  000000001fffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   83164657104e46ed285f929f880b4d94\r
+TEST= 222\r
+KEY=  000000003fffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   24766eda3ac0abe8ecd3f578c1dcdb54\r
+TEST= 223\r
+KEY=  000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   d871b41c3cd1b8977242dc4846bfacfc\r
+TEST= 224\r
+KEY=  00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   7b41c82f493c0fa5f5d55ea270f9863c\r
+TEST= 225\r
+KEY=  00000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   79ac40e48b1f044e89c2f2e444447a78\r
+TEST= 226\r
+KEY=  00000003ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   71b289b6ccd0975244b291b0afad7883\r
+TEST= 227\r
+KEY=  00000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   0212b97d6105467fcc606575d17f1065\r
+TEST= 228\r
+KEY=  0000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   2eb35611fb7c76778b0f54cb0cc2934d\r
+TEST= 229\r
+KEY=  0000001fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   a7dee1c4fe0755ba889cf3fd1c65205c\r
+TEST= 230\r
+KEY=  0000003fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   621116bdeeae44ae2eecb08fce1e108a\r
+TEST= 231\r
+KEY=  0000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   29a1db0e72a771eb8c6361a17d6e6dbf\r
+TEST= 232\r
+KEY=  000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   36fffa85f3963cf01f3297f4eefe14a1\r
+TEST= 233\r
+KEY=  000001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   c45dc9405cf61864d9fb65e864130009\r
+TEST= 234\r
+KEY=  000003ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   ae9a1eb242eee920e539d8ce1fc96286\r
+TEST= 235\r
+KEY=  000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   99861099327a2b7170db096990c90453\r
+TEST= 236\r
+KEY=  00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   d33639cd1a110d75cc8394e0a09be96a\r
+TEST= 237\r
+KEY=  00001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   775fda0219add7cf975e38ba170e7d7b\r
+TEST= 238\r
+KEY=  00003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   70ce9897f99712185af3f0ba84a726ff\r
+TEST= 239\r
+KEY=  00007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   a3d47fb6583f8a2f889bb79509731ec7\r
+TEST= 240\r
+KEY=  0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   c4bad4e26e43d7c4af234278dc537528\r
+TEST= 241\r
+KEY=  0001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   920d830bce23565df19eaae4bd57310a\r
+TEST= 242\r
+KEY=  0003ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   3a39c43e83b54f61abe4383c96db3cc6\r
+TEST= 243\r
+KEY=  0007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   1d020ad19fba8d96a65bba16fbb42e17\r
+TEST= 244\r
+KEY=  000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   141ac0c97479d9e2102a9aabc127ee63\r
+TEST= 245\r
+KEY=  001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   7d3af45ccefc698808fb285ac595d491\r
+TEST= 246\r
+KEY=  003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   f9721f2d5f0a842aa66015d4ed6ca4b8\r
+TEST= 247\r
+KEY=  007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   3375396341b19ef7d59035e77d04157c\r
+TEST= 248\r
+KEY=  00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   b82a29ff80dc7924f3bc74033b567241\r
+TEST= 249\r
+KEY=  01ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   89cd4f3a1ff80a6f5f21619b12d8ceb7\r
+TEST= 250\r
+KEY=  03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   2ac0fd06ad5d60a45ef4b185eb2116d3\r
+TEST= 251\r
+KEY=  07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   a84ecd3feb87562d3837c1bd82f4a9a9\r
+TEST= 252\r
+KEY=  0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   6863d07b1b6cbf078a5a95ab10e4142f\r
+TEST= 253\r
+KEY=  1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   3b4c71bd036bc069e5dd13c38a3004a9\r
+TEST= 254\r
+KEY=  3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   cc0a818a631d407ab7ec415276719e31\r
+TEST= 255\r
+KEY=  7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   69053f64996ad8b4e82d996847de458b\r
+TEST= 256\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\r
+CT=   4bf85f1b5d54adbc307b0a048389adcb\r
+TEST= 257\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe\r
+CT=   b07d4f3e2cd2ef2eb545980754dfea0f\r
+TEST= 258\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc\r
+CT=   27936bd27fb1468fc8b48bc483321725\r
+TEST= 259\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8\r
+CT=   1f8a8133aa8ccf70e2bd3285831ca6b7\r
+TEST= 260\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0\r
+CT=   03720371a04962eaea0a852e69972858\r
+TEST= 261\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0\r
+CT=   cf78618f74f6f3696e0a4779b90b5a77\r
+TEST= 262\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0\r
+CT=   7b03627611678a997717578807a800e2\r
+TEST= 263\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80\r
+CT=   2f005a8aed8a361c92e440c15520cbd1\r
+TEST= 264\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\r
+CT=   60eb5af8416b257149372194e8b88749\r
+TEST= 265\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00\r
+CT=   5b40ff4ec9be536ba23035fa4f06064c\r
+TEST= 266\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00\r
+CT=   cca7c3086f5f9511b31233da7cab9160\r
+TEST= 267\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800\r
+CT=   8b378c86672aa54a3a266ba19d2580ca\r
+TEST= 268\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000\r
+CT=   9338f08e0ebee96905d8f2e825208f43\r
+TEST= 269\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe000\r
+CT=   50e6d3c9b6698a7cd276f96b1473f35a\r
+TEST= 270\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc000\r
+CT=   d94b5e90db354c1e42f61fabe167b2c0\r
+TEST= 271\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000\r
+CT=   a8a39a0f5663f4c0fe5f2d3cafff421a\r
+TEST= 272\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000\r
+CT=   563531135e0c4d70a38f8bdb190ba04e\r
+TEST= 273\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000\r
+CT=   d2e0c7f15b4772467d2cfc873000b2ca\r
+TEST= 274\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0000\r
+CT=   52fc3e620492ea99641ea168da5b6d52\r
+TEST= 275\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000\r
+CT=   3a0a0e75a8da36735aee6684d965a778\r
+TEST= 276\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000\r
+CT=   d3a204dbd9c2af158b6ca67a5156ce4a\r
+TEST= 277\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00000\r
+CT=   2fdea9e650532be5bc0e7325337fd363\r
+TEST= 278\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00000\r
+CT=   d1ac39bb1ef86b9c1344f214679aa376\r
+TEST= 279\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800000\r
+CT=   da797713263d6f33a5478a65ef60d412\r
+TEST= 280\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000\r
+CT=   3194367a4898c502c13bb7478640a72d\r
+TEST= 281\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffe000000\r
+CT=   ba9ebefdb4ccf30f296cecb3bc1943e8\r
+TEST= 282\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffffc000000\r
+CT=   e74a4c999b4c064e48bb1e413f51e5ea\r
+TEST= 283\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000000\r
+CT=   ea7bd6bb63418731aeac790fe42d61e8\r
+TEST= 284\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000\r
+CT=   37f655536a704e5ace182d742a820cf4\r
+TEST= 285\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000\r
+CT=   3f58c950f0367160adec45f2441e7411\r
+TEST= 286\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0000000\r
+CT=   294b033df4da853f4be3e243f7e513f4\r
+TEST= 287\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000\r
+CT=   234b148b8cb1d8c32b287e896903d150\r
+TEST= 288\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000\r
+CT=   70bed8dbf615868a1f9d9b05d3e7a267\r
+TEST= 289\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffe00000000\r
+CT=   1e38e759075ba5cab6457da51844295a\r
+TEST= 290\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffffc00000000\r
+CT=   02dc99fa3d4f98ce80985e7233889313\r
+TEST= 291\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffff800000000\r
+CT=   7379f3370cf6e5ce12ae5969c8eea312\r
+TEST= 292\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000\r
+CT=   96877803de77744bb970d0a91f4debae\r
+TEST= 293\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffe000000000\r
+CT=   2fbb83dfd0d7abcb05cd28cad2dfb523\r
+TEST= 294\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffffc000000000\r
+CT=   9c94b8b0cb8bcc919072262b3fa05ad9\r
+TEST= 295\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffff8000000000\r
+CT=   70377b6da669b072129e057cc28e9ca5\r
+TEST= 296\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000\r
+CT=   26b549c2ec756f82ecc48008e529956b\r
+TEST= 297\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000\r
+CT=   1ee6ee326583a0586491c96418d1a35d\r
+TEST= 298\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffffc0000000000\r
+CT=   97e8adf65638fd9cdf3bc22c17fe4dbd\r
+TEST= 299\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000\r
+CT=   5bf0051893a18bb30e139a58fed0fa54\r
+TEST= 300\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000\r
+CT=   7a15aab82701efa5ae36ab1d6b76290f\r
+TEST= 301\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffe00000000000\r
+CT=   4327d08c523d8eba697a4336507d1f42\r
+TEST= 302\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffffc00000000000\r
+CT=   4fc0d230f8891415b87b83f95f2e09d1\r
+TEST= 303\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffff800000000000\r
+CT=   a085d7c1a500873a20099c4caa3c3f5b\r
+TEST= 304\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000\r
+CT=   69cd0606e15af729d6bca143016d9842\r
+TEST= 305\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffe000000000000\r
+CT=   1f56413c7add6f43d1d56e4f02190330\r
+TEST= 306\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffffc000000000000\r
+CT=   2e2e647d5360e09230a5d738ca33471e\r
+TEST= 307\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffff8000000000000\r
+CT=   6702990727aa0878637b45dcd3a3b074\r
+TEST= 308\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000\r
+CT=   e9f80e9d845bcc0f62926af72eabca39\r
+TEST= 309\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000\r
+CT=   c267ef0e2d01a993944dd397101413cb\r
+TEST= 310\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffffc0000000000000\r
+CT=   6eda7ff6b8319180ff0d6e65629d01c3\r
+TEST= 311\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000\r
+CT=   8a772231c01dfdd7c98e4cfddcc0807a\r
+TEST= 312\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000\r
+CT=   35e9eddbc375e792c19992c19165012b\r
+TEST= 313\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffe00000000000000\r
+CT=   1dcd8bb173259eb33a5242b0de31a455\r
+TEST= 314\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffffc00000000000000\r
+CT=   84ecacfcd400084d078612b1945f2ef5\r
+TEST= 315\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffff800000000000000\r
+CT=   193a3d24157a51f1ee0893f6777417e7\r
+TEST= 316\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000\r
+CT=   023e82b533f68c75c238cebdb2ee89a2\r
+TEST= 317\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffe000000000000000\r
+CT=   d64424f23cb97215e9c2c6f28d29eab7\r
+TEST= 318\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffffc000000000000000\r
+CT=   804f32ea71828c7d329077e712231666\r
+TEST= 319\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffff8000000000000000\r
+CT=   37232a4ed21ccc27c19c9610078cabac\r
+TEST= 320\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000\r
+CT=   77565c8d73cfd4130b4aa14d8911710f\r
+TEST= 321\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000\r
+CT=   516183392f7a8763afec68a060264141\r
+TEST= 322\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffffc0000000000000000\r
+CT=   d1415447866230d28bb1ea18a4cdfd02\r
+TEST= 323\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffff80000000000000000\r
+CT=   6168b00ba7859e0970ecfd757efecf7c\r
+TEST= 324\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffff00000000000000000\r
+CT=   edf61ae362e882ddc0167474a7a77f3a\r
+TEST= 325\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffe00000000000000000\r
+CT=   330d8ee7c5677e099ac74c9994ee4cfb\r
+TEST= 326\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffffc00000000000000000\r
+CT=   2cacf728b88abbad7011ed0e64a1680c\r
+TEST= 327\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffff800000000000000000\r
+CT=   db826251e4ce384b80218b0e1da1dd4c\r
+TEST= 328\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffff000000000000000000\r
+CT=   0ddfe51ced7e3f4ae927daa3fe452cee\r
+TEST= 329\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffe000000000000000000\r
+CT=   98551da1a6503276ae1c77625f9ea615\r
+TEST= 330\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffffc000000000000000000\r
+CT=   72bc65aa8e89562e3f274d45af1cd10b\r
+TEST= 331\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffff8000000000000000000\r
+CT=   4570a5a18cfc0dd582f1d88d5c9a1720\r
+TEST= 332\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000\r
+CT=   6629d2b8df97da728cdd8b1e7f945077\r
+TEST= 333\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000\r
+CT=   ca6e8893a114ae8e27d5ab03a5499610\r
+TEST= 334\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffffc0000000000000000000\r
+CT=   db91a38855c8c4643851fbfb358b0109\r
+TEST= 335\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffff80000000000000000000\r
+CT=   bcc65b526f88d05b89ce8a52021fdb06\r
+TEST= 336\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffff00000000000000000000\r
+CT=   ca359c70803a3b2a3d542e8781dea975\r
+TEST= 337\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffe00000000000000000000\r
+CT=   c33bc13e8de88ac25232aa7496398783\r
+TEST= 338\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffffc00000000000000000000\r
+CT=   10dffb05904bff7c4781df780ad26837\r
+TEST= 339\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffff800000000000000000000\r
+CT=   ede447b362c484993dec9442a3b46aef\r
+TEST= 340\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffff000000000000000000000\r
+CT=   fdd9bbb4a7dc2e4a23536a5880a2db67\r
+TEST= 341\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffe000000000000000000000\r
+CT=   ca0bf42cb107f55ccff2fc09ee08ca15\r
+TEST= 342\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffffc000000000000000000000\r
+CT=   cb5a408657837c53bf16f9d8465dce19\r
+TEST= 343\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffff8000000000000000000000\r
+CT=   cfd1875523f3cd21c395651e6ee15e56\r
+TEST= 344\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffff0000000000000000000000\r
+CT=   be288319029363c2622feba4b05dfdfe\r
+TEST= 345\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffe0000000000000000000000\r
+CT=   cc1445ee94c0f08cdee5c344ecd1e233\r
+TEST= 346\r
+KEY=  fffffffffffffffffffffffffffffffffffffffffc0000000000000000000000\r
+CT=   866b5b3977ba6efa5128efbda9ff03cd\r
+TEST= 347\r
+KEY=  fffffffffffffffffffffffffffffffffffffffff80000000000000000000000\r
+CT=   332eee1a0cbd19ca2d69b426894044f0\r
+TEST= 348\r
+KEY=  fffffffffffffffffffffffffffffffffffffffff00000000000000000000000\r
+CT=   347846b2b2e36f1f0324c86f7f1b98e2\r
+TEST= 349\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffe00000000000000000000000\r
+CT=   11c5413904487a805d70a8edd9c35527\r
+TEST= 350\r
+KEY=  ffffffffffffffffffffffffffffffffffffffffc00000000000000000000000\r
+CT=   feec7ce6a6cbd07c043416737f1bbb33\r
+TEST= 351\r
+KEY=  ffffffffffffffffffffffffffffffffffffffff800000000000000000000000\r
+CT=   4960757ec6ce68cf195e454cfd0f32ca\r
+TEST= 352\r
+KEY=  ffffffffffffffffffffffffffffffffffffffff000000000000000000000000\r
+CT=   93201481665cbafc1fcc220bc545fb3d\r
+TEST= 353\r
+KEY=  fffffffffffffffffffffffffffffffffffffffe000000000000000000000000\r
+CT=   c102e38e489aa74762f3efc5bb23205a\r
+TEST= 354\r
+KEY=  fffffffffffffffffffffffffffffffffffffffc000000000000000000000000\r
+CT=   c93bbdc07a4611ae4bb266ea5034a387\r
+TEST= 355\r
+KEY=  fffffffffffffffffffffffffffffffffffffff8000000000000000000000000\r
+CT=   8c791d5fdddf470da04f3e6dc4a5b5b5\r
+TEST= 356\r
+KEY=  fffffffffffffffffffffffffffffffffffffff0000000000000000000000000\r
+CT=   fcfefb534100796eebbd990206754e19\r
+TEST= 357\r
+KEY=  ffffffffffffffffffffffffffffffffffffffe0000000000000000000000000\r
+CT=   6cae8129f843d86dc786a0fb1a184970\r
+TEST= 358\r
+KEY=  ffffffffffffffffffffffffffffffffffffffc0000000000000000000000000\r
+CT=   ba77413dea5925b7f5417ea47ff19f59\r
+TEST= 359\r
+KEY=  ffffffffffffffffffffffffffffffffffffff80000000000000000000000000\r
+CT=   72c9e4646dbc3d6320fc6689d93e8833\r
+TEST= 360\r
+KEY=  ffffffffffffffffffffffffffffffffffffff00000000000000000000000000\r
+CT=   33905080f7acf1cdae0a91fc3e85aee4\r
+TEST= 361\r
+KEY=  fffffffffffffffffffffffffffffffffffffe00000000000000000000000000\r
+CT=   59836a0e06a79691b36667d5380d8188\r
+TEST= 362\r
+KEY=  fffffffffffffffffffffffffffffffffffffc00000000000000000000000000\r
+CT=   238aca23fd3409f38af63378ed2f5473\r
+TEST= 363\r
+KEY=  fffffffffffffffffffffffffffffffffffff800000000000000000000000000\r
+CT=   ca352df025c65c7b0bf306fbee0f36ba\r
+TEST= 364\r
+KEY=  fffffffffffffffffffffffffffffffffffff000000000000000000000000000\r
+CT=   d9a4c7618b0ce48a3d5aee1a1c0114c4\r
+TEST= 365\r
+KEY=  ffffffffffffffffffffffffffffffffffffe000000000000000000000000000\r
+CT=   dcf4e129136c1a4b7a0f38935cc34b2b\r
+TEST= 366\r
+KEY=  ffffffffffffffffffffffffffffffffffffc000000000000000000000000000\r
+CT=   b4da5df4becb5462e03a0ed00d295629\r
+TEST= 367\r
+KEY=  ffffffffffffffffffffffffffffffffffff8000000000000000000000000000\r
+CT=   45d089c36d5c5a4efc689e3b0de10dd5\r
+TEST= 368\r
+KEY=  ffffffffffffffffffffffffffffffffffff0000000000000000000000000000\r
+CT=   d240d648ce21a3020282c3f1b528a0b6\r
+TEST= 369\r
+KEY=  fffffffffffffffffffffffffffffffffffe0000000000000000000000000000\r
+CT=   5d942b7f4622ce056c3ce3ce5f1dd9d6\r
+TEST= 370\r
+KEY=  fffffffffffffffffffffffffffffffffffc0000000000000000000000000000\r
+CT=   cac8e414c2f388227ae14986fc983524\r
+TEST= 371\r
+KEY=  fffffffffffffffffffffffffffffffffff80000000000000000000000000000\r
+CT=   a9eec03c8abec7ba68315c2c8c2316e0\r
+TEST= 372\r
+KEY=  fffffffffffffffffffffffffffffffffff00000000000000000000000000000\r
+CT=   7c85e9c95de1a9ec5a5363a8a053472d\r
+TEST= 373\r
+KEY=  ffffffffffffffffffffffffffffffffffe00000000000000000000000000000\r
+CT=   3967a10cffe27d0178545fbf6a40544b\r
+TEST= 374\r
+KEY=  ffffffffffffffffffffffffffffffffffc00000000000000000000000000000\r
+CT=   c64c24b6894b038b3c0d09b1df068b0b\r
+TEST= 375\r
+KEY=  ffffffffffffffffffffffffffffffffff800000000000000000000000000000\r
+CT=   bf8115805471741bd5ad20a03944790f\r
+TEST= 376\r
+KEY=  ffffffffffffffffffffffffffffffffff000000000000000000000000000000\r
+CT=   ef1b384ac4d93eda00c92add0995ea5f\r
+TEST= 377\r
+KEY=  fffffffffffffffffffffffffffffffffe000000000000000000000000000000\r
+CT=   6c5d03b13069c3658b3179be91b0800c\r
+TEST= 378\r
+KEY=  fffffffffffffffffffffffffffffffffc000000000000000000000000000000\r
+CT=   8680db7f3a87b8605543cfdbe6754076\r
+TEST= 379\r
+KEY=  fffffffffffffffffffffffffffffffff8000000000000000000000000000000\r
+CT=   6e668856539ad8e405bd123fe6c88530\r
+TEST= 380\r
+KEY=  fffffffffffffffffffffffffffffffff0000000000000000000000000000000\r
+CT=   c3498f7eced2095314fc28115885b33f\r
+TEST= 381\r
+KEY=  ffffffffffffffffffffffffffffffffe0000000000000000000000000000000\r
+CT=   5d454b75021d76d4b84f873a8f877b92\r
+TEST= 382\r
+KEY=  ffffffffffffffffffffffffffffffffc0000000000000000000000000000000\r
+CT=   d836b44bb29e0c7d89fa4b2d4b677d2a\r
+TEST= 383\r
+KEY=  ffffffffffffffffffffffffffffffff80000000000000000000000000000000\r
+CT=   e3714e94a5778955cc0346358e94783a\r
+TEST= 384\r
+KEY=  ffffffffffffffffffffffffffffffff00000000000000000000000000000000\r
+CT=   6825a347ac479d4f9d95c5cb8d3fd7e9\r
+TEST= 385\r
+KEY=  fffffffffffffffffffffffffffffffe00000000000000000000000000000000\r
+CT=   b5f71d4dd9a71fe5d8bc8ba7e6ea3048\r
+TEST= 386\r
+KEY=  fffffffffffffffffffffffffffffffc00000000000000000000000000000000\r
+CT=   d62068444578e3ab39ce7ec95dd045dc\r
+TEST= 387\r
+KEY=  fffffffffffffffffffffffffffffff800000000000000000000000000000000\r
+CT=   27eefa80ce6a4a9d598e3fec365434d2\r
+TEST= 388\r
+KEY=  fffffffffffffffffffffffffffffff000000000000000000000000000000000\r
+CT=   86f93d9ec08453a071e2e2877877a9c8\r
+TEST= 389\r
+KEY=  ffffffffffffffffffffffffffffffe000000000000000000000000000000000\r
+CT=   9661cb2424d7d4a380d547f9e7ec1cb9\r
+TEST= 390\r
+KEY=  ffffffffffffffffffffffffffffffc000000000000000000000000000000000\r
+CT=   8193c6ff85225ced4255e92f6e078a14\r
+TEST= 391\r
+KEY=  ffffffffffffffffffffffffffffff8000000000000000000000000000000000\r
+CT=   a866bc65b6941d86e8420a7ffb0964db\r
+TEST= 392\r
+KEY=  ffffffffffffffffffffffffffffff0000000000000000000000000000000000\r
+CT=   190843d29b25a3897c692ce1dd81ee52\r
+TEST= 393\r
+KEY=  fffffffffffffffffffffffffffffe0000000000000000000000000000000000\r
+CT=   f1f1c5a40899e15772857ccb65c7a09a\r
+TEST= 394\r
+KEY=  fffffffffffffffffffffffffffffc0000000000000000000000000000000000\r
+CT=   3a90c62d88b5c42809abf782488ed130\r
+TEST= 395\r
+KEY=  fffffffffffffffffffffffffffff80000000000000000000000000000000000\r
+CT=   9aaec4fabbf6fae2a71feff02e372b39\r
+TEST= 396\r
+KEY=  fffffffffffffffffffffffffffff00000000000000000000000000000000000\r
+CT=   10617d28b5e0f4605492b182a5d7f9f6\r
+TEST= 397\r
+KEY=  ffffffffffffffffffffffffffffe00000000000000000000000000000000000\r
+CT=   87f53bf620d3677268445212904389d5\r
+TEST= 398\r
+KEY=  ffffffffffffffffffffffffffffc00000000000000000000000000000000000\r
+CT=   ba26d47da3aeb028de4fb5b3a854a24b\r
+TEST= 399\r
+KEY=  ffffffffffffffffffffffffffff800000000000000000000000000000000000\r
+CT=   3b6f46f40e0ac5fc0a9c1105f800f48d\r
+TEST= 400\r
+KEY=  ffffffffffffffffffffffffffff000000000000000000000000000000000000\r
+CT=   cd5ece55b8da3bf622c4100df5de46f9\r
+TEST= 401\r
+KEY=  fffffffffffffffffffffffffffe000000000000000000000000000000000000\r
+CT=   6c839dd58eeae6b8a36af48ed63d2dc9\r
+TEST= 402\r
+KEY=  fffffffffffffffffffffffffffc000000000000000000000000000000000000\r
+CT=   ce61d63514aded03d43e6ebfc3a9001f\r
+TEST= 403\r
+KEY=  fffffffffffffffffffffffffff8000000000000000000000000000000000000\r
+CT=   84a83d7b94c699cbcb8a7d9b61f64093\r
+TEST= 404\r
+KEY=  fffffffffffffffffffffffffff0000000000000000000000000000000000000\r
+CT=   972bdd2e7c525130fadc8f76fc6f4b3f\r
+TEST= 405\r
+KEY=  ffffffffffffffffffffffffffe0000000000000000000000000000000000000\r
+CT=   e3abc4939457422bb957da3c56938c6d\r
+TEST= 406\r
+KEY=  ffffffffffffffffffffffffffc0000000000000000000000000000000000000\r
+CT=   a42734a3929bf84cf0116c9856a3c18c\r
+TEST= 407\r
+KEY=  ffffffffffffffffffffffffff80000000000000000000000000000000000000\r
+CT=   3d20253adbce3be2373767c4d822c566\r
+TEST= 408\r
+KEY=  ffffffffffffffffffffffffff00000000000000000000000000000000000000\r
+CT=   33f7502390b8a4a221cfecd0666624ba\r
+TEST= 409\r
+KEY=  fffffffffffffffffffffffffe00000000000000000000000000000000000000\r
+CT=   b588a302bdbc09197df1edae68926ed9\r
+TEST= 410\r
+KEY=  fffffffffffffffffffffffffc00000000000000000000000000000000000000\r
+CT=   8d4595cb4fa7026715f55bd68e2882f9\r
+TEST= 411\r
+KEY=  fffffffffffffffffffffffff800000000000000000000000000000000000000\r
+CT=   40b264e921e9e4a82694589ef3798262\r
+TEST= 412\r
+KEY=  fffffffffffffffffffffffff000000000000000000000000000000000000000\r
+CT=   112078e9e11fbb78e26ffb8899e96b9a\r
+TEST= 413\r
+KEY=  ffffffffffffffffffffffffe000000000000000000000000000000000000000\r
+CT=   7606fa36d86473e6fb3a1bb0e2c0adf5\r
+TEST= 414\r
+KEY=  ffffffffffffffffffffffffc000000000000000000000000000000000000000\r
+CT=   6693dc911662ae473216ba22189a511a\r
+TEST= 415\r
+KEY=  ffffffffffffffffffffffff8000000000000000000000000000000000000000\r
+CT=   266581af0dcfbed1585e0a242c64b8df\r
+TEST= 416\r
+KEY=  ffffffffffffffffffffffff0000000000000000000000000000000000000000\r
+CT=   0aeede5b91f721700e9e62edbf60b781\r
+TEST= 417\r
+KEY=  fffffffffffffffffffffffe0000000000000000000000000000000000000000\r
+CT=   15c6becf0f4cec7129cbd22d1a79b1b8\r
+TEST= 418\r
+KEY=  fffffffffffffffffffffffc0000000000000000000000000000000000000000\r
+CT=   0ebd7c30ed2016e08ba806ddb008bcc8\r
+TEST= 419\r
+KEY=  fffffffffffffffffffffff80000000000000000000000000000000000000000\r
+CT=   40071eeab3f935dbc25d00841460260f\r
+TEST= 420\r
+KEY=  fffffffffffffffffffffff00000000000000000000000000000000000000000\r
+CT=   04bc3da2179c3015498b0e03910db5b8\r
+TEST= 421\r
+KEY=  ffffffffffffffffffffffe00000000000000000000000000000000000000000\r
+CT=   a858411ffbe63fdb9c8aa1bfaed67b52\r
+TEST= 422\r
+KEY=  ffffffffffffffffffffffc00000000000000000000000000000000000000000\r
+CT=   684c9efc237e4a442965f84bce20247a\r
+TEST= 423\r
+KEY=  ffffffffffffffffffffff800000000000000000000000000000000000000000\r
+CT=   dcca366a9bf47b7b868b77e25c18a364\r
+TEST= 424\r
+KEY=  ffffffffffffffffffffff000000000000000000000000000000000000000000\r
+CT=   0791823a3c666bb6162825e78606a7fe\r
+TEST= 425\r
+KEY=  fffffffffffffffffffffe000000000000000000000000000000000000000000\r
+CT=   e68ad5055a367041fade09d9a70a794b\r
+TEST= 426\r
+KEY=  fffffffffffffffffffffc000000000000000000000000000000000000000000\r
+CT=   e86f7e23e835e114977f60e1a592202e\r
+TEST= 427\r
+KEY=  fffffffffffffffffffff8000000000000000000000000000000000000000000\r
+CT=   ab0c8410aeeead92feec1eb430d652cb\r
+TEST= 428\r
+KEY=  fffffffffffffffffffff0000000000000000000000000000000000000000000\r
+CT=   4e6e627c1acc51340053a8236d579576\r
+TEST= 429\r
+KEY=  ffffffffffffffffffffe0000000000000000000000000000000000000000000\r
+CT=   2e16873e1678610d7e14c02d002ea845\r
+TEST= 430\r
+KEY=  ffffffffffffffffffffc0000000000000000000000000000000000000000000\r
+CT=   ad4916f5ee5772be764fc027b8a6e539\r
+TEST= 431\r
+KEY=  ffffffffffffffffffff80000000000000000000000000000000000000000000\r
+CT=   fdcfac0c02ca538343c68117e0a15938\r
+TEST= 432\r
+KEY=  ffffffffffffffffffff00000000000000000000000000000000000000000000\r
+CT=   f33fa36720231afe4c759ade6bd62eb6\r
+TEST= 433\r
+KEY=  fffffffffffffffffffe00000000000000000000000000000000000000000000\r
+CT=   f97d57b3333b6281b07d486db2d4e20c\r
+TEST= 434\r
+KEY=  fffffffffffffffffffc00000000000000000000000000000000000000000000\r
+CT=   ab980296197e1a5022326c31da4bf6f3\r
+TEST= 435\r
+KEY=  fffffffffffffffffff800000000000000000000000000000000000000000000\r
+CT=   a4af534a7d0b643a01868785d86dfb95\r
+TEST= 436\r
+KEY=  fffffffffffffffffff000000000000000000000000000000000000000000000\r
+CT=   462ccd7f5fd1108dbc152f3cacad328b\r
+TEST= 437\r
+KEY=  ffffffffffffffffffe000000000000000000000000000000000000000000000\r
+CT=   2e70f168fc74bf911df240bcd2cef236\r
+TEST= 438\r
+KEY=  ffffffffffffffffffc000000000000000000000000000000000000000000000\r
+CT=   9f0fdec08b7fd79aa39535bea42db92a\r
+TEST= 439\r
+KEY=  ffffffffffffffffff8000000000000000000000000000000000000000000000\r
+CT=   eb040b891d4b37f6851f7ec219cd3f6d\r
+TEST= 440\r
+KEY=  ffffffffffffffffff0000000000000000000000000000000000000000000000\r
+CT=   4b3b9f1e099c2a09dc091e90e4f18f0a\r
+TEST= 441\r
+KEY=  fffffffffffffffffe0000000000000000000000000000000000000000000000\r
+CT=   97120166307119ca2280e9315668e96f\r
+TEST= 442\r
+KEY=  fffffffffffffffffc0000000000000000000000000000000000000000000000\r
+CT=   c20a19fd5758b0c4bc1a5df89cf73877\r
+TEST= 443\r
+KEY=  fffffffffffffffff80000000000000000000000000000000000000000000000\r
+CT=   9ff071b165b5198a93dddeebc54d09b5\r
+TEST= 444\r
+KEY=  fffffffffffffffff00000000000000000000000000000000000000000000000\r
+CT=   f51a0f694442b8f05571797fec7ee8bf\r
+TEST= 445\r
+KEY=  ffffffffffffffffe00000000000000000000000000000000000000000000000\r
+CT=   597a6252255e46d6364dbeeda31e279c\r
+TEST= 446\r
+KEY=  ffffffffffffffffc00000000000000000000000000000000000000000000000\r
+CT=   e0f0a91b2e45f8cc37b7805a3042588d\r
+TEST= 447\r
+KEY=  ffffffffffffffff800000000000000000000000000000000000000000000000\r
+CT=   8f8fd822680a85974e53a5a8eb9d38de\r
+TEST= 448\r
+KEY=  ffffffffffffffff000000000000000000000000000000000000000000000000\r
+CT=   94efe7a0e2e031e2536da01df799c927\r
+TEST= 449\r
+KEY=  fffffffffffffffe000000000000000000000000000000000000000000000000\r
+CT=   d276c13a5d220f4da9224e74896391ce\r
+TEST= 450\r
+KEY=  fffffffffffffffc000000000000000000000000000000000000000000000000\r
+CT=   ffb4e87a32b37d6f2c8328d3b5377802\r
+TEST= 451\r
+KEY=  fffffffffffffff8000000000000000000000000000000000000000000000000\r
+CT=   f8b9fffb5c187f7ddc7ab10f4fb77576\r
+TEST= 452\r
+KEY=  fffffffffffffff0000000000000000000000000000000000000000000000000\r
+CT=   11825f99b0e9bb3477c1c0713b015aac\r
+TEST= 453\r
+KEY=  ffffffffffffffe0000000000000000000000000000000000000000000000000\r
+CT=   d8c4b200b383fc1f2b2ea677618a1d27\r
+TEST= 454\r
+KEY=  ffffffffffffffc0000000000000000000000000000000000000000000000000\r
+CT=   3e0cdadf2e68353c0027672c97144dd3\r
+TEST= 455\r
+KEY=  ffffffffffffff80000000000000000000000000000000000000000000000000\r
+CT=   092fa137ce18b5dfe7906f550bb13370\r
+TEST= 456\r
+KEY=  ffffffffffffff00000000000000000000000000000000000000000000000000\r
+CT=   4c022ac62b3cb78d739cc67b3e20bb7e\r
+TEST= 457\r
+KEY=  fffffffffffffe00000000000000000000000000000000000000000000000000\r
+CT=   77dd7702646d55f08365e477d3590eda\r
+TEST= 458\r
+KEY=  fffffffffffffc00000000000000000000000000000000000000000000000000\r
+CT=   31690b5ed41c7eb42a1e83270a7ff0e6\r
+TEST= 459\r
+KEY=  fffffffffffff800000000000000000000000000000000000000000000000000\r
+CT=   3f84566df23da48af692722fe980573a\r
+TEST= 460\r
+KEY=  fffffffffffff000000000000000000000000000000000000000000000000000\r
+CT=   8aa9b75e784593876c53a00eae5af52b\r
+TEST= 461\r
+KEY=  ffffffffffffe000000000000000000000000000000000000000000000000000\r
+CT=   a78463fb064db5d52bb64bfef64f2dda\r
+TEST= 462\r
+KEY=  ffffffffffffc000000000000000000000000000000000000000000000000000\r
+CT=   5e031cb9d676c3022d7f26227e85c38f\r
+TEST= 463\r
+KEY=  ffffffffffff8000000000000000000000000000000000000000000000000000\r
+CT=   ae682c5ecd71898e08942ac9aa89875c\r
+TEST= 464\r
+KEY=  ffffffffffff0000000000000000000000000000000000000000000000000000\r
+CT=   225f068c28476605735ad671bb8f39f3\r
+TEST= 465\r
+KEY=  fffffffffffe0000000000000000000000000000000000000000000000000000\r
+CT=   2937a64f7d4f46fe6fea3b349ec78e38\r
+TEST= 466\r
+KEY=  fffffffffffc0000000000000000000000000000000000000000000000000000\r
+CT=   82bda118a3ed7af314fa2ccc5c07b761\r
+TEST= 467\r
+KEY=  fffffffffff80000000000000000000000000000000000000000000000000000\r
+CT=   3dd5c34634a79d3cfcc8339760e6f5f4\r
+TEST= 468\r
+KEY=  fffffffffff00000000000000000000000000000000000000000000000000000\r
+CT=   3c9db3335306fe1ec612bdbfae6b6028\r
+TEST= 469\r
+KEY=  ffffffffffe00000000000000000000000000000000000000000000000000000\r
+CT=   b5bb0f5629fb6aae5e1839a3c3625d63\r
+TEST= 470\r
+KEY=  ffffffffffc00000000000000000000000000000000000000000000000000000\r
+CT=   df31144f87a2ef523facdcf21a427804\r
+TEST= 471\r
+KEY=  ffffffffff800000000000000000000000000000000000000000000000000000\r
+CT=   be66cfea2fecd6bf0ec7b4352c99bcaa\r
+TEST= 472\r
+KEY=  ffffffffff000000000000000000000000000000000000000000000000000000\r
+CT=   e0dcc2d27fc9865633f85223cf0d611f\r
+TEST= 473\r
+KEY=  fffffffffe000000000000000000000000000000000000000000000000000000\r
+CT=   077e9470ae7abea5a9769d49182628c3\r
+TEST= 474\r
+KEY=  fffffffffc000000000000000000000000000000000000000000000000000000\r
+CT=   f836f251ad1d11d49dc344628b1884e1\r
+TEST= 475\r
+KEY=  fffffffff8000000000000000000000000000000000000000000000000000000\r
+CT=   f2b21b4e7640a9b3346de8b82fb41e49\r
+TEST= 476\r
+KEY=  fffffffff0000000000000000000000000000000000000000000000000000000\r
+CT=   6f6238d8966048d4967154e0dad5a6c9\r
+TEST= 477\r
+KEY=  ffffffffe0000000000000000000000000000000000000000000000000000000\r
+CT=   f85ca05fe528f1ce9b790166e8d551e7\r
+TEST= 478\r
+KEY=  ffffffffc0000000000000000000000000000000000000000000000000000000\r
+CT=   2025c74b8ad8f4cda17ee2049c4c902d\r
+TEST= 479\r
+KEY=  ffffffff80000000000000000000000000000000000000000000000000000000\r
+CT=   33ac9eccc4cc75e2711618f80b1548e8\r
+TEST= 480\r
+KEY=  ffffffff00000000000000000000000000000000000000000000000000000000\r
+CT=   ad9fc613a703251b54c64a0e76431711\r
+TEST= 481\r
+KEY=  fffffffe00000000000000000000000000000000000000000000000000000000\r
+CT=   829fd7208fb92d44a074a677ee9861ac\r
+TEST= 482\r
+KEY=  fffffffc00000000000000000000000000000000000000000000000000000000\r
+CT=   fc4af7c948df26e2ef3e01c1ee5b8f6f\r
+TEST= 483\r
+KEY=  fffffff800000000000000000000000000000000000000000000000000000000\r
+CT=   5fd1f13fa0f31e37fabde328f894eac2\r
+TEST= 484\r
+KEY=  fffffff000000000000000000000000000000000000000000000000000000000\r
+CT=   07058e408f5b99b0e0f061a1761b5b3b\r
+TEST= 485\r
+KEY=  ffffffe000000000000000000000000000000000000000000000000000000000\r
+CT=   bbd1097a62433f79449fa97d4ee80dbf\r
+TEST= 486\r
+KEY=  ffffffc000000000000000000000000000000000000000000000000000000000\r
+CT=   a190527d0ef7c70f459cd3940df316ec\r
+TEST= 487\r
+KEY=  ffffff8000000000000000000000000000000000000000000000000000000000\r
+CT=   bd49295006250ffca5100b6007a0eade\r
+TEST= 488\r
+KEY=  ffffff0000000000000000000000000000000000000000000000000000000000\r
+CT=   2c75e2d36eebd65411f14fd0eb1d2a06\r
+TEST= 489\r
+KEY=  fffffe0000000000000000000000000000000000000000000000000000000000\r
+CT=   6bcca98bf6a835fa64955f72de4115fe\r
+TEST= 490\r
+KEY=  fffffc0000000000000000000000000000000000000000000000000000000000\r
+CT=   85f2ba84f8c307cf525e124c3e22e6cc\r
+TEST= 491\r
+KEY=  fffff80000000000000000000000000000000000000000000000000000000000\r
+CT=   976e6f851ab52c771998dbb2d71c75a9\r
+TEST= 492\r
+KEY=  fffff00000000000000000000000000000000000000000000000000000000000\r
+CT=   6e1b482b53761cf631819b749a6f3724\r
+TEST= 493\r
+KEY=  ffffe00000000000000000000000000000000000000000000000000000000000\r
+CT=   633cafea395bc03adae3a1e2068e4b4e\r
+TEST= 494\r
+KEY=  ffffc00000000000000000000000000000000000000000000000000000000000\r
+CT=   27ef2495dabf323885aab39c80f18d8b\r
+TEST= 495\r
+KEY=  ffff800000000000000000000000000000000000000000000000000000000000\r
+CT=   610b71dfc688e150d8152c5b35ebc14d\r
+TEST= 496\r
+KEY=  ffff000000000000000000000000000000000000000000000000000000000000\r
+CT=   937ad84880db50613423d6d527a2823d\r
+TEST= 497\r
+KEY=  fffe000000000000000000000000000000000000000000000000000000000000\r
+CT=   1a4c1c263bbccfafc11782894685e3a8\r
+TEST= 498\r
+KEY=  fffc000000000000000000000000000000000000000000000000000000000000\r
+CT=   4dcede8da9e2578f39703d4433dc6459\r
+TEST= 499\r
+KEY=  fff8000000000000000000000000000000000000000000000000000000000000\r
+CT=   dc43b51ab609052372989a26e9cdd714\r
+TEST= 500\r
+KEY=  fff0000000000000000000000000000000000000000000000000000000000000\r
+CT=   cc111f6c37cf40a1159d00fb59fb0488\r
+TEST= 501\r
+KEY=  ffe0000000000000000000000000000000000000000000000000000000000000\r
+CT=   d1ccb9b1337002cbac42c520b5d67722\r
+TEST= 502\r
+KEY=  ffc0000000000000000000000000000000000000000000000000000000000000\r
+CT=   a3f599d63a82a968c33fe26590745970\r
+TEST= 503\r
+KEY=  ff80000000000000000000000000000000000000000000000000000000000000\r
+CT=   f23e5b600eb70dbccf6c0b1d9a68182c\r
+TEST= 504\r
+KEY=  ff00000000000000000000000000000000000000000000000000000000000000\r
+CT=   ec52a212f80a09df6317021bc2a9819e\r
+TEST= 505\r
+KEY=  fe00000000000000000000000000000000000000000000000000000000000000\r
+CT=   60e32246bed2b0e859e55c1cc6b26502\r
+TEST= 506\r
+KEY=  fc00000000000000000000000000000000000000000000000000000000000000\r
+CT=   8fbb413703735326310a269bd3aa94b2\r
+TEST= 507\r
+KEY=  f800000000000000000000000000000000000000000000000000000000000000\r
+CT=   9cf4893ecafa0a0247a898e040691559\r
+TEST= 508\r
+KEY=  f000000000000000000000000000000000000000000000000000000000000000\r
+CT=   1c777679d50037c79491a94da76a9a35\r
+TEST= 509\r
+KEY=  e000000000000000000000000000000000000000000000000000000000000000\r
+CT=   d8f3a72fc3cdf74dfaf6c3e6b97b2fa6\r
+TEST= 510\r
+KEY=  c000000000000000000000000000000000000000000000000000000000000000\r
+CT=   b29169cdcf2d83e838125a12ee6aa400\r
+TEST= 511\r
+KEY=  8000000000000000000000000000000000000000000000000000000000000000\r
+CT=   e35a6dcb19b201a01ebcfa8aa22b5759\r
diff --git a/test/dfregress/testcases/crypto/aes/ecbnt44.txt b/test/dfregress/testcases/crypto/aes/ecbnt44.txt
new file mode 100644 (file)
index 0000000..0887804
--- /dev/null
@@ -0,0 +1,779 @@
+==============================================\r
+Author:    Dr B R Gladman (                 )\r
+Test:      ECB Variable Text Known Answer Tests\r
+Algorithm: Extended Rijndael (an AES Superset)\r
+Filename:  ecbnt44.txt\r
+==============================================\r
+\r
+BLOCKSIZE=128\r
+KEYSIZE=  128\r
+\r
+KEY=  00000000000000000000000000000000\r
+TEST= 0\r
+PT=   00000000000000000000000000000000\r
+CT=   66e94bd4ef8a2c3b884cfa59ca342b2e\r
+TEST= 1\r
+PT=   00000000000000000000000000000001\r
+CT=   58e2fccefa7e3061367f1d57a4e7455a\r
+TEST= 2\r
+PT=   00000000000000000000000000000003\r
+CT=   f795aaab494b5923f7fd89ff948bc1e0\r
+TEST= 3\r
+PT=   00000000000000000000000000000007\r
+CT=   95b84d1b96c690ff2f2de30bf2ec89e0\r
+TEST= 4\r
+PT=   0000000000000000000000000000000f\r
+CT=   a73f8d0437e0915fbce5d7a62d8dab0a\r
+TEST= 5\r
+PT=   0000000000000000000000000000001f\r
+CT=   7941dd0a63d994703e63d94a44680421\r
+TEST= 6\r
+PT=   0000000000000000000000000000003f\r
+CT=   5bca68deb6b692377c85f6515d2a33e1\r
+TEST= 7\r
+PT=   0000000000000000000000000000007f\r
+CT=   349bf2ed99e8726cb1734349e5c5499a\r
+TEST= 8\r
+PT=   000000000000000000000000000000ff\r
+CT=   f70ddef93ba62588242a0e67d0d645e0\r
+TEST= 9\r
+PT=   000000000000000000000000000001ff\r
+CT=   cf7512278cd5454f819d89ea35bb3862\r
+TEST= 10\r
+PT=   000000000000000000000000000003ff\r
+CT=   09836c44648b1f262e7b8bb6310e3c73\r
+TEST= 11\r
+PT=   000000000000000000000000000007ff\r
+CT=   7c3f20d829a78c00203702ef0b002db5\r
+TEST= 12\r
+PT=   00000000000000000000000000000fff\r
+CT=   5b1243b00f14e74eb7536ccc09acfa68\r
+TEST= 13\r
+PT=   00000000000000000000000000001fff\r
+CT=   b3b90648b4f40f576a75ba0466db8863\r
+TEST= 14\r
+PT=   00000000000000000000000000003fff\r
+CT=   e4ee13764d015d68bf37d51f4af9f36b\r
+TEST= 15\r
+PT=   00000000000000000000000000007fff\r
+CT=   9f3bdc3ff6446ce6aa8e3b6c231596a3\r
+TEST= 16\r
+PT=   0000000000000000000000000000ffff\r
+CT=   90d4af3471b958d79c38285110dfb453\r
+TEST= 17\r
+PT=   0000000000000000000000000001ffff\r
+CT=   ca829c5f3dc854939ddf3f0a4f852aed\r
+TEST= 18\r
+PT=   0000000000000000000000000003ffff\r
+CT=   28ea70f964ef188472078e5fadbf243c\r
+TEST= 19\r
+PT=   0000000000000000000000000007ffff\r
+CT=   d1277ea8d373b8f80bec4923227435c4\r
+TEST= 20\r
+PT=   000000000000000000000000000fffff\r
+CT=   2bcafbb6ce709c19be131bb8386bdd3b\r
+TEST= 21\r
+PT=   000000000000000000000000001fffff\r
+CT=   39fa40456ae73fe146de3e3a42039405\r
+TEST= 22\r
+PT=   000000000000000000000000003fffff\r
+CT=   baec66484967417c3bbe18a60de0b093\r
+TEST= 23\r
+PT=   000000000000000000000000007fffff\r
+CT=   6796a439bb4a1a0745ed78ec8dea15c7\r
+TEST= 24\r
+PT=   00000000000000000000000000ffffff\r
+CT=   6936f9fd2274b4a36463e329719b0174\r
+TEST= 25\r
+PT=   00000000000000000000000001ffffff\r
+CT=   86290a5586bca091a762c5ff509a6167\r
+TEST= 26\r
+PT=   00000000000000000000000003ffffff\r
+CT=   78e6abea95914abb9c8e526aafc09bc6\r
+TEST= 27\r
+PT=   00000000000000000000000007ffffff\r
+CT=   983346ddc59459db4e6e2e8d5b2ac4ca\r
+TEST= 28\r
+PT=   0000000000000000000000000fffffff\r
+CT=   5d8f73bd76f371deaa46e98e7764ea8f\r
+TEST= 29\r
+PT=   0000000000000000000000001fffffff\r
+CT=   78eb3f556196e8efb02b6b1ac9c59fb2\r
+TEST= 30\r
+PT=   0000000000000000000000003fffffff\r
+CT=   0e5eeb2e621ec0f45683a8d255dda84e\r
+TEST= 31\r
+PT=   0000000000000000000000007fffffff\r
+CT=   6c5746dd45b5846c6096ca8e8ade7f25\r
+TEST= 32\r
+PT=   000000000000000000000000ffffffff\r
+CT=   28c16380c491088ca019f8a76853b1e8\r
+TEST= 33\r
+PT=   000000000000000000000001ffffffff\r
+CT=   c8b1afa8bfd9415b3c4764fc2301a445\r
+TEST= 34\r
+PT=   000000000000000000000003ffffffff\r
+CT=   8e265ca8740c2dc8f8e8339bb0319d1e\r
+TEST= 35\r
+PT=   000000000000000000000007ffffffff\r
+CT=   4090d032397a3d4564218ac27e6dc4b6\r
+TEST= 36\r
+PT=   00000000000000000000000fffffffff\r
+CT=   6e7b1e7d9dc86adc0e111aa174d7d568\r
+TEST= 37\r
+PT=   00000000000000000000001fffffffff\r
+CT=   cc4632e9ad075584b0dc8816e8f48e9b\r
+TEST= 38\r
+PT=   00000000000000000000003fffffffff\r
+CT=   99afdf4178e53a5de4173159abd8c479\r
+TEST= 39\r
+PT=   00000000000000000000007fffffffff\r
+CT=   fe5f51452842fd38c566ef536f950111\r
+TEST= 40\r
+PT=   0000000000000000000000ffffffffff\r
+CT=   4d4c5f40e67449514e30639299d6f473\r
+TEST= 41\r
+PT=   0000000000000000000001ffffffffff\r
+CT=   9bf52296fbb86ce06b35f0c610b28e5c\r
+TEST= 42\r
+PT=   0000000000000000000003ffffffffff\r
+CT=   8dd5d84df9b637c123d26114071e8799\r
+TEST= 43\r
+PT=   0000000000000000000007ffffffffff\r
+CT=   09fdbba8739d1a9c386d1b74bfb674d2\r
+TEST= 44\r
+PT=   000000000000000000000fffffffffff\r
+CT=   fc2e827596e4c6c4df3e13fdb77db10e\r
+TEST= 45\r
+PT=   000000000000000000001fffffffffff\r
+CT=   0bcf5bde0c7fd3b87fec152a3c7d9a86\r
+TEST= 46\r
+PT=   000000000000000000003fffffffffff\r
+CT=   15ab7d13a564d6bdbd2b337318912a24\r
+TEST= 47\r
+PT=   000000000000000000007fffffffffff\r
+CT=   6f1039adc3f6a546989b1444efb629ab\r
+TEST= 48\r
+PT=   00000000000000000000ffffffffffff\r
+CT=   105df4d1e4b74dca12b3f38c4c3c0d9c\r
+TEST= 49\r
+PT=   00000000000000000001ffffffffffff\r
+CT=   c27ca1f66b72ca93735be563adf2ddda\r
+TEST= 50\r
+PT=   00000000000000000003ffffffffffff\r
+CT=   bc1a8411b68970e6c99bf42e4a40e976\r
+TEST= 51\r
+PT=   00000000000000000007ffffffffffff\r
+CT=   40165c46ef23bc1c167a9ebbb5b166e3\r
+TEST= 52\r
+PT=   0000000000000000000fffffffffffff\r
+CT=   dd9b27fa45374d1c626874d9ca04eb0d\r
+TEST= 53\r
+PT=   0000000000000000001fffffffffffff\r
+CT=   f2373d9f620496925b34e01194336a2f\r
+TEST= 54\r
+PT=   0000000000000000003fffffffffffff\r
+CT=   b1564039bad539f373e4c4a97709a5b4\r
+TEST= 55\r
+PT=   0000000000000000007fffffffffffff\r
+CT=   98dea09dffa792af98ac8d258c710870\r
+TEST= 56\r
+PT=   000000000000000000ffffffffffffff\r
+CT=   9e1cd0f752de544bcc8a838b27a4b955\r
+TEST= 57\r
+PT=   000000000000000001ffffffffffffff\r
+CT=   06d18f8542f0497d53dee00176f93616\r
+TEST= 58\r
+PT=   000000000000000003ffffffffffffff\r
+CT=   690460ac223f65654cc522350d881765\r
+TEST= 59\r
+PT=   000000000000000007ffffffffffffff\r
+CT=   d6680b1c9abc752aba384fe234c7d583\r
+TEST= 60\r
+PT=   00000000000000000fffffffffffffff\r
+CT=   e7be712ee4a90b03e43823035eb0ca93\r
+TEST= 61\r
+PT=   00000000000000001fffffffffffffff\r
+CT=   da82d3f4234d748c8172dc0d17a6e038\r
+TEST= 62\r
+PT=   00000000000000003fffffffffffffff\r
+CT=   236c49b713b1521f5e938b422c030f29\r
+TEST= 63\r
+PT=   00000000000000007fffffffffffffff\r
+CT=   c86bee15e569c0e78171bfa438890264\r
+TEST= 64\r
+PT=   0000000000000000ffffffffffffffff\r
+CT=   747cb9267e59fa9e4e615668db0909bc\r
+TEST= 65\r
+PT=   0000000000000001ffffffffffffffff\r
+CT=   7add10f24e7245863c677d27e9f0fdb8\r
+TEST= 66\r
+PT=   0000000000000003ffffffffffffffff\r
+CT=   72976df6935ec1c943d5759a33ccba84\r
+TEST= 67\r
+PT=   0000000000000007ffffffffffffffff\r
+CT=   5bb3e19d6fce1b695d061941df6e4325\r
+TEST= 68\r
+PT=   000000000000000fffffffffffffffff\r
+CT=   1a0a2db60ce1b3187a65949bfe7985f2\r
+TEST= 69\r
+PT=   000000000000001fffffffffffffffff\r
+CT=   1bf6d1af28331174fa90e13636bc02bf\r
+TEST= 70\r
+PT=   000000000000003fffffffffffffffff\r
+CT=   2140bd0eb8df02b22c05cc3689690530\r
+TEST= 71\r
+PT=   000000000000007fffffffffffffffff\r
+CT=   9aa4c6ea0b7cc9492c7ee12234def1a4\r
+TEST= 72\r
+PT=   00000000000000ffffffffffffffffff\r
+CT=   bc991755a129add0f3feeb8d94edda3d\r
+TEST= 73\r
+PT=   00000000000001ffffffffffffffffff\r
+CT=   e0b6795bdd52dcdc3f6934685bbe326a\r
+TEST= 74\r
+PT=   00000000000003ffffffffffffffffff\r
+CT=   b0c4121e0e63e1d0969ca70b0bfbe8d2\r
+TEST= 75\r
+PT=   00000000000007ffffffffffffffffff\r
+CT=   32ebdad9131b68d3293b55aed87ffa16\r
+TEST= 76\r
+PT=   0000000000000fffffffffffffffffff\r
+CT=   921c10a6f26bb519fe085c8f04c1b668\r
+TEST= 77\r
+PT=   0000000000001fffffffffffffffffff\r
+CT=   58fc8beaae1b73bffe3e4c1614cc1cb7\r
+TEST= 78\r
+PT=   0000000000003fffffffffffffffffff\r
+CT=   41d3699fe17781c4e9ad324fee5113af\r
+TEST= 79\r
+PT=   0000000000007fffffffffffffffffff\r
+CT=   24ab534dbc77d9505d9be59f8655de74\r
+TEST= 80\r
+PT=   000000000000ffffffffffffffffffff\r
+CT=   23a77a7a04e5c3fe927cfc881837b622\r
+TEST= 81\r
+PT=   000000000001ffffffffffffffffffff\r
+CT=   cf85ae385c7ff1344b624a744969cdf4\r
+TEST= 82\r
+PT=   000000000003ffffffffffffffffffff\r
+CT=   c7111db57bb89abb2ebb2c2d5153e14c\r
+TEST= 83\r
+PT=   000000000007ffffffffffffffffffff\r
+CT=   e5df6e02245a0be02383e2bbeba3f5b9\r
+TEST= 84\r
+PT=   00000000000fffffffffffffffffffff\r
+CT=   9721e2f1eae9228362dcb1d8d6d67045\r
+TEST= 85\r
+PT=   00000000001fffffffffffffffffffff\r
+CT=   cfa84b287aa52de3fc37129f39fa826f\r
+TEST= 86\r
+PT=   00000000003fffffffffffffffffffff\r
+CT=   664b7441307ba9e1d8c8ccf93de514d0\r
+TEST= 87\r
+PT=   00000000007fffffffffffffffffffff\r
+CT=   62d0ee00d428cb5dc3d4a2144fe2af6d\r
+TEST= 88\r
+PT=   0000000000ffffffffffffffffffffff\r
+CT=   9d7bc30466c376acd0c8ed9da8cdf8ca\r
+TEST= 89\r
+PT=   0000000001ffffffffffffffffffffff\r
+CT=   c8fe3583c99f400cd252768ff72c79ef\r
+TEST= 90\r
+PT=   0000000003ffffffffffffffffffffff\r
+CT=   1300d6570e1622a42d033f1d60cb3524\r
+TEST= 91\r
+PT=   0000000007ffffffffffffffffffffff\r
+CT=   c4b7500f92605bc25e95f3a55f8e1c01\r
+TEST= 92\r
+PT=   000000000fffffffffffffffffffffff\r
+CT=   6438a0528dc92c6c091a3d6b5915d9d4\r
+TEST= 93\r
+PT=   000000001fffffffffffffffffffffff\r
+CT=   4c3cc0914e2fce6004e275726025ea1d\r
+TEST= 94\r
+PT=   000000003fffffffffffffffffffffff\r
+CT=   e4e5b011312f9b915a1111f3dd5a50cd\r
+TEST= 95\r
+PT=   000000007fffffffffffffffffffffff\r
+CT=   7bb21b447853a94d54b8129b14402a36\r
+TEST= 96\r
+PT=   00000000ffffffffffffffffffffffff\r
+CT=   4282e562f1b2beded056e4c582a278fc\r
+TEST= 97\r
+PT=   00000001ffffffffffffffffffffffff\r
+CT=   242c38975bfbc4eae1123e62d2ecd198\r
+TEST= 98\r
+PT=   00000003ffffffffffffffffffffffff\r
+CT=   12cb3e844dbe4b517c62b20dbf518c89\r
+TEST= 99\r
+PT=   00000007ffffffffffffffffffffffff\r
+CT=   6c6b3bfec90a2011fe4af8f2635ca388\r
+TEST= 100\r
+PT=   0000000fffffffffffffffffffffffff\r
+CT=   c90003b8b8e86ba81c5ab01e417f8c56\r
+TEST= 101\r
+PT=   0000001fffffffffffffffffffffffff\r
+CT=   3b55fde647001591c20b13bad65202a9\r
+TEST= 102\r
+PT=   0000003fffffffffffffffffffffffff\r
+CT=   ec0fa4bcac5b09244326f344cd14e45d\r
+TEST= 103\r
+PT=   0000007fffffffffffffffffffffffff\r
+CT=   f0c5e5ab99d309f21e2364c74b9a8c10\r
+TEST= 104\r
+PT=   000000ffffffffffffffffffffffffff\r
+CT=   4c5016e8afa51df539df6500929bdeb5\r
+TEST= 105\r
+PT=   000001ffffffffffffffffffffffffff\r
+CT=   aa55dab3242ab4dc6ec1c1973069e289\r
+TEST= 106\r
+PT=   000003ffffffffffffffffffffffffff\r
+CT=   ad79bdc7bbfe3e94fd7feefac711a75a\r
+TEST= 107\r
+PT=   000007ffffffffffffffffffffffffff\r
+CT=   49038d62ad5e80c12717e4de7f71161c\r
+TEST= 108\r
+PT=   00000fffffffffffffffffffffffffff\r
+CT=   ea2a989853b9468d8358895b7ec6bd08\r
+TEST= 109\r
+PT=   00001fffffffffffffffffffffffffff\r
+CT=   92a3a09eb028adcc96d5014cd4e0cb5b\r
+TEST= 110\r
+PT=   00003fffffffffffffffffffffffffff\r
+CT=   447089e19867c9f730a634e36624411b\r
+TEST= 111\r
+PT=   00007fffffffffffffffffffffffffff\r
+CT=   79e1bc6f8f889a3a860635fd8b89ae08\r
+TEST= 112\r
+PT=   0000ffffffffffffffffffffffffffff\r
+CT=   5d1fb7b62620ca0bbc1b56079968c95d\r
+TEST= 113\r
+PT=   0001ffffffffffffffffffffffffffff\r
+CT=   17b5ff27f2a627f12c38853ba60540f6\r
+TEST= 114\r
+PT=   0003ffffffffffffffffffffffffffff\r
+CT=   aa02288e444d6ff292fb4ceee5326637\r
+TEST= 115\r
+PT=   0007ffffffffffffffffffffffffffff\r
+CT=   503389a0dde58d848e457611a29d03ef\r
+TEST= 116\r
+PT=   000fffffffffffffffffffffffffffff\r
+CT=   9a3ebb35de64c8416685cc8fb72ac553\r
+TEST= 117\r
+PT=   001fffffffffffffffffffffffffffff\r
+CT=   0789e387cbe0afb4502c452017100dce\r
+TEST= 118\r
+PT=   003fffffffffffffffffffffffffffff\r
+CT=   a018173d885207307ca5c6928ff77c92\r
+TEST= 119\r
+PT=   007fffffffffffffffffffffffffffff\r
+CT=   576c30ca713f5a949e164f98cdb3ca33\r
+TEST= 120\r
+PT=   00ffffffffffffffffffffffffffffff\r
+CT=   7191dfc1bbef90c4f80301c6c0a796bb\r
+TEST= 121\r
+PT=   01ffffffffffffffffffffffffffffff\r
+CT=   270bbe54a220baeef70b0c6c28b4e423\r
+TEST= 122\r
+PT=   03ffffffffffffffffffffffffffffff\r
+CT=   84c9e5d0218dc4b9cc76bba8293243ba\r
+TEST= 123\r
+PT=   07ffffffffffffffffffffffffffffff\r
+CT=   4de4d5970cf8865094f8da24cc0519f3\r
+TEST= 124\r
+PT=   0fffffffffffffffffffffffffffffff\r
+CT=   8488634ace9c71d65d160193b0c4cd7a\r
+TEST= 125\r
+PT=   1fffffffffffffffffffffffffffffff\r
+CT=   8eb8bb7bd3a69711eec8732be003abf2\r
+TEST= 126\r
+PT=   3fffffffffffffffffffffffffffffff\r
+CT=   4e9983b2f707735ef928a95a13510624\r
+TEST= 127\r
+PT=   7fffffffffffffffffffffffffffffff\r
+CT=   28de7ba142b3d255cbf7040a1e3680a9\r
+TEST= 128\r
+PT=   ffffffffffffffffffffffffffffffff\r
+CT=   3f5b8cc9ea855a0afa7347d23e8d664e\r
+TEST= 129\r
+PT=   fffffffffffffffffffffffffffffffe\r
+CT=   5c005e72c1418c44f569f2ea33ba54f3\r
+TEST= 130\r
+PT=   fffffffffffffffffffffffffffffffc\r
+CT=   39bde67d5c8ed8a8b1c37eb8fa9f5ac0\r
+TEST= 131\r
+PT=   fffffffffffffffffffffffffffffff8\r
+CT=   8ade895913685c67c5269f8aae42983e\r
+TEST= 132\r
+PT=   fffffffffffffffffffffffffffffff0\r
+CT=   f9b0fda0c4a898f5b9e6f661c4ce4d07\r
+TEST= 133\r
+PT=   ffffffffffffffffffffffffffffffe0\r
+CT=   8568261797de176bf0b43becc6285afb\r
+TEST= 134\r
+PT=   ffffffffffffffffffffffffffffffc0\r
+CT=   0833ff6f61d98a57b288e8c3586b85a6\r
+TEST= 135\r
+PT=   ffffffffffffffffffffffffffffff80\r
+CT=   d1788f572d98b2b16ec5d5f3922b99bc\r
+TEST= 136\r
+PT=   ffffffffffffffffffffffffffffff00\r
+CT=   3bd141ee84a0e6414a26e7a4f281f8a2\r
+TEST= 137\r
+PT=   fffffffffffffffffffffffffffffe00\r
+CT=   7f692b03945867d16179a8cefc83ea3f\r
+TEST= 138\r
+PT=   fffffffffffffffffffffffffffffc00\r
+CT=   a4d6616bd04f87335b0e53351227a9ee\r
+TEST= 139\r
+PT=   fffffffffffffffffffffffffffff800\r
+CT=   34a2c5a91ae2aec99b7d1b5fa6780447\r
+TEST= 140\r
+PT=   fffffffffffffffffffffffffffff000\r
+CT=   2e3579ca15af27f64b3c955a5bfc30ba\r
+TEST= 141\r
+PT=   ffffffffffffffffffffffffffffe000\r
+CT=   6f45732cf10881546f0fd23896d2bb60\r
+TEST= 142\r
+PT=   ffffffffffffffffffffffffffffc000\r
+CT=   b7972b3941c44b90afa7b264bfba7387\r
+TEST= 143\r
+PT=   ffffffffffffffffffffffffffff8000\r
+CT=   4b706f7f92406352394037a6d4f4688d\r
+TEST= 144\r
+PT=   ffffffffffffffffffffffffffff0000\r
+CT=   545f2b83d9616dccf60fa9830e9cd287\r
+TEST= 145\r
+PT=   fffffffffffffffffffffffffffe0000\r
+CT=   a87a385736c0a6189bd6589bd8445a93\r
+TEST= 146\r
+PT=   fffffffffffffffffffffffffffc0000\r
+CT=   4010a5e401fdf0a0354ddbcc0d012b17\r
+TEST= 147\r
+PT=   fffffffffffffffffffffffffff80000\r
+CT=   088c4b53f5ec0ff814c19adae7f6246c\r
+TEST= 148\r
+PT=   fffffffffffffffffffffffffff00000\r
+CT=   9272e2d2cdd11050998c845077a30ea0\r
+TEST= 149\r
+PT=   ffffffffffffffffffffffffffe00000\r
+CT=   3aa426831067d36b92be7c5f81c13c56\r
+TEST= 150\r
+PT=   ffffffffffffffffffffffffffc00000\r
+CT=   7678f3a833f19fea95f3c6029e2bc610\r
+TEST= 151\r
+PT=   ffffffffffffffffffffffffff800000\r
+CT=   63919ed4ce10196438b6ad09d99cd795\r
+TEST= 152\r
+PT=   ffffffffffffffffffffffffff000000\r
+CT=   ed3c0a94d59bece98835da7aa4f07ca2\r
+TEST= 153\r
+PT=   fffffffffffffffffffffffffe000000\r
+CT=   3c849939a5d29399f344c4a0eca8a576\r
+TEST= 154\r
+PT=   fffffffffffffffffffffffffc000000\r
+CT=   79bf5dce14bb7dd73a8e3611de7ce026\r
+TEST= 155\r
+PT=   fffffffffffffffffffffffff8000000\r
+CT=   2ca8209d63274cd9a29bb74bcd77683a\r
+TEST= 156\r
+PT=   fffffffffffffffffffffffff0000000\r
+CT=   e656f9ecf5fe27ec3e4a73d00c282fb3\r
+TEST= 157\r
+PT=   ffffffffffffffffffffffffe0000000\r
+CT=   082eb8be35f442fb52668e16a591d1d6\r
+TEST= 158\r
+PT=   ffffffffffffffffffffffffc0000000\r
+CT=   76da1fbe3a50728c50fd2e621b5ad885\r
+TEST= 159\r
+PT=   ffffffffffffffffffffffff80000000\r
+CT=   1ffc626d30203dcdb0019fb80f726cf4\r
+TEST= 160\r
+PT=   ffffffffffffffffffffffff00000000\r
+CT=   123c1f4af313ad8c2ce648b2e71fb6e1\r
+TEST= 161\r
+PT=   fffffffffffffffffffffffe00000000\r
+CT=   9402e9aa6f69de6504da8d20c4fcaa2f\r
+TEST= 162\r
+PT=   fffffffffffffffffffffffc00000000\r
+CT=   377be0be33b4e3e310b4aabda173f84f\r
+TEST= 163\r
+PT=   fffffffffffffffffffffff800000000\r
+CT=   65c0526cbe40161b8019a2a3171abd23\r
+TEST= 164\r
+PT=   fffffffffffffffffffffff000000000\r
+CT=   56aff089878bf3352f8df172a3ae47d8\r
+TEST= 165\r
+PT=   ffffffffffffffffffffffe000000000\r
+CT=   7472f9a7988607ca79707795991035e6\r
+TEST= 166\r
+PT=   ffffffffffffffffffffffc000000000\r
+CT=   90684a2ac55fe1ec2b8ebd5622520b73\r
+TEST= 167\r
+PT=   ffffffffffffffffffffff8000000000\r
+CT=   90ecbe6177e674c98de412413f7ac915\r
+TEST= 168\r
+PT=   ffffffffffffffffffffff0000000000\r
+CT=   4c6a1c83e568cd10f27c2d73ded19c28\r
+TEST= 169\r
+PT=   fffffffffffffffffffffe0000000000\r
+CT=   db7e1932679fdd99742aab04aa0d5a80\r
+TEST= 170\r
+PT=   fffffffffffffffffffffc0000000000\r
+CT=   7c8d9ab6c2761723fe42f8bb506cbcf7\r
+TEST= 171\r
+PT=   fffffffffffffffffffff80000000000\r
+CT=   14954f0b4697776f44494fe458d814ed\r
+TEST= 172\r
+PT=   fffffffffffffffffffff00000000000\r
+CT=   a5e652614c9300f37816b1f9fd0c87f9\r
+TEST= 173\r
+PT=   ffffffffffffffffffffe00000000000\r
+CT=   9ca547f7439edc3e255c0f4d49aa8990\r
+TEST= 174\r
+PT=   ffffffffffffffffffffc00000000000\r
+CT=   2e65eb6b6ea383e109accce8326b0393\r
+TEST= 175\r
+PT=   ffffffffffffffffffff800000000000\r
+CT=   b87c921b91829ef3b13ca541ee1130a6\r
+TEST= 176\r
+PT=   ffffffffffffffffffff000000000000\r
+CT=   4d37c850644563c69fd0acd9a049325b\r
+TEST= 177\r
+PT=   fffffffffffffffffffe000000000000\r
+CT=   563bf90d61beef39f48dd625fcef1361\r
+TEST= 178\r
+PT=   fffffffffffffffffffc000000000000\r
+CT=   e886f9281999c5bb3b3e8862e2f7c988\r
+TEST= 179\r
+PT=   fffffffffffffffffff8000000000000\r
+CT=   3bffc16e4c49b268a20f8d96a60b4058\r
+TEST= 180\r
+PT=   fffffffffffffffffff0000000000000\r
+CT=   251a7eac7e2fe809e4aa8d0d7012531a\r
+TEST= 181\r
+PT=   ffffffffffffffffffe0000000000000\r
+CT=   06f2519a2fafaa596bfef5cfa15c21b9\r
+TEST= 182\r
+PT=   ffffffffffffffffffc0000000000000\r
+CT=   eef456431dea8b4acf83bdae3717f75f\r
+TEST= 183\r
+PT=   ffffffffffffffffff80000000000000\r
+CT=   1bdec521316503d9d5ee65df3ea94ddf\r
+TEST= 184\r
+PT=   ffffffffffffffffff00000000000000\r
+CT=   d93eae966fac46dca927d6b114fa3f9e\r
+TEST= 185\r
+PT=   fffffffffffffffffe00000000000000\r
+CT=   ab3b89542233f1271bf8fd0c0f403545\r
+TEST= 186\r
+PT=   fffffffffffffffffc00000000000000\r
+CT=   1c317a220a7d700da2b1e075b00266e1\r
+TEST= 187\r
+PT=   fffffffffffffffff800000000000000\r
+CT=   66404033d6b72b609354d5496e7eb511\r
+TEST= 188\r
+PT=   fffffffffffffffff000000000000000\r
+CT=   1480cb3955ba62d09eea668f7c708817\r
+TEST= 189\r
+PT=   ffffffffffffffffe000000000000000\r
+CT=   21feecd45b2e675973ac33bf0c5424fc\r
+TEST= 190\r
+PT=   ffffffffffffffffc000000000000000\r
+CT=   10d3ed7a6fe15ab4d91acbc7d0767ab1\r
+TEST= 191\r
+PT=   ffffffffffffffff8000000000000000\r
+CT=   41f992a856fb278b389a62f5d274d7e9\r
+TEST= 192\r
+PT=   ffffffffffffffff0000000000000000\r
+CT=   f807c3e7985fe0f5a50e2cdb25c5109e\r
+TEST= 193\r
+PT=   fffffffffffffffe0000000000000000\r
+CT=   3b5e0f566dc96c298f0c12637539b25c\r
+TEST= 194\r
+PT=   fffffffffffffffc0000000000000000\r
+CT=   7d33fc7d8abe3ca1936759f8f5deaf20\r
+TEST= 195\r
+PT=   fffffffffffffff80000000000000000\r
+CT=   b611295e739ca7d9b50f8e4c0e754a3f\r
+TEST= 196\r
+PT=   fffffffffffffff00000000000000000\r
+CT=   6898d4f42fa7ba6a10ac05e87b9f2080\r
+TEST= 197\r
+PT=   ffffffffffffffe00000000000000000\r
+CT=   d451b8d6e1e1a0ebb155fbbf6e7b7dc3\r
+TEST= 198\r
+PT=   ffffffffffffffc00000000000000000\r
+CT=   3a4d354f02bb5a5e47d39666867f246a\r
+TEST= 199\r
+PT=   ffffffffffffff800000000000000000\r
+CT=   11005d52f25f16bdc9545a876a63490a\r
+TEST= 200\r
+PT=   ffffffffffffff000000000000000000\r
+CT=   1bfd4b91c701fd6b61b7f997829d663b\r
+TEST= 201\r
+PT=   fffffffffffffe000000000000000000\r
+CT=   d2d99c6bcc1f06fda8e27e8ae3f1ccc7\r
+TEST= 202\r
+PT=   fffffffffffffc000000000000000000\r
+CT=   79b61c37bf328ecca8d743265a3d425c\r
+TEST= 203\r
+PT=   fffffffffffff8000000000000000000\r
+CT=   a18e3dbbca577860dab6b80da3139256\r
+TEST= 204\r
+PT=   fffffffffffff0000000000000000000\r
+CT=   c9cacb5cd11692c373b2411768149ee7\r
+TEST= 205\r
+PT=   ffffffffffffe0000000000000000000\r
+CT=   22322327e01780b17397f24087f8cc6f\r
+TEST= 206\r
+PT=   ffffffffffffc0000000000000000000\r
+CT=   ea2e6b5ef182b7dff3629abd6a12045f\r
+TEST= 207\r
+PT=   ffffffffffff80000000000000000000\r
+CT=   00c55bd75c7f9c881989d3ec1911c0d4\r
+TEST= 208\r
+PT=   ffffffffffff00000000000000000000\r
+CT=   1c3112bcb0c1dcc749d799743691bf82\r
+TEST= 209\r
+PT=   fffffffffffe00000000000000000000\r
+CT=   c2f93a4ce5ab6d5d56f1b93cf19911c1\r
+TEST= 210\r
+PT=   fffffffffffc00000000000000000000\r
+CT=   678034dc9e41b5a560ed239eeab1bc78\r
+TEST= 211\r
+PT=   fffffffffff800000000000000000000\r
+CT=   85062c2c909f15d9269b6c18ce99c4f0\r
+TEST= 212\r
+PT=   fffffffffff000000000000000000000\r
+CT=   191aa0f2c8570144f38657ea4085ebe5\r
+TEST= 213\r
+PT=   ffffffffffe000000000000000000000\r
+CT=   35830c8e7aaefe2d30310ef381cbf691\r
+TEST= 214\r
+PT=   ffffffffffc000000000000000000000\r
+CT=   827f000e75e2c8b9d479beed913fe678\r
+TEST= 215\r
+PT=   ffffffffff8000000000000000000000\r
+CT=   4afe7f120ce7613f74fc12a01a828073\r
+TEST= 216\r
+PT=   ffffffffff0000000000000000000000\r
+CT=   95e3a0ca9079e646331df8b4e70d2cd6\r
+TEST= 217\r
+PT=   fffffffffe0000000000000000000000\r
+CT=   f21e99cf4f0f77cea836e11a2fe75fb1\r
+TEST= 218\r
+PT=   fffffffffc0000000000000000000000\r
+CT=   215a41ee442fa992a6e323986ded3f68\r
+TEST= 219\r
+PT=   fffffffff80000000000000000000000\r
+CT=   cb2bf8280f3f9742c7ed513fe802629c\r
+TEST= 220\r
+PT=   fffffffff00000000000000000000000\r
+CT=   092faacc9bf43508bf8fa8613ca75dea\r
+TEST= 221\r
+PT=   ffffffffe00000000000000000000000\r
+CT=   43b02ff929a1485af6f5c6d6558baa0f\r
+TEST= 222\r
+PT=   ffffffffc00000000000000000000000\r
+CT=   7cadbe402d1b208fe735edce00aee7ce\r
+TEST= 223\r
+PT=   ffffffff800000000000000000000000\r
+CT=   171a0e1b2dd424f0e089af2c4c10f32f\r
+TEST= 224\r
+PT=   ffffffff000000000000000000000000\r
+CT=   c26277437420c5d634f715aea81a9132\r
+TEST= 225\r
+PT=   fffffffe000000000000000000000000\r
+CT=   b9fb4399fa4facc7309e14ec98360b0a\r
+TEST= 226\r
+PT=   fffffffc000000000000000000000000\r
+CT=   a2124bea53ec2834279bed7f7eb0f938\r
+TEST= 227\r
+PT=   fffffff8000000000000000000000000\r
+CT=   3aebbad7303649b4194a6945c6cc3694\r
+TEST= 228\r
+PT=   fffffff0000000000000000000000000\r
+CT=   35f40182ab4662f3023baec1ee796b57\r
+TEST= 229\r
+PT=   ffffffe0000000000000000000000000\r
+CT=   f8023ee9c3fdc45a019b4e985c7e1a54\r
+TEST= 230\r
+PT=   ffffffc0000000000000000000000000\r
+CT=   e9c0fc1818e4aa46bd2e39d638f89e05\r
+TEST= 231\r
+PT=   ffffff80000000000000000000000000\r
+CT=   3b594c60f5c8277a5113677f94208d82\r
+TEST= 232\r
+PT=   ffffff00000000000000000000000000\r
+CT=   13001ff5d99806efd25da34f56be854b\r
+TEST= 233\r
+PT=   fffffe00000000000000000000000000\r
+CT=   c0b5fd98190ef45fbb4301438d095950\r
+TEST= 234\r
+PT=   fffffc00000000000000000000000000\r
+CT=   625d01f058e565f77ae86378bd2c49b3\r
+TEST= 235\r
+PT=   fffff800000000000000000000000000\r
+CT=   2c20f439f6bb097b29b8bd6d99aad799\r
+TEST= 236\r
+PT=   fffff000000000000000000000000000\r
+CT=   6941cb6b3e08c2b7afa581ebdd607b87\r
+TEST= 237\r
+PT=   ffffe000000000000000000000000000\r
+CT=   dd35cea2799940b40db3f819cb94c08b\r
+TEST= 238\r
+PT=   ffffc000000000000000000000000000\r
+CT=   8ee79dd4f401ff9b7ea945d86666c13b\r
+TEST= 239\r
+PT=   ffff8000000000000000000000000000\r
+CT=   f3f72375264e167fca9de2c1527d9606\r
+TEST= 240\r
+PT=   ffff0000000000000000000000000000\r
+CT=   d7e5dbd3324595f8fdc7d7c571da6c2a\r
+TEST= 241\r
+PT=   fffe0000000000000000000000000000\r
+CT=   64b4d629810fda6bafdf08f3b0d8d2c5\r
+TEST= 242\r
+PT=   fffc0000000000000000000000000000\r
+CT=   8eae3b10a0c8ca6d1d3b0fa61e56b0b2\r
+TEST= 243\r
+PT=   fff80000000000000000000000000000\r
+CT=   8b87145a01ad1c6cede995ea3670454f\r
+TEST= 244\r
+PT=   fff00000000000000000000000000000\r
+CT=   965135f8a81f25c9d630b17502f68e53\r
+TEST= 245\r
+PT=   ffe00000000000000000000000000000\r
+CT=   b8499c251f8442ee13f0933b688fcd19\r
+TEST= 246\r
+PT=   ffc00000000000000000000000000000\r
+CT=   77e2b508db7fd89234caf7939ee5621a\r
+TEST= 247\r
+PT=   ff800000000000000000000000000000\r
+CT=   a81738252621dd180a34f3455b4baa2f\r
+TEST= 248\r
+PT=   ff000000000000000000000000000000\r
+CT=   db4f1aa530967d6732ce4715eb0ee24b\r
+TEST= 249\r
+PT=   fe000000000000000000000000000000\r
+CT=   b6da0bb11a23855d9c5cb1b4c6412e0a\r
+TEST= 250\r
+PT=   fc000000000000000000000000000000\r
+CT=   16ae4ce5042a67ee8e177b7c587ecc82\r
+TEST= 251\r
+PT=   f8000000000000000000000000000000\r
+CT=   30ccdb044646d7e1f3ccea3dca08b8c0\r
+TEST= 252\r
+PT=   f0000000000000000000000000000000\r
+CT=   96d9fd5cc4f07441727df0f33e401a36\r
+TEST= 253\r
+PT=   e0000000000000000000000000000000\r
+CT=   f031d4d74f5dcbf39daaf8ca3af6e527\r
+TEST= 254\r
+PT=   c0000000000000000000000000000000\r
+CT=   aae5939c8efdf2f04e60b9fe7117b2c2\r
+TEST= 255\r
+PT=   80000000000000000000000000000000\r
+CT=   3ad78e726c1ec02b7ebfe92b23d9ec34\r
diff --git a/test/dfregress/testcases/crypto/aes/ecbnt48.txt b/test/dfregress/testcases/crypto/aes/ecbnt48.txt
new file mode 100644 (file)
index 0000000..df20081
--- /dev/null
@@ -0,0 +1,779 @@
+==============================================\r
+Author:    Dr B R Gladman (                 )\r
+Test:      ECB Variable Text Known Answer Tests\r
+Algorithm: Extended Rijndael (an AES Superset)\r
+Filename:  ecbnt48.txt\r
+==============================================\r
+\r
+BLOCKSIZE=128\r
+KEYSIZE=  256\r
+\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000000\r
+TEST= 0\r
+PT=   00000000000000000000000000000000\r
+CT=   dc95c078a2408989ad48a21492842087\r
+TEST= 1\r
+PT=   00000000000000000000000000000001\r
+CT=   530f8afbc74536b9a963b4f1c4cb738b\r
+TEST= 2\r
+PT=   00000000000000000000000000000003\r
+CT=   726003ca37a62a74d1a2f58e7506358e\r
+TEST= 3\r
+PT=   00000000000000000000000000000007\r
+CT=   bcaf49b0c0cea62de6bc1c66545e1dad\r
+TEST= 4\r
+PT=   0000000000000000000000000000000f\r
+CT=   b0b710249c8626e1a96ad57828d7be2e\r
+TEST= 5\r
+PT=   0000000000000000000000000000001f\r
+CT=   887cb1eb76b46720104130dbf1966387\r
+TEST= 6\r
+PT=   0000000000000000000000000000003f\r
+CT=   56a368c7a34325e4adce918732e8ea7e\r
+TEST= 7\r
+PT=   0000000000000000000000000000007f\r
+CT=   cac87823c4ed0ded6ffe92afe6a56ffd\r
+TEST= 8\r
+PT=   000000000000000000000000000000ff\r
+CT=   4d4f06c6f17c2903abc750b28eda2e34\r
+TEST= 9\r
+PT=   000000000000000000000000000001ff\r
+CT=   c460e6aee417a37a6c60dc0aa85bc4d2\r
+TEST= 10\r
+PT=   000000000000000000000000000003ff\r
+CT=   0ef31d5000240ab67f2511ad51ac6a6f\r
+TEST= 11\r
+PT=   000000000000000000000000000007ff\r
+CT=   304239c608efb82eafd161826baddb67\r
+TEST= 12\r
+PT=   00000000000000000000000000000fff\r
+CT=   17be0fbc50c92820d563067c9f5204fd\r
+TEST= 13\r
+PT=   00000000000000000000000000001fff\r
+CT=   b172d242b63b54af7f6aba477ecdc146\r
+TEST= 14\r
+PT=   00000000000000000000000000003fff\r
+CT=   c550e4f6ca4dfa10fb9e9ea66fb91673\r
+TEST= 15\r
+PT=   00000000000000000000000000007fff\r
+CT=   e9a4ee862f87f211b6e605115aee6e5a\r
+TEST= 16\r
+PT=   0000000000000000000000000000ffff\r
+CT=   e8dd97836fe934a5f5cf6a662d5b479f\r
+TEST= 17\r
+PT=   0000000000000000000000000001ffff\r
+CT=   80ce6c203776f35a48928ae2358ee174\r
+TEST= 18\r
+PT=   0000000000000000000000000003ffff\r
+CT=   15942b0d89e9ef9716e831443281a57c\r
+TEST= 19\r
+PT=   0000000000000000000000000007ffff\r
+CT=   a5299cdc04a6b08a3aa30e48f410c0a5\r
+TEST= 20\r
+PT=   000000000000000000000000000fffff\r
+CT=   075c1e8602554af03ea1ac5aaf174a85\r
+TEST= 21\r
+PT=   000000000000000000000000001fffff\r
+CT=   451a51155cad491e8307cd770e20cbee\r
+TEST= 22\r
+PT=   000000000000000000000000003fffff\r
+CT=   a04966b5f5cac26a27a054f0872a9d6e\r
+TEST= 23\r
+PT=   000000000000000000000000007fffff\r
+CT=   2bdb0cd6ca18e273345ce91e3b6359b3\r
+TEST= 24\r
+PT=   00000000000000000000000000ffffff\r
+CT=   7640fb7a3eb6d99975239f6a5e4f3e90\r
+TEST= 25\r
+PT=   00000000000000000000000001ffffff\r
+CT=   000d85d4cd6089dca634401d8ffc9dc5\r
+TEST= 26\r
+PT=   00000000000000000000000003ffffff\r
+CT=   9814a2df042ed7cdeb8c540a3f93aae6\r
+TEST= 27\r
+PT=   00000000000000000000000007ffffff\r
+CT=   afbdd961a6ea47665b6a47d1e97d3139\r
+TEST= 28\r
+PT=   0000000000000000000000000fffffff\r
+CT=   b92b31ec069b5eded32883d152808107\r
+TEST= 29\r
+PT=   0000000000000000000000001fffffff\r
+CT=   4c18ff599dd824de22fa28083504b7a4\r
+TEST= 30\r
+PT=   0000000000000000000000003fffffff\r
+CT=   d0ce009cd9581bc87aab04bffbe3eac5\r
+TEST= 31\r
+PT=   0000000000000000000000007fffffff\r
+CT=   fb01abd9082d54d31cfe9ae654c360bf\r
+TEST= 32\r
+PT=   000000000000000000000000ffffffff\r
+CT=   ebc85b60c80ac906911208ac8191ca99\r
+TEST= 33\r
+PT=   000000000000000000000001ffffffff\r
+CT=   7d4feb5ff6d3a0b59ffa3f64635b45f0\r
+TEST= 34\r
+PT=   000000000000000000000003ffffffff\r
+CT=   5a7243d2ed4f20c06638d5b8fd86fca1\r
+TEST= 35\r
+PT=   000000000000000000000007ffffffff\r
+CT=   00e138e93ba22c212fad9eb7803dc8a7\r
+TEST= 36\r
+PT=   00000000000000000000000fffffffff\r
+CT=   5342826786693becb735c5dfd9dc3b78\r
+TEST= 37\r
+PT=   00000000000000000000001fffffffff\r
+CT=   89d27af549ecc8b352887c35afbe05b9\r
+TEST= 38\r
+PT=   00000000000000000000003fffffffff\r
+CT=   ea1694641aaa6c665ae9ff277d7535d6\r
+TEST= 39\r
+PT=   00000000000000000000007fffffffff\r
+CT=   8a20deb1ec0bc7d7116d78b66711ac8d\r
+TEST= 40\r
+PT=   0000000000000000000000ffffffffff\r
+CT=   f264d95afd5e7660ca94472fc669044d\r
+TEST= 41\r
+PT=   0000000000000000000001ffffffffff\r
+CT=   fb3d784a822ea5061c99a4e86dd5e0ee\r
+TEST= 42\r
+PT=   0000000000000000000003ffffffffff\r
+CT=   1cf03115a4d5025aeeccb29fdfaf8518\r
+TEST= 43\r
+PT=   0000000000000000000007ffffffffff\r
+CT=   ad031c70f3695ab0f17b54542295b6f1\r
+TEST= 44\r
+PT=   000000000000000000000fffffffffff\r
+CT=   fe47d8f239b3b45e6032d64772a89597\r
+TEST= 45\r
+PT=   000000000000000000001fffffffffff\r
+CT=   30a52cf0b60d78417a6f9139ead693aa\r
+TEST= 46\r
+PT=   000000000000000000003fffffffffff\r
+CT=   bcfa8c117289994c5e2bf36671a1c250\r
+TEST= 47\r
+PT=   000000000000000000007fffffffffff\r
+CT=   6e2ef0875cbaf7daa88d7c168fb4e74c\r
+TEST= 48\r
+PT=   00000000000000000000ffffffffffff\r
+CT=   19a62ebdec659f25ba9deede08db4ba1\r
+TEST= 49\r
+PT=   00000000000000000001ffffffffffff\r
+CT=   9cfe3fd2d4742a8dd4ce2cdb53558b8b\r
+TEST= 50\r
+PT=   00000000000000000003ffffffffffff\r
+CT=   ff9e5e6b14cc67acf4b5d1b5f0ae7825\r
+TEST= 51\r
+PT=   00000000000000000007ffffffffffff\r
+CT=   105303cd709d55961f68164ae9af602f\r
+TEST= 52\r
+PT=   0000000000000000000fffffffffffff\r
+CT=   32334bec8f2369ec5af88389849e10e2\r
+TEST= 53\r
+PT=   0000000000000000001fffffffffffff\r
+CT=   6b135672f9313b5708f907ba6ca08aa2\r
+TEST= 54\r
+PT=   0000000000000000003fffffffffffff\r
+CT=   c938c8042ea25b79287063e83886a114\r
+TEST= 55\r
+PT=   0000000000000000007fffffffffffff\r
+CT=   a725af8f5a93e89cb76aabcd7800254f\r
+TEST= 56\r
+PT=   000000000000000000ffffffffffffff\r
+CT=   140aeec2b0dea84585888b9ccd93b899\r
+TEST= 57\r
+PT=   000000000000000001ffffffffffffff\r
+CT=   0d070d0515d0140c32c37ab448d938e4\r
+TEST= 58\r
+PT=   000000000000000003ffffffffffffff\r
+CT=   3c973d2fc670a8ce81386e1093fd5d01\r
+TEST= 59\r
+PT=   000000000000000007ffffffffffffff\r
+CT=   2dc5acfc922bc0e9ae28f6ba5900075a\r
+TEST= 60\r
+PT=   00000000000000000fffffffffffffff\r
+CT=   a884b5ce79fe57658be0b1a1725a620d\r
+TEST= 61\r
+PT=   00000000000000001fffffffffffffff\r
+CT=   4ae4eac3bc4c1d89bae0807f350a1db2\r
+TEST= 62\r
+PT=   00000000000000003fffffffffffffff\r
+CT=   21e1531f06bb0be6b3824c5210cab657\r
+TEST= 63\r
+PT=   00000000000000007fffffffffffffff\r
+CT=   1d00b46164c05228575ade02afd3f3aa\r
+TEST= 64\r
+PT=   0000000000000000ffffffffffffffff\r
+CT=   55ed76948d2886bfff50e3352bfe34fd\r
+TEST= 65\r
+PT=   0000000000000001ffffffffffffffff\r
+CT=   26330a5f3bc166e2d66c25523d80827b\r
+TEST= 66\r
+PT=   0000000000000003ffffffffffffffff\r
+CT=   7d1ff2b1cd8c311da0d31877d8479924\r
+TEST= 67\r
+PT=   0000000000000007ffffffffffffffff\r
+CT=   6b44fd6bcbc1746699fa86393e663e20\r
+TEST= 68\r
+PT=   000000000000000fffffffffffffffff\r
+CT=   7d6135c058802c7d7e1a64d84c1b0b58\r
+TEST= 69\r
+PT=   000000000000001fffffffffffffffff\r
+CT=   2780da1d4af9937b7f7a167109c01ed5\r
+TEST= 70\r
+PT=   000000000000003fffffffffffffffff\r
+CT=   8c6d606a473292ef9d7b3eaa2c2b48d0\r
+TEST= 71\r
+PT=   000000000000007fffffffffffffffff\r
+CT=   b21cd49bdd33f8dba102ea9f593679f5\r
+TEST= 72\r
+PT=   00000000000000ffffffffffffffffff\r
+CT=   e84b26bdf29cdcf2cc6d0cfba9a36b4a\r
+TEST= 73\r
+PT=   00000000000001ffffffffffffffffff\r
+CT=   5f1e926f32237a79c41c996708abb848\r
+TEST= 74\r
+PT=   00000000000003ffffffffffffffffff\r
+CT=   b3071afc6fb7cb44dc31791a303ab3a1\r
+TEST= 75\r
+PT=   00000000000007ffffffffffffffffff\r
+CT=   1bfa099e97915b970ac427db41c4e682\r
+TEST= 76\r
+PT=   0000000000000fffffffffffffffffff\r
+CT=   652ec0796f58f50323bcd4d688e891e6\r
+TEST= 77\r
+PT=   0000000000001fffffffffffffffffff\r
+CT=   2cd6250a5b9090ee1a8a6e82ca249f4d\r
+TEST= 78\r
+PT=   0000000000003fffffffffffffffffff\r
+CT=   fb748f3bab75ea7bc1a8e82d82a51e09\r
+TEST= 79\r
+PT=   0000000000007fffffffffffffffffff\r
+CT=   9c61fb5dfef28e0e332477533e04fa5d\r
+TEST= 80\r
+PT=   000000000000ffffffffffffffffffff\r
+CT=   1554b13676e017251cbaa0b870293f5b\r
+TEST= 81\r
+PT=   000000000001ffffffffffffffffffff\r
+CT=   2bdf5516618bfa55688ef7cab73711bd\r
+TEST= 82\r
+PT=   000000000003ffffffffffffffffffff\r
+CT=   ecf1b105a6d8e6da307ea0fb480001a5\r
+TEST= 83\r
+PT=   000000000007ffffffffffffffffffff\r
+CT=   a3f459f75e64b6e19f4299b269139f7d\r
+TEST= 84\r
+PT=   00000000000fffffffffffffffffffff\r
+CT=   9b7fcb51afb728ebc4b2cde2eaa3272e\r
+TEST= 85\r
+PT=   00000000001fffffffffffffffffffff\r
+CT=   6cc8b54fcc4cb5ab1f6bca58809a03f3\r
+TEST= 86\r
+PT=   00000000003fffffffffffffffffffff\r
+CT=   08d33488079834d193a93e60340a9dc6\r
+TEST= 87\r
+PT=   00000000007fffffffffffffffffffff\r
+CT=   3192a2e9f08b3b683234da0f5518a010\r
+TEST= 88\r
+PT=   0000000000ffffffffffffffffffffff\r
+CT=   943ac035ba6411af0340a479c035ccde\r
+TEST= 89\r
+PT=   0000000001ffffffffffffffffffffff\r
+CT=   3a4ee0ccaee8fcaf778e23e572b64972\r
+TEST= 90\r
+PT=   0000000003ffffffffffffffffffffff\r
+CT=   71dd8603c6a215f56ce78254a2dcc352\r
+TEST= 91\r
+PT=   0000000007ffffffffffffffffffffff\r
+CT=   e55d93d9e16f29b5c0bcc04caeba26b4\r
+TEST= 92\r
+PT=   000000000fffffffffffffffffffffff\r
+CT=   978b39d54628ef68dd2e3481c056be87\r
+TEST= 93\r
+PT=   000000001fffffffffffffffffffffff\r
+CT=   9781f263a24815e5f86d5426fca2a60d\r
+TEST= 94\r
+PT=   000000003fffffffffffffffffffffff\r
+CT=   a2502f0fa52c9ee2b04dceba26818feb\r
+TEST= 95\r
+PT=   000000007fffffffffffffffffffffff\r
+CT=   e01498623fc3691c93f0a254025f00dc\r
+TEST= 96\r
+PT=   00000000ffffffffffffffffffffffff\r
+CT=   04f6241fa8dfe97b8fa21020c8e0f012\r
+TEST= 97\r
+PT=   00000001ffffffffffffffffffffffff\r
+CT=   adad0ea8da80f52cba02a2f797e5f660\r
+TEST= 98\r
+PT=   00000003ffffffffffffffffffffffff\r
+CT=   da4e186b8466f3de44fcceb4275e919e\r
+TEST= 99\r
+PT=   00000007ffffffffffffffffffffffff\r
+CT=   81afed0aa90ab04150725191ae23329d\r
+TEST= 100\r
+PT=   0000000fffffffffffffffffffffffff\r
+CT=   ed4edde587d7de7bfc9937e901f28ac3\r
+TEST= 101\r
+PT=   0000001fffffffffffffffffffffffff\r
+CT=   db971e6a8fef015916b1bd3d1384765b\r
+TEST= 102\r
+PT=   0000003fffffffffffffffffffffffff\r
+CT=   2908a709b1ed9d002ff1575fb656f145\r
+TEST= 103\r
+PT=   0000007fffffffffffffffffffffffff\r
+CT=   f2db14c1ebbcfd1cffcd2d45569d8d67\r
+TEST= 104\r
+PT=   000000ffffffffffffffffffffffffff\r
+CT=   70c94bbbdecd58bf0f5f85d2cbca1ef5\r
+TEST= 105\r
+PT=   000001ffffffffffffffffffffffffff\r
+CT=   6fcc581931c7de8f8433912403e59ef6\r
+TEST= 106\r
+PT=   000003ffffffffffffffffffffffffff\r
+CT=   052bd927df7af09b394e6acd3faf17af\r
+TEST= 107\r
+PT=   000007ffffffffffffffffffffffffff\r
+CT=   71d78327dd4f1de4c41c0bed89d86ad9\r
+TEST= 108\r
+PT=   00000fffffffffffffffffffffffffff\r
+CT=   990d25762402bcd18da9ac57a4734ec8\r
+TEST= 109\r
+PT=   00001fffffffffffffffffffffffffff\r
+CT=   e4fc8242eabf609feb6f3bab41f8b1dc\r
+TEST= 110\r
+PT=   00003fffffffffffffffffffffffffff\r
+CT=   dfef5c6cbcfcd8a2628ae53ce4c6a79b\r
+TEST= 111\r
+PT=   00007fffffffffffffffffffffffffff\r
+CT=   d0b45049e154ea336aa76e4a75b315e7\r
+TEST= 112\r
+PT=   0000ffffffffffffffffffffffffffff\r
+CT=   d414f7943d00ca79d85b74cc95f9ef14\r
+TEST= 113\r
+PT=   0001ffffffffffffffffffffffffffff\r
+CT=   a69b3d1b84f6ee453a27bca6c80f1b7f\r
+TEST= 114\r
+PT=   0003ffffffffffffffffffffffffffff\r
+CT=   58396af6098f11a4146c222c23489274\r
+TEST= 115\r
+PT=   0007ffffffffffffffffffffffffffff\r
+CT=   0b125f559c24c477ba892ce77426f45a\r
+TEST= 116\r
+PT=   000fffffffffffffffffffffffffffff\r
+CT=   c4bf82fc934d9c05da586038b25b3a30\r
+TEST= 117\r
+PT=   001fffffffffffffffffffffffffffff\r
+CT=   e6211d551f1508d285cfd248a5dbea3e\r
+TEST= 118\r
+PT=   003fffffffffffffffffffffffffffff\r
+CT=   25a4f6a5fdf329d70ca049f503b5eda2\r
+TEST= 119\r
+PT=   007fffffffffffffffffffffffffffff\r
+CT=   63302af0213fde83e376a1c1e9990542\r
+TEST= 120\r
+PT=   00ffffffffffffffffffffffffffffff\r
+CT=   9300e6173d1260a519b13ea2ae65a985\r
+TEST= 121\r
+PT=   01ffffffffffffffffffffffffffffff\r
+CT=   8e9aac3b662e266dcdf5ae4426a90edd\r
+TEST= 122\r
+PT=   03ffffffffffffffffffffffffffffff\r
+CT=   c691e61ab83e4b2a6cea1a1a6097ba2e\r
+TEST= 123\r
+PT=   07ffffffffffffffffffffffffffffff\r
+CT=   cdf811cc43cf5df05db02cb939721884\r
+TEST= 124\r
+PT=   0fffffffffffffffffffffffffffffff\r
+CT=   bf2778915eee19c7cab7c0547f0a61dd\r
+TEST= 125\r
+PT=   1fffffffffffffffffffffffffffffff\r
+CT=   4da9149db4c9c2bb29ba1701816f1b2f\r
+TEST= 126\r
+PT=   3fffffffffffffffffffffffffffffff\r
+CT=   d20c5e7d71e9caeccf40664f1eb45392\r
+TEST= 127\r
+PT=   7fffffffffffffffffffffffffffffff\r
+CT=   e358d3c6b857b344f148f8d6c622f3bf\r
+TEST= 128\r
+PT=   ffffffffffffffffffffffffffffffff\r
+CT=   acdace8078a32b1a182bfa4987ca1347\r
+TEST= 129\r
+PT=   fffffffffffffffffffffffffffffffe\r
+CT=   7bfe9d876c6d63c1d035da8fe21c409d\r
+TEST= 130\r
+PT=   fffffffffffffffffffffffffffffffc\r
+CT=   0f59cb5a4b522e2ac56c1a64f558ad9a\r
+TEST= 131\r
+PT=   fffffffffffffffffffffffffffffff8\r
+CT=   da63039d38cb4612b2dc36ba26684b93\r
+TEST= 132\r
+PT=   fffffffffffffffffffffffffffffff0\r
+CT=   7240e524bc51d8c4d440b1be55d1062c\r
+TEST= 133\r
+PT=   ffffffffffffffffffffffffffffffe0\r
+CT=   2915be4a1ecfdcbe3e023811a12bb6c7\r
+TEST= 134\r
+PT=   ffffffffffffffffffffffffffffffc0\r
+CT=   9b7b940f6c509f9e44a4ee140448ee46\r
+TEST= 135\r
+PT=   ffffffffffffffffffffffffffffff80\r
+CT=   0493370e054b09871130fe49af730a5a\r
+TEST= 136\r
+PT=   ffffffffffffffffffffffffffffff00\r
+CT=   29ee526770f2a11dcfa989d1ce88830f\r
+TEST= 137\r
+PT=   fffffffffffffffffffffffffffffe00\r
+CT=   ee0715b96f72e3f7a22a5064fc592f4c\r
+TEST= 138\r
+PT=   fffffffffffffffffffffffffffffc00\r
+CT=   27127daafc9accd2fb334ec3eba52323\r
+TEST= 139\r
+PT=   fffffffffffffffffffffffffffff800\r
+CT=   eb8168313e1cfdfdb5e986d5429cf172\r
+TEST= 140\r
+PT=   fffffffffffffffffffffffffffff000\r
+CT=   a423deabc173dcf7e2c4c53e77d37cd1\r
+TEST= 141\r
+PT=   ffffffffffffffffffffffffffffe000\r
+CT=   286894e48e537f8763b56707d7d155c8\r
+TEST= 142\r
+PT=   ffffffffffffffffffffffffffffc000\r
+CT=   683e2140585b18452dd4ffbb93c95df9\r
+TEST= 143\r
+PT=   ffffffffffffffffffffffffffff8000\r
+CT=   63fafabb72c07bfbd3ddc9b1203104b8\r
+TEST= 144\r
+PT=   ffffffffffffffffffffffffffff0000\r
+CT=   5f397bf03084820cc8810d52e5b666e9\r
+TEST= 145\r
+PT=   fffffffffffffffffffffffffffe0000\r
+CT=   4b00c27e8b26da7eab9d3a88dec8b031\r
+TEST= 146\r
+PT=   fffffffffffffffffffffffffffc0000\r
+CT=   0861a861c3db4e94194211b77ed761b9\r
+TEST= 147\r
+PT=   fffffffffffffffffffffffffff80000\r
+CT=   705a4ef8ba2133729c20185c3d3a4763\r
+TEST= 148\r
+PT=   fffffffffffffffffffffffffff00000\r
+CT=   8d683ee63e60d208e343ce48dbc44cac\r
+TEST= 149\r
+PT=   ffffffffffffffffffffffffffe00000\r
+CT=   afa2ffc137577092e2b654fa199d2c43\r
+TEST= 150\r
+PT=   ffffffffffffffffffffffffffc00000\r
+CT=   3cdf13e72dee4c581bafec70b85f9660\r
+TEST= 151\r
+PT=   ffffffffffffffffffffffffff800000\r
+CT=   2fd0e41c5b8402277354a7391d2618e2\r
+TEST= 152\r
+PT=   ffffffffffffffffffffffffff000000\r
+CT=   90ddbcb950843592dd47bbef00fdc876\r
+TEST= 153\r
+PT=   fffffffffffffffffffffffffe000000\r
+CT=   62526b78be79cb384633c91f83b4151b\r
+TEST= 154\r
+PT=   fffffffffffffffffffffffffc000000\r
+CT=   1f11d5d0355e0b556ccdb6c7f5083b4d\r
+TEST= 155\r
+PT=   fffffffffffffffffffffffff8000000\r
+CT=   220df19f85d69b1b562fa69a3c5beca5\r
+TEST= 156\r
+PT=   fffffffffffffffffffffffff0000000\r
+CT=   da86f292c6f41ea34fb2068df75ecc29\r
+TEST= 157\r
+PT=   ffffffffffffffffffffffffe0000000\r
+CT=   2be1fae5048a25582a679ca10905eb80\r
+TEST= 158\r
+PT=   ffffffffffffffffffffffffc0000000\r
+CT=   e2775e4b59c1bc2e31a2078c11b5a08c\r
+TEST= 159\r
+PT=   ffffffffffffffffffffffff80000000\r
+CT=   649f1cddc3792b4638635a392bc9bade\r
+TEST= 160\r
+PT=   ffffffffffffffffffffffff00000000\r
+CT=   21d9ba49f276b45f11af8fc71a088e3d\r
+TEST= 161\r
+PT=   fffffffffffffffffffffffe00000000\r
+CT=   1ac1f7102c59933e8b2ddc3f14e94baa\r
+TEST= 162\r
+PT=   fffffffffffffffffffffffc00000000\r
+CT=   e5c3b8e30fd2d8e6239b17b44bd23bbd\r
+TEST= 163\r
+PT=   fffffffffffffffffffffff800000000\r
+CT=   6f8ba6521152d31f2bada1843e26b973\r
+TEST= 164\r
+PT=   fffffffffffffffffffffff000000000\r
+CT=   83a63402a77f9ad5c1e931a931ecd706\r
+TEST= 165\r
+PT=   ffffffffffffffffffffffe000000000\r
+CT=   2bf27229901eb40f2df9d8398d1505ae\r
+TEST= 166\r
+PT=   ffffffffffffffffffffffc000000000\r
+CT=   7b8e7098e357ef71237d46d8b075b0f5\r
+TEST= 167\r
+PT=   ffffffffffffffffffffff8000000000\r
+CT=   55cfb3fb6d75cad0445bbc8dafa25b0f\r
+TEST= 168\r
+PT=   ffffffffffffffffffffff0000000000\r
+CT=   145b60d6d0193c23f4221848a892d61a\r
+TEST= 169\r
+PT=   fffffffffffffffffffffe0000000000\r
+CT=   905b6267f1d6ab5320835a133f096f2a\r
+TEST= 170\r
+PT=   fffffffffffffffffffffc0000000000\r
+CT=   8f476cbff75c1f725ce18e4bbcd19b32\r
+TEST= 171\r
+PT=   fffffffffffffffffffff80000000000\r
+CT=   9ad983f3bf651cd0393f0a73cccdea50\r
+TEST= 172\r
+PT=   fffffffffffffffffffff00000000000\r
+CT=   3b271f8ab2e6e4a20ba8090f43ba78f3\r
+TEST= 173\r
+PT=   ffffffffffffffffffffe00000000000\r
+CT=   39b333e8694f21546ad1edd9d87ed95b\r
+TEST= 174\r
+PT=   ffffffffffffffffffffc00000000000\r
+CT=   08b244ce7cbc8ee97fbba808cb146fda\r
+TEST= 175\r
+PT=   ffffffffffffffffffff800000000000\r
+CT=   4cc42fc1407b008fe350907c092e80ac\r
+TEST= 176\r
+PT=   ffffffffffffffffffff000000000000\r
+CT=   12e71214ae8e04f0bb63d7425c6f14d5\r
+TEST= 177\r
+PT=   fffffffffffffffffffe000000000000\r
+CT=   4620a49bd967491561669ab25dce45f4\r
+TEST= 178\r
+PT=   fffffffffffffffffffc000000000000\r
+CT=   b95ba05b332da61ef63a2b31fcad9879\r
+TEST= 179\r
+PT=   fffffffffffffffffff8000000000000\r
+CT=   0007e20b8298ec354f0f5fe7470f36bd\r
+TEST= 180\r
+PT=   fffffffffffffffffff0000000000000\r
+CT=   d1c5f6399bf382502e385eee1474a869\r
+TEST= 181\r
+PT=   ffffffffffffffffffe0000000000000\r
+CT=   a013014d4ce8054cf2591d06f6f2f176\r
+TEST= 182\r
+PT=   ffffffffffffffffffc0000000000000\r
+CT=   964153a83bf6989a4ba80daa91c3e081\r
+TEST= 183\r
+PT=   ffffffffffffffffff80000000000000\r
+CT=   7d9fa6a57530d0f036fec31c230b0cc6\r
+TEST= 184\r
+PT=   ffffffffffffffffff00000000000000\r
+CT=   76b5614a042707c98e2132e2e805fe63\r
+TEST= 185\r
+PT=   fffffffffffffffffe00000000000000\r
+CT=   959971ce4134190563518e700b9874d1\r
+TEST= 186\r
+PT=   fffffffffffffffffc00000000000000\r
+CT=   811441ce1d309eee7185e8c752c07557\r
+TEST= 187\r
+PT=   fffffffffffffffff800000000000000\r
+CT=   bc3594e865bcd0261b13202731f33580\r
+TEST= 188\r
+PT=   fffffffffffffffff000000000000000\r
+CT=   a37a5869b218a9f3a0868d19aea0ad6a\r
+TEST= 189\r
+PT=   ffffffffffffffffe000000000000000\r
+CT=   a1b19beee4e117139f74b3c53fdcb875\r
+TEST= 190\r
+PT=   ffffffffffffffffc000000000000000\r
+CT=   19f08e3420ee69b477ca1420281c4782\r
+TEST= 191\r
+PT=   ffffffffffffffff8000000000000000\r
+CT=   77f392089042e478ac16c0c86a0b5db5\r
+TEST= 192\r
+PT=   ffffffffffffffff0000000000000000\r
+CT=   9b58dbfd77fe5aca9cfc190cd1b82d19\r
+TEST= 193\r
+PT=   fffffffffffffffe0000000000000000\r
+CT=   faf82d178af25a9886a47e7f789b98d7\r
+TEST= 194\r
+PT=   fffffffffffffffc0000000000000000\r
+CT=   d8e2bb1ae8ee3dcf5bf7d6c38da82a1a\r
+TEST= 195\r
+PT=   fffffffffffffff80000000000000000\r
+CT=   1d7c0c4040b355b9d107a99325e3b050\r
+TEST= 196\r
+PT=   fffffffffffffff00000000000000000\r
+CT=   b1144ddfa75755213390e7c596660490\r
+TEST= 197\r
+PT=   ffffffffffffffe00000000000000000\r
+CT=   768f520efe0f23e61d3ec8ad9ce91774\r
+TEST= 198\r
+PT=   ffffffffffffffc00000000000000000\r
+CT=   56ede9dda3f6f141bff1757fa689c3e1\r
+TEST= 199\r
+PT=   ffffffffffffff800000000000000000\r
+CT=   0d9ac756eb297695eed4d382eb126d26\r
+TEST= 200\r
+PT=   ffffffffffffff000000000000000000\r
+CT=   c0838d1a2b16a7c7f0dfcc433c399c33\r
+TEST= 201\r
+PT=   fffffffffffffe000000000000000000\r
+CT=   cc3526262b92f02edce548f716b9f45c\r
+TEST= 202\r
+PT=   fffffffffffffc000000000000000000\r
+CT=   c090313eb98674f35f3123385fb95d4d\r
+TEST= 203\r
+PT=   fffffffffffff8000000000000000000\r
+CT=   dd27cac6401a022e8f38f9f93e774417\r
+TEST= 204\r
+PT=   fffffffffffff0000000000000000000\r
+CT=   4632154179a555c17ea604d0889fab14\r
+TEST= 205\r
+PT=   ffffffffffffe0000000000000000000\r
+CT=   a1853fe47fe29289d153161d06387d21\r
+TEST= 206\r
+PT=   ffffffffffffc0000000000000000000\r
+CT=   cd2b1fec11fd906c5c7630099443610a\r
+TEST= 207\r
+PT=   ffffffffffff80000000000000000000\r
+CT=   b1d4efe40242f83e93b6c8d7efb5eae9\r
+TEST= 208\r
+PT=   ffffffffffff00000000000000000000\r
+CT=   ead731af4d3a2fe3b34bed047942a49f\r
+TEST= 209\r
+PT=   fffffffffffe00000000000000000000\r
+CT=   1a518dddaf9efa0d002cc58d107edfc8\r
+TEST= 210\r
+PT=   fffffffffffc00000000000000000000\r
+CT=   e67ae6426bf9526c972cff072b52252c\r
+TEST= 211\r
+PT=   fffffffffff800000000000000000000\r
+CT=   20ebc86f1304d272e2e207e59db639f0\r
+TEST= 212\r
+PT=   fffffffffff000000000000000000000\r
+CT=   3f5f9106d0e52f973d4890e6f37e8a00\r
+TEST= 213\r
+PT=   ffffffffffe000000000000000000000\r
+CT=   ac9bd8e2530469134b9d5b065d4f565b\r
+TEST= 214\r
+PT=   ffffffffffc000000000000000000000\r
+CT=   2463531ab54d66955e73edc4cb8eaa45\r
+TEST= 215\r
+PT=   ffffffffff8000000000000000000000\r
+CT=   48c7d0e80834ebdc35b6735f76b46c8b\r
+TEST= 216\r
+PT=   ffffffffff0000000000000000000000\r
+CT=   f96b0c4a8bc6c86130289f60b43b8fba\r
+TEST= 217\r
+PT=   fffffffffe0000000000000000000000\r
+CT=   11a45530f624ff6f76a1b3826626ff7b\r
+TEST= 218\r
+PT=   fffffffffc0000000000000000000000\r
+CT=   49d541b2e74cfe73e6a8e8225f7bd449\r
+TEST= 219\r
+PT=   fffffffff80000000000000000000000\r
+CT=   54fafe26e4287f17d1935f87eb9ade01\r
+TEST= 220\r
+PT=   fffffffff00000000000000000000000\r
+CT=   9a682acf40be01f5b2a4193c9a82404d\r
+TEST= 221\r
+PT=   ffffffffe00000000000000000000000\r
+CT=   753665c4af1eff33aa8b628bf8741cfd\r
+TEST= 222\r
+PT=   ffffffffc00000000000000000000000\r
+CT=   9b471596dc69ae1586cee6158b0b0181\r
+TEST= 223\r
+PT=   ffffffff800000000000000000000000\r
+CT=   42a1136e5f8d8d21d3101998642d573b\r
+TEST= 224\r
+PT=   ffffffff000000000000000000000000\r
+CT=   6a4981f2915e3e68af6c22385dd06756\r
+TEST= 225\r
+PT=   fffffffe000000000000000000000000\r
+CT=   8d6a8afe55a6e481badae0d146f436db\r
+TEST= 226\r
+PT=   fffffffc000000000000000000000000\r
+CT=   fbd6640c80245c2b805373f130703127\r
+TEST= 227\r
+PT=   fffffff8000000000000000000000000\r
+CT=   cf37cdaaa0d2d536c71857634c792064\r
+TEST= 228\r
+PT=   fffffff0000000000000000000000000\r
+CT=   96f96e9d607f6615fc192061ee648b07\r
+TEST= 229\r
+PT=   ffffffe0000000000000000000000000\r
+CT=   abf4154a3375a1d3e6b1d454438f95a6\r
+TEST= 230\r
+PT=   ffffffc0000000000000000000000000\r
+CT=   1f8eedea0f62a1406d58cfc3ecea72cf\r
+TEST= 231\r
+PT=   ffffff80000000000000000000000000\r
+CT=   36aff0ef7bf3280772cf4cac80a0d2b2\r
+TEST= 232\r
+PT=   ffffff00000000000000000000000000\r
+CT=   ac86bc606b6640c309e782f232bf367f\r
+TEST= 233\r
+PT=   fffffe00000000000000000000000000\r
+CT=   6ef4cc4de49b11065d7af2909854794a\r
+TEST= 234\r
+PT=   fffffc00000000000000000000000000\r
+CT=   b1f4066e6f4f187dfe5f2ad1b17819d0\r
+TEST= 235\r
+PT=   fffff800000000000000000000000000\r
+CT=   d5e38bf15f16d90e3e214041d774daa8\r
+TEST= 236\r
+PT=   fffff000000000000000000000000000\r
+CT=   3ee500c5c8d63479717163e55c5c4522\r
+TEST= 237\r
+PT=   ffffe000000000000000000000000000\r
+CT=   2239455e7afe3b0616100288cc5a723b\r
+TEST= 238\r
+PT=   ffffc000000000000000000000000000\r
+CT=   59e858eaaa97fec38111275b6cf5abc0\r
+TEST= 239\r
+PT=   ffff8000000000000000000000000000\r
+CT=   1fe6cc3c05965dc08eb0590c95ac71d0\r
+TEST= 240\r
+PT=   ffff0000000000000000000000000000\r
+CT=   300ade92f88f48fa2df730ec16ef44cd\r
+TEST= 241\r
+PT=   fffe0000000000000000000000000000\r
+CT=   1569859ea6b7206c30bf4fd0cbfac33c\r
+TEST= 242\r
+PT=   fffc0000000000000000000000000000\r
+CT=   dc8f0e4915fd81ba70a331310882f6da\r
+TEST= 243\r
+PT=   fff80000000000000000000000000000\r
+CT=   047bba83f7aa841731504e012208fc9e\r
+TEST= 244\r
+PT=   fff00000000000000000000000000000\r
+CT=   c218faa16056bd0774c3e8d79c35a5e4\r
+TEST= 245\r
+PT=   ffe00000000000000000000000000000\r
+CT=   0dc58a8d886623705aec15cb1e70dc0e\r
+TEST= 246\r
+PT=   ffc00000000000000000000000000000\r
+CT=   fe1cffb83f45dcfb38b29be438dbd3ab\r
+TEST= 247\r
+PT=   ff800000000000000000000000000000\r
+CT=   8bcd40f94ebb63b9f7909676e667f1e7\r
+TEST= 248\r
+PT=   ff000000000000000000000000000000\r
+CT=   49af6b372135acef10132e548f217b17\r
+TEST= 249\r
+PT=   fe000000000000000000000000000000\r
+CT=   8092a4dcf2da7e77e93bdd371dfed82e\r
+TEST= 250\r
+PT=   fc000000000000000000000000000000\r
+CT=   e74cd1c92f0919c35a0324123d6177d3\r
+TEST= 251\r
+PT=   f8000000000000000000000000000000\r
+CT=   7818d800dcf6f4be1e0e94f403d1e4c2\r
+TEST= 252\r
+PT=   f0000000000000000000000000000000\r
+CT=   7f2c5ece07a98d8bee13c51177395ff7\r
+TEST= 253\r
+PT=   e0000000000000000000000000000000\r
+CT=   9b80eefb7ebe2d2b16247aa0efc72f5d\r
+TEST= 254\r
+PT=   c0000000000000000000000000000000\r
+CT=   0a6bdc6d4c1e6280301fd8e97ddbe601\r
+TEST= 255\r
+PT=   80000000000000000000000000000000\r
+CT=   ddc6bf790c15760d8d9aeb6f9a75fd4e\r
diff --git a/test/dfregress/testcases/crypto/aes/ecbvk44.txt b/test/dfregress/testcases/crypto/aes/ecbvk44.txt
new file mode 100644 (file)
index 0000000..04f3089
--- /dev/null
@@ -0,0 +1,398 @@
+==============================================\r
+Author:    Dr B R Gladman (                 )\r
+Test:      ECB Variable Key Known Answer Tests\r
+Algorithm: Extended Rijndael (an AES Superset)\r
+Filename:  ecbvk44.txt\r
+==============================================\r
+\r
+BLOCKSIZE=128\r
+KEYSIZE=  128\r
+\r
+PT=   00000000000000000000000000000000\r
+TEST= 0\r
+KEY=  00000000000000000000000000000000\r
+CT=   66e94bd4ef8a2c3b884cfa59ca342b2e\r
+TEST= 1\r
+KEY=  80000000000000000000000000000000\r
+CT=   0edd33d3c621e546455bd8ba1418bec8\r
+TEST= 2\r
+KEY=  40000000000000000000000000000000\r
+CT=   c0cc0c5da5bd63acd44a80774fad5222\r
+TEST= 3\r
+KEY=  20000000000000000000000000000000\r
+CT=   2f0b4b71bc77851b9ca56d42eb8ff080\r
+TEST= 4\r
+KEY=  10000000000000000000000000000000\r
+CT=   6b1e2fffe8a114009d8fe22f6db5f876\r
+TEST= 5\r
+KEY=  08000000000000000000000000000000\r
+CT=   9aa042c315f94cbb97b62202f83358f5\r
+TEST= 6\r
+KEY=  04000000000000000000000000000000\r
+CT=   dbe01de67e346a800c4c4b4880311de4\r
+TEST= 7\r
+KEY=  02000000000000000000000000000000\r
+CT=   c117d2238d53836acd92ddcdb85d6a21\r
+TEST= 8\r
+KEY=  01000000000000000000000000000000\r
+CT=   dc0ed85df9611abb7249cdd168c5467e\r
+TEST= 9\r
+KEY=  00800000000000000000000000000000\r
+CT=   807d678fff1f56fa92de3381904842f2\r
+TEST= 10\r
+KEY=  00400000000000000000000000000000\r
+CT=   0e53b3fcad8e4b130ef73aeb957fb402\r
+TEST= 11\r
+KEY=  00200000000000000000000000000000\r
+CT=   969ffd3b7c35439417e7bde923035d65\r
+TEST= 12\r
+KEY=  00100000000000000000000000000000\r
+CT=   a99b512c19ca56070491166a1503bf15\r
+TEST= 13\r
+KEY=  00080000000000000000000000000000\r
+CT=   6e9985252126ee344d26ae369d2327e3\r
+TEST= 14\r
+KEY=  00040000000000000000000000000000\r
+CT=   b85f4809f904c275491fcdcd1610387e\r
+TEST= 15\r
+KEY=  00020000000000000000000000000000\r
+CT=   ed365b8d7d20c1f5d53fb94dd211df7b\r
+TEST= 16\r
+KEY=  00010000000000000000000000000000\r
+CT=   b3a575e86a8db4a7135d604c43304896\r
+TEST= 17\r
+KEY=  00008000000000000000000000000000\r
+CT=   89704bcb8e69f846259eb0accbc7f8a2\r
+TEST= 18\r
+KEY=  00004000000000000000000000000000\r
+CT=   c56ee7c92197861f10d7a92b90882055\r
+TEST= 19\r
+KEY=  00002000000000000000000000000000\r
+CT=   92f296f6846e0eaf9422a5a24a08b069\r
+TEST= 20\r
+KEY=  00001000000000000000000000000000\r
+CT=   e67e32bb8f11deb8699318bee9e91a60\r
+TEST= 21\r
+KEY=  00000800000000000000000000000000\r
+CT=   b08eef85eaf626dd91b65c4c3a97d92b\r
+TEST= 22\r
+KEY=  00000400000000000000000000000000\r
+CT=   661083a6addce79bb4e0859ab5538013\r
+TEST= 23\r
+KEY=  00000200000000000000000000000000\r
+CT=   55dfe2941e0eb10afc0b333bd34de1fe\r
+TEST= 24\r
+KEY=  00000100000000000000000000000000\r
+CT=   6bfe5945e715c9662609770f8846087a\r
+TEST= 25\r
+KEY=  00000080000000000000000000000000\r
+CT=   79848e9c30c2f8cda8b325f7fed2b139\r
+TEST= 26\r
+KEY=  00000040000000000000000000000000\r
+CT=   7a713a53b99fef34ac04deef80965bd0\r
+TEST= 27\r
+KEY=  00000020000000000000000000000000\r
+CT=   18144a2b46620d32c3c32ce52d49257f\r
+TEST= 28\r
+KEY=  00000010000000000000000000000000\r
+CT=   872e827c70887c80749f7b8bb1847c7e\r
+TEST= 29\r
+KEY=  00000008000000000000000000000000\r
+CT=   6b86c6a4fe6a60c59b1a3102f8de49f3\r
+TEST= 30\r
+KEY=  00000004000000000000000000000000\r
+CT=   9848bb3dfdf6f532f094679a4c231a20\r
+TEST= 31\r
+KEY=  00000002000000000000000000000000\r
+CT=   925ad528e852e329b2091cd3f1c2bcee\r
+TEST= 32\r
+KEY=  00000001000000000000000000000000\r
+CT=   80df436544b0dd596722e46792a40cd8\r
+TEST= 33\r
+KEY=  00000000800000000000000000000000\r
+CT=   525daf18f93e83e1e74bbbdde4263bba\r
+TEST= 34\r
+KEY=  00000000400000000000000000000000\r
+CT=   f65c9d2ee485d24701ffa3313b9d5be6\r
+TEST= 35\r
+KEY=  00000000200000000000000000000000\r
+CT=   e4fc8d8bca06425bdf94afa40fcc14ba\r
+TEST= 36\r
+KEY=  00000000100000000000000000000000\r
+CT=   a53f0a5ca1e4e6440bb975ff320de6f8\r
+TEST= 37\r
+KEY=  00000000080000000000000000000000\r
+CT=   d55313b9394080462e87e02899b553f0\r
+TEST= 38\r
+KEY=  00000000040000000000000000000000\r
+CT=   34a71d761f71bcd344384c7f97d27906\r
+TEST= 39\r
+KEY=  00000000020000000000000000000000\r
+CT=   233f3d819599612ebc89580245c996a8\r
+TEST= 40\r
+KEY=  00000000010000000000000000000000\r
+CT=   b4f1374e5268dbcb676e447529e53f89\r
+TEST= 41\r
+KEY=  00000000008000000000000000000000\r
+CT=   0816bd27861d2ba891d1044e39951e96\r
+TEST= 42\r
+KEY=  00000000004000000000000000000000\r
+CT=   f3be9ea3f10c73ca64fde5db13a951d1\r
+TEST= 43\r
+KEY=  00000000002000000000000000000000\r
+CT=   2448086a8106fbd03048ddf857d3f1c8\r
+TEST= 44\r
+KEY=  00000000001000000000000000000000\r
+CT=   670756e65bec8b68f03d77cdcdce7b91\r
+TEST= 45\r
+KEY=  00000000000800000000000000000000\r
+CT=   ef968cf0d36fd6c6effd225f6fb44ca9\r
+TEST= 46\r
+KEY=  00000000000400000000000000000000\r
+CT=   2e8767157922e3826ddcec1b0cc1e105\r
+TEST= 47\r
+KEY=  00000000000200000000000000000000\r
+CT=   78ce7eec670e45a967bab17e26a1ad36\r
+TEST= 48\r
+KEY=  00000000000100000000000000000000\r
+CT=   3c5cee825655f098f6e81a2f417da3fb\r
+TEST= 49\r
+KEY=  00000000000080000000000000000000\r
+CT=   67bfdb431dce1292200bc6f5207adb12\r
+TEST= 50\r
+KEY=  00000000000040000000000000000000\r
+CT=   7540fd38e447c0779228548747843a6f\r
+TEST= 51\r
+KEY=  00000000000020000000000000000000\r
+CT=   b85e513301f8a936ea9ec8a21a85b5e6\r
+TEST= 52\r
+KEY=  00000000000010000000000000000000\r
+CT=   04c67dbf16c11427d507a455de2c9bc5\r
+TEST= 53\r
+KEY=  00000000000008000000000000000000\r
+CT=   03f75eb8959e55079cffb4ff149a37b6\r
+TEST= 54\r
+KEY=  00000000000004000000000000000000\r
+CT=   74550287f666c63bb9bc7838433434b0\r
+TEST= 55\r
+KEY=  00000000000002000000000000000000\r
+CT=   7d537200195ebc3aefd1eaab1c385221\r
+TEST= 56\r
+KEY=  00000000000001000000000000000000\r
+CT=   ce24e4d40c68a82b535cbd3c8e21652a\r
+TEST= 57\r
+KEY=  00000000000000800000000000000000\r
+CT=   ab20072405aa8fc40265c6f1f3dc8bc0\r
+TEST= 58\r
+KEY=  00000000000000400000000000000000\r
+CT=   6cfd2cf688f566b093f67b9b3839e80a\r
+TEST= 59\r
+KEY=  00000000000000200000000000000000\r
+CT=   bd95977e6b7239d407a012c5544bf584\r
+TEST= 60\r
+KEY=  00000000000000100000000000000000\r
+CT=   df9c0130ac77e7c72c997f587b46dbe0\r
+TEST= 61\r
+KEY=  00000000000000080000000000000000\r
+CT=   e7f1b82cadc53a648798945b34efeff2\r
+TEST= 62\r
+KEY=  00000000000000040000000000000000\r
+CT=   932c6dbf69255cf13edcdb72233acea3\r
+TEST= 63\r
+KEY=  00000000000000020000000000000000\r
+CT=   5c76002bc7206560efe550c80b8f12cc\r
+TEST= 64\r
+KEY=  00000000000000010000000000000000\r
+CT=   f6b7bdd1caeebab574683893c4475484\r
+TEST= 65\r
+KEY=  00000000000000008000000000000000\r
+CT=   a920e37cc6dc6b31da8c0169569f5034\r
+TEST= 66\r
+KEY=  00000000000000004000000000000000\r
+CT=   919380ecd9c778bc513148b0c28d65fd\r
+TEST= 67\r
+KEY=  00000000000000002000000000000000\r
+CT=   ee67308dd3f2d9e6c2170755e5784be1\r
+TEST= 68\r
+KEY=  00000000000000001000000000000000\r
+CT=   3cc73e53b85609023a05e149b223ae09\r
+TEST= 69\r
+KEY=  00000000000000000800000000000000\r
+CT=   983e8af7cf05ebb28d71eb841c9406e6\r
+TEST= 70\r
+KEY=  00000000000000000400000000000000\r
+CT=   0f3099b2d31fa5299ee5bf43193287fc\r
+TEST= 71\r
+KEY=  00000000000000000200000000000000\r
+CT=   b763d84f38c27fe6931dceb6715d4db6\r
+TEST= 72\r
+KEY=  00000000000000000100000000000000\r
+CT=   5ae3c9b0e3cc29c0c61565cd01f8a248\r
+TEST= 73\r
+KEY=  00000000000000000080000000000000\r
+CT=   f58083572cd90981958565d48d2dee25\r
+TEST= 74\r
+KEY=  00000000000000000040000000000000\r
+CT=   7e6255eef8f70c0ef10337aab1cccef8\r
+TEST= 75\r
+KEY=  00000000000000000020000000000000\r
+CT=   aad4bac34db22821841ce2f631961902\r
+TEST= 76\r
+KEY=  00000000000000000010000000000000\r
+CT=   d7431c0409bb1441ba9c6858dc7d4e81\r
+TEST= 77\r
+KEY=  00000000000000000008000000000000\r
+CT=   ef9298c65e339f6e801a59c626456993\r
+TEST= 78\r
+KEY=  00000000000000000004000000000000\r
+CT=   53fe29f68ff541abc3f0ef3350b72f7e\r
+TEST= 79\r
+KEY=  00000000000000000002000000000000\r
+CT=   f6bba5c10db02529e2c2da3fb582cc14\r
+TEST= 80\r
+KEY=  00000000000000000001000000000000\r
+CT=   e4239aa37fc531a386dad1126fc0e9cd\r
+TEST= 81\r
+KEY=  00000000000000000000800000000000\r
+CT=   8f7758f857d15bbe7bfd0e416404c365\r
+TEST= 82\r
+KEY=  00000000000000000000400000000000\r
+CT=   d273eb57c687bcd1b4ea7218a509e7b8\r
+TEST= 83\r
+KEY=  00000000000000000000200000000000\r
+CT=   65d64f8d76e8b3423fa25c4eb58a210a\r
+TEST= 84\r
+KEY=  00000000000000000000100000000000\r
+CT=   623d802b4ec450d66a16625702fcdbe0\r
+TEST= 85\r
+KEY=  00000000000000000000080000000000\r
+CT=   7496460cb28e5791baeaf9b68fb00022\r
+TEST= 86\r
+KEY=  00000000000000000000040000000000\r
+CT=   34ea600f18bb0694b41681a49d510c1d\r
+TEST= 87\r
+KEY=  00000000000000000000020000000000\r
+CT=   5f8ff0d47d5766d29b5d6e8f46423bd8\r
+TEST= 88\r
+KEY=  00000000000000000000010000000000\r
+CT=   225f9286c5928bf09f84d3f93f541959\r
+TEST= 89\r
+KEY=  00000000000000000000008000000000\r
+CT=   b21e90d25df383416a5f072cebeb1ffb\r
+TEST= 90\r
+KEY=  00000000000000000000004000000000\r
+CT=   4aefcda089318125453eb9e8eb5e492e\r
+TEST= 91\r
+KEY=  00000000000000000000002000000000\r
+CT=   4d3e75c6cd40ec4869bc85158591adb8\r
+TEST= 92\r
+KEY=  00000000000000000000001000000000\r
+CT=   63a8b904405436a1b99d7751866771b7\r
+TEST= 93\r
+KEY=  00000000000000000000000800000000\r
+CT=   64f0daae47529199792eae172ba53293\r
+TEST= 94\r
+KEY=  00000000000000000000000400000000\r
+CT=   c3eef84bea18225d515a8c852a9047ee\r
+TEST= 95\r
+KEY=  00000000000000000000000200000000\r
+CT=   a44ac422b47d47b81af73b3e9ac9596e\r
+TEST= 96\r
+KEY=  00000000000000000000000100000000\r
+CT=   d16e04a8fbc435094f8d53adf25f5084\r
+TEST= 97\r
+KEY=  00000000000000000000000080000000\r
+CT=   ef13dc34bab03e124eead8b6bf44b532\r
+TEST= 98\r
+KEY=  00000000000000000000000040000000\r
+CT=   d94799075c24dcc067af0d392049250d\r
+TEST= 99\r
+KEY=  00000000000000000000000020000000\r
+CT=   14f431771eddce4764c21a2254b5e3c8\r
+TEST= 100\r
+KEY=  00000000000000000000000010000000\r
+CT=   7039329f36f2ed682b02991f28d64679\r
+TEST= 101\r
+KEY=  00000000000000000000000008000000\r
+CT=   124ee24ede5551639db8b8b941f6141d\r
+TEST= 102\r
+KEY=  00000000000000000000000004000000\r
+CT=   c2852879a34d5184e478ec918b993fee\r
+TEST= 103\r
+KEY=  00000000000000000000000002000000\r
+CT=   86a806a3525b93e432053c9ab5abbedf\r
+TEST= 104\r
+KEY=  00000000000000000000000001000000\r
+CT=   c1609bf5a4f07e37c17a36366ec23ecc\r
+TEST= 105\r
+KEY=  00000000000000000000000000800000\r
+CT=   7e81e7cb92159a51ffcea331b1e8ea53\r
+TEST= 106\r
+KEY=  00000000000000000000000000400000\r
+CT=   37a7be002856c5a59a6e03eafce7729a\r
+TEST= 107\r
+KEY=  00000000000000000000000000200000\r
+CT=   bdf98a5a4f91e890c9a1d1e5faab138f\r
+TEST= 108\r
+KEY=  00000000000000000000000000100000\r
+CT=   4e96acb66e051f2bc739cc3d3e34a26b\r
+TEST= 109\r
+KEY=  00000000000000000000000000080000\r
+CT=   ee996cdd120eb86e21ecfa49e8e1fcf1\r
+TEST= 110\r
+KEY=  00000000000000000000000000040000\r
+CT=   61b9e6b579dbf6070c351a1440dd85ff\r
+TEST= 111\r
+KEY=  00000000000000000000000000020000\r
+CT=   ac369e484316440b40dfc83aa96e28e7\r
+TEST= 112\r
+KEY=  00000000000000000000000000010000\r
+CT=   0a2d16de985c76d45c579c1159413bbe\r
+TEST= 113\r
+KEY=  00000000000000000000000000008000\r
+CT=   da3fdc38da1d374fa4802cda1a1c6b0f\r
+TEST= 114\r
+KEY=  00000000000000000000000000004000\r
+CT=   b842523d4c41c2211afe43a5800adce3\r
+TEST= 115\r
+KEY=  00000000000000000000000000002000\r
+CT=   9e2cda90d8e992dba6c73d8229567192\r
+TEST= 116\r
+KEY=  00000000000000000000000000001000\r
+CT=   d49583b781d9e20f5be101415957fc49\r
+TEST= 117\r
+KEY=  00000000000000000000000000000800\r
+CT=   ef09da5c12b376e458b9b8670032498e\r
+TEST= 118\r
+KEY=  00000000000000000000000000000400\r
+CT=   a96be0463da774461a5e1d5a9dd1ac10\r
+TEST= 119\r
+KEY=  00000000000000000000000000000200\r
+CT=   32cee3341060790d2d4b1362ef397090\r
+TEST= 120\r
+KEY=  00000000000000000000000000000100\r
+CT=   21cea416a3d3359d2c4d58fb6a035f06\r
+TEST= 121\r
+KEY=  00000000000000000000000000000080\r
+CT=   172aeab3d507678ecaf455c12587adb7\r
+TEST= 122\r
+KEY=  00000000000000000000000000000040\r
+CT=   b6f897941ef8ebff9fe80a567ef38478\r
+TEST= 123\r
+KEY=  00000000000000000000000000000020\r
+CT=   a9723259d94a7dc662fb0c782ca3f1dd\r
+TEST= 124\r
+KEY=  00000000000000000000000000000010\r
+CT=   2f91c984b9a4839f30001b9f430493b4\r
+TEST= 125\r
+KEY=  00000000000000000000000000000008\r
+CT=   0472406345a610b048cb99ee0ef3fa0f\r
+TEST= 126\r
+KEY=  00000000000000000000000000000004\r
+CT=   f5f39086646f8c05ed16efa4b617957c\r
+TEST= 127\r
+KEY=  00000000000000000000000000000002\r
+CT=   26d50f485a30408d5af47a5736292450\r
+TEST= 128\r
+KEY=  00000000000000000000000000000001\r
+CT=   0545aad56da2a97c3663d1432a3d1c84\r
diff --git a/test/dfregress/testcases/crypto/aes/ecbvk48.txt b/test/dfregress/testcases/crypto/aes/ecbvk48.txt
new file mode 100644 (file)
index 0000000..e11c0c9
--- /dev/null
@@ -0,0 +1,782 @@
+==============================================\r
+Author:    Dr B R Gladman (                 )\r
+Test:      ECB Variable Key Known Answer Tests\r
+Algorithm: Extended Rijndael (an AES Superset)\r
+Filename:  ecbvk48.txt\r
+==============================================\r
+\r
+BLOCKSIZE=128\r
+KEYSIZE=  256\r
+\r
+PT=   00000000000000000000000000000000\r
+TEST= 0\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000000\r
+CT=   dc95c078a2408989ad48a21492842087\r
+TEST= 1\r
+KEY=  8000000000000000000000000000000000000000000000000000000000000000\r
+CT=   e35a6dcb19b201a01ebcfa8aa22b5759\r
+TEST= 2\r
+KEY=  4000000000000000000000000000000000000000000000000000000000000000\r
+CT=   5075c2405b76f22f553488cae47ce90b\r
+TEST= 3\r
+KEY=  2000000000000000000000000000000000000000000000000000000000000000\r
+CT=   49df95d844a0145a7de01c91793302d3\r
+TEST= 4\r
+KEY=  1000000000000000000000000000000000000000000000000000000000000000\r
+CT=   e7396d778e940b8418a86120e5f421fe\r
+TEST= 5\r
+KEY=  0800000000000000000000000000000000000000000000000000000000000000\r
+CT=   05f535c36fcede4657be37f4087db1ef\r
+TEST= 6\r
+KEY=  0400000000000000000000000000000000000000000000000000000000000000\r
+CT=   d0c1dddd10da777c68ab36af51f2c204\r
+TEST= 7\r
+KEY=  0200000000000000000000000000000000000000000000000000000000000000\r
+CT=   1c55fb811b5c6464c4e5de1535a75514\r
+TEST= 8\r
+KEY=  0100000000000000000000000000000000000000000000000000000000000000\r
+CT=   52917f3ae957d5230d3a2af57c7b5a71\r
+TEST= 9\r
+KEY=  0080000000000000000000000000000000000000000000000000000000000000\r
+CT=   c6e3d5501752dd5e9aef086d6b45d705\r
+TEST= 10\r
+KEY=  0040000000000000000000000000000000000000000000000000000000000000\r
+CT=   a24a9c7af1d9b1e17e1c9a3e711b3fa7\r
+TEST= 11\r
+KEY=  0020000000000000000000000000000000000000000000000000000000000000\r
+CT=   b881eca724a6d43dbc6b96f6f59a0d20\r
+TEST= 12\r
+KEY=  0010000000000000000000000000000000000000000000000000000000000000\r
+CT=   ec524d9a24dfff2a9639879b83b8e137\r
+TEST= 13\r
+KEY=  0008000000000000000000000000000000000000000000000000000000000000\r
+CT=   34c4f345f5466215a037f443635d6f75\r
+TEST= 14\r
+KEY=  0004000000000000000000000000000000000000000000000000000000000000\r
+CT=   5ba5055bedb8895f672e29f2eb5a355d\r
+TEST= 15\r
+KEY=  0002000000000000000000000000000000000000000000000000000000000000\r
+CT=   b3f692aa3a435259ebbef9b51ad1e08d\r
+TEST= 16\r
+KEY=  0001000000000000000000000000000000000000000000000000000000000000\r
+CT=   414feb4376f2c64a5d2fbb2ed531ba7d\r
+TEST= 17\r
+KEY=  0000800000000000000000000000000000000000000000000000000000000000\r
+CT=   a20d519e3bca3303f07e81719f61605e\r
+TEST= 18\r
+KEY=  0000400000000000000000000000000000000000000000000000000000000000\r
+CT=   a08d10e520af811f45bd60a2dc0dc4b1\r
+TEST= 19\r
+KEY=  0000200000000000000000000000000000000000000000000000000000000000\r
+CT=   b06893a8c563c430e6f3858826efbbe4\r
+TEST= 20\r
+KEY=  0000100000000000000000000000000000000000000000000000000000000000\r
+CT=   0ffee26ae2d3929c6bd9c6bedff84409\r
+TEST= 21\r
+KEY=  0000080000000000000000000000000000000000000000000000000000000000\r
+CT=   4d0f5e906ed77801fc0ef53edc5f9e2b\r
+TEST= 22\r
+KEY=  0000040000000000000000000000000000000000000000000000000000000000\r
+CT=   8b6ec00119ad8b026dce56ea7defe930\r
+TEST= 23\r
+KEY=  0000020000000000000000000000000000000000000000000000000000000000\r
+CT=   69026591d43363ee9d83b5007f0b484e\r
+TEST= 24\r
+KEY=  0000010000000000000000000000000000000000000000000000000000000000\r
+CT=   27135d86950c6a2f86872706279a4761\r
+TEST= 25\r
+KEY=  0000008000000000000000000000000000000000000000000000000000000000\r
+CT=   35e6db8723f281da410c3ac8535ed77c\r
+TEST= 26\r
+KEY=  0000004000000000000000000000000000000000000000000000000000000000\r
+CT=   57427cf214b8c28e4bbf487ccb8d0e09\r
+TEST= 27\r
+KEY=  0000002000000000000000000000000000000000000000000000000000000000\r
+CT=   6df01bf56e5131ac87f96e99cab86367\r
+TEST= 28\r
+KEY=  0000001000000000000000000000000000000000000000000000000000000000\r
+CT=   3856c5b55790b768bbf7d43031579bcf\r
+TEST= 29\r
+KEY=  0000000800000000000000000000000000000000000000000000000000000000\r
+CT=   1e6ed8fb7c15bc4d2f63ba7037ed44d0\r
+TEST= 30\r
+KEY=  0000000400000000000000000000000000000000000000000000000000000000\r
+CT=   e1b2ed6cd8d93d455534e401156d4bcf\r
+TEST= 31\r
+KEY=  0000000200000000000000000000000000000000000000000000000000000000\r
+CT=   efbcca5bdfdad10e875f02336212ce36\r
+TEST= 32\r
+KEY=  0000000100000000000000000000000000000000000000000000000000000000\r
+CT=   0b777f02fd18dce2646dcfe868dfafad\r
+TEST= 33\r
+KEY=  0000000080000000000000000000000000000000000000000000000000000000\r
+CT=   c8a104b5693d1b14f5bf1f10100bf508\r
+TEST= 34\r
+KEY=  0000000040000000000000000000000000000000000000000000000000000000\r
+CT=   4cce6615244afcb38408fece219962ea\r
+TEST= 35\r
+KEY=  0000000020000000000000000000000000000000000000000000000000000000\r
+CT=   f99e7845d3a255b394c9c050cba258b1\r
+TEST= 36\r
+KEY=  0000000010000000000000000000000000000000000000000000000000000000\r
+CT=   b4afbb787f9bcfb7b55fdf447f611295\r
+TEST= 37\r
+KEY=  0000000008000000000000000000000000000000000000000000000000000000\r
+CT=   ae1c426a697faf2808b7ef6addb5c020\r
+TEST= 38\r
+KEY=  0000000004000000000000000000000000000000000000000000000000000000\r
+CT=   7572f92811a85b9bdd38dead9945bcae\r
+TEST= 39\r
+KEY=  0000000002000000000000000000000000000000000000000000000000000000\r
+CT=   71bc7aa46e43fb95a181527d9f6a360f\r
+TEST= 40\r
+KEY=  0000000001000000000000000000000000000000000000000000000000000000\r
+CT=   5542ef2923066f1ec8f546dd0d8e7ca8\r
+TEST= 41\r
+KEY=  0000000000800000000000000000000000000000000000000000000000000000\r
+CT=   6b92317c7d623790b748fdd7efc42422\r
+TEST= 42\r
+KEY=  0000000000400000000000000000000000000000000000000000000000000000\r
+CT=   0fe7c097e899c71ef045360f8d6c25cf\r
+TEST= 43\r
+KEY=  0000000000200000000000000000000000000000000000000000000000000000\r
+CT=   4ece7ee107d0264d04693151c25b9df6\r
+TEST= 44\r
+KEY=  0000000000100000000000000000000000000000000000000000000000000000\r
+CT=   fd6ae687cbfca9e301045888d3bb9605\r
+TEST= 45\r
+KEY=  0000000000080000000000000000000000000000000000000000000000000000\r
+CT=   476b579c8556c7254424902cc1d6d36e\r
+TEST= 46\r
+KEY=  0000000000040000000000000000000000000000000000000000000000000000\r
+CT=   4133cbcdfdd6b8860a1fc18665d6d71b\r
+TEST= 47\r
+KEY=  0000000000020000000000000000000000000000000000000000000000000000\r
+CT=   3b36ec2664798c108b816812c65dfdc7\r
+TEST= 48\r
+KEY=  0000000000010000000000000000000000000000000000000000000000000000\r
+CT=   364e20a234fea385d48dc5a09c9e70cf\r
+TEST= 49\r
+KEY=  0000000000008000000000000000000000000000000000000000000000000000\r
+CT=   4a4ba25969de3f5ee5642c71aad0efd1\r
+TEST= 50\r
+KEY=  0000000000004000000000000000000000000000000000000000000000000000\r
+CT=   e42cbaae43297f67a76c1c501bb79e36\r
+TEST= 51\r
+KEY=  0000000000002000000000000000000000000000000000000000000000000000\r
+CT=   23cededa4c15b4c037e8c61492217937\r
+TEST= 52\r
+KEY=  0000000000001000000000000000000000000000000000000000000000000000\r
+CT=   a1719147a1f4a1a1180bd16e8593dcde\r
+TEST= 53\r
+KEY=  0000000000000800000000000000000000000000000000000000000000000000\r
+CT=   ab82337e9fb0ec60d1f25a1d0014192c\r
+TEST= 54\r
+KEY=  0000000000000400000000000000000000000000000000000000000000000000\r
+CT=   74bf2d8fc5a8388df1a3a4d7d33fc164\r
+TEST= 55\r
+KEY=  0000000000000200000000000000000000000000000000000000000000000000\r
+CT=   d5b493317e6fbc6fffd664b3c491368a\r
+TEST= 56\r
+KEY=  0000000000000100000000000000000000000000000000000000000000000000\r
+CT=   ba767381586da56a2a8d503d5f7ada0b\r
+TEST= 57\r
+KEY=  0000000000000080000000000000000000000000000000000000000000000000\r
+CT=   e8e6bc57dfe9ccadb0decabf4e5cf91f\r
+TEST= 58\r
+KEY=  0000000000000040000000000000000000000000000000000000000000000000\r
+CT=   3c8e5a5cdc9ceed90815d1f84bb2998c\r
+TEST= 59\r
+KEY=  0000000000000020000000000000000000000000000000000000000000000000\r
+CT=   283843020ba38f056001b2fd585f7cc9\r
+TEST= 60\r
+KEY=  0000000000000010000000000000000000000000000000000000000000000000\r
+CT=   d8adc7426f623ece8741a70621d28870\r
+TEST= 61\r
+KEY=  0000000000000008000000000000000000000000000000000000000000000000\r
+CT=   d7c5c215592d06f00e6a80da69a28ea9\r
+TEST= 62\r
+KEY=  0000000000000004000000000000000000000000000000000000000000000000\r
+CT=   52cf6fa433c3c870cac70190358f7f16\r
+TEST= 63\r
+KEY=  0000000000000002000000000000000000000000000000000000000000000000\r
+CT=   f63d442a584da71786adec9f3346df75\r
+TEST= 64\r
+KEY=  0000000000000001000000000000000000000000000000000000000000000000\r
+CT=   549078f4b0ca7079b45f9a5adafafd99\r
+TEST= 65\r
+KEY=  0000000000000000800000000000000000000000000000000000000000000000\r
+CT=   f2a5986ee4e9984be2bafb79ea8152fa\r
+TEST= 66\r
+KEY=  0000000000000000400000000000000000000000000000000000000000000000\r
+CT=   8a74535017b4db2776668a1fae64384c\r
+TEST= 67\r
+KEY=  0000000000000000200000000000000000000000000000000000000000000000\r
+CT=   e613342f57a97fd95dc088711a5d0ecd\r
+TEST= 68\r
+KEY=  0000000000000000100000000000000000000000000000000000000000000000\r
+CT=   3ffaebf6b22cf1dc82ae17cd48175b01\r
+TEST= 69\r
+KEY=  0000000000000000080000000000000000000000000000000000000000000000\r
+CT=   bafd52efa15c248ccbf9757735e6b1ce\r
+TEST= 70\r
+KEY=  0000000000000000040000000000000000000000000000000000000000000000\r
+CT=   7af94bc018d9ddd4539d2dd1c6f4000f\r
+TEST= 71\r
+KEY=  0000000000000000020000000000000000000000000000000000000000000000\r
+CT=   fe177ad61ca0fdb281086fba8fe76803\r
+TEST= 72\r
+KEY=  0000000000000000010000000000000000000000000000000000000000000000\r
+CT=   74dbea15e2e9285bad163d7d534251b6\r
+TEST= 73\r
+KEY=  0000000000000000008000000000000000000000000000000000000000000000\r
+CT=   23dd21331b3a92f200fe56ff050ffe74\r
+TEST= 74\r
+KEY=  0000000000000000004000000000000000000000000000000000000000000000\r
+CT=   a69c5aa34ab20a858cafa766eaced6d8\r
+TEST= 75\r
+KEY=  0000000000000000002000000000000000000000000000000000000000000000\r
+CT=   3f72bb4df2a4f941a4a09cb78f04b97a\r
+TEST= 76\r
+KEY=  0000000000000000001000000000000000000000000000000000000000000000\r
+CT=   72cc43577e1fd5fd14622d24d97fcdcc\r
+TEST= 77\r
+KEY=  0000000000000000000800000000000000000000000000000000000000000000\r
+CT=   d83af8ebe93e0b6b99cafade224937d1\r
+TEST= 78\r
+KEY=  0000000000000000000400000000000000000000000000000000000000000000\r
+CT=   44042329128d56caa8d084c8bd769d1e\r
+TEST= 79\r
+KEY=  0000000000000000000200000000000000000000000000000000000000000000\r
+CT=   14102d72290de4f2c430add1ed64ba1d\r
+TEST= 80\r
+KEY=  0000000000000000000100000000000000000000000000000000000000000000\r
+CT=   449124097b1ecd0ae7065206df06f03c\r
+TEST= 81\r
+KEY=  0000000000000000000080000000000000000000000000000000000000000000\r
+CT=   d060a99f8cc153a42e11e5f97bd7584a\r
+TEST= 82\r
+KEY=  0000000000000000000040000000000000000000000000000000000000000000\r
+CT=   65605b3ea9261488d53e48602adea299\r
+TEST= 83\r
+KEY=  0000000000000000000020000000000000000000000000000000000000000000\r
+CT=   c5e5cad7a208de8ea6be049efe5c7346\r
+TEST= 84\r
+KEY=  0000000000000000000010000000000000000000000000000000000000000000\r
+CT=   4c280c46d2181646048dd5bc0c0831a5\r
+TEST= 85\r
+KEY=  0000000000000000000008000000000000000000000000000000000000000000\r
+CT=   5dd65cf37f2a0929559aabafda08e730\r
+TEST= 86\r
+KEY=  0000000000000000000004000000000000000000000000000000000000000000\r
+CT=   31f2335caaf264172f69a693225e6d22\r
+TEST= 87\r
+KEY=  0000000000000000000002000000000000000000000000000000000000000000\r
+CT=   3e28b35f99a72662590da96426dd377f\r
+TEST= 88\r
+KEY=  0000000000000000000001000000000000000000000000000000000000000000\r
+CT=   570f40f5d7b20441486578ed344343be\r
+TEST= 89\r
+KEY=  0000000000000000000000800000000000000000000000000000000000000000\r
+CT=   c54308ad1c9e3b19f8b7417873045a8c\r
+TEST= 90\r
+KEY=  0000000000000000000000400000000000000000000000000000000000000000\r
+CT=   cbf335e39ce13ade2b696179e8fd0ce1\r
+TEST= 91\r
+KEY=  0000000000000000000000200000000000000000000000000000000000000000\r
+CT=   9c2fbf422355d8293083d51f4a3c18a9\r
+TEST= 92\r
+KEY=  0000000000000000000000100000000000000000000000000000000000000000\r
+CT=   5ed8b5a31ecefab16c9aa6986da67bce\r
+TEST= 93\r
+KEY=  0000000000000000000000080000000000000000000000000000000000000000\r
+CT=   627815dcfc814abc75900041b1dd7b59\r
+TEST= 94\r
+KEY=  0000000000000000000000040000000000000000000000000000000000000000\r
+CT=   9ef3e82a50a59f166260494f7a7f2cc3\r
+TEST= 95\r
+KEY=  0000000000000000000000020000000000000000000000000000000000000000\r
+CT=   878cd0d8d920888b5935d6c351128737\r
+TEST= 96\r
+KEY=  0000000000000000000000010000000000000000000000000000000000000000\r
+CT=   e44429474d6fc3084eb2a6b8b46af754\r
+TEST= 97\r
+KEY=  0000000000000000000000008000000000000000000000000000000000000000\r
+CT=   ebaacf9641d54e1fb18d0a2be4f19be5\r
+TEST= 98\r
+KEY=  0000000000000000000000004000000000000000000000000000000000000000\r
+CT=   13b3bf497cee780e123c7e193dea3a01\r
+TEST= 99\r
+KEY=  0000000000000000000000002000000000000000000000000000000000000000\r
+CT=   6e8f381de00a41161f0df03b4155bfd4\r
+TEST= 100\r
+KEY=  0000000000000000000000001000000000000000000000000000000000000000\r
+CT=   35e4f29bba2bae01144910783c3fef49\r
+TEST= 101\r
+KEY=  0000000000000000000000000800000000000000000000000000000000000000\r
+CT=   55b17bd66788ceac366398a31f289ffb\r
+TEST= 102\r
+KEY=  0000000000000000000000000400000000000000000000000000000000000000\r
+CT=   11341f56c0d6d1008d28741daa7679ce\r
+TEST= 103\r
+KEY=  0000000000000000000000000200000000000000000000000000000000000000\r
+CT=   4df7253df421d83358bdbe924745d98c\r
+TEST= 104\r
+KEY=  0000000000000000000000000100000000000000000000000000000000000000\r
+CT=   bae2ee651116d93edc8e83b5f3347be1\r
+TEST= 105\r
+KEY=  0000000000000000000000000080000000000000000000000000000000000000\r
+CT=   f9721abd06709157183af3965a659d9d\r
+TEST= 106\r
+KEY=  0000000000000000000000000040000000000000000000000000000000000000\r
+CT=   19a1c252a613fe2860a4ae6d75ce6fa3\r
+TEST= 107\r
+KEY=  0000000000000000000000000020000000000000000000000000000000000000\r
+CT=   b5ddb2f5d9752c949fbde3fff5556c6e\r
+TEST= 108\r
+KEY=  0000000000000000000000000010000000000000000000000000000000000000\r
+CT=   81b044fcffc78eccfcd171aad0405c66\r
+TEST= 109\r
+KEY=  0000000000000000000000000008000000000000000000000000000000000000\r
+CT=   c640566d3c06020eb2c42f1d62e56a9b\r
+TEST= 110\r
+KEY=  0000000000000000000000000004000000000000000000000000000000000000\r
+CT=   ea6c4bcf425291679fdffd26a424fbcc\r
+TEST= 111\r
+KEY=  0000000000000000000000000002000000000000000000000000000000000000\r
+CT=   57f6901465d9440d9f15ee2cba5a4090\r
+TEST= 112\r
+KEY=  0000000000000000000000000001000000000000000000000000000000000000\r
+CT=   fbcfa74cadc7406260f63d96c8aab6b1\r
+TEST= 113\r
+KEY=  0000000000000000000000000000800000000000000000000000000000000000\r
+CT=   dff4f096cea211d4bbdaca033d0ec7d1\r
+TEST= 114\r
+KEY=  0000000000000000000000000000400000000000000000000000000000000000\r
+CT=   1ee5190d551f0f42f675227a381296a9\r
+TEST= 115\r
+KEY=  0000000000000000000000000000200000000000000000000000000000000000\r
+CT=   f98e1905012e580f097623c10b93054f\r
+TEST= 116\r
+KEY=  0000000000000000000000000000100000000000000000000000000000000000\r
+CT=   e7d43743d21dd3c9f168c86856558b9a\r
+TEST= 117\r
+KEY=  0000000000000000000000000000080000000000000000000000000000000000\r
+CT=   632a9dda730dab67593c5d08d8ac1059\r
+TEST= 118\r
+KEY=  0000000000000000000000000000040000000000000000000000000000000000\r
+CT=   e084317000715b9057bc9de9f3ab6124\r
+TEST= 119\r
+KEY=  0000000000000000000000000000020000000000000000000000000000000000\r
+CT=   61f9ef33a0bb4e666c2ed99101919fab\r
+TEST= 120\r
+KEY=  0000000000000000000000000000010000000000000000000000000000000000\r
+CT=   6dc1d68a11834657d46703c22578d59a\r
+TEST= 121\r
+KEY=  0000000000000000000000000000008000000000000000000000000000000000\r
+CT=   53ac1548863d3d16f1d4dc7242e05f2c\r
+TEST= 122\r
+KEY=  0000000000000000000000000000004000000000000000000000000000000000\r
+CT=   e82cd587a408306ad78ceae0916b9f8c\r
+TEST= 123\r
+KEY=  0000000000000000000000000000002000000000000000000000000000000000\r
+CT=   0fd2d40ea6ad17a3a767f0a8600d6295\r
+TEST= 124\r
+KEY=  0000000000000000000000000000001000000000000000000000000000000000\r
+CT=   ad84cc8255adb39dfca23f92761ae7e9\r
+TEST= 125\r
+KEY=  0000000000000000000000000000000800000000000000000000000000000000\r
+CT=   f4f20cf7d51bee7da024a2b11a7eca0b\r
+TEST= 126\r
+KEY=  0000000000000000000000000000000400000000000000000000000000000000\r
+CT=   5057691b85d9ce93a193214db0a016b6\r
+TEST= 127\r
+KEY=  0000000000000000000000000000000200000000000000000000000000000000\r
+CT=   0f58c960876390bdef4bb6be95caa1ee\r
+TEST= 128\r
+KEY=  0000000000000000000000000000000100000000000000000000000000000000\r
+CT=   9a3e66eebc21bc0bd9430b341ef465fa\r
+TEST= 129\r
+KEY=  0000000000000000000000000000000080000000000000000000000000000000\r
+CT=   20415035f34b8bcbcb28abf07f78f0d4\r
+TEST= 130\r
+KEY=  0000000000000000000000000000000040000000000000000000000000000000\r
+CT=   ac89fc7ba10479ebf10de65bcef89b3c\r
+TEST= 131\r
+KEY=  0000000000000000000000000000000020000000000000000000000000000000\r
+CT=   068fa75a30be443171af3f6feb1a20d2\r
+TEST= 132\r
+KEY=  0000000000000000000000000000000010000000000000000000000000000000\r
+CT=   50e02f213246c525a8c27700ca34b502\r
+TEST= 133\r
+KEY=  0000000000000000000000000000000008000000000000000000000000000000\r
+CT=   227da47d5a0906db3ab042bb0a695fb6\r
+TEST= 134\r
+KEY=  0000000000000000000000000000000004000000000000000000000000000000\r
+CT=   8663ac30ed12514f1de46777f4514bfc\r
+TEST= 135\r
+KEY=  0000000000000000000000000000000002000000000000000000000000000000\r
+CT=   a987d4bc12e1de9f4b6df43567c34a8b\r
+TEST= 136\r
+KEY=  0000000000000000000000000000000001000000000000000000000000000000\r
+CT=   6d5a0370f599aca605f63b04e5143d0c\r
+TEST= 137\r
+KEY=  0000000000000000000000000000000000800000000000000000000000000000\r
+CT=   9809266e378b07b7afdb3baa97b7e442\r
+TEST= 138\r
+KEY=  0000000000000000000000000000000000400000000000000000000000000000\r
+CT=   8f753252b30cccace12d9a301f4d5090\r
+TEST= 139\r
+KEY=  0000000000000000000000000000000000200000000000000000000000000000\r
+CT=   032465f6c0ce34d41962f561692a1aff\r
+TEST= 140\r
+KEY=  0000000000000000000000000000000000100000000000000000000000000000\r
+CT=   c50e9ad5beb8f3b00821dd47ff8ac093\r
+TEST= 141\r
+KEY=  0000000000000000000000000000000000080000000000000000000000000000\r
+CT=   9c6fea3d46268d54a6829b2ad25bb276\r
+TEST= 142\r
+KEY=  0000000000000000000000000000000000040000000000000000000000000000\r
+CT=   0fd8575e87706f561343d7b3a41e044a\r
+TEST= 143\r
+KEY=  0000000000000000000000000000000000020000000000000000000000000000\r
+CT=   bee9beb3739540d88cbce77925f0a114\r
+TEST= 144\r
+KEY=  0000000000000000000000000000000000010000000000000000000000000000\r
+CT=   d24eaee7fffbac3d6f26c2dce0dcde28\r
+TEST= 145\r
+KEY=  0000000000000000000000000000000000008000000000000000000000000000\r
+CT=   47771a90398ff0f7fa821c2f8f5e1398\r
+TEST= 146\r
+KEY=  0000000000000000000000000000000000004000000000000000000000000000\r
+CT=   4639741b6f84b135ad118c8249b64ed0\r
+TEST= 147\r
+KEY=  0000000000000000000000000000000000002000000000000000000000000000\r
+CT=   8ee5505ec85567697a3306f250a27720\r
+TEST= 148\r
+KEY=  0000000000000000000000000000000000001000000000000000000000000000\r
+CT=   7c8a19ac1aefbc5e0119d91a5f05d4c2\r
+TEST= 149\r
+KEY=  0000000000000000000000000000000000000800000000000000000000000000\r
+CT=   5141b9b672e54773b672e3a6c424887b\r
+TEST= 150\r
+KEY=  0000000000000000000000000000000000000400000000000000000000000000\r
+CT=   b5a2d3cd206653c6402f34fb0ae3613d\r
+TEST= 151\r
+KEY=  0000000000000000000000000000000000000200000000000000000000000000\r
+CT=   0f5bd9408738231d114b0a82753279a3\r
+TEST= 152\r
+KEY=  0000000000000000000000000000000000000100000000000000000000000000\r
+CT=   fef033ff4268ea487fc74c5e43a45338\r
+TEST= 153\r
+KEY=  0000000000000000000000000000000000000080000000000000000000000000\r
+CT=   a3edc09dcd529b113910d904ad855581\r
+TEST= 154\r
+KEY=  0000000000000000000000000000000000000040000000000000000000000000\r
+CT=   ab8fbb6f27a0ac7c55b59fdd36b72f1c\r
+TEST= 155\r
+KEY=  0000000000000000000000000000000000000020000000000000000000000000\r
+CT=   eea44d5ed4d769cc930cd83d8999ec46\r
+TEST= 156\r
+KEY=  0000000000000000000000000000000000000010000000000000000000000000\r
+CT=   6972276803ae9aa7c6f431ab10979c34\r
+TEST= 157\r
+KEY=  0000000000000000000000000000000000000008000000000000000000000000\r
+CT=   86deaa9f39244101818178474d7dbde9\r
+TEST= 158\r
+KEY=  0000000000000000000000000000000000000004000000000000000000000000\r
+CT=   88c6b466ea361d662d8d08cbf181f4fe\r
+TEST= 159\r
+KEY=  0000000000000000000000000000000000000002000000000000000000000000\r
+CT=   91ab2c6b7c63ff59f7cbeebf91b20b95\r
+TEST= 160\r
+KEY=  0000000000000000000000000000000000000001000000000000000000000000\r
+CT=   2dfe6c146ad5b3d8c3c1718f13b48e01\r
+TEST= 161\r
+KEY=  0000000000000000000000000000000000000000800000000000000000000000\r
+CT=   c7cff1623451711391a302eec3584aaa\r
+TEST= 162\r
+KEY=  0000000000000000000000000000000000000000400000000000000000000000\r
+CT=   089fe845cc05011686c66019d18be050\r
+TEST= 163\r
+KEY=  0000000000000000000000000000000000000000200000000000000000000000\r
+CT=   08c8410b9b427211a67124b0dccead48\r
+TEST= 164\r
+KEY=  0000000000000000000000000000000000000000100000000000000000000000\r
+CT=   8d91592f5566085254784606334d7629\r
+TEST= 165\r
+KEY=  0000000000000000000000000000000000000000080000000000000000000000\r
+CT=   3298feaaf2e1201d6299ff8846639c97\r
+TEST= 166\r
+KEY=  0000000000000000000000000000000000000000040000000000000000000000\r
+CT=   c497cb9f0bdfe0efc8c2f3f90760aa72\r
+TEST= 167\r
+KEY=  0000000000000000000000000000000000000000020000000000000000000000\r
+CT=   2788afd046e0309cbe4424690da2ab89\r
+TEST= 168\r
+KEY=  0000000000000000000000000000000000000000010000000000000000000000\r
+CT=   e9891707f25ef29fee372890d4258982\r
+TEST= 169\r
+KEY=  0000000000000000000000000000000000000000008000000000000000000000\r
+CT=   db041d94a23d45d4d4dced5a030caf61\r
+TEST= 170\r
+KEY=  0000000000000000000000000000000000000000004000000000000000000000\r
+CT=   ffafdbf0ecb18df9ea02c27077448e6d\r
+TEST= 171\r
+KEY=  0000000000000000000000000000000000000000002000000000000000000000\r
+CT=   2daaa42a7d0a1d3b0e4761d99cf2150a\r
+TEST= 172\r
+KEY=  0000000000000000000000000000000000000000001000000000000000000000\r
+CT=   3b7a54cb7cf30abe263dd6ed5bfe8d63\r
+TEST= 173\r
+KEY=  0000000000000000000000000000000000000000000800000000000000000000\r
+CT=   eefa090174c590c448a55d43648f534a\r
+TEST= 174\r
+KEY=  0000000000000000000000000000000000000000000400000000000000000000\r
+CT=   9e15798731ed42f43ea2740a691da872\r
+TEST= 175\r
+KEY=  0000000000000000000000000000000000000000000200000000000000000000\r
+CT=   31fbd661540a5deaad1017cfd3909ec8\r
+TEST= 176\r
+KEY=  0000000000000000000000000000000000000000000100000000000000000000\r
+CT=   cda9ae05f224140e28cb951721b44d6a\r
+TEST= 177\r
+KEY=  0000000000000000000000000000000000000000000080000000000000000000\r
+CT=   0c5bc512c60a1eac3434efb1a8fbb182\r
+TEST= 178\r
+KEY=  0000000000000000000000000000000000000000000040000000000000000000\r
+CT=   aa863610deeeeb62d045e87ea30b59b5\r
+TEST= 179\r
+KEY=  0000000000000000000000000000000000000000000020000000000000000000\r
+CT=   6ac2448de568d279c7eebe1df403920c\r
+TEST= 180\r
+KEY=  0000000000000000000000000000000000000000000010000000000000000000\r
+CT=   e2011e3d292b26888ae801215fd0cb40\r
+TEST= 181\r
+KEY=  0000000000000000000000000000000000000000000008000000000000000000\r
+CT=   e06f3e15ee3a61672d1c99bade5b9dbe\r
+TEST= 182\r
+KEY=  0000000000000000000000000000000000000000000004000000000000000000\r
+CT=   bb7027f0548cf6712ceb4c7a4b28e178\r
+TEST= 183\r
+KEY=  0000000000000000000000000000000000000000000002000000000000000000\r
+CT=   061ec21fb70fadbdf87c3bd2ae23825b\r
+TEST= 184\r
+KEY=  0000000000000000000000000000000000000000000001000000000000000000\r
+CT=   4c21f26fe94abbac381352375314c3eb\r
+TEST= 185\r
+KEY=  0000000000000000000000000000000000000000000000800000000000000000\r
+CT=   f7cee6dd99909c2b569eeda61ed8942e\r
+TEST= 186\r
+KEY=  0000000000000000000000000000000000000000000000400000000000000000\r
+CT=   ce98c4a876c65e4ccb261ebb1d9df7f5\r
+TEST= 187\r
+KEY=  0000000000000000000000000000000000000000000000200000000000000000\r
+CT=   a5491881cf833c3604abc08044f402ac\r
+TEST= 188\r
+KEY=  0000000000000000000000000000000000000000000000100000000000000000\r
+CT=   a1ba16e64cccb3087d57a768507b0bfc\r
+TEST= 189\r
+KEY=  0000000000000000000000000000000000000000000000080000000000000000\r
+CT=   d55951e202d2949ebd3be43120c738bf\r
+TEST= 190\r
+KEY=  0000000000000000000000000000000000000000000000040000000000000000\r
+CT=   ebb8e43069e69f450efec65dcd52b7fd\r
+TEST= 191\r
+KEY=  0000000000000000000000000000000000000000000000020000000000000000\r
+CT=   2b292135663b4aa5abfe9423d57e7ee9\r
+TEST= 192\r
+KEY=  0000000000000000000000000000000000000000000000010000000000000000\r
+CT=   e91bf974b3be3ad966249d8655292a85\r
+TEST= 193\r
+KEY=  0000000000000000000000000000000000000000000000008000000000000000\r
+CT=   384365998eaa9562236cc58f6adf9610\r
+TEST= 194\r
+KEY=  0000000000000000000000000000000000000000000000004000000000000000\r
+CT=   c2e997012aa3d4d8d359c9a947cbe69f\r
+TEST= 195\r
+KEY=  0000000000000000000000000000000000000000000000002000000000000000\r
+CT=   f49421204148ba213be87e2d5c22b0bf\r
+TEST= 196\r
+KEY=  0000000000000000000000000000000000000000000000001000000000000000\r
+CT=   82ed0ed9953aa92e4df30929ca65c00f\r
+TEST= 197\r
+KEY=  0000000000000000000000000000000000000000000000000800000000000000\r
+CT=   291eb1d11653c8479437c74a977f5106\r
+TEST= 198\r
+KEY=  0000000000000000000000000000000000000000000000000400000000000000\r
+CT=   bcb997b1939b8983abd550d6025683e3\r
+TEST= 199\r
+KEY=  0000000000000000000000000000000000000000000000000200000000000000\r
+CT=   1fba2592c6f489775caada71f9b983e9\r
+TEST= 200\r
+KEY=  0000000000000000000000000000000000000000000000000100000000000000\r
+CT=   969f66f217af1a3db9e41c1b29039824\r
+TEST= 201\r
+KEY=  0000000000000000000000000000000000000000000000000080000000000000\r
+CT=   a54bb7d6b17e423ac0a7744c19073cb8\r
+TEST= 202\r
+KEY=  0000000000000000000000000000000000000000000000000040000000000000\r
+CT=   b0ac6e6578d1021f47dcf9748a32ead5\r
+TEST= 203\r
+KEY=  0000000000000000000000000000000000000000000000000020000000000000\r
+CT=   b87b361c3b7b194c77a4358d4669153e\r
+TEST= 204\r
+KEY=  0000000000000000000000000000000000000000000000000010000000000000\r
+CT=   46a133847f96eaa8282a799dc8899d58\r
+TEST= 205\r
+KEY=  0000000000000000000000000000000000000000000000000008000000000000\r
+CT=   2265ec3a9f2d5c9547a091cc8cfb18ea\r
+TEST= 206\r
+KEY=  0000000000000000000000000000000000000000000000000004000000000000\r
+CT=   54cbf3a6fc4fe56d426117aa1ffd1dde\r
+TEST= 207\r
+KEY=  0000000000000000000000000000000000000000000000000002000000000000\r
+CT=   5312877cceab6cfb0905394a370a8003\r
+TEST= 208\r
+KEY=  0000000000000000000000000000000000000000000000000001000000000000\r
+CT=   7190bd6ec613fe38b84ecfe28f702fe4\r
+TEST= 209\r
+KEY=  0000000000000000000000000000000000000000000000000000800000000000\r
+CT=   d1fa5b9ca89a43b04c05f0ef29ef68cd\r
+TEST= 210\r
+KEY=  0000000000000000000000000000000000000000000000000000400000000000\r
+CT=   808285751548ed934fd1056d2d9ae8ba\r
+TEST= 211\r
+KEY=  0000000000000000000000000000000000000000000000000000200000000000\r
+CT=   2758def3e7b95a9ae89777be64d5a6cf\r
+TEST= 212\r
+KEY=  0000000000000000000000000000000000000000000000000000100000000000\r
+CT=   07d81f87db3e0acc82b01e08fb22f3c1\r
+TEST= 213\r
+KEY=  0000000000000000000000000000000000000000000000000000080000000000\r
+CT=   8da250e5553d650711a75ee1cb4fd1c7\r
+TEST= 214\r
+KEY=  0000000000000000000000000000000000000000000000000000040000000000\r
+CT=   a93d946bd0e87f32719df5f158cee669\r
+TEST= 215\r
+KEY=  0000000000000000000000000000000000000000000000000000020000000000\r
+CT=   03945236ec2a4d4eaf30b8abeb54330d\r
+TEST= 216\r
+KEY=  0000000000000000000000000000000000000000000000000000010000000000\r
+CT=   11cc35301f24b79dde31aea2d1354f88\r
+TEST= 217\r
+KEY=  0000000000000000000000000000000000000000000000000000008000000000\r
+CT=   e73715b3e8d9a290f44ae6ffbf247e5d\r
+TEST= 218\r
+KEY=  0000000000000000000000000000000000000000000000000000004000000000\r
+CT=   7345e07732b71cb158bbf64cca5c5b96\r
+TEST= 219\r
+KEY=  0000000000000000000000000000000000000000000000000000002000000000\r
+CT=   6e128f296d24705a1924fd9b70c4ed04\r
+TEST= 220\r
+KEY=  0000000000000000000000000000000000000000000000000000001000000000\r
+CT=   95a789776f036783fbd330947083f54f\r
+TEST= 221\r
+KEY=  0000000000000000000000000000000000000000000000000000000800000000\r
+CT=   360dec2533ea4aa2e3e54fd3de2906eb\r
+TEST= 222\r
+KEY=  0000000000000000000000000000000000000000000000000000000400000000\r
+CT=   e68efd7fecf4d601ea22727bd764965b\r
+TEST= 223\r
+KEY=  0000000000000000000000000000000000000000000000000000000200000000\r
+CT=   9065c64a8bff44ac33edbb611cf83d7b\r
+TEST= 224\r
+KEY=  0000000000000000000000000000000000000000000000000000000100000000\r
+CT=   8f33c8df2a7a51ce8090e8f123bc3723\r
+TEST= 225\r
+KEY=  0000000000000000000000000000000000000000000000000000000080000000\r
+CT=   807f391ffba8291ba625623210f99018\r
+TEST= 226\r
+KEY=  0000000000000000000000000000000000000000000000000000000040000000\r
+CT=   5e8b3f3a701522ce5caa761c929d6292\r
+TEST= 227\r
+KEY=  0000000000000000000000000000000000000000000000000000000020000000\r
+CT=   3ba404dc38735a78289e3809e8364835\r
+TEST= 228\r
+KEY=  0000000000000000000000000000000000000000000000000000000010000000\r
+CT=   d23bedbad229f8305dc425b6b759dcc9\r
+TEST= 229\r
+KEY=  0000000000000000000000000000000000000000000000000000000008000000\r
+CT=   44880f21cf5913040ae376aee2a10ad8\r
+TEST= 230\r
+KEY=  0000000000000000000000000000000000000000000000000000000004000000\r
+CT=   9bc98e29d057c0e828c3b5cce69256c1\r
+TEST= 231\r
+KEY=  0000000000000000000000000000000000000000000000000000000002000000\r
+CT=   b293cc7a975da141a68279368057cc41\r
+TEST= 232\r
+KEY=  0000000000000000000000000000000000000000000000000000000001000000\r
+CT=   8d60fb87acd91385b313be5f1d7bd30f\r
+TEST= 233\r
+KEY=  0000000000000000000000000000000000000000000000000000000000800000\r
+CT=   2c8e56132d70291b303c48fdf75543cd\r
+TEST= 234\r
+KEY=  0000000000000000000000000000000000000000000000000000000000400000\r
+CT=   d1f80035b826791f6ce4e59b7db1bb0d\r
+TEST= 235\r
+KEY=  0000000000000000000000000000000000000000000000000000000000200000\r
+CT=   42ce6224fc36469339a133dd08173bd4\r
+TEST= 236\r
+KEY=  0000000000000000000000000000000000000000000000000000000000100000\r
+CT=   61817155ea41bcba2af7f06ae7cbf585\r
+TEST= 237\r
+KEY=  0000000000000000000000000000000000000000000000000000000000080000\r
+CT=   d1923a9866068d2ef5fb77d57c3315b6\r
+TEST= 238\r
+KEY=  0000000000000000000000000000000000000000000000000000000000040000\r
+CT=   b37cbdb5d719f49691ca968ef2e84140\r
+TEST= 239\r
+KEY=  0000000000000000000000000000000000000000000000000000000000020000\r
+CT=   ec974e653a055d7f8f22171030f68e1d\r
+TEST= 240\r
+KEY=  0000000000000000000000000000000000000000000000000000000000010000\r
+CT=   dde5d3b9aad9c32213bb3675a822499c\r
+TEST= 241\r
+KEY=  0000000000000000000000000000000000000000000000000000000000008000\r
+CT=   d3b6e9216ea1ae57eb1c628a3c38ab78\r
+TEST= 242\r
+KEY=  0000000000000000000000000000000000000000000000000000000000004000\r
+CT=   82c99ecc69472b7e96324b042ae8b87a\r
+TEST= 243\r
+KEY=  0000000000000000000000000000000000000000000000000000000000002000\r
+CT=   97144dc5338c43600f84439c0aa0d147\r
+TEST= 244\r
+KEY=  0000000000000000000000000000000000000000000000000000000000001000\r
+CT=   400ac4a0bbada1db2121eb144c7e5209\r
+TEST= 245\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000800\r
+CT=   efd9d550eb419ed278f4885a490ab54c\r
+TEST= 246\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000400\r
+CT=   2ab7816e149b7c0404c88a8857793670\r
+TEST= 247\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000200\r
+CT=   5b591dff9e8dee15bad24c025dbca481\r
+TEST= 248\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000100\r
+CT=   0c06633e30721c3749f49ad8cbf2b754\r
+TEST= 249\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000080\r
+CT=   96d6d31a41b5123b2035fd91a921d4ca\r
+TEST= 250\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000040\r
+CT=   e7f6c34d86668bc2805ca7793c5e86ad\r
+TEST= 251\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000020\r
+CT=   f46dff5ff500d6879c4d3e45cf0cf0f3\r
+TEST= 252\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000010\r
+CT=   60d842d9c61da7495c116197b7cecbbe\r
+TEST= 253\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000008\r
+CT=   d45b24edb673353ebdf248b8fa06b67a\r
+TEST= 254\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000004\r
+CT=   119eaebcc165d0bd02c0d35dc82ef992\r
+TEST= 255\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000002\r
+CT=   e673143680414ada301d0ed34626b9fe\r
+TEST= 256\r
+KEY=  0000000000000000000000000000000000000000000000000000000000000001\r
+CT=   6b6cfe160a6263631b292f879eeff926\r
diff --git a/test/dfregress/testcases/crypto/aes/ecbvt44.txt b/test/dfregress/testcases/crypto/aes/ecbvt44.txt
new file mode 100644 (file)
index 0000000..d9e866b
--- /dev/null
@@ -0,0 +1,398 @@
+==============================================\r
+Author:    Dr B R Gladman (                  )\r
+Test:      ECB Variable Text Known Answer Tests\r
+Algorithm: Extended Rijndael (an AES Superset)\r
+Filename:  ecbvt44.txt\r
+==============================================\r
+\r
+BLOCKSIZE=128\r
+KEYSIZE=  128\r
+\r
+KEY=  00000000000000000000000000000000\r
+TEST= 0\r
+PT=   00000000000000000000000000000000\r
+CT=   66e94bd4ef8a2c3b884cfa59ca342b2e\r
+TEST= 1\r
+PT=   80000000000000000000000000000000\r
+CT=   3ad78e726c1ec02b7ebfe92b23d9ec34\r
+TEST= 2\r
+PT=   40000000000000000000000000000000\r
+CT=   45bc707d29e8204d88dfba2f0b0cad9b\r
+TEST= 3\r
+PT=   20000000000000000000000000000000\r
+CT=   161556838018f52805cdbd6202002e3f\r
+TEST= 4\r
+PT=   10000000000000000000000000000000\r
+CT=   f5569b3ab6a6d11efde1bf0a64c6854a\r
+TEST= 5\r
+PT=   08000000000000000000000000000000\r
+CT=   64e82b50e501fbd7dd4116921159b83e\r
+TEST= 6\r
+PT=   04000000000000000000000000000000\r
+CT=   baac12fb613a7de11450375c74034041\r
+TEST= 7\r
+PT=   02000000000000000000000000000000\r
+CT=   bcf176a7eaad8085ebacea362462a281\r
+TEST= 8\r
+PT=   01000000000000000000000000000000\r
+CT=   47711816e91d6ff059bbbf2bf58e0fd3\r
+TEST= 9\r
+PT=   00800000000000000000000000000000\r
+CT=   b970dfbe40698af1638fe38bd3df3b2f\r
+TEST= 10\r
+PT=   00400000000000000000000000000000\r
+CT=   f95b59a44f391e14cf20b74bdc32fcff\r
+TEST= 11\r
+PT=   00200000000000000000000000000000\r
+CT=   720f74ae04a2a435b9a7256e49378f5b\r
+TEST= 12\r
+PT=   00100000000000000000000000000000\r
+CT=   2a0445f61d36bfa7e277070730cf76da\r
+TEST= 13\r
+PT=   00080000000000000000000000000000\r
+CT=   8d0536b997aefec1d94011bab6699a03\r
+TEST= 14\r
+PT=   00040000000000000000000000000000\r
+CT=   674f002e19f6ed47eff319e51fad4498\r
+TEST= 15\r
+PT=   00020000000000000000000000000000\r
+CT=   292c02c5cb9163c80ac0f6cf1dd8e92d\r
+TEST= 16\r
+PT=   00010000000000000000000000000000\r
+CT=   fa321cf18ef5fe727dd82a5c1e945141\r
+TEST= 17\r
+PT=   00008000000000000000000000000000\r
+CT=   a5a7afe1034c39cccebe3c584bc0be05\r
+TEST= 18\r
+PT=   00004000000000000000000000000000\r
+CT=   4ff5a52e697e77d081205dbdb21cea39\r
+TEST= 19\r
+PT=   00002000000000000000000000000000\r
+CT=   209e88dc94c9003000ce0769af7b7166\r
+TEST= 20\r
+PT=   00001000000000000000000000000000\r
+CT=   5dee41af864cb4b650e5f51551824d38\r
+TEST= 21\r
+PT=   00000800000000000000000000000000\r
+CT=   a79a63fa7e4503ae6d6e09f5f9053030\r
+TEST= 22\r
+PT=   00000400000000000000000000000000\r
+CT=   a48316749fae7fac7002031a6afd8ba7\r
+TEST= 23\r
+PT=   00000200000000000000000000000000\r
+CT=   d6eee8a7357a0e1d64262ca9c337ac42\r
+TEST= 24\r
+PT=   00000100000000000000000000000000\r
+CT=   b013ca8a62a858053e9fb667ed39829e\r
+TEST= 25\r
+PT=   00000080000000000000000000000000\r
+CT=   df6ea9e4538a45a52d5c1a43c88f4b55\r
+TEST= 26\r
+PT=   00000040000000000000000000000000\r
+CT=   7d03ba451371591d3fd5547d9165c73b\r
+TEST= 27\r
+PT=   00000020000000000000000000000000\r
+CT=   0e0426281a6277e186499d365d5f49ff\r
+TEST= 28\r
+PT=   00000010000000000000000000000000\r
+CT=   dbc02169dd2059e6cc4c57c1fedf5ab4\r
+TEST= 29\r
+PT=   00000008000000000000000000000000\r
+CT=   826590e05d167da6f00dcc75e22788eb\r
+TEST= 30\r
+PT=   00000004000000000000000000000000\r
+CT=   34a73f21a04421d9786335faab49423a\r
+TEST= 31\r
+PT=   00000002000000000000000000000000\r
+CT=   ed347d0e0128ee1a7392a1d36ab78aa9\r
+TEST= 32\r
+PT=   00000001000000000000000000000000\r
+CT=   ee944b2fe6e9fc888042608da9615f75\r
+TEST= 33\r
+PT=   00000000800000000000000000000000\r
+CT=   9e7c85a909ef7218ba7947cfb4718f46\r
+TEST= 34\r
+PT=   00000000400000000000000000000000\r
+CT=   811ae07a0b2b1f816587fa73699ae77d\r
+TEST= 35\r
+PT=   00000000200000000000000000000000\r
+CT=   68466fbf43c2fe13d4b18f7ec5ea745f\r
+TEST= 36\r
+PT=   00000000100000000000000000000000\r
+CT=   d20b015c7191b219780956e6101f9354\r
+TEST= 37\r
+PT=   00000000080000000000000000000000\r
+CT=   5939d5c1bbf54ee1b3e326d757bdde25\r
+TEST= 38\r
+PT=   00000000040000000000000000000000\r
+CT=   b1fdafe9a0240e8ffea19ce94b5105d3\r
+TEST= 39\r
+PT=   00000000020000000000000000000000\r
+CT=   d62962ece02cdd68c06bdfefb2f9495b\r
+TEST= 40\r
+PT=   00000000010000000000000000000000\r
+CT=   b3bb2de6f3c26587ba8bac4f7ad9499a\r
+TEST= 41\r
+PT=   00000000008000000000000000000000\r
+CT=   e0b1072d6d9ff703d6fbef77852b0a6b\r
+TEST= 42\r
+PT=   00000000004000000000000000000000\r
+CT=   d8dd51c907f478de0228e83e61fd1758\r
+TEST= 43\r
+PT=   00000000002000000000000000000000\r
+CT=   a42dffe6e7c1671c06a25236fdd10017\r
+TEST= 44\r
+PT=   00000000001000000000000000000000\r
+CT=   25acf141550bfab9ef451b6c6a5b2163\r
+TEST= 45\r
+PT=   00000000000800000000000000000000\r
+CT=   4da7fca3949b16e821dbc84f19581018\r
+TEST= 46\r
+PT=   00000000000400000000000000000000\r
+CT=   7d49b6347cbcc8919c7fa96a37a7a215\r
+TEST= 47\r
+PT=   00000000000200000000000000000000\r
+CT=   900024b29a08c6721b95ba3b753ddb4d\r
+TEST= 48\r
+PT=   00000000000100000000000000000000\r
+CT=   6d2182fb283b6934d90ba7848cab5e66\r
+TEST= 49\r
+PT=   00000000000080000000000000000000\r
+CT=   f73ef01b448d23a4d90de8b2f9666e7a\r
+TEST= 50\r
+PT=   00000000000040000000000000000000\r
+CT=   4ad9cda2418643e9a3d926af5e6b0412\r
+TEST= 51\r
+PT=   00000000000020000000000000000000\r
+CT=   7caec8e7e5953997d545b033201c8c5b\r
+TEST= 52\r
+PT=   00000000000010000000000000000000\r
+CT=   3c43ca1f6b6864503e27b48d88230cf5\r
+TEST= 53\r
+PT=   00000000000008000000000000000000\r
+CT=   44f779b93108fe9feec880d79ba74488\r
+TEST= 54\r
+PT=   00000000000004000000000000000000\r
+CT=   9e50e8d9cfd3a682a78e527c9072a1cf\r
+TEST= 55\r
+PT=   00000000000002000000000000000000\r
+CT=   68d000cbc838bbe3c505d6f814c01f28\r
+TEST= 56\r
+PT=   00000000000001000000000000000000\r
+CT=   2cb2a9fec1acd1d9b0fa05205e304f57\r
+TEST= 57\r
+PT=   00000000000000800000000000000000\r
+CT=   01eb2806606e46444520a5cc6180cd4b\r
+TEST= 58\r
+PT=   00000000000000400000000000000000\r
+CT=   daa9b25168cc702326f217f1a0c0b162\r
+TEST= 59\r
+PT=   00000000000000200000000000000000\r
+CT=   3e07e648975d9578d03555b1755807ed\r
+TEST= 60\r
+PT=   00000000000000100000000000000000\r
+CT=   0b45f52e802c8b8de09579425b80b711\r
+TEST= 61\r
+PT=   00000000000000080000000000000000\r
+CT=   659595da0b68f6df0dd6ca77202986e1\r
+TEST= 62\r
+PT=   00000000000000040000000000000000\r
+CT=   05ff42873893536e58c8fa98a45c73c4\r
+TEST= 63\r
+PT=   00000000000000020000000000000000\r
+CT=   b5b03421de8bbffc4eadec767339a9bd\r
+TEST= 64\r
+PT=   00000000000000010000000000000000\r
+CT=   788bcd111ecf73d4e78d2e21bef55460\r
+TEST= 65\r
+PT=   00000000000000008000000000000000\r
+CT=   909cd9ec6790359f982dc6f2393d5315\r
+TEST= 66\r
+PT=   00000000000000004000000000000000\r
+CT=   332950f361535ff24efac8c76293f12c\r
+TEST= 67\r
+PT=   00000000000000002000000000000000\r
+CT=   a68ccd4e330ffda9d576da436db53d75\r
+TEST= 68\r
+PT=   00000000000000001000000000000000\r
+CT=   27c8a1ccfdb0b015d1ed5b3e77143791\r
+TEST= 69\r
+PT=   00000000000000000800000000000000\r
+CT=   d76a4b95887a77df610dd3e1d3b20325\r
+TEST= 70\r
+PT=   00000000000000000400000000000000\r
+CT=   c068ab0de71c66dae83c361ef4b2d989\r
+TEST= 71\r
+PT=   00000000000000000200000000000000\r
+CT=   c2120bcd49eda9a288b3b4be79ac8158\r
+TEST= 72\r
+PT=   00000000000000000100000000000000\r
+CT=   0c546f62bf2773cd0f564fceca7ba688\r
+TEST= 73\r
+PT=   00000000000000000080000000000000\r
+CT=   18f3462bede4920213ccb66dab1640aa\r
+TEST= 74\r
+PT=   00000000000000000040000000000000\r
+CT=   fe42f245edd0e24b216aebd8b392d690\r
+TEST= 75\r
+PT=   00000000000000000020000000000000\r
+CT=   3d3eebc8d3d1558a194c2d00c337ff2b\r
+TEST= 76\r
+PT=   00000000000000000010000000000000\r
+CT=   29aaedf043e785db42836f79be6cba28\r
+TEST= 77\r
+PT=   00000000000000000008000000000000\r
+CT=   215f90c6744e2944358e78619159a611\r
+TEST= 78\r
+PT=   00000000000000000004000000000000\r
+CT=   8606b1aa9e1d548e5442b06551e2c6dc\r
+TEST= 79\r
+PT=   00000000000000000002000000000000\r
+CT=   987bb4b8740ec0ede7fea97df033b5b1\r
+TEST= 80\r
+PT=   00000000000000000001000000000000\r
+CT=   c0a3500da5b0ae07d2f450930beedf1b\r
+TEST= 81\r
+PT=   00000000000000000000800000000000\r
+CT=   525fdf8312fe8f32c781481a8daaae37\r
+TEST= 82\r
+PT=   00000000000000000000400000000000\r
+CT=   bfd2c56ae5fb9c9de33a6944572a6487\r
+TEST= 83\r
+PT=   00000000000000000000200000000000\r
+CT=   7975a57a425cdf5aa1fa929101f650b0\r
+TEST= 84\r
+PT=   00000000000000000000100000000000\r
+CT=   bf174bc49609a8709b2cd8366daa79fe\r
+TEST= 85\r
+PT=   00000000000000000000080000000000\r
+CT=   06c50c43222f56c874b1704e9f44bf7d\r
+TEST= 86\r
+PT=   00000000000000000000040000000000\r
+CT=   0cec48cd34043ea29ca3b8ed5278721e\r
+TEST= 87\r
+PT=   00000000000000000000020000000000\r
+CT=   9548ea34a1560197b304d0acb8a1698d\r
+TEST= 88\r
+PT=   00000000000000000000010000000000\r
+CT=   22f9e9b1bd73b6b5b7d3062c986272f3\r
+TEST= 89\r
+PT=   00000000000000000000008000000000\r
+CT=   fee8e934bd0873295059002230e298d4\r
+TEST= 90\r
+PT=   00000000000000000000004000000000\r
+CT=   1b08e2e3eb820d139cb4abbdbe81d00d\r
+TEST= 91\r
+PT=   00000000000000000000002000000000\r
+CT=   0021177681e4d90ceaf69dced0145125\r
+TEST= 92\r
+PT=   00000000000000000000001000000000\r
+CT=   4a8e314452ca8a8a3619fc54bc423643\r
+TEST= 93\r
+PT=   00000000000000000000000800000000\r
+CT=   65047474f7222c94c6965425ff1bfd0a\r
+TEST= 94\r
+PT=   00000000000000000000000400000000\r
+CT=   e123f551a9c4a8489622b16f961a9aa4\r
+TEST= 95\r
+PT=   00000000000000000000000200000000\r
+CT=   ef05530948b80915028bb2b6fe429380\r
+TEST= 96\r
+PT=   00000000000000000000000100000000\r
+CT=   72535b7fe0f0f777cedcd55cd77e2ddf\r
+TEST= 97\r
+PT=   00000000000000000000000080000000\r
+CT=   3423d8efc31fa2f4c365c77d8f3b5c63\r
+TEST= 98\r
+PT=   00000000000000000000000040000000\r
+CT=   de0e51c264663f3c5dbc59580a98d8e4\r
+TEST= 99\r
+PT=   00000000000000000000000020000000\r
+CT=   b2d9391166680947ab09264156719679\r
+TEST= 100\r
+PT=   00000000000000000000000010000000\r
+CT=   10db79f23b06d263835c424af749adb7\r
+TEST= 101\r
+PT=   00000000000000000000000008000000\r
+CT=   ddf72d27e6b01ec107ea3e005b59563b\r
+TEST= 102\r
+PT=   00000000000000000000000004000000\r
+CT=   8266b57485a5954a4236751de07f6694\r
+TEST= 103\r
+PT=   00000000000000000000000002000000\r
+CT=   669a501e1f1ade6e5523de01d6dbc987\r
+TEST= 104\r
+PT=   00000000000000000000000001000000\r
+CT=   c20c48f2989725d461d1db589dc0896e\r
+TEST= 105\r
+PT=   00000000000000000000000000800000\r
+CT=   de35158e7810ed1191825d2aa98fa97d\r
+TEST= 106\r
+PT=   00000000000000000000000000400000\r
+CT=   4fe294f2c0f34d0671b693a237ebddc8\r
+TEST= 107\r
+PT=   00000000000000000000000000200000\r
+CT=   087ae74b10ccbfdf6739feb9559c01a4\r
+TEST= 108\r
+PT=   00000000000000000000000000100000\r
+CT=   5dc278970b7def77a5536c77ab59c207\r
+TEST= 109\r
+PT=   00000000000000000000000000080000\r
+CT=   7607f078c77085184eaa9b060c1fbfff\r
+TEST= 110\r
+PT=   00000000000000000000000000040000\r
+CT=   9db841531bcbe7998dad19993fb3cc00\r
+TEST= 111\r
+PT=   00000000000000000000000000020000\r
+CT=   d6a089b654854a94560bae13298835b8\r
+TEST= 112\r
+PT=   00000000000000000000000000010000\r
+CT=   e1e223c4cf90cc5d195b370d65114622\r
+TEST= 113\r
+PT=   00000000000000000000000000008000\r
+CT=   1cbed73c50d053bdad372ceee54836a1\r
+TEST= 114\r
+PT=   00000000000000000000000000004000\r
+CT=   d309e69376d257adf2bfda152b26555f\r
+TEST= 115