Move libtomcrypt to submodule
This commit is contained in:
@@ -33,3 +33,7 @@
|
||||
path = extern/libtommath
|
||||
url = https://github.com/libtom/libtommath.git
|
||||
shallow = true
|
||||
[submodule "extern/libtomcrypt"]
|
||||
path = extern/libtomcrypt
|
||||
url = https://github.com/libtom/libtomcrypt.git
|
||||
shallow = true
|
||||
|
||||
@@ -45,7 +45,6 @@ option(WITH_SYSTEM_PNG "Build with system PNG library (may not work on 1.6+)"
|
||||
OFF)
|
||||
option(WITH_SYSTEM_OGG "Build with system OGG libraries" OFF)
|
||||
option(WITH_SYSTEM_GLEW "Build with system GLEW library" OFF)
|
||||
option(WITH_SYSTEM_TOMMATH "Build with system libtommath" OFF)
|
||||
option(WITH_SYSTEM_TOMCRYPT "Build with system libtomcrypt" OFF)
|
||||
option(WITH_SYSTEM_MAD "Build with system libmad" OFF)
|
||||
option(WITH_SYSTEM_JSONCPP "Build with system jsoncpp" OFF)
|
||||
|
||||
Vendored
+430
-817
File diff suppressed because it is too large
Load Diff
+1
Submodule extern/libtomcrypt added at 7e7eb695d5
+1
-7
@@ -104,9 +104,6 @@ if(WITH_LTO)
|
||||
set_property(TARGET "${SM_EXE_NAME}" PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
endif()
|
||||
|
||||
# Required for usage of tomcrypt and tommath.
|
||||
target_compile_definitions("${SM_EXE_NAME}" PRIVATE LTM_DESC)
|
||||
|
||||
if(WITH_PORTABLE_TOMCRYPT)
|
||||
target_compile_definitions("${SM_EXE_NAME}" PRIVATE LTC_NO_ASM)
|
||||
endif()
|
||||
@@ -349,6 +346,7 @@ else()
|
||||
endif()
|
||||
|
||||
if(WITH_SYSTEM_TOMCRYPT)
|
||||
target_compile_definitions("${SM_EXE_NAME}" PRIVATE LTM_DESC)
|
||||
list(APPEND SMDATA_LINK_LIB ${TOMCRYPT_LIBRARY})
|
||||
else()
|
||||
list(APPEND SMDATA_LINK_LIB "tomcrypt")
|
||||
@@ -583,10 +581,6 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT WITH_SYSTEM_TOMCRYPT)
|
||||
list(APPEND SM_INCLUDE_DIRS "${SM_SRC_DIR}/libtomcrypt/src/headers")
|
||||
endif()
|
||||
|
||||
target_include_directories("${SM_EXE_NAME}" PUBLIC ${SM_INCLUDE_DIRS})
|
||||
|
||||
if(WIN32)
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
---
|
||||
AccessModifierOffset: -2
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
BreakBeforeBinaryOperators: false
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BinPackParameters: true
|
||||
ColumnLimit: 120
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
DerivePointerBinding: true
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
IndentCaseLabels: true
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceBeforeProtocolList: false
|
||||
PenaltyBreakComment: 60
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 200
|
||||
PointerBindsToType: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
Cpp11BracedListStyle: false
|
||||
Standard: Cpp03
|
||||
IndentWidth: 3
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
BreakBeforeBraces: Linux
|
||||
IndentFunctionDeclarationAfterType: false
|
||||
SpacesInParentheses: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpaceAfterControlStatementKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
...
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
dist: trusty
|
||||
sudo: required
|
||||
|
||||
language: c
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
packages:
|
||||
- clang-3.8
|
||||
|
||||
install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install libtommath-dev
|
||||
|
||||
before_script:
|
||||
- gem install coveralls-lcov
|
||||
- curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz
|
||||
- export PATH=$PATH:`pwd`/lcov-1.11/bin
|
||||
- curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash
|
||||
- sudo apt-get install libtfm-dev=0.13-5
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /^release\/.*$/
|
||||
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
script:
|
||||
- bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile V=1" "-DUSE_LTM -DLTM_DESC" "-ltommath"
|
||||
- bash "${BUILDSCRIPT}" "${BUILDNAME}" "${BUILDOPTIONS}" "makefile.shared V=1" "-DUSE_TFM -DTFM_DESC" "-ltfm"
|
||||
env:
|
||||
- |
|
||||
BUILDSCRIPT="check_source.sh"
|
||||
BUILDNAME="CHECK_SOURCES"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="scan_build.sh"
|
||||
BUILDNAME="SCAN_BUILD"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="coverage.sh"
|
||||
BUILDNAME="COVERAGE"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="STOCK"
|
||||
BUILDOPTIONS=" "
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="EASY"
|
||||
BUILDOPTIONS="-DLTC_EASY"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="SMALL"
|
||||
BUILDOPTIONS="-DLTC_SMALL_CODE"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_NO_TABLES"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="SMALL+NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_NO_TABLES"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK"
|
||||
BUILDOPTIONS="-DLTC_CLEAN_STACK"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+SMALL"
|
||||
BUILDOPTIONS="-DLTC_SMALL_CODE -DLTC_CLEAN_STACK"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES+SMALL"
|
||||
BUILDOPTIONS="-DLTC_NO_TABLES -DLTC_CLEAN_STACK -DLTC_SMALL_CODE"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_FAST"
|
||||
BUILDOPTIONS="-DLTC_NO_FAST"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_FAST+NOTABLES"
|
||||
BUILDOPTIONS="-DLTC_NO_FAST -DLTC_NO_TABLES"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_ASM"
|
||||
BUILDOPTIONS="-DLTC_NO_ASM"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="NO_TIMING_RESISTANCE"
|
||||
BUILDOPTIONS="-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE"
|
||||
BUILDOPTIONS="-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="PTHREAD"
|
||||
BUILDOPTIONS="-DLTC_PTHREAD"
|
||||
- |
|
||||
BUILDSCRIPT="run.sh"
|
||||
BUILDNAME="CLEANSTACK+NOTABLES+SMALL+NO_ASM+NO_TIMING_RESISTANCE+PTHREAD"
|
||||
BUILDOPTIONS="-DLTC_CLEAN_STACK -DLTC_NO_TABLES -DLTC_SMALL_CODE -DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING -DLTC_PTHREAD"
|
||||
- |
|
||||
BUILDSCRIPT="testbuild.sh"
|
||||
BUILDNAME="NOTEST"
|
||||
BUILDOPTIONS="-DLTC_NO_TEST"
|
||||
- |
|
||||
BUILDSCRIPT="testbuild.sh"
|
||||
BUILDNAME="NOFILE"
|
||||
BUILDOPTIONS="-DLTC_NO_FILE"
|
||||
|
||||
after_failure:
|
||||
- cat test_std.txt
|
||||
- cat test_err.txt
|
||||
- cat tv.txt
|
||||
|
||||
after_script:
|
||||
- cat gcc_1.txt
|
||||
- cat gcc_2.txt
|
||||
|
||||
notifications:
|
||||
irc: "chat.freenode.net#libtom-notifications"
|
||||
@@ -1,29 +0,0 @@
|
||||
LibTomCrypt is licensed under DUAL licensing terms.
|
||||
|
||||
Choose and use the license of your needs.
|
||||
|
||||
[LICENSE #1]
|
||||
|
||||
LibTomCrypt is public domain. As should all quality software be.
|
||||
|
||||
Tom St Denis
|
||||
|
||||
[/LICENSE #1]
|
||||
|
||||
[LICENSE #2]
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
||||
[/LICENSE #2]
|
||||
@@ -1,173 +0,0 @@
|
||||
# libtomcrypt
|
||||
|
||||
Previously the git repository contained `doc/crypt.pdf` for detailed documentation.
|
||||
This was changed and the file is now only available from the tarball of the appropriate version
|
||||
or from the page https://github.com/libtom/libtomcrypt/releases .
|
||||
|
||||
## Project Status
|
||||
|
||||
master: [](https://travis-ci.org/libtom/libtomcrypt) [](https://coveralls.io/r/libtom/libtomcrypt)
|
||||
|
||||
develop: [](https://travis-ci.org/libtom/libtomcrypt) [](https://coveralls.io/r/libtom/libtomcrypt)
|
||||
|
||||
[](https://scan.coverity.com/projects/487)
|
||||
|
||||
API/ABI changes: [check here](https://abi-laboratory.pro/tracker/timeline/libtomcrypt/)
|
||||
|
||||
## Submitting patches
|
||||
|
||||
Please branch off from develop if you want to submit a patch.
|
||||
|
||||
Patch integration will be faster if tests and documentation are included.
|
||||
|
||||
Please update the makefiles in a separate commit. To update them simply run the `updatemakes.sh` script.
|
||||
|
||||
If you have something bigger to submit, feel free to contact us beforehand.
|
||||
Then we can give you write access to this repo, so you can open your PR based on this repo
|
||||
and we can easier follow the rebase-before-merge approach we're using (or even do the rebase ourself).
|
||||
|
||||
### Reviews
|
||||
|
||||
We're using Pull Request reviews to make sure that the code is in line with the existing code base.
|
||||
|
||||
Please have a look [here](https://help.github.com/articles/approving-a-pull-request-with-required-reviews/) to get an idea of the approach.
|
||||
|
||||
## Branches
|
||||
|
||||
Please be aware, that all branches besides _master_ and _develop_ __can__ and __will be__ force-pushed, rebased and/or removed!
|
||||
|
||||
If you want to rely on such an _unstable_ branch, create your own fork of this repository to make sure nothing breaks for you.
|
||||
|
||||
## Configuration options
|
||||
|
||||
By default the library builds its entire feature set (besides `katja`) in a (depending on your needs more or less) optimal way.
|
||||
|
||||
There are numerous configuration options available if you want to trim down the functionality of the library.
|
||||
|
||||
Please have a look at `src/headers/tomcrypt_custom.h` for all available configuration options.
|
||||
|
||||
The following list is a small part of the available, but the most often required, configuration switches.
|
||||
|
||||
| Flag | Behavior |
|
||||
| ---- | -------- |
|
||||
| `LTC_NO_TEST` | Remove all algorithm self-tests from the library |
|
||||
| `LTC_NO_FILE` | Remove all API functions requiring a pre-defined `FILE` data-type (mostly useful for embedded targets) |
|
||||
| `GMP_DESC` | enable [gmp](https://gmplib.org/) as MPI provider *\*1* |
|
||||
| `LTM_DESC` | enable [libtommath](http://www.libtom.net/) as MPI provider *\*1* |
|
||||
| `TFM_DESC` | enable [tomsfastmath](http://www.libtom.net/) as MPI provider *\*1* *\*2* |
|
||||
| `USE_GMP` | use `gmp` as MPI provider when building the binaries *\*3* |
|
||||
| `USE_LTM` | use `libtommath` as MPI provider when building the binaries *\*3* |
|
||||
| `USE_TFM` | use `tomsfastmath` as MPI provider when building the binaries *\*3* |
|
||||
|
||||
*\*1* It is possible to build the library against all MPI providers in parallel and choose at startup-time which math library should be used.
|
||||
|
||||
*\*2* Please be aware that `tomsfastmath` has the limitation of a fixed max size of MPI's.
|
||||
|
||||
*\*3* Only one is supported at the time & this is only required when building the binaries, not when building the library itself.
|
||||
|
||||
## Building the library
|
||||
|
||||
There are several `makefile`s provided. Please choose the one that fits best for you.
|
||||
|
||||
| makefile | use-case |
|
||||
| -------- | -------- |
|
||||
| `makefile` | builds a static library (GNU Make required) |
|
||||
| `makefile.shared` | builds a shared (and static) library (GNU Make required) |
|
||||
| `makefile.unix` | for unusual UNIX platforms, or if you do not have GNU Make |
|
||||
| `makefile.mingw` | for usage with the mingw compiler on MS Windows |
|
||||
| `makefile.msvc` | for usage with the MSVC compiler on MS Windows |
|
||||
| `libtomcrypt_VS2008.sln` | A VisualStudio 2008 project for MS Windows |
|
||||
|
||||
### Make targets
|
||||
|
||||
The `makefile`s provide several targets to build (VS project excluded).
|
||||
The following list does not claim to be complete resp. to be available across all `makefile` variants.
|
||||
|
||||
| target | application |
|
||||
| ------ | ----------- |
|
||||
| *empty target*/none given | c.f. `library`
|
||||
| `library` | builds only the library |
|
||||
| `hashsum` | builds the `hashsum` binary, similar to [`shasum`](https://linux.die.net/man/1/shasum), but with support for all hash-algorithms included in the library *\*4* |
|
||||
| `ltcrypt` | builds the `ltcrypt` binary, implementing something similar to [`crypt`](https://linux.die.net/man/3/crypt) *\*4* |
|
||||
| `sizes` | builds the `sizes` binary, printing all internal data sizes on invocation *\*4* |
|
||||
| `constants` | builds the `constants` binary, printing all internal constants on invocation *\*4* |
|
||||
| `openssl-enc` | builds the `openssl-enc` binary, which is more or less compatible to [`openssl enc`](https://linux.die.net/man/1/enc) *\*4* *\*5* |
|
||||
| `test` | builds the `test` binary, which runs all algorithm self-tests + some extended tests *\*4* |
|
||||
| `timing` | builds the `timing` binary, which can be used to measure timings for algorithms and modes *\*4* |
|
||||
| `bins` | builds `hashsum` *\*4* |
|
||||
| `all_test` | builds `test`, `hashsum`, `ltcrypt`, `small`, `tv_gen`, `sizes` & `constants` *\*4* |
|
||||
| `docs` | builds the developer documentation `doc/crypt.pdf` |
|
||||
| `install` | installs the `library` and header files *\*7* *\*8* |
|
||||
| `install_bins` | installs the binaries created by the `bins` target *\*7* *\*8* |
|
||||
| `install_docs` | installs the documentation created by the `docs` target *\*7* *\*8* |
|
||||
| `install_test` | installs the test-app created by the `test` target *\*7* *\*8* |
|
||||
| `install_all` | installs everything (i.e. `library`, `bins`, `docs` and `test`) *\*8* |
|
||||
| `uninstall` | uninstalls the `library` and header files |
|
||||
|
||||
*\*4* also builds `library`
|
||||
|
||||
*\*5* broken build in some configurations, therefore not built by default
|
||||
|
||||
*\*7* also builds the necessary artifact(s) before installing it
|
||||
|
||||
*\*8* also have a look at the 'Installation' section of this file
|
||||
|
||||
### Examples
|
||||
|
||||
You want to build the library as static library
|
||||
|
||||
make
|
||||
|
||||
You want to build the library as shared library
|
||||
|
||||
make -f makefile.shared
|
||||
|
||||
You have `libtommath` installed on your system and want to build a static library and the `test` binary to run the self-tests.
|
||||
|
||||
make CFLAGS="-DUSE_LTM -DLTM_DESC" EXTRALIBS="-ltommath" test
|
||||
|
||||
You have `tomsfastmath` installed on your system and want to build a shared library and all binaries
|
||||
|
||||
make -f makefile.shared CFLAGS="-DUSE_TFM -DTFM_DESC" EXTRALIBS="-ltfm" all demos
|
||||
|
||||
You have `gmp`, `libtommath` and `tomsfastmath` installed on your system and want to build a static library and the `timing` binary to measure timings against `gmp`.
|
||||
|
||||
make CFLAGS="-DUSE_GMP -DGMP_DESC -DLTM_DESC -DTFM_DESC" EXTRALIBS="-lgmp" timing
|
||||
|
||||
If you have `libtommath` in a non-standard location:
|
||||
|
||||
make CFLAGS="-DUSE_LTM -DLTM_DESC -I/opt/devel/ltm" EXTRALIBS="/opt/devel/ltm/libtommath.a" all
|
||||
|
||||
## Installation
|
||||
|
||||
There exist several _install_ make-targets which are described in the table above.
|
||||
|
||||
These targets support the standard ways (c.f. [[GNU]], [[FreeBSD]])
|
||||
to modify the installation path via the following set of variables:
|
||||
|
||||
DESTDIR
|
||||
PREFIX
|
||||
LIBPATH
|
||||
INCPATH
|
||||
DATAPATH
|
||||
BINPATH
|
||||
|
||||
The entire set of the variables is only supported in `makefile`, `makefile.shared` and `makefile.unix`.
|
||||
|
||||
In case you have to use one of the other makefiles, check in the file which variables are supported.
|
||||
|
||||
### Examples
|
||||
|
||||
You want to install the static library to the default paths
|
||||
|
||||
make install
|
||||
|
||||
You want to install the shared library to a special path and use it from this path
|
||||
|
||||
make -f makefile.shared PREFIX=/opt/special/path
|
||||
|
||||
Have a look at the developer documentation, [[GNU]] or [[FreeBSD]] to get a detailed explanation of all the variables.
|
||||
|
||||
[GNU]: https://www.gnu.org/prep/standards/html_node/DESTDIR.html
|
||||
|
||||
[FreeBSD]: https://www.freebsd.org/doc/en/books/porters-handbook/porting-prefix.html
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/bin/bash
|
||||
echo "$1 ($2, $3)..."
|
||||
|
||||
make clean 1>/dev/null 2>/dev/null
|
||||
|
||||
echo -n "building..."
|
||||
|
||||
if [ -f /proc/cpuinfo ]
|
||||
then
|
||||
MAKE_JOBS=$(( ($(cat /proc/cpuinfo | grep -E '^processor[[:space:]]*:' | tail -n -1 | cut -d':' -f2) + 1) * 2 + 1 ))
|
||||
else
|
||||
MAKE_JOBS=8
|
||||
fi
|
||||
|
||||
CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j$MAKE_JOBS -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt
|
||||
mret=$?
|
||||
cnt=$(wc -l < gcc_2.txt)
|
||||
# ignore 1 line since ar prints to stderr instead of stdout and ar is called for
|
||||
# $(LIBNAME)
|
||||
if [[ $mret -ne 0 ]] || [[ $cnt -gt 1 ]]; then
|
||||
echo "build $1 failed! printing gcc_2.txt now for convenience"
|
||||
cat gcc_2.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "testing..."
|
||||
|
||||
if [ -a test ] && [ -f test ] && [ -x test ]; then
|
||||
((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt or tv.txt" && exit 1)
|
||||
if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then
|
||||
for f in *_tv.txt; do
|
||||
# check for lines starting with '<' ($f might be a subset of notes/$f)
|
||||
difftroubles=$(diff -i -w -B $f notes/$f | grep '^<')
|
||||
if [ -n "$difftroubles" ]; then
|
||||
echo "FAILURE: $f"
|
||||
diff -i -w -B $f notes/$f
|
||||
echo "tv_gen $f failed" && rm -f testok.txt && exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
if [ "$LTC_COVERAGE" != "" ]; then
|
||||
./coverage_more.sh > test_coverage_more.txt || exit 1
|
||||
lcov_opts="--capture --no-external --directory src -q"
|
||||
lcov_out=$(echo coverage_$1_$2_$3 | tr ' -=+' '_')".info"
|
||||
lcov $lcov_opts --output-file $lcov_out
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
exit 1
|
||||
|
||||
# ref: HEAD -> master, tag: v1.18.2
|
||||
# git commit: 7e7eb695d581782f04b24dc444cbfde86af59853
|
||||
# commit time: 2018-07-01 22:49:01 +0200
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# output version
|
||||
bash printinfo.sh
|
||||
|
||||
make clean > /dev/null
|
||||
|
||||
echo "checking..."
|
||||
./helper.pl --check-source --check-makefiles --check-defines|| exit 1
|
||||
|
||||
exit 0
|
||||
|
||||
# ref: HEAD -> master, tag: v1.18.2
|
||||
# git commit: 7e7eb695d581782f04b24dc444cbfde86af59853
|
||||
# commit time: 2018-07-01 22:49:01 +0200
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$TRAVIS_CI" == "private" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$#" != "5" ]; then
|
||||
echo "Usage is: ${0} \"coverage\" \"<prepend CFLAGS>\" \"<makefile>\" \"<append CFLAGS>\" <math library to link to>"
|
||||
echo "CC=gcc ${0} \"coverage\" \" \" \"makefile\" \"-DUSE_LTM -DLTM_DESC -I../libtommath\" ../libtommath/libtommath.a"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ -z "$(echo $CC | grep "gcc")" ]; then
|
||||
echo "no gcc detected, early exit success"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(echo $3 | grep -v 'makefile[.]')" == "" ]; then
|
||||
echo "only run $0 for the regular makefile, early exit success"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# output version
|
||||
bash printinfo.sh
|
||||
|
||||
bash build.sh " $1" " $2" " $3 COVERAGE=1" "$4" "$5"
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "Test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./coverage_more.sh > test_coverage_more.txt || { rm -f testok.txt && exit 1 ; }
|
||||
|
||||
make lcov-single
|
||||
# if this was executed as './coverage.sh ...' create coverage locally
|
||||
if [[ "${0%% *}" == "./${0##*/}" ]]; then
|
||||
make lcov-html
|
||||
else
|
||||
coveralls-lcov coverage.info
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# ref: HEAD -> master, tag: v1.18.2
|
||||
# git commit: 7e7eb695d581782f04b24dc444cbfde86af59853
|
||||
# commit time: 2018-07-01 22:49:01 +0200
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
./sizes
|
||||
./constants
|
||||
|
||||
for i in $(for j in $(echo $(./hashsum -h | awk '/Algorithms/,EOF' | tail -n +2)); do echo $j; done | sort); do echo -n "$i: " && ./hashsum -a $i tests/test.key ; done > hashsum_tv.txt
|
||||
difftroubles=$(diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt | grep '^<') || true
|
||||
if [ -n "$difftroubles" ]; then
|
||||
echo "FAILURE: hashsum_tv.tx"
|
||||
diff -i -w -B hashsum_tv.txt notes/hashsum_tv.txt
|
||||
echo "hashsum failed"
|
||||
exit 1
|
||||
else
|
||||
echo "hashsum okay"
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
# ref: HEAD -> master, tag: v1.18.2
|
||||
# git commit: 7e7eb695d581782f04b24dc444cbfde86af59853
|
||||
# commit time: 2018-07-01 22:49:01 +0200
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
echo "usage is: ${0##*/} <path to coverity scan> <extra compiler options>"
|
||||
echo "e.g. \"${0##*/} \"/usr/local/bin/coverity\" \"-DLTM_DESC -I/path/to/libtommath/\"\""
|
||||
exit -1
|
||||
fi
|
||||
|
||||
PATH=$PATH:$1/bin
|
||||
|
||||
make clean
|
||||
rm -r cov-int/
|
||||
|
||||
myCflags=""
|
||||
myCflags="$myCflags -O2 ${2}"
|
||||
myCflags="$myCflags -pipe -Werror -Wpointer-arith -Winit-self -Wextra -Wall -Wformat -Wformat-security"
|
||||
|
||||
CFLAGS="$myCflags" cov-build --dir cov-int make -f makefile.unix $MAKE_OPTS IGNORE_SPEED=1 1>gcc_1.txt
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "make failed"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# zipup everything
|
||||
tar caf libtomcrypt.lzma cov-int
|
||||
|
||||
mytoken=$(cat .coverity_token)
|
||||
mymail=$(cat .coverity_mail)
|
||||
myversion=$(git describe --dirty)
|
||||
|
||||
curl -k --form project=libtomcrypt \
|
||||
--form token=${mytoken} \
|
||||
--form email=${mymail} \
|
||||
--form file=@libtomcrypt.lzma \
|
||||
--form version=\"${myversion}\" \
|
||||
--form description="\"libtomcrypt version ${myversion}\"" \
|
||||
https://scan.coverity.com/builds?project=libtom%2Flibtomcrypt
|
||||
@@ -1,87 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#define basename(x) x
|
||||
#endif
|
||||
|
||||
/**
|
||||
@file demo_crypt_constants.c
|
||||
|
||||
Demo how to get various constants to dynamic languages
|
||||
like Python
|
||||
|
||||
Larry Bugbee, February 2013
|
||||
*/
|
||||
|
||||
static void _print_line(const char* cmd, const char* desc)
|
||||
{
|
||||
printf(" %-16s - %s\n", cmd, desc);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc == 1) {
|
||||
/* given a specific constant name, get and print its value */
|
||||
char name[] = "CTR_COUNTER_BIG_ENDIAN";
|
||||
int value;
|
||||
char *names_list;
|
||||
unsigned int names_list_len;
|
||||
|
||||
if (crypt_get_constant(name, &value) != 0) exit(EXIT_FAILURE);
|
||||
printf("\n %s is %d \n\n", name, value);
|
||||
|
||||
/* get and print the length of the names (and values) list */
|
||||
|
||||
if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" need to allocate %u bytes \n\n", names_list_len);
|
||||
|
||||
/* get and print the names (and values) list */
|
||||
if ((names_list = malloc(names_list_len)) == NULL) exit(EXIT_FAILURE);
|
||||
if (crypt_list_all_constants(names_list, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" supported constants:\n\n%s\n\n", names_list);
|
||||
free(names_list);
|
||||
} else if (argc == 2) {
|
||||
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
|
||||
char* base = strdup(basename(argv[0]));
|
||||
printf("Usage: %s [-a] [-s name]\n\n", base);
|
||||
_print_line("<no argument>", "The old behavior of the demo");
|
||||
_print_line("-a", "Only lists all constants");
|
||||
_print_line("-s name", "List a single constant given as argument");
|
||||
_print_line("-h", "The help you're looking at");
|
||||
free(base);
|
||||
} else if (strcmp(argv[1], "-a") == 0) {
|
||||
char *names_list;
|
||||
unsigned int names_list_len;
|
||||
/* get and print the length of the names (and values) list */
|
||||
if (crypt_list_all_constants(NULL, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
/* get and print the names (and values) list */
|
||||
if ((names_list = malloc(names_list_len)) == NULL) exit(EXIT_FAILURE);
|
||||
if (crypt_list_all_constants(names_list, &names_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s\n", names_list);
|
||||
free(names_list);
|
||||
}
|
||||
} else if (argc == 3) {
|
||||
if (strcmp(argv[1], "-s") == 0) {
|
||||
int value;
|
||||
if (crypt_get_constant(argv[2], &value) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s,%u\n", argv[2], value);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,309 +0,0 @@
|
||||
|
||||
|
||||
"""
|
||||
demo_dynamic.py v2b
|
||||
|
||||
This program demonstrates Python's use of the dynamic
|
||||
language support additions to LTC, namely access to LTC
|
||||
constants, struct and union sizes, and the binding of a
|
||||
math package to LTC. Also provided are simple code
|
||||
fragments to illustrate how one might write a Python
|
||||
wrapper for LTC and how an app might call the wrapper.
|
||||
This or a similar model should work for Ruby and other
|
||||
dynamic languages.
|
||||
|
||||
This instance uses Python's ctypes and requires a single
|
||||
.dylib linking together LTC and a math library. Building
|
||||
a single .dylib is needed because LTC wants a fairly tight
|
||||
relationship between itself and the mathlib. (ctypes can
|
||||
load multiple .dylibs, but it does not support this level
|
||||
of tight coupling between otherwise independent libraries.)
|
||||
|
||||
My .dylib was created on OSX/macOS with the following:
|
||||
sudo make -j5 -f makefile.shared \
|
||||
CFLAGS="-DUSE_TFM -DTFM_DESC -I/usr/local/include" \
|
||||
EXTRALIBS=/usr/local/lib/libtfm.a install
|
||||
|
||||
For python 2.7.12 on Ubuntu Xenial the following worked for
|
||||
me (without MPI support):
|
||||
sudo make -f makefile.shared install PREFIX="/usr"
|
||||
|
||||
Reminder: you don't need to bind in a math library unless
|
||||
you are going to use LTC functions that need a
|
||||
mathlib. For example, public key crypto requires
|
||||
a mathlib; hashing and symmetric encryption do not.
|
||||
|
||||
------
|
||||
|
||||
This code was originally written for Python 2.7 with the
|
||||
ctypes standard library. This version is modified to run
|
||||
under both Python 2.7 and 3.6.
|
||||
|
||||
Arguably the biggest change for Python3 has to do with
|
||||
strings. Under Python2, native strings are ASCII bytes and
|
||||
passing them to LTC is natural and requires no conversion.
|
||||
Under Python3 all native strings are Unicode which requires
|
||||
they be converted to bytes before use by LTC.
|
||||
|
||||
Note the following for Python3.
|
||||
- ASCII keys, IVs and other string arguments must be
|
||||
'bytes'. Define them with a 'b' prefix or convert
|
||||
via the 'bytes()' function.
|
||||
- "strings" returned from LTC are bytes and conversion
|
||||
to Unicode might be necessary for proper printing.
|
||||
If so, use <string>.decode('utf-8').
|
||||
- The Python2 'print' statement becomes a function in
|
||||
Python3 which requires parenthesis, eg. 'print()'.
|
||||
|
||||
NB: Unicode is achieved under Python2 by either defining
|
||||
a Unicode string with a 'u' prefix or passing ASCII
|
||||
strings thru the 'unicode()' function.
|
||||
|
||||
Larry Bugbee
|
||||
March 2014 v1
|
||||
August 2017 v2b
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
from ctypes import *
|
||||
from ctypes.util import find_library
|
||||
|
||||
# switches to enable/disable selected output
|
||||
SHOW_ALL_CONSTANTS = True
|
||||
SHOW_ALL_SIZES = True
|
||||
SHOW_SELECTED_CONSTANTS = True
|
||||
SHOW_SELECTED_SIZES = True
|
||||
SHOW_BUILD_OPTIONS_ALGS = True
|
||||
SHOW_SHA256_EXAMPLE = True
|
||||
SHOW_CHACHA_EXAMPLE = True
|
||||
|
||||
print(' ')
|
||||
print(' demo_dynamic.py')
|
||||
|
||||
def inprint(s, indent=0):
|
||||
"prints strings indented, including multline strings"
|
||||
for line in s.split('\n'):
|
||||
print(' '*indent + line)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# load the .dylib
|
||||
|
||||
libname = 'tomcrypt'
|
||||
libpath = find_library(libname)
|
||||
print(' ')
|
||||
print(' path to library %s: %s' % (libname, libpath))
|
||||
|
||||
LTC = cdll.LoadLibrary(libpath)
|
||||
print(' loaded: %s' % LTC)
|
||||
print(' ')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# get list of all supported constants followed by a list of all
|
||||
# supported sizes. One alternative: these lists may be parsed
|
||||
# and used as needed.
|
||||
|
||||
if SHOW_ALL_CONSTANTS:
|
||||
print('-'*60)
|
||||
print(' all supported constants and their values:')
|
||||
|
||||
# get size to allocate for constants output list
|
||||
str_len = c_int(0)
|
||||
ret = LTC.crypt_list_all_constants(None, byref(str_len))
|
||||
print(' need to allocate %d bytes to build list \n' % str_len.value)
|
||||
|
||||
# allocate that size and get (name, size) pairs, each pair
|
||||
# separated by a newline char.
|
||||
names_sizes = c_buffer(str_len.value)
|
||||
ret = LTC.crypt_list_all_constants(names_sizes, byref(str_len))
|
||||
print(names_sizes.value.decode("utf-8"))
|
||||
print(' ')
|
||||
|
||||
|
||||
if SHOW_ALL_SIZES:
|
||||
print('-'*60)
|
||||
print(' all supported sizes:')
|
||||
|
||||
# get size to allocate for sizes output list
|
||||
str_len = c_int(0)
|
||||
ret = LTC.crypt_list_all_sizes(None, byref(str_len))
|
||||
print(' need to allocate %d bytes to build list \n' % str_len.value)
|
||||
|
||||
# allocate that size and get (name, size) pairs, each pair
|
||||
# separated by a newline char.
|
||||
names_sizes = c_buffer(str_len.value)
|
||||
ret = LTC.crypt_list_all_sizes(names_sizes, byref(str_len))
|
||||
print(names_sizes.value.decode("utf-8"))
|
||||
print(' ')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# get individually named constants and sizes
|
||||
|
||||
if SHOW_SELECTED_CONSTANTS:
|
||||
print('-'*60)
|
||||
print('\n selected constants:')
|
||||
|
||||
names = [
|
||||
b'ENDIAN_LITTLE',
|
||||
b'ENDIAN_64BITWORD',
|
||||
b'PK_PUBLIC',
|
||||
b'LTC_MILLER_RABIN_REPS',
|
||||
b'CTR_COUNTER_BIG_ENDIAN',
|
||||
]
|
||||
for name in names:
|
||||
const_value = c_int(0)
|
||||
rc = LTC.crypt_get_constant(name, byref(const_value))
|
||||
value = const_value.value
|
||||
print(' %-25s %d' % (name.decode("utf-8"), value))
|
||||
print(' ')
|
||||
|
||||
if SHOW_SELECTED_SIZES:
|
||||
print('-'*60)
|
||||
print('\n selected sizes:')
|
||||
|
||||
names = [
|
||||
b'rijndael_key',
|
||||
b'rsa_key',
|
||||
b'symmetric_CTR',
|
||||
b'twofish_key',
|
||||
b'ecc_point',
|
||||
b'gcm_state',
|
||||
b'sha512_state',
|
||||
]
|
||||
for name in names:
|
||||
size_value = c_int(0)
|
||||
rc = LTC.crypt_get_size(name, byref(size_value))
|
||||
value = size_value.value
|
||||
print(' %-25s %d' % (name.decode("utf-8"), value))
|
||||
print(' ')
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
# LibTomCrypt exposes one interesting string that can be accessed
|
||||
# via Python's ctypes module, "crypt_build_settings", which
|
||||
# provides a list of this build's compiler switches and supported
|
||||
# algorithms. If someday LTC exposes other interesting strings,
|
||||
# they can be found with:
|
||||
# nm /usr/local/lib/libtomcrypt.dylib | grep " D "
|
||||
|
||||
def get_named_string(lib, name):
|
||||
return c_char_p.in_dll(lib, name).value.decode("utf-8")
|
||||
|
||||
if SHOW_BUILD_OPTIONS_ALGS:
|
||||
print('-'*60)
|
||||
print('This is a string compiled into LTC showing compile')
|
||||
print('options and algorithms supported by this build \n')
|
||||
# print(get_named_string(LTC, 'crypt_build_settings'))
|
||||
inprint(get_named_string(LTC, 'crypt_build_settings'), 4)
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
# here is an example of how Python code can be written to access
|
||||
# LTC's implementation of SHA256 and ChaCha,
|
||||
|
||||
# - - - - - - - - - - - - -
|
||||
# definitions
|
||||
|
||||
from binascii import hexlify, unhexlify
|
||||
|
||||
def _err2str(err):
|
||||
# define return type
|
||||
errstr = LTC.error_to_string
|
||||
errstr.restype = c_char_p
|
||||
# get and return err string
|
||||
return errstr(err)
|
||||
|
||||
def _get_size(name):
|
||||
size = c_int(0)
|
||||
rc = LTC.crypt_get_size(bytes(name), byref(size))
|
||||
if rc != 0:
|
||||
raise Exception('LTC.crypt_get_size(%s) rc = %d' % (name, rc))
|
||||
return size.value
|
||||
|
||||
def _get_constant(name):
|
||||
constant = c_int(0)
|
||||
rc = LTC.crypt_get_constant(bytes(name), byref(constant))
|
||||
if rc != 0:
|
||||
raise Exception('LTC.crypt_get_constant(%s) rc = %d' % (name, rc))
|
||||
return constant.value
|
||||
|
||||
CRYPT_OK = _get_constant(b'CRYPT_OK')
|
||||
|
||||
class SHA256(object):
|
||||
def __init__(self):
|
||||
self.state = c_buffer(_get_size(b'sha256_state'))
|
||||
LTC.sha256_init(byref(self.state))
|
||||
def update(self, data):
|
||||
LTC.sha256_process(byref(self.state), data, len(data))
|
||||
def digest(self):
|
||||
md = c_buffer(32)
|
||||
LTC.sha256_done(byref(self.state), byref(md))
|
||||
return md.raw
|
||||
|
||||
class ChaCha(object):
|
||||
def __init__(self, key, rounds):
|
||||
self.state = c_buffer(_get_size(b'chacha_state'))
|
||||
self.counter = c_int(1)
|
||||
err = LTC.chacha_setup(byref(self.state), key, len(key), rounds)
|
||||
if err != CRYPT_OK:
|
||||
raise Exception('LTC.chacha_setup(), err = %d, "%s"' % (err, _err2str(err)))
|
||||
def set_iv32(self, iv):
|
||||
err = LTC.chacha_ivctr32(byref(self.state), iv, len(iv), byref(self.counter))
|
||||
if err != CRYPT_OK:
|
||||
raise Exception('LTC.chacha_ivctr32(), err = %d, "%s"' % (err, _err2str(err)))
|
||||
def crypt(self, datain):
|
||||
dataout = c_buffer(len(datain))
|
||||
err = LTC.chacha_crypt(byref(self.state), datain, len(datain), byref(dataout))
|
||||
if err != CRYPT_OK:
|
||||
raise Exception('LTC.chacha_crypt(), err = %d, "%s"' % (err, _err2str(err)))
|
||||
return dataout.raw
|
||||
|
||||
# - - - - - - - - - - - - -
|
||||
# a SHA256 app fragment
|
||||
|
||||
if SHOW_SHA256_EXAMPLE:
|
||||
print('-'*60)
|
||||
data = b'hello world' # we want bytes, not Unicode
|
||||
|
||||
sha256 = SHA256()
|
||||
sha256.update(data)
|
||||
md = sha256.digest()
|
||||
|
||||
template = '\n the SHA256 digest for "%s" is %s \n'
|
||||
print(template % (data, hexlify(md)))
|
||||
|
||||
# - - - - - - - - - - - - -
|
||||
# a ChaCha app fragment
|
||||
|
||||
if SHOW_CHACHA_EXAMPLE:
|
||||
print('-'*60)
|
||||
key = b'hownowbrowncow\x00\x00' # exactly 16 or 32 bytes
|
||||
rounds = 12 # common values: 8, 12, 20
|
||||
iv = b'123456789012' # exactly 12 bytes
|
||||
plain = b'Kilroy was here, there, and everywhere!'
|
||||
|
||||
cha = ChaCha(key, rounds)
|
||||
cha.set_iv32(iv)
|
||||
cipher = cha.crypt(plain)
|
||||
|
||||
template = '\n ChaCha%d ciphertext for "%s" is "%s"'
|
||||
print(template % (rounds, plain, hexlify(cipher)))
|
||||
|
||||
cha.set_iv32(iv) # reset to decrypt
|
||||
decrypted = cha.crypt(cipher)
|
||||
|
||||
template = ' ChaCha%d decoded text for "%s" is "%s" \n'
|
||||
print(template % (rounds, plain, decrypted.decode("utf-8")))
|
||||
|
||||
# Footnote: Keys should be erased fm memory as soon as possible after use,
|
||||
# and that includes Python. For a tip on how to do that in Python, see
|
||||
# http://buggywhip.blogspot.com/2010/12/erase-keys-and-credit-card-numbers-in.html
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -1,300 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Written by Daniel Richards <kyhwana@world-net.co.nz> 6/7/2002
|
||||
* hash.c: This app uses libtomcrypt to hash either stdin or a file
|
||||
* This file is Public Domain. No rights are reserved.
|
||||
* Compile with 'gcc hashsum.c -o hashsum -ltomcrypt'
|
||||
* This example isn't really big enough to warrent splitting into
|
||||
* more functions ;)
|
||||
*/
|
||||
|
||||
#include <tomcrypt.h>
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#define basename(x) x
|
||||
#endif
|
||||
|
||||
#if !defined(PATH_MAX) && defined(_MSC_VER)
|
||||
#include <windows.h>
|
||||
#define PATH_MAX MAX_PATH
|
||||
#endif
|
||||
|
||||
/* thanks http://stackoverflow.com/a/8198009 */
|
||||
#define _base(x) ((x >= '0' && x <= '9') ? '0' : \
|
||||
(x >= 'a' && x <= 'f') ? 'a' - 10 : \
|
||||
(x >= 'A' && x <= 'F') ? 'A' - 10 : \
|
||||
'\255')
|
||||
#define HEXOF(x) (x - _base(x))
|
||||
|
||||
static char* hashsum;
|
||||
|
||||
static void cleanup(void)
|
||||
{
|
||||
free(hashsum);
|
||||
}
|
||||
|
||||
static void die(int status)
|
||||
{
|
||||
unsigned long w, x;
|
||||
FILE* o = status == EXIT_SUCCESS ? stdout : stderr;
|
||||
fprintf(o, "usage: %s -a algorithm [-c] [file...]\n\n", hashsum);
|
||||
fprintf(o, "\t-c\tCheck the hash(es) of the file(s) written in [file].\n");
|
||||
fprintf(o, "\t\t(-a not required)\n");
|
||||
fprintf(o, "\nAlgorithms:\n\t");
|
||||
w = 0;
|
||||
for (x = 0; hash_descriptor[x].name != NULL; x++) {
|
||||
w += fprintf(o, "%-14s", hash_descriptor[x].name);
|
||||
if (w >= 70) {
|
||||
fprintf(o, "\n\t");
|
||||
w = 0;
|
||||
}
|
||||
}
|
||||
if (w != 0) fprintf(o, "\n");
|
||||
exit(status);
|
||||
}
|
||||
|
||||
static void printf_hex(unsigned char* hash_buffer, unsigned long w)
|
||||
{
|
||||
unsigned long x;
|
||||
for (x = 0; x < w; x++) {
|
||||
printf("%02x",hash_buffer[x]);
|
||||
}
|
||||
}
|
||||
|
||||
static void check_file(int argn, int argc, char **argv)
|
||||
{
|
||||
int err, failed, invalid;
|
||||
unsigned char is_buffer[MAXBLOCKSIZE], should_buffer[MAXBLOCKSIZE];
|
||||
char buf[PATH_MAX + (MAXBLOCKSIZE * 3)];
|
||||
/* iterate through all files */
|
||||
while(argn < argc) {
|
||||
char* s;
|
||||
FILE* f = fopen(argv[argn], "rb");
|
||||
if(f == NULL) {
|
||||
int n = snprintf(buf, sizeof(buf), "%s: %s", hashsum, argv[argn]);
|
||||
if (n > 0 && n < (int)sizeof(buf))
|
||||
perror(buf);
|
||||
else
|
||||
perror(argv[argn]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
failed = 0;
|
||||
invalid = 0;
|
||||
/* read the file line by line */
|
||||
while((s = fgets(buf, sizeof(buf), f)) != NULL)
|
||||
{
|
||||
int tries, n;
|
||||
unsigned long hash_len, w, x;
|
||||
char* space = strstr(s, " ");
|
||||
|
||||
/* skip lines with comments */
|
||||
if (buf[0] == '#') continue;
|
||||
|
||||
if (space == NULL) {
|
||||
fprintf(stderr, "%s: no properly formatted checksum lines found\n", hashsum);
|
||||
goto ERR;
|
||||
}
|
||||
|
||||
hash_len = space - s;
|
||||
hash_len /= 2;
|
||||
|
||||
if (hash_len > sizeof(should_buffer)) {
|
||||
fprintf(stderr, "%s: hash too long\n", hashsum);
|
||||
goto ERR;
|
||||
}
|
||||
|
||||
/* convert the hex-string back to binary */
|
||||
for (x = 0; x < hash_len; ++x) {
|
||||
should_buffer[x] = HEXOF(s[x*2]) << 4 | HEXOF(s[x*2 + 1]);
|
||||
}
|
||||
|
||||
space++;
|
||||
if (*space != '*') {
|
||||
fprintf(stderr, "%s: unsupported input mode '%c'\n", hashsum, *space);
|
||||
goto ERR;
|
||||
}
|
||||
space++;
|
||||
|
||||
for (n = 0; n < (buf + sizeof(buf)) - space; ++n) {
|
||||
if(iscntrl((int)space[n])) {
|
||||
space[n] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* try all hash algorithms that have the appropriate hash size */
|
||||
tries = 0;
|
||||
for (x = 0; hash_descriptor[x].name != NULL; ++x) {
|
||||
if (hash_descriptor[x].hashsize == hash_len) {
|
||||
tries++;
|
||||
w = sizeof(is_buffer);
|
||||
if ((err = hash_file(x, space, is_buffer, &w)) != CRYPT_OK) {
|
||||
fprintf(stderr, "%s: File hash error: %s: %s\n", hashsum, space, error_to_string(err));
|
||||
ERR:
|
||||
fclose(f);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if(XMEMCMP(should_buffer, is_buffer, w) == 0) {
|
||||
printf("%s: OK\n", space);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} /* for */
|
||||
if (hash_descriptor[x].name == NULL) {
|
||||
if(tries > 0) {
|
||||
printf("%s: FAILED\n", space);
|
||||
failed++;
|
||||
}
|
||||
else {
|
||||
invalid++;
|
||||
}
|
||||
}
|
||||
} /* while */
|
||||
fclose(f);
|
||||
if(invalid) {
|
||||
fprintf(stderr, "%s: WARNING: %d %s is improperly formatted\n", hashsum, invalid, invalid > 1?"lines":"line");
|
||||
}
|
||||
if(failed) {
|
||||
fprintf(stderr, "%s: WARNING: %d computed %s did NOT match\n", hashsum, failed, failed > 1?"checksums":"checksum");
|
||||
}
|
||||
argn++;
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int idxs[TAB_SIZE], idx, check, y, z, err, argn;
|
||||
unsigned long w, x;
|
||||
unsigned char hash_buffer[MAXBLOCKSIZE];
|
||||
|
||||
hashsum = strdup(basename(argv[0]));
|
||||
atexit(cleanup);
|
||||
|
||||
/* You need to register algorithms before using them */
|
||||
register_all_ciphers();
|
||||
register_all_hashes();
|
||||
if (argc > 1 && (strcmp("-h", argv[1]) == 0 || strcmp("--help", argv[1]) == 0)) {
|
||||
die(EXIT_SUCCESS);
|
||||
}
|
||||
if (argc < 3) {
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (x = 0; x < sizeof(idxs)/sizeof(idxs[0]); ++x) {
|
||||
idxs[x] = -2;
|
||||
}
|
||||
argn = 1;
|
||||
check = 0;
|
||||
idx = 0;
|
||||
|
||||
while(argn < argc){
|
||||
if(strcmp("-a", argv[argn]) == 0) {
|
||||
argn++;
|
||||
if(argn < argc) {
|
||||
idxs[idx] = find_hash(argv[argn]);
|
||||
if (idxs[idx] == -1) {
|
||||
struct {
|
||||
const char* is;
|
||||
const char* should;
|
||||
} shasum_compat[] =
|
||||
{
|
||||
#ifdef LTC_SHA1
|
||||
{ "1", sha1_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA224
|
||||
{ "224", sha224_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA256
|
||||
{ "256", sha256_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA384
|
||||
{ "384", sha384_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA512
|
||||
{ "512", sha512_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA512_224
|
||||
{ "512224", sha512_224_desc.name },
|
||||
#endif
|
||||
#ifdef LTC_SHA512_256
|
||||
{ "512256", sha512_256_desc.name },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
for (x = 0; shasum_compat[x].is != NULL; ++x) {
|
||||
if(XSTRCMP(shasum_compat[x].is, argv[argn]) == 0) {
|
||||
idxs[idx] = find_hash(shasum_compat[x].should);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (idxs[idx] == -1) {
|
||||
fprintf(stderr, "%s: Unrecognized algorithm\n", hashsum);
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
idx++;
|
||||
if ((size_t)idx >= sizeof(idxs)/sizeof(idxs[0])) {
|
||||
fprintf(stderr, "%s: Too many '-a' options chosen\n", hashsum);
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
argn++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
die(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
if(strcmp("-c", argv[argn]) == 0) {
|
||||
check = 1;
|
||||
argn++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (check == 1) {
|
||||
check_file(argn, argc, argv);
|
||||
}
|
||||
|
||||
if (argc == argn) {
|
||||
w = sizeof(hash_buffer);
|
||||
if ((err = hash_filehandle(idxs[0], stdin, hash_buffer, &w)) != CRYPT_OK) {
|
||||
fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err));
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
for (x = 0; x < w; x++) {
|
||||
printf("%02x",hash_buffer[x]);
|
||||
}
|
||||
printf(" *-\n");
|
||||
}
|
||||
} else {
|
||||
for (z = argn; z < argc; z++) {
|
||||
for (y = 0; y < idx; ++y) {
|
||||
w = sizeof(hash_buffer);
|
||||
if ((err = hash_file(idxs[y],argv[z],hash_buffer,&w)) != CRYPT_OK) {
|
||||
fprintf(stderr, "%s: File hash error: %s\n", hashsum, error_to_string(err));
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
printf_hex(hash_buffer, w);
|
||||
printf(" *%s\n", argv[z]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,205 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/* encrypt V1.1 Fri Oct 18 04:28:03 NZDT 2002 */
|
||||
/* File de/encryption, using libtomcrypt */
|
||||
/* Written by Daniel Richards <kyhwana@world-net.co.nz> */
|
||||
/* Help from Tom St Denis with various bits */
|
||||
/* This code is public domain, no rights reserved. */
|
||||
/* Encrypts by default, -d flag enables decryption */
|
||||
/* ie: ./encrypt blowfish story.txt story.ct */
|
||||
/* ./encrypt -d blowfish story.ct story.pt */
|
||||
|
||||
#include <tomcrypt.h>
|
||||
|
||||
int usage(char *name)
|
||||
{
|
||||
int x;
|
||||
|
||||
printf("Usage encrypt: %s cipher infile outfile\n", name);
|
||||
printf("Usage decrypt: %s -d cipher infile outfile\n", name);
|
||||
printf("Usage test: %s -t cipher\nCiphers:\n", name);
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
printf("%s\n",cipher_descriptor[x].name);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned char plaintext[512],ciphertext[512];
|
||||
unsigned char tmpkey[512], key[MAXBLOCKSIZE], IV[MAXBLOCKSIZE];
|
||||
unsigned char inbuf[512]; /* i/o block size */
|
||||
unsigned long outlen, y, ivsize, x, decrypt;
|
||||
symmetric_CTR ctr;
|
||||
int cipher_idx, hash_idx, ks;
|
||||
char *infile, *outfile, *cipher;
|
||||
prng_state prng;
|
||||
FILE *fdin, *fdout;
|
||||
int err;
|
||||
|
||||
/* register algs, so they can be printed */
|
||||
register_all_ciphers();
|
||||
register_all_hashes();
|
||||
register_all_prngs();
|
||||
|
||||
if (argc < 4) {
|
||||
if ((argc > 2) && (!strcmp(argv[1], "-t"))) {
|
||||
cipher = argv[2];
|
||||
cipher_idx = find_cipher(cipher);
|
||||
if (cipher_idx == -1) {
|
||||
printf("Invalid cipher %s entered on command line.\n", cipher);
|
||||
exit(-1);
|
||||
} /* if */
|
||||
if (cipher_descriptor[cipher_idx].test)
|
||||
{
|
||||
if (cipher_descriptor[cipher_idx].test() != CRYPT_OK)
|
||||
{
|
||||
printf("Error when testing cipher %s.\n", cipher);
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Testing cipher %s succeeded.\n", cipher);
|
||||
exit(0);
|
||||
} /* if ... else */
|
||||
} /* if */
|
||||
}
|
||||
return usage(argv[0]);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "-d")) {
|
||||
decrypt = 1;
|
||||
cipher = argv[2];
|
||||
infile = argv[3];
|
||||
outfile = argv[4];
|
||||
} else {
|
||||
decrypt = 0;
|
||||
cipher = argv[1];
|
||||
infile = argv[2];
|
||||
outfile = argv[3];
|
||||
}
|
||||
|
||||
/* file handles setup */
|
||||
fdin = fopen(infile,"rb");
|
||||
if (fdin == NULL) {
|
||||
perror("Can't open input for reading");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fdout = fopen(outfile,"wb");
|
||||
if (fdout == NULL) {
|
||||
perror("Can't open output for writing");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
cipher_idx = find_cipher(cipher);
|
||||
if (cipher_idx == -1) {
|
||||
printf("Invalid cipher entered on command line.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
hash_idx = find_hash("sha256");
|
||||
if (hash_idx == -1) {
|
||||
printf("LTC_SHA256 not found...?\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
ivsize = cipher_descriptor[cipher_idx].block_length;
|
||||
ks = hash_descriptor[hash_idx].hashsize;
|
||||
if (cipher_descriptor[cipher_idx].keysize(&ks) != CRYPT_OK) {
|
||||
printf("Invalid keysize???\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
printf("\nEnter key: ");
|
||||
if(fgets((char *)tmpkey,sizeof(tmpkey), stdin) == NULL)
|
||||
exit(-1);
|
||||
outlen = sizeof(key);
|
||||
if ((err = hash_memory(hash_idx,tmpkey,strlen((char *)tmpkey),key,&outlen)) != CRYPT_OK) {
|
||||
printf("Error hashing key: %s\n", error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (decrypt) {
|
||||
/* Need to read in IV */
|
||||
if (fread(IV,1,ivsize,fdin) != ivsize) {
|
||||
printf("Error reading IV from input.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if ((err = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_start error: %s\n",error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* IV done */
|
||||
do {
|
||||
y = fread(inbuf,1,sizeof(inbuf),fdin);
|
||||
|
||||
if ((err = ctr_decrypt(inbuf,plaintext,y,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_decrypt error: %s\n", error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (fwrite(plaintext,1,y,fdout) != y) {
|
||||
printf("Error writing to file.\n");
|
||||
exit(-1);
|
||||
}
|
||||
} while (y == sizeof(inbuf));
|
||||
fclose(fdin);
|
||||
fclose(fdout);
|
||||
|
||||
} else { /* encrypt */
|
||||
/* Setup yarrow for random bytes for IV */
|
||||
|
||||
if ((err = rng_make_prng(128, find_prng("yarrow"), &prng, NULL)) != CRYPT_OK) {
|
||||
printf("Error setting up PRNG, %s\n", error_to_string(err));
|
||||
}
|
||||
|
||||
/* You can use rng_get_bytes on platforms that support it */
|
||||
/* x = rng_get_bytes(IV,ivsize,NULL);*/
|
||||
x = yarrow_read(IV,ivsize,&prng);
|
||||
if (x != ivsize) {
|
||||
printf("Error reading PRNG for IV required.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (fwrite(IV,1,ivsize,fdout) != ivsize) {
|
||||
printf("Error writing IV to output.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if ((err = ctr_start(cipher_idx,IV,key,ks,0,CTR_COUNTER_LITTLE_ENDIAN,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_start error: %s\n",error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
do {
|
||||
y = fread(inbuf,1,sizeof(inbuf),fdin);
|
||||
|
||||
if ((err = ctr_encrypt(inbuf,ciphertext,y,&ctr)) != CRYPT_OK) {
|
||||
printf("ctr_encrypt error: %s\n", error_to_string(err));
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (fwrite(ciphertext,1,y,fdout) != y) {
|
||||
printf("Error writing to output.\n");
|
||||
exit(-1);
|
||||
}
|
||||
} while (y == sizeof(inbuf));
|
||||
fclose(fdout);
|
||||
fclose(fdin);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,397 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Demo to do the rough equivalent of:
|
||||
*
|
||||
* openssl enc -aes-256-cbc -pass pass:foobar -in infile -out outfile -p
|
||||
*
|
||||
* Compilation:
|
||||
*
|
||||
* $(CC) -I /path/to/headers -L .../libs \
|
||||
* -o openssl-enc \
|
||||
* openssl-enc.c -ltomcrypt
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ./openssl-enc <enc|dec> infile outfile "passphrase" [salt]
|
||||
*
|
||||
* If provided, the salt must be EXACTLY a 16-char hex string.
|
||||
*
|
||||
* Demo is an example of:
|
||||
*
|
||||
* - (When decrypting) yanking salt out of the OpenSSL "Salted__..." header
|
||||
* - OpenSSL-compatible key derivation (in OpenSSL's modified PKCS#5v1 approach)
|
||||
* - Grabbing an Initialization Vector from the key generator
|
||||
* - Performing simple block encryption using AES
|
||||
* - PKCS#7-type padding (which hopefully can get ripped out of this demo and
|
||||
* made a libtomcrypt thing someday).
|
||||
*
|
||||
* This program is free for all purposes without any express guarantee it
|
||||
* works. If you really want to see a license here, assume the WTFPL :-)
|
||||
*
|
||||
* BJ Black, bblack@barracuda.com, https://wjblack.com
|
||||
*
|
||||
* BUGS:
|
||||
* Passing a password on a command line is a HORRIBLE idea. Don't use
|
||||
* this program for serious work!
|
||||
*/
|
||||
|
||||
#include <tomcrypt.h>
|
||||
|
||||
#ifndef LTC_RIJNDAEL
|
||||
#error Cannot compile this demo; Rijndael (AES) required
|
||||
#endif
|
||||
#ifndef LTC_CBC_MODE
|
||||
#error Cannot compile this demo; CBC mode required
|
||||
#endif
|
||||
#ifndef LTC_PKCS_5
|
||||
#error Cannot compile this demo; PKCS5 required
|
||||
#endif
|
||||
#ifndef LTC_RNG_GET_BYTES
|
||||
#error Cannot compile this demo; random generator required
|
||||
#endif
|
||||
#ifndef LTC_MD5
|
||||
#error Cannot compile this demo; MD5 required
|
||||
#endif
|
||||
|
||||
/* OpenSSL by default only runs one hash round */
|
||||
#define OPENSSL_ITERATIONS 1
|
||||
/* Use aes-256-cbc, so 256 bits of key, 128 of IV */
|
||||
#define KEY_LENGTH (256>>3)
|
||||
#define IV_LENGTH (128>>3)
|
||||
/* PKCS#5v1 requires exactly an 8-byte salt */
|
||||
#define SALT_LENGTH 8
|
||||
/* The header OpenSSL puts on an encrypted file */
|
||||
static char salt_header[] = { 'S', 'a', 'l', 't', 'e', 'd', '_', '_' };
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* A simple way to handle the possibility that a block may increase in size
|
||||
after padding. */
|
||||
union paddable {
|
||||
unsigned char unpad[1024];
|
||||
unsigned char pad[1024+MAXBLOCKSIZE];
|
||||
};
|
||||
|
||||
/*
|
||||
* Print usage and exit with a bad status (and perror() if any errno).
|
||||
*
|
||||
* Input: argv[0] and the error string
|
||||
* Output: <no return>
|
||||
* Side Effects: print messages and barf (does exit(3))
|
||||
*/
|
||||
void barf(const char *pname, const char *err)
|
||||
{
|
||||
printf("Usage: %s <enc|dec> infile outfile passphrase [salt]\n", pname);
|
||||
printf("\n");
|
||||
printf(" # encrypts infile->outfile, random salt\n");
|
||||
printf(" %s enc infile outfile \"passphrase\"\n", pname);
|
||||
printf("\n");
|
||||
printf(" # encrypts infile->outfile, salt from cmdline\n");
|
||||
printf(" %s enc infile outfile pass 0123456789abcdef\n", pname);
|
||||
printf("\n");
|
||||
printf(" # decrypts infile->outfile, pulls salt from infile\n");
|
||||
printf(" %s dec infile outfile pass\n", pname);
|
||||
printf("\n");
|
||||
printf(" # decrypts infile->outfile, salt specified\n");
|
||||
printf(" # (don't try to read the salt from infile)\n");
|
||||
printf(" %s dec infile outfile pass 0123456789abcdef"
|
||||
"\n", pname);
|
||||
printf("\n");
|
||||
printf("Application Error: %s\n", err);
|
||||
if(errno)
|
||||
perror(" System Error");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse a salt value passed in on the cmdline.
|
||||
*
|
||||
* Input: string passed in and a buf to put it in (exactly 8 bytes!)
|
||||
* Output: CRYPT_OK if parsed OK, CRYPT_ERROR if not
|
||||
* Side Effects: none
|
||||
*/
|
||||
int parse_hex_salt(unsigned char *in, unsigned char *out)
|
||||
{
|
||||
int idx;
|
||||
for(idx=0; idx<SALT_LENGTH; idx++)
|
||||
if(sscanf((char*)in+idx*2, "%02hhx", out+idx) != 1)
|
||||
return CRYPT_ERROR;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the Salted__[+8 bytes] from an OpenSSL-compatible file header.
|
||||
*
|
||||
* Input: file to read from and a to put the salt in (exactly 8 bytes!)
|
||||
* Output: CRYPT_OK if parsed OK, CRYPT_ERROR if not
|
||||
* Side Effects: infile's read pointer += 16
|
||||
*/
|
||||
int parse_openssl_header(FILE *in, unsigned char *out)
|
||||
{
|
||||
unsigned char tmp[SALT_LENGTH];
|
||||
if(fread(tmp, 1, sizeof(tmp), in) != sizeof(tmp))
|
||||
return CRYPT_ERROR;
|
||||
if(memcmp(tmp, salt_header, sizeof(tmp)))
|
||||
return CRYPT_ERROR;
|
||||
if(fread(tmp, 1, sizeof(tmp), in) != sizeof(tmp))
|
||||
return CRYPT_ERROR;
|
||||
memcpy(out, tmp, sizeof(tmp));
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dump a hexed stream of bytes (convenience func).
|
||||
*
|
||||
* Input: buf to read from, length
|
||||
* Output: none
|
||||
* Side Effects: bytes printed as a hex blob, no lf at the end
|
||||
*/
|
||||
void dump_bytes(unsigned char *in, unsigned long len)
|
||||
{
|
||||
unsigned long idx;
|
||||
for(idx=0; idx<len; idx++)
|
||||
printf("%02hhX", *(in+idx));
|
||||
}
|
||||
|
||||
/*
|
||||
* Pad or unpad a message using PKCS#7 padding.
|
||||
* Padding will add 1-(blocksize) bytes and unpadding will remove that amount.
|
||||
* Set is_padding to 1 to pad, 0 to unpad.
|
||||
*
|
||||
* Input: paddable buffer, size read, block length of cipher, mode
|
||||
* Output: number of bytes after padding resp. after unpadding
|
||||
* Side Effects: none
|
||||
*/
|
||||
size_t pkcs7_pad(union paddable *buf, size_t nb, int block_length,
|
||||
int is_padding)
|
||||
{
|
||||
unsigned char padval;
|
||||
off_t idx;
|
||||
|
||||
if(is_padding) {
|
||||
/* We are PADDING this block (and therefore adding bytes) */
|
||||
/* The pad value in PKCS#7 is the number of bytes remaining in
|
||||
the block, so for a 16-byte block and 3 bytes left, it's
|
||||
0x030303. In the oddball case where nb is an exact multiple
|
||||
multiple of block_length, set the padval to blocksize (i.e.
|
||||
add one full block) */
|
||||
padval = (unsigned char) (block_length - (nb % block_length));
|
||||
padval = padval ? padval : block_length;
|
||||
|
||||
memset(buf->pad+nb, padval, padval);
|
||||
return nb+padval;
|
||||
} else {
|
||||
/* We are UNPADDING this block (and removing bytes)
|
||||
We really just need to verify that the pad bytes are correct,
|
||||
so start at the end of the string and work backwards. */
|
||||
|
||||
/* Figure out what the padlength should be by looking at the
|
||||
last byte */
|
||||
idx = nb-1;
|
||||
padval = buf->pad[idx];
|
||||
|
||||
/* padval must be nonzero and <= block length */
|
||||
if(padval <= 0 || padval > block_length)
|
||||
return 0;
|
||||
|
||||
/* First byte's accounted for; do the rest */
|
||||
idx--;
|
||||
|
||||
while(idx >= (off_t)(nb-padval))
|
||||
if(buf->pad[idx] != padval)
|
||||
return 0;
|
||||
else
|
||||
idx--;
|
||||
|
||||
/* If we got here, the pad checked out, so return a smaller
|
||||
number of bytes than nb (basically where we left off+1) */
|
||||
return idx+1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform an encrypt/decrypt operation to/from files using AES+CBC+PKCS7 pad.
|
||||
* Set encrypt to 1 to encrypt, 0 to decrypt.
|
||||
*
|
||||
* Input: in/out files, key, iv, and mode
|
||||
* Output: CRYPT_OK if no error
|
||||
* Side Effects: bytes slurped from infile, pushed to outfile, fds updated.
|
||||
*/
|
||||
int do_crypt(FILE *infd, FILE *outfd, unsigned char *key, unsigned char *iv,
|
||||
int encrypt)
|
||||
{
|
||||
union paddable inbuf, outbuf;
|
||||
int cipher, ret;
|
||||
symmetric_CBC cbc;
|
||||
size_t nb;
|
||||
|
||||
/* Register your cipher! */
|
||||
cipher = register_cipher(&aes_desc);
|
||||
if(cipher == -1)
|
||||
return CRYPT_INVALID_CIPHER;
|
||||
|
||||
/* Start a CBC session with cipher/key/val params */
|
||||
ret = cbc_start(cipher, iv, key, KEY_LENGTH, 0, &cbc);
|
||||
if( ret != CRYPT_OK )
|
||||
return -1;
|
||||
|
||||
do {
|
||||
/* Get bytes from the source */
|
||||
nb = fread(inbuf.unpad, 1, sizeof(inbuf.unpad), infd);
|
||||
if(!nb)
|
||||
return encrypt ? CRYPT_OK : CRYPT_ERROR;
|
||||
|
||||
/* Barf if we got a read error */
|
||||
if(ferror(infd))
|
||||
return CRYPT_ERROR;
|
||||
|
||||
if(encrypt) {
|
||||
/* We're encrypting, so pad first (if at EOF) and then
|
||||
crypt */
|
||||
if(feof(infd))
|
||||
nb = pkcs7_pad(&inbuf, nb,
|
||||
aes_desc.block_length, 1);
|
||||
|
||||
ret = cbc_encrypt(inbuf.pad, outbuf.pad, nb, &cbc);
|
||||
if(ret != CRYPT_OK)
|
||||
return ret;
|
||||
|
||||
} else {
|
||||
/* We're decrypting, so decrypt and then unpad if at
|
||||
EOF */
|
||||
ret = cbc_decrypt(inbuf.unpad, outbuf.unpad, nb, &cbc);
|
||||
if( ret != CRYPT_OK )
|
||||
return ret;
|
||||
|
||||
if( feof(infd) )
|
||||
nb = pkcs7_pad(&outbuf, nb,
|
||||
aes_desc.block_length, 0);
|
||||
if(nb == 0)
|
||||
/* The file didn't decrypt correctly */
|
||||
return CRYPT_ERROR;
|
||||
|
||||
}
|
||||
|
||||
/* Push bytes to outfile */
|
||||
if(fwrite(outbuf.unpad, 1, nb, outfd) != nb)
|
||||
return CRYPT_ERROR;
|
||||
|
||||
} while(!feof(infd));
|
||||
|
||||
/* Close up */
|
||||
cbc_done(&cbc);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/* Convenience macro for the various barfable places below */
|
||||
#define BARF(a) { \
|
||||
if(infd) fclose(infd); \
|
||||
if(outfd) { fclose(outfd); remove(argv[3]); } \
|
||||
barf(argv[0], a); \
|
||||
}
|
||||
/*
|
||||
* The main routine. Mostly validate cmdline params, open files, run the KDF,
|
||||
* and do the crypt.
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
unsigned char salt[SALT_LENGTH];
|
||||
FILE *infd = NULL, *outfd = NULL;
|
||||
int encrypt = -1;
|
||||
int hash = -1;
|
||||
int ret;
|
||||
unsigned char keyiv[KEY_LENGTH + IV_LENGTH];
|
||||
unsigned long keyivlen = (KEY_LENGTH + IV_LENGTH);
|
||||
unsigned char *key, *iv;
|
||||
|
||||
/* Check proper number of cmdline args */
|
||||
if(argc < 5 || argc > 6)
|
||||
BARF("Invalid number of arguments");
|
||||
|
||||
/* Check proper mode of operation */
|
||||
if (!strncmp(argv[1], "enc", 3))
|
||||
encrypt = 1;
|
||||
else if(!strncmp(argv[1], "dec", 3))
|
||||
encrypt = 0;
|
||||
else
|
||||
BARF("Bad command name");
|
||||
|
||||
/* Check we can open infile/outfile */
|
||||
infd = fopen(argv[2], "rb");
|
||||
if(infd == NULL)
|
||||
BARF("Could not open infile");
|
||||
outfd = fopen(argv[3], "wb");
|
||||
if(outfd == NULL)
|
||||
BARF("Could not open outfile");
|
||||
|
||||
/* Get the salt from wherever */
|
||||
if(argc == 6) {
|
||||
/* User-provided */
|
||||
if(parse_hex_salt((unsigned char*) argv[5], salt) != CRYPT_OK)
|
||||
BARF("Bad user-specified salt");
|
||||
} else if(!strncmp(argv[1], "enc", 3)) {
|
||||
/* Encrypting; get from RNG */
|
||||
if(rng_get_bytes(salt, sizeof(salt), NULL) != sizeof(salt))
|
||||
BARF("Not enough random data");
|
||||
} else {
|
||||
/* Parse from infile (decrypt only) */
|
||||
if(parse_openssl_header(infd, salt) != CRYPT_OK)
|
||||
BARF("Invalid OpenSSL header in infile");
|
||||
}
|
||||
|
||||
/* Fetch the MD5 hasher for PKCS#5 */
|
||||
hash = register_hash(&md5_desc);
|
||||
if(hash == -1)
|
||||
BARF("Could not register MD5 hash");
|
||||
|
||||
/* Set things to a sane initial state */
|
||||
zeromem(keyiv, sizeof(keyiv));
|
||||
key = keyiv + 0; /* key comes first */
|
||||
iv = keyiv + KEY_LENGTH; /* iv comes next */
|
||||
|
||||
/* Run the key derivation from the provided passphrase. This gets us
|
||||
the key and iv. */
|
||||
ret = pkcs_5_alg1_openssl((unsigned char*)argv[4], strlen(argv[4]), salt,
|
||||
OPENSSL_ITERATIONS, hash, keyiv, &keyivlen );
|
||||
if(ret != CRYPT_OK)
|
||||
BARF("Could not derive key/iv from passphrase");
|
||||
|
||||
/* Display the salt/key/iv like OpenSSL cmdline does when -p */
|
||||
printf("salt="); dump_bytes(salt, sizeof(salt)); printf("\n");
|
||||
printf("key="); dump_bytes(key, KEY_LENGTH); printf("\n");
|
||||
printf("iv ="); dump_bytes(iv, IV_LENGTH ); printf("\n");
|
||||
|
||||
/* If we're encrypting, write the salt header as OpenSSL does */
|
||||
if(!strncmp(argv[1], "enc", 3)) {
|
||||
if(fwrite(salt_header, 1, sizeof(salt_header), outfd) !=
|
||||
sizeof(salt_header) )
|
||||
BARF("Error writing salt header to outfile");
|
||||
if(fwrite(salt, 1, sizeof(salt), outfd) != sizeof(salt))
|
||||
BARF("Error writing salt to outfile");
|
||||
}
|
||||
|
||||
/* At this point, the files are open, the salt has been figured out,
|
||||
and we're ready to pump data through crypt. */
|
||||
|
||||
/* Do the crypt operation */
|
||||
if(do_crypt(infd, outfd, key, iv, encrypt) != CRYPT_OK)
|
||||
BARF("Error during crypt operation");
|
||||
|
||||
/* Clean up */
|
||||
fclose(infd); fclose(outfd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,81 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#define basename(x) x
|
||||
#endif
|
||||
/**
|
||||
@file demo_crypt_sizes.c
|
||||
|
||||
Demo how to get various sizes to dynamic languages
|
||||
like Python - Larry Bugbee, February 2013
|
||||
*/
|
||||
|
||||
static void _print_line(const char* cmd, const char* desc)
|
||||
{
|
||||
printf(" %-16s - %s\n", cmd, desc);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc == 1) {
|
||||
/* given a specific size name, get and print its size */
|
||||
char name[] = "ltc_hash_descriptor";
|
||||
unsigned int size;
|
||||
char *sizes_list;
|
||||
unsigned int sizes_list_len;
|
||||
if (crypt_get_size(name, &size) != 0) exit(EXIT_FAILURE);
|
||||
printf("\n size of '%s' is %u \n\n", name, size);
|
||||
|
||||
/* get and print the length of the names (and sizes) list */
|
||||
if (crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" need to allocate %u bytes \n\n", sizes_list_len);
|
||||
|
||||
/* get and print the names (and sizes) list */
|
||||
if ((sizes_list = malloc(sizes_list_len)) == NULL) exit(EXIT_FAILURE);
|
||||
if (crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf(" supported sizes:\n\n%s\n\n", sizes_list);
|
||||
free(sizes_list);
|
||||
} else if (argc == 2) {
|
||||
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
|
||||
char* base = strdup(basename(argv[0]));
|
||||
printf("Usage: %s [-a] [-s name]\n\n", base);
|
||||
_print_line("<no argument>", "The old behavior of the demo");
|
||||
_print_line("-a", "Only lists all sizes");
|
||||
_print_line("-s name", "List a single size given as argument");
|
||||
_print_line("-h", "The help you're looking at");
|
||||
free(base);
|
||||
} else if (strcmp(argv[1], "-a") == 0) {
|
||||
char *sizes_list;
|
||||
unsigned int sizes_list_len;
|
||||
/* get and print the length of the names (and sizes) list */
|
||||
if (crypt_list_all_sizes(NULL, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
/* get and print the names (and sizes) list */
|
||||
if ((sizes_list = malloc(sizes_list_len)) == NULL) exit(EXIT_FAILURE);
|
||||
if (crypt_list_all_sizes(sizes_list, &sizes_list_len) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s\n", sizes_list);
|
||||
free(sizes_list);
|
||||
}
|
||||
} else if (argc == 3) {
|
||||
if (strcmp(argv[1], "-s") == 0) {
|
||||
unsigned int size;
|
||||
if (crypt_get_size(argv[2], &size) != 0) exit(EXIT_FAILURE);
|
||||
printf("%s,%u\n", argv[2], size);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,22 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
/* small demo app that just includes a cipher/hash/prng */
|
||||
#include <tomcrypt.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
register_cipher(&rijndael_enc_desc);
|
||||
register_prng(&yarrow_desc);
|
||||
register_hash(&sha256_desc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,802 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
#include <tomcrypt.h>
|
||||
|
||||
void hash_gen(void)
|
||||
{
|
||||
unsigned char md[MAXBLOCKSIZE], *buf;
|
||||
unsigned long outlen, x, y, z;
|
||||
FILE *out;
|
||||
int err;
|
||||
|
||||
out = fopen("hash_tv.txt", "w");
|
||||
if (out == NULL) {
|
||||
perror("can't open hash_tv");
|
||||
}
|
||||
|
||||
fprintf(out, "Hash Test Vectors:\n\nThese are the hashes of nn bytes '00 01 02 03 .. (nn-1)'\n\n");
|
||||
for (x = 0; hash_descriptor[x].name != NULL; x++) {
|
||||
buf = XMALLOC(2 * hash_descriptor[x].blocksize + 1);
|
||||
if (buf == NULL) {
|
||||
perror("can't alloc mem");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "Hash: %s\n", hash_descriptor[x].name);
|
||||
for (y = 0; y <= (hash_descriptor[x].blocksize * 2); y++) {
|
||||
for (z = 0; z < y; z++) {
|
||||
buf[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
outlen = sizeof(md);
|
||||
if ((err = hash_memory(x, buf, y, md, &outlen)) != CRYPT_OK) {
|
||||
printf("hash_memory error: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3lu: ", y);
|
||||
for (z = 0; z < outlen; z++) {
|
||||
fprintf(out, "%02X", md[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
XFREE(buf);
|
||||
}
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
void cipher_gen(void)
|
||||
{
|
||||
unsigned char *key, pt[MAXBLOCKSIZE];
|
||||
unsigned long x, y, z, w;
|
||||
int err, kl, lastkl;
|
||||
FILE *out;
|
||||
symmetric_key skey;
|
||||
|
||||
out = fopen("cipher_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
"Cipher Test Vectors\n\nThese are test encryptions with key of nn bytes '00 01 02 03 .. (nn-1)' and original PT of the same style.\n"
|
||||
"The output of step N is used as the key and plaintext for step N+1 (key bytes repeated as required to fill the key)\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
fprintf(out, "Cipher: %s\n", cipher_descriptor[x].name);
|
||||
|
||||
/* three modes, smallest, medium, large keys */
|
||||
lastkl = 10000;
|
||||
for (y = 0; y < 3; y++) {
|
||||
switch (y) {
|
||||
case 0: kl = cipher_descriptor[x].min_key_length; break;
|
||||
case 1: kl = (cipher_descriptor[x].min_key_length + cipher_descriptor[x].max_key_length)/2; break;
|
||||
case 2: kl = cipher_descriptor[x].max_key_length; break;
|
||||
}
|
||||
if ((err = cipher_descriptor[x].keysize(&kl)) != CRYPT_OK) {
|
||||
printf("keysize error: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (kl == lastkl) continue;
|
||||
lastkl = kl;
|
||||
fprintf(out, "Key Size: %d bytes\n", kl);
|
||||
|
||||
key = XMALLOC(kl);
|
||||
if (key == NULL) {
|
||||
perror("can't malloc memory");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (z = 0; (int)z < kl; z++) {
|
||||
key[z] = (unsigned char)z;
|
||||
}
|
||||
if ((err = cipher_descriptor[x].setup(key, kl, 0, &skey)) != CRYPT_OK) {
|
||||
printf("setup error: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (z = 0; (int)z < cipher_descriptor[x].block_length; z++) {
|
||||
pt[z] = (unsigned char)z;
|
||||
}
|
||||
for (w = 0; w < 50; w++) {
|
||||
cipher_descriptor[x].ecb_encrypt(pt, pt, &skey);
|
||||
fprintf(out, "%2lu: ", w);
|
||||
for (z = 0; (int)z < cipher_descriptor[x].block_length; z++) {
|
||||
fprintf(out, "%02X", pt[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* reschedule a new key */
|
||||
for (z = 0; z < (unsigned long)kl; z++) {
|
||||
key[z] = pt[z % cipher_descriptor[x].block_length];
|
||||
}
|
||||
if ((err = cipher_descriptor[x].setup(key, kl, 0, &skey)) != CRYPT_OK) {
|
||||
printf("cipher setup2 error: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
XFREE(key);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
void hmac_gen(void)
|
||||
{
|
||||
unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], *input;
|
||||
int x, y, z, err;
|
||||
FILE *out;
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("hmac_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
"HMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are HMACed. The initial key is\n"
|
||||
"of the same format (the same length as the HASH output size). The HMAC key in step N+1 is the HMAC output of\n"
|
||||
"step N.\n\n");
|
||||
|
||||
for (x = 0; hash_descriptor[x].name != NULL; x++) {
|
||||
fprintf(out, "HMAC-%s\n", hash_descriptor[x].name);
|
||||
|
||||
/* initial key */
|
||||
for (y = 0; y < (int)hash_descriptor[x].hashsize; y++) {
|
||||
key[y] = (y&255);
|
||||
}
|
||||
|
||||
input = XMALLOC(hash_descriptor[x].blocksize * 2 + 1);
|
||||
if (input == NULL) {
|
||||
perror("Can't malloc memory");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (y = 0; y <= (int)(hash_descriptor[x].blocksize * 2); y++) {
|
||||
for (z = 0; z < y; z++) {
|
||||
input[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = sizeof(output);
|
||||
if ((err = hmac_memory(x, key, hash_descriptor[x].hashsize, input, y, output, &len)) != CRYPT_OK) {
|
||||
printf("Error hmacing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y);
|
||||
for (z = 0; z <(int) len; z++) {
|
||||
fprintf(out, "%02X", output[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
memcpy(key, output, hash_descriptor[x].hashsize);
|
||||
}
|
||||
XFREE(input);
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
void omac_gen(void)
|
||||
{
|
||||
#ifdef LTC_OMAC
|
||||
unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2];
|
||||
int err, x, y, z, kl;
|
||||
FILE *out;
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("omac_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
"OMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are OMAC'ed. The initial key is\n"
|
||||
"of the same format (length specified per cipher). The OMAC key in step N+1 is the OMAC output of\n"
|
||||
"step N (repeated as required to fill the array).\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 64 or 128 bit block sizes */
|
||||
if (kl != 8 && kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "OMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* initial key/block */
|
||||
for (y = 0; y < kl; y++) {
|
||||
key[y] = (y & 255);
|
||||
}
|
||||
|
||||
for (y = 0; y <= (int)(cipher_descriptor[x].block_length*2); y++) {
|
||||
for (z = 0; z < y; z++) {
|
||||
input[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = sizeof(output);
|
||||
if ((err = omac_memory(x, key, kl, input, y, output, &len)) != CRYPT_OK) {
|
||||
printf("Error omacing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y);
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", output[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = output[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void pmac_gen(void)
|
||||
{
|
||||
#ifdef LTC_PMAC
|
||||
unsigned char key[MAXBLOCKSIZE], output[MAXBLOCKSIZE], input[MAXBLOCKSIZE*2+2];
|
||||
int err, x, y, z, kl;
|
||||
FILE *out;
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("pmac_tv.txt", "w");
|
||||
|
||||
fprintf(out,
|
||||
"PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are PMAC'ed. The initial key is\n"
|
||||
"of the same format (length specified per cipher). The PMAC key in step N+1 is the PMAC output of\n"
|
||||
"step N (repeated as required to fill the array).\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 64 or 128 bit block sizes */
|
||||
if (kl != 8 && kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "PMAC-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* initial key/block */
|
||||
for (y = 0; y < kl; y++) {
|
||||
key[y] = (y & 255);
|
||||
}
|
||||
|
||||
for (y = 0; y <= (int)(cipher_descriptor[x].block_length*2); y++) {
|
||||
for (z = 0; z < y; z++) {
|
||||
input[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = sizeof(output);
|
||||
if ((err = pmac_memory(x, key, kl, input, y, output, &len)) != CRYPT_OK) {
|
||||
printf("Error omacing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y);
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", output[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = output[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void eax_gen(void)
|
||||
{
|
||||
#ifdef LTC_EAX_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2], header[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("eax_tv.txt", "w");
|
||||
fprintf(out, "EAX Test Vectors. Uses the 00010203...NN-1 pattern for header/nonce/plaintext/key. The outputs\n"
|
||||
"are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous\n"
|
||||
"step repeated sufficiently.\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 64 or 128 bit block sizes */
|
||||
if (kl != 8 && kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "EAX-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
nonce[z] = (unsigned char)(z & 255);
|
||||
header[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = sizeof(tag);
|
||||
if ((err = eax_encrypt_authenticate_memory(x, key, kl, nonce, y1, header, y1, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) {
|
||||
printf("Error EAX'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
}
|
||||
fprintf(out, ", ");
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", tag[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = tag[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ocb_gen(void)
|
||||
{
|
||||
#ifdef LTC_OCB_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("ocb_tv.txt", "w");
|
||||
fprintf(out, "OCB Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. The outputs\n"
|
||||
"are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous\n"
|
||||
"step repeated sufficiently. The nonce is fixed throughout.\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 64 or 128 bit block sizes */
|
||||
if (kl != 8 && kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "OCB-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
/* fixed nonce */
|
||||
for (z = 0; z < cipher_descriptor[x].block_length; z++) {
|
||||
nonce[z] = z;
|
||||
}
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = sizeof(tag);
|
||||
if ((err = ocb_encrypt_authenticate_memory(x, key, kl, nonce, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) {
|
||||
printf("Error OCB'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
}
|
||||
fprintf(out, ", ");
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", tag[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = tag[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ocb3_gen(void)
|
||||
{
|
||||
#ifdef LTC_OCB3_MODE
|
||||
int err, kl, x, y1, z, noncelen;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("ocb3_tv.txt", "w");
|
||||
fprintf(out, "OCB3 Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. The outputs\n"
|
||||
"are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous\n"
|
||||
"step repeated sufficiently. The nonce is fixed throughout. AAD is fixed to 3 bytes (ASCII) 'AAD'.\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 64 or 128 bit block sizes */
|
||||
if (kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "OCB3-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
/* fixed nonce */
|
||||
noncelen = MIN(15, cipher_descriptor[x].block_length);
|
||||
for (z = 0; z < noncelen; z++) {
|
||||
nonce[z] = z;
|
||||
}
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = 16;
|
||||
if ((err = ocb3_encrypt_authenticate_memory(x, key, kl, nonce, noncelen, (unsigned char*)"AAD", 3, plaintext, y1, plaintext, tag, &len)) != CRYPT_OK) {
|
||||
printf("Error OCB3'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
}
|
||||
fprintf(out, ", ");
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", tag[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = tag[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ccm_gen(void)
|
||||
{
|
||||
#ifdef LTC_CCM_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], nonce[MAXBLOCKSIZE*2],
|
||||
plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("ccm_tv.txt", "w");
|
||||
fprintf(out, "CCM Test Vectors. Uses the 00010203...NN-1 pattern for nonce/header/plaintext/key. The outputs\n"
|
||||
"are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous\n"
|
||||
"step repeated sufficiently. The nonce is fixed throughout at 13 bytes 000102...\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 128 bit block sizes */
|
||||
if (kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "CCM-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
/* fixed nonce */
|
||||
for (z = 0; z < cipher_descriptor[x].block_length; z++) {
|
||||
nonce[z] = z;
|
||||
}
|
||||
|
||||
for (y1 = 0; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = sizeof(tag);
|
||||
if ((err = ccm_memory(x, key, kl, NULL, nonce, 13, plaintext, y1, plaintext, y1, plaintext, tag, &len, CCM_ENCRYPT)) != CRYPT_OK) {
|
||||
printf("Error CCM'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (len == 0) {
|
||||
printf("Error CCM'ing: zero length\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
}
|
||||
fprintf(out, ", ");
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", tag[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = tag[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void gcm_gen(void)
|
||||
{
|
||||
#ifdef LTC_GCM_MODE
|
||||
int err, kl, x, y1, z;
|
||||
FILE *out;
|
||||
unsigned char key[MAXBLOCKSIZE], plaintext[MAXBLOCKSIZE*2], tag[MAXBLOCKSIZE];
|
||||
unsigned long len;
|
||||
|
||||
out = fopen("gcm_tv.txt", "w");
|
||||
fprintf(out, "GCM Test Vectors. Uses the 00010203...NN-1 pattern for nonce/header/plaintext/key. The outputs\n"
|
||||
"are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous\n"
|
||||
"step repeated sufficiently. The nonce is fixed throughout at 13 bytes 000102...\n\n");
|
||||
|
||||
for (x = 0; cipher_descriptor[x].name != NULL; x++) {
|
||||
kl = cipher_descriptor[x].block_length;
|
||||
|
||||
/* skip ciphers which do not have 128 bit block sizes */
|
||||
if (kl != 16) continue;
|
||||
|
||||
if (cipher_descriptor[x].keysize(&kl) != CRYPT_OK) {
|
||||
kl = cipher_descriptor[x].max_key_length;
|
||||
}
|
||||
fprintf(out, "GCM-%s (%d byte key)\n", cipher_descriptor[x].name, kl);
|
||||
|
||||
/* the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = (z & 255);
|
||||
}
|
||||
|
||||
for (y1 = 1; y1 <= (int)(cipher_descriptor[x].block_length*2); y1++){
|
||||
for (z = 0; z < y1; z++) {
|
||||
plaintext[z] = (unsigned char)(z & 255);
|
||||
}
|
||||
len = sizeof(tag);
|
||||
if ((err = gcm_memory(x, key, kl, plaintext, y1, plaintext, y1, plaintext, y1, plaintext, tag, &len, GCM_ENCRYPT)) != CRYPT_OK) {
|
||||
printf("Error GCM'ing: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (len == 0) {
|
||||
printf("Error GCM'ing: zero length\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
fprintf(out, "%3d: ", y1);
|
||||
for (z = 0; z < y1; z++) {
|
||||
fprintf(out, "%02X", plaintext[z]);
|
||||
}
|
||||
fprintf(out, ", ");
|
||||
for (z = 0; z <(int)len; z++) {
|
||||
fprintf(out, "%02X", tag[z]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* forward the key */
|
||||
for (z = 0; z < kl; z++) {
|
||||
key[z] = tag[z % len];
|
||||
}
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
void base64_gen(void)
|
||||
{
|
||||
FILE *out;
|
||||
unsigned char dst[256], src[32], ch;
|
||||
unsigned long x, len;
|
||||
|
||||
out = fopen("base64_tv.txt", "w");
|
||||
fprintf(out, "Base64 vectors. These are the base64 encodings of the strings 00,01,02...NN-1\n\n");
|
||||
for (x = 0; x <= 32; x++) {
|
||||
for (ch = 0; ch < x; ch++) {
|
||||
src[ch] = ch;
|
||||
}
|
||||
len = sizeof(dst);
|
||||
base64_encode(src, x, dst, &len);
|
||||
fprintf(out, "%2lu: %s\n", x, dst);
|
||||
}
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
void math_gen(void)
|
||||
{
|
||||
}
|
||||
|
||||
void ecc_gen(void)
|
||||
{
|
||||
FILE *out;
|
||||
unsigned char str[512];
|
||||
void *k, *order, *modulus;
|
||||
ecc_point *G, *R;
|
||||
int x;
|
||||
|
||||
out = fopen("ecc_tv.txt", "w");
|
||||
fprintf(out, "ecc vectors. These are for kG for k=1,3,9,27,...,3**n until k > order of the curve outputs are <k,x,y> triplets\n\n");
|
||||
G = ltc_ecc_new_point();
|
||||
R = ltc_ecc_new_point();
|
||||
mp_init(&k);
|
||||
mp_init(&order);
|
||||
mp_init(&modulus);
|
||||
|
||||
for (x = 0; ltc_ecc_sets[x].size != 0; x++) {
|
||||
fprintf(out, "ECC-%d\n", ltc_ecc_sets[x].size*8);
|
||||
mp_set(k, 1);
|
||||
|
||||
mp_read_radix(order, (char *)ltc_ecc_sets[x].order, 16);
|
||||
mp_read_radix(modulus, (char *)ltc_ecc_sets[x].prime, 16);
|
||||
mp_read_radix(G->x, (char *)ltc_ecc_sets[x].Gx, 16);
|
||||
mp_read_radix(G->y, (char *)ltc_ecc_sets[x].Gy, 16);
|
||||
mp_set(G->z, 1);
|
||||
|
||||
while (mp_cmp(k, order) == LTC_MP_LT) {
|
||||
ltc_mp.ecc_ptmul(k, G, R, modulus, 1);
|
||||
mp_tohex(k, (char*)str); fprintf(out, "%s, ", (char*)str);
|
||||
mp_tohex(R->x, (char*)str); fprintf(out, "%s, ", (char*)str);
|
||||
mp_tohex(R->y, (char*)str); fprintf(out, "%s\n", (char*)str);
|
||||
mp_mul_d(k, 3, k);
|
||||
}
|
||||
}
|
||||
mp_clear_multi(k, order, modulus, NULL);
|
||||
ltc_ecc_del_point(G);
|
||||
ltc_ecc_del_point(R);
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
void lrw_gen(void)
|
||||
{
|
||||
#ifdef LTC_LRW_MODE
|
||||
FILE *out;
|
||||
unsigned char tweak[16], key[16], iv[16], buf[1024];
|
||||
int x, y, err;
|
||||
symmetric_LRW lrw;
|
||||
|
||||
/* initialize default key and tweak */
|
||||
for (x = 0; x < 16; x++) {
|
||||
tweak[x] = key[x] = iv[x] = x;
|
||||
}
|
||||
|
||||
out = fopen("lrw_tv.txt", "w");
|
||||
for (x = 16; x < (int)(sizeof(buf)); x += 16) {
|
||||
if ((err = lrw_start(find_cipher("aes"), iv, key, 16, tweak, 0, &lrw)) != CRYPT_OK) {
|
||||
fprintf(stderr, "Error starting LRW-AES: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* encrypt incremental */
|
||||
for (y = 0; y < x; y++) {
|
||||
buf[y] = y & 255;
|
||||
}
|
||||
|
||||
if ((err = lrw_encrypt(buf, buf, x, &lrw)) != CRYPT_OK) {
|
||||
fprintf(stderr, "Error encrypting with LRW-AES: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* display it */
|
||||
fprintf(out, "%d:", x);
|
||||
for (y = 0; y < x; y++) {
|
||||
fprintf(out, "%02x", buf[y]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
|
||||
/* reset IV */
|
||||
if ((err = lrw_setiv(iv, 16, &lrw)) != CRYPT_OK) {
|
||||
fprintf(stderr, "Error setting IV: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* copy new tweak, iv and key */
|
||||
for (y = 0; y < 16; y++) {
|
||||
key[y] = buf[y];
|
||||
iv[y] = buf[(y+16)%x];
|
||||
tweak[y] = buf[(y+32)%x];
|
||||
}
|
||||
|
||||
if ((err = lrw_decrypt(buf, buf, x, &lrw)) != CRYPT_OK) {
|
||||
fprintf(stderr, "Error decrypting with LRW-AES: %s\n", error_to_string(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* display it */
|
||||
fprintf(out, "%d:", x);
|
||||
for (y = 0; y < x; y++) {
|
||||
fprintf(out, "%02x", buf[y]);
|
||||
}
|
||||
fprintf(out, "\n");
|
||||
lrw_done(&lrw);
|
||||
}
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
register_all_ciphers();
|
||||
register_all_hashes();
|
||||
register_all_prngs();
|
||||
#ifdef USE_LTM
|
||||
ltc_mp = ltm_desc;
|
||||
#elif defined(USE_TFM)
|
||||
ltc_mp = tfm_desc;
|
||||
#elif defined(USE_GMP)
|
||||
ltc_mp = gmp_desc;
|
||||
#elif defined(EXT_MATH_LIB)
|
||||
extern ltc_math_descriptor EXT_MATH_LIB;
|
||||
ltc_mp = EXT_MATH_LIB;
|
||||
#else
|
||||
fprintf(stderr, "No MPI provider available\n");
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
printf("Generating hash vectors..."); fflush(stdout); hash_gen(); printf("done\n");
|
||||
printf("Generating cipher vectors..."); fflush(stdout); cipher_gen(); printf("done\n");
|
||||
printf("Generating HMAC vectors..."); fflush(stdout); hmac_gen(); printf("done\n");
|
||||
#ifdef LTC_OMAC
|
||||
printf("Generating OMAC vectors..."); fflush(stdout); omac_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_PMAC
|
||||
printf("Generating PMAC vectors..."); fflush(stdout); pmac_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_EAX_MODE
|
||||
printf("Generating EAX vectors..."); fflush(stdout); eax_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_OCB_MODE
|
||||
printf("Generating OCB vectors..."); fflush(stdout); ocb_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_OCB3_MODE
|
||||
printf("Generating OCB3 vectors..."); fflush(stdout); ocb3_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_CCM_MODE
|
||||
printf("Generating CCM vectors..."); fflush(stdout); ccm_gen(); printf("done\n");
|
||||
#endif
|
||||
#ifdef LTC_GCM_MODE
|
||||
printf("Generating GCM vectors..."); fflush(stdout); gcm_gen(); printf("done\n");
|
||||
#endif
|
||||
printf("Generating BASE64 vectors..."); fflush(stdout); base64_gen(); printf("done\n");
|
||||
printf("Generating MATH vectors..."); fflush(stdout); math_gen(); printf("done\n");
|
||||
printf("Generating ECC vectors..."); fflush(stdout); ecc_gen(); printf("done\n");
|
||||
#ifdef LTC_LRW_MODE
|
||||
printf("Generating LRW vectors..."); fflush(stdout); lrw_gen(); printf("done\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
@@ -1,63 +0,0 @@
|
||||
ifeq ($V,1)
|
||||
silent=
|
||||
silent_stdout=
|
||||
else
|
||||
silent=@
|
||||
silent_stdout= > /dev/null
|
||||
endif
|
||||
|
||||
#Files left over from making the crypt.pdf.
|
||||
LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out *.lof
|
||||
|
||||
#build the doxy files (requires Doxygen, tetex and patience)
|
||||
.PHONY: doxygen
|
||||
doxygen:
|
||||
doxygen $(silent_stdout)
|
||||
|
||||
patched_doxygen:
|
||||
(cat Doxyfile && echo "HAVE_DOT=no") | doxygen - $(silent_stdout)
|
||||
|
||||
doxy: patched_doxygen
|
||||
${MAKE} -C doxygen/latex $(silent_stdout) && mv -f doxygen/latex/refman.pdf .
|
||||
@echo The huge doxygen PDF should be available as doc/refman.pdf
|
||||
|
||||
#This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed
|
||||
#from the clean command! This is because most people would like to keep the
|
||||
#nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to
|
||||
#delete it if we are rebuilding it.
|
||||
docs crypt.pdf: crypt.tex
|
||||
rm -f crypt.pdf $(LEFTOVERS)
|
||||
cp crypt.tex crypt.bak
|
||||
touch -r crypt.tex crypt.bak
|
||||
(printf "%s" "\def\fixedpdfdate{"; date +'D:%Y%m%d%H%M%S%:z' -d @$$(stat --format=%Y crypt.tex) | sed "s/:\([0-9][0-9]\)$$/'\1'}/g") > crypt-deterministic.tex
|
||||
printf "%s\n" "\pdfinfo{" >> crypt-deterministic.tex
|
||||
printf "%s\n" " /CreationDate (\fixedpdfdate)" >> crypt-deterministic.tex
|
||||
printf "%s\n}\n" " /ModDate (\fixedpdfdate)" >> crypt-deterministic.tex
|
||||
cat crypt.tex >> crypt-deterministic.tex
|
||||
mv crypt-deterministic.tex crypt.tex
|
||||
touch -r crypt.bak crypt.tex
|
||||
echo "hello" > crypt.ind
|
||||
latex crypt $(silent_stdout)
|
||||
latex crypt $(silent_stdout)
|
||||
makeindex crypt.idx $(silent_stdout)
|
||||
perl ../helper.pl --fixupind crypt.ind
|
||||
pdflatex crypt $(silent_stdout)
|
||||
sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf
|
||||
mv crypt.bak crypt.tex
|
||||
rm -f $(LEFTOVERS)
|
||||
|
||||
docdvi: crypt.tex
|
||||
echo hello > crypt.ind
|
||||
latex crypt $(silent_stdout)
|
||||
latex crypt $(silent_stdout)
|
||||
makeindex crypt.idx
|
||||
perl ../helper.pl --fixupind crypt.ind
|
||||
latex crypt $(silent_stdout)
|
||||
latex crypt $(silent_stdout)
|
||||
|
||||
termdoc: docdvi
|
||||
dvi2tty crypt.dvi -w120
|
||||
|
||||
clean:
|
||||
rm -f $(LEFTOVERS)
|
||||
rm -rf doxygen/
|
||||
@@ -1,384 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Getopt::Long;
|
||||
use File::Find 'find';
|
||||
use File::Basename 'basename';
|
||||
use File::Glob 'bsd_glob';
|
||||
|
||||
sub read_file {
|
||||
my $f = shift;
|
||||
open my $fh, "<", $f or die "FATAL: read_rawfile() cannot open file '$f': $!";
|
||||
binmode $fh;
|
||||
return do { local $/; <$fh> };
|
||||
}
|
||||
|
||||
sub write_file {
|
||||
my ($f, $data) = @_;
|
||||
die "FATAL: write_file() no data" unless defined $data;
|
||||
open my $fh, ">", $f or die "FATAL: write_file() cannot open file '$f': $!";
|
||||
binmode $fh;
|
||||
print $fh $data or die "FATAL: write_file() cannot write to '$f': $!";
|
||||
close $fh or die "FATAL: write_file() cannot close '$f': $!";
|
||||
return;
|
||||
}
|
||||
|
||||
sub check_source {
|
||||
my @all_files = (bsd_glob("makefile*"), bsd_glob("*.sh"), bsd_glob("*.pl"));
|
||||
find({ wanted=>sub { push @all_files, $_ if -f $_ }, no_chdir=>1 }, qw/src tests demos/);
|
||||
|
||||
my $fails = 0;
|
||||
for my $file (sort @all_files) {
|
||||
next unless $file =~ /\.(c|h|pl|py|sh)$/ || basename($file) =~ /^makefile/i;
|
||||
my $troubles = {};
|
||||
my $lineno = 1;
|
||||
my $content = read_file($file);
|
||||
push @{$troubles->{crlf_line_end}}, '?' if $content =~ /\r/;
|
||||
for my $l (split /\n/, $content) {
|
||||
push @{$troubles->{merge_conflict}}, $lineno if $l =~ /^(<<<<<<<|=======|>>>>>>>)([^<=>]|$)/;
|
||||
push @{$troubles->{trailing_space}}, $lineno if $l =~ / $/;
|
||||
push @{$troubles->{tab}}, $lineno if $l =~ /\t/ && basename($file) !~ /^makefile/i;
|
||||
push @{$troubles->{non_ascii_char}}, $lineno if $l =~ /[^[:ascii:]]/;
|
||||
push @{$troubles->{cpp_comment}}, $lineno if $file =~ /\.(c|h)$/ && ($l =~ /\s\/\// || $l =~ /\/\/\s/);
|
||||
# in ./src we prefer using XMEMCPY, XMALLOC, XFREE ...
|
||||
push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcpy\s*\(/;
|
||||
push @{$troubles->{unwanted_malloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmalloc\s*\(/;
|
||||
push @{$troubles->{unwanted_realloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\brealloc\s*\(/;
|
||||
push @{$troubles->{unwanted_calloc}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bcalloc\s*\(/;
|
||||
push @{$troubles->{unwanted_free}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bfree\s*\(/;
|
||||
push @{$troubles->{unwanted_memset}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemset\s*\(/;
|
||||
push @{$troubles->{unwanted_memcpy}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcpy\s*\(/;
|
||||
push @{$troubles->{unwanted_memmove}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemmove\s*\(/;
|
||||
push @{$troubles->{unwanted_memcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bmemcmp\s*\(/;
|
||||
push @{$troubles->{unwanted_strcmp}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bstrcmp\s*\(/;
|
||||
push @{$troubles->{unwanted_clock}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bclock\s*\(/;
|
||||
push @{$troubles->{unwanted_qsort}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bqsort\s*\(/;
|
||||
push @{$troubles->{sizeof_no_brackets}}, $lineno if $file =~ /^src\/.*\.c$/ && $l =~ /\bsizeof\s*[^\(]/;
|
||||
if ($file =~ m|src/.*\.c$| &&
|
||||
$file !~ m|src/ciphers/.*\.c$| &&
|
||||
$file !~ m|src/hashes/.*\.c$| &&
|
||||
$file !~ m|src/math/.+_desc.c$| &&
|
||||
$file !~ m|src/stream/sober128/sober128_stream.c$| &&
|
||||
$l =~ /^static(\s+[a-zA-Z0-9_]+)+\s+([^_][a-zA-Z0-9_]+)\s*\(/) {
|
||||
push @{$troubles->{staticfunc_name}}, "$lineno($2)";
|
||||
}
|
||||
$lineno++;
|
||||
}
|
||||
for my $k (sort keys %$troubles) {
|
||||
warn "[$k] $file line:" . join(",", @{$troubles->{$k}}) . "\n";
|
||||
$fails++;
|
||||
}
|
||||
}
|
||||
|
||||
warn( $fails > 0 ? "check-source: FAIL $fails\n" : "check-source: PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_defines {
|
||||
my $fails = 0;
|
||||
my $cust_h = read_file("src/headers/tomcrypt_custom.h");
|
||||
my $cryp_c = read_file("src/misc/crypt/crypt.c");
|
||||
$cust_h =~ s|/\*.*?\*/||sg; # remove comments
|
||||
$cryp_c =~ s|/\*.*?\*/||sg; # remove comments
|
||||
my %def = map { $_ => 1 } map { my $x = $_; $x =~ s/^\s*#define\s+(LTC_\S+).*$/$1/; $x } grep { /^\s*#define\s+LTC_\S+/ } split /\n/, $cust_h;
|
||||
for my $d (sort keys %def) {
|
||||
next if $d =~ /^LTC_(DH\d+|ECC\d+|ECC_\S+|MPI|MUTEX_\S+\(x\)|NO_\S+)$/;
|
||||
warn "$d missing in src/misc/crypt/crypt.c\n" and $fails++ if $cryp_c !~ /\Q$d\E/;
|
||||
}
|
||||
warn( $fails > 0 ? "check-defines: FAIL $fails\n" : "check-defines: PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_descriptor {
|
||||
my $which = shift;
|
||||
my $what = shift;
|
||||
my @src;
|
||||
my @descriptors;
|
||||
find({ wanted => sub { push @src, $_ if $_ =~ /\.c$/ }, no_chdir=>1 }, "./src/${which}/");
|
||||
for my $f (@src) {
|
||||
my @n = map { my $x = $_; $x =~ s/^.*?ltc_${what}_descriptor\s+(\S+).*$/$1/; $x } grep { $_ =~ /ltc_${what}_descriptor/ } split /\n/, read_file($f);
|
||||
push @descriptors, @n if @n;
|
||||
}
|
||||
my $fails = 0;
|
||||
for my $d (@descriptors) {
|
||||
for my $f ("./src/misc/crypt/crypt_register_all_${which}.c") {
|
||||
my $txt = read_file($f);
|
||||
warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/;
|
||||
}
|
||||
}
|
||||
for my $d (@descriptors) {
|
||||
for my $f ("./tests/test.c") {
|
||||
my $txt = read_file($f);
|
||||
warn "$d missing in $f\n" and $fails++ if $txt !~ /\Q$d\E/;
|
||||
}
|
||||
}
|
||||
my $name = sprintf("%-17s", "check-${which}:");
|
||||
warn( $fails > 0 ? "${name}FAIL $fails\n" : "${name}PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_descriptors {
|
||||
my $fails = 0;
|
||||
$fails = $fails + check_descriptor("ciphers", "cipher");
|
||||
$fails = $fails + check_descriptor("hashes", "hash");
|
||||
$fails = $fails + check_descriptor("prngs", "prng");
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub check_comments {
|
||||
my $fails = 0;
|
||||
my $first_comment = <<'MARKER';
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
MARKER
|
||||
my $last_comment = <<'MARKER';
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
MARKER
|
||||
my @all_files;
|
||||
find({ wanted=> sub { push @all_files, $_ if $_ =~ /\.(c|h)$/ }, no_chdir=>1 }, 'demos', 'src', 'tests');
|
||||
for my $f (@all_files) {
|
||||
my $txt = read_file($f);
|
||||
if ($txt !~ /^\Q$first_comment\E/s) {
|
||||
warn "[first_comment] $f\n";
|
||||
$fails++;
|
||||
}
|
||||
if ($txt !~ /\Q$last_comment\E\s*$/s) {
|
||||
warn "[last_comment] $f\n";
|
||||
$fails++;
|
||||
}
|
||||
}
|
||||
warn( $fails > 0 ? "check-comments: FAIL $fails\n" : "check-comments: PASS\n" );
|
||||
return $fails;
|
||||
}
|
||||
|
||||
sub prepare_variable {
|
||||
my ($varname, @list) = @_;
|
||||
my $output = "$varname=";
|
||||
my $len = length($output);
|
||||
foreach my $obj (sort @list) {
|
||||
$len = $len + length $obj;
|
||||
$obj =~ s/\*/\$/;
|
||||
if ($len > 100) {
|
||||
$output .= "\\\n";
|
||||
$len = length $obj;
|
||||
}
|
||||
$output .= $obj . ' ';
|
||||
}
|
||||
$output =~ s/ $//;
|
||||
return $output;
|
||||
}
|
||||
|
||||
sub prepare_msvc_files_xml {
|
||||
my ($all, $exclude_re, $targets) = @_;
|
||||
my $last = [];
|
||||
my $depth = 2;
|
||||
|
||||
# sort files in the same order as visual studio (ugly, I know)
|
||||
my @parts = ();
|
||||
for my $orig (@$all) {
|
||||
my $p = $orig;
|
||||
$p =~ s|/|/~|g;
|
||||
$p =~ s|/~([^/]+)$|/$1|g;
|
||||
# now we have: 'src/pk/rsa/rsa_verify_hash.c' > 'src/~pk/~rsa/rsa_verify_hash.c'
|
||||
my @l = map { sprintf "% -99s", $_ } split /\//, $p;
|
||||
push @parts, [ $orig, join(':', @l) ];
|
||||
}
|
||||
my @sorted = map { $_->[0] } sort { $a->[1] cmp $b->[1] } @parts;
|
||||
|
||||
my $files = "<Files>\r\n";
|
||||
for my $full (@sorted) {
|
||||
my @items = split /\//, $full; # split by '/'
|
||||
$full =~ s|/|\\|g; # replace '/' bt '\'
|
||||
shift @items; # drop first one (src)
|
||||
pop @items; # drop last one (filename.ext)
|
||||
my $current = \@items;
|
||||
if (join(':', @$current) ne join(':', @$last)) {
|
||||
my $common = 0;
|
||||
$common++ while ($last->[$common] && $current->[$common] && $last->[$common] eq $current->[$common]);
|
||||
my $back = @$last - $common;
|
||||
if ($back > 0) {
|
||||
$files .= ("\t" x --$depth) . "</Filter>\r\n" for (1..$back);
|
||||
}
|
||||
my $fwd = [ @$current ]; splice(@$fwd, 0, $common);
|
||||
for my $i (0..scalar(@$fwd) - 1) {
|
||||
$files .= ("\t" x $depth) . "<Filter\r\n";
|
||||
$files .= ("\t" x $depth) . "\tName=\"$fwd->[$i]\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t>\r\n";
|
||||
$depth++;
|
||||
}
|
||||
$last = $current;
|
||||
}
|
||||
$files .= ("\t" x $depth) . "<File\r\n";
|
||||
$files .= ("\t" x $depth) . "\tRelativePath=\"$full\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t>\r\n";
|
||||
if ($full =~ $exclude_re) {
|
||||
for (@$targets) {
|
||||
$files .= ("\t" x $depth) . "\t<FileConfiguration\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\tName=\"$_\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\tExcludedFromBuild=\"true\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t>\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t<Tool\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t\tName=\"VCCLCompilerTool\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t\tAdditionalIncludeDirectories=\"\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t\tPreprocessorDefinitions=\"\"\r\n";
|
||||
$files .= ("\t" x $depth) . "\t\t/>\r\n";
|
||||
$files .= ("\t" x $depth) . "\t</FileConfiguration>\r\n";
|
||||
}
|
||||
}
|
||||
########### aes_enc "hack" disabled - discussion: https://github.com/libtom/libtomcrypt/pull/158
|
||||
# if ($full eq 'src\ciphers\aes\aes.c') { #hack
|
||||
# my %cmd = (
|
||||
# 'Debug|Win32' => [ 'Debug/aes.obj;Debug/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c $(InputPath)
cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Debug/libtomcrypt.pch" /YX /Fo"Debug/aes_enc.obj" /Fd"Debug/" /FD /GZ /c $(InputPath)
' ],
|
||||
# 'Release|Win32' => [ 'Release/aes.obj;Release/aes_enc.obj', 'cl /nologo /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/" /Fd"Release/" /FD /GZ /c $(InputPath)
cl /nologo /DENCRYPT_ONLY /MLd /W3 /Gm /GX /ZI /Od /I "src\headers" /I "..\libtommath" /D "_DEBUG" /D "LTM_DESC" /D "WIN32" /D "_MBCS" /D "_LIB" /D "LTC_SOURCE" /D "USE_LTM" /Fp"Release/libtomcrypt.pch" /YX /Fo"Release/aes_enc.obj" /Fd"Release/" /FD /GZ /c $(InputPath)
' ],
|
||||
# );
|
||||
# for (@$targets) {
|
||||
# next unless $cmd{$_};
|
||||
# $files .= ("\t" x $depth) . "\t<FileConfiguration\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\tName=\"$_\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t>\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t<Tool\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t\tName=\"VCCustomBuildTool\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t\tCommandLine=\"$cmd{$_}[1]\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t\tOutputs=\"$cmd{$_}[0]\"\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t\t/>\r\n";
|
||||
# $files .= ("\t" x $depth) . "\t</FileConfiguration>\r\n";
|
||||
# }
|
||||
# }
|
||||
$files .= ("\t" x $depth) . "</File>\r\n";
|
||||
}
|
||||
$files .= ("\t" x --$depth) . "</Filter>\r\n" for (@$last);
|
||||
$files .= "\t</Files>";
|
||||
return $files;
|
||||
}
|
||||
|
||||
sub patch_file {
|
||||
my ($content, @variables) = @_;
|
||||
for my $v (@variables) {
|
||||
if ($v =~ /^([A-Z0-9_]+)\s*=.*$/si) {
|
||||
my $name = $1;
|
||||
$content =~ s/\n\Q$name\E\b.*?[^\\]\n/\n$v\n/s;
|
||||
}
|
||||
else {
|
||||
die "patch_file failed: " . substr($v, 0, 30) . "..";
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
sub version_from_tomcrypt_h {
|
||||
my $h = read_file(shift);
|
||||
if ($h =~ /\n#define\s*SCRYPT\s*"([0-9]+)\.([0-9]+)\.([0-9]+)(.*)"/s) {
|
||||
return "VERSION_PC=$1.$2.$3", "VERSION_LT=1:1", "VERSION=$1.$2.$3$4", "PROJECT_NUMBER=$1.$2.$3$4";
|
||||
}
|
||||
else {
|
||||
die "#define SCRYPT not found in tomcrypt.h";
|
||||
}
|
||||
}
|
||||
|
||||
sub process_makefiles {
|
||||
my $write = shift;
|
||||
my $changed_count = 0;
|
||||
my @c = ();
|
||||
find({ no_chdir => 1, wanted => sub { push @c, $_ if -f $_ && $_ =~ /\.c$/ && $_ !~ /tab.c$/ } }, 'src');
|
||||
my @h = ();
|
||||
find({ no_chdir => 1, wanted => sub { push @h, $_ if -f $_ && $_ =~ /\.h$/ && $_ !~ /dh_static.h$/ } }, 'src');
|
||||
my @all = ();
|
||||
find({ no_chdir => 1, wanted => sub { push @all, $_ if -f $_ && $_ =~ /\.(c|h)$/ } }, 'src');
|
||||
my @t = qw();
|
||||
find({ no_chdir => 1, wanted => sub { push @t, $_ if $_ =~ /(common|no_prng|_tests?|test).c$/ } }, 'tests');
|
||||
|
||||
my @o = sort ('src/ciphers/aes/aes_enc.o', map { my $x = $_; $x =~ s/\.c$/.o/; $x } @c);
|
||||
my $var_o = prepare_variable("OBJECTS", @o);
|
||||
my $var_h = prepare_variable("HEADERS", (sort @h));
|
||||
(my $var_obj = $var_o) =~ s/\.o\b/.obj/sg;
|
||||
|
||||
my $var_to = prepare_variable("TOBJECTS", sort map { my $x = $_; $x =~ s/\.c$/.o/; $x } @t);
|
||||
(my $var_tobj = $var_to) =~ s/\.o\b/.obj/sg;
|
||||
|
||||
my @ver_version = version_from_tomcrypt_h("src/headers/tomcrypt.h");
|
||||
|
||||
# update MSVC project files
|
||||
my $msvc_files = prepare_msvc_files_xml(\@all, qr/tab\.c$/, ['Debug|Win32', 'Release|Win32', 'Debug|x64', 'Release|x64']);
|
||||
for my $m (qw/libtomcrypt_VS2008.vcproj/) {
|
||||
my $old = read_file($m);
|
||||
my $new = $old;
|
||||
$new =~ s|<Files>.*</Files>|$msvc_files|s;
|
||||
if ($old ne $new) {
|
||||
write_file($m, $new) if $write;
|
||||
warn "changed: $m\n";
|
||||
$changed_count++;
|
||||
}
|
||||
}
|
||||
|
||||
# update OBJECTS + HEADERS in makefile*
|
||||
for my $m (qw/ makefile makefile.shared makefile.unix makefile.mingw makefile.msvc makefile_include.mk doc\/Doxyfile /) {
|
||||
my $old = read_file($m);
|
||||
my $new = $m eq 'makefile.msvc' ? patch_file($old, $var_obj, $var_h, $var_tobj, @ver_version)
|
||||
: patch_file($old, $var_o, $var_h, $var_to, @ver_version);
|
||||
if ($old ne $new) {
|
||||
write_file($m, $new) if $write;
|
||||
warn "changed: $m\n";
|
||||
$changed_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($write) {
|
||||
return 0; # no failures
|
||||
}
|
||||
else {
|
||||
warn( $changed_count > 0 ? "check-makefiles: FAIL $changed_count\n" : "check-makefiles: PASS\n" );
|
||||
return $changed_count;
|
||||
}
|
||||
}
|
||||
|
||||
sub die_usage {
|
||||
die <<"MARKER";
|
||||
usage: $0 -s OR $0 --check-source
|
||||
$0 -c OR $0 --check-descriptors
|
||||
$0 -d OR $0 --check-defines
|
||||
$0 -o OR $0 --check-comments
|
||||
$0 -m OR $0 --check-makefiles
|
||||
$0 -a OR $0 --check-all
|
||||
$0 -u OR $0 --update-makefiles
|
||||
$0 --fixupind crypt.ind
|
||||
MARKER
|
||||
}
|
||||
|
||||
GetOptions( "s|check-source" => \my $check_source,
|
||||
"c|check-descriptors" => \my $check_descriptors,
|
||||
"d|check-defines" => \my $check_defines,
|
||||
"o|check-comments" => \my $check_comments,
|
||||
"m|check-makefiles" => \my $check_makefiles,
|
||||
"a|check-all" => \my $check_all,
|
||||
"u|update-makefiles" => \my $update_makefiles,
|
||||
"f|fixupind=s" => \my $fixupind,
|
||||
"h|help" => \my $help
|
||||
) or die_usage;
|
||||
|
||||
if ($fixupind) {
|
||||
my $txt = read_file($fixupind);
|
||||
$txt =~ s/^([^\n]*\n)/$1\n\\addcontentsline{toc}{chapter}{Index}\n/s;
|
||||
write_file($fixupind, $txt);
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $failure;
|
||||
$failure ||= check_source() if $check_all || $check_source;
|
||||
$failure ||= check_defines() if $check_all || $check_defines;
|
||||
$failure ||= check_descriptors() if $check_all || $check_descriptors;
|
||||
$failure ||= check_comments() if $check_all || $check_comments;
|
||||
$failure ||= process_makefiles(0) if $check_all || $check_makefiles;
|
||||
$failure ||= process_makefiles(1) if $update_makefiles;
|
||||
|
||||
die_usage unless defined $failure;
|
||||
exit $failure ? 1 : 0;
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# An example hook script to verify what is about to be committed.
|
||||
# Called by "git commit" with no arguments. The hook should
|
||||
# exit with non-zero status after issuing an appropriate message if
|
||||
# it wants to stop the commit.
|
||||
#
|
||||
# To enable this hook, rename this file to "pre-commit".
|
||||
|
||||
if git rev-parse --verify HEAD >/dev/null 2>&1
|
||||
then
|
||||
against=HEAD
|
||||
else
|
||||
# Initial commit: diff against an empty tree object
|
||||
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||
fi
|
||||
|
||||
# If you want to allow non-ascii filenames set this variable to true.
|
||||
allownonascii=$(git config hooks.allownonascii)
|
||||
|
||||
# Redirect output to stderr.
|
||||
exec 1>&2
|
||||
|
||||
# Cross platform projects tend to avoid non-ascii filenames; prevent
|
||||
# them from being added to the repository. We exploit the fact that the
|
||||
# printable range starts at the space character and ends with tilde.
|
||||
if [ "$allownonascii" != "true" ] &&
|
||||
# Note that the use of brackets around a tr range is ok here, (it's
|
||||
# even required, for portability to Solaris 10's /usr/bin/tr), since
|
||||
# the square bracket bytes happen to fall in the designated range.
|
||||
test $(git diff --cached --name-only --diff-filter=A -z $against |
|
||||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
||||
then
|
||||
echo "Error: Attempt to add a non-ascii file name."
|
||||
echo
|
||||
echo "This can cause problems if you want to work"
|
||||
echo "with people on other platforms."
|
||||
echo
|
||||
echo "To be portable it is advisable to rename the file ..."
|
||||
echo
|
||||
echo "If you know what you are doing you can disable this"
|
||||
echo "check using:"
|
||||
echo
|
||||
echo " git config hooks.allownonascii true"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec perl helper.pl --check-all
|
||||
@@ -1,10 +0,0 @@
|
||||
prefix=@to-be-replaced@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
|
||||
Name: LibTomCrypt
|
||||
Description: public domain open source cryptographic toolkit
|
||||
Version: @to-be-replaced@
|
||||
Libs: -L${libdir} -ltomcrypt
|
||||
Cflags: -I${includedir}
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtomcrypt", "libtomcrypt_VS2008.vcproj", "{E3802982-DCB6-4D85-A2BD-6B08F0657E79}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Debug|x64.Build.0 = Debug|x64
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|Win32.Build.0 = Release|Win32
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|x64.ActiveCfg = Release|x64
|
||||
{E3802982-DCB6-4D85-A2BD-6B08F0657E79}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,132 +0,0 @@
|
||||
# MAKEFILE for linux GCC
|
||||
#
|
||||
# Tom St Denis
|
||||
# Modified by Clay Culver
|
||||
#
|
||||
# (GNU make only)
|
||||
|
||||
ifeq ($V,1)
|
||||
silent=
|
||||
silent_stdout=
|
||||
else
|
||||
silent=@
|
||||
silent_stdout= > /dev/null
|
||||
endif
|
||||
|
||||
PLATFORM := $(shell uname | sed -e 's/_.*//')
|
||||
|
||||
# ranlib tools
|
||||
ifndef RANLIB
|
||||
RANLIB:=$(CROSS_COMPILE)ranlib
|
||||
endif
|
||||
INSTALL_CMD = install
|
||||
UNINSTALL_CMD = rm
|
||||
|
||||
#Output filenames for various targets.
|
||||
ifndef LIBNAME
|
||||
LIBNAME=libtomcrypt.a
|
||||
endif
|
||||
|
||||
|
||||
include makefile_include.mk
|
||||
|
||||
ifeq ($(COVERAGE),1)
|
||||
all_test: LIB_PRE = -Wl,--whole-archive
|
||||
all_test: LIB_POST = -Wl,--no-whole-archive
|
||||
LTC_CFLAGS += -fprofile-arcs -ftest-coverage
|
||||
EXTRALIBS += -lgcov
|
||||
endif
|
||||
|
||||
#AES comes in two flavours... enc+dec and enc
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
${silent} ${CC} ${LTC_CFLAGS} -DENCRYPT_ONLY -c $< -o $@
|
||||
|
||||
.c.o:
|
||||
ifneq ($V,1)
|
||||
@echo " * ${CC} $@"
|
||||
endif
|
||||
${silent} ${CC} ${LTC_CFLAGS} -c $< -o $@
|
||||
|
||||
$(LIBNAME): $(OBJECTS)
|
||||
ifneq ($V,1)
|
||||
@echo " * ${AR} $@"
|
||||
endif
|
||||
${silent} $(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
ifneq ($V,1)
|
||||
@echo " * ${RANLIB} $@"
|
||||
endif
|
||||
${silent} $(RANLIB) $@
|
||||
|
||||
test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS)
|
||||
ifneq ($V,1)
|
||||
@echo " * ${CC} $@"
|
||||
endif
|
||||
${silent} $(CC) $(LTC_LDFLAGS) $(TOBJECTS) $(LIB_PRE) $(LIBNAME) $(LIB_POST) $(EXTRALIBS) -o $(TEST)
|
||||
|
||||
# build the demos from a template
|
||||
define DEMO_template
|
||||
$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME)
|
||||
ifneq ($V,1)
|
||||
@echo " * $${CC} $$@"
|
||||
endif
|
||||
$${silent} $$(CC) $$< $$(LIB_PRE) $$(LIBNAME) $$(LIB_POST) $$(EXTRALIBS) -o $(1)
|
||||
endef
|
||||
|
||||
$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
|
||||
|
||||
|
||||
#This rule installs the library and the header files. This must be run
|
||||
#as root in order to have a high enough permission to write to the correct
|
||||
#directories and to set the owner and group to root.
|
||||
install: $(call print-help,install,Installs the library and headers) .common_install
|
||||
|
||||
install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins
|
||||
|
||||
uninstall: $(call print-help,uninstall,Uninstalls the library and headers) .common_uninstall
|
||||
|
||||
profile:
|
||||
LTC_CFLAGS="$(LTC_CFLAGS) -fprofile-generate" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
|
||||
./timing
|
||||
rm -f timing `find . -type f | grep [.][ao] | xargs`
|
||||
LTC_CFLAGS="$(LTC_CFLAGS) -fprofile-use" $(MAKE) timing EXTRALIBS="$(EXTRALIBS) -lgcov"
|
||||
|
||||
# target that pre-processes all coverage data
|
||||
lcov-single-create:
|
||||
lcov --capture --no-external --directory src -q --output-file coverage_std.info
|
||||
|
||||
# target that removes all coverage output
|
||||
cleancov-clean:
|
||||
rm -f `find . -type f -name "*.info" | xargs`
|
||||
rm -rf coverage/
|
||||
|
||||
# merges all coverage_*.info files into coverage.info
|
||||
coverage.info:
|
||||
lcov `find -name 'coverage_*.info' -exec echo -n " -a {}" \;` -o coverage.info
|
||||
|
||||
# generates html output from all coverage_*.info files
|
||||
lcov-html: coverage.info
|
||||
genhtml coverage.info --output-directory coverage -q
|
||||
|
||||
# combines all necessary steps to create the coverage from a single testrun with e.g.
|
||||
# CFLAGS="-DUSE_LTM -DLTM_DESC -I../libtommath" EXTRALIBS="../libtommath/libtommath.a" make coverage -j9
|
||||
lcov-single:
|
||||
$(MAKE) cleancov-clean
|
||||
$(MAKE) lcov-single-create
|
||||
$(MAKE) coverage.info
|
||||
|
||||
|
||||
#make the code coverage of the library
|
||||
coverage: LTC_CFLAGS += -fprofile-arcs -ftest-coverage
|
||||
coverage: EXTRALIBS += -lgcov
|
||||
coverage: LIB_PRE = -Wl,--whole-archive
|
||||
coverage: LIB_POST = -Wl,--no-whole-archive
|
||||
|
||||
coverage: $(call print-help,coverage,Create code-coverage of the library - but better use coverage.sh) test
|
||||
./test
|
||||
|
||||
# cleans everything - coverage output and standard 'clean'
|
||||
cleancov: cleancov-clean clean
|
||||
|
||||
# ref: HEAD -> master, tag: v1.18.2
|
||||
# git commit: 7e7eb695d581782f04b24dc444cbfde86af59853
|
||||
# commit time: 2018-07-01 22:49:01 +0200
|
||||
@@ -1,288 +0,0 @@
|
||||
# MAKEFILE for MS Windows (mingw + gcc + gmake)
|
||||
#
|
||||
# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh
|
||||
|
||||
### USAGE:
|
||||
# Open a command prompt with gcc + gmake in PATH and start:
|
||||
#
|
||||
# gmake -f makefile.mingw all
|
||||
# test.exe
|
||||
# gmake -f makefile.mingw PREFIX=c:\devel\libtom install
|
||||
#
|
||||
#Or:
|
||||
#
|
||||
# gmake -f makefile.mingw CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -Ic:/path/to/libtommath" EXTRALIBS="-Lc:/path/to/libtommath -ltommath" all
|
||||
#
|
||||
|
||||
#The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs
|
||||
PREFIX = c:\mingw
|
||||
CC = gcc
|
||||
AR = ar
|
||||
ARFLAGS = r
|
||||
RANLIB = ranlib
|
||||
STRIP = strip
|
||||
CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
|
||||
EXTRALIBS = -L../libtommath -ltommath
|
||||
|
||||
#Compilation flags
|
||||
LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS)
|
||||
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
|
||||
VERSION=1.18.2
|
||||
|
||||
#Libraries to be created
|
||||
LIBMAIN_S =libtomcrypt.a
|
||||
LIBMAIN_I =libtomcrypt.dll.a
|
||||
LIBMAIN_D =libtomcrypt.dll
|
||||
|
||||
#List of objects to compile (all goes to libtomcrypt.a)
|
||||
OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \
|
||||
src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \
|
||||
src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
|
||||
src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \
|
||||
src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \
|
||||
src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \
|
||||
src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
|
||||
src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
|
||||
src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \
|
||||
src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \
|
||||
src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \
|
||||
src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \
|
||||
src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \
|
||||
src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \
|
||||
src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \
|
||||
src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \
|
||||
src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \
|
||||
src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \
|
||||
src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \
|
||||
src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \
|
||||
src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \
|
||||
src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \
|
||||
src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \
|
||||
src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \
|
||||
src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \
|
||||
src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \
|
||||
src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \
|
||||
src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
|
||||
src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \
|
||||
src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \
|
||||
src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \
|
||||
src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \
|
||||
src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \
|
||||
src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \
|
||||
src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \
|
||||
src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \
|
||||
src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \
|
||||
src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \
|
||||
src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \
|
||||
src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \
|
||||
src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \
|
||||
src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
|
||||
src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \
|
||||
src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \
|
||||
src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \
|
||||
src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \
|
||||
src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
|
||||
src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
|
||||
src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \
|
||||
src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \
|
||||
src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
|
||||
src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
|
||||
src/pk/asn1/der/octet/der_length_octet_string.o \
|
||||
src/pk/asn1/der/printable_string/der_decode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_encode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \
|
||||
src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \
|
||||
src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \
|
||||
src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \
|
||||
src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \
|
||||
src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
|
||||
src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \
|
||||
src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \
|
||||
src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
|
||||
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \
|
||||
src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \
|
||||
src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \
|
||||
src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_x509.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_set.o src/pk/rsa/rsa_sign_hash.o \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \
|
||||
src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \
|
||||
src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \
|
||||
src/stream/rc4/rc4_stream.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128_stream.o \
|
||||
src/stream/sober128/sober128_test.o
|
||||
|
||||
#List of test objects to compile
|
||||
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \
|
||||
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
|
||||
tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \
|
||||
tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \
|
||||
tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o
|
||||
|
||||
#The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
#The default rule for make builds the libtomcrypt.a library (static)
|
||||
default: $(LIBMAIN_S)
|
||||
|
||||
#SPECIAL: AES comes in two flavours - enc+dec and enc-only
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#SPECIAL: these are the rules to make certain object files
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
|
||||
|
||||
.c.o:
|
||||
$(CC) $(LTC_CFLAGS) -c $< -o $@
|
||||
|
||||
#Create libtomcrypt.a
|
||||
$(LIBMAIN_S): $(OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
#Create DLL + import library libtomcrypt.dll.a
|
||||
$(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS)
|
||||
$(CC) -s -shared -o $(LIBMAIN_D) $^ -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBMAIN_I) $(LTC_LDFLAGS)
|
||||
$(STRIP) -S $(LIBMAIN_D)
|
||||
|
||||
#Demo tools/utilities
|
||||
hashsum.exe: demos/hashsum.o $(LIBMAIN_S)
|
||||
$(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
ltcrypt.exe: demos/ltcrypt.o $(LIBMAIN_S)
|
||||
$(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
small.exe: demos/small.o $(LIBMAIN_S)
|
||||
$(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
tv_gen.exe: demos/tv_gen.o $(LIBMAIN_S)
|
||||
$(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
sizes.exe: demos/sizes.o $(LIBMAIN_S)
|
||||
$(CC) demos/sizes.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
constants.exe: demos/constants.o $(LIBMAIN_S)
|
||||
$(CC) demos/constants.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
timing.exe: demos/timing.o $(LIBMAIN_S)
|
||||
$(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
|
||||
#Tests
|
||||
test.exe: $(TOBJECTS) $(LIBMAIN_S)
|
||||
$(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
@echo NOTICE: start the tests by launching test.exe
|
||||
|
||||
all: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D) hashsum.exe ltcrypt.exe small.exe tv_gen.exe sizes.exe constants.exe timing.exe test.exe
|
||||
|
||||
test: test.exe
|
||||
|
||||
clean:
|
||||
@-cmd /c del /Q *_tv.txt 2>nul
|
||||
@-cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul
|
||||
|
||||
#Install the library + headers
|
||||
install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D)
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib"
|
||||
cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include"
|
||||
copy /Y $(LIBMAIN_S) "$(PREFIX)\lib"
|
||||
copy /Y $(LIBMAIN_I) "$(PREFIX)\lib"
|
||||
copy /Y $(LIBMAIN_D) "$(PREFIX)\bin"
|
||||
copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include"
|
||||
|
||||
#Install useful tools
|
||||
install_bins: hashsum
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
copy /Y hashsum.exe "$(PREFIX)\bin"
|
||||
|
||||
#Install documentation
|
||||
install_docs: doc/crypt.pdf
|
||||
cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc"
|
||||
copy /Y doc\crypt.pdf "$(PREFIX)\doc"
|
||||
@@ -1,273 +0,0 @@
|
||||
# MAKEFILE for MS Windows (nmake + Windows SDK)
|
||||
#
|
||||
# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh
|
||||
|
||||
### USAGE:
|
||||
# Open a command prompt with WinSDK variables set and start:
|
||||
#
|
||||
# nmake -f makefile.msvc all
|
||||
# test.exe
|
||||
# nmake -f makefile.msvc PREFIX=c:\devel\libtom install
|
||||
#
|
||||
#Or:
|
||||
#
|
||||
# nmake -f makefile.msvc CFLAGS="/DUSE_LTM /DLTM_DESC /Ic:\path\to\libtommath" EXTRALIBS=c:\path\to\libtommath\tommath.lib all
|
||||
#
|
||||
|
||||
#The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs
|
||||
PREFIX = c:\devel
|
||||
CFLAGS = /Ox /DUSE_LTM /DLTM_DESC /I../libtommath
|
||||
EXTRALIBS = ../libtommath/tommath.lib
|
||||
|
||||
#Compilation flags
|
||||
LTC_CFLAGS = /nologo /Isrc/headers/ /Itests/ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /DLTC_SOURCE /W3 $(CFLAGS)
|
||||
LTC_LDFLAGS = advapi32.lib $(EXTRALIBS)
|
||||
VERSION=1.18.2
|
||||
|
||||
#Libraries to be created (this makefile builds only static libraries)
|
||||
LIBMAIN_S =tomcrypt.lib
|
||||
|
||||
#List of objects to compile (all goes to tomcrypt.lib)
|
||||
OBJECTS=src/ciphers/aes/aes.obj src/ciphers/aes/aes_enc.obj src/ciphers/anubis.obj src/ciphers/blowfish.obj \
|
||||
src/ciphers/camellia.obj src/ciphers/cast5.obj src/ciphers/des.obj src/ciphers/kasumi.obj src/ciphers/khazad.obj \
|
||||
src/ciphers/kseed.obj src/ciphers/multi2.obj src/ciphers/noekeon.obj src/ciphers/rc2.obj src/ciphers/rc5.obj \
|
||||
src/ciphers/rc6.obj src/ciphers/safer/safer.obj src/ciphers/safer/saferp.obj src/ciphers/skipjack.obj \
|
||||
src/ciphers/twofish/twofish.obj src/ciphers/xtea.obj src/encauth/ccm/ccm_add_aad.obj \
|
||||
src/encauth/ccm/ccm_add_nonce.obj src/encauth/ccm/ccm_done.obj src/encauth/ccm/ccm_init.obj \
|
||||
src/encauth/ccm/ccm_memory.obj src/encauth/ccm/ccm_process.obj src/encauth/ccm/ccm_reset.obj \
|
||||
src/encauth/ccm/ccm_test.obj src/encauth/chachapoly/chacha20poly1305_add_aad.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.obj src/encauth/chachapoly/chacha20poly1305_done.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.obj src/encauth/chachapoly/chacha20poly1305_init.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.obj src/encauth/chachapoly/chacha20poly1305_setiv.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.obj \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.obj src/encauth/eax/eax_addheader.obj \
|
||||
src/encauth/eax/eax_decrypt.obj src/encauth/eax/eax_decrypt_verify_memory.obj src/encauth/eax/eax_done.obj \
|
||||
src/encauth/eax/eax_encrypt.obj src/encauth/eax/eax_encrypt_authenticate_memory.obj \
|
||||
src/encauth/eax/eax_init.obj src/encauth/eax/eax_test.obj src/encauth/gcm/gcm_add_aad.obj \
|
||||
src/encauth/gcm/gcm_add_iv.obj src/encauth/gcm/gcm_done.obj src/encauth/gcm/gcm_gf_mult.obj \
|
||||
src/encauth/gcm/gcm_init.obj src/encauth/gcm/gcm_memory.obj src/encauth/gcm/gcm_mult_h.obj \
|
||||
src/encauth/gcm/gcm_process.obj src/encauth/gcm/gcm_reset.obj src/encauth/gcm/gcm_test.obj \
|
||||
src/encauth/ocb/ocb_decrypt.obj src/encauth/ocb/ocb_decrypt_verify_memory.obj \
|
||||
src/encauth/ocb/ocb_done_decrypt.obj src/encauth/ocb/ocb_done_encrypt.obj src/encauth/ocb/ocb_encrypt.obj \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.obj src/encauth/ocb/ocb_init.obj src/encauth/ocb/ocb_ntz.obj \
|
||||
src/encauth/ocb/ocb_shift_xor.obj src/encauth/ocb/ocb_test.obj src/encauth/ocb/s_ocb_done.obj \
|
||||
src/encauth/ocb3/ocb3_add_aad.obj src/encauth/ocb3/ocb3_decrypt.obj src/encauth/ocb3/ocb3_decrypt_last.obj \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.obj src/encauth/ocb3/ocb3_done.obj \
|
||||
src/encauth/ocb3/ocb3_encrypt.obj src/encauth/ocb3/ocb3_encrypt_authenticate_memory.obj \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.obj src/encauth/ocb3/ocb3_init.obj src/encauth/ocb3/ocb3_int_ntz.obj \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.obj src/encauth/ocb3/ocb3_test.obj src/hashes/blake2b.obj \
|
||||
src/hashes/blake2s.obj src/hashes/chc/chc.obj src/hashes/helper/hash_file.obj \
|
||||
src/hashes/helper/hash_filehandle.obj src/hashes/helper/hash_memory.obj \
|
||||
src/hashes/helper/hash_memory_multi.obj src/hashes/md2.obj src/hashes/md4.obj src/hashes/md5.obj \
|
||||
src/hashes/rmd128.obj src/hashes/rmd160.obj src/hashes/rmd256.obj src/hashes/rmd320.obj src/hashes/sha1.obj \
|
||||
src/hashes/sha2/sha224.obj src/hashes/sha2/sha256.obj src/hashes/sha2/sha384.obj src/hashes/sha2/sha512.obj \
|
||||
src/hashes/sha2/sha512_224.obj src/hashes/sha2/sha512_256.obj src/hashes/sha3.obj src/hashes/sha3_test.obj \
|
||||
src/hashes/tiger.obj src/hashes/whirl/whirl.obj src/mac/blake2/blake2bmac.obj \
|
||||
src/mac/blake2/blake2bmac_file.obj src/mac/blake2/blake2bmac_memory.obj \
|
||||
src/mac/blake2/blake2bmac_memory_multi.obj src/mac/blake2/blake2bmac_test.obj src/mac/blake2/blake2smac.obj \
|
||||
src/mac/blake2/blake2smac_file.obj src/mac/blake2/blake2smac_memory.obj \
|
||||
src/mac/blake2/blake2smac_memory_multi.obj src/mac/blake2/blake2smac_test.obj src/mac/f9/f9_done.obj \
|
||||
src/mac/f9/f9_file.obj src/mac/f9/f9_init.obj src/mac/f9/f9_memory.obj src/mac/f9/f9_memory_multi.obj \
|
||||
src/mac/f9/f9_process.obj src/mac/f9/f9_test.obj src/mac/hmac/hmac_done.obj src/mac/hmac/hmac_file.obj \
|
||||
src/mac/hmac/hmac_init.obj src/mac/hmac/hmac_memory.obj src/mac/hmac/hmac_memory_multi.obj \
|
||||
src/mac/hmac/hmac_process.obj src/mac/hmac/hmac_test.obj src/mac/omac/omac_done.obj src/mac/omac/omac_file.obj \
|
||||
src/mac/omac/omac_init.obj src/mac/omac/omac_memory.obj src/mac/omac/omac_memory_multi.obj \
|
||||
src/mac/omac/omac_process.obj src/mac/omac/omac_test.obj src/mac/pelican/pelican.obj \
|
||||
src/mac/pelican/pelican_memory.obj src/mac/pelican/pelican_test.obj src/mac/pmac/pmac_done.obj \
|
||||
src/mac/pmac/pmac_file.obj src/mac/pmac/pmac_init.obj src/mac/pmac/pmac_memory.obj \
|
||||
src/mac/pmac/pmac_memory_multi.obj src/mac/pmac/pmac_ntz.obj src/mac/pmac/pmac_process.obj \
|
||||
src/mac/pmac/pmac_shift_xor.obj src/mac/pmac/pmac_test.obj src/mac/poly1305/poly1305.obj \
|
||||
src/mac/poly1305/poly1305_file.obj src/mac/poly1305/poly1305_memory.obj \
|
||||
src/mac/poly1305/poly1305_memory_multi.obj src/mac/poly1305/poly1305_test.obj src/mac/xcbc/xcbc_done.obj \
|
||||
src/mac/xcbc/xcbc_file.obj src/mac/xcbc/xcbc_init.obj src/mac/xcbc/xcbc_memory.obj \
|
||||
src/mac/xcbc/xcbc_memory_multi.obj src/mac/xcbc/xcbc_process.obj src/mac/xcbc/xcbc_test.obj \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.obj src/math/gmp_desc.obj src/math/ltm_desc.obj src/math/multi.obj \
|
||||
src/math/radix_to_bin.obj src/math/rand_bn.obj src/math/rand_prime.obj src/math/tfm_desc.obj src/misc/adler32.obj \
|
||||
src/misc/base64/base64_decode.obj src/misc/base64/base64_encode.obj src/misc/burn_stack.obj \
|
||||
src/misc/compare_testvector.obj src/misc/crc32.obj src/misc/crypt/crypt.obj src/misc/crypt/crypt_argchk.obj \
|
||||
src/misc/crypt/crypt_cipher_descriptor.obj src/misc/crypt/crypt_cipher_is_valid.obj \
|
||||
src/misc/crypt/crypt_constants.obj src/misc/crypt/crypt_find_cipher.obj \
|
||||
src/misc/crypt/crypt_find_cipher_any.obj src/misc/crypt/crypt_find_cipher_id.obj \
|
||||
src/misc/crypt/crypt_find_hash.obj src/misc/crypt/crypt_find_hash_any.obj \
|
||||
src/misc/crypt/crypt_find_hash_id.obj src/misc/crypt/crypt_find_hash_oid.obj \
|
||||
src/misc/crypt/crypt_find_prng.obj src/misc/crypt/crypt_fsa.obj src/misc/crypt/crypt_hash_descriptor.obj \
|
||||
src/misc/crypt/crypt_hash_is_valid.obj src/misc/crypt/crypt_inits.obj \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.obj src/misc/crypt/crypt_prng_descriptor.obj \
|
||||
src/misc/crypt/crypt_prng_is_valid.obj src/misc/crypt/crypt_prng_rng_descriptor.obj \
|
||||
src/misc/crypt/crypt_register_all_ciphers.obj src/misc/crypt/crypt_register_all_hashes.obj \
|
||||
src/misc/crypt/crypt_register_all_prngs.obj src/misc/crypt/crypt_register_cipher.obj \
|
||||
src/misc/crypt/crypt_register_hash.obj src/misc/crypt/crypt_register_prng.obj src/misc/crypt/crypt_sizes.obj \
|
||||
src/misc/crypt/crypt_unregister_cipher.obj src/misc/crypt/crypt_unregister_hash.obj \
|
||||
src/misc/crypt/crypt_unregister_prng.obj src/misc/error_to_string.obj src/misc/hkdf/hkdf.obj \
|
||||
src/misc/hkdf/hkdf_test.obj src/misc/mem_neq.obj src/misc/pk_get_oid.obj src/misc/pkcs5/pkcs_5_1.obj \
|
||||
src/misc/pkcs5/pkcs_5_2.obj src/misc/pkcs5/pkcs_5_test.obj src/misc/zeromem.obj src/modes/cbc/cbc_decrypt.obj \
|
||||
src/modes/cbc/cbc_done.obj src/modes/cbc/cbc_encrypt.obj src/modes/cbc/cbc_getiv.obj \
|
||||
src/modes/cbc/cbc_setiv.obj src/modes/cbc/cbc_start.obj src/modes/cfb/cfb_decrypt.obj \
|
||||
src/modes/cfb/cfb_done.obj src/modes/cfb/cfb_encrypt.obj src/modes/cfb/cfb_getiv.obj \
|
||||
src/modes/cfb/cfb_setiv.obj src/modes/cfb/cfb_start.obj src/modes/ctr/ctr_decrypt.obj \
|
||||
src/modes/ctr/ctr_done.obj src/modes/ctr/ctr_encrypt.obj src/modes/ctr/ctr_getiv.obj \
|
||||
src/modes/ctr/ctr_setiv.obj src/modes/ctr/ctr_start.obj src/modes/ctr/ctr_test.obj \
|
||||
src/modes/ecb/ecb_decrypt.obj src/modes/ecb/ecb_done.obj src/modes/ecb/ecb_encrypt.obj \
|
||||
src/modes/ecb/ecb_start.obj src/modes/f8/f8_decrypt.obj src/modes/f8/f8_done.obj src/modes/f8/f8_encrypt.obj \
|
||||
src/modes/f8/f8_getiv.obj src/modes/f8/f8_setiv.obj src/modes/f8/f8_start.obj src/modes/f8/f8_test_mode.obj \
|
||||
src/modes/lrw/lrw_decrypt.obj src/modes/lrw/lrw_done.obj src/modes/lrw/lrw_encrypt.obj \
|
||||
src/modes/lrw/lrw_getiv.obj src/modes/lrw/lrw_process.obj src/modes/lrw/lrw_setiv.obj \
|
||||
src/modes/lrw/lrw_start.obj src/modes/lrw/lrw_test.obj src/modes/ofb/ofb_decrypt.obj src/modes/ofb/ofb_done.obj \
|
||||
src/modes/ofb/ofb_encrypt.obj src/modes/ofb/ofb_getiv.obj src/modes/ofb/ofb_setiv.obj \
|
||||
src/modes/ofb/ofb_start.obj src/modes/xts/xts_decrypt.obj src/modes/xts/xts_done.obj \
|
||||
src/modes/xts/xts_encrypt.obj src/modes/xts/xts_init.obj src/modes/xts/xts_mult_x.obj \
|
||||
src/modes/xts/xts_test.obj src/pk/asn1/der/bit/der_decode_bit_string.obj \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.obj src/pk/asn1/der/bit/der_encode_bit_string.obj \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.obj src/pk/asn1/der/bit/der_length_bit_string.obj \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.obj src/pk/asn1/der/boolean/der_encode_boolean.obj \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.obj src/pk/asn1/der/choice/der_decode_choice.obj \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.obj \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.obj \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.obj \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.obj src/pk/asn1/der/ia5/der_encode_ia5_string.obj \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.obj src/pk/asn1/der/integer/der_decode_integer.obj \
|
||||
src/pk/asn1/der/integer/der_encode_integer.obj src/pk/asn1/der/integer/der_length_integer.obj \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.obj \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.obj \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.obj \
|
||||
src/pk/asn1/der/octet/der_decode_octet_string.obj src/pk/asn1/der/octet/der_encode_octet_string.obj \
|
||||
src/pk/asn1/der/octet/der_length_octet_string.obj \
|
||||
src/pk/asn1/der/printable_string/der_decode_printable_string.obj \
|
||||
src/pk/asn1/der/printable_string/der_encode_printable_string.obj \
|
||||
src/pk/asn1/der/printable_string/der_length_printable_string.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.obj \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.obj \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.obj \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.obj \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.obj \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.obj src/pk/asn1/der/sequence/der_sequence_free.obj \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.obj src/pk/asn1/der/set/der_encode_set.obj \
|
||||
src/pk/asn1/der/set/der_encode_setof.obj src/pk/asn1/der/short_integer/der_decode_short_integer.obj \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.obj \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.obj \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.obj \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.obj \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.obj src/pk/asn1/der/utctime/der_encode_utctime.obj \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.obj src/pk/asn1/der/utf8/der_decode_utf8_string.obj \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.obj src/pk/asn1/der/utf8/der_length_utf8_string.obj \
|
||||
src/pk/dh/dh.obj src/pk/dh/dh_check_pubkey.obj src/pk/dh/dh_export.obj src/pk/dh/dh_export_key.obj \
|
||||
src/pk/dh/dh_free.obj src/pk/dh/dh_generate_key.obj src/pk/dh/dh_import.obj src/pk/dh/dh_set.obj \
|
||||
src/pk/dh/dh_set_pg_dhparam.obj src/pk/dh/dh_shared_secret.obj src/pk/dsa/dsa_decrypt_key.obj \
|
||||
src/pk/dsa/dsa_encrypt_key.obj src/pk/dsa/dsa_export.obj src/pk/dsa/dsa_free.obj \
|
||||
src/pk/dsa/dsa_generate_key.obj src/pk/dsa/dsa_generate_pqg.obj src/pk/dsa/dsa_import.obj \
|
||||
src/pk/dsa/dsa_make_key.obj src/pk/dsa/dsa_set.obj src/pk/dsa/dsa_set_pqg_dsaparam.obj \
|
||||
src/pk/dsa/dsa_shared_secret.obj src/pk/dsa/dsa_sign_hash.obj src/pk/dsa/dsa_verify_hash.obj \
|
||||
src/pk/dsa/dsa_verify_key.obj src/pk/ecc/ecc.obj src/pk/ecc/ecc_ansi_x963_export.obj \
|
||||
src/pk/ecc/ecc_ansi_x963_import.obj src/pk/ecc/ecc_decrypt_key.obj src/pk/ecc/ecc_encrypt_key.obj \
|
||||
src/pk/ecc/ecc_export.obj src/pk/ecc/ecc_free.obj src/pk/ecc/ecc_get_size.obj src/pk/ecc/ecc_import.obj \
|
||||
src/pk/ecc/ecc_make_key.obj src/pk/ecc/ecc_shared_secret.obj src/pk/ecc/ecc_sign_hash.obj \
|
||||
src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_test.obj src/pk/ecc/ecc_verify_hash.obj \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.obj src/pk/ecc/ltc_ecc_map.obj src/pk/ecc/ltc_ecc_mul2add.obj \
|
||||
src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj src/pk/ecc/ltc_ecc_points.obj \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.obj src/pk/ecc/ltc_ecc_projective_dbl_point.obj \
|
||||
src/pk/katja/katja_decrypt_key.obj src/pk/katja/katja_encrypt_key.obj src/pk/katja/katja_export.obj \
|
||||
src/pk/katja/katja_exptmod.obj src/pk/katja/katja_free.obj src/pk/katja/katja_import.obj \
|
||||
src/pk/katja/katja_make_key.obj src/pk/pkcs1/pkcs_1_i2osp.obj src/pk/pkcs1/pkcs_1_mgf1.obj \
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.obj src/pk/pkcs1/pkcs_1_oaep_encode.obj src/pk/pkcs1/pkcs_1_os2ip.obj \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.obj src/pk/pkcs1/pkcs_1_pss_encode.obj src/pk/pkcs1/pkcs_1_v1_5_decode.obj \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.obj src/pk/rsa/rsa_decrypt_key.obj src/pk/rsa/rsa_encrypt_key.obj \
|
||||
src/pk/rsa/rsa_export.obj src/pk/rsa/rsa_exptmod.obj src/pk/rsa/rsa_free.obj src/pk/rsa/rsa_get_size.obj \
|
||||
src/pk/rsa/rsa_import.obj src/pk/rsa/rsa_import_pkcs8.obj src/pk/rsa/rsa_import_x509.obj \
|
||||
src/pk/rsa/rsa_make_key.obj src/pk/rsa/rsa_set.obj src/pk/rsa/rsa_sign_hash.obj \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.obj src/pk/rsa/rsa_verify_hash.obj src/prngs/chacha20.obj src/prngs/fortuna.obj \
|
||||
src/prngs/rc4.obj src/prngs/rng_get_bytes.obj src/prngs/rng_make_prng.obj src/prngs/sober128.obj \
|
||||
src/prngs/sprng.obj src/prngs/yarrow.obj src/stream/chacha/chacha_crypt.obj src/stream/chacha/chacha_done.obj \
|
||||
src/stream/chacha/chacha_ivctr32.obj src/stream/chacha/chacha_ivctr64.obj \
|
||||
src/stream/chacha/chacha_keystream.obj src/stream/chacha/chacha_setup.obj src/stream/chacha/chacha_test.obj \
|
||||
src/stream/rc4/rc4_stream.obj src/stream/rc4/rc4_test.obj src/stream/sober128/sober128_stream.obj \
|
||||
src/stream/sober128/sober128_test.obj
|
||||
|
||||
#List of test objects to compile
|
||||
TOBJECTS=tests/base64_test.obj tests/cipher_hash_test.obj tests/common.obj tests/der_test.obj tests/dh_test.obj \
|
||||
tests/dsa_test.obj tests/ecc_test.obj tests/file_test.obj tests/katja_test.obj tests/mac_test.obj tests/misc_test.obj \
|
||||
tests/modes_test.obj tests/mpi_test.obj tests/multi_test.obj tests/no_prng.obj tests/pkcs_1_eme_test.obj \
|
||||
tests/pkcs_1_emsa_test.obj tests/pkcs_1_oaep_test.obj tests/pkcs_1_pss_test.obj tests/pkcs_1_test.obj \
|
||||
tests/prng_test.obj tests/rotate_test.obj tests/rsa_test.obj tests/store_test.obj tests/test.obj
|
||||
|
||||
#The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
#The default rule for make builds the tomcrypt.lib library (static)
|
||||
default: $(LIBMAIN_S)
|
||||
|
||||
#SPECIAL: AES comes in two flavours - enc+dec and enc-only
|
||||
src/ciphers/aes/aes_enc.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(LTC_CFLAGS) /DENCRYPT_ONLY /c src/ciphers/aes/aes.c /Fosrc/ciphers/aes/aes_enc.obj
|
||||
|
||||
#SPECIAL: these are the rules to make certain object files
|
||||
src/ciphers/aes/aes.obj: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.obj: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.obj: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.obj: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.obj: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
|
||||
|
||||
.c.obj:
|
||||
$(CC) $(LTC_CFLAGS) /c $< /Fo$@
|
||||
|
||||
#Create tomcrypt.lib
|
||||
$(LIBMAIN_S): $(OBJECTS)
|
||||
lib /out:$(LIBMAIN_S) $(OBJECTS)
|
||||
|
||||
#Demo tools/utilities
|
||||
hashsum.exe: demos/hashsum.c tests/common.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/hashsum.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
ltcrypt.exe: demos/ltcrypt.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/ltcrypt.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
small.exe: demos/small.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/small.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
tv_gen.exe: demos/tv_gen.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/tv_gen.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
sizes.exe: demos/sizes.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/sizes.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
constants.exe: demos/constants.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/constants.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
timing.exe: demos/timing.c $(LIBMAIN_S)
|
||||
cl $(LTC_CFLAGS) demos/timing.c tests/common.c $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
|
||||
#Tests
|
||||
test.exe: $(LIBMAIN_S) $(TOBJECTS)
|
||||
cl $(LTC_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) /Fe$@
|
||||
@echo NOTICE: start the tests by launching test.exe
|
||||
|
||||
all: $(LIBMAIN_S) hashsum.exe ltcrypt.exe small.exe tv_gen.exe sizes.exe constants.exe timing.exe test.exe
|
||||
|
||||
test: test.exe
|
||||
|
||||
clean:
|
||||
@-cmd /c del /Q *_tv.txt 2>nul
|
||||
@-cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul
|
||||
|
||||
#Install the library + headers
|
||||
install: $(LIBMAIN_S)
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib"
|
||||
cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include"
|
||||
copy /Y $(LIBMAIN_S) "$(PREFIX)\lib"
|
||||
copy /Y src\headers\tomcrypt*.h "$(PREFIX)\include"
|
||||
|
||||
#Install useful tools
|
||||
install_bins: hashsum
|
||||
cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
|
||||
copy /Y hashsum.exe "$(PREFIX)\bin"
|
||||
|
||||
#Install documentation
|
||||
install_docs: doc/crypt.pdf
|
||||
cmd /c if not exist "$(PREFIX)\doc" mkdir "$(PREFIX)\doc"
|
||||
copy /Y doc\crypt.pdf "$(PREFIX)\doc"
|
||||
@@ -1,77 +0,0 @@
|
||||
# MAKEFILE for linux GCC
|
||||
#
|
||||
# This makefile produces a shared object and requires libtool to be installed.
|
||||
#
|
||||
# Thanks to Zed Shaw for helping debug this on BSD/OSX.
|
||||
# Tom St Denis
|
||||
#
|
||||
# (GNU make only)
|
||||
|
||||
### USAGE:
|
||||
#
|
||||
# CFLAGS="-DUSE_LTM -DLTM_DESC -I/path/to/libtommath" make -f makefile.shared all EXTRALIBS=/path/to/libtommath/libtommath.a
|
||||
# ./test
|
||||
# make -f makefile.shared PREFIX=/opt/libtom install
|
||||
#
|
||||
|
||||
PLATFORM := $(shell uname | sed -e 's/_.*//')
|
||||
|
||||
ifndef LIBTOOL
|
||||
ifeq ($(PLATFORM), Darwin)
|
||||
LIBTOOL:=glibtool
|
||||
else
|
||||
LIBTOOL:=libtool
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM), CYGWIN)
|
||||
NO_UNDEFINED:=-no-undefined
|
||||
endif
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC)
|
||||
INSTALL_CMD = $(LIBTOOL) --mode=install install
|
||||
UNINSTALL_CMD = $(LIBTOOL) --mode=uninstall rm
|
||||
|
||||
#Output filenames for various targets.
|
||||
ifndef LIBNAME
|
||||
LIBNAME=libtomcrypt.la
|
||||
endif
|
||||
|
||||
|
||||
include makefile_include.mk
|
||||
|
||||
|
||||
#ciphers come in two flavours... enc+dec and enc
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(LTCOMPILE) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
.c.o:
|
||||
$(LTCOMPILE) $(LTC_CFLAGS) $(CPPFLAGS) $(LTC_LDFLAGS) -o $@ -c $<
|
||||
|
||||
LOBJECTS = $(OBJECTS:.o=.lo)
|
||||
|
||||
$(LIBNAME): $(OBJECTS)
|
||||
$(LIBTOOL) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(NO_UNDEFINED)
|
||||
|
||||
test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS)
|
||||
$(LIBTOOL) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
|
||||
|
||||
# build the demos from a template
|
||||
define DEMO_template
|
||||
$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME)
|
||||
$$(LIBTOOL) --mode=link --tag=CC $$(CC) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1)
|
||||
endef
|
||||
|
||||
$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
|
||||
|
||||
install: $(call print-help,install,Installs the library + headers + pkg-config file) .common_install
|
||||
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtomcrypt.pc.in > libtomcrypt.pc
|
||||
install -p -d $(DESTDIR)$(LIBPATH)/pkgconfig
|
||||
install -p -m 644 libtomcrypt.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
|
||||
|
||||
install_bins: $(call print-help,install_bins,Installs the useful demos ($(USEFUL_DEMOS))) .common_install_bins
|
||||
|
||||
uninstall: $(call print-help,uninstall,Uninstalls the library + headers + pkg-config file) .common_uninstall
|
||||
rm $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
|
||||
|
||||
# ref: HEAD -> master, tag: v1.18.2
|
||||
# git commit: 7e7eb695d581782f04b24dc444cbfde86af59853
|
||||
# commit time: 2018-07-01 22:49:01 +0200
|
||||
@@ -1,294 +0,0 @@
|
||||
# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...)
|
||||
# works on: Linux, *BSD, Cygwin, AIX, HP-UX and hopefully other UNIX systems
|
||||
#
|
||||
# Please do not use here neither any special make syntax nor any unusual tools/utilities!
|
||||
#
|
||||
# BEWARE: variables OBJECTS, TOBJECTS, HEADERS, VERSION are updated via ./updatemakes.sh
|
||||
|
||||
### USAGE:
|
||||
#
|
||||
# make -f makefile.unix all
|
||||
# ./test
|
||||
# make -f makefile.unix install
|
||||
#
|
||||
#Or:
|
||||
#
|
||||
# make -f makefile.unix CFLAGS="-O3 -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all
|
||||
# ./test
|
||||
# make -f makefile.unix PREFIX=/opt/libtom install
|
||||
#
|
||||
#Or if you are using Intel C compiler you might need something like:
|
||||
#
|
||||
# make -f makefile.unix CC=icc AR=xiar CFLAGS="-fast -DUSE_LTM -DLTM_DESC -I/path/to/libtommath" EXTRALIBS=/path/to/libtommath/libtommath.a all
|
||||
#
|
||||
|
||||
#The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs"
|
||||
DESTDIR =
|
||||
PREFIX = /usr/local
|
||||
LIBPATH = $(PREFIX)/lib
|
||||
INCPATH = $(PREFIX)/include
|
||||
DATAPATH = $(PREFIX)/share/doc/libtomcrypt/pdf
|
||||
BINPATH = $(PREFIX)/bin
|
||||
CC = cc
|
||||
AR = ar
|
||||
ARFLAGS = r
|
||||
RANLIB = ranlib
|
||||
CFLAGS = -O2 -DUSE_LTM -DLTM_DESC -I../libtommath
|
||||
EXTRALIBS = ../libtommath/libtommath.a
|
||||
|
||||
#Compilation flags
|
||||
LTC_CFLAGS = -Isrc/headers -Itests -DLTC_SOURCE $(CFLAGS)
|
||||
LTC_LDFLAGS = $(LDFLAGS) $(EXTRALIBS)
|
||||
VERSION=1.18.2
|
||||
|
||||
#Libraries to be created (this makefile builds only static libraries)
|
||||
LIBMAIN_S =libtomcrypt.a
|
||||
|
||||
#List of objects to compile (all goes to libtomcrypt.a)
|
||||
OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \
|
||||
src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \
|
||||
src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
|
||||
src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \
|
||||
src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \
|
||||
src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \
|
||||
src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
|
||||
src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
|
||||
src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \
|
||||
src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \
|
||||
src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \
|
||||
src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \
|
||||
src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \
|
||||
src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \
|
||||
src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \
|
||||
src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \
|
||||
src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \
|
||||
src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \
|
||||
src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \
|
||||
src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \
|
||||
src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \
|
||||
src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \
|
||||
src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \
|
||||
src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \
|
||||
src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \
|
||||
src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \
|
||||
src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \
|
||||
src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
|
||||
src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \
|
||||
src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \
|
||||
src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \
|
||||
src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \
|
||||
src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \
|
||||
src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \
|
||||
src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \
|
||||
src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \
|
||||
src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \
|
||||
src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \
|
||||
src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \
|
||||
src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \
|
||||
src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \
|
||||
src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
|
||||
src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \
|
||||
src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \
|
||||
src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \
|
||||
src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \
|
||||
src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
|
||||
src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
|
||||
src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \
|
||||
src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \
|
||||
src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
|
||||
src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
|
||||
src/pk/asn1/der/octet/der_length_octet_string.o \
|
||||
src/pk/asn1/der/printable_string/der_decode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_encode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \
|
||||
src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \
|
||||
src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \
|
||||
src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \
|
||||
src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \
|
||||
src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
|
||||
src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \
|
||||
src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \
|
||||
src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
|
||||
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \
|
||||
src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \
|
||||
src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \
|
||||
src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_x509.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_set.o src/pk/rsa/rsa_sign_hash.o \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \
|
||||
src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \
|
||||
src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \
|
||||
src/stream/rc4/rc4_stream.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128_stream.o \
|
||||
src/stream/sober128/sober128_test.o
|
||||
|
||||
#List of test objects to compile (all goes to libtomcrypt_prof.a)
|
||||
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \
|
||||
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
|
||||
tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \
|
||||
tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \
|
||||
tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o
|
||||
|
||||
#The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
#The default rule for make builds the libtomcrypt.a library (static)
|
||||
default: $(LIBMAIN_S)
|
||||
|
||||
#SPECIAL: AES comes in two flavours - enc+dec and enc-only
|
||||
src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
$(CC) $(LTC_CFLAGS) -DENCRYPT_ONLY -c src/ciphers/aes/aes.c -o src/ciphers/aes/aes_enc.o
|
||||
|
||||
#SPECIAL: these are the rules to make certain object files
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(TOBJECTS): $(HEADERS) tests/tomcrypt_test.h
|
||||
|
||||
#This is necessary for compatibility with BSD make (namely on OpenBSD)
|
||||
.SUFFIXES: .o .c
|
||||
.c.o:
|
||||
$(CC) $(LTC_CFLAGS) -c $< -o $@
|
||||
|
||||
#Create libtomcrypt.a
|
||||
$(LIBMAIN_S): $(OBJECTS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
#Demo tools/utilities
|
||||
hashsum: demos/hashsum.o $(LIBMAIN_S)
|
||||
$(CC) demos/hashsum.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
ltcrypt: demos/ltcrypt.o $(LIBMAIN_S)
|
||||
$(CC) demos/ltcrypt.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
small: demos/small.o $(LIBMAIN_S)
|
||||
$(CC) demos/small.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
tv_gen: demos/tv_gen.o $(LIBMAIN_S)
|
||||
$(CC) demos/tv_gen.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
sizes: demos/sizes.o $(LIBMAIN_S)
|
||||
$(CC) demos/sizes.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
constants: demos/constants.o $(LIBMAIN_S)
|
||||
$(CC) demos/constants.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
timing: demos/timing.o $(LIBMAIN_S)
|
||||
$(CC) demos/timing.o $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
|
||||
#Tests
|
||||
test: $(TOBJECTS) $(LIBMAIN_S)
|
||||
$(CC) $(TOBJECTS) $(LIBMAIN_S) $(LTC_LDFLAGS) -o $@
|
||||
@echo "NOTICE: start the tests by: ./test"
|
||||
|
||||
all: $(LIBMAIN_S) hashsum ltcrypt small tv_gen sizes constants timing test
|
||||
|
||||
#NOTE: this makefile works also on cygwin, thus we need to delete *.exe
|
||||
clean:
|
||||
-@rm -f $(OBJECTS) $(TOBJECTS)
|
||||
-@rm -f $(LIBMAIN_S)
|
||||
-@rm -f demos/*.o *_tv.txt
|
||||
-@rm -f test constants sizes tv_gen hashsum ltcrypt small timing
|
||||
-@rm -f test.exe constants.exe sizes.exe tv_gen.exe hashsum.exe ltcrypt.exe small.exe timing.exe
|
||||
|
||||
#Install the library + headers
|
||||
install: $(LIBMAIN_S) $(HEADERS)
|
||||
@mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/pkgconfig
|
||||
@cp $(LIBMAIN_S) $(DESTDIR)$(LIBPATH)/
|
||||
@cp $(HEADERS) $(DESTDIR)$(INCPATH)/
|
||||
@sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtomcrypt.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtomcrypt.pc
|
||||
|
||||
#Install useful tools
|
||||
install_bins: hashsum
|
||||
@mkdir -p $(DESTDIR)$(BINPATH)
|
||||
@cp hashsum $(DESTDIR)$(BINPATH)/
|
||||
|
||||
#Install documentation
|
||||
install_docs: doc/crypt.pdf
|
||||
@mkdir -p $(DESTDIR)$(DATAPATH)
|
||||
@cp doc/crypt.pdf $(DESTDIR)$(DATAPATH)/
|
||||
@@ -1,490 +0,0 @@
|
||||
#
|
||||
# Include makefile used by makefile + makefile.shared
|
||||
# (GNU make only)
|
||||
|
||||
# The version - BEWARE: VERSION, VERSION_PC and VERSION_LT are updated via ./updatemakes.sh
|
||||
VERSION=1.18.2
|
||||
VERSION_PC=1.18.2
|
||||
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||
VERSION_LT=1:1
|
||||
|
||||
# Compiler and Linker Names
|
||||
ifndef CROSS_COMPILE
|
||||
CROSS_COMPILE:=
|
||||
endif
|
||||
|
||||
# We only need to go through this dance of determining the right compiler if we're using
|
||||
# cross compilation, otherwise $(CC) is fine as-is.
|
||||
ifneq (,$(CROSS_COMPILE))
|
||||
ifeq ($(origin CC),default)
|
||||
CSTR := "\#ifdef __clang__\nCLANG\n\#endif\n"
|
||||
ifeq ($(PLATFORM),FreeBSD)
|
||||
# XXX: FreeBSD needs extra escaping for some reason
|
||||
CSTR := $$$(CSTR)
|
||||
endif
|
||||
ifneq (,$(shell echo $(CSTR) | $(CC) -E - | grep CLANG))
|
||||
CC := $(CROSS_COMPILE)clang
|
||||
else
|
||||
CC := $(CROSS_COMPILE)gcc
|
||||
endif # Clang
|
||||
endif # cc is Make's default
|
||||
endif # CROSS_COMPILE non-empty
|
||||
|
||||
LD:=$(CROSS_COMPILE)ld
|
||||
AR:=$(CROSS_COMPILE)ar
|
||||
|
||||
# Archiver [makes .a files]
|
||||
#AR=ar
|
||||
ARFLAGS:=r
|
||||
|
||||
ifndef MAKE
|
||||
# BSDs refer to GNU Make as gmake
|
||||
ifneq (,$(findstring $(PLATFORM),FreeBSD OpenBSD DragonFly NetBSD))
|
||||
MAKE=gmake
|
||||
else
|
||||
MAKE=make
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef INSTALL_CMD
|
||||
$(error your makefile must define INSTALL_CMD)
|
||||
endif
|
||||
ifndef UNINSTALL_CMD
|
||||
$(error your makefile must define UNINSTALL_CMD)
|
||||
endif
|
||||
|
||||
ifndef EXTRALIBS
|
||||
ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),)
|
||||
EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs)
|
||||
else
|
||||
ifneq ($(shell echo $(CFLAGS) | grep USE_TFM),)
|
||||
EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config tomsfastmath --libs)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
need-help := $(filter help,$(MAKECMDGOALS))
|
||||
define print-help
|
||||
$(if $(need-help),$(info $1 -- $2))
|
||||
endef
|
||||
|
||||
#
|
||||
# Compilation flags. Note the += does not write over the user's CFLAGS!
|
||||
#
|
||||
# Also note that we're extending the environments' CFLAGS.
|
||||
# If you think that our CFLAGS are not nice you can easily override them
|
||||
# by giving them as a parameter to make:
|
||||
# make CFLAGS="-I./src/headers/ -DLTC_SOURCE ..." ...
|
||||
#
|
||||
LTC_CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE
|
||||
|
||||
ifdef OLD_GCC
|
||||
LTC_CFLAGS += -W
|
||||
# older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros
|
||||
# define this to help
|
||||
LTC_CFLAGS += -DLTC_NO_ROLC
|
||||
else
|
||||
LTC_CFLAGS += -Wextra
|
||||
# additional warnings
|
||||
LTC_CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align
|
||||
LTC_CFLAGS += -Wstrict-prototypes -Wpointer-arith
|
||||
LTC_CFLAGS += -Wdeclaration-after-statement
|
||||
LTC_CFLAGS += -Wwrite-strings
|
||||
endif
|
||||
|
||||
LTC_CFLAGS += -Wno-type-limits
|
||||
|
||||
ifdef LTC_DEBUG
|
||||
$(info Debug build)
|
||||
# compile for DEBUGGING (required for ccmalloc checking!!!)
|
||||
LTC_CFLAGS += -g3 -DLTC_NO_ASM
|
||||
ifneq (,$(strip $(LTC_DEBUG)))
|
||||
LTC_CFLAGS += -DLTC_TEST_DBG=$(LTC_DEBUG)
|
||||
else
|
||||
LTC_CFLAGS += -DLTC_TEST_DBG
|
||||
endif
|
||||
else
|
||||
|
||||
ifdef LTC_SMALL
|
||||
# optimize for SIZE
|
||||
LTC_CFLAGS += -Os -DLTC_SMALL_CODE
|
||||
else
|
||||
|
||||
ifndef IGNORE_SPEED
|
||||
# optimize for SPEED
|
||||
LTC_CFLAGS += -O3 -funroll-loops
|
||||
|
||||
# add -fomit-frame-pointer. hinders debugging!
|
||||
LTC_CFLAGS += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
endif # COMPILE_SMALL
|
||||
endif # COMPILE_DEBUG
|
||||
|
||||
|
||||
ifneq ($(findstring clang,$(CC)),)
|
||||
LTC_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header -Wno-missing-field-initializers
|
||||
endif
|
||||
ifneq ($(findstring mingw,$(CC)),)
|
||||
LTC_CFLAGS += -Wno-shadow -Wno-attributes
|
||||
endif
|
||||
ifeq ($(PLATFORM), Darwin)
|
||||
LTC_CFLAGS += -Wno-nullability-completeness
|
||||
endif
|
||||
|
||||
|
||||
GIT_VERSION := $(shell { [ -e .git ] && which git 2>/dev/null 1>&2 ; } && { printf git- ; git describe --tags --always --dirty ; } || echo $(VERSION))
|
||||
ifneq ($(GIT_VERSION),)
|
||||
LTC_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
LTC_CFLAGS := $(LTC_CFLAGS) $(CFLAGS)
|
||||
|
||||
ifneq ($(findstring -DLTC_PTHREAD,$(LTC_CFLAGS)),)
|
||||
LTC_LDFLAGS += -pthread
|
||||
endif
|
||||
|
||||
LTC_LDFLAGS := $(LTC_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
#List of demo objects
|
||||
DSOURCES = $(wildcard demos/*.c)
|
||||
DOBJECTS = $(DSOURCES:.c=.o)
|
||||
|
||||
#List of tests headers
|
||||
THEADERS = $(wildcard tests/*.h)
|
||||
|
||||
TEST=test
|
||||
|
||||
# Demos that are even somehow useful and could be installed as a system-tool
|
||||
USEFUL_DEMOS = hashsum
|
||||
|
||||
# Demos that are usable but only rarely make sense to be installed
|
||||
USEABLE_DEMOS = ltcrypt sizes constants
|
||||
|
||||
# Demos that are used for testing or measuring
|
||||
TEST_DEMOS = small tv_gen
|
||||
|
||||
# Demos that are in one config broken
|
||||
# openssl-enc - can't be build with LTC_EASY
|
||||
# timing - not really broken, but older gcc builds spit warnings
|
||||
BROKEN_DEMOS = openssl-enc timing
|
||||
|
||||
# Combine demos in groups
|
||||
UNBROKEN_DEMOS = $(TEST_DEMOS) $(USEABLE_DEMOS) $(USEFUL_DEMOS)
|
||||
DEMOS = $(UNBROKEN_DEMOS) $(BROKEN_DEMOS)
|
||||
|
||||
#LIBPATH The directory for libtomcrypt to be installed to.
|
||||
#INCPATH The directory to install the header files for libtomcrypt.
|
||||
#DATAPATH The directory to install the pdf docs.
|
||||
#BINPATH The directory to install the binaries provided.
|
||||
DESTDIR ?=
|
||||
PREFIX ?= /usr/local
|
||||
LIBPATH ?= $(PREFIX)/lib
|
||||
INCPATH ?= $(PREFIX)/include
|
||||
DATAPATH ?= $(PREFIX)/share/doc/libtomcrypt/pdf
|
||||
BINPATH ?= $(PREFIX)/bin
|
||||
|
||||
#Who do we install as?
|
||||
ifdef INSTALL_USER
|
||||
USER=$(INSTALL_USER)
|
||||
else
|
||||
USER=root
|
||||
endif
|
||||
|
||||
ifdef INSTALL_GROUP
|
||||
GROUP=$(INSTALL_GROUP)
|
||||
else
|
||||
GROUP=wheel
|
||||
endif
|
||||
|
||||
|
||||
#The first rule is also the default rule and builds the libtomcrypt library.
|
||||
library: $(call print-help,library,Builds the library) $(LIBNAME)
|
||||
|
||||
|
||||
# List of objects to compile (all goes to libtomcrypt.a)
|
||||
OBJECTS=src/ciphers/aes/aes.o src/ciphers/aes/aes_enc.o src/ciphers/anubis.o src/ciphers/blowfish.o \
|
||||
src/ciphers/camellia.o src/ciphers/cast5.o src/ciphers/des.o src/ciphers/kasumi.o src/ciphers/khazad.o \
|
||||
src/ciphers/kseed.o src/ciphers/multi2.o src/ciphers/noekeon.o src/ciphers/rc2.o src/ciphers/rc5.o \
|
||||
src/ciphers/rc6.o src/ciphers/safer/safer.o src/ciphers/safer/saferp.o src/ciphers/skipjack.o \
|
||||
src/ciphers/twofish/twofish.o src/ciphers/xtea.o src/encauth/ccm/ccm_add_aad.o \
|
||||
src/encauth/ccm/ccm_add_nonce.o src/encauth/ccm/ccm_done.o src/encauth/ccm/ccm_init.o \
|
||||
src/encauth/ccm/ccm_memory.o src/encauth/ccm/ccm_process.o src/encauth/ccm/ccm_reset.o \
|
||||
src/encauth/ccm/ccm_test.o src/encauth/chachapoly/chacha20poly1305_add_aad.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_decrypt.o src/encauth/chachapoly/chacha20poly1305_done.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_encrypt.o src/encauth/chachapoly/chacha20poly1305_init.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_memory.o src/encauth/chachapoly/chacha20poly1305_setiv.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
|
||||
src/encauth/chachapoly/chacha20poly1305_test.o src/encauth/eax/eax_addheader.o \
|
||||
src/encauth/eax/eax_decrypt.o src/encauth/eax/eax_decrypt_verify_memory.o src/encauth/eax/eax_done.o \
|
||||
src/encauth/eax/eax_encrypt.o src/encauth/eax/eax_encrypt_authenticate_memory.o \
|
||||
src/encauth/eax/eax_init.o src/encauth/eax/eax_test.o src/encauth/gcm/gcm_add_aad.o \
|
||||
src/encauth/gcm/gcm_add_iv.o src/encauth/gcm/gcm_done.o src/encauth/gcm/gcm_gf_mult.o \
|
||||
src/encauth/gcm/gcm_init.o src/encauth/gcm/gcm_memory.o src/encauth/gcm/gcm_mult_h.o \
|
||||
src/encauth/gcm/gcm_process.o src/encauth/gcm/gcm_reset.o src/encauth/gcm/gcm_test.o \
|
||||
src/encauth/ocb/ocb_decrypt.o src/encauth/ocb/ocb_decrypt_verify_memory.o \
|
||||
src/encauth/ocb/ocb_done_decrypt.o src/encauth/ocb/ocb_done_encrypt.o src/encauth/ocb/ocb_encrypt.o \
|
||||
src/encauth/ocb/ocb_encrypt_authenticate_memory.o src/encauth/ocb/ocb_init.o src/encauth/ocb/ocb_ntz.o \
|
||||
src/encauth/ocb/ocb_shift_xor.o src/encauth/ocb/ocb_test.o src/encauth/ocb/s_ocb_done.o \
|
||||
src/encauth/ocb3/ocb3_add_aad.o src/encauth/ocb3/ocb3_decrypt.o src/encauth/ocb3/ocb3_decrypt_last.o \
|
||||
src/encauth/ocb3/ocb3_decrypt_verify_memory.o src/encauth/ocb3/ocb3_done.o \
|
||||
src/encauth/ocb3/ocb3_encrypt.o src/encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
|
||||
src/encauth/ocb3/ocb3_encrypt_last.o src/encauth/ocb3/ocb3_init.o src/encauth/ocb3/ocb3_int_ntz.o \
|
||||
src/encauth/ocb3/ocb3_int_xor_blocks.o src/encauth/ocb3/ocb3_test.o src/hashes/blake2b.o \
|
||||
src/hashes/blake2s.o src/hashes/chc/chc.o src/hashes/helper/hash_file.o \
|
||||
src/hashes/helper/hash_filehandle.o src/hashes/helper/hash_memory.o \
|
||||
src/hashes/helper/hash_memory_multi.o src/hashes/md2.o src/hashes/md4.o src/hashes/md5.o \
|
||||
src/hashes/rmd128.o src/hashes/rmd160.o src/hashes/rmd256.o src/hashes/rmd320.o src/hashes/sha1.o \
|
||||
src/hashes/sha2/sha224.o src/hashes/sha2/sha256.o src/hashes/sha2/sha384.o src/hashes/sha2/sha512.o \
|
||||
src/hashes/sha2/sha512_224.o src/hashes/sha2/sha512_256.o src/hashes/sha3.o src/hashes/sha3_test.o \
|
||||
src/hashes/tiger.o src/hashes/whirl/whirl.o src/mac/blake2/blake2bmac.o \
|
||||
src/mac/blake2/blake2bmac_file.o src/mac/blake2/blake2bmac_memory.o \
|
||||
src/mac/blake2/blake2bmac_memory_multi.o src/mac/blake2/blake2bmac_test.o src/mac/blake2/blake2smac.o \
|
||||
src/mac/blake2/blake2smac_file.o src/mac/blake2/blake2smac_memory.o \
|
||||
src/mac/blake2/blake2smac_memory_multi.o src/mac/blake2/blake2smac_test.o src/mac/f9/f9_done.o \
|
||||
src/mac/f9/f9_file.o src/mac/f9/f9_init.o src/mac/f9/f9_memory.o src/mac/f9/f9_memory_multi.o \
|
||||
src/mac/f9/f9_process.o src/mac/f9/f9_test.o src/mac/hmac/hmac_done.o src/mac/hmac/hmac_file.o \
|
||||
src/mac/hmac/hmac_init.o src/mac/hmac/hmac_memory.o src/mac/hmac/hmac_memory_multi.o \
|
||||
src/mac/hmac/hmac_process.o src/mac/hmac/hmac_test.o src/mac/omac/omac_done.o src/mac/omac/omac_file.o \
|
||||
src/mac/omac/omac_init.o src/mac/omac/omac_memory.o src/mac/omac/omac_memory_multi.o \
|
||||
src/mac/omac/omac_process.o src/mac/omac/omac_test.o src/mac/pelican/pelican.o \
|
||||
src/mac/pelican/pelican_memory.o src/mac/pelican/pelican_test.o src/mac/pmac/pmac_done.o \
|
||||
src/mac/pmac/pmac_file.o src/mac/pmac/pmac_init.o src/mac/pmac/pmac_memory.o \
|
||||
src/mac/pmac/pmac_memory_multi.o src/mac/pmac/pmac_ntz.o src/mac/pmac/pmac_process.o \
|
||||
src/mac/pmac/pmac_shift_xor.o src/mac/pmac/pmac_test.o src/mac/poly1305/poly1305.o \
|
||||
src/mac/poly1305/poly1305_file.o src/mac/poly1305/poly1305_memory.o \
|
||||
src/mac/poly1305/poly1305_memory_multi.o src/mac/poly1305/poly1305_test.o src/mac/xcbc/xcbc_done.o \
|
||||
src/mac/xcbc/xcbc_file.o src/mac/xcbc/xcbc_init.o src/mac/xcbc/xcbc_memory.o \
|
||||
src/mac/xcbc/xcbc_memory_multi.o src/mac/xcbc/xcbc_process.o src/mac/xcbc/xcbc_test.o \
|
||||
src/math/fp/ltc_ecc_fp_mulmod.o src/math/gmp_desc.o src/math/ltm_desc.o src/math/multi.o \
|
||||
src/math/radix_to_bin.o src/math/rand_bn.o src/math/rand_prime.o src/math/tfm_desc.o src/misc/adler32.o \
|
||||
src/misc/base64/base64_decode.o src/misc/base64/base64_encode.o src/misc/burn_stack.o \
|
||||
src/misc/compare_testvector.o src/misc/crc32.o src/misc/crypt/crypt.o src/misc/crypt/crypt_argchk.o \
|
||||
src/misc/crypt/crypt_cipher_descriptor.o src/misc/crypt/crypt_cipher_is_valid.o \
|
||||
src/misc/crypt/crypt_constants.o src/misc/crypt/crypt_find_cipher.o \
|
||||
src/misc/crypt/crypt_find_cipher_any.o src/misc/crypt/crypt_find_cipher_id.o \
|
||||
src/misc/crypt/crypt_find_hash.o src/misc/crypt/crypt_find_hash_any.o \
|
||||
src/misc/crypt/crypt_find_hash_id.o src/misc/crypt/crypt_find_hash_oid.o \
|
||||
src/misc/crypt/crypt_find_prng.o src/misc/crypt/crypt_fsa.o src/misc/crypt/crypt_hash_descriptor.o \
|
||||
src/misc/crypt/crypt_hash_is_valid.o src/misc/crypt/crypt_inits.o \
|
||||
src/misc/crypt/crypt_ltc_mp_descriptor.o src/misc/crypt/crypt_prng_descriptor.o \
|
||||
src/misc/crypt/crypt_prng_is_valid.o src/misc/crypt/crypt_prng_rng_descriptor.o \
|
||||
src/misc/crypt/crypt_register_all_ciphers.o src/misc/crypt/crypt_register_all_hashes.o \
|
||||
src/misc/crypt/crypt_register_all_prngs.o src/misc/crypt/crypt_register_cipher.o \
|
||||
src/misc/crypt/crypt_register_hash.o src/misc/crypt/crypt_register_prng.o src/misc/crypt/crypt_sizes.o \
|
||||
src/misc/crypt/crypt_unregister_cipher.o src/misc/crypt/crypt_unregister_hash.o \
|
||||
src/misc/crypt/crypt_unregister_prng.o src/misc/error_to_string.o src/misc/hkdf/hkdf.o \
|
||||
src/misc/hkdf/hkdf_test.o src/misc/mem_neq.o src/misc/pk_get_oid.o src/misc/pkcs5/pkcs_5_1.o \
|
||||
src/misc/pkcs5/pkcs_5_2.o src/misc/pkcs5/pkcs_5_test.o src/misc/zeromem.o src/modes/cbc/cbc_decrypt.o \
|
||||
src/modes/cbc/cbc_done.o src/modes/cbc/cbc_encrypt.o src/modes/cbc/cbc_getiv.o \
|
||||
src/modes/cbc/cbc_setiv.o src/modes/cbc/cbc_start.o src/modes/cfb/cfb_decrypt.o \
|
||||
src/modes/cfb/cfb_done.o src/modes/cfb/cfb_encrypt.o src/modes/cfb/cfb_getiv.o \
|
||||
src/modes/cfb/cfb_setiv.o src/modes/cfb/cfb_start.o src/modes/ctr/ctr_decrypt.o \
|
||||
src/modes/ctr/ctr_done.o src/modes/ctr/ctr_encrypt.o src/modes/ctr/ctr_getiv.o \
|
||||
src/modes/ctr/ctr_setiv.o src/modes/ctr/ctr_start.o src/modes/ctr/ctr_test.o \
|
||||
src/modes/ecb/ecb_decrypt.o src/modes/ecb/ecb_done.o src/modes/ecb/ecb_encrypt.o \
|
||||
src/modes/ecb/ecb_start.o src/modes/f8/f8_decrypt.o src/modes/f8/f8_done.o src/modes/f8/f8_encrypt.o \
|
||||
src/modes/f8/f8_getiv.o src/modes/f8/f8_setiv.o src/modes/f8/f8_start.o src/modes/f8/f8_test_mode.o \
|
||||
src/modes/lrw/lrw_decrypt.o src/modes/lrw/lrw_done.o src/modes/lrw/lrw_encrypt.o \
|
||||
src/modes/lrw/lrw_getiv.o src/modes/lrw/lrw_process.o src/modes/lrw/lrw_setiv.o \
|
||||
src/modes/lrw/lrw_start.o src/modes/lrw/lrw_test.o src/modes/ofb/ofb_decrypt.o src/modes/ofb/ofb_done.o \
|
||||
src/modes/ofb/ofb_encrypt.o src/modes/ofb/ofb_getiv.o src/modes/ofb/ofb_setiv.o \
|
||||
src/modes/ofb/ofb_start.o src/modes/xts/xts_decrypt.o src/modes/xts/xts_done.o \
|
||||
src/modes/xts/xts_encrypt.o src/modes/xts/xts_init.o src/modes/xts/xts_mult_x.o \
|
||||
src/modes/xts/xts_test.o src/pk/asn1/der/bit/der_decode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_decode_raw_bit_string.o src/pk/asn1/der/bit/der_encode_bit_string.o \
|
||||
src/pk/asn1/der/bit/der_encode_raw_bit_string.o src/pk/asn1/der/bit/der_length_bit_string.o \
|
||||
src/pk/asn1/der/boolean/der_decode_boolean.o src/pk/asn1/der/boolean/der_encode_boolean.o \
|
||||
src/pk/asn1/der/boolean/der_length_boolean.o src/pk/asn1/der/choice/der_decode_choice.o \
|
||||
src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
|
||||
src/pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
|
||||
src/pk/asn1/der/ia5/der_decode_ia5_string.o src/pk/asn1/der/ia5/der_encode_ia5_string.o \
|
||||
src/pk/asn1/der/ia5/der_length_ia5_string.o src/pk/asn1/der/integer/der_decode_integer.o \
|
||||
src/pk/asn1/der/integer/der_encode_integer.o src/pk/asn1/der/integer/der_length_integer.o \
|
||||
src/pk/asn1/der/object_identifier/der_decode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_encode_object_identifier.o \
|
||||
src/pk/asn1/der/object_identifier/der_length_object_identifier.o \
|
||||
src/pk/asn1/der/octet/der_decode_octet_string.o src/pk/asn1/der/octet/der_encode_octet_string.o \
|
||||
src/pk/asn1/der/octet/der_length_octet_string.o \
|
||||
src/pk/asn1/der/printable_string/der_decode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_encode_printable_string.o \
|
||||
src/pk/asn1/der/printable_string/der_length_printable_string.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_flexi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_ex.o \
|
||||
src/pk/asn1/der/sequence/der_encode_sequence_multi.o \
|
||||
src/pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
|
||||
src/pk/asn1/der/sequence/der_length_sequence.o src/pk/asn1/der/sequence/der_sequence_free.o \
|
||||
src/pk/asn1/der/sequence/der_sequence_shrink.o src/pk/asn1/der/set/der_encode_set.o \
|
||||
src/pk/asn1/der/set/der_encode_setof.o src/pk/asn1/der/short_integer/der_decode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_encode_short_integer.o \
|
||||
src/pk/asn1/der/short_integer/der_length_short_integer.o \
|
||||
src/pk/asn1/der/teletex_string/der_decode_teletex_string.o \
|
||||
src/pk/asn1/der/teletex_string/der_length_teletex_string.o \
|
||||
src/pk/asn1/der/utctime/der_decode_utctime.o src/pk/asn1/der/utctime/der_encode_utctime.o \
|
||||
src/pk/asn1/der/utctime/der_length_utctime.o src/pk/asn1/der/utf8/der_decode_utf8_string.o \
|
||||
src/pk/asn1/der/utf8/der_encode_utf8_string.o src/pk/asn1/der/utf8/der_length_utf8_string.o \
|
||||
src/pk/dh/dh.o src/pk/dh/dh_check_pubkey.o src/pk/dh/dh_export.o src/pk/dh/dh_export_key.o \
|
||||
src/pk/dh/dh_free.o src/pk/dh/dh_generate_key.o src/pk/dh/dh_import.o src/pk/dh/dh_set.o \
|
||||
src/pk/dh/dh_set_pg_dhparam.o src/pk/dh/dh_shared_secret.o src/pk/dsa/dsa_decrypt_key.o \
|
||||
src/pk/dsa/dsa_encrypt_key.o src/pk/dsa/dsa_export.o src/pk/dsa/dsa_free.o \
|
||||
src/pk/dsa/dsa_generate_key.o src/pk/dsa/dsa_generate_pqg.o src/pk/dsa/dsa_import.o \
|
||||
src/pk/dsa/dsa_make_key.o src/pk/dsa/dsa_set.o src/pk/dsa/dsa_set_pqg_dsaparam.o \
|
||||
src/pk/dsa/dsa_shared_secret.o src/pk/dsa/dsa_sign_hash.o src/pk/dsa/dsa_verify_hash.o \
|
||||
src/pk/dsa/dsa_verify_key.o src/pk/ecc/ecc.o src/pk/ecc/ecc_ansi_x963_export.o \
|
||||
src/pk/ecc/ecc_ansi_x963_import.o src/pk/ecc/ecc_decrypt_key.o src/pk/ecc/ecc_encrypt_key.o \
|
||||
src/pk/ecc/ecc_export.o src/pk/ecc/ecc_free.o src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o \
|
||||
src/pk/ecc/ecc_make_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
|
||||
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_test.o src/pk/ecc/ecc_verify_hash.o \
|
||||
src/pk/ecc/ltc_ecc_is_valid_idx.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
|
||||
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
|
||||
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
|
||||
src/pk/katja/katja_decrypt_key.o src/pk/katja/katja_encrypt_key.o src/pk/katja/katja_export.o \
|
||||
src/pk/katja/katja_exptmod.o src/pk/katja/katja_free.o src/pk/katja/katja_import.o \
|
||||
src/pk/katja/katja_make_key.o src/pk/pkcs1/pkcs_1_i2osp.o src/pk/pkcs1/pkcs_1_mgf1.o \
|
||||
src/pk/pkcs1/pkcs_1_oaep_decode.o src/pk/pkcs1/pkcs_1_oaep_encode.o src/pk/pkcs1/pkcs_1_os2ip.o \
|
||||
src/pk/pkcs1/pkcs_1_pss_decode.o src/pk/pkcs1/pkcs_1_pss_encode.o src/pk/pkcs1/pkcs_1_v1_5_decode.o \
|
||||
src/pk/pkcs1/pkcs_1_v1_5_encode.o src/pk/rsa/rsa_decrypt_key.o src/pk/rsa/rsa_encrypt_key.o \
|
||||
src/pk/rsa/rsa_export.o src/pk/rsa/rsa_exptmod.o src/pk/rsa/rsa_free.o src/pk/rsa/rsa_get_size.o \
|
||||
src/pk/rsa/rsa_import.o src/pk/rsa/rsa_import_pkcs8.o src/pk/rsa/rsa_import_x509.o \
|
||||
src/pk/rsa/rsa_make_key.o src/pk/rsa/rsa_set.o src/pk/rsa/rsa_sign_hash.o \
|
||||
src/pk/rsa/rsa_sign_saltlen_get.o src/pk/rsa/rsa_verify_hash.o src/prngs/chacha20.o src/prngs/fortuna.o \
|
||||
src/prngs/rc4.o src/prngs/rng_get_bytes.o src/prngs/rng_make_prng.o src/prngs/sober128.o \
|
||||
src/prngs/sprng.o src/prngs/yarrow.o src/stream/chacha/chacha_crypt.o src/stream/chacha/chacha_done.o \
|
||||
src/stream/chacha/chacha_ivctr32.o src/stream/chacha/chacha_ivctr64.o \
|
||||
src/stream/chacha/chacha_keystream.o src/stream/chacha/chacha_setup.o src/stream/chacha/chacha_test.o \
|
||||
src/stream/rc4/rc4_stream.o src/stream/rc4/rc4_test.o src/stream/sober128/sober128_stream.o \
|
||||
src/stream/sober128/sober128_test.o
|
||||
|
||||
# List of test objects to compile (all goes to libtomcrypt_prof.a)
|
||||
TOBJECTS=tests/base64_test.o tests/cipher_hash_test.o tests/common.o tests/der_test.o tests/dh_test.o \
|
||||
tests/dsa_test.o tests/ecc_test.o tests/file_test.o tests/katja_test.o tests/mac_test.o tests/misc_test.o \
|
||||
tests/modes_test.o tests/mpi_test.o tests/multi_test.o tests/no_prng.o tests/pkcs_1_eme_test.o \
|
||||
tests/pkcs_1_emsa_test.o tests/pkcs_1_oaep_test.o tests/pkcs_1_pss_test.o tests/pkcs_1_test.o \
|
||||
tests/prng_test.o tests/rotate_test.o tests/rsa_test.o tests/store_test.o tests/test.o
|
||||
|
||||
# The following headers will be installed by "make install"
|
||||
HEADERS=src/headers/tomcrypt.h src/headers/tomcrypt_argchk.h src/headers/tomcrypt_cfg.h \
|
||||
src/headers/tomcrypt_cipher.h src/headers/tomcrypt_custom.h src/headers/tomcrypt_hash.h \
|
||||
src/headers/tomcrypt_mac.h src/headers/tomcrypt_macros.h src/headers/tomcrypt_math.h \
|
||||
src/headers/tomcrypt_misc.h src/headers/tomcrypt_pk.h src/headers/tomcrypt_pkcs.h \
|
||||
src/headers/tomcrypt_prng.h
|
||||
|
||||
#These are the rules to make certain object files.
|
||||
src/ciphers/aes/aes.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
||||
src/ciphers/twofish/twofish.o: src/ciphers/twofish/twofish.c src/ciphers/twofish/twofish_tab.c
|
||||
src/hashes/whirl/whirl.o: src/hashes/whirl/whirl.c src/hashes/whirl/whirltab.c
|
||||
src/hashes/sha2/sha512.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha384.c
|
||||
src/hashes/sha2/sha512_224.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_224.c
|
||||
src/hashes/sha2/sha512_256.o: src/hashes/sha2/sha512.c src/hashes/sha2/sha512_256.c
|
||||
src/hashes/sha2/sha256.o: src/hashes/sha2/sha256.c src/hashes/sha2/sha224.c
|
||||
|
||||
$(DOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS)
|
||||
$(TOBJECTS): LTC_CFLAGS := -Itests $(LTC_CFLAGS)
|
||||
|
||||
#Dependencies on *.h
|
||||
$(OBJECTS): $(HEADERS)
|
||||
$(DOBJECTS): $(HEADERS) $(THEADERS)
|
||||
$(TOBJECTS): $(HEADERS) $(THEADERS)
|
||||
|
||||
all: $(call print-help,all,Builds the library and all demos and test utils (test $(UNBROKEN_DEMOS) $(BROKEN_DEMOS))) all_test $(BROKEN_DEMOS)
|
||||
|
||||
all_test: $(call print-help,all_test,Builds the library and all unbroken demos and test utils (test $(UNBROKEN_DEMOS))) test $(UNBROKEN_DEMOS)
|
||||
|
||||
bins: $(call print-help,bins,Builds the library and all useful demos) $(USEFUL_DEMOS)
|
||||
|
||||
#build the doxy files (requires Doxygen, tetex and patience)
|
||||
doxygen: $(call print-help,doxygen,Builds the doxygen html documentation)
|
||||
$(MAKE) -C doc/ $@ V=$(V)
|
||||
doxy: $(call print-help,doxy,Builds the complete doxygen documentation including refman.pdf (takes long to generate))
|
||||
$(MAKE) -C doc/ $@ V=$(V)
|
||||
docs: $(call print-help,docs,Builds the Developer Manual)
|
||||
$(MAKE) -C doc/ $@ V=$(V)
|
||||
|
||||
doc/crypt.pdf: $(call print-help,doc/crypt.pdf,Builds the Developer Manual)
|
||||
$(MAKE) -C doc/ crypt.pdf V=$(V)
|
||||
|
||||
|
||||
install_all: $(call print-help,install_all,Install everything - library bins docs tests) install install_bins install_docs
|
||||
|
||||
INSTALL_OPTS ?= -m 644
|
||||
|
||||
.common_install: $(LIBNAME)
|
||||
install -p -d $(DESTDIR)$(INCPATH)
|
||||
install -p -d $(DESTDIR)$(LIBPATH)
|
||||
$(INSTALL_CMD) -p $(INSTALL_OPTS) $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
|
||||
install -p -m 644 $(HEADERS) $(DESTDIR)$(INCPATH)
|
||||
|
||||
$(DESTDIR)$(BINPATH):
|
||||
install -p -d $(DESTDIR)$(BINPATH)
|
||||
|
||||
.common_install_bins: $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH)
|
||||
$(INSTALL_CMD) -p -m 775 $(USEFUL_DEMOS) $(DESTDIR)$(BINPATH)
|
||||
|
||||
install_docs: $(call print-help,install_docs,Installs the Developer Manual) doc/crypt.pdf
|
||||
install -p -d $(DESTDIR)$(DATAPATH)
|
||||
install -p -m 644 doc/crypt.pdf $(DESTDIR)$(DATAPATH)
|
||||
|
||||
install_test: $(call print-help,install_test,Installs the self-test binary) test $(DESTDIR)$(BINPATH)
|
||||
$(INSTALL_CMD) -p -m 775 $< $(DESTDIR)$(BINPATH)
|
||||
|
||||
install_hooks: $(call print-help,install_hooks,Installs the git hooks)
|
||||
for s in `ls hooks/`; do ln -s ../../hooks/$$s .git/hooks/$$s; done
|
||||
|
||||
HEADER_FILES=$(notdir $(HEADERS))
|
||||
.common_uninstall:
|
||||
$(UNINSTALL_CMD) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
|
||||
rm $(HEADER_FILES:%=$(DESTDIR)$(INCPATH)/%)
|
||||
|
||||
#This rule cleans the source tree of all compiled code, not including the pdf
|
||||
#documentation.
|
||||
clean: $(call print-help,clean,Clean everything besides the pdf documentation)
|
||||
find . -type f -name "*.o" \
|
||||
-o -name "*.lo" \
|
||||
-o -name "*.a" \
|
||||
-o -name "*.la" \
|
||||
-o -name "*.obj" \
|
||||
-o -name "*.lib" \
|
||||
-o -name "*.exe" \
|
||||
-o -name "*.dll" \
|
||||
-o -name "*.so" \
|
||||
-o -name "*.gcov"\
|
||||
-o -name "*.gcda"\
|
||||
-o -name "*.gcno"\
|
||||
-o -name "*.il" \
|
||||
-o -name "*.dyn" \
|
||||
-o -name "*.dpi" | xargs rm -f
|
||||
rm -f $(TIMING) $(TEST) $(DEMOS)
|
||||
rm -f *_tv.txt
|
||||
rm -f *.pc
|
||||
rm -rf `find . -type d -name "*.libs" | xargs`
|
||||
$(MAKE) -C doc/ clean
|
||||
|
||||
zipup: $(call print-help,zipup,Prepare the archives for a release) doc/crypt.pdf
|
||||
@# Update the index, so diff-index won't fail in case the pdf has been created.
|
||||
@# As the pdf creation modifies crypt.tex, git sometimes detects the
|
||||
@# modified file, but misses that it's put back to its original version.
|
||||
@git update-index --refresh
|
||||
@git diff-index --quiet HEAD -- || ( echo "FAILURE: uncommited changes or not a git" && exit 1 )
|
||||
@perl helper.pl --check-all || ( echo "FAILURE: helper.pl --check-all errors" && exit 1 )
|
||||
rm -rf libtomcrypt-$(VERSION) crypt-$(VERSION).*
|
||||
@# files/dirs excluded from "git archive" are defined in .gitattributes
|
||||
git archive --format=tar --prefix=libtomcrypt-$(VERSION)/ HEAD | tar x
|
||||
@echo 'fixme check'
|
||||
-@(find libtomcrypt-$(VERSION)/ -type f | xargs grep 'FIXM[E]') && echo '############## BEWARE: the "fixme" marker was found !!! ##############' || true
|
||||
mkdir -p libtomcrypt-$(VERSION)/doc
|
||||
cp doc/crypt.pdf libtomcrypt-$(VERSION)/doc/crypt.pdf
|
||||
tar -c libtomcrypt-$(VERSION)/ | xz -6e -c - > crypt-$(VERSION).tar.xz
|
||||
zip -9rq crypt-$(VERSION).zip libtomcrypt-$(VERSION)
|
||||
rm -rf libtomcrypt-$(VERSION)
|
||||
gpg -b -a crypt-$(VERSION).tar.xz
|
||||
gpg -b -a crypt-$(VERSION).zip
|
||||
|
||||
codecheck: $(call print-help,codecheck,Check the code of the library)
|
||||
perl helper.pl -a
|
||||
perlcritic *.pl
|
||||
|
||||
help: $(call print-help,help,That's what you're currently looking at)
|
||||
@@ -1,35 +0,0 @@
|
||||
Base64 vectors. These are the base64 encodings of the strings 00,01,02...NN-1
|
||||
|
||||
0:
|
||||
1: AA==
|
||||
2: AAE=
|
||||
3: AAEC
|
||||
4: AAECAw==
|
||||
5: AAECAwQ=
|
||||
6: AAECAwQF
|
||||
7: AAECAwQFBg==
|
||||
8: AAECAwQFBgc=
|
||||
9: AAECAwQFBgcI
|
||||
10: AAECAwQFBgcICQ==
|
||||
11: AAECAwQFBgcICQo=
|
||||
12: AAECAwQFBgcICQoL
|
||||
13: AAECAwQFBgcICQoLDA==
|
||||
14: AAECAwQFBgcICQoLDA0=
|
||||
15: AAECAwQFBgcICQoLDA0O
|
||||
16: AAECAwQFBgcICQoLDA0ODw==
|
||||
17: AAECAwQFBgcICQoLDA0ODxA=
|
||||
18: AAECAwQFBgcICQoLDA0ODxAR
|
||||
19: AAECAwQFBgcICQoLDA0ODxAREg==
|
||||
20: AAECAwQFBgcICQoLDA0ODxAREhM=
|
||||
21: AAECAwQFBgcICQoLDA0ODxAREhMU
|
||||
22: AAECAwQFBgcICQoLDA0ODxAREhMUFQ==
|
||||
23: AAECAwQFBgcICQoLDA0ODxAREhMUFRY=
|
||||
24: AAECAwQFBgcICQoLDA0ODxAREhMUFRYX
|
||||
25: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGA==
|
||||
26: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBk=
|
||||
27: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBka
|
||||
28: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGw==
|
||||
29: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxw=
|
||||
30: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd
|
||||
31: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHg==
|
||||
32: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=
|
||||
@@ -1,284 +0,0 @@
|
||||
CCM Test Vectors. Uses the 00010203...NN-1 pattern for nonce/header/plaintext/key. The outputs
|
||||
are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous
|
||||
step repeated sufficiently. The nonce is fixed throughout at 13 bytes 000102...
|
||||
|
||||
CCM-aes (16 byte key)
|
||||
0: , 54C92FE45510D6B3B0D46EAC2FEE8E63
|
||||
1: DA, 7A8984228DCF944903936CA9D7709ACF
|
||||
2: B95E, 1056DE0CBBEEA760ED2053FFEB554EA6
|
||||
3: 58FF3B, A42DE1A812D29BBC6C1C5AC808565437
|
||||
4: 9D6E6FB6, 5E8E0422792999381ED669CE17601D34
|
||||
5: 40D49E851D, B076B4ED79BF0155B39A743550593944
|
||||
6: 015356B9A6E1, 8D62CEFC451CAE4A21C1C579C6CAA128
|
||||
7: A2CF0A77AE0DE2, 97B9D201740FA59E863513EDACC59FFB
|
||||
8: A44C68E52F95B48B, A461B79D4D9B8ADF6C6618E6ECDC059A
|
||||
9: F56B8AD68AA31F22B9, C5C7D2E6FE34D94CE72B86DA55679080
|
||||
10: 5C17EEBF4E348CBE3278, 29FAE7B470CB652C501343FE23B25894
|
||||
11: 1EE960BFAE360302D834E3, 8F8F475EB9BAB29CE14A9CF42C30B148
|
||||
12: EFF6BA1F2B1389237C6C045E, C895302DD8E75096951EF5CA63BFDD67
|
||||
13: 5A1179A4047334CCD9162F36EB, 110987D37F45422625DEA402BD7580EB
|
||||
14: F26E2C27E7D287B182FA42879978, 530FDE90C13A01EBCA86449073A3B035
|
||||
15: 77BFE79B4BC87116EC5232606E890F, 280994EB0E16C7CF10F31BB60DBF52C8
|
||||
16: 9926A4CE1AD70B89CC0050A58B958742, A635B4272EBFA1F83DAE270452D877E7
|
||||
17: BAAF99CAE4753E3304D6F8F9C0CD366C68, A6F606AACD0B87923B43C3EB61AC3965
|
||||
18: F72453C6765352A31494FA02B388E407B1FB, 0A446D28B7C5845C3621B4D3A0FA98DB
|
||||
19: A7372589A86B2E137F124A96618095EB5E1435, 3C59A6A858947FEBFD32441E37309F1A
|
||||
20: 5683E13A4E82A1AB8B3DC2051B6DBF2E1F2BB417, 459D1B0D2CF2C30B5ED5C237D07DFC19
|
||||
21: 33594C4B84536C23DA5AB2117E9267258CCE5DEC3B, 6E4BB70A72343E142AC4E31CE0FE6A77
|
||||
22: 332EDC9A3BDB90DBCCF317AC55BE5855CA9BCA2A73C4, 9FB310E5FFF5C754EE1E5FFF865F1656
|
||||
23: 734618677055469335FFD574B008F2C68B78633F79010E, FAD31386E42BB4EA76A643A9004A8CB4
|
||||
24: BA6F6ABA2AF35895F7F966D71F4E91A0BDD1DD551826F861, 25A3EC1C91C26283BAA5975390285AB2
|
||||
25: FF519213E858E36AC8D92450F81CA46C8CA8AB129A997EBB36, 0D4AB2B7A5EB02242C01A81CEBF5D84E
|
||||
26: B1F80058C3B4316EA86E9A898CD0B9C0366DFCB2AEC0799312D5, 0F4FF2759EDDF6349F4E23F284FAAD2E
|
||||
27: 00BDC15012F8183112D5C3A135DC60DC9C764A04BD39A8E041F1D9, 0C68BC9E6A6BF1B01743F3183C9B7C80
|
||||
28: 3022FD12969D925365C553D98D59E5D1EC494540909D1FA794F41E18, 05E61844943E78DB9BD417DDDE9C98B2
|
||||
29: 4F4A4554BFED6BAA09E3D8843C4EA3807B8762799C1D21289A46575389, 3A59A6DC9230020FE061466A92BBCAFD
|
||||
30: 6AE735EB15D9B39C8AD0E54F45307AAD97DB9F8A2A66BDC9BABCCFBD54A3, 0BDB365E493A9E160EEFD7DE24101870
|
||||
31: 4AF19F00EAE55FED2304B94FBCA29383042F2BE711041323C1D9F14BA63383, 94561581E496553D068052BA698683D2
|
||||
32: C2438BC46A92A465E0DB41E638CC6C8E0029C4DA842CA4140D73F90985EABA9C, 0F5A69F52AA8D8508D09E642511E54E5
|
||||
|
||||
CCM-rc6 (16 byte key)
|
||||
0: , D01FACF2BB577BFA6194800E53FB4A00
|
||||
1: 65, 92E48F7300FA2697E9E0FF80DD187237
|
||||
2: AF5C, 332863BC515649D5BCAB6A2FE5F5250D
|
||||
3: E7C89D, 49A641F027C65A15100009D99E79CF3F
|
||||
4: ACB36D46, 53DE328A8B4B14CAD363BED53DACE8A1
|
||||
5: C3ADAE6CCF, F713F5079BD77046F95D8685CDF522DC
|
||||
6: 5A8CABC912DA, FB97B059D2BE1273497FA8D2739A1505
|
||||
7: 27F101DD6D0894, 266ACEF34476A0E64410D209219335D0
|
||||
8: 66164DA09BE2F46D, EFC64C01890A5B562AF39ADFC48E1CA9
|
||||
9: 1B0018895394753995, FA894E1C882D96E35A4C238708931F3D
|
||||
10: D346062826187BAEFC3B, A036AE1D3C02E2AD23541DE095AC7B84
|
||||
11: EFB375BA1138339FA1B504, CDD4232FF4664D59D5AC6BE32CBE1B35
|
||||
12: AFCF494078D7D7E6D9803FD5, 07E06ED923F76150BE82C1DDCB62C4DD
|
||||
13: 75DF2EC91379408DA426A444E4, 440ACDF2A6567FA3A5009DDFE502A1A1
|
||||
14: 3B36B62B01E324E702694305DD29, 4093598607DCD9993845D1837D211FE2
|
||||
15: 7DF6595C9711B164C99CB246B4D57E, F364993B2C187058F466B62D11E0F94D
|
||||
16: D317EE9EE1746D1B89A4CC52D88F0819, 41856B0B229D38344FA718E04CA57A8B
|
||||
17: 85252277A97CA7553007995BD5A0DCD372, BDEEAB636BD1ACC8D5A23F658150FA30
|
||||
18: 36FF305AC6EF662C155A1C15A6C195D3EC88, 9AC48EF07A510E308E06E79C0C80C3A0
|
||||
19: 51645A614313E978F6DCE7BBDDEDC33E3284AB, E9F7723E763AD50161C0671C4034FD0A
|
||||
20: 3CB9E6D0730FE05F903D338708AD8E34BFBB3285, 8A12185DAD518049F0FAC945A8FB305A
|
||||
21: 276E37D246C40ABF32DC83007B95390EE801CDA6E3, 73FA1D310D031E0A0A3A1421661B4697
|
||||
22: 4444BB070EDFBD1AC59D0BF70D66F48F0830069F3562, 9DCB6A99CBCCE3C8AEF29F06AF5057FB
|
||||
23: D16BA084CF82EDD2E43349311140BF3A2E37DE40544BF3, CB93C5AD60C700D4EA653136101AACCC
|
||||
24: 3FBAEBB36E2B74014043BA7D72F899B0D8DED883F592D778, 54DEA31D7EEA863A06A16D6C9B25DC13
|
||||
25: 3614B5428B790793F31E23670A38A070B65DB8E51C61FEA9C9, A91B750FD7ABFF18376C982DFA0C8872
|
||||
26: AC15FD90A4C254BA1406BE7DBA5694BB2625F634C69F45CCCD04, E6F97BCC8526BE3C04BA139EB50E65DF
|
||||
27: B506E83557E48553BD8557411D2C17D64005E734BA5A5FF1CF98B1, 6FA001758A19F783A71C97AF1AA61F94
|
||||
28: F07721663400838947EA1B9404D9683556F2D911429A9F59E3F5AD31, 376A1165A30C919E96C3706A4AB5DB37
|
||||
29: 98B5EB8FE0005E515A585D8F44D838FA590054EA5201CD444366B6F71E, D8C58448F601F2C05F24ED2CC349C78B
|
||||
30: E36E2FC225767CC1E2C388BEBC2C81C340FEF5B504575D5FA49682E1C214, CFED56F38CA4F84E6E1E16CEF50A6154
|
||||
31: 7A9FDD8E481B822B3D282AAF726944101ED61DAE73782DE055D7D305E36B27, 328B10841E977041CBD13C39CD70F03F
|
||||
32: 48AE8B5FA027930A7BCEC27468D795D0D8E6099C5F0558361B3AD20C1ECFF89F, B180AA9353E9EB6A22710A4DE872FACB
|
||||
|
||||
CCM-safer+ (16 byte key)
|
||||
0: , E106F41D61402E532662213EBA471BFF
|
||||
1: 05, 1749600C7045647DCB3293C0724E7A21
|
||||
2: 2355, 80DD597665723F4AEFFF760C5C6C5EE2
|
||||
3: 5F4CD8, 59AE54E63A8CF4DBAD050B42CE922013
|
||||
4: 75F63A43, C31B6BD3125C036C99507DDEE0197201
|
||||
5: 51D4D87B8D, 0F3872088CDEB0E958C35F343677AC24
|
||||
6: 8CF6D81A274C, C8E688954E72A052B5F8D1CA46FB44B0
|
||||
7: 5EB8283B299AB1, 5977CB96C8D439DE3A86AE0452A2EE34
|
||||
8: 829B1A4EA8643EAA, 1E892D3DFB73A469035CA81DD7F937D1
|
||||
9: 0FEEF9504CF0F4E282, EDCBED7C61E8E2D24392B4145218F0AB
|
||||
10: DEF7679D3073D461A94C, D7ABAE561901CBB30FD7D9467C088B3B
|
||||
11: 625FD679C7354A74D62893, 450E3954857640DDF4C7A95A6E202A1E
|
||||
12: 3C9E76E4E2D4D95FEABD5C90, CD4467F695B7ED8973AEED5A822B347A
|
||||
13: B1B6294ECEAE6AEE4853731CA9, 6042302DAE598822BE8554BE038119CF
|
||||
14: 204BF480582D4BA408BAD23CEB52, 4D6B87334E1BFB9BA2D42B89B24165B2
|
||||
15: 277591770E3E2DB97A3011D9616991, 75D0A4B9937748EAE7794056F7A8A7FE
|
||||
16: 5669F75D0C908BFF7B82095231B86DAA, 3E816776A73FB89276534A3646C0F8FB
|
||||
17: 37E621EF5A043A83FC98A65329891BC031, 159A823EA61B3A47B42EFCF12F304725
|
||||
18: 18AC6ECF3F478A0797BF813C871235A9D309, 9B415B1B3A933B22C9027E2D72764956
|
||||
19: 671484C7587DAAB885C7F2FAF030081B452CC6, 574A63D113A5ECEC877D5A368A3160AA
|
||||
20: D7AB0F7D46B7ED976C8F6E7D0C6AABE3CAAA5A6E, 266C7A025C4EDF657DD42EB82BB6616A
|
||||
21: D60E4CFC6500E237276A69F35AE4BBAE17371392EF, 6ED2A1673F8B4DB795547D9D93D76D8B
|
||||
22: FAC6E21979D8D9896C790CB883C29F84D6820AE4FD4B, 1C7B6D73200E3C2DC5C701152F38EE8E
|
||||
23: 39240DC2B544CA8BEBBB4EA499FD48A5EE707198AE8AC8, E7FFD169552665ADE7B9C0DFFDD04EBD
|
||||
24: 6BE2C24172CAA192D55CC3E640E34675DD7F441CE5DB0FC0, 760CA976355281F76E49A2856A4EC7A0
|
||||
25: 0E20427218D6447D6E23FA4832CB8D2A172B23FDC542B41524, 27D0F37E109252FF5E6F6F703CA784F5
|
||||
26: 0AF75BD89028A5691B8B7993B9CE4FD24334A312DE28212C8B2C, AFE4C6B193B0F1796FC9E6C23292C060
|
||||
27: 6830D8E2E6DEC1476796DA44C982D36409E268F966283A66E801ED, 9E2C92D5B30EB0943E17869ED4C789EC
|
||||
28: 75ED280BEECD7768F7E032071F0E06D9D6BF1C9FF8E5DEB536DCD4BA, BF0DD11D633DBA5DCD25F4172765570B
|
||||
29: DF1FAECC1DB24718236B18B90B354F405FD5DE1257EC43F811F4A43DCD, 48D182E572E794350BBDA91FD76B86BC
|
||||
30: 176681E38ACACCD3C625F554C1F7A2D7C2C474C9444EAC8929B8C36EC05E, 080E109FFC5D247F1007217DD642BBA3
|
||||
31: 8A8172C21D88A1FDD43089C545C308507617F7BDB02C47CF2719F1484407E2, 1A0D10B0AF5BE21BF19D570D3FDA5BCE
|
||||
32: 0A93CAE2B95517773A4009FD3438231A207B9D46AABAE83FC4E1057EA4E2D6B4, 717AEF2F55DC8669F7E2D0298F8A7BE9
|
||||
|
||||
CCM-twofish (16 byte key)
|
||||
0: , 33B3DF1B59C84DD3C15E4FEB66173303
|
||||
1: BF, 92DCEBF1C11DD0B028DEC944A555E4C6
|
||||
2: 8A4F, A859C7F76291326D821BB3C7519657C0
|
||||
3: BAE755, 14D7C2EFBCA1063460FEFCEBAE3AD79A
|
||||
4: 25695BC6, 9358BC434B14B59ED17F9C0D3F51DCB1
|
||||
5: 1D9FC70ECE, 2A86578FA3A8C702E2E6723DB9A9893F
|
||||
6: AC39F1DF3661, 3F9C71EE0506FD2BAFFEE7200D22CD92
|
||||
7: D330A915EED9D0, 22DC25EDF5ACDEF8358BE2A3082112BC
|
||||
8: EF913ADAE6380507, E87D72BB6395EEEF2AD4F546B4033DE8
|
||||
9: 5EC16994E762BCE467, D7700F7BF4FE026A2076F161C3383A0A
|
||||
10: 7EEB4910B7C2B540B490, 40C88A977E1DCDDABD749ABC9A0C60F8
|
||||
11: E5DD32FF54D39451CC2AF8, 541B1558B5AFF6E9EFBEE496D60AD65C
|
||||
12: 242C2900F859966B6627FF5C, 1CED148098350F3A5D1B5634180817A3
|
||||
13: EEF025B9E4EB867B127EBD19D4, AD0179A07AD1418C25F40E123C2BEF47
|
||||
14: C5E812B0AE37098686E2C4452C12, 02FC88AAA62E34742BB8577A651E922B
|
||||
15: 7BCAB32D1A871A62F9C781AFCAC60C, 2CD1C11EE197D9E130359F76E7F49251
|
||||
16: 1E82D8B8EED9A730D1670F0DCFF17B60, B7730261560EA6CF715FF7006D5FEFE2
|
||||
17: 0E1966992E360DC81312B28ECA6865B811, 10C40ACD169CB0F2A6FFC99F9A5516EA
|
||||
18: 5F5418C1322BF7EB828CF27C1F72086515BE, 90F8ED0447171A10476DED39F7518075
|
||||
19: 6C552506FA167FB8AA12E9F416930031487D4E, C992009F83F31A7BF922BFAE68C4134B
|
||||
20: 38429D966676406B17638DB7F9F7205250408BB2, 3385A50E9789D2C63835A80EFE9CFAE4
|
||||
21: 56EF426315EF96BE4C60B49F41C9BDDE2E0CDB3C22, 2D51D5B4F5B04BEF3BC1A7CF1AEA70E9
|
||||
22: 314B075C097EE531ECCE6AD7CEF22A72AAFCEFB02029, FB7A7D84D23FF524D060871D90FAC106
|
||||
23: 61CCCF7E2A9B3E46CD0A94D7F4A7617BB0DBA2D989907A, B3F4D46094732F3EDD81E0755F0C52EB
|
||||
24: 7A812A3BCED4E0A72FB81218BD5A4E33D69CA18834FFAE61, 487F80588B41F4E1198124708987667D
|
||||
25: DBFAB77EF07AA4C9ED2B05500BDFA00FE3F19F15F97A74880A, 84504D9EECBC6CE11B18BD105DE55E2C
|
||||
26: E676D4739B01B5101E36BF8D9F4FAE8F767C028E83A6D5B39664, 3141A05669807BCA30F0934F599FD077
|
||||
27: D8FEBD069D87C1EE504CB8F72ADFF2166B14BA40B17B4DAA439668, 1D99A301943041C2F7A71432DA736FE0
|
||||
28: D98E2A1CFFAB28341F92C41971A21AD0FDDE733EA25F2607967CD0C3, 42E05A53BF4F1A6C5B7F84742ECE031B
|
||||
29: 13FA412B484945C1FE8291A7EB8F8FB78D2DC2C72C5132386EA82BF4A6, A1A8E8B026DD116B0F9C73EB14C1C7CD
|
||||
30: 10ABD2DC25C8BA594FBFA9312E69C1A2DBF326475AF2080E55E3611FBC0E, 49DF8A5171DAC3FB684BA2CF7FBB3D3B
|
||||
31: F401D2123619B81F54F307B783362CC40FB4FB2433CF51F5543A147BCD1FE5, ACBB670CB3722059B4B9FBEE67703E98
|
||||
32: 839A9BFA1D3CA37924BC6648DED2291FC61736A3638906D9C5DA28A66AA684AC, CD07B83C8E0C3E6FB4115A149BDF6FDA
|
||||
|
||||
CCM-noekeon (16 byte key)
|
||||
0: , AB924F56DFA05F4E8628C14111272E5C
|
||||
1: 08, 8A76DCADA7CE53A0F4577E67B0B958D7
|
||||
2: B602, E0BEAC0B1E95C4570A823295E7517C25
|
||||
3: 50E4B1, F874F8B5F2806F64AE0AED151821C638
|
||||
4: 990F28F6, 9AE2D6D5576D1C4722E2E3C11F5D98FF
|
||||
5: 297104DD8D, 7A245E5F5E0F4C3466E16D5EF2B96D80
|
||||
6: 7B6E9776EF05, 6B540166DE5E154D7A3A34EEA3FAD5F3
|
||||
7: 67EB1922FAB0E1, 549F39F7C3CB17F0EA6EA9C75899BD55
|
||||
8: 343E752F0F956C7F, 19CBB59CC4117DE6EB9924AB0CE2C9B9
|
||||
9: 98A25FBBD87D8C1829, 6E3D4F0ED0C5B9161EB11AE9600003F6
|
||||
10: AAA54C273F69638CFB54, 1192FCD1F9F543889F3607CD6B623AA6
|
||||
11: 51B3F33EF8B1F38438618B, 8A704F5B003A21E4033ABFCC6C53577A
|
||||
12: C7E5167D81B23F47AE90DFC8, E218F7DD222CE31642CB06C329911CD9
|
||||
13: B065DFE10B9C32F1B028AACE4F, 5EC4DE45C29C78D1CDDF2A6AC05BD53F
|
||||
14: B5AAF0ADCA03812F251C8A2BE745, AA353E20F65237279643D4CCC06150A8
|
||||
15: 88AF734661B83CBA42FF983C260B63, 8F20A5190A218B8D392ABA1295CBF905
|
||||
16: 6663AE30F79A110747D6678784330BF6, 142196DDD26668E08D196BCE0989AE01
|
||||
17: 8153816C6E9C449B0439AD7892DF8C0492, 58B376CF240C37A08337C7794736838D
|
||||
18: 1611C22134C06CF8F43625017CCC65B6E305, C0443028C8DC5FB78F9350C4A8D1D32D
|
||||
19: FD2EEDDF2B20F7623D854FF4E987DB4196AB2E, 8B2CD7C72438F3EB071A33A7C65610B3
|
||||
20: 641256A9C543D0860E609F1AABC36EAB515E29C1, 0E1A0FE82BB18BFBB3D13BEB84BA185D
|
||||
21: 437719619E96C3AD2080470809F7CDDEC3011EB6E9, E31934C5F0C2E4A04A4ED533A98C795C
|
||||
22: CF2B11E8660CC6E650EDDB2146B11F864E01B4C99DDD, 8647759347E7A4FD2CE8AC17AF4186C9
|
||||
23: F339314695B539B715A7E5FB4799029CC133CEE26A2E86, 136274C51D9797986E92F9E540A80EB1
|
||||
24: 38F843B9DA155D57166D310D85406E72FB382604C2EA4CE3, D1D7C6397599ACC2EB5CF1E06975B423
|
||||
25: 29E497528D72C2BEBB12663F71B3981705BEF60A5451FAE4F4, 50F6C796CC00FE590E5E975206045702
|
||||
26: F16F583E1FEBC78F5AB0FA61B5BC389D3C16B62ECA7C6A86BC98, B3643EA448ECA0511312895B63193516
|
||||
27: 80347C7148FE1A5B078A27B3821DDFD93341F0351F4323EFEA6632, 8AF133E83EB316E615F1BC9DF241E23F
|
||||
28: 96939F79855C211B23E45771DDA2C3AB81C2672F94B87A7FFE46FC84, 4E7DEF91D1A102667BF55922B2531E6A
|
||||
29: 4789028961FDB78E8821A1FD9AF93BDB3CAC5C75566613E148B4439E90, 470DC4389C466AE79051A62F8122A1BD
|
||||
30: 7D2030ACE87827B785D3EFA3AE5CCB3DBF3A06DE4BED2D4FAB31DBE90F58, 55437514620E6B499C4FC01445FD2828
|
||||
31: 276940205F5B869E40BBB064BB0DEF9D86D520DFCFE531A77A55AA78DE8709, F291F6A4D7EFF52E5EE47CC3ED7902B3
|
||||
32: A75FCDC9F4E38C02E70D885353F5E3E7E13A14237D75EFA0D53B0C808EAF10AE, CABDB90052202C4EC777936B6097320F
|
||||
|
||||
CCM-anubis (16 byte key)
|
||||
0: , C85F41475E06F25682F855C3D45A6523
|
||||
1: 25, 437BD73ECB8CFFAD9B2876F08D4BDA36
|
||||
2: 5ADC, 5C762058A5EF71278B69F567F18CBE51
|
||||
3: 95E541, DF099E8218AEDE8087791B38298334E9
|
||||
4: 2DAA84E4, 7437094198E4AD2647C2618248769A26
|
||||
5: B9641C5855, 91B02EC44D22460BFF22BB40C799E20C
|
||||
6: 102012BCEFA5, E60488DA65D683182F0EFDF9DA52A78C
|
||||
7: 8F14972CA4F8EA, C26B51F20ACDEC7DCA911500CF1241ED
|
||||
8: ED2714B652972256, 8BA29459D5D370FC608EE362B55B7633
|
||||
9: BF58A269A4F59CE0A4, D69080820F836E5B5CA8F393E61ED009
|
||||
10: 44AF1F715ADAF26C6EF0, FEFBC7DB75ECDDBA4A13CBF9A57873D8
|
||||
11: 77CDE1B951F0803893642D, FBF8B80B061703504D8D3A7718366B6E
|
||||
12: DE599BAAC9D3EFD9FCD47E44, F636EC35D172D661F01746FF86688B95
|
||||
13: A792B8359050C4866572977415, AE67D4EED92E63A14003FBC936EEF43E
|
||||
14: 62D5A7A4DFB78A175831627987CB, 25F7B440DBE9902C28B28E50BF02C516
|
||||
15: B6F289459F924C76586F4EEA0C1CAA, 54266B4424C3AF6E81F6CC4F2437F54E
|
||||
16: 884B7DF3395F063DCA26BDF9F2FEF4EA, E3C2BFA1964EFDF78FDB9559C8031C50
|
||||
17: 774962377B8731F2F301B930487518801F, F35B54264711D843D23636BA6CFA3E4C
|
||||
18: E9C8D1164F2B196C7305406179B232E45F1F, 2A13E034A136EBC0ED3361737EAD214C
|
||||
19: D3DCD242C952C5589E00B65CD826CA87691B8F, 9D624D482042798DB896B55D801EAD98
|
||||
20: 57065B2655D4799C0478FE7E8463A2215E758875, C8FB052F14F9DF6731A9C8B566E71D53
|
||||
21: FF736FDBD23593D9BC9A0D8CA7D819F550EF969322, 5CC3023029790BFD43204B27D52D7D7E
|
||||
22: C562B7387B8F1D3DBA22DD1636C9C4AB443F2FF15F70, 195C928EAF88BB4ACBA8A01B4EBAEE6E
|
||||
23: D0AC6EA8A804DC261304D4821E6AD7FCC2F0DC1A299B9A, 34FE2034CCF09A98DD50581DA8BCBE39
|
||||
24: B65933A7D7C8EF19C1BDEAABE2B4CE5E821459D953565EF8, 42B20EF142EB228803D6AF47C6482BEB
|
||||
25: F1F4FCE842EFEF563F6F047956E6706DC9B178D00D82776D74, 3ECE3050D8C80319821D5F57A7CA7066
|
||||
26: 4A3F10F4E34210A5CA1B81AD4269CBC3FD68AC662BF0E9DC9935, 0BC0724AA9A194D8C75EE6FC8E7F28F1
|
||||
27: 077F3C055303FD669BC1A370B18AA7F31D3C8CBFF5A69381404FBB, 872C7946401BE70E677B79EA13FB0F58
|
||||
28: FD39D32B27FE5BB8E6512C642D490E0AD0866E386580AE115C85ED2B, EE81712EA57DD54DDEE98EAB3285E6EE
|
||||
29: B45ED179290A6064188AFF6B722B37F8C3E984EC37AB5F47B353229B12, 186B3AD0C9F60D57E84992CBB2B0F71B
|
||||
30: 83FF1FD179D518A414148C15BE566BE4CC3DBE9FF5319A651E862811F152, 4B2942C66565EB9139A83C2EFD549D55
|
||||
31: B8176469E6A0D5797ED6421A871FEECDE48ACF011E394981C43AC917E8FFD5, E9B01383DB1A32E6126BD802A6C6F47E
|
||||
32: AB6A0AA29B687D05735167D78DB697BA2478BD14ECD059AE9D1239E7F2AB48FD, A560A30FD87CF28BA66F5B2638567E4B
|
||||
|
||||
CCM-seed (16 byte key)
|
||||
0: , 960414F81DF9F363AE6234067B946EA6
|
||||
1: 15, 17746EC09B06AF1DE24710D2506629CD
|
||||
2: 892C, 828705A8CF1E51688EC4F1FFAC4C151A
|
||||
3: E411A7, 1AF2DD611D05DAF48118D1E7D810C173
|
||||
4: B9DC8276, 4D335DF8B860AF121904310F5C004212
|
||||
5: 8182C84A25, B713177663D498218908178B3EA3C65E
|
||||
6: 5933E7872324, 52413BB22BABEC9E43F1A98B78B4496E
|
||||
7: A243E381075DEA, 8FF3D2D465748AAF2373D1D8F8EDCFC3
|
||||
8: 57A4E46B9B5C1795, B26653992639D54D5CEBAC7473CD3285
|
||||
9: 4D05D6669D9A0C3079, 6B26FA6D5271D74D444985466D2CF0AA
|
||||
10: 1D35BB653A9F48C3314B, 494E108B0780280DF7CB4BE24CACB5CB
|
||||
11: 9A227951B4565021D29DD4, 3E21A07540744E26424996B0670CB07A
|
||||
12: 3E893574DD3D82CCD83E87E0, 017D51F744FE95E375D0456FA8BB0EC9
|
||||
13: 5DF04297D842B3CEFCF93F5B95, 49CCE7A12C85648BD2A07944623C81AC
|
||||
14: 27F7D25EDE3471AAE1B91BBAEAD0, A6F1DD19DF08160D982184A414247B8B
|
||||
15: 6F8583E5B88B15F89070FB7A49383F, 4C98CC3884A2BD20AC6FA5184FB72670
|
||||
16: 5D8D511AE705860B1A55E2FDAE9581D9, 96EF02C285AFD27D2B26BCAC02EC56A0
|
||||
17: C4508E9E03DFE7C3B89192589CFD171A16, A2A4DC81E900BC5C404389BBD0B4710D
|
||||
18: 3163AE0E74B3DE3779745A82B783D882F092, A89574F7D1C2B90241A702A2C6A2AD86
|
||||
19: 2D9C64EF9D8C2E195AF05BAE747A7BF8EC6C30, 07EEB7667A539164862E472366FFAD68
|
||||
20: 03D145C9133E9108BB7A61D17880B155A56A58E6, 4F8EBC9A3F3C74EEA02099BB5AE6D456
|
||||
21: 41C20EF2D199B6C0FAD9DA02DA0296D37B23059C3A, 062AE92091F7A8CF74A8E9DAFC58BEDE
|
||||
22: 402912121F84EDB82F101195A68EF214F0A8F4DA6DC0, B35C944A4E5BA8AB60A4415B5BDF6E30
|
||||
23: 4D3F14438904F8F4F911CE729B26415F4EF819F80D2254, 2304E0373E136010B9BC6E061660D881
|
||||
24: A855C170C1E2D326D74996939C48A85EDEED2E06F97BE61A, E66F188735CDBD27F6354C260A4796BA
|
||||
25: F882B023A3B25B878073DF739A234256E4174238A30A5B5062, 3C8BEBFA98ABF880891AF2539D3A0FCF
|
||||
26: C66F850279CD23D5243CF15E6084A17C124DDDE840DFD9532954, 003202A7E393626BFF93D48207E7DE39
|
||||
27: BAC89C099A8AF633EFAFA496198DC9398DB3AAB47A8D24E2FE7D62, 32583F94ADE55278F2533ABE934CD535
|
||||
28: B9EB02F63EFB72455CFFA2799A5BFA9E0BFDE240379AA98B4D0532C8, 5D01FD2F100C003EA284A2AF55EE5934
|
||||
29: BAD5BB6B8DF316401B12B2BF36329F1D977E1FD943F594A6F4ED696194, 3D91CE3618998F3E060038D4DCAAD084
|
||||
30: 8964B7FAC865310E56DB3238E03803F3B79D095523D278D609AD34BA8B67, C57D3AA1FF71636CC7497DF3CB4F7B71
|
||||
31: F83C35D61E5C48CC7C402C9C78758D0DC696D2708FBC5294879DBF700BAF75, C69997844AB43312C90E995AD8C91E58
|
||||
32: 03CA8E42B89C0AEEF0B7A364E94E326C537AFC4392AED3E6DA71EE65032A5CDB, E8DCD9120DE61900A194E8B94AEF6B2B
|
||||
|
||||
CCM-camellia (16 byte key)
|
||||
0: , 3B53D5CC8B26A5FFC78D2E974E45A661
|
||||
1: 5B, ED7741D8C258D56A29392A7A65CF147D
|
||||
2: 9396, AEC9E6690624A94E9ED39A0507C32277
|
||||
3: 7D7DDB, E7D4B50F856F78EAFCCD6B91CA985AFE
|
||||
4: 1DE036A3, 4F519237C8534508140174DD3F5D5E10
|
||||
5: 9BD3C8B888, 760CADF4D2722C52BE28D89F9F1BEAAC
|
||||
6: CA4252105A3D, 675B4D6953136E0691C3FE174381C231
|
||||
7: EFF8ABC8F5CFA0, DDECDDF8FAE2BCAE971003D05A86024C
|
||||
8: D155E0590C4DC889, 08EFED0B6FA5C0EB64B7900229EA41DC
|
||||
9: 50AC40B4A083BEBF21, 14DABECF5CDBBB8F0AF3E7DDC034DAC6
|
||||
10: 1C5442AF9F2D491BE911, FD19818919D55FD80BCC9EBA0A108920
|
||||
11: 85A748561995A968CC9124, 69F769B8EA2BE927DADD209300752181
|
||||
12: 2F0838A1C593A629C1AE9032, 4C8AB614BCF4F7988EB4B93E1DC48EE2
|
||||
13: F19EE633F8B5E323904469D5C3, F82B28464B4BF73C39B332814E1672EF
|
||||
14: D6DBE7D82D4C99830FA1A6245125, 94D9EDF12A4A4EE357B647184EACC01B
|
||||
15: E8D02CBECEAD690DDFC1E48EE16B1F, 2D1355394CD62544D8840302715862D8
|
||||
16: 74C395F0C833ECB858F6D09C097192C4, 9079E949C4081B348259080AA0AAD85B
|
||||
17: ECB27927C303ABE439BCD9F9D4E87D5674, 726E8E755398A30E930F2159B510DD8B
|
||||
18: 86593B1148EF7D5B446AA3AD22001CB66CB5, 63B0D269B586B9C887584498FF61D8BA
|
||||
19: 0373123872929AAF354B085FCEAB74DD2D28E4, 5FE2491F2603E474D15500DB2E32481D
|
||||
20: 3EA3D8DC013F2A6E42BFCCEE51BBFCEDD194BA40, 5667BD5212E31F02C8D8B94FAB5A9DEF
|
||||
21: 5ACC89A28DB162595FD55D63ED2C5B48976E0BA0E9, A52EDC5A3AB7B070B755DBB008D99787
|
||||
22: 381266462C783DF3B5F3F3570611D6E0A61ABDFF7BA5, C79D371D81511D85D7B54B686AADFAFD
|
||||
23: 8819DDC964172B3BE049CCBABCF5AA7EDB50BD90E871F4, 45561AD598EB2DB8F7825878786B2CED
|
||||
24: F514E9F64E90197728E2D061443ED006F2CF2236EC2E65CF, 0C47214A73F6CEAEC1C96FE859C519E1
|
||||
25: 3B965F16101777CF84C85AD864701BCDD617681B92944386AD, ECBE6B6BA145D10FE0D5042A5F04BB68
|
||||
26: B573EB75A48CB8F56163A55DFB870017E06940D799ECCECE7C2C, 63A7C16D33F6ECA72B2B33C6FFF4F13D
|
||||
27: 47A3A96928BC9B28E22C3AF1999A30E271806BD3E6C8FAA4D82D62, 25E319011BA2F72BF7447C8EB36BBD01
|
||||
28: 0E873D38B34A0857FB82BF278AE07AEF9A4B378A8300CDD96C5BDE34, 6045114D75AE7681C91E5BC508E2398B
|
||||
29: FF33B9683538014DCF4F7D78CF7126FB43448BF9883D69B824019B05FB, 28AD47D363A7F9A4653C6685F90C2971
|
||||
30: 58005BF96E194411DF808DB3A6D405CA241986486160313AD092026A0A54, 7D8A8C8E8AB6ACE7312D82146219F37B
|
||||
31: 20C3DFE512F4EC1F17973BBB164E9F1B77CC3EB37B486119614764F4C7D0E2, 57CEB0625D34AD40935B03C54A1B8779
|
||||
32: 913F8D366D4C2AC10ACB3196CCBDB5F436CFA92377045EB3A1C066F6ED7DE0E9, F48C8BB647E719049DB38C39EF779CE2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,569 +0,0 @@
|
||||
EAX Test Vectors. Uses the 00010203...NN-1 pattern for header/nonce/plaintext/key. The outputs
|
||||
are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous
|
||||
step repeated sufficiently.
|
||||
|
||||
EAX-aes (16 byte key)
|
||||
0: , 9AD07E7DBFF301F505DE596B9615DFFF
|
||||
1: 47, 57C4AC75A42D05260AFA093ACD4499ED
|
||||
2: C4E2, 26C5AB00325306772E6F6E4C8093F3D2
|
||||
3: 16177B, 852260F91F27898D4FC176E311F6E1D1
|
||||
4: F09F68BE, 700766CA231643B5D60C3B91B1B700C1
|
||||
5: 8472705EDF, AC4C3359326EEA4CF71FC03E0E0292F2
|
||||
6: 14C25EB5FD0D, 8DBD749CA79CCF11C1B370F8C975858C
|
||||
7: F6A37F60670A85, AFBD1D5921557187504ADE61014C9622
|
||||
8: 1AACFEAE8FBAD833, 82F477325D6F76BB81940AE25F9801C2
|
||||
9: 069414324EC293697C, B980E21C09CA129B69E9032D980A9DC5
|
||||
10: D8174DE9A2FC92B7DA9C, 1E42CC58BA2C8BFD83806444EA29DB61
|
||||
11: 2C087DEA30F8B7EE510990, 83DB400A080C4D43CAA6EC3F1085A923
|
||||
12: F36B93C272A703D3422C6A11, 1370C3AF2F3392916364BBBCC2C62EC1
|
||||
13: A0F33477BAE2E28E6747AA3193, B626DC719528CAC65DB0EF94E35422CE
|
||||
14: FCF5193506052E8BFA095C1A5205, F5BD02E0B3C91CC7D6FAAA8A9A76CE6A
|
||||
15: 3797D7F8599B8EEAB39C56241880DC, 0B70003E77146B903F06EF294FECD517
|
||||
16: C4BAD0E0356FFD369110C048D45D81BE, DE7C2B1D83BE2CC8EA402ABE1038BB79
|
||||
17: AF5C358BD31CDCAC2F0EA5252F1C3BE1E4, 2D700986F93B22DFE6695C2A243B4E42
|
||||
18: 7DEF9056FBDAF491D7206B26B19DEF617AA1, E71A7D00BE972D85C77931D7591B2151
|
||||
19: 6E9B2C0A90BF9D38A6EA3B5D2B9B2D97F938EB, 5B483D7F15C39602C2918181E57DA341
|
||||
20: 7C5F68DEE9BBA3B04F11D5FC7C9C7FE6E8B5025C, 0AE6A12D37A9C10BB1A494E16705DC05
|
||||
21: AF0A886BF673BC72045FC074F06A0176C96105E2E6, 06B2DC9A2868C23F86D710E01E37E07B
|
||||
22: 5F228A986DFE4301EDBAF07A02E114F1B30932995CD1, 74EBF68627C78B1FD024A59B56B2A8FA
|
||||
23: 911322F60555118CBECD8DD82F186AC19514316E8D48BA, B6A8BAF2F175CD0C71B63B1EF37E185E
|
||||
24: E7F52730CFB808EFDB376A5D5DF31A7EF8292DC5FC37E9BC, BA2AD158A2D2E5CE01296402B592E1DB
|
||||
25: B3F8D7CA47D8D86E94D670AFBAFA3B8D9E186C97DC029D4705, 709D2D2B9975D4729C19D4EAC430E65E
|
||||
26: 7178FEC027AFADDC2C03518E75CF34D207CAC2EB1537A0DBA520, A315F034CE5E66601444402520F55DE2
|
||||
27: FC230B2B8522F53459D0B968421469BBA7E683ACB0190393B2870F, 48679A78E470E175CF3D3E9B46CEDFCE
|
||||
28: 35A641127C78C721ECDC50866C21637FDC9515E41CE60F09015EA713, 0062987222F6412B7AAF8A9ABF6FBF98
|
||||
29: 3D42D6C113421743C08A6F682CFA0E517D5531BB66241C02EC4DCC26F7, B1AAFE11FA2D6E0C870177DDD7F98FF0
|
||||
30: DAD065B4669B7C59C8392D8E7BD7E64BC01CEFFF27E335B25A328D356F0E, 8973B9B9ECF26DAB58CCF0787EE928E5
|
||||
31: EBE626F9E241FD233D9781C359430C982667AA26921B62E98FAEC502C01B0B, 2AC0D7052A2CDCCE8E26FEA7595198AA
|
||||
32: 64D842B66796A797C2B4C6905742FDF2148FFC445E192F9E03B53810C082F788, 9778B345EC12D222DCC6DBABD2651750
|
||||
|
||||
EAX-blowfish (8 byte key)
|
||||
0: , D8C4C23A6AC0B7B7
|
||||
1: 2A, 5E0E4BDDB60772FB
|
||||
2: 7695, 7581B16CCC9C45F1
|
||||
3: EB14C8, 6223A121CFA216C7
|
||||
4: 5A5C809C, 4A47658796337D6A
|
||||
5: 8BC2041181, E1FBA8DBA00571FC
|
||||
6: 89C666F015FA, 2B4A76A0E699FCFE
|
||||
7: 86C1FA92484AF6, 31B3B738A261D6F5
|
||||
8: D1F401C145C9328B, 4C4A045EB489F59C
|
||||
9: 70C9C7753698324A73, AB298B5B20567EB4
|
||||
10: A50D9D88DC101B6DC8D2, 529DFCBFD13B8E6C
|
||||
11: 7CC2885C2BE79C44F28FF2, 566255022B40C81C
|
||||
12: 6902D58347C29250EE07981C, 34619AF18E14C690
|
||||
13: AB6C3C4AD3EC45143392B642DA, E6D2DD323DA175BB
|
||||
14: 7065B28BA8AB67B2FB7B6D5E3FAF, AEDCAA54F4B0772F
|
||||
15: CBBA14A74AD4ADC0EF036EDAE42D51, F2BFFA4D81BAC034
|
||||
16: 60A315193F58144F5701D547C79FEEED, 912FDBDB05467DF5
|
||||
|
||||
EAX-xtea (16 byte key)
|
||||
0: , A04FAC8D0416F081
|
||||
1: 5E, F95DAA99F8FE28E9
|
||||
2: B6A7, E2A05E1F1E6D17B5
|
||||
3: 27D698, CCC0CC54F40DA243
|
||||
4: C2E81CCC, 283AB8F109D287ED
|
||||
5: 51B99DF694, A9637DB356B4BC0C
|
||||
6: C2ED3E79A4F2, 413D3A65FFE803BA
|
||||
7: 40E35BE6CA019C, 1B68833B90E4E026
|
||||
8: C246C2B5ACEBEB08, 50CFEB01DEC3BB1F
|
||||
9: 35E2F7AAB57842D50F, 617804483BFFCA9D
|
||||
10: 2F855AB7A4664958300D, 6F054767FE484664
|
||||
11: 2824A5486D1B621D0F992A, 238566B9F56ECAB1
|
||||
12: BF5C121A6144AA0CC05A380E, 63F4DA4B898FB2A8
|
||||
13: 2EB53E8A4698EDEBB990FC65E6, 7DFFE0E43187D10C
|
||||
14: 85F77FD150C6649F5826AD45D50D, AA660F37975768FC
|
||||
15: 8B4EB3750814EE7E8FC6B97B3ED1ED, F79545FB1F1C389B
|
||||
16: 980EB7FCEEE37558BEDA0E938325F608, 2FAA9235BFA3EA30
|
||||
|
||||
EAX-rc5 (8 byte key)
|
||||
0: , 169C7954341EF44D
|
||||
1: 22, DABFDA9A0B0BA067
|
||||
2: 2E54, 6A3D6D9AA5877C5A
|
||||
3: 2A6ECF, 2A34A3AF5DE8919E
|
||||
4: 9CC5F84F, D3F673EDAF75E3B5
|
||||
5: FF5611756C, CC647FAAC8D49BF1
|
||||
6: 74C939BEB31C, C335999CCFE8F5FA
|
||||
7: 7976B6F7709B5F, 2A7969C5FD063A88
|
||||
8: 421EEC5022276174, 2C9BFB1EAC3C54A2
|
||||
9: 6A4761CD266B1C0ECB, 3EA3CCEBC85FAC4E
|
||||
10: 7C09201098E764239A2E, 8043ABA9BF4D5AEE
|
||||
11: 8CE26277562F646DE33C88, D72AED48895E3B40
|
||||
12: 52150F44D37D121560DA87F6, 58E865E22B485906
|
||||
13: BA0A73B45F93ECFBFC3AB3D8D0, 683D52FA47FB1A52
|
||||
14: 96546CBE01054AD24CC95DB54724, D80D0D530E5D1DDE
|
||||
15: 61E654BB18CD26FC36C09F874DC2C7, C65884CB9D9FEC1E
|
||||
16: 1D77B8BF02CDEAB4A707C07628826D5B, F18D1730C3D64701
|
||||
|
||||
EAX-rc6 (16 byte key)
|
||||
0: , 1DF8B0B92A3F0C951C425AF4830E63FD
|
||||
1: 1A, 8A2959EBBE90180999994DEB7036DB85
|
||||
2: 435D, 7EF00CB57DB7B4155DB530D75CE6B025
|
||||
3: 08A6CF, 2ED6AF0F2D5BAB05F623D389480A01F2
|
||||
4: A86E54D3, FC69547C8BD922A5BF2F7B26C4D20F98
|
||||
5: ED0822E439, 0007A3C6DEFC6C912C0E5B853B520368
|
||||
6: 7BEFC7FD4054, D32C43A4D1086D57C5BCFAEE04EBC600
|
||||
7: 5235E58E79287C, A27E9C781327C0FC7C55410EB0C828A9
|
||||
8: CEB5EE99BE521F4D, 547F46383987F2A3582A81A3BCF9B280
|
||||
9: 0358B063D5F99C3770, C0A73730512CDA6AD49599775D59EDA1
|
||||
10: 434B9AEE07DFADD0A332, 499BD88881E558E09A8E822BE27D2496
|
||||
11: D47849E650F350BB622D74, 638E37A84E7FAAF8F5D77F1B061773DC
|
||||
12: 814592F568284085E79A024B, 9EB1405E8422FE50BC0D88D837A2C650
|
||||
13: 6F2B55EC91B591082053AF692E, C48F91EF01AA43A1EE3B36D233DDD48B
|
||||
14: 506CBDD2901838EE2F178B6953DA, 03778957F536509BFCA577B23A18F726
|
||||
15: 446EE435D3D1848B51BB8C5F7BE4A1, 1129EAEAADE534940546D43242A4C839
|
||||
16: FB9D2B150C42465B1685D8F069CC06DB, 41E2940F5DC63CB4E2FBEC25ED8A31E6
|
||||
17: 9684F683260107BE8FEBBEE1D3EEDAA7BD, BAE7C116F7FF96631F4ACEE95C65CEF3
|
||||
18: 5082B1FE48CD3AB58F63C2DCFDD4069AC736, 19AC7B8EE315CBB7131A283851B32266
|
||||
19: 8C72AE495B6F003A3C784D144E84E88885F78E, FA4CEC023740A8D670E351FBCF62C1CB
|
||||
20: 815D6361C7AE34C9D796ADF9C71ABC46AEF88BC9, 9A1F7288C61A6623B9A82748137ED7CC
|
||||
21: 904A853E2E96BD2B85AAB3F5DFB900E9B3642EE667, 9AA90DBDD461CAD20495DCFBCB513DD2
|
||||
22: 79D738A462F727B3D3C529ED999B6FDCCD991D1C5A4D, BF0987BEDDE650D73CAE7D380FED3431
|
||||
23: B2DEFDB7D503A84E83155A04B8DE8C8DBB68C2FC475007, B7CE900CF43CD518024123C76F6DA328
|
||||
24: 9E723E15439E12F6C46DF8A309AE1E97B6FD18436259CFB0, DF8B6E1E23512CC4CF5FF531A1908F69
|
||||
25: A7F0AD03CEBCC9202718AA164886E1026975306A664C5AC7A9, 4A771BF8B9A4325705C85E5499FD98E9
|
||||
26: A53A92AD1C6835F28E04EF591E783D36F3D76E489B31B87BEB7A, AA263B52A6E6A043DE4D7029D4DC73F5
|
||||
27: 79BE3C38291A7F77E932C8A9DEAC08DE6442EA9B3895B101A14E7B, 33B84DE06342E675E019CD0237292ED0
|
||||
28: FA108123C5A69571CFDFE8C3D00535121FDE3096DDC0D700F8F26A5A, 764025D7CA1A3F2C54D28956423B0C77
|
||||
29: 36EC2D67FD977BD2B73DB6D8EB756B3EADA13690E1B6DFC12A4781B34B, 4BC6B38DE3B02283D92F4DF19A5C48C5
|
||||
30: 96D3243C945905C9732B5927E46F00886D511463B38C86002FC26B65AB8C, 5B5511CDEC35687AB8425AB22D58B4F1
|
||||
31: 9CF83B87BEA3374AF7722E999863E3DABB858B0383383EAC7757F5B80FD44B, 1E0CBC961940FDA93B73A92DACFD67F3
|
||||
32: CE3BC3C9FA5EF4AFE5272B3EDD24B1B003FED2C2E501528CFF44D3FABFF52CB4, DC94FDDC78AAB2B7CAA1E1EF149AC355
|
||||
|
||||
EAX-safer+ (16 byte key)
|
||||
0: , B120C7B37450C46189712E4DFD1F0C44
|
||||
1: CA, 82BA1869C5FF1EF2A4F6ADC1E7DC1F1D
|
||||
2: DD20, 6BD5601B16C9943A84AC1F99A176E6D1
|
||||
3: C1C09F, 0911DC63AA414C004E2BD825BECDC93B
|
||||
4: 27E43F59, BD858F084B082F76814DC385E1FB20D1
|
||||
5: 2A9A92F246, 5ADC4A32491934AC0BD00FCE686B26F1
|
||||
6: 52C78C0CD6F4, F35886F46C03EDCA10B3D01CF07B1E0A
|
||||
7: 23E0D3CED3795F, FE33D96FC98B78A30C0A412C60E93992
|
||||
8: CD3FC9961559F239, 9982364A61609FC41068260267231EE9
|
||||
9: 6EA46CB7AD7505C1BC, BB15053EF0F78B9091B3064118F3E9BF
|
||||
10: 05D9BA230A56CCA0703A, 1338E68E3DC992B6EB2685C668E75869
|
||||
11: 7AAD6049DFDCA6771AE42B, 35267E431051E1812495615324C4CBE6
|
||||
12: 8695091532B83B23C296F620, 7B2EEA861E9A91E6B6A911E10FC3FDD1
|
||||
13: D909DA4BC7372ACAEA78E6A0EE, EA6C1CD16180DF0B07F4E204A4B4FACB
|
||||
14: 7DEC8443600D0563AEFE87A2064F, DA454728069B3B409889664783588189
|
||||
15: C042FE656742CD2FE5D9C212D18C6C, 5929E4AECC2CA047BAE948E7023FE4D0
|
||||
16: 0B84D3CF59EEF7319633F4A397D47CF8, 31F892FFDB7535DF5D9143456E404163
|
||||
17: 8C9E57AAFA7969B142742B63AB73286600, C418231C44F96660DDBA8C26B3BB3681
|
||||
18: E9EED66D370A3A6A39C7E0E570D96F807EAC, A4AFE8D1D3C31B956A3BDBD043E7A665
|
||||
19: 1A5D47992DA5597D1449B4C8DD47B7404C7657, F3ECEE5182014FC3365FDBC4C33CC06A
|
||||
20: E7C7945FD1AFD3F5DCE666D8A5A2E8A3C11A7A5F, 86D78B2FBA7597B8806BED505B52BDF6
|
||||
21: 9E2165B47B29CBC4ACD50660E011D691F061209969, E9B1E860BD02085177E1A94E1EE6F3F0
|
||||
22: 48EA2945C8DD3FE09407BAC8973A861DB15B788C8FFD, 502926712EDB1B3DD13806052C6C75D7
|
||||
23: F37D46B35B60819EA52B00457D79155C04B55972D0DFA9, BB2B7D210BF0570F422640BF81F39B9E
|
||||
24: 12E85C0C78227205CC682360C79E35BF58EC6551CF8FE2D0, 042990D7A58D458C570A15DD375DB4E7
|
||||
25: 4F6C15109DE980DD14A7F4C27F48671E4787C53A564232F427, B097A5990D8067DD89C21473150C070F
|
||||
26: AAC472E49DB101B564A8A01E2C80C0C6AE9065D332C2DE79FAB6, ACDD587A7DB86542E195DF73AF1C1CBC
|
||||
27: B9912CE18019C31692A1F7E11D9CCB20297ACCB9DC62C47C01D2C2, B0ACBF028CA5B15E0035D2EB8CA916BE
|
||||
28: B4F2B1FE14A1ECDC9C8EA1A0120395E6ED1E69D3FC85DD0F3F90F350, 9A561EBC769369B95B9CB74FC6AC27D3
|
||||
29: 3FE397C8AD02689B7437A37861F0907AF1F6014A293B46419348771C5A, 6B7BEB9BD5018FECD71BE5081C7C2544
|
||||
30: 5019089142199F7207E1B7731B8B247A18A685B231499DF12A73F5D67D37, 307E93446777005BA1B088F178A0DB6E
|
||||
31: EAE8F9F02F8DB3D70B78B08CFB0949D99F1A86C958A8E3823736BCEAB86BE1, 6C94F48591C18BF9C450515B73379973
|
||||
32: B9C795F7A87305B4AD36DBA10B3B1C70B329D29E49C8C6A932D96A74334AEE4A, D18E6E233FEFD6E5C7148BDC1504299C
|
||||
|
||||
EAX-twofish (16 byte key)
|
||||
0: , DB0C02CB069E3773296D3BD4A87A381B
|
||||
1: 99, 7D21D19E9C440F68E99F1F2EA2668694
|
||||
2: 0696, EA590EC417C88E23FD23917F9ECFB0C6
|
||||
3: B9B082, 82D4C9B68DDB02C906496413E13A2D68
|
||||
4: D6B29D74, 5BCE5CA4F662E883BF7FCAAE5FB2CE01
|
||||
5: A59C9CB009, CBFB04226D1029A7EC9D64A48A6729BE
|
||||
6: F4924FE3E355, 3D85B3900DECA0528C815F1447A1F209
|
||||
7: 679C88D52FB519, 931C7A863C3701D8015FDBD8696C6C30
|
||||
8: 26DA41C0D115375E, 7627E23E791A4DCB0FA5ED71B1ED2288
|
||||
9: 8FEC6EB7016AD2B178, F65ED0286A724F0CB2EA317D5022B0D8
|
||||
10: B5F22415B1334133C531, 87C4F3A8991BBB85984BC4D3305A5CF1
|
||||
11: 23E1D0ED2E820AFE7DA2FE, 100499F1093FAB2ECF73B643594E98E3
|
||||
12: 79519ABA91F46B8DAD6D5335, FBDCD1FCDB20AB99135F28A714C6992F
|
||||
13: 5968D0B4198A0AAD3D0395018F, 781F22E2DA98F83398FCF911B2010057
|
||||
14: 4E55B14432B601E3EF2EF567CB15, 8BF6E53D7657E56EA3DA1BFD9C9EC06E
|
||||
15: 6ED89651CE19B3DD1EE5C8780B5015, 131CFD657D32D4E1B35140ADDCA0E13A
|
||||
16: 2295A968B4D072D12757756247554850, F35FAC95C2AA4155450EAAA6E2E789B5
|
||||
17: F9B2AA2AA502EA79BBA0C5EAD932B8E1EE, 0ED81AA40B9BF39A9AAEDDDB7A04BEA6
|
||||
18: 385055F1C1C26C0472A504B4CD225DCA55FE, 24831680B56368231AC54227D737F582
|
||||
19: 771529585C741A3F8B1C973709892F255A99EE, 2A132B4BF96FD5109DB04459103F5E84
|
||||
20: E7A2197D9FAA8AB8B303B5EC71AE34AD5EC5DD66, CCAB6518371EC8E0A9E9EE4F7CA5878B
|
||||
21: 279E54F755EAC6B57375B9EC4406E43DB3139D740C, 7B6F26F2C0ECC9F2DF4EDD7513E6E0B7
|
||||
22: 27816AA94CBA2BF98E49E595AF5B3FAD12BF1D6F1AC6, D04876C5492D275F15C834E3CF794F0E
|
||||
23: B5658DC148855F68B282211D879F688F3C142FE555CF81, 4539CDA8A65DB9047AAD76B421B81120
|
||||
24: 72F0BD4F939C2C9B4FA734DCB0AE4FB9BD342BC8459ED2FE, CEA8469BC0457EBF3418C1114288C904
|
||||
25: 70568245E6E6BD5D11AD0C74030D7AE08BA05057DEA0FBF4AD, 71554FDE6B87477A51EE4499D78783D2
|
||||
26: 8702D35BE07D7ADF70684046CC6C72FBBBF821E0BBCCBC973601, 33CC6FBFDA15E306919E0C3BB2E22BB6
|
||||
27: 0BA23F4A6174165D4A8BA80B7C875340B0F8B2A6967D34E106BC22, 00E6679496714236EECEC84B9AF3072E
|
||||
28: B9E25ABA84C6BD95B5149E7616FE2E1D6FAACEAAD77A636C60279176, 8D8AD0B9D4C709E1DA370EE01611482A
|
||||
29: 74759711F6D542581F9F83498FB616638D092732BA07109BF4B5BE045C, 71A40DC777BD09F75362F7B20E0B7576
|
||||
30: ADBF7E98926484BA2C7F6CD7CD9734FC19265F68AF3BFCAEB025F6296E37, 8DF15B5F69B67F7DABE44E3666B55047
|
||||
31: 2DC26D449379997D110309B2A0DC2760FCE8CADB4B14ED580F86C70F69C9BA, EFCB60EB2B25737E256BC76700B198EF
|
||||
32: 2B1890EB9FC0B8293E45D42D2126F4072754AA54E220C853C5F20FBA86BE0795, 1A1B15BBC287372FB9AF035FB124B6A1
|
||||
|
||||
EAX-safer-k64 (8 byte key)
|
||||
0: , 9065118C8F6F7842
|
||||
1: A1, 1926B3F5112C33BA
|
||||
2: 2E9A, 5FA6078A0AA7B7C8
|
||||
3: 56FCE2, 984E385F9441FEC8
|
||||
4: C33ACE8A, 24AC1CBBCCD0D00A
|
||||
5: 24307E196B, DD2D52EFCA571B68
|
||||
6: 31471EAA5155, EB41C2B36FAAA774
|
||||
7: 03D397F6CFFF62, 7DFBC8485C8B169B
|
||||
8: 8FA39E282C21B5B2, 2C7EC769966B36D7
|
||||
9: FEA5402D9A8BE34946, A058E165B5FFB556
|
||||
10: 6CDEF76554CA845193F0, FED516001FFE039A
|
||||
11: DC50D19E98463543D94820, 8F9CCF32394498A1
|
||||
12: 42D8DC34F1974FB4EB2535D7, 77F648526BCBB5AF
|
||||
13: B75F1299EF6211A6318F6A8EAA, C5086AEA1BE7640B
|
||||
14: 1E28D68373330829DD1FFC5D083E, 33EDA06A7B5929A2
|
||||
15: 85529CF87C4706751B0D47CC89CEA6, D031905D6141CBED
|
||||
16: FE5CB61BAF93B30ED3C296EE85F51864, CC484888F0ABD922
|
||||
|
||||
EAX-safer-sk64 (8 byte key)
|
||||
0: , 5254AB3079CDCB78
|
||||
1: 75, 798DCF14FEF8F4D1
|
||||
2: 0300, D5FCA75DAC97849C
|
||||
3: 520F98, 10E357957CE20898
|
||||
4: 80E2764D, 5C7F46656C6A46EA
|
||||
5: C48960CDAA, 3CCF44BD41F01CA8
|
||||
6: E0E60BD9AA2C, EBB493983FCEE79D
|
||||
7: D13D8804906A1B, 6EDDCA919978F0B6
|
||||
8: B7AE14C37A343BFB, 2369E38A9B686747
|
||||
9: 5DE326BBCC7D0D35E9, 041E5EE8568E941C
|
||||
10: 13494F5B0635BA3D6E53, EAEEA8AFA55141DD
|
||||
11: A9BB35B14C831FDA0D83F7, 4002A696F1363987
|
||||
12: E242043A1C355409819FABFC, 63A085B8886C5FDC
|
||||
13: 204598B889272C6FE694BDBB4D, 194A1530138EFECE
|
||||
14: EE3F39E0823A82615679C664DEBF, 1EFF8134C8BEFB3A
|
||||
15: 8579D87FD3B5E2780BC229665F1D1B, A832CD3E1C1C2289
|
||||
16: 74D7290D72DA67C4A9EAD434AE3A0A85, 96BAA615A5253CB5
|
||||
|
||||
EAX-safer-k128 (16 byte key)
|
||||
0: , 7E32E3F943777EE7
|
||||
1: D1, BA00336F561731A7
|
||||
2: F6D7, 8E3862846CD1F482
|
||||
3: 5323B5, BD1B8C27B061969B
|
||||
4: A3EC3416, 170BBB9CE17D1D62
|
||||
5: 0C74D66716, 7BD024B890C5CE01
|
||||
6: 6158A630EB37, B5C5BD0652ACB712
|
||||
7: 17F2D0E019947D, F9FF81E2638EC21C
|
||||
8: 68E135CC154509C8, AA9EAEF8426886AA
|
||||
9: EDB1ABE0B486749C21, 355C99E4651C0400
|
||||
10: DB0C30E9367A72E8F5B2, 631B5671B8A1DB9A
|
||||
11: D4E5453D9A4C9DB5170FCE, 75A2DF0042E14D82
|
||||
12: 3F429CC9A550CBDA44107AA7, 2C2977EA13FEBD45
|
||||
13: A7CA22A97C2361171B415E7083, BFE81185F31727A8
|
||||
14: 170F79D8B0E3F77299C44208C5B1, D5ED9F9459DF9C22
|
||||
15: 2E24312D2AE5D5F09D5410900A4BBA, 2FC865CA96EA5A7E
|
||||
16: 8F3C49A316BA27067FF2C6D99EC8C846, 9D840F40CDB62E4B
|
||||
|
||||
EAX-safer-sk128 (16 byte key)
|
||||
0: , 22D90A75BBA5F298
|
||||
1: 3F, 98C31AB2DE61DE82
|
||||
2: 584D, F4701D4A1A09928C
|
||||
3: B9DEAD, 6E221A98505153DA
|
||||
4: 06D4A6EB, 0E57C51B96BA13B6
|
||||
5: 7B58B441CA, E28CCF271F5D0A29
|
||||
6: 7950E0D1EC24, 2ACDDE6E38180C07
|
||||
7: 65A4F4E098D7C6, 7DC1C9E9602BACF2
|
||||
8: FEBE4E72BAA0848F, C4607EA3F138BAD9
|
||||
9: 9B7BD6D6D655985AA3, 8B2C58A9530EA6AC
|
||||
10: 60C92F925D1478470203, 51E6F5F6DC996F84
|
||||
11: 7B40769370E651F64AA654, 74F1F8A8D3F4B9AF
|
||||
12: 7215832C2FB9C54DF7A9C686, 9BF9AEF14F9151D1
|
||||
13: AD0F9C79008572AB8AE2466EFF, F375D0583D921B69
|
||||
14: C05076E2C330A0D25D7CEC80597F, 843C12F84B00A8E0
|
||||
15: D18F0563AB0278140B0CD9A9B07B34, 262B1688E16A171E
|
||||
16: 650747091F5C532EE37D2D78EE1EC605, 1BAC36144F9A0E8D
|
||||
|
||||
EAX-rc2 (8 byte key)
|
||||
0: , D6CC8632EEE0F46B
|
||||
1: 4C, EA19572CB8970CB4
|
||||
2: 5537, 3EDD3253F6D0C1A8
|
||||
3: 206FA6, 20FA88F03F240D31
|
||||
4: 17EE8B40, 702E8194F1FCBFDE
|
||||
5: 2A89287136, 31C5534786E15FB3
|
||||
6: 3A6AEDC7066B, 3C663A4081E1D243
|
||||
7: 8BC5203947A644, 6AAC806C92BFBD6E
|
||||
8: 2E0274BBE14D21A3, CEB0E0CB73C3664C
|
||||
9: 9C4B292B0CF17E3A29, F23CD535559023EC
|
||||
10: 8E322734308F85662877, 46363D7EFC322821
|
||||
11: C413C405767FF5F98E3667, E7BA35D8F3678E7E
|
||||
12: D77806B7A218098B1569EADC, BA67C306E5C0181B
|
||||
13: 4BE5EF74F9E9799A4D636FEA9F, 4C511C44ADBA4030
|
||||
14: 7E19969170C2C8D8AEBA8C7FBC2C, 54CC6D466A2DF6DA
|
||||
15: 2EF1CEDC1DD3403CF440FC5561BE33, 61C6FB277E93701F
|
||||
16: DE052719153EBACE9D7B19F52AC4282F, 4AC2A96F2FA8634C
|
||||
|
||||
EAX-des (8 byte key)
|
||||
0: , 44048B7F240B6F5F
|
||||
1: 0A, 37009B7D4E09953A
|
||||
2: 03BA, BFD2FD7758961728
|
||||
3: 37EE10, 16A6AF96DE888A19
|
||||
4: 07F44290, 100CA84AA0EDAA1D
|
||||
5: 389EF0023B, 9614FB800A533268
|
||||
6: 3F4DBA8AA01C, EFA6B55B7ED5E40F
|
||||
7: 8C7B837896EAE7, C113CE8F664CE3D4
|
||||
8: 7011D993D8EDB0C7, B4C370A919F60497
|
||||
9: 0DEB30A31351B13D7B, 00ABC82DC5F3A1AF
|
||||
10: 8D3897B2CBE323D6EE1C, 7A2D15627CA1441B
|
||||
11: DBC002C817DEBFB419F94B, D8EB87F86D6ACDEF
|
||||
12: 17048E2976FA85AA849E9A80, 229FCD1C9D1E3B9C
|
||||
13: 30B989EF646544885A478AC198, C1B7EB4F799105C8
|
||||
14: 5C2E12A7F118A08D6FD585F9C839, C358679FEE6FE7D7
|
||||
15: 8D1A1E888BBB8648E638C4E74E11B8, 685E006C441448B8
|
||||
16: 93AE906B8BE4EAC8ED6D8F48F04A7AFF, 71DD7AF752FE28FB
|
||||
|
||||
EAX-3des (24 byte key)
|
||||
0: , 8914311BB990B725
|
||||
1: D8, 2094EDC5D03E54B1
|
||||
2: FEE5, 781CFB0EBE3895CA
|
||||
3: DECF5E, 59918E8A5C4B459B
|
||||
4: BD583AAD, 2013BEEBEEA795A1
|
||||
5: 2BC01C6C78, 0B1134DBBEAB5D3F
|
||||
6: 4D5EAF01A895, AB4D17516ECBA50A
|
||||
7: AF229F90614480, D3113C0A9D133CD4
|
||||
8: BCA6F375DF4568E0, 8E9EAEC8E77786BC
|
||||
9: 575F34219E6DD8DB4C, B40C75139E5D1860
|
||||
10: A199B8AC433B615EC96F, 774AF803698ADE3D
|
||||
11: 718A2975DD9A872A68AE10, 3B9460F849CBA7FB
|
||||
12: AB38E148180F6E2FFBB96F91, E3EE3B8FC50DADBC
|
||||
13: EB10E0233507459D4A6C29EE80, 8D90B46BB1EAB27E
|
||||
14: EB48559C320DFB056C37458E19B5, 9315F0C4AF8500EB
|
||||
15: 9E8C73EADA105749B5D8D97392EDC3, 2E749EE66C1E6A16
|
||||
16: 600FA4149AF252C87B828C780AEFF8BC, 33D7D11DCDC19936
|
||||
|
||||
EAX-cast5 (8 byte key)
|
||||
0: , 382FB8F7E9F69FDC
|
||||
1: 99, 20DA959849B3F7AB
|
||||
2: C54B, D05547C6AFA3484A
|
||||
3: 579836, AAA92B2321FC50C5
|
||||
4: FEB7AE55, 639EDF01C4FB965D
|
||||
5: EA8A6023FA, 01274B3ED5CE102C
|
||||
6: B7C4E995121F, 712BFE27CAFF6DDE
|
||||
7: F44236660B0004, FAC51D1DF8EC7093
|
||||
8: 01CD7E3D0BF29E8A, 049C47A45D868D0B
|
||||
9: DAB170493DFD6E0365, 6F3AEDD9A3ECF4FD
|
||||
10: 82C9EEC4803D9CD11FA8, 32683C0A9128C6EA
|
||||
11: 324AC59E87B244ECE0F32F, F6B095AAB49353CF
|
||||
12: DBDDAB11D02C9CA5843C406E, EA728FC46DDD3B04
|
||||
13: D67376C2A4AD92E7DD80E39303, CAF72B7E7C237EB3
|
||||
14: F2B9BBEF08036C2982C6DDD06918, 70A29D780C22752C
|
||||
15: 96E3D9141F8EBF520540C2BC9A9C23, CEFC86A1CD48203D
|
||||
16: 70CABBA983179106AE7FCD5F1F31D5C3, BF7F9168F4F82F56
|
||||
|
||||
EAX-noekeon (16 byte key)
|
||||
0: , 5CB584CC68025F830B42371B9CCE99EB
|
||||
1: 65, 69D866C00E11E4311ADCD50AE2F91D03
|
||||
2: 80D2, DA0499598F478A7FF53324908EB4DC74
|
||||
3: 86EFB4, 7DC1556C65F9E7CF2E3A357B38E326D1
|
||||
4: 87387A77, 7B58F421766918A179A999520A6E3781
|
||||
5: D18B9788C6, 924A2FF178FD06BF292A605FCB27BDD9
|
||||
6: 0075EC03ECD1, 78F553564A25A574E6A4857778A2DB43
|
||||
7: 5BF96EC79C2E88, C49CBD1C4F631B35D5A3B764251870D2
|
||||
8: 70DF3B35F6D9B822, 42351BF5C947AF7A0E1F852199B5840C
|
||||
9: 2E53748525AF367861, 4986BC390AA0DA1E4E78CB2148A2C513
|
||||
10: 05DE8BAD8C975ACECF87, 1C0F1C18FB8682D76AF9E48D3547D88E
|
||||
11: 8B2B1D70F6A74059503F42, 839EE120ADC8BF08CD9A7DF6393D1E51
|
||||
12: 9D7F92F08953B5B300A7410E, 603A43432DAB26882797BB5AA7A75D28
|
||||
13: 4CA551DDB4BBCFA45BF71C49DA, D2743508826E3E39151F21C0AD81C8DC
|
||||
14: BAE72091E78013369AF5D0294AC6, 3F0D391BF01C3BA116A9CAF50DC28307
|
||||
15: B037AFB65588B95BC86E1430E0746A, 2399A4C31F55310AE2C4A2FE3379C74F
|
||||
16: 842F0B29888C43999545D29CFEFA58DD, 9B6E4FED2A6BE59DC2DFAB407D2FD124
|
||||
17: 86F7DA57E5C9DE9C88EFC1ED0CA61F76A4, E7278F365289FD0C484A166FA9EDB801
|
||||
18: CB94AD60C1FBDC9868DDE0D4674251A644B5, D857CE47FB963DFBE7983D183695803B
|
||||
19: 5A0B24FF167EB133808A3FBF89D9895F30BE1C, 488362E61725BE723CE892F550AF028A
|
||||
20: 60D43A8C29F1714588672847FA00DE771F2C3D36, 25D7CEF55A2A33953D9B7739F9C98C12
|
||||
21: CC47C891FAB841800F0AC0F746A257062BE9AF49F3, 220A3EE618FB735B9E801F9B3708D4FE
|
||||
22: C8E0F9AF7A7C62B6C297B16025DA55BAF5BA13F6ABA7, FA16192047892BC2472AF1DBD95E0D6F
|
||||
23: 731BDA5BEFCBA427E715839C21E4A176D0E28F042C3089, 4CBE4BB916EEE773B9299FE2FF0BBD81
|
||||
24: 62C5CD4F7EF81EA4E58847F3F715FA9E9EFB32059D70BA88, 090E92CEED8FB5D472CCDA11363FC904
|
||||
25: F7FD159377B130633F93B4D18BE68B0872905BDB205025E4FB, 6F335AB81AC8507D5F4018F86FB0230E
|
||||
26: DC374E5B40E8F4614C2BE685539C97825C7A972CA2BEFF338208, 719F6C042DB09A08C36D92810FCC29FD
|
||||
27: 1050C71D491237EF77F4F043D7EDCBD41DA0BC155F1CB65EAA1D5E, 44E7CD8CEB27584340270F3CADE1A083
|
||||
28: 8AE94A4FF500DC889436866D90B8E150B63EDE74074912029FF9C3A0, 3C96328BE53423BEB32FFE0D05F9B71A
|
||||
29: A801D1571411396C0727B132AEFE114D7BD486DA74C549E7661F2D8B87, DD6A443497AFC9EB14FE6EE9069AD580
|
||||
30: C79DFE19B0199768EFDD29026863C644A0ADBD14A3F3866DE74EE7AA2E0C, CCB313FE30CD4F04BB3548808FEBAE6E
|
||||
31: F658ECDD95F960D7C68D03F9BBADF066F8B9CE8108867C7DEA305FF4124AF2, 8AE64618E77A2806B53E239927787ACB
|
||||
32: C92EF301771E89D5BD3B901B380EBE18BD2A193B5989092006E7AC15345AFD34, B450AC584DF13D9C8BDD32DA686A1AF9
|
||||
|
||||
EAX-skipjack (10 byte key)
|
||||
0: , 85F74B6AFFB10ACD
|
||||
1: 3F, 604DF8BDD98A0B3F
|
||||
2: EA87, 792374FE07588BF9
|
||||
3: 0169CA, 489AB8AF69DA3306
|
||||
4: A7AC3EB1, 428DAF508E24B583
|
||||
5: AA9028D5B3, C0A44EDA71FB2C86
|
||||
6: DA97BA88A061, DA2EC34077F42585
|
||||
7: 7E25FAA41CEBC8, 36D4987551E06D5B
|
||||
8: F662DA6C9001CBFE, B7DEF76680C316A9
|
||||
9: 6D3F73EC716E1DA897, 5F0F83BAE4D3513B
|
||||
10: 2A300F585BEE9C889743, F4756C24DEB72A9C
|
||||
11: 80518B010DD77C82D19106, 50FF5CAA365F4A70
|
||||
12: 6E579A2173C861B6F37B4CD3, 81E3E5ABBA8F0292
|
||||
13: 5B04829880A72C38871C7021F3, 6B26F463708A3294
|
||||
14: 934177878E9A9A9FB4DEB3895922, EBC1C32F0A2A3E96
|
||||
15: 07AF486D1C458AAB2DBF13C3243FAD, 87288E41A9E64089
|
||||
16: 84059283DF9A2A8563E7AF69235F26DF, 351652A0DBCE9D6E
|
||||
|
||||
EAX-anubis (16 byte key)
|
||||
0: , 8E20F19D9BA22ABA09FB86FDE6B9EF38
|
||||
1: 3B, F4201E546A9160F989191942EC8FD1D3
|
||||
2: 9F38, 4E3CEAE3E1CB954E021A10E814B71732
|
||||
3: 4F4769, 3E8F35A6A5B11200E9F1AA38590066CD
|
||||
4: AB41F5FC, EC4C97A8892AAF5433106D4AC8A49843
|
||||
5: 414F95D61B, BF831E34D1E3FECB973A8C730ECA2E6D
|
||||
6: 4798322F06D1, 005BBC30BFEDBE6463536C4F80D1A071
|
||||
7: F256B6CD1BF4F5, 468A28F0661884B846B191B530C8D064
|
||||
8: 90906F27A633ADDE, 6D9200A37A7F6A456CB103673184C2E5
|
||||
9: 16CD3C17C9B4EAB135, 6D716E23D7B35109F55B036EDFA7742E
|
||||
10: 7AD1C22F1F06298DFB25, B076990F8193543C8F3185D3792BCE56
|
||||
11: 0476F2ABCD057FE6FEE39D, BB2876DB18C00038FADBBD9B264ACC3C
|
||||
12: B69EDE336407DBC2EE735857, AB63E5906116A8BE22C52B5DA31B1839
|
||||
13: C3864C1354065A56470669E602, C72BFD3A0BC73BFF051C9AB2F0DFED93
|
||||
14: 296D8F183A59020D33890420DD7B, C9D90B9EB42C32EDCF6223587D1598A6
|
||||
15: 256ED8E9D982616680559979BDF2E9, 179FE4E7BA7E966050D35900317E9916
|
||||
16: D4ED8F30FF9C0470D75B3B16750A3AE4, 5D50F05BB270A292DFF9F67A3BA84675
|
||||
17: 40CDEB6388274143CA3C4F6020BD9A4875, B27C7DFB1BFBB3FCCEE0171852C7924E
|
||||
18: 54EF262EC1801D505C7629D038654EBA0594, 9D2060FCD0A2C577511C7752ADE60BBE
|
||||
19: F39EE54A37F16DD38B624D7AB8F0D9CBD4B981, BC056C7D2C09D813703CDD63C1C69F44
|
||||
20: F4E7AD474FCA153ABD670E43081ED09EB2C4CC1A, F244BD4D630272F0D98FCA04226C04F1
|
||||
21: 039ECC36A0A16273E7246CA1FF19D213AC87B53F29, 3056DB6916C925DF220B6C9980EE141A
|
||||
22: 7DE1DCDEF01447CA2FE83375A48DD84E4A7CB7C01992, 79AFEA4816EAF8DAC8A5E93960F1594F
|
||||
23: A886C4B914BF0983003272F226F9B2197EF2DC05ACDDE0, B59D85A0FDA5FA4422F7203C055B97A9
|
||||
24: 00B3E1E91448E250AAFB695C0643A6577AB453EFECFABF53, 4A7EFF1CBC1AB535122A017203616D85
|
||||
25: 85E972E774D66D0531E40B8FE9E264A77B50FA883AB0943080, B18E164BF89B7E7AB0DC256DFEC7C72F
|
||||
26: 004849E39334969B392CB0CF3FDEFB3D792DCBBC15F8328C7EDC, 3C51295711F5F878DE8F0B2B5A26A227
|
||||
27: A0BAD6C2264AB1578993BA49E59D4598822FFED20A57D88F756FF1, 2EB9D525697A419A10DB2A84AEEA5FBC
|
||||
28: C34DD806EAB5AD823D78BCA78A7709A705FC94ECC521A367D76C9588, 3C57580C7903039D645C06DBAF07B477
|
||||
29: C447EC77512938CF7862388C32AF22ACE6B5E4CBAA998BE4F5CBC4D215, 43425D09B7ACFD90371C08953946A955
|
||||
30: 2C16993AAE624CBA4CDAF34FE3D368559E6BE548292B281439866375013B, 3B7360C3FA8FB1C15D19F567153CB46C
|
||||
31: 538E5DFAF14854A786851E4165F2E01CDDA963E318FCE4FB58E31A6B5CFC33, 2F8EA13B7A6873FE556CA535ABA0968B
|
||||
32: 5E29CDB7D9695A110043E9C260104BDF020A3A2A139D4112E918AB584BDD7EDA, 9133213AA7BCF062D2BD37F866683D3F
|
||||
|
||||
EAX-khazad (16 byte key)
|
||||
0: , 75968E54452F6781
|
||||
1: 95, ADAF5949F09B5A22
|
||||
2: 6B8F, A06B201947424A11
|
||||
3: 5BE668, 3251416625DF347A
|
||||
4: 5A92E82B, 33E25772427D9786
|
||||
5: 62F9F2ABCC, DE714F5F5D17D6D0
|
||||
6: 0E3CD825BD8D, A7991C8CB8975ED9
|
||||
7: 4AD0D999503AAD, 53A827D7886F7227
|
||||
8: BB08E6FAED1DAEE8, 91A118749B7AB9F3
|
||||
9: 16E30CB12E20D18495, F8F8B8C1280158F9
|
||||
10: 616DBCC6346959D89E4A, 506BF35A70297D53
|
||||
11: F86B022D4B28FDB1F0B7D3, EA42220C805FD759
|
||||
12: 9B8A3D9CDBADD9BBCCCD2B28, BB478D3CE9A229C9
|
||||
13: CDC4AB4EF2D5B46E87827241F0, 658EDB9497A91823
|
||||
14: 1A113D96B21B4AEBDB13E34C381A, 63AD0C4084AC84B0
|
||||
15: 14DA751E5AF7E01F35B3CE74EE1ACF, 3C76AB64E1724DCE
|
||||
16: A13BBC7E408D2C550634CBC64690B8FE, 3D4BBC0C76536730
|
||||
|
||||
EAX-seed (16 byte key)
|
||||
0: , 3D0715108CEA3BE144350082B1BC4F25
|
||||
1: EF, E56898AEDB0F461980587FFBDB83EE59
|
||||
2: 9552, 9647B7FCEDBB9EF4EDEBCD98831E5BDE
|
||||
3: 25DCD8, 3647D80EF3529C72F16D223D04D7ACAA
|
||||
4: 3D169011, 7A741FA2536E5905FD4ABAB104062D3B
|
||||
5: A92411F6BC, 18A306E5DBF4DBDCE21505F16DA85482
|
||||
6: 9D4661D2859F, 7B2FC34AB3DE45DB4AE8C97BF3B32BA9
|
||||
7: 0E8C26E24B0961, DFF098B44E7D57A71F68FD0D2D2416C7
|
||||
8: 485EE54D5D2684DF, C8FCF501065D23F936A4A530BB028EA0
|
||||
9: 768888B50865A635A2, 8121463B762AC12D19EE21C58A8A1B7B
|
||||
10: 647FF44F0B350385BF27, 883241565540347D491C0E397FF5D663
|
||||
11: FD868A569E2E597EB3B5AC, 4DE96B6810A1FC5F19A085B4F4C8B687
|
||||
12: 342D72063420F3FCFC1EF71F, 88B94C3FFD74F052CC44722B87E1A45D
|
||||
13: C768F88646D47D5201FDF47A1E, A01EB1FBB3AB135F258B87C30A8E1A13
|
||||
14: 44BF87EC9A5F5E20E5D972ECAE4C, 6F1C44EDB3533EFF973B53EAAF84D601
|
||||
15: FDE60E4F25C4B9388BD3D348912B7F, 863871D706A32F92DAD13803CF2008E1
|
||||
16: 69881E58AF690C5EEBC00DABDAAFBCA9, BD3911C5E41B327A10DC7D03435FB8AC
|
||||
17: 41AC0D70E8ECB01CFFFC9352E3800F568E, CCD63A0D20D0FD385EB720B2D60D20EF
|
||||
18: 88301B40FA8B84ECEE7238F17B08EC2A2DA3, AD10D120ABCCB67FD3F12C8D8BD216F7
|
||||
19: CCD0F8187B7455274D80A2387599617582B7C5, 3DAA6952A9AA160863E4F489AF04C6A5
|
||||
20: CB955D3B6044F1712DEDC65451E46B8D9FBE5067, D46FEEFA0A0069115F262877050265E9
|
||||
21: 373B8AD20672BEADE5B742C72306455549B26DB631, 16DC5FE5C7C0D5478FF67AD00463AEF1
|
||||
22: CAB49183077EB4DF3BFBF7FE026BCA8311A6BC067EDB, 8F4497F253167AB81A70A05218734C1F
|
||||
23: C2F860DA7EC7801FE30FF8C362EFA11E9392E029E24407, 1612D514BF9F365EB0E5CA13E974670D
|
||||
24: F0084F22D7AE598FF5DFEF76CCC0728325BB5D3DF5467B2F, 1DE5CD767D2B731DE4C9B4E303A7E771
|
||||
25: F5E907AC398B2C7BE124ACCAD1FEB001BC3EC7C77C21E94110, D8C7D50EFB0CCE2926DA9E796EA46E17
|
||||
26: D65A41B86D24C573D21EE416F2F853E8FF7A0788120102E8BABB, 3EEDB65BCF0E32C24B797D972913F943
|
||||
27: 3B39B9994248DD1FB3EFD68820D19E8436F66FF0E6D82F40E50AFF, 7892720F9AA0ABC34E05FD982396C13A
|
||||
28: 9B924A2F620E5160B8F6C8DD313F39D6DC22B7E0596C8D0BFCA14907, E417D1FE5569975E8698C4D80684A613
|
||||
29: 01068AA5F6FBFFDE1A8290CB315426F8CFD2438C09FD5982BE45EB21CC, A7DB568F037E8A4DB2D73CB2DF2BABA4
|
||||
30: D39210874C4B7BEB63966BDC89AC7279B67C118618E9C44C1C563A10F74B, FB64939029B8E5DC1318EBE3FDAFC9F6
|
||||
31: 8338B7BCA36C104C4B7EEBFF582FEAF879894FD6F00434859AD94E644BEC60, 93DECCE7AD61E69A2BD6621FEE2953D9
|
||||
32: 21DC38BE252ECCA74963965660C98B5D9B5C2411945D8AAF9EF93732748A6162, 2BBE555F1D3C94BC6F1665A6DEDB536C
|
||||
|
||||
EAX-kasumi (16 byte key)
|
||||
0: , 9E0C41B26B960E81
|
||||
1: 03, 26B904336B9E0BDA
|
||||
2: 9EB8, 18E90B52DB587A8B
|
||||
3: F8E4F4, 9842D0A42ACC7717
|
||||
4: B5688382, 2134820AF25CFFF5
|
||||
5: 582E9402B2, 9C0F60D5B2D4BEA8
|
||||
6: 836A3CEA4965, 6EB7565E0FF7FFCA
|
||||
7: 00DD66F0AB54AE, 0CAFA81DFB52F835
|
||||
8: F5824156469E77DA, 44AEED7DA55C7C2F
|
||||
9: FCED54C15FAE6EB601, 95D7A3592D5F3B0E
|
||||
10: 0630750CAF71D334562C, D8F7432F9AAEC624
|
||||
11: 25E3C5FAFE86F59D30BEDE, 42E3F6C3B8F73F64
|
||||
12: B98480D54E604E4CFB988EFB, 2BCA65A62CE3E363
|
||||
13: F07F1F98A2411749EA11FD87F2, EC7C07D37B7CC07C
|
||||
14: 19A6D648AD698ADED0AF37001479, F88417372E600717
|
||||
15: 17CE88FC64ED98233BBAB20AA4DA45, 4959410987AE317B
|
||||
16: 61EE83703D8CA5D652F8E1E83C86D58F, 57EC73A828C20B68
|
||||
|
||||
EAX-multi2 (40 byte key)
|
||||
0: , E3EB492A2A560816
|
||||
1: C6, E0A176A66E269255
|
||||
2: 1D00, 472E25EF8B4ED450
|
||||
3: 1DFE5A, BEDB3404162C7122
|
||||
4: 915B77D4, BABBB74A3EE61755
|
||||
5: 3C966136E8, 603664C04EF42178
|
||||
6: E4A4925C9F75, 41B77B32F28613DB
|
||||
7: 365BC4FEF0B1B0, BB09E42F396F3832
|
||||
8: FFCE6DA57D7FE9D1, C11BA7A7B580032C
|
||||
9: 0413506EE42819574C, 9B5C6A8111BE7B29
|
||||
10: 531319C06A4B68AE226C, 77BC1DF09414D212
|
||||
11: 85C0454EB3B9CDEDD32EF9, 39576F2268A59EF6
|
||||
12: 8FB1732015FD006D2FFA8D9C, F8F51511ECA4E0A7
|
||||
13: 1654F11C940FCBA529D2384A0D, 871B4541612C7CCE
|
||||
14: F119DC9F998D92B4C45185CFA2D1, B50D3A61F3CE76B0
|
||||
15: 05B051F7DA81609FAC41BF0A19C45A, DF1265F3F69625F5
|
||||
16: A313136E4E7F1314E7ED504B48324047, A9D1C5527D6EF7D7
|
||||
|
||||
EAX-camellia (16 byte key)
|
||||
0: , 9E8CDB7237166EF9FD0605A0AD3E4070
|
||||
1: 8A, 23F462AC7E22EB9078DAC34CB1CFFB08
|
||||
2: EC9D, EBA9E2E3112C18CC2991FFF97EF77E6F
|
||||
3: D2A9CF, 913472F45F6D6B087D8AEB34B0FF9494
|
||||
4: 360A7ECC, 6382103D53AB8C9263977AFB1A96AAC4
|
||||
5: 80B52AAFE6, F855787CD6CCA56CD656A0DBC663CAD1
|
||||
6: 0915D546F5F0, EBE17981CAB5D59E6376CFE30DE66936
|
||||
7: 086B525B082B71, 182D76F2DE42F5D0AC252F25E7BC34CA
|
||||
8: 438DA1E9E78B9D2E, 36BA12456C3AC5ED3A0BDF851A651E82
|
||||
9: 0F9C9890152D6AD5EC, 06F3A96F40D794552CA799006E76AE7A
|
||||
10: 7754241DCD040CC449EB, B576881B5E542A73717A6AC24E516079
|
||||
11: BB536F70C1111BFAC4D149, DDC6043F2B5DF96418799DD13BD04726
|
||||
12: 4B530B4F67376C4B7EC1CB29, 43A36C14092F19F168ADF0FD9F557424
|
||||
13: 55D5D285DC88451148C7B2B143, 7C2CB43BD19808EB90F045E6D6EB70D0
|
||||
14: B321948117659CB06E6B364D00A7, 1B30A37234E3A13A335EFE6A07B070DC
|
||||
15: BDCCAC5E956953E6D5C43D9436D453, 98F924C659F4112B1D9DAFFF711FB2F6
|
||||
16: E0A2F28186D79A9494700E5A30351542, C604F7F47C3F18F236DDB289D287BE91
|
||||
17: 750D6EF87E1C9E1023920D3F355B2BEED8, 96FEEAC4DA36FD36129F67C3EADA75EF
|
||||
18: E7F91687119D70793B9BB0114C7B588D32F0, A75052978F26EE6FE5D802BD4C06004D
|
||||
19: 56D7420981DC556AE0137DB0F1BD1CEC0BC945, CC024D30F19EAA3CDF66E51246FC3225
|
||||
20: F2D61A0E214472663F5F41C9D66EDEEC2F7C824A, 9706F273AF680AE2537D02BE41A2C980
|
||||
21: 30F76A83CF8010DF0F49F73C06435E0C5D85EDC6E3, 1F18354A73BF506D229369836855EFD5
|
||||
22: DB9688FB58EB83AF06A579CE56FBC75D93412790924C, C9DD5350751CFF0AB1A8910AC1898E08
|
||||
23: CBD64BAB16852F40FB00D9FEEF5365C773CA14B77EF5E2, D6A02105B1BD018A5BCF47A69803248D
|
||||
24: BDCE2AA8092D4790041750DC922F2D6AA12DB3F41A547C7E, 3DF09D758306DAE21C3AAAB3FC51623E
|
||||
25: FDFF0AFA4D94CB3019AB27234259ED225B1B3B0F2BDC32CDD0, D64E69725D638D9F0F90C44C6BF51722
|
||||
26: A9D2CC4F7FB98D54A78293C64C2A41CA19CC1F7B9970F3437AE9, BDFC6B10DD012BA057CCCD40AE14569B
|
||||
27: 81FE813C4A6A47D34F146DD943092940ECEA77F85339A219B6134D, 5F44590AE8CDF89E13AE2BE4D32AB7DB
|
||||
28: F618779FC6E6F5B7EE3FB4E937097E6A122B979E3DF837F72A8FA3B9, 00F0A3B4C67F68590AAA0BEF2D399D1F
|
||||
29: 0A8AB66D218268C9181DB8C6EF542AA4B42E53E4623E3385723024CC3A, F28D7D86317D2F509561DD3392F3EF3C
|
||||
30: 9CD50C94ED5391BED5C8CE2A07F8955744B275B6C5E5B6F453A5E6185C03, 048E889FF70729C55582003ED6169E0C
|
||||
31: 1CFD6D8EF6F44265703544AFEB2BBA2A067BE8DAB412E071B66B70E357238A, 0A5BB055E00D42F4291CAB3813FC2946
|
||||
32: 8E6E6433E4FF879155E0612F17EFC00AA8D5236EFAB5D9D6A912898F3124B588, EDF81BB73FF9288F315B988413432823
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,249 +0,0 @@
|
||||
/*
|
||||
NoekeonVects.java - Generate Noekeon test vectors using BouncyCastle.
|
||||
|
||||
Written in 2011 by Patrick Pelletier <code@funwithsoftware.org>
|
||||
|
||||
To the extent possible under law, the author(s) have dedicated all
|
||||
copyright and related and neighboring rights to this software to
|
||||
the public domain worldwide. This software is distributed without
|
||||
any warranty.
|
||||
|
||||
This file is dedicated to the public domain with the CC0 Public Domain
|
||||
Dedication: http://creativecommons.org/publicdomain/zero/1.0/legalcode.txt
|
||||
|
||||
You may also consider this file to be covered by the WTFPL, as contained
|
||||
in the LibTomCrypt LICENSE file, if that makes you happier for some reason.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
This program was inspired by the comment in Botan 1.10.1's
|
||||
doc/examples/eax_test.cpp:
|
||||
|
||||
// Noekeon: unknown cause, though LTC's lone test vector does not
|
||||
// match Botan
|
||||
|
||||
So, I investigated the discrepancy by comparing them with a third
|
||||
implementation, BouncyCastle: http://www.bouncycastle.org/java.html
|
||||
|
||||
I determined that there are two reasons why LibTomCrypt's Noekeon does
|
||||
not match Botan:
|
||||
|
||||
1) Botan uses "indirect Noekeon" (with a key schedule), while
|
||||
LibTomCrypt and BouncyCastle both use "direct Noekeon" (without
|
||||
a key schedule). See slide 14 of
|
||||
http://gro.noekeon.org/Noekeon-slides.pdf
|
||||
|
||||
2) However, LibTomCrypt's direct Noekeon still does not match
|
||||
BouncyCastle's direct Noekeon. This is because of a bug in
|
||||
LibTomCrypt's PI1 and PI2 functions:
|
||||
https://github.com/libtom/libtomcrypt/issues/5
|
||||
|
||||
This program uses BouncyCastle to produce test vectors which are
|
||||
suitable for Botan (by explicitly scheduling the key, thus
|
||||
building indirect Noekeon out of BouncyCastle's direct Noekeon),
|
||||
and also produces test vectors which would be suitable for
|
||||
LibTomCrypt (direct Noekeon) once its PI1 and PI2 functions are
|
||||
fixed to match the Noekeon specification.
|
||||
|
||||
Although this program uses a PRNG from BouncyCastle to generate
|
||||
data for the test vectors, it uses a fixed seed and thus will
|
||||
produce the same output every time it is run.
|
||||
*/
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import org.bouncycastle.crypto.digests.RIPEMD128Digest;
|
||||
import org.bouncycastle.crypto.engines.NoekeonEngine;
|
||||
import org.bouncycastle.crypto.modes.EAXBlockCipher;
|
||||
import org.bouncycastle.crypto.params.AEADParameters;
|
||||
import org.bouncycastle.crypto.params.KeyParameter;
|
||||
import org.bouncycastle.crypto.prng.DigestRandomGenerator;
|
||||
import org.bouncycastle.util.encoders.HexEncoder;
|
||||
|
||||
public class NoekeonVects
|
||||
{
|
||||
private final DigestRandomGenerator r =
|
||||
new DigestRandomGenerator(new RIPEMD128Digest());
|
||||
|
||||
private final HexEncoder h = new HexEncoder();
|
||||
|
||||
private final NoekeonEngine noekeon = new NoekeonEngine();
|
||||
|
||||
private final KeyParameter null_key = new KeyParameter(new byte[16]);
|
||||
|
||||
private final boolean schedule_key;
|
||||
|
||||
private final boolean botan_format;
|
||||
|
||||
private byte[] randomBytes(int n)
|
||||
{
|
||||
byte[] b = new byte[n];
|
||||
r.nextBytes(b);
|
||||
return b;
|
||||
}
|
||||
|
||||
private void hexOut(byte[] b) throws IOException
|
||||
{
|
||||
// HexEncoder uses lowercase, and Botan's test vectors must
|
||||
// be in uppercase, so...
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
h.encode(b, 0, b.length, os);
|
||||
String s = os.toString("US-ASCII");
|
||||
System.out.print(s.toUpperCase(Locale.US));
|
||||
}
|
||||
|
||||
private void printCArray(byte[] a) throws IOException
|
||||
{
|
||||
byte[] b = new byte[1];
|
||||
for (int i = 0; i < a.length; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
System.out.print(", ");
|
||||
System.out.print("0x");
|
||||
b[0] = a[i];
|
||||
hexOut(b);
|
||||
}
|
||||
}
|
||||
|
||||
private void printVector(byte[] key, byte[] plaintext, byte[] ciphertext)
|
||||
throws IOException
|
||||
{
|
||||
if (botan_format)
|
||||
{
|
||||
hexOut(plaintext);
|
||||
System.out.print(":");
|
||||
hexOut(ciphertext);
|
||||
System.out.println(":\\");
|
||||
hexOut(key);
|
||||
System.out.println();
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println(" {");
|
||||
System.out.println(" 16,");
|
||||
System.out.print(" { ");
|
||||
printCArray (key);
|
||||
System.out.println(" },");
|
||||
System.out.print(" { ");
|
||||
printCArray (plaintext);
|
||||
System.out.println(" },");
|
||||
System.out.print(" { ");
|
||||
printCArray (ciphertext);
|
||||
System.out.println(" }");
|
||||
System.out.println(" },");
|
||||
}
|
||||
}
|
||||
|
||||
private KeyParameter maybe_schedule_key(byte[] key)
|
||||
{
|
||||
if (schedule_key)
|
||||
{
|
||||
noekeon.init(true, null_key);
|
||||
byte[] scheduled = new byte[16];
|
||||
noekeon.processBlock(key, 0, scheduled, 0);
|
||||
return new KeyParameter(scheduled);
|
||||
}
|
||||
else
|
||||
return new KeyParameter(key);
|
||||
}
|
||||
|
||||
private byte[] encrypt(byte[] plaintext, byte[] key)
|
||||
{
|
||||
KeyParameter kp = maybe_schedule_key(key);
|
||||
noekeon.init(true, kp);
|
||||
byte[] ciphertext = new byte[16];
|
||||
noekeon.processBlock(plaintext, 0, ciphertext, 0);
|
||||
return ciphertext;
|
||||
}
|
||||
|
||||
public NoekeonVects(long seed, boolean schedule_key, boolean botan_format)
|
||||
{
|
||||
this.schedule_key = schedule_key;
|
||||
this.botan_format = botan_format;
|
||||
r.addSeedMaterial(seed);
|
||||
}
|
||||
|
||||
public void ecb_vectors() throws IOException
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
byte[] key = randomBytes(16);
|
||||
byte[] plaintext = randomBytes(16);
|
||||
byte[] ciphertext = encrypt(plaintext, key);
|
||||
printVector(key, plaintext, ciphertext);
|
||||
}
|
||||
}
|
||||
|
||||
public void eax_vectors() throws Exception
|
||||
{
|
||||
System.out.println("EAX-noekeon (16 byte key)");
|
||||
EAXBlockCipher eax = new EAXBlockCipher(new NoekeonEngine());
|
||||
byte[] output = new byte[48];
|
||||
byte[] tag = new byte[16];
|
||||
|
||||
for (int j = 0; j < 16; j++)
|
||||
tag[j] = (byte) j;
|
||||
|
||||
for (int i = 0; i <= 32; i++)
|
||||
{
|
||||
byte[] header_nonce_plaintext = new byte[i];
|
||||
for (int j = 0; j < i; j++)
|
||||
header_nonce_plaintext[j] = (byte) j;
|
||||
AEADParameters params =
|
||||
new AEADParameters(maybe_schedule_key(tag),
|
||||
128,
|
||||
header_nonce_plaintext,
|
||||
header_nonce_plaintext);
|
||||
eax.init(true, params);
|
||||
int off = eax.processBytes(header_nonce_plaintext, 0, i,
|
||||
output, 0);
|
||||
off += eax.doFinal(output, off);
|
||||
if (off != i + 16)
|
||||
throw new RuntimeException("didn't expect that");
|
||||
byte[] ciphertext = new byte[i];
|
||||
for (int j = 0; j < i; j++)
|
||||
ciphertext[j] = output[j];
|
||||
for (int j = 0; j < 16; j++)
|
||||
tag[j] = output[i + j];
|
||||
System.out.print(i < 10 ? " " : " ");
|
||||
System.out.print(i);
|
||||
System.out.print(": ");
|
||||
hexOut(ciphertext);
|
||||
System.out.print(", ");
|
||||
hexOut(tag);
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] argv) throws Exception
|
||||
{
|
||||
NoekeonVects bot = new NoekeonVects(0xdefacedbadfacadeL, true, true);
|
||||
NoekeonVects tom = new NoekeonVects(0xdefacedbadfacadeL, false, false);
|
||||
System.out.println("# ECB vectors for indirect Noekeon, in Botan's");
|
||||
System.out.println("# test vector format, suitable for insertion");
|
||||
System.out.println("# into Botan's file checks/validate.dat");
|
||||
System.out.println("# Block cipher format is plaintext:ciphertext:key");
|
||||
bot.ecb_vectors();
|
||||
System.out.println();
|
||||
System.out.println("/* ECB vectors for direct Noekeon, as C arrays");
|
||||
System.out.println(" * suitable for insertion into LibTomCrypt's");
|
||||
System.out.println(" * noekeon_test() in src/ciphers/noekeon.c,");
|
||||
System.out.println(" * once LTC's PI1/PI2 bug is fixed. */");
|
||||
tom.ecb_vectors();
|
||||
System.out.println();
|
||||
System.out.println("# EAX vectors for indirect Noekeon, in the format");
|
||||
System.out.println("# generated by LTC's demos/tv_gen.c and consumed");
|
||||
System.out.println("# by Botan's doc/examples/eax_test.cpp, suitable");
|
||||
System.out.println("# for insertion in Botan's doc/examples/eax.vec");
|
||||
bot.eax_vectors();
|
||||
System.out.println();
|
||||
System.out.println("# EAX vectors for direct Noekeon, in the format");
|
||||
System.out.println("# generated by LTC's demos/tv_gen.c and consumed");
|
||||
System.out.println("# by Botan's doc/examples/eax_test.cpp, which");
|
||||
System.out.println("# should match LTC's notes/eax_tv.txt, once");
|
||||
System.out.println("# LTC's PI1/PI2 bug is fixed.");
|
||||
tom.eax_vectors();
|
||||
System.out.flush();
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/* emits an optimized version of LTC_SAFER+ ... only does encrypt so far... */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* This is the "Armenian" Shuffle. It takes the input from b and stores it in b2 */
|
||||
#define SHUF\
|
||||
b2[0] = b[8]; b2[1] = b[11]; b2[2] = b[12]; b2[3] = b[15]; \
|
||||
b2[4] = b[2]; b2[5] = b[1]; b2[6] = b[6]; b2[7] = b[5]; \
|
||||
b2[8] = b[10]; b2[9] = b[9]; b2[10] = b[14]; b2[11] = b[13]; \
|
||||
b2[12] = b[0]; b2[13] = b[7]; b2[14] = b[4]; b2[15] = b[3]; memcpy(b, b2, sizeof(b));
|
||||
|
||||
/* This is the inverse shuffle. It takes from b and gives to b2 */
|
||||
#define iSHUF(b, b2) \
|
||||
b2[0] = b[12]; b2[1] = b[5]; b2[2] = b[4]; b2[3] = b[15]; \
|
||||
b2[4] = b[14]; b2[5] = b[7]; b2[6] = b[6]; b2[7] = b[13]; \
|
||||
b2[8] = b[0]; b2[9] = b[9]; b2[10] = b[8]; b2[11] = b[1]; \
|
||||
b2[12] = b[2]; b2[13] = b[11]; b2[14] = b[10]; b2[15] = b[3]; memcpy(b, b2, sizeof(b));
|
||||
|
||||
#define ROUND(b, i) \
|
||||
b[0] = (safer_ebox[(b[0] ^ skey->saferp.K[i][0]) & 255] + skey->saferp.K[i+1][0]) & 255; \
|
||||
b[1] = safer_lbox[(b[1] + skey->saferp.K[i][1]) & 255] ^ skey->saferp.K[i+1][1]; \
|
||||
b[2] = safer_lbox[(b[2] + skey->saferp.K[i][2]) & 255] ^ skey->saferp.K[i+1][2]; \
|
||||
b[3] = (safer_ebox[(b[3] ^ skey->saferp.K[i][3]) & 255] + skey->saferp.K[i+1][3]) & 255; \
|
||||
b[4] = (safer_ebox[(b[4] ^ skey->saferp.K[i][4]) & 255] + skey->saferp.K[i+1][4]) & 255; \
|
||||
b[5] = safer_lbox[(b[5] + skey->saferp.K[i][5]) & 255] ^ skey->saferp.K[i+1][5]; \
|
||||
b[6] = safer_lbox[(b[6] + skey->saferp.K[i][6]) & 255] ^ skey->saferp.K[i+1][6]; \
|
||||
b[7] = (safer_ebox[(b[7] ^ skey->saferp.K[i][7]) & 255] + skey->saferp.K[i+1][7]) & 255; \
|
||||
b[8] = (safer_ebox[(b[8] ^ skey->saferp.K[i][8]) & 255] + skey->saferp.K[i+1][8]) & 255; \
|
||||
b[9] = safer_lbox[(b[9] + skey->saferp.K[i][9]) & 255] ^ skey->saferp.K[i+1][9]; \
|
||||
b[10] = safer_lbox[(b[10] + skey->saferp.K[i][10]) & 255] ^ skey->saferp.K[i+1][10]; \
|
||||
b[11] = (safer_ebox[(b[11] ^ skey->saferp.K[i][11]) & 255] + skey->saferp.K[i+1][11]) & 255; \
|
||||
b[12] = (safer_ebox[(b[12] ^ skey->saferp.K[i][12]) & 255] + skey->saferp.K[i+1][12]) & 255; \
|
||||
b[13] = safer_lbox[(b[13] + skey->saferp.K[i][13]) & 255] ^ skey->saferp.K[i+1][13]; \
|
||||
b[14] = safer_lbox[(b[14] + skey->saferp.K[i][14]) & 255] ^ skey->saferp.K[i+1][14]; \
|
||||
b[15] = (safer_ebox[(b[15] ^ skey->saferp.K[i][15]) & 255] + skey->saferp.K[i+1][15]) & 255;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int b[16], b2[16], x, y, z;
|
||||
|
||||
/* -- ENCRYPT --- */
|
||||
for (x = 0; x < 16; x++) b[x] = x;
|
||||
/* emit encrypt preabmle */
|
||||
printf(
|
||||
"void saferp_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)\n"
|
||||
"{\n"
|
||||
" int x;\n"
|
||||
" unsigned char b[16];\n"
|
||||
"\n"
|
||||
" LTC_ARGCHK(pt != NULL);\n"
|
||||
" LTC_ARGCHK(ct != NULL);\n"
|
||||
" LTC_ARGCHK(skey != NULL);\n"
|
||||
"\n"
|
||||
" /* do eight rounds */\n"
|
||||
" for (x = 0; x < 16; x++) {\n"
|
||||
" b[x] = pt[x];\n"
|
||||
" }\n");
|
||||
|
||||
/* do 8 rounds of ROUND; LT; */
|
||||
for (x = 0; x < 8; x++) {
|
||||
/* ROUND(..., x*2) */
|
||||
for (y = 0; y < 16; y++) {
|
||||
printf("b[%d] = (safer_%cbox[(b[%d] %c skey->saferp.K[%d][%d]) & 255] %c skey->saferp.K[%d][%d]) & 255;\n",
|
||||
b[y], "elle"[y&3], b[y], "^++^"[y&3], x*2, y, "+^^+"[y&3], x*2+1, y);
|
||||
}
|
||||
|
||||
/* LT */
|
||||
for (y = 0; y < 4; y++) {
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[0], b[0], b[1], b[0], b[1]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[2], b[2], b[3], b[3], b[2]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[4], b[4], b[5], b[5], b[4]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[6], b[6], b[7], b[7], b[6]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[8], b[8], b[9], b[9], b[8]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[10], b[10], b[11], b[11], b[10]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[12], b[12], b[13], b[13], b[12]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[14], b[14], b[15], b[15], b[14]);
|
||||
if (y < 3) {
|
||||
SHUF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf(
|
||||
" if (skey->saferp.rounds <= 8) {\n");
|
||||
/* finish */
|
||||
for (x = 0; x < 16; x++) {
|
||||
printf(
|
||||
" ct[%d] = (b[%d] %c skey->saferp.K[skey->saferp.rounds*2][%d]) & 255;\n",
|
||||
x, b[x], "^++^"[x&3], x);
|
||||
}
|
||||
printf(" return;\n }\n");
|
||||
|
||||
/* 192-bit keys */
|
||||
printf(
|
||||
" /* 192-bit key? */\n"
|
||||
" if (skey->saferp.rounds > 8) {\n");
|
||||
|
||||
/* do 4 rounds of ROUND; LT; */
|
||||
for (x = 8; x < 12; x++) {
|
||||
/* ROUND(..., x*2) */
|
||||
for (y = 0; y < 16; y++) {
|
||||
printf("b[%d] = (safer_%cbox[(b[%d] %c skey->saferp.K[%d][%d]) & 255] %c skey->saferp.K[%d][%d]) & 255;\n",
|
||||
b[y], "elle"[y&3], b[y], "^++^"[y&3], x*2, y, "+^^+"[y&3], x*2+1, y);
|
||||
}
|
||||
|
||||
/* LT */
|
||||
for (y = 0; y < 4; y++) {
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[0], b[0], b[1], b[0], b[1]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[2], b[2], b[3], b[3], b[2]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[4], b[4], b[5], b[5], b[4]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[6], b[6], b[7], b[7], b[6]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[8], b[8], b[9], b[9], b[8]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[10], b[10], b[11], b[11], b[10]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[12], b[12], b[13], b[13], b[12]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[14], b[14], b[15], b[15], b[14]);
|
||||
if (y < 3) {
|
||||
SHUF;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("}\n");
|
||||
|
||||
printf(
|
||||
" if (skey->saferp.rounds <= 12) {\n");
|
||||
/* finish */
|
||||
for (x = 0; x < 16; x++) {
|
||||
printf(
|
||||
" ct[%d] = (b[%d] %c skey->saferp.K[skey->saferp.rounds*2][%d]) & 255;\n",
|
||||
x, b[x], "^++^"[x&3], x);
|
||||
}
|
||||
printf(" return;\n }\n");
|
||||
|
||||
/* 256-bit keys */
|
||||
printf(
|
||||
" /* 256-bit key? */\n"
|
||||
" if (skey->saferp.rounds > 12) {\n");
|
||||
|
||||
/* do 4 rounds of ROUND; LT; */
|
||||
for (x = 12; x < 16; x++) {
|
||||
/* ROUND(..., x*2) */
|
||||
for (y = 0; y < 16; y++) {
|
||||
printf("b[%d] = (safer_%cbox[(b[%d] %c skey->saferp.K[%d][%d]) & 255] %c skey->saferp.K[%d][%d]) & 255;\n",
|
||||
b[y], "elle"[y&3], b[y], "^++^"[y&3], x*2, y, "+^^+"[y&3], x*2+1, y);
|
||||
}
|
||||
|
||||
/* LT */
|
||||
for (y = 0; y < 4; y++) {
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[0], b[0], b[1], b[0], b[1]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[2], b[2], b[3], b[3], b[2]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[4], b[4], b[5], b[5], b[4]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[6], b[6], b[7], b[7], b[6]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[8], b[8], b[9], b[9], b[8]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[10], b[10], b[11], b[11], b[10]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[12], b[12], b[13], b[13], b[12]);
|
||||
printf(" b[%d] = (b[%d] + (b[%d] = (b[%d] + b[%d]) & 255)) & 255;\n", b[14], b[14], b[15], b[15], b[14]);
|
||||
if (y < 3) {
|
||||
SHUF;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* finish */
|
||||
for (x = 0; x < 16; x++) {
|
||||
printf(
|
||||
" ct[%d] = (b[%d] %c skey->saferp.K[skey->saferp.rounds*2][%d]) & 255;\n",
|
||||
x, b[x], "^++^"[x&3], x);
|
||||
}
|
||||
printf(" return;\n");
|
||||
printf(" }\n}\n\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,95 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
unsigned E[16] = { 1, 0xb, 9, 0xc, 0xd, 6, 0xf, 3, 0xe, 8, 7, 4, 0xa, 2, 5, 0 };
|
||||
unsigned Ei[16];
|
||||
unsigned R[16] = { 7, 0xc, 0xb, 0xd, 0xe, 4, 9, 0xf, 6, 3, 8, 0xa, 2, 5, 1, 0 };
|
||||
unsigned cir[8][8] = {
|
||||
{1, 1, 4, 1, 8, 5, 2, 9 },
|
||||
};
|
||||
|
||||
|
||||
unsigned gf_mul(unsigned a, unsigned b)
|
||||
{
|
||||
unsigned r;
|
||||
|
||||
r = 0;
|
||||
while (a) {
|
||||
if (a & 1) r ^= b;
|
||||
a >>= 1;
|
||||
b = (b << 1) ^ (b & 0x80 ? 0x11d : 0x00);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
unsigned sbox(unsigned x)
|
||||
{
|
||||
unsigned a, b, w;
|
||||
|
||||
a = x >> 4;
|
||||
b = x & 15;
|
||||
|
||||
a = E[a]; b = Ei[b];
|
||||
w = a ^ b; w = R[w];
|
||||
a = E[a ^ w]; b = Ei[b ^ w];
|
||||
|
||||
|
||||
return (a << 4) | b;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned x, y;
|
||||
|
||||
for (x = 0; x < 16; x++) Ei[E[x]] = x;
|
||||
|
||||
// for (x = 0; x < 16; x++) printf("%2x ", sbox(x));
|
||||
for (y = 1; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
cir[y][x] = cir[y-1][(x-1)&7];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
printf("\n");
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) printf("%2d ", cir[y][x]);
|
||||
printf("\n");
|
||||
}
|
||||
*/
|
||||
|
||||
for (y = 0; y < 8; y++) {
|
||||
printf("static const ulong64 sbox%d[] = {\n", y);
|
||||
for (x = 0; x < 256; ) {
|
||||
printf("CONST64(0x%02x%02x%02x%02x%02x%02x%02x%02x)",
|
||||
gf_mul(sbox(x), cir[y][0]),
|
||||
gf_mul(sbox(x), cir[y][1]),
|
||||
gf_mul(sbox(x), cir[y][2]),
|
||||
gf_mul(sbox(x), cir[y][3]),
|
||||
gf_mul(sbox(x), cir[y][4]),
|
||||
gf_mul(sbox(x), cir[y][5]),
|
||||
gf_mul(sbox(x), cir[y][6]),
|
||||
gf_mul(sbox(x), cir[y][7]));
|
||||
if (x < 255) printf(", ");
|
||||
if (!(++x & 3)) printf("\n");
|
||||
}
|
||||
printf("};\n\n");
|
||||
}
|
||||
|
||||
printf("static const ulong64 cont[] = {\n");
|
||||
for (y = 0; y <= 10; y++) {
|
||||
printf("CONST64(0x");
|
||||
for (x = 0; x < 8; x++) {
|
||||
printf("%02x", sbox((8*y + x)&255));
|
||||
}
|
||||
printf("),\n");
|
||||
}
|
||||
printf("};\n\n");
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,19 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buf[4096];
|
||||
int x;
|
||||
|
||||
while (fgets(buf, sizeof(buf)-2, stdin) != NULL) {
|
||||
for (x = 0; x < 128; ) {
|
||||
printf("0x%c%c, ", buf[x], buf[x+1]);
|
||||
if (!((x += 2) & 31)) printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,276 +0,0 @@
|
||||
GCM Test Vectors. Uses the 00010203...NN-1 pattern for nonce/header/plaintext/key. The outputs
|
||||
are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous
|
||||
step repeated sufficiently. The nonce is fixed throughout at 13 bytes 000102...
|
||||
|
||||
GCM-aes (16 byte key)
|
||||
1: 3A, 03C32E0E9D7E07A410B9BEE40A8F0D26
|
||||
2: 26AE, 3A635BBDC1A17CA40B58CEEA78105CDC
|
||||
3: 142FAC, 7E8922E8FA6F1E41E4339F0B52176DE4
|
||||
4: 20C1863F, A1D12620C22EA7A0AA0E74667A20B8E1
|
||||
5: B3B796AA54, 53F0F9F03791BBD76BC99D1B5639F3C0
|
||||
6: FDCFF8EA82D8, B56076B42E3EEAC73DD42FC83B9220F9
|
||||
7: 4695E719E67849, B4A1A2E29AAD713D5677CF425E65A400
|
||||
8: EE5BA3309D417697, 146EA95CED151F8C40DF98C1CC54930B
|
||||
9: 13FF05ABB084FA608F, 55550AADC3461CC190CA22F29C6246CD
|
||||
10: 008B0102208A22D3A562, 7178534BC7145754BAE525CC06E14A6B
|
||||
11: 3536DBBB07B026E78E94C8, AB27183AEA2240B0166D702EEB2A7BFA
|
||||
12: 00739D5A27AE82AC7D6A40EC, 4354578C3D241074D3C1F6496420F239
|
||||
13: DA41A5F458400C94B84026C052, DC6CB036FCAE9765A69F5B8C38B0B767
|
||||
14: 4C99797C7EDCEA9D5425565522E2, 3FFEEC557F0D5FA73472D2A3F8E71389
|
||||
15: D381E7AD2E5BE2C97FB4BD958BC2EB, 6BF713D4E7DA7C4290967A1D23F97EDD
|
||||
16: 5016C127F16A4787734AF3A3E6F6F0F7, 8CD8458531E94BC8160E2176F63F8D0B
|
||||
17: BDF3D0F24D9415AB5CF9B87BB45B4A8AE4, D81A3D56451313742ACE53D41223F6AF
|
||||
18: 68C1FCBE22FBDB296C246F2E34D871A6902E, 7AFD64D4EB0DE7E2A842B518AC6D483F
|
||||
19: 7D8D3C31E643611B0B557F29B437F635FE3FD0, 8501B61DBF4A4DD19B87E95055B95962
|
||||
20: 4185EEB0B9B480F69B3EC7A162810073A36AD95A, B9BCA6D9CA0AC2B4B35D7BFF4DB27D25
|
||||
21: F991F4A481E322FEEC6FE9302D010AC4C811B23B4A, 54FA4DDA92E57509F4D48D206A03624F
|
||||
22: B288424FF96596B2A30A1EB9480F5EADC2F6D8551B9A, 2C998C8DFDC7663C8DE677B2F1CBCB57
|
||||
23: 1066FE3DCB9F8AE0DC0693F7179F111E0A7A1FFE944FF4, 65402D1F8AFBDC819D6D1ADB5375AFD0
|
||||
24: 0A8772CCDE122EFF01D7C187C77F07BDA50997B4320CD0D8, F55823AFC3D9FE6E749E70E82C823925
|
||||
25: E6E2FBB3E2238BC8CB396F463C2F488B4B4933087728D39815, F06DA35A9AEE65F9AD0DAD5B99AB4DF6
|
||||
26: 569BD39CB1693CB89B88923ABE0D8CFA0B4F22A48A15E2EACD4A, 661AF51FF0E0E363406AB278BFC9176D
|
||||
27: 199EED81C2428170EB089060FF9676596EADD2270895A0C8650903, 90AA9C634469D45E7BDD9AB955B90130
|
||||
28: B5200497A0654009B9F5B0D45FFDCF192F3042D6B05C6D6A8191A7EA, 71F6C4982AA50705D5FFC60512FC674C
|
||||
29: E39DA262C0E851B5CB5BD55A8B19D0AC0ABDC6FF3F32DF3B1896242D9E, B58AA05F594FC9779E185353CC52B8FB
|
||||
30: AF349B91BAD4BE2F2D5E4DDE28A1AA74115A9059A5EBBF9E38F341DC368B, 966B04FE43A2A9D94004E756F7DBFEFA
|
||||
31: 8C87861DFFDE72FA64E926BF741330F64E2B30837650F309A3F979AE43BA2E, A5C825AE1B844D6A8D531077C881BD36
|
||||
32: 924E178A17FA1CA0E7486F0404123B91DBF797BB9DBDE9B1D48D5C7F53165912, 10F972B6F9E0A3C1CF9CCF56543DCA79
|
||||
|
||||
GCM-rc6 (16 byte key)
|
||||
1: 16, 2CA928694EA91AF92B3ADB402FBBCDEE
|
||||
2: CD9D, 4A9940BD7148F08AE75A4F238148C174
|
||||
3: 6D1332, 5CD73043FD797D1375AA011D2E36896A
|
||||
4: ADC34199, FF5D2B40B02CB58BC63AA6D1CFBA811B
|
||||
5: 83158D52A1, CB8C45A56D7539CBACBB85DFB4C1F52E
|
||||
6: 66E32F053C17, 3EB9AC9A066DC66DB4973B5C78C6EC0B
|
||||
7: F23224FEB14897, 0ED4890D034F20A9A78ACA7492AE9341
|
||||
8: 3FF9570F77486C86, B82C19DE2C5CA6CAAC223F337173F840
|
||||
9: 44B4F4130619FD516C, 6689DC410118E0DC2D90ADCD6327049B
|
||||
10: 6E205B2537935E50A1E3, CE5739FDFC13D279075508786388C08D
|
||||
11: DB836471D91F2FFC6A199E, 1518E9A6CD2190D32A9EA1AC0849DF09
|
||||
12: B9936A58667AABD9BB9B2ADA, 388894E75CEF512CD5E3986DFB2CA589
|
||||
13: 1B5072C8FC0EA19A0486C0E04C, A804D99E2414A314440E5F4B8BDCFB45
|
||||
14: 614903F301B1E7C092E9A32C195C, B4F7406533C58AC54869F09C4B0801CE
|
||||
15: F30ADEF328878D174B1AEAF5D7137D, 7C5BB92772540C1E2209B77C78AAB092
|
||||
16: 776D20B980DDC7C48ACE4225F59E2736, 85DAEE9785EB1BA9C99FFAA5AE565159
|
||||
17: 6BBA225325564369BB5F11EF5734604938, E41E0E3C31F4B1770AB93750A386286C
|
||||
18: 6EAAF9EF0C149A13BA535A2AFC398281017D, 10CBB6A874711DE179D8A4EEDC4DE085
|
||||
19: 9D0B62274F7E5426F5AD9515DAAF4742C291D9, A35D18485F881CB0BBB00A9421C9694C
|
||||
20: E6A18F640923DBB22FCBCEB0ACD1A2BC94256212, CFCFC7E7E5C64090DF746F8C36F605D4
|
||||
21: E37EB92C38B47C6E2621C2CC64D83CCCA9104C2095, D88C0FBF2402FBA40EB525118FC2CAC8
|
||||
22: 0E690F9D73E7E689AF48FE5B99E58AC42F3702EA40FD, 33D698F9C44FEB68C1C442B30DD36B9E
|
||||
23: DA759D58629FA946FB635538C1AED318890C4D84EB6610, D7BC6A69DA658EE3DB842C01B9085A07
|
||||
24: 581F86B5A844FD709B13E09A7CF64ADEA84EFC2D7AD9300A, 0296F58775CE4D4E92C4DD0CF65CF8D7
|
||||
25: 78B346A03098BD6EBE0BF56F5C37C83B3C42288D0E031E0D4B, 2F89EDA70B8A31EE64B264C7C5165AF1
|
||||
26: ED768B0F18A13ACF40738FD61642C0CFBCF746D60887A8C5FDD9, 56EE211AB10B37D61FD80692A76615B0
|
||||
27: FCC298575C9F4E1DD2C8B0482F9FFF42EFFE565ED5FB178DC56947, 0EBA843B28F91798D79E2105995EF662
|
||||
28: 4341133DA062A885DA6D7BF4387C6F28829E65EA7DB7E50B15F2D03F, DAEFA9D1230FE3084FDB91AC7ED35503
|
||||
29: 777C13A7FC16345BF949508CBC1051540928CB5B9B36569488109FB60E, C8DEE566513233B8E74ACB1046FE87B4
|
||||
30: 6342B6FEDC0B8868AAB5E870CE1B2E420269CB11DBA74F10C5E978F2B44D, B2B001639A2A0BA045023817947573E4
|
||||
31: 99A123D836EF76A4250A960DF7DCFA231C3595EAB53024F53B961EF80901ED, 02E8820F6D31A23DC9F0DCE511A1F8FF
|
||||
32: BF57034D1EA94A6DB86642918EDBC9CC7D6C39025F9EC528EAA2A9EE7B22EAA1, 7801231ADBA83C137D760AA75FF2C9E6
|
||||
|
||||
GCM-safer+ (16 byte key)
|
||||
1: 0F, 62E723CCA67DFC49C1915AD3C69FDFF7
|
||||
2: 87A7, A73B3D416AD68235C662E9684430FAA0
|
||||
3: 40FF80, 8EC11FFA3B777664FC6D2AD37AED3765
|
||||
4: ED5B1716, 1A4FD3FDC9D197866FA8AA1403E3219F
|
||||
5: 033CF349B9, CA1E6111A5BF539931490D2EFDA7575C
|
||||
6: 23E30716B131, 79FB546DE6C534A18BBA604E8E2BE8D0
|
||||
7: DE67DCF5635B0D, 463989CCB9A972468B870C403AB840D8
|
||||
8: AFB5BCFD6E36E41F, FD3A63618F1D31A8A71D94FE91F41501
|
||||
9: DBA0EB7B664D303BE5, 2860B5516CF0CE20E35BF766A4375EAF
|
||||
10: 2826E6EDCFD7E9FB938C, 685E8B032254DFF65DAC8A44C3819E08
|
||||
11: B70FC9EE54123F45A4E67D, 8661E54524A0F12612E000876E8E6F15
|
||||
12: 5FC3C79807594E403B82B9DB, 9D88DACCB8654708B241A505AB12FD47
|
||||
13: 2C7AC463E62BBC014E1A48E15C, B4FB110193F147E4A59EC38983528047
|
||||
14: 046D692C6B2827453F7BA3EFB609, C4E46E0D5F71D2D477D7CD12B7447713
|
||||
15: CD693A49640E00134FE33C9E324122, F43001B425E37C094BCCBAC49A6471C8
|
||||
16: 9FC2042EF22E0F8A767DB0C52109E4F5, F60730D914AA02A3BCED7F737640B9FC
|
||||
17: F09ECC9AA4FE3596C00D0AF4E052E60755, 199B8C9CEED9B4E70526BFE603FD5E45
|
||||
18: 0C8BD929E87A21A9F043E47CE79950EA0E75, EC9D38AB193FEC16EC470A15E27FB367
|
||||
19: F621E43B7FB21D98544817FB229C2F308361D4, B6BDD4053C4DFBD3970A5055E4A7719A
|
||||
20: 63F1D36ACEDADC63627CD438B379C48D648126A8, B1A7217302F84CF5F6A259F2881484B6
|
||||
21: 60BAE96D5E0F248A257CB3A7788D6107CFB525D20C, FE60C3B3E2029869EA063BA3B981AB96
|
||||
22: 01213496633A4525B2C7CAABDCFEB84193A8AE2D8059, 738E7956DA8464FF655CE4F5B0A005C9
|
||||
23: F6822F3C87B238F6F7E44307C416B6366C18B26B2357C1, A27A98EA0AAFD1D3010DAF4070F52E7A
|
||||
24: 32B49BE196CC3825B7B6E0DEBD90680B996C3AA161BB52ED, 8505573CC5191577BD992A004F255953
|
||||
25: 38361B85808140127A44B364046A5E1FB0B86885D5030110D3, 17DF461782D45807A7709EB2BCFAABE1
|
||||
26: DBEF6C2067BAFF378A285EBF685F559A896B76A517292B4301F0, B6061185764BA316CC0163925F27A1A7
|
||||
27: 15E2A0634520C0CF4C189436D35DE01CF5C83F0684CBC261A59AC5, DCD96E1687F24676838B60E873D47087
|
||||
28: F837ACBF63898720B0527477B59A8EA74751DABCF2CC48C768AB421E, 72DD76EADF13C65E6F322E110F9944FD
|
||||
29: FDA50738B60251E5FF1C38AF0A8E3F619D247C24A20D63B372571AD6D7, F1F1B212BD7E973BA17BDABDF27F5AC3
|
||||
30: 0CDDC7A10CA3F3616E923A751EB638CF1E67CC2D17A03538C6A2BEB8555F, 7DB533FD15E48FFB217B18E91B7B2928
|
||||
31: BE0C9A148FC3344025C8BD35AC883B584AC706F540BE1100A92DB67EF900B9, FD172B0942DDC1EA076D46BA46B9F7AC
|
||||
32: F8256E9A41BC6E09084274A91229DC877257C433E3E43F05FDDBC3584B6093D4, 5CD834DDE7406085CADD5BEE122AF052
|
||||
|
||||
GCM-twofish (16 byte key)
|
||||
1: E9, D82A22BF49B52DECE1A3DAA163956EA1
|
||||
2: 3DE3, 837CB2018053A6FA9A51A18362C0A6E5
|
||||
3: 1123B2, 280150FC247D06FF79ABE3C6C5ACFDBF
|
||||
4: 6BE74C72, 52FA635AA14154D3FFD7A4866AC989E7
|
||||
5: 7610B2DE22, 3E77AF501CA8EF386E2843A2C9F30425
|
||||
6: 31BBF5CC9F77, DA25899A5B84C4CE3CB031D24BE39EEC
|
||||
7: 49FE2D43D16BEF, 491CAFC0F9A749AF0F87CB5276FF7BD0
|
||||
8: 28191B8F4FBE3C03, B8318CE8B7EEE3BD42A35F7EF7B4FE91
|
||||
9: F6BCC7AD009DF4B71F, 01BDA4572E1B95D0152A8675BBA9F6B4
|
||||
10: 89B6B6B611CBBD4AB667, 5AD5C05B2FFC3AF07ACA04EC488BC4BF
|
||||
11: 985A04A3BE0A43A3489870, 57AB64D52976293C09882943B8622A0C
|
||||
12: 15DDAC26F9C07856F5C11CCA, 183A4FD20C0D7AD1744B77992D4A16C1
|
||||
13: FE45E506C3C26745D6B5B53A36, 67B3768535D1A50D2756AB4ED83C73F1
|
||||
14: 8EBA337B5E13FC16BBB18B8F0B10, FA90CD334FA6565E517097C37B7281C7
|
||||
15: C9F914A669C4C58ACA86884FFF469C, 876599BB8BC1AD6E7B1DBB00ED53276E
|
||||
16: 8416EEB95A4B3DA645035CBDC76C8532, 405B3A936CE697DCBA9385CAEAFE2B55
|
||||
17: 312BBF82B6619E5F7EE56AE873CAC9C415, D5FB2028CF3F6C57295BA6F7E5F410A9
|
||||
18: 1B51044539639A7093D996E3B4174D6A253C, E934D7A7EF90586A56C6C2DB53CD6C40
|
||||
19: 178762C071950E8E0198E6573BD585EEEE4E69, DD661E463BF3BB45225F7E7A6E0DE3EA
|
||||
20: FFD6BA51FEDDB7E20593AD2BF0EEE061D3B5C014, 0DCCDAEBE6135EDF787FEEDABFF3A4F3
|
||||
21: 04BE622B5CBE1058A4C8356F65B8158295F39E1AB1, FCA9B0BCA348B319D0B19DD28EE9DE79
|
||||
22: 8B49016BFA45DCE019BA9E4606E987A159ED0DA07D2D, 6B93BD424871D5231EB359E40666CC5E
|
||||
23: FF8D016642B2C3190094423F5A61F7CBD358522A5E5799, 2088A4088AF6F786DFE08AED79A19B3B
|
||||
24: 07F446A2E3597041B9AFFEDF5DD474CA5FA5C872844A4F8C, 870223F7404BA37C8DB940623F0DDBE2
|
||||
25: 32C2EF41ED54C8B63AB8151E690C1770CED90D2827EB2C302B, 5BC4EABF30986EE33FE483B8FABCE7D3
|
||||
26: 3310D94B00007C10D4B3BC3F57DE877D0E2B822B96DA9CFEFEDD, E0E114CEC34558A180675B0438128F30
|
||||
27: A4C95A5B316AE03A569B7862290DC6340FDEA1299C5B27591333B6, 63288F9CDEB93BF029C194B2C62B4AB6
|
||||
28: CB63472F93E0325123558620DB9FBA058455D8AF1D23A94BEBB60A79, EC0968F60DCAFEB17411C4A2D7793FCD
|
||||
29: 74241261257C5610211A3B9D45D62AA0876B63EA289FE938FB03CC8D1C, 4A18EAA2039B29F0CEF7745EB8AA7DDD
|
||||
30: 6172080F96B60E3BA450BA195EB4D6732A25AF30A109031560915C4C0344, 3B690B088522D3EBD6B647070AECF97F
|
||||
31: AF52E18DE8608C39FA886377899C66AAF8612513C21C7B815E248D9F75D775, 39F0F712265F44A442A7581D8F314D1B
|
||||
32: 64F9AE4A9E6735D348343EA7ADD617F0687C2883637468BBFA3664F9194F1683, 947A02C9994DA490BFC9E036305B26EA
|
||||
|
||||
GCM-noekeon (16 byte key)
|
||||
1: 05, E18F8A201F281A4F3F4FE6F43A001107
|
||||
2: 55DF, BE4D95A0BC5966CC2E80FB544AD43B8B
|
||||
3: 0C5A1D, DDAE782864D5EAC894C863D4D2E3CA54
|
||||
4: 767CCE5C, 106D7DBE5D9D56D38E6A679528C72688
|
||||
5: 9F099BF360, D4D50BE3B13DE7B18BE415B21BD9AD4B
|
||||
6: AE4B0C056B1B, 8E0EA5A5F612835B1A498C671413CA19
|
||||
7: A8EF51FA62B5F9, 44A65E1A85C9C102467A50297F8256B0
|
||||
8: C58D955A860EE8E0, 45622020FC40884B61BE3C35B940A870
|
||||
9: FC5F5562143A7F9AA9, 7FBED30D1594D1DB57BA10EEF0C4AABA
|
||||
10: C2B2D5B922504BD29C23, F14AF5025799EAF249745F1B91AB554A
|
||||
11: 62C250C8548BAF088DD01F, 6D49DB3F4D3D8D30DB0B26DCF6CF6A80
|
||||
12: 3FD64FC5BE13ED2AA041B8C5, EDC192E68D5A7B37F395B794C3D8245F
|
||||
13: A84B4EA6C8CF088B0C6D40B5E0, 01EE07A0D3F4A1957579C1EE36C5D5A3
|
||||
14: 39A4C10E5C542FABA9C6138E02D6, 8B31EDD92A71F53ECEF716E08CD0A3C3
|
||||
15: E4DF855B9065B51C47454CBC3209A1, 4714B347E11804D0AB3241B1D72F4FCB
|
||||
16: FB6D42C9C44997D4C854BA321C8631CB, 7F0BD8708CC6358899B7C62A7ACEE739
|
||||
17: 81A2C031F0D5593DBD283A9650A4160185, 3267D10C3BE6044B0D2E0BB59A919AFC
|
||||
18: 33776FB240A45E1A84B86B49FB04A350B9F8, 3743BA55B523F4BFC25E8B2474347C70
|
||||
19: 4E19A791B6EA4B776C5449CC3AC486EE9EAAE7, 9D4FD554D57E73B6789D20E262E706FD
|
||||
20: 10B946D1B1C005516B7DE7F51CD41C8DCC581DA5, 3F41B2B8FFCFDE5298473D2E6FF76227
|
||||
21: 184C4DD415AFE6FE74B3BE662AC04E6229F517F4A2, 158749C83A13B178F0FB7C48E7A4A19E
|
||||
22: 6DBD3F3888A2028841B61167C3EDAAE71FC23774C923, E0E87641B9C55DCC041D343960C9417C
|
||||
23: 6D995776DB3B90B038A4CE44EF2D4EFEA16DFE0A5BB054, E14F63E6C6657CB904B16EC4F2B82972
|
||||
24: A955576527F9A240B13F9DA2FD67997D5E606D34548C1444, B8FD23A3EFA33E7F4367C61E071F8BEE
|
||||
25: F7D9EE67BD019E97A5EB7A33B7A307B2268ED7BECA95553D92, 6B31B756C9B3EE98613BB29B357FADAE
|
||||
26: ED68485EF62E89965CC8B085CAFE89BD9661ACF66939FB014E1F, C57A80259C493520E50902597EA3EFCA
|
||||
27: 53365AF657B186724902E8011368D6E49DDD2158F51EE0FFFA9658, 8EB890A78716344E79E4AD48C52D423D
|
||||
28: B49CCFC3FEAEF5C8DE4E41EF538A537552B4957E8965E454FFA3B5F7, 7CA3442BAF416B50431BBBE5CACD44DD
|
||||
29: F02E7CA72035455ED723EB802E66118D5FA642295416F12AB298567AF8, AB211AB9624F17975279690C6D95EB51
|
||||
30: CA4C2EC503773BBF34FA411340CBAD6A9115E81B073932444ACEC5537614, D877D5B78FFB31CC54142562BED1890F
|
||||
31: 9B9BBF2D46D301F3ECDE92A13C1EEE8F9F1533AA4AADFE2E22D36D51F5F469, F03F634BCCAC070F210142F737542491
|
||||
32: 92AD34E95350275A4CF208CC1A07776E7A6635EB8F2A7D4D9B6B6C96D6812616, 52E49767709D7CE349AAFC0C405A68ED
|
||||
|
||||
GCM-anubis (16 byte key)
|
||||
1: 99, DD35EDAD537F6FCA5BCDEB053BEE36B8
|
||||
2: 12A6, 24CB6ECAECF376400F7BFF52C4312D08
|
||||
3: 791DDD, 7C35A987766AC11A4625C92BA4AA419E
|
||||
4: 601FF830, 69A6E3718404D3A20019D9E7F875C2FA
|
||||
5: 45A67C8B23, 92EFC3CA67CA0934E5E22A0EBA4E5613
|
||||
6: 5F2C7A733D42, EB5BF55241D049343457F05BE8B53CB5
|
||||
7: C356F4D8AC59BB, 12598DA524E6F01EDDB512E3B988B860
|
||||
8: F24201E87407B8BC, 58FBE9D3E242E16BA16420C354BCF0D0
|
||||
9: 509A017E05D0075264, 357822F3CAF350972D86F2423FE49040
|
||||
10: 0BCBA97FD277C65D4BB2, 068F57C866AD35379F108237B39C78C0
|
||||
11: BFE30A88F0B1FE651D0EC3, EE2F073E23DACD211B1C22074CB32A70
|
||||
12: 11AA35923D9CCC49AF83DA5D, 9A7E9EED9774C06D1D127D1ADE221893
|
||||
13: E3FE3E1C2CA4E1C61D530AA46F, 0D26F48272F7DAE98C797F0AE5BD5B3E
|
||||
14: 6407C7F6DD9E188DB09F584AD32E, A673DD2BB4ACC85983DCD4B5EAC2FB68
|
||||
15: AEFBD570198C05D5B430A275AA82D5, 3A1CB79A7DDB7601C7F72A5B0DA8531D
|
||||
16: 40C1B9150E8E09C9483C1CA0CCBDF363, 241FBB631ACEDF77D51594D660BB4981
|
||||
17: AD3F3FA6D431E12D6B41476D7B5DA77C2C, 4C22BF4240AE4235FEAA2D3ED7AAB8B4
|
||||
18: 5EB8D86E7B26064D75E56C42B090A17544E0, 44EBE42984F206FA78D19DFC88AA1EAA
|
||||
19: 75D7E5AD5C2D19E21A1931F88229C1456EBFD4, 1F1CF1F832658DB0804D577BB2FCD2AB
|
||||
20: F73F1D3F38E8B99898E30FACECEFA40FA933F63B, EFF893CE73B6B30AD144735A5BC759A3
|
||||
21: 452A09F297A013652273C124085FFE03D5034EC331, 9E71970BCD0EC639049F906589B7FFD1
|
||||
22: D7BB98AD11A884CC8BF3F2F52CE9F8C17F8B188C190E, 31496C89519DE6F66113C9BEEB151275
|
||||
23: 97B8305B1D1E02D4D1D8194BC54E4AB394FA8F5C8B2526, 1A153F52C3C67E0DA81B626C159D31A9
|
||||
24: 1542789709D1FD889E7C5820F920126434D5969C4EC3F6AB, 685A03CA342688A70753953AB27CF0BE
|
||||
25: BB08A7F815AFA96B96C028EA48D79FF3BA7FFFFFA1902E7822, 98E4377462566EFEE39F65659DEB13CE
|
||||
26: DC8EC0B08BCADA829B3663980D66B80A2D51500AFD80EA0F18CC, 58D9C85F9561F59BF264393DA954399B
|
||||
27: 477A3B8344DBCC79577C15524F35B45A7FEA72B0561A0CDCB3CD66, 57343CF1432D30FAF8724C5AB3120539
|
||||
28: 3CE2DD2869EDF99ABBB3DABC981B5BF294D6AA29A785F1ED6363D6A5, A939560243DC164D46028133C12B16BD
|
||||
29: 72504872BE65F3DE8F0B63BD24AFEED17B195D270AB20ACBEA7E6B0B8A, 4D5D642AEAFE6A2CE8881577FCD7F2B7
|
||||
30: 5B71030C43F551C27183A17D08FC1B9C8AC1829D404B8DA8803FBB09343A, A602A88365B46F19DB240F2C077A0334
|
||||
31: 89C0C85BA495D5F92D91EAC281362F374A0F41C507FD20DF6E05147C8E7208, 7F8994E46CE0548DE8F290303E8F3613
|
||||
32: 5AC62A000B9A80B6B849F3A36E1B512097922F8475D3C6F237C3DAE23A6B8C6A, 346203E5D4775D002A1022D7F42504C1
|
||||
|
||||
GCM-seed (16 byte key)
|
||||
1: 26, 87B72BF4F343FA59CFA40D1091F50FD1
|
||||
2: E80F, BF6A3B3F649E3AD1D07D24326C44365A
|
||||
3: 16C93E, 740A57E99296F82515190712B4B56F00
|
||||
4: C403D1FF, B210C95ED48A15A8E78DBECA2831CBC8
|
||||
5: DAF5735AE4, D74ABA53295DAEB4A04842D0F587C0FD
|
||||
6: B80ECF00DBBA, 91DD19615D6F71F696C4AE9D388D7266
|
||||
7: 45F170B0D2ADD6, B9FC969B51976A3CE3D8CDD227722A53
|
||||
8: E3EC82041FE3EEDE, 3B82743C9A974E594D53DCF17204CE55
|
||||
9: 15B8E18A9D105E2F2A, F1452F649ADEB08006092347A722497D
|
||||
10: BE3E6D03650BC96975E1, BFA2A6EDEF412FAB922E861514475C21
|
||||
11: 0361D6CEEAFBA30C30EE5D, AC97D081314CB9CD24113CF38E9E41FB
|
||||
12: 50E4627778596D55D7A508F4, 99A3E41EC4F3B20DE8D217C06C828F23
|
||||
13: E3362B153E59770912C7B12FB2, 9A96E56341834743DDF33156AF411B5E
|
||||
14: 3408B88EEB308F20964DAA903AC7, A4D487202ED5EEC5EA4C45792982A821
|
||||
15: A6AAA4ACBFF8AE329618B023C1EB99, 5B67A194B6358D44FA5801B588289DF0
|
||||
16: 4DCF2115BE730CEFA52053E9398EDCA2, 5DE56AA2FFC6FFEAF87225316C74C87B
|
||||
17: CFFA74C036CD62DCE15843160B39FD18F2, B0CA9A45CCFDD7A61B1D06E0075610B2
|
||||
18: A68AA4DB35238DCE0D537670D76073ECE5FE, 283B33B1D7B57917B8658B3E957B52A0
|
||||
19: F99FCDF3990405A203BC6F9F7D56DB5B8A3E5C, 0887CB21263AE7178AB02E287D47E2C2
|
||||
20: 363664B0944200D152A48C8C27183D7AEE177A1A, 3043B2927916652091951B9E2104E91B
|
||||
21: C1D9BF607F76D69761A9BDBA7D13D9CE4C8E430F7B, D6E7509B620B7E83B3FF7F931020F56C
|
||||
22: BB2DC71C8FB4A7A201AF36C4A174AD542D3A34EB2BD6, 2158A10FFA890769882FBB6636F95D1A
|
||||
23: 6B478DD22EF941F726D89C1B5654260845DC9140317630, 359297946889A740671BBB0BD2857883
|
||||
24: 3211DA2201F029B1ED2E11187E62D434442D5302E78A3242, 0C1D43B63A4DD329EA11ABE5404E83F4
|
||||
25: E0398E55D8E5146A715FE9E9A74316BBBD69DE747B5F7C3C68, 74FE8E2F10A96CAB8102EE6F0847380B
|
||||
26: C404BB08D0BEE8FF032D3EFDE7A15CEE27BA29B43161F0B5E952, 0F21B0E2D83584B65BD7A2F912BF9CEB
|
||||
27: C61D97BC584FA3CB0E6CA3E966747D75BE90CE32E4E1DFA2F34CAC, 45D4D5B01D578ADE8EB7B58CDEFB7950
|
||||
28: 2EEC4B1DEF647FAB996C7A5FA5061E5B572E8B1B0BAA0C8B7D01D122, 36E014FF6D8729B2EADF2E0406840B9E
|
||||
29: 9753865FB716D470C634974C2056D637F11EB2467274D0024A72E5FDCC, 1E2DEAEBBBA78E0E6000275B7CAEC89C
|
||||
30: E9FE40F4C8F4AF2607E41C6BDCAA28EC7241FBC6C8DEF6F36961EFE9B46B, EC5EDD19299A09A39D2F9006093E4CEB
|
||||
31: 995FEA1FA6A0B0B141375B12BC9BA18E29229E3D3BA3FF2F67438268B06EAE, 0413AF0B5AAB28C4EE92495ACEAF17B1
|
||||
32: 746961D162BECF915397F718478F5C1DF7A3FB8BD2413A4BF7C0C43314F6E2B1, FED8ACB5288B6ED8E0556D169CAD99B0
|
||||
|
||||
GCM-camellia (16 byte key)
|
||||
1: 13, 0679D1B662AFDDF3ACFCE419B6DA94AC
|
||||
2: 26D6, 162A86F8E59F9E6EA5DF0748B890862A
|
||||
3: 58767A, EE0B79D3ED4B852EEFA323F8EF9839DE
|
||||
4: 0CA5F75E, A8063610439C0AD6631F6CFBE10C2AEE
|
||||
5: 5B821141C2, 0568AE410E4EF4C9FD4EC55926FB0300
|
||||
6: ADCDD0B1C7AC, 84B1E359DF762B7E51084FCE1619D632
|
||||
7: 75882A4FF78AF6, A13923C17E9006E06FC10710C3F1FAD0
|
||||
8: C4F2E79246F1CE2C, 27FE18DF274233BF632F91F5C6004C3F
|
||||
9: B5F5462F5AFD8333EF, 56EE2A3CCF86F4F5CC6FCFF2638283B7
|
||||
10: FF40C4163E604B0679D7, F813C36C222C5EC2DF7EF51DD12BDA97
|
||||
11: 93FAF62FB742529F2F1034, 2A67CA1A0CD5ECD3EC62E9A303D11B27
|
||||
12: 4C7F377995D7FA5D94E740A9, 0F8B822AA9775F742D5436029263520A
|
||||
13: 357A0DE9ED3E1070808B2AFBA4, FFB8426038E07FD7D23E92876B3CF4CA
|
||||
14: 281F9A4C95ED6C363A1F00564206, 93D5470EEA15AF8E85019C47728B217F
|
||||
15: CBBB9CCCBC78A78CF1F571BF667059, 15C7BFE9E2D25DE73BACE501D9BB5346
|
||||
16: 8A3392119B0B01A9C38C556C6F31AE45, 87886BF5B99CB77FE3B681826286E87B
|
||||
17: EC52B385BC9CE88DABC560DA23B3684378, F6B71A19E39723BD4D9DCFF7ADE97796
|
||||
18: DA81EDEBBAD7F6A49D3BC377E5F16272765A, A0D06F71CD2D9947562832E1A83E577C
|
||||
19: 2146F272EDB8F46958C01887D92BD3AC9B8A47, B5CC3F66E09AD98AB6BCEAFCDED10CB3
|
||||
20: 3E281F975765DE1DB519696DDEA6F94B462B4717, 515B758DC732EC6CAEEAA4B94C943CF0
|
||||
21: B3A735243E2D508E2EF3066705D0FA37442C8406BA, A8C1CC8EE8D5935FBEEC31B7132977FE
|
||||
22: C1272F2CFEE63BA750A7689385ABBCD4D431A99BD2E6, 46511DE41E6ABDBDA73AD854149B03F5
|
||||
23: 3C66C359BA5DC0AB52EB152DBE89AB28767B7E4A6A05E6, DE4BB656C5B0DDE993ED461A0D9C185A
|
||||
24: D0248AC2923887E76BAB9FD48D8FB73D93B23E4FA8704C10, 7C120335F1DDBB429431F15E24F64455
|
||||
25: ACFFD738047C794E9C88BB76C2BD8E300CC5F89C2E5505815F, 7D090676F5CD61FE8BB3E20BB1BC8235
|
||||
26: 8B2F83612C9B5870782FDC506FD9E7CF08024C6D126AA0E715AC, 5A72E736892087A91E77FE785200ED68
|
||||
27: DDB64F5869813B94E80975E55BB8B62A23CC8B0DD56357C51A0B2F, FE9B74933C7D6FF5272A0DD90D1F5D71
|
||||
28: 00A21C6C047DB3551368ACA67B45222386A2DD63297CABC780493A73, BEDAED8C4799594FDB40F992CC82B4A2
|
||||
29: 35FE5CD3F9ABC78C3B6E96EF11FB601741710FDA8572CF741EF9E5A522, FE34A91C83C93FE08F7D4EEA3F927415
|
||||
30: 4CEE166BB1E1325C69BFAE06C9422BA735FD5B21EE2D7581E27FC027CDB2, 31D3086C3A0639D79FE08F5DEEB3E81A
|
||||
31: 6F575BCEF0FC079F8FA300040AA50AD6CF6F4C92A27E24A210AD32FB1FB0E7, 057E5239A6277E1D96BC277D4EEF5FFA
|
||||
32: 5090FF37EF4F163F5B54AEA54DAF1CDAC1125C46A8617CE3D251576BF52143E2, 182FD3ED463E1A6A615F4E25B34CA748
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
||||
blake2b-160: 684b540eb245ebba2cd66b7814fe6d787868a5bb *tests/test.key
|
||||
blake2b-256: 3aaa08120aa0174c105fd1f3412e3da30c3bbb9073569b0b8ae458b34de7780e *tests/test.key
|
||||
blake2b-384: c33f39ab19099d5dea6789479e23447857803a3f45361ea58dd69c7b8037c8697544b6a741e236215adcb8b38fa0cfc4 *tests/test.key
|
||||
blake2b-512: a2daabae6996e3bbfb76c5d277fb881107037c756173f510d83a78f669cf0b70a5088b971e30ca2168381568ea3d30b80a7b500944a5e2e3294f25aed4c3a5f1 *tests/test.key
|
||||
blake2s-128: 7e1f9b6de11a3c597308f9d8aacd7321 *tests/test.key
|
||||
blake2s-160: 3d1c9ae1a0afe8a6ef8b61d5380de7b061cd353c *tests/test.key
|
||||
blake2s-224: 95dacd83d0421b2d69a52d92ee54143bb97c91a61450d917a88d4388 *tests/test.key
|
||||
blake2s-256: 92ac6dc88b9ce4a75b2a54783435a37919303f713396db0e9ccd976d8c55f1cf *tests/test.key
|
||||
chc_hash: d50da1ea9b53c0b891c8bcb0a4c6e5e0 *tests/test.key
|
||||
md2: 0b327a17a102580ccde8081c18f137c7 *tests/test.key
|
||||
md4: 6df7b3c1f7fbcbf6b8246dc0046e9d6b *tests/test.key
|
||||
md5: 48fd9ed11c633069c3cf721611696a73 *tests/test.key
|
||||
rmd128: a78170e11d56605eb0f5e05e6a218e61 *tests/test.key
|
||||
rmd160: 56236b14cd15958c58136a295fa2b07c5edee009 *tests/test.key
|
||||
rmd256: a0a658b25b8841f20be8151eb5e2c1229f085dd5cf7aa8bef4c8e07ea5738913 *tests/test.key
|
||||
rmd320: 2ec15ca947f29dd8cef4782aeaeb4541ac00dc29e1649c4f5f4578ef0287091e513f9da423ce7319 *tests/test.key
|
||||
sha1: c17a11eef02d7a2ad7250bc2ee22bdf37ed21f0f *tests/test.key
|
||||
sha224: b226daa069512c849d55866470c23543d87e1fb768171efdcc6ab59a *tests/test.key
|
||||
sha256: 76ec7faebdc42a4de35ca70024c2d273e9f7856ca61612e89f5f66350ba8cf5f *tests/test.key
|
||||
sha3-224: 09525d6410c462e00e72ccd4304290bc59ff2b1b8e5322dbc197e169 *tests/test.key
|
||||
sha3-256: b9016fc9976545ad0183775d88f20df5295d40b31db00d85f6916333260b8ae2 *tests/test.key
|
||||
sha3-384: 5452977763b602df4185bbe7cce193346b09ee20d4a45a780fd44237e335ceaa71b9da06242621e159d796db9043c9be *tests/test.key
|
||||
sha3-512: 1fadf63073c8613d38d5c944e2e3f7e086d94d93dceb2eec1e9693fd44158f3127c90cbaa8a13035cc9ff9b3572c9dce836bea15c92e8a78b036ec382caceb0f *tests/test.key
|
||||
sha384: 7cc080c662524617e56d5a49f1c185909e9b1858a86684161ddd97fc5426f693b53f59d779de16da25dcb1259df879e5 *tests/test.key
|
||||
sha512: f90afe4d254716a9770fd2c4f29ca544f2975f961cbd7fa207117383e4e48f7a2e1ade4aac333a2cb8c227dd6af2fff4d87c31c2a3916ae24d507c7c94c21818 *tests/test.key
|
||||
sha512-224: 64ec566b5c2de736eab1b4e8542dc110f736819ea7f8f48e3712fbad *tests/test.key
|
||||
sha512-256: db880bce4beb7246510febb961c7595aab57a15de6f90cd079f145e476b5d773 *tests/test.key
|
||||
tiger: 97d713850e7affac30a642572c1ee7b18793d5b9e0ef5932 *tests/test.key
|
||||
whirlpool: d7d41c755e0f28313f254cb198e0bfa42f56670595d97b80dceec754825d69938a9c11e5bf16e9a3809a62a09bddf021f3dbff4302ceec7ba46c88b41772b711 *tests/test.key
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,126 +0,0 @@
|
||||
16:931b40b97cd1d1338d4a4abdf96d1f45
|
||||
16:000102030405060708090a0b0c0d0e0f
|
||||
32:85e82fe5e8b426cf04bd96d9aed318fb5dae89a1dfb854a09f556b61c5ac918b
|
||||
32:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
48:dd7aad6c6d10176e25eb97e165ba612a2b6275d97667102f20af20ec2630c7ccb4f5772a3e009948f1ea91f3bbaf7e04
|
||||
48:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f
|
||||
64:338509ed021eecd249cb15cdd440a84ff9d6704b99e8e52e9d057f152b742a5e3b9c314574026c76fc887fb404a12d669eea9460c1fa08e1867c2c0274408b9e
|
||||
64:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f
|
||||
80:8a9cbff36874de7da3e20e9a26691eef944ff78a72341515ae20c2199688ff92f039a19dc6d517e017ef36647834debee90bf80ba20a7caf24964bcb0bb3a621f8203ce5428461d3ee72ead7aeb201a9
|
||||
80:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
|
||||
96:06eb66a88b9667296b8644cda3464a27e3e2d8b6b3d0a9ffbebfd48f3967952ce161d8867900b0a7a44638a6e41b9a9dc53bf183a85a4ee33bb6f6c2d64b8cb54bfbb8625ff5cd3965aa08b460737b575da0b8f4123751cf8f0ae801c5856712
|
||||
96:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
|
||||
112:7af5a2b1381a8bc5aa2bdd4370b88d680c34ba9332d1d9f6e203c4d9fdbf5ece39fe5afb5871490a180c4b102665823dabe1079656f24969bf84267d3264f92cbbc610f26203536d387333938d1a52f4076df1aa0a114f3b0182da12c3a5d87bdc8eff54f80b0d56f7044ba372ee6366
|
||||
112:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f
|
||||
128:814fe82674b98d54671869e3fd705f76e353761bf61cfc635fbb23037d8a0e0dfc13c6c0e34f8c79d4444ac314d4918773265b3fb5866a997e270d5ea8891f0217ec6749df281d790dfbbec8adc504404cc0a6f11e91d0ee6c19abdc67b0c22ea4d9fa218320a694dca53cf522c761e426e0cd57e49b73a5d765cb4bc571e888
|
||||
128:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f
|
||||
144:9fab9584b0dd87df42f07513edad3b5e3a35b8871323eed63a48ded1efe4308a9883579f3a7ab830277bda59b1f1c2614a2cabe11cdd87689c0bae80ebad02b76d9300703d0268e0eb052d9956c5648912843b16be988134cfaf65fa87013ab960b190afea879897f1fdd00b360b6bfc6cc3531285682894b707af5914d2d1a136407f869ae6672e096ad7e95f380d53
|
||||
144:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f
|
||||
160:95aa16e637f1449d9012237f5fd95a57c5a9e203ca0a9393975e5991cc568f7ad2af3266ab605915af277f4395aa312586fb28a18f22d1644963233e1121472980229a3941c2f24758a51c48aa22b61fa4310ed2e6175a71bd4058cdb070f2b8289a46a39636dbe259eeff3c87f96fc8d46961aac54d7a8491b5d713e6cc0d6551b9e90911947d9fd15051badf67420188c450f9916c2edae245f1f6a67e4f5c
|
||||
160:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
|
||||
176:5cb782dd9e2391ab54378121d0766afe6d35ecef7a2cbd85ab04ea82b06b56ddabd311917093ff16bc1857480f84049d89ec6694414617b1cf3a11778c1ccbf22b81be5f07ed6f978df5089e54561fec53de95205ffa7d573092688fce92cae228f342f77c50df87404d502a9b274bbf3cfcaf4e94a1e8401630e18b79d048a5f3901abe82493d911d385890405bcaf4d5981def670955e95c546da8939aa68aefda56b37abd3bdcd466605f9bcc5931
|
||||
176:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
|
||||
192:e9a7781c750910f265e72edf0659d76a0db2dab863f43ca313b9e67e8f9f97a1ad8ced641c6d8d889ed2d38caa7887ec2eb9242093b39d4633702731b96e11da52b1a9a584d2367e6a0e759baf902eb908b4432ffecd367ff1fde454d4af844e9a10cb260ae222446c179dcc82b5f767b941f75196e8c4b210315d01b006fa6b5f1faf931549044b17b33f567b729ddea115c7b11c90982e1480101e98aab23da6533b40777971b4afc3815d063ef175419dd72bddcdc6bb187b3512c3bff56e
|
||||
192:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf
|
||||
208:8fd33ac16f8d9bd2ab24d1d26b267f67222b9309d697502bd001bb48b8c3206bd5c98cc1cff788633cda4edb5aaed2055435c2c092a7c655455d1d01a6d7a449df870dd559e9bae1e0fb0d6e5a98679402c288b87cbda569c3503b4aa9403f80c835c995e3b47e33c1c5b8321e8db1b72955ccbdf640c78aac376ec449396b163b8d16b51b0749fab6ba71d0b563fef6e94702f35ff2ed180f0de1f86679d8f2a26b2b9d8adffc7ad11c5944118e30025c9be26431f130aa2bc238e4b0104ddf9f82630ab7eea590bd7eabb2da745ffa
|
||||
208:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecf
|
||||
224:ac2daa6b330224b6f146ad67edebacd98cd2269d0cb313fde49d85ad60f9b21c9926d411fd435be8bd073d294e905acfccea2708f98e05cc9ded3c77e684b671bdc59deff3b43fb931381b12133ce386a0314a939d6c4855bbb7765adf955f4e587bebaf6d3b8cf547b2feda60c326e3409833665f61d91a2451ca2693bad6779094e010a3804993d6078c1ac3c2d26d589a8b3376dd06241b3139d2ae603ae5c4829c297f09a5c535c37998f571b0e96855e7a708d7b2ac42659050547c7bd447bbebad92e98b203ce6e83bab8e94f232417152ac6bfe8f9982012c8f83c674
|
||||
224:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf
|
||||
240:5c4d34448cf5b5b385a8aa9e504d724e6e689a35ff36143c20fa16df16f74347df6b65ef354c094732fe1b31e454e319a7be20dc6df4b900dd6527feb5b7c81a7a40df73d513cd40a5e1acfda4ba9e4fed784bb26b2719899c60a54bd8c772f17c95e6100c6def216c9c612a10db62a576cf45392c68736466305f6cb86f218f57b033c3773d0cdd9827f822cd480b60f94d32b28f536e6f0464e63e84294f0c3ab088dbf0efcf95b020f4c2ddc72c5823c2182025cfda510e1a944ac9316f0ceaba7dbd116cef95e051ca9143eebd575ce53c26cab9aa897167d500fcbe229560a85c98e83385ca6befa90726e768b4
|
||||
240:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeef
|
||||
256:46d31a1a6fccbff0435e1811a4851746df2af5772dd0408fbca2b3603cc4f92f778dec8f14daaa6f081500de55d036b3680a8a9b6c50bc20eebf09e35036bdef9b3751167e807cd1aa70385ea9f4be42ef4de6211079eb0cd6c3810404a60f09dd4e98cccb09c356e6b4c4cc1da036bc82023b075011cad2d01bf95fc45829c7af484f92562c2579bd3b4dba3967d5c6bfdb3e2236c2b43655e6393cdce8a2cca0affb8e45e8545aaf04049c2789108ac5bc6bceba18bcb9d4944ed81a64ab43e28e28207268464b99dad7328db0059defa25a722cbfaf89e93a20768bbce91b64f395a379ba5580a2ca4ab2d978c6ed3aedc9f53896bdc28aa5f1300473a3df
|
||||
256:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
|
||||
272:96a46190ac8c56cb272488d1db3a6153a4be7a298f200eecd42b0657e7110e879ddaf12a782d3f946a283f23fd5fd98ddce5874ea645e6581284d94c5437a4737921fd1504fded721d9a12c9bac8d8feda0b1a32a5a04e3602dd3befaebb161af6df1590d280ce09fd99e551ab39351dff8cd85dc084920a21f49e726bafdfc75e1cd2c42fc8789edf52adcb8b8f87b0b7c89c7e80fb8a14807c96912fa125395d71f631cc3181cccbf435da014e47c4dd25640cf7953787c3fa2e9de4a867d61cc398724a94b584ed336715ec92a562215bf36c193cf2356973e60b858d3f97a944d12a40173218f0bd2e565833581e51bee580e3b3430b3d41d6d6788b73ebb45a22a548456f393f24999c40136688
|
||||
272:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f
|
||||
288:4ea9644990536525105792b735e1a9adaabf7542f8d30f41553f756b33fa90051352939fe2693be9e5e482f9a2fd0ea00ec85abb01a56780b61609ac1364b22b2a1f7b061317995c1d2a8bdd280a7735d1191aa6c546516713577093f17b5696c9f2a2b94b766b5a9d2551891a5c17530bf953aa1dbec6a9560054534163c26973399b128156af6a257e0c591b279ff376d0e2464b06a464bc5e5f3d4ca309ddb9fc96d8c59efe0027389e25aca9106b4a6c0e8e3726e26470f0aa59ecbb1022953312bf5a09db75728ce455f63bd328437622bc61dc5f703e7e0d49a27ccc1fa25439848a1349c7790d1920f465151318c3d27855bd953231981eb903bde19906667d26900e2c233330fa0b6c157db37d5b7c76fdfa7a7e1606045e9a18a0b9
|
||||
288:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
304:53ef1d7350ca9c52f3d53b1f3097919a4e49bc48d2e63c571abac2f19f16084b16308dd8cf96f374fafbd1ac7b3f9cf3b9c62af25563ff09f419c94f0530d43ddda8396d99010c861c92d59b3d03bb8423eea55044053b06be07fdab392cff5f85be8119ce3e3783cd03923d28bd6cbecd5620fc2465a9f2b1a0850e4a6f35c1893819b689387e5bd2449aaf8b1497a598a48595030a00b92ce357509f259690823c0d1b710edb36cae8b7653afc183f54b1955a56db65929df6b29880e99eb68581f1e41141ee697c1fa565f0d674a2b9f1e88c3f370d1d5c564547370e73e2f475f52eda167bccbcc19405e1cdd24c13ac25bcfa3f7dd65e233e059b18fb420bdb52969816548bca83ae9d392b8ba1eece0faea2a4d965e46e38c3acdb00466892c1be69ed0e73ad80beee0cbe6d2b
|
||||
304:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f
|
||||
320:577d305d82d993adb3fbf1e91bbfcd6d9fd9b7872420dc418825ff0bc791b12dcc5fb56f0a4396131f989cebb7b07b67f6365bf120b15cdf7c856e4ffdecff571bc8b04a10328811401ced98c14b92d667d89ef0f413d2472d039931c33570bef3db3485b4f018bdc771ecad8cdca1ace0ec948591e98ce1e037d33ce00326452fddfc70a340c73b0886b43dd0e9203c11c025af0aa2ef3e3538893d6716574f242657cf1bfdf6d8ca3fabb982866d04554d74a9495f178b5bb68d2c2d026b82a1d65a2a63a5527710c305d6b54e830baa18f692dc0f29815b7eeb717c08d49b696af80db2c05481aa077e52420cbd1ec47c99aa82a0bb730a85bff1a8000c1735af09ac45ad3d0088eaf52f5d42ba1337dfe3ae956d6d7899ac949028ec0f5884ae58d949099505dc9576d204702d9b25a172f81a041fea4e8744605ff0dcb5
|
||||
320:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f
|
||||
336:cf3c36fbf2b8d72b6e9e8e9ec871117b2d4dc814e3204a5aa223136f8fb8218245dcf03cd81de80a4d35fc5d0a4f8a31a2872d3c1acdab0846c89bbc8db6f31436741f6e3f21cc1f783bf4eeea9b29415eab9c1d6ed94dbd391a13ba98a851ee0646a378a8d1b25d56de83049fa5ffb33ed2c5f60c6588eaf8e6b374c43cf1aac153dd63951aab2ef10923889af3192bf2adf9eaad048eb8ee3f81916eb589974b5152226c5d1e6f516a82e8acfccbb46ab14d5b901a4b9ad23c3310b0a2d30f0d88d0852e67fd7391c64b9e57800d62d81695d9450e135c9d193fc0efcc8f774e0fab020dff5d0a28390dd4d629f5492a544fcf04811f2b0e3a64d33c5eabc43a22a97c698390d53789935aab90808b091211609a5834ee60da7af6cce5cfe9dcdb438b9e8bf60706696d0a95c5e6bfd25921dee98c47de5d7e4cf5101fc994b062fd2dd01a176358113bafa404bbc8
|
||||
336:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
|
||||
352:7dfc531b8d9b4f8a084ef0f6bca81ccedb88d13f899c64ddae54611d76a0f77ca27d3745860c79bc944eb854738a1c5a1d23491d19a20f7fef3ac6391798360eb210874cec1cedeef549726e533b223a3f3b14d4bdad059920910279ceb49e70c87a84f1901125327a9929f238f5361099425afa5d826c82253d94d83cd291947a7d54dde88aac734d1df8de1f125fa02b6b0983cd8674bf529c97929b56a5ba681c7279461575a7568c7b9518d95e6ea8faa6ab6b4dca7874dda2c8d2cc72577dd67744873da145bce25593511d0bc3d67bf5cb61f9ac53e04701a1a448e80d692fb46651e45b65dae90994c91b83ba4c1ec9f7945187b9e7c31e870401f5ec8322d0a686fc2f9559279de992171957719004de602a7da9ab63a902fad8313b60fd883781aeb1c8d5b99c73e417c821f75859bbaafad40ab85098dae356c996f4274b198536262b2d26b22216e79ff3fc707fd197e1f39bdfb9acb6214d9196
|
||||
352:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
|
||||
368:100e6e817ed865757039f75eb6d15c16c5478784eb9dc70f60e3b900f60fa925404e09e2cfc0450bc89bce115fef62de782a2d7725970e7fe8226122c1ff9ccf142275d4f37d011ca3aad5700e2e8a8d27c7553e59f8173c8117d813e4d237bf906e3499306fd5bee0fbae137a372807caae0619caee51039049a09066b62953fc5bf1213dac7da86b4418cf3bbfe046c1b9fedb6045ccbf25617ea52e2b6fe2cf9a52ed371f864197fbb3ccd27ff2d0e2e7285e29b21632111d2ebea0c8f1a216779aaef98346b84f54fafe46ee3128020434d0fb1291e07c53bdb236e3f476199647bd7366a72dcdb5484e2439257ddc5b2d77b3c033e068c32288d94a72f2c6562c7e1727e4f60fa41a75f5561c4c15d5997db99471ff68b085b39d5107003927dce0060b1926ed8e9144a6ba6d907ecf037f8006936ba536513fb8122b82214162b7735a16f72ffc4773c32c9d694827c3c2ecddf742766d2b742ffba674a04c3700ea52988f6e265925cdcf4ef5
|
||||
368:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f
|
||||
384:0e2a132eca216076665bab6f3d1f222a9b502a4830e7a67be3330fb4a4cbc1f2ba2c3891ffd67cca8514739848cd90354e99e489235f380b3727e74467b5579ab2c3661054eac7f9413fe1f5f9b8b54f25b9eec5f693025d300bc70c607f074b640764d91230a6a9753bc403a17009e201cb96b57020b527d48943436e4fb717a5c5ab027e239cb508115244f1ba975861c0beebbfa6a7ff1e47ae135eb2cefdd8976c48ad71ff19549164d22df54044abb8cf86c7281035c00f471514762b6224b2c06cd496e149fe43262c554ba04735df40ae8946a59d87d7bfc4573e5a1cc4bee53a4d33d301503955e405c47cce974a8844ad1990c568dd07dcc1a240dd1dba5f4ce864321967870acf941535926e5d3b511a97924350c9019313a56816a1abc5c51aa96bbfdd2c7837a43320ba964d047fe5d2db2800471679663dbc8afd4fb8ca4d39c5735281b9a668b9dcc46c4f45881a2c9f841dc52f354d706cd32ef5dcb4a9f2cb5c1c7b4fc9e2b56e14fe10a8492f7137e580b6f117d1cae58c
|
||||
384:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f
|
||||
400:0195b4bd24e6a6295a3a6ea05ee7717ec07eb6eab50bbac751f66f6a79fc564f7aa1bce8b62b87dc25e7b45d52ff34f4f9d30afd0eb33eedac4eb19241fd80dc05ed8265974d1ed3df48c2e027b77866dbc235536b48ab50f628635a95c4430f8c237d647fd588e0318a5370ee6342eb802c6e584983ec6aace4f486aa05e4ae68da28307cd64f1b9572ba59c0c59ecd198dcae3d6d36e09c80d10c877a88b8779b934c6e39dfe0123c922be796a5d962586b54f6e9fbb467f72534be73c4374a7ec7c34cc1eb3e3934505d9edde91c210697b2e550569bf6a3e1adfc2db5d364336c19ac4dc17e3270601ac88f996a5efbcb2d241a1c7acc8ab4a354533f912c9e51ba898bd41f43486290fa32b36a760de5df0c25d5914f3d56004920c6dc2e1724a95eab88f61cfd154dd47fc8b62702e7780522938fb9c035b494a0ace5a21c09f0cd465a834a61c4c979b093a5d780141cca82324f3dde77f45efbe46d3772831cfa93869d144740bc4d0948bd60df373ea24e4be876b6dc8a338e1853cce36b9415ee9aa9077c4cf9b2d482f70
|
||||
400:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f
|
||||
416:5c3985f375cf6cca081dfc118d4460208446d21d3f3d100e883222cabddda538115ccfc37f68739fb6a1649c55fd36412579ad1c66908b87f252cde8ab32386ef68c6205c8994bb7d0f9e0fa5e1e6d8aef7064b0432b1a03b3dd4fea645aea15216c03f58658df21ca8792fd2253a2a889d1b223efbd60e10890676291fedbdc91aff403cb98fcd96de1d1481bb8103f157780ca09ab5490c79fc9c60fe91d5325103441b986af5e9a0e323bdc98150e45a2e7cd20997c58a561c8698a64e7734ada60ad1669160f92c07e56360113adf699c25990d0172cf67fa8e0e4a3687ac23801badd498c7a1a411ffb1f96bdfa5de99d5a4d6faa8feff99f624c396029c5605927ae0b7315dda77d092d6e37ff885669e7e60a823fd06a457785be0a151786fb0a7a3a8b67a4cf47788ff8768e24b38df7338c87c2fe3919e74e923cc8a4a3ab7a21db18ff4672a25d3652be23b4ef02e958a77d7df0254d7d54f6ce0f3a4572ef675782d0a9083c6549304cb302a03b5692137a2fd65f0b5a21eeae19c6535836844445afbbe2a236ec3fe26b7d7615a4171a6900620376bf27db1479
|
||||
416:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
|
||||
432:de81559812d2938cba8075ee1cfb7313173305486f59e53abc00efa276653d6cf200828615a9f51a045ee94017723aa431e0d4252205f8b45afce15d3654fc638bc32744488e97f4f7b9958694d40403bec42a1ca97011cc166580737b6fdd71843b8e9e876793858d5b7a06da8cd7bcaad4ab2db8a5635f3643263c9881a9157e1ad82c2832e5894630dd36cb9c65dd7faf147b57e230b5b94417aa962a3f63bf1594a99adbbedb9c03bb9d1a728614032946ad9743c514948b3e01ba8099954dd5e3a0c157eee3e0038c8254fbedb10c685d89cb0555ea7d3f7bd5bce22431bb274ca8421af1fd9842cc9d8094f2289b6e0f4eaa183f316a203b1aa4e6f8008d8576b5936f715ccc584e4ccf1ae81ba5954ee4f5d78ed17135cb13af0484f3664a6f9639a7440ceffd5ea60cc5f391b7cd7201b0059e3391eab6cee0e9ae0ab7c4b7e6480ce7f315b84d8321ec4d1a33cce3ff8dfcf9b1299cbbfee9a5874ce5a1c1dd89710a3119c1d73bd9795d85ff3a01d88066a7b2377738a2247f3cc02072f0f3ea2e3adf463c157e9d662167422db3824df31c592891474fd4d0268e0c64ee9117f6fa02acbbec532d4f9801
|
||||
432:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
|
||||
448:957c2adc952b9187cc7da773714fcb6fe574a07684c3d5d1e2d633354cfe248406b95f0e9714f276f156d97014cfb35991c359e07464b55ebf67f745168b386bda72f0c2df5a7f830a5e4629303443181cd43cd8d30a415cbce0f503d10a0f63a34eaa3a7ae962111caff5fc33d012549eac997290ee78f4c9cf95c148138b60734cef0612983eb27a160bcf5434bb1e3e6a6c100dd55dff25b04d738bfcedb84ae2a168f3be9711bf74c0c61925b61b321f90bed4018f0798b6aeb99975d26244606e1b5632ad1c1019d0ed0f254273cb6a48494b92e516dd1c90b6e48b407179fb20426ee46a8a0771f1bd67b153bd7625e76ebe052d33137ed1cb8b0574eb7c93176d6ad88c5e4bc47c8c9ef4bd54a46fa8ff32ed284339982a1aafe3752648c55f01f5ea80c419aee39b0590de39f0e34f382e3463bad7b42aa17b5eeb2e5a4ca06e9dc3c254cceb5567acc56fd6848d5d6b259e79452423d1a541c6cbaff928039186f51bf1800d859ed932977df30fe28e00117c1e6e8e77a0bf7ca69e264fcc96c1f75ca677554e9aefd06ce97ce5f0edacd50ef8af9653ec3650dc78693a483cb9686015565ea96fd0c36c13d51af320fb8ca900802ae94fdbcd560e
|
||||
448:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf
|
||||
464:1b30a6f0f8275f186d7dc2686794411242cd55389a35c2a8f0d276138b9c1bbd2e12c152def0bcbdc323bd3e3b43fab29cbb67f5ffdf7450acbd8c4844e17b196d68f0ca6c0075bf06b1561432435687a998658d62d2f9945ab9d2a2b9cfd7d4f67bbf4c536ea589faa7a438e3cb0c006a2bbf2f90c139793c6cb41be18b4948841a2d31cff96b25ad0f1377563a4acb28f64efa006834c3335e604d94873e7b8eab583f87c5f4e096bb27f1c1af45eb906953acfd7558c978032624355fb2421a636ac6433e7459b61b0706dac2f4bbcaf18727dea1f6100d34eeed31d2ea2672f9dfc853e408736b1cc03a6485496b6cfccc6f3481b2cd05f5569bb36456970d0289aee8c0442cb85b0659efe9872d5e7eee0218d9da684ed0f11c489b49f5b974d1a397bb31e15a9556dc1447018a4cb40f1e13db643a8769e4be78e22f354390563a7a7334445adc5e70ad26623d248721a0e3b8354e526f573f8a292e7d568e63fa38b48e0a4ce7431e890ed19b3f824cedc84a050d4d2a7818ee26b8ea804700ac840eb4bd3a4c1cc9655380d13a86a69f03f642e7b2337d21116aa7510761704098bde0cd6136cf47858a26e4a11649920fc2cb21a51f2f9330095d9de06b5d72b93a67a59ae3fbaa4652b82c
|
||||
464:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecf
|
||||
480:8140b529f455d70afc9ee6018a2e59a1ae060ccc18908f3b0ee9e8efcbd3f0124123252c5a62401b3c30ae2843f4565f19d6f4af186dc35ce11fc8d0d23bde67ac133dea138a5c27712381f148f1756228e0ae06a0795e8fa3e8437f87a6f34db3edd5a679d8b93442e9129ccb3bbd2e79d4e01d57caeeb085b5cf24200150bfa76047b850e96818faabd768ac5e2dfe210846008bd76d956352bcc5600fa77c044ec582c17b8bacbef9075e9f99a2f58fbf8f102825786b6785428f4ac15756c7190ba822ce5c0c571940bf77a22474f8eb6692469a3faf69694301d5c14d92d9995d20afe38b9e58aa6c0bb59dfabdb2aebb0e7b11bd2eba1cfa05ded46cf1dd1cb174dc76ff6784d06f6062fb58a7760284e051cc1ce1144643d902881f1a435130d3a5d7b2442fc03db9896d6d552afc14be38263c63b24659fff6e115b795aa1e1d6415e67637b0bc095de9dc4d464b9cc00dc47cbb55b3b73f3ac03a8ab933be81986e9739c79169e51bb90b1664320193df2368697afc9e02b9d9ca09d7e8710535f512c17ff24e3bfafec233f799999d8be0bc8f460fea79d8459ba17d4efef64cfd90624864fb5b220bc3b77d21a3db10fb626cd8539245398b008c93205254a60c73f9c19f0ed4f4152311ab1743762d859b29af7807fafa815fe9
|
||||
480:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf
|
||||
496:569e7fa1c3fb86f2f88b26de0fbbe7332900ef284696d3b04800b0d81d09eaffece090063c472a180f237b2d4e51b2be3f29c361fad95789ef5f1fbb07059133ed74c3cc544032021d98894be3202af6c77e43f55755afe31ac5b9e5d73d1aa8ad059a4efb9fa10f76d88ad0bd792c96f804254566d4c86949027fff96a5d05c673eecb52436737d329298922ebd45d77789104c6b0885e742e45c4d2fd283768377c09a9925b3984828d1a4fc9bc2bc256b28a2aff31a1ead319897441fccc4b8f3f2c82e5c64cd82111de146cdf7652a8147076d828f1c50b67e2d060deecb9bd2b84a8ba13f0a65fea79a0f47af74d3f03207a191e3a5c9087994846cf176063c196b77271c7e8560ab28084fd1e394d9c43b07deab40c48c05eecfc5ba42ec6d36724eb30ffa5e9904318c1242b0b113cf0c7a168da9197abc2a083f371c526b4afdfe1f1424b290fb2bccf48a426c8f321663c767e3708f37fda56968f0b5e787b67d366828a3cc16266268d92c8afdced356463dcaff0ef568c87653a308c12b69649235f7b2eb391f6c54df1e96451419bf412d2ca0f6d34ec92e04b7bc618ccbff4433e687dd147c5b3fdcf4705078adf5d7e370ee992e021329bed281d0c086930a3661541d67d4af188d882ddd020cdb7bd0c65743ff41b6fc7fd75237e02e7d6dd8083afb544080620c41
|
||||
496:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeef
|
||||
512:9821b3449869f2cb0ef0a24ecbff9b33a73b3cd54bde63d343c426a36c68d1d166c13d02ca4d65cf78e953361a4d2a4035fcade9f3d35d0ae1cff5b85f1fe5c9f3a9db9dab6c10b8ee7542944c84815ca990bf4bcd7062a8013bf852ff3b781f60e29eb9196f31b0e9cd566b7c906b8d930c4d4f410793c1fdf7c8c8ed913469c2506ccfa1c029f383a9eee5a95f18ffeb1f25084c62d6c9fab1d67213efc1ff08f2a33a20eabb520d6997803ffe382ec2f1879465c8b166b045e8ef6fc27c8182d8969419291fa5641afb45ba1600f512a612e7dfca4f71cd63c5fae50a53fb305650e3805428bfb6689813e342425ac6d5d13c9575b629b9430cbb21bfc41c026fa3f8fcd9677bf9bb7cc14c447706a455e2d5fc90a80ee635fbaa589e2f50d35d1a1d5ded77bd970a1fe32f92fccae831c8e540c5cfbad2162dd0683160f0d614fef933207b4ecb51465ec0063ab31243c9a23a07cf0952b81eb02e628b9e53ed0c27d720f65be8f38b960c0286b8dc58aa11905f3d3c694d364ac0997e6b2e3886a1a11b357ef0b75cadbf77acf015b4cf6bce508f4c27f01048d2f4d811e39ee8501d4fb6d69fbb6159a6ba56629e54e798e872be33c191750168af7a47dfefd989c65f6b2ef8064aef83e2e902f68aa9e10a7d6ac4a2680dd0913aad62b5dbbe2f51b46bf64c950caee3b66f6e7857a64d9ccd4518d955f24a23819615
|
||||
512:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
|
||||
528:f02604963d9dc47382d2b835494b8591deeee437c38d4d23e643ef3d3d3d3d87a6ac3475667a749ee84cac055aa47b531eb22d58cfdcdb395fccd9e34e88ec8dd6d4bdff940e321899b700572badb5e44675f7b425a9c1c1969df684a25ee0974c8a9d5e801b5cd70976a6c5af27937c784f4f8d1c86ae1c265c5cb38ea1ee18bca93ff6019f1927ebe203514bf20548c7efc13cd91fc292e2c9ab9fc014d8371d85a2efae108b2afb8bbafab75e7361c99925a19d83f3d7fa51c0274a7a9796aee7451e783976e679db97baadc4aecbc9d120e01719592e007195dcb7b42439c5403ccdde0ed0ad21a7c5a2798919abe81ff72a2baa033002fe25070e14f3417e7076847e90d21ca9a7fa82b45f62d2340bc2aa729616c83bbbf2a6505f860ceca837c479eead3b18f50f88a63f9582e517b4bf51703e42c3f473f901702d3eb4dc25097169a2fa95729f295200e13d05567e5132268b3939250b8bec170a90bf842c8f2b680fb7dd6bb63bcc1ade151944030c0a58b278d700e3460e9d9a7453f0698de6fe4b3104f048d0d3c2bfd6d71c86d8460b95568df8a493f6e77e1d64b158329bec6ec126a24a1d3cec3beb2749c0d2f2d1c9d03708d0f0a4faf81ab0cc31e31dadba6e7f453f35978d49bd026c145188b042da98795d884256fb7b25f5d6e8ef42c927bb39c921d1e634bc94539076986afc5973e98bbd0e466b2b7e4cfc7831fb0d4da70ab31dd9e1584d
|
||||
528:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f
|
||||
544:ab5530701149690a9f3157b9718fb392d2d2c38e57b588c652a9af8580750ef2da9ac7f28442a1a3acc2ddc06e0cca15a6ad8c5a253c0cbb307e7d89ecd6a9d5e72c76f2589e11706713bd0cc4bf524fb5ef3c410eb88e52ec0e52d822f6fe14d744a09ec110171af24ce27a8f116688092d7a7123c2ae144fef01f277876e85bf0bf774350c92c7bfee5977d71f52a0d395003adecddcd92ce6e3a6c73b07786db829396479b10b92938c7b788b897695f74b61bec738526c02865b15ddb8d6a927840fabac0fc2ccbca815ab58689eb73adfb08d6148d9a98e8a5388aa6502458ebf02592178527681a12afacb0e0e1b861347dca374eb38f31d86761b5d933f182cfb3aa48cdcf17f08cb9563ab8928e6472fdf43143454f66b626d4e69b1ea0698a4571387e99fd4ee16faf826c3a5c1110522236345948c594c20e3a61e530dee291b79b7cd0e2b0fe7d0180ba1162bc4b3b1b3280dca81fd5a9ca8a227f77cef89896e5c664a75b787f45e9693147776ca8ec8ed99ced39920b813ae9e1e93214d8cfe5c168ec5f07fca092f6368fd952d0d48a49600fc0b3905486140be1fdbf142d0cc8da446d2ed4b1b42f09f09d3cccb95b50ebbfeff60a1f5bc44a9161ec3bebb94504b70fef1c36035a89a866fb96b12f122d2e5ee5fe85b371223f95664b7737784c0cecea980fa711cc263446be48c07e6da223c4ec856004f99b0b195180187aa73ad3318b7b23c9002590d6b42fc57e9b0891e70406387ed
|
||||
544:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
560:dee4d7750f0870bcd16faff4d65a5593f5d86f32a6ad7a519d6b2333e522dccadfab7890d02a6499d6487302aeddf9c52c929486ffb44b9ea9409a940d4486a379b0ed04e00421f6e43e7393f75963e68422ebcb2b87eca211f671dd713d59a6034576a4feb356eff67f33081f7889c684f971a22be68adaceb35d24d1947d7f5a5c03f66f3152dc3bd70f59e172879f50da9038a115986ada1277014958b2b19d8a158c097c3212eab6c6c0e97948ae15f146a245bda2495a5a860da0dea32b7794f77aa4bc91268076649255fb138a4ed831e659a1ab9761e37bc13839d1f419d7cecbb12bfa67c53fde957ef5f5cdf43157517f8021e89eb46df4762cdb992a9285c36b6361561dc469c2e9b5bbf79fdc8779627971e6d6a74e40fb1961933f182a1b270910d7604a680d5bfc2e5f66b6e4098a0b13d4c9b923bb56713012bb63b7a5cd1f9f1a7b42a4e28278e5766a3e484da08a7538fb1b27a15f7eefdb5fe28cf6297d81ce7c464b6f7373783c7d344334beed713e325e1429bd7bfdd1610efa551f0c16a6eee5b787f973a0110754bb681de8d17830996e993a360e1585b12ea8720fdb3227f193a1963f0afa7d59e303c27c70d37392fcdaefd5b85d52c2bbb7f19b3146c2165e35bda3b6c23f16e469281e10bd351a533edc370388a07e63f02b07db8569b8760b7c091529907893133685aec1cabbb8e06752f90490ed49fe4cf5d580c0007ea7e902a71923029237fbcf965859abb2d14f6c89548017eeed6d0d5614d131b6512c74b407
|
||||
560:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f
|
||||
576:a1d36653fed5f5d40d1dd0873a07b82e673c63f30f6d7c895ec6eec7fb1e9fce1f3ecc41032c94b3fefa4fe98f66baa353939c796be30cc1668d195eaf5c8556c1a00c4dc0d6ab65919a1d72950231c8969c5b02b7f22b70cc03fceaa39a5adca0c9ba1cfd9bfbbef5d4dbe74d3596659658cc5aa1709e4d60469600324514517e90d203aa7eb44612e58870e3acec3b8c969f47f90c2142128a2a47ac3d3247c67fcb051c82f3bcfc98dc5fdf5bef407e369d02f23d690f62cc5e41aeb2298bf2c971a66744bdaeb9832650edc25d09fbd1314a5d84477d7e552b81b3c5731b420eab4d679bb84e765ffc5bf9b4d19df96b22342ec09d808d509fe8c4d0d40c3ab9b1d40040b4443555d9ce9aa04e216567f05ee286c811c9daa6c1dab198bce81e03d171305f1423626132210f0143a514daa926edbfce9a234b3100590196c424fffe738d0137fba0532a7b9b4dc162b9b406fa06840e49b0b9cad3ef7d71aa767b8b2fbf9780f1369d6c5b34361f403a3516ceb2fa0a89bf1821574439dcf42fb1328415e363d9a306a3f720e23eb5041199edcfa10b865a9f5a32009906512202bb4ed532616b956d0308a0d713c6adf20dc03da7c9b29c9d409b2fbe3c7f30376bace8a3156fcb384a62b93c50561776fc6cf16ded8e968b27391af2b767ac890b57fdbb7d3a3fcdee5467badc7c0d8ce59a17129a3672c37259874b85202902b11a3261ce7a16b3f830d36a173a8dd3623db5f45c233c6456b8a2d0fdadb16356e5c37afeb7f473cb4a55f39b9ffb0e4fd96952b75edb5c7f4648250e
|
||||
576:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f
|
||||
592:4231efb1fe07daf9ef1a69137769cce0731aac9aef27cfae5b60094e8e8550cc5b83c31efee907f5aa9fc51fbffe785d7d70ed0b93e918b4d771c7b22dd72b3d78e7eedaba9689eafd5d440897a339a2fd814651166f74636518affd53d96ce9b6b2727cf3b87c1a7e5ad7cf839b244bb2561fb3955d848131efa937cc8f61fa8820496b779498ecb3a3ea1cb573d55c11bcfe1f21ca95110012be5f35ee2d224cc284062b27b5ef85abe933f8bc5f1acb40b2f42b24db4dddaaae33b67653145a2c20ec0b308cb7f2e1a4110033776cdca32115a2022b3427d73d1e3895c9b6f337c6ba7efffc63bfde50b2c43cb6741650a4ec6a742019c65581a6d45f8d62f62d3da161211e414eb6af9894383615b4df3d1ac5d5d878ba72087ae03530013b21d56130782acfe0a9605466085a8c8b8db96827ea4039a77b1d7b95aca25167d37e6d6ca8880da08588ec7c613f06d24f69c3e8bc1f0b9b8bf589b7010671a9737f57eb59e76523b9df0a94edbb85a5ad91a7bc58ac0df86e6fa68b36eac485b497a170bfdd798e1032376906d0b77dfe9335fe47ae4142dfe9da9b3d946af220715dfa7adcb0c7789e4566fb9acad513c054d859ef309cec2a196a5407902ae929aab826cdd056f70a8957e7e001a63522e579986f542297fe07226c946e832554cb4d8a0f579891abd54b7ed12247ed880574eb62f823b42cca3418fd03b9efbd6e490e92dcca2409c1e5530b9a02529fef02114f96bc0ee7739507b22e48510221e218c0bad525dec6a2da81b834134ebf0bbad4638d6e3d781db3335883256d1964bcfd37391e84d128c5c7fd
|
||||
592:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
|
||||
608:7cff31eeaa23800d7147e8746ad4e2b2e041a68804786f51539d19c040c4529d2c8f3a9eb917505eaf9fa09c8ae6e0d8d8f5c341e4f35f0b0f9b4ad99d7996c140abe8adcb81b6c96459f62b7e24e580614f6320b9d9a2f791b7c2aa9de02f0450819411e80cd62d67ab56f207441f823e8a40bb89f41fbbe95e26359f738ec2c7e418acd5c054c18631d573aec346915979d8eda7ef287b96053e6b9ad1ea683624fd02b3ae6ecf0db342a7e5c46b4b39f5fb16a52237689977c1f2d310fa7e940b9a7c6e20beb9e7a8c0727f0c7461dcb6fee73b4444822776345d7db060c7ff761e2246250b2d7a48e4ebd1f084fae6906c3120f59b740ac6bfda70ac6e1168d4572ca2912f6891d33a128e439bda816691e519bef01660a80df5d6e7108b7789950ee523b9b2ac8d998dcd276ad09c479265fc9679008174cac18ab8ba38f0ea3384f3e623daf1fa7081d042203a4777e5a245540bfb1cda88445f056d4668256e719352a4cd9d02cc3f0a3bf24153aeca33ed0df4ba73d5453a40e79a4a1ff462b6c9b3f3a129be2d27f1ee31b5675ad4d9c1a4567c57d039badc19676a6a029881c6c30616a8d32b6af83c6a3fa412a6a383af1f6cd38366c1475670dc15a9406a22e33ca2e149bb7141b8e39f1e437a13cb0ea27a9f73f7f01a02ceb8ef6a70de8a33e68c6f5495058a0b5af933bbcda9451e93f6e8877938ec67728d48fce408e803351928ea05f2d0d53ead088eaa84c2ec158ac9c036ba602399d542b687e8e0c80f7ea642b09abb61798e54c54886c88eeca627a8012254bdecd763c906e4dc7c31249830278dc4ac6a08cb22eb2aca2cc1bd54da06376e741149
|
||||
608:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
|
||||
624:d49acd3a39ebf5002de6a7e435cddbc5df1ee700d41c4f8ae145882f005aa149edbb81506056755bc660208b79ce20927d17f8246689174e22c9e5dc225d86924de4ab1073d6f9762931ecf002c9149d05c715b05d7b56dd0c2d715aef361084073d55b126a9e34390f49cf66fa1deabe9c1191478659be5509462b2bf5c0c6490c4a97aa9343403b5056de209afe24ad277e68bfe19c11e4b99d70bd7f1f0abcdd80ec552392b4e5b385c25e9703c992a340927fe1271dcae11fc44a1060b77bbb42fe8fbe92cee73fb6231e0c66747c5dcd0e407958707745d7a969605c5308ca858641863c8546039bbf78e54178dc3445285f6c4cfa1264ec44e76946b16c7d1fb40370bb7681cc5bd08f1f325517c076b83a0fbc9dd82cc6b4a5fe145df1d206934333f04940bf403f6a0ae6bf2dacd9d240f73d20ae6aa24bf6b8ae918bdaff2615eb6fe2de197420e085ded829a2bcd194043d2c7f4da31acb04a84123ee75cdb611618667b6adcc3677f0c5203cfb9b18d6994e1a3b05b01f97471c374facd2a380c8770f1baeb09a0d9b45ab4e32ded8ae5292c307a8f83352757dbb797c8a7dbac6d2f2c54bf86055e08cc59db82c083d2a4ee16c57127d335dc07a895ceeccc8a8c268873cad5b3b3f9318e5e1b46f1e603596abed2332e79cc8d9835e0d67b9bc9c3192671a812bb80d3d09a95110dd4191bbf76c0eb6665326c753dfa9047dedfb91bf6258e575c0305a46b8f27847f74020fd5cb6306b32f526286d2f69d3c1f7c77071ce622b809ff9706eec156ac3c6b31dc3fc112c6fbfee7e40a86a1bb634dd2f62cf3e7b9885fe6a24db8204e1424bcb996f53ca5a5fb823263e564cc08d0194ef39500c81568
|
||||
624:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f
|
||||
640:34aa7620dd642155a71ef5f64dbb6e226780c86774d9892d7cfc2f11876d05a4e51cf71d01479119ee35ba690debba287a0a8a2a5f984eacf6623db41cc5f8f8028cabbb1377d010effcb8cdfad1a9f583e2b8357760ebe68e4d8727844ff55277713d27e1c98290b4d83cdf71a577de138daec9dbe03fa7637e5a42c39fce6540f921c2248c28cea6787f23fc8046fb6efd9b3a1ffc3fc335f130bc0b4cca337dcd8ba050d8d87bc8da7c0e286503526e46385c85a6c8bd36ea803f3bff5d37dc29dd39429a84c6f35e83a3192db15a3bece1fa7648002ebf8feb5a158859831f10946c94a834ebe3922a71bb424e681a18fbd7feb27cbf889443f6ad1a94a0e48ef3ce6378f123acd41abf79621663a75e5f14dacd0e590fd9cb9f50daff9f9f109959474c9841d9fbfc538947dc98221df050732084f672daf8ae517fc9b59617c5667c946f3837a21a1c60707c8f086d27e856df624bd7972aa9149d2d588dcf4cdb66b78b257387d28985e9e518631aa1b4c9e272eec70ee9b2b58e98983aa14461bb6a468c6976620ff76855570ac7a7894199de1240ebabc8d5dd6aa261bfe09d8bf711f2175977d241e5a32bb99f4486a7e023e5c587eb952ae908bf48125a74ed8a675e801151bef8b226d10cd1cb0981697b67fda8064385b3867232071123128619c05f64fdab86fa6903c2651674fc225855317f7bc47a0018db70dad91b08164bef0a2de82e62d6592b42d8e303aea2974ddacec20efa9cebf99ed23a93582388bb75ea7bb93d2447079b8968644747ab32b3ac10f6445d585eb3011e1dc12fa65863e616c0e44fb36a978852a10e913aba4239ce369ea1358f32130aac17be13af5ccb31e404fbb916a2ca902b6c84c2b7b369747454db4844
|
||||
640:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f
|
||||
656:f7ed0e6e0ef7d5fa1d23f895db539ad14e024902f30d899dd592a64a4a044b191f545c72734b2ecc70a1a752d7e55acb2f28503e3e9e06569faeb1bec2b6e7f4b9064aeaef41bcfa097ba3cc416505dee7e2840128cb1abef3e4106be9add513c3d22646211de6dd6fa7c7e2a40a2ac70b3724d1e5875c59ad004d82c2d3fda06d9f5dada4345d2f945f0a7c3036ba290b4dfed691688140b9af1b82274ba844a3d03b86556b67babd856e6c812a4c2521ce629596f28267e7d3cb7fe30bd1d693927b4c85fd50445a1c4753ecce75035996f38684685211e5b43ea5d32e54c5db286a70c573681d386480a499488502be1f51bf205ab3ffbc61a86765835d748e6e2a81410389ec98eeeb2bcb2c16cd9d3514e542021ed1bd9a41b3775cee0af410c6e3a29db39ab9a8913d7b72ceedee6f06bcd17178974d93a037ff303ac8a58b50787067ace9ed15d12417964230712cf154d881968ace0cec64721370864714739670441fc421185c2fa57a2a0bf9bc43a1e4cb78c0964ae06789af36cca8f7f85364c6d4be28fd7f275050b0e3b88b3a46739cb5ab2bd6d301c03dfae838b3137d085ff8bcdc593b8f790d6c3b56c8c4901ab23e5fe4f5fbe9b6cceb4beb06e8bdf1d6e8df98b6e4b3c96f2555431f1e634e8b7cd7919d489188c792b89b538e4fd8334fa28bd45bfcfa9dd9796ce0849f99b4c1c915f73ec0e0d59859f3100892f9c9f5793e5d0e908546eaaeb8bf4a8629386b1b28eb94d4b03dedff7b101a22f219a989285cd657fcfd3b5eeea8151e31ab11e38bad33bc40e519a8450b5929779aa90fb0c28ffd45df929c962faa2a342c5d6c7170af7213019e92d84758e41a4545dced705a21b6c857e4a2aa6176e21933626f363ac758b566278016e7088741cb3776ebe0530e26fda6
|
||||
656:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f
|
||||
672:c324cc370a3ac69bcd8312a091b00dea07de0b5f3d4335ef68b596926fad005df403820803a80934f87d0ae02bc5ef9c25caf162d5b0638d0ce61b79bc0e0105d3c2df29015dee30fa123be4c5ca9e4ed4f9388bab22e2b7602a7a76206a311d5bb1f609ef60b777227326efe17a648f3b6febe3c64e8160070d5b8f5f81a5820af7b69486051e65779481e7edd4a0326b72d9292bfa5c553384f66c18ac573e848e1e69d9288cb52ab7bba98cadc6be8a71f5cb6ef23baafca64e91e0b451f2fb32479653a4f54e790dd7ba625713a2d3fc8d0c54d2dada99bd4e78e819ea0dab2586fad553dc4d87e8f45c85d1efb0f9d7a8da57184a2daaaad2d174c912e79997269f5e5a1a9c10f644e2280956f4836e8feea9b39557f7a928bbc6641fc61b613afefe04d35feb60fe33d03ed772fda778fa8c6fbc568a3ce516d1d7a731bb4cd3428caaeb2fb72fbd3e320b868dffc0794a0749c7ff42699c07dbc576d6e52105ceb16478683818e6207bbd02b268c45496e7841df2bb49faca2e45aa6cc5f50e8c845fe19faf6e4d79ca84d1437529be69ab32ee97c21e0002426098b9ab6c043f3fca03379d3d047701c43127ffc5d49543435c3c21fc9bcf798dde20b764040061f89293d9f2cf793e6e2afe443b423168a8fa9bc0484bdec7949e6a4be68a7f1afe8e6256b55a49827f18054a3c09dd3bc8c7676e86b1786e04d279ee61faa805d9e574e17d8a0d366f127784cad553fd038e237f6c5e8fb2c94817bb76cf954eb5195ede1ff597690239be6e0f6ceac8107ac4b5c843e4c2edadc7754a55ec64a59c7d88122a8a353bf8b75c56ed1aecb6d3454bc352088ce570bd066afd2402e8da33d4ec1d670a06030165fbd1f25407eee55b554848d0923f77b9a263af75f83b5bf702dc733686d9cdcd977da36d321844ec1e5fbd38c3db11
|
||||
672:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
|
||||
688:d4f095f98c6f6d5e536668ef67014b1cfaae8410377f67505c1fbac8f1d5a9b08e117348803c9dc1a06faa05527d6c9962611aa80a027ba9ab90f4bda65f4ca70dfc0008b18229b4c7e5b8970feac4f5f0b2012f7acde2dd835dcc94175ed97ca691f66ba1e86e86db2e1b546d24b44166061327e5e872829e1693671c42fead9921bfc9a10eb16dac02ab725ed48b34c153716c897ba91e1d55d53e6954bdcb2653f49a5bdd6f25b2ba109ee0f9ccffdde38e7bb5b6bb23ee4aa062e3148ff5e11fca8a484be29849aafc41dd8d23c6d051f58a998717a96c32aef897f80f5143a8d9140965544926540f6a9f33762a97ace2a127839c193aa643d9e7277854f362e4149b39688af16767f20cb3340df8a61a1c850d1c79d5408762985341fa62f2863ff650cbf1676f6e247987e317691dc8b77647db6d26e9ddd53923508343f1404e16e2e13da4dc1bf51c9c2ad2e604d6843f2a506ab32dc893c9f6e392917d04b4b3f18e7cd0e60d170987a2a479570bdfc4a933579a19daea628e3966df59285775da8ed1ef1c60888c7f65f8ccaa21fe4196d638ff5ab9e0948b2b7d6ecbe98f38a22bf9cfac14d5a277c16b6c4b43999c092d0fcd0b6f4d4bd0b7cbe05d03ddac0e2e8cc70d8627a97e2ffe0f7d7d5e82a1a59fa190bf798531de3c130a92cfe737f3d41ae67ff9040ea86bae64f0035765577326e595d08fa90b6490a8960cf636be26f21cf15f9628554e0c55132274a7acf6cb738ad535e872e591daa602b17c64f296950b2f6978f5edb11063d5d838418e6aa960fd09f713426ac4d522fc3ebe1a440c04de7398e9d787a5209d5720e17946543a0251921d1e61cd51a1b71d83cd40a4b190ff58668a90d264576ee675110e17aadb765d4e8bdea5d6f8bb87d558ceaec33f81facfe0b2cc78b37335b91aa6cb7f4d749302df73ee9e01a936c78b2b1a8a3d2e949b48
|
||||
688:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
|
||||
704:52aa88885c8189072ed6fba7972b92b32544c1ffae641cd7704987d5661338d5a86f45540abd8fa9b36df2a74ac0e7fde18a9b863e689ac6c50ec81cdea4ff74ebba9b4a5bf401479e3c7b4c444616f1b385e0b335c26b9ec89ef10fa2f5e6e7b13c7c4ef9b88bb9ba10a8715886d6b0e598dd5a2e8b5ab98f6f5a6855bda241beeb0fbf53869254a39c250395b75ee8c6cde6e911f9d110c19759ee93e90f741b4620b008c9c54cbaf10d9cd39855f6493a612e9fdaf8709552c4f36eae6831edba0bbdec5cde5193e0ca24c7afdcd66ec6d3d94ff2fb1d0a9b71da4f0d6638fa924f780b3cd6c271685d23d6018bd7e87a565ac9cfda02c5d0fda60b2c076ffae6aa94f73a58526c6b7e1c08384cb0aa660c6a8b939f7d7ac7ca57b7c18b9be7e496fa0b94771a8918a57a3fa5dc03ca5b3f47b8cd99ce97d9d01c27cd97050602238ec7fac872c1e9b280dd551ae59734ee935f4c1257e067f5de2b6f2ff532cb5f45e228a6a961d2107835874aa307d7d9e495eefc7cc1039745a478a61eff60083689828f225304bc3a22524a6ff3849ef260c84458884c9b011b5660988de0e8ef47ced9cb5ce31b684c22156ca0ec1c60c2b09d487e5672e5a7ba98a1a4c8d0390420190bf2a3d4d5191f164b248297bec98e656742770849e9abc22156a8a214c464ebcdcc0db0a6b77ad29987b6ffa23cf1281a5316c2db1e8a712ace87d6023f1252ccdda51722dbd47b758dd12c44c4c356cd005d42e1a7f1bbfa5b4b57a0fedbbdce6e0ce0fc69d92417aecb8e7d7c593a1d1e74e58273072da7e4bce4f4bd94a03f1dd87d3a7089079ae6caa80a835109d984b19aa30f3e50db4fc91ea93182418ab500a44f521f8ebf7e202388da49472e7442fa407bc6604b8c0954a40f9c543a55a436a2eac98dd454755137602021130a9e13cc5107a9f23fbf9d1d1448a60d09fbaeb7472ff3d227df70964cbbf9bb0a35780cf7917e54
|
||||
704:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf
|
||||
720:17d8ac181eb03a99368dc6cb4a8e3b6ed3b8ebfa2ac6e0f988243b96066031261827c3964295c33a20e45ec4529509e8dfb754c69e5988e7b67a737365980184e935fc8fe51b8e5b9514e2b61283872320e75a43aaf92bb9ac44dc0774068d3be4a1497616d5867321e03ad9e440545b82a48bf5a185701f9683ce291757e398e9f4dec98182493d977dbf57529c88e6c88ba9c92cd6c5af668d9d37c99d85cd11e58dcd6b159dcd1c699c302df95fc9e60b651bed0e571ee6db8e711d0bc7c69e52706be5a181fe213b28c70d2ec92d45056e29ff2314367c1695737e73e75b7be408cb3287cdca8b592f83fb03870ea88343331c3b02f0d91552d673d41c2957be143bd9dae64eed6c71ac8d4a8f627112720b1c5b95c2555bcc4fe8727fdb650f3db80a9c18bb8fdf885efa2cfeb4b56a1f1e78bc670c44fbcf49f84daaa1b9b1c943de2068364674b51a389dced863c8b4950bbf1e706b9d5132319697da0f5714e0380d8d7411e650df78f2e875c2178105f86dd0b7ff49f98bc61115e6231f01954c3c73957d8f26469b9b12232aeec1a592fb1fee638e02c1ac8c795a986734e896e79ebb510d9956e6fdc2421dd304c7fa11db82dc05f053d7fb0b9b77c368379245c2ebc3ff9573548985eead364f65d7737c84444b020b6875b0c845caf9e521500143f732cf13dd493a7fcad33299cec6ef50a088a1ba6aa42b9fa1bcbae6068debf5a0751785ff646bf79454242f784b70b6b36f8c7fa12469faea65dcf2fb8ab7548893c725c139514c0a317dcc6aa76241cb76230e9daeba2853d3aeebd02901038c53c08769abf5d3738750c6f2854071713ea513838d4efdea23f13ce194ab3e3adcb5e66504714ca084198c4fac1ed59e0e112030142aae46f89772a2440555990d659bac5c05c4bd6f7be52de389cb581f7a381759749e103fc184ef880bf6d170beeb5c931ac02ecfa92321013da446d89d6ab564da6d7865cda50677ce5d352ca93bdf702736
|
||||
720:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecf
|
||||
736:7d25eb22236666c1574748f0fd631c8694d573df66e16bde87491efaba83b36d389ff10fedf3a8fe4689d57826f47c5e0eb47119f8f6e61c589602762a6c3a7c3be980b9a271f721483ada30887e5dd6d75d906511b6cf422d41aa7adf1d1254fe299aa5faa1be4b95e63f235e26fe10dcb60a189ae415016c5484989a7d32f51494d9ac28c81822eb2760ea734da2320f083d3c2a708b4a68569073b11e634977b2aaa053b08c4ef1c11bf92d4cd9dac7ecd913bdc4ce70a5c9f0d559cfd98cca12c43c8102a9c89349702c173defef8222b486c2fb63e2b0ea9b1a103550cad8719883f349c9b21c135df1cb84d3f5ece4f153dbb661abaed30574c53eb7922a72737a92d4baba008bdf983a56bd58789242f4176e3c65031dc2a418b32a7ff53f4557cda34583b70710c6feec420938087728f9692c21edf00c6a8cb6487d8f51dede758835cb716b383dbe90fdd90478687b1da45905f0ce5f0cc2765c0737da9810c7ebc698bd2f00d0e905fd86bdf9bac5ac7ce4af90cf87242356fdbf3ba0cf19e82daf21d2261363e8b30187edd9b1339f8f48afc8880f71c06bd59ff7906e2847c5129ac20d2e68622b34eb29657fe949ab4953232efac5eb83efc010aada059a5073d8dad10037fd586ac93dc5417c916073765d7e1eacb3dd076f22809d06dd6b0c90bd776015a8d769ee82e9963c6153030a845131c9ce8f8642dee4fc878c7d727ab3982c8c3394482124a32ff12684991fb2114f7256eb3421273129905abc87de9b27a34009440f8d4537c8e6df11209b7289b84ace6f5d63677fda318c8f55f6535c270bc0a39b9a1d05f459db316415021cd90a476e10a342499b88181c2e5985902f761654380c59cafa90c0ca056c058daada2de18fe6860a4a5bd860bb50b348418f668266d73551d38c771266edf1466dd52989f3551f45e3075d9bbb8c95d8c8bd0f062534bca370c0ddafeb08c51781126b785a176e9410b054f66b584c4da0777970a141598adb1826d6f5038da6f25f013fbfa7
|
||||
736:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf
|
||||
752:0c2ace6d4227b0314c8c9b39c2090541759f40f9d5d0523b25f081436b9982bd8b2fd7db50b6e6e8cf5ed828854f549c6d6f7b768372e73dbf7c834759b0f01d3a1ecfbb6d19b3ace85cb643e7d69a9af7d591608f266cb347298eb3756da5b92188c6d9e1dab31cee666b5dd06b3077a21bbd14479a35701bb5a21f80417a49cf36333b4da1a7a1871424cf6c3b90a0530c9746d75977b585d6a621d08161a3695e56b569184f8bc7b26519505422f220a4f2e20d5b5dafbe24a0811b675d0d5c85e2180ba194490f9ac758006f23886abce9e06d42b8b7519eb2c77f2a0545fd7b36ff0f15544b15ce100ac7a96ccda5b0a9d7b657f93407c86a9c58e08aa9ad13fec40601d9f7c79225ef8b8b4029f4d470d606b3e30acd463dcdb45c50a8b1dca6063d56fdbd05326a75e6a16e8b6fb41c3030b8b0e613694e8b877662a3361c95f0534599fbfc9a623fae8a119e98cb8068a911cca7c4edc105d65b5395d9ec3b75cf73fa4b371e3319f241f060b84c9760403395913abdd74bb75fbe4693232a853ace148248f218e5e0c175ba82196fd26f4c478014ec08e5bc47b599b6f42483668925d7e45eeb59026a2589d76dd2a6bdc23c292162355938f4f7440ff5eba65c946adb900f1dde05a85b0d82a84a2ae9585695cbcce85a88d99c5f4fff8e153d947b973766c9120b5d1fe2d6e3ea9fad4cd732e3aa869d0a721c188fdead76d98d37a4696bd968e23f069506c525f46362acd222e845cf4c0665e6369c4ca0822eb89d3711b070172485d8447d203f80cc82a174945c094f5e9659fc7e3069c8848efebef09dd3495b06d10a659abbb363b78a79bd8bc2de1beecee979d2b3b504a054c66a98393ab0549311337fc121f3728e6e8821be49820755ff578b3763643dd7f3b54b4ba694609017849c0bda642a49e4a85b8eed67cd9daff10c980869d8e1edf95476e79c5475110d16cad3c271b42d4809c658c2a0cbbc5394fc83dc416d255f814301b8711b91605e73b744db9edcb87fc6b14cca8ffe14d00719b00c4f8f53b4e825acd6b9
|
||||
752:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeef
|
||||
768:a96c69c3bf2a4bfe67bc553c6028bb5f42ee4178f87aee7535aada824b72716a40af3bb5bf039f6cee5e4524c424b15dccd1ae02981ab382a6070fc739d8fd5666e097ddf40b0142a9ffcf069445cf50db8c08087d5a78421f526922e7e79bc2a149e585075720c51be341d083e9dcd51aaa6aeb69fb08346e58269cd895ac0bc2fb3291f74a6d71155150b5bbcee52ada0d08fe6e4afd2d7e5bc7c4e18846edf2be939bc46815b68ced4532136bffdd890a83393f75653bd983f1ce52ab699b75d0b7c3293e398c38048e778f42aa988b51fba10b6aa379cc1abd12291eb11a910f927d13b7a74b725c27db8c9f4499f3d3b0d25f2d8738280b73ebb29790ada6e95ff7933a189e34532e3124027e9fccabf23ec6469b425c62ba4e0cd68177c555af0e49bc3d48f4b8c43328b57bdd47cc2c1a87df7764e25d49395c6f353a66b42f41e3bd1bc9f6ba84724990d1978b34d740e0bb84a8dd46edb245259cea37aa1f46cb8fe54802b65c98986fe9dc61a03aec493ecc2b263682d585cbf4162d6a9a7da7660fbe37a2e89cf1d4dac38211cf3cdc0554676e18c1a43e93e90c969da7c1e5265238d55c9cbb1563b07a77535ae14b895c5b020f3bdd7cbea272f79e5a42e23025cb25aef30a7e0cd43d01d93f6dae36c5ccc52d16e9abbbb65928e0eb97d83c184a8e181c9d8430f3d198dc024d757ebca4dd2f011863af893d4b25a434e304f6db5b5d46e193fd83404bd97216c314b9cdf59b68eb3272789472f0e0f077e98fcf53a9979fd08ae339598d57a0e59c0bfb7c6898c042634ee7e32f889eb07f5b17b568c007ba55d05cb33f554bec6f7dfdf165f49b659d3e3af859fcb3024f6610b5db6b176f250e838fe4ba8c21cc5ea2472851853702cba5ba99b17df0a47ae3fa0ecb36099c22df6782f8d45d910ebb2aa701c60af0d55da51659da3bd6054afe5413036532741aeb808932d10a4e5af32ee9b28b6c39a5c91371a58de8c4220f8c65b0458e764dea847b07be78c41610e02588f604733701255b26a5e9ca572c16f32bb92115c078bd76cf270aca1a56b283fb9a67f2f8
|
||||
768:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
|
||||
784:21278770ac93e98b0d7a4a5a2fc7014e8cebba97b575c45dc3beb9edd7e8a07448639bc285c9e7a98014d2b40c2cd33ac6f14d18ad1ffa5d12dae454527ca8d4a832e27e0c94d6b870f77e3c11cf54bcd8a8e49a2edc6ce8e19bea61c7bb5ef4f75342d3f2dc5e694df575ca778c0246da3669553eb58c7da006e4faa9f58d530da166a051cc4bb1ca70092bc58a07fc0cf668558e28471f6f83bb2667e6b131a4ec76c291a027b7a563dcb373ae1de152c17865e254699f5a88662621cbbfae892309cc2f06eca8c2a6275c7a65277b63266b36a8eaeb31a3b76e0cac01b155eb0e7998c30f3c7cb9556cdf1496108fbc6592c2ef7a3bd57a559ce9d9f8dd30e39e223a8090919c302a6d703600ec053f505178e83af97259a5eff1b222ceacc74ba6ac3e46097bb62cdf8ced6b027c68e60f76c222a6957284912ebcbbdb74585c03e8867bea69de6bdd68566873e743eae0857448b03b191890e791529e4e2149f88130ab912bbeba27ecd75ae44d6554e33bcca80e9161b285329694dd246d0b146d8a8918ef68ba5dd49aea22adea00b4dd0167b9a4a4b5f18fa684bec7c7f628ea7832ee6fea16b20ac303fec7a8df1bb39dd8448d192c19e686f90fbc7493898a801f0f231603592caa5fc5e562b737f82b89de49ee5f2cf7ec5be61ad8b145da0f9dd2fa0e6bc6a0dc17613c48f5e1ca260d35fb9c807e244dda3372d61f0f5988b4f2cdf703fe507cd932ea0d0833481d2bca2dfdbad4ab50efd08e2e63a29eaf1e4155d6bc80f1a665c4237cf40d331ac1d52f29667c9581d5a66b7b6c629956553aed47dde70ef3492be6b4a9728f57469db1d3e830a6719533d757f69b6f400c7f6636ee699f0dc06273d70b40335792aabdf8101952f9eaccd40ded5cb911bd3e55d698b7ae4937a619dbb67c7b02fdf67a97253d0e0e3ab0a9e24bde2046ba82a69b7e1bf32bab2fbbbc2b02680e1c2b08c1099b661f5bdb2ebc58fd39e82c5d4ba199efcd73f8a1843fea9c84c083aee456aa811c9d6072aac9868d61f3bccc40c7b1a3aa470296c4ee7525ff29854484a05485c327186394dcab0a9b6fea8a00bdfc5ad667b85c66
|
||||
784:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f
|
||||
800:09a0113a78cf09a4a7e8ca519b63004d62f50d84c9570e7431e4a9dc1e7f9b2943374fc3a83961efd9b43c6967d9d3655dad2a1edc70b948c3ff10621aa60d6739da0bb75d434f46e251963be90121c802eb02b78560a0fa57eb0f8b7592caf2a91928c874573da9b859c85c3b82b93bd427a2e1a98ea8fd5337da73f456041a01f824bc3d1042f3dcf73f9c8809aedfabcc982087efa1953bc95d3b33a4627695839badb2ef5b70353e1ec2992b07089c747dd4614de1b1f273e8a22a5002b87d7dd2b92f7c9c5fa3b2c33e4e027e6bd93ca5072de8f918bd49ef3a8191030e83f104ddbdcc0e4f98783397c4e1d2c6fe009c4f2b0042e1c16dbdbb35f689dff9e793496ac33f6c96f70740a2bdb18688fd9b9b2865cbd4344c2a54ddc033a83ef3d134d5c8ee785f9697dbe28de6fa034caff78919b32af62e7cae90cb5b709e07a6ca844959fd5e015daed3d8cee560c1dc95dd5a4e1b30c03569fe3d9262078cbc48c294ac0603325bde7cbb9def6a4d828eaaf68059eaa27b50edfe83545fc7d2e008c046b912719fc7d72622fd73b0744ea4e023206f54797e7b36bee14a4f669226349d6cc2b5550f4543bbbe76e43b1746f52cec2cd735723538a34c9ab54db2edd22e6b163a4c5dbe7cea900b6f1cdb8be7ff25d3f18f2eec7929a4dd3d475d6e526c8644430106d02ffeb300d4dbb19f1f806c750f1838663ba70def27ed20f16515308ce942fa1ad2e8516f5df37751339f6a9a5835e8e848c257d25f806c5d5e0562ef2c96a541a8cda5950d107c23fbfd6947d68256fcba0098591b6b57418919c23d0ba37b2368669fe2701c4d58b629be2661b5f27d2b3de75fbd274c2d626350ee6da7861e5d033fd1905da0c1c72ddfebe92af2e6a6c7881f6a98c4b62057478d4173c6ac8d31a50ef01fed21177bea97cbf382bfd0ad1e5fb5b4a931f62dd2948c3a2b94ea5b4ff55e80187ad453c5b8c430494651f09acb764b8c44d47305ee22dc1289377481cdfd2a8664cc764b0982ac2923a485db4e8f7ad35cd08820f5bf854dc5089a077aa92a2f175c3f1771b14102c52bb2720619ffa98ebd94ff15ed62b8d24f9e02dd8b8f454e0d8c74f133df512cdbbae7
|
||||
800:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||
816:3563439e39e10a74a84b204c7e3aa88695514c2c2b4575058999b0b2acf7221ebc0efafca23fee6dfec9640a6711d1c5fc903c99df596f43c8ddb919116c3a301a8f526d87b94b41c674093527db68aeb63d1705015d4c5f14099e258791ceea5bbd1369ae632cfa42f5c6d85520a5b8e3bf9691ac41bbb7569d44ab7af84eff60f633fc2be1601778ddb4f8481f940ddd8432d1aa898d2841aeea92dd4ae3b83a2e736454a8e779ee7b27778fc80b35a2c23d87e4b9e3db21cd549fb46fd8d37a883d4d210cc4336dd2aba0501db3c7ec53c5fce208b67b236ce3a446c036872ffe4251d455a444c00c62672b100de3e40118115b82ad2c516c30e49ebf2c3e8b16e1ed575e1c6c200c95a1482d89f769f14a2ad11877cadb3cd8d8ac0e26de638295a4d19d900d0ec6f24d97035e61dc8f4a5026269e205ba1b3bde1c431d56de4dfe0dcb979018ebb0e075fc712bf0114e3788a7cdc7ba93ade53a0e08dee265ae8ed1d6345cc2d5fa931c53e14dfcf3bc61c4803b3e86b702cda53efe0f6f0c9c2e1dc6e754736a276dabd46217b98ba1063a7b041d8d2685d9b36fdb441d3a23c60af648ad504e8c00301eda5b65696cde206d549fcd9822745aab3079d116905652052993e28b89e01a53db7ad3ab4756b33a024930a2b8e4fd39dfff919e8a3ff69d1f09453e0e9662b9a86e9956b65cc1e0ad33ebfddf19d13cc9e2aaf8e6d2c416975ab56f6b2e38c3bc00b31643e9062dd18a39888ebacc284ae73b6b9aac6e6b41e4fc4aa2f0a3c8a5c89e40278ec0649187e8a27b6240f8b68b67c84dc085cbdeaaa0e98b18c97785e8924d6b15899496c1079368dfce78b4e1321cb5b223ebf963231dda79a9c3b2c6f4c84c8b8f6420f474eeac754eaddd8c2b403b5ec2ba9bf133da6319e2a9a33813b94db2d4dadce0c2843a32ea06f75fa9e73752c179d8014def50b102e2018f3e46d00373660a2beb7abbc1c73d352d8e163a0f6cfdbbbeb82634bea3992efc2bc402a8383df91f7fb2ff0b7e5b87ba90ae76f920c7028cbd77fbfbcb6feb1cbb8656e0271223034edcc711a37a5e3d0ea3fb4383a5c2654bac15ce4fd97caa0552673a7b7409ed209ea47e13995467573dd8da2245a5d53223cbf3a1645a0de
|
||||
816:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f
|
||||
832:5d06971e1b3999c61b8c2ad2f6c69cdc1c07f5dc736daa78838c68127564bc8925ba600e892c04045667448c9be6101dbcc99b28d8fd809d31c2c0f2a0ce9ee430754588703eb7ed65dfd24f316710267885dd6cbace7d6636d3ac7e4d654b7fba954f2b4dc5164f21e6ccc3cffb9f430e3b673a7c64088adc8e841ee3d1d83b475808992588660e8756f438065f9a93b3de2e3ee0a5229df17c830d4c1a1e3d72e829eb8d77fca6b4cabdf16d0dd00862a08d899062b9e201b38dc0f755f08658a85ad83cd5dcfb289cd2ed3e2c5e4f2fc1097d5748e6e5be88df37f58696d69673408b21b8ee1fabbc63332053c206e54209aeff02bf2c7aa39634791c5d44b9ef2fe117dc9835dd0fef1e18dddfb03ba8f1819983fc7bbd9176e663bfe291c0b655b64d6d520901806a44c670e16bdb551bde314212ea306f440cc3c1ae5fe18dff4d58c595fbcf2abee582344f334eaf7c0d06faa39c6ff9219677675c857254644060f3117cdc9e9574c4af13d2b91103f92fe8aa66874680be0e31f52f7df722523068e5120c6061b50a84599c29fa33403c1853e393b7f971cd94633b9808e9b2b487d2f818dab80399d74dc40d6a5a9f9f0ae86e6b3a404010755b6d91b283bf96eddaac4f6cd918d37e13813b1b9d5fc56d9f6c6b704e845e443f2c7ff15197bf3ad8780a53a45dfd434cec61d6fdb148d3001f6d4d1da11b2440cda7cfc4ecb8a4dda37647b638eed69d15292d4af489bc7207fc562627a2bc47f30a1723a19b956a6747bbe5fef13fb83980730599adf1c8c79f3eb8f8bd16f8872e3d011d24967d5b4df53058bf6d850ea352823cad19a0b1e60c0c2430b899530a593d02721b1015cd334356291ac48bb34b840c8eb2eaa8490e31f0fbb40c405cad0a4a7abb1969a4781d45b39ddf470719909cf853ce0854e4ea742bee2434c49c82cbec4f4ffd6d417751acf04c7aa3cf806a33dbfdbd4b622945eb65eaa698e2ed6e648e068bb6ee917d72f7e1f0c50a96b9f139925ecacf07d5823772f79ef5a0bbe3ea5030b48a6d45a96cce9112ca45632c58629dc7765402d180b7ad3b88e72e59398e0256ed406b5ae58fb91d7263064b78667e37f1bae38d4565d90005d29c2dda4d8421f46671a83e6d457f4843b1c3a40468fb92271f1b085629
|
||||
832:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f
|
||||
848:7425c506e34c1f7f41351e6a836d712e308fee8e9b07b0ea43fe7c91aff8b9d2ff367a0e7427d06ca131e396ad7d8bee4d92849deb3fbed9d3b4c69553a85b537b10f671fb5bb18e2c0b81cf3d8c42511db6f70cf8339462d19e0f17872ba0264ebf4ca34e87ab2e633e63f88f8fc69be8bed9638f5e8a33b4ff4b50408c5b640505069e862d3f43ef3ed5fc691b9e2076c378c32a3d92668d169aa44be6ad4259601528fbcea5fa5d48fba49f830f6084481b920e9b9c60bfb1d36c92f8bfba1cd03f75d77c1e20af32457d64a148bd0509fc25b9e50739183346a1e7012d9dec8e9f7f83a48a745e483889c20fc88974cb2cfea5a271a3a48155e23d2f27ff0b9cf92df0bfe67af2e0948355206f2a28b6e984a211d6e2d9d4b4dc1dbecceb26cfb8d61bdd439fa7908c8377e75e3ef38caae86b49978d287463d139459da625f80e5f90b4b210095b29ef9eb54744f9c0e1b409d3105b5583c0774af8a1a496559527b0d6181fb539a1ea5799e5e7b36264024983803fa1c22d5f9fb69ddaabe3b86b67f1a1e28ac4f54bce5095c62c34cf44eb9b4c7dace34efbf79bc064fae5cac01a3f2ff0f175aa44b0207b29e4404f058b633f994d6fa2d87302b0454deed9305b9c6a5dca4413deed61b3d0c13c23b69c291a5197842dce0b787361440b9b8f687284cc923fd3c50c1be290927386b757f9aaeb318a878296c95a243affecf5387b6d2bcf7f68f407dcb2b775262acc0460e516d84f3a46fac4f3a2b6f413d57a9e865a01d9cfb1395742d05cd9932169de4ca1d242e6a1cf5c6b230031ceb0a1bfc09fd3520528f11109bed15ff9fb011b13d956b34c06e7ce5f28693f8a4ab93df6f11e6945b56d32bea6ab4754be8c951abf74833c91e362b50efd26a0787b09c5ccd9386d79c7c2c6eb2da20e873108c16a7658f8b765fcdb6480071a0b8624fb0ca5ee081bc2407586aa6bf5b285da6c10070a068e1daed4502fade3ee5aef733fff590d906cb0aee09061fc8033dfbb6f8e52d98223320c17ae6ac86e1ebfac3beb758b80d0818a02d335544c372f70fb7a602668ab163ec0b9ec5d00cf637ed1aa4e6d8e76668d7ca75a418a71f57c90679af483758cbf5940272a901eaf1ca9aa7335c6ccc1399c8d7f829eb7bc9011c9bc71920d5d80efbea91a2f8d94b3389478a81293e7193b
|
||||
848:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
|
||||
864:764b92fd61e99249b6fb085b02c3b204dca2858aac1b419d9ae16dc7e927aa5ba4971a1a4ebbc54236a86f4372043162ddc4b9c35f4ee43a1cba3f090470e80f5dd1aaad578c518da3fa5fec78d464e74b2acde84e5641b1074868356cf1afed14271eaf705ebdb94234e4c9b00b4f88fcb409b2066ec82f954def23a153b95231d03bb4a1c8fde19187b997555026e19542427f757fd7283716bc0e8d0a4e78c8861e7f49733e89d28179508bb5bf1d03d8ccec34225fe5bf26803456f5210b4a009570d5683a83c0f8ff480b4a4f454edcc2cce8abc112fda27595eba8f3a101597dd2c2d53b073816aff654c35de769b6396429bb9a1b4395d08229968e57666832356f43d61b9132d752e9839659d286dd75667eb320e90b0e6352e0834fb7b18c658ca5472ac0909e018f7f4953affd3529154ad883d2e91d56c41ef85ab7a49a49aac116d0051d8e0f4e091ad6f5ac4273e5e56d8dcb3ee0e6e759eb2a7f54d71f20b7d0250056c6eb02b8a05d812f449cf47ed191196156b2e061098205a9eab3fe510c3691b439835dbb62705553f0edd6fe643fb54a273ab3b7bcb37b9a46a6d5b508f0a42679cf11ed4057c87928018d72222b14a38a1d1e1744eb79ba7d7271403b1fe3ee39d76d94665a313f5932795cf66fa08a5b0e61cd6b32648c628ec0ef0079ca74cb84ba96627e349892636f0783976d16e1aeaa21bd20b8b0c642fc73caa1e5d92fa1b412f94ed3e08e21755d608f5e62e38726785daf73306c082a5ac13690a82465babdf8f154f0096736780136856c86c5c63d95172dbac86476275387658e28f612acbf0ac9d44dbb015d339cc05517f5a0c0bc7c7e7748b91df87b6f8d48b8a8921a7d8737da324767390846b70ef4f5aa81a1df8e16c1effbfd8610fd5f815ae42aae521181b716f42a24e601ebb9b95358a77a80ed2e7da8b54ab9359f9f15c9628eec00b38cc2134a671f11ae7bc96da59da73ef278338716dd85a67bbb507b0600f26186dec8c6ab4e5a68b31c0d0501c69a4964644dc0e4f611b603b4accc295c7be7d6372871a5bcc5be78e6f53689c50a20f0cc1b4cade5c3c3f465337fe7ca320eab9f2e6b4fb81897f2fbdd79f2af5641c41f8efb1c6bd7829c2959946a7671ad4e62916378ee220c9356d54205d88d0f32f128bb80824f2f88506c590eb4faf8fcc9cf28afbd391ecce6bc538a5b66
|
||||
864:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
|
||||
880:29c2f3b2c6bdd1209c76fb6b483a0fea5b269ddce36ca90008cf2cc52cc1e3b382f3fe445523997c1318f50014ce000de365dbaab930c4a8ad0743ba4f8c9fb4540c5ba1296cff579a64b964efd3f62e481944a5c475af35c51394383c80fd5cf37eb969e97f53afcdb4a2914473523a61e8239fd8e441cbb028c23b9a837fd05824972fd9e2cf92876d2dc93641e3500f52be33ca5f646c8013c04a256a71bbb4ca3e4c8ffba6113e34ff2423ee5c623902b47f2a1d8f51bf5f0b33d3c8d948859c9a0787101e126dc8e5e2b5bab6f125605f7b1a3ed85e1484bb6380bb01b44d3b18db78d904fb9f239222926893314d85591c5970f2c287dc78827c3895385c306a6dfe05000f7f01bcabc0e7ea14edf019f20c01f3732e4bebef395834d069582f685157f93e7924fcb0fa4898662fd67144f5b5bd07f8ae60d820a4305151a29e9306762914b579a52ea1b8d6b06e50e039a6b2148dd063c3781db0ce2c0e46f054f41329b57c07e5f571356a29587905be947cea7cb38a1a190a2cdf443514e09fb429a5e8c56a8774ec2344edfebc4aa4088725e7083b9d0908f5b0fbb71876dfd8fa69a0c1ea5cac706c6063c7ec9a2ce986e8ebe5f3cfab9a7bc636666b627d5338d48bae45016c6c98748f852554fff47b0b46f4d2951df9422f839ada5b10aa5c471f359ae1e462a839bad79af26322893533ba119fe5fad16d2cabbbc07210d2cb6eab815a4a74e8aa60332da45a8eeb37916365cf4435aa5b5df3686b299c846bd33412b7f8535e470074a9440702d9f98bf9dfcbaec7c356d8c61077235dfdb66e3493724e93be78c5c114c9e7996733f1c6c618d960b779263c1473b7c0eb6831bdbccccae88a287ab9096f5003a28f9d9026366554177954ab34ac940e33d14e2c61c74628fd617dbb4bd037c5763edfc5243f1c7cd98bed9718e8560c1ede47c5b3201fc47a2ed5507697633fe34bfcb9e40827989378a85f3e4c476f2b1c210cd0940703637ab728614e98f603a46cf5e830ac644c848a5e233349c5d5178c67f51261d1d7ca4aa36e293ef771b61bb81303b4546f1d6c7b84d9e1d47121990c3a7b819d53195b7ece7bc6bb517948cc44778200a7a53b083b1de133e8fbf1e51da9cf49cfbd04773654149bdbd679ed72acab26f301d895b1bd8c045fec96768ba49021fe380ec68ad1d143f26b8d2e873fc8295bba799c953d8b9e0857df2fea790f0d753432
|
||||
880:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f
|
||||
896:b3807844dbb30365e6f40f56e7b1f075d50762f12c64d7a7afdaa7da9b9eb80e90bd263a5977f9ce2fc761627fe447780f59fd6f452c0688f5ace451c9d583111523558b007e17db611961a6956e7d778c74384f427eb54ac2321041e1baa70119c81978a751392b4f49704f14c9fdd7f423b7c0c9b6f8e89c25999d7ef008f5397968e26a769bc172b50974f6988d6d92cf783634c79cf804d59c8e9225a17e7c6fe42179f52239ccb1b865c8d4ed5ec8bd7bd63f8cc1a05d6d652f26841937f794b2c0c8c4903e0b8935b1868363798da983541807debf9996bb6cd5f61974e06953c3b72ec70c6b5c69181e2745033b3d7aabf40d84845aa6a33bdedcd6383f7a19506e65ca18a38777768b1e229a13da5c054a585d1ed83d7a7839b780db663b634132d90fd1c3941f095282c760b21889438acb47ae02b9c2f3058f13186b16cf9c374545c804807ce2ddf590e038633619b50bf2b78a55f6c08483563d267ae84924f8b1b6a94572e782c4f86605446d0650556ec5ffcdcb92b33a9c983b2e4360f9887db8312ff2eface3fd92a2b8bf034bc720ec832252a5eb9d81732ca31a926955ba01e2f28699913a4961a26aceee382e3ca742f1b9fe3f53f71ff12f3bf12d9ee7e0f0de6ee089568da0511562813edaef60f429beb76626814d40854dc91fdf6c27831407113074c1661feed01c7a222c2c468c6f4207f625d0a09e5a4ad07f12388cfce72c4b05ba1d6c07c3c60c7c744509777b7e6feb085a33bad2df5538b4683976d3208be57c217eb5de4a5b5844e4ee877381ebf08f975b47ed1d17ba2c541146802658a14641376c13459764e018d7e6320f52c6cd2c7804d78d1b74e860e134b36628b423bc0ab8e45b7db1cd1f4609ab93878c05ea070cf2d5998cdbb8dbd87f1226b24029b53471f68439601e04b658f4269ffe58b070251b2864298adfc6be0a3df6d1c94ad25ac27aefa0cedd1473e9a3808877e1fa65f6411f82c67f42c94c655f3e2e9215ccb082d171feccc6ea0688d29051d6a80ebd36382131933d5d9f9538c35a489446fc8bb2748dfaf232d51bd4986c3dd5df2427696fde8761c695c12d0d291099e38c7abf0cf2e25fd9523f8dd0ef226d23cf69f23db15e46bbc30cc652ab7140f3ed4caf39d26df35d6628cd39bfd4493d535533a61bfe210dc929e8a6f50db5f0222355ed2ba3f6e945ec86c740648bcef4c9576c327f9cb3ca52612c5b72d8f4b152805e6cbf83593153ea0f0b
|
||||
896:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f
|
||||
912:b690948e6fbb6d5065e1f143bd8413a18f1762ae4301c9467f31bb75fc73cad9ef44a6f5d22d9813d068b555bb4949faa007568c86f63663a14df9d36c40e329435ac5baa656796e9b92ba26247a266a9d6cef4618ec1fafb730fdb5e417503a1bd061ccda2f93bcab6c8d0b1e11d9f29781c2ae361774b82b0b097be4a6c0494dfdee31d97591c22422a09418082d1c3689fd8b72828ea1730531665ca7264e75aed3b4f22845cb813bc525d877dfe616278e2041505c8bcc0b3d52bc8ef7335ef655733f263413f5493cd65d233c3f0e276881dcb13b27760b2694375502d9de447501dcbdb380e8fb3d554fa2cc771a38ef927cfd4cc3879e497e86006f4aa3b0e9ba3de6844cbdb0e63e04d83bb124ccbeb91aabb4c6df567ff4c4302a9e8ed13c5932e1c8ab03d3d0d6c6e4715a641e82d15f08de55a818b82c437ac039616499da2c3afc9c50e85e7af23801516961d2f4460ff425b10228c42594e78e05a68f238be3957d15e2ba3a227499ff30564f7c2a11ba00fe05505d0664462e301738f37b59bbb43bf44e3afc41e789211b97005898f8edb18231afc26ef98965df9e38a2306c14b82bd995184bcc1078b36cdcba476980a50252447a4f2a5925e311a2f21067b80b35031d677bf3560d5d5435c1131d0eb9863eedc06095c0ae8a4e6b13e9fefad3a9c9b35bd6adbc4db04ada77e3af55181cb17aff5aef861bd05d7ead1f42554a5bac36cd5b2b89cc10cf2b09072d13e517411235ff0a348894df3dc8d37a1828a5ff5dd31c9d04205ba0cb98a51394359e202dbdfda332185ccced81f451e7a7b79576be0bd5ab571c82c5763fca0ca66527dd9f524c85dd06f522d85de846c111ece570d1072dece75853d72d8d2b76677b53877b9586473795ce9d7b59e612023fd08a163d2897b35480b4f3e2d4daa092daf321031878e5432197133ae6a763e336e570f6e0428ea6a2501aee160b3b9ea2e0caa101927b93edc6dcf92cc38c4688989ede312fba3ae35ccb8056eef57668dd46f2f0ed9ba2d35ad450caa945baf34b8f254a3e0afbc3bdd37869f13745622f30c35f380d62990bb5c40a0dcbf6e13ec0cfb569c2581ee68e16d1cdcadf77a15d166c59b7f154aaaea4bd4287c31f2683013facb53bfc69998d5d35a58c4cd90a3aa3a049e06cc63a6d7181a2c38817be9c4721e346667557bd8d076c1224392d039ae243724dc495fe2ec3f2be06107bb91475f23bdd70b91f86c5f42711509222f29783ff066ea43cfb2933ff327ba83918
|
||||
912:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f
|
||||
928:bc5df364add8c8b84b3cd442f0cc09d2ac092ab25a81c6c57a5a13f62d9fea43c0fbf314d71e05c4eb01158aea19309efb4a5f32de5f311db43f568b6ec9d54383738ce402eb66a16129c4ab14f01ba81bba99ceae83b1e126f89125dbca89be178c23a5a1a8cdb287369321b95986aeec02c74a63fc32d7364e2e49382d440156be2428a3082c14dd482374a8ede2b3756a49725ae7e3148e8cdff15e8f2c8287d3fd7933e88b1c2439c6b8a0147d14c4bcf39a718ce38f2d42108282fe6ff236957fe5396362eb0e0dfd53e25d7b38e14de45ff451f1b56ec05e5d1a74d3aef5f2c0acd4662b5010af266fd653f3d99ea6e0a538655f1709e221392a7c450cdda6adebbd0f13fd3eb85520a7b8b5ed07926a09b763c6075fe6343d2fda48805d9345a3bff442b607e7d1417ef044d82f32e4fc2f8370fc36eee84854c63d4b4869a5b14874f03bad28b1fd9228f2eb648ae562763582dfe198d1a817ba42e2d9e7785cd54cc934045ac9985c9ae3d5b54dc61ffe99646a7f041a5a424ef909d68b1d8c042952f70533d8ae85e677d20554566dff1097d70780da80f5e6061ca27cfed9365c51a2db775be2e145fef14b2cf9bf671110be653f0781ee8d2b77f40e7d52f6928aa6e3f6dbb4462b0707afb354b2d88f1f6e0a9a687c63e2b0275e9309930956e310e37935c8b142af786bfaef99ef4786b0347c2238d8c468a77724b963b9bd04b85766bf358b44835a765ef105a4f71352f00d53aead6b98799c36dba4f73f6ffff880ffeabbb4c7bc97b61d3c8cdb757459f70a800e68980f120c1c5e9c4fd87d6b8d797bf3474744e42d5075a903d7ec24841b6d317d0e266e96b7fe40c1c65e90b65ae6476fbf4db5afa20d930ea00a5ff117766f300497b64edff10fbfcdb2a5b389c6ad4f1a4dc7338b6aab66f3b1c914b64c980572fb858eeb2364001271f7b3d9230faef634455753123766f14bcd0567905a121009dfdd6648b37a4012c5c534fa097f9e5e043a4dc18e924131cba32cbe91beeee1dbe8be95a91e3dbcb3eacdac1c6ae914cf50df6913f8dec3b17b6536df1fcf276b241f8e3ca34ee37f9182ec7beb3965f809780226c19da869a42aeb0ca0f75d6c8e61cc5241b48d1d0896db21ff6dc242604ecb003d6dfd3d04ff9b3ef1262c5c8a39ee525e642577019d69c5c2d0be5872b85fdab68769bc55658a553d1448918124284ee1a32961f0c6e4ef97ad1c19a5f7e75e254f837560b3c25c31c774248d1e48a5f7effcf96abf9774dcec13e732bfbe0a812ce2a4a9b4a08bf80fc0
|
||||
928:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
|
||||
944:62e7a2ef1ec0ee486b1de8c2d10232ebc0615252f48dc33b7700b64c262849098660a89d87747d7970a029c15fbfc980dc2f780ccf1f3c35283ecdc690412debb3466da444dcc5658b025bbc34fdee1bdd6058064b42ae92fa228f576337e2cb01bd062e5f8a353b027881e5b95aa153128a3a3092a4dcaa6395c59cadfcfc44fcb368c1809cd8f18817c8920e02f18ca7bdd9bd441f4d7a5ba3e3801ca1ab16b16742a77d459055b7fc755e74e525e8d21a1bdc6105c726d5aec9595cbc3b2ec95643739c49678e177165c15a5f7252020e48225bd5b61c0a3021e4811ee6d14a5a3cba357f429d5593a55a58e6b13cb105c9434049b1e86432926efddecfca063e1502ecf33915e00e7e4a03dddfd64ddeec5aeb18a4c6dd054495fe05e0bf83d4d8fddbaf11799fff54fdafd5562d0f0abf1f3bfd67813425b9568c05cb70bae4c1bbd888d3d5d79322127deae89003f857b66d2e623eaa7ca28e75012c669d28a438f1b47d71dc03539f273969017f033cb4037bed293e227fc3d745b26727bffdb313713ad08de751bd9135e8f2e463a1d8b8b8b2ffdb023cc5af4497b0e8dfd19ecb29684a15e5167d9bbc0bcf674a0c9bb454c6e31c81605776af4b640ff35d7a011ed5658df6b7157acd8f87fa505195b5524f3283f4c4e8bffeb7af66cdc233f1af1d9b81c63601eb5863de6d2d7ca892207c20ae6078dd347f9c1464d92f39f55b7a62caa2913bea8e8893f76e92fc1408b4f76412ff5baf04d62766282c23588eae49908c856ed4eece4ede57dca9e745cf4838fd3c7aef6a857a9d9826db5b571928ca1d614467225deb510f4aa24955a00755c64e49d3183715a34f7ab2069e6fa864e5cefcc706633d4543d448ec7a18779cda8e6116bdd4120c0a1f653161adba4c1abca388ae6f40c96d853793e5aef469ca3c57f57f19c09f2eecad6ac0bb687fbb0c71a932fdd80483b85759ba661d3a9747c5131cdfcd7c1b46ab719a0fd2f0a7c1b41fa043177d5187f1cfe9f870a36d7e71f080a286aec0a2c6771e629944551f3692fe91beb59c3fff95470dc42ad077260f0f20912c394e2e04baac2363d3e056d589d763b5963642decd3ff5e345377574e24b87405ca7179e2d6a278089cf89dfe726a3639e4820ba48cf264717343dfa7e0b82a3928fcca98f3e1129837f2bfbd732664583354e71ac115009f3e8a9499694af02edef9d25c95291f206bd931a5d43227e1d0fa1de8ce06f88fc33e70ecbe1b17c5b43a716211f6a26b1fb28a431f3c2ed6b106ada51add23e4eb690a23a91d2db355c880c441390d06a9de6022e499c
|
||||
944:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
|
||||
960:b8616d0a83c9aae9f1ac8ba538c43eae3f5861843787aec8b1189d7c32e072d79fe1f08fe0291740ef058d53e52c08f41cfca7b8d8eed4404a24dab6816003828c083f57152cbcefa411d213211e828efef1669cbec96fbff2f691ae78aebb5ddccf87684cf08d1c243ea7b3c6bac1b11ebe02ff7e1c342e825670ae7b88bcf31c3850f94dc540e6bb9be4ed8fd08113799c539eb97c1342a23448cea9d81a188974d47b6bca7c37dd19b413746f7feb2e49e1f7a61a3e6516b4bd49a2b02a73c27bbcd95b262e57986905eea78a7579b0a01a98269264a5fd2f1297cff5d109c4014c07bb3a98de6ba4490dbaf81ed8c62a6942d7295815f97fac618b3533e8c3d1ffb7f047004ad18cf0278d3d0cc046f67e64914eae29589381ab9b14781c4cf801579d01c5d5472816a6826982d5a626ca4d4404a10bb882b34083b4d2a1be756ded346c2300705c27d517cd2bb607a7e2c2f1b209a3c0ae4dffff1de98f7e64848ad865354919ec5efa517cab15b5f109d2264fe98b019b01665d5e4a73e98afa189699cece78b2ec97925ce99e2a2e195858f7487a199d55eb8ff9a69b11cf958b5d522a23c0bd30e6092e191ca4ae702d21ca3fb0823c57de653a93d7942c7731ae7a530c74fcc18f064f53fa507cc13608625d723ce39bf937a969c68f20c4b8aaba3869e12dfe4fe887d7cdec7d0c6efa9bfa11a949ceea5e16c353ea4f3c834161d3cf991a73d750e32ea75cbf15674a488028c4967569534cf17f587b5cde13d0e39614c46150d48572522fbd1dc4f4e7671b40b9a9c2bffa40084791211dd9e4fda25aa547ca27d6f68569e1cee1333b6fa3ebf7937aa6765a3421a3bfafbb605f95eb5bac77df9530a6a75f87c8463ef1733167316b4339ab8e41d3fd7dd518ae7c28c043fa802924b854ad01e6b2e7166e3f1966bd352943a794b6f4752beb8122103913a0f1a88d2f3cd8a210a54a81b991b3f566b912fc03d133c4fc55537bd0c9095678f7558b400500060f01c179bb9e998361a6c4c140be88070bdad79d40984579cf663db9e5de3d29274f1897d4d576ac3b593343e6d618e0747664429e7c087ce1eeac4e5aab827e24f21ec8a1bea9c0da9c41859ad2b09e9cfbdb88f426c66bb5dcfac33aae44976b8c567fecd0ec0549612d74f1932a571649198c736a602abf02bdf48bdd1fb7677e9aba0dab07b8afa973e1bd50eb9977f6d4779c24ae085ece616dcac3a0c8d6923aed9dc256e48a08dd33369e6bb9d619a3410ca5766b6cacb1cce1fe5dd2119beca4af02889721b0e28b3ce2c14a746a84155cd66408bcdc9d62fc7999eed86d1138aa4bdb5e8639ac2492
|
||||
960:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf
|
||||
976:fe8a924f6b473e4252e8306238646b383cb6cc6adeb6c472314b1c21b0d651e2864e875d4f5c47b9c8b74493b153f6795fd0265e9022f93ed363e9e4439e233f4298d859620eb269663a3094ef87a65b8568e8f646bb7a94a9bfb666c416486492bc14783cc1d32a6def86aacd4fb3e808785f796cdb3c67333d14dc611b043ad8d5dbd9ebad1b18f3f243bc67d4578077872de81f660d01a9a0d289d24d224ee33852ba898da68b74612f7140d3151f6d1dcc4304b1677a46f623589d3a1ccf61434dfc23d0fc2e31cb118ba4d02550b0057a261e736d8cdfac1f33373d2ee932bb6c07d3420f5c1791faab4e61ae17f857d716b93ff583883a834e6d878db98fb9f2abd0b1641a8f3904406d536c480f1c6be78083b745f1d8cb103700911a4c8d5b9b8f5a1dc5dcf5cbb021ed9f035ffba62f2bb1ea524e4fd999aa226980633853ff20b4b7094f3e8fe5913b7bd36259bb531ec1a4a41336a855cd8d8712480b380af3e66f8eae13b964fca9b1e1593ecb904cd6b8e1daff2296c268954bb6baf1211e35280c3d0115374055e0dda8a48486f45d1236c04d3e3d24f4aed948bd5467df2468929840ba0af1487e96f8883846fb02a6a20cdb3ffdd280a534c0f4d88743694b8abd71b24ad4dcb7ca7563f01971815b785b4d29c91994776b8a4fac9da0f9fc76488d8016bcb77d927125bd86f2127b85dbae52b0712358908a75f545c83ef81ce34a5f931504ab75b0d1aa12814f176ecec759e9cc8e21b2e92a3e2e6fcca56f8e0c6423e1a93e4c856316d7a6a2cb9ac4400538cecaa9ac7868ce99de9a50dc7b5bb7707c959ab0291708e83395bd142225261ea222b9ef58614f5208848dee2c97baa86ab3e390658803e0483968d6f2a067fbaeba311983066b9032f99cdbfb4d767729bf7d9148345724462fb868297e6b325f289f00bc151110f89d5ea758e9484eb26ba3eaeab7156308740ac499414b5d75d07fdec78843ba261a8c58d03609668fbf55d4ad2eed5b0ea4eca805d633541bcd6e93020003c6ad2cf360b03c71c32673cb34130f7634f8eaa459fa8bcb56f4476738b49aa9c7569672f0a7e58874e8d2b78373150faea04648c08873afd27530b04f9882f9921306fddea77a186605390f40de81efe5cdb48d6a25efbac6f6badfe7e2a7eea7d204151febdad5687c228f22ca4fed8b456cd5a7eeadb750ff29cff75016d8e5a439b735aa9586244300f6f78164b10f27cf311e46ce86e4a387ccf72e277ec6eff71ea62e783bbdf20a4f234d54c0e3d8c24d1fc3c9f27bb5c160d92cfd4b5e789a0f54335f7b16b7226877ff142e7a396f087422c41ea1424c7b89f7b05ac5f16b15ebf37ae8718b511b72
|
||||
976:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecf
|
||||
992:af755a7fd216598bcfec0d1398921f87ad8f9a4aa4418a5bfccf00bc9a710a0669ea2cb17cae99ad9a87b731236847bd642a3598c7e590e0135d0aae144d288fa1426ab6c50bbe70a27b72c793dcfddd118373e22ae8f680b0e8b10a3cda8a334a0faa389f56b7807c05d6cefa9560b0467c1ad10d29f83a5c07d6c69e8917a4aa4520cf42c7156ccf114781ee80bf2f1558fd9efdc9f9ef369b219ca8106408d24b6bbf851816e8e0c989615fb2d4c0854072ab3758ffa22c69185d5ff6920cb62fbf786b054353940081a55fd81979b73f5808a9cd29b8d3e4c75a622561375e95d50c2ffd61bc967b1295c70d8c8163c80cea6d6982f9a72db09495414a99247b24bbb64511ddaddb8fae455816d7c12880442001e8d0588180ed69a9a84e975b93659389c986653e8bbee4332b748ee40d8e1b556d05da8a3aa1348972036fb2657f29d044ca0ed4d8ea4030a1b23d0e973958806d8dc806430deabb64d5bd75dbcf2641a6d2ce92f297a8598c7aab436c1485074f244b609aca470151e8f3d54102f0d4290ba5b7722758a363c873fbc88e43afb2437f79ebd38990f72238bb865261bd434f9da58c0a54048494f0746b9690a69510361a02d934b14ff0589353828d375741236f1b45497d8afc1b479779e4f724edae20e2609764fb9613305d370f16afe452be289f595941981b451b4180c7b4b65843c2d99a75e4332f1ab83f8ef22827f94c6ecff6b3ec136033d4839e3518e1f76d734910556bccc0394bf619e209d92275862ebcc19d8be4a68ba52b6ef05db9ce497853bdb31764a351d2d6b91e0f1680b84d154e7f3404b97a0e9643188e27268e73f0740e9ac3c4461c9be061970a7b4a77db5bab38450b4fd0af274fa8c4283b2e95776c63d023991c8b02da1aff122eb9e661bcb1239d67e516500ce626e2000ef9767e75843c5e90679beee9aac3328defc89dcc5da2b7dbb76ab1dd6d84ac22f7e05d9e515b827824482c115d7180cc1b9378fe0eafbe34b545fa52b3fb9a9bdce1e41a80b2f911747f6bdb279b140cf12507fd33ef9eadcafc7ea5dc107a3ff6745a30c12d8ded824580aaa274e49495f017435979940c3a0035be77f29e099f44e1ee82b00a13729b2b90addc549d6799c388630ce7c42691b888380ccdf5cf7a701ccdc3f3422a677dc7f7891140c7fbb5093626349066a7720a4c696ec590fb74a5ca7f6b6774811af33eed78198d5b8de2371a9aa768b789cc0ca1c381cf4b70104204fba70b140a87e6093f15b02625c7b90ac215c3b318c2efc85c5e9baa06b52e426e2d3207b638f28af2814d8bc6dd29204e1d45823e6bca114acc39bae9293bb4b292bdddc457502b6dca9a7a80ba45f528a2234a166924d62b09cbbab14f
|
||||
992:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf
|
||||
1008:425b0a3543b047574d63f3513c2fc330437067ea9e14c24487e0fed0a5e5ca8c1e92d8c5015e4d25fb6bb9e7a16b6f0fd54782f84499ea944ef01b05053c004c730c5e229523bd7e017dabb49487f4aa6d93e580d7d5d6f05316f39a2f3fbaed95b615a83b39a4106dbf127e9d1a134cd65780cd9507723e876ff82a63d96c16a50ec0412f977b038e0efae2fcc1203da3ea4feb029a5be2bfd502e58d1f753fefd49bd3c67ed0d79d99618efbafadef0b47327803ea099247f8fb17f7ac8cc7ca37a32f5d1ee27f637db36d3c171af5549f554b4b9422f8bfad644ef9dbd47fc868ce4ba9342888ebc8c69728902565f1b520528fc73dc2bcd7d516d0a4ff9eee95069f487c810efc38bda54933f41ef69b3a39f28a19afaf758a5abf173f7544dea90596ac9eaf6194f26f444ad6f0feaf9c6cf1827a35eab9e4a44f7bcfa085dafd83f5a2ff66b73f58e7415d906312749427ac5625bc70f7b58dc78f2b0153c83f2d2503d670b9da82df1ae7ff567f80464f1a7a7ffc2e69ccbd507fdce91714691582800a07694969536d86f1acaa4bf4517fcfb631f08732a9234e17154ad807d0308aca397fdb648dc49164cfaec222f6a911c4deefa790738aaa7a5c94f1668441c20bfbf7e1a72f9f45b7e62e87214194c9b4e9a4e68702f91d797076c9268dff2fb1bd84b4bfab3af92bc7fbf21610be8819bdee42cb40515676c4d82561a41d930b34790a6f744d05c599256bbc94adeca9be462ee24fce633eac239ff0d1423a51c475f4a51ca51c570293988113c64b921b7496e5a9f0013578bb206819574ee4fc80067ce33df536a8a7fb6b54b16b719c547257cfabeed00c18eb120e019c09e7d275feae4076a1957035e05f9649dd93bec3e56a9aabdaebbe9bc53af637004f35f029e75b44a40989885c7913574fbe040ba059524044f00da3f29d0f6eab71b8508c5693a8401fd0bd0d4312d018b9b26cd2633ee477585affb5a2be73f156285bd93905a227f6794138e18ecc0fedc9814ba806c0bb2087653e02295aa13807908d968d6966c7ec21c936c877b8ba6a76f2dc367dd1b538c0045d211ea81d286a8afa147eabea42802fe01891012a1766551abcdbffdab8191b630c6a98ba91cd9dee647091838cf31454fa7c877418fb10b19ef905408c47ba1115394fbd5af5ce362b1f888124043a5fd3fc78a041fd7240396d61d2fe3fceea37488065b23d9b7745cc46b1769aad936ded16a4fb73b982d24959ea0ec38f6d0673b1e4272f0da01512cca7d2e14bf2481c5fcb37cbae35a95fa417b18b1173413a0d6ca1e548bcdc09b070656b98b0d6a05fac98c986ccad9c6bbd17881412adcef7d041550c753f26320a6e296ac0059ba1b91015bce4a73a7749a3dc02efab9668503d20f492d78be481
|
||||
1008:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeef
|
||||
@@ -1,284 +0,0 @@
|
||||
OCB3 Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. The outputs
|
||||
are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous
|
||||
step repeated sufficiently. The nonce is fixed throughout. AAD is fixed to 3 bytes (ASCII) 'AAD'.
|
||||
|
||||
OCB3-aes (16 byte key)
|
||||
0: , B314B579B54365D9094A8A7544FECFA7
|
||||
1: F9, 3E49FF310B88634BACA91D55DFBAA185
|
||||
2: 04B6, E13FBD06086CAEF7AD042C93D7BB6FB0
|
||||
3: 5E9389, 04216D3227A79ED90D60637AACA49318
|
||||
4: AD4A090A, 71FF49510C87EE5FC004162F146D4C1E
|
||||
5: A3D8218932, 5AA9FE79861F6B5BC8F3E238D0221388
|
||||
6: F8FADE0FFCCD, 04FB1C91F3B23E58F6B9614648B1A653
|
||||
7: 92C4F8CC40044E, 232C049DA70A9AB4B6B3A03B286180C1
|
||||
8: F93B1744D7C77AA0, 21FBF572E7FE551ECB5025BDE9ED5984
|
||||
9: BA51E012FF90E40800, 117280C3D04F2376D4B2F020AA661146
|
||||
10: 71CE4295BF396C6B2338, BE21F998166D7EB96285884217FA8086
|
||||
11: E8BD27F4EE71D7C8B92B32, D6004359B714792C44B1EF5F9CA04F3D
|
||||
12: 44F561EA59DD0DC2A2FFF982, 6AAE8B19D5D6FE35A510E53C35C74AE8
|
||||
13: 644B54237E20C68249B4FCE531, 806FA9F25EA420A8B4CAFA7620C7256A
|
||||
14: 2AC152EA88E036E58667960CAA99, 04351AF74BC428C37282EF2A85C85B08
|
||||
15: DBB19579CA7E525544CA6893556BE0, 6847407644710A2DDDC128E4C7223FBF
|
||||
16: 457557479FDC7F70CCDFDDD53EC950CC, 8B9C8D93E60A881F625B82E200B021BD
|
||||
17: C07EAF5328D338CA4601560F513A2A4AC7, E882049660635CF0D13F6058773141DA
|
||||
18: BDEAE23389E05F719CCD723DC972F2C884D3, 0E40806F30CF1F788C3C6D10B89096A2
|
||||
19: D5F334BC7A5196E460D52F89E129F33D2C9F91, 00C4EF195CB474CD880DF1B6915EA357
|
||||
20: 74435B9ACFB72DF8D67DE0BBB2F18F34EF1C5962, B33A91F1AFEE65F56C781AD7047E55C4
|
||||
21: 31618C38EEB4A77E0769131E91F4814C7DFB825409, 8307F47A53FD8CB7B82211E8121738DE
|
||||
22: 45ADEBF8F29313F13C3919A4246C96142485B58D074C, 268C4072B1FB58F0491EFF34756C1250
|
||||
23: 2E11364612BE88875F506FD6603CBDCCA10188B3F6BD79, B782DB9E311FA0C3F1489DA839CF37CD
|
||||
24: 565DB17A001D87FF3B432D80CB6DCF84A389E306845D4BAB, FE514CA6EACFC08D6CA02D4F34CA223B
|
||||
25: 7819A4A63E4ECE3FB6DBC5208A5E0ECC5803E22F28C083C6B8, FA00969B7C91711E0E70027D13FF0407
|
||||
26: 27186491315F2F00D125C1266C442FB3C7B6FC824DE4A30B3EAB, 084DA787A8AA2D108B95F3A5B69BFA52
|
||||
27: 3545DE774BF9CFC3AF51602CCEAFDAD54302C8FC75C3FC1794C6CD, 68A18C2F767BDADD023D85B722BE8D6D
|
||||
28: 73AB104D83AE82A4D0AF53065D488EEA47C05E201A667581BB046E98, E65DAFCC4DD662232C895602DD8C7582
|
||||
29: B7B26992F361B7D9CE2782304C6C62495E46216304075A787395948752, 38F99FA3C086CE6B2620302931DB0BC8
|
||||
30: ADB1E4FC3217F82C2851122B8EEACCFB1C731565AFF856E201E8EEE702D1, 615A3A991F4BA240768FDCB4D9CF16DD
|
||||
31: F2CF0958F00F11E8564CFFD9AEC71451344E2A35DE7D82D1AAC14649BCD34C, 04E97E02B50CFCC86EC0B9A958057F66
|
||||
32: 914755B90B12CF5720CC0176AED145ADEC862E51B237AFE862477CF91D729768, EEDA6BE8E7875AA7E1E3393DE81FBAF7
|
||||
|
||||
OCB3-rc6 (16 byte key)
|
||||
0: , E55863F7B850CEA28023BA8E2AB1F4FD
|
||||
1: E5, C1F5CEA421F84AECACF622BCE507BD21
|
||||
2: 6443, FB3B7992E057AA4A0E31E8718093740B
|
||||
3: A1E36C, 0BE1B8CC538E60FDC36165AF5D273F41
|
||||
4: 4891FC23, C6ADA69F1A613830CFF5E564F01FEA93
|
||||
5: 6AAFA8549C, 6DDA8C3720633B9E83BBF2DB356EEBCA
|
||||
6: 254EBFFB3C60, F092EA5FE0DA6B90DD5F2FB75FF92960
|
||||
7: 1DA9F258ACA84E, 762E38C6545C3ED4AF970B09C6747CFB
|
||||
8: 289067E54AF4FFC9, C04CFAAC0D919AD6027A7D923705443B
|
||||
9: 65E083C54F9CC7C228, D6A4A1AC4144217BC07329BCDDD6F27F
|
||||
10: F78CE1BEE4471E9830FE, A503FBBE2378505EFDD50AD4FEE587E4
|
||||
11: 31874B00827B810588A635, 287CE2ECEF9247BCBF7537DA052E6A86
|
||||
12: AC8CB1138A4BC5A19BA96DC3, F443C67A2CC51FE2DF38A8B6C0F08220
|
||||
13: EFBFF1BCDF7B3F66A402A01459, 274A2DA9F33DB5203A1EBF90366E5064
|
||||
14: 7A47F5FBA688594319CC14B33458, 9107C62E140339F3FAB445113331DE4C
|
||||
15: 69957805FC3C51C59F9149306CCED0, C887CB0B1D880BE0ACA16AC513019721
|
||||
16: 6735D0D5D2ECFB68B718B8A95AFB8922, C97E9187ED00C6D9FAFC76511BE46AD5
|
||||
17: 00F51550A1875A3517FDE2A3038E1CCDAB, CDA7AE39A8B8708E91A3EB7C94FA7BD6
|
||||
18: 85184BEF9A31A8F4CBB5CAA56FF5C63845EE, 5BFA7FFF2072E7B4D9AFEA21D23755CE
|
||||
19: 025F6ACB1A85173A639D8FB24ED4B1E08339B8, BAB248C26F24FCAA94328C9BB0821E55
|
||||
20: E18DA8E16897E888C73743E0BE165A6F8CC94A04, D759682D03ECE0888B07915D6E3F5FC6
|
||||
21: 6B94BCF8DE2F326BC7D6BBE1FE7B744E25E717CDC3, A69D284CB8B279297A4FEA3B6561171A
|
||||
22: B9AEBFF5E08E82451A486BFFAAAAA2564F36BEB8B00D, B0F0B98B97DADF33B25AACE289D8BF9B
|
||||
23: 5F3C5797CC821B3A3B8559C5A5AF422F85B2803B7A4D9E, E01492AC89D7CB9F87FB8B23B6E55152
|
||||
24: 2760B653AE34625A78ECC775BF4584DDE6B2D0A1063C7B8C, 2FDB63B68839C6250E0C5F16351C31BF
|
||||
25: A5CD59CCA78AA4A95B1C1CAFABF90230FBC9F6BE66E1AE7575, 0EE3390FF12980B9C3DBA27802FA7F01
|
||||
26: 4E9D19900631CBBF3F2326C129C90AC6B5BC3889E1392A05E542, 3CE0EC540949EBF4D70E98B17BC37D58
|
||||
27: 5448E01EF054DC8B4B6C148CB05D5A20F50EBDFA42E59FAE178058, BD64C93FDE56099E206AD57958A259C4
|
||||
28: 9D62242B65C51F9BCF41177BE9E992AAB7721A6EB3584CCB25FE13C1, C93E44C0AF6559D8045D89B98CFF59D4
|
||||
29: B72E80500D0ECA63727E82569B3BCE66F11DADBE374BD0672D0880645F, 8419544A26D030E30085ECF8F97896F1
|
||||
30: 28F27958226709140EA0867D285376E1B14890F44A18A219E1CAB02FF62D, 77CA96AB5A1F36E7564B7010ED08E540
|
||||
31: 80F7CA76B988519731D76C4D60DA0E5C77BEC17368C9B237AE60A910312334, 962C1F0C4E7C8137863A48E6E5BFA44B
|
||||
32: 1B43CDD2D0E13ECAE95F2DE4782760679CDCCE5E74A3C3E6614BAD86DFE073EE, B5A6A14CA26E60AAC3B5C9DB0723ACE5
|
||||
|
||||
OCB3-safer+ (16 byte key)
|
||||
0: , 8F56A79150DEFC6B2CBB3FB6E359FBD2
|
||||
1: C9, 8E316BB1D0C29B6D7A5A87099B85B72A
|
||||
2: 2060, BC6DEBA562045204F685BD4AD1095614
|
||||
3: 0CB79E, FF5C3DD5E0D3C587F73B79871E18D92D
|
||||
4: EB055446, 68712BEFD76001DEBEB0D49FB45753C9
|
||||
5: E936796698, DACC5325D10076E3454EA244FDE2C446
|
||||
6: E64E038A3E72, C790A04E48892CD267FC323EC8606BE6
|
||||
7: 3530F74D417ACC, F0383D56F2FF810F37DFEC884A7F0189
|
||||
8: 2B616C4A95A3C681, C2D5793720F925F74693C7A8E117860C
|
||||
9: CE0C99100C05C3BB31, B1F94A461CD2F81E31AABB949E2B2866
|
||||
10: 2F4556261D59FB7104EF, F061D0F70B0984C57651ADC2C500FB90
|
||||
11: B0DC48C26496AF66330E6C, 68276FCFD1C9AC88C54429CA7714662E
|
||||
12: 5F2ABA85E68BE0FBCB8127A4, C1FF0E5E54CFCB1109E8707E6EFC5548
|
||||
13: 52560F88ABD9EF2BE8F5693CC9, FDC0F5DEE4C0739869C8D310EDE6D8CB
|
||||
14: 3FB7DFB38F9CB53B932C09BB4953, 156BFBDE08F2665A3F7C79F711042B40
|
||||
15: 09031E49212D7F8706DB42929EE5FE, 8A0F8A6634EFA7E56471178F6F906CED
|
||||
16: CED816F12E02E14B312C6DD520BDD936, 4FE5C914D17C426A3BCF5799A4BE0FA8
|
||||
17: 30180417B91D913762B8066964F01F7050, F9FF5A968C3B5D6F6F8ABD5BF23461F5
|
||||
18: 9135A4CE4F8DC27758B9F158F515F89C8B9C, 7B3E446236E33F999D7B586205B55D33
|
||||
19: FE2BC52A5AD051401471D2487803E2F70679E9, 902CB619F522AC61EE70C5407E23441C
|
||||
20: 7FD71CB30B9836C6CABAC78AC336BD5775EF3027, 7E6419511E3886BD3736D1BE13FB8599
|
||||
21: A946EBC8A4F779A6FF805B2B4F9D166479A25C71BB, 850E57C9BD78774FC4CF5BB1A956BD4D
|
||||
22: 1F3101AB8B7FA06DC3194D66F3997C990C79DD69669F, AC4962DAACEC80D993E52A2170ACF145
|
||||
23: F8BA79427B329475C7374CD1F48518C5064D3796683978, 39D4EE512DA456B0E6EBE7680766756B
|
||||
24: 52CD976F3DE59CCAA8E352161BD7867C026D39142FDFADC4, 7BF77402B6CDC953487A1A4C87AE4ED7
|
||||
25: 1A1D64F1B73C52B698FFED8DCED76292807AB3676004B63064, 6E16BCC6F312A92E80FCB10DB8BC659C
|
||||
26: 171AF49F6816848A355D92E7DBFD769587EA2B988076BA5D5918, 9F821AC305325BDB9B12B44F82882C63
|
||||
27: 025152E05F44E7F05C2B4BA3B0023544CFBBEC8F9A98C13E931E2D, C8E3228E2B74FCC935BE1802E092C346
|
||||
28: 96B96648528B740D15504E299E619A6D0B129407DEFD04C1BF405AA6, D0721CC578C44EF15FAC882A8F49617B
|
||||
29: 9136905B84ED8A403CA83DC0DE081CAAA0F8E4F775FE0EA1E3E20BF223, EB474F78BFB6BAC8E1B1867ED405DC38
|
||||
30: D65A403FB587A6839C071167ED096B46FB480468F7C1F702F1B2479CDA5C, 8E82A3BA76E1AFCD82E324FEAC9E3084
|
||||
31: 017E3A54463EDC279879A07FD7BFF1225CEE307BD8741B6013FE4C9A454EB8, 10449A44C1F90C64CCCA5D808AC705A5
|
||||
32: DB9C895FF4A59D407344B8254FCD416F0D5EDB2ECB639CF226DEAA76370FB79D, CFE8C49CF0E323F694FAB1805A85DC93
|
||||
|
||||
OCB3-twofish (16 byte key)
|
||||
0: , 924B3293251DA82CC6843F4616DAA68D
|
||||
1: 01, 4B07AF17FF5D6C2477E90B7843F19D1B
|
||||
2: 5CFF, 75BF06BF38FA2BEC8A3A546B9E29741E
|
||||
3: B31197, 0923C75169AAFCA604EDEFB93E7C5D83
|
||||
4: 8AF83046, 29C744B4A6A1DB80CF625B490FD25A60
|
||||
5: 0D0AF40357, 477754E1995FC70B3D4D7E6D6DDDA77F
|
||||
6: 9E6765559AED, 389733D5DCAD65971EDB674B2479F13E
|
||||
7: 113AD2738DB565, 366AE5F327EE4BDF2CA04A3B82FA3A3F
|
||||
8: F2235181D51EB014, 3418DCFFEB24E4D94DC72F7F3876A978
|
||||
9: 303087A4458E3063AE, F3E6B83CAA0A07261BA9D384087D6D5A
|
||||
10: 98FF08F0E42331B68492, E532298F60E06BB72C57596957400E16
|
||||
11: CD40F0F4D8000E5096262D, 8AF824C0EC17FF0F88371BF3E05AF7BD
|
||||
12: A7EE8BD81168FBDC359375E9, E20FD7E1914136C94223F6DF67386099
|
||||
13: 8BFD44C8A327E7835A9D43A52B, 7AF41E1B25A7BF4D1F5868F0E047E2DF
|
||||
14: 8DAF93847C1B3D8220B7748A9823, 9787A3B32FD7EE08835DD7A9277F5A4F
|
||||
15: C602FD9F13259C4D3E3700F89CDDBF, 5711A41B4666248FC3FAE3FE8FB9E861
|
||||
16: 972734035B0C78BF774279BA3DB7CB0A, 23E96A558B3A64D95FE1669923E10CC5
|
||||
17: 9D8B4DD8259B51DAC20C4C64693E20AEC0, 66E07F2BF239C0541DF19254F53820CC
|
||||
18: 4F76EDFD8C101BF1A20B9D337724BE0019A7, E046081F3CBD112CFAD56D9A32FDC6F1
|
||||
19: 59B667CDFCCC1634C9891DD0D3809A682EDA2C, A0F8E38B41BD82E8010F917F4629184B
|
||||
20: 0DBF3DD74E0D165C095468824E431B8B5650EB5F, DB7B71633206184ECD6157060DB2E443
|
||||
21: F5A457AA7ED8C131ABE99EC2C1008DA022D27908F0, 794C3E20F41E7D32B70BF043DBD0D86E
|
||||
22: ACABF3932E154342873B1EB770A3E5E31C629090EE8B, 4D998537CAFD3453A5D748EF09C81B69
|
||||
23: 850CA96B3B1287A8726E2B11B7B17EE321CF7D65481F73, D78C52190C81FCCAD299DDBCA72D95BF
|
||||
24: 5060CD915C916D082579B571FCF340E82224A9704398E033, 30EE449934C54F531D2702F8F1B9F510
|
||||
25: 0C47F5CAA3F2E8ED47F016918B634474B004B357A35337F14B, 9D749132486F07B06D25428B592CD767
|
||||
26: F01B95D67392793ED557D2C7289CF899C053ECC5E8BD28BA662B, 3760662B33EAFF659DEDD2AD6E7B32A5
|
||||
27: BF8B0FB0B069978F0EEE2120F61B6437969C0BDBA700AE279B3239, EF2A1D664F26DAB4F9E8142730C2942F
|
||||
28: 64E68C83E76FECF44BE02B2E44F182C1F6A08B8DAF396BFA3B395A18, 55AEE32957B9B15AD35F172849308919
|
||||
29: B594643A43A91DD34A75D30B259EEAFB75145C91D8A862F2526CF47A35, 0E60E4118213E89C28BB71A8003A94FC
|
||||
30: 5D2E20D31A1F6C48EBF52B63FAE1CC09C85F2307E509CBDD4E8771B65787, 11D347399697D4955028F7B08EE32B93
|
||||
31: 8726247FAEB21D7F8927DC3E90267ECD744A8452C64B9EBE08D1A590BFA1F9, 8D75DAEC7E4438E7C701A392346EBBF6
|
||||
32: 0DC0EE528456FEC203AFB12A55A4D3A901B9408958E5387EB42E75730D98B6A6, D7D682F57C1E1671BE459EE33BEA6B26
|
||||
|
||||
OCB3-noekeon (16 byte key)
|
||||
0: , B23A40302652E204B694EA78AF5A8FCC
|
||||
1: B1, 5245C8680A6F4520168B173A39661249
|
||||
2: CE8C, 05763A489DF8B88DF01862007B2D6655
|
||||
3: CB7D55, E14463F2230FD60AC779B5608F708A13
|
||||
4: B4E9D036, 78A9A918D7CC6E742F22BBAB7781CC7F
|
||||
5: 0CB35CAD63, 1A010E65263EDB85039E81B8BF88B978
|
||||
6: 7094335707F5, 8EC8C49EFBB77AEF2B443855760CF5D2
|
||||
7: 734E7D94C8BD6C, 5E701C5886A72499A79B3DB6A6F865A7
|
||||
8: 5375C12BD7B724F8, 3C12E52B9E0DB5967AA09C84DC4D48BA
|
||||
9: AE56D9F446D45EF168, 297EED4ED9671F7D9E6433E189C754AB
|
||||
10: 203F357C80E760BB0D47, AEB8CCB8AA3D0752266E9BFF4B501832
|
||||
11: 12A9F075BF911C0691338A, 317824AEDC90F284C3702A651BA50488
|
||||
12: A4F167C8D051DC582892E5B0, CCB64B2CD8CB62212003A4E0A4065B23
|
||||
13: 42B2F2B5E43D407E2E2E047957, B81F80502CEE49C84BCE21A942BD6206
|
||||
14: BA5562041E71339AA676E1BFBE07, 7C0920E33B1AD9257FC6FF8732EE4BBA
|
||||
15: 1D1DE906DDBB4C3FB367DD7FB59622, 10D4E97FF5495A4250B60A1238D21B3D
|
||||
16: A06A25AFEC795738D0ED17542EF1E691, 1D31E82501E1779FC62E8A2847D89631
|
||||
17: F7BAFF86763A1BE37F6ABCAEB2E8A64411, 4F3E5E7009B8A09CE47ED7E67D9B6B0C
|
||||
18: 15A97D2BEA9DA105282144776C710A047F1C, 79406BCFE7C9E8283AA851ACE9D40AB6
|
||||
19: 80FD02BBAD283477394A3DF93FD6323AB2718C, 30FB621D3A41DD01BF8F4E7EFFE93C22
|
||||
20: E091A9D6C14A60627FF6BDC59DFE85E9528AF3A6, E8D5A085BC63B7AA48761FE4431A7966
|
||||
21: 76FC712E7BE90A93015045E96DC102FFC2DAF113AD, D563F913F2A90D653C0764F276F8D0D8
|
||||
22: D4A6E1FD6DC7504CE40F4A1A7B9342ECCC03CD3788F6, E6C45E97B3B2E00C2DD0C639EC056485
|
||||
23: 7DB75AADBA75F026F430C7B9A59E4E0F228770990512B1, 09BAFFCA7F69156C6ABD5FA7A8F1F39C
|
||||
24: 18AF0400D1FCC74AFFD5D2FE4F8224A29BD17DB2294F89DC, BAB2E20E100E6292658A7BBE67F96E13
|
||||
25: DE47E5BD43101F0688D7149811511E549C8846AB71B35A12F8, AFD0DF5FAF7821759DE3AD928B239570
|
||||
26: 1826EEBA81A57174214F9953BA88F4324456127D7F7ADDCA8036, A03FF1F7B71611D8E9B41DA61E191A90
|
||||
27: 73D79CFEC44F7274720BC73B7F2422BDB79A9DE6245B08B006F654, 00F66AADBB4110E77A7A788A1B0CB4B2
|
||||
28: BA5F0C34A1DF413378C6F49E09BEDE1ED757935934C1FDCD978C2B3D, AC286CAE6E7C3DC2CEE3B6019F5A1662
|
||||
29: 231AB287C2156BD0E590632E057D7EE92B6DD7976AFB75540FB04FC84C, 12420BEED7F377C4792A0940EA91C34D
|
||||
30: 7B06F611F07763C65EA542EAF679DDBCADDA4B61238F489331184FAF764D, 56FCBC05F1E3B57286B1AE881FF04BF4
|
||||
31: 17C5B1127E3D08737590EFB2FEB17562E7FDB4B21A768595ADDD9697CF9B46, 6F4BC0A033BE040350FF4958866BDEA0
|
||||
32: 4667525E9B39821CF08E6C7A7E37A5020CE23F81DEF05932113E9A6B5B3F9BCF, 5C0350C6F7299192947EB22ED415B05C
|
||||
|
||||
OCB3-anubis (16 byte key)
|
||||
0: , BAF3C352341E4E8F5E1FE11C9CB3E151
|
||||
1: 1E, 01BAEEA2431B9106129937F135D46215
|
||||
2: B586, AC89B511AC5F80B2E6F9E6BC96DDCE15
|
||||
3: F28FB1, EFF43DCF8C909D51ABD58CE44461C35F
|
||||
4: 2AE6B0DC, 36A21C9193BDB12FCACA73E756C6D75F
|
||||
5: 4A37080738, F90B5BBA5A103EAF4ED01FF845F7F6C3
|
||||
6: 369B9FDCA431, 85C530F58C7DB80C6E8B1F3A9A593C69
|
||||
7: DF0388D34583E9, 4EEF27EABC10A78488F82E8105C52C2C
|
||||
8: E63011F0E310F68A, 8AC5A7B20B6F4E160EEFA6D16DD868DA
|
||||
9: 93FBDAD02B07A03C8D, 2C968FA16435934EB40F27019AE00F87
|
||||
10: 6D91E68224DEAD679298, 2AE270894D8618D4D92485B51B7B5658
|
||||
11: 53B08EE1F8FFF2590B7CF5, FC9A33C9221C06ED7EBB1D3C33BB0FE9
|
||||
12: AFE762CDB97A411E0F6D8422, A9A1028C6055FA627007E65CAFE5618C
|
||||
13: 781464F6A0739FB8EFD8C6130F, 1DBCCACDDC218B76FC27F444FC0CCDB8
|
||||
14: 1F9AEFACB5D87693CCBB9D173529, EE13B9890D0E05EAF61E1BBE8B0ED0F9
|
||||
15: 107248D8D565CDBD520E50A139531B, CD7220BB19B95C496FC901C831AB7CAE
|
||||
16: 1045F21485E1C4FB812D9428C4D29D7C, 08035EF80327E3D238D98A09E3B48542
|
||||
17: 68E48C74D09B7D07F38BFD1722F6DAF18D, 9D94E4B7CC4F00F1716D830D953E1DC4
|
||||
18: BF9D274E7DD49FA2ACEE1D65DEB0A5A74D2D, BB841A83356BED14D2A06B5D7F5F8556
|
||||
19: 4586B730D46E9BEBE34EB52242DE954CD39B90, 40981229C0DC8D47C69AA261D2BC960A
|
||||
20: 11038CE2E4AB2D2F8258D4DEF25F102352468350, 1EC047D2BD87BDDF02068BFD5742688E
|
||||
21: 25E4D441758E4953D463D0BB63CAE2B8D5F78B7968, B548855DEC4C11C10F74983D6B426A41
|
||||
22: 1711526E226559666D2439881650AEED6DA12EA01A72, EE6D4D29BDC8EC975ED90340910EF829
|
||||
23: A70447A0317930D20C5EBB0841528802B948DA7E437EED, CCB551453425652D6535DAD0A5890431
|
||||
24: 57D82A93F29B4B2C2CE4D2326D2E224836F0857EC8035972, 87E1F70A7D4140A58851A2C4F0E39F0F
|
||||
25: 5F065C6406B07A8CA35AE0F05D0D48C631C6FB3D7655D5F6BE, 2E3EE16DFA370D0F988615CA063DD62F
|
||||
26: 3DE835DAF81C17F45DE11431A6F8294FBDFC062F237A7DF30E1E, 401F8841A7D97F84438B905D2C03A416
|
||||
27: ABDF9D5E996364C628D4DCF67ECC870117E8CC5A6C52E4663C26C4, 05996C80448BCB0C4B311E05AD0B4C5E
|
||||
28: 1C2401BB1DA2CEBA1BB56C69728FDAEE42FBFA374E57DE1C593494E6, 8491B62BBF372C671C311A97C173BBE3
|
||||
29: E504321BA399FFB6E3187B645635273A92C63D014E337EC266334BEC7C, 026444BAAD6C4EF67C660180CCC6E7B4
|
||||
30: A61D3FCC22988166F57F4585E936CB8CD714713355593780F54EED1681E7, 3507D5E0185318CC4577C5FECB3A348D
|
||||
31: 55AFBFA3A57B960AC0F8B3DAE6EA60165FF7D5A77731B05BCB7E8C647487AA, E25444D551A823650757DAAD8ED6B588
|
||||
32: 5553F81F123EC0697C26B00BF20BE287C0A1E9C4035C8EB3036F6D58C8A3B83B, B7349CE03F264F816305A6D46C274980
|
||||
|
||||
OCB3-seed (16 byte key)
|
||||
0: , A7D37A371F0B3596ACF3856B5D18B45E
|
||||
1: 49, 3C671A1AFA5B253DD8FF67FFED9C33E4
|
||||
2: B986, 2A069C4C6FF67FA6880D6EDA8490A3C6
|
||||
3: F78307, AB6D00AB217E62E1C2863A63E7E805FF
|
||||
4: C43CDED4, 9332E6E78B574354B866EB49B951AD6E
|
||||
5: 47FBFDFF71, 14B3A25479FC36C71C837680871855C9
|
||||
6: 4662362F3992, 28B8B162DDEAECC2AFD92C343C49D986
|
||||
7: 64BE9B49D4E3F2, 6DD06663768ECDEBC64980E0FE11BA9C
|
||||
8: DC6F456F02349DDD, D4CBE9414C65BEA4F1340707410A8D6F
|
||||
9: E0C1166D7CA0A919B2, E7B742D40ACECC618A9012DA72C0DBB5
|
||||
10: 1E9B38CA4B1D2E41173F, 6F87E9D8B7EA96249B533FFB626773BB
|
||||
11: 7598A106F4A42DC2EBCEAA, 8A1358443F492C6996ECA14D41FCD91A
|
||||
12: 79C43C511A13395E5F1D259B, 0955EC3B5D6999D1DACA88E4B4B0EE77
|
||||
13: 39DD979B5CDC450D7E7D49136B, 78E5E86F6FE3EFC5827BF7F088EC8FF0
|
||||
14: A1C18979318C625FA4FCB0D40FC0, 6F9508959B87F510F3E7B39FF3237B7E
|
||||
15: D3A55B637FAF068BC97C52265B7DFC, 8C940DFDC990CAD1A08179784E668012
|
||||
16: DC120E50B38579CB4A45DC7D45C29AE6, 2E0939B538B26E0009B198D5C3E6DE17
|
||||
17: 266CD82BBCA8FBC6D146CD10DB417685F9, 0AE1614717E23EEFD5F9BE7916494A71
|
||||
18: 00741031BC893E10F6B86698B4B3787FA14A, C297ED582832F4B77C7AD820F5637EA7
|
||||
19: FFCF3CF4B06AA83E05E5C049DA2A4F1AB4843A, F2FB3E63B88B56E9D680560F346C6144
|
||||
20: 381DDB2637F17F8FFC619AF59A4DCAEA227E95A5, 82D692BD1F86AFD28EE140D021E69532
|
||||
21: 6267EDEE16E3FD95356079CC4366BCAA0739C5831B, 9D4F17B8A5E85E5CDD18FE16D6BE29F7
|
||||
22: 0B79A1E9B3EE98DD6EF57E4F23171D84D7250562B4C6, D76DB52F53F51553C604FF17E23253B4
|
||||
23: 1DED7558063E2F8B18514B8F5A3446981D6CD648ED098B, 0B209EE39335BD6336309D1DE1EBC379
|
||||
24: E3E3CF278C9FB18005A468674E1EC0CDB5DB5B42ED1CA4D3, 772C852C854303FED2DE41F8437E81C7
|
||||
25: 8D0F93686527DD62C4101B213B88930E375167E48B04446B90, 11BA6E13F45B82FD916644F859689AE6
|
||||
26: 1B45865FB91DB5E93D87569DDB8A1CC395381E875E5CA6EAC1F1, 8BCB49BD6D413542DC88156758EF8CBD
|
||||
27: 06C381B8028DAC54D785CABF55B47AD7BD2CFC6D66C4B538F287F4, DEBFCDB4E6C7A43B7D7E0983D4FC0C87
|
||||
28: D71A0CE6A88F80CC922189EFCA5696FE5C8F6557AB744698E4A65222, 4DCB5B5B0F9794D776C4C63C3E00C78C
|
||||
29: 23099CF8578E878B58589D6FFCAC8E6A74B373074D90E0F38ACCFB6117, A5B2C145ECF768842A957E47A8511D2F
|
||||
30: EC19652D148810E8C714D184263FE7E961FECE4C9CFD30D6921C32D2D4A9, 74B900BA5F4AE547C19221081DDC1F91
|
||||
31: 9DB58E1FEF922A4A1F99602710ABCA029E8A10383465C62967EB0A466F11AD, 08D4FF277C8DA53A2598201B255B7FD7
|
||||
32: 1BD03BAB70BE842FDB12E49DEB04AE477335B0B3930E75A27C37EBB1594099E7, 3A6DEAE1C289763C4405DE86544DF401
|
||||
|
||||
OCB3-camellia (16 byte key)
|
||||
0: , DFF7EA9ECD4E2AD37B9838E85F9D36EB
|
||||
1: 1B, D5D37222F530EA2C282A4D8BC55A08EA
|
||||
2: B73C, 5163F4BD7CBC03DA1B31C7C1105B5511
|
||||
3: 42B8CB, 997087C18C191D560E3FCF70E77A3C15
|
||||
4: F533FD5E, 15275FBDDED6459BFD8FBB8FA08DDD3F
|
||||
5: CA7A675DD6, 11604097A97E10A4724799DC6A349F34
|
||||
6: 00F4D4CAC81D, 9165C7B49928D47A8F3C17C0B029F44E
|
||||
7: 8751CBEEC4D29C, F541920B2E92DE956B6468EF83DFECB0
|
||||
8: B851DACF29824BF3, C16660EB40CF830FFD263C52C1FA8C97
|
||||
9: 8646C3D808426E03E8, DB30D0CE9F7DA93162D69D42F0B4C644
|
||||
10: 0715BC4E51EAF610956D, 2475EAB0B92533BD574550F316C86746
|
||||
11: 12F6C6BE1A4AAD391BCDB4, F1F387AB03A4E36965CF41C6842950C4
|
||||
12: 4F85DAC1AB5B6D48CFA75266, 57B3ACD0FB6D2F8B672BF097E7C559A9
|
||||
13: FCD56B0CAF30F6A29324AA3067, 437461CFA9DE7562A572085439CE5B5D
|
||||
14: 612BD3BDAA826CCCC76722699D51, 90863205C506D85FEE095B32F3E1DF93
|
||||
15: 5C85AFD2B6A6FC85B282B57D48642E, C59DBD94D744A6F3745EBD9D4EBAE0F4
|
||||
16: 64173080FB3CB43EA8FD41F23DB88587, D80103E4C578DD4B79A23372E34ED967
|
||||
17: DBA50DDBF3B3F064F8E40967EB53769FB3, 4751B6EEAA9B2E49BF8B23A3BA13807D
|
||||
18: 04B8D0D351F3FA3B3B3F641A244EF7036825, 6BB18750DCEBD39DC25E42233475BE7E
|
||||
19: A15A0C3E91CE8AC01C8A5291D24FA0514453A8, 5DDC4FB9D6C7AAF7660B763EADAAD969
|
||||
20: 6E223B742F768FA57651AD90B6BDFAA772E6AC04, C987C8A3A27605B6CE04B25777286875
|
||||
21: 1FBFEA7AB374D972FBF76456048F77745D8E7B64C1, C301981D5C17473953B00818967E9230
|
||||
22: D642F5D05092443C776E53D6FCF2B65F6D25E8E98F89, 5E87E6BFA1EBD436909126197B2CCAA5
|
||||
23: A8270C56D2A0084670A0C5D8DA2B495A849D1BFC571912, C4D32192AC893C87C900EE2F80443789
|
||||
24: 431ED5C50F16D509C8229156E9BF0A7E1998F48F0032D91C, 960F4467E129A002CAC3F75EACCC7D73
|
||||
25: DB57EDEBCAA10C4B8E0194CEE7E778FDEFA88424883DC476DC, 069F456F5AF43492AEDC7FC24A0ED875
|
||||
26: DC8AF80FE840605041638184A00F683FB0AB86C4067550B4DB49, 862057189AC987639992EA9F49C7158E
|
||||
27: 6A67318A81F95E33F741C95BCBCD8623CBF26D2D8801D0E745DFB6, 22DA5E8C63CEBC5A6957FB1A01AC7571
|
||||
28: 70587F34F31CF711F2558C7DB1B04334DD58D850930ACDD5825EE131, D2436CA4FC757B16509CECA1272A2955
|
||||
29: 736DF200A877930DA3EC2FD0AF53F08285E02EFB519A443F50B9E2F1F1, 22607EA2C6F1AE1B73785554F9440F2B
|
||||
30: 62248D90EA60163F9CBDFAEC498802AA816915273093D375B02BBE22241B, BFADB3689B3863AB997D101380F7156A
|
||||
31: 41C092516DC494E4E165EABAF939858EDAE3D3DAE488D14EFDB0E850675565, F45307A495AFE24E29E2AB744311F07C
|
||||
32: EFFEAF5A73C2A825AFEE12A2BE80406937C75D4264FD937A310FA57C7D5D01CB, 3B430C0DA47DAA069FCC5C92C5427396
|
||||
|
||||
@@ -1,569 +0,0 @@
|
||||
OCB Test Vectors. Uses the 00010203...NN-1 pattern for nonce/plaintext/key. The outputs
|
||||
are of the form ciphertext,tag for a given NN. The key for step N>1 is the tag of the previous
|
||||
step repeated sufficiently. The nonce is fixed throughout.
|
||||
|
||||
OCB-aes (16 byte key)
|
||||
0: , 04ADA45E947BC5B6E00F4C8B8053902D
|
||||
1: 07, 987354C062CD6251CAA6D93280EFE9BE
|
||||
2: 1CB7, B9F1620EA8374E1C2D05110878D93069
|
||||
3: B98C59, 3793FB737C2DFB29E73DD1AD8B8F71C7
|
||||
4: 8978F240, 5E25316ED13D3300F2EC12D718A0BA8E
|
||||
5: CB4D261594, EDA252A1A5C7D0A4AB4620F771446DD3
|
||||
6: 30D6B6688D59, 684037DE07832C6FC38CA42BDF2A7D53
|
||||
7: D0583F9741BFA4, 3DF53DFF73431C0245982F4EEEAD432F
|
||||
8: EE3B9596CBEFF520, D283D1B9D990739EA05F4BAE2E96BE4E
|
||||
9: 6570FC25E6103AC125, 90D3F1FA6595B775749FAE7B00A8E5B1
|
||||
10: F56750C98C370DFDC4A0, 19389A6875FAB432B72D64BCDD6BD26C
|
||||
11: 3344AE6D9528603CC1E4E1, 87AB6FBC7F919125A7DB0D17D19056B8
|
||||
12: F3D9D816A727D3E67330C779, 07AC0F3841DFCFEC58A5AAC22270538C
|
||||
13: 976651E63ABC3B276799BC1FE4, EE603A8C66099AD6FF8667B3F34ABF29
|
||||
14: A48E3ABC31336C6B717A96170A9B, A9D1B973D84D3125F5F9D7923BA0A8FF
|
||||
15: F60E9B2A911FAFB0080FAA3ECDEE42, 4902F8AEB7685F7B255ECC45B5B7D3D4
|
||||
16: 0855DE488940144AF18C65A9966DDB66, A66B3E7A75D394273AC196FFD062F9DD
|
||||
17: 172DC1740F75AB2A27B2B80895961A69AB, D6986BB95F7E4137430CAC67F773623B
|
||||
18: A414234DCCC61B65A79B7C618A6B91ACA410, 6CE32E55E158BC3E51E94116A615F3A2
|
||||
19: 16A1B16BC0F63D63179901F1CBC772D612C102, 54007EF9822E0E4A4F953838577C76FA
|
||||
20: 539788EBF85C15B3A638017B4054D71315BFF25F, 9B2511322E16CECD53E3241F3D51EB97
|
||||
21: 7E74595A3DCFE1EA2C91B67738765463D50A22924A, AC9C9B526251C16F112E769F9FBE74E4
|
||||
22: A2B61792102B2E44F1DC0E48B40472CE883730504FEB, 76452A49C2524404C8A4B098D6390F98
|
||||
23: F58174BC06A022AB7D81991E9346F5E4B0AEC535D93473, 47F96374BC094BB2C1A5D1D291806912
|
||||
24: A3A7713895D178A85D9092EA6138323DC2FF9090D7F01AC5, 3814208FA7009A2934F9A172D029667D
|
||||
25: 385525DAF9949DCDEB22F7518AF96438E40F7D94933706A9F2, 1249F3DF50084A6D1A76AA350FD85B0B
|
||||
26: 6838E207D98A5BF8D8E41454CF51663D8F8B76FD26092D45D1D9, 301723D0F49BF8CF37828340B894689C
|
||||
27: 736413C025A549CB2550E93139DFD5DC3CE241C296C9FE641FF520, BE07259963F251743A85DF51EB1B47FB
|
||||
28: 7F2CD26367A885BD9E2B515D4E871272AC1BEA1C650B530E5616B2D3, EEB37E8451597E5A53CB49072EDA9346
|
||||
29: 68F23DCDEF223B60B46E3D724A93BEEF8B110D4394C990AC3D0E34E1B6, 9A60344982F852EFE02CBE9CBBAB60F1
|
||||
30: 66C5DE3EB27139983D48BED81D0E5FCE6BA1AB402C357062FE989D31C69C, BAFA0A7997A529039F0CE8528E670415
|
||||
31: D3B9009C1A930EE288C61B0B15C7E92CB73484C345594DC5A3F377147981DB, 1EDAACF7F1F3AC7EA613F94DA4DEF930
|
||||
32: F7818DF15FE6FBC42A28FDE1D55A2C07EC8D82AA0E7A680DBD3CF26C13448F9B, 67FEB344108008A88067E92B210766D5
|
||||
|
||||
OCB-blowfish (8 byte key)
|
||||
0: , 07B7752047F9E0AE
|
||||
1: CE, 7D69017C42B06204
|
||||
2: 1D6F, 4DFD4BD58439062F
|
||||
3: 30A011, DB49D988798F8842
|
||||
4: B71C8951, AA3261584B0C20FD
|
||||
5: 06F89957DA, 88BFA80D36427F64
|
||||
6: 45BC4CE5FABD, 4CAF71136ED166A7
|
||||
7: A7405F124D0296, 5D8993CE64FFF0E7
|
||||
8: ECABEFD9E6574E4D, B69349673CF86E41
|
||||
9: F7D26A7E82A34ACC71, AFFDEE843ABEA68A
|
||||
10: E225C5F0FA1D649F81A3, 03AC1D5DF1323EF8
|
||||
11: 58722FBFB86C2697061217, CE731D80E6355710
|
||||
12: E577EB8FA70225C5A18D31DC, 2F08B140F0D3A255
|
||||
13: 92154A94CD7D42EBADB6CFEE14, DC949170E84D3CA2
|
||||
14: 5A3C08744FD85CA262D51AC6CD25, E83CE45547403BAD
|
||||
15: 8B2E4980ABA10A20573A402D89AD12, E3D978611DD831D0
|
||||
16: 3EDC4A0FA95BD8F944BCE4F252B6470C, 87B54BBEA86A5B5C
|
||||
|
||||
OCB-xtea (16 byte key)
|
||||
0: , F996E5CC593FD6E9
|
||||
1: 88, 64636E3C48940F8D
|
||||
2: 223D, 230D7718A8BCB965
|
||||
3: 32531B, 37FEA4728FAE474D
|
||||
4: BDCF3E96, A9F30B4187CD174C
|
||||
5: 7B0CCDE546, E7328648817987FE
|
||||
6: 824BD771B724, 0BDF80C14EDB758B
|
||||
7: 8F0E73B1280717, 2DEDBF2C87180CC4
|
||||
8: 6F7EFA44AF774B1F, 1A9C5509D54A7185
|
||||
9: 9749BCF684F68755AC, E46941DBE948BDD5
|
||||
10: DCD32D91FE2D5590355D, E17DFA54A5B60E07
|
||||
11: 3CBBF6464D438AB95B3ACF, C207876D030362EC
|
||||
12: 1C804A611F6CE4CFD2657366, B957F48EA00C428C
|
||||
13: 5A2F6927951D8F60C754893790, EB3A27A9E5B8928F
|
||||
14: C710D28CD02726002596D9196021, C6C9EBF090A20C07
|
||||
15: 298FFCE0CD42BC329697AEB5F53A56, BB2F0C415317928C
|
||||
16: 59F6395260ECEAB2E3511991EEEF9656, 278A218A720F8E05
|
||||
|
||||
OCB-rc5 (8 byte key)
|
||||
0: , E7462C3C0C95A73E
|
||||
1: C5, 83CB00E780937259
|
||||
2: 1533, 022FF70566E0BA87
|
||||
3: 57543B, AC4EF15FC83BDF2D
|
||||
4: 01E4474B, BD817C06AC2141E0
|
||||
5: 4CD7E850EE, 7BB6B3BDA5373422
|
||||
6: 489C0CD1502A, 23DD4406F87EB164
|
||||
7: 0CBAAE08E07EFF, 92569C958B722413
|
||||
8: 073612F283F8A6E4, 1DD978D01CE8D1DF
|
||||
9: CDE676B1A3AC98B00E, C033F099E2620668
|
||||
10: AD3BC88EEEDA40A83685, 36DA44E13C0C8A4D
|
||||
11: CA60E8B918F73E99986021, 45634CA0E43E4B13
|
||||
12: 3B3CF82157ECEACAD8658EF5, E681F57616146CC7
|
||||
13: EBC1A7068346EC1B7EB815A7DC, 2C806D2A909CCAF1
|
||||
14: 97CDB3EF8276F1E7D6B6677DA2DB, 53F00B9A2E43DE08
|
||||
15: 44169B3EDAD9506C51A6DA055EF9C2, 5BB6DD996130896B
|
||||
16: 35EC29065B1FC640015B0F779E7A358A, 867EBD0E86823F09
|
||||
|
||||
OCB-rc6 (16 byte key)
|
||||
0: , 27B9E3F544B8F567EEBF98ED5FD55C76
|
||||
1: 92, 219FD2D74D7E3F21AA6C2A507C0A546B
|
||||
2: BECF, 96A656A16FB3C4579E6955D592AECAE1
|
||||
3: 4DDE09, 7D1882879B5D6FD8C151502BD8AB220A
|
||||
4: 0D6B4FCC, E01FBD1ECA2A6A8DC6697A06AB12BDB0
|
||||
5: E5E19C973B, E5A86AADF2F333D5DEDCE410688CC6A4
|
||||
6: 90BA7D2A6965, 80523A2CAB2A7BB2E90B121DE80F46A9
|
||||
7: 6FE258148EC8D0, B7254B11276A77C5F99FE5EC91D81F57
|
||||
8: D887080095DF8817, F3FB938068A01EF89DE0F1226C544362
|
||||
9: D9823313289D597614, A547764EF20BD4B4B303882B64FAF2C5
|
||||
10: FF68942112CF01701E86, 94F3860D4438428EE296CEACB3EB67F5
|
||||
11: FFD390D3E0B64F64D3192F, 99D2E424C67EBACCD4E2EB9A0CDB8CDD
|
||||
12: 3162235748BDDECC84FC8C94, BDD400A58AF59100A731DD5B4386444E
|
||||
13: D2A0EC8B1F20672289F7236C56, B245CF42644BDAC5F077143AF2A57BA7
|
||||
14: 830929B2850E22F6C1BA2027248C, B6B522F7D6BA3CFFA92D093B383542FE
|
||||
15: 2A5FCCCCF43F845AA77750D3BC6B1E, 53A0A0882C7844636900509921661FCA
|
||||
16: 8480234796F9EAC313140CE014B0265C, 0656CA8D851B53FD5C1AAC303B264E43
|
||||
17: F011A67C22F16A42CEA5E493CB766964AA, 830B8158B7A96224A53FB7F3A08CD128
|
||||
18: F76274A730A608C2AB37497A049C3699882E, 4DC4DD4DF39D0E68D6169F9DC7F4A6D5
|
||||
19: 7B38DD237DE552A72E4369A81C30AFEA5E5063, 01A62CBD30153702A5B29FB2A1683899
|
||||
20: 58EB866F1FCB060ACC821D776AAC4AD9E87C326A, 25AFB8FC48605E1396EA8471F55C1294
|
||||
21: A25F2C0FAD66B3580627498EC66C994B49C5445911, 0182A951D9A3DA53675612DE8EED1FB9
|
||||
22: 8813977F092F07F251A1497C898967F3F98F5CB878CB, 80BC353E310880A83DD4DE4FE96AB6F0
|
||||
23: 52DC8B76F5A6F78D51FB7DB51048E2663563335EC876A5, DC3689AA079C04C19D83646B272F9DEC
|
||||
24: 965437D3FDF91784B63C73C8CD001BD9372167963DF36B89, 9FF84E2845E3C1E3E6711D1646B18F21
|
||||
25: ADD40F674BD56FFC8F9B4047FAAD2471F0A48F4544C894F806, 9D684F74F9734F1C497E33D96A27E00C
|
||||
26: 7B049B688839BC62785082397DEC7AA94B837D094AECA4B14571, EE711DF1C15B5C9E36B6E38B6F7152D2
|
||||
27: DD4681F9C498A3CF69A9AC876E02BD9CDC4FB1F6798F772013B62D, C5A50676EFAA2A56CBDBE55CFED3050D
|
||||
28: 471B5E89A1337E75E88AFBAACA1C011790F1657425483229E55C34EE, 20F73F2AC452FFEA423BE2EBDF33CFA1
|
||||
29: 71812C83DE34DB329C8DCD98890AFB1F7719E890DAE5CEB7AC9668CAD0, 6FAA03E10C6FB67D425C683C6D85FD76
|
||||
30: 4BC2DB33786CFD29B5CA5B804454169906138E90E29E7BE9197971027AF7, 75053C433EF5572A70C58EEC96F56C53
|
||||
31: 5E3A0AB41264AB65365458ED3B7E6A25827E50075A9E347F1622ED0723E229, C8F1ECD19AD5FC970CF0D31BF46B0F2B
|
||||
32: 2E48DEE4B379CD59F5367D17DC397C1BFD53B8C4CE46A8202518614076174EB6, EFCE758ECCB6BE875D16B7E03A498D31
|
||||
|
||||
OCB-safer+ (16 byte key)
|
||||
0: , 88618DEF98FE588E23107E9A5D89C26B
|
||||
1: 39, 2B01B202E751F957E331ECD1CEDE3456
|
||||
2: 13CB, 17071E5AFD5D8CE953A73F49412BE8C4
|
||||
3: DC4428, 4B0B1881C2540FF92E7DE63C479A7750
|
||||
4: 120382B0, 0BB11D57B5BD9D846CF31033CD4CCB92
|
||||
5: 97F332F95B, 335E0424D0A820F60DBB968B8B5AA057
|
||||
6: 3C7AAE72037B, C8034C2C76C1CCD7C1B3F36DD8907E1D
|
||||
7: 8A99E4A1B89B6D, 06A8165DFADF1EA5ABD89E574422DF7F
|
||||
8: 676587065F0342B8, 93ADE63994DF2189079234DC204BF92B
|
||||
9: 8EC394CBC6877B245A, 1A89F0AB0B44BC708EBD9DE489E2EEB8
|
||||
10: 5FB5366E5CAE4DB72411, 5CA5881A5805D53ACA4904A5EEC01550
|
||||
11: 72A1994028F09ED6A4E45C, 0FFC0052996CE45DF4A28F7A6E9CFEA6
|
||||
12: 1D5EF20F52A9B72386D1A601, A697DF1179628DE1120D5E8D9F39DA6E
|
||||
13: 79BD002AA59D74F125AD9E32DE, 2F02CB6F70BF57BBA0DF100DE503F633
|
||||
14: 442C6F9016DF4C090056258756A9, 58C6FD3180B9B74459D70B5684BE3F4C
|
||||
15: 4FC5543D9A892B44ED04EE8B25E232, B8B858B3D3EB4B26E867E429F88A56B4
|
||||
16: F06E7503167C2210AB332259BAFD6AB4, 73CE2589D1DF34CA3DC2B14CC9FA6276
|
||||
17: BCCC260BD4823B64090FB33E6816F9C330, 81ABBDC83B2544907840FEB5AF4479EC
|
||||
18: 450C1105B76F960D1A5F33D7F9D37DAE20C3, C41DDC8980E88E3986D9C84857BBE1E7
|
||||
19: C9F36EF3A990E0554EDB59E6788F8E9BF1DBC7, 90DD543E148D9A0B79A8B376C5509E09
|
||||
20: 3666FEEA98A4FC434EDB7517E7FCEE2320C69BCB, 99F11B360DDB3A15C42110831CCBF21C
|
||||
21: 126F39C19D1E0B87F1180F6589A75712B66209E2CE, B4D268FB8EF5C048CA9A35337D57828A
|
||||
22: C1B6D14EE8B6D0A653BFCC295D5F94E6BCA09E181D8A, 4B4883B614D5CC412B53ED4203EA93B7
|
||||
23: D1F2A10F1A9DAB738C61CD0EF66FE5F6D1DA95DC671128, 3F1EFDA55EFEF1A0B24708E132BC4D25
|
||||
24: 9D457216C584F43DBA1DD55C54822A8B6A86D22DBFFA14D4, 53402970B128E98A5F0D62476A38F959
|
||||
25: 012828614B5D67C9A1EE24A1EBCD322FE9C8BE0C3F20A53714, 2BFF288D90DBDC638084F80F3F7AADF3
|
||||
26: B1904AECF599F6C74557475E409E75E646271DEDEC7A830260DB, BF119BDBDA27773E038B7067D2B0EECD
|
||||
27: ED831771C4346FC19435354AE29F7A9436D6E8D4D42CFF26207DBD, C3F029FC8AE690E84FBD0EF806B801F3
|
||||
28: E051B958601223FECEADF932A277BCF18C25025AE4DA791155B85035, EB75E56BE7856F1B5ED3D125C092D38A
|
||||
29: AB3449537C5E22125BC32D483F74C3A3DBDBD5232839A85D300F65B4FD, 851B0FBABD080F783BDE4F47ADCD6D76
|
||||
30: 4E68550837130652795A8C9D68530717D2B0AA5A17F3AEF92FFB502E46AC, 10E222706527A64E757EDE4B9EFC09DD
|
||||
31: C2D7033DA7A1857D79497EA6C64779EB969046CCEE6C74E6592FEE6E7C94C4, 2015674ECA80AC9B67AE854E18A7D56E
|
||||
32: 2F3F0374DDC24AE21F02D4DA74D46C71F0CD2269A68F32F7FAA0BAB64AA8E9BC, 737C8BA1677A8CE97D42FBB07530EE99
|
||||
|
||||
OCB-twofish (16 byte key)
|
||||
0: , 2CD8EF22E5457C7FE4016B0FB82FD204
|
||||
1: 64, EB7BB60E4932C0E97A7A5906BD044ACF
|
||||
2: 3A59, E3D2024241666369BB542ED096F20C71
|
||||
3: 67C038, 7E6F1EB3F2088F6416BB675DCAC0D484
|
||||
4: BB36BF02, BDEEEF07EBB7A50A5201C8A2D72C0036
|
||||
5: 6F06C0E293, C63557681D84ACCFFBFEE87D82EF1D3C
|
||||
6: 2015F94CC5AA, EF1DEAD4134D2A1A47A20F26FAA3554D
|
||||
7: A5F8CDD07964B0, 672B74D88C8AA7567C6AC4A896E0F6D1
|
||||
8: 5EFC9D8C3B9E7F3F, DB9160C53AD429D4C22BC0E2E6C509C5
|
||||
9: B62CB80F75594BC54F, 20020A798FF59F0472E750C796B5CC94
|
||||
10: 970983B0F889760EEEF0, 360AE43CEBCC27755548D4984CEEA10C
|
||||
11: 75C3A8CCB30A94CD57D1F8, 79820F3B1625E216B5BC1D1A22B198F9
|
||||
12: 033DA41CCBFE3C6897230FCE, CFE3EDD11627270CD63916508B058B7A
|
||||
13: 15358032F30043A66F49D3F76A, 98B8056A7991D5EF498E7C09DAC7B25D
|
||||
14: 71FBA7D6C2C8DC4A0E2773766F26, 22BA0ECEF19532554335D8F1A1C7DEFC
|
||||
15: BD761CD92C6F9FB651B38555CDFDC7, 8E3C7E1D8C4702B85C6FCD04184739E4
|
||||
16: EB6D310E2B7F84C24872EC48BFAA6BD7, 12DE548D982A122716CEDF5B5D2176D9
|
||||
17: 8DDF6CE25A67B409D3FB42A25C3AA7A842, 3E9FA2C6C65341A8E1101C15E1BBD936
|
||||
18: 5563DFC29B750FBC647E427C5480B65846DB, 90881C6820901BD41F7B3C2DF529B8A9
|
||||
19: 93343C1E9624321C2A0A155BA8B4E66FD92BE2, 71A641DDCD49825E10880D54BEF30E91
|
||||
20: C256BCA0CF0ACCEEC1AA4B9372AF27D2C3C65AFC, 91D45C4DA49BBAD1809A11F4041C7D09
|
||||
21: 3DE69FDB72C93518A3E317F7B26C425EE3DD42DA7E, 85E37B3E8EC3AF476DB7819D739D07D5
|
||||
22: 676AC7885C7C8FBE9862242FCCC46C181440EE49AE59, BCDB42B53AC4FDDF9C3BF8849AB96EEC
|
||||
23: D71B98B88F46CC47D90BB931564CDF0157F0ABCB5E6954, 289CD5799D9E49F36D70F67726A59610
|
||||
24: 669C16DB9DC175200C08476832155DAA52F1F8969DF3B79A, 835B210EBBE5C9D34C2E052E1843C1F8
|
||||
25: 2F39346E14A34BBED0491929CD9F1FB3CEC412C25AB703372A, DC4B42E8BA676BA100B87BEE328C5229
|
||||
26: 1FD0F8BD0AC95E91881635EB0CF0E4FB099CBB214CE556422E2D, 898CEB3CA8FCA565CE5B01EF932FD391
|
||||
27: 7FBD32B3D88B7E002BA6055585B5D0E1CC648315A81CFECA363CC8, 804820B1E3813D244164F778B9C2A8C8
|
||||
28: 877A5F336A1D33AB94751A33E285C21666F0D8F103AC1187FC205372, AF9F0AC165EAFCEE8C2A831608F166B4
|
||||
29: ECCA297705B0395E71B9E4263343D486B29207DA188C2F1BA626EDBF46, A05DC873406B236E4DDBC038DC4D2627
|
||||
30: FF3BD8D4E1108E98FBAE2E28BC12819CD7956BC491C0B3A291FBEE739599, 68DFE58473BA2818A23095D1D6EC065C
|
||||
31: F175230606040ADACEBAFE4D58BBD140B2D45E8BF7E5C904510B58E4B53D3F, DAF579E1A12481D39F4DCFB7C28794B1
|
||||
32: 261388D491EF1CB92C261FD9B91CAD5B95440DE0A747144EB8697699F600801D, 749056EBEAF4F20CD8746AA8C8846C47
|
||||
|
||||
OCB-safer-k64 (8 byte key)
|
||||
0: , 0EDD2A1AB692AA7A
|
||||
1: 3E, 306F814F3C2C109E
|
||||
2: 0593, 063D19B734C34715
|
||||
3: CA72C6, DF6DAAFAD91BE697
|
||||
4: 08924AEE, 15095FA49E789483
|
||||
5: 359908A6CD, 16CB7F0741BA4091
|
||||
6: 97F3BD820CF4, A59DB15B67B95EE8
|
||||
7: 0A267201AC039E, B4FFC31DBCD8284A
|
||||
8: 9F6ACD9705C9ECC5, 6B41A938F0B1CAEB
|
||||
9: F355D5A937DD1582C2, 9D1F932E521CB955
|
||||
10: ED39758CAF89E7932E48, 398EF517015F118F
|
||||
11: D8ACF19363A0E0ADC9321B, F98B2A30217766AA
|
||||
12: F8F54A8202B0F281ED610F33, 36EF7FA4A20E04B7
|
||||
13: 0F8677DF64B5982DB6E2299140, 4DED2DA806834C81
|
||||
14: 0C357A9DC321C93B3872881503B0, 7814D1C0C6A8900A
|
||||
15: 10B6B1A261C3015A18110AD200A7B6, 9A814D6D2BAD850C
|
||||
16: AA9EA9D1BA7818C0D2EBF23781A5467D, 236A24FC98826702
|
||||
|
||||
OCB-safer-sk64 (8 byte key)
|
||||
0: , 76F16BDCE55B3E23
|
||||
1: 63, F34B0B471F6F8F75
|
||||
2: 8651, D7EFE17943D35193
|
||||
3: D45504, 263224E50E7E9E75
|
||||
4: 57B414C3, A553D6CABCA0F285
|
||||
5: 4976E3B303, AC5E9969F739EBD9
|
||||
6: F10AB8EB94E0, 8301FFE68848D46D
|
||||
7: 6E954593AC427D, C1CF93BBC0F92644
|
||||
8: F48F44441B898C0F, 698FFAED1A95E8E4
|
||||
9: 1DC60156D62782E3D0, 6AFF0DCC65D4C933
|
||||
10: 71920ADC8997CB8B3A72, 1C101C6A27CFBBBD
|
||||
11: 890ED7492ED914AC20391B, F66DCD6205D945C6
|
||||
12: 1B9FAB84A8748BAC187C7393, B450757FCAFAAD52
|
||||
13: B4C89E1BB280DBC265E43ACE15, AE6BB3D2E6A371FF
|
||||
14: 24B0C28944BDF22048E2E86644F5, 84E93E2191CEF17A
|
||||
15: 8F2D5694D55EE235168AAA735943AF, 514252AEF2F2A2D9
|
||||
16: 568B7E31FFDA726718E40397CFC8DCC6, 3C80BA7FCA9E419E
|
||||
|
||||
OCB-safer-k128 (16 byte key)
|
||||
0: , 4919F68F6BC44ABC
|
||||
1: 65, C6785F7BE4DE54D3
|
||||
2: E1B0, C197C93B63F58355
|
||||
3: BB7247, DFE092EF8184443B
|
||||
4: 38C2D022, 943FD999227C5596
|
||||
5: D71E4FD0ED, 51040FE9A01EA901
|
||||
6: C4B211EADC2A, 329429BE3366F22F
|
||||
7: 426DEB3FC3A4BC, CF1C976F6A19CE88
|
||||
8: A6F813C09CE84800, 98D9FF427B3BD571
|
||||
9: 4D1A9948FD157814B4, 5A389FAEEB85B8C6
|
||||
10: EC3EA142C3F07F5A9EEB, 31E26E13F032A48F
|
||||
11: A75FB14365D1533CD3FBE7, 8EF01ACC568C0591
|
||||
12: 891582B5853DD546FF3EA071, E013CFFE43219C21
|
||||
13: 54CA848C49DCDEE076780F21F4, 298EFC7B4D6B6CFE
|
||||
14: EA7611C69A60F1A2EF71D6A7762D, 7D9AA51CFCEC8101
|
||||
15: B2D1A211BC524B965A084BB4B21710, 7B2AC0EEB5216892
|
||||
16: 5E81F1BFA270E804A488C9BFAB75811D, A67F627CE1E37851
|
||||
|
||||
OCB-safer-sk128 (16 byte key)
|
||||
0: , E523C6DBB3CA178D
|
||||
1: 5E, B1CB7EBE5780DF98
|
||||
2: F4D8, 8036235F2BE7A817
|
||||
3: 4FE268, 123320394EAC24F6
|
||||
4: A5BA02B4, B8276B5E027D45DA
|
||||
5: 1571859CCC, 29406C5F2DF2CFC4
|
||||
6: CA1E47447B95, 5D4FAF8FD5341791
|
||||
7: 8710DB37022D96, E10040FEA9AEA9C2
|
||||
8: 205990DC9A34DA3C, AE25CB49AA7A697B
|
||||
9: 757AFCB3191DC811C3, AA8CADA8638D6118
|
||||
10: 6994F8C153522361BB92, 1BCEE09E928EB18B
|
||||
11: A86FA0CDD051BB60AF5AA8, 50A38F8E9889354D
|
||||
12: 8D3FD3EB7FF2269AACFD24BA, CB51CF84CEFC45F0
|
||||
13: 03D2A313925D9490FC5547F95F, A1FF9D72E11C420B
|
||||
14: D77C0F0F600FE92F14F479FA457C, 1EBE1B4B9685EDFA
|
||||
15: 0CAF0A8BEB864E26058C7DF8EBA0EB, 1B153DDAE807561F
|
||||
16: 113D12716DFE0596A2F30C875EC6BA0E, C61F5AC0245154A6
|
||||
|
||||
OCB-rc2 (8 byte key)
|
||||
0: , 1A073F25FF5690BE
|
||||
1: F4, 3D3221E92E40F634
|
||||
2: 2C76, C22C20B7231A0DB9
|
||||
3: C647CB, 3E6348D996399629
|
||||
4: 2021891A, 8EF76B24E9D55FDA
|
||||
5: 1966CBCBBF, 310D24024D573E8D
|
||||
6: 42C15AC9AAF0, 217E83C0CDE4F077
|
||||
7: AB70F3F73DF0B6, 16AB2679D96A591B
|
||||
8: B7C7DD845D7E76DD, F33065EA531545CA
|
||||
9: 468CC16A37CF63EA73, 88879733F70AE3D3
|
||||
10: 4F769E25A7346E22A932, 26E1A92FEDEE0597
|
||||
11: 304A8B53B1CD24C6C27C17, 48B46E9F091B0B2E
|
||||
12: 4E3DF867FEFF0B8E06D5FA70, 53BB48BFB8AB4750
|
||||
13: 2BAB3F0A8C38A3BD3C49DBBA5A, 52303CADCBB6D312
|
||||
14: 3D04A29924589AAEF93A29003EE7, 120EF9364B83748F
|
||||
15: 486127A80E4EC599C461451CF1D79B, 2245D51599CAD629
|
||||
16: AF8FB3FD2DB343F1AFF564FCBEA58785, 805BF441E660B0B0
|
||||
|
||||
OCB-des (8 byte key)
|
||||
0: , 8A65BD7DE54082AD
|
||||
1: A8, 3A83897CC8EC7CF6
|
||||
2: 9256, DC66C39C7DD87D93
|
||||
3: C145A0, 45967F3764F62F48
|
||||
4: CD314BAB, EF38B0213259C3D4
|
||||
5: 7074014741, 6748F4BAF06DD7BD
|
||||
6: 9A874CAE01F1, E382DB7235624104
|
||||
7: DFA0D86DC4CA84, 627ABB432E50455E
|
||||
8: 685C2B2CBDD8D144, D166082E085063BA
|
||||
9: 53515DAAC7F7B8CE1D, 6680B6C26E1B0994
|
||||
10: 2B3967812BF4155A8D36, AFED7F38AFEFC543
|
||||
11: F4E5AC3CC5913B8A7F35FB, 6181DD3C46A6C24F
|
||||
12: F3EC89AD4235287D53715A81, 12CC354833FE5BD8
|
||||
13: 66D554AC2CA85C079F051B8459, 097F31088CFBA239
|
||||
14: 8746061C26D72771A7586949A3E4, 6CEF3565D0E45C6B
|
||||
15: FB3BCC650B29F418930A467EA4FB73, 64D12723E100F08B
|
||||
16: DE1C27E9B3C391AF5DF403291F2C084A, 6BADE4638AE46BE2
|
||||
|
||||
OCB-3des (24 byte key)
|
||||
0: , 9CB7074F93CD37DD
|
||||
1: 4D, 51541A838A154E0B
|
||||
2: 5C77, 60E86F2F1F4C6F96
|
||||
3: B3D2F0, 7D74A9E6A061457D
|
||||
4: B3556075, EAF7A89A07453460
|
||||
5: 1B61CE7230, F90D18620E1AB877
|
||||
6: 3987FEC8D0D7, B5EF04DEE2E528F9
|
||||
7: EBD0A7EBEEFF3B, A72CA24DD77A5DDA
|
||||
8: 429FB38DDABF76D4, D0578484C37227C8
|
||||
9: F8DF28BF5C4CD28B1B, 5E7C4DC8E694E3B4
|
||||
10: 2BF436BBE063F7E830C2, 8D919637C973C71B
|
||||
11: ED21656C8878319F1B7D29, 8813280C1277DF26
|
||||
12: F45F90980D38EDF5D0FEC926, F9619341E273A31F
|
||||
13: 52F2D3CACC294B141B35D73BBF, 7BBC3F1A0D38F61F
|
||||
14: 2E6DA0FB55962F79B8E890E8DD8D, 8060799DCAB802E4
|
||||
15: D6F9A6B2420174C499F9FE91178784, D3AAF969ED2F7215
|
||||
16: 4F1CF285B8748C4F8F4D201C06B343CA, 203A2692C077F1B5
|
||||
|
||||
OCB-cast5 (8 byte key)
|
||||
0: , 77E8002236021687
|
||||
1: 52, D57DF1037B6A799D
|
||||
2: 31C9, 7E781759B057D695
|
||||
3: 5C8324, 56965D6CB2C97C0C
|
||||
4: 17D99099, 7C52B5D09475F5D3
|
||||
5: 400082C475, 3CA5CDB9B4A0FAE9
|
||||
6: 4DF0E4000C24, DCFEE2C3384F9731
|
||||
7: 10004C3CE32255, 0A6832F985F61658
|
||||
8: FFA6EA76B346893C, 6202693B153254D6
|
||||
9: E96378C94D246AB51C, 5B259FEB715B9159
|
||||
10: A9BED2D59A92D3D9418A, 1E7E066C098A023D
|
||||
11: 4EF144B7D4622BAD4DC840, 5DAB2C1D0DF56B08
|
||||
12: 6DBCDF56E57CE47DD3D0CF44, 2A24F2A224368F55
|
||||
13: 43241A0AD933635D7C8EAD47DC, 86B4B5AC22177F19
|
||||
14: 920D6BDBE073F3C75052420C883D, 10943DBB23BD894D
|
||||
15: B2C75DF024269833B039CAB19EC865, 84B7DBB425E45855
|
||||
16: 6A9424B6A873BB7155C01DC87E23EC52, 82C5047655952B01
|
||||
|
||||
OCB-noekeon (16 byte key)
|
||||
0: , C810FFEC70BB008FD7C314A732B226E6
|
||||
1: D0, 3C48A2C7E0CE9B9099221EF2CEC56767
|
||||
2: 5542, 518EDB8174B067CBF2568C6911378137
|
||||
3: 65E8A4, 3E4EFF5F6FBC99EF3B71B11F566A20FB
|
||||
4: 3D0EF863, A366D5CE05F564B5E676EC78938CCC85
|
||||
5: 89B17BA512, 0E83095D771F654CBD630AC114501A0F
|
||||
6: E9AF5FCFEFED, 3A283F7FF02274DD4B48C2CD7E36182D
|
||||
7: F7A001CEC51C30, 8392CC274521BB452134713153F36268
|
||||
8: D796E3F23E31D4F2, 351C7B0304E127287A9A1DE38BB3167A
|
||||
9: C4E2BBF6B4827E1A84, 275907279D0764CF80D7E6626D81F994
|
||||
10: 6C61226E61F70408A61A, 941AD1718D272BFCB8C5ACE08F90B2D1
|
||||
11: 3C195850E7FD63EFC11F7C, 348A975B60908445230D4D56A0CAB008
|
||||
12: EE5FF5362DA3744C9EAD274B, 875C2167BFAEB65F5601F2DB9035444C
|
||||
13: 7DB5392ED1933ED858EC0C52F5, BE6507D8AC743805A872658C680A4D06
|
||||
14: FEDEAE2EC2059D22B960813B5E7D, A559933509C47854176CEEDEC12EB8B4
|
||||
15: 64C81F2169F7CEFBF51E68D4186A36, FFE84A9B49F0E77A9799EDEC7D76B987
|
||||
16: 66532B678D23130714E088FE874C4743, AF95ADA553A68319DBEBDA4172E18A22
|
||||
17: 53E56845C091A1E2372F3FC772017C9804, 9A6AB7CEB632429F2B31FB91C141B6F0
|
||||
18: DAF6832520591B886E2E962ACF5B9D0A38E9, 73FFEBA8997E0C55CB0B4ABE59C86BF6
|
||||
19: 108F04FEFCB5EE68033E57346012CDEB348D14, E08E90976E0F7868994B017D7A007AB8
|
||||
20: 101682160DEB9667FB073F96ED1D9C063ABCE668, FB79A4BEBCA9A7832C72116AD9B98D41
|
||||
21: E10AB0D22A6C4C253D818AB6AF1A3FF5811C6CEF24, 174CD350B069A239F9EB80A7BCADE8B7
|
||||
22: 9F62A79B25D4F5532D78228A50516F97ACB7A2C5DF13, DD25DD14174B5667B0AD70732323C8C4
|
||||
23: 2A0AA96147E74A3B881D62BA692EE27927A9EAB351C6DB, 9CE03AACF9318770BF7E095F90B470DB
|
||||
24: 29E38605973D0218AA8BAF2FBAB7722DB242C4775E453372, 72D6038E8927EDDE469F98B84C74A8A3
|
||||
25: 8DBF8C2B5477DBA6E07B269293713D60D60BE29E677CA35C33, 83100BBC1401C890B36890A3FD0CD4EE
|
||||
26: 13DE9776093827F254DBF500EEBE0C65DC602A5FDF6AEFFC34D9, D142F6CE9E43633CBE94A2BDCC9AC5A8
|
||||
27: 4A25370043862CF7A12A00A5A278623F9BF8DE33212D35661591EC, 62064DD74F9F6D77682B43D9B44E26B8
|
||||
28: 37C6C6C40DA0581BF041770E330A40185E90426A1A4AC9BCDBC5CA7D, E77EE99F62EB1A38CCD1E90CED6EB5C7
|
||||
29: 6B9047158068957CBF77F35988E5C926C7B262A8EBA9D33638A15B1505, 913DC491D3B2AFF172053CC4D1271F46
|
||||
30: 949E5F05396F60722877EDBAA5D7437DDB24B3E25651458C266992D0854E, 87D4396BBC24646659F10179823066B2
|
||||
31: D48489C360F6EB2BF4155FFD7CCAFA4793B8870BFA4A95C9BEDD372F51C04E, 173EEB238E6186D5A93AC6072A22B772
|
||||
32: ACB6F91E8BDB4CFFE1F2A5F6C712D16177EE06842E4CF27F61C8F68D44C842FF, A1E5F2560183B0AFE466243EF3921E4D
|
||||
|
||||
OCB-skipjack (10 byte key)
|
||||
0: , 90EAAB5131AEB43B
|
||||
1: 2F, 6274B82063314006
|
||||
2: DAF6, 6A6BCCE84FD4EF02
|
||||
3: 5C2A88, C83D54C562A62852
|
||||
4: B6E8FB5E, C44459EF41C8F296
|
||||
5: 6C0888C119, 269DD7657BD0225F
|
||||
6: 1FD9AD7ECCC3, 3CA090F46B107839
|
||||
7: 1EDBFF8AE458A3, 440380BF9745132B
|
||||
8: 04DBECC1F31F9F96, 2653620A4877B0E6
|
||||
9: 908AE5648AF988A896, 00180FF33C1DD249
|
||||
10: 53E63E0C297C1FC7859B, 36616209504C4230
|
||||
11: 407BE16144187B4BEBD3A3, 4754B7DD4DB2927B
|
||||
12: 9961D87CFEDDF9CC22F2C806, 5947FC41E6B9CEC9
|
||||
13: 9F5254962E4D210ED8AC301252, 97A392BEAF9B3B04
|
||||
14: 379FDA76ECCFDAAC10F67FBF624C, 1D895ABD932BD5EC
|
||||
15: 1D5A7AD556FF3078284BB21A536DAA, 01FAE2F4936ED9D2
|
||||
16: 4B8B71396924880CB33EA6EC6593F969, A0F4B1BE3B9B4CCE
|
||||
|
||||
OCB-anubis (16 byte key)
|
||||
0: , D22ACF880B297DB0513DFAF0D2DF57D9
|
||||
1: 59, 210A179469D6568AB9470C760415574E
|
||||
2: AFA5, 1223F9CD160ABE2F257164C6E5533C87
|
||||
3: 969BEC, A57EC767543CA2ADBA4F5A7423ECA78A
|
||||
4: CF8B31F1, 13B5BF9CD87CE15CE696F3AF1B082650
|
||||
5: 9B22DF3852, 4937FDDA0AFDDA04CCD53CCBB0A82745
|
||||
6: E11719B2F0F8, 6847931DBF0223F5CEF66AE3F4DFCF9B
|
||||
7: 5A85E0F6DD2266, A1A0AF45A68A681CC396615FE1E1DFB5
|
||||
8: 7F2DFCC65ED86976, 13614A3C6E0E08611D8DF8EE5B7D788F
|
||||
9: 1DAF10DFA3F1D53E50, 673632B6DD553BAE90E9E6CC8CDE0FA5
|
||||
10: AF74FD9671F9C0A9879C, B8B4DD448FE967207227B84E42126D90
|
||||
11: 49421CED1167A882E26297, 21C8951A1761E4BD13BC85CBD14D30BD
|
||||
12: BC0BC779B83F07D30CB340DA, FAABD25E14FFD8D468AD6616021F604C
|
||||
13: 843D7E00F94E61AE950B9AA191, 08933ED5FBDCAF72F788393CD5422D0F
|
||||
14: 296F15C383C511C36258F528E331, 8BFFADF5655C1864057D69A6706D1739
|
||||
15: E31D2E80B2DBA4FBFAF52DB0513838, C4CD36821EC631CCBF1F258EE9931288
|
||||
16: 87F319FE9A48E2D087EDF95563896EE5, 517960488E5A118D150A1573E76C290A
|
||||
17: 9632B7DC1740BBE0A7AEEFD0F535B5AE8A, 0C24D0950873621D319A928862D3A6AC
|
||||
18: 359431ED4B3AC537238CAC2F86126972D403, 4A0CED2F4BFA3355C17D6C5DF9FABFAA
|
||||
19: E15B50172EE8DA9C552D448A5A48BEEAA2F11D, 8166B2A2D3A0745D1055F9F503FD6C03
|
||||
20: 75842DDC0D5E3BD80225E4BFBD1298421244D7EF, BB957BB2582B67B63978BCFD7A949EDD
|
||||
21: 3DD69162716D5F3E096E614991CAD7ED8E01F926B8, 40A954F31F5B0A2C5DD220ACED8D2B3E
|
||||
22: 8A49AC14F59593D5399A10F9346E2FD36F47F64ED419, 4324D408CE7F86370495AF14FBD1A859
|
||||
23: 6AA8FA353BCAAB4262211D75F13D27BE173526B8BC3CFC, BA3A27D79EC8ECBC5A78CB9FD095B766
|
||||
24: B918192BB72CFEF980298EEE570460356A4BA1755576FEAA, EB341ECE0A070E769F498600EE4EBF77
|
||||
25: BEFAE0B77E42A2FD18958D9E43202E8A338562AFF8317461B0, 444C1D6BDC026A01012BB2CEEAD89C2C
|
||||
26: 07E86D49CFFE6FB08FDF44584033AF321447003D8AD3862C00C9, DA9355A79B224EF662DA65F19BE494A7
|
||||
27: 911BB223AC6F6E54082FBFEDEC300D73FCAF715CCA35949212B372, 3496160A46A21DCDB5A4C179F159D860
|
||||
28: ABB563FC803715F59AA35460E98470E2E94E4270455ACEBF4297641B, 899CFE1946A060DE620879B8A7464718
|
||||
29: 47D98E83B5849CDE19B14ABCF9EA6CA9684AB49A3AB36BD14F328D808C, 6D76CD5EFF6D4AD3B67A56DF1EB42E05
|
||||
30: C8BF0B71A95884FFB93D64C57E327A4754EC5A1EE26632CF8E0B6B26CBDE, 2B3BE785263B1A400E5893273AFD09AE
|
||||
31: 9804D668CF2D75CA58C9671F65630E33909269B9511AF9119BE88EBB35F00C, 3DDA028B1A2339CA817DC8D9371E0FF8
|
||||
32: F6E038A82A09BCD20BAAC7926B2296B78F9CBA9DD12C497C47EA08DBCD8CEA3A, A203FC1E68E21A52E72224891AC10EE2
|
||||
|
||||
OCB-khazad (16 byte key)
|
||||
0: , BDEDFF7AA0070063
|
||||
1: 00, 67E951582D66ED93
|
||||
2: 5FED, 09DC8AEAD70673DE
|
||||
3: 26A7CC, CE1436CE1E37D4B0
|
||||
4: 3D2BD063, 574C24395F31511A
|
||||
5: 597F1AFCB1, 6FBBE820C6F26CDB
|
||||
6: 202DAE442DF6, 58CA6E5706C9852D
|
||||
7: 7C20EDA18E9444, AABF0DA252A1BAAD
|
||||
8: DEC02BF76DFD5B77, A0A97446B80EACB6
|
||||
9: 5D7A42F73843F9200E, A1DD603372D124CB
|
||||
10: 0D4710E454C19B68369E, CC78E9D7EAA6A39F
|
||||
11: 126694191BF09A29DCF40E, 76C9B84FA3E8913F
|
||||
12: A94EBB86BD325B4FA1942FA5, 613DE312DB1666F7
|
||||
13: 4F9462386469EA0EFDC1BFAFE9, 5247244FD4BBAA6F
|
||||
14: 4EB794DFCF3823BDC38FA5EF3B23, 0C12017B5E058398
|
||||
15: D870479780CC5B3B13A7A39029A56F, 003D3FCD31D497B5
|
||||
16: A47BF1218AC86A60F6002CE004AF5E50, B4EC27091D5DCD58
|
||||
|
||||
OCB-seed (16 byte key)
|
||||
0: , D80D16D2D0FB2BD9EBA4912468B893D7
|
||||
1: 12, 8776140CB818C1CBFD2CFCD8BDFC9FFA
|
||||
2: F8A1, 597381977898AC43194C302216113CEB
|
||||
3: B35B5E, BC327275E7A552C4E0AC0FCB8403A6C4
|
||||
4: 19F57542, 4E49DE569547B619E4187239D9B755C2
|
||||
5: EAD2D99E86, 53DCC5FAB4DE25541A22AF0309C9FE78
|
||||
6: 4902A8FF9AF9, 950D9A28DFBDAECE5F14D47E6B7A8B8B
|
||||
7: 45FE502602EA4E, 69CD243A3CF17FE51ABBFA2CDE510BCC
|
||||
8: D54F2EDE48207CFB, 775EE6140AACF9D56787071F08F36F67
|
||||
9: FEDBBFD9FAABC80186, B37B2C643D62A205BD009BB55D50B918
|
||||
10: 3541A86C889AFEB783B7, FE41A36AC076F417B6A3870DB712CC1F
|
||||
11: 62EB71A2EAFDDE1A050AFC, A953ECF1F0B53438E869F0CFB84CB142
|
||||
12: 77AFE377460D6A51208194DB, 5CC2A9D8499F1B25D78937DAFB1DED10
|
||||
13: A34FCDD7CA45DFAA2178CDC7E8, A14A119115143EE2B4719282C9E2356C
|
||||
14: A61FA4E9550280C8AAC87EF7A204, A87DDD9631C87ED0792C067E8D7F1D9B
|
||||
15: EE82AF5C51896AED298B0C12E00ECF, 9051873090B013508F93677D3A080E96
|
||||
16: 5D532646FAD510E984959C4E14F853D7, 275D8DF932818030F1269804DE06A73B
|
||||
17: 1D77F8916DF479DDCE3F49A1D9DEFA40FB, 99611A067F45F140AFDB6FB7E9C23DF2
|
||||
18: 5857267B77E7B8D7732509AEAC0AA80BDB2C, 3159BF09910493977A33268C7F7DBC01
|
||||
19: 1CF64E54D48811F02DAAE472846E65235DC8B7, 78F88A35E2D93A0746058D1B37762A27
|
||||
20: 8CC20A5FEFE9AAE81742DE70453F62A961188DB7, EDA9E9208EC38152E53AFD62ABC77F0B
|
||||
21: 1D6CCEEEC72CC7369C33F5CD83ED0DCD6F5613D562, 9FEFD274F3F906B11DD87CC2C0F9D0A2
|
||||
22: 20A9C1EAD88F005DB8F69C8BE005D8A010B261FF2EAD, A341F754932DCBC6DAFE4231918A9CF1
|
||||
23: DCEC1BB28E8D77D69B5148FB02E02C281B68BA6E9768B0, 6AAB2EEB1D25D2DF7CEEFA6054E295DA
|
||||
24: 7C4F7165943DB1EFA5731F5C75931F4391F0C40D5731BC54, 3FBFF88733ACE5289D9FB9CD24C44C3F
|
||||
25: F5E2C8A9B3A02E0BB86F9E969B0EDA5F554B0C8902BB6F4643, DFB22569019686B2EE92ABA9EE6610B0
|
||||
26: 42B7D0E9613AFAD6E8093E4F638BC96E22413F15A84202188C31, 002F0F602F596236A8F239E81CE47FC0
|
||||
27: 88B89B7756BD3BE09467998FABD12BCE87E5FE994ADE9B30844AE6, 05E0E8AFA55C3B571A849CE4C9F1F477
|
||||
28: 10452565D15D1D829FC54F61960C6A749AFB91086E388269CF6B588A, DD88B0C63E040DF8878B3C919AA95218
|
||||
29: E68619409B86082C744496FC3F645CE1134E84192D2CBCE1CFEEB12612, 83258C337EF21302724CE051A03195D6
|
||||
30: 840277319319EF1DDF6A57682B6695550157F5B76756BF81BFFB3394AFC0, 183FA85F8E91F8972DA23108FA066F20
|
||||
31: C74A4B01328B809397C07F4FC16131FBEE6396293181C327ADB50EF39CC936, D6C5CF79D47995D7CDB5745F601D859F
|
||||
32: FF3FEE866339B01DD2C1EC0C0E569A458A77DD014AF0CC9C0A8DC52A52133940, BF1AF01F2CB34CBAF1EAB96FBCCB5404
|
||||
|
||||
OCB-kasumi (16 byte key)
|
||||
0: , 7B4CE3A5B7284F8B
|
||||
1: F8, 80584D787B7AE753
|
||||
2: D37A, 7BD7B52BE65B995C
|
||||
3: 2D07BF, 6E6E16FDFE808D21
|
||||
4: 9F1A8E7F, 810CDE98B80F2CF2
|
||||
5: C6A7842512, CB6E9709AD7E8545
|
||||
6: 056553F25EE5, 24A74A113D68E373
|
||||
7: C3E0215DEABD43, 80B9F0ABDC207E04
|
||||
8: 38DA7B24B04DDF91, AEEB273DCAE4F743
|
||||
9: 34169FBF64966E0EB8, 1D10D18FC0DF5372
|
||||
10: 5B3A510F1AE97BFCE1EA, 5B1342A77724DBF7
|
||||
11: 39D1B5067E584E59BB6603, 38EDA20D46B2563D
|
||||
12: AC2DD02E2406D7D8175EB308, AE7DCB1AE6188975
|
||||
13: B0623EDBC20FEBEDF9B4AB70E6, E218732D221A04A4
|
||||
14: 82F57A435A92E28B56F4EF5E7EA8, CC5842752D089C26
|
||||
15: F2D54E3B9022AB32F668AD5A20D050, D811DF3DE76089FF
|
||||
16: 1CAC13A538AFC64D9747226AC23F072C, 2DF49C64213B35B9
|
||||
|
||||
OCB-multi2 (40 byte key)
|
||||
0: , 70A2AD75028C8B3E
|
||||
1: 3E, 76BE76B249142049
|
||||
2: 5C21, E31CDBD0ED6B864D
|
||||
3: 62BC9F, F1124FC4C9C82617
|
||||
4: BB5AC85A, 97035E20D4FFEC81
|
||||
5: 500D9D05E3, 86D5EC5AD1D55434
|
||||
6: 5179B8442E46, 432EAB80B938A00E
|
||||
7: 361000D13C364B, 5ADB3F9FD65EC776
|
||||
8: 5C5BD790B927CBE4, F6ED8E9D330FD37E
|
||||
9: 2020DD735C5D7B4739, F98DEFD6A8368E1F
|
||||
10: 008A8548790A3582C2AC, 041C4E2FA196390C
|
||||
11: E6409403D3E2E4385EE54E, 25AE9113A0E7A3EF
|
||||
12: E23E598908C755FCF9D51E39, 21BF8C9F319FB44F
|
||||
13: C1F13F46FF04717C7E54FFBDC7, E7D8CDF40A1D78A5
|
||||
14: 27721EB66D4F6362308B96DD9895, A374C96FCA94C809
|
||||
15: 1A393F94CB9ACD3BB93D8766C63569, 45A090303B71D35D
|
||||
16: BCC0498FB13CEE8A615FF6409EDF1707, 9589A4CBC481A455
|
||||
|
||||
OCB-camellia (16 byte key)
|
||||
0: , 6972CC27A9711EAE6654851AB8E0C53F
|
||||
1: A2, 208D783961FD532E14376B4EE904FE52
|
||||
2: 1177, C7CC74015F7EDD9A72F7435494D8A050
|
||||
3: 0F8502, F1A708AA0F485A554E2E76592CD9D7F4
|
||||
4: 9986180B, D47186A8B539F890824DEBA223861ACD
|
||||
5: C0FF4519C3, 4430A9453016E4974CFB5380A1F3E95F
|
||||
6: 2AC54E3E6A0B, 6E320BE8DAF4BA0462A57BECC574740F
|
||||
7: 846053E1A37A6A, 5B91B680B92517781DC362C2F3E144E4
|
||||
8: CCB09ECFF76EEE2C, F91E7E245F4C8A404F3ECC7DE49261C3
|
||||
9: E049E2AA271388106E, 8C6981A160D831F4DC57FACE5ACCF006
|
||||
10: 761782341D52BA8AD12F, 672DC4B06DBBCED80381CE4845757F0B
|
||||
11: 92AD781DEC4549940265C6, DB04CAABC54E71FE1A9C41DF1ED5C52E
|
||||
12: D507B77EEE9BE07EAD700143, B3EFCC0B27DC85166E04E7BC39E45C58
|
||||
13: 5AA1AD6B9CAE3001D4C1CC4048, 424D8A22F7B9ADA30AAC0C1D3D4E77F9
|
||||
14: C69E96F7A4B9A6F0F2C7EFA72C26, 678144F802AE9DD83D11877779B48972
|
||||
15: E2596B3FE48EF6EC50D857C8B4E3F4, DDB3BD2B8AB2FA71C7F56C8E57AFF2C2
|
||||
16: D81664A002E03A75E08CF16EE7670E97, B56A0B0955E15E62C557C6E66782AF4C
|
||||
17: A8F2696A972A87C784FDC775439470D822, 36E3AD03CB18002A17D49E466CE64814
|
||||
18: C2B537D807BD1ACA734AA072D9C2B836F588, 449B05D145666D1E5A92E204FC3507D7
|
||||
19: D5418F1288BFA7D39D23B3C6ECF797397D3D44, B0CFBA612544B8AB159E9D4AD1FFB3D4
|
||||
20: 2F9522460182291C6F264308E0363B9FE312E517, 1EE4CB38075B67463FB9DE26DF9D581C
|
||||
21: DF2881568BECA504A66E4B15BEA58AE6E99D0270E6, 3283D46803FC33098BB262FC1D2B2157
|
||||
22: 4B0083A4CF7E166C8466A5B991AD0CDF71F9DF010EE7, 7C91D9A5DF6C76CB02D83D8C7F3D8D07
|
||||
23: AC0457474B4193647D62906BD08D8C8EB32BE151555B68, 0A448FF3C468D7CDC945724172CEB66F
|
||||
24: E6E7786EBECDC296F072CD66C89141C700DE2A8B5DBF6549, 68ACCB5FEC04717FB21FF3B46A34BC74
|
||||
25: 860865770047A9798D90C9365E9C9F8210CB804D785D65E2C0, A58F22FFC4CBFE3BBA451BE4B3B95723
|
||||
26: F157588B4F98D798E6850D8F04ABF9905C1BBB2D055ADE1EA424, D6960C1EA6DAF225366374333D38EBDB
|
||||
27: DE3431977821BC861CD88E4236BCAAAFFE3C894607498FB8D68746, A3D23729464BD38338F4AC5B4D9F5C81
|
||||
28: 3F2F0AB546E118B76B937D539806DC02D02A5D42D64926A9E1101D66, 3C0D2D23F5DAF7D36DDC0F87B4163F42
|
||||
29: 3F9FFAE1D7BC62BB80A2FA2728FC33FF02E26CB9F52EA8D03FFE95A49A, 96B45B3F946E629ED974EFA7B66F5DDF
|
||||
30: A398B66C8425CE9E8A6BF5AB900CEA1EAE811E06AC7BC0D69A53FB2015BB, F83411C72B7DB201B254565D1DD8D1BF
|
||||
31: 9C760ED6C10A80C52F092ED20AB1D03A52427B6235F3C7FE7541033AACDD74, 8AB98FCA89D1245B177E0AC06E083024
|
||||
32: C38F260587B3BA9919601BD0A56909FB36ABCEB8968D08DD6B74F1EF5ED7065C, E357D0D56124276790DACA38D95792BB
|
||||
|
||||
@@ -1,569 +0,0 @@
|
||||
OMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are OMAC'ed. The initial key is
|
||||
of the same format (length specified per cipher). The OMAC key in step N+1 is the OMAC output of
|
||||
step N (repeated as required to fill the array).
|
||||
|
||||
OMAC-aes (16 byte key)
|
||||
0: 97DD6E5A882CBD564C39AE7D1C5A31AA
|
||||
1: F69346EEB9A76553172FC20E9DB18C63
|
||||
2: 996B17202E2EDEBD63F414DD5E84F3AF
|
||||
3: D00D7DA967A2873589A7496503B3DBAB
|
||||
4: B43C24C0A82DAA12D328395C2ABD7CAE
|
||||
5: 9B902B6663B5FEDC6F9DCE74B35B91F2
|
||||
6: 06A9678C65D7CE225E082ECA31788335
|
||||
7: 7D67866CDB313DF65DED113DB02D6362
|
||||
8: 259E28CF3E578AC47A21A77BA9EA8261
|
||||
9: 32F23C8F93EA301C6D3FE0840CA8DB4B
|
||||
10: C2B06388AD6F8C43D19FE4F6A8ED21AE
|
||||
11: FA8622485DB2F62F84FF46E532A1A141
|
||||
12: F312D9B2E6272578F406B66C79F30A0E
|
||||
13: 7A5DE06B2BFB75ADA665E96F680AC098
|
||||
14: C3B00380F0BD8E2F5C9DD9945E0F36EE
|
||||
15: DDD87974A5FB2E7A4514241E94526B5B
|
||||
16: AD24FC47A0FEA84C54696DE997A94F4B
|
||||
17: 7538713D8AA2AE3726307EFF087BBF5E
|
||||
18: 7619A52B4C34A98440812F5F28F8DC4F
|
||||
19: 7E797B8846554888622CC5E400B2FA44
|
||||
20: 61E8DD3E09145F5657DB4B8F7BD2D7D8
|
||||
21: FDAE2A3FE60DDF1871C2613A293AB6F1
|
||||
22: A186D6EFD10DFFD2C088480B0A784185
|
||||
23: 3119D337865618CDA55C06FB992427CF
|
||||
24: 413E3EAD7E3F169A37C49F9CA92E235E
|
||||
25: 37A55AF22373B9A1E2F8368B2FB992CA
|
||||
26: 4941F604C40EEEE1A16CFE073C12D1FE
|
||||
27: 3E8F4A0876BF12A2DCA87157F15DC884
|
||||
28: 5DFAE292D8EEB13D8FE5725E5D169742
|
||||
29: 59160455E0C0B35D950BA67C77F9FB05
|
||||
30: 5AC0D736A06A7DD146B137ADEE78EE06
|
||||
31: 0CA1178F28B953045EE76E2E760036CA
|
||||
32: 025616215F870D1EF838AD1D2AE0C649
|
||||
|
||||
OMAC-blowfish (8 byte key)
|
||||
0: 2CFB5DE451FFE8CC
|
||||
1: A5AC339DB44D020C
|
||||
2: A3CE0CF62249444D
|
||||
3: 3076B7129CE3F6A1
|
||||
4: 9E091A637DDF70E3
|
||||
5: 275199AB20A5F09C
|
||||
6: CDEDA8D16A401E62
|
||||
7: FC980516CF5C9E30
|
||||
8: 659D0B31D21B622B
|
||||
9: 8306847B5E72E018
|
||||
10: 7AD029BBF1D2919F
|
||||
11: 133181425C6808C9
|
||||
12: FC5AC60E367F413A
|
||||
13: E0DF8BCCF0AD01D9
|
||||
14: AC5015398FA64A85
|
||||
15: 1F068F22AFFECEE1
|
||||
16: 8E6831D5370678EF
|
||||
|
||||
OMAC-xtea (16 byte key)
|
||||
0: A821403929958A1A
|
||||
1: 68C4A02D47C2E7C0
|
||||
2: 7D37358141506DC1
|
||||
3: 9BEA3AAE55B75F52
|
||||
4: 884D053D05CC8DE4
|
||||
5: E953747483FF4E0D
|
||||
6: B6E77E72C9738E4F
|
||||
7: 8AB67D2B24E3D512
|
||||
8: 329C0B9D504A0D41
|
||||
9: 50323DA8ACEF4164
|
||||
10: FA3239C668C34DA3
|
||||
11: B5A12FC81FC24084
|
||||
12: 71A01A3ED3936934
|
||||
13: F29B630CEB6AEDDB
|
||||
14: F8802F0D4504D55E
|
||||
15: F844B92162038F99
|
||||
16: 99AECD7CA69F0465
|
||||
|
||||
OMAC-rc5 (8 byte key)
|
||||
0: E374E40562C3CB23
|
||||
1: B46D83F69233E236
|
||||
2: 7CB72B1D335F04B0
|
||||
3: 94457CBC97B31328
|
||||
4: 543D0EDFCDCD7C76
|
||||
5: 5164EFA8412EAA5D
|
||||
6: 13CA0717EF95F9A7
|
||||
7: 2AA49A7AA7719700
|
||||
8: C9E7C56125C3D90F
|
||||
9: 2BE3E15FE58648AA
|
||||
10: 77D0B90372D6D0FD
|
||||
11: 17408F62ECD62F57
|
||||
12: 7864EFFA59DC059B
|
||||
13: 3212E76E25E5DEA8
|
||||
14: E2424C083CDE5A6A
|
||||
15: DE86FFDBDA65D138
|
||||
16: 85482C24D61B8950
|
||||
|
||||
OMAC-rc6 (16 byte key)
|
||||
0: E103BD8BA47B7C1C010E1561712E6722
|
||||
1: E51AEECFED3AF40443B3A1C011407736
|
||||
2: FA6506C5ABE03381B045D28D1D828966
|
||||
3: FAC4237FFE7772E2299D3D983BB130DD
|
||||
4: 3A7E24D41121A5D4F96FCECF0C2A4A10
|
||||
5: AA44291E5500C1C8E1A14CB56E4F979A
|
||||
6: 4B8FDA6DA6B3266E39111F403C31754E
|
||||
7: 4DF5F1A1C8EBC7F56D0D12EEB63FF585
|
||||
8: 46A6DDE419355EDE14D31045FCA1BA35
|
||||
9: 71756D4D3DF59578B7F93FD4B5C08187
|
||||
10: ADA292A19F8636A03A8BC58C26D65B0D
|
||||
11: 703190DAF17F8D08A67A11FDF0C2A622
|
||||
12: D2B94CAD1AFC5CD012575964D1425BE6
|
||||
13: 45FD0069FCA6F72E23E4DB41AA543091
|
||||
14: 36F652600F5C9F226721400A7199E2BA
|
||||
15: E8CC6389ECF8EF1DBB90A0FD051B7570
|
||||
16: 8125446B975DBDA742A903340D6B96C7
|
||||
17: 00B55E4399EB930E592F507F896BF3DC
|
||||
18: 33E58F42A47C9543A851D6CA9324FEE0
|
||||
19: 9F28FDEA3EC7F515128F5D0C0EB684C5
|
||||
20: AC1DAF6C01AA28BCC0A819189FA949D7
|
||||
21: D0532B5F54A179444D052A4D2AD6E4F9
|
||||
22: 58B80A66549404C7B9F64D5AE3F798AB
|
||||
23: D0D6D586477F92311DDF667E0749D338
|
||||
24: 0DFC0FAA67FF114398CE94D0688AE146
|
||||
25: E163B8C00CF5CC9FA23ACACD62B53D64
|
||||
26: ACE9270456AF9BD388BA72E98825CFE8
|
||||
27: 4302EED9BAA19C7A296585E23A066A44
|
||||
28: B3EEABEFAB25C7478419265564715387
|
||||
29: 9F0630ADE9C74AB2981D63F3B69E85BF
|
||||
30: 1215A9446A275CCE2714F94F3C213BB7
|
||||
31: AF43D7F748DE0E3458DB970BAC37E98D
|
||||
32: BF871AC9E892CE0DCD7C8C7ADDD854C6
|
||||
|
||||
OMAC-safer+ (16 byte key)
|
||||
0: A2C8C7FEA5529D01C3FF4E9359EF74F4
|
||||
1: EAB87021118FF24FE79B69ABCCB14A8F
|
||||
2: 789566F467BAA68F4CC3C4B61901D6D4
|
||||
3: 369F41EEAF7D628F9E0D77BE43BFC1D2
|
||||
4: DC46A20E1F36F45006ED5B43BEC20DA6
|
||||
5: 8F150CE34F57BBA2E6CE3431B78E4ACD
|
||||
6: 61CD154478BE20F33B26CD8FC58091A5
|
||||
7: 4E6DAA575CF28F1F48B256262B7D558C
|
||||
8: D21FA4F1859571DB91E92767C5487AA2
|
||||
9: E3D009DC7E71FBBB030B8FF0B544A2C9
|
||||
10: 094C236EA48ABF7DBAE5A88AA3DE07D7
|
||||
11: 00C401996F8224359566660AC1CEDAA1
|
||||
12: D580EC60F712558D875F01643D96653F
|
||||
13: 8482298027C7B4D5969787A1DB1B1F2F
|
||||
14: AB726AE3DA95CB242E63EF876A4BC446
|
||||
15: D668ED4919003F5E45590663FAED41DA
|
||||
16: E4CFFD7E0E7B176867C386001849FD6F
|
||||
17: 37B3C6DEFC5573879006D15F982A397C
|
||||
18: 0AB8847EE6A41A0E960080EF0D1BF1C5
|
||||
19: 2C94FCA2A685F276A65ED286AE12FD9F
|
||||
20: 23383032032D7B5165A31ECA156DBD23
|
||||
21: E1EECFB3D671DF694FFB05AE4305AD4C
|
||||
22: A0F6CA99B96CD1EDD04C52828C8A4D74
|
||||
23: 12D6B7053417AF3E407EFD6EE1CC38FE
|
||||
24: A566D1C39AE7A1A0A77D5A1F56C5FAAB
|
||||
25: 81C9FAECEAEA326140AFCD569668F669
|
||||
26: 6A00BF1D0DC893868378E4347CB4A1B9
|
||||
27: 98842956DBE7AFB1BF49C46497BD54C7
|
||||
28: 88EFCD5A1644B75BB0B3F5DD338849CE
|
||||
29: 77EC62C278C61163B1BEC595A11F047A
|
||||
30: 147424E817DC69413CC657E0CB292F7F
|
||||
31: A2946CBB910743EF62D8A3C7391B9B9B
|
||||
32: 00EEDA55520B8A5B88B76487E80EB6E1
|
||||
|
||||
OMAC-twofish (16 byte key)
|
||||
0: 0158EB365FCCFDD94EBA6BE42B6659C4
|
||||
1: 17DA580917D147D10CB73DB6800B0E59
|
||||
2: 3F185CC15EF3328D3E075665308C07C8
|
||||
3: 5712A97ACC9D08FE9D2087D0CA16B0AD
|
||||
4: 90425A8CC1C026DDD896FC2131AF654B
|
||||
5: 30A43D4FEAE71F5396308C16DA081B4A
|
||||
6: 6839FEF605704D49F1A379A9E9595E6F
|
||||
7: 56A8F06DFEE543971B351B07430E2026
|
||||
8: 36DD0E4B55C5314F9F2753D7EB6F0849
|
||||
9: 8E319249A3CD456460F410F518F8CEDB
|
||||
10: 463978BE2A063C22E71DC71520723517
|
||||
11: 1B735E45FD3DF636E0A6104D4A2E9CB8
|
||||
12: 628A82213148AD9791153D5AAFBDDFDC
|
||||
13: 21AFDF08A36ADB6659B656C8EA0800E5
|
||||
14: E5C3E58803DDBE174E0D4C2B8171AEF0
|
||||
15: FC6981F2B4359BA05988D61822C0FA88
|
||||
16: 7B03498FAFB04A6542248852225F9DAE
|
||||
17: 9B173E91E59A940186E57BB867B8307B
|
||||
18: 470BF2EE614C8423AA3FDF323F1C103E
|
||||
19: 6E664AFDFD8306547BBEDA036D267B79
|
||||
20: F61AEC1144C3DD646169E16073700AC6
|
||||
21: AE503B139707AFA494F7F2DE933EE81A
|
||||
22: A0A8BDD4ED0DCAE4A8E1DCEE56368FF0
|
||||
23: 460B8207930DA434AE6AFECC305D9A26
|
||||
24: 7F03F8C7BA5365CC65F7864A42693BC8
|
||||
25: 31448849D6190484192F29A221700011
|
||||
26: BDA941019C75551D858F70FB1362EB23
|
||||
27: 2880CB3E62447AE8EACA76C17971BB18
|
||||
28: FC8D710FA3990B56357E61C2A302EB84
|
||||
29: 793CD15348D7DFF301C47BC6E6235E22
|
||||
30: 6FB0CE69A15A3B6A933324A480077D35
|
||||
31: C24FCA5DD4AE0DF2BFF17364D17D6743
|
||||
32: DC6738080478AF9AF7CA833295031E06
|
||||
|
||||
OMAC-safer-k64 (8 byte key)
|
||||
0: 726FE2DD40A43924
|
||||
1: 2A138B65EB352621
|
||||
2: 9588A1B53E29616C
|
||||
3: C025DEFDE1A59850
|
||||
4: 73D062F1B6D8E003
|
||||
5: 944598A2FC8A2D76
|
||||
6: B176C25D8CAFFC98
|
||||
7: 14F05014DE6A090A
|
||||
8: A7B9847B2CE22D0F
|
||||
9: FCD71310CBAA3A62
|
||||
10: BFF00CE5D4A20331
|
||||
11: BEE12A2171333ED5
|
||||
12: 333FD849BEB4A64A
|
||||
13: D048EC7E93B90435
|
||||
14: F04960356689CFEF
|
||||
15: 9E63D9744BF1B61A
|
||||
16: 7C744982F32F8889
|
||||
|
||||
OMAC-safer-sk64 (8 byte key)
|
||||
0: E96711BA37D53743
|
||||
1: 7DCFF26A03509FE1
|
||||
2: 0A20EF19C8EE9BF2
|
||||
3: FE2883748A6963CF
|
||||
4: 557060195B820A18
|
||||
5: 771A7931FBBE5C0F
|
||||
6: 6BDBCE5F96CF91D8
|
||||
7: F3B924CCE8724595
|
||||
8: EC7191286D83C2C3
|
||||
9: 94F55B19BB7A8AC1
|
||||
10: 2189F4F2B06A8CA4
|
||||
11: 99853DAEBCA33A46
|
||||
12: 66EAC37A033802D7
|
||||
13: 845D7AA866F8A8AD
|
||||
14: 33A874DFECAC22AC
|
||||
15: 63DD9F7A7F3683DF
|
||||
16: EAC277D951676C44
|
||||
|
||||
OMAC-safer-k128 (16 byte key)
|
||||
0: 8037B89AF193F129
|
||||
1: FF2314E87BA6AFE1
|
||||
2: C3243DF896B61D85
|
||||
3: 0F61C715CE821AB8
|
||||
4: EBFDC6A9CFD2F5A4
|
||||
5: AB6497D7AF2C7FFF
|
||||
6: C920CEEB7C1819C2
|
||||
7: 3E186951B545A7E5
|
||||
8: 5EA36A93C94AF4AC
|
||||
9: 6A2C59FAE33709BE
|
||||
10: BF1BAFAF9FC39C19
|
||||
11: 69EB6EF046677B7C
|
||||
12: CDDCEE6B20453094
|
||||
13: A3833BD3FED6895C
|
||||
14: B6C05E51F01E049B
|
||||
15: 90A2D0EAB739D39B
|
||||
16: 07BF607A161D0A66
|
||||
|
||||
OMAC-safer-sk128 (16 byte key)
|
||||
0: 5E8B137A3946A557
|
||||
1: 0228FA66B13F3C7E
|
||||
2: A6F9BBAFF050DCDD
|
||||
3: F75880F684A796CE
|
||||
4: E0AEFB8E32040EBD
|
||||
5: 9F65D658B86D310F
|
||||
6: 3FA52804FB46CCAA
|
||||
7: 2F6D12D199FCD2FB
|
||||
8: CB56AF60AFB4D2BB
|
||||
9: 8E6F0FF6FDD262FD
|
||||
10: 490245BE3CCCEDE2
|
||||
11: EFD319AE46C73005
|
||||
12: 43E00E545C848995
|
||||
13: 10444B41ECA15EBE
|
||||
14: 521775C389D5BE71
|
||||
15: 9B683EF8B097FEBA
|
||||
16: 3C5D746EED09530A
|
||||
|
||||
OMAC-rc2 (8 byte key)
|
||||
0: F001FE9BBC3A97B0
|
||||
1: 8F8DC9C952897FBD
|
||||
2: EC82EAD195AAC38C
|
||||
3: 53DD52269B19E9A4
|
||||
4: 9B86F64BF72A0647
|
||||
5: 664A88A29F2898C6
|
||||
6: AFEC3F71C1415666
|
||||
7: 9BA1F2C1A2E765F9
|
||||
8: 402A12120908B436
|
||||
9: 03ECCD4C6AF44144
|
||||
10: E8CA3529B5D9D6FC
|
||||
11: 951EE10779CC585D
|
||||
12: B9083CA88E7E819B
|
||||
13: AFFB9E884DACC5B7
|
||||
14: E942E8BC241343D6
|
||||
15: 9B190489091344FB
|
||||
16: 9330A9E05554A15A
|
||||
|
||||
OMAC-des (8 byte key)
|
||||
0: C9085E99D74DF01D
|
||||
1: FAC84F0EFBEF8630
|
||||
2: C37C5FECE671CF16
|
||||
3: 45B2CBEE8701A5B1
|
||||
4: 53665E1F024EB001
|
||||
5: 357123CEDFC9FF61
|
||||
6: BD2CFD33FB1F832B
|
||||
7: 1AAA9D8C9120BDBF
|
||||
8: EB9F589AE9D4E78F
|
||||
9: C8F9D2ACE691922D
|
||||
10: 81ED6F3611DDC0FD
|
||||
11: 2965ABEAC46839EE
|
||||
12: 2208B1E095F7AE2E
|
||||
13: C0414FE41800113E
|
||||
14: 653A24119CF43D97
|
||||
15: 7FB7CE0862958B37
|
||||
16: 55097816B10C549B
|
||||
|
||||
OMAC-3des (24 byte key)
|
||||
0: 7F07A9EA8ECEDF9E
|
||||
1: 4E2A652EB5FBF5F8
|
||||
2: 4F84E3779ACCB9F5
|
||||
3: 7134AB3463115DC6
|
||||
4: 82327BE8EA2D7E0B
|
||||
5: 24950B9C14D87CD9
|
||||
6: B25A097BB7E0E18A
|
||||
7: ED51BAE55ED925E7
|
||||
8: 56B79E7644556975
|
||||
9: A65BD98E4D4E31E2
|
||||
10: 11145BB51514482D
|
||||
11: 397486787E676BA6
|
||||
12: BD1F6DEBAF6D9AEF
|
||||
13: 5CC3921F7DB815CF
|
||||
14: B0C0E60DA5F727F3
|
||||
15: F8637AEEFF10F470
|
||||
16: 0EA19531D42706EA
|
||||
|
||||
OMAC-cast5 (8 byte key)
|
||||
0: 7413DCDB9F0C3100
|
||||
1: 423799EDF1472B79
|
||||
2: 03856F0CB4F11606
|
||||
3: F152AE6360813DE0
|
||||
4: 853998BD980AD146
|
||||
5: AE6C3D667DB8B414
|
||||
6: B5A4986A34BDE20F
|
||||
7: E5ABE5B979798942
|
||||
8: BEE8DFED4555F405
|
||||
9: 6B5339E952AF61BE
|
||||
10: 5E867CF34D9C1149
|
||||
11: F9C55CB3BC655E08
|
||||
12: EA09A2929AC7D915
|
||||
13: CE8EB0E4370E1933
|
||||
14: 749A424B2AA91B98
|
||||
15: 8DDA93C2B814D5D1
|
||||
16: E8B0B219D4CB699B
|
||||
|
||||
OMAC-noekeon (16 byte key)
|
||||
0: A9F50A6567FAD338AB5727B3B94DEB82
|
||||
1: C9EC17EF3656C9056E64E692A449AD24
|
||||
2: 7D1F6A3373BF20D4E65804B745D40855
|
||||
3: FE3484F11C338721F3FCB4DCC608BD6E
|
||||
4: C45670D31D48CE9AD70BADE9F7A6A5B3
|
||||
5: 6AF86480F1AE638DCAC40939B864D4DE
|
||||
6: CBBAFED3A5891A7BD8692055E4C59444
|
||||
7: B23439FC6D1CF0E3B04BE5201CAF9283
|
||||
8: 385D2C64F55B3FE976E660155FAC4C90
|
||||
9: 239D4B8F663248076E64CF743AC14EC0
|
||||
10: B942C5E06C6E68866440EB10747643B6
|
||||
11: 9B591FA2FD9A20C367FB03366150D1E7
|
||||
12: F90183F872D062AB4642DCDCED399970
|
||||
13: 86003C2F260EAFC81BC45A0614F88381
|
||||
14: C80F88A148FF906D42E6D75A50049468
|
||||
15: 0A81478238ED815D7CB04C0DC5A4A4D5
|
||||
16: DFE74730DB9CF4F994084C88923A8931
|
||||
17: 91194DAAAB458B5B34E991EF534D4BD8
|
||||
18: DAA1CCA0B644AB9F8B4D889D7F1268FB
|
||||
19: A93AE4F41DFB6CA311FAAA148A9D53D9
|
||||
20: 6FFD47B80A991A6C09775060E4A4B13E
|
||||
21: 4BE3101511BCA3251559ED6D3BFCC304
|
||||
22: 3C1AA3485241175A9A17F440A1F2FF5F
|
||||
23: 11D2C5E4FC75639CC61C8FE66C2F5135
|
||||
24: 3EDBF9F32259650ABC2C835301FA6556
|
||||
25: 56FA9AA43C01CA5BA798780D3BF40FA1
|
||||
26: 40AE1F352003026C6D4C5F44430DD5ED
|
||||
27: 264E11C88266029588A1B8369F0C5B73
|
||||
28: 60CE0E6D2C2C74D122DBDE57B3EA44AB
|
||||
29: 5E4078E7CEFA94886E9CF0D083C4B468
|
||||
30: CEC169560600ECEED6E5C8F06C76E702
|
||||
31: B4209736F08EAAE6D5B4923D83EB3EE2
|
||||
32: 5DC8D45C9954B82864F1C2388858D97B
|
||||
|
||||
OMAC-skipjack (10 byte key)
|
||||
0: 84EDFA769040603C
|
||||
1: 7DA58A4CBD642627
|
||||
2: 118F60115CFC8229
|
||||
3: A7F7346D34DB2F0E
|
||||
4: 35615CCD526CD57F
|
||||
5: DE471601A3660844
|
||||
6: 15FCCE6D6D883D1F
|
||||
7: C6F694861233151B
|
||||
8: 3B762B397F16E807
|
||||
9: 976C6AB59FB3AB12
|
||||
10: 6810791F2C595961
|
||||
11: 7FA3478286917F17
|
||||
12: 73DEE44A51C6B610
|
||||
13: 89EE8B253B1ACE81
|
||||
14: CDF2586A56C8A0B5
|
||||
15: ED91F98DA98F42C4
|
||||
16: D8D0FA5CE96B08BF
|
||||
|
||||
OMAC-anubis (16 byte key)
|
||||
0: E672617CAA1E641C0E7B4B4CC4787455
|
||||
1: C0C16E8FD63907C08A8ABBB7B73376D3
|
||||
2: 23F97CED54939361830396224A7BDD91
|
||||
3: 7FD87DEA9F05E07212DDF61292D9E13D
|
||||
4: 929A11A4D0991A6446B1051926A6048D
|
||||
5: 4EB74F1CC0150D86126BC6FE1FC8253D
|
||||
6: 33C2C3C072D05BB6D54F87579C23B116
|
||||
7: DE350181C9E90A79879813A609BE77E2
|
||||
8: DB519EB9EF0E154D9D248734FD3D3724
|
||||
9: 4F7F2E6D3FC72BA94FE24EC0ABBF4E66
|
||||
10: D646389DBCEEDD59EBB6E8F09C422930
|
||||
11: 8547658AE1CE6A8B8D010A1E1FEA7AF4
|
||||
12: C9BE2B7F3630EFDFBD3AEA6A108C86EA
|
||||
13: 290417C57096B8B9A1BA3C20FD91285B
|
||||
14: 9AF60E99692C5F911CBF969A6E11DC14
|
||||
15: CDA433BE58C98E49EBA8A7108E50DE2B
|
||||
16: 7430D0EE631A4659351B8A4489A78D46
|
||||
17: DCC74C0FD0415768FE00225CA14B7DC2
|
||||
18: 0CF2432B1B465F2A8C5FACAAF2FEF619
|
||||
19: DA020680C64E93AE5FCA3D71466D01C1
|
||||
20: B9C33A86E6ED9FCCDCD973382DD1B6A3
|
||||
21: 6631236B9F2F810DD4D97E6046F41AF2
|
||||
22: 0312C322F4D634CF4FBC0C2624E3E9F2
|
||||
23: 111E3E9F8FBDC1E4364622723F1CB524
|
||||
24: 6D2608D7AAF243D5219E14513895BFF6
|
||||
25: 683BD01B43CBC0430A007ACBAB357DC9
|
||||
26: 01B8FC65C56B0F1A5BFEBEDCCF6748D9
|
||||
27: 4D6298D63A80D55491697A6DD8E3694C
|
||||
28: 6F0205E4E083CAB00747D723300510DF
|
||||
29: 5183BAEEF05E9402A935EB9AFF0AA2A9
|
||||
30: 1E673BFAD4944643A740C59D96A5925C
|
||||
31: 940FB4000E34EEE78E8DB402E4A76502
|
||||
32: 87B0C48F3D155AD85D0502D94A4572DE
|
||||
|
||||
OMAC-khazad (16 byte key)
|
||||
0: 4EBEFA460499424F
|
||||
1: 97AEEAD51E541D16
|
||||
2: 29A35212910C9595
|
||||
3: ABD1577D622074EA
|
||||
4: 70A537DE14DD765C
|
||||
5: 240A19016DE99C51
|
||||
6: 4D42C10A9F803177
|
||||
7: F464BC3E0DB5A909
|
||||
8: 1C65A01A7C08DAC7
|
||||
9: E49A1428C230C209
|
||||
10: 16DD0FEB7A6505B8
|
||||
11: 2DDDB3E35A05C220
|
||||
12: EC88910C799AC6CC
|
||||
13: B2A65C9EF39BEC8A
|
||||
14: F0D2366BA91DFFD5
|
||||
15: BCAB623CAB7AAA23
|
||||
16: 9BCEAB857596E478
|
||||
|
||||
OMAC-seed (16 byte key)
|
||||
0: F184C3569AE39C95609E878E8E69D276
|
||||
1: 6B94C6CEB7347C7E478D33FD1892032B
|
||||
2: 9FA405B299D5887181C5F09A27AF9F76
|
||||
3: 7457B824FA672F0D939B3CD161A3D229
|
||||
4: EF164E3F30058EA7BA10B1D7ABD945F8
|
||||
5: 22FAD3E42EB96A6E6A66FA73FC96A9E4
|
||||
6: 9BE414C3CD92860A67AFB7C45D0E0EEE
|
||||
7: 40DA2A768F6593E45214CB7F054A9BAA
|
||||
8: 9AFBBEEC8EFAFA7A22752F3BEE055811
|
||||
9: 45EBA2A3EE9276A90FE7FC705086F59B
|
||||
10: 9FE7E1DE176065440B45B1F8F012B8E7
|
||||
11: 5D45CE9EFB14AE973C6567E804492D4A
|
||||
12: BB37B25C98998B0CBDF7AA2BF86FBF3B
|
||||
13: D68EA4AD5B7C3E243872F5BCF7F24EE2
|
||||
14: E880AEA09E328C58ED99928C7BB97DEE
|
||||
15: 4A9EBD30EAB684544D79A066545B100A
|
||||
16: CEFD858C3179B39BADA7EA0F6D3AB150
|
||||
17: BD3336CB8C5AC6D327B310C2093FD087
|
||||
18: ACB4B352003B45FE5E872647ACD2C945
|
||||
19: 74FF04F0ED7ACBDFC2B8EDB0193312BF
|
||||
20: 950B9587B448A73F0566B6E5D30BD85E
|
||||
21: A1CEB1E515BEE6C0C2253415CEDB7F54
|
||||
22: 5E3B9B8F983B882D48853403152BBD09
|
||||
23: E7BB12680BFDC81851D08870862F5F70
|
||||
24: C89D50E7BC1692A3EE29585F4C2861DB
|
||||
25: 1ACBB14354F3A1E002BBD065930F56B8
|
||||
26: AECF4E3972E26A862DC9A0D0F78F4A75
|
||||
27: 4E8663B1FD460CC7B6CA7D6D880209C8
|
||||
28: 0350DFE2A107BB68BAD09A9461EE5E64
|
||||
29: 89B70BBAF6E7F4E7E37F40D122588B0A
|
||||
30: EB0B22BCD7D61272372502B7EADA68A7
|
||||
31: CC4FB973D094008F4B90D687CD91B4C9
|
||||
32: C7162431A53216C22D47FA511B0A619E
|
||||
|
||||
OMAC-kasumi (16 byte key)
|
||||
0: AF4289889D9AD5A1
|
||||
1: C58E7863B4E8CE54
|
||||
2: 2927047C455329BD
|
||||
3: 62905068423B826C
|
||||
4: 0BC0C92B5162FA20
|
||||
5: 03E6D71DE770BB3A
|
||||
6: 6D48AB1CE5EC49FB
|
||||
7: 338597E9545657E8
|
||||
8: 418BAF4EFB83DD50
|
||||
9: A47BA8181D187753
|
||||
10: 76FAA6B0FF3B9D4D
|
||||
11: C540C8A06345FAAE
|
||||
12: 67E454776D871265
|
||||
13: D4E0ABD317993766
|
||||
14: BD328F89D3C1FEA5
|
||||
15: 580E74CB054A9F7D
|
||||
16: 121002BF94F18D90
|
||||
|
||||
OMAC-multi2 (40 byte key)
|
||||
0: 3A06523F10C9F2C5
|
||||
1: 310F665F3A12E82A
|
||||
2: 459FB6A9AC69FE27
|
||||
3: DEB259E248440826
|
||||
4: 6598F16BC1BFB8C8
|
||||
5: B37DFDF8DD61D479
|
||||
6: 0CE3BD7843FC83C4
|
||||
7: 3BB7880A7E8D6C9E
|
||||
8: 74BAA5B4EEFCFDB5
|
||||
9: B71CC55A72D4BB4F
|
||||
10: BEF0C7D0781B368B
|
||||
11: 0CA0D02961398164
|
||||
12: CF3848FA94C45657
|
||||
13: 57EA86B185A210D3
|
||||
14: 05887EB7679F4B62
|
||||
15: F6A007FF4A175F82
|
||||
16: 57E61B59AC9F3240
|
||||
|
||||
OMAC-camellia (16 byte key)
|
||||
0: B5664C5148FFB45297703BCC46C19E4E
|
||||
1: 126EC31A554E8B3B635DE4617092ECE8
|
||||
2: FD57148685F4AA85AF48017AFD72B410
|
||||
3: 1427607464A408C1775B4036509E9659
|
||||
4: D8F5A7112CC8A9DF28B331FE7184BF08
|
||||
5: 0E29B0F09409DABECF645F05C4A5717C
|
||||
6: C4155442FDC29685028AF4AADEDCC266
|
||||
7: 92356ACB98AE2EDAABE0D3ED0C90772B
|
||||
8: AA3C828618F72258D91BC391876776C3
|
||||
9: 189458BA4D98E85802E7028E5C57A25F
|
||||
10: EE652D70328DA00D63B42A5E85D70E63
|
||||
11: F9D1E5F8E1539F2D657A047755CD232E
|
||||
12: 56FF5979FD3DEAD90EAAAF79A9AF1DCD
|
||||
13: 7E8B39D459D5AB449A8C5917B0CD0C4E
|
||||
14: 822D9B9C434C6FF7F0E5A25281740A91
|
||||
15: 654909D2836CCB06501CB359C717C1B9
|
||||
16: E8996FC89D47C91543B7BA3DC1C34B73
|
||||
17: DC29D51B2372DD7564CF56AF8702924F
|
||||
18: AD74D081197644DFE2723CABC991B1AC
|
||||
19: 26145C6DF074CA53125F6F386FBEA373
|
||||
20: 72C6C760A70FE410FAD113D8BE711D75
|
||||
21: 099D3B5802D7FB699B6B8F031BE10B3F
|
||||
22: A9D5DD3988A18AA7BC6F9C050BDBE8D2
|
||||
23: F7E99E4C3C7D127FF04FF325F7B06997
|
||||
24: E99A2F7547B5C6EDF3BC2EC2B8F05198
|
||||
25: 46C42FF49FCCFC49FBC99FEB08FEF10A
|
||||
26: DC349D600A754F73ACE6A7D2D00D3551
|
||||
27: FC2E5434ABBA44ABD9D724A9BB6CA2A6
|
||||
28: BA923927BF0074AD73BA8A6914194297
|
||||
29: 7DAB39F8D7E5CB93265568E6713C7CCD
|
||||
30: 9F60259B759B68E1C8F89CC36C7E170E
|
||||
31: 7D611F8BFEF0491CED8815C0E3D4CAFF
|
||||
32: 31E04DE5F9D1403C660E39891DE0D8DE
|
||||
|
||||
@@ -1,569 +0,0 @@
|
||||
PMAC Tests. In these tests messages of N bytes long (00,01,02,...,NN-1) are PMAC'ed. The initial key is
|
||||
of the same format (length specified per cipher). The PMAC key in step N+1 is the PMAC output of
|
||||
step N (repeated as required to fill the array).
|
||||
|
||||
PMAC-aes (16 byte key)
|
||||
0: 4399572CD6EA5341B8D35876A7098AF7
|
||||
1: 580F7AA4AA45857C79BA2FB892228893
|
||||
2: 24D2D1DBABDB25F9F2D391BB61F4204A
|
||||
3: 083BF95E310B42A89751BC8E65ABA8B5
|
||||
4: 69BEB9268CD7FD3D7AB820BD7E226955
|
||||
5: FD71B0E647ADB4BB3F587E82B8B3401A
|
||||
6: 07EA46271081840737CEB1AC9E5E22E3
|
||||
7: FFA12AD9A9FDB5EE126084F82B381B10
|
||||
8: 8A11AF301AAFEAC8A75984ED16BB3292
|
||||
9: 368BDC3F4220E89B54C5F9D09FFB8F34
|
||||
10: 8B6DBFF776FD526147D1C4655626374F
|
||||
11: C538C09FC10DF38217CD8E799D8D1DC9
|
||||
12: FC1264A2051DEF73339432EA39443CFD
|
||||
13: 8AF37ED2FB2E8E30E9C4B75C1F1363E1
|
||||
14: 4295541FC62F6774068B8194CC9D9A46
|
||||
15: CFAF4D8EA09BB342F07131344DB0AA52
|
||||
16: B6CBD6E95959B2A8E22DE07E38B64D8D
|
||||
17: 3124E42DE3273B0F4806FB72A50F3E54
|
||||
18: 252D49403509B618AB3A6A1D99F9E9FA
|
||||
19: 9CDA75594CB696EB19C022DDA7324C10
|
||||
20: 33BB8AE43B7BC179E85F157FA19607D0
|
||||
21: 12FE91BCF2F2875379DC671C6F1B403E
|
||||
22: 416A3E519D1E406C92F8BB0DDBBBB6BF
|
||||
23: 6F98DCCD5A8D60DEAF612ACCEDD7E465
|
||||
24: FFCE7604609B2C3C050921854C638B7E
|
||||
25: DD2BB10AA07A5EC8D326BB7BF8D407F4
|
||||
26: 468BFE669FCDF354E4F9768FE1EAF8F6
|
||||
27: 01724D2F2C61EB4F380852218212E892
|
||||
28: 2D90EC658F57138505598C659C539A3E
|
||||
29: 6301EAA0E1500FFEB86752744EFFF23D
|
||||
30: 3CCB177486377616056D835F6F857F7C
|
||||
31: BFB3C7755C1F4543B516EB8610CB219F
|
||||
32: D5C505847D7CFFD8CED848F6CB613105
|
||||
|
||||
PMAC-blowfish (8 byte key)
|
||||
0: 3B7E4EFE92FA46AF
|
||||
1: 746840017C38C892
|
||||
2: 3B6A92C731465B64
|
||||
3: D89D3B05143B6704
|
||||
4: 43F70D54B808B7CE
|
||||
5: 84E4063AB32F046C
|
||||
6: A7E78CD5CCD23805
|
||||
7: A78FB083475FEF10
|
||||
8: D4F6C26B5386BA25
|
||||
9: 184768A079853C90
|
||||
10: 0702E6C8140C5D3B
|
||||
11: 786D94565AA0DF4B
|
||||
12: F6D36D3A2F4FB2C1
|
||||
13: 7BB3A0592E02B391
|
||||
14: 5B575C77A470946B
|
||||
15: 686DAD633B5A8CC3
|
||||
16: BDFE0C7F0254BAD5
|
||||
|
||||
PMAC-xtea (16 byte key)
|
||||
0: F5E28630DFDE34E0
|
||||
1: FFCC52D905DA5198
|
||||
2: 25198AB18B2B290D
|
||||
3: 18914E50791161E9
|
||||
4: 200F832212AD6747
|
||||
5: A9D09C41D734DDF7
|
||||
6: 32D7CCA3F4BD8215
|
||||
7: 91A1AA9389CD5D02
|
||||
8: 35CB1F77D7C25E2F
|
||||
9: D91EEE6D0A3874F3
|
||||
10: A42872686A8FF6F2
|
||||
11: 7568908634A79CBD
|
||||
12: 5B91A633D919BC34
|
||||
13: 32DCD17176896F1D
|
||||
14: 2BBBA64F30E672B6
|
||||
15: AFEB07DBC636AEED
|
||||
16: 7A417347CA03C598
|
||||
|
||||
PMAC-rc5 (8 byte key)
|
||||
0: C6B48F8DEC631F7C
|
||||
1: F7AA62C39972C358
|
||||
2: 0E26EC105D99F417
|
||||
3: 7D3C942798F20B8C
|
||||
4: 415CDA53E1DE3888
|
||||
5: A314BA5BCA9A67AC
|
||||
6: 02A5D00A3E371326
|
||||
7: E210F0A597A639E5
|
||||
8: D4A15EED872B78A2
|
||||
9: AC5F99886123F7DC
|
||||
10: 69AEB2478B58FFDF
|
||||
11: 8AB167DFC9EF7854
|
||||
12: 945786A136B98E07
|
||||
13: F3822AB46627CAB5
|
||||
14: 23833793C3A83DA9
|
||||
15: 70E6AB9E6734E5A6
|
||||
16: 0705C312A4BB6EDE
|
||||
|
||||
PMAC-rc6 (16 byte key)
|
||||
0: C7715A17012401DE248DC944DEEBD551
|
||||
1: 5B804C6CCDF97BB28811C9ED24FE6157
|
||||
2: 7528378C052F4346253CB0DFA3D251C7
|
||||
3: 6DA86EE0B28606861B1A954D7429A93C
|
||||
4: B4DFF84C25937FB50EE79D4037323160
|
||||
5: A60FD9BE5E1FF67EC9734776C8781096
|
||||
6: 81D3F8EDC0A197DD3739EAE648F38580
|
||||
7: 8BAF47F02120E898916D678DBD0C1641
|
||||
8: 7A9EEC96F10B7CF557B61EF35BB55B08
|
||||
9: B88C11221014F8AE048E56C427DF4A46
|
||||
10: 4BBA8EED89F357861A265006816D9B04
|
||||
11: 8497C1D55010A65ED8C3688B75A7CABF
|
||||
12: 95E1720C06A373CAD1A22F432F26BCCA
|
||||
13: A175FB732692831E96AFB587BC49E18C
|
||||
14: 54EBC04FCFD90302907BF77C4D8AC77C
|
||||
15: EA9F13EE5548CDF771C354527CDDA09B
|
||||
16: 4EDBCFD0E2E6B321530EB31B3E8C2FE4
|
||||
17: F412304C1A5B9005CC3B7900A597DFB5
|
||||
18: 3B9247C12BB25DF048BF5541E91E1A78
|
||||
19: 39626488635D0A6224CD23C13B25AE8E
|
||||
20: 40305F5C2FCEF34E764E33EF635A3DC5
|
||||
21: F84499804086033E85633A1EF9908617
|
||||
22: C4D263CDC7E0969B8AC6FA9AD9D65CB8
|
||||
23: 6137DC840E61EA6A288D017EFB9646FC
|
||||
24: 8619960428EB29B1D5390F40173C152F
|
||||
25: F0464509D0FBDBECEC9DFC57A820016D
|
||||
26: 630EED23E87059051E564194831BAEF6
|
||||
27: 4B792B412458DC9411F281D5DD3A8DF6
|
||||
28: F2349FA4418BC89853706B35A9F887BA
|
||||
29: FEAC41D48AEAB0955745DC2BE1E024D5
|
||||
30: A67A135B4E6043CB7C9CAFBFA25D1828
|
||||
31: EC12C9574BDE5B0001EE3895B53716E2
|
||||
32: 44903C5737EE6B08FD7D7A3937CC840D
|
||||
|
||||
PMAC-safer+ (16 byte key)
|
||||
0: E8603C78F9324E9D294DA13C1C6E6E9B
|
||||
1: 3F1178DFC2A10567D4BCC817D35D1E16
|
||||
2: 27FE01F90E09237B4B888746199908EE
|
||||
3: 4F5172E3D8A58CD775CD480D85E70835
|
||||
4: 74BED75EFAAB3E8AA0027D6730318521
|
||||
5: 54B003AB0BE29B7C69F7C7494E4E9623
|
||||
6: 8A2DAD967747AEA24670141B52494E2F
|
||||
7: 69EB054A24EE814E1FB7E78395339781
|
||||
8: E59C2D16B76B700DC62093F0A7F716CC
|
||||
9: AB227D6303007FD2001D0B6A9E2BFEB7
|
||||
10: AE107117D9457A1166C6DFD27A819B44
|
||||
11: F84DE551B480CED350458851BAE20541
|
||||
12: B0EB5103E7559B967D06A081665421E0
|
||||
13: CDB14F3AD1170CE8C6091947BE89DE7B
|
||||
14: 24FA2F476407094152D528FCF124E438
|
||||
15: 440144B31EC09BD8791BFE02E24EA170
|
||||
16: 697D268A46E8B33CEC0BAB8CAF43F52D
|
||||
17: 587CBDE7608449BD162184020FBFCC8D
|
||||
18: 3EA999C2169CC65735737F50FCD7956B
|
||||
19: C6D692698CD8BEEBF2387C6A35A261B0
|
||||
20: 46DAB3AD3C4E2EF712FAC38F846C63E1
|
||||
21: 7261E68B530D10DDC9AD4C9AB5D95693
|
||||
22: 4D0BA5773E988C2B7B2302BBA0A9D368
|
||||
23: 8617154626362736698613151D1FD03A
|
||||
24: 23CF25F68B281E21777DC409FE3B774A
|
||||
25: CA626956C97DC4207D968A8CC85940B8
|
||||
26: 24C39BE160BDBB753513F949C238014E
|
||||
27: 83CD65C010FB69A77EEDEA022A650530
|
||||
28: 1A72DC8438B927464125C0DFEACDE75D
|
||||
29: 546054936A2CB5BFBB5E25FFD07C9B51
|
||||
30: 0EB81A268F1BB91997CB9809D7F9F2AD
|
||||
31: 7D08B4DE960CADC483D55745BB4B2C17
|
||||
32: FD45061D378A31D0186598B088F6261B
|
||||
|
||||
PMAC-twofish (16 byte key)
|
||||
0: D2D40F078CEDC1A330279CB71B0FF12B
|
||||
1: D1C1E80FD5F38212C3527DA3797DA71D
|
||||
2: 071118A5A87F637D627E27CB581AD58C
|
||||
3: C8CFA166A9B300F720590382CE503B94
|
||||
4: 3965342C5A6AC5F7B0A40DC3B89ED4EB
|
||||
5: 6830AB8969796682C3705E368B2BDF74
|
||||
6: FF4DCC4D16B71AFEEA405D0097AD6B89
|
||||
7: ADB77760B079C010889F79AA02190D70
|
||||
8: 5F2FCD6AA2A22CEECAA4671EE0403B88
|
||||
9: 70DD6D396330904A0A03E19046F4C0BF
|
||||
10: 8A2C9D88FA0303123275C704445A7F47
|
||||
11: BA0B2F6D029DCD72566821AB884A8427
|
||||
12: C8DF45FF13D7A2E4CFE1546279172300
|
||||
13: 512659AD40DC2B9D31D299A1B00B3DAD
|
||||
14: A8A0E99D2E231180949FC4DFB4B79ED4
|
||||
15: CA161AFB2BC7D891AAE268D167897EF2
|
||||
16: D6C19BBDFFC5822663B604B1F836D8BD
|
||||
17: 4BF115F409A41A26E89C8D758BBF5F68
|
||||
18: 02E3196D888D5A8DE818DBCBAD6E6DC7
|
||||
19: 995C9DD698EC711A73BD41CAAE8EB633
|
||||
20: A031857FADC8C8AFEABF14EF663A712D
|
||||
21: 124695C9A8132618B10E9800A4EFACC5
|
||||
22: 997E5E41798648B8CE0C398EF9135A2C
|
||||
23: 42C92154B71FB4E133F8F5B2A2007AB2
|
||||
24: 945DC568188D036AC91051A11AC92BBF
|
||||
25: D5A860CC4C3087E9F4988B25D1F7FAAE
|
||||
26: 6CD6ABF8EDF3102659AFFBE476E2CBE8
|
||||
27: 45ECD0C37091414E28153AA5AFA3E0B2
|
||||
28: CBA6FE296DDE36FE689C65667F67A038
|
||||
29: C4022281633F2FC438625540B2EE4EB8
|
||||
30: 864E27045F9CC79B5377FDF80A6199CF
|
||||
31: 0D06F2FAEC5AA404A4087AAEBC4DBB36
|
||||
32: 0F396FE9E3D9D74D17EB7A0BF603AB51
|
||||
|
||||
PMAC-safer-k64 (8 byte key)
|
||||
0: 2E49792C78C1DA52
|
||||
1: 7A5136F4FE617C57
|
||||
2: 6FC8575F6F3D78EC
|
||||
3: 7C0373CAEAAA640B
|
||||
4: 9D469E7FF6C35D31
|
||||
5: 7755D62DD7D88112
|
||||
6: ADD9E7855A958C9F
|
||||
7: 752D29BA8150F18E
|
||||
8: 0954649A99596104
|
||||
9: 05D4D75A9FAE233D
|
||||
10: 1AADAFD7B4B250DA
|
||||
11: E7A8F31ED74DA32B
|
||||
12: 1A74DF61BDB9DF94
|
||||
13: C38A67B1955C4E0D
|
||||
14: EBADAA44746ADF16
|
||||
15: C0BFBB092CE81D8E
|
||||
16: 984975657F3FF2B0
|
||||
|
||||
PMAC-safer-sk64 (8 byte key)
|
||||
0: E8917E1629E7403E
|
||||
1: AE8061A5E412A647
|
||||
2: C969771CE5A9B0C6
|
||||
3: 78159C01D0A3A5CB
|
||||
4: 1DD4382A8FC81921
|
||||
5: 4086880FD863C048
|
||||
6: A520B45600A3FA1D
|
||||
7: 0F0AB5118D7506C4
|
||||
8: 22E315F2DD03BCC6
|
||||
9: 5ECB5561EE372016
|
||||
10: 446A9B2BCB367AD6
|
||||
11: B2107FE2EB411AE9
|
||||
12: 5A539B62FB5893DF
|
||||
13: F44EE1EB3278C2BA
|
||||
14: 293FEA56D1F6EA81
|
||||
15: F38F614D2B5F81C4
|
||||
16: AB23F7F8F4C12A7E
|
||||
|
||||
PMAC-safer-k128 (16 byte key)
|
||||
0: 7E0BDE11EC82FDE6
|
||||
1: 8942FB017A135520
|
||||
2: 0B073E6D0F037A02
|
||||
3: DBF88439D671ED4F
|
||||
4: B89427ED1121069A
|
||||
5: AA8573DAC66D2315
|
||||
6: 12DA3144BEF13FF2
|
||||
7: EF80413CBA281B3A
|
||||
8: DFA7114D8505EEBD
|
||||
9: AE53607F3E6F4A54
|
||||
10: 3F2C9395CFB9F78F
|
||||
11: 67EB7C5F02760AED
|
||||
12: 3EF4CBB4AB5B8D1F
|
||||
13: 83B63AFA78795A92
|
||||
14: 5DE400951766992A
|
||||
15: AA8791A45237CF83
|
||||
16: 7743B18704B037CF
|
||||
|
||||
PMAC-safer-sk128 (16 byte key)
|
||||
0: 8F1597FFCF6FB7C1
|
||||
1: AFF8BD8FF9F3888A
|
||||
2: 65F89D82869D8B42
|
||||
3: CBE1F06476B2D5BD
|
||||
4: 4878D47FDFECE23E
|
||||
5: 4751A9E6D61AB2A2
|
||||
6: 003AC162AED4DED8
|
||||
7: 1F617A5555092C22
|
||||
8: 088EE0C35B607153
|
||||
9: F840B485086F9908
|
||||
10: BA99E0FB5D7D0976
|
||||
11: F04AF6DC4BAF6887
|
||||
12: 5DBBE40AF2F67E4E
|
||||
13: 7F52A93E87E29C9D
|
||||
14: 7B26A14A4BD5B709
|
||||
15: C34F26E08C64F26B
|
||||
16: 291A41D479EC1D2A
|
||||
|
||||
PMAC-rc2 (8 byte key)
|
||||
0: E5AF80FAC4580444
|
||||
1: 6A15D6211EB4FF99
|
||||
2: DDB95E9486C4B034
|
||||
3: 9764761DC2AAD5C0
|
||||
4: 1B1CD2E799D44B4F
|
||||
5: 4F80FE32256CF2EC
|
||||
6: 7B70CF31C81CD384
|
||||
7: 9BC10DD9332CF3BB
|
||||
8: 628189801879FDD8
|
||||
9: 5FC17C555E2AE28B
|
||||
10: E20E68327ABEAC32
|
||||
11: 5D375CA59E7E2A7C
|
||||
12: A9F4CFC684113161
|
||||
13: 3A0E069940DDD13C
|
||||
14: EAC25B6351941674
|
||||
15: CB8B5CF885D838CF
|
||||
16: DCBCDDFC06D3DB9A
|
||||
|
||||
PMAC-des (8 byte key)
|
||||
0: 086A2A7CFC08E28E
|
||||
1: F66A1FB75AF18EC9
|
||||
2: B58561DE2BEB96DF
|
||||
3: 9C50856F571B3167
|
||||
4: 6CC645BF3FB00754
|
||||
5: 0E4BEE62B2972C5A
|
||||
6: D2215E451649F11F
|
||||
7: E83DDC61D12F3995
|
||||
8: 155B20BDA899D2CF
|
||||
9: 2567071973052B1D
|
||||
10: DB9C20237A2D8575
|
||||
11: DAF4041E5674A48C
|
||||
12: 552DB7A627E8ECC4
|
||||
13: 1E8B7F823488DEC0
|
||||
14: 84AA15713793B25D
|
||||
15: FCE22E6CAD528B49
|
||||
16: 993884FB9B3FB620
|
||||
|
||||
PMAC-3des (24 byte key)
|
||||
0: E42CCBC9C9457DF6
|
||||
1: FE766F7930557708
|
||||
2: B9011E8AF7CD1E16
|
||||
3: 5AE38B037BEA850B
|
||||
4: A6B2C586E1875116
|
||||
5: BF8BA4F1D53A4473
|
||||
6: 3EB4A079E4E39AD5
|
||||
7: 80293018AC36EDBF
|
||||
8: CC3F5F62C2CEE93C
|
||||
9: EE6AA24CE39BE821
|
||||
10: 487A6EAF915966EA
|
||||
11: D94AD6393DF44F00
|
||||
12: F4BFCCC818B4E20D
|
||||
13: 2BE9BC57412591AA
|
||||
14: 7F7CC8D87F2CDAB7
|
||||
15: B13BFD07E7A202CB
|
||||
16: 58A6931335B4B2C2
|
||||
|
||||
PMAC-cast5 (8 byte key)
|
||||
0: 0654F2F4BC1F7470
|
||||
1: 3F725B162A1C8E6B
|
||||
2: BCFBDC680A20F379
|
||||
3: 027922705BCACDEE
|
||||
4: 44E2F4BE59774BA4
|
||||
5: 3ABD1AFC8EE291F7
|
||||
6: D96347E717921E96
|
||||
7: 96257299FCE55BC6
|
||||
8: C2C1DA176EE98170
|
||||
9: FD415C122E604589
|
||||
10: DCBCA228D45AEDA4
|
||||
11: 7801FBCFAAB9DF75
|
||||
12: D38CB38574474B7F
|
||||
13: F5C5A23FF3E80F37
|
||||
14: 83FA4DAD55D092F5
|
||||
15: BDC0A27EE0CB1657
|
||||
16: 87D907CACA80A138
|
||||
|
||||
PMAC-noekeon (16 byte key)
|
||||
0: 276019CC8E43A1B3F300C47B55B7AA22
|
||||
1: B93E353A2CC21CEAD81C91EC2FCD348E
|
||||
2: E8B9737CAD705C499F246744DCFE9641
|
||||
3: EF36B0FFB5439FF8668F35FD1822D0EA
|
||||
4: B7F5AD89538FC3F03923E98ADF95D0CC
|
||||
5: 558FCA30F602B4BC6697F44053875204
|
||||
6: 6B2D6D5A1CF670BE80E4BBB945CD3871
|
||||
7: 9CFA28FCA22EA12A13AC1093EF5D5EB9
|
||||
8: 04EDA6C71B9F1177F4A5368684FBBAFB
|
||||
9: 43C56B31D440EBECE4C74B90750A4653
|
||||
10: 23D5FA9AFFB2DC3DD372F22690487BAC
|
||||
11: FD61731F27CF8E791535AAB579A018B4
|
||||
12: 502D3A64FDED3CA2A2C8A5E986B27E03
|
||||
13: 1EABBC65B0A08F6CB15218E7153A6003
|
||||
14: B05DBC66CF92B045FC99395E9D405C4F
|
||||
15: EE841A0BF2C91C1E2078F06D022F2E6C
|
||||
16: EA749FBAC6BA9F672796C9D58A8C3294
|
||||
17: BBEF3CDFB93E5F462773579986F08374
|
||||
18: B17F7645F80BF5A2817C228987B43C03
|
||||
19: C995A102DFBB38FA397A4E508B85093D
|
||||
20: 9011CA395AC3FCD8594C13E67C22E95B
|
||||
21: 364BF53974D68B8BCF53CAADC5469DEC
|
||||
22: 5BAD7041372F28DE28BAAAC1A89C10A8
|
||||
23: 77874E908BFCE6F5E36888A484A754C0
|
||||
24: 9BDA525416A3129C55886134B79BAEDE
|
||||
25: 84E3201FA7958223B302D1BC2AC57D55
|
||||
26: 2B8FA1A95DADB4DC2F7A308D8E3D8C81
|
||||
27: F74EBF0ACCC187569BDE549F5FC96C36
|
||||
28: 7023D209F1965EC32253D11835CDFFA5
|
||||
29: C3C6397D9B0A1D741335882ACDFAC20D
|
||||
30: 7BC92905F2AF6754256BE087CC4F54DB
|
||||
31: 0BBA0A507767530F26C3A465DAB11359
|
||||
32: D2891C8EA1F574A6B2AB091057E0FB2C
|
||||
|
||||
PMAC-skipjack (10 byte key)
|
||||
0: 9CD94B75BC43B647
|
||||
1: B069ACB82B12BC7B
|
||||
2: 6DD40E71EB03E311
|
||||
3: 74CBED61D77DBA7D
|
||||
4: DD1B7E0D181537FE
|
||||
5: ACB5B96FA0AD1786
|
||||
6: B34E01EB2567D381
|
||||
7: 9623DAADE57B9549
|
||||
8: 8BA384BABB798344
|
||||
9: B147AA9D5C5C67CF
|
||||
10: 0033C520F4C67523
|
||||
11: 42DAC184BEABC3E5
|
||||
12: 428029311004AEBB
|
||||
13: AC2BB1C0F0ED649B
|
||||
14: F7CAA9A3BF749C1A
|
||||
15: 2C5BD475AAC44C77
|
||||
16: FEB892DA66D31A84
|
||||
|
||||
PMAC-anubis (16 byte key)
|
||||
0: DF33EE541FFEE6A97FE3A1F72F7A38FC
|
||||
1: 0AB28675AC3923C6DD9F5A8E1E2928D0
|
||||
2: 2DABF75D6403E1E1CFAB3E6869FB1088
|
||||
3: 95835D49E09740180B79E394FC2AA744
|
||||
4: F364D6DC2C2078A519E5BAEFE858AFCA
|
||||
5: DA4C66A4805FC91FABAECC0D3AEAD850
|
||||
6: 487660FADCAC7B326C492AA051A1DF49
|
||||
7: BF07835AA1A548FA7312509AF35CE3F3
|
||||
8: 3CE8A8B1F324A700923AC0B830D53D99
|
||||
9: 3C54D99AACFAB26E34FC1B0B6BB9EB22
|
||||
10: 0A559F9D107ED76FD19227FDD0752B8A
|
||||
11: BFD9E74ADC40B9C7446FDD09558FA584
|
||||
12: F1130F663BC0FA3B1066129E0D1910E9
|
||||
13: 535EAD786F0D211DE7AA78F3CB480803
|
||||
14: CDF5855F00A4C310D95B26751B01A28B
|
||||
15: EF6686E999D5A9C35A96D25BB9DBBF57
|
||||
16: E795733AA0AAF16D8F7AB1A8E9C55E54
|
||||
17: E03CA85727D5CF06F56BB6465BB3E5C5
|
||||
18: 6EDDDB6D2292EFF584E382E1BACD1A49
|
||||
19: 7B7FE0D8821836C1AA95578071FF2FD2
|
||||
20: 5F8CC568338400746B61A9286B7CF262
|
||||
21: 32DEE5A11E9EDB04BDF911837CE0FA4D
|
||||
22: F1A99914F13B17ABF383F36157FEB170
|
||||
23: 99F541647F382390043CAE5332E3114D
|
||||
24: 34C5EBB85693A1979F8CFDF8B431A5BB
|
||||
25: 1BA7266568F1E7B4A77A869D3021AC0F
|
||||
26: 0FC675C99C24E859F8CE714E86BF5289
|
||||
27: CBFAB21F5ABC47356A43BED806D873C0
|
||||
28: 9659AB1A4D334B622629721F98EECE3A
|
||||
29: 644C8BEE41F03BDE7652B03CAEA31E37
|
||||
30: 5B3447AFAD934B4D1E4910A8DFD588E7
|
||||
31: BFF403342E8D50D0447627AEA2F56B23
|
||||
32: 19F468F0FB05184D00FABD40A18DB7B2
|
||||
|
||||
PMAC-khazad (16 byte key)
|
||||
0: F40CEF2E392BEAEB
|
||||
1: C6E086BD1CFA0992
|
||||
2: 513F2851583AD69A
|
||||
3: 07279D57695D78FF
|
||||
4: 051E94FE4CC847B6
|
||||
5: 5E9AAA5989D5C951
|
||||
6: 310D5D740143369A
|
||||
7: 9BB1EA8ECD4AF34B
|
||||
8: CF886800AF0526C8
|
||||
9: 0B03E2C94729E643
|
||||
10: 42815B308A900EC7
|
||||
11: 9A38A58C438D26DD
|
||||
12: 044BFF68FD2BFF76
|
||||
13: 7F5ABBDC29852729
|
||||
14: F81A7D6F7B788A5D
|
||||
15: 93098DA8A180AA35
|
||||
16: BACE2F4DA8A89E32
|
||||
|
||||
PMAC-seed (16 byte key)
|
||||
0: 58844BC0C53AACF808587A7C35C37DE2
|
||||
1: 481E3E0831DF5AED135C71BBBD075F4A
|
||||
2: 11355F9D42E7BAD967DF90E9088D45A7
|
||||
3: 5E3F82EF0B3CA70DCB614C1016DDB052
|
||||
4: 35E283B0E6C538ED5F2DF4E004324865
|
||||
5: 56467B8BA87BDE89DF4A64DC9B9409CF
|
||||
6: 9315AAAE6CA0868FDCBC397B7DC2DF84
|
||||
7: A265D861DCE6C9B80CCFF92463DB27D3
|
||||
8: 196A0813E4EB49F47A1C3713950B194E
|
||||
9: 261372868D259E609BE5080F282B361A
|
||||
10: DFDC55CDF60A0CB6A33BC6F4B5E5A481
|
||||
11: 0BD99E075BC93386CDB40C2AAF8E8918
|
||||
12: CA1B80D0088D7267C9AFB037DCD8FA56
|
||||
13: 8EDBC9F77D4DAB3DFABEAB0891622F1C
|
||||
14: D1A8F869C961739ABFE7F401FA41D6F6
|
||||
15: 653041670E0BAD5D1FE77A19D9439CEE
|
||||
16: 440EF361908A528B2A3ED7C50C1A47AB
|
||||
17: DCE2613438A5DC42AC8F5CE753DDF01D
|
||||
18: F9E313156CA5345CECB1A5F963E9B201
|
||||
19: 34D72FB89BA3C41E1D0597531849C6C9
|
||||
20: 7ED20B28067BA27E37606387D641B75F
|
||||
21: 933A2E06DA91C208297305FFF4F7795B
|
||||
22: CC455E1FB196CF5B233921AA6A048B81
|
||||
23: 613AC1EE5B8D0C3123A18BED9A352980
|
||||
24: 00A2BBEEB98DB190A694B67EF85A65A4
|
||||
25: 1A7D50E6051D85CA81D9DD7DE81BF02E
|
||||
26: A7F948B36D7AF08FB405A1B8C8C6AC6D
|
||||
27: 967DC3981E7C718B562A93E5292B872F
|
||||
28: 2674544D8D3E3F750590992C0AFB36AF
|
||||
29: 193A2CC794CB285B4CB87197EE3550ED
|
||||
30: 312AAC97C92279428FB1AA0882DB7088
|
||||
31: 3B9CBA2FF7FF4113BB2DC0DF6BCADDD0
|
||||
32: 45C5C71122C70F4337F5EC74BA6B446D
|
||||
|
||||
PMAC-kasumi (16 byte key)
|
||||
0: 52DF2D9A9EB4816A
|
||||
1: 201C1024E6D2AF23
|
||||
2: 04E7B341BFC96D1A
|
||||
3: CC11D07594C50F31
|
||||
4: EE27EAEED00E2F97
|
||||
5: 51DB73EC42ADB789
|
||||
6: 097A5F01A90BFE7F
|
||||
7: 7FD121FD6B504A9D
|
||||
8: 8A09BC5C1E7FA48C
|
||||
9: B7A88328D7D84C9E
|
||||
10: 1D34173FA9F1DFCD
|
||||
11: 129AC84C0429E80E
|
||||
12: 81D236AC427123E4
|
||||
13: 72D4EFEDD56F6253
|
||||
14: ACFC8D6AF30F8B64
|
||||
15: C7F75094394C1765
|
||||
16: D95208BCB48FAA38
|
||||
|
||||
PMAC-multi2 (40 byte key)
|
||||
0: 4799ECD07D95FF68
|
||||
1: 5B94DBFD53C531D7
|
||||
2: DF09EDE792536619
|
||||
3: 01FB72E4EE79DFEF
|
||||
4: 4159642D6ED0D4D8
|
||||
5: B6909A449A0A85BB
|
||||
6: 20B167D3AA349DEA
|
||||
7: E550AAB246D99D92
|
||||
8: 5E1042397C86B08C
|
||||
9: 3789D96B64C85AC0
|
||||
10: 72C0921EF5B5DEDE
|
||||
11: 5923493300FA910E
|
||||
12: B589609B09B4D12F
|
||||
13: 5EA42FE501CD696D
|
||||
14: 4413763D2689108B
|
||||
15: 07207040BAFC8E6D
|
||||
16: 4E80F408AA6F1DD9
|
||||
|
||||
PMAC-camellia (16 byte key)
|
||||
0: 33C03F6AA205F3816A17DA92BEE0BAD2
|
||||
1: AD1EC293DD032511579235B2F29CC909
|
||||
2: E71363EAF5A311DCFB035C69BBCE5DC0
|
||||
3: 22661D6CD3496FB5C9B3D89FC62E3981
|
||||
4: B142A96AF9C481B61E55B7B5896847C4
|
||||
5: A286C0769989120F8A31A8DAD7574F22
|
||||
6: 09E711382FDB6B938C802D11A66EF657
|
||||
7: DF9ABA4F5CF5B0647F045C3AA631BB62
|
||||
8: 499A8F68DAEC7FE56E64DB59B0993741
|
||||
9: AFFDA4F40A1BDF673EE9123CAE321F16
|
||||
10: B6F2E39D0126AA85D9152C4457365235
|
||||
11: 2922AAC2FF4F0B77DEE4B3E28EF5094F
|
||||
12: 369D18F985D18B5ADDFFFC1151DE6BBA
|
||||
13: 1B7641D1A38C4114EE829B7D25BF0EFF
|
||||
14: DEF9092BA185FD5238A25C6FCF410C52
|
||||
15: D59FEE8047D64032329318DC7A2277B8
|
||||
16: B4561A4A092E031F8FE998FAC87F9BFB
|
||||
17: F27EF7D0823B056F692BA369D1B2E7B4
|
||||
18: F62C4F7B749CF31A6F5485BFDED7EEBD
|
||||
19: 22BD3AB334BE6E04C84D6197FF69CAE3
|
||||
20: E617D108BED8E9ACBA55FAF60863F8C3
|
||||
21: 0DB60AE0725D37855F3AF1DDF78E98EB
|
||||
22: C76DD5A075AB30AB66FC448BD19B6588
|
||||
23: 60231366598BEB2D16D33A1A8019B9A1
|
||||
24: 247E925C96064801490A1D062A0C1F18
|
||||
25: 1C1081E20DE3BE26FF24BEC3DFBA9BF2
|
||||
26: 3B16562B3CD862C00A03B7ADC99E46C5
|
||||
27: C1E8BA560851254640D523A0CEE846AF
|
||||
28: C36E8CF324A0A4EBC6C76EA01CDFD158
|
||||
29: EAED84E721777F5E30184E496DA2C0FA
|
||||
30: 6655CA0D8741440212AA0DB218E5C7FE
|
||||
31: D5C0143E1BA233BA5F862EE6E11A8F58
|
||||
32: C8DAF08BD68F4AE401C6663393C257CB
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
default: regen
|
||||
|
||||
clean:
|
||||
rm -f *.c
|
||||
|
||||
regen:
|
||||
python rt.py pss-vect.txt pss > pss-vect.c
|
||||
python rt.py oaep-vect.txt oaep > oaep-vect.c
|
||||
python rt.py pkcs1v15sign-vectors.txt emsa > pkcs1v15sign-vectors.c
|
||||
python rt.py pkcs1v15crypt-vectors.txt eme > pkcs1v15crypt-vectors.c
|
||||
|
||||
@@ -1,369 +0,0 @@
|
||||
# =================================
|
||||
# WORKED-OUT EXAMPLE FOR RSAES-OAEP
|
||||
# =================================
|
||||
#
|
||||
# This file gives an example of the process of
|
||||
# encrypting and decrypting a message with
|
||||
# RSAES-OAEP as specified in PKCS #1 v2.1.
|
||||
#
|
||||
# The message is a bit string of length 128,
|
||||
# while the size of the modulus in the public
|
||||
# key is 1024 bits. The second representation
|
||||
# of the private key is used, which means that
|
||||
# CRT is applied in the decryption process.
|
||||
#
|
||||
# The underlying hash function is SHA-1; the
|
||||
# mask generation function is MGF1 with SHA-1
|
||||
# as specified in PKCS #1 v2.1.
|
||||
#
|
||||
# This file also contains a demonstration of
|
||||
# the RSADP decryption primitive with CRT.
|
||||
# Finally, DER encodings of the RSA keys are
|
||||
# given at the end of the file.
|
||||
#
|
||||
#
|
||||
# Integers are represented by strings of octets
|
||||
# with the leftmost octet being the most
|
||||
# significant octet. For example,
|
||||
#
|
||||
# 9,202,000 = (0x)8c 69 50.
|
||||
#
|
||||
# =============================================
|
||||
|
||||
# ------------------------------
|
||||
# Components of the RSA Key Pair
|
||||
# ------------------------------
|
||||
|
||||
# RSA modulus n:
|
||||
bb f8 2f 09 06 82 ce 9c 23 38 ac 2b 9d a8 71 f7
|
||||
36 8d 07 ee d4 10 43 a4 40 d6 b6 f0 74 54 f5 1f
|
||||
b8 df ba af 03 5c 02 ab 61 ea 48 ce eb 6f cd 48
|
||||
76 ed 52 0d 60 e1 ec 46 19 71 9d 8a 5b 8b 80 7f
|
||||
af b8 e0 a3 df c7 37 72 3e e6 b4 b7 d9 3a 25 84
|
||||
ee 6a 64 9d 06 09 53 74 88 34 b2 45 45 98 39 4e
|
||||
e0 aa b1 2d 7b 61 a5 1f 52 7a 9a 41 f6 c1 68 7f
|
||||
e2 53 72 98 ca 2a 8f 59 46 f8 e5 fd 09 1d bd cb
|
||||
|
||||
# RSA public exponent e:
|
||||
(0x)11
|
||||
|
||||
# Prime p:
|
||||
ee cf ae 81 b1 b9 b3 c9 08 81 0b 10 a1 b5 60 01
|
||||
99 eb 9f 44 ae f4 fd a4 93 b8 1a 9e 3d 84 f6 32
|
||||
12 4e f0 23 6e 5d 1e 3b 7e 28 fa e7 aa 04 0a 2d
|
||||
5b 25 21 76 45 9d 1f 39 75 41 ba 2a 58 fb 65 99
|
||||
|
||||
# Prime q:
|
||||
c9 7f b1 f0 27 f4 53 f6 34 12 33 ea aa d1 d9 35
|
||||
3f 6c 42 d0 88 66 b1 d0 5a 0f 20 35 02 8b 9d 86
|
||||
98 40 b4 16 66 b4 2e 92 ea 0d a3 b4 32 04 b5 cf
|
||||
ce 33 52 52 4d 04 16 a5 a4 41 e7 00 af 46 15 03
|
||||
|
||||
# p's CRT exponent dP:
|
||||
54 49 4c a6 3e ba 03 37 e4 e2 40 23 fc d6 9a 5a
|
||||
eb 07 dd dc 01 83 a4 d0 ac 9b 54 b0 51 f2 b1 3e
|
||||
d9 49 09 75 ea b7 74 14 ff 59 c1 f7 69 2e 9a 2e
|
||||
20 2b 38 fc 91 0a 47 41 74 ad c9 3c 1f 67 c9 81
|
||||
|
||||
# q's CRT exponent dQ:
|
||||
47 1e 02 90 ff 0a f0 75 03 51 b7 f8 78 86 4c a9
|
||||
61 ad bd 3a 8a 7e 99 1c 5c 05 56 a9 4c 31 46 a7
|
||||
f9 80 3f 8f 6f 8a e3 42 e9 31 fd 8a e4 7a 22 0d
|
||||
1b 99 a4 95 84 98 07 fe 39 f9 24 5a 98 36 da 3d
|
||||
|
||||
# CRT coefficient qInv:
|
||||
b0 6c 4f da bb 63 01 19 8d 26 5b db ae 94 23 b3
|
||||
80 f2 71 f7 34 53 88 50 93 07 7f cd 39 e2 11 9f
|
||||
c9 86 32 15 4f 58 83 b1 67 a9 67 bf 40 2b 4e 9e
|
||||
2e 0f 96 56 e6 98 ea 36 66 ed fb 25 79 80 39 f7
|
||||
|
||||
# ----------------------------------
|
||||
# Step-by-step RSAES-OAEP Encryption
|
||||
# ----------------------------------
|
||||
|
||||
# Message M to be encrypted:
|
||||
d4 36 e9 95 69 fd 32 a7 c8 a0 5b bc 90 d3 2c 49
|
||||
|
||||
# Label L:
|
||||
(the empty string)
|
||||
|
||||
# lHash = Hash(L)
|
||||
# DB = lHash || Padding || M
|
||||
# seed = random string of octets
|
||||
# dbMask = MGF(seed, length(DB))
|
||||
# maskedDB = DB xor dbMask
|
||||
# seedMask = MGF(maskedDB, length(seed))
|
||||
# maskedSeed = seed xor seedMask
|
||||
# EM = 0x00 || maskedSeed || maskedDB
|
||||
|
||||
# lHash:
|
||||
da 39 a3 ee 5e 6b 4b 0d 32 55 bf ef 95 60 18 90
|
||||
af d8 07 09
|
||||
|
||||
# DB:
|
||||
da 39 a3 ee 5e 6b 4b 0d 32 55 bf ef 95 60 18 90
|
||||
af d8 07 09 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 01 d4 36 e9 95 69
|
||||
fd 32 a7 c8 a0 5b bc 90 d3 2c 49
|
||||
|
||||
# seed:
|
||||
aa fd 12 f6 59 ca e6 34 89 b4 79 e5 07 6d de c2
|
||||
f0 6c b5 8f
|
||||
|
||||
# dbMask:
|
||||
06 e1 de b2 36 9a a5 a5 c7 07 d8 2c 8e 4e 93 24
|
||||
8a c7 83 de e0 b2 c0 46 26 f5 af f9 3e dc fb 25
|
||||
c9 c2 b3 ff 8a e1 0e 83 9a 2d db 4c dc fe 4f f4
|
||||
77 28 b4 a1 b7 c1 36 2b aa d2 9a b4 8d 28 69 d5
|
||||
02 41 21 43 58 11 59 1b e3 92 f9 82 fb 3e 87 d0
|
||||
95 ae b4 04 48 db 97 2f 3a c1 4e af f4 9c 8c 3b
|
||||
7c fc 95 1a 51 ec d1 dd e6 12 64
|
||||
|
||||
# maskedDB:
|
||||
dc d8 7d 5c 68 f1 ee a8 f5 52 67 c3 1b 2e 8b b4
|
||||
25 1f 84 d7 e0 b2 c0 46 26 f5 af f9 3e dc fb 25
|
||||
c9 c2 b3 ff 8a e1 0e 83 9a 2d db 4c dc fe 4f f4
|
||||
77 28 b4 a1 b7 c1 36 2b aa d2 9a b4 8d 28 69 d5
|
||||
02 41 21 43 58 11 59 1b e3 92 f9 82 fb 3e 87 d0
|
||||
95 ae b4 04 48 db 97 2f 3a c1 4f 7b c2 75 19 52
|
||||
81 ce 32 d2 f1 b7 6d 4d 35 3e 2d
|
||||
|
||||
# seedMask:
|
||||
41 87 0b 5a b0 29 e6 57 d9 57 50 b5 4c 28 3c 08
|
||||
72 5d be a9
|
||||
|
||||
# maskedSeed:
|
||||
eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2 ca
|
||||
82 31 0b 26
|
||||
|
||||
# EM = 00 || maskedSeed || maskedDB:
|
||||
00 eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2
|
||||
ca 82 31 0b 26 dc d8 7d 5c 68 f1 ee a8 f5 52 67
|
||||
c3 1b 2e 8b b4 25 1f 84 d7 e0 b2 c0 46 26 f5 af
|
||||
f9 3e dc fb 25 c9 c2 b3 ff 8a e1 0e 83 9a 2d db
|
||||
4c dc fe 4f f4 77 28 b4 a1 b7 c1 36 2b aa d2 9a
|
||||
b4 8d 28 69 d5 02 41 21 43 58 11 59 1b e3 92 f9
|
||||
82 fb 3e 87 d0 95 ae b4 04 48 db 97 2f 3a c1 4f
|
||||
7b c2 75 19 52 81 ce 32 d2 f1 b7 6d 4d 35 3e 2d
|
||||
|
||||
# Ciphertext, the RSA encryption of EM:
|
||||
12 53 e0 4d c0 a5 39 7b b4 4a 7a b8 7e 9b f2 a0
|
||||
39 a3 3d 1e 99 6f c8 2a 94 cc d3 00 74 c9 5d f7
|
||||
63 72 20 17 06 9e 52 68 da 5d 1c 0b 4f 87 2c f6
|
||||
53 c1 1d f8 23 14 a6 79 68 df ea e2 8d ef 04 bb
|
||||
6d 84 b1 c3 1d 65 4a 19 70 e5 78 3b d6 eb 96 a0
|
||||
24 c2 ca 2f 4a 90 fe 9f 2e f5 c9 c1 40 e5 bb 48
|
||||
da 95 36 ad 87 00 c8 4f c9 13 0a de a7 4e 55 8d
|
||||
51 a7 4d df 85 d8 b5 0d e9 68 38 d6 06 3e 09 55
|
||||
|
||||
# --------------------------------------------
|
||||
# Step-by-step RSAES-OAEP Decryption Using CRT
|
||||
# --------------------------------------------
|
||||
|
||||
# c = the integer value of C above
|
||||
# m1 = c^dP mod p = (c mod p)^dP mod p
|
||||
# m2 = c^dQ mod q = (c mod q)^dQ mod q
|
||||
# h = (m1-m2)*qInv mod p
|
||||
# m = m2 + q*h = the integer value of EM above
|
||||
|
||||
# c mod p:
|
||||
de 63 d4 72 35 66 fa a7 59 bf e4 08 82 1d d5 25
|
||||
72 ec 92 85 4d df 87 a2 b6 64 d4 4d aa 37 ca 34
|
||||
6a 05 20 3d 82 ff 2d e8 e3 6c ec 1d 34 f9 8e b6
|
||||
05 e2 a7 d2 6d e7 af 36 9c e4 ec ae 14 e3 56 33
|
||||
|
||||
# c mod q:
|
||||
a2 d9 24 de d9 c3 6d 62 3e d9 a6 5b 5d 86 2c fb
|
||||
ec 8b 19 9c 64 27 9c 54 14 e6 41 19 6e f1 c9 3c
|
||||
50 7a 9b 52 13 88 1a ad 05 b4 cc fa 02 8a c1 ec
|
||||
61 42 09 74 bf 16 25 83 6b 0b 7d 05 fb b7 53 36
|
||||
|
||||
# m1:
|
||||
89 6c a2 6c d7 e4 87 1c 7f c9 68 a8 ed ea 11 e2
|
||||
71 82 4f 0e 03 65 52 17 94 f1 e9 e9 43 b4 a4 4b
|
||||
57 c9 e3 95 a1 46 74 78 f5 26 49 6b 4b b9 1f 1c
|
||||
ba ea 90 0f fc 60 2c f0 c6 63 6e ba 84 fc 9f f7
|
||||
|
||||
# m2:
|
||||
4e bb 22 75 85 f0 c1 31 2d ca 19 e0 b5 41 db 14
|
||||
99 fb f1 4e 27 0e 69 8e 23 9a 8c 27 a9 6c da 9a
|
||||
74 09 74 de 93 7b 5c 9c 93 ea d9 46 2c 65 75 02
|
||||
1a 23 d4 64 99 dc 9f 6b 35 89 75 59 60 8f 19 be
|
||||
|
||||
# h:
|
||||
01 2b 2b 24 15 0e 76 e1 59 bd 8d db 42 76 e0 7b
|
||||
fa c1 88 e0 8d 60 47 cf 0e fb 8a e2 ae bd f2 51
|
||||
c4 0e bc 23 dc fd 4a 34 42 43 94 ad a9 2c fc be
|
||||
1b 2e ff bb 60 fd fb 03 35 9a 95 36 8d 98 09 25
|
||||
|
||||
# m:
|
||||
00 eb 7a 19 ac e9 e3 00 63 50 e3 29 50 4b 45 e2
|
||||
ca 82 31 0b 26 dc d8 7d 5c 68 f1 ee a8 f5 52 67
|
||||
c3 1b 2e 8b b4 25 1f 84 d7 e0 b2 c0 46 26 f5 af
|
||||
f9 3e dc fb 25 c9 c2 b3 ff 8a e1 0e 83 9a 2d db
|
||||
4c dc fe 4f f4 77 28 b4 a1 b7 c1 36 2b aa d2 9a
|
||||
b4 8d 28 69 d5 02 41 21 43 58 11 59 1b e3 92 f9
|
||||
82 fb 3e 87 d0 95 ae b4 04 48 db 97 2f 3a c1 4f
|
||||
7b c2 75 19 52 81 ce 32 d2 f1 b7 6d 4d 35 3e 2d
|
||||
|
||||
# The intermediate values in the remaining
|
||||
# decryption process are the same as during
|
||||
# RSAES-OAEP encryption of M.
|
||||
|
||||
# =============================================
|
||||
|
||||
# ========================
|
||||
# DER Encoding of RSA Keys
|
||||
# ========================
|
||||
|
||||
# ------------
|
||||
# RSAPublicKey
|
||||
# ------------
|
||||
30 81 87
|
||||
# modulus
|
||||
02 81 81
|
||||
00 bb f8 2f 09 06 82 ce
|
||||
9c 23 38 ac 2b 9d a8 71
|
||||
f7 36 8d 07 ee d4 10 43
|
||||
a4 40 d6 b6 f0 74 54 f5
|
||||
1f b8 df ba af 03 5c 02
|
||||
ab 61 ea 48 ce eb 6f cd
|
||||
48 76 ed 52 0d 60 e1 ec
|
||||
46 19 71 9d 8a 5b 8b 80
|
||||
7f af b8 e0 a3 df c7 37
|
||||
72 3e e6 b4 b7 d9 3a 25
|
||||
84 ee 6a 64 9d 06 09 53
|
||||
74 88 34 b2 45 45 98 39
|
||||
4e e0 aa b1 2d 7b 61 a5
|
||||
1f 52 7a 9a 41 f6 c1 68
|
||||
7f e2 53 72 98 ca 2a 8f
|
||||
59 46 f8 e5 fd 09 1d bd
|
||||
cb
|
||||
# publicExponent
|
||||
02 01
|
||||
11
|
||||
|
||||
# -------------
|
||||
# RSAPrivateKey
|
||||
# -------------
|
||||
30 82 02 5b
|
||||
# version
|
||||
02 01
|
||||
00
|
||||
# modulus
|
||||
02 81 81
|
||||
00 bb f8 2f 09 06 82 ce
|
||||
9c 23 38 ac 2b 9d a8 71
|
||||
f7 36 8d 07 ee d4 10 43
|
||||
a4 40 d6 b6 f0 74 54 f5
|
||||
1f b8 df ba af 03 5c 02
|
||||
ab 61 ea 48 ce eb 6f cd
|
||||
48 76 ed 52 0d 60 e1 ec
|
||||
46 19 71 9d 8a 5b 8b 80
|
||||
7f af b8 e0 a3 df c7 37
|
||||
72 3e e6 b4 b7 d9 3a 25
|
||||
84 ee 6a 64 9d 06 09 53
|
||||
74 88 34 b2 45 45 98 39
|
||||
4e e0 aa b1 2d 7b 61 a5
|
||||
1f 52 7a 9a 41 f6 c1 68
|
||||
7f e2 53 72 98 ca 2a 8f
|
||||
59 46 f8 e5 fd 09 1d bd
|
||||
cb
|
||||
# publicExponent
|
||||
02 01
|
||||
11
|
||||
# privateExponent
|
||||
02 81 81
|
||||
00 a5 da fc 53 41 fa f2
|
||||
89 c4 b9 88 db 30 c1 cd
|
||||
f8 3f 31 25 1e 06 68 b4
|
||||
27 84 81 38 01 57 96 41
|
||||
b2 94 10 b3 c7 99 8d 6b
|
||||
c4 65 74 5e 5c 39 26 69
|
||||
d6 87 0d a2 c0 82 a9 39
|
||||
e3 7f dc b8 2e c9 3e da
|
||||
c9 7f f3 ad 59 50 ac cf
|
||||
bc 11 1c 76 f1 a9 52 94
|
||||
44 e5 6a af 68 c5 6c 09
|
||||
2c d3 8d c3 be f5 d2 0a
|
||||
93 99 26 ed 4f 74 a1 3e
|
||||
dd fb e1 a1 ce cc 48 94
|
||||
af 94 28 c2 b7 b8 88 3f
|
||||
e4 46 3a 4b c8 5b 1c b3
|
||||
c1
|
||||
# prime1
|
||||
02 41
|
||||
00 ee cf ae 81 b1 b9 b3
|
||||
c9 08 81 0b 10 a1 b5 60
|
||||
01 99 eb 9f 44 ae f4 fd
|
||||
a4 93 b8 1a 9e 3d 84 f6
|
||||
32 12 4e f0 23 6e 5d 1e
|
||||
3b 7e 28 fa e7 aa 04 0a
|
||||
2d 5b 25 21 76 45 9d 1f
|
||||
39 75 41 ba 2a 58 fb 65
|
||||
99
|
||||
# prime2
|
||||
02 41
|
||||
00 c9 7f b1 f0 27 f4 53
|
||||
f6 34 12 33 ea aa d1 d9
|
||||
35 3f 6c 42 d0 88 66 b1
|
||||
d0 5a 0f 20 35 02 8b 9d
|
||||
86 98 40 b4 16 66 b4 2e
|
||||
92 ea 0d a3 b4 32 04 b5
|
||||
cf ce 33 52 52 4d 04 16
|
||||
a5 a4 41 e7 00 af 46 15
|
||||
03
|
||||
# exponent1
|
||||
02 40
|
||||
54 49 4c a6 3e ba 03 37
|
||||
e4 e2 40 23 fc d6 9a 5a
|
||||
eb 07 dd dc 01 83 a4 d0
|
||||
ac 9b 54 b0 51 f2 b1 3e
|
||||
d9 49 09 75 ea b7 74 14
|
||||
ff 59 c1 f7 69 2e 9a 2e
|
||||
20 2b 38 fc 91 0a 47 41
|
||||
74 ad c9 3c 1f 67 c9 81
|
||||
# exponent2
|
||||
02 40
|
||||
47 1e 02 90 ff 0a f0 75
|
||||
03 51 b7 f8 78 86 4c a9
|
||||
61 ad bd 3a 8a 7e 99 1c
|
||||
5c 05 56 a9 4c 31 46 a7
|
||||
f9 80 3f 8f 6f 8a e3 42
|
||||
e9 31 fd 8a e4 7a 22 0d
|
||||
1b 99 a4 95 84 98 07 fe
|
||||
39 f9 24 5a 98 36 da 3d
|
||||
# coefficient
|
||||
02 41
|
||||
00 b0 6c 4f da bb 63 01
|
||||
19 8d 26 5b db ae 94 23
|
||||
b3 80 f2 71 f7 34 53 88
|
||||
50 93 07 7f cd 39 e2 11
|
||||
9f c9 86 32 15 4f 58 83
|
||||
b1 67 a9 67 bf 40 2b 4e
|
||||
9e 2e 0f 96 56 e6 98 ea
|
||||
36 66 ed fb 25 79 80 39
|
||||
f7
|
||||
|
||||
# ------------------------
|
||||
# PrivateKeyInfo (PKCS #8)
|
||||
# ------------------------
|
||||
30 82 02 75
|
||||
# version
|
||||
02 01
|
||||
00
|
||||
# privateKeyAlgorithmIdentifier
|
||||
30 0d
|
||||
06 09
|
||||
2a 86 48 86 f7 0d 01 01 01
|
||||
# parameters
|
||||
05 00
|
||||
# privateKey = RSAPrivateKey encoding
|
||||
04 82 02 5f
|
||||
# DER encoding of RSAPrivateKey structure
|
||||
30 82 02 5b ... 79 80 39 f7
|
||||
|
||||
# =============================================
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,162 +0,0 @@
|
||||
# =================================
|
||||
# WORKED-OUT EXAMPLE FOR RSASSA-PSS
|
||||
# =================================
|
||||
#
|
||||
# This file gives an example of the process of
|
||||
# signing a message with RSASSA-PSS as
|
||||
# specified in PKCS #1 v2.1.
|
||||
#
|
||||
# The message is an octet string of length 114,
|
||||
# while the size of the modulus in the public
|
||||
# key is 1024 bits. The message is signed via a
|
||||
# random salt of length 20 octets
|
||||
#
|
||||
# The underlying hash function in the EMSA-PSS
|
||||
# encoding method is SHA-1; the mask generation
|
||||
# function is MGF1 with SHA-1 as specified in
|
||||
# PKCS #1 v2.1.
|
||||
#
|
||||
# Integers are represented by strings of octets
|
||||
# with the leftmost octet being the most
|
||||
# significant octet. For example,
|
||||
#
|
||||
# 9,202,000 = (0x)8c 69 50.
|
||||
#
|
||||
# =============================================
|
||||
|
||||
# ------------------------------
|
||||
# Components of the RSA Key Pair
|
||||
# ------------------------------
|
||||
|
||||
# RSA modulus n:
|
||||
a2 ba 40 ee 07 e3 b2 bd 2f 02 ce 22 7f 36 a1 95
|
||||
02 44 86 e4 9c 19 cb 41 bb bd fb ba 98 b2 2b 0e
|
||||
57 7c 2e ea ff a2 0d 88 3a 76 e6 5e 39 4c 69 d4
|
||||
b3 c0 5a 1e 8f ad da 27 ed b2 a4 2b c0 00 fe 88
|
||||
8b 9b 32 c2 2d 15 ad d0 cd 76 b3 e7 93 6e 19 95
|
||||
5b 22 0d d1 7d 4e a9 04 b1 ec 10 2b 2e 4d e7 75
|
||||
12 22 aa 99 15 10 24 c7 cb 41 cc 5e a2 1d 00 ee
|
||||
b4 1f 7c 80 08 34 d2 c6 e0 6b ce 3b ce 7e a9 a5
|
||||
|
||||
# RSA public exponent e:
|
||||
01 00 01
|
||||
|
||||
# Prime p:
|
||||
d1 7f 65 5b f2 7c 8b 16 d3 54 62 c9 05 cc 04 a2
|
||||
6f 37 e2 a6 7f a9 c0 ce 0d ce d4 72 39 4a 0d f7
|
||||
43 fe 7f 92 9e 37 8e fd b3 68 ed df f4 53 cf 00
|
||||
7a f6 d9 48 e0 ad e7 57 37 1f 8a 71 1e 27 8f 6b
|
||||
|
||||
# Prime q:
|
||||
c6 d9 2b 6f ee 74 14 d1 35 8c e1 54 6f b6 29 87
|
||||
53 0b 90 bd 15 e0 f1 49 63 a5 e2 63 5a db 69 34
|
||||
7e c0 c0 1b 2a b1 76 3f d8 ac 1a 59 2f b2 27 57
|
||||
46 3a 98 24 25 bb 97 a3 a4 37 c5 bf 86 d0 3f 2f
|
||||
|
||||
# p's CRT exponent dP:
|
||||
9d 0d bf 83 e5 ce 9e 4b 17 54 dc d5 cd 05 bc b7
|
||||
b5 5f 15 08 33 0e a4 9f 14 d4 e8 89 55 0f 82 56
|
||||
cb 5f 80 6d ff 34 b1 7a da 44 20 88 53 57 7d 08
|
||||
e4 26 28 90 ac f7 52 46 1c ea 05 54 76 01 bc 4f
|
||||
|
||||
# q's CRT exponent dQ:
|
||||
12 91 a5 24 c6 b7 c0 59 e9 0e 46 dc 83 b2 17 1e
|
||||
b3 fa 98 81 8f d1 79 b6 c8 bf 6c ec aa 47 63 03
|
||||
ab f2 83 fe 05 76 9c fc 49 57 88 fe 5b 1d df de
|
||||
9e 88 4a 3c d5 e9 36 b7 e9 55 eb f9 7e b5 63 b1
|
||||
|
||||
# CRT coefficient qInv:
|
||||
a6 3f 1d a3 8b 95 0c 9a d1 c6 7c e0 d6 77 ec 29
|
||||
14 cd 7d 40 06 2d f4 2a 67 eb 19 8a 17 6f 97 42
|
||||
aa c7 c5 fe a1 4f 22 97 66 2b 84 81 2c 4d ef c4
|
||||
9a 80 25 ab 43 82 28 6b e4 c0 37 88 dd 01 d6 9f
|
||||
|
||||
# ---------------------------------
|
||||
# Step-by-step RSASSA-PSS Signature
|
||||
# ---------------------------------
|
||||
|
||||
# Message M to be signed:
|
||||
85 9e ef 2f d7 8a ca 00 30 8b dc 47 11 93 bf 55
|
||||
bf 9d 78 db 8f 8a 67 2b 48 46 34 f3 c9 c2 6e 64
|
||||
78 ae 10 26 0f e0 dd 8c 08 2e 53 a5 29 3a f2 17
|
||||
3c d5 0c 6d 5d 35 4f eb f7 8b 26 02 1c 25 c0 27
|
||||
12 e7 8c d4 69 4c 9f 46 97 77 e4 51 e7 f8 e9 e0
|
||||
4c d3 73 9c 6b bf ed ae 48 7f b5 56 44 e9 ca 74
|
||||
ff 77 a5 3c b7 29 80 2f 6e d4 a5 ff a8 ba 15 98
|
||||
90 fc
|
||||
|
||||
# mHash = Hash(M)
|
||||
# salt = random string of octets
|
||||
# M' = Padding || mHash || salt
|
||||
# H = Hash(M')
|
||||
# DB = Padding || salt
|
||||
# dbMask = MGF(H, length(DB))
|
||||
# maskedDB = DB xor dbMask (leftmost bit set to
|
||||
# zero)
|
||||
# EM = maskedDB || H || 0xbc
|
||||
|
||||
# mHash:
|
||||
37 b6 6a e0 44 58 43 35 3d 47 ec b0 b4 fd 14 c1
|
||||
10 e6 2d 6a
|
||||
|
||||
# salt:
|
||||
e3 b5 d5 d0 02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8
|
||||
3b ce 7e 61
|
||||
|
||||
# M':
|
||||
00 00 00 00 00 00 00 00 37 b6 6a e0 44 58 43 35
|
||||
3d 47 ec b0 b4 fd 14 c1 10 e6 2d 6a e3 b5 d5 d0
|
||||
02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8 3b ce 7e 61
|
||||
|
||||
# H:
|
||||
df 1a 89 6f 9d 8b c8 16 d9 7c d7 a2 c4 3b ad 54
|
||||
6f be 8c fe
|
||||
|
||||
# DB:
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 01 e3 b5 d5 d0 02 c1 bc e5 0c
|
||||
2b 65 ef 88 a1 88 d8 3b ce 7e 61
|
||||
|
||||
# dbMask:
|
||||
66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67
|
||||
d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af
|
||||
50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4
|
||||
d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1
|
||||
e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec
|
||||
d3 18 3a 31 1f c8 97 39 a9 66 43 13 6e 8b 0f 46
|
||||
5e 87 a4 53 5c d4 c5 9b 10 02 8d
|
||||
|
||||
# maskedDB:
|
||||
66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67
|
||||
d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af
|
||||
50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4
|
||||
d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1
|
||||
e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec
|
||||
d3 18 3a 31 1f c8 96 da 1c b3 93 11 af 37 ea 4a
|
||||
75 e2 4b db fd 5c 1d a0 de 7c ec
|
||||
|
||||
# Encoded message EM:
|
||||
66 e4 67 2e 83 6a d1 21 ba 24 4b ed 65 76 b8 67
|
||||
d9 a4 47 c2 8a 6e 66 a5 b8 7d ee 7f bc 7e 65 af
|
||||
50 57 f8 6f ae 89 84 d9 ba 7f 96 9a d6 fe 02 a4
|
||||
d7 5f 74 45 fe fd d8 5b 6d 3a 47 7c 28 d2 4b a1
|
||||
e3 75 6f 79 2d d1 dc e8 ca 94 44 0e cb 52 79 ec
|
||||
d3 18 3a 31 1f c8 96 da 1c b3 93 11 af 37 ea 4a
|
||||
75 e2 4b db fd 5c 1d a0 de 7c ec df 1a 89 6f 9d
|
||||
8b c8 16 d9 7c d7 a2 c4 3b ad 54 6f be 8c fe bc
|
||||
|
||||
# Signature S, the RSA decryption of EM:
|
||||
8d aa 62 7d 3d e7 59 5d 63 05 6c 7e c6 59 e5 44
|
||||
06 f1 06 10 12 8b aa e8 21 c8 b2 a0 f3 93 6d 54
|
||||
dc 3b dc e4 66 89 f6 b7 95 1b b1 8e 84 05 42 76
|
||||
97 18 d5 71 5d 21 0d 85 ef bb 59 61 92 03 2c 42
|
||||
be 4c 29 97 2c 85 62 75 eb 6d 5a 45 f0 5f 51 87
|
||||
6f c6 74 3d ed dd 28 ca ec 9b b3 0e a9 9e 02 c3
|
||||
48 82 69 60 4f e4 97 f7 4c cd 7c 7f ca 16 71 89
|
||||
71 23 cb d3 0d ef 5d 54 a2 b5 53 6a d9 0a 74 7e
|
||||
|
||||
# =============================================
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
====================
|
||||
pkcs-1v2-1-vec.zip
|
||||
====================
|
||||
|
||||
This directory contains test vectors for RSAES-OAEP and
|
||||
RSASSA-PSS as defined in PKCS #1 v2.1.
|
||||
|
||||
The files:
|
||||
|
||||
readme.txt This file.
|
||||
|
||||
oaep-vect.txt Test vectors for RSAES-OAEP encryption.
|
||||
|
||||
oaep-int.txt Intermediate values for RSAES-OAEP
|
||||
encryption and RSA decryption with CRT.
|
||||
Also, DER-encoded RSAPrivateKey and
|
||||
RSAPublicKey types.
|
||||
|
||||
pss-vect.txt Test vectors for RSASSA-PSS signing.
|
||||
|
||||
pss-int.txt Intermediate values for RSASSA-PSS
|
||||
signing.
|
||||
@@ -1,253 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
import hashlib
|
||||
|
||||
def md5_for_file(path, block_size=256*128):
|
||||
'''
|
||||
Block size directly depends on the block size of your filesystem
|
||||
to avoid performances issues
|
||||
Here I have blocks of 4096 octets (Default NTFS)
|
||||
'''
|
||||
md5 = hashlib.md5()
|
||||
with open(path,'rb') as f:
|
||||
for chunk in iter(lambda: f.read(block_size), b''):
|
||||
md5.update(chunk)
|
||||
f.close()
|
||||
return md5.hexdigest()
|
||||
|
||||
def read_until_ends(f, s):
|
||||
while True:
|
||||
l = f.readline()
|
||||
if l.strip().endswith(s):
|
||||
break
|
||||
return l
|
||||
|
||||
def read_until_start(f, s):
|
||||
while True:
|
||||
l = f.readline()
|
||||
if l.startswith(s):
|
||||
break
|
||||
return l
|
||||
|
||||
def read_hex(f):
|
||||
t = []
|
||||
while True:
|
||||
l = f.readline()
|
||||
if l.strip() == '':
|
||||
break
|
||||
t.extend(l.strip().split(' '))
|
||||
return t
|
||||
|
||||
class NamedData(object):
|
||||
def __init__(self, name, data):
|
||||
self.name = name
|
||||
self.data = data
|
||||
|
||||
def __str__(self):
|
||||
return " /* {0} */\n {1},\n {{ {2} }}\n".format(self.name, len(self.data), ', '.join('0x' + x for x in self.data))
|
||||
|
||||
def read_part(f, s):
|
||||
name = read_until_start(f, s).strip().lstrip('# ').rstrip(':')
|
||||
data = read_hex(f)
|
||||
e = NamedData(name, data)
|
||||
return e
|
||||
|
||||
class RsaKey(object):
|
||||
def __init__(self, n, e, d, p, q, dP, dQ, qInv):
|
||||
self.n = n
|
||||
self.e = e
|
||||
self.d = d
|
||||
self.p = p
|
||||
self.q = q
|
||||
self.dP = dP
|
||||
self.dQ = dQ
|
||||
self.qInv = qInv
|
||||
|
||||
def __str__(self):
|
||||
return "{{\n{0},\n{1},\n{2},\n{3},\n{4},\n{5},\n{6},\n{7}\n}}\n".format(self.n, self.e, self.d, self.p, self.q, self.dP, self.dQ, self.qInv)
|
||||
|
||||
def read_key(f):
|
||||
if ftype.version == 1:
|
||||
read_until_start(f, '# Private key')
|
||||
n = read_part(f, ftype.n)
|
||||
e = read_part(f, ftype.e)
|
||||
d = read_part(f, ftype.d)
|
||||
p = read_part(f, ftype.p)
|
||||
q = read_part(f, ftype.q)
|
||||
dP = read_part(f, ftype.dP)
|
||||
dQ = read_part(f, ftype.dQ)
|
||||
qInv = read_part(f, ftype.qInv)
|
||||
k = RsaKey(n, e, d, p, q, dP, dQ, qInv)
|
||||
return k
|
||||
|
||||
class Data(object):
|
||||
def __init__(self, name, obj1, obj2, obj3):
|
||||
self.name = name
|
||||
self.obj1 = obj1
|
||||
self.obj2 = obj2
|
||||
self.obj3 = obj3
|
||||
|
||||
def __str__(self):
|
||||
if self.obj3 == None:
|
||||
return "{{\n \"{0}\",\n{1},\n{2}\n}}\n,".format(self.name, self.obj1, self.obj2)
|
||||
else:
|
||||
return "{{\n \"{0}\",\n{1},\n{2},\n{3}\n}}\n,".format(self.name, self.obj1, self.obj2, self.obj3)
|
||||
|
||||
def read_data(f):
|
||||
name = read_until_start(f, ftype.o).strip().lstrip('# ')
|
||||
obj1 = read_part(f, ftype.o1)
|
||||
obj2 = read_part(f, ftype.o2)
|
||||
if ftype.name == 'emsa':
|
||||
obj3 = None
|
||||
else:
|
||||
obj3 = read_part(f, ftype.o3)
|
||||
s = Data(name, obj1, obj2, obj3)
|
||||
return s
|
||||
|
||||
class Example(object):
|
||||
def __init__(self, name, key, data):
|
||||
self.name = name
|
||||
self.key = key
|
||||
self.data = data
|
||||
|
||||
def __str__(self):
|
||||
res = "{{\n \"{0}\",\n{1},\n{{".format(self.name, str(self.key))
|
||||
for idx, d in enumerate(self.data, 1):
|
||||
if idx == 2:
|
||||
res += '#ifdef LTC_TEST_EXT\n'
|
||||
res += str(d) + '\n'
|
||||
if idx == ftype.numcases:
|
||||
res += '#endif /* LTC_TEST_EXT */\n'
|
||||
res += '}\n},'
|
||||
return res
|
||||
|
||||
def read_example(f):
|
||||
name = read_until_start(f, '# Example').strip().lstrip('# ')
|
||||
key = read_key(f)
|
||||
l = read_until_start(f, ftype.sod)
|
||||
d = []
|
||||
while l.strip().startswith(ftype.sod):
|
||||
if ftype.version == 1:
|
||||
f.seek(-len(l), os.SEEK_CUR)
|
||||
data = read_data(f)
|
||||
d.append(data)
|
||||
l = read_until_start(f, '#')
|
||||
|
||||
e = Example(name, key, d)
|
||||
f.seek(-len(l), os.SEEK_CUR)
|
||||
return e
|
||||
|
||||
|
||||
class PkcsType(object):
|
||||
def __init__(self, name):
|
||||
if name == 'pss':
|
||||
self.o = '# RSASSA-PSS Signature Example'
|
||||
self.o1 = '# Message to be signed'
|
||||
self.o2 = '# Salt'
|
||||
self.o3 = '# Signature'
|
||||
elif name == 'oaep':
|
||||
self.o = '# RSAES-OAEP Encryption Example'
|
||||
self.o1 = '# Message to be encrypted'
|
||||
self.o2 = '# Seed'
|
||||
self.o3 = '# Encryption'
|
||||
elif name == 'emsa':
|
||||
self.o = '# PKCS#1 v1.5 Signature Example'
|
||||
self.o1 = '# Message to be signed'
|
||||
self.o2 = '# Signature'
|
||||
elif name == 'eme':
|
||||
self.o = '# PKCS#1 v1.5 Encryption Example'
|
||||
self.o1 = '# Message'
|
||||
self.o2 = '# Seed'
|
||||
self.o3 = '# Encryption'
|
||||
else:
|
||||
raise ValueError('Type unknown: ' + name)
|
||||
|
||||
if name == 'pss' or name == 'oaep':
|
||||
self.version = 2
|
||||
self.numcases = 6
|
||||
self.n = '# RSA modulus n'
|
||||
self.e = '# RSA public exponent e'
|
||||
self.d = '# RSA private exponent d'
|
||||
self.p = '# Prime p'
|
||||
self.q = '# Prime q'
|
||||
self.dP = '# p\'s CRT exponent dP'
|
||||
self.dQ = '# q\'s CRT exponent dQ'
|
||||
self.qInv = '# CRT coefficient qInv'
|
||||
self.sod = '# --------------------------------'
|
||||
elif name == 'emsa' or name == 'eme':
|
||||
self.version = 1
|
||||
self.numcases = 20
|
||||
self.n = '# Modulus'
|
||||
self.e = '# Public exponent'
|
||||
self.d = '# Exponent'
|
||||
self.p = '# Prime 1'
|
||||
self.q = '# Prime 2'
|
||||
self.dP = '# Prime exponent 1'
|
||||
self.dQ = '# Prime exponent 2'
|
||||
self.qInv = '# Coefficient'
|
||||
self.sod = self.o
|
||||
self.name = name
|
||||
|
||||
ftype = PkcsType(sys.argv[2])
|
||||
|
||||
print('/* Generated from file: %s\n * with md5 hash: %s\n */\n' % (sys.argv[1], md5_for_file(sys.argv[1])))
|
||||
print('''
|
||||
typedef struct rsaKey {
|
||||
int n_l;
|
||||
unsigned char n[256];
|
||||
int e_l;
|
||||
unsigned char e[256];
|
||||
int d_l;
|
||||
unsigned char d[256];
|
||||
int p_l;
|
||||
unsigned char p[256];
|
||||
int q_l;
|
||||
unsigned char q[256];
|
||||
int dP_l;
|
||||
unsigned char dP[256];
|
||||
int dQ_l;
|
||||
unsigned char dQ[256];
|
||||
int qInv_l;
|
||||
unsigned char qInv[256];
|
||||
} rsaKey_t;
|
||||
|
||||
typedef struct rsaData {
|
||||
const char* name;
|
||||
int o1_l;
|
||||
unsigned char o1[256];
|
||||
int o2_l;
|
||||
unsigned char o2[256];''')
|
||||
|
||||
if ftype.name != 'emsa':
|
||||
print(''' int o3_l;
|
||||
unsigned char o3[256];''')
|
||||
|
||||
print('''} rsaData_t;
|
||||
|
||||
typedef struct testcase {
|
||||
const char* name;
|
||||
rsaKey_t rsa;
|
||||
#ifdef LTC_TEST_EXT
|
||||
rsaData_t data[%d];
|
||||
#else
|
||||
rsaData_t data[1];
|
||||
#endif /* LTC_TEST_EXT */
|
||||
} testcase_t;
|
||||
|
||||
testcase_t testcases_%s[] =
|
||||
{''' % (ftype.numcases, sys.argv[2]))
|
||||
|
||||
with open(sys.argv[1], 'rb') as f:
|
||||
ex = []
|
||||
while read_until_ends(f, '============================================='):
|
||||
if f.tell() == os.path.getsize(sys.argv[1]):
|
||||
break
|
||||
e = read_example(f)
|
||||
ex.append(e)
|
||||
|
||||
for i in ex:
|
||||
print(i)
|
||||
f.close()
|
||||
print('};\n')
|
||||
@@ -1,73 +0,0 @@
|
||||
Tech Note 0001
|
||||
How to Gather Entropy on Embedded Systems
|
||||
Tom St Denis
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This tech note explains a relatively simple way to gather entropy for a PRNG (Yarrow in this case) in embedded systems
|
||||
where there are few sources of entropy or physical sources.
|
||||
|
||||
When trying to setup a secure random number generator a fresh source of random data (entropy) is required to ensure the
|
||||
deterministic state of the PRNG is not known or predetermined with respect to an attacker.
|
||||
|
||||
At the very least the system requires one timer and one source of un-timed interrupts. by "un-timed" I mean interrupts
|
||||
that do not occur at regular intervals [e.g. joypad/keypad input, network packets, etc...].
|
||||
|
||||
First we shall begin by taking an overview of how the Yarrow PRNG works within libtomcrypt. At the heart of all
|
||||
PRNGs is the "prng_state" data type. This is a union of structures that hold the PRNG state for the various prngs. The
|
||||
first thing we require is a state...
|
||||
|
||||
prng_state myPrng;
|
||||
|
||||
Next we must initialize the state once to get the ball rolling
|
||||
|
||||
if (yarrow_start(&myPrng) != CRYPT_OK) {
|
||||
// error should never happen!
|
||||
}
|
||||
|
||||
At this point the PRNG is ready to accept fresh entropy which is added with
|
||||
|
||||
int yarrow_add_entropy(const unsigned char *buf, unsigned long len, prng_state *prng)
|
||||
|
||||
This function is **NOT** thread safe which will come under consideration later. To add entropy to our PRNG we must
|
||||
call this function with fresh data as its sampled. Lets say we have a timer counter called "uTimer" which is a 32-bit
|
||||
long and say a 32-bit joyPad state called "uPad". An example interrupt handler would look like
|
||||
|
||||
void joypad_interrupt(...) {
|
||||
unsigned char buf[8];
|
||||
|
||||
STORE32L(uTimer, buf);
|
||||
STORE32L(uPad, buf+4)
|
||||
if (yarrow_add_entropy(buf, 8, &myPrng) != CRYPT_OK) {
|
||||
// this should never occur either unless you didn't call yarrow_start
|
||||
}
|
||||
|
||||
// handle interrupt
|
||||
}
|
||||
|
||||
In this snippet the timer count and state of the joypad are added together into the entropy pool. The timer is important
|
||||
because with respect to the joypad it is a good source of entropy (on its own its not). For example, the probability of
|
||||
the user pushing the up arrow is fairly high, but at a specific time is not.
|
||||
|
||||
This method doesn't gather alot of entropy and has to be used to for quite a while. One way to speed it up is to tap
|
||||
multiple sources. If you have a network adapter and other sources of events (keyboard, mouse, etc...) trapping their
|
||||
data is ideal as well. Its important to gather the timer along with the event data.
|
||||
|
||||
As mentioned the "yarrow_add_entropy()" function is not thread safe. If your system allows interrupt handlers to be
|
||||
interrupted themselves then you could have trouble. One simple way is to detect when an interrupt is in progress and
|
||||
simply not add entropy during the call (jump over the yarrow_add_entropy() call)
|
||||
|
||||
Once you feel that there has been enough entropy added to the pool then within a single thread you can call
|
||||
|
||||
int yarrow_ready(prng_state *prng)
|
||||
|
||||
Now the PRNG is ready to read via the
|
||||
|
||||
unsigned long yarrow_read(unsigned char *buf, unsigned long len, prng_state *prng)
|
||||
|
||||
It is a very good idea that once you call the yarrow_ready() function that you stop harvesting entropy in your interrupt
|
||||
functions. This will free up alot of CPU time. Also one more final note. The yarrow_read() function is not thread
|
||||
safe either. This means if you have multiple threads or processes that read from it you will have to add your own semaphores
|
||||
around calls to it.
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
Tech Note 0002
|
||||
How to avoid non-intrusive timing attacks with online computations
|
||||
Tom St Denis
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
A timing attack is when an attacker can observe a side channel of the device (in this case time). In this tech note
|
||||
we consider only non-intrusive timing attacks with respect to online computations. That is an attacker can
|
||||
determine when a computation (such as a public key encryption) begins and ends but cannot observe the device
|
||||
directly. This is specifically important for applications which transmit data via a public network.
|
||||
|
||||
Consider a Diffie-Hellman encryption which requires the sender to make up a public key "y = g^x mod p". Libtomcrypt
|
||||
uses the MPI bignum library to perform the operation. The time it takes to compute y is controlled by the number
|
||||
of 1 bits in the exponent 'x'. To a large extent there will be the same number of squaring operations. "1" bits in
|
||||
the exponent require the sender to perform a multiplication. This means to a certain extent an attacker can
|
||||
determine not only the magnitude of 'x' but the number of one bits. With this information the attacker cannot directly
|
||||
learn the key used. However, good cryptography mandates the close scrutiny of any practical side channel.
|
||||
|
||||
Similar logic applies to the other various routines. Fortunately for this case there is a simple solution. First,
|
||||
determine the maximum time the particular operation can require. For instance, on an Athlon 1.53Ghz XP processor a
|
||||
DH-768 encryption requires roughly 50 milliseconds. Take that time and round it up. Now place a delay after the call.
|
||||
|
||||
For example,
|
||||
|
||||
void demo(void) {
|
||||
clock_t t1;
|
||||
|
||||
// get initial clock
|
||||
t1 = clock();
|
||||
|
||||
// some PK function
|
||||
|
||||
// now delay
|
||||
while (clock() < (t1 + 100));
|
||||
|
||||
// transmit data...
|
||||
|
||||
}
|
||||
|
||||
This code has the effect of taking at least 100 ms always. In effect someone analyzing the traffic will see that the
|
||||
operations always take a fixed amount of time. Since no two platforms are the same this type of fix has not been
|
||||
incorporated into libtomcrypt (nor is it desired for many platforms). This requires on the developers part to profile
|
||||
the code to determine the delays required.
|
||||
|
||||
Note that this "quick" fix has no effect against an intrusive attacker. For example, power consumption will drop
|
||||
significantly in the loop after the operation. However, this type of fix is more important to secure the user of the
|
||||
application/device. For example, a user placing an order online won't try to cheat themselves by cracking open their
|
||||
device and performing side-channel cryptanalysis. An attacker over a network might try to use the timing information
|
||||
against the user.
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
Tech Note 0003
|
||||
Minimizing Memory Usage
|
||||
Tom St Denis
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
For the most part the library can get by with around 20KB of stack and about 32KB of heap even if you use the
|
||||
public key functions. If all you plan on using are the hashes and ciphers than only about 1KB of stack is required
|
||||
and no heap.
|
||||
|
||||
To save space all of the symmetric key scheduled keys are stored in a union called "symmetric_key". This means the
|
||||
size of a symmetric_key is the size of the largest scheduled key. By removing the ciphers you don't use from
|
||||
the build you can minimize the size of this structure. For instance, by removing both Twofish and Blowfish the
|
||||
size reduces to 768 bytes from the 4,256 bytes it would have been (on a 32-bit platform). Or if you remove
|
||||
Blowfish and use Twofish with TWOFISH_SMALL defined its still 768 bytes. Even at its largest the structure is only
|
||||
4KB which is normally not a problem for any platform.
|
||||
|
||||
|
||||
Cipher Name | Size of scheduled key (bytes) |
|
||||
------------+-------------------------------|
|
||||
Twofish | 4,256 |
|
||||
Blowfish | 4,168 |
|
||||
3DES | 768 |
|
||||
SAFER+ | 532 |
|
||||
Serpent | 528 |
|
||||
Rijndael | 516 |
|
||||
XTEA | 256 |
|
||||
RC2 | 256 |
|
||||
DES | 256 |
|
||||
SAFER [#] | 217 |
|
||||
RC5 | 204 |
|
||||
Twofish [*] | 193 |
|
||||
RC6 | 176 |
|
||||
CAST5 | 132 |
|
||||
Noekeon | 32 |
|
||||
Skipjack | 10 |
|
||||
------------+-------------------------------/
|
||||
Memory used per cipher on a 32-bit platform.
|
||||
|
||||
[*] For Twofish with TWOFISH_SMALL defined
|
||||
[#] For all 64-bit SAFER ciphers.
|
||||
|
||||
Noekeon is a fairly fast cipher and uses very little memory. Ideally in low-ram platforms all other ciphers should be
|
||||
left undefined and Noekeon should remain. While Noekeon is generally considered a secure block cipher (it is insecure
|
||||
as a hash) CAST5 is perhaps a "runner-up" choice. CAST5 has been around longer (it is also known as CAST-128) and is
|
||||
fairly fast as well.
|
||||
|
||||
You can easily accomplish this via the "config.pl" script. Simply answer "n" to all of the ciphers except the one you want
|
||||
and then rebuild the library. [or you can hand edit tomcrypt_custom.h]
|
||||
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
Tech Note 0004
|
||||
Using Yarrow, Fortuna and SOBER-128
|
||||
Tom St Denis
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This tech note explains how to use three of the more useful pseudo random number generators and their
|
||||
own little "issues". While all of the PRNGs have the same API and are roughly used in the same
|
||||
manner their effectiveness really depends on the user knowing how they work.
|
||||
|
||||
|
||||
Yarrow
|
||||
------
|
||||
|
||||
Yarrow is by far the simplest of the PRNGs. It gathers bits of entropy by hashing the pool state
|
||||
plus the additional bits storing the message digest back in the pool. E.g.
|
||||
|
||||
pool = hash(pool || newbits)
|
||||
|
||||
Simply dump bits into the PRNG via yarrow_add_entropy() and call yarrow_ready() when you want to
|
||||
put them to use. This PRNG while simple is not entirely safe. An attacker who learns the state
|
||||
of the pool and can control future events can control the PRNG. This requires an active attacker but
|
||||
isn't entire impossible.
|
||||
|
||||
The pool is then used as a key for a cipher that is used in CTR mode.
|
||||
|
||||
Yarrow is mostly meant for short-term programs [e.g. like file utils]. This particular implementation
|
||||
is not meant for long-term usage.
|
||||
|
||||
Fortuna
|
||||
-------
|
||||
|
||||
Fortuna was designed by Niels Fergusson and Bruce Schneier [Bruce is also the guy who invented Yarrow]. It
|
||||
operates on a more defensive level than Yarrow. Instead of 1 entropy pool it has 32 and the new entropy
|
||||
is spread [round robin] in all of the pools.
|
||||
|
||||
That is, each call to fortuna_add_entropy() puts the bits in the next [in the sequenece] pool of entropy.
|
||||
Effective bits are added to the pool by sending them through a hash [but not terminating the hash].
|
||||
|
||||
Here's the main catch though. When the PRNG must be reseeded [so that you can extract bits from it] only
|
||||
certain pools are used. More precisely the i'th pool is used every 2**i'th reseeding. For example, pool[0]
|
||||
is always used. pool[1] is used every second reseeding, pool[2] every fourth.
|
||||
|
||||
The pools are hashed together along with the current key and the result is the new key for a cipher which
|
||||
operates in CTR mode [more about that in a sec].
|
||||
|
||||
Now this may seem odd at first however there is a good reason behind it. An attacker who learns pool[0] won't
|
||||
strictly know the other pools. So the recovery rate of is not 0. In fact pool[0] can be completely
|
||||
compromised and the PRNG will still eventually recover. The value FORTUNA_WD is the "WatchDog" counter.
|
||||
Every FORTUNA_WD calls to fortuna_read will invoke the reseed operation. By default this is set to 10 which
|
||||
means after 10 calls the PRNG will reseed itself.
|
||||
|
||||
The pools are combined with the running cipher key [256 bits] so that a cipher in CTR mode can produce
|
||||
the stream. Unlike Yarrow the cipher is re-keyed after every call to fortuna_read() [so one big call
|
||||
would be faster than many smaller calls]. This prevents too much data being encrypted under the same
|
||||
key [and mitigates a flaw in CTR mode that the same block can't be emitted twice under the same key].
|
||||
|
||||
Fortuna is really meant for a kernel-level PRNG. The more sources [and often] you feed into it the
|
||||
healthier it will be. It's also meant to be used for long term purposes. Since it can recover from
|
||||
compromises it is harder to control it.
|
||||
|
||||
SOBER-128
|
||||
------
|
||||
|
||||
SOBER-128 is actually a stream cipher but like most ciphers can easily be modelled in the context of a PRNG.
|
||||
This PRNG is extremely fast [4 cycles/byte on a P4] and was designed by a well known cryptographer [Greg Rose].
|
||||
|
||||
SOBER-128 doesn't really "act" like the other two PRNGs. It's meant to be seeded once and then read as
|
||||
required. In such a sense it isn't a "system PRNG" but useful short term purposes. In particular
|
||||
the sober128_read() function actually XORs against the input buffer you specify. This allows the
|
||||
read() function to be used as an "encrypt" function as well.
|
||||
|
||||
You can only key SOBER-128 once [by calling sober128_add_entropy()]. Once it it is keyed subsequent
|
||||
calls to add_entropy() will be considered a "re-IV" operation. Changing the IV allows you to use same
|
||||
initial key and not produce the same output stream. It also lets you differentiate packets. E.g. each
|
||||
packet has it's own IV.
|
||||
|
||||
All inputs to sober128_add_entropy() must have a length that is a multiple of four.
|
||||
|
||||
Overall
|
||||
-------
|
||||
|
||||
Since SOBER-128 is *much* faster than the other two PRNGs a good setup would be to use Fortuna as your
|
||||
system-wide PRNG and use SOBER-128 [key'ed from Fortuna] for encrypting streams or as a PRNG for
|
||||
simulations.
|
||||
|
||||
Yarrow is still a good candidate but only for "short lived" programs. However, since Fortuna is faster
|
||||
[by about 10 cycles/byte on a P4] I'd use Fortuna anyways...
|
||||
|
||||
Tom
|
||||
@@ -1,20 +0,0 @@
|
||||
Tech Note 0005
|
||||
Minimizing Code Space
|
||||
Tom St Denis
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Tweaking...
|
||||
|
||||
You can disable whole classes of algorithms on the command line with the LTC_NO_* defines. From there you can manually turn on what you want to enable.
|
||||
|
||||
The following build with GCC 3.4.4 on an AMD64 box gets you AES, CTR mode, SHA-256, HMAC, Yarrow, full RSA PKCS #1, PKCS #5 and ASN.1 DER in
|
||||
roughly 40KB of code (49KB on the ARMv4) (both excluding the math library).
|
||||
|
||||
CFLAGS="-DLTC_NO_CIPHERS -DLTC_NO_HASHES -DLTC_NO_PRNGS -DLTC_NO_MACS -DLTC_NO_MODES -DLTC_NO_PK -DLTC_RIJNDAEL -DLTC_CTR_MODE -DSHA256 \
|
||||
-DLTC_HMAC -DYARROW -DMRSA -DMPI -DTFM_DESC -DARGTYPE=3 -Os -DLTC_SMALL_CODE -fomit-frame-pointer" make IGNORE_SPEED=1
|
||||
|
||||
Obviously this won't get you performance but if you need to pack a crypto lib in a device with limited means it's more than enough...
|
||||
|
||||
Neato eh?
|
||||
@@ -1,91 +0,0 @@
|
||||
Tech Note 0006
|
||||
PK Standards Compliance
|
||||
Tom St Denis
|
||||
|
||||
RSA
|
||||
----
|
||||
|
||||
PKCS #1 compliance.
|
||||
|
||||
Key Format: RSAPublicKey and RSAPrivateKey as per PKCS #1 v2.1
|
||||
Encryption: OAEP as per PKCS #1
|
||||
Signature : PSS as per PKCS #1
|
||||
|
||||
DSA
|
||||
----
|
||||
|
||||
The NIST DSA algorithm
|
||||
|
||||
Key Format: HomeBrew [see below]
|
||||
Signature : ANSI X9.62 format [see below].
|
||||
|
||||
Keys are stored as
|
||||
|
||||
DSAPublicKey ::= SEQUENCE {
|
||||
publicFlags BIT STRING(1), -- must be 0
|
||||
g INTEGER , -- base generator, check that g^q mod p == 1
|
||||
-- and that 1 < g < p - 1
|
||||
p INTEGER , -- prime modulus
|
||||
q INTEGER , -- order of sub-group (must be prime)
|
||||
y INTEGER , -- public key, specifically, g^x mod p,
|
||||
-- check that y^q mod p == 1
|
||||
-- and that 1 < y < p - 1
|
||||
}
|
||||
|
||||
DSAPrivateKey ::= SEQUENCE {
|
||||
publicFlags BIT STRING(1), -- must be 1
|
||||
g INTEGER , -- base generator, check that g^q mod p == 1
|
||||
-- and that 1 < g < p - 1
|
||||
p INTEGER , -- prime modulus
|
||||
q INTEGER , -- order of sub-group (must be prime)
|
||||
y INTEGER , -- public key, specifically, g^x mod p,
|
||||
-- check that y^q mod p == 1
|
||||
-- and that 1 < y < p - 1
|
||||
x INTEGER -- private key
|
||||
}
|
||||
|
||||
Signatures are stored as
|
||||
|
||||
DSASignature ::= SEQUENCE {
|
||||
r, s INTEGER -- signature parameters
|
||||
}
|
||||
|
||||
ECC
|
||||
----
|
||||
|
||||
The ANSI X9.62 and X9.63 algorithms [partial]. Supports all NIST GF(p) curves.
|
||||
|
||||
Key Format : Homebrew [see below, only GF(p) NIST curves supported]
|
||||
Signature : X9.62 compliant
|
||||
Encryption : Homebrew [based on X9.63, differs in that the public point is stored as an ECCPublicKey]
|
||||
Shared Secret: X9.63 compliant
|
||||
|
||||
ECCPublicKey ::= SEQUENCE {
|
||||
flags BIT STRING(1), -- public/private flag (always zero),
|
||||
keySize INTEGER, -- Curve size (in bits) divided by eight
|
||||
-- and rounded down, e.g. 521 => 65
|
||||
pubkey.x INTEGER, -- The X co-ordinate of the public key point
|
||||
pubkey.y INTEGER, -- The Y co-ordinate of the public key point
|
||||
}
|
||||
|
||||
ECCPrivateKey ::= SEQUENCE {
|
||||
flags BIT STRING(1), -- public/private flag (always one),
|
||||
keySize INTEGER, -- Curve size (in bits) divided by eight
|
||||
-- and rounded down, e.g. 521 => 65
|
||||
pubkey.x INTEGER, -- The X co-ordinate of the public key point
|
||||
pubkey.y INTEGER, -- The Y co-ordinate of the public key point
|
||||
secret.k INTEGER, -- The secret key scalar
|
||||
}
|
||||
|
||||
The encryption works by finding the X9.63 shared secret and hashing it. The hash is then simply XOR'ed against the message [which must be at most the size
|
||||
of the hash digest]. The format of the encrypted text is as follows
|
||||
|
||||
ECCEncrypted ::= SEQUENCE {
|
||||
hashOID OBJECT IDENTIFIER, -- The OID of the hash used
|
||||
pubkey OCTET STRING , -- Encapsulation of a random ECCPublicKey
|
||||
skey OCTET STRING -- The encrypted text (which the hash was XOR'ed against)
|
||||
}
|
||||
|
||||
% $Source: /cvs/libtom/libtomcrypt/notes/tech0006.txt,v $
|
||||
% $Revision: 1.2 $
|
||||
% $Date: 2005/06/18 02:26:27 $
|
||||
@@ -1,5 +0,0 @@
|
||||
Tech Note #7
|
||||
Quick building for testing with LTM
|
||||
|
||||
EXTRALIBS=-ltommath CFLAGS="-g3 -DLTC_NO_ASM -DUSE_LTM -DLTM_DESC" make -j3 IGNORE_SPEED=1 test
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
version=$(git describe --tags --always --dirty 2>/dev/null)
|
||||
if [ ! -e ".git" ] || [ -z $version ]
|
||||
then
|
||||
version=$(grep "^VERSION=" makefile_include.mk | sed "s/.*=//")
|
||||
fi
|
||||
echo "Testing version:" $version
|
||||
#grep "VERSION=" makefile | perl -e "@a = split('=', <>); print @a[1];"`
|
||||
|
||||
# get uname
|
||||
echo "uname="`uname -a`
|
||||
|
||||
# get gcc name
|
||||
if [ -z ${CC} ]
|
||||
then
|
||||
CC="gcc"
|
||||
fi
|
||||
echo "${CC}="`${CC} -dumpversion`
|
||||
echo
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# output version
|
||||
bash printinfo.sh
|
||||
|
||||
bash build.sh " $1" "$2 -O2" "$3 IGNORE_SPEED=1" "$4" "$5"
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "Test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f testok.txt
|
||||
bash build.sh " $1" "$2 -Os" "$3 IGNORE_SPEED=1 LTC_SMALL=1" "$4" "$5"
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "Test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f testok.txt
|
||||
bash build.sh " $1" "$2" "$3 LTC_DEBUG=1" "$4" "$5"
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "Test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f testok.txt
|
||||
bash build.sh " $1" "$2" "$3" "$4" "$5"
|
||||
if [ -a testok.txt ] && [ -f testok.txt ]; then
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "Test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# ref: HEAD -> master, tag: v1.18.2
|
||||
# git commit: 7e7eb695d581782f04b24dc444cbfde86af59853
|
||||
# commit time: 2018-07-01 22:49:01 +0200
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
[ "$TRAVIS_CI" != "" ] && { [ -z "$(which scan-build)" ] && { echo "installing clang"; sudo apt-get install clang -y -qq; }; } || true
|
||||
|
||||
if [ "$#" = "5" -a "$(echo $3 | grep -v 'makefile[.]')" = "" ]; then
|
||||
echo "only run $0 for the regular makefile, early exit success"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# output version
|
||||
bash printinfo.sh
|
||||
|
||||
make clean > /dev/null
|
||||
|
||||
scan_build=$(which scan-build)
|
||||
[ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true
|
||||
[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || echo "run $scan_build"
|
||||
export CFLAGS="-DUSE_LTM -DLTM_DESC -I/usr/include"
|
||||
export EXTRALIBS="-ltommath"
|
||||
$scan_build --status-bugs make -f makefile.unix all CFLAGS="$CFLAGS" EXTRALIBS="$EXTRALIBS"
|
||||
@@ -1,743 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/* AES implementation by Tom St Denis
|
||||
*
|
||||
* Derived from the Public Domain source code by
|
||||
|
||||
---
|
||||
* rijndael-alg-fst.c
|
||||
*
|
||||
* @version 3.0 (December 2000)
|
||||
*
|
||||
* Optimised ANSI C code for the Rijndael cipher (now AES)
|
||||
*
|
||||
* @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
|
||||
* @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
|
||||
* @author Paulo Barreto <paulo.barreto@terra.com.br>
|
||||
---
|
||||
*/
|
||||
/**
|
||||
@file aes.c
|
||||
Implementation of AES
|
||||
*/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_RIJNDAEL
|
||||
|
||||
#ifndef ENCRYPT_ONLY
|
||||
|
||||
#define SETUP rijndael_setup
|
||||
#define ECB_ENC rijndael_ecb_encrypt
|
||||
#define ECB_DEC rijndael_ecb_decrypt
|
||||
#define ECB_DONE rijndael_done
|
||||
#define ECB_TEST rijndael_test
|
||||
#define ECB_KS rijndael_keysize
|
||||
|
||||
const struct ltc_cipher_descriptor rijndael_desc =
|
||||
{
|
||||
"rijndael",
|
||||
6,
|
||||
16, 32, 16, 10,
|
||||
SETUP, ECB_ENC, ECB_DEC, ECB_TEST, ECB_DONE, ECB_KS,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
const struct ltc_cipher_descriptor aes_desc =
|
||||
{
|
||||
"aes",
|
||||
6,
|
||||
16, 32, 16, 10,
|
||||
SETUP, ECB_ENC, ECB_DEC, ECB_TEST, ECB_DONE, ECB_KS,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#define SETUP rijndael_enc_setup
|
||||
#define ECB_ENC rijndael_enc_ecb_encrypt
|
||||
#define ECB_KS rijndael_enc_keysize
|
||||
#define ECB_DONE rijndael_enc_done
|
||||
|
||||
const struct ltc_cipher_descriptor rijndael_enc_desc =
|
||||
{
|
||||
"rijndael",
|
||||
6,
|
||||
16, 32, 16, 10,
|
||||
SETUP, ECB_ENC, NULL, NULL, ECB_DONE, ECB_KS,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
const struct ltc_cipher_descriptor aes_enc_desc =
|
||||
{
|
||||
"aes",
|
||||
6,
|
||||
16, 32, 16, 10,
|
||||
SETUP, ECB_ENC, NULL, NULL, ECB_DONE, ECB_KS,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#define __LTC_AES_TAB_C__
|
||||
#include "aes_tab.c"
|
||||
|
||||
static ulong32 setup_mix(ulong32 temp)
|
||||
{
|
||||
return (Te4_3[byte(temp, 2)]) ^
|
||||
(Te4_2[byte(temp, 1)]) ^
|
||||
(Te4_1[byte(temp, 0)]) ^
|
||||
(Te4_0[byte(temp, 3)]);
|
||||
}
|
||||
|
||||
#ifndef ENCRYPT_ONLY
|
||||
#ifdef LTC_SMALL_CODE
|
||||
static ulong32 setup_mix2(ulong32 temp)
|
||||
{
|
||||
return Td0(255 & Te4[byte(temp, 3)]) ^
|
||||
Td1(255 & Te4[byte(temp, 2)]) ^
|
||||
Td2(255 & Te4[byte(temp, 1)]) ^
|
||||
Td3(255 & Te4[byte(temp, 0)]);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
Initialize the AES (Rijndael) block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
int i;
|
||||
ulong32 temp, *rk;
|
||||
#ifndef ENCRYPT_ONLY
|
||||
ulong32 *rrk;
|
||||
#endif
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (keylen != 16 && keylen != 24 && keylen != 32) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
if (num_rounds != 0 && num_rounds != (10 + ((keylen/8)-2)*2)) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
skey->rijndael.Nr = 10 + ((keylen/8)-2)*2;
|
||||
|
||||
/* setup the forward key */
|
||||
i = 0;
|
||||
rk = skey->rijndael.eK;
|
||||
LOAD32H(rk[0], key );
|
||||
LOAD32H(rk[1], key + 4);
|
||||
LOAD32H(rk[2], key + 8);
|
||||
LOAD32H(rk[3], key + 12);
|
||||
if (keylen == 16) {
|
||||
for (;;) {
|
||||
temp = rk[3];
|
||||
rk[4] = rk[0] ^ setup_mix(temp) ^ rcon[i];
|
||||
rk[5] = rk[1] ^ rk[4];
|
||||
rk[6] = rk[2] ^ rk[5];
|
||||
rk[7] = rk[3] ^ rk[6];
|
||||
if (++i == 10) {
|
||||
break;
|
||||
}
|
||||
rk += 4;
|
||||
}
|
||||
} else if (keylen == 24) {
|
||||
LOAD32H(rk[4], key + 16);
|
||||
LOAD32H(rk[5], key + 20);
|
||||
for (;;) {
|
||||
#ifdef _MSC_VER
|
||||
temp = skey->rijndael.eK[rk - skey->rijndael.eK + 5];
|
||||
#else
|
||||
temp = rk[5];
|
||||
#endif
|
||||
rk[ 6] = rk[ 0] ^ setup_mix(temp) ^ rcon[i];
|
||||
rk[ 7] = rk[ 1] ^ rk[ 6];
|
||||
rk[ 8] = rk[ 2] ^ rk[ 7];
|
||||
rk[ 9] = rk[ 3] ^ rk[ 8];
|
||||
if (++i == 8) {
|
||||
break;
|
||||
}
|
||||
rk[10] = rk[ 4] ^ rk[ 9];
|
||||
rk[11] = rk[ 5] ^ rk[10];
|
||||
rk += 6;
|
||||
}
|
||||
} else if (keylen == 32) {
|
||||
LOAD32H(rk[4], key + 16);
|
||||
LOAD32H(rk[5], key + 20);
|
||||
LOAD32H(rk[6], key + 24);
|
||||
LOAD32H(rk[7], key + 28);
|
||||
for (;;) {
|
||||
#ifdef _MSC_VER
|
||||
temp = skey->rijndael.eK[rk - skey->rijndael.eK + 7];
|
||||
#else
|
||||
temp = rk[7];
|
||||
#endif
|
||||
rk[ 8] = rk[ 0] ^ setup_mix(temp) ^ rcon[i];
|
||||
rk[ 9] = rk[ 1] ^ rk[ 8];
|
||||
rk[10] = rk[ 2] ^ rk[ 9];
|
||||
rk[11] = rk[ 3] ^ rk[10];
|
||||
if (++i == 7) {
|
||||
break;
|
||||
}
|
||||
temp = rk[11];
|
||||
rk[12] = rk[ 4] ^ setup_mix(RORc(temp, 8));
|
||||
rk[13] = rk[ 5] ^ rk[12];
|
||||
rk[14] = rk[ 6] ^ rk[13];
|
||||
rk[15] = rk[ 7] ^ rk[14];
|
||||
rk += 8;
|
||||
}
|
||||
} else {
|
||||
/* this can't happen */
|
||||
/* coverity[dead_error_line] */
|
||||
return CRYPT_ERROR;
|
||||
}
|
||||
|
||||
#ifndef ENCRYPT_ONLY
|
||||
/* setup the inverse key now */
|
||||
rk = skey->rijndael.dK;
|
||||
rrk = skey->rijndael.eK + (28 + keylen) - 4;
|
||||
|
||||
/* apply the inverse MixColumn transform to all round keys but the first and the last: */
|
||||
/* copy first */
|
||||
*rk++ = *rrk++;
|
||||
*rk++ = *rrk++;
|
||||
*rk++ = *rrk++;
|
||||
*rk = *rrk;
|
||||
rk -= 3; rrk -= 3;
|
||||
|
||||
for (i = 1; i < skey->rijndael.Nr; i++) {
|
||||
rrk -= 4;
|
||||
rk += 4;
|
||||
#ifdef LTC_SMALL_CODE
|
||||
temp = rrk[0];
|
||||
rk[0] = setup_mix2(temp);
|
||||
temp = rrk[1];
|
||||
rk[1] = setup_mix2(temp);
|
||||
temp = rrk[2];
|
||||
rk[2] = setup_mix2(temp);
|
||||
temp = rrk[3];
|
||||
rk[3] = setup_mix2(temp);
|
||||
#else
|
||||
temp = rrk[0];
|
||||
rk[0] =
|
||||
Tks0[byte(temp, 3)] ^
|
||||
Tks1[byte(temp, 2)] ^
|
||||
Tks2[byte(temp, 1)] ^
|
||||
Tks3[byte(temp, 0)];
|
||||
temp = rrk[1];
|
||||
rk[1] =
|
||||
Tks0[byte(temp, 3)] ^
|
||||
Tks1[byte(temp, 2)] ^
|
||||
Tks2[byte(temp, 1)] ^
|
||||
Tks3[byte(temp, 0)];
|
||||
temp = rrk[2];
|
||||
rk[2] =
|
||||
Tks0[byte(temp, 3)] ^
|
||||
Tks1[byte(temp, 2)] ^
|
||||
Tks2[byte(temp, 1)] ^
|
||||
Tks3[byte(temp, 0)];
|
||||
temp = rrk[3];
|
||||
rk[3] =
|
||||
Tks0[byte(temp, 3)] ^
|
||||
Tks1[byte(temp, 2)] ^
|
||||
Tks2[byte(temp, 1)] ^
|
||||
Tks3[byte(temp, 0)];
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* copy last */
|
||||
rrk -= 4;
|
||||
rk += 4;
|
||||
*rk++ = *rrk++;
|
||||
*rk++ = *rrk++;
|
||||
*rk++ = *rrk++;
|
||||
*rk = *rrk;
|
||||
#endif /* ENCRYPT_ONLY */
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with AES
|
||||
@param pt The input plaintext (16 bytes)
|
||||
@param ct The output ciphertext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rijndael_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#else
|
||||
int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 s0, s1, s2, s3, t0, t1, t2, t3, *rk;
|
||||
int Nr, r;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
Nr = skey->rijndael.Nr;
|
||||
rk = skey->rijndael.eK;
|
||||
|
||||
/*
|
||||
* map byte array block to cipher state
|
||||
* and add initial round key:
|
||||
*/
|
||||
LOAD32H(s0, pt ); s0 ^= rk[0];
|
||||
LOAD32H(s1, pt + 4); s1 ^= rk[1];
|
||||
LOAD32H(s2, pt + 8); s2 ^= rk[2];
|
||||
LOAD32H(s3, pt + 12); s3 ^= rk[3];
|
||||
|
||||
#ifdef LTC_SMALL_CODE
|
||||
|
||||
for (r = 0; ; r++) {
|
||||
rk += 4;
|
||||
t0 =
|
||||
Te0(byte(s0, 3)) ^
|
||||
Te1(byte(s1, 2)) ^
|
||||
Te2(byte(s2, 1)) ^
|
||||
Te3(byte(s3, 0)) ^
|
||||
rk[0];
|
||||
t1 =
|
||||
Te0(byte(s1, 3)) ^
|
||||
Te1(byte(s2, 2)) ^
|
||||
Te2(byte(s3, 1)) ^
|
||||
Te3(byte(s0, 0)) ^
|
||||
rk[1];
|
||||
t2 =
|
||||
Te0(byte(s2, 3)) ^
|
||||
Te1(byte(s3, 2)) ^
|
||||
Te2(byte(s0, 1)) ^
|
||||
Te3(byte(s1, 0)) ^
|
||||
rk[2];
|
||||
t3 =
|
||||
Te0(byte(s3, 3)) ^
|
||||
Te1(byte(s0, 2)) ^
|
||||
Te2(byte(s1, 1)) ^
|
||||
Te3(byte(s2, 0)) ^
|
||||
rk[3];
|
||||
if (r == Nr-2) {
|
||||
break;
|
||||
}
|
||||
s0 = t0; s1 = t1; s2 = t2; s3 = t3;
|
||||
}
|
||||
rk += 4;
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Nr - 1 full rounds:
|
||||
*/
|
||||
r = Nr >> 1;
|
||||
for (;;) {
|
||||
t0 =
|
||||
Te0(byte(s0, 3)) ^
|
||||
Te1(byte(s1, 2)) ^
|
||||
Te2(byte(s2, 1)) ^
|
||||
Te3(byte(s3, 0)) ^
|
||||
rk[4];
|
||||
t1 =
|
||||
Te0(byte(s1, 3)) ^
|
||||
Te1(byte(s2, 2)) ^
|
||||
Te2(byte(s3, 1)) ^
|
||||
Te3(byte(s0, 0)) ^
|
||||
rk[5];
|
||||
t2 =
|
||||
Te0(byte(s2, 3)) ^
|
||||
Te1(byte(s3, 2)) ^
|
||||
Te2(byte(s0, 1)) ^
|
||||
Te3(byte(s1, 0)) ^
|
||||
rk[6];
|
||||
t3 =
|
||||
Te0(byte(s3, 3)) ^
|
||||
Te1(byte(s0, 2)) ^
|
||||
Te2(byte(s1, 1)) ^
|
||||
Te3(byte(s2, 0)) ^
|
||||
rk[7];
|
||||
|
||||
rk += 8;
|
||||
if (--r == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
s0 =
|
||||
Te0(byte(t0, 3)) ^
|
||||
Te1(byte(t1, 2)) ^
|
||||
Te2(byte(t2, 1)) ^
|
||||
Te3(byte(t3, 0)) ^
|
||||
rk[0];
|
||||
s1 =
|
||||
Te0(byte(t1, 3)) ^
|
||||
Te1(byte(t2, 2)) ^
|
||||
Te2(byte(t3, 1)) ^
|
||||
Te3(byte(t0, 0)) ^
|
||||
rk[1];
|
||||
s2 =
|
||||
Te0(byte(t2, 3)) ^
|
||||
Te1(byte(t3, 2)) ^
|
||||
Te2(byte(t0, 1)) ^
|
||||
Te3(byte(t1, 0)) ^
|
||||
rk[2];
|
||||
s3 =
|
||||
Te0(byte(t3, 3)) ^
|
||||
Te1(byte(t0, 2)) ^
|
||||
Te2(byte(t1, 1)) ^
|
||||
Te3(byte(t2, 0)) ^
|
||||
rk[3];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* apply last round and
|
||||
* map cipher state to byte array block:
|
||||
*/
|
||||
s0 =
|
||||
(Te4_3[byte(t0, 3)]) ^
|
||||
(Te4_2[byte(t1, 2)]) ^
|
||||
(Te4_1[byte(t2, 1)]) ^
|
||||
(Te4_0[byte(t3, 0)]) ^
|
||||
rk[0];
|
||||
STORE32H(s0, ct);
|
||||
s1 =
|
||||
(Te4_3[byte(t1, 3)]) ^
|
||||
(Te4_2[byte(t2, 2)]) ^
|
||||
(Te4_1[byte(t3, 1)]) ^
|
||||
(Te4_0[byte(t0, 0)]) ^
|
||||
rk[1];
|
||||
STORE32H(s1, ct+4);
|
||||
s2 =
|
||||
(Te4_3[byte(t2, 3)]) ^
|
||||
(Te4_2[byte(t3, 2)]) ^
|
||||
(Te4_1[byte(t0, 1)]) ^
|
||||
(Te4_0[byte(t1, 0)]) ^
|
||||
rk[2];
|
||||
STORE32H(s2, ct+8);
|
||||
s3 =
|
||||
(Te4_3[byte(t3, 3)]) ^
|
||||
(Te4_2[byte(t0, 2)]) ^
|
||||
(Te4_1[byte(t1, 1)]) ^
|
||||
(Te4_0[byte(t2, 0)]) ^
|
||||
rk[3];
|
||||
STORE32H(s3, ct+12);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int ECB_ENC(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
int err = _rijndael_ecb_encrypt(pt, ct, skey);
|
||||
burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ENCRYPT_ONLY
|
||||
|
||||
/**
|
||||
Decrypts a block of text with AES
|
||||
@param ct The input ciphertext (16 bytes)
|
||||
@param pt The output plaintext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rijndael_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#else
|
||||
int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 s0, s1, s2, s3, t0, t1, t2, t3, *rk;
|
||||
int Nr, r;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
Nr = skey->rijndael.Nr;
|
||||
rk = skey->rijndael.dK;
|
||||
|
||||
/*
|
||||
* map byte array block to cipher state
|
||||
* and add initial round key:
|
||||
*/
|
||||
LOAD32H(s0, ct ); s0 ^= rk[0];
|
||||
LOAD32H(s1, ct + 4); s1 ^= rk[1];
|
||||
LOAD32H(s2, ct + 8); s2 ^= rk[2];
|
||||
LOAD32H(s3, ct + 12); s3 ^= rk[3];
|
||||
|
||||
#ifdef LTC_SMALL_CODE
|
||||
for (r = 0; ; r++) {
|
||||
rk += 4;
|
||||
t0 =
|
||||
Td0(byte(s0, 3)) ^
|
||||
Td1(byte(s3, 2)) ^
|
||||
Td2(byte(s2, 1)) ^
|
||||
Td3(byte(s1, 0)) ^
|
||||
rk[0];
|
||||
t1 =
|
||||
Td0(byte(s1, 3)) ^
|
||||
Td1(byte(s0, 2)) ^
|
||||
Td2(byte(s3, 1)) ^
|
||||
Td3(byte(s2, 0)) ^
|
||||
rk[1];
|
||||
t2 =
|
||||
Td0(byte(s2, 3)) ^
|
||||
Td1(byte(s1, 2)) ^
|
||||
Td2(byte(s0, 1)) ^
|
||||
Td3(byte(s3, 0)) ^
|
||||
rk[2];
|
||||
t3 =
|
||||
Td0(byte(s3, 3)) ^
|
||||
Td1(byte(s2, 2)) ^
|
||||
Td2(byte(s1, 1)) ^
|
||||
Td3(byte(s0, 0)) ^
|
||||
rk[3];
|
||||
if (r == Nr-2) {
|
||||
break;
|
||||
}
|
||||
s0 = t0; s1 = t1; s2 = t2; s3 = t3;
|
||||
}
|
||||
rk += 4;
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Nr - 1 full rounds:
|
||||
*/
|
||||
r = Nr >> 1;
|
||||
for (;;) {
|
||||
|
||||
t0 =
|
||||
Td0(byte(s0, 3)) ^
|
||||
Td1(byte(s3, 2)) ^
|
||||
Td2(byte(s2, 1)) ^
|
||||
Td3(byte(s1, 0)) ^
|
||||
rk[4];
|
||||
t1 =
|
||||
Td0(byte(s1, 3)) ^
|
||||
Td1(byte(s0, 2)) ^
|
||||
Td2(byte(s3, 1)) ^
|
||||
Td3(byte(s2, 0)) ^
|
||||
rk[5];
|
||||
t2 =
|
||||
Td0(byte(s2, 3)) ^
|
||||
Td1(byte(s1, 2)) ^
|
||||
Td2(byte(s0, 1)) ^
|
||||
Td3(byte(s3, 0)) ^
|
||||
rk[6];
|
||||
t3 =
|
||||
Td0(byte(s3, 3)) ^
|
||||
Td1(byte(s2, 2)) ^
|
||||
Td2(byte(s1, 1)) ^
|
||||
Td3(byte(s0, 0)) ^
|
||||
rk[7];
|
||||
|
||||
rk += 8;
|
||||
if (--r == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
s0 =
|
||||
Td0(byte(t0, 3)) ^
|
||||
Td1(byte(t3, 2)) ^
|
||||
Td2(byte(t2, 1)) ^
|
||||
Td3(byte(t1, 0)) ^
|
||||
rk[0];
|
||||
s1 =
|
||||
Td0(byte(t1, 3)) ^
|
||||
Td1(byte(t0, 2)) ^
|
||||
Td2(byte(t3, 1)) ^
|
||||
Td3(byte(t2, 0)) ^
|
||||
rk[1];
|
||||
s2 =
|
||||
Td0(byte(t2, 3)) ^
|
||||
Td1(byte(t1, 2)) ^
|
||||
Td2(byte(t0, 1)) ^
|
||||
Td3(byte(t3, 0)) ^
|
||||
rk[2];
|
||||
s3 =
|
||||
Td0(byte(t3, 3)) ^
|
||||
Td1(byte(t2, 2)) ^
|
||||
Td2(byte(t1, 1)) ^
|
||||
Td3(byte(t0, 0)) ^
|
||||
rk[3];
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* apply last round and
|
||||
* map cipher state to byte array block:
|
||||
*/
|
||||
s0 =
|
||||
(Td4[byte(t0, 3)] & 0xff000000) ^
|
||||
(Td4[byte(t3, 2)] & 0x00ff0000) ^
|
||||
(Td4[byte(t2, 1)] & 0x0000ff00) ^
|
||||
(Td4[byte(t1, 0)] & 0x000000ff) ^
|
||||
rk[0];
|
||||
STORE32H(s0, pt);
|
||||
s1 =
|
||||
(Td4[byte(t1, 3)] & 0xff000000) ^
|
||||
(Td4[byte(t0, 2)] & 0x00ff0000) ^
|
||||
(Td4[byte(t3, 1)] & 0x0000ff00) ^
|
||||
(Td4[byte(t2, 0)] & 0x000000ff) ^
|
||||
rk[1];
|
||||
STORE32H(s1, pt+4);
|
||||
s2 =
|
||||
(Td4[byte(t2, 3)] & 0xff000000) ^
|
||||
(Td4[byte(t1, 2)] & 0x00ff0000) ^
|
||||
(Td4[byte(t0, 1)] & 0x0000ff00) ^
|
||||
(Td4[byte(t3, 0)] & 0x000000ff) ^
|
||||
rk[2];
|
||||
STORE32H(s2, pt+8);
|
||||
s3 =
|
||||
(Td4[byte(t3, 3)] & 0xff000000) ^
|
||||
(Td4[byte(t2, 2)] & 0x00ff0000) ^
|
||||
(Td4[byte(t1, 1)] & 0x0000ff00) ^
|
||||
(Td4[byte(t0, 0)] & 0x000000ff) ^
|
||||
rk[3];
|
||||
STORE32H(s3, pt+12);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int ECB_DEC(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
int err = _rijndael_ecb_decrypt(ct, pt, skey);
|
||||
burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Performs a self-test of the AES block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int ECB_TEST(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
int err;
|
||||
static const struct {
|
||||
int keylen;
|
||||
unsigned char key[32], pt[16], ct[16];
|
||||
} tests[] = {
|
||||
{ 16,
|
||||
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
|
||||
{ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
|
||||
{ 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30,
|
||||
0xd8, 0xcd, 0xb7, 0x80, 0x70, 0xb4, 0xc5, 0x5a }
|
||||
}, {
|
||||
24,
|
||||
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 },
|
||||
{ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
|
||||
{ 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0,
|
||||
0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91 }
|
||||
}, {
|
||||
32,
|
||||
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
|
||||
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
|
||||
{ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
|
||||
{ 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf,
|
||||
0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89 }
|
||||
}
|
||||
};
|
||||
|
||||
symmetric_key key;
|
||||
unsigned char tmp[2][16];
|
||||
int i, y;
|
||||
|
||||
for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
|
||||
zeromem(&key, sizeof(key));
|
||||
if ((err = rijndael_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
rijndael_ecb_encrypt(tests[i].pt, tmp[0], &key);
|
||||
rijndael_ecb_decrypt(tmp[0], tmp[1], &key);
|
||||
if (compare_testvector(tmp[0], 16, tests[i].ct, 16, "AES Encrypt", i) ||
|
||||
compare_testvector(tmp[1], 16, tests[i].pt, 16, "AES Decrypt", i)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 16; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) rijndael_ecb_encrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 1000; y++) rijndael_ecb_decrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* ENCRYPT_ONLY */
|
||||
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void ECB_DONE(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int ECB_KS(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
|
||||
if (*keysize < 16)
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
if (*keysize < 24) {
|
||||
*keysize = 16;
|
||||
return CRYPT_OK;
|
||||
} else if (*keysize < 32) {
|
||||
*keysize = 24;
|
||||
return CRYPT_OK;
|
||||
} else {
|
||||
*keysize = 32;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,594 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
/**
|
||||
@file blowfish.c
|
||||
Implementation of the Blowfish block cipher, Tom St Denis
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_BLOWFISH
|
||||
|
||||
const struct ltc_cipher_descriptor blowfish_desc =
|
||||
{
|
||||
"blowfish",
|
||||
0,
|
||||
8, 56, 8, 16,
|
||||
&blowfish_setup,
|
||||
&blowfish_ecb_encrypt,
|
||||
&blowfish_ecb_decrypt,
|
||||
&blowfish_test,
|
||||
&blowfish_done,
|
||||
&blowfish_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const ulong32 ORIG_P[16 + 2] = {
|
||||
0x243F6A88UL, 0x85A308D3UL, 0x13198A2EUL, 0x03707344UL,
|
||||
0xA4093822UL, 0x299F31D0UL, 0x082EFA98UL, 0xEC4E6C89UL,
|
||||
0x452821E6UL, 0x38D01377UL, 0xBE5466CFUL, 0x34E90C6CUL,
|
||||
0xC0AC29B7UL, 0xC97C50DDUL, 0x3F84D5B5UL, 0xB5470917UL,
|
||||
0x9216D5D9UL, 0x8979FB1BUL
|
||||
};
|
||||
|
||||
static const ulong32 ORIG_S[4][256] = {
|
||||
{ 0xD1310BA6UL, 0x98DFB5ACUL, 0x2FFD72DBUL, 0xD01ADFB7UL,
|
||||
0xB8E1AFEDUL, 0x6A267E96UL, 0xBA7C9045UL, 0xF12C7F99UL,
|
||||
0x24A19947UL, 0xB3916CF7UL, 0x0801F2E2UL, 0x858EFC16UL,
|
||||
0x636920D8UL, 0x71574E69UL, 0xA458FEA3UL, 0xF4933D7EUL,
|
||||
0x0D95748FUL, 0x728EB658UL, 0x718BCD58UL, 0x82154AEEUL,
|
||||
0x7B54A41DUL, 0xC25A59B5UL, 0x9C30D539UL, 0x2AF26013UL,
|
||||
0xC5D1B023UL, 0x286085F0UL, 0xCA417918UL, 0xB8DB38EFUL,
|
||||
0x8E79DCB0UL, 0x603A180EUL, 0x6C9E0E8BUL, 0xB01E8A3EUL,
|
||||
0xD71577C1UL, 0xBD314B27UL, 0x78AF2FDAUL, 0x55605C60UL,
|
||||
0xE65525F3UL, 0xAA55AB94UL, 0x57489862UL, 0x63E81440UL,
|
||||
0x55CA396AUL, 0x2AAB10B6UL, 0xB4CC5C34UL, 0x1141E8CEUL,
|
||||
0xA15486AFUL, 0x7C72E993UL, 0xB3EE1411UL, 0x636FBC2AUL,
|
||||
0x2BA9C55DUL, 0x741831F6UL, 0xCE5C3E16UL, 0x9B87931EUL,
|
||||
0xAFD6BA33UL, 0x6C24CF5CUL, 0x7A325381UL, 0x28958677UL,
|
||||
0x3B8F4898UL, 0x6B4BB9AFUL, 0xC4BFE81BUL, 0x66282193UL,
|
||||
0x61D809CCUL, 0xFB21A991UL, 0x487CAC60UL, 0x5DEC8032UL,
|
||||
0xEF845D5DUL, 0xE98575B1UL, 0xDC262302UL, 0xEB651B88UL,
|
||||
0x23893E81UL, 0xD396ACC5UL, 0x0F6D6FF3UL, 0x83F44239UL,
|
||||
0x2E0B4482UL, 0xA4842004UL, 0x69C8F04AUL, 0x9E1F9B5EUL,
|
||||
0x21C66842UL, 0xF6E96C9AUL, 0x670C9C61UL, 0xABD388F0UL,
|
||||
0x6A51A0D2UL, 0xD8542F68UL, 0x960FA728UL, 0xAB5133A3UL,
|
||||
0x6EEF0B6CUL, 0x137A3BE4UL, 0xBA3BF050UL, 0x7EFB2A98UL,
|
||||
0xA1F1651DUL, 0x39AF0176UL, 0x66CA593EUL, 0x82430E88UL,
|
||||
0x8CEE8619UL, 0x456F9FB4UL, 0x7D84A5C3UL, 0x3B8B5EBEUL,
|
||||
0xE06F75D8UL, 0x85C12073UL, 0x401A449FUL, 0x56C16AA6UL,
|
||||
0x4ED3AA62UL, 0x363F7706UL, 0x1BFEDF72UL, 0x429B023DUL,
|
||||
0x37D0D724UL, 0xD00A1248UL, 0xDB0FEAD3UL, 0x49F1C09BUL,
|
||||
0x075372C9UL, 0x80991B7BUL, 0x25D479D8UL, 0xF6E8DEF7UL,
|
||||
0xE3FE501AUL, 0xB6794C3BUL, 0x976CE0BDUL, 0x04C006BAUL,
|
||||
0xC1A94FB6UL, 0x409F60C4UL, 0x5E5C9EC2UL, 0x196A2463UL,
|
||||
0x68FB6FAFUL, 0x3E6C53B5UL, 0x1339B2EBUL, 0x3B52EC6FUL,
|
||||
0x6DFC511FUL, 0x9B30952CUL, 0xCC814544UL, 0xAF5EBD09UL,
|
||||
0xBEE3D004UL, 0xDE334AFDUL, 0x660F2807UL, 0x192E4BB3UL,
|
||||
0xC0CBA857UL, 0x45C8740FUL, 0xD20B5F39UL, 0xB9D3FBDBUL,
|
||||
0x5579C0BDUL, 0x1A60320AUL, 0xD6A100C6UL, 0x402C7279UL,
|
||||
0x679F25FEUL, 0xFB1FA3CCUL, 0x8EA5E9F8UL, 0xDB3222F8UL,
|
||||
0x3C7516DFUL, 0xFD616B15UL, 0x2F501EC8UL, 0xAD0552ABUL,
|
||||
0x323DB5FAUL, 0xFD238760UL, 0x53317B48UL, 0x3E00DF82UL,
|
||||
0x9E5C57BBUL, 0xCA6F8CA0UL, 0x1A87562EUL, 0xDF1769DBUL,
|
||||
0xD542A8F6UL, 0x287EFFC3UL, 0xAC6732C6UL, 0x8C4F5573UL,
|
||||
0x695B27B0UL, 0xBBCA58C8UL, 0xE1FFA35DUL, 0xB8F011A0UL,
|
||||
0x10FA3D98UL, 0xFD2183B8UL, 0x4AFCB56CUL, 0x2DD1D35BUL,
|
||||
0x9A53E479UL, 0xB6F84565UL, 0xD28E49BCUL, 0x4BFB9790UL,
|
||||
0xE1DDF2DAUL, 0xA4CB7E33UL, 0x62FB1341UL, 0xCEE4C6E8UL,
|
||||
0xEF20CADAUL, 0x36774C01UL, 0xD07E9EFEUL, 0x2BF11FB4UL,
|
||||
0x95DBDA4DUL, 0xAE909198UL, 0xEAAD8E71UL, 0x6B93D5A0UL,
|
||||
0xD08ED1D0UL, 0xAFC725E0UL, 0x8E3C5B2FUL, 0x8E7594B7UL,
|
||||
0x8FF6E2FBUL, 0xF2122B64UL, 0x8888B812UL, 0x900DF01CUL,
|
||||
0x4FAD5EA0UL, 0x688FC31CUL, 0xD1CFF191UL, 0xB3A8C1ADUL,
|
||||
0x2F2F2218UL, 0xBE0E1777UL, 0xEA752DFEUL, 0x8B021FA1UL,
|
||||
0xE5A0CC0FUL, 0xB56F74E8UL, 0x18ACF3D6UL, 0xCE89E299UL,
|
||||
0xB4A84FE0UL, 0xFD13E0B7UL, 0x7CC43B81UL, 0xD2ADA8D9UL,
|
||||
0x165FA266UL, 0x80957705UL, 0x93CC7314UL, 0x211A1477UL,
|
||||
0xE6AD2065UL, 0x77B5FA86UL, 0xC75442F5UL, 0xFB9D35CFUL,
|
||||
0xEBCDAF0CUL, 0x7B3E89A0UL, 0xD6411BD3UL, 0xAE1E7E49UL,
|
||||
0x00250E2DUL, 0x2071B35EUL, 0x226800BBUL, 0x57B8E0AFUL,
|
||||
0x2464369BUL, 0xF009B91EUL, 0x5563911DUL, 0x59DFA6AAUL,
|
||||
0x78C14389UL, 0xD95A537FUL, 0x207D5BA2UL, 0x02E5B9C5UL,
|
||||
0x83260376UL, 0x6295CFA9UL, 0x11C81968UL, 0x4E734A41UL,
|
||||
0xB3472DCAUL, 0x7B14A94AUL, 0x1B510052UL, 0x9A532915UL,
|
||||
0xD60F573FUL, 0xBC9BC6E4UL, 0x2B60A476UL, 0x81E67400UL,
|
||||
0x08BA6FB5UL, 0x571BE91FUL, 0xF296EC6BUL, 0x2A0DD915UL,
|
||||
0xB6636521UL, 0xE7B9F9B6UL, 0xFF34052EUL, 0xC5855664UL,
|
||||
0x53B02D5DUL, 0xA99F8FA1UL, 0x08BA4799UL, 0x6E85076AUL },
|
||||
{ 0x4B7A70E9UL, 0xB5B32944UL, 0xDB75092EUL, 0xC4192623UL,
|
||||
0xAD6EA6B0UL, 0x49A7DF7DUL, 0x9CEE60B8UL, 0x8FEDB266UL,
|
||||
0xECAA8C71UL, 0x699A17FFUL, 0x5664526CUL, 0xC2B19EE1UL,
|
||||
0x193602A5UL, 0x75094C29UL, 0xA0591340UL, 0xE4183A3EUL,
|
||||
0x3F54989AUL, 0x5B429D65UL, 0x6B8FE4D6UL, 0x99F73FD6UL,
|
||||
0xA1D29C07UL, 0xEFE830F5UL, 0x4D2D38E6UL, 0xF0255DC1UL,
|
||||
0x4CDD2086UL, 0x8470EB26UL, 0x6382E9C6UL, 0x021ECC5EUL,
|
||||
0x09686B3FUL, 0x3EBAEFC9UL, 0x3C971814UL, 0x6B6A70A1UL,
|
||||
0x687F3584UL, 0x52A0E286UL, 0xB79C5305UL, 0xAA500737UL,
|
||||
0x3E07841CUL, 0x7FDEAE5CUL, 0x8E7D44ECUL, 0x5716F2B8UL,
|
||||
0xB03ADA37UL, 0xF0500C0DUL, 0xF01C1F04UL, 0x0200B3FFUL,
|
||||
0xAE0CF51AUL, 0x3CB574B2UL, 0x25837A58UL, 0xDC0921BDUL,
|
||||
0xD19113F9UL, 0x7CA92FF6UL, 0x94324773UL, 0x22F54701UL,
|
||||
0x3AE5E581UL, 0x37C2DADCUL, 0xC8B57634UL, 0x9AF3DDA7UL,
|
||||
0xA9446146UL, 0x0FD0030EUL, 0xECC8C73EUL, 0xA4751E41UL,
|
||||
0xE238CD99UL, 0x3BEA0E2FUL, 0x3280BBA1UL, 0x183EB331UL,
|
||||
0x4E548B38UL, 0x4F6DB908UL, 0x6F420D03UL, 0xF60A04BFUL,
|
||||
0x2CB81290UL, 0x24977C79UL, 0x5679B072UL, 0xBCAF89AFUL,
|
||||
0xDE9A771FUL, 0xD9930810UL, 0xB38BAE12UL, 0xDCCF3F2EUL,
|
||||
0x5512721FUL, 0x2E6B7124UL, 0x501ADDE6UL, 0x9F84CD87UL,
|
||||
0x7A584718UL, 0x7408DA17UL, 0xBC9F9ABCUL, 0xE94B7D8CUL,
|
||||
0xEC7AEC3AUL, 0xDB851DFAUL, 0x63094366UL, 0xC464C3D2UL,
|
||||
0xEF1C1847UL, 0x3215D908UL, 0xDD433B37UL, 0x24C2BA16UL,
|
||||
0x12A14D43UL, 0x2A65C451UL, 0x50940002UL, 0x133AE4DDUL,
|
||||
0x71DFF89EUL, 0x10314E55UL, 0x81AC77D6UL, 0x5F11199BUL,
|
||||
0x043556F1UL, 0xD7A3C76BUL, 0x3C11183BUL, 0x5924A509UL,
|
||||
0xF28FE6EDUL, 0x97F1FBFAUL, 0x9EBABF2CUL, 0x1E153C6EUL,
|
||||
0x86E34570UL, 0xEAE96FB1UL, 0x860E5E0AUL, 0x5A3E2AB3UL,
|
||||
0x771FE71CUL, 0x4E3D06FAUL, 0x2965DCB9UL, 0x99E71D0FUL,
|
||||
0x803E89D6UL, 0x5266C825UL, 0x2E4CC978UL, 0x9C10B36AUL,
|
||||
0xC6150EBAUL, 0x94E2EA78UL, 0xA5FC3C53UL, 0x1E0A2DF4UL,
|
||||
0xF2F74EA7UL, 0x361D2B3DUL, 0x1939260FUL, 0x19C27960UL,
|
||||
0x5223A708UL, 0xF71312B6UL, 0xEBADFE6EUL, 0xEAC31F66UL,
|
||||
0xE3BC4595UL, 0xA67BC883UL, 0xB17F37D1UL, 0x018CFF28UL,
|
||||
0xC332DDEFUL, 0xBE6C5AA5UL, 0x65582185UL, 0x68AB9802UL,
|
||||
0xEECEA50FUL, 0xDB2F953BUL, 0x2AEF7DADUL, 0x5B6E2F84UL,
|
||||
0x1521B628UL, 0x29076170UL, 0xECDD4775UL, 0x619F1510UL,
|
||||
0x13CCA830UL, 0xEB61BD96UL, 0x0334FE1EUL, 0xAA0363CFUL,
|
||||
0xB5735C90UL, 0x4C70A239UL, 0xD59E9E0BUL, 0xCBAADE14UL,
|
||||
0xEECC86BCUL, 0x60622CA7UL, 0x9CAB5CABUL, 0xB2F3846EUL,
|
||||
0x648B1EAFUL, 0x19BDF0CAUL, 0xA02369B9UL, 0x655ABB50UL,
|
||||
0x40685A32UL, 0x3C2AB4B3UL, 0x319EE9D5UL, 0xC021B8F7UL,
|
||||
0x9B540B19UL, 0x875FA099UL, 0x95F7997EUL, 0x623D7DA8UL,
|
||||
0xF837889AUL, 0x97E32D77UL, 0x11ED935FUL, 0x16681281UL,
|
||||
0x0E358829UL, 0xC7E61FD6UL, 0x96DEDFA1UL, 0x7858BA99UL,
|
||||
0x57F584A5UL, 0x1B227263UL, 0x9B83C3FFUL, 0x1AC24696UL,
|
||||
0xCDB30AEBUL, 0x532E3054UL, 0x8FD948E4UL, 0x6DBC3128UL,
|
||||
0x58EBF2EFUL, 0x34C6FFEAUL, 0xFE28ED61UL, 0xEE7C3C73UL,
|
||||
0x5D4A14D9UL, 0xE864B7E3UL, 0x42105D14UL, 0x203E13E0UL,
|
||||
0x45EEE2B6UL, 0xA3AAABEAUL, 0xDB6C4F15UL, 0xFACB4FD0UL,
|
||||
0xC742F442UL, 0xEF6ABBB5UL, 0x654F3B1DUL, 0x41CD2105UL,
|
||||
0xD81E799EUL, 0x86854DC7UL, 0xE44B476AUL, 0x3D816250UL,
|
||||
0xCF62A1F2UL, 0x5B8D2646UL, 0xFC8883A0UL, 0xC1C7B6A3UL,
|
||||
0x7F1524C3UL, 0x69CB7492UL, 0x47848A0BUL, 0x5692B285UL,
|
||||
0x095BBF00UL, 0xAD19489DUL, 0x1462B174UL, 0x23820E00UL,
|
||||
0x58428D2AUL, 0x0C55F5EAUL, 0x1DADF43EUL, 0x233F7061UL,
|
||||
0x3372F092UL, 0x8D937E41UL, 0xD65FECF1UL, 0x6C223BDBUL,
|
||||
0x7CDE3759UL, 0xCBEE7460UL, 0x4085F2A7UL, 0xCE77326EUL,
|
||||
0xA6078084UL, 0x19F8509EUL, 0xE8EFD855UL, 0x61D99735UL,
|
||||
0xA969A7AAUL, 0xC50C06C2UL, 0x5A04ABFCUL, 0x800BCADCUL,
|
||||
0x9E447A2EUL, 0xC3453484UL, 0xFDD56705UL, 0x0E1E9EC9UL,
|
||||
0xDB73DBD3UL, 0x105588CDUL, 0x675FDA79UL, 0xE3674340UL,
|
||||
0xC5C43465UL, 0x713E38D8UL, 0x3D28F89EUL, 0xF16DFF20UL,
|
||||
0x153E21E7UL, 0x8FB03D4AUL, 0xE6E39F2BUL, 0xDB83ADF7UL },
|
||||
{ 0xE93D5A68UL, 0x948140F7UL, 0xF64C261CUL, 0x94692934UL,
|
||||
0x411520F7UL, 0x7602D4F7UL, 0xBCF46B2EUL, 0xD4A20068UL,
|
||||
0xD4082471UL, 0x3320F46AUL, 0x43B7D4B7UL, 0x500061AFUL,
|
||||
0x1E39F62EUL, 0x97244546UL, 0x14214F74UL, 0xBF8B8840UL,
|
||||
0x4D95FC1DUL, 0x96B591AFUL, 0x70F4DDD3UL, 0x66A02F45UL,
|
||||
0xBFBC09ECUL, 0x03BD9785UL, 0x7FAC6DD0UL, 0x31CB8504UL,
|
||||
0x96EB27B3UL, 0x55FD3941UL, 0xDA2547E6UL, 0xABCA0A9AUL,
|
||||
0x28507825UL, 0x530429F4UL, 0x0A2C86DAUL, 0xE9B66DFBUL,
|
||||
0x68DC1462UL, 0xD7486900UL, 0x680EC0A4UL, 0x27A18DEEUL,
|
||||
0x4F3FFEA2UL, 0xE887AD8CUL, 0xB58CE006UL, 0x7AF4D6B6UL,
|
||||
0xAACE1E7CUL, 0xD3375FECUL, 0xCE78A399UL, 0x406B2A42UL,
|
||||
0x20FE9E35UL, 0xD9F385B9UL, 0xEE39D7ABUL, 0x3B124E8BUL,
|
||||
0x1DC9FAF7UL, 0x4B6D1856UL, 0x26A36631UL, 0xEAE397B2UL,
|
||||
0x3A6EFA74UL, 0xDD5B4332UL, 0x6841E7F7UL, 0xCA7820FBUL,
|
||||
0xFB0AF54EUL, 0xD8FEB397UL, 0x454056ACUL, 0xBA489527UL,
|
||||
0x55533A3AUL, 0x20838D87UL, 0xFE6BA9B7UL, 0xD096954BUL,
|
||||
0x55A867BCUL, 0xA1159A58UL, 0xCCA92963UL, 0x99E1DB33UL,
|
||||
0xA62A4A56UL, 0x3F3125F9UL, 0x5EF47E1CUL, 0x9029317CUL,
|
||||
0xFDF8E802UL, 0x04272F70UL, 0x80BB155CUL, 0x05282CE3UL,
|
||||
0x95C11548UL, 0xE4C66D22UL, 0x48C1133FUL, 0xC70F86DCUL,
|
||||
0x07F9C9EEUL, 0x41041F0FUL, 0x404779A4UL, 0x5D886E17UL,
|
||||
0x325F51EBUL, 0xD59BC0D1UL, 0xF2BCC18FUL, 0x41113564UL,
|
||||
0x257B7834UL, 0x602A9C60UL, 0xDFF8E8A3UL, 0x1F636C1BUL,
|
||||
0x0E12B4C2UL, 0x02E1329EUL, 0xAF664FD1UL, 0xCAD18115UL,
|
||||
0x6B2395E0UL, 0x333E92E1UL, 0x3B240B62UL, 0xEEBEB922UL,
|
||||
0x85B2A20EUL, 0xE6BA0D99UL, 0xDE720C8CUL, 0x2DA2F728UL,
|
||||
0xD0127845UL, 0x95B794FDUL, 0x647D0862UL, 0xE7CCF5F0UL,
|
||||
0x5449A36FUL, 0x877D48FAUL, 0xC39DFD27UL, 0xF33E8D1EUL,
|
||||
0x0A476341UL, 0x992EFF74UL, 0x3A6F6EABUL, 0xF4F8FD37UL,
|
||||
0xA812DC60UL, 0xA1EBDDF8UL, 0x991BE14CUL, 0xDB6E6B0DUL,
|
||||
0xC67B5510UL, 0x6D672C37UL, 0x2765D43BUL, 0xDCD0E804UL,
|
||||
0xF1290DC7UL, 0xCC00FFA3UL, 0xB5390F92UL, 0x690FED0BUL,
|
||||
0x667B9FFBUL, 0xCEDB7D9CUL, 0xA091CF0BUL, 0xD9155EA3UL,
|
||||
0xBB132F88UL, 0x515BAD24UL, 0x7B9479BFUL, 0x763BD6EBUL,
|
||||
0x37392EB3UL, 0xCC115979UL, 0x8026E297UL, 0xF42E312DUL,
|
||||
0x6842ADA7UL, 0xC66A2B3BUL, 0x12754CCCUL, 0x782EF11CUL,
|
||||
0x6A124237UL, 0xB79251E7UL, 0x06A1BBE6UL, 0x4BFB6350UL,
|
||||
0x1A6B1018UL, 0x11CAEDFAUL, 0x3D25BDD8UL, 0xE2E1C3C9UL,
|
||||
0x44421659UL, 0x0A121386UL, 0xD90CEC6EUL, 0xD5ABEA2AUL,
|
||||
0x64AF674EUL, 0xDA86A85FUL, 0xBEBFE988UL, 0x64E4C3FEUL,
|
||||
0x9DBC8057UL, 0xF0F7C086UL, 0x60787BF8UL, 0x6003604DUL,
|
||||
0xD1FD8346UL, 0xF6381FB0UL, 0x7745AE04UL, 0xD736FCCCUL,
|
||||
0x83426B33UL, 0xF01EAB71UL, 0xB0804187UL, 0x3C005E5FUL,
|
||||
0x77A057BEUL, 0xBDE8AE24UL, 0x55464299UL, 0xBF582E61UL,
|
||||
0x4E58F48FUL, 0xF2DDFDA2UL, 0xF474EF38UL, 0x8789BDC2UL,
|
||||
0x5366F9C3UL, 0xC8B38E74UL, 0xB475F255UL, 0x46FCD9B9UL,
|
||||
0x7AEB2661UL, 0x8B1DDF84UL, 0x846A0E79UL, 0x915F95E2UL,
|
||||
0x466E598EUL, 0x20B45770UL, 0x8CD55591UL, 0xC902DE4CUL,
|
||||
0xB90BACE1UL, 0xBB8205D0UL, 0x11A86248UL, 0x7574A99EUL,
|
||||
0xB77F19B6UL, 0xE0A9DC09UL, 0x662D09A1UL, 0xC4324633UL,
|
||||
0xE85A1F02UL, 0x09F0BE8CUL, 0x4A99A025UL, 0x1D6EFE10UL,
|
||||
0x1AB93D1DUL, 0x0BA5A4DFUL, 0xA186F20FUL, 0x2868F169UL,
|
||||
0xDCB7DA83UL, 0x573906FEUL, 0xA1E2CE9BUL, 0x4FCD7F52UL,
|
||||
0x50115E01UL, 0xA70683FAUL, 0xA002B5C4UL, 0x0DE6D027UL,
|
||||
0x9AF88C27UL, 0x773F8641UL, 0xC3604C06UL, 0x61A806B5UL,
|
||||
0xF0177A28UL, 0xC0F586E0UL, 0x006058AAUL, 0x30DC7D62UL,
|
||||
0x11E69ED7UL, 0x2338EA63UL, 0x53C2DD94UL, 0xC2C21634UL,
|
||||
0xBBCBEE56UL, 0x90BCB6DEUL, 0xEBFC7DA1UL, 0xCE591D76UL,
|
||||
0x6F05E409UL, 0x4B7C0188UL, 0x39720A3DUL, 0x7C927C24UL,
|
||||
0x86E3725FUL, 0x724D9DB9UL, 0x1AC15BB4UL, 0xD39EB8FCUL,
|
||||
0xED545578UL, 0x08FCA5B5UL, 0xD83D7CD3UL, 0x4DAD0FC4UL,
|
||||
0x1E50EF5EUL, 0xB161E6F8UL, 0xA28514D9UL, 0x6C51133CUL,
|
||||
0x6FD5C7E7UL, 0x56E14EC4UL, 0x362ABFCEUL, 0xDDC6C837UL,
|
||||
0xD79A3234UL, 0x92638212UL, 0x670EFA8EUL, 0x406000E0UL },
|
||||
{ 0x3A39CE37UL, 0xD3FAF5CFUL, 0xABC27737UL, 0x5AC52D1BUL,
|
||||
0x5CB0679EUL, 0x4FA33742UL, 0xD3822740UL, 0x99BC9BBEUL,
|
||||
0xD5118E9DUL, 0xBF0F7315UL, 0xD62D1C7EUL, 0xC700C47BUL,
|
||||
0xB78C1B6BUL, 0x21A19045UL, 0xB26EB1BEUL, 0x6A366EB4UL,
|
||||
0x5748AB2FUL, 0xBC946E79UL, 0xC6A376D2UL, 0x6549C2C8UL,
|
||||
0x530FF8EEUL, 0x468DDE7DUL, 0xD5730A1DUL, 0x4CD04DC6UL,
|
||||
0x2939BBDBUL, 0xA9BA4650UL, 0xAC9526E8UL, 0xBE5EE304UL,
|
||||
0xA1FAD5F0UL, 0x6A2D519AUL, 0x63EF8CE2UL, 0x9A86EE22UL,
|
||||
0xC089C2B8UL, 0x43242EF6UL, 0xA51E03AAUL, 0x9CF2D0A4UL,
|
||||
0x83C061BAUL, 0x9BE96A4DUL, 0x8FE51550UL, 0xBA645BD6UL,
|
||||
0x2826A2F9UL, 0xA73A3AE1UL, 0x4BA99586UL, 0xEF5562E9UL,
|
||||
0xC72FEFD3UL, 0xF752F7DAUL, 0x3F046F69UL, 0x77FA0A59UL,
|
||||
0x80E4A915UL, 0x87B08601UL, 0x9B09E6ADUL, 0x3B3EE593UL,
|
||||
0xE990FD5AUL, 0x9E34D797UL, 0x2CF0B7D9UL, 0x022B8B51UL,
|
||||
0x96D5AC3AUL, 0x017DA67DUL, 0xD1CF3ED6UL, 0x7C7D2D28UL,
|
||||
0x1F9F25CFUL, 0xADF2B89BUL, 0x5AD6B472UL, 0x5A88F54CUL,
|
||||
0xE029AC71UL, 0xE019A5E6UL, 0x47B0ACFDUL, 0xED93FA9BUL,
|
||||
0xE8D3C48DUL, 0x283B57CCUL, 0xF8D56629UL, 0x79132E28UL,
|
||||
0x785F0191UL, 0xED756055UL, 0xF7960E44UL, 0xE3D35E8CUL,
|
||||
0x15056DD4UL, 0x88F46DBAUL, 0x03A16125UL, 0x0564F0BDUL,
|
||||
0xC3EB9E15UL, 0x3C9057A2UL, 0x97271AECUL, 0xA93A072AUL,
|
||||
0x1B3F6D9BUL, 0x1E6321F5UL, 0xF59C66FBUL, 0x26DCF319UL,
|
||||
0x7533D928UL, 0xB155FDF5UL, 0x03563482UL, 0x8ABA3CBBUL,
|
||||
0x28517711UL, 0xC20AD9F8UL, 0xABCC5167UL, 0xCCAD925FUL,
|
||||
0x4DE81751UL, 0x3830DC8EUL, 0x379D5862UL, 0x9320F991UL,
|
||||
0xEA7A90C2UL, 0xFB3E7BCEUL, 0x5121CE64UL, 0x774FBE32UL,
|
||||
0xA8B6E37EUL, 0xC3293D46UL, 0x48DE5369UL, 0x6413E680UL,
|
||||
0xA2AE0810UL, 0xDD6DB224UL, 0x69852DFDUL, 0x09072166UL,
|
||||
0xB39A460AUL, 0x6445C0DDUL, 0x586CDECFUL, 0x1C20C8AEUL,
|
||||
0x5BBEF7DDUL, 0x1B588D40UL, 0xCCD2017FUL, 0x6BB4E3BBUL,
|
||||
0xDDA26A7EUL, 0x3A59FF45UL, 0x3E350A44UL, 0xBCB4CDD5UL,
|
||||
0x72EACEA8UL, 0xFA6484BBUL, 0x8D6612AEUL, 0xBF3C6F47UL,
|
||||
0xD29BE463UL, 0x542F5D9EUL, 0xAEC2771BUL, 0xF64E6370UL,
|
||||
0x740E0D8DUL, 0xE75B1357UL, 0xF8721671UL, 0xAF537D5DUL,
|
||||
0x4040CB08UL, 0x4EB4E2CCUL, 0x34D2466AUL, 0x0115AF84UL,
|
||||
0xE1B00428UL, 0x95983A1DUL, 0x06B89FB4UL, 0xCE6EA048UL,
|
||||
0x6F3F3B82UL, 0x3520AB82UL, 0x011A1D4BUL, 0x277227F8UL,
|
||||
0x611560B1UL, 0xE7933FDCUL, 0xBB3A792BUL, 0x344525BDUL,
|
||||
0xA08839E1UL, 0x51CE794BUL, 0x2F32C9B7UL, 0xA01FBAC9UL,
|
||||
0xE01CC87EUL, 0xBCC7D1F6UL, 0xCF0111C3UL, 0xA1E8AAC7UL,
|
||||
0x1A908749UL, 0xD44FBD9AUL, 0xD0DADECBUL, 0xD50ADA38UL,
|
||||
0x0339C32AUL, 0xC6913667UL, 0x8DF9317CUL, 0xE0B12B4FUL,
|
||||
0xF79E59B7UL, 0x43F5BB3AUL, 0xF2D519FFUL, 0x27D9459CUL,
|
||||
0xBF97222CUL, 0x15E6FC2AUL, 0x0F91FC71UL, 0x9B941525UL,
|
||||
0xFAE59361UL, 0xCEB69CEBUL, 0xC2A86459UL, 0x12BAA8D1UL,
|
||||
0xB6C1075EUL, 0xE3056A0CUL, 0x10D25065UL, 0xCB03A442UL,
|
||||
0xE0EC6E0EUL, 0x1698DB3BUL, 0x4C98A0BEUL, 0x3278E964UL,
|
||||
0x9F1F9532UL, 0xE0D392DFUL, 0xD3A0342BUL, 0x8971F21EUL,
|
||||
0x1B0A7441UL, 0x4BA3348CUL, 0xC5BE7120UL, 0xC37632D8UL,
|
||||
0xDF359F8DUL, 0x9B992F2EUL, 0xE60B6F47UL, 0x0FE3F11DUL,
|
||||
0xE54CDA54UL, 0x1EDAD891UL, 0xCE6279CFUL, 0xCD3E7E6FUL,
|
||||
0x1618B166UL, 0xFD2C1D05UL, 0x848FD2C5UL, 0xF6FB2299UL,
|
||||
0xF523F357UL, 0xA6327623UL, 0x93A83531UL, 0x56CCCD02UL,
|
||||
0xACF08162UL, 0x5A75EBB5UL, 0x6E163697UL, 0x88D273CCUL,
|
||||
0xDE966292UL, 0x81B949D0UL, 0x4C50901BUL, 0x71C65614UL,
|
||||
0xE6C6C7BDUL, 0x327A140AUL, 0x45E1D006UL, 0xC3F27B9AUL,
|
||||
0xC9AA53FDUL, 0x62A80F00UL, 0xBB25BFE2UL, 0x35BDD2F6UL,
|
||||
0x71126905UL, 0xB2040222UL, 0xB6CBCF7CUL, 0xCD769C2BUL,
|
||||
0x53113EC0UL, 0x1640E3D3UL, 0x38ABBD60UL, 0x2547ADF0UL,
|
||||
0xBA38209CUL, 0xF746CE76UL, 0x77AFA1C5UL, 0x20756060UL,
|
||||
0x85CBFE4EUL, 0x8AE88DD8UL, 0x7AAAF9B0UL, 0x4CF9AA7EUL,
|
||||
0x1948C25CUL, 0x02FB8A8CUL, 0x01C36AE4UL, 0xD6EBE1F9UL,
|
||||
0x90D4F869UL, 0xA65CDEA0UL, 0x3F09252DUL, 0xC208E69FUL,
|
||||
0xB74E6132UL, 0xCE77E25BUL, 0x578FDFE3UL, 0x3AC372E6UL }
|
||||
};
|
||||
|
||||
/**
|
||||
Initialize the Blowfish block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int blowfish_setup(const unsigned char *key, int keylen, int num_rounds,
|
||||
symmetric_key *skey)
|
||||
{
|
||||
ulong32 x, y, z, A;
|
||||
unsigned char B[8];
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* check key length */
|
||||
if (keylen < 8 || keylen > 56) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
/* check rounds */
|
||||
if (num_rounds != 0 && num_rounds != 16) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* load in key bytes (Supplied by David Hopwood) */
|
||||
for (x = y = 0; x < 18; x++) {
|
||||
A = 0;
|
||||
for (z = 0; z < 4; z++) {
|
||||
A = (A << 8) | ((ulong32)key[y++] & 255);
|
||||
if (y == (ulong32)keylen) {
|
||||
y = 0;
|
||||
}
|
||||
}
|
||||
skey->blowfish.K[x] = ORIG_P[x] ^ A;
|
||||
}
|
||||
|
||||
/* copy sboxes */
|
||||
for (x = 0; x < 4; x++) {
|
||||
for (y = 0; y < 256; y++) {
|
||||
skey->blowfish.S[x][y] = ORIG_S[x][y];
|
||||
}
|
||||
}
|
||||
|
||||
/* encrypt K array */
|
||||
for (x = 0; x < 8; x++) {
|
||||
B[x] = 0;
|
||||
}
|
||||
|
||||
for (x = 0; x < 18; x += 2) {
|
||||
/* encrypt it */
|
||||
blowfish_ecb_encrypt(B, B, skey);
|
||||
/* copy it */
|
||||
LOAD32H(skey->blowfish.K[x], &B[0]);
|
||||
LOAD32H(skey->blowfish.K[x+1], &B[4]);
|
||||
}
|
||||
|
||||
/* encrypt S array */
|
||||
for (x = 0; x < 4; x++) {
|
||||
for (y = 0; y < 256; y += 2) {
|
||||
/* encrypt it */
|
||||
blowfish_ecb_encrypt(B, B, skey);
|
||||
/* copy it */
|
||||
LOAD32H(skey->blowfish.S[x][y], &B[0]);
|
||||
LOAD32H(skey->blowfish.S[x][y+1], &B[4]);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(B, sizeof(B));
|
||||
#endif
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define F(x) ((S1[byte(x,3)] + S2[byte(x,2)]) ^ S3[byte(x,1)]) + S4[byte(x,0)]
|
||||
#else
|
||||
#define F(x) ((skey->blowfish.S[0][byte(x,3)] + skey->blowfish.S[1][byte(x,2)]) ^ skey->blowfish.S[2][byte(x,1)]) + skey->blowfish.S[3][byte(x,0)]
|
||||
#endif
|
||||
|
||||
/**
|
||||
Encrypts a block of text with Blowfish
|
||||
@param pt The input plaintext (8 bytes)
|
||||
@param ct The output ciphertext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#else
|
||||
int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 L, R;
|
||||
int r;
|
||||
#ifndef __GNUC__
|
||||
ulong32 *S1, *S2, *S3, *S4;
|
||||
#endif
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
#ifndef __GNUC__
|
||||
S1 = skey->blowfish.S[0];
|
||||
S2 = skey->blowfish.S[1];
|
||||
S3 = skey->blowfish.S[2];
|
||||
S4 = skey->blowfish.S[3];
|
||||
#endif
|
||||
|
||||
/* load it */
|
||||
LOAD32H(L, &pt[0]);
|
||||
LOAD32H(R, &pt[4]);
|
||||
|
||||
/* do 16 rounds */
|
||||
for (r = 0; r < 16; ) {
|
||||
L ^= skey->blowfish.K[r++]; R ^= F(L);
|
||||
R ^= skey->blowfish.K[r++]; L ^= F(R);
|
||||
L ^= skey->blowfish.K[r++]; R ^= F(L);
|
||||
R ^= skey->blowfish.K[r++]; L ^= F(R);
|
||||
}
|
||||
|
||||
/* last keying */
|
||||
R ^= skey->blowfish.K[17];
|
||||
L ^= skey->blowfish.K[16];
|
||||
|
||||
/* store */
|
||||
STORE32H(R, &ct[0]);
|
||||
STORE32H(L, &ct[4]);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
int err = _blowfish_ecb_encrypt(pt, ct, skey);
|
||||
burn_stack(sizeof(ulong32) * 2 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Decrypts a block of text with Blowfish
|
||||
@param ct The input ciphertext (8 bytes)
|
||||
@param pt The output plaintext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#else
|
||||
int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 L, R;
|
||||
int r;
|
||||
#ifndef __GNUC__
|
||||
ulong32 *S1, *S2, *S3, *S4;
|
||||
#endif
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
#ifndef __GNUC__
|
||||
S1 = skey->blowfish.S[0];
|
||||
S2 = skey->blowfish.S[1];
|
||||
S3 = skey->blowfish.S[2];
|
||||
S4 = skey->blowfish.S[3];
|
||||
#endif
|
||||
|
||||
/* load it */
|
||||
LOAD32H(R, &ct[0]);
|
||||
LOAD32H(L, &ct[4]);
|
||||
|
||||
/* undo last keying */
|
||||
R ^= skey->blowfish.K[17];
|
||||
L ^= skey->blowfish.K[16];
|
||||
|
||||
/* do 16 rounds */
|
||||
for (r = 15; r > 0; ) {
|
||||
L ^= F(R); R ^= skey->blowfish.K[r--];
|
||||
R ^= F(L); L ^= skey->blowfish.K[r--];
|
||||
L ^= F(R); R ^= skey->blowfish.K[r--];
|
||||
R ^= F(L); L ^= skey->blowfish.K[r--];
|
||||
}
|
||||
|
||||
/* store */
|
||||
STORE32H(L, &pt[0]);
|
||||
STORE32H(R, &pt[4]);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
int err = _blowfish_ecb_decrypt(ct, pt, skey);
|
||||
burn_stack(sizeof(ulong32) * 2 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
Performs a self-test of the Blowfish block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int blowfish_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
int err;
|
||||
symmetric_key key;
|
||||
static const struct {
|
||||
unsigned char key[8], pt[8], ct[8];
|
||||
} tests[] = {
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
{ 0x4E, 0xF9, 0x97, 0x45, 0x61, 0x98, 0xDD, 0x78}
|
||||
},
|
||||
{
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
|
||||
{ 0x51, 0x86, 0x6F, 0xD5, 0xB8, 0x5E, 0xCB, 0x8A}
|
||||
},
|
||||
{
|
||||
{ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
{ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
|
||||
{ 0x7D, 0x85, 0x6F, 0x9A, 0x61, 0x30, 0x63, 0xF2}
|
||||
}
|
||||
};
|
||||
unsigned char tmp[2][8];
|
||||
int x, y;
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) {
|
||||
/* setup key */
|
||||
if ((err = blowfish_setup(tests[x].key, 8, 16, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* encrypt and decrypt */
|
||||
blowfish_ecb_encrypt(tests[x].pt, tmp[0], &key);
|
||||
blowfish_ecb_decrypt(tmp[0], tmp[1], &key);
|
||||
|
||||
/* compare */
|
||||
if ((compare_testvector(tmp[0], 8, tests[x].ct, 8, "Blowfish Encrypt", x) != 0) ||
|
||||
(compare_testvector(tmp[1], 8, tests[x].pt, 8, "Blowfish Decrypt", x) != 0)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 8; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) blowfish_ecb_encrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 1000; y++) blowfish_ecb_decrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void blowfish_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int blowfish_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
|
||||
if (*keysize < 8) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else if (*keysize > 56) {
|
||||
*keysize = 56;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,726 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file camellia.c
|
||||
Implementation by Tom St Denis of Elliptic Semiconductor
|
||||
*/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_CAMELLIA
|
||||
|
||||
const struct ltc_cipher_descriptor camellia_desc = {
|
||||
"camellia",
|
||||
23,
|
||||
16, 32, 16, 18,
|
||||
&camellia_setup,
|
||||
&camellia_ecb_encrypt,
|
||||
&camellia_ecb_decrypt,
|
||||
&camellia_test,
|
||||
&camellia_done,
|
||||
&camellia_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const ulong32 SP1110[] = {
|
||||
0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, 0xb3b3b300, 0x27272700, 0xc0c0c000, 0xe5e5e500,
|
||||
0xe4e4e400, 0x85858500, 0x57575700, 0x35353500, 0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100,
|
||||
0x23232300, 0xefefef00, 0x6b6b6b00, 0x93939300, 0x45454500, 0x19191900, 0xa5a5a500, 0x21212100,
|
||||
0xededed00, 0x0e0e0e00, 0x4f4f4f00, 0x4e4e4e00, 0x1d1d1d00, 0x65656500, 0x92929200, 0xbdbdbd00,
|
||||
0x86868600, 0xb8b8b800, 0xafafaf00, 0x8f8f8f00, 0x7c7c7c00, 0xebebeb00, 0x1f1f1f00, 0xcecece00,
|
||||
0x3e3e3e00, 0x30303000, 0xdcdcdc00, 0x5f5f5f00, 0x5e5e5e00, 0xc5c5c500, 0x0b0b0b00, 0x1a1a1a00,
|
||||
0xa6a6a600, 0xe1e1e100, 0x39393900, 0xcacaca00, 0xd5d5d500, 0x47474700, 0x5d5d5d00, 0x3d3d3d00,
|
||||
0xd9d9d900, 0x01010100, 0x5a5a5a00, 0xd6d6d600, 0x51515100, 0x56565600, 0x6c6c6c00, 0x4d4d4d00,
|
||||
0x8b8b8b00, 0x0d0d0d00, 0x9a9a9a00, 0x66666600, 0xfbfbfb00, 0xcccccc00, 0xb0b0b000, 0x2d2d2d00,
|
||||
0x74747400, 0x12121200, 0x2b2b2b00, 0x20202000, 0xf0f0f000, 0xb1b1b100, 0x84848400, 0x99999900,
|
||||
0xdfdfdf00, 0x4c4c4c00, 0xcbcbcb00, 0xc2c2c200, 0x34343400, 0x7e7e7e00, 0x76767600, 0x05050500,
|
||||
0x6d6d6d00, 0xb7b7b700, 0xa9a9a900, 0x31313100, 0xd1d1d100, 0x17171700, 0x04040400, 0xd7d7d700,
|
||||
0x14141400, 0x58585800, 0x3a3a3a00, 0x61616100, 0xdedede00, 0x1b1b1b00, 0x11111100, 0x1c1c1c00,
|
||||
0x32323200, 0x0f0f0f00, 0x9c9c9c00, 0x16161600, 0x53535300, 0x18181800, 0xf2f2f200, 0x22222200,
|
||||
0xfefefe00, 0x44444400, 0xcfcfcf00, 0xb2b2b200, 0xc3c3c300, 0xb5b5b500, 0x7a7a7a00, 0x91919100,
|
||||
0x24242400, 0x08080800, 0xe8e8e800, 0xa8a8a800, 0x60606000, 0xfcfcfc00, 0x69696900, 0x50505000,
|
||||
0xaaaaaa00, 0xd0d0d000, 0xa0a0a000, 0x7d7d7d00, 0xa1a1a100, 0x89898900, 0x62626200, 0x97979700,
|
||||
0x54545400, 0x5b5b5b00, 0x1e1e1e00, 0x95959500, 0xe0e0e000, 0xffffff00, 0x64646400, 0xd2d2d200,
|
||||
0x10101000, 0xc4c4c400, 0x00000000, 0x48484800, 0xa3a3a300, 0xf7f7f700, 0x75757500, 0xdbdbdb00,
|
||||
0x8a8a8a00, 0x03030300, 0xe6e6e600, 0xdadada00, 0x09090900, 0x3f3f3f00, 0xdddddd00, 0x94949400,
|
||||
0x87878700, 0x5c5c5c00, 0x83838300, 0x02020200, 0xcdcdcd00, 0x4a4a4a00, 0x90909000, 0x33333300,
|
||||
0x73737300, 0x67676700, 0xf6f6f600, 0xf3f3f300, 0x9d9d9d00, 0x7f7f7f00, 0xbfbfbf00, 0xe2e2e200,
|
||||
0x52525200, 0x9b9b9b00, 0xd8d8d800, 0x26262600, 0xc8c8c800, 0x37373700, 0xc6c6c600, 0x3b3b3b00,
|
||||
0x81818100, 0x96969600, 0x6f6f6f00, 0x4b4b4b00, 0x13131300, 0xbebebe00, 0x63636300, 0x2e2e2e00,
|
||||
0xe9e9e900, 0x79797900, 0xa7a7a700, 0x8c8c8c00, 0x9f9f9f00, 0x6e6e6e00, 0xbcbcbc00, 0x8e8e8e00,
|
||||
0x29292900, 0xf5f5f500, 0xf9f9f900, 0xb6b6b600, 0x2f2f2f00, 0xfdfdfd00, 0xb4b4b400, 0x59595900,
|
||||
0x78787800, 0x98989800, 0x06060600, 0x6a6a6a00, 0xe7e7e700, 0x46464600, 0x71717100, 0xbababa00,
|
||||
0xd4d4d400, 0x25252500, 0xababab00, 0x42424200, 0x88888800, 0xa2a2a200, 0x8d8d8d00, 0xfafafa00,
|
||||
0x72727200, 0x07070700, 0xb9b9b900, 0x55555500, 0xf8f8f800, 0xeeeeee00, 0xacacac00, 0x0a0a0a00,
|
||||
0x36363600, 0x49494900, 0x2a2a2a00, 0x68686800, 0x3c3c3c00, 0x38383800, 0xf1f1f100, 0xa4a4a400,
|
||||
0x40404000, 0x28282800, 0xd3d3d300, 0x7b7b7b00, 0xbbbbbb00, 0xc9c9c900, 0x43434300, 0xc1c1c100,
|
||||
0x15151500, 0xe3e3e300, 0xadadad00, 0xf4f4f400, 0x77777700, 0xc7c7c700, 0x80808000, 0x9e9e9e00,
|
||||
};
|
||||
|
||||
static const ulong32 SP0222[] = {
|
||||
0x00e0e0e0, 0x00050505, 0x00585858, 0x00d9d9d9, 0x00676767, 0x004e4e4e, 0x00818181, 0x00cbcbcb,
|
||||
0x00c9c9c9, 0x000b0b0b, 0x00aeaeae, 0x006a6a6a, 0x00d5d5d5, 0x00181818, 0x005d5d5d, 0x00828282,
|
||||
0x00464646, 0x00dfdfdf, 0x00d6d6d6, 0x00272727, 0x008a8a8a, 0x00323232, 0x004b4b4b, 0x00424242,
|
||||
0x00dbdbdb, 0x001c1c1c, 0x009e9e9e, 0x009c9c9c, 0x003a3a3a, 0x00cacaca, 0x00252525, 0x007b7b7b,
|
||||
0x000d0d0d, 0x00717171, 0x005f5f5f, 0x001f1f1f, 0x00f8f8f8, 0x00d7d7d7, 0x003e3e3e, 0x009d9d9d,
|
||||
0x007c7c7c, 0x00606060, 0x00b9b9b9, 0x00bebebe, 0x00bcbcbc, 0x008b8b8b, 0x00161616, 0x00343434,
|
||||
0x004d4d4d, 0x00c3c3c3, 0x00727272, 0x00959595, 0x00ababab, 0x008e8e8e, 0x00bababa, 0x007a7a7a,
|
||||
0x00b3b3b3, 0x00020202, 0x00b4b4b4, 0x00adadad, 0x00a2a2a2, 0x00acacac, 0x00d8d8d8, 0x009a9a9a,
|
||||
0x00171717, 0x001a1a1a, 0x00353535, 0x00cccccc, 0x00f7f7f7, 0x00999999, 0x00616161, 0x005a5a5a,
|
||||
0x00e8e8e8, 0x00242424, 0x00565656, 0x00404040, 0x00e1e1e1, 0x00636363, 0x00090909, 0x00333333,
|
||||
0x00bfbfbf, 0x00989898, 0x00979797, 0x00858585, 0x00686868, 0x00fcfcfc, 0x00ececec, 0x000a0a0a,
|
||||
0x00dadada, 0x006f6f6f, 0x00535353, 0x00626262, 0x00a3a3a3, 0x002e2e2e, 0x00080808, 0x00afafaf,
|
||||
0x00282828, 0x00b0b0b0, 0x00747474, 0x00c2c2c2, 0x00bdbdbd, 0x00363636, 0x00222222, 0x00383838,
|
||||
0x00646464, 0x001e1e1e, 0x00393939, 0x002c2c2c, 0x00a6a6a6, 0x00303030, 0x00e5e5e5, 0x00444444,
|
||||
0x00fdfdfd, 0x00888888, 0x009f9f9f, 0x00656565, 0x00878787, 0x006b6b6b, 0x00f4f4f4, 0x00232323,
|
||||
0x00484848, 0x00101010, 0x00d1d1d1, 0x00515151, 0x00c0c0c0, 0x00f9f9f9, 0x00d2d2d2, 0x00a0a0a0,
|
||||
0x00555555, 0x00a1a1a1, 0x00414141, 0x00fafafa, 0x00434343, 0x00131313, 0x00c4c4c4, 0x002f2f2f,
|
||||
0x00a8a8a8, 0x00b6b6b6, 0x003c3c3c, 0x002b2b2b, 0x00c1c1c1, 0x00ffffff, 0x00c8c8c8, 0x00a5a5a5,
|
||||
0x00202020, 0x00898989, 0x00000000, 0x00909090, 0x00474747, 0x00efefef, 0x00eaeaea, 0x00b7b7b7,
|
||||
0x00151515, 0x00060606, 0x00cdcdcd, 0x00b5b5b5, 0x00121212, 0x007e7e7e, 0x00bbbbbb, 0x00292929,
|
||||
0x000f0f0f, 0x00b8b8b8, 0x00070707, 0x00040404, 0x009b9b9b, 0x00949494, 0x00212121, 0x00666666,
|
||||
0x00e6e6e6, 0x00cecece, 0x00ededed, 0x00e7e7e7, 0x003b3b3b, 0x00fefefe, 0x007f7f7f, 0x00c5c5c5,
|
||||
0x00a4a4a4, 0x00373737, 0x00b1b1b1, 0x004c4c4c, 0x00919191, 0x006e6e6e, 0x008d8d8d, 0x00767676,
|
||||
0x00030303, 0x002d2d2d, 0x00dedede, 0x00969696, 0x00262626, 0x007d7d7d, 0x00c6c6c6, 0x005c5c5c,
|
||||
0x00d3d3d3, 0x00f2f2f2, 0x004f4f4f, 0x00191919, 0x003f3f3f, 0x00dcdcdc, 0x00797979, 0x001d1d1d,
|
||||
0x00525252, 0x00ebebeb, 0x00f3f3f3, 0x006d6d6d, 0x005e5e5e, 0x00fbfbfb, 0x00696969, 0x00b2b2b2,
|
||||
0x00f0f0f0, 0x00313131, 0x000c0c0c, 0x00d4d4d4, 0x00cfcfcf, 0x008c8c8c, 0x00e2e2e2, 0x00757575,
|
||||
0x00a9a9a9, 0x004a4a4a, 0x00575757, 0x00848484, 0x00111111, 0x00454545, 0x001b1b1b, 0x00f5f5f5,
|
||||
0x00e4e4e4, 0x000e0e0e, 0x00737373, 0x00aaaaaa, 0x00f1f1f1, 0x00dddddd, 0x00595959, 0x00141414,
|
||||
0x006c6c6c, 0x00929292, 0x00545454, 0x00d0d0d0, 0x00787878, 0x00707070, 0x00e3e3e3, 0x00494949,
|
||||
0x00808080, 0x00505050, 0x00a7a7a7, 0x00f6f6f6, 0x00777777, 0x00939393, 0x00868686, 0x00838383,
|
||||
0x002a2a2a, 0x00c7c7c7, 0x005b5b5b, 0x00e9e9e9, 0x00eeeeee, 0x008f8f8f, 0x00010101, 0x003d3d3d,
|
||||
};
|
||||
|
||||
static const ulong32 SP3033[] = {
|
||||
0x38003838, 0x41004141, 0x16001616, 0x76007676, 0xd900d9d9, 0x93009393, 0x60006060, 0xf200f2f2,
|
||||
0x72007272, 0xc200c2c2, 0xab00abab, 0x9a009a9a, 0x75007575, 0x06000606, 0x57005757, 0xa000a0a0,
|
||||
0x91009191, 0xf700f7f7, 0xb500b5b5, 0xc900c9c9, 0xa200a2a2, 0x8c008c8c, 0xd200d2d2, 0x90009090,
|
||||
0xf600f6f6, 0x07000707, 0xa700a7a7, 0x27002727, 0x8e008e8e, 0xb200b2b2, 0x49004949, 0xde00dede,
|
||||
0x43004343, 0x5c005c5c, 0xd700d7d7, 0xc700c7c7, 0x3e003e3e, 0xf500f5f5, 0x8f008f8f, 0x67006767,
|
||||
0x1f001f1f, 0x18001818, 0x6e006e6e, 0xaf00afaf, 0x2f002f2f, 0xe200e2e2, 0x85008585, 0x0d000d0d,
|
||||
0x53005353, 0xf000f0f0, 0x9c009c9c, 0x65006565, 0xea00eaea, 0xa300a3a3, 0xae00aeae, 0x9e009e9e,
|
||||
0xec00ecec, 0x80008080, 0x2d002d2d, 0x6b006b6b, 0xa800a8a8, 0x2b002b2b, 0x36003636, 0xa600a6a6,
|
||||
0xc500c5c5, 0x86008686, 0x4d004d4d, 0x33003333, 0xfd00fdfd, 0x66006666, 0x58005858, 0x96009696,
|
||||
0x3a003a3a, 0x09000909, 0x95009595, 0x10001010, 0x78007878, 0xd800d8d8, 0x42004242, 0xcc00cccc,
|
||||
0xef00efef, 0x26002626, 0xe500e5e5, 0x61006161, 0x1a001a1a, 0x3f003f3f, 0x3b003b3b, 0x82008282,
|
||||
0xb600b6b6, 0xdb00dbdb, 0xd400d4d4, 0x98009898, 0xe800e8e8, 0x8b008b8b, 0x02000202, 0xeb00ebeb,
|
||||
0x0a000a0a, 0x2c002c2c, 0x1d001d1d, 0xb000b0b0, 0x6f006f6f, 0x8d008d8d, 0x88008888, 0x0e000e0e,
|
||||
0x19001919, 0x87008787, 0x4e004e4e, 0x0b000b0b, 0xa900a9a9, 0x0c000c0c, 0x79007979, 0x11001111,
|
||||
0x7f007f7f, 0x22002222, 0xe700e7e7, 0x59005959, 0xe100e1e1, 0xda00dada, 0x3d003d3d, 0xc800c8c8,
|
||||
0x12001212, 0x04000404, 0x74007474, 0x54005454, 0x30003030, 0x7e007e7e, 0xb400b4b4, 0x28002828,
|
||||
0x55005555, 0x68006868, 0x50005050, 0xbe00bebe, 0xd000d0d0, 0xc400c4c4, 0x31003131, 0xcb00cbcb,
|
||||
0x2a002a2a, 0xad00adad, 0x0f000f0f, 0xca00caca, 0x70007070, 0xff00ffff, 0x32003232, 0x69006969,
|
||||
0x08000808, 0x62006262, 0x00000000, 0x24002424, 0xd100d1d1, 0xfb00fbfb, 0xba00baba, 0xed00eded,
|
||||
0x45004545, 0x81008181, 0x73007373, 0x6d006d6d, 0x84008484, 0x9f009f9f, 0xee00eeee, 0x4a004a4a,
|
||||
0xc300c3c3, 0x2e002e2e, 0xc100c1c1, 0x01000101, 0xe600e6e6, 0x25002525, 0x48004848, 0x99009999,
|
||||
0xb900b9b9, 0xb300b3b3, 0x7b007b7b, 0xf900f9f9, 0xce00cece, 0xbf00bfbf, 0xdf00dfdf, 0x71007171,
|
||||
0x29002929, 0xcd00cdcd, 0x6c006c6c, 0x13001313, 0x64006464, 0x9b009b9b, 0x63006363, 0x9d009d9d,
|
||||
0xc000c0c0, 0x4b004b4b, 0xb700b7b7, 0xa500a5a5, 0x89008989, 0x5f005f5f, 0xb100b1b1, 0x17001717,
|
||||
0xf400f4f4, 0xbc00bcbc, 0xd300d3d3, 0x46004646, 0xcf00cfcf, 0x37003737, 0x5e005e5e, 0x47004747,
|
||||
0x94009494, 0xfa00fafa, 0xfc00fcfc, 0x5b005b5b, 0x97009797, 0xfe00fefe, 0x5a005a5a, 0xac00acac,
|
||||
0x3c003c3c, 0x4c004c4c, 0x03000303, 0x35003535, 0xf300f3f3, 0x23002323, 0xb800b8b8, 0x5d005d5d,
|
||||
0x6a006a6a, 0x92009292, 0xd500d5d5, 0x21002121, 0x44004444, 0x51005151, 0xc600c6c6, 0x7d007d7d,
|
||||
0x39003939, 0x83008383, 0xdc00dcdc, 0xaa00aaaa, 0x7c007c7c, 0x77007777, 0x56005656, 0x05000505,
|
||||
0x1b001b1b, 0xa400a4a4, 0x15001515, 0x34003434, 0x1e001e1e, 0x1c001c1c, 0xf800f8f8, 0x52005252,
|
||||
0x20002020, 0x14001414, 0xe900e9e9, 0xbd00bdbd, 0xdd00dddd, 0xe400e4e4, 0xa100a1a1, 0xe000e0e0,
|
||||
0x8a008a8a, 0xf100f1f1, 0xd600d6d6, 0x7a007a7a, 0xbb00bbbb, 0xe300e3e3, 0x40004040, 0x4f004f4f,
|
||||
};
|
||||
|
||||
static const ulong32 SP4404[] = {
|
||||
0x70700070, 0x2c2c002c, 0xb3b300b3, 0xc0c000c0, 0xe4e400e4, 0x57570057, 0xeaea00ea, 0xaeae00ae,
|
||||
0x23230023, 0x6b6b006b, 0x45450045, 0xa5a500a5, 0xeded00ed, 0x4f4f004f, 0x1d1d001d, 0x92920092,
|
||||
0x86860086, 0xafaf00af, 0x7c7c007c, 0x1f1f001f, 0x3e3e003e, 0xdcdc00dc, 0x5e5e005e, 0x0b0b000b,
|
||||
0xa6a600a6, 0x39390039, 0xd5d500d5, 0x5d5d005d, 0xd9d900d9, 0x5a5a005a, 0x51510051, 0x6c6c006c,
|
||||
0x8b8b008b, 0x9a9a009a, 0xfbfb00fb, 0xb0b000b0, 0x74740074, 0x2b2b002b, 0xf0f000f0, 0x84840084,
|
||||
0xdfdf00df, 0xcbcb00cb, 0x34340034, 0x76760076, 0x6d6d006d, 0xa9a900a9, 0xd1d100d1, 0x04040004,
|
||||
0x14140014, 0x3a3a003a, 0xdede00de, 0x11110011, 0x32320032, 0x9c9c009c, 0x53530053, 0xf2f200f2,
|
||||
0xfefe00fe, 0xcfcf00cf, 0xc3c300c3, 0x7a7a007a, 0x24240024, 0xe8e800e8, 0x60600060, 0x69690069,
|
||||
0xaaaa00aa, 0xa0a000a0, 0xa1a100a1, 0x62620062, 0x54540054, 0x1e1e001e, 0xe0e000e0, 0x64640064,
|
||||
0x10100010, 0x00000000, 0xa3a300a3, 0x75750075, 0x8a8a008a, 0xe6e600e6, 0x09090009, 0xdddd00dd,
|
||||
0x87870087, 0x83830083, 0xcdcd00cd, 0x90900090, 0x73730073, 0xf6f600f6, 0x9d9d009d, 0xbfbf00bf,
|
||||
0x52520052, 0xd8d800d8, 0xc8c800c8, 0xc6c600c6, 0x81810081, 0x6f6f006f, 0x13130013, 0x63630063,
|
||||
0xe9e900e9, 0xa7a700a7, 0x9f9f009f, 0xbcbc00bc, 0x29290029, 0xf9f900f9, 0x2f2f002f, 0xb4b400b4,
|
||||
0x78780078, 0x06060006, 0xe7e700e7, 0x71710071, 0xd4d400d4, 0xabab00ab, 0x88880088, 0x8d8d008d,
|
||||
0x72720072, 0xb9b900b9, 0xf8f800f8, 0xacac00ac, 0x36360036, 0x2a2a002a, 0x3c3c003c, 0xf1f100f1,
|
||||
0x40400040, 0xd3d300d3, 0xbbbb00bb, 0x43430043, 0x15150015, 0xadad00ad, 0x77770077, 0x80800080,
|
||||
0x82820082, 0xecec00ec, 0x27270027, 0xe5e500e5, 0x85850085, 0x35350035, 0x0c0c000c, 0x41410041,
|
||||
0xefef00ef, 0x93930093, 0x19190019, 0x21210021, 0x0e0e000e, 0x4e4e004e, 0x65650065, 0xbdbd00bd,
|
||||
0xb8b800b8, 0x8f8f008f, 0xebeb00eb, 0xcece00ce, 0x30300030, 0x5f5f005f, 0xc5c500c5, 0x1a1a001a,
|
||||
0xe1e100e1, 0xcaca00ca, 0x47470047, 0x3d3d003d, 0x01010001, 0xd6d600d6, 0x56560056, 0x4d4d004d,
|
||||
0x0d0d000d, 0x66660066, 0xcccc00cc, 0x2d2d002d, 0x12120012, 0x20200020, 0xb1b100b1, 0x99990099,
|
||||
0x4c4c004c, 0xc2c200c2, 0x7e7e007e, 0x05050005, 0xb7b700b7, 0x31310031, 0x17170017, 0xd7d700d7,
|
||||
0x58580058, 0x61610061, 0x1b1b001b, 0x1c1c001c, 0x0f0f000f, 0x16160016, 0x18180018, 0x22220022,
|
||||
0x44440044, 0xb2b200b2, 0xb5b500b5, 0x91910091, 0x08080008, 0xa8a800a8, 0xfcfc00fc, 0x50500050,
|
||||
0xd0d000d0, 0x7d7d007d, 0x89890089, 0x97970097, 0x5b5b005b, 0x95950095, 0xffff00ff, 0xd2d200d2,
|
||||
0xc4c400c4, 0x48480048, 0xf7f700f7, 0xdbdb00db, 0x03030003, 0xdada00da, 0x3f3f003f, 0x94940094,
|
||||
0x5c5c005c, 0x02020002, 0x4a4a004a, 0x33330033, 0x67670067, 0xf3f300f3, 0x7f7f007f, 0xe2e200e2,
|
||||
0x9b9b009b, 0x26260026, 0x37370037, 0x3b3b003b, 0x96960096, 0x4b4b004b, 0xbebe00be, 0x2e2e002e,
|
||||
0x79790079, 0x8c8c008c, 0x6e6e006e, 0x8e8e008e, 0xf5f500f5, 0xb6b600b6, 0xfdfd00fd, 0x59590059,
|
||||
0x98980098, 0x6a6a006a, 0x46460046, 0xbaba00ba, 0x25250025, 0x42420042, 0xa2a200a2, 0xfafa00fa,
|
||||
0x07070007, 0x55550055, 0xeeee00ee, 0x0a0a000a, 0x49490049, 0x68680068, 0x38380038, 0xa4a400a4,
|
||||
0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e,
|
||||
};
|
||||
|
||||
static const ulong64 key_sigma[] = {
|
||||
CONST64(0xA09E667F3BCC908B),
|
||||
CONST64(0xB67AE8584CAA73B2),
|
||||
CONST64(0xC6EF372FE94F82BE),
|
||||
CONST64(0x54FF53A5F1D36F1C),
|
||||
CONST64(0x10E527FADE682D1D),
|
||||
CONST64(0xB05688C2B3E6C1FD)
|
||||
};
|
||||
|
||||
static ulong64 F(ulong64 x)
|
||||
{
|
||||
ulong32 D, U;
|
||||
|
||||
#define loc(i) ((8-i)*8)
|
||||
|
||||
D = SP1110[(x >> loc(8)) & 0xFF] ^ SP0222[(x >> loc(5)) & 0xFF] ^ SP3033[(x >> loc(6)) & 0xFF] ^ SP4404[(x >> loc(7)) & 0xFF];
|
||||
U = SP1110[(x >> loc(1)) & 0xFF] ^ SP0222[(x >> loc(2)) & 0xFF] ^ SP3033[(x >> loc(3)) & 0xFF] ^ SP4404[(x >> loc(4)) & 0xFF];
|
||||
|
||||
D ^= U;
|
||||
U = D ^ RORc(U, 8);
|
||||
|
||||
return ((ulong64)U) | (((ulong64)D) << CONST64(32));
|
||||
}
|
||||
|
||||
static void rot_128(unsigned char *in, unsigned count, unsigned char *out)
|
||||
{
|
||||
unsigned x, w, b;
|
||||
|
||||
w = count >> 3;
|
||||
b = count & 7;
|
||||
|
||||
for (x = 0; x < 16; x++) {
|
||||
out[x] = (in[(x+w)&15] << b) | (in[(x+w+1)&15] >> (8 - b));
|
||||
}
|
||||
}
|
||||
|
||||
int camellia_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
unsigned char T[48], kA[16], kB[16], kR[16], kL[16];
|
||||
int x;
|
||||
ulong64 A, B;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* Valid sizes (in bytes) are 16, 24, 32 */
|
||||
if (keylen != 16 && keylen != 24 && keylen != 32) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
/* number of rounds */
|
||||
skey->camellia.R = (keylen == 16) ? 18 : 24;
|
||||
|
||||
if (num_rounds != 0 && num_rounds != skey->camellia.R) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* expand key */
|
||||
if (keylen == 16) {
|
||||
for (x = 0; x < 16; x++) {
|
||||
T[x] = key[x];
|
||||
T[x + 16] = 0;
|
||||
}
|
||||
} else if (keylen == 24) {
|
||||
for (x = 0; x < 24; x++) {
|
||||
T[x] = key[x];
|
||||
}
|
||||
for (x = 24; x < 32; x++) {
|
||||
T[x] = key[x-8] ^ 0xFF;
|
||||
}
|
||||
} else {
|
||||
for (x = 0; x < 32; x++) {
|
||||
T[x] = key[x];
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 0; x < 16; x++) {
|
||||
kL[x] = T[x];
|
||||
kR[x] = T[x + 16];
|
||||
}
|
||||
|
||||
for (x = 32; x < 48; x++) {
|
||||
T[x] = T[x - 32] ^ T[x - 16];
|
||||
}
|
||||
|
||||
/* first two rounds */
|
||||
LOAD64H(A, T+32); LOAD64H(B, T+40);
|
||||
B ^= F(A ^ key_sigma[0]);
|
||||
A ^= F(B ^ key_sigma[1]);
|
||||
STORE64H(A, T+32); STORE64H(B, T+40);
|
||||
|
||||
/* xor kL in */
|
||||
for (x = 0; x < 16; x++) { T[x+32] ^= kL[x]; }
|
||||
|
||||
/* next two rounds */
|
||||
LOAD64H(A, T+32); LOAD64H(B, T+40);
|
||||
B ^= F(A ^ key_sigma[2]);
|
||||
A ^= F(B ^ key_sigma[3]);
|
||||
STORE64H(A, T+32); STORE64H(B, T+40);
|
||||
|
||||
/* grab KA */
|
||||
for (x = 0; x < 16; x++) { kA[x] = T[x+32]; }
|
||||
|
||||
/* xor kR in */
|
||||
for (x = 0; x < 16; x++) { T[x+32] ^= kR[x]; }
|
||||
|
||||
if (keylen == 16) {
|
||||
/* grab whitening keys kw1 and kw2 */
|
||||
LOAD64H(skey->camellia.kw[0], kL);
|
||||
LOAD64H(skey->camellia.kw[1], kL+8);
|
||||
|
||||
/* k1-k2 */
|
||||
LOAD64H(skey->camellia.k[0], kA);
|
||||
LOAD64H(skey->camellia.k[1], kA+8);
|
||||
|
||||
/* rotate kL by 15, k3/k4 */
|
||||
rot_128(kL, 15, T+32);
|
||||
LOAD64H(skey->camellia.k[2], T+32);
|
||||
LOAD64H(skey->camellia.k[3], T+40);
|
||||
|
||||
/* rotate kA by 15, k5/k6 */
|
||||
rot_128(kA, 15, T+32);
|
||||
LOAD64H(skey->camellia.k[4], T+32);
|
||||
LOAD64H(skey->camellia.k[5], T+40);
|
||||
|
||||
/* rotate kA by 30, kl1, kl2 */
|
||||
rot_128(kA, 30, T+32);
|
||||
LOAD64H(skey->camellia.kl[0], T+32);
|
||||
LOAD64H(skey->camellia.kl[1], T+40);
|
||||
|
||||
/* rotate kL by 45, k7/k8 */
|
||||
rot_128(kL, 45, T+32);
|
||||
LOAD64H(skey->camellia.k[6], T+32);
|
||||
LOAD64H(skey->camellia.k[7], T+40);
|
||||
|
||||
/* rotate kA by 45, k9/k10 */
|
||||
rot_128(kA, 45, T+32);
|
||||
LOAD64H(skey->camellia.k[8], T+32);
|
||||
rot_128(kL, 60, T+32);
|
||||
LOAD64H(skey->camellia.k[9], T+40);
|
||||
|
||||
/* rotate kA by 60, k11/k12 */
|
||||
rot_128(kA, 60, T+32);
|
||||
LOAD64H(skey->camellia.k[10], T+32);
|
||||
LOAD64H(skey->camellia.k[11], T+40);
|
||||
|
||||
/* rotate kL by 77, kl3, kl4 */
|
||||
rot_128(kL, 77, T+32);
|
||||
LOAD64H(skey->camellia.kl[2], T+32);
|
||||
LOAD64H(skey->camellia.kl[3], T+40);
|
||||
|
||||
/* rotate kL by 94, k13/k14 */
|
||||
rot_128(kL, 94, T+32);
|
||||
LOAD64H(skey->camellia.k[12], T+32);
|
||||
LOAD64H(skey->camellia.k[13], T+40);
|
||||
|
||||
/* rotate kA by 94, k15/k16 */
|
||||
rot_128(kA, 94, T+32);
|
||||
LOAD64H(skey->camellia.k[14], T+32);
|
||||
LOAD64H(skey->camellia.k[15], T+40);
|
||||
|
||||
/* rotate kL by 111, k17/k18 */
|
||||
rot_128(kL, 111, T+32);
|
||||
LOAD64H(skey->camellia.k[16], T+32);
|
||||
LOAD64H(skey->camellia.k[17], T+40);
|
||||
|
||||
/* rotate kA by 111, kw3/kw4 */
|
||||
rot_128(kA, 111, T+32);
|
||||
LOAD64H(skey->camellia.kw[2], T+32);
|
||||
LOAD64H(skey->camellia.kw[3], T+40);
|
||||
} else {
|
||||
/* last two rounds */
|
||||
LOAD64H(A, T+32); LOAD64H(B, T+40);
|
||||
B ^= F(A ^ key_sigma[4]);
|
||||
A ^= F(B ^ key_sigma[5]);
|
||||
STORE64H(A, T+32); STORE64H(B, T+40);
|
||||
|
||||
/* grab kB */
|
||||
for (x = 0; x < 16; x++) { kB[x] = T[x+32]; }
|
||||
|
||||
/* kw1/2 from kL*/
|
||||
LOAD64H(skey->camellia.kw[0], kL);
|
||||
LOAD64H(skey->camellia.kw[1], kL+8);
|
||||
|
||||
/* k1/k2 = kB */
|
||||
LOAD64H(skey->camellia.k[0], kB);
|
||||
LOAD64H(skey->camellia.k[1], kB+8);
|
||||
|
||||
/* k3/k4 = kR by 15 */
|
||||
rot_128(kR, 15, T+32);
|
||||
LOAD64H(skey->camellia.k[2], T+32);
|
||||
LOAD64H(skey->camellia.k[3], T+40);
|
||||
|
||||
/* k5/k7 = kA by 15 */
|
||||
rot_128(kA, 15, T+32);
|
||||
LOAD64H(skey->camellia.k[4], T+32);
|
||||
LOAD64H(skey->camellia.k[5], T+40);
|
||||
|
||||
/* kl1/2 = kR by 30 */
|
||||
rot_128(kR, 30, T+32);
|
||||
LOAD64H(skey->camellia.kl[0], T+32);
|
||||
LOAD64H(skey->camellia.kl[1], T+40);
|
||||
|
||||
/* k7/k8 = kB by 30 */
|
||||
rot_128(kB, 30, T+32);
|
||||
LOAD64H(skey->camellia.k[6], T+32);
|
||||
LOAD64H(skey->camellia.k[7], T+40);
|
||||
|
||||
/* k9/k10 = kL by 45 */
|
||||
rot_128(kL, 45, T+32);
|
||||
LOAD64H(skey->camellia.k[8], T+32);
|
||||
LOAD64H(skey->camellia.k[9], T+40);
|
||||
|
||||
/* k11/k12 = kA by 45 */
|
||||
rot_128(kA, 45, T+32);
|
||||
LOAD64H(skey->camellia.k[10], T+32);
|
||||
LOAD64H(skey->camellia.k[11], T+40);
|
||||
|
||||
/* kl3/4 = kL by 60 */
|
||||
rot_128(kL, 60, T+32);
|
||||
LOAD64H(skey->camellia.kl[2], T+32);
|
||||
LOAD64H(skey->camellia.kl[3], T+40);
|
||||
|
||||
/* k13/k14 = kR by 60 */
|
||||
rot_128(kR, 60, T+32);
|
||||
LOAD64H(skey->camellia.k[12], T+32);
|
||||
LOAD64H(skey->camellia.k[13], T+40);
|
||||
|
||||
/* k15/k16 = kB by 15 */
|
||||
rot_128(kB, 60, T+32);
|
||||
LOAD64H(skey->camellia.k[14], T+32);
|
||||
LOAD64H(skey->camellia.k[15], T+40);
|
||||
|
||||
/* k17/k18 = kL by 77 */
|
||||
rot_128(kL, 77, T+32);
|
||||
LOAD64H(skey->camellia.k[16], T+32);
|
||||
LOAD64H(skey->camellia.k[17], T+40);
|
||||
|
||||
/* kl5/6 = kA by 77 */
|
||||
rot_128(kA, 77, T+32);
|
||||
LOAD64H(skey->camellia.kl[4], T+32);
|
||||
LOAD64H(skey->camellia.kl[5], T+40);
|
||||
|
||||
/* k19/k20 = kR by 94 */
|
||||
rot_128(kR, 94, T+32);
|
||||
LOAD64H(skey->camellia.k[18], T+32);
|
||||
LOAD64H(skey->camellia.k[19], T+40);
|
||||
|
||||
/* k21/k22 = kA by 94 */
|
||||
rot_128(kA, 94, T+32);
|
||||
LOAD64H(skey->camellia.k[20], T+32);
|
||||
LOAD64H(skey->camellia.k[21], T+40);
|
||||
|
||||
/* k23/k24 = kL by 111 */
|
||||
rot_128(kL, 111, T+32);
|
||||
LOAD64H(skey->camellia.k[22], T+32);
|
||||
LOAD64H(skey->camellia.k[23], T+40);
|
||||
|
||||
/* kw2/kw3 = kB by 111 */
|
||||
rot_128(kB, 111, T+32);
|
||||
LOAD64H(skey->camellia.kw[2], T+32);
|
||||
LOAD64H(skey->camellia.kw[3], T+40);
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int camellia_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
ulong64 L, R;
|
||||
ulong32 a, b;
|
||||
|
||||
LOAD64H(L, pt+0); LOAD64H(R, pt+8);
|
||||
L ^= skey->camellia.kw[0];
|
||||
R ^= skey->camellia.kw[1];
|
||||
|
||||
/* first 6 rounds */
|
||||
R ^= F(L ^ skey->camellia.k[0]);
|
||||
L ^= F(R ^ skey->camellia.k[1]);
|
||||
R ^= F(L ^ skey->camellia.k[2]);
|
||||
L ^= F(R ^ skey->camellia.k[3]);
|
||||
R ^= F(L ^ skey->camellia.k[4]);
|
||||
L ^= F(R ^ skey->camellia.k[5]);
|
||||
|
||||
/* FL */
|
||||
a = (ulong32)(L >> 32);
|
||||
b = (ulong32)(L & 0xFFFFFFFFUL);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[0] >> 32)), 1);
|
||||
a ^= b | (skey->camellia.kl[0] & 0xFFFFFFFFU);
|
||||
L = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* FL^-1 */
|
||||
a = (ulong32)(R >> 32);
|
||||
b = (ulong32)(R & 0xFFFFFFFFUL);
|
||||
a ^= b | (skey->camellia.kl[1] & 0xFFFFFFFFU);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[1] >> 32)), 1);
|
||||
R = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* second 6 rounds */
|
||||
R ^= F(L ^ skey->camellia.k[6]);
|
||||
L ^= F(R ^ skey->camellia.k[7]);
|
||||
R ^= F(L ^ skey->camellia.k[8]);
|
||||
L ^= F(R ^ skey->camellia.k[9]);
|
||||
R ^= F(L ^ skey->camellia.k[10]);
|
||||
L ^= F(R ^ skey->camellia.k[11]);
|
||||
|
||||
/* FL */
|
||||
a = (ulong32)(L >> 32);
|
||||
b = (ulong32)(L & 0xFFFFFFFFUL);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[2] >> 32)), 1);
|
||||
a ^= b | (skey->camellia.kl[2] & 0xFFFFFFFFU);
|
||||
L = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* FL^-1 */
|
||||
a = (ulong32)(R >> 32);
|
||||
b = (ulong32)(R & 0xFFFFFFFFUL);
|
||||
a ^= b | (skey->camellia.kl[3] & 0xFFFFFFFFU);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[3] >> 32)), 1);
|
||||
R = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* third 6 rounds */
|
||||
R ^= F(L ^ skey->camellia.k[12]);
|
||||
L ^= F(R ^ skey->camellia.k[13]);
|
||||
R ^= F(L ^ skey->camellia.k[14]);
|
||||
L ^= F(R ^ skey->camellia.k[15]);
|
||||
R ^= F(L ^ skey->camellia.k[16]);
|
||||
L ^= F(R ^ skey->camellia.k[17]);
|
||||
|
||||
/* next FL */
|
||||
if (skey->camellia.R == 24) {
|
||||
/* FL */
|
||||
a = (ulong32)(L >> 32);
|
||||
b = (ulong32)(L & 0xFFFFFFFFUL);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[4] >> 32)), 1);
|
||||
a ^= b | (skey->camellia.kl[4] & 0xFFFFFFFFU);
|
||||
L = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* FL^-1 */
|
||||
a = (ulong32)(R >> 32);
|
||||
b = (ulong32)(R & 0xFFFFFFFFUL);
|
||||
a ^= b | (skey->camellia.kl[5] & 0xFFFFFFFFU);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[5] >> 32)), 1);
|
||||
R = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* fourth 6 rounds */
|
||||
R ^= F(L ^ skey->camellia.k[18]);
|
||||
L ^= F(R ^ skey->camellia.k[19]);
|
||||
R ^= F(L ^ skey->camellia.k[20]);
|
||||
L ^= F(R ^ skey->camellia.k[21]);
|
||||
R ^= F(L ^ skey->camellia.k[22]);
|
||||
L ^= F(R ^ skey->camellia.k[23]);
|
||||
}
|
||||
|
||||
L ^= skey->camellia.kw[3];
|
||||
R ^= skey->camellia.kw[2];
|
||||
|
||||
STORE64H(R, ct+0); STORE64H(L, ct+8);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int camellia_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
ulong64 L, R;
|
||||
ulong32 a, b;
|
||||
|
||||
LOAD64H(R, ct+0); LOAD64H(L, ct+8);
|
||||
L ^= skey->camellia.kw[3];
|
||||
R ^= skey->camellia.kw[2];
|
||||
|
||||
/* next FL */
|
||||
if (skey->camellia.R == 24) {
|
||||
/* fourth 6 rounds */
|
||||
L ^= F(R ^ skey->camellia.k[23]);
|
||||
R ^= F(L ^ skey->camellia.k[22]);
|
||||
L ^= F(R ^ skey->camellia.k[21]);
|
||||
R ^= F(L ^ skey->camellia.k[20]);
|
||||
L ^= F(R ^ skey->camellia.k[19]);
|
||||
R ^= F(L ^ skey->camellia.k[18]);
|
||||
|
||||
/* FL */
|
||||
a = (ulong32)(L >> 32);
|
||||
b = (ulong32)(L & 0xFFFFFFFFUL);
|
||||
a ^= b | (skey->camellia.kl[4] & 0xFFFFFFFFU);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[4] >> 32)), 1);
|
||||
L = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* FL^-1 */
|
||||
a = (ulong32)(R >> 32);
|
||||
b = (ulong32)(R & 0xFFFFFFFFUL);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[5] >> 32)), 1);
|
||||
a ^= b | (skey->camellia.kl[5] & 0xFFFFFFFFU);
|
||||
R = (((ulong64)a) << 32) | b;
|
||||
|
||||
}
|
||||
|
||||
/* third 6 rounds */
|
||||
L ^= F(R ^ skey->camellia.k[17]);
|
||||
R ^= F(L ^ skey->camellia.k[16]);
|
||||
L ^= F(R ^ skey->camellia.k[15]);
|
||||
R ^= F(L ^ skey->camellia.k[14]);
|
||||
L ^= F(R ^ skey->camellia.k[13]);
|
||||
R ^= F(L ^ skey->camellia.k[12]);
|
||||
|
||||
/* FL */
|
||||
a = (ulong32)(L >> 32);
|
||||
b = (ulong32)(L & 0xFFFFFFFFUL);
|
||||
a ^= b | (skey->camellia.kl[2] & 0xFFFFFFFFU);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[2] >> 32)), 1);
|
||||
L = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* FL^-1 */
|
||||
a = (ulong32)(R >> 32);
|
||||
b = (ulong32)(R & 0xFFFFFFFFUL);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[3] >> 32)), 1);
|
||||
a ^= b | (skey->camellia.kl[3] & 0xFFFFFFFFU);
|
||||
R = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* second 6 rounds */
|
||||
L ^= F(R ^ skey->camellia.k[11]);
|
||||
R ^= F(L ^ skey->camellia.k[10]);
|
||||
L ^= F(R ^ skey->camellia.k[9]);
|
||||
R ^= F(L ^ skey->camellia.k[8]);
|
||||
L ^= F(R ^ skey->camellia.k[7]);
|
||||
R ^= F(L ^ skey->camellia.k[6]);
|
||||
|
||||
/* FL */
|
||||
a = (ulong32)(L >> 32);
|
||||
b = (ulong32)(L & 0xFFFFFFFFUL);
|
||||
a ^= b | (skey->camellia.kl[0] & 0xFFFFFFFFU);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[0] >> 32)), 1);
|
||||
L = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* FL^-1 */
|
||||
a = (ulong32)(R >> 32);
|
||||
b = (ulong32)(R & 0xFFFFFFFFUL);
|
||||
b ^= ROL((a & (ulong32)(skey->camellia.kl[1] >> 32)), 1);
|
||||
a ^= b | (skey->camellia.kl[1] & 0xFFFFFFFFU);
|
||||
R = (((ulong64)a) << 32) | b;
|
||||
|
||||
/* first 6 rounds */
|
||||
L ^= F(R ^ skey->camellia.k[5]);
|
||||
R ^= F(L ^ skey->camellia.k[4]);
|
||||
L ^= F(R ^ skey->camellia.k[3]);
|
||||
R ^= F(L ^ skey->camellia.k[2]);
|
||||
L ^= F(R ^ skey->camellia.k[1]);
|
||||
R ^= F(L ^ skey->camellia.k[0]);
|
||||
|
||||
R ^= skey->camellia.kw[1];
|
||||
L ^= skey->camellia.kw[0];
|
||||
|
||||
STORE64H(R, pt+8); STORE64H(L, pt+0);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int camellia_test(void)
|
||||
{
|
||||
static const struct {
|
||||
int keylen;
|
||||
unsigned char key[32], pt[16], ct[16];
|
||||
} tests[] = {
|
||||
|
||||
{
|
||||
16,
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
|
||||
{ 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73,
|
||||
0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43 }
|
||||
},
|
||||
|
||||
{
|
||||
24,
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
|
||||
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 },
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
|
||||
{ 0xb4, 0x99, 0x34, 0x01, 0xb3, 0xe9, 0x96, 0xf8,
|
||||
0x4e, 0xe5, 0xce, 0xe7, 0xd7, 0x9b, 0x09, 0xb9 }
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
32,
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
|
||||
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
|
||||
{ 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c,
|
||||
0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09 }
|
||||
},
|
||||
|
||||
{
|
||||
32,
|
||||
{ 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE,
|
||||
0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81,
|
||||
0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7,
|
||||
0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 },
|
||||
{ 0xF6, 0x9F, 0x24, 0x45, 0xDF, 0x4F, 0x9B, 0x17,
|
||||
0xAD, 0x2B, 0x41, 0x7B, 0xE6, 0x6C, 0x37, 0x10 },
|
||||
{ 0x79, 0x60, 0x10, 0x9F, 0xB6, 0xDC, 0x42, 0x94,
|
||||
0x7F, 0xCF, 0xE5, 0x9E, 0xA3, 0xC5, 0xEB, 0x6B }
|
||||
}
|
||||
};
|
||||
unsigned char buf[2][16];
|
||||
symmetric_key skey;
|
||||
int err;
|
||||
unsigned int x;
|
||||
|
||||
for (x = 0; x < sizeof(tests)/sizeof(tests[0]); x++) {
|
||||
zeromem(&skey, sizeof(skey));
|
||||
if ((err = camellia_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = camellia_ecb_encrypt(tests[x].pt, buf[0], &skey)) != CRYPT_OK) {
|
||||
camellia_done(&skey);
|
||||
return err;
|
||||
}
|
||||
if ((err = camellia_ecb_decrypt(tests[x].ct, buf[1], &skey)) != CRYPT_OK) {
|
||||
camellia_done(&skey);
|
||||
return err;
|
||||
}
|
||||
camellia_done(&skey);
|
||||
if (compare_testvector(tests[x].ct, 16, buf[0], 16, "Camellia Encrypt", x) ||
|
||||
compare_testvector(tests[x].pt, 16, buf[1], 16, "Camellia Decrypt", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
void camellia_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
int camellia_keysize(int *keysize)
|
||||
{
|
||||
if (*keysize >= 32) { *keysize = 32; }
|
||||
else if (*keysize >= 24) { *keysize = 24; }
|
||||
else if (*keysize >= 16) { *keysize = 16; }
|
||||
else return CRYPT_INVALID_KEYSIZE;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,720 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file cast5.c
|
||||
Implementation of LTC_CAST5 (RFC 2144) by Tom St Denis
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_CAST5
|
||||
|
||||
const struct ltc_cipher_descriptor cast5_desc = {
|
||||
"cast5",
|
||||
15,
|
||||
5, 16, 8, 16,
|
||||
&cast5_setup,
|
||||
&cast5_ecb_encrypt,
|
||||
&cast5_ecb_decrypt,
|
||||
&cast5_test,
|
||||
&cast5_done,
|
||||
&cast5_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const ulong32 S1[256] = {
|
||||
0x30fb40d4UL, 0x9fa0ff0bUL, 0x6beccd2fUL, 0x3f258c7aUL, 0x1e213f2fUL, 0x9c004dd3UL,
|
||||
0x6003e540UL, 0xcf9fc949UL, 0xbfd4af27UL, 0x88bbbdb5UL, 0xe2034090UL, 0x98d09675UL,
|
||||
0x6e63a0e0UL, 0x15c361d2UL, 0xc2e7661dUL, 0x22d4ff8eUL, 0x28683b6fUL, 0xc07fd059UL,
|
||||
0xff2379c8UL, 0x775f50e2UL, 0x43c340d3UL, 0xdf2f8656UL, 0x887ca41aUL, 0xa2d2bd2dUL,
|
||||
0xa1c9e0d6UL, 0x346c4819UL, 0x61b76d87UL, 0x22540f2fUL, 0x2abe32e1UL, 0xaa54166bUL,
|
||||
0x22568e3aUL, 0xa2d341d0UL, 0x66db40c8UL, 0xa784392fUL, 0x004dff2fUL, 0x2db9d2deUL,
|
||||
0x97943facUL, 0x4a97c1d8UL, 0x527644b7UL, 0xb5f437a7UL, 0xb82cbaefUL, 0xd751d159UL,
|
||||
0x6ff7f0edUL, 0x5a097a1fUL, 0x827b68d0UL, 0x90ecf52eUL, 0x22b0c054UL, 0xbc8e5935UL,
|
||||
0x4b6d2f7fUL, 0x50bb64a2UL, 0xd2664910UL, 0xbee5812dUL, 0xb7332290UL, 0xe93b159fUL,
|
||||
0xb48ee411UL, 0x4bff345dUL, 0xfd45c240UL, 0xad31973fUL, 0xc4f6d02eUL, 0x55fc8165UL,
|
||||
0xd5b1caadUL, 0xa1ac2daeUL, 0xa2d4b76dUL, 0xc19b0c50UL, 0x882240f2UL, 0x0c6e4f38UL,
|
||||
0xa4e4bfd7UL, 0x4f5ba272UL, 0x564c1d2fUL, 0xc59c5319UL, 0xb949e354UL, 0xb04669feUL,
|
||||
0xb1b6ab8aUL, 0xc71358ddUL, 0x6385c545UL, 0x110f935dUL, 0x57538ad5UL, 0x6a390493UL,
|
||||
0xe63d37e0UL, 0x2a54f6b3UL, 0x3a787d5fUL, 0x6276a0b5UL, 0x19a6fcdfUL, 0x7a42206aUL,
|
||||
0x29f9d4d5UL, 0xf61b1891UL, 0xbb72275eUL, 0xaa508167UL, 0x38901091UL, 0xc6b505ebUL,
|
||||
0x84c7cb8cUL, 0x2ad75a0fUL, 0x874a1427UL, 0xa2d1936bUL, 0x2ad286afUL, 0xaa56d291UL,
|
||||
0xd7894360UL, 0x425c750dUL, 0x93b39e26UL, 0x187184c9UL, 0x6c00b32dUL, 0x73e2bb14UL,
|
||||
0xa0bebc3cUL, 0x54623779UL, 0x64459eabUL, 0x3f328b82UL, 0x7718cf82UL, 0x59a2cea6UL,
|
||||
0x04ee002eUL, 0x89fe78e6UL, 0x3fab0950UL, 0x325ff6c2UL, 0x81383f05UL, 0x6963c5c8UL,
|
||||
0x76cb5ad6UL, 0xd49974c9UL, 0xca180dcfUL, 0x380782d5UL, 0xc7fa5cf6UL, 0x8ac31511UL,
|
||||
0x35e79e13UL, 0x47da91d0UL, 0xf40f9086UL, 0xa7e2419eUL, 0x31366241UL, 0x051ef495UL,
|
||||
0xaa573b04UL, 0x4a805d8dUL, 0x548300d0UL, 0x00322a3cUL, 0xbf64cddfUL, 0xba57a68eUL,
|
||||
0x75c6372bUL, 0x50afd341UL, 0xa7c13275UL, 0x915a0bf5UL, 0x6b54bfabUL, 0x2b0b1426UL,
|
||||
0xab4cc9d7UL, 0x449ccd82UL, 0xf7fbf265UL, 0xab85c5f3UL, 0x1b55db94UL, 0xaad4e324UL,
|
||||
0xcfa4bd3fUL, 0x2deaa3e2UL, 0x9e204d02UL, 0xc8bd25acUL, 0xeadf55b3UL, 0xd5bd9e98UL,
|
||||
0xe31231b2UL, 0x2ad5ad6cUL, 0x954329deUL, 0xadbe4528UL, 0xd8710f69UL, 0xaa51c90fUL,
|
||||
0xaa786bf6UL, 0x22513f1eUL, 0xaa51a79bUL, 0x2ad344ccUL, 0x7b5a41f0UL, 0xd37cfbadUL,
|
||||
0x1b069505UL, 0x41ece491UL, 0xb4c332e6UL, 0x032268d4UL, 0xc9600accUL, 0xce387e6dUL,
|
||||
0xbf6bb16cUL, 0x6a70fb78UL, 0x0d03d9c9UL, 0xd4df39deUL, 0xe01063daUL, 0x4736f464UL,
|
||||
0x5ad328d8UL, 0xb347cc96UL, 0x75bb0fc3UL, 0x98511bfbUL, 0x4ffbcc35UL, 0xb58bcf6aUL,
|
||||
0xe11f0abcUL, 0xbfc5fe4aUL, 0xa70aec10UL, 0xac39570aUL, 0x3f04442fUL, 0x6188b153UL,
|
||||
0xe0397a2eUL, 0x5727cb79UL, 0x9ceb418fUL, 0x1cacd68dUL, 0x2ad37c96UL, 0x0175cb9dUL,
|
||||
0xc69dff09UL, 0xc75b65f0UL, 0xd9db40d8UL, 0xec0e7779UL, 0x4744ead4UL, 0xb11c3274UL,
|
||||
0xdd24cb9eUL, 0x7e1c54bdUL, 0xf01144f9UL, 0xd2240eb1UL, 0x9675b3fdUL, 0xa3ac3755UL,
|
||||
0xd47c27afUL, 0x51c85f4dUL, 0x56907596UL, 0xa5bb15e6UL, 0x580304f0UL, 0xca042cf1UL,
|
||||
0x011a37eaUL, 0x8dbfaadbUL, 0x35ba3e4aUL, 0x3526ffa0UL, 0xc37b4d09UL, 0xbc306ed9UL,
|
||||
0x98a52666UL, 0x5648f725UL, 0xff5e569dUL, 0x0ced63d0UL, 0x7c63b2cfUL, 0x700b45e1UL,
|
||||
0xd5ea50f1UL, 0x85a92872UL, 0xaf1fbda7UL, 0xd4234870UL, 0xa7870bf3UL, 0x2d3b4d79UL,
|
||||
0x42e04198UL, 0x0cd0ede7UL, 0x26470db8UL, 0xf881814cUL, 0x474d6ad7UL, 0x7c0c5e5cUL,
|
||||
0xd1231959UL, 0x381b7298UL, 0xf5d2f4dbUL, 0xab838653UL, 0x6e2f1e23UL, 0x83719c9eUL,
|
||||
0xbd91e046UL, 0x9a56456eUL, 0xdc39200cUL, 0x20c8c571UL, 0x962bda1cUL, 0xe1e696ffUL,
|
||||
0xb141ab08UL, 0x7cca89b9UL, 0x1a69e783UL, 0x02cc4843UL, 0xa2f7c579UL, 0x429ef47dUL,
|
||||
0x427b169cUL, 0x5ac9f049UL, 0xdd8f0f00UL, 0x5c8165bfUL};
|
||||
|
||||
static const ulong32 S2[256] = {
|
||||
0x1f201094UL, 0xef0ba75bUL, 0x69e3cf7eUL, 0x393f4380UL, 0xfe61cf7aUL, 0xeec5207aUL,
|
||||
0x55889c94UL, 0x72fc0651UL, 0xada7ef79UL, 0x4e1d7235UL, 0xd55a63ceUL, 0xde0436baUL,
|
||||
0x99c430efUL, 0x5f0c0794UL, 0x18dcdb7dUL, 0xa1d6eff3UL, 0xa0b52f7bUL, 0x59e83605UL,
|
||||
0xee15b094UL, 0xe9ffd909UL, 0xdc440086UL, 0xef944459UL, 0xba83ccb3UL, 0xe0c3cdfbUL,
|
||||
0xd1da4181UL, 0x3b092ab1UL, 0xf997f1c1UL, 0xa5e6cf7bUL, 0x01420ddbUL, 0xe4e7ef5bUL,
|
||||
0x25a1ff41UL, 0xe180f806UL, 0x1fc41080UL, 0x179bee7aUL, 0xd37ac6a9UL, 0xfe5830a4UL,
|
||||
0x98de8b7fUL, 0x77e83f4eUL, 0x79929269UL, 0x24fa9f7bUL, 0xe113c85bUL, 0xacc40083UL,
|
||||
0xd7503525UL, 0xf7ea615fUL, 0x62143154UL, 0x0d554b63UL, 0x5d681121UL, 0xc866c359UL,
|
||||
0x3d63cf73UL, 0xcee234c0UL, 0xd4d87e87UL, 0x5c672b21UL, 0x071f6181UL, 0x39f7627fUL,
|
||||
0x361e3084UL, 0xe4eb573bUL, 0x602f64a4UL, 0xd63acd9cUL, 0x1bbc4635UL, 0x9e81032dUL,
|
||||
0x2701f50cUL, 0x99847ab4UL, 0xa0e3df79UL, 0xba6cf38cUL, 0x10843094UL, 0x2537a95eUL,
|
||||
0xf46f6ffeUL, 0xa1ff3b1fUL, 0x208cfb6aUL, 0x8f458c74UL, 0xd9e0a227UL, 0x4ec73a34UL,
|
||||
0xfc884f69UL, 0x3e4de8dfUL, 0xef0e0088UL, 0x3559648dUL, 0x8a45388cUL, 0x1d804366UL,
|
||||
0x721d9bfdUL, 0xa58684bbUL, 0xe8256333UL, 0x844e8212UL, 0x128d8098UL, 0xfed33fb4UL,
|
||||
0xce280ae1UL, 0x27e19ba5UL, 0xd5a6c252UL, 0xe49754bdUL, 0xc5d655ddUL, 0xeb667064UL,
|
||||
0x77840b4dUL, 0xa1b6a801UL, 0x84db26a9UL, 0xe0b56714UL, 0x21f043b7UL, 0xe5d05860UL,
|
||||
0x54f03084UL, 0x066ff472UL, 0xa31aa153UL, 0xdadc4755UL, 0xb5625dbfUL, 0x68561be6UL,
|
||||
0x83ca6b94UL, 0x2d6ed23bUL, 0xeccf01dbUL, 0xa6d3d0baUL, 0xb6803d5cUL, 0xaf77a709UL,
|
||||
0x33b4a34cUL, 0x397bc8d6UL, 0x5ee22b95UL, 0x5f0e5304UL, 0x81ed6f61UL, 0x20e74364UL,
|
||||
0xb45e1378UL, 0xde18639bUL, 0x881ca122UL, 0xb96726d1UL, 0x8049a7e8UL, 0x22b7da7bUL,
|
||||
0x5e552d25UL, 0x5272d237UL, 0x79d2951cUL, 0xc60d894cUL, 0x488cb402UL, 0x1ba4fe5bUL,
|
||||
0xa4b09f6bUL, 0x1ca815cfUL, 0xa20c3005UL, 0x8871df63UL, 0xb9de2fcbUL, 0x0cc6c9e9UL,
|
||||
0x0beeff53UL, 0xe3214517UL, 0xb4542835UL, 0x9f63293cUL, 0xee41e729UL, 0x6e1d2d7cUL,
|
||||
0x50045286UL, 0x1e6685f3UL, 0xf33401c6UL, 0x30a22c95UL, 0x31a70850UL, 0x60930f13UL,
|
||||
0x73f98417UL, 0xa1269859UL, 0xec645c44UL, 0x52c877a9UL, 0xcdff33a6UL, 0xa02b1741UL,
|
||||
0x7cbad9a2UL, 0x2180036fUL, 0x50d99c08UL, 0xcb3f4861UL, 0xc26bd765UL, 0x64a3f6abUL,
|
||||
0x80342676UL, 0x25a75e7bUL, 0xe4e6d1fcUL, 0x20c710e6UL, 0xcdf0b680UL, 0x17844d3bUL,
|
||||
0x31eef84dUL, 0x7e0824e4UL, 0x2ccb49ebUL, 0x846a3baeUL, 0x8ff77888UL, 0xee5d60f6UL,
|
||||
0x7af75673UL, 0x2fdd5cdbUL, 0xa11631c1UL, 0x30f66f43UL, 0xb3faec54UL, 0x157fd7faUL,
|
||||
0xef8579ccUL, 0xd152de58UL, 0xdb2ffd5eUL, 0x8f32ce19UL, 0x306af97aUL, 0x02f03ef8UL,
|
||||
0x99319ad5UL, 0xc242fa0fUL, 0xa7e3ebb0UL, 0xc68e4906UL, 0xb8da230cUL, 0x80823028UL,
|
||||
0xdcdef3c8UL, 0xd35fb171UL, 0x088a1bc8UL, 0xbec0c560UL, 0x61a3c9e8UL, 0xbca8f54dUL,
|
||||
0xc72feffaUL, 0x22822e99UL, 0x82c570b4UL, 0xd8d94e89UL, 0x8b1c34bcUL, 0x301e16e6UL,
|
||||
0x273be979UL, 0xb0ffeaa6UL, 0x61d9b8c6UL, 0x00b24869UL, 0xb7ffce3fUL, 0x08dc283bUL,
|
||||
0x43daf65aUL, 0xf7e19798UL, 0x7619b72fUL, 0x8f1c9ba4UL, 0xdc8637a0UL, 0x16a7d3b1UL,
|
||||
0x9fc393b7UL, 0xa7136eebUL, 0xc6bcc63eUL, 0x1a513742UL, 0xef6828bcUL, 0x520365d6UL,
|
||||
0x2d6a77abUL, 0x3527ed4bUL, 0x821fd216UL, 0x095c6e2eUL, 0xdb92f2fbUL, 0x5eea29cbUL,
|
||||
0x145892f5UL, 0x91584f7fUL, 0x5483697bUL, 0x2667a8ccUL, 0x85196048UL, 0x8c4baceaUL,
|
||||
0x833860d4UL, 0x0d23e0f9UL, 0x6c387e8aUL, 0x0ae6d249UL, 0xb284600cUL, 0xd835731dUL,
|
||||
0xdcb1c647UL, 0xac4c56eaUL, 0x3ebd81b3UL, 0x230eabb0UL, 0x6438bc87UL, 0xf0b5b1faUL,
|
||||
0x8f5ea2b3UL, 0xfc184642UL, 0x0a036b7aUL, 0x4fb089bdUL, 0x649da589UL, 0xa345415eUL,
|
||||
0x5c038323UL, 0x3e5d3bb9UL, 0x43d79572UL, 0x7e6dd07cUL, 0x06dfdf1eUL, 0x6c6cc4efUL,
|
||||
0x7160a539UL, 0x73bfbe70UL, 0x83877605UL, 0x4523ecf1UL};
|
||||
|
||||
static const ulong32 S3[256] = {
|
||||
0x8defc240UL, 0x25fa5d9fUL, 0xeb903dbfUL, 0xe810c907UL, 0x47607fffUL, 0x369fe44bUL,
|
||||
0x8c1fc644UL, 0xaececa90UL, 0xbeb1f9bfUL, 0xeefbcaeaUL, 0xe8cf1950UL, 0x51df07aeUL,
|
||||
0x920e8806UL, 0xf0ad0548UL, 0xe13c8d83UL, 0x927010d5UL, 0x11107d9fUL, 0x07647db9UL,
|
||||
0xb2e3e4d4UL, 0x3d4f285eUL, 0xb9afa820UL, 0xfade82e0UL, 0xa067268bUL, 0x8272792eUL,
|
||||
0x553fb2c0UL, 0x489ae22bUL, 0xd4ef9794UL, 0x125e3fbcUL, 0x21fffceeUL, 0x825b1bfdUL,
|
||||
0x9255c5edUL, 0x1257a240UL, 0x4e1a8302UL, 0xbae07fffUL, 0x528246e7UL, 0x8e57140eUL,
|
||||
0x3373f7bfUL, 0x8c9f8188UL, 0xa6fc4ee8UL, 0xc982b5a5UL, 0xa8c01db7UL, 0x579fc264UL,
|
||||
0x67094f31UL, 0xf2bd3f5fUL, 0x40fff7c1UL, 0x1fb78dfcUL, 0x8e6bd2c1UL, 0x437be59bUL,
|
||||
0x99b03dbfUL, 0xb5dbc64bUL, 0x638dc0e6UL, 0x55819d99UL, 0xa197c81cUL, 0x4a012d6eUL,
|
||||
0xc5884a28UL, 0xccc36f71UL, 0xb843c213UL, 0x6c0743f1UL, 0x8309893cUL, 0x0feddd5fUL,
|
||||
0x2f7fe850UL, 0xd7c07f7eUL, 0x02507fbfUL, 0x5afb9a04UL, 0xa747d2d0UL, 0x1651192eUL,
|
||||
0xaf70bf3eUL, 0x58c31380UL, 0x5f98302eUL, 0x727cc3c4UL, 0x0a0fb402UL, 0x0f7fef82UL,
|
||||
0x8c96fdadUL, 0x5d2c2aaeUL, 0x8ee99a49UL, 0x50da88b8UL, 0x8427f4a0UL, 0x1eac5790UL,
|
||||
0x796fb449UL, 0x8252dc15UL, 0xefbd7d9bUL, 0xa672597dUL, 0xada840d8UL, 0x45f54504UL,
|
||||
0xfa5d7403UL, 0xe83ec305UL, 0x4f91751aUL, 0x925669c2UL, 0x23efe941UL, 0xa903f12eUL,
|
||||
0x60270df2UL, 0x0276e4b6UL, 0x94fd6574UL, 0x927985b2UL, 0x8276dbcbUL, 0x02778176UL,
|
||||
0xf8af918dUL, 0x4e48f79eUL, 0x8f616ddfUL, 0xe29d840eUL, 0x842f7d83UL, 0x340ce5c8UL,
|
||||
0x96bbb682UL, 0x93b4b148UL, 0xef303cabUL, 0x984faf28UL, 0x779faf9bUL, 0x92dc560dUL,
|
||||
0x224d1e20UL, 0x8437aa88UL, 0x7d29dc96UL, 0x2756d3dcUL, 0x8b907ceeUL, 0xb51fd240UL,
|
||||
0xe7c07ce3UL, 0xe566b4a1UL, 0xc3e9615eUL, 0x3cf8209dUL, 0x6094d1e3UL, 0xcd9ca341UL,
|
||||
0x5c76460eUL, 0x00ea983bUL, 0xd4d67881UL, 0xfd47572cUL, 0xf76cedd9UL, 0xbda8229cUL,
|
||||
0x127dadaaUL, 0x438a074eUL, 0x1f97c090UL, 0x081bdb8aUL, 0x93a07ebeUL, 0xb938ca15UL,
|
||||
0x97b03cffUL, 0x3dc2c0f8UL, 0x8d1ab2ecUL, 0x64380e51UL, 0x68cc7bfbUL, 0xd90f2788UL,
|
||||
0x12490181UL, 0x5de5ffd4UL, 0xdd7ef86aUL, 0x76a2e214UL, 0xb9a40368UL, 0x925d958fUL,
|
||||
0x4b39fffaUL, 0xba39aee9UL, 0xa4ffd30bUL, 0xfaf7933bUL, 0x6d498623UL, 0x193cbcfaUL,
|
||||
0x27627545UL, 0x825cf47aUL, 0x61bd8ba0UL, 0xd11e42d1UL, 0xcead04f4UL, 0x127ea392UL,
|
||||
0x10428db7UL, 0x8272a972UL, 0x9270c4a8UL, 0x127de50bUL, 0x285ba1c8UL, 0x3c62f44fUL,
|
||||
0x35c0eaa5UL, 0xe805d231UL, 0x428929fbUL, 0xb4fcdf82UL, 0x4fb66a53UL, 0x0e7dc15bUL,
|
||||
0x1f081fabUL, 0x108618aeUL, 0xfcfd086dUL, 0xf9ff2889UL, 0x694bcc11UL, 0x236a5caeUL,
|
||||
0x12deca4dUL, 0x2c3f8cc5UL, 0xd2d02dfeUL, 0xf8ef5896UL, 0xe4cf52daUL, 0x95155b67UL,
|
||||
0x494a488cUL, 0xb9b6a80cUL, 0x5c8f82bcUL, 0x89d36b45UL, 0x3a609437UL, 0xec00c9a9UL,
|
||||
0x44715253UL, 0x0a874b49UL, 0xd773bc40UL, 0x7c34671cUL, 0x02717ef6UL, 0x4feb5536UL,
|
||||
0xa2d02fffUL, 0xd2bf60c4UL, 0xd43f03c0UL, 0x50b4ef6dUL, 0x07478cd1UL, 0x006e1888UL,
|
||||
0xa2e53f55UL, 0xb9e6d4bcUL, 0xa2048016UL, 0x97573833UL, 0xd7207d67UL, 0xde0f8f3dUL,
|
||||
0x72f87b33UL, 0xabcc4f33UL, 0x7688c55dUL, 0x7b00a6b0UL, 0x947b0001UL, 0x570075d2UL,
|
||||
0xf9bb88f8UL, 0x8942019eUL, 0x4264a5ffUL, 0x856302e0UL, 0x72dbd92bUL, 0xee971b69UL,
|
||||
0x6ea22fdeUL, 0x5f08ae2bUL, 0xaf7a616dUL, 0xe5c98767UL, 0xcf1febd2UL, 0x61efc8c2UL,
|
||||
0xf1ac2571UL, 0xcc8239c2UL, 0x67214cb8UL, 0xb1e583d1UL, 0xb7dc3e62UL, 0x7f10bdceUL,
|
||||
0xf90a5c38UL, 0x0ff0443dUL, 0x606e6dc6UL, 0x60543a49UL, 0x5727c148UL, 0x2be98a1dUL,
|
||||
0x8ab41738UL, 0x20e1be24UL, 0xaf96da0fUL, 0x68458425UL, 0x99833be5UL, 0x600d457dUL,
|
||||
0x282f9350UL, 0x8334b362UL, 0xd91d1120UL, 0x2b6d8da0UL, 0x642b1e31UL, 0x9c305a00UL,
|
||||
0x52bce688UL, 0x1b03588aUL, 0xf7baefd5UL, 0x4142ed9cUL, 0xa4315c11UL, 0x83323ec5UL,
|
||||
0xdfef4636UL, 0xa133c501UL, 0xe9d3531cUL, 0xee353783UL};
|
||||
|
||||
static const ulong32 S4[256] = {
|
||||
0x9db30420UL, 0x1fb6e9deUL, 0xa7be7befUL, 0xd273a298UL, 0x4a4f7bdbUL, 0x64ad8c57UL,
|
||||
0x85510443UL, 0xfa020ed1UL, 0x7e287affUL, 0xe60fb663UL, 0x095f35a1UL, 0x79ebf120UL,
|
||||
0xfd059d43UL, 0x6497b7b1UL, 0xf3641f63UL, 0x241e4adfUL, 0x28147f5fUL, 0x4fa2b8cdUL,
|
||||
0xc9430040UL, 0x0cc32220UL, 0xfdd30b30UL, 0xc0a5374fUL, 0x1d2d00d9UL, 0x24147b15UL,
|
||||
0xee4d111aUL, 0x0fca5167UL, 0x71ff904cUL, 0x2d195ffeUL, 0x1a05645fUL, 0x0c13fefeUL,
|
||||
0x081b08caUL, 0x05170121UL, 0x80530100UL, 0xe83e5efeUL, 0xac9af4f8UL, 0x7fe72701UL,
|
||||
0xd2b8ee5fUL, 0x06df4261UL, 0xbb9e9b8aUL, 0x7293ea25UL, 0xce84ffdfUL, 0xf5718801UL,
|
||||
0x3dd64b04UL, 0xa26f263bUL, 0x7ed48400UL, 0x547eebe6UL, 0x446d4ca0UL, 0x6cf3d6f5UL,
|
||||
0x2649abdfUL, 0xaea0c7f5UL, 0x36338cc1UL, 0x503f7e93UL, 0xd3772061UL, 0x11b638e1UL,
|
||||
0x72500e03UL, 0xf80eb2bbUL, 0xabe0502eUL, 0xec8d77deUL, 0x57971e81UL, 0xe14f6746UL,
|
||||
0xc9335400UL, 0x6920318fUL, 0x081dbb99UL, 0xffc304a5UL, 0x4d351805UL, 0x7f3d5ce3UL,
|
||||
0xa6c866c6UL, 0x5d5bcca9UL, 0xdaec6feaUL, 0x9f926f91UL, 0x9f46222fUL, 0x3991467dUL,
|
||||
0xa5bf6d8eUL, 0x1143c44fUL, 0x43958302UL, 0xd0214eebUL, 0x022083b8UL, 0x3fb6180cUL,
|
||||
0x18f8931eUL, 0x281658e6UL, 0x26486e3eUL, 0x8bd78a70UL, 0x7477e4c1UL, 0xb506e07cUL,
|
||||
0xf32d0a25UL, 0x79098b02UL, 0xe4eabb81UL, 0x28123b23UL, 0x69dead38UL, 0x1574ca16UL,
|
||||
0xdf871b62UL, 0x211c40b7UL, 0xa51a9ef9UL, 0x0014377bUL, 0x041e8ac8UL, 0x09114003UL,
|
||||
0xbd59e4d2UL, 0xe3d156d5UL, 0x4fe876d5UL, 0x2f91a340UL, 0x557be8deUL, 0x00eae4a7UL,
|
||||
0x0ce5c2ecUL, 0x4db4bba6UL, 0xe756bdffUL, 0xdd3369acUL, 0xec17b035UL, 0x06572327UL,
|
||||
0x99afc8b0UL, 0x56c8c391UL, 0x6b65811cUL, 0x5e146119UL, 0x6e85cb75UL, 0xbe07c002UL,
|
||||
0xc2325577UL, 0x893ff4ecUL, 0x5bbfc92dUL, 0xd0ec3b25UL, 0xb7801ab7UL, 0x8d6d3b24UL,
|
||||
0x20c763efUL, 0xc366a5fcUL, 0x9c382880UL, 0x0ace3205UL, 0xaac9548aUL, 0xeca1d7c7UL,
|
||||
0x041afa32UL, 0x1d16625aUL, 0x6701902cUL, 0x9b757a54UL, 0x31d477f7UL, 0x9126b031UL,
|
||||
0x36cc6fdbUL, 0xc70b8b46UL, 0xd9e66a48UL, 0x56e55a79UL, 0x026a4cebUL, 0x52437effUL,
|
||||
0x2f8f76b4UL, 0x0df980a5UL, 0x8674cde3UL, 0xedda04ebUL, 0x17a9be04UL, 0x2c18f4dfUL,
|
||||
0xb7747f9dUL, 0xab2af7b4UL, 0xefc34d20UL, 0x2e096b7cUL, 0x1741a254UL, 0xe5b6a035UL,
|
||||
0x213d42f6UL, 0x2c1c7c26UL, 0x61c2f50fUL, 0x6552daf9UL, 0xd2c231f8UL, 0x25130f69UL,
|
||||
0xd8167fa2UL, 0x0418f2c8UL, 0x001a96a6UL, 0x0d1526abUL, 0x63315c21UL, 0x5e0a72ecUL,
|
||||
0x49bafefdUL, 0x187908d9UL, 0x8d0dbd86UL, 0x311170a7UL, 0x3e9b640cUL, 0xcc3e10d7UL,
|
||||
0xd5cad3b6UL, 0x0caec388UL, 0xf73001e1UL, 0x6c728affUL, 0x71eae2a1UL, 0x1f9af36eUL,
|
||||
0xcfcbd12fUL, 0xc1de8417UL, 0xac07be6bUL, 0xcb44a1d8UL, 0x8b9b0f56UL, 0x013988c3UL,
|
||||
0xb1c52fcaUL, 0xb4be31cdUL, 0xd8782806UL, 0x12a3a4e2UL, 0x6f7de532UL, 0x58fd7eb6UL,
|
||||
0xd01ee900UL, 0x24adffc2UL, 0xf4990fc5UL, 0x9711aac5UL, 0x001d7b95UL, 0x82e5e7d2UL,
|
||||
0x109873f6UL, 0x00613096UL, 0xc32d9521UL, 0xada121ffUL, 0x29908415UL, 0x7fbb977fUL,
|
||||
0xaf9eb3dbUL, 0x29c9ed2aUL, 0x5ce2a465UL, 0xa730f32cUL, 0xd0aa3fe8UL, 0x8a5cc091UL,
|
||||
0xd49e2ce7UL, 0x0ce454a9UL, 0xd60acd86UL, 0x015f1919UL, 0x77079103UL, 0xdea03af6UL,
|
||||
0x78a8565eUL, 0xdee356dfUL, 0x21f05cbeUL, 0x8b75e387UL, 0xb3c50651UL, 0xb8a5c3efUL,
|
||||
0xd8eeb6d2UL, 0xe523be77UL, 0xc2154529UL, 0x2f69efdfUL, 0xafe67afbUL, 0xf470c4b2UL,
|
||||
0xf3e0eb5bUL, 0xd6cc9876UL, 0x39e4460cUL, 0x1fda8538UL, 0x1987832fUL, 0xca007367UL,
|
||||
0xa99144f8UL, 0x296b299eUL, 0x492fc295UL, 0x9266beabUL, 0xb5676e69UL, 0x9bd3dddaUL,
|
||||
0xdf7e052fUL, 0xdb25701cUL, 0x1b5e51eeUL, 0xf65324e6UL, 0x6afce36cUL, 0x0316cc04UL,
|
||||
0x8644213eUL, 0xb7dc59d0UL, 0x7965291fUL, 0xccd6fd43UL, 0x41823979UL, 0x932bcdf6UL,
|
||||
0xb657c34dUL, 0x4edfd282UL, 0x7ae5290cUL, 0x3cb9536bUL, 0x851e20feUL, 0x9833557eUL,
|
||||
0x13ecf0b0UL, 0xd3ffb372UL, 0x3f85c5c1UL, 0x0aef7ed2UL};
|
||||
|
||||
static const ulong32 S5[256] = {
|
||||
0x7ec90c04UL, 0x2c6e74b9UL, 0x9b0e66dfUL, 0xa6337911UL, 0xb86a7fffUL, 0x1dd358f5UL,
|
||||
0x44dd9d44UL, 0x1731167fUL, 0x08fbf1faUL, 0xe7f511ccUL, 0xd2051b00UL, 0x735aba00UL,
|
||||
0x2ab722d8UL, 0x386381cbUL, 0xacf6243aUL, 0x69befd7aUL, 0xe6a2e77fUL, 0xf0c720cdUL,
|
||||
0xc4494816UL, 0xccf5c180UL, 0x38851640UL, 0x15b0a848UL, 0xe68b18cbUL, 0x4caadeffUL,
|
||||
0x5f480a01UL, 0x0412b2aaUL, 0x259814fcUL, 0x41d0efe2UL, 0x4e40b48dUL, 0x248eb6fbUL,
|
||||
0x8dba1cfeUL, 0x41a99b02UL, 0x1a550a04UL, 0xba8f65cbUL, 0x7251f4e7UL, 0x95a51725UL,
|
||||
0xc106ecd7UL, 0x97a5980aUL, 0xc539b9aaUL, 0x4d79fe6aUL, 0xf2f3f763UL, 0x68af8040UL,
|
||||
0xed0c9e56UL, 0x11b4958bUL, 0xe1eb5a88UL, 0x8709e6b0UL, 0xd7e07156UL, 0x4e29fea7UL,
|
||||
0x6366e52dUL, 0x02d1c000UL, 0xc4ac8e05UL, 0x9377f571UL, 0x0c05372aUL, 0x578535f2UL,
|
||||
0x2261be02UL, 0xd642a0c9UL, 0xdf13a280UL, 0x74b55bd2UL, 0x682199c0UL, 0xd421e5ecUL,
|
||||
0x53fb3ce8UL, 0xc8adedb3UL, 0x28a87fc9UL, 0x3d959981UL, 0x5c1ff900UL, 0xfe38d399UL,
|
||||
0x0c4eff0bUL, 0x062407eaUL, 0xaa2f4fb1UL, 0x4fb96976UL, 0x90c79505UL, 0xb0a8a774UL,
|
||||
0xef55a1ffUL, 0xe59ca2c2UL, 0xa6b62d27UL, 0xe66a4263UL, 0xdf65001fUL, 0x0ec50966UL,
|
||||
0xdfdd55bcUL, 0x29de0655UL, 0x911e739aUL, 0x17af8975UL, 0x32c7911cUL, 0x89f89468UL,
|
||||
0x0d01e980UL, 0x524755f4UL, 0x03b63cc9UL, 0x0cc844b2UL, 0xbcf3f0aaUL, 0x87ac36e9UL,
|
||||
0xe53a7426UL, 0x01b3d82bUL, 0x1a9e7449UL, 0x64ee2d7eUL, 0xcddbb1daUL, 0x01c94910UL,
|
||||
0xb868bf80UL, 0x0d26f3fdUL, 0x9342ede7UL, 0x04a5c284UL, 0x636737b6UL, 0x50f5b616UL,
|
||||
0xf24766e3UL, 0x8eca36c1UL, 0x136e05dbUL, 0xfef18391UL, 0xfb887a37UL, 0xd6e7f7d4UL,
|
||||
0xc7fb7dc9UL, 0x3063fcdfUL, 0xb6f589deUL, 0xec2941daUL, 0x26e46695UL, 0xb7566419UL,
|
||||
0xf654efc5UL, 0xd08d58b7UL, 0x48925401UL, 0xc1bacb7fUL, 0xe5ff550fUL, 0xb6083049UL,
|
||||
0x5bb5d0e8UL, 0x87d72e5aUL, 0xab6a6ee1UL, 0x223a66ceUL, 0xc62bf3cdUL, 0x9e0885f9UL,
|
||||
0x68cb3e47UL, 0x086c010fUL, 0xa21de820UL, 0xd18b69deUL, 0xf3f65777UL, 0xfa02c3f6UL,
|
||||
0x407edac3UL, 0xcbb3d550UL, 0x1793084dUL, 0xb0d70ebaUL, 0x0ab378d5UL, 0xd951fb0cUL,
|
||||
0xded7da56UL, 0x4124bbe4UL, 0x94ca0b56UL, 0x0f5755d1UL, 0xe0e1e56eUL, 0x6184b5beUL,
|
||||
0x580a249fUL, 0x94f74bc0UL, 0xe327888eUL, 0x9f7b5561UL, 0xc3dc0280UL, 0x05687715UL,
|
||||
0x646c6bd7UL, 0x44904db3UL, 0x66b4f0a3UL, 0xc0f1648aUL, 0x697ed5afUL, 0x49e92ff6UL,
|
||||
0x309e374fUL, 0x2cb6356aUL, 0x85808573UL, 0x4991f840UL, 0x76f0ae02UL, 0x083be84dUL,
|
||||
0x28421c9aUL, 0x44489406UL, 0x736e4cb8UL, 0xc1092910UL, 0x8bc95fc6UL, 0x7d869cf4UL,
|
||||
0x134f616fUL, 0x2e77118dUL, 0xb31b2be1UL, 0xaa90b472UL, 0x3ca5d717UL, 0x7d161bbaUL,
|
||||
0x9cad9010UL, 0xaf462ba2UL, 0x9fe459d2UL, 0x45d34559UL, 0xd9f2da13UL, 0xdbc65487UL,
|
||||
0xf3e4f94eUL, 0x176d486fUL, 0x097c13eaUL, 0x631da5c7UL, 0x445f7382UL, 0x175683f4UL,
|
||||
0xcdc66a97UL, 0x70be0288UL, 0xb3cdcf72UL, 0x6e5dd2f3UL, 0x20936079UL, 0x459b80a5UL,
|
||||
0xbe60e2dbUL, 0xa9c23101UL, 0xeba5315cUL, 0x224e42f2UL, 0x1c5c1572UL, 0xf6721b2cUL,
|
||||
0x1ad2fff3UL, 0x8c25404eUL, 0x324ed72fUL, 0x4067b7fdUL, 0x0523138eUL, 0x5ca3bc78UL,
|
||||
0xdc0fd66eUL, 0x75922283UL, 0x784d6b17UL, 0x58ebb16eUL, 0x44094f85UL, 0x3f481d87UL,
|
||||
0xfcfeae7bUL, 0x77b5ff76UL, 0x8c2302bfUL, 0xaaf47556UL, 0x5f46b02aUL, 0x2b092801UL,
|
||||
0x3d38f5f7UL, 0x0ca81f36UL, 0x52af4a8aUL, 0x66d5e7c0UL, 0xdf3b0874UL, 0x95055110UL,
|
||||
0x1b5ad7a8UL, 0xf61ed5adUL, 0x6cf6e479UL, 0x20758184UL, 0xd0cefa65UL, 0x88f7be58UL,
|
||||
0x4a046826UL, 0x0ff6f8f3UL, 0xa09c7f70UL, 0x5346aba0UL, 0x5ce96c28UL, 0xe176eda3UL,
|
||||
0x6bac307fUL, 0x376829d2UL, 0x85360fa9UL, 0x17e3fe2aUL, 0x24b79767UL, 0xf5a96b20UL,
|
||||
0xd6cd2595UL, 0x68ff1ebfUL, 0x7555442cUL, 0xf19f06beUL, 0xf9e0659aUL, 0xeeb9491dUL,
|
||||
0x34010718UL, 0xbb30cab8UL, 0xe822fe15UL, 0x88570983UL, 0x750e6249UL, 0xda627e55UL,
|
||||
0x5e76ffa8UL, 0xb1534546UL, 0x6d47de08UL, 0xefe9e7d4UL};
|
||||
|
||||
static const ulong32 S6[256] = {
|
||||
0xf6fa8f9dUL, 0x2cac6ce1UL, 0x4ca34867UL, 0xe2337f7cUL, 0x95db08e7UL, 0x016843b4UL,
|
||||
0xeced5cbcUL, 0x325553acUL, 0xbf9f0960UL, 0xdfa1e2edUL, 0x83f0579dUL, 0x63ed86b9UL,
|
||||
0x1ab6a6b8UL, 0xde5ebe39UL, 0xf38ff732UL, 0x8989b138UL, 0x33f14961UL, 0xc01937bdUL,
|
||||
0xf506c6daUL, 0xe4625e7eUL, 0xa308ea99UL, 0x4e23e33cUL, 0x79cbd7ccUL, 0x48a14367UL,
|
||||
0xa3149619UL, 0xfec94bd5UL, 0xa114174aUL, 0xeaa01866UL, 0xa084db2dUL, 0x09a8486fUL,
|
||||
0xa888614aUL, 0x2900af98UL, 0x01665991UL, 0xe1992863UL, 0xc8f30c60UL, 0x2e78ef3cUL,
|
||||
0xd0d51932UL, 0xcf0fec14UL, 0xf7ca07d2UL, 0xd0a82072UL, 0xfd41197eUL, 0x9305a6b0UL,
|
||||
0xe86be3daUL, 0x74bed3cdUL, 0x372da53cUL, 0x4c7f4448UL, 0xdab5d440UL, 0x6dba0ec3UL,
|
||||
0x083919a7UL, 0x9fbaeed9UL, 0x49dbcfb0UL, 0x4e670c53UL, 0x5c3d9c01UL, 0x64bdb941UL,
|
||||
0x2c0e636aUL, 0xba7dd9cdUL, 0xea6f7388UL, 0xe70bc762UL, 0x35f29adbUL, 0x5c4cdd8dUL,
|
||||
0xf0d48d8cUL, 0xb88153e2UL, 0x08a19866UL, 0x1ae2eac8UL, 0x284caf89UL, 0xaa928223UL,
|
||||
0x9334be53UL, 0x3b3a21bfUL, 0x16434be3UL, 0x9aea3906UL, 0xefe8c36eUL, 0xf890cdd9UL,
|
||||
0x80226daeUL, 0xc340a4a3UL, 0xdf7e9c09UL, 0xa694a807UL, 0x5b7c5eccUL, 0x221db3a6UL,
|
||||
0x9a69a02fUL, 0x68818a54UL, 0xceb2296fUL, 0x53c0843aUL, 0xfe893655UL, 0x25bfe68aUL,
|
||||
0xb4628abcUL, 0xcf222ebfUL, 0x25ac6f48UL, 0xa9a99387UL, 0x53bddb65UL, 0xe76ffbe7UL,
|
||||
0xe967fd78UL, 0x0ba93563UL, 0x8e342bc1UL, 0xe8a11be9UL, 0x4980740dUL, 0xc8087dfcUL,
|
||||
0x8de4bf99UL, 0xa11101a0UL, 0x7fd37975UL, 0xda5a26c0UL, 0xe81f994fUL, 0x9528cd89UL,
|
||||
0xfd339fedUL, 0xb87834bfUL, 0x5f04456dUL, 0x22258698UL, 0xc9c4c83bUL, 0x2dc156beUL,
|
||||
0x4f628daaUL, 0x57f55ec5UL, 0xe2220abeUL, 0xd2916ebfUL, 0x4ec75b95UL, 0x24f2c3c0UL,
|
||||
0x42d15d99UL, 0xcd0d7fa0UL, 0x7b6e27ffUL, 0xa8dc8af0UL, 0x7345c106UL, 0xf41e232fUL,
|
||||
0x35162386UL, 0xe6ea8926UL, 0x3333b094UL, 0x157ec6f2UL, 0x372b74afUL, 0x692573e4UL,
|
||||
0xe9a9d848UL, 0xf3160289UL, 0x3a62ef1dUL, 0xa787e238UL, 0xf3a5f676UL, 0x74364853UL,
|
||||
0x20951063UL, 0x4576698dUL, 0xb6fad407UL, 0x592af950UL, 0x36f73523UL, 0x4cfb6e87UL,
|
||||
0x7da4cec0UL, 0x6c152daaUL, 0xcb0396a8UL, 0xc50dfe5dUL, 0xfcd707abUL, 0x0921c42fUL,
|
||||
0x89dff0bbUL, 0x5fe2be78UL, 0x448f4f33UL, 0x754613c9UL, 0x2b05d08dUL, 0x48b9d585UL,
|
||||
0xdc049441UL, 0xc8098f9bUL, 0x7dede786UL, 0xc39a3373UL, 0x42410005UL, 0x6a091751UL,
|
||||
0x0ef3c8a6UL, 0x890072d6UL, 0x28207682UL, 0xa9a9f7beUL, 0xbf32679dUL, 0xd45b5b75UL,
|
||||
0xb353fd00UL, 0xcbb0e358UL, 0x830f220aUL, 0x1f8fb214UL, 0xd372cf08UL, 0xcc3c4a13UL,
|
||||
0x8cf63166UL, 0x061c87beUL, 0x88c98f88UL, 0x6062e397UL, 0x47cf8e7aUL, 0xb6c85283UL,
|
||||
0x3cc2acfbUL, 0x3fc06976UL, 0x4e8f0252UL, 0x64d8314dUL, 0xda3870e3UL, 0x1e665459UL,
|
||||
0xc10908f0UL, 0x513021a5UL, 0x6c5b68b7UL, 0x822f8aa0UL, 0x3007cd3eUL, 0x74719eefUL,
|
||||
0xdc872681UL, 0x073340d4UL, 0x7e432fd9UL, 0x0c5ec241UL, 0x8809286cUL, 0xf592d891UL,
|
||||
0x08a930f6UL, 0x957ef305UL, 0xb7fbffbdUL, 0xc266e96fUL, 0x6fe4ac98UL, 0xb173ecc0UL,
|
||||
0xbc60b42aUL, 0x953498daUL, 0xfba1ae12UL, 0x2d4bd736UL, 0x0f25faabUL, 0xa4f3fcebUL,
|
||||
0xe2969123UL, 0x257f0c3dUL, 0x9348af49UL, 0x361400bcUL, 0xe8816f4aUL, 0x3814f200UL,
|
||||
0xa3f94043UL, 0x9c7a54c2UL, 0xbc704f57UL, 0xda41e7f9UL, 0xc25ad33aUL, 0x54f4a084UL,
|
||||
0xb17f5505UL, 0x59357cbeUL, 0xedbd15c8UL, 0x7f97c5abUL, 0xba5ac7b5UL, 0xb6f6deafUL,
|
||||
0x3a479c3aUL, 0x5302da25UL, 0x653d7e6aUL, 0x54268d49UL, 0x51a477eaUL, 0x5017d55bUL,
|
||||
0xd7d25d88UL, 0x44136c76UL, 0x0404a8c8UL, 0xb8e5a121UL, 0xb81a928aUL, 0x60ed5869UL,
|
||||
0x97c55b96UL, 0xeaec991bUL, 0x29935913UL, 0x01fdb7f1UL, 0x088e8dfaUL, 0x9ab6f6f5UL,
|
||||
0x3b4cbf9fUL, 0x4a5de3abUL, 0xe6051d35UL, 0xa0e1d855UL, 0xd36b4cf1UL, 0xf544edebUL,
|
||||
0xb0e93524UL, 0xbebb8fbdUL, 0xa2d762cfUL, 0x49c92f54UL, 0x38b5f331UL, 0x7128a454UL,
|
||||
0x48392905UL, 0xa65b1db8UL, 0x851c97bdUL, 0xd675cf2fUL};
|
||||
|
||||
static const ulong32 S7[256] = {
|
||||
0x85e04019UL, 0x332bf567UL, 0x662dbfffUL, 0xcfc65693UL, 0x2a8d7f6fUL, 0xab9bc912UL,
|
||||
0xde6008a1UL, 0x2028da1fUL, 0x0227bce7UL, 0x4d642916UL, 0x18fac300UL, 0x50f18b82UL,
|
||||
0x2cb2cb11UL, 0xb232e75cUL, 0x4b3695f2UL, 0xb28707deUL, 0xa05fbcf6UL, 0xcd4181e9UL,
|
||||
0xe150210cUL, 0xe24ef1bdUL, 0xb168c381UL, 0xfde4e789UL, 0x5c79b0d8UL, 0x1e8bfd43UL,
|
||||
0x4d495001UL, 0x38be4341UL, 0x913cee1dUL, 0x92a79c3fUL, 0x089766beUL, 0xbaeeadf4UL,
|
||||
0x1286becfUL, 0xb6eacb19UL, 0x2660c200UL, 0x7565bde4UL, 0x64241f7aUL, 0x8248dca9UL,
|
||||
0xc3b3ad66UL, 0x28136086UL, 0x0bd8dfa8UL, 0x356d1cf2UL, 0x107789beUL, 0xb3b2e9ceUL,
|
||||
0x0502aa8fUL, 0x0bc0351eUL, 0x166bf52aUL, 0xeb12ff82UL, 0xe3486911UL, 0xd34d7516UL,
|
||||
0x4e7b3affUL, 0x5f43671bUL, 0x9cf6e037UL, 0x4981ac83UL, 0x334266ceUL, 0x8c9341b7UL,
|
||||
0xd0d854c0UL, 0xcb3a6c88UL, 0x47bc2829UL, 0x4725ba37UL, 0xa66ad22bUL, 0x7ad61f1eUL,
|
||||
0x0c5cbafaUL, 0x4437f107UL, 0xb6e79962UL, 0x42d2d816UL, 0x0a961288UL, 0xe1a5c06eUL,
|
||||
0x13749e67UL, 0x72fc081aUL, 0xb1d139f7UL, 0xf9583745UL, 0xcf19df58UL, 0xbec3f756UL,
|
||||
0xc06eba30UL, 0x07211b24UL, 0x45c28829UL, 0xc95e317fUL, 0xbc8ec511UL, 0x38bc46e9UL,
|
||||
0xc6e6fa14UL, 0xbae8584aUL, 0xad4ebc46UL, 0x468f508bUL, 0x7829435fUL, 0xf124183bUL,
|
||||
0x821dba9fUL, 0xaff60ff4UL, 0xea2c4e6dUL, 0x16e39264UL, 0x92544a8bUL, 0x009b4fc3UL,
|
||||
0xaba68cedUL, 0x9ac96f78UL, 0x06a5b79aUL, 0xb2856e6eUL, 0x1aec3ca9UL, 0xbe838688UL,
|
||||
0x0e0804e9UL, 0x55f1be56UL, 0xe7e5363bUL, 0xb3a1f25dUL, 0xf7debb85UL, 0x61fe033cUL,
|
||||
0x16746233UL, 0x3c034c28UL, 0xda6d0c74UL, 0x79aac56cUL, 0x3ce4e1adUL, 0x51f0c802UL,
|
||||
0x98f8f35aUL, 0x1626a49fUL, 0xeed82b29UL, 0x1d382fe3UL, 0x0c4fb99aUL, 0xbb325778UL,
|
||||
0x3ec6d97bUL, 0x6e77a6a9UL, 0xcb658b5cUL, 0xd45230c7UL, 0x2bd1408bUL, 0x60c03eb7UL,
|
||||
0xb9068d78UL, 0xa33754f4UL, 0xf430c87dUL, 0xc8a71302UL, 0xb96d8c32UL, 0xebd4e7beUL,
|
||||
0xbe8b9d2dUL, 0x7979fb06UL, 0xe7225308UL, 0x8b75cf77UL, 0x11ef8da4UL, 0xe083c858UL,
|
||||
0x8d6b786fUL, 0x5a6317a6UL, 0xfa5cf7a0UL, 0x5dda0033UL, 0xf28ebfb0UL, 0xf5b9c310UL,
|
||||
0xa0eac280UL, 0x08b9767aUL, 0xa3d9d2b0UL, 0x79d34217UL, 0x021a718dUL, 0x9ac6336aUL,
|
||||
0x2711fd60UL, 0x438050e3UL, 0x069908a8UL, 0x3d7fedc4UL, 0x826d2befUL, 0x4eeb8476UL,
|
||||
0x488dcf25UL, 0x36c9d566UL, 0x28e74e41UL, 0xc2610acaUL, 0x3d49a9cfUL, 0xbae3b9dfUL,
|
||||
0xb65f8de6UL, 0x92aeaf64UL, 0x3ac7d5e6UL, 0x9ea80509UL, 0xf22b017dUL, 0xa4173f70UL,
|
||||
0xdd1e16c3UL, 0x15e0d7f9UL, 0x50b1b887UL, 0x2b9f4fd5UL, 0x625aba82UL, 0x6a017962UL,
|
||||
0x2ec01b9cUL, 0x15488aa9UL, 0xd716e740UL, 0x40055a2cUL, 0x93d29a22UL, 0xe32dbf9aUL,
|
||||
0x058745b9UL, 0x3453dc1eUL, 0xd699296eUL, 0x496cff6fUL, 0x1c9f4986UL, 0xdfe2ed07UL,
|
||||
0xb87242d1UL, 0x19de7eaeUL, 0x053e561aUL, 0x15ad6f8cUL, 0x66626c1cUL, 0x7154c24cUL,
|
||||
0xea082b2aUL, 0x93eb2939UL, 0x17dcb0f0UL, 0x58d4f2aeUL, 0x9ea294fbUL, 0x52cf564cUL,
|
||||
0x9883fe66UL, 0x2ec40581UL, 0x763953c3UL, 0x01d6692eUL, 0xd3a0c108UL, 0xa1e7160eUL,
|
||||
0xe4f2dfa6UL, 0x693ed285UL, 0x74904698UL, 0x4c2b0eddUL, 0x4f757656UL, 0x5d393378UL,
|
||||
0xa132234fUL, 0x3d321c5dUL, 0xc3f5e194UL, 0x4b269301UL, 0xc79f022fUL, 0x3c997e7eUL,
|
||||
0x5e4f9504UL, 0x3ffafbbdUL, 0x76f7ad0eUL, 0x296693f4UL, 0x3d1fce6fUL, 0xc61e45beUL,
|
||||
0xd3b5ab34UL, 0xf72bf9b7UL, 0x1b0434c0UL, 0x4e72b567UL, 0x5592a33dUL, 0xb5229301UL,
|
||||
0xcfd2a87fUL, 0x60aeb767UL, 0x1814386bUL, 0x30bcc33dUL, 0x38a0c07dUL, 0xfd1606f2UL,
|
||||
0xc363519bUL, 0x589dd390UL, 0x5479f8e6UL, 0x1cb8d647UL, 0x97fd61a9UL, 0xea7759f4UL,
|
||||
0x2d57539dUL, 0x569a58cfUL, 0xe84e63adUL, 0x462e1b78UL, 0x6580f87eUL, 0xf3817914UL,
|
||||
0x91da55f4UL, 0x40a230f3UL, 0xd1988f35UL, 0xb6e318d2UL, 0x3ffa50bcUL, 0x3d40f021UL,
|
||||
0xc3c0bdaeUL, 0x4958c24cUL, 0x518f36b2UL, 0x84b1d370UL, 0x0fedce83UL, 0x878ddadaUL,
|
||||
0xf2a279c7UL, 0x94e01be8UL, 0x90716f4bUL, 0x954b8aa3UL};
|
||||
|
||||
static const ulong32 S8[256] = {
|
||||
0xe216300dUL, 0xbbddfffcUL, 0xa7ebdabdUL, 0x35648095UL, 0x7789f8b7UL, 0xe6c1121bUL,
|
||||
0x0e241600UL, 0x052ce8b5UL, 0x11a9cfb0UL, 0xe5952f11UL, 0xece7990aUL, 0x9386d174UL,
|
||||
0x2a42931cUL, 0x76e38111UL, 0xb12def3aUL, 0x37ddddfcUL, 0xde9adeb1UL, 0x0a0cc32cUL,
|
||||
0xbe197029UL, 0x84a00940UL, 0xbb243a0fUL, 0xb4d137cfUL, 0xb44e79f0UL, 0x049eedfdUL,
|
||||
0x0b15a15dUL, 0x480d3168UL, 0x8bbbde5aUL, 0x669ded42UL, 0xc7ece831UL, 0x3f8f95e7UL,
|
||||
0x72df191bUL, 0x7580330dUL, 0x94074251UL, 0x5c7dcdfaUL, 0xabbe6d63UL, 0xaa402164UL,
|
||||
0xb301d40aUL, 0x02e7d1caUL, 0x53571daeUL, 0x7a3182a2UL, 0x12a8ddecUL, 0xfdaa335dUL,
|
||||
0x176f43e8UL, 0x71fb46d4UL, 0x38129022UL, 0xce949ad4UL, 0xb84769adUL, 0x965bd862UL,
|
||||
0x82f3d055UL, 0x66fb9767UL, 0x15b80b4eUL, 0x1d5b47a0UL, 0x4cfde06fUL, 0xc28ec4b8UL,
|
||||
0x57e8726eUL, 0x647a78fcUL, 0x99865d44UL, 0x608bd593UL, 0x6c200e03UL, 0x39dc5ff6UL,
|
||||
0x5d0b00a3UL, 0xae63aff2UL, 0x7e8bd632UL, 0x70108c0cUL, 0xbbd35049UL, 0x2998df04UL,
|
||||
0x980cf42aUL, 0x9b6df491UL, 0x9e7edd53UL, 0x06918548UL, 0x58cb7e07UL, 0x3b74ef2eUL,
|
||||
0x522fffb1UL, 0xd24708ccUL, 0x1c7e27cdUL, 0xa4eb215bUL, 0x3cf1d2e2UL, 0x19b47a38UL,
|
||||
0x424f7618UL, 0x35856039UL, 0x9d17dee7UL, 0x27eb35e6UL, 0xc9aff67bUL, 0x36baf5b8UL,
|
||||
0x09c467cdUL, 0xc18910b1UL, 0xe11dbf7bUL, 0x06cd1af8UL, 0x7170c608UL, 0x2d5e3354UL,
|
||||
0xd4de495aUL, 0x64c6d006UL, 0xbcc0c62cUL, 0x3dd00db3UL, 0x708f8f34UL, 0x77d51b42UL,
|
||||
0x264f620fUL, 0x24b8d2bfUL, 0x15c1b79eUL, 0x46a52564UL, 0xf8d7e54eUL, 0x3e378160UL,
|
||||
0x7895cda5UL, 0x859c15a5UL, 0xe6459788UL, 0xc37bc75fUL, 0xdb07ba0cUL, 0x0676a3abUL,
|
||||
0x7f229b1eUL, 0x31842e7bUL, 0x24259fd7UL, 0xf8bef472UL, 0x835ffcb8UL, 0x6df4c1f2UL,
|
||||
0x96f5b195UL, 0xfd0af0fcUL, 0xb0fe134cUL, 0xe2506d3dUL, 0x4f9b12eaUL, 0xf215f225UL,
|
||||
0xa223736fUL, 0x9fb4c428UL, 0x25d04979UL, 0x34c713f8UL, 0xc4618187UL, 0xea7a6e98UL,
|
||||
0x7cd16efcUL, 0x1436876cUL, 0xf1544107UL, 0xbedeee14UL, 0x56e9af27UL, 0xa04aa441UL,
|
||||
0x3cf7c899UL, 0x92ecbae6UL, 0xdd67016dUL, 0x151682ebUL, 0xa842eedfUL, 0xfdba60b4UL,
|
||||
0xf1907b75UL, 0x20e3030fUL, 0x24d8c29eUL, 0xe139673bUL, 0xefa63fb8UL, 0x71873054UL,
|
||||
0xb6f2cf3bUL, 0x9f326442UL, 0xcb15a4ccUL, 0xb01a4504UL, 0xf1e47d8dUL, 0x844a1be5UL,
|
||||
0xbae7dfdcUL, 0x42cbda70UL, 0xcd7dae0aUL, 0x57e85b7aUL, 0xd53f5af6UL, 0x20cf4d8cUL,
|
||||
0xcea4d428UL, 0x79d130a4UL, 0x3486ebfbUL, 0x33d3cddcUL, 0x77853b53UL, 0x37effcb5UL,
|
||||
0xc5068778UL, 0xe580b3e6UL, 0x4e68b8f4UL, 0xc5c8b37eUL, 0x0d809ea2UL, 0x398feb7cUL,
|
||||
0x132a4f94UL, 0x43b7950eUL, 0x2fee7d1cUL, 0x223613bdUL, 0xdd06caa2UL, 0x37df932bUL,
|
||||
0xc4248289UL, 0xacf3ebc3UL, 0x5715f6b7UL, 0xef3478ddUL, 0xf267616fUL, 0xc148cbe4UL,
|
||||
0x9052815eUL, 0x5e410fabUL, 0xb48a2465UL, 0x2eda7fa4UL, 0xe87b40e4UL, 0xe98ea084UL,
|
||||
0x5889e9e1UL, 0xefd390fcUL, 0xdd07d35bUL, 0xdb485694UL, 0x38d7e5b2UL, 0x57720101UL,
|
||||
0x730edebcUL, 0x5b643113UL, 0x94917e4fUL, 0x503c2fbaUL, 0x646f1282UL, 0x7523d24aUL,
|
||||
0xe0779695UL, 0xf9c17a8fUL, 0x7a5b2121UL, 0xd187b896UL, 0x29263a4dUL, 0xba510cdfUL,
|
||||
0x81f47c9fUL, 0xad1163edUL, 0xea7b5965UL, 0x1a00726eUL, 0x11403092UL, 0x00da6d77UL,
|
||||
0x4a0cdd61UL, 0xad1f4603UL, 0x605bdfb0UL, 0x9eedc364UL, 0x22ebe6a8UL, 0xcee7d28aUL,
|
||||
0xa0e736a0UL, 0x5564a6b9UL, 0x10853209UL, 0xc7eb8f37UL, 0x2de705caUL, 0x8951570fUL,
|
||||
0xdf09822bUL, 0xbd691a6cUL, 0xaa12e4f2UL, 0x87451c0fUL, 0xe0f6a27aUL, 0x3ada4819UL,
|
||||
0x4cf1764fUL, 0x0d771c2bUL, 0x67cdb156UL, 0x350d8384UL, 0x5938fa0fUL, 0x42399ef3UL,
|
||||
0x36997b07UL, 0x0e84093dUL, 0x4aa93e61UL, 0x8360d87bUL, 0x1fa98b0cUL, 0x1149382cUL,
|
||||
0xe97625a5UL, 0x0614d1b7UL, 0x0e25244bUL, 0x0c768347UL, 0x589e8d82UL, 0x0d2059d1UL,
|
||||
0xa466bb1eUL, 0xf8da0a82UL, 0x04f19130UL, 0xba6e4ec0UL, 0x99265164UL, 0x1ee7230dUL,
|
||||
0x50b2ad80UL, 0xeaee6801UL, 0x8db2a283UL, 0xea8bf59eUL};
|
||||
|
||||
/* returns the i'th byte of a variable */
|
||||
#ifdef _MSC_VER
|
||||
#define GB(x, i) ((unsigned char)((x[(15-i)>>2])>>(unsigned)(8*((15-i)&3))))
|
||||
#else
|
||||
#define GB(x, i) (((x[(15-i)>>2])>>(unsigned)(8*((15-i)&3)))&255)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Initialize the LTC_CAST5 block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
#else
|
||||
int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 x[4], z[4];
|
||||
unsigned char buf[16];
|
||||
int y, i;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (num_rounds != 12 && num_rounds != 16 && num_rounds != 0) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
if (num_rounds == 12 && keylen > 10) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
if (keylen < 5 || keylen > 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
/* extend the key as required */
|
||||
zeromem(buf, sizeof(buf));
|
||||
XMEMCPY(buf, key, (size_t)keylen);
|
||||
|
||||
/* load and start the awful looking network */
|
||||
for (y = 0; y < 4; y++) {
|
||||
LOAD32H(x[3-y],buf+4*y);
|
||||
}
|
||||
|
||||
for (i = y = 0; y < 2; y++) {
|
||||
z[3] = x[3] ^ S5[GB(x, 0xD)] ^ S6[GB(x, 0xF)] ^ S7[GB(x, 0xC)] ^ S8[GB(x, 0xE)] ^ S7[GB(x, 0x8)];
|
||||
z[2] = x[1] ^ S5[GB(z, 0x0)] ^ S6[GB(z, 0x2)] ^ S7[GB(z, 0x1)] ^ S8[GB(z, 0x3)] ^ S8[GB(x, 0xA)];
|
||||
z[1] = x[0] ^ S5[GB(z, 0x7)] ^ S6[GB(z, 0x6)] ^ S7[GB(z, 0x5)] ^ S8[GB(z, 0x4)] ^ S5[GB(x, 0x9)];
|
||||
z[0] = x[2] ^ S5[GB(z, 0xA)] ^ S6[GB(z, 0x9)] ^ S7[GB(z, 0xb)] ^ S8[GB(z, 0x8)] ^ S6[GB(x, 0xB)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0x8)] ^ S6[GB(z, 0x9)] ^ S7[GB(z, 0x7)] ^ S8[GB(z, 0x6)] ^ S5[GB(z, 0x2)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0xA)] ^ S6[GB(z, 0xB)] ^ S7[GB(z, 0x5)] ^ S8[GB(z, 0x4)] ^ S6[GB(z, 0x6)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0xC)] ^ S6[GB(z, 0xd)] ^ S7[GB(z, 0x3)] ^ S8[GB(z, 0x2)] ^ S7[GB(z, 0x9)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0xE)] ^ S6[GB(z, 0xF)] ^ S7[GB(z, 0x1)] ^ S8[GB(z, 0x0)] ^ S8[GB(z, 0xc)];
|
||||
|
||||
x[3] = z[1] ^ S5[GB(z, 0x5)] ^ S6[GB(z, 0x7)] ^ S7[GB(z, 0x4)] ^ S8[GB(z, 0x6)] ^ S7[GB(z, 0x0)];
|
||||
x[2] = z[3] ^ S5[GB(x, 0x0)] ^ S6[GB(x, 0x2)] ^ S7[GB(x, 0x1)] ^ S8[GB(x, 0x3)] ^ S8[GB(z, 0x2)];
|
||||
x[1] = z[2] ^ S5[GB(x, 0x7)] ^ S6[GB(x, 0x6)] ^ S7[GB(x, 0x5)] ^ S8[GB(x, 0x4)] ^ S5[GB(z, 0x1)];
|
||||
x[0] = z[0] ^ S5[GB(x, 0xA)] ^ S6[GB(x, 0x9)] ^ S7[GB(x, 0xb)] ^ S8[GB(x, 0x8)] ^ S6[GB(z, 0x3)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0x3)] ^ S6[GB(x, 0x2)] ^ S7[GB(x, 0xc)] ^ S8[GB(x, 0xd)] ^ S5[GB(x, 0x8)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0x1)] ^ S6[GB(x, 0x0)] ^ S7[GB(x, 0xe)] ^ S8[GB(x, 0xf)] ^ S6[GB(x, 0xd)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0x7)] ^ S6[GB(x, 0x6)] ^ S7[GB(x, 0x8)] ^ S8[GB(x, 0x9)] ^ S7[GB(x, 0x3)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0x5)] ^ S6[GB(x, 0x4)] ^ S7[GB(x, 0xa)] ^ S8[GB(x, 0xb)] ^ S8[GB(x, 0x7)];
|
||||
|
||||
/* second half */
|
||||
z[3] = x[3] ^ S5[GB(x, 0xD)] ^ S6[GB(x, 0xF)] ^ S7[GB(x, 0xC)] ^ S8[GB(x, 0xE)] ^ S7[GB(x, 0x8)];
|
||||
z[2] = x[1] ^ S5[GB(z, 0x0)] ^ S6[GB(z, 0x2)] ^ S7[GB(z, 0x1)] ^ S8[GB(z, 0x3)] ^ S8[GB(x, 0xA)];
|
||||
z[1] = x[0] ^ S5[GB(z, 0x7)] ^ S6[GB(z, 0x6)] ^ S7[GB(z, 0x5)] ^ S8[GB(z, 0x4)] ^ S5[GB(x, 0x9)];
|
||||
z[0] = x[2] ^ S5[GB(z, 0xA)] ^ S6[GB(z, 0x9)] ^ S7[GB(z, 0xb)] ^ S8[GB(z, 0x8)] ^ S6[GB(x, 0xB)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0x3)] ^ S6[GB(z, 0x2)] ^ S7[GB(z, 0xc)] ^ S8[GB(z, 0xd)] ^ S5[GB(z, 0x9)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0x1)] ^ S6[GB(z, 0x0)] ^ S7[GB(z, 0xe)] ^ S8[GB(z, 0xf)] ^ S6[GB(z, 0xc)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0x7)] ^ S6[GB(z, 0x6)] ^ S7[GB(z, 0x8)] ^ S8[GB(z, 0x9)] ^ S7[GB(z, 0x2)];
|
||||
skey->cast5.K[i++] = S5[GB(z, 0x5)] ^ S6[GB(z, 0x4)] ^ S7[GB(z, 0xa)] ^ S8[GB(z, 0xb)] ^ S8[GB(z, 0x6)];
|
||||
|
||||
x[3] = z[1] ^ S5[GB(z, 0x5)] ^ S6[GB(z, 0x7)] ^ S7[GB(z, 0x4)] ^ S8[GB(z, 0x6)] ^ S7[GB(z, 0x0)];
|
||||
x[2] = z[3] ^ S5[GB(x, 0x0)] ^ S6[GB(x, 0x2)] ^ S7[GB(x, 0x1)] ^ S8[GB(x, 0x3)] ^ S8[GB(z, 0x2)];
|
||||
x[1] = z[2] ^ S5[GB(x, 0x7)] ^ S6[GB(x, 0x6)] ^ S7[GB(x, 0x5)] ^ S8[GB(x, 0x4)] ^ S5[GB(z, 0x1)];
|
||||
x[0] = z[0] ^ S5[GB(x, 0xA)] ^ S6[GB(x, 0x9)] ^ S7[GB(x, 0xb)] ^ S8[GB(x, 0x8)] ^ S6[GB(z, 0x3)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0x8)] ^ S6[GB(x, 0x9)] ^ S7[GB(x, 0x7)] ^ S8[GB(x, 0x6)] ^ S5[GB(x, 0x3)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0xa)] ^ S6[GB(x, 0xb)] ^ S7[GB(x, 0x5)] ^ S8[GB(x, 0x4)] ^ S6[GB(x, 0x7)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0xc)] ^ S6[GB(x, 0xd)] ^ S7[GB(x, 0x3)] ^ S8[GB(x, 0x2)] ^ S7[GB(x, 0x8)];
|
||||
skey->cast5.K[i++] = S5[GB(x, 0xe)] ^ S6[GB(x, 0xf)] ^ S7[GB(x, 0x1)] ^ S8[GB(x, 0x0)] ^ S8[GB(x, 0xd)];
|
||||
}
|
||||
|
||||
skey->cast5.keylen = keylen;
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(buf, sizeof(buf));
|
||||
zeromem(x, sizeof(x));
|
||||
zeromem(z, sizeof(z));
|
||||
#endif
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
int z;
|
||||
z = _cast5_setup(key, keylen, num_rounds, skey);
|
||||
burn_stack(sizeof(ulong32)*8 + 16 + sizeof(int)*2);
|
||||
return z;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define INLINE __inline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
|
||||
INLINE static ulong32 FI(ulong32 R, ulong32 Km, ulong32 Kr)
|
||||
{
|
||||
ulong32 I;
|
||||
I = (Km + R);
|
||||
I = ROL(I, Kr);
|
||||
return ((S1[byte(I, 3)] ^ S2[byte(I,2)]) - S3[byte(I,1)]) + S4[byte(I,0)];
|
||||
}
|
||||
|
||||
INLINE static ulong32 FII(ulong32 R, ulong32 Km, ulong32 Kr)
|
||||
{
|
||||
ulong32 I;
|
||||
I = (Km ^ R);
|
||||
I = ROL(I, Kr);
|
||||
return ((S1[byte(I, 3)] - S2[byte(I,2)]) + S3[byte(I,1)]) ^ S4[byte(I,0)];
|
||||
}
|
||||
|
||||
INLINE static ulong32 FIII(ulong32 R, ulong32 Km, ulong32 Kr)
|
||||
{
|
||||
ulong32 I;
|
||||
I = (Km - R);
|
||||
I = ROL(I, Kr);
|
||||
return ((S1[byte(I, 3)] + S2[byte(I,2)]) ^ S3[byte(I,1)]) - S4[byte(I,0)];
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with LTC_CAST5
|
||||
@param pt The input plaintext (8 bytes)
|
||||
@param ct The output ciphertext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#else
|
||||
int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 R, L;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
LOAD32H(L,&pt[0]);
|
||||
LOAD32H(R,&pt[4]);
|
||||
L ^= FI(R, skey->cast5.K[0], skey->cast5.K[16]);
|
||||
R ^= FII(L, skey->cast5.K[1], skey->cast5.K[17]);
|
||||
L ^= FIII(R, skey->cast5.K[2], skey->cast5.K[18]);
|
||||
R ^= FI(L, skey->cast5.K[3], skey->cast5.K[19]);
|
||||
L ^= FII(R, skey->cast5.K[4], skey->cast5.K[20]);
|
||||
R ^= FIII(L, skey->cast5.K[5], skey->cast5.K[21]);
|
||||
L ^= FI(R, skey->cast5.K[6], skey->cast5.K[22]);
|
||||
R ^= FII(L, skey->cast5.K[7], skey->cast5.K[23]);
|
||||
L ^= FIII(R, skey->cast5.K[8], skey->cast5.K[24]);
|
||||
R ^= FI(L, skey->cast5.K[9], skey->cast5.K[25]);
|
||||
L ^= FII(R, skey->cast5.K[10], skey->cast5.K[26]);
|
||||
R ^= FIII(L, skey->cast5.K[11], skey->cast5.K[27]);
|
||||
if (skey->cast5.keylen > 10) {
|
||||
L ^= FI(R, skey->cast5.K[12], skey->cast5.K[28]);
|
||||
R ^= FII(L, skey->cast5.K[13], skey->cast5.K[29]);
|
||||
L ^= FIII(R, skey->cast5.K[14], skey->cast5.K[30]);
|
||||
R ^= FI(L, skey->cast5.K[15], skey->cast5.K[31]);
|
||||
}
|
||||
STORE32H(R,&ct[0]);
|
||||
STORE32H(L,&ct[4]);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
int err =_cast5_ecb_encrypt(pt,ct,skey);
|
||||
burn_stack(sizeof(ulong32)*3);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Decrypts a block of text with LTC_CAST5
|
||||
@param ct The input ciphertext (8 bytes)
|
||||
@param pt The output plaintext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#else
|
||||
int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 R, L;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
LOAD32H(R,&ct[0]);
|
||||
LOAD32H(L,&ct[4]);
|
||||
if (skey->cast5.keylen > 10) {
|
||||
R ^= FI(L, skey->cast5.K[15], skey->cast5.K[31]);
|
||||
L ^= FIII(R, skey->cast5.K[14], skey->cast5.K[30]);
|
||||
R ^= FII(L, skey->cast5.K[13], skey->cast5.K[29]);
|
||||
L ^= FI(R, skey->cast5.K[12], skey->cast5.K[28]);
|
||||
}
|
||||
R ^= FIII(L, skey->cast5.K[11], skey->cast5.K[27]);
|
||||
L ^= FII(R, skey->cast5.K[10], skey->cast5.K[26]);
|
||||
R ^= FI(L, skey->cast5.K[9], skey->cast5.K[25]);
|
||||
L ^= FIII(R, skey->cast5.K[8], skey->cast5.K[24]);
|
||||
R ^= FII(L, skey->cast5.K[7], skey->cast5.K[23]);
|
||||
L ^= FI(R, skey->cast5.K[6], skey->cast5.K[22]);
|
||||
R ^= FIII(L, skey->cast5.K[5], skey->cast5.K[21]);
|
||||
L ^= FII(R, skey->cast5.K[4], skey->cast5.K[20]);
|
||||
R ^= FI(L, skey->cast5.K[3], skey->cast5.K[19]);
|
||||
L ^= FIII(R, skey->cast5.K[2], skey->cast5.K[18]);
|
||||
R ^= FII(L, skey->cast5.K[1], skey->cast5.K[17]);
|
||||
L ^= FI(R, skey->cast5.K[0], skey->cast5.K[16]);
|
||||
STORE32H(L,&pt[0]);
|
||||
STORE32H(R,&pt[4]);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
int err = _cast5_ecb_decrypt(ct,pt,skey);
|
||||
burn_stack(sizeof(ulong32)*3);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Performs a self-test of the LTC_CAST5 block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int cast5_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
int keylen;
|
||||
unsigned char key[16];
|
||||
unsigned char pt[8];
|
||||
unsigned char ct[8];
|
||||
} tests[] = {
|
||||
{ 16,
|
||||
{0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9A},
|
||||
{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
|
||||
{0x23, 0x8B, 0x4F, 0xE5, 0x84, 0x7E, 0x44, 0xB2}
|
||||
},
|
||||
{ 10,
|
||||
{0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 0x23, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
|
||||
{0xEB, 0x6A, 0x71, 0x1A, 0x2C, 0x02, 0x27, 0x1B},
|
||||
},
|
||||
{ 5,
|
||||
{0x01, 0x23, 0x45, 0x67, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
|
||||
{0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF},
|
||||
{0x7A, 0xC8, 0x16, 0xD1, 0x6E, 0x9B, 0x30, 0x2E}
|
||||
}
|
||||
};
|
||||
int i, y, err;
|
||||
symmetric_key key;
|
||||
unsigned char tmp[2][8];
|
||||
|
||||
for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
|
||||
if ((err = cast5_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
cast5_ecb_encrypt(tests[i].pt, tmp[0], &key);
|
||||
cast5_ecb_decrypt(tmp[0], tmp[1], &key);
|
||||
if ((compare_testvector(tmp[0], 8, tests[i].ct, 8, "CAST5 Encrypt", i) != 0) ||
|
||||
(compare_testvector(tmp[1], 8, tests[i].pt, 8, "CAST5 Decrypt", i) != 0)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 8; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) cast5_ecb_encrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 1000; y++) cast5_ecb_decrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void cast5_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int cast5_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 5) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else if (*keysize > 16) {
|
||||
*keysize = 16;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,318 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file kasumi.c
|
||||
Implementation of the 3GPP Kasumi block cipher
|
||||
Derived from the 3GPP standard source code
|
||||
*/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_KASUMI
|
||||
|
||||
typedef unsigned u16;
|
||||
|
||||
#define ROL16(x, y) ((((x)<<(y)) | ((x)>>(16-(y)))) & 0xFFFF)
|
||||
|
||||
const struct ltc_cipher_descriptor kasumi_desc = {
|
||||
"kasumi",
|
||||
21,
|
||||
16, 16, 8, 8,
|
||||
&kasumi_setup,
|
||||
&kasumi_ecb_encrypt,
|
||||
&kasumi_ecb_decrypt,
|
||||
&kasumi_test,
|
||||
&kasumi_done,
|
||||
&kasumi_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static u16 FI( u16 in, u16 subkey )
|
||||
{
|
||||
u16 nine, seven;
|
||||
static const u16 S7[128] = {
|
||||
54, 50, 62, 56, 22, 34, 94, 96, 38, 6, 63, 93, 2, 18,123, 33,
|
||||
55,113, 39,114, 21, 67, 65, 12, 47, 73, 46, 27, 25,111,124, 81,
|
||||
53, 9,121, 79, 52, 60, 58, 48,101,127, 40,120,104, 70, 71, 43,
|
||||
20,122, 72, 61, 23,109, 13,100, 77, 1, 16, 7, 82, 10,105, 98,
|
||||
117,116, 76, 11, 89,106, 0,125,118, 99, 86, 69, 30, 57,126, 87,
|
||||
112, 51, 17, 5, 95, 14, 90, 84, 91, 8, 35,103, 32, 97, 28, 66,
|
||||
102, 31, 26, 45, 75, 4, 85, 92, 37, 74, 80, 49, 68, 29,115, 44,
|
||||
64,107,108, 24,110, 83, 36, 78, 42, 19, 15, 41, 88,119, 59, 3 };
|
||||
static const u16 S9[512] = {
|
||||
167,239,161,379,391,334, 9,338, 38,226, 48,358,452,385, 90,397,
|
||||
183,253,147,331,415,340, 51,362,306,500,262, 82,216,159,356,177,
|
||||
175,241,489, 37,206, 17, 0,333, 44,254,378, 58,143,220, 81,400,
|
||||
95, 3,315,245, 54,235,218,405,472,264,172,494,371,290,399, 76,
|
||||
165,197,395,121,257,480,423,212,240, 28,462,176,406,507,288,223,
|
||||
501,407,249,265, 89,186,221,428,164, 74,440,196,458,421,350,163,
|
||||
232,158,134,354, 13,250,491,142,191, 69,193,425,152,227,366,135,
|
||||
344,300,276,242,437,320,113,278, 11,243, 87,317, 36, 93,496, 27,
|
||||
487,446,482, 41, 68,156,457,131,326,403,339, 20, 39,115,442,124,
|
||||
475,384,508, 53,112,170,479,151,126,169, 73,268,279,321,168,364,
|
||||
363,292, 46,499,393,327,324, 24,456,267,157,460,488,426,309,229,
|
||||
439,506,208,271,349,401,434,236, 16,209,359, 52, 56,120,199,277,
|
||||
465,416,252,287,246, 6, 83,305,420,345,153,502, 65, 61,244,282,
|
||||
173,222,418, 67,386,368,261,101,476,291,195,430, 49, 79,166,330,
|
||||
280,383,373,128,382,408,155,495,367,388,274,107,459,417, 62,454,
|
||||
132,225,203,316,234, 14,301, 91,503,286,424,211,347,307,140,374,
|
||||
35,103,125,427, 19,214,453,146,498,314,444,230,256,329,198,285,
|
||||
50,116, 78,410, 10,205,510,171,231, 45,139,467, 29, 86,505, 32,
|
||||
72, 26,342,150,313,490,431,238,411,325,149,473, 40,119,174,355,
|
||||
185,233,389, 71,448,273,372, 55,110,178,322, 12,469,392,369,190,
|
||||
1,109,375,137,181, 88, 75,308,260,484, 98,272,370,275,412,111,
|
||||
336,318, 4,504,492,259,304, 77,337,435, 21,357,303,332,483, 18,
|
||||
47, 85, 25,497,474,289,100,269,296,478,270,106, 31,104,433, 84,
|
||||
414,486,394, 96, 99,154,511,148,413,361,409,255,162,215,302,201,
|
||||
266,351,343,144,441,365,108,298,251, 34,182,509,138,210,335,133,
|
||||
311,352,328,141,396,346,123,319,450,281,429,228,443,481, 92,404,
|
||||
485,422,248,297, 23,213,130,466, 22,217,283, 70,294,360,419,127,
|
||||
312,377, 7,468,194, 2,117,295,463,258,224,447,247,187, 80,398,
|
||||
284,353,105,390,299,471,470,184, 57,200,348, 63,204,188, 33,451,
|
||||
97, 30,310,219, 94,160,129,493, 64,179,263,102,189,207,114,402,
|
||||
438,477,387,122,192, 42,381, 5,145,118,180,449,293,323,136,380,
|
||||
43, 66, 60,455,341,445,202,432, 8,237, 15,376,436,464, 59,461};
|
||||
|
||||
/* The sixteen bit input is split into two unequal halves, *
|
||||
* nine bits and seven bits - as is the subkey */
|
||||
|
||||
nine = (u16)(in>>7)&0x1FF;
|
||||
seven = (u16)(in&0x7F);
|
||||
|
||||
/* Now run the various operations */
|
||||
nine = (u16)(S9[nine] ^ seven);
|
||||
seven = (u16)(S7[seven] ^ (nine & 0x7F));
|
||||
seven ^= (subkey>>9);
|
||||
nine ^= (subkey&0x1FF);
|
||||
nine = (u16)(S9[nine] ^ seven);
|
||||
seven = (u16)(S7[seven] ^ (nine & 0x7F));
|
||||
return (u16)(seven<<9) + nine;
|
||||
}
|
||||
|
||||
static ulong32 FO( ulong32 in, int round_no, symmetric_key *key)
|
||||
{
|
||||
u16 left, right;
|
||||
|
||||
/* Split the input into two 16-bit words */
|
||||
left = (u16)(in>>16);
|
||||
right = (u16) in&0xFFFF;
|
||||
|
||||
/* Now apply the same basic transformation three times */
|
||||
left ^= key->kasumi.KOi1[round_no];
|
||||
left = FI( left, key->kasumi.KIi1[round_no] );
|
||||
left ^= right;
|
||||
|
||||
right ^= key->kasumi.KOi2[round_no];
|
||||
right = FI( right, key->kasumi.KIi2[round_no] );
|
||||
right ^= left;
|
||||
|
||||
left ^= key->kasumi.KOi3[round_no];
|
||||
left = FI( left, key->kasumi.KIi3[round_no] );
|
||||
left ^= right;
|
||||
|
||||
return (((ulong32)right)<<16)+left;
|
||||
}
|
||||
|
||||
static ulong32 FL( ulong32 in, int round_no, symmetric_key *key )
|
||||
{
|
||||
u16 l, r, a, b;
|
||||
/* split out the left and right halves */
|
||||
l = (u16)(in>>16);
|
||||
r = (u16)(in)&0xFFFF;
|
||||
/* do the FL() operations */
|
||||
a = (u16) (l & key->kasumi.KLi1[round_no]);
|
||||
r ^= ROL16(a,1);
|
||||
b = (u16)(r | key->kasumi.KLi2[round_no]);
|
||||
l ^= ROL16(b,1);
|
||||
/* put the two halves back together */
|
||||
|
||||
return (((ulong32)l)<<16) + r;
|
||||
}
|
||||
|
||||
int kasumi_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
ulong32 left, right, temp;
|
||||
int n;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
LOAD32H(left, pt);
|
||||
LOAD32H(right, pt+4);
|
||||
|
||||
for (n = 0; n <= 7; ) {
|
||||
temp = FL(left, n, skey);
|
||||
temp = FO(temp, n++, skey);
|
||||
right ^= temp;
|
||||
temp = FO(right, n, skey);
|
||||
temp = FL(temp, n++, skey);
|
||||
left ^= temp;
|
||||
}
|
||||
|
||||
STORE32H(left, ct);
|
||||
STORE32H(right, ct+4);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int kasumi_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
ulong32 left, right, temp;
|
||||
int n;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
LOAD32H(left, ct);
|
||||
LOAD32H(right, ct+4);
|
||||
|
||||
for (n = 7; n >= 0; ) {
|
||||
temp = FO(right, n, skey);
|
||||
temp = FL(temp, n--, skey);
|
||||
left ^= temp;
|
||||
temp = FL(left, n, skey);
|
||||
temp = FO(temp, n--, skey);
|
||||
right ^= temp;
|
||||
}
|
||||
|
||||
STORE32H(left, pt);
|
||||
STORE32H(right, pt+4);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int kasumi_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
static const u16 C[8] = { 0x0123,0x4567,0x89AB,0xCDEF, 0xFEDC,0xBA98,0x7654,0x3210 };
|
||||
u16 ukey[8], Kprime[8];
|
||||
int n;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (keylen != 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
if (num_rounds != 0 && num_rounds != 8) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* Start by ensuring the subkeys are endian correct on a 16-bit basis */
|
||||
for (n = 0; n < 8; n++ ) {
|
||||
ukey[n] = (((u16)key[2*n]) << 8) | key[2*n+1];
|
||||
}
|
||||
|
||||
/* Now build the K'[] keys */
|
||||
for (n = 0; n < 8; n++) {
|
||||
Kprime[n] = ukey[n] ^ C[n];
|
||||
}
|
||||
|
||||
/* Finally construct the various sub keys */
|
||||
for(n = 0; n < 8; n++) {
|
||||
skey->kasumi.KLi1[n] = ROL16(ukey[n],1);
|
||||
skey->kasumi.KLi2[n] = Kprime[(n+2)&0x7];
|
||||
skey->kasumi.KOi1[n] = ROL16(ukey[(n+1)&0x7],5);
|
||||
skey->kasumi.KOi2[n] = ROL16(ukey[(n+5)&0x7],8);
|
||||
skey->kasumi.KOi3[n] = ROL16(ukey[(n+6)&0x7],13);
|
||||
skey->kasumi.KIi1[n] = Kprime[(n+4)&0x7];
|
||||
skey->kasumi.KIi2[n] = Kprime[(n+3)&0x7];
|
||||
skey->kasumi.KIi3[n] = Kprime[(n+7)&0x7];
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
void kasumi_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
int kasumi_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize >= 16) {
|
||||
*keysize = 16;
|
||||
return CRYPT_OK;
|
||||
} else {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
}
|
||||
|
||||
int kasumi_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
unsigned char key[16], pt[8], ct[8];
|
||||
} tests[] = {
|
||||
|
||||
{
|
||||
{ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x4B, 0x58, 0xA7, 0x71, 0xAF, 0xC7, 0xE5, 0xE8 }
|
||||
},
|
||||
|
||||
{
|
||||
{ 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x7E, 0xEF, 0x11, 0x3C, 0x95, 0xBB, 0x5A, 0x77 }
|
||||
},
|
||||
|
||||
{
|
||||
{ 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x5F, 0x14, 0x06, 0x86, 0xD7, 0xAD, 0x5A, 0x39 },
|
||||
},
|
||||
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x2E, 0x14, 0x91, 0xCF, 0x70, 0xAA, 0x46, 0x5D }
|
||||
},
|
||||
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0xB5, 0x45, 0x86, 0xF4, 0xAB, 0x9A, 0xE5, 0x46 }
|
||||
},
|
||||
|
||||
};
|
||||
unsigned char buf[2][8];
|
||||
symmetric_key key;
|
||||
int err, x;
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) {
|
||||
if ((err = kasumi_setup(tests[x].key, 16, 0, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = kasumi_ecb_encrypt(tests[x].pt, buf[0], &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = kasumi_ecb_decrypt(tests[x].ct, buf[1], &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if (compare_testvector(buf[1], 8, tests[x].pt, 8, "Kasumi Decrypt", x) ||
|
||||
compare_testvector(buf[0], 8, tests[x].ct, 8, "Kasumi Encrypt", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,855 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file khazad.c
|
||||
Khazad implementation derived from public domain source
|
||||
Authors: Paulo S.L.M. Barreto and Vincent Rijmen.
|
||||
*/
|
||||
|
||||
#ifdef LTC_KHAZAD
|
||||
|
||||
const struct ltc_cipher_descriptor khazad_desc = {
|
||||
"khazad",
|
||||
18,
|
||||
16, 16, 8, 8,
|
||||
&khazad_setup,
|
||||
&khazad_ecb_encrypt,
|
||||
&khazad_ecb_decrypt,
|
||||
&khazad_test,
|
||||
&khazad_done,
|
||||
&khazad_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
#define R 8
|
||||
#define KEYSIZE 128
|
||||
#define KEYSIZEB (KEYSIZE/8)
|
||||
#define BLOCKSIZE 64
|
||||
#define BLOCKSIZEB (BLOCKSIZE/8)
|
||||
|
||||
static const ulong64 T0[256] = {
|
||||
CONST64(0xbad3d268bbb96a01), CONST64(0x54fc4d19e59a66b1), CONST64(0x2f71bc93e26514cd), CONST64(0x749ccdb925871b51),
|
||||
CONST64(0x53f55102f7a257a4), CONST64(0xd3686bb8d0d6be03), CONST64(0xd26b6fbdd6deb504), CONST64(0x4dd72964b35285fe),
|
||||
CONST64(0x50f05d0dfdba4aad), CONST64(0xace98a26cf09e063), CONST64(0x8d8a0e83091c9684), CONST64(0xbfdcc679a5914d1a),
|
||||
CONST64(0x7090ddad3da7374d), CONST64(0x52f65507f1aa5ca3), CONST64(0x9ab352c87ba417e1), CONST64(0x4cd42d61b55a8ef9),
|
||||
CONST64(0xea238f65460320ac), CONST64(0xd56273a6c4e68411), CONST64(0x97a466f155cc68c2), CONST64(0xd16e63b2dcc6a80d),
|
||||
CONST64(0x3355ccffaa85d099), CONST64(0x51f35908fbb241aa), CONST64(0x5bed712ac7e20f9c), CONST64(0xa6f7a204f359ae55),
|
||||
CONST64(0xde7f5f81febec120), CONST64(0x48d83d75ad7aa2e5), CONST64(0xa8e59a32d729cc7f), CONST64(0x99b65ec771bc0ae8),
|
||||
CONST64(0xdb704b90e096e63b), CONST64(0x3256c8faac8ddb9e), CONST64(0xb7c4e65195d11522), CONST64(0xfc19d72b32b3aace),
|
||||
CONST64(0xe338ab48704b7393), CONST64(0x9ebf42dc63843bfd), CONST64(0x91ae7eef41fc52d0), CONST64(0x9bb056cd7dac1ce6),
|
||||
CONST64(0xe23baf4d76437894), CONST64(0xbbd0d66dbdb16106), CONST64(0x41c319589b32f1da), CONST64(0x6eb2a5cb7957e517),
|
||||
CONST64(0xa5f2ae0bf941b35c), CONST64(0xcb400bc08016564b), CONST64(0x6bbdb1da677fc20c), CONST64(0x95a26efb59dc7ecc),
|
||||
CONST64(0xa1febe1fe1619f40), CONST64(0xf308eb1810cbc3e3), CONST64(0xb1cefe4f81e12f30), CONST64(0x0206080a0c10160e),
|
||||
CONST64(0xcc4917db922e675e), CONST64(0xc45137f3a26e3f66), CONST64(0x1d2774694ee8cf53), CONST64(0x143c504478a09c6c),
|
||||
CONST64(0xc3582be8b0560e73), CONST64(0x63a591f2573f9a34), CONST64(0xda734f95e69eed3c), CONST64(0x5de76934d3d2358e),
|
||||
CONST64(0x5fe1613edfc22380), CONST64(0xdc79578bf2aed72e), CONST64(0x7d87e99413cf486e), CONST64(0xcd4a13de94266c59),
|
||||
CONST64(0x7f81e19e1fdf5e60), CONST64(0x5aee752fc1ea049b), CONST64(0x6cb4adc17547f319), CONST64(0x5ce46d31d5da3e89),
|
||||
CONST64(0xf704fb0c08ebefff), CONST64(0x266a98bed42d47f2), CONST64(0xff1cdb2438abb7c7), CONST64(0xed2a937e543b11b9),
|
||||
CONST64(0xe825876f4a1336a2), CONST64(0x9dba4ed3699c26f4), CONST64(0x6fb1a1ce7f5fee10), CONST64(0x8e8f028c03048b8d),
|
||||
CONST64(0x192b647d56c8e34f), CONST64(0xa0fdba1ae7699447), CONST64(0xf00de7171ad3deea), CONST64(0x89861e97113cba98),
|
||||
CONST64(0x0f113c332278692d), CONST64(0x07091c1b12383115), CONST64(0xafec8629c511fd6a), CONST64(0xfb10cb30208b9bdb),
|
||||
CONST64(0x0818202830405838), CONST64(0x153f54417ea8976b), CONST64(0x0d1734392e687f23), CONST64(0x040c101418202c1c),
|
||||
CONST64(0x0103040506080b07), CONST64(0x64ac8de94507ab21), CONST64(0xdf7c5b84f8b6ca27), CONST64(0x769ac5b329970d5f),
|
||||
CONST64(0x798bf9800bef6472), CONST64(0xdd7a538ef4a6dc29), CONST64(0x3d47f4c98ef5b2b3), CONST64(0x163a584e74b08a62),
|
||||
CONST64(0x3f41fcc382e5a4bd), CONST64(0x3759dcebb2a5fc85), CONST64(0x6db7a9c4734ff81e), CONST64(0x3848e0d890dd95a8),
|
||||
CONST64(0xb9d6de67b1a17708), CONST64(0x7395d1a237bf2a44), CONST64(0xe926836a4c1b3da5), CONST64(0x355fd4e1beb5ea8b),
|
||||
CONST64(0x55ff491ce3926db6), CONST64(0x7193d9a83baf3c4a), CONST64(0x7b8df18a07ff727c), CONST64(0x8c890a860f149d83),
|
||||
CONST64(0x7296d5a731b72143), CONST64(0x88851a921734b19f), CONST64(0xf607ff090ee3e4f8), CONST64(0x2a7ea882fc4d33d6),
|
||||
CONST64(0x3e42f8c684edafba), CONST64(0x5ee2653bd9ca2887), CONST64(0x27699cbbd2254cf5), CONST64(0x46ca0543890ac0cf),
|
||||
CONST64(0x0c14303c28607424), CONST64(0x65af89ec430fa026), CONST64(0x68b8bdd56d67df05), CONST64(0x61a399f85b2f8c3a),
|
||||
CONST64(0x03050c0f0a181d09), CONST64(0xc15e23e2bc46187d), CONST64(0x57f94116ef827bb8), CONST64(0xd6677fa9cefe9918),
|
||||
CONST64(0xd976439aec86f035), CONST64(0x58e87d25cdfa1295), CONST64(0xd875479fea8efb32), CONST64(0x66aa85e34917bd2f),
|
||||
CONST64(0xd7647bacc8f6921f), CONST64(0x3a4ee8d29ccd83a6), CONST64(0xc84507cf8a0e4b42), CONST64(0x3c44f0cc88fdb9b4),
|
||||
CONST64(0xfa13cf35268390dc), CONST64(0x96a762f453c463c5), CONST64(0xa7f4a601f551a552), CONST64(0x98b55ac277b401ef),
|
||||
CONST64(0xec29977b52331abe), CONST64(0xb8d5da62b7a97c0f), CONST64(0xc7543bfca876226f), CONST64(0xaeef822cc319f66d),
|
||||
CONST64(0x69bbb9d06b6fd402), CONST64(0x4bdd317aa762bfec), CONST64(0xabe0963ddd31d176), CONST64(0xa9e69e37d121c778),
|
||||
CONST64(0x67a981e64f1fb628), CONST64(0x0a1e28223c504e36), CONST64(0x47c901468f02cbc8), CONST64(0xf20bef1d16c3c8e4),
|
||||
CONST64(0xb5c2ee5b99c1032c), CONST64(0x226688aacc0d6bee), CONST64(0xe532b356647b4981), CONST64(0xee2f9f715e230cb0),
|
||||
CONST64(0xbedfc27ca399461d), CONST64(0x2b7dac87fa4538d1), CONST64(0x819e3ebf217ce2a0), CONST64(0x1236485a6c90a67e),
|
||||
CONST64(0x839836b52d6cf4ae), CONST64(0x1b2d6c775ad8f541), CONST64(0x0e1238362470622a), CONST64(0x23658cafca0560e9),
|
||||
CONST64(0xf502f30604fbf9f1), CONST64(0x45cf094c8312ddc6), CONST64(0x216384a5c61576e7), CONST64(0xce4f1fd19e3e7150),
|
||||
CONST64(0x49db3970ab72a9e2), CONST64(0x2c74b09ce87d09c4), CONST64(0xf916c33a2c9b8dd5), CONST64(0xe637bf596e635488),
|
||||
CONST64(0xb6c7e25493d91e25), CONST64(0x2878a088f05d25d8), CONST64(0x17395c4b72b88165), CONST64(0x829b32b02b64ffa9),
|
||||
CONST64(0x1a2e68725cd0fe46), CONST64(0x8b80169d1d2cac96), CONST64(0xfe1fdf213ea3bcc0), CONST64(0x8a8312981b24a791),
|
||||
CONST64(0x091b242d3648533f), CONST64(0xc94603ca8c064045), CONST64(0x879426a1354cd8b2), CONST64(0x4ed2256bb94a98f7),
|
||||
CONST64(0xe13ea3427c5b659d), CONST64(0x2e72b896e46d1fca), CONST64(0xe431b75362734286), CONST64(0xe03da7477a536e9a),
|
||||
CONST64(0xeb208b60400b2bab), CONST64(0x90ad7aea47f459d7), CONST64(0xa4f1aa0eff49b85b), CONST64(0x1e22786644f0d25a),
|
||||
CONST64(0x85922eab395ccebc), CONST64(0x60a09dfd5d27873d), CONST64(0x0000000000000000), CONST64(0x256f94b1de355afb),
|
||||
CONST64(0xf401f70302f3f2f6), CONST64(0xf10ee3121cdbd5ed), CONST64(0x94a16afe5fd475cb), CONST64(0x0b1d2c273a584531),
|
||||
CONST64(0xe734bb5c686b5f8f), CONST64(0x759fc9bc238f1056), CONST64(0xef2c9b74582b07b7), CONST64(0x345cd0e4b8bde18c),
|
||||
CONST64(0x3153c4f5a695c697), CONST64(0xd46177a3c2ee8f16), CONST64(0xd06d67b7dacea30a), CONST64(0x869722a43344d3b5),
|
||||
CONST64(0x7e82e59b19d75567), CONST64(0xadea8e23c901eb64), CONST64(0xfd1ad32e34bba1c9), CONST64(0x297ba48df6552edf),
|
||||
CONST64(0x3050c0f0a09dcd90), CONST64(0x3b4decd79ac588a1), CONST64(0x9fbc46d9658c30fa), CONST64(0xf815c73f2a9386d2),
|
||||
CONST64(0xc6573ff9ae7e2968), CONST64(0x13354c5f6a98ad79), CONST64(0x060a181e14303a12), CONST64(0x050f14111e28271b),
|
||||
CONST64(0xc55233f6a4663461), CONST64(0x113344556688bb77), CONST64(0x7799c1b62f9f0658), CONST64(0x7c84ed9115c74369),
|
||||
CONST64(0x7a8ef58f01f7797b), CONST64(0x7888fd850de76f75), CONST64(0x365ad8eeb4adf782), CONST64(0x1c24706c48e0c454),
|
||||
CONST64(0x394be4dd96d59eaf), CONST64(0x59eb7920cbf21992), CONST64(0x1828607850c0e848), CONST64(0x56fa4513e98a70bf),
|
||||
CONST64(0xb3c8f6458df1393e), CONST64(0xb0cdfa4a87e92437), CONST64(0x246c90b4d83d51fc), CONST64(0x206080a0c01d7de0),
|
||||
CONST64(0xb2cbf2408bf93239), CONST64(0x92ab72e04be44fd9), CONST64(0xa3f8b615ed71894e), CONST64(0xc05d27e7ba4e137a),
|
||||
CONST64(0x44cc0d49851ad6c1), CONST64(0x62a695f751379133), CONST64(0x103040506080b070), CONST64(0xb4c1ea5e9fc9082b),
|
||||
CONST64(0x84912aae3f54c5bb), CONST64(0x43c511529722e7d4), CONST64(0x93a876e54dec44de), CONST64(0xc25b2fedb65e0574),
|
||||
CONST64(0x4ade357fa16ab4eb), CONST64(0xbddace73a9815b14), CONST64(0x8f8c0689050c808a), CONST64(0x2d77b499ee7502c3),
|
||||
CONST64(0xbcd9ca76af895013), CONST64(0x9cb94ad66f942df3), CONST64(0x6abeb5df6177c90b), CONST64(0x40c01d5d9d3afadd),
|
||||
CONST64(0xcf4c1bd498367a57), CONST64(0xa2fbb210eb798249), CONST64(0x809d3aba2774e9a7), CONST64(0x4fd1216ebf4293f0),
|
||||
CONST64(0x1f217c6342f8d95d), CONST64(0xca430fc5861e5d4c), CONST64(0xaae39238db39da71), CONST64(0x42c61557912aecd3),
|
||||
};
|
||||
|
||||
static const ulong64 T1[256] = {
|
||||
CONST64(0xd3ba68d2b9bb016a), CONST64(0xfc54194d9ae5b166), CONST64(0x712f93bc65e2cd14), CONST64(0x9c74b9cd8725511b),
|
||||
CONST64(0xf5530251a2f7a457), CONST64(0x68d3b86bd6d003be), CONST64(0x6bd2bd6fded604b5), CONST64(0xd74d642952b3fe85),
|
||||
CONST64(0xf0500d5dbafdad4a), CONST64(0xe9ac268a09cf63e0), CONST64(0x8a8d830e1c098496), CONST64(0xdcbf79c691a51a4d),
|
||||
CONST64(0x9070addda73d4d37), CONST64(0xf6520755aaf1a35c), CONST64(0xb39ac852a47be117), CONST64(0xd44c612d5ab5f98e),
|
||||
CONST64(0x23ea658f0346ac20), CONST64(0x62d5a673e6c41184), CONST64(0xa497f166cc55c268), CONST64(0x6ed1b263c6dc0da8),
|
||||
CONST64(0x5533ffcc85aa99d0), CONST64(0xf3510859b2fbaa41), CONST64(0xed5b2a71e2c79c0f), CONST64(0xf7a604a259f355ae),
|
||||
CONST64(0x7fde815fbefe20c1), CONST64(0xd848753d7aade5a2), CONST64(0xe5a8329a29d77fcc), CONST64(0xb699c75ebc71e80a),
|
||||
CONST64(0x70db904b96e03be6), CONST64(0x5632fac88dac9edb), CONST64(0xc4b751e6d1952215), CONST64(0x19fc2bd7b332ceaa),
|
||||
CONST64(0x38e348ab4b709373), CONST64(0xbf9edc428463fd3b), CONST64(0xae91ef7efc41d052), CONST64(0xb09bcd56ac7de61c),
|
||||
CONST64(0x3be24daf43769478), CONST64(0xd0bb6dd6b1bd0661), CONST64(0xc3415819329bdaf1), CONST64(0xb26ecba5577917e5),
|
||||
CONST64(0xf2a50bae41f95cb3), CONST64(0x40cbc00b16804b56), CONST64(0xbd6bdab17f670cc2), CONST64(0xa295fb6edc59cc7e),
|
||||
CONST64(0xfea11fbe61e1409f), CONST64(0x08f318ebcb10e3c3), CONST64(0xceb14ffee181302f), CONST64(0x06020a08100c0e16),
|
||||
CONST64(0x49ccdb172e925e67), CONST64(0x51c4f3376ea2663f), CONST64(0x271d6974e84e53cf), CONST64(0x3c144450a0786c9c),
|
||||
CONST64(0x58c3e82b56b0730e), CONST64(0xa563f2913f57349a), CONST64(0x73da954f9ee63ced), CONST64(0xe75d3469d2d38e35),
|
||||
CONST64(0xe15f3e61c2df8023), CONST64(0x79dc8b57aef22ed7), CONST64(0x877d94e9cf136e48), CONST64(0x4acdde132694596c),
|
||||
CONST64(0x817f9ee1df1f605e), CONST64(0xee5a2f75eac19b04), CONST64(0xb46cc1ad477519f3), CONST64(0xe45c316ddad5893e),
|
||||
CONST64(0x04f70cfbeb08ffef), CONST64(0x6a26be982dd4f247), CONST64(0x1cff24dbab38c7b7), CONST64(0x2aed7e933b54b911),
|
||||
CONST64(0x25e86f87134aa236), CONST64(0xba9dd34e9c69f426), CONST64(0xb16fcea15f7f10ee), CONST64(0x8f8e8c0204038d8b),
|
||||
CONST64(0x2b197d64c8564fe3), CONST64(0xfda01aba69e74794), CONST64(0x0df017e7d31aeade), CONST64(0x8689971e3c1198ba),
|
||||
CONST64(0x110f333c78222d69), CONST64(0x09071b1c38121531), CONST64(0xecaf298611c56afd), CONST64(0x10fb30cb8b20db9b),
|
||||
CONST64(0x1808282040303858), CONST64(0x3f154154a87e6b97), CONST64(0x170d3934682e237f), CONST64(0x0c04141020181c2c),
|
||||
CONST64(0x030105040806070b), CONST64(0xac64e98d074521ab), CONST64(0x7cdf845bb6f827ca), CONST64(0x9a76b3c597295f0d),
|
||||
CONST64(0x8b7980f9ef0b7264), CONST64(0x7add8e53a6f429dc), CONST64(0x473dc9f4f58eb3b2), CONST64(0x3a164e58b074628a),
|
||||
CONST64(0x413fc3fce582bda4), CONST64(0x5937ebdca5b285fc), CONST64(0xb76dc4a94f731ef8), CONST64(0x4838d8e0dd90a895),
|
||||
CONST64(0xd6b967dea1b10877), CONST64(0x9573a2d1bf37442a), CONST64(0x26e96a831b4ca53d), CONST64(0x5f35e1d4b5be8bea),
|
||||
CONST64(0xff551c4992e3b66d), CONST64(0x9371a8d9af3b4a3c), CONST64(0x8d7b8af1ff077c72), CONST64(0x898c860a140f839d),
|
||||
CONST64(0x9672a7d5b7314321), CONST64(0x8588921a34179fb1), CONST64(0x07f609ffe30ef8e4), CONST64(0x7e2a82a84dfcd633),
|
||||
CONST64(0x423ec6f8ed84baaf), CONST64(0xe25e3b65cad98728), CONST64(0x6927bb9c25d2f54c), CONST64(0xca4643050a89cfc0),
|
||||
CONST64(0x140c3c3060282474), CONST64(0xaf65ec890f4326a0), CONST64(0xb868d5bd676d05df), CONST64(0xa361f8992f5b3a8c),
|
||||
CONST64(0x05030f0c180a091d), CONST64(0x5ec1e22346bc7d18), CONST64(0xf957164182efb87b), CONST64(0x67d6a97ffece1899),
|
||||
CONST64(0x76d99a4386ec35f0), CONST64(0xe858257dfacd9512), CONST64(0x75d89f478eea32fb), CONST64(0xaa66e38517492fbd),
|
||||
CONST64(0x64d7ac7bf6c81f92), CONST64(0x4e3ad2e8cd9ca683), CONST64(0x45c8cf070e8a424b), CONST64(0x443cccf0fd88b4b9),
|
||||
CONST64(0x13fa35cf8326dc90), CONST64(0xa796f462c453c563), CONST64(0xf4a701a651f552a5), CONST64(0xb598c25ab477ef01),
|
||||
CONST64(0x29ec7b973352be1a), CONST64(0xd5b862daa9b70f7c), CONST64(0x54c7fc3b76a86f22), CONST64(0xefae2c8219c36df6),
|
||||
CONST64(0xbb69d0b96f6b02d4), CONST64(0xdd4b7a3162a7ecbf), CONST64(0xe0ab3d9631dd76d1), CONST64(0xe6a9379e21d178c7),
|
||||
CONST64(0xa967e6811f4f28b6), CONST64(0x1e0a2228503c364e), CONST64(0xc9474601028fc8cb), CONST64(0x0bf21defc316e4c8),
|
||||
CONST64(0xc2b55beec1992c03), CONST64(0x6622aa880dccee6b), CONST64(0x32e556b37b648149), CONST64(0x2fee719f235eb00c),
|
||||
CONST64(0xdfbe7cc299a31d46), CONST64(0x7d2b87ac45fad138), CONST64(0x9e81bf3e7c21a0e2), CONST64(0x36125a48906c7ea6),
|
||||
CONST64(0x9883b5366c2daef4), CONST64(0x2d1b776cd85a41f5), CONST64(0x120e363870242a62), CONST64(0x6523af8c05cae960),
|
||||
CONST64(0x02f506f3fb04f1f9), CONST64(0xcf454c091283c6dd), CONST64(0x6321a58415c6e776), CONST64(0x4fced11f3e9e5071),
|
||||
CONST64(0xdb49703972abe2a9), CONST64(0x742c9cb07de8c409), CONST64(0x16f93ac39b2cd58d), CONST64(0x37e659bf636e8854),
|
||||
CONST64(0xc7b654e2d993251e), CONST64(0x782888a05df0d825), CONST64(0x39174b5cb8726581), CONST64(0x9b82b032642ba9ff),
|
||||
CONST64(0x2e1a7268d05c46fe), CONST64(0x808b9d162c1d96ac), CONST64(0x1ffe21dfa33ec0bc), CONST64(0x838a9812241b91a7),
|
||||
CONST64(0x1b092d2448363f53), CONST64(0x46c9ca03068c4540), CONST64(0x9487a1264c35b2d8), CONST64(0xd24e6b254ab9f798),
|
||||
CONST64(0x3ee142a35b7c9d65), CONST64(0x722e96b86de4ca1f), CONST64(0x31e453b773628642), CONST64(0x3de047a7537a9a6e),
|
||||
CONST64(0x20eb608b0b40ab2b), CONST64(0xad90ea7af447d759), CONST64(0xf1a40eaa49ff5bb8), CONST64(0x221e6678f0445ad2),
|
||||
CONST64(0x9285ab2e5c39bcce), CONST64(0xa060fd9d275d3d87), CONST64(0x0000000000000000), CONST64(0x6f25b19435defb5a),
|
||||
CONST64(0x01f403f7f302f6f2), CONST64(0x0ef112e3db1cedd5), CONST64(0xa194fe6ad45fcb75), CONST64(0x1d0b272c583a3145),
|
||||
CONST64(0x34e75cbb6b688f5f), CONST64(0x9f75bcc98f235610), CONST64(0x2cef749b2b58b707), CONST64(0x5c34e4d0bdb88ce1),
|
||||
CONST64(0x5331f5c495a697c6), CONST64(0x61d4a377eec2168f), CONST64(0x6dd0b767ceda0aa3), CONST64(0x9786a4224433b5d3),
|
||||
CONST64(0x827e9be5d7196755), CONST64(0xeaad238e01c964eb), CONST64(0x1afd2ed3bb34c9a1), CONST64(0x7b298da455f6df2e),
|
||||
CONST64(0x5030f0c09da090cd), CONST64(0x4d3bd7ecc59aa188), CONST64(0xbc9fd9468c65fa30), CONST64(0x15f83fc7932ad286),
|
||||
CONST64(0x57c6f93f7eae6829), CONST64(0x35135f4c986a79ad), CONST64(0x0a061e183014123a), CONST64(0x0f051114281e1b27),
|
||||
CONST64(0x52c5f63366a46134), CONST64(0x33115544886677bb), CONST64(0x9977b6c19f2f5806), CONST64(0x847c91edc7156943),
|
||||
CONST64(0x8e7a8ff5f7017b79), CONST64(0x887885fde70d756f), CONST64(0x5a36eed8adb482f7), CONST64(0x241c6c70e04854c4),
|
||||
CONST64(0x4b39dde4d596af9e), CONST64(0xeb592079f2cb9219), CONST64(0x28187860c05048e8), CONST64(0xfa5613458ae9bf70),
|
||||
CONST64(0xc8b345f6f18d3e39), CONST64(0xcdb04afae9873724), CONST64(0x6c24b4903dd8fc51), CONST64(0x6020a0801dc0e07d),
|
||||
CONST64(0xcbb240f2f98b3932), CONST64(0xab92e072e44bd94f), CONST64(0xf8a315b671ed4e89), CONST64(0x5dc0e7274eba7a13),
|
||||
CONST64(0xcc44490d1a85c1d6), CONST64(0xa662f79537513391), CONST64(0x30105040806070b0), CONST64(0xc1b45eeac99f2b08),
|
||||
CONST64(0x9184ae2a543fbbc5), CONST64(0xc54352112297d4e7), CONST64(0xa893e576ec4dde44), CONST64(0x5bc2ed2f5eb67405),
|
||||
CONST64(0xde4a7f356aa1ebb4), CONST64(0xdabd73ce81a9145b), CONST64(0x8c8f89060c058a80), CONST64(0x772d99b475eec302),
|
||||
CONST64(0xd9bc76ca89af1350), CONST64(0xb99cd64a946ff32d), CONST64(0xbe6adfb577610bc9), CONST64(0xc0405d1d3a9dddfa),
|
||||
CONST64(0x4ccfd41b3698577a), CONST64(0xfba210b279eb4982), CONST64(0x9d80ba3a7427a7e9), CONST64(0xd14f6e2142bff093),
|
||||
CONST64(0x211f637cf8425dd9), CONST64(0x43cac50f1e864c5d), CONST64(0xe3aa389239db71da), CONST64(0xc64257152a91d3ec),
|
||||
};
|
||||
|
||||
static const ulong64 T2[256] = {
|
||||
CONST64(0xd268bad36a01bbb9), CONST64(0x4d1954fc66b1e59a), CONST64(0xbc932f7114cde265), CONST64(0xcdb9749c1b512587),
|
||||
CONST64(0x510253f557a4f7a2), CONST64(0x6bb8d368be03d0d6), CONST64(0x6fbdd26bb504d6de), CONST64(0x29644dd785feb352),
|
||||
CONST64(0x5d0d50f04aadfdba), CONST64(0x8a26ace9e063cf09), CONST64(0x0e838d8a9684091c), CONST64(0xc679bfdc4d1aa591),
|
||||
CONST64(0xddad7090374d3da7), CONST64(0x550752f65ca3f1aa), CONST64(0x52c89ab317e17ba4), CONST64(0x2d614cd48ef9b55a),
|
||||
CONST64(0x8f65ea2320ac4603), CONST64(0x73a6d5628411c4e6), CONST64(0x66f197a468c255cc), CONST64(0x63b2d16ea80ddcc6),
|
||||
CONST64(0xccff3355d099aa85), CONST64(0x590851f341aafbb2), CONST64(0x712a5bed0f9cc7e2), CONST64(0xa204a6f7ae55f359),
|
||||
CONST64(0x5f81de7fc120febe), CONST64(0x3d7548d8a2e5ad7a), CONST64(0x9a32a8e5cc7fd729), CONST64(0x5ec799b60ae871bc),
|
||||
CONST64(0x4b90db70e63be096), CONST64(0xc8fa3256db9eac8d), CONST64(0xe651b7c4152295d1), CONST64(0xd72bfc19aace32b3),
|
||||
CONST64(0xab48e3387393704b), CONST64(0x42dc9ebf3bfd6384), CONST64(0x7eef91ae52d041fc), CONST64(0x56cd9bb01ce67dac),
|
||||
CONST64(0xaf4de23b78947643), CONST64(0xd66dbbd06106bdb1), CONST64(0x195841c3f1da9b32), CONST64(0xa5cb6eb2e5177957),
|
||||
CONST64(0xae0ba5f2b35cf941), CONST64(0x0bc0cb40564b8016), CONST64(0xb1da6bbdc20c677f), CONST64(0x6efb95a27ecc59dc),
|
||||
CONST64(0xbe1fa1fe9f40e161), CONST64(0xeb18f308c3e310cb), CONST64(0xfe4fb1ce2f3081e1), CONST64(0x080a0206160e0c10),
|
||||
CONST64(0x17dbcc49675e922e), CONST64(0x37f3c4513f66a26e), CONST64(0x74691d27cf534ee8), CONST64(0x5044143c9c6c78a0),
|
||||
CONST64(0x2be8c3580e73b056), CONST64(0x91f263a59a34573f), CONST64(0x4f95da73ed3ce69e), CONST64(0x69345de7358ed3d2),
|
||||
CONST64(0x613e5fe12380dfc2), CONST64(0x578bdc79d72ef2ae), CONST64(0xe9947d87486e13cf), CONST64(0x13decd4a6c599426),
|
||||
CONST64(0xe19e7f815e601fdf), CONST64(0x752f5aee049bc1ea), CONST64(0xadc16cb4f3197547), CONST64(0x6d315ce43e89d5da),
|
||||
CONST64(0xfb0cf704efff08eb), CONST64(0x98be266a47f2d42d), CONST64(0xdb24ff1cb7c738ab), CONST64(0x937eed2a11b9543b),
|
||||
CONST64(0x876fe82536a24a13), CONST64(0x4ed39dba26f4699c), CONST64(0xa1ce6fb1ee107f5f), CONST64(0x028c8e8f8b8d0304),
|
||||
CONST64(0x647d192be34f56c8), CONST64(0xba1aa0fd9447e769), CONST64(0xe717f00ddeea1ad3), CONST64(0x1e978986ba98113c),
|
||||
CONST64(0x3c330f11692d2278), CONST64(0x1c1b070931151238), CONST64(0x8629afecfd6ac511), CONST64(0xcb30fb109bdb208b),
|
||||
CONST64(0x2028081858383040), CONST64(0x5441153f976b7ea8), CONST64(0x34390d177f232e68), CONST64(0x1014040c2c1c1820),
|
||||
CONST64(0x040501030b070608), CONST64(0x8de964acab214507), CONST64(0x5b84df7cca27f8b6), CONST64(0xc5b3769a0d5f2997),
|
||||
CONST64(0xf980798b64720bef), CONST64(0x538edd7adc29f4a6), CONST64(0xf4c93d47b2b38ef5), CONST64(0x584e163a8a6274b0),
|
||||
CONST64(0xfcc33f41a4bd82e5), CONST64(0xdceb3759fc85b2a5), CONST64(0xa9c46db7f81e734f), CONST64(0xe0d8384895a890dd),
|
||||
CONST64(0xde67b9d67708b1a1), CONST64(0xd1a273952a4437bf), CONST64(0x836ae9263da54c1b), CONST64(0xd4e1355fea8bbeb5),
|
||||
CONST64(0x491c55ff6db6e392), CONST64(0xd9a871933c4a3baf), CONST64(0xf18a7b8d727c07ff), CONST64(0x0a868c899d830f14),
|
||||
CONST64(0xd5a77296214331b7), CONST64(0x1a928885b19f1734), CONST64(0xff09f607e4f80ee3), CONST64(0xa8822a7e33d6fc4d),
|
||||
CONST64(0xf8c63e42afba84ed), CONST64(0x653b5ee22887d9ca), CONST64(0x9cbb27694cf5d225), CONST64(0x054346cac0cf890a),
|
||||
CONST64(0x303c0c1474242860), CONST64(0x89ec65afa026430f), CONST64(0xbdd568b8df056d67), CONST64(0x99f861a38c3a5b2f),
|
||||
CONST64(0x0c0f03051d090a18), CONST64(0x23e2c15e187dbc46), CONST64(0x411657f97bb8ef82), CONST64(0x7fa9d6679918cefe),
|
||||
CONST64(0x439ad976f035ec86), CONST64(0x7d2558e81295cdfa), CONST64(0x479fd875fb32ea8e), CONST64(0x85e366aabd2f4917),
|
||||
CONST64(0x7bacd764921fc8f6), CONST64(0xe8d23a4e83a69ccd), CONST64(0x07cfc8454b428a0e), CONST64(0xf0cc3c44b9b488fd),
|
||||
CONST64(0xcf35fa1390dc2683), CONST64(0x62f496a763c553c4), CONST64(0xa601a7f4a552f551), CONST64(0x5ac298b501ef77b4),
|
||||
CONST64(0x977bec291abe5233), CONST64(0xda62b8d57c0fb7a9), CONST64(0x3bfcc754226fa876), CONST64(0x822caeeff66dc319),
|
||||
CONST64(0xb9d069bbd4026b6f), CONST64(0x317a4bddbfeca762), CONST64(0x963dabe0d176dd31), CONST64(0x9e37a9e6c778d121),
|
||||
CONST64(0x81e667a9b6284f1f), CONST64(0x28220a1e4e363c50), CONST64(0x014647c9cbc88f02), CONST64(0xef1df20bc8e416c3),
|
||||
CONST64(0xee5bb5c2032c99c1), CONST64(0x88aa22666beecc0d), CONST64(0xb356e5324981647b), CONST64(0x9f71ee2f0cb05e23),
|
||||
CONST64(0xc27cbedf461da399), CONST64(0xac872b7d38d1fa45), CONST64(0x3ebf819ee2a0217c), CONST64(0x485a1236a67e6c90),
|
||||
CONST64(0x36b58398f4ae2d6c), CONST64(0x6c771b2df5415ad8), CONST64(0x38360e12622a2470), CONST64(0x8caf236560e9ca05),
|
||||
CONST64(0xf306f502f9f104fb), CONST64(0x094c45cfddc68312), CONST64(0x84a5216376e7c615), CONST64(0x1fd1ce4f71509e3e),
|
||||
CONST64(0x397049dba9e2ab72), CONST64(0xb09c2c7409c4e87d), CONST64(0xc33af9168dd52c9b), CONST64(0xbf59e63754886e63),
|
||||
CONST64(0xe254b6c71e2593d9), CONST64(0xa088287825d8f05d), CONST64(0x5c4b1739816572b8), CONST64(0x32b0829bffa92b64),
|
||||
CONST64(0x68721a2efe465cd0), CONST64(0x169d8b80ac961d2c), CONST64(0xdf21fe1fbcc03ea3), CONST64(0x12988a83a7911b24),
|
||||
CONST64(0x242d091b533f3648), CONST64(0x03cac94640458c06), CONST64(0x26a18794d8b2354c), CONST64(0x256b4ed298f7b94a),
|
||||
CONST64(0xa342e13e659d7c5b), CONST64(0xb8962e721fcae46d), CONST64(0xb753e43142866273), CONST64(0xa747e03d6e9a7a53),
|
||||
CONST64(0x8b60eb202bab400b), CONST64(0x7aea90ad59d747f4), CONST64(0xaa0ea4f1b85bff49), CONST64(0x78661e22d25a44f0),
|
||||
CONST64(0x2eab8592cebc395c), CONST64(0x9dfd60a0873d5d27), CONST64(0x0000000000000000), CONST64(0x94b1256f5afbde35),
|
||||
CONST64(0xf703f401f2f602f3), CONST64(0xe312f10ed5ed1cdb), CONST64(0x6afe94a175cb5fd4), CONST64(0x2c270b1d45313a58),
|
||||
CONST64(0xbb5ce7345f8f686b), CONST64(0xc9bc759f1056238f), CONST64(0x9b74ef2c07b7582b), CONST64(0xd0e4345ce18cb8bd),
|
||||
CONST64(0xc4f53153c697a695), CONST64(0x77a3d4618f16c2ee), CONST64(0x67b7d06da30adace), CONST64(0x22a48697d3b53344),
|
||||
CONST64(0xe59b7e82556719d7), CONST64(0x8e23adeaeb64c901), CONST64(0xd32efd1aa1c934bb), CONST64(0xa48d297b2edff655),
|
||||
CONST64(0xc0f03050cd90a09d), CONST64(0xecd73b4d88a19ac5), CONST64(0x46d99fbc30fa658c), CONST64(0xc73ff81586d22a93),
|
||||
CONST64(0x3ff9c6572968ae7e), CONST64(0x4c5f1335ad796a98), CONST64(0x181e060a3a121430), CONST64(0x1411050f271b1e28),
|
||||
CONST64(0x33f6c5523461a466), CONST64(0x44551133bb776688), CONST64(0xc1b6779906582f9f), CONST64(0xed917c84436915c7),
|
||||
CONST64(0xf58f7a8e797b01f7), CONST64(0xfd8578886f750de7), CONST64(0xd8ee365af782b4ad), CONST64(0x706c1c24c45448e0),
|
||||
CONST64(0xe4dd394b9eaf96d5), CONST64(0x792059eb1992cbf2), CONST64(0x60781828e84850c0), CONST64(0x451356fa70bfe98a),
|
||||
CONST64(0xf645b3c8393e8df1), CONST64(0xfa4ab0cd243787e9), CONST64(0x90b4246c51fcd83d), CONST64(0x80a020607de0c01d),
|
||||
CONST64(0xf240b2cb32398bf9), CONST64(0x72e092ab4fd94be4), CONST64(0xb615a3f8894eed71), CONST64(0x27e7c05d137aba4e),
|
||||
CONST64(0x0d4944ccd6c1851a), CONST64(0x95f762a691335137), CONST64(0x40501030b0706080), CONST64(0xea5eb4c1082b9fc9),
|
||||
CONST64(0x2aae8491c5bb3f54), CONST64(0x115243c5e7d49722), CONST64(0x76e593a844de4dec), CONST64(0x2fedc25b0574b65e),
|
||||
CONST64(0x357f4adeb4eba16a), CONST64(0xce73bdda5b14a981), CONST64(0x06898f8c808a050c), CONST64(0xb4992d7702c3ee75),
|
||||
CONST64(0xca76bcd95013af89), CONST64(0x4ad69cb92df36f94), CONST64(0xb5df6abec90b6177), CONST64(0x1d5d40c0fadd9d3a),
|
||||
CONST64(0x1bd4cf4c7a579836), CONST64(0xb210a2fb8249eb79), CONST64(0x3aba809de9a72774), CONST64(0x216e4fd193f0bf42),
|
||||
CONST64(0x7c631f21d95d42f8), CONST64(0x0fc5ca435d4c861e), CONST64(0x9238aae3da71db39), CONST64(0x155742c6ecd3912a),
|
||||
};
|
||||
|
||||
static const ulong64 T3[256] = {
|
||||
CONST64(0x68d2d3ba016ab9bb), CONST64(0x194dfc54b1669ae5), CONST64(0x93bc712fcd1465e2), CONST64(0xb9cd9c74511b8725),
|
||||
CONST64(0x0251f553a457a2f7), CONST64(0xb86b68d303bed6d0), CONST64(0xbd6f6bd204b5ded6), CONST64(0x6429d74dfe8552b3),
|
||||
CONST64(0x0d5df050ad4abafd), CONST64(0x268ae9ac63e009cf), CONST64(0x830e8a8d84961c09), CONST64(0x79c6dcbf1a4d91a5),
|
||||
CONST64(0xaddd90704d37a73d), CONST64(0x0755f652a35caaf1), CONST64(0xc852b39ae117a47b), CONST64(0x612dd44cf98e5ab5),
|
||||
CONST64(0x658f23eaac200346), CONST64(0xa67362d51184e6c4), CONST64(0xf166a497c268cc55), CONST64(0xb2636ed10da8c6dc),
|
||||
CONST64(0xffcc553399d085aa), CONST64(0x0859f351aa41b2fb), CONST64(0x2a71ed5b9c0fe2c7), CONST64(0x04a2f7a655ae59f3),
|
||||
CONST64(0x815f7fde20c1befe), CONST64(0x753dd848e5a27aad), CONST64(0x329ae5a87fcc29d7), CONST64(0xc75eb699e80abc71),
|
||||
CONST64(0x904b70db3be696e0), CONST64(0xfac856329edb8dac), CONST64(0x51e6c4b72215d195), CONST64(0x2bd719fcceaab332),
|
||||
CONST64(0x48ab38e393734b70), CONST64(0xdc42bf9efd3b8463), CONST64(0xef7eae91d052fc41), CONST64(0xcd56b09be61cac7d),
|
||||
CONST64(0x4daf3be294784376), CONST64(0x6dd6d0bb0661b1bd), CONST64(0x5819c341daf1329b), CONST64(0xcba5b26e17e55779),
|
||||
CONST64(0x0baef2a55cb341f9), CONST64(0xc00b40cb4b561680), CONST64(0xdab1bd6b0cc27f67), CONST64(0xfb6ea295cc7edc59),
|
||||
CONST64(0x1fbefea1409f61e1), CONST64(0x18eb08f3e3c3cb10), CONST64(0x4ffeceb1302fe181), CONST64(0x0a0806020e16100c),
|
||||
CONST64(0xdb1749cc5e672e92), CONST64(0xf33751c4663f6ea2), CONST64(0x6974271d53cfe84e), CONST64(0x44503c146c9ca078),
|
||||
CONST64(0xe82b58c3730e56b0), CONST64(0xf291a563349a3f57), CONST64(0x954f73da3ced9ee6), CONST64(0x3469e75d8e35d2d3),
|
||||
CONST64(0x3e61e15f8023c2df), CONST64(0x8b5779dc2ed7aef2), CONST64(0x94e9877d6e48cf13), CONST64(0xde134acd596c2694),
|
||||
CONST64(0x9ee1817f605edf1f), CONST64(0x2f75ee5a9b04eac1), CONST64(0xc1adb46c19f34775), CONST64(0x316de45c893edad5),
|
||||
CONST64(0x0cfb04f7ffefeb08), CONST64(0xbe986a26f2472dd4), CONST64(0x24db1cffc7b7ab38), CONST64(0x7e932aedb9113b54),
|
||||
CONST64(0x6f8725e8a236134a), CONST64(0xd34eba9df4269c69), CONST64(0xcea1b16f10ee5f7f), CONST64(0x8c028f8e8d8b0403),
|
||||
CONST64(0x7d642b194fe3c856), CONST64(0x1abafda0479469e7), CONST64(0x17e70df0eaded31a), CONST64(0x971e868998ba3c11),
|
||||
CONST64(0x333c110f2d697822), CONST64(0x1b1c090715313812), CONST64(0x2986ecaf6afd11c5), CONST64(0x30cb10fbdb9b8b20),
|
||||
CONST64(0x2820180838584030), CONST64(0x41543f156b97a87e), CONST64(0x3934170d237f682e), CONST64(0x14100c041c2c2018),
|
||||
CONST64(0x05040301070b0806), CONST64(0xe98dac6421ab0745), CONST64(0x845b7cdf27cab6f8), CONST64(0xb3c59a765f0d9729),
|
||||
CONST64(0x80f98b797264ef0b), CONST64(0x8e537add29dca6f4), CONST64(0xc9f4473db3b2f58e), CONST64(0x4e583a16628ab074),
|
||||
CONST64(0xc3fc413fbda4e582), CONST64(0xebdc593785fca5b2), CONST64(0xc4a9b76d1ef84f73), CONST64(0xd8e04838a895dd90),
|
||||
CONST64(0x67ded6b90877a1b1), CONST64(0xa2d19573442abf37), CONST64(0x6a8326e9a53d1b4c), CONST64(0xe1d45f358beab5be),
|
||||
CONST64(0x1c49ff55b66d92e3), CONST64(0xa8d993714a3caf3b), CONST64(0x8af18d7b7c72ff07), CONST64(0x860a898c839d140f),
|
||||
CONST64(0xa7d596724321b731), CONST64(0x921a85889fb13417), CONST64(0x09ff07f6f8e4e30e), CONST64(0x82a87e2ad6334dfc),
|
||||
CONST64(0xc6f8423ebaafed84), CONST64(0x3b65e25e8728cad9), CONST64(0xbb9c6927f54c25d2), CONST64(0x4305ca46cfc00a89),
|
||||
CONST64(0x3c30140c24746028), CONST64(0xec89af6526a00f43), CONST64(0xd5bdb86805df676d), CONST64(0xf899a3613a8c2f5b),
|
||||
CONST64(0x0f0c0503091d180a), CONST64(0xe2235ec17d1846bc), CONST64(0x1641f957b87b82ef), CONST64(0xa97f67d61899fece),
|
||||
CONST64(0x9a4376d935f086ec), CONST64(0x257de8589512facd), CONST64(0x9f4775d832fb8eea), CONST64(0xe385aa662fbd1749),
|
||||
CONST64(0xac7b64d71f92f6c8), CONST64(0xd2e84e3aa683cd9c), CONST64(0xcf0745c8424b0e8a), CONST64(0xccf0443cb4b9fd88),
|
||||
CONST64(0x35cf13fadc908326), CONST64(0xf462a796c563c453), CONST64(0x01a6f4a752a551f5), CONST64(0xc25ab598ef01b477),
|
||||
CONST64(0x7b9729ecbe1a3352), CONST64(0x62dad5b80f7ca9b7), CONST64(0xfc3b54c76f2276a8), CONST64(0x2c82efae6df619c3),
|
||||
CONST64(0xd0b9bb6902d46f6b), CONST64(0x7a31dd4becbf62a7), CONST64(0x3d96e0ab76d131dd), CONST64(0x379ee6a978c721d1),
|
||||
CONST64(0xe681a96728b61f4f), CONST64(0x22281e0a364e503c), CONST64(0x4601c947c8cb028f), CONST64(0x1def0bf2e4c8c316),
|
||||
CONST64(0x5beec2b52c03c199), CONST64(0xaa886622ee6b0dcc), CONST64(0x56b332e581497b64), CONST64(0x719f2feeb00c235e),
|
||||
CONST64(0x7cc2dfbe1d4699a3), CONST64(0x87ac7d2bd13845fa), CONST64(0xbf3e9e81a0e27c21), CONST64(0x5a4836127ea6906c),
|
||||
CONST64(0xb5369883aef46c2d), CONST64(0x776c2d1b41f5d85a), CONST64(0x3638120e2a627024), CONST64(0xaf8c6523e96005ca),
|
||||
CONST64(0x06f302f5f1f9fb04), CONST64(0x4c09cf45c6dd1283), CONST64(0xa5846321e77615c6), CONST64(0xd11f4fce50713e9e),
|
||||
CONST64(0x7039db49e2a972ab), CONST64(0x9cb0742cc4097de8), CONST64(0x3ac316f9d58d9b2c), CONST64(0x59bf37e68854636e),
|
||||
CONST64(0x54e2c7b6251ed993), CONST64(0x88a07828d8255df0), CONST64(0x4b5c39176581b872), CONST64(0xb0329b82a9ff642b),
|
||||
CONST64(0x72682e1a46fed05c), CONST64(0x9d16808b96ac2c1d), CONST64(0x21df1ffec0bca33e), CONST64(0x9812838a91a7241b),
|
||||
CONST64(0x2d241b093f534836), CONST64(0xca0346c94540068c), CONST64(0xa1269487b2d84c35), CONST64(0x6b25d24ef7984ab9),
|
||||
CONST64(0x42a33ee19d655b7c), CONST64(0x96b8722eca1f6de4), CONST64(0x53b731e486427362), CONST64(0x47a73de09a6e537a),
|
||||
CONST64(0x608b20ebab2b0b40), CONST64(0xea7aad90d759f447), CONST64(0x0eaaf1a45bb849ff), CONST64(0x6678221e5ad2f044),
|
||||
CONST64(0xab2e9285bcce5c39), CONST64(0xfd9da0603d87275d), CONST64(0x0000000000000000), CONST64(0xb1946f25fb5a35de),
|
||||
CONST64(0x03f701f4f6f2f302), CONST64(0x12e30ef1edd5db1c), CONST64(0xfe6aa194cb75d45f), CONST64(0x272c1d0b3145583a),
|
||||
CONST64(0x5cbb34e78f5f6b68), CONST64(0xbcc99f7556108f23), CONST64(0x749b2cefb7072b58), CONST64(0xe4d05c348ce1bdb8),
|
||||
CONST64(0xf5c4533197c695a6), CONST64(0xa37761d4168feec2), CONST64(0xb7676dd00aa3ceda), CONST64(0xa4229786b5d34433),
|
||||
CONST64(0x9be5827e6755d719), CONST64(0x238eeaad64eb01c9), CONST64(0x2ed31afdc9a1bb34), CONST64(0x8da47b29df2e55f6),
|
||||
CONST64(0xf0c0503090cd9da0), CONST64(0xd7ec4d3ba188c59a), CONST64(0xd946bc9ffa308c65), CONST64(0x3fc715f8d286932a),
|
||||
CONST64(0xf93f57c668297eae), CONST64(0x5f4c351379ad986a), CONST64(0x1e180a06123a3014), CONST64(0x11140f051b27281e),
|
||||
CONST64(0xf63352c5613466a4), CONST64(0x5544331177bb8866), CONST64(0xb6c1997758069f2f), CONST64(0x91ed847c6943c715),
|
||||
CONST64(0x8ff58e7a7b79f701), CONST64(0x85fd8878756fe70d), CONST64(0xeed85a3682f7adb4), CONST64(0x6c70241c54c4e048),
|
||||
CONST64(0xdde44b39af9ed596), CONST64(0x2079eb599219f2cb), CONST64(0x7860281848e8c050), CONST64(0x1345fa56bf708ae9),
|
||||
CONST64(0x45f6c8b33e39f18d), CONST64(0x4afacdb03724e987), CONST64(0xb4906c24fc513dd8), CONST64(0xa0806020e07d1dc0),
|
||||
CONST64(0x40f2cbb23932f98b), CONST64(0xe072ab92d94fe44b), CONST64(0x15b6f8a34e8971ed), CONST64(0xe7275dc07a134eba),
|
||||
CONST64(0x490dcc44c1d61a85), CONST64(0xf795a66233913751), CONST64(0x5040301070b08060), CONST64(0x5eeac1b42b08c99f),
|
||||
CONST64(0xae2a9184bbc5543f), CONST64(0x5211c543d4e72297), CONST64(0xe576a893de44ec4d), CONST64(0xed2f5bc274055eb6),
|
||||
CONST64(0x7f35de4aebb46aa1), CONST64(0x73cedabd145b81a9), CONST64(0x89068c8f8a800c05), CONST64(0x99b4772dc30275ee),
|
||||
CONST64(0x76cad9bc135089af), CONST64(0xd64ab99cf32d946f), CONST64(0xdfb5be6a0bc97761), CONST64(0x5d1dc040ddfa3a9d),
|
||||
CONST64(0xd41b4ccf577a3698), CONST64(0x10b2fba2498279eb), CONST64(0xba3a9d80a7e97427), CONST64(0x6e21d14ff09342bf),
|
||||
CONST64(0x637c211f5dd9f842), CONST64(0xc50f43ca4c5d1e86), CONST64(0x3892e3aa71da39db), CONST64(0x5715c642d3ec2a91),
|
||||
};
|
||||
|
||||
static const ulong64 T4[256] = {
|
||||
CONST64(0xbbb96a01bad3d268), CONST64(0xe59a66b154fc4d19), CONST64(0xe26514cd2f71bc93), CONST64(0x25871b51749ccdb9),
|
||||
CONST64(0xf7a257a453f55102), CONST64(0xd0d6be03d3686bb8), CONST64(0xd6deb504d26b6fbd), CONST64(0xb35285fe4dd72964),
|
||||
CONST64(0xfdba4aad50f05d0d), CONST64(0xcf09e063ace98a26), CONST64(0x091c96848d8a0e83), CONST64(0xa5914d1abfdcc679),
|
||||
CONST64(0x3da7374d7090ddad), CONST64(0xf1aa5ca352f65507), CONST64(0x7ba417e19ab352c8), CONST64(0xb55a8ef94cd42d61),
|
||||
CONST64(0x460320acea238f65), CONST64(0xc4e68411d56273a6), CONST64(0x55cc68c297a466f1), CONST64(0xdcc6a80dd16e63b2),
|
||||
CONST64(0xaa85d0993355ccff), CONST64(0xfbb241aa51f35908), CONST64(0xc7e20f9c5bed712a), CONST64(0xf359ae55a6f7a204),
|
||||
CONST64(0xfebec120de7f5f81), CONST64(0xad7aa2e548d83d75), CONST64(0xd729cc7fa8e59a32), CONST64(0x71bc0ae899b65ec7),
|
||||
CONST64(0xe096e63bdb704b90), CONST64(0xac8ddb9e3256c8fa), CONST64(0x95d11522b7c4e651), CONST64(0x32b3aacefc19d72b),
|
||||
CONST64(0x704b7393e338ab48), CONST64(0x63843bfd9ebf42dc), CONST64(0x41fc52d091ae7eef), CONST64(0x7dac1ce69bb056cd),
|
||||
CONST64(0x76437894e23baf4d), CONST64(0xbdb16106bbd0d66d), CONST64(0x9b32f1da41c31958), CONST64(0x7957e5176eb2a5cb),
|
||||
CONST64(0xf941b35ca5f2ae0b), CONST64(0x8016564bcb400bc0), CONST64(0x677fc20c6bbdb1da), CONST64(0x59dc7ecc95a26efb),
|
||||
CONST64(0xe1619f40a1febe1f), CONST64(0x10cbc3e3f308eb18), CONST64(0x81e12f30b1cefe4f), CONST64(0x0c10160e0206080a),
|
||||
CONST64(0x922e675ecc4917db), CONST64(0xa26e3f66c45137f3), CONST64(0x4ee8cf531d277469), CONST64(0x78a09c6c143c5044),
|
||||
CONST64(0xb0560e73c3582be8), CONST64(0x573f9a3463a591f2), CONST64(0xe69eed3cda734f95), CONST64(0xd3d2358e5de76934),
|
||||
CONST64(0xdfc223805fe1613e), CONST64(0xf2aed72edc79578b), CONST64(0x13cf486e7d87e994), CONST64(0x94266c59cd4a13de),
|
||||
CONST64(0x1fdf5e607f81e19e), CONST64(0xc1ea049b5aee752f), CONST64(0x7547f3196cb4adc1), CONST64(0xd5da3e895ce46d31),
|
||||
CONST64(0x08ebeffff704fb0c), CONST64(0xd42d47f2266a98be), CONST64(0x38abb7c7ff1cdb24), CONST64(0x543b11b9ed2a937e),
|
||||
CONST64(0x4a1336a2e825876f), CONST64(0x699c26f49dba4ed3), CONST64(0x7f5fee106fb1a1ce), CONST64(0x03048b8d8e8f028c),
|
||||
CONST64(0x56c8e34f192b647d), CONST64(0xe7699447a0fdba1a), CONST64(0x1ad3deeaf00de717), CONST64(0x113cba9889861e97),
|
||||
CONST64(0x2278692d0f113c33), CONST64(0x1238311507091c1b), CONST64(0xc511fd6aafec8629), CONST64(0x208b9bdbfb10cb30),
|
||||
CONST64(0x3040583808182028), CONST64(0x7ea8976b153f5441), CONST64(0x2e687f230d173439), CONST64(0x18202c1c040c1014),
|
||||
CONST64(0x06080b0701030405), CONST64(0x4507ab2164ac8de9), CONST64(0xf8b6ca27df7c5b84), CONST64(0x29970d5f769ac5b3),
|
||||
CONST64(0x0bef6472798bf980), CONST64(0xf4a6dc29dd7a538e), CONST64(0x8ef5b2b33d47f4c9), CONST64(0x74b08a62163a584e),
|
||||
CONST64(0x82e5a4bd3f41fcc3), CONST64(0xb2a5fc853759dceb), CONST64(0x734ff81e6db7a9c4), CONST64(0x90dd95a83848e0d8),
|
||||
CONST64(0xb1a17708b9d6de67), CONST64(0x37bf2a447395d1a2), CONST64(0x4c1b3da5e926836a), CONST64(0xbeb5ea8b355fd4e1),
|
||||
CONST64(0xe3926db655ff491c), CONST64(0x3baf3c4a7193d9a8), CONST64(0x07ff727c7b8df18a), CONST64(0x0f149d838c890a86),
|
||||
CONST64(0x31b721437296d5a7), CONST64(0x1734b19f88851a92), CONST64(0x0ee3e4f8f607ff09), CONST64(0xfc4d33d62a7ea882),
|
||||
CONST64(0x84edafba3e42f8c6), CONST64(0xd9ca28875ee2653b), CONST64(0xd2254cf527699cbb), CONST64(0x890ac0cf46ca0543),
|
||||
CONST64(0x286074240c14303c), CONST64(0x430fa02665af89ec), CONST64(0x6d67df0568b8bdd5), CONST64(0x5b2f8c3a61a399f8),
|
||||
CONST64(0x0a181d0903050c0f), CONST64(0xbc46187dc15e23e2), CONST64(0xef827bb857f94116), CONST64(0xcefe9918d6677fa9),
|
||||
CONST64(0xec86f035d976439a), CONST64(0xcdfa129558e87d25), CONST64(0xea8efb32d875479f), CONST64(0x4917bd2f66aa85e3),
|
||||
CONST64(0xc8f6921fd7647bac), CONST64(0x9ccd83a63a4ee8d2), CONST64(0x8a0e4b42c84507cf), CONST64(0x88fdb9b43c44f0cc),
|
||||
CONST64(0x268390dcfa13cf35), CONST64(0x53c463c596a762f4), CONST64(0xf551a552a7f4a601), CONST64(0x77b401ef98b55ac2),
|
||||
CONST64(0x52331abeec29977b), CONST64(0xb7a97c0fb8d5da62), CONST64(0xa876226fc7543bfc), CONST64(0xc319f66daeef822c),
|
||||
CONST64(0x6b6fd40269bbb9d0), CONST64(0xa762bfec4bdd317a), CONST64(0xdd31d176abe0963d), CONST64(0xd121c778a9e69e37),
|
||||
CONST64(0x4f1fb62867a981e6), CONST64(0x3c504e360a1e2822), CONST64(0x8f02cbc847c90146), CONST64(0x16c3c8e4f20bef1d),
|
||||
CONST64(0x99c1032cb5c2ee5b), CONST64(0xcc0d6bee226688aa), CONST64(0x647b4981e532b356), CONST64(0x5e230cb0ee2f9f71),
|
||||
CONST64(0xa399461dbedfc27c), CONST64(0xfa4538d12b7dac87), CONST64(0x217ce2a0819e3ebf), CONST64(0x6c90a67e1236485a),
|
||||
CONST64(0x2d6cf4ae839836b5), CONST64(0x5ad8f5411b2d6c77), CONST64(0x2470622a0e123836), CONST64(0xca0560e923658caf),
|
||||
CONST64(0x04fbf9f1f502f306), CONST64(0x8312ddc645cf094c), CONST64(0xc61576e7216384a5), CONST64(0x9e3e7150ce4f1fd1),
|
||||
CONST64(0xab72a9e249db3970), CONST64(0xe87d09c42c74b09c), CONST64(0x2c9b8dd5f916c33a), CONST64(0x6e635488e637bf59),
|
||||
CONST64(0x93d91e25b6c7e254), CONST64(0xf05d25d82878a088), CONST64(0x72b8816517395c4b), CONST64(0x2b64ffa9829b32b0),
|
||||
CONST64(0x5cd0fe461a2e6872), CONST64(0x1d2cac968b80169d), CONST64(0x3ea3bcc0fe1fdf21), CONST64(0x1b24a7918a831298),
|
||||
CONST64(0x3648533f091b242d), CONST64(0x8c064045c94603ca), CONST64(0x354cd8b2879426a1), CONST64(0xb94a98f74ed2256b),
|
||||
CONST64(0x7c5b659de13ea342), CONST64(0xe46d1fca2e72b896), CONST64(0x62734286e431b753), CONST64(0x7a536e9ae03da747),
|
||||
CONST64(0x400b2babeb208b60), CONST64(0x47f459d790ad7aea), CONST64(0xff49b85ba4f1aa0e), CONST64(0x44f0d25a1e227866),
|
||||
CONST64(0x395ccebc85922eab), CONST64(0x5d27873d60a09dfd), CONST64(0x0000000000000000), CONST64(0xde355afb256f94b1),
|
||||
CONST64(0x02f3f2f6f401f703), CONST64(0x1cdbd5edf10ee312), CONST64(0x5fd475cb94a16afe), CONST64(0x3a5845310b1d2c27),
|
||||
CONST64(0x686b5f8fe734bb5c), CONST64(0x238f1056759fc9bc), CONST64(0x582b07b7ef2c9b74), CONST64(0xb8bde18c345cd0e4),
|
||||
CONST64(0xa695c6973153c4f5), CONST64(0xc2ee8f16d46177a3), CONST64(0xdacea30ad06d67b7), CONST64(0x3344d3b5869722a4),
|
||||
CONST64(0x19d755677e82e59b), CONST64(0xc901eb64adea8e23), CONST64(0x34bba1c9fd1ad32e), CONST64(0xf6552edf297ba48d),
|
||||
CONST64(0xa09dcd903050c0f0), CONST64(0x9ac588a13b4decd7), CONST64(0x658c30fa9fbc46d9), CONST64(0x2a9386d2f815c73f),
|
||||
CONST64(0xae7e2968c6573ff9), CONST64(0x6a98ad7913354c5f), CONST64(0x14303a12060a181e), CONST64(0x1e28271b050f1411),
|
||||
CONST64(0xa4663461c55233f6), CONST64(0x6688bb7711334455), CONST64(0x2f9f06587799c1b6), CONST64(0x15c743697c84ed91),
|
||||
CONST64(0x01f7797b7a8ef58f), CONST64(0x0de76f757888fd85), CONST64(0xb4adf782365ad8ee), CONST64(0x48e0c4541c24706c),
|
||||
CONST64(0x96d59eaf394be4dd), CONST64(0xcbf2199259eb7920), CONST64(0x50c0e84818286078), CONST64(0xe98a70bf56fa4513),
|
||||
CONST64(0x8df1393eb3c8f645), CONST64(0x87e92437b0cdfa4a), CONST64(0xd83d51fc246c90b4), CONST64(0xc01d7de0206080a0),
|
||||
CONST64(0x8bf93239b2cbf240), CONST64(0x4be44fd992ab72e0), CONST64(0xed71894ea3f8b615), CONST64(0xba4e137ac05d27e7),
|
||||
CONST64(0x851ad6c144cc0d49), CONST64(0x5137913362a695f7), CONST64(0x6080b07010304050), CONST64(0x9fc9082bb4c1ea5e),
|
||||
CONST64(0x3f54c5bb84912aae), CONST64(0x9722e7d443c51152), CONST64(0x4dec44de93a876e5), CONST64(0xb65e0574c25b2fed),
|
||||
CONST64(0xa16ab4eb4ade357f), CONST64(0xa9815b14bddace73), CONST64(0x050c808a8f8c0689), CONST64(0xee7502c32d77b499),
|
||||
CONST64(0xaf895013bcd9ca76), CONST64(0x6f942df39cb94ad6), CONST64(0x6177c90b6abeb5df), CONST64(0x9d3afadd40c01d5d),
|
||||
CONST64(0x98367a57cf4c1bd4), CONST64(0xeb798249a2fbb210), CONST64(0x2774e9a7809d3aba), CONST64(0xbf4293f04fd1216e),
|
||||
CONST64(0x42f8d95d1f217c63), CONST64(0x861e5d4cca430fc5), CONST64(0xdb39da71aae39238), CONST64(0x912aecd342c61557),
|
||||
};
|
||||
|
||||
static const ulong64 T5[256] = {
|
||||
CONST64(0xb9bb016ad3ba68d2), CONST64(0x9ae5b166fc54194d), CONST64(0x65e2cd14712f93bc), CONST64(0x8725511b9c74b9cd),
|
||||
CONST64(0xa2f7a457f5530251), CONST64(0xd6d003be68d3b86b), CONST64(0xded604b56bd2bd6f), CONST64(0x52b3fe85d74d6429),
|
||||
CONST64(0xbafdad4af0500d5d), CONST64(0x09cf63e0e9ac268a), CONST64(0x1c0984968a8d830e), CONST64(0x91a51a4ddcbf79c6),
|
||||
CONST64(0xa73d4d379070addd), CONST64(0xaaf1a35cf6520755), CONST64(0xa47be117b39ac852), CONST64(0x5ab5f98ed44c612d),
|
||||
CONST64(0x0346ac2023ea658f), CONST64(0xe6c4118462d5a673), CONST64(0xcc55c268a497f166), CONST64(0xc6dc0da86ed1b263),
|
||||
CONST64(0x85aa99d05533ffcc), CONST64(0xb2fbaa41f3510859), CONST64(0xe2c79c0fed5b2a71), CONST64(0x59f355aef7a604a2),
|
||||
CONST64(0xbefe20c17fde815f), CONST64(0x7aade5a2d848753d), CONST64(0x29d77fcce5a8329a), CONST64(0xbc71e80ab699c75e),
|
||||
CONST64(0x96e03be670db904b), CONST64(0x8dac9edb5632fac8), CONST64(0xd1952215c4b751e6), CONST64(0xb332ceaa19fc2bd7),
|
||||
CONST64(0x4b70937338e348ab), CONST64(0x8463fd3bbf9edc42), CONST64(0xfc41d052ae91ef7e), CONST64(0xac7de61cb09bcd56),
|
||||
CONST64(0x437694783be24daf), CONST64(0xb1bd0661d0bb6dd6), CONST64(0x329bdaf1c3415819), CONST64(0x577917e5b26ecba5),
|
||||
CONST64(0x41f95cb3f2a50bae), CONST64(0x16804b5640cbc00b), CONST64(0x7f670cc2bd6bdab1), CONST64(0xdc59cc7ea295fb6e),
|
||||
CONST64(0x61e1409ffea11fbe), CONST64(0xcb10e3c308f318eb), CONST64(0xe181302fceb14ffe), CONST64(0x100c0e1606020a08),
|
||||
CONST64(0x2e925e6749ccdb17), CONST64(0x6ea2663f51c4f337), CONST64(0xe84e53cf271d6974), CONST64(0xa0786c9c3c144450),
|
||||
CONST64(0x56b0730e58c3e82b), CONST64(0x3f57349aa563f291), CONST64(0x9ee63ced73da954f), CONST64(0xd2d38e35e75d3469),
|
||||
CONST64(0xc2df8023e15f3e61), CONST64(0xaef22ed779dc8b57), CONST64(0xcf136e48877d94e9), CONST64(0x2694596c4acdde13),
|
||||
CONST64(0xdf1f605e817f9ee1), CONST64(0xeac19b04ee5a2f75), CONST64(0x477519f3b46cc1ad), CONST64(0xdad5893ee45c316d),
|
||||
CONST64(0xeb08ffef04f70cfb), CONST64(0x2dd4f2476a26be98), CONST64(0xab38c7b71cff24db), CONST64(0x3b54b9112aed7e93),
|
||||
CONST64(0x134aa23625e86f87), CONST64(0x9c69f426ba9dd34e), CONST64(0x5f7f10eeb16fcea1), CONST64(0x04038d8b8f8e8c02),
|
||||
CONST64(0xc8564fe32b197d64), CONST64(0x69e74794fda01aba), CONST64(0xd31aeade0df017e7), CONST64(0x3c1198ba8689971e),
|
||||
CONST64(0x78222d69110f333c), CONST64(0x3812153109071b1c), CONST64(0x11c56afdecaf2986), CONST64(0x8b20db9b10fb30cb),
|
||||
CONST64(0x4030385818082820), CONST64(0xa87e6b973f154154), CONST64(0x682e237f170d3934), CONST64(0x20181c2c0c041410),
|
||||
CONST64(0x0806070b03010504), CONST64(0x074521abac64e98d), CONST64(0xb6f827ca7cdf845b), CONST64(0x97295f0d9a76b3c5),
|
||||
CONST64(0xef0b72648b7980f9), CONST64(0xa6f429dc7add8e53), CONST64(0xf58eb3b2473dc9f4), CONST64(0xb074628a3a164e58),
|
||||
CONST64(0xe582bda4413fc3fc), CONST64(0xa5b285fc5937ebdc), CONST64(0x4f731ef8b76dc4a9), CONST64(0xdd90a8954838d8e0),
|
||||
CONST64(0xa1b10877d6b967de), CONST64(0xbf37442a9573a2d1), CONST64(0x1b4ca53d26e96a83), CONST64(0xb5be8bea5f35e1d4),
|
||||
CONST64(0x92e3b66dff551c49), CONST64(0xaf3b4a3c9371a8d9), CONST64(0xff077c728d7b8af1), CONST64(0x140f839d898c860a),
|
||||
CONST64(0xb73143219672a7d5), CONST64(0x34179fb18588921a), CONST64(0xe30ef8e407f609ff), CONST64(0x4dfcd6337e2a82a8),
|
||||
CONST64(0xed84baaf423ec6f8), CONST64(0xcad98728e25e3b65), CONST64(0x25d2f54c6927bb9c), CONST64(0x0a89cfc0ca464305),
|
||||
CONST64(0x60282474140c3c30), CONST64(0x0f4326a0af65ec89), CONST64(0x676d05dfb868d5bd), CONST64(0x2f5b3a8ca361f899),
|
||||
CONST64(0x180a091d05030f0c), CONST64(0x46bc7d185ec1e223), CONST64(0x82efb87bf9571641), CONST64(0xfece189967d6a97f),
|
||||
CONST64(0x86ec35f076d99a43), CONST64(0xfacd9512e858257d), CONST64(0x8eea32fb75d89f47), CONST64(0x17492fbdaa66e385),
|
||||
CONST64(0xf6c81f9264d7ac7b), CONST64(0xcd9ca6834e3ad2e8), CONST64(0x0e8a424b45c8cf07), CONST64(0xfd88b4b9443cccf0),
|
||||
CONST64(0x8326dc9013fa35cf), CONST64(0xc453c563a796f462), CONST64(0x51f552a5f4a701a6), CONST64(0xb477ef01b598c25a),
|
||||
CONST64(0x3352be1a29ec7b97), CONST64(0xa9b70f7cd5b862da), CONST64(0x76a86f2254c7fc3b), CONST64(0x19c36df6efae2c82),
|
||||
CONST64(0x6f6b02d4bb69d0b9), CONST64(0x62a7ecbfdd4b7a31), CONST64(0x31dd76d1e0ab3d96), CONST64(0x21d178c7e6a9379e),
|
||||
CONST64(0x1f4f28b6a967e681), CONST64(0x503c364e1e0a2228), CONST64(0x028fc8cbc9474601), CONST64(0xc316e4c80bf21def),
|
||||
CONST64(0xc1992c03c2b55bee), CONST64(0x0dccee6b6622aa88), CONST64(0x7b64814932e556b3), CONST64(0x235eb00c2fee719f),
|
||||
CONST64(0x99a31d46dfbe7cc2), CONST64(0x45fad1387d2b87ac), CONST64(0x7c21a0e29e81bf3e), CONST64(0x906c7ea636125a48),
|
||||
CONST64(0x6c2daef49883b536), CONST64(0xd85a41f52d1b776c), CONST64(0x70242a62120e3638), CONST64(0x05cae9606523af8c),
|
||||
CONST64(0xfb04f1f902f506f3), CONST64(0x1283c6ddcf454c09), CONST64(0x15c6e7766321a584), CONST64(0x3e9e50714fced11f),
|
||||
CONST64(0x72abe2a9db497039), CONST64(0x7de8c409742c9cb0), CONST64(0x9b2cd58d16f93ac3), CONST64(0x636e885437e659bf),
|
||||
CONST64(0xd993251ec7b654e2), CONST64(0x5df0d825782888a0), CONST64(0xb872658139174b5c), CONST64(0x642ba9ff9b82b032),
|
||||
CONST64(0xd05c46fe2e1a7268), CONST64(0x2c1d96ac808b9d16), CONST64(0xa33ec0bc1ffe21df), CONST64(0x241b91a7838a9812),
|
||||
CONST64(0x48363f531b092d24), CONST64(0x068c454046c9ca03), CONST64(0x4c35b2d89487a126), CONST64(0x4ab9f798d24e6b25),
|
||||
CONST64(0x5b7c9d653ee142a3), CONST64(0x6de4ca1f722e96b8), CONST64(0x7362864231e453b7), CONST64(0x537a9a6e3de047a7),
|
||||
CONST64(0x0b40ab2b20eb608b), CONST64(0xf447d759ad90ea7a), CONST64(0x49ff5bb8f1a40eaa), CONST64(0xf0445ad2221e6678),
|
||||
CONST64(0x5c39bcce9285ab2e), CONST64(0x275d3d87a060fd9d), CONST64(0x0000000000000000), CONST64(0x35defb5a6f25b194),
|
||||
CONST64(0xf302f6f201f403f7), CONST64(0xdb1cedd50ef112e3), CONST64(0xd45fcb75a194fe6a), CONST64(0x583a31451d0b272c),
|
||||
CONST64(0x6b688f5f34e75cbb), CONST64(0x8f2356109f75bcc9), CONST64(0x2b58b7072cef749b), CONST64(0xbdb88ce15c34e4d0),
|
||||
CONST64(0x95a697c65331f5c4), CONST64(0xeec2168f61d4a377), CONST64(0xceda0aa36dd0b767), CONST64(0x4433b5d39786a422),
|
||||
CONST64(0xd7196755827e9be5), CONST64(0x01c964ebeaad238e), CONST64(0xbb34c9a11afd2ed3), CONST64(0x55f6df2e7b298da4),
|
||||
CONST64(0x9da090cd5030f0c0), CONST64(0xc59aa1884d3bd7ec), CONST64(0x8c65fa30bc9fd946), CONST64(0x932ad28615f83fc7),
|
||||
CONST64(0x7eae682957c6f93f), CONST64(0x986a79ad35135f4c), CONST64(0x3014123a0a061e18), CONST64(0x281e1b270f051114),
|
||||
CONST64(0x66a4613452c5f633), CONST64(0x886677bb33115544), CONST64(0x9f2f58069977b6c1), CONST64(0xc7156943847c91ed),
|
||||
CONST64(0xf7017b798e7a8ff5), CONST64(0xe70d756f887885fd), CONST64(0xadb482f75a36eed8), CONST64(0xe04854c4241c6c70),
|
||||
CONST64(0xd596af9e4b39dde4), CONST64(0xf2cb9219eb592079), CONST64(0xc05048e828187860), CONST64(0x8ae9bf70fa561345),
|
||||
CONST64(0xf18d3e39c8b345f6), CONST64(0xe9873724cdb04afa), CONST64(0x3dd8fc516c24b490), CONST64(0x1dc0e07d6020a080),
|
||||
CONST64(0xf98b3932cbb240f2), CONST64(0xe44bd94fab92e072), CONST64(0x71ed4e89f8a315b6), CONST64(0x4eba7a135dc0e727),
|
||||
CONST64(0x1a85c1d6cc44490d), CONST64(0x37513391a662f795), CONST64(0x806070b030105040), CONST64(0xc99f2b08c1b45eea),
|
||||
CONST64(0x543fbbc59184ae2a), CONST64(0x2297d4e7c5435211), CONST64(0xec4dde44a893e576), CONST64(0x5eb674055bc2ed2f),
|
||||
CONST64(0x6aa1ebb4de4a7f35), CONST64(0x81a9145bdabd73ce), CONST64(0x0c058a808c8f8906), CONST64(0x75eec302772d99b4),
|
||||
CONST64(0x89af1350d9bc76ca), CONST64(0x946ff32db99cd64a), CONST64(0x77610bc9be6adfb5), CONST64(0x3a9dddfac0405d1d),
|
||||
CONST64(0x3698577a4ccfd41b), CONST64(0x79eb4982fba210b2), CONST64(0x7427a7e99d80ba3a), CONST64(0x42bff093d14f6e21),
|
||||
CONST64(0xf8425dd9211f637c), CONST64(0x1e864c5d43cac50f), CONST64(0x39db71dae3aa3892), CONST64(0x2a91d3ecc6425715),
|
||||
};
|
||||
|
||||
static const ulong64 T6[256] = {
|
||||
CONST64(0x6a01bbb9d268bad3), CONST64(0x66b1e59a4d1954fc), CONST64(0x14cde265bc932f71), CONST64(0x1b512587cdb9749c),
|
||||
CONST64(0x57a4f7a2510253f5), CONST64(0xbe03d0d66bb8d368), CONST64(0xb504d6de6fbdd26b), CONST64(0x85feb35229644dd7),
|
||||
CONST64(0x4aadfdba5d0d50f0), CONST64(0xe063cf098a26ace9), CONST64(0x9684091c0e838d8a), CONST64(0x4d1aa591c679bfdc),
|
||||
CONST64(0x374d3da7ddad7090), CONST64(0x5ca3f1aa550752f6), CONST64(0x17e17ba452c89ab3), CONST64(0x8ef9b55a2d614cd4),
|
||||
CONST64(0x20ac46038f65ea23), CONST64(0x8411c4e673a6d562), CONST64(0x68c255cc66f197a4), CONST64(0xa80ddcc663b2d16e),
|
||||
CONST64(0xd099aa85ccff3355), CONST64(0x41aafbb2590851f3), CONST64(0x0f9cc7e2712a5bed), CONST64(0xae55f359a204a6f7),
|
||||
CONST64(0xc120febe5f81de7f), CONST64(0xa2e5ad7a3d7548d8), CONST64(0xcc7fd7299a32a8e5), CONST64(0x0ae871bc5ec799b6),
|
||||
CONST64(0xe63be0964b90db70), CONST64(0xdb9eac8dc8fa3256), CONST64(0x152295d1e651b7c4), CONST64(0xaace32b3d72bfc19),
|
||||
CONST64(0x7393704bab48e338), CONST64(0x3bfd638442dc9ebf), CONST64(0x52d041fc7eef91ae), CONST64(0x1ce67dac56cd9bb0),
|
||||
CONST64(0x78947643af4de23b), CONST64(0x6106bdb1d66dbbd0), CONST64(0xf1da9b32195841c3), CONST64(0xe5177957a5cb6eb2),
|
||||
CONST64(0xb35cf941ae0ba5f2), CONST64(0x564b80160bc0cb40), CONST64(0xc20c677fb1da6bbd), CONST64(0x7ecc59dc6efb95a2),
|
||||
CONST64(0x9f40e161be1fa1fe), CONST64(0xc3e310cbeb18f308), CONST64(0x2f3081e1fe4fb1ce), CONST64(0x160e0c10080a0206),
|
||||
CONST64(0x675e922e17dbcc49), CONST64(0x3f66a26e37f3c451), CONST64(0xcf534ee874691d27), CONST64(0x9c6c78a05044143c),
|
||||
CONST64(0x0e73b0562be8c358), CONST64(0x9a34573f91f263a5), CONST64(0xed3ce69e4f95da73), CONST64(0x358ed3d269345de7),
|
||||
CONST64(0x2380dfc2613e5fe1), CONST64(0xd72ef2ae578bdc79), CONST64(0x486e13cfe9947d87), CONST64(0x6c59942613decd4a),
|
||||
CONST64(0x5e601fdfe19e7f81), CONST64(0x049bc1ea752f5aee), CONST64(0xf3197547adc16cb4), CONST64(0x3e89d5da6d315ce4),
|
||||
CONST64(0xefff08ebfb0cf704), CONST64(0x47f2d42d98be266a), CONST64(0xb7c738abdb24ff1c), CONST64(0x11b9543b937eed2a),
|
||||
CONST64(0x36a24a13876fe825), CONST64(0x26f4699c4ed39dba), CONST64(0xee107f5fa1ce6fb1), CONST64(0x8b8d0304028c8e8f),
|
||||
CONST64(0xe34f56c8647d192b), CONST64(0x9447e769ba1aa0fd), CONST64(0xdeea1ad3e717f00d), CONST64(0xba98113c1e978986),
|
||||
CONST64(0x692d22783c330f11), CONST64(0x311512381c1b0709), CONST64(0xfd6ac5118629afec), CONST64(0x9bdb208bcb30fb10),
|
||||
CONST64(0x5838304020280818), CONST64(0x976b7ea85441153f), CONST64(0x7f232e6834390d17), CONST64(0x2c1c18201014040c),
|
||||
CONST64(0x0b07060804050103), CONST64(0xab2145078de964ac), CONST64(0xca27f8b65b84df7c), CONST64(0x0d5f2997c5b3769a),
|
||||
CONST64(0x64720beff980798b), CONST64(0xdc29f4a6538edd7a), CONST64(0xb2b38ef5f4c93d47), CONST64(0x8a6274b0584e163a),
|
||||
CONST64(0xa4bd82e5fcc33f41), CONST64(0xfc85b2a5dceb3759), CONST64(0xf81e734fa9c46db7), CONST64(0x95a890dde0d83848),
|
||||
CONST64(0x7708b1a1de67b9d6), CONST64(0x2a4437bfd1a27395), CONST64(0x3da54c1b836ae926), CONST64(0xea8bbeb5d4e1355f),
|
||||
CONST64(0x6db6e392491c55ff), CONST64(0x3c4a3bafd9a87193), CONST64(0x727c07fff18a7b8d), CONST64(0x9d830f140a868c89),
|
||||
CONST64(0x214331b7d5a77296), CONST64(0xb19f17341a928885), CONST64(0xe4f80ee3ff09f607), CONST64(0x33d6fc4da8822a7e),
|
||||
CONST64(0xafba84edf8c63e42), CONST64(0x2887d9ca653b5ee2), CONST64(0x4cf5d2259cbb2769), CONST64(0xc0cf890a054346ca),
|
||||
CONST64(0x74242860303c0c14), CONST64(0xa026430f89ec65af), CONST64(0xdf056d67bdd568b8), CONST64(0x8c3a5b2f99f861a3),
|
||||
CONST64(0x1d090a180c0f0305), CONST64(0x187dbc4623e2c15e), CONST64(0x7bb8ef82411657f9), CONST64(0x9918cefe7fa9d667),
|
||||
CONST64(0xf035ec86439ad976), CONST64(0x1295cdfa7d2558e8), CONST64(0xfb32ea8e479fd875), CONST64(0xbd2f491785e366aa),
|
||||
CONST64(0x921fc8f67bacd764), CONST64(0x83a69ccde8d23a4e), CONST64(0x4b428a0e07cfc845), CONST64(0xb9b488fdf0cc3c44),
|
||||
CONST64(0x90dc2683cf35fa13), CONST64(0x63c553c462f496a7), CONST64(0xa552f551a601a7f4), CONST64(0x01ef77b45ac298b5),
|
||||
CONST64(0x1abe5233977bec29), CONST64(0x7c0fb7a9da62b8d5), CONST64(0x226fa8763bfcc754), CONST64(0xf66dc319822caeef),
|
||||
CONST64(0xd4026b6fb9d069bb), CONST64(0xbfeca762317a4bdd), CONST64(0xd176dd31963dabe0), CONST64(0xc778d1219e37a9e6),
|
||||
CONST64(0xb6284f1f81e667a9), CONST64(0x4e363c5028220a1e), CONST64(0xcbc88f02014647c9), CONST64(0xc8e416c3ef1df20b),
|
||||
CONST64(0x032c99c1ee5bb5c2), CONST64(0x6beecc0d88aa2266), CONST64(0x4981647bb356e532), CONST64(0x0cb05e239f71ee2f),
|
||||
CONST64(0x461da399c27cbedf), CONST64(0x38d1fa45ac872b7d), CONST64(0xe2a0217c3ebf819e), CONST64(0xa67e6c90485a1236),
|
||||
CONST64(0xf4ae2d6c36b58398), CONST64(0xf5415ad86c771b2d), CONST64(0x622a247038360e12), CONST64(0x60e9ca058caf2365),
|
||||
CONST64(0xf9f104fbf306f502), CONST64(0xddc68312094c45cf), CONST64(0x76e7c61584a52163), CONST64(0x71509e3e1fd1ce4f),
|
||||
CONST64(0xa9e2ab72397049db), CONST64(0x09c4e87db09c2c74), CONST64(0x8dd52c9bc33af916), CONST64(0x54886e63bf59e637),
|
||||
CONST64(0x1e2593d9e254b6c7), CONST64(0x25d8f05da0882878), CONST64(0x816572b85c4b1739), CONST64(0xffa92b6432b0829b),
|
||||
CONST64(0xfe465cd068721a2e), CONST64(0xac961d2c169d8b80), CONST64(0xbcc03ea3df21fe1f), CONST64(0xa7911b2412988a83),
|
||||
CONST64(0x533f3648242d091b), CONST64(0x40458c0603cac946), CONST64(0xd8b2354c26a18794), CONST64(0x98f7b94a256b4ed2),
|
||||
CONST64(0x659d7c5ba342e13e), CONST64(0x1fcae46db8962e72), CONST64(0x42866273b753e431), CONST64(0x6e9a7a53a747e03d),
|
||||
CONST64(0x2bab400b8b60eb20), CONST64(0x59d747f47aea90ad), CONST64(0xb85bff49aa0ea4f1), CONST64(0xd25a44f078661e22),
|
||||
CONST64(0xcebc395c2eab8592), CONST64(0x873d5d279dfd60a0), CONST64(0x0000000000000000), CONST64(0x5afbde3594b1256f),
|
||||
CONST64(0xf2f602f3f703f401), CONST64(0xd5ed1cdbe312f10e), CONST64(0x75cb5fd46afe94a1), CONST64(0x45313a582c270b1d),
|
||||
CONST64(0x5f8f686bbb5ce734), CONST64(0x1056238fc9bc759f), CONST64(0x07b7582b9b74ef2c), CONST64(0xe18cb8bdd0e4345c),
|
||||
CONST64(0xc697a695c4f53153), CONST64(0x8f16c2ee77a3d461), CONST64(0xa30adace67b7d06d), CONST64(0xd3b5334422a48697),
|
||||
CONST64(0x556719d7e59b7e82), CONST64(0xeb64c9018e23adea), CONST64(0xa1c934bbd32efd1a), CONST64(0x2edff655a48d297b),
|
||||
CONST64(0xcd90a09dc0f03050), CONST64(0x88a19ac5ecd73b4d), CONST64(0x30fa658c46d99fbc), CONST64(0x86d22a93c73ff815),
|
||||
CONST64(0x2968ae7e3ff9c657), CONST64(0xad796a984c5f1335), CONST64(0x3a121430181e060a), CONST64(0x271b1e281411050f),
|
||||
CONST64(0x3461a46633f6c552), CONST64(0xbb77668844551133), CONST64(0x06582f9fc1b67799), CONST64(0x436915c7ed917c84),
|
||||
CONST64(0x797b01f7f58f7a8e), CONST64(0x6f750de7fd857888), CONST64(0xf782b4add8ee365a), CONST64(0xc45448e0706c1c24),
|
||||
CONST64(0x9eaf96d5e4dd394b), CONST64(0x1992cbf2792059eb), CONST64(0xe84850c060781828), CONST64(0x70bfe98a451356fa),
|
||||
CONST64(0x393e8df1f645b3c8), CONST64(0x243787e9fa4ab0cd), CONST64(0x51fcd83d90b4246c), CONST64(0x7de0c01d80a02060),
|
||||
CONST64(0x32398bf9f240b2cb), CONST64(0x4fd94be472e092ab), CONST64(0x894eed71b615a3f8), CONST64(0x137aba4e27e7c05d),
|
||||
CONST64(0xd6c1851a0d4944cc), CONST64(0x9133513795f762a6), CONST64(0xb070608040501030), CONST64(0x082b9fc9ea5eb4c1),
|
||||
CONST64(0xc5bb3f542aae8491), CONST64(0xe7d49722115243c5), CONST64(0x44de4dec76e593a8), CONST64(0x0574b65e2fedc25b),
|
||||
CONST64(0xb4eba16a357f4ade), CONST64(0x5b14a981ce73bdda), CONST64(0x808a050c06898f8c), CONST64(0x02c3ee75b4992d77),
|
||||
CONST64(0x5013af89ca76bcd9), CONST64(0x2df36f944ad69cb9), CONST64(0xc90b6177b5df6abe), CONST64(0xfadd9d3a1d5d40c0),
|
||||
CONST64(0x7a5798361bd4cf4c), CONST64(0x8249eb79b210a2fb), CONST64(0xe9a727743aba809d), CONST64(0x93f0bf42216e4fd1),
|
||||
CONST64(0xd95d42f87c631f21), CONST64(0x5d4c861e0fc5ca43), CONST64(0xda71db399238aae3), CONST64(0xecd3912a155742c6),
|
||||
};
|
||||
|
||||
static const ulong64 T7[256] = {
|
||||
CONST64(0x016ab9bb68d2d3ba), CONST64(0xb1669ae5194dfc54), CONST64(0xcd1465e293bc712f), CONST64(0x511b8725b9cd9c74),
|
||||
CONST64(0xa457a2f70251f553), CONST64(0x03bed6d0b86b68d3), CONST64(0x04b5ded6bd6f6bd2), CONST64(0xfe8552b36429d74d),
|
||||
CONST64(0xad4abafd0d5df050), CONST64(0x63e009cf268ae9ac), CONST64(0x84961c09830e8a8d), CONST64(0x1a4d91a579c6dcbf),
|
||||
CONST64(0x4d37a73daddd9070), CONST64(0xa35caaf10755f652), CONST64(0xe117a47bc852b39a), CONST64(0xf98e5ab5612dd44c),
|
||||
CONST64(0xac200346658f23ea), CONST64(0x1184e6c4a67362d5), CONST64(0xc268cc55f166a497), CONST64(0x0da8c6dcb2636ed1),
|
||||
CONST64(0x99d085aaffcc5533), CONST64(0xaa41b2fb0859f351), CONST64(0x9c0fe2c72a71ed5b), CONST64(0x55ae59f304a2f7a6),
|
||||
CONST64(0x20c1befe815f7fde), CONST64(0xe5a27aad753dd848), CONST64(0x7fcc29d7329ae5a8), CONST64(0xe80abc71c75eb699),
|
||||
CONST64(0x3be696e0904b70db), CONST64(0x9edb8dacfac85632), CONST64(0x2215d19551e6c4b7), CONST64(0xceaab3322bd719fc),
|
||||
CONST64(0x93734b7048ab38e3), CONST64(0xfd3b8463dc42bf9e), CONST64(0xd052fc41ef7eae91), CONST64(0xe61cac7dcd56b09b),
|
||||
CONST64(0x947843764daf3be2), CONST64(0x0661b1bd6dd6d0bb), CONST64(0xdaf1329b5819c341), CONST64(0x17e55779cba5b26e),
|
||||
CONST64(0x5cb341f90baef2a5), CONST64(0x4b561680c00b40cb), CONST64(0x0cc27f67dab1bd6b), CONST64(0xcc7edc59fb6ea295),
|
||||
CONST64(0x409f61e11fbefea1), CONST64(0xe3c3cb1018eb08f3), CONST64(0x302fe1814ffeceb1), CONST64(0x0e16100c0a080602),
|
||||
CONST64(0x5e672e92db1749cc), CONST64(0x663f6ea2f33751c4), CONST64(0x53cfe84e6974271d), CONST64(0x6c9ca07844503c14),
|
||||
CONST64(0x730e56b0e82b58c3), CONST64(0x349a3f57f291a563), CONST64(0x3ced9ee6954f73da), CONST64(0x8e35d2d33469e75d),
|
||||
CONST64(0x8023c2df3e61e15f), CONST64(0x2ed7aef28b5779dc), CONST64(0x6e48cf1394e9877d), CONST64(0x596c2694de134acd),
|
||||
CONST64(0x605edf1f9ee1817f), CONST64(0x9b04eac12f75ee5a), CONST64(0x19f34775c1adb46c), CONST64(0x893edad5316de45c),
|
||||
CONST64(0xffefeb080cfb04f7), CONST64(0xf2472dd4be986a26), CONST64(0xc7b7ab3824db1cff), CONST64(0xb9113b547e932aed),
|
||||
CONST64(0xa236134a6f8725e8), CONST64(0xf4269c69d34eba9d), CONST64(0x10ee5f7fcea1b16f), CONST64(0x8d8b04038c028f8e),
|
||||
CONST64(0x4fe3c8567d642b19), CONST64(0x479469e71abafda0), CONST64(0xeaded31a17e70df0), CONST64(0x98ba3c11971e8689),
|
||||
CONST64(0x2d697822333c110f), CONST64(0x153138121b1c0907), CONST64(0x6afd11c52986ecaf), CONST64(0xdb9b8b2030cb10fb),
|
||||
CONST64(0x3858403028201808), CONST64(0x6b97a87e41543f15), CONST64(0x237f682e3934170d), CONST64(0x1c2c201814100c04),
|
||||
CONST64(0x070b080605040301), CONST64(0x21ab0745e98dac64), CONST64(0x27cab6f8845b7cdf), CONST64(0x5f0d9729b3c59a76),
|
||||
CONST64(0x7264ef0b80f98b79), CONST64(0x29dca6f48e537add), CONST64(0xb3b2f58ec9f4473d), CONST64(0x628ab0744e583a16),
|
||||
CONST64(0xbda4e582c3fc413f), CONST64(0x85fca5b2ebdc5937), CONST64(0x1ef84f73c4a9b76d), CONST64(0xa895dd90d8e04838),
|
||||
CONST64(0x0877a1b167ded6b9), CONST64(0x442abf37a2d19573), CONST64(0xa53d1b4c6a8326e9), CONST64(0x8beab5bee1d45f35),
|
||||
CONST64(0xb66d92e31c49ff55), CONST64(0x4a3caf3ba8d99371), CONST64(0x7c72ff078af18d7b), CONST64(0x839d140f860a898c),
|
||||
CONST64(0x4321b731a7d59672), CONST64(0x9fb13417921a8588), CONST64(0xf8e4e30e09ff07f6), CONST64(0xd6334dfc82a87e2a),
|
||||
CONST64(0xbaafed84c6f8423e), CONST64(0x8728cad93b65e25e), CONST64(0xf54c25d2bb9c6927), CONST64(0xcfc00a894305ca46),
|
||||
CONST64(0x247460283c30140c), CONST64(0x26a00f43ec89af65), CONST64(0x05df676dd5bdb868), CONST64(0x3a8c2f5bf899a361),
|
||||
CONST64(0x091d180a0f0c0503), CONST64(0x7d1846bce2235ec1), CONST64(0xb87b82ef1641f957), CONST64(0x1899fecea97f67d6),
|
||||
CONST64(0x35f086ec9a4376d9), CONST64(0x9512facd257de858), CONST64(0x32fb8eea9f4775d8), CONST64(0x2fbd1749e385aa66),
|
||||
CONST64(0x1f92f6c8ac7b64d7), CONST64(0xa683cd9cd2e84e3a), CONST64(0x424b0e8acf0745c8), CONST64(0xb4b9fd88ccf0443c),
|
||||
CONST64(0xdc90832635cf13fa), CONST64(0xc563c453f462a796), CONST64(0x52a551f501a6f4a7), CONST64(0xef01b477c25ab598),
|
||||
CONST64(0xbe1a33527b9729ec), CONST64(0x0f7ca9b762dad5b8), CONST64(0x6f2276a8fc3b54c7), CONST64(0x6df619c32c82efae),
|
||||
CONST64(0x02d46f6bd0b9bb69), CONST64(0xecbf62a77a31dd4b), CONST64(0x76d131dd3d96e0ab), CONST64(0x78c721d1379ee6a9),
|
||||
CONST64(0x28b61f4fe681a967), CONST64(0x364e503c22281e0a), CONST64(0xc8cb028f4601c947), CONST64(0xe4c8c3161def0bf2),
|
||||
CONST64(0x2c03c1995beec2b5), CONST64(0xee6b0dccaa886622), CONST64(0x81497b6456b332e5), CONST64(0xb00c235e719f2fee),
|
||||
CONST64(0x1d4699a37cc2dfbe), CONST64(0xd13845fa87ac7d2b), CONST64(0xa0e27c21bf3e9e81), CONST64(0x7ea6906c5a483612),
|
||||
CONST64(0xaef46c2db5369883), CONST64(0x41f5d85a776c2d1b), CONST64(0x2a6270243638120e), CONST64(0xe96005caaf8c6523),
|
||||
CONST64(0xf1f9fb0406f302f5), CONST64(0xc6dd12834c09cf45), CONST64(0xe77615c6a5846321), CONST64(0x50713e9ed11f4fce),
|
||||
CONST64(0xe2a972ab7039db49), CONST64(0xc4097de89cb0742c), CONST64(0xd58d9b2c3ac316f9), CONST64(0x8854636e59bf37e6),
|
||||
CONST64(0x251ed99354e2c7b6), CONST64(0xd8255df088a07828), CONST64(0x6581b8724b5c3917), CONST64(0xa9ff642bb0329b82),
|
||||
CONST64(0x46fed05c72682e1a), CONST64(0x96ac2c1d9d16808b), CONST64(0xc0bca33e21df1ffe), CONST64(0x91a7241b9812838a),
|
||||
CONST64(0x3f5348362d241b09), CONST64(0x4540068cca0346c9), CONST64(0xb2d84c35a1269487), CONST64(0xf7984ab96b25d24e),
|
||||
CONST64(0x9d655b7c42a33ee1), CONST64(0xca1f6de496b8722e), CONST64(0x8642736253b731e4), CONST64(0x9a6e537a47a73de0),
|
||||
CONST64(0xab2b0b40608b20eb), CONST64(0xd759f447ea7aad90), CONST64(0x5bb849ff0eaaf1a4), CONST64(0x5ad2f0446678221e),
|
||||
CONST64(0xbcce5c39ab2e9285), CONST64(0x3d87275dfd9da060), CONST64(0x0000000000000000), CONST64(0xfb5a35deb1946f25),
|
||||
CONST64(0xf6f2f30203f701f4), CONST64(0xedd5db1c12e30ef1), CONST64(0xcb75d45ffe6aa194), CONST64(0x3145583a272c1d0b),
|
||||
CONST64(0x8f5f6b685cbb34e7), CONST64(0x56108f23bcc99f75), CONST64(0xb7072b58749b2cef), CONST64(0x8ce1bdb8e4d05c34),
|
||||
CONST64(0x97c695a6f5c45331), CONST64(0x168feec2a37761d4), CONST64(0x0aa3cedab7676dd0), CONST64(0xb5d34433a4229786),
|
||||
CONST64(0x6755d7199be5827e), CONST64(0x64eb01c9238eeaad), CONST64(0xc9a1bb342ed31afd), CONST64(0xdf2e55f68da47b29),
|
||||
CONST64(0x90cd9da0f0c05030), CONST64(0xa188c59ad7ec4d3b), CONST64(0xfa308c65d946bc9f), CONST64(0xd286932a3fc715f8),
|
||||
CONST64(0x68297eaef93f57c6), CONST64(0x79ad986a5f4c3513), CONST64(0x123a30141e180a06), CONST64(0x1b27281e11140f05),
|
||||
CONST64(0x613466a4f63352c5), CONST64(0x77bb886655443311), CONST64(0x58069f2fb6c19977), CONST64(0x6943c71591ed847c),
|
||||
CONST64(0x7b79f7018ff58e7a), CONST64(0x756fe70d85fd8878), CONST64(0x82f7adb4eed85a36), CONST64(0x54c4e0486c70241c),
|
||||
CONST64(0xaf9ed596dde44b39), CONST64(0x9219f2cb2079eb59), CONST64(0x48e8c05078602818), CONST64(0xbf708ae91345fa56),
|
||||
CONST64(0x3e39f18d45f6c8b3), CONST64(0x3724e9874afacdb0), CONST64(0xfc513dd8b4906c24), CONST64(0xe07d1dc0a0806020),
|
||||
CONST64(0x3932f98b40f2cbb2), CONST64(0xd94fe44be072ab92), CONST64(0x4e8971ed15b6f8a3), CONST64(0x7a134ebae7275dc0),
|
||||
CONST64(0xc1d61a85490dcc44), CONST64(0x33913751f795a662), CONST64(0x70b0806050403010), CONST64(0x2b08c99f5eeac1b4),
|
||||
CONST64(0xbbc5543fae2a9184), CONST64(0xd4e722975211c543), CONST64(0xde44ec4de576a893), CONST64(0x74055eb6ed2f5bc2),
|
||||
CONST64(0xebb46aa17f35de4a), CONST64(0x145b81a973cedabd), CONST64(0x8a800c0589068c8f), CONST64(0xc30275ee99b4772d),
|
||||
CONST64(0x135089af76cad9bc), CONST64(0xf32d946fd64ab99c), CONST64(0x0bc97761dfb5be6a), CONST64(0xddfa3a9d5d1dc040),
|
||||
CONST64(0x577a3698d41b4ccf), CONST64(0x498279eb10b2fba2), CONST64(0xa7e97427ba3a9d80), CONST64(0xf09342bf6e21d14f),
|
||||
CONST64(0x5dd9f842637c211f), CONST64(0x4c5d1e86c50f43ca), CONST64(0x71da39db3892e3aa), CONST64(0xd3ec2a915715c642),
|
||||
};
|
||||
|
||||
static const ulong64 c[R + 1] = {
|
||||
CONST64(0xba542f7453d3d24d),
|
||||
CONST64(0x50ac8dbf70529a4c),
|
||||
CONST64(0xead597d133515ba6),
|
||||
CONST64(0xde48a899db32b7fc),
|
||||
CONST64(0xe39e919be2bb416e),
|
||||
CONST64(0xa5cb6b95a1f3b102),
|
||||
CONST64(0xccc41d14c363da5d),
|
||||
CONST64(0x5fdc7dcd7f5a6c5c),
|
||||
CONST64(0xf726ffede89d6f8e),
|
||||
};
|
||||
|
||||
/**
|
||||
Initialize the Khazad block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int khazad_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
int r;
|
||||
const ulong64 *S;
|
||||
ulong64 K2, K1;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
if (keylen != 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
if (num_rounds != 8 && num_rounds != 0) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* use 7th table */
|
||||
S = T7;
|
||||
|
||||
/*
|
||||
* map unsigned char array cipher key to initial key state (mu):
|
||||
*/
|
||||
K2 =
|
||||
((ulong64)key[ 0] << 56) ^
|
||||
((ulong64)key[ 1] << 48) ^
|
||||
((ulong64)key[ 2] << 40) ^
|
||||
((ulong64)key[ 3] << 32) ^
|
||||
((ulong64)key[ 4] << 24) ^
|
||||
((ulong64)key[ 5] << 16) ^
|
||||
((ulong64)key[ 6] << 8) ^
|
||||
((ulong64)key[ 7] );
|
||||
K1 =
|
||||
((ulong64)key[ 8] << 56) ^
|
||||
((ulong64)key[ 9] << 48) ^
|
||||
((ulong64)key[10] << 40) ^
|
||||
((ulong64)key[11] << 32) ^
|
||||
((ulong64)key[12] << 24) ^
|
||||
((ulong64)key[13] << 16) ^
|
||||
((ulong64)key[14] << 8) ^
|
||||
((ulong64)key[15] );
|
||||
|
||||
/*
|
||||
* compute the round keys:
|
||||
*/
|
||||
for (r = 0; r <= R; r++) {
|
||||
/*
|
||||
* K[r] = rho(c[r], K1) ^ K2;
|
||||
*/
|
||||
skey->khazad.roundKeyEnc[r] =
|
||||
T0[(int)(K1 >> 56) ] ^
|
||||
T1[(int)(K1 >> 48) & 0xff] ^
|
||||
T2[(int)(K1 >> 40) & 0xff] ^
|
||||
T3[(int)(K1 >> 32) & 0xff] ^
|
||||
T4[(int)(K1 >> 24) & 0xff] ^
|
||||
T5[(int)(K1 >> 16) & 0xff] ^
|
||||
T6[(int)(K1 >> 8) & 0xff] ^
|
||||
T7[(int)(K1 ) & 0xff] ^
|
||||
c[r] ^ K2;
|
||||
K2 = K1; K1 = skey->khazad.roundKeyEnc[r];
|
||||
}
|
||||
/*
|
||||
* compute the inverse key schedule:
|
||||
* K'^0 = K^R, K'^R = K^0, K'^r = theta(K^{R-r})
|
||||
*/
|
||||
skey->khazad.roundKeyDec[0] = skey->khazad.roundKeyEnc[R];
|
||||
for (r = 1; r < R; r++) {
|
||||
K1 = skey->khazad.roundKeyEnc[R - r];
|
||||
skey->khazad.roundKeyDec[r] =
|
||||
T0[(int)S[(int)(K1 >> 56) ] & 0xff] ^
|
||||
T1[(int)S[(int)(K1 >> 48) & 0xff] & 0xff] ^
|
||||
T2[(int)S[(int)(K1 >> 40) & 0xff] & 0xff] ^
|
||||
T3[(int)S[(int)(K1 >> 32) & 0xff] & 0xff] ^
|
||||
T4[(int)S[(int)(K1 >> 24) & 0xff] & 0xff] ^
|
||||
T5[(int)S[(int)(K1 >> 16) & 0xff] & 0xff] ^
|
||||
T6[(int)S[(int)(K1 >> 8) & 0xff] & 0xff] ^
|
||||
T7[(int)S[(int)(K1 ) & 0xff] & 0xff];
|
||||
}
|
||||
skey->khazad.roundKeyDec[R] = skey->khazad.roundKeyEnc[0];
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
static void khazad_crypt(const unsigned char *plaintext, unsigned char *ciphertext,
|
||||
const ulong64 *roundKey) {
|
||||
int r;
|
||||
ulong64 state;
|
||||
/*
|
||||
* map plaintext block to cipher state (mu)
|
||||
* and add initial round key (sigma[K^0]):
|
||||
*/
|
||||
state =
|
||||
((ulong64)plaintext[0] << 56) ^
|
||||
((ulong64)plaintext[1] << 48) ^
|
||||
((ulong64)plaintext[2] << 40) ^
|
||||
((ulong64)plaintext[3] << 32) ^
|
||||
((ulong64)plaintext[4] << 24) ^
|
||||
((ulong64)plaintext[5] << 16) ^
|
||||
((ulong64)plaintext[6] << 8) ^
|
||||
((ulong64)plaintext[7] ) ^
|
||||
roundKey[0];
|
||||
|
||||
/*
|
||||
* R - 1 full rounds:
|
||||
*/
|
||||
for (r = 1; r < R; r++) {
|
||||
state =
|
||||
T0[(int)(state >> 56) ] ^
|
||||
T1[(int)(state >> 48) & 0xff] ^
|
||||
T2[(int)(state >> 40) & 0xff] ^
|
||||
T3[(int)(state >> 32) & 0xff] ^
|
||||
T4[(int)(state >> 24) & 0xff] ^
|
||||
T5[(int)(state >> 16) & 0xff] ^
|
||||
T6[(int)(state >> 8) & 0xff] ^
|
||||
T7[(int)(state ) & 0xff] ^
|
||||
roundKey[r];
|
||||
}
|
||||
|
||||
/*
|
||||
* last round:
|
||||
*/
|
||||
state =
|
||||
(T0[(int)(state >> 56) ] & CONST64(0xff00000000000000)) ^
|
||||
(T1[(int)(state >> 48) & 0xff] & CONST64(0x00ff000000000000)) ^
|
||||
(T2[(int)(state >> 40) & 0xff] & CONST64(0x0000ff0000000000)) ^
|
||||
(T3[(int)(state >> 32) & 0xff] & CONST64(0x000000ff00000000)) ^
|
||||
(T4[(int)(state >> 24) & 0xff] & CONST64(0x00000000ff000000)) ^
|
||||
(T5[(int)(state >> 16) & 0xff] & CONST64(0x0000000000ff0000)) ^
|
||||
(T6[(int)(state >> 8) & 0xff] & CONST64(0x000000000000ff00)) ^
|
||||
(T7[(int)(state ) & 0xff] & CONST64(0x00000000000000ff)) ^
|
||||
roundKey[R];
|
||||
|
||||
/*
|
||||
* map cipher state to ciphertext block (mu^{-1}):
|
||||
*/
|
||||
ciphertext[0] = (unsigned char)(state >> 56);
|
||||
ciphertext[1] = (unsigned char)(state >> 48);
|
||||
ciphertext[2] = (unsigned char)(state >> 40);
|
||||
ciphertext[3] = (unsigned char)(state >> 32);
|
||||
ciphertext[4] = (unsigned char)(state >> 24);
|
||||
ciphertext[5] = (unsigned char)(state >> 16);
|
||||
ciphertext[6] = (unsigned char)(state >> 8);
|
||||
ciphertext[7] = (unsigned char)(state );
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with Khazad
|
||||
@param pt The input plaintext (8 bytes)
|
||||
@param ct The output ciphertext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int khazad_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
khazad_crypt(pt, ct, skey->khazad.roundKeyEnc);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Decrypts a block of text with Khazad
|
||||
@param ct The input ciphertext (8 bytes)
|
||||
@param pt The output plaintext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int khazad_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
khazad_crypt(ct, pt, skey->khazad.roundKeyDec);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs a self-test of the Khazad block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int khazad_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct test {
|
||||
unsigned char pt[8], ct[8], key[16];
|
||||
} tests[] = {
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x49, 0xA4, 0xCE, 0x32, 0xAC, 0x19, 0x0E, 0x3F },
|
||||
{ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
}, {
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x64, 0x5D, 0x77, 0x3E, 0x40, 0xAB, 0xDD, 0x53 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }
|
||||
}, {
|
||||
{ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x9E, 0x39, 0x98, 0x64, 0xF7, 0x8E, 0xCA, 0x02 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
}, {
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
|
||||
{ 0xA9, 0xDF, 0x3D, 0x2C, 0x64, 0xD3, 0xEA, 0x28 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
}
|
||||
};
|
||||
int x, y;
|
||||
unsigned char buf[2][8];
|
||||
symmetric_key skey;
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) {
|
||||
khazad_setup(tests[x].key, 16, 0, &skey);
|
||||
khazad_ecb_encrypt(tests[x].pt, buf[0], &skey);
|
||||
khazad_ecb_decrypt(buf[0], buf[1], &skey);
|
||||
if (compare_testvector(buf[0], 8, tests[x].ct, 8, "Khazad Encrypt", x) ||
|
||||
compare_testvector(buf[1], 8, tests[x].pt, 8, "Khazad Decrypt", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
for (y = 0; y < 1000; y++) khazad_ecb_encrypt(buf[0], buf[0], &skey);
|
||||
for (y = 0; y < 1000; y++) khazad_ecb_decrypt(buf[0], buf[0], &skey);
|
||||
if (compare_testvector(buf[0], 8, tests[x].ct, 8, "Khazad 1000", 1000)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void khazad_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int khazad_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize >= 16) {
|
||||
*keysize = 16;
|
||||
return CRYPT_OK;
|
||||
} else {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,376 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file kseed.c
|
||||
seed implementation of SEED derived from RFC4269
|
||||
Tom St Denis
|
||||
*/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_KSEED
|
||||
|
||||
const struct ltc_cipher_descriptor kseed_desc = {
|
||||
"seed",
|
||||
20,
|
||||
16, 16, 16, 16,
|
||||
&kseed_setup,
|
||||
&kseed_ecb_encrypt,
|
||||
&kseed_ecb_decrypt,
|
||||
&kseed_test,
|
||||
&kseed_done,
|
||||
&kseed_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const ulong32 SS0[256] = {
|
||||
0x2989A1A8UL,0x05858184UL,0x16C6D2D4UL,0x13C3D3D0UL,0x14445054UL,0x1D0D111CUL,0x2C8CA0ACUL,0x25052124UL,
|
||||
0x1D4D515CUL,0x03434340UL,0x18081018UL,0x1E0E121CUL,0x11415150UL,0x3CCCF0FCUL,0x0ACAC2C8UL,0x23436360UL,
|
||||
0x28082028UL,0x04444044UL,0x20002020UL,0x1D8D919CUL,0x20C0E0E0UL,0x22C2E2E0UL,0x08C8C0C8UL,0x17071314UL,
|
||||
0x2585A1A4UL,0x0F8F838CUL,0x03030300UL,0x3B4B7378UL,0x3B8BB3B8UL,0x13031310UL,0x12C2D2D0UL,0x2ECEE2ECUL,
|
||||
0x30407070UL,0x0C8C808CUL,0x3F0F333CUL,0x2888A0A8UL,0x32023230UL,0x1DCDD1DCUL,0x36C6F2F4UL,0x34447074UL,
|
||||
0x2CCCE0ECUL,0x15859194UL,0x0B0B0308UL,0x17475354UL,0x1C4C505CUL,0x1B4B5358UL,0x3D8DB1BCUL,0x01010100UL,
|
||||
0x24042024UL,0x1C0C101CUL,0x33437370UL,0x18889098UL,0x10001010UL,0x0CCCC0CCUL,0x32C2F2F0UL,0x19C9D1D8UL,
|
||||
0x2C0C202CUL,0x27C7E3E4UL,0x32427270UL,0x03838380UL,0x1B8B9398UL,0x11C1D1D0UL,0x06868284UL,0x09C9C1C8UL,
|
||||
0x20406060UL,0x10405050UL,0x2383A3A0UL,0x2BCBE3E8UL,0x0D0D010CUL,0x3686B2B4UL,0x1E8E929CUL,0x0F4F434CUL,
|
||||
0x3787B3B4UL,0x1A4A5258UL,0x06C6C2C4UL,0x38487078UL,0x2686A2A4UL,0x12021210UL,0x2F8FA3ACUL,0x15C5D1D4UL,
|
||||
0x21416160UL,0x03C3C3C0UL,0x3484B0B4UL,0x01414140UL,0x12425250UL,0x3D4D717CUL,0x0D8D818CUL,0x08080008UL,
|
||||
0x1F0F131CUL,0x19899198UL,0x00000000UL,0x19091118UL,0x04040004UL,0x13435350UL,0x37C7F3F4UL,0x21C1E1E0UL,
|
||||
0x3DCDF1FCUL,0x36467274UL,0x2F0F232CUL,0x27072324UL,0x3080B0B0UL,0x0B8B8388UL,0x0E0E020CUL,0x2B8BA3A8UL,
|
||||
0x2282A2A0UL,0x2E4E626CUL,0x13839390UL,0x0D4D414CUL,0x29496168UL,0x3C4C707CUL,0x09090108UL,0x0A0A0208UL,
|
||||
0x3F8FB3BCUL,0x2FCFE3ECUL,0x33C3F3F0UL,0x05C5C1C4UL,0x07878384UL,0x14041014UL,0x3ECEF2FCUL,0x24446064UL,
|
||||
0x1ECED2DCUL,0x2E0E222CUL,0x0B4B4348UL,0x1A0A1218UL,0x06060204UL,0x21012120UL,0x2B4B6368UL,0x26466264UL,
|
||||
0x02020200UL,0x35C5F1F4UL,0x12829290UL,0x0A8A8288UL,0x0C0C000CUL,0x3383B3B0UL,0x3E4E727CUL,0x10C0D0D0UL,
|
||||
0x3A4A7278UL,0x07474344UL,0x16869294UL,0x25C5E1E4UL,0x26062224UL,0x00808080UL,0x2D8DA1ACUL,0x1FCFD3DCUL,
|
||||
0x2181A1A0UL,0x30003030UL,0x37073334UL,0x2E8EA2ACUL,0x36063234UL,0x15051114UL,0x22022220UL,0x38083038UL,
|
||||
0x34C4F0F4UL,0x2787A3A4UL,0x05454144UL,0x0C4C404CUL,0x01818180UL,0x29C9E1E8UL,0x04848084UL,0x17879394UL,
|
||||
0x35053134UL,0x0BCBC3C8UL,0x0ECEC2CCUL,0x3C0C303CUL,0x31417170UL,0x11011110UL,0x07C7C3C4UL,0x09898188UL,
|
||||
0x35457174UL,0x3BCBF3F8UL,0x1ACAD2D8UL,0x38C8F0F8UL,0x14849094UL,0x19495158UL,0x02828280UL,0x04C4C0C4UL,
|
||||
0x3FCFF3FCUL,0x09494148UL,0x39093138UL,0x27476364UL,0x00C0C0C0UL,0x0FCFC3CCUL,0x17C7D3D4UL,0x3888B0B8UL,
|
||||
0x0F0F030CUL,0x0E8E828CUL,0x02424240UL,0x23032320UL,0x11819190UL,0x2C4C606CUL,0x1BCBD3D8UL,0x2484A0A4UL,
|
||||
0x34043034UL,0x31C1F1F0UL,0x08484048UL,0x02C2C2C0UL,0x2F4F636CUL,0x3D0D313CUL,0x2D0D212CUL,0x00404040UL,
|
||||
0x3E8EB2BCUL,0x3E0E323CUL,0x3C8CB0BCUL,0x01C1C1C0UL,0x2A8AA2A8UL,0x3A8AB2B8UL,0x0E4E424CUL,0x15455154UL,
|
||||
0x3B0B3338UL,0x1CCCD0DCUL,0x28486068UL,0x3F4F737CUL,0x1C8C909CUL,0x18C8D0D8UL,0x0A4A4248UL,0x16465254UL,
|
||||
0x37477374UL,0x2080A0A0UL,0x2DCDE1ECUL,0x06464244UL,0x3585B1B4UL,0x2B0B2328UL,0x25456164UL,0x3ACAF2F8UL,
|
||||
0x23C3E3E0UL,0x3989B1B8UL,0x3181B1B0UL,0x1F8F939CUL,0x1E4E525CUL,0x39C9F1F8UL,0x26C6E2E4UL,0x3282B2B0UL,
|
||||
0x31013130UL,0x2ACAE2E8UL,0x2D4D616CUL,0x1F4F535CUL,0x24C4E0E4UL,0x30C0F0F0UL,0x0DCDC1CCUL,0x08888088UL,
|
||||
0x16061214UL,0x3A0A3238UL,0x18485058UL,0x14C4D0D4UL,0x22426260UL,0x29092128UL,0x07070304UL,0x33033330UL,
|
||||
0x28C8E0E8UL,0x1B0B1318UL,0x05050104UL,0x39497178UL,0x10809090UL,0x2A4A6268UL,0x2A0A2228UL,0x1A8A9298UL
|
||||
};
|
||||
|
||||
static const ulong32 SS1[256] = {
|
||||
0x38380830UL,0xE828C8E0UL,0x2C2D0D21UL,0xA42686A2UL,0xCC0FCFC3UL,0xDC1ECED2UL,0xB03383B3UL,0xB83888B0UL,
|
||||
0xAC2F8FA3UL,0x60204060UL,0x54154551UL,0xC407C7C3UL,0x44044440UL,0x6C2F4F63UL,0x682B4B63UL,0x581B4B53UL,
|
||||
0xC003C3C3UL,0x60224262UL,0x30330333UL,0xB43585B1UL,0x28290921UL,0xA02080A0UL,0xE022C2E2UL,0xA42787A3UL,
|
||||
0xD013C3D3UL,0x90118191UL,0x10110111UL,0x04060602UL,0x1C1C0C10UL,0xBC3C8CB0UL,0x34360632UL,0x480B4B43UL,
|
||||
0xEC2FCFE3UL,0x88088880UL,0x6C2C4C60UL,0xA82888A0UL,0x14170713UL,0xC404C4C0UL,0x14160612UL,0xF434C4F0UL,
|
||||
0xC002C2C2UL,0x44054541UL,0xE021C1E1UL,0xD416C6D2UL,0x3C3F0F33UL,0x3C3D0D31UL,0x8C0E8E82UL,0x98188890UL,
|
||||
0x28280820UL,0x4C0E4E42UL,0xF436C6F2UL,0x3C3E0E32UL,0xA42585A1UL,0xF839C9F1UL,0x0C0D0D01UL,0xDC1FCFD3UL,
|
||||
0xD818C8D0UL,0x282B0B23UL,0x64264662UL,0x783A4A72UL,0x24270723UL,0x2C2F0F23UL,0xF031C1F1UL,0x70324272UL,
|
||||
0x40024242UL,0xD414C4D0UL,0x40014141UL,0xC000C0C0UL,0x70334373UL,0x64274763UL,0xAC2C8CA0UL,0x880B8B83UL,
|
||||
0xF437C7F3UL,0xAC2D8DA1UL,0x80008080UL,0x1C1F0F13UL,0xC80ACAC2UL,0x2C2C0C20UL,0xA82A8AA2UL,0x34340430UL,
|
||||
0xD012C2D2UL,0x080B0B03UL,0xEC2ECEE2UL,0xE829C9E1UL,0x5C1D4D51UL,0x94148490UL,0x18180810UL,0xF838C8F0UL,
|
||||
0x54174753UL,0xAC2E8EA2UL,0x08080800UL,0xC405C5C1UL,0x10130313UL,0xCC0DCDC1UL,0x84068682UL,0xB83989B1UL,
|
||||
0xFC3FCFF3UL,0x7C3D4D71UL,0xC001C1C1UL,0x30310131UL,0xF435C5F1UL,0x880A8A82UL,0x682A4A62UL,0xB03181B1UL,
|
||||
0xD011C1D1UL,0x20200020UL,0xD417C7D3UL,0x00020202UL,0x20220222UL,0x04040400UL,0x68284860UL,0x70314171UL,
|
||||
0x04070703UL,0xD81BCBD3UL,0x9C1D8D91UL,0x98198991UL,0x60214161UL,0xBC3E8EB2UL,0xE426C6E2UL,0x58194951UL,
|
||||
0xDC1DCDD1UL,0x50114151UL,0x90108090UL,0xDC1CCCD0UL,0x981A8A92UL,0xA02383A3UL,0xA82B8BA3UL,0xD010C0D0UL,
|
||||
0x80018181UL,0x0C0F0F03UL,0x44074743UL,0x181A0A12UL,0xE023C3E3UL,0xEC2CCCE0UL,0x8C0D8D81UL,0xBC3F8FB3UL,
|
||||
0x94168692UL,0x783B4B73UL,0x5C1C4C50UL,0xA02282A2UL,0xA02181A1UL,0x60234363UL,0x20230323UL,0x4C0D4D41UL,
|
||||
0xC808C8C0UL,0x9C1E8E92UL,0x9C1C8C90UL,0x383A0A32UL,0x0C0C0C00UL,0x2C2E0E22UL,0xB83A8AB2UL,0x6C2E4E62UL,
|
||||
0x9C1F8F93UL,0x581A4A52UL,0xF032C2F2UL,0x90128292UL,0xF033C3F3UL,0x48094941UL,0x78384870UL,0xCC0CCCC0UL,
|
||||
0x14150511UL,0xF83BCBF3UL,0x70304070UL,0x74354571UL,0x7C3F4F73UL,0x34350531UL,0x10100010UL,0x00030303UL,
|
||||
0x64244460UL,0x6C2D4D61UL,0xC406C6C2UL,0x74344470UL,0xD415C5D1UL,0xB43484B0UL,0xE82ACAE2UL,0x08090901UL,
|
||||
0x74364672UL,0x18190911UL,0xFC3ECEF2UL,0x40004040UL,0x10120212UL,0xE020C0E0UL,0xBC3D8DB1UL,0x04050501UL,
|
||||
0xF83ACAF2UL,0x00010101UL,0xF030C0F0UL,0x282A0A22UL,0x5C1E4E52UL,0xA82989A1UL,0x54164652UL,0x40034343UL,
|
||||
0x84058581UL,0x14140410UL,0x88098981UL,0x981B8B93UL,0xB03080B0UL,0xE425C5E1UL,0x48084840UL,0x78394971UL,
|
||||
0x94178793UL,0xFC3CCCF0UL,0x1C1E0E12UL,0x80028282UL,0x20210121UL,0x8C0C8C80UL,0x181B0B13UL,0x5C1F4F53UL,
|
||||
0x74374773UL,0x54144450UL,0xB03282B2UL,0x1C1D0D11UL,0x24250521UL,0x4C0F4F43UL,0x00000000UL,0x44064642UL,
|
||||
0xEC2DCDE1UL,0x58184850UL,0x50124252UL,0xE82BCBE3UL,0x7C3E4E72UL,0xD81ACAD2UL,0xC809C9C1UL,0xFC3DCDF1UL,
|
||||
0x30300030UL,0x94158591UL,0x64254561UL,0x3C3C0C30UL,0xB43686B2UL,0xE424C4E0UL,0xB83B8BB3UL,0x7C3C4C70UL,
|
||||
0x0C0E0E02UL,0x50104050UL,0x38390931UL,0x24260622UL,0x30320232UL,0x84048480UL,0x68294961UL,0x90138393UL,
|
||||
0x34370733UL,0xE427C7E3UL,0x24240420UL,0xA42484A0UL,0xC80BCBC3UL,0x50134353UL,0x080A0A02UL,0x84078783UL,
|
||||
0xD819C9D1UL,0x4C0C4C40UL,0x80038383UL,0x8C0F8F83UL,0xCC0ECEC2UL,0x383B0B33UL,0x480A4A42UL,0xB43787B3UL
|
||||
};
|
||||
|
||||
static const ulong32 SS2[256] = {
|
||||
0xA1A82989UL,0x81840585UL,0xD2D416C6UL,0xD3D013C3UL,0x50541444UL,0x111C1D0DUL,0xA0AC2C8CUL,0x21242505UL,
|
||||
0x515C1D4DUL,0x43400343UL,0x10181808UL,0x121C1E0EUL,0x51501141UL,0xF0FC3CCCUL,0xC2C80ACAUL,0x63602343UL,
|
||||
0x20282808UL,0x40440444UL,0x20202000UL,0x919C1D8DUL,0xE0E020C0UL,0xE2E022C2UL,0xC0C808C8UL,0x13141707UL,
|
||||
0xA1A42585UL,0x838C0F8FUL,0x03000303UL,0x73783B4BUL,0xB3B83B8BUL,0x13101303UL,0xD2D012C2UL,0xE2EC2ECEUL,
|
||||
0x70703040UL,0x808C0C8CUL,0x333C3F0FUL,0xA0A82888UL,0x32303202UL,0xD1DC1DCDUL,0xF2F436C6UL,0x70743444UL,
|
||||
0xE0EC2CCCUL,0x91941585UL,0x03080B0BUL,0x53541747UL,0x505C1C4CUL,0x53581B4BUL,0xB1BC3D8DUL,0x01000101UL,
|
||||
0x20242404UL,0x101C1C0CUL,0x73703343UL,0x90981888UL,0x10101000UL,0xC0CC0CCCUL,0xF2F032C2UL,0xD1D819C9UL,
|
||||
0x202C2C0CUL,0xE3E427C7UL,0x72703242UL,0x83800383UL,0x93981B8BUL,0xD1D011C1UL,0x82840686UL,0xC1C809C9UL,
|
||||
0x60602040UL,0x50501040UL,0xA3A02383UL,0xE3E82BCBUL,0x010C0D0DUL,0xB2B43686UL,0x929C1E8EUL,0x434C0F4FUL,
|
||||
0xB3B43787UL,0x52581A4AUL,0xC2C406C6UL,0x70783848UL,0xA2A42686UL,0x12101202UL,0xA3AC2F8FUL,0xD1D415C5UL,
|
||||
0x61602141UL,0xC3C003C3UL,0xB0B43484UL,0x41400141UL,0x52501242UL,0x717C3D4DUL,0x818C0D8DUL,0x00080808UL,
|
||||
0x131C1F0FUL,0x91981989UL,0x00000000UL,0x11181909UL,0x00040404UL,0x53501343UL,0xF3F437C7UL,0xE1E021C1UL,
|
||||
0xF1FC3DCDUL,0x72743646UL,0x232C2F0FUL,0x23242707UL,0xB0B03080UL,0x83880B8BUL,0x020C0E0EUL,0xA3A82B8BUL,
|
||||
0xA2A02282UL,0x626C2E4EUL,0x93901383UL,0x414C0D4DUL,0x61682949UL,0x707C3C4CUL,0x01080909UL,0x02080A0AUL,
|
||||
0xB3BC3F8FUL,0xE3EC2FCFUL,0xF3F033C3UL,0xC1C405C5UL,0x83840787UL,0x10141404UL,0xF2FC3ECEUL,0x60642444UL,
|
||||
0xD2DC1ECEUL,0x222C2E0EUL,0x43480B4BUL,0x12181A0AUL,0x02040606UL,0x21202101UL,0x63682B4BUL,0x62642646UL,
|
||||
0x02000202UL,0xF1F435C5UL,0x92901282UL,0x82880A8AUL,0x000C0C0CUL,0xB3B03383UL,0x727C3E4EUL,0xD0D010C0UL,
|
||||
0x72783A4AUL,0x43440747UL,0x92941686UL,0xE1E425C5UL,0x22242606UL,0x80800080UL,0xA1AC2D8DUL,0xD3DC1FCFUL,
|
||||
0xA1A02181UL,0x30303000UL,0x33343707UL,0xA2AC2E8EUL,0x32343606UL,0x11141505UL,0x22202202UL,0x30383808UL,
|
||||
0xF0F434C4UL,0xA3A42787UL,0x41440545UL,0x404C0C4CUL,0x81800181UL,0xE1E829C9UL,0x80840484UL,0x93941787UL,
|
||||
0x31343505UL,0xC3C80BCBUL,0xC2CC0ECEUL,0x303C3C0CUL,0x71703141UL,0x11101101UL,0xC3C407C7UL,0x81880989UL,
|
||||
0x71743545UL,0xF3F83BCBUL,0xD2D81ACAUL,0xF0F838C8UL,0x90941484UL,0x51581949UL,0x82800282UL,0xC0C404C4UL,
|
||||
0xF3FC3FCFUL,0x41480949UL,0x31383909UL,0x63642747UL,0xC0C000C0UL,0xC3CC0FCFUL,0xD3D417C7UL,0xB0B83888UL,
|
||||
0x030C0F0FUL,0x828C0E8EUL,0x42400242UL,0x23202303UL,0x91901181UL,0x606C2C4CUL,0xD3D81BCBUL,0xA0A42484UL,
|
||||
0x30343404UL,0xF1F031C1UL,0x40480848UL,0xC2C002C2UL,0x636C2F4FUL,0x313C3D0DUL,0x212C2D0DUL,0x40400040UL,
|
||||
0xB2BC3E8EUL,0x323C3E0EUL,0xB0BC3C8CUL,0xC1C001C1UL,0xA2A82A8AUL,0xB2B83A8AUL,0x424C0E4EUL,0x51541545UL,
|
||||
0x33383B0BUL,0xD0DC1CCCUL,0x60682848UL,0x737C3F4FUL,0x909C1C8CUL,0xD0D818C8UL,0x42480A4AUL,0x52541646UL,
|
||||
0x73743747UL,0xA0A02080UL,0xE1EC2DCDUL,0x42440646UL,0xB1B43585UL,0x23282B0BUL,0x61642545UL,0xF2F83ACAUL,
|
||||
0xE3E023C3UL,0xB1B83989UL,0xB1B03181UL,0x939C1F8FUL,0x525C1E4EUL,0xF1F839C9UL,0xE2E426C6UL,0xB2B03282UL,
|
||||
0x31303101UL,0xE2E82ACAUL,0x616C2D4DUL,0x535C1F4FUL,0xE0E424C4UL,0xF0F030C0UL,0xC1CC0DCDUL,0x80880888UL,
|
||||
0x12141606UL,0x32383A0AUL,0x50581848UL,0xD0D414C4UL,0x62602242UL,0x21282909UL,0x03040707UL,0x33303303UL,
|
||||
0xE0E828C8UL,0x13181B0BUL,0x01040505UL,0x71783949UL,0x90901080UL,0x62682A4AUL,0x22282A0AUL,0x92981A8AUL
|
||||
};
|
||||
|
||||
static const ulong32 SS3[256] = {
|
||||
0x08303838UL,0xC8E0E828UL,0x0D212C2DUL,0x86A2A426UL,0xCFC3CC0FUL,0xCED2DC1EUL,0x83B3B033UL,0x88B0B838UL,
|
||||
0x8FA3AC2FUL,0x40606020UL,0x45515415UL,0xC7C3C407UL,0x44404404UL,0x4F636C2FUL,0x4B63682BUL,0x4B53581BUL,
|
||||
0xC3C3C003UL,0x42626022UL,0x03333033UL,0x85B1B435UL,0x09212829UL,0x80A0A020UL,0xC2E2E022UL,0x87A3A427UL,
|
||||
0xC3D3D013UL,0x81919011UL,0x01111011UL,0x06020406UL,0x0C101C1CUL,0x8CB0BC3CUL,0x06323436UL,0x4B43480BUL,
|
||||
0xCFE3EC2FUL,0x88808808UL,0x4C606C2CUL,0x88A0A828UL,0x07131417UL,0xC4C0C404UL,0x06121416UL,0xC4F0F434UL,
|
||||
0xC2C2C002UL,0x45414405UL,0xC1E1E021UL,0xC6D2D416UL,0x0F333C3FUL,0x0D313C3DUL,0x8E828C0EUL,0x88909818UL,
|
||||
0x08202828UL,0x4E424C0EUL,0xC6F2F436UL,0x0E323C3EUL,0x85A1A425UL,0xC9F1F839UL,0x0D010C0DUL,0xCFD3DC1FUL,
|
||||
0xC8D0D818UL,0x0B23282BUL,0x46626426UL,0x4A72783AUL,0x07232427UL,0x0F232C2FUL,0xC1F1F031UL,0x42727032UL,
|
||||
0x42424002UL,0xC4D0D414UL,0x41414001UL,0xC0C0C000UL,0x43737033UL,0x47636427UL,0x8CA0AC2CUL,0x8B83880BUL,
|
||||
0xC7F3F437UL,0x8DA1AC2DUL,0x80808000UL,0x0F131C1FUL,0xCAC2C80AUL,0x0C202C2CUL,0x8AA2A82AUL,0x04303434UL,
|
||||
0xC2D2D012UL,0x0B03080BUL,0xCEE2EC2EUL,0xC9E1E829UL,0x4D515C1DUL,0x84909414UL,0x08101818UL,0xC8F0F838UL,
|
||||
0x47535417UL,0x8EA2AC2EUL,0x08000808UL,0xC5C1C405UL,0x03131013UL,0xCDC1CC0DUL,0x86828406UL,0x89B1B839UL,
|
||||
0xCFF3FC3FUL,0x4D717C3DUL,0xC1C1C001UL,0x01313031UL,0xC5F1F435UL,0x8A82880AUL,0x4A62682AUL,0x81B1B031UL,
|
||||
0xC1D1D011UL,0x00202020UL,0xC7D3D417UL,0x02020002UL,0x02222022UL,0x04000404UL,0x48606828UL,0x41717031UL,
|
||||
0x07030407UL,0xCBD3D81BUL,0x8D919C1DUL,0x89919819UL,0x41616021UL,0x8EB2BC3EUL,0xC6E2E426UL,0x49515819UL,
|
||||
0xCDD1DC1DUL,0x41515011UL,0x80909010UL,0xCCD0DC1CUL,0x8A92981AUL,0x83A3A023UL,0x8BA3A82BUL,0xC0D0D010UL,
|
||||
0x81818001UL,0x0F030C0FUL,0x47434407UL,0x0A12181AUL,0xC3E3E023UL,0xCCE0EC2CUL,0x8D818C0DUL,0x8FB3BC3FUL,
|
||||
0x86929416UL,0x4B73783BUL,0x4C505C1CUL,0x82A2A022UL,0x81A1A021UL,0x43636023UL,0x03232023UL,0x4D414C0DUL,
|
||||
0xC8C0C808UL,0x8E929C1EUL,0x8C909C1CUL,0x0A32383AUL,0x0C000C0CUL,0x0E222C2EUL,0x8AB2B83AUL,0x4E626C2EUL,
|
||||
0x8F939C1FUL,0x4A52581AUL,0xC2F2F032UL,0x82929012UL,0xC3F3F033UL,0x49414809UL,0x48707838UL,0xCCC0CC0CUL,
|
||||
0x05111415UL,0xCBF3F83BUL,0x40707030UL,0x45717435UL,0x4F737C3FUL,0x05313435UL,0x00101010UL,0x03030003UL,
|
||||
0x44606424UL,0x4D616C2DUL,0xC6C2C406UL,0x44707434UL,0xC5D1D415UL,0x84B0B434UL,0xCAE2E82AUL,0x09010809UL,
|
||||
0x46727436UL,0x09111819UL,0xCEF2FC3EUL,0x40404000UL,0x02121012UL,0xC0E0E020UL,0x8DB1BC3DUL,0x05010405UL,
|
||||
0xCAF2F83AUL,0x01010001UL,0xC0F0F030UL,0x0A22282AUL,0x4E525C1EUL,0x89A1A829UL,0x46525416UL,0x43434003UL,
|
||||
0x85818405UL,0x04101414UL,0x89818809UL,0x8B93981BUL,0x80B0B030UL,0xC5E1E425UL,0x48404808UL,0x49717839UL,
|
||||
0x87939417UL,0xCCF0FC3CUL,0x0E121C1EUL,0x82828002UL,0x01212021UL,0x8C808C0CUL,0x0B13181BUL,0x4F535C1FUL,
|
||||
0x47737437UL,0x44505414UL,0x82B2B032UL,0x0D111C1DUL,0x05212425UL,0x4F434C0FUL,0x00000000UL,0x46424406UL,
|
||||
0xCDE1EC2DUL,0x48505818UL,0x42525012UL,0xCBE3E82BUL,0x4E727C3EUL,0xCAD2D81AUL,0xC9C1C809UL,0xCDF1FC3DUL,
|
||||
0x00303030UL,0x85919415UL,0x45616425UL,0x0C303C3CUL,0x86B2B436UL,0xC4E0E424UL,0x8BB3B83BUL,0x4C707C3CUL,
|
||||
0x0E020C0EUL,0x40505010UL,0x09313839UL,0x06222426UL,0x02323032UL,0x84808404UL,0x49616829UL,0x83939013UL,
|
||||
0x07333437UL,0xC7E3E427UL,0x04202424UL,0x84A0A424UL,0xCBC3C80BUL,0x43535013UL,0x0A02080AUL,0x87838407UL,
|
||||
0xC9D1D819UL,0x4C404C0CUL,0x83838003UL,0x8F838C0FUL,0xCEC2CC0EUL,0x0B33383BUL,0x4A42480AUL,0x87B3B437UL
|
||||
};
|
||||
|
||||
static const ulong32 KCi[16] = {
|
||||
0x9E3779B9,0x3C6EF373,
|
||||
0x78DDE6E6,0xF1BBCDCC,
|
||||
0xE3779B99,0xC6EF3733,
|
||||
0x8DDE6E67,0x1BBCDCCF,
|
||||
0x3779B99E,0x6EF3733C,
|
||||
0xDDE6E678,0xBBCDCCF1,
|
||||
0x779B99E3,0xEF3733C6,
|
||||
0xDE6E678D,0xBCDCCF1B
|
||||
};
|
||||
|
||||
#define G(x) (SS3[((x)>>24)&255] ^ SS2[((x)>>16)&255] ^ SS1[((x)>>8)&255] ^ SS0[(x)&255])
|
||||
|
||||
#define F(L1, L2, R1, R2, K1, K2) \
|
||||
T2 = G((R1 ^ K1) ^ (R2 ^ K2)); \
|
||||
T = G( G(T2 + (R1 ^ K1)) + T2); \
|
||||
L2 ^= T; \
|
||||
L1 ^= (T + G(T2 + (R1 ^ K1))); \
|
||||
|
||||
/**
|
||||
Initialize the SEED block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int kseed_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
int i;
|
||||
ulong32 tmp, k1, k2, k3, k4;
|
||||
|
||||
if (keylen != 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
if (num_rounds != 16 && num_rounds != 0) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* load key */
|
||||
LOAD32H(k1, key);
|
||||
LOAD32H(k2, key+4);
|
||||
LOAD32H(k3, key+8);
|
||||
LOAD32H(k4, key+12);
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
skey->kseed.K[2*i+0] = G(k1 + k3 - KCi[i]);
|
||||
skey->kseed.K[2*i+1] = G(k2 - k4 + KCi[i]);
|
||||
if (i&1) {
|
||||
tmp = k3;
|
||||
k3 = ((k3 << 8) | (k4 >> 24)) & 0xFFFFFFFF;
|
||||
k4 = ((k4 << 8) | (tmp >> 24)) & 0xFFFFFFFF;
|
||||
} else {
|
||||
tmp = k1;
|
||||
k1 = ((k1 >> 8) | (k2 << 24)) & 0xFFFFFFFF;
|
||||
k2 = ((k2 >> 8) | (tmp << 24)) & 0xFFFFFFFF;
|
||||
}
|
||||
/* reverse keys for decrypt */
|
||||
skey->kseed.dK[2*(15-i)+0] = skey->kseed.K[2*i+0];
|
||||
skey->kseed.dK[2*(15-i)+1] = skey->kseed.K[2*i+1];
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
static void rounds(ulong32 *P, ulong32 *K)
|
||||
{
|
||||
ulong32 T, T2;
|
||||
int i;
|
||||
for (i = 0; i < 16; i += 2) {
|
||||
F(P[0], P[1], P[2], P[3], K[0], K[1]);
|
||||
F(P[2], P[3], P[0], P[1], K[2], K[3]);
|
||||
K += 4;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with SEED
|
||||
@param pt The input plaintext (16 bytes)
|
||||
@param ct The output ciphertext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int kseed_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
ulong32 P[4];
|
||||
LOAD32H(P[0], pt);
|
||||
LOAD32H(P[1], pt+4);
|
||||
LOAD32H(P[2], pt+8);
|
||||
LOAD32H(P[3], pt+12);
|
||||
rounds(P, skey->kseed.K);
|
||||
STORE32H(P[2], ct);
|
||||
STORE32H(P[3], ct+4);
|
||||
STORE32H(P[0], ct+8);
|
||||
STORE32H(P[1], ct+12);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Decrypts a block of text with SEED
|
||||
@param ct The input ciphertext (16 bytes)
|
||||
@param pt The output plaintext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int kseed_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
ulong32 P[4];
|
||||
LOAD32H(P[0], ct);
|
||||
LOAD32H(P[1], ct+4);
|
||||
LOAD32H(P[2], ct+8);
|
||||
LOAD32H(P[3], ct+12);
|
||||
rounds(P, skey->kseed.dK);
|
||||
STORE32H(P[2], pt);
|
||||
STORE32H(P[3], pt+4);
|
||||
STORE32H(P[0], pt+8);
|
||||
STORE32H(P[1], pt+12);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void kseed_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Performs a self-test of the SEED block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int kseed_test(void)
|
||||
{
|
||||
#if !defined(LTC_TEST)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct test {
|
||||
unsigned char pt[16], ct[16], key[16];
|
||||
} tests[] = {
|
||||
|
||||
{
|
||||
{ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F },
|
||||
{ 0x5E,0xBA,0xC6,0xE0,0x05,0x4E,0x16,0x68,0x19,0xAF,0xF1,0xCC,0x6D,0x34,0x6C,0xDB },
|
||||
{ 0 },
|
||||
},
|
||||
|
||||
{
|
||||
{ 0 },
|
||||
{ 0xC1,0x1F,0x22,0xF2,0x01,0x40,0x50,0x50,0x84,0x48,0x35,0x97,0xE4,0x37,0x0F,0x43 },
|
||||
{ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F },
|
||||
},
|
||||
|
||||
{
|
||||
{ 0x83,0xA2,0xF8,0xA2,0x88,0x64,0x1F,0xB9,0xA4,0xE9,0xA5,0xCC,0x2F,0x13,0x1C,0x7D },
|
||||
{ 0xEE,0x54,0xD1,0x3E,0xBC,0xAE,0x70,0x6D,0x22,0x6B,0xC3,0x14,0x2C,0xD4,0x0D,0x4A },
|
||||
{ 0x47,0x06,0x48,0x08,0x51,0xE6,0x1B,0xE8,0x5D,0x74,0xBF,0xB3,0xFD,0x95,0x61,0x85 },
|
||||
},
|
||||
|
||||
{
|
||||
{ 0xB4,0x1E,0x6B,0xE2,0xEB,0xA8,0x4A,0x14,0x8E,0x2E,0xED,0x84,0x59,0x3C,0x5E,0xC7 },
|
||||
{ 0x9B,0x9B,0x7B,0xFC,0xD1,0x81,0x3C,0xB9,0x5D,0x0B,0x36,0x18,0xF4,0x0F,0x51,0x22 },
|
||||
{ 0x28,0xDB,0xC3,0xBC,0x49,0xFF,0xD8,0x7D,0xCF,0xA5,0x09,0xB1,0x1D,0x42,0x2B,0xE7 },
|
||||
}
|
||||
};
|
||||
int x;
|
||||
unsigned char buf[2][16];
|
||||
symmetric_key skey;
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) {
|
||||
kseed_setup(tests[x].key, 16, 0, &skey);
|
||||
kseed_ecb_encrypt(tests[x].pt, buf[0], &skey);
|
||||
kseed_ecb_decrypt(buf[0], buf[1], &skey);
|
||||
if (compare_testvector(buf[0], 16, tests[x].ct, 16, "KSEED Encrypt", x) ||
|
||||
compare_testvector(buf[1], 16, tests[x].pt, 16, "KSEED Decrypt", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int kseed_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize >= 16) {
|
||||
*keysize = 16;
|
||||
} else {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,319 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file multi2.c
|
||||
Multi-2 implementation (not public domain, hence the default disable)
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_MULTI2
|
||||
|
||||
static void pi1(ulong32 *p)
|
||||
{
|
||||
p[1] ^= p[0];
|
||||
}
|
||||
|
||||
static void pi2(ulong32 *p, ulong32 *k)
|
||||
{
|
||||
ulong32 t;
|
||||
t = (p[1] + k[0]) & 0xFFFFFFFFUL;
|
||||
t = (ROL(t, 1) + t - 1) & 0xFFFFFFFFUL;
|
||||
t = (ROL(t, 4) ^ t) & 0xFFFFFFFFUL;
|
||||
p[0] ^= t;
|
||||
}
|
||||
|
||||
static void pi3(ulong32 *p, ulong32 *k)
|
||||
{
|
||||
ulong32 t;
|
||||
t = p[0] + k[1];
|
||||
t = (ROL(t, 2) + t + 1) & 0xFFFFFFFFUL;
|
||||
t = (ROL(t, 8) ^ t) & 0xFFFFFFFFUL;
|
||||
t = (t + k[2]) & 0xFFFFFFFFUL;
|
||||
t = (ROL(t, 1) - t) & 0xFFFFFFFFUL;
|
||||
t = ROL(t, 16) ^ (p[0] | t);
|
||||
p[1] ^= t;
|
||||
}
|
||||
|
||||
static void pi4(ulong32 *p, ulong32 *k)
|
||||
{
|
||||
ulong32 t;
|
||||
t = (p[1] + k[3]) & 0xFFFFFFFFUL;
|
||||
t = (ROL(t, 2) + t + 1) & 0xFFFFFFFFUL;
|
||||
p[0] ^= t;
|
||||
}
|
||||
|
||||
static void setup(ulong32 *dk, ulong32 *k, ulong32 *uk)
|
||||
{
|
||||
int n, t;
|
||||
ulong32 p[2];
|
||||
|
||||
p[0] = dk[0]; p[1] = dk[1];
|
||||
|
||||
t = 4;
|
||||
n = 0;
|
||||
pi1(p);
|
||||
pi2(p, k);
|
||||
uk[n++] = p[0];
|
||||
pi3(p, k);
|
||||
uk[n++] = p[1];
|
||||
pi4(p, k);
|
||||
uk[n++] = p[0];
|
||||
pi1(p);
|
||||
uk[n++] = p[1];
|
||||
pi2(p, k+t);
|
||||
uk[n++] = p[0];
|
||||
pi3(p, k+t);
|
||||
uk[n++] = p[1];
|
||||
pi4(p, k+t);
|
||||
uk[n++] = p[0];
|
||||
pi1(p);
|
||||
uk[n++] = p[1];
|
||||
}
|
||||
|
||||
static void encrypt(ulong32 *p, int N, ulong32 *uk)
|
||||
{
|
||||
int n, t;
|
||||
for (t = n = 0; ; ) {
|
||||
pi1(p); if (++n == N) break;
|
||||
pi2(p, uk+t); if (++n == N) break;
|
||||
pi3(p, uk+t); if (++n == N) break;
|
||||
pi4(p, uk+t); if (++n == N) break;
|
||||
t ^= 4;
|
||||
}
|
||||
}
|
||||
|
||||
static void decrypt(ulong32 *p, int N, ulong32 *uk)
|
||||
{
|
||||
int n, t;
|
||||
for (t = 4*(((N-1)>>2)&1), n = N; ; ) {
|
||||
switch (n<=4 ? n : ((n-1)%4)+1) {
|
||||
case 4: pi4(p, uk+t); --n; /* FALLTHROUGH */
|
||||
case 3: pi3(p, uk+t); --n; /* FALLTHROUGH */
|
||||
case 2: pi2(p, uk+t); --n; /* FALLTHROUGH */
|
||||
case 1: pi1(p); --n; break;
|
||||
case 0: return;
|
||||
}
|
||||
t ^= 4;
|
||||
}
|
||||
}
|
||||
|
||||
const struct ltc_cipher_descriptor multi2_desc = {
|
||||
"multi2",
|
||||
22,
|
||||
40, 40, 8, 128,
|
||||
&multi2_setup,
|
||||
&multi2_ecb_encrypt,
|
||||
&multi2_ecb_decrypt,
|
||||
&multi2_test,
|
||||
&multi2_done,
|
||||
&multi2_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
int multi2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
ulong32 sk[8], dk[2];
|
||||
int x;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (keylen != 40) return CRYPT_INVALID_KEYSIZE;
|
||||
if (num_rounds == 0) num_rounds = 128;
|
||||
|
||||
skey->multi2.N = num_rounds;
|
||||
for (x = 0; x < 8; x++) {
|
||||
LOAD32H(sk[x], key + x*4);
|
||||
}
|
||||
LOAD32H(dk[0], key + 32);
|
||||
LOAD32H(dk[1], key + 36);
|
||||
setup(dk, sk, skey->multi2.uk);
|
||||
|
||||
zeromem(sk, sizeof(sk));
|
||||
zeromem(dk, sizeof(dk));
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with multi2
|
||||
@param pt The input plaintext (8 bytes)
|
||||
@param ct The output ciphertext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int multi2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
ulong32 p[2];
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LOAD32H(p[0], pt);
|
||||
LOAD32H(p[1], pt+4);
|
||||
encrypt(p, skey->multi2.N, skey->multi2.uk);
|
||||
STORE32H(p[0], ct);
|
||||
STORE32H(p[1], ct+4);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Decrypts a block of text with multi2
|
||||
@param ct The input ciphertext (8 bytes)
|
||||
@param pt The output plaintext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int multi2_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
ulong32 p[2];
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LOAD32H(p[0], ct);
|
||||
LOAD32H(p[1], ct+4);
|
||||
decrypt(p, skey->multi2.N, skey->multi2.uk);
|
||||
STORE32H(p[0], pt);
|
||||
STORE32H(p[1], pt+4);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs a self-test of the multi2 block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int multi2_test(void)
|
||||
{
|
||||
static const struct {
|
||||
unsigned char key[40];
|
||||
unsigned char pt[8], ct[8];
|
||||
int rounds;
|
||||
} tests[] = {
|
||||
{
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x01, 0x23, 0x45, 0x67,
|
||||
0x89, 0xAB, 0xCD, 0xEF
|
||||
},
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
},
|
||||
{
|
||||
0xf8, 0x94, 0x40, 0x84,
|
||||
0x5e, 0x11, 0xcf, 0x89
|
||||
},
|
||||
128,
|
||||
},
|
||||
{
|
||||
{
|
||||
0x35, 0x91, 0x9d, 0x96,
|
||||
0x07, 0x02, 0xe2, 0xce,
|
||||
0x8d, 0x0b, 0x58, 0x3c,
|
||||
0xc9, 0xc8, 0x9d, 0x59,
|
||||
0xa2, 0xae, 0x96, 0x4e,
|
||||
0x87, 0x82, 0x45, 0xed,
|
||||
0x3f, 0x2e, 0x62, 0xd6,
|
||||
0x36, 0x35, 0xd0, 0x67,
|
||||
|
||||
0xb1, 0x27, 0xb9, 0x06,
|
||||
0xe7, 0x56, 0x22, 0x38,
|
||||
},
|
||||
{
|
||||
0x1f, 0xb4, 0x60, 0x60,
|
||||
0xd0, 0xb3, 0x4f, 0xa5
|
||||
},
|
||||
{
|
||||
0xca, 0x84, 0xa9, 0x34,
|
||||
0x75, 0xc8, 0x60, 0xe5
|
||||
},
|
||||
216,
|
||||
}
|
||||
};
|
||||
unsigned char buf[8];
|
||||
symmetric_key skey;
|
||||
int err, x;
|
||||
|
||||
for (x = 1; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) {
|
||||
if ((err = multi2_setup(tests[x].key, 40, tests[x].rounds, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = multi2_ecb_encrypt(tests[x].pt, buf, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (compare_testvector(buf, 8, tests[x].ct, 8, "Multi2 Encrypt", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
if ((err = multi2_ecb_decrypt(buf, buf, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if (compare_testvector(buf, 8, tests[x].pt, 8, "Multi2 Decrypt", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
}
|
||||
|
||||
for (x = 128; x < 256; ++x) {
|
||||
unsigned char ct[8];
|
||||
|
||||
if ((err = multi2_setup(tests[0].key, 40, x, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = multi2_ecb_encrypt(tests[0].pt, ct, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = multi2_ecb_decrypt(ct, buf, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if (compare_testvector(buf, 8, tests[0].pt, 8, "Multi2 Rounds", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void multi2_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int multi2_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize >= 40) {
|
||||
*keysize = 40;
|
||||
} else {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,328 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
/**
|
||||
@file noekeon.c
|
||||
Implementation of the Noekeon block cipher by Tom St Denis
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_NOEKEON
|
||||
|
||||
const struct ltc_cipher_descriptor noekeon_desc =
|
||||
{
|
||||
"noekeon",
|
||||
16,
|
||||
16, 16, 16, 16,
|
||||
&noekeon_setup,
|
||||
&noekeon_ecb_encrypt,
|
||||
&noekeon_ecb_decrypt,
|
||||
&noekeon_test,
|
||||
&noekeon_done,
|
||||
&noekeon_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const ulong32 RC[] = {
|
||||
0x00000080UL, 0x0000001bUL, 0x00000036UL, 0x0000006cUL,
|
||||
0x000000d8UL, 0x000000abUL, 0x0000004dUL, 0x0000009aUL,
|
||||
0x0000002fUL, 0x0000005eUL, 0x000000bcUL, 0x00000063UL,
|
||||
0x000000c6UL, 0x00000097UL, 0x00000035UL, 0x0000006aUL,
|
||||
0x000000d4UL
|
||||
};
|
||||
|
||||
#define kTHETA(a, b, c, d) \
|
||||
temp = a^c; temp = temp ^ ROLc(temp, 8) ^ RORc(temp, 8); \
|
||||
b ^= temp; d ^= temp; \
|
||||
temp = b^d; temp = temp ^ ROLc(temp, 8) ^ RORc(temp, 8); \
|
||||
a ^= temp; c ^= temp;
|
||||
|
||||
#define THETA(k, a, b, c, d) \
|
||||
temp = a^c; temp = temp ^ ROLc(temp, 8) ^ RORc(temp, 8); \
|
||||
b ^= temp ^ k[1]; d ^= temp ^ k[3]; \
|
||||
temp = b^d; temp = temp ^ ROLc(temp, 8) ^ RORc(temp, 8); \
|
||||
a ^= temp ^ k[0]; c ^= temp ^ k[2];
|
||||
|
||||
#define GAMMA(a, b, c, d) \
|
||||
b ^= ~(d|c); \
|
||||
a ^= c&b; \
|
||||
temp = d; d = a; a = temp;\
|
||||
c ^= a ^ b ^ d; \
|
||||
b ^= ~(d|c); \
|
||||
a ^= c&b;
|
||||
|
||||
#define PI1(a, b, c, d) \
|
||||
b = ROLc(b, 1); c = ROLc(c, 5); d = ROLc(d, 2);
|
||||
|
||||
#define PI2(a, b, c, d) \
|
||||
b = RORc(b, 1); c = RORc(c, 5); d = RORc(d, 2);
|
||||
|
||||
/**
|
||||
Initialize the Noekeon block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int noekeon_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
ulong32 temp;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (keylen != 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
if (num_rounds != 16 && num_rounds != 0) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
LOAD32H(skey->noekeon.K[0],&key[0]);
|
||||
LOAD32H(skey->noekeon.K[1],&key[4]);
|
||||
LOAD32H(skey->noekeon.K[2],&key[8]);
|
||||
LOAD32H(skey->noekeon.K[3],&key[12]);
|
||||
|
||||
LOAD32H(skey->noekeon.dK[0],&key[0]);
|
||||
LOAD32H(skey->noekeon.dK[1],&key[4]);
|
||||
LOAD32H(skey->noekeon.dK[2],&key[8]);
|
||||
LOAD32H(skey->noekeon.dK[3],&key[12]);
|
||||
|
||||
kTHETA(skey->noekeon.dK[0], skey->noekeon.dK[1], skey->noekeon.dK[2], skey->noekeon.dK[3]);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with Noekeon
|
||||
@param pt The input plaintext (16 bytes)
|
||||
@param ct The output ciphertext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#else
|
||||
int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 a,b,c,d,temp;
|
||||
int r;
|
||||
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
|
||||
LOAD32H(a,&pt[0]); LOAD32H(b,&pt[4]);
|
||||
LOAD32H(c,&pt[8]); LOAD32H(d,&pt[12]);
|
||||
|
||||
#define ROUND(i) \
|
||||
a ^= RC[i]; \
|
||||
THETA(skey->noekeon.K, a,b,c,d); \
|
||||
PI1(a,b,c,d); \
|
||||
GAMMA(a,b,c,d); \
|
||||
PI2(a,b,c,d);
|
||||
|
||||
for (r = 0; r < 16; ++r) {
|
||||
ROUND(r);
|
||||
}
|
||||
|
||||
#undef ROUND
|
||||
|
||||
a ^= RC[16];
|
||||
THETA(skey->noekeon.K, a, b, c, d);
|
||||
|
||||
STORE32H(a,&ct[0]); STORE32H(b,&ct[4]);
|
||||
STORE32H(c,&ct[8]); STORE32H(d,&ct[12]);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
int err = _noekeon_ecb_encrypt(pt, ct, skey);
|
||||
burn_stack(sizeof(ulong32) * 5 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Decrypts a block of text with Noekeon
|
||||
@param ct The input ciphertext (16 bytes)
|
||||
@param pt The output plaintext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#else
|
||||
int noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 a,b,c,d, temp;
|
||||
int r;
|
||||
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
|
||||
LOAD32H(a,&ct[0]); LOAD32H(b,&ct[4]);
|
||||
LOAD32H(c,&ct[8]); LOAD32H(d,&ct[12]);
|
||||
|
||||
|
||||
#define ROUND(i) \
|
||||
THETA(skey->noekeon.dK, a,b,c,d); \
|
||||
a ^= RC[i]; \
|
||||
PI1(a,b,c,d); \
|
||||
GAMMA(a,b,c,d); \
|
||||
PI2(a,b,c,d);
|
||||
|
||||
for (r = 16; r > 0; --r) {
|
||||
ROUND(r);
|
||||
}
|
||||
|
||||
#undef ROUND
|
||||
|
||||
THETA(skey->noekeon.dK, a,b,c,d);
|
||||
a ^= RC[0];
|
||||
STORE32H(a,&pt[0]); STORE32H(b, &pt[4]);
|
||||
STORE32H(c,&pt[8]); STORE32H(d, &pt[12]);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
int err = _noekeon_ecb_decrypt(ct, pt, skey);
|
||||
burn_stack(sizeof(ulong32) * 5 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Performs a self-test of the Noekeon block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int noekeon_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
int keylen;
|
||||
unsigned char key[16], pt[16], ct[16];
|
||||
} tests[] = {
|
||||
{
|
||||
16,
|
||||
{ 0xAA, 0x3C, 0x8C, 0x86, 0xD9, 0x8B, 0xF8, 0xBE, 0x21, 0xE0, 0x36, 0x09, 0x78, 0xFB, 0xE4, 0x90 },
|
||||
{ 0xE4, 0x96, 0x6C, 0xD3, 0x13, 0xA0, 0x6C, 0xAF, 0xD0, 0x23, 0xC9, 0xFD, 0x45, 0x32, 0x23, 0x16 },
|
||||
{ 0xA6, 0xEC, 0xB8, 0xA8, 0x61, 0xFD, 0x62, 0xD9, 0x13, 0x02, 0xFE, 0x9E, 0x47, 0x01, 0x3F, 0xC3 }
|
||||
},
|
||||
{
|
||||
16,
|
||||
{ 0xED, 0x43, 0xD1, 0x87, 0x21, 0x7E, 0xE0, 0x97, 0x3D, 0x76, 0xC3, 0x37, 0x2E, 0x7D, 0xAE, 0xD3 },
|
||||
{ 0xE3, 0x38, 0x32, 0xCC, 0xF2, 0x2F, 0x2F, 0x0A, 0x4A, 0x8B, 0x8F, 0x18, 0x12, 0x20, 0x17, 0xD3 },
|
||||
{ 0x94, 0xA5, 0xDF, 0xF5, 0xAE, 0x1C, 0xBB, 0x22, 0xAD, 0xEB, 0xA7, 0x0D, 0xB7, 0x82, 0x90, 0xA0 }
|
||||
},
|
||||
{
|
||||
16,
|
||||
{ 0x6F, 0xDC, 0x23, 0x38, 0xF2, 0x10, 0xFB, 0xD3, 0xC1, 0x8C, 0x02, 0xF6, 0xB4, 0x6A, 0xD5, 0xA8 },
|
||||
{ 0xDB, 0x29, 0xED, 0xB5, 0x5F, 0xB3, 0x60, 0x3A, 0x92, 0xA8, 0xEB, 0x9C, 0x6D, 0x9D, 0x3E, 0x8F },
|
||||
{ 0x78, 0xF3, 0x6F, 0xF8, 0x9E, 0xBB, 0x8C, 0x6A, 0xE8, 0x10, 0xF7, 0x00, 0x22, 0x15, 0x30, 0x3D }
|
||||
},
|
||||
{
|
||||
16,
|
||||
{ 0x2C, 0x0C, 0x02, 0xEF, 0x6B, 0xC4, 0xF2, 0x0B, 0x2E, 0xB9, 0xE0, 0xBF, 0xD9, 0x36, 0xC2, 0x4E },
|
||||
{ 0x84, 0xE2, 0xFE, 0x64, 0xB1, 0xB9, 0xFE, 0x76, 0xA8, 0x3F, 0x45, 0xC7, 0x40, 0x7A, 0xAF, 0xEE },
|
||||
{ 0x2A, 0x08, 0xD6, 0xA2, 0x1C, 0x63, 0x08, 0xB0, 0xF8, 0xBC, 0xB3, 0xA1, 0x66, 0xF7, 0xAE, 0xCF }
|
||||
},
|
||||
{
|
||||
16,
|
||||
{ 0x6F, 0x30, 0xF8, 0x9F, 0xDA, 0x6E, 0xA0, 0x91, 0x04, 0x0F, 0x6C, 0x8B, 0x7D, 0xF7, 0x2A, 0x4B },
|
||||
{ 0x65, 0xB6, 0xA6, 0xD0, 0x42, 0x14, 0x08, 0x60, 0x34, 0x8D, 0x37, 0x2F, 0x01, 0xF0, 0x46, 0xBE },
|
||||
{ 0x66, 0xAC, 0x0B, 0x62, 0x1D, 0x68, 0x11, 0xF5, 0x27, 0xB1, 0x13, 0x5D, 0xF3, 0x2A, 0xE9, 0x18 }
|
||||
},
|
||||
{
|
||||
16,
|
||||
{ 0xCA, 0xA4, 0x16, 0xB7, 0x1C, 0x92, 0x2E, 0xAD, 0xEB, 0xA7, 0xDB, 0x69, 0x92, 0xCB, 0x35, 0xEF },
|
||||
{ 0x81, 0x6F, 0x8E, 0x4D, 0x96, 0xC6, 0xB3, 0x67, 0x83, 0xF5, 0x63, 0xC7, 0x20, 0x6D, 0x40, 0x23 },
|
||||
{ 0x44, 0xF7, 0x63, 0x62, 0xF0, 0x43, 0xBB, 0x67, 0x4A, 0x75, 0x12, 0x42, 0x46, 0x29, 0x28, 0x19 }
|
||||
},
|
||||
{
|
||||
16,
|
||||
{ 0x6B, 0xCF, 0x22, 0x2F, 0xE0, 0x1B, 0xB0, 0xAA, 0xD8, 0x3C, 0x91, 0x99, 0x18, 0xB2, 0x28, 0xE8 },
|
||||
{ 0x7C, 0x37, 0xC7, 0xD0, 0xAC, 0x92, 0x29, 0xF1, 0x60, 0x82, 0x93, 0x89, 0xAA, 0x61, 0xAA, 0xA9 },
|
||||
{ 0xE5, 0x89, 0x1B, 0xB3, 0xFE, 0x8B, 0x0C, 0xA1, 0xA6, 0xC7, 0xBE, 0x12, 0x73, 0x0F, 0xC1, 0x19 }
|
||||
},
|
||||
{
|
||||
16,
|
||||
{ 0xE6, 0xD0, 0xF1, 0x03, 0x2E, 0xDE, 0x70, 0x8D, 0xD8, 0x9E, 0x36, 0x5C, 0x05, 0x52, 0xE7, 0x0D },
|
||||
{ 0xE2, 0x42, 0xE7, 0x92, 0x0E, 0xF7, 0x82, 0xA2, 0xB8, 0x21, 0x8D, 0x26, 0xBA, 0x2D, 0xE6, 0x32 },
|
||||
{ 0x1E, 0xDD, 0x75, 0x22, 0xB9, 0x36, 0x8A, 0x0F, 0x32, 0xFD, 0xD4, 0x48, 0x65, 0x12, 0x5A, 0x2F }
|
||||
}
|
||||
};
|
||||
symmetric_key key;
|
||||
unsigned char tmp[2][16];
|
||||
int err, i, y;
|
||||
|
||||
for (i = 0; i < (int)(sizeof(tests)/sizeof(tests[0])); i++) {
|
||||
zeromem(&key, sizeof(key));
|
||||
if ((err = noekeon_setup(tests[i].key, tests[i].keylen, 0, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
noekeon_ecb_encrypt(tests[i].pt, tmp[0], &key);
|
||||
noekeon_ecb_decrypt(tmp[0], tmp[1], &key);
|
||||
if (compare_testvector(tmp[0], 16, tests[i].ct, 16, "Noekeon Encrypt", i) ||
|
||||
compare_testvector(tmp[1], 16, tests[i].pt, 16, "Noekeon Decrypt", i)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 16; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) noekeon_ecb_encrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 1000; y++) noekeon_ecb_decrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void noekeon_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int noekeon_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else {
|
||||
*keysize = 16;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,417 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
/**********************************************************************\
|
||||
* To commemorate the 1996 RSA Data Security Conference, the following *
|
||||
* code is released into the public domain by its author. Prost! *
|
||||
* *
|
||||
* This cipher uses 16-bit words and little-endian byte ordering. *
|
||||
* I wonder which processor it was optimized for? *
|
||||
* *
|
||||
* Thanks to CodeView, SoftIce, and D86 for helping bring this code to *
|
||||
* the public. *
|
||||
\**********************************************************************/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file rc2.c
|
||||
Implementation of RC2 with fixed effective key length of 64bits
|
||||
*/
|
||||
|
||||
#ifdef LTC_RC2
|
||||
|
||||
const struct ltc_cipher_descriptor rc2_desc = {
|
||||
"rc2",
|
||||
12, 8, 128, 8, 16,
|
||||
&rc2_setup,
|
||||
&rc2_ecb_encrypt,
|
||||
&rc2_ecb_decrypt,
|
||||
&rc2_test,
|
||||
&rc2_done,
|
||||
&rc2_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
/* 256-entry permutation table, probably derived somehow from pi */
|
||||
static const unsigned char permute[256] = {
|
||||
217,120,249,196, 25,221,181,237, 40,233,253,121, 74,160,216,157,
|
||||
198,126, 55,131, 43,118, 83,142, 98, 76,100,136, 68,139,251,162,
|
||||
23,154, 89,245,135,179, 79, 19, 97, 69,109,141, 9,129,125, 50,
|
||||
189,143, 64,235,134,183,123, 11,240,149, 33, 34, 92,107, 78,130,
|
||||
84,214,101,147,206, 96,178, 28,115, 86,192, 20,167,140,241,220,
|
||||
18,117,202, 31, 59,190,228,209, 66, 61,212, 48,163, 60,182, 38,
|
||||
111,191, 14,218, 70,105, 7, 87, 39,242, 29,155,188,148, 67, 3,
|
||||
248, 17,199,246,144,239, 62,231, 6,195,213, 47,200,102, 30,215,
|
||||
8,232,234,222,128, 82,238,247,132,170,114,172, 53, 77,106, 42,
|
||||
150, 26,210,113, 90, 21, 73,116, 75,159,208, 94, 4, 24,164,236,
|
||||
194,224, 65,110, 15, 81,203,204, 36,145,175, 80,161,244,112, 57,
|
||||
153,124, 58,133, 35,184,180,122,252, 2, 54, 91, 37, 85,151, 49,
|
||||
45, 93,250,152,227,138,146,174, 5,223, 41, 16,103,108,186,201,
|
||||
211, 0,230,207,225,158,168, 44, 99, 22, 1, 63, 88,226,137,169,
|
||||
13, 56, 52, 27,171, 51,255,176,187, 72, 12, 95,185,177,205, 46,
|
||||
197,243,219, 71,229,165,156,119, 10,166, 32,104,254,127,193,173
|
||||
};
|
||||
|
||||
/**
|
||||
Initialize the RC2 block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param bits The effective key length in bits
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int rc2_setup_ex(const unsigned char *key, int keylen, int bits, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
unsigned *xkey = skey->rc2.xkey;
|
||||
unsigned char tmp[128];
|
||||
unsigned T8, TM;
|
||||
int i;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (keylen == 0 || keylen > 128 || bits > 1024) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
if (bits == 0) {
|
||||
bits = 1024;
|
||||
}
|
||||
|
||||
if (num_rounds != 0 && num_rounds != 16) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
for (i = 0; i < keylen; i++) {
|
||||
tmp[i] = key[i] & 255;
|
||||
}
|
||||
|
||||
/* Phase 1: Expand input key to 128 bytes */
|
||||
if (keylen < 128) {
|
||||
for (i = keylen; i < 128; i++) {
|
||||
tmp[i] = permute[(tmp[i - 1] + tmp[i - keylen]) & 255];
|
||||
}
|
||||
}
|
||||
|
||||
/* Phase 2 - reduce effective key size to "bits" */
|
||||
T8 = (unsigned)(bits+7)>>3;
|
||||
TM = (255 >> (unsigned)(7 & -bits));
|
||||
tmp[128 - T8] = permute[tmp[128 - T8] & TM];
|
||||
for (i = 127 - T8; i >= 0; i--) {
|
||||
tmp[i] = permute[tmp[i + 1] ^ tmp[i + T8]];
|
||||
}
|
||||
|
||||
/* Phase 3 - copy to xkey in little-endian order */
|
||||
for (i = 0; i < 64; i++) {
|
||||
xkey[i] = (unsigned)tmp[2*i] + ((unsigned)tmp[2*i+1] << 8);
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(tmp, sizeof(tmp));
|
||||
#endif
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Initialize the RC2 block cipher
|
||||
|
||||
The effective key length is here always keylen * 8
|
||||
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
return rc2_setup_ex(key, keylen, keylen * 8, num_rounds, skey);
|
||||
}
|
||||
|
||||
/**********************************************************************\
|
||||
* Encrypt an 8-byte block of plaintext using the given key. *
|
||||
\**********************************************************************/
|
||||
/**
|
||||
Encrypts a block of text with RC2
|
||||
@param pt The input plaintext (8 bytes)
|
||||
@param ct The output ciphertext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc2_ecb_encrypt( const unsigned char *pt,
|
||||
unsigned char *ct,
|
||||
symmetric_key *skey)
|
||||
#else
|
||||
int rc2_ecb_encrypt( const unsigned char *pt,
|
||||
unsigned char *ct,
|
||||
symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
unsigned *xkey;
|
||||
unsigned x76, x54, x32, x10, i;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
xkey = skey->rc2.xkey;
|
||||
|
||||
x76 = ((unsigned)pt[7] << 8) + (unsigned)pt[6];
|
||||
x54 = ((unsigned)pt[5] << 8) + (unsigned)pt[4];
|
||||
x32 = ((unsigned)pt[3] << 8) + (unsigned)pt[2];
|
||||
x10 = ((unsigned)pt[1] << 8) + (unsigned)pt[0];
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
x10 = (x10 + (x32 & ~x76) + (x54 & x76) + xkey[4*i+0]) & 0xFFFF;
|
||||
x10 = ((x10 << 1) | (x10 >> 15));
|
||||
|
||||
x32 = (x32 + (x54 & ~x10) + (x76 & x10) + xkey[4*i+1]) & 0xFFFF;
|
||||
x32 = ((x32 << 2) | (x32 >> 14));
|
||||
|
||||
x54 = (x54 + (x76 & ~x32) + (x10 & x32) + xkey[4*i+2]) & 0xFFFF;
|
||||
x54 = ((x54 << 3) | (x54 >> 13));
|
||||
|
||||
x76 = (x76 + (x10 & ~x54) + (x32 & x54) + xkey[4*i+3]) & 0xFFFF;
|
||||
x76 = ((x76 << 5) | (x76 >> 11));
|
||||
|
||||
if (i == 4 || i == 10) {
|
||||
x10 = (x10 + xkey[x76 & 63]) & 0xFFFF;
|
||||
x32 = (x32 + xkey[x10 & 63]) & 0xFFFF;
|
||||
x54 = (x54 + xkey[x32 & 63]) & 0xFFFF;
|
||||
x76 = (x76 + xkey[x54 & 63]) & 0xFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
ct[0] = (unsigned char)x10;
|
||||
ct[1] = (unsigned char)(x10 >> 8);
|
||||
ct[2] = (unsigned char)x32;
|
||||
ct[3] = (unsigned char)(x32 >> 8);
|
||||
ct[4] = (unsigned char)x54;
|
||||
ct[5] = (unsigned char)(x54 >> 8);
|
||||
ct[6] = (unsigned char)x76;
|
||||
ct[7] = (unsigned char)(x76 >> 8);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc2_ecb_encrypt( const unsigned char *pt,
|
||||
unsigned char *ct,
|
||||
symmetric_key *skey)
|
||||
{
|
||||
int err = _rc2_ecb_encrypt(pt, ct, skey);
|
||||
burn_stack(sizeof(unsigned *) + sizeof(unsigned) * 5);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**********************************************************************\
|
||||
* Decrypt an 8-byte block of ciphertext using the given key. *
|
||||
\**********************************************************************/
|
||||
/**
|
||||
Decrypts a block of text with RC2
|
||||
@param ct The input ciphertext (8 bytes)
|
||||
@param pt The output plaintext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc2_ecb_decrypt( const unsigned char *ct,
|
||||
unsigned char *pt,
|
||||
symmetric_key *skey)
|
||||
#else
|
||||
int rc2_ecb_decrypt( const unsigned char *ct,
|
||||
unsigned char *pt,
|
||||
symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
unsigned x76, x54, x32, x10;
|
||||
unsigned *xkey;
|
||||
int i;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
xkey = skey->rc2.xkey;
|
||||
|
||||
x76 = ((unsigned)ct[7] << 8) + (unsigned)ct[6];
|
||||
x54 = ((unsigned)ct[5] << 8) + (unsigned)ct[4];
|
||||
x32 = ((unsigned)ct[3] << 8) + (unsigned)ct[2];
|
||||
x10 = ((unsigned)ct[1] << 8) + (unsigned)ct[0];
|
||||
|
||||
for (i = 15; i >= 0; i--) {
|
||||
if (i == 4 || i == 10) {
|
||||
x76 = (x76 - xkey[x54 & 63]) & 0xFFFF;
|
||||
x54 = (x54 - xkey[x32 & 63]) & 0xFFFF;
|
||||
x32 = (x32 - xkey[x10 & 63]) & 0xFFFF;
|
||||
x10 = (x10 - xkey[x76 & 63]) & 0xFFFF;
|
||||
}
|
||||
|
||||
x76 = ((x76 << 11) | (x76 >> 5));
|
||||
x76 = (x76 - ((x10 & ~x54) + (x32 & x54) + xkey[4*i+3])) & 0xFFFF;
|
||||
|
||||
x54 = ((x54 << 13) | (x54 >> 3));
|
||||
x54 = (x54 - ((x76 & ~x32) + (x10 & x32) + xkey[4*i+2])) & 0xFFFF;
|
||||
|
||||
x32 = ((x32 << 14) | (x32 >> 2));
|
||||
x32 = (x32 - ((x54 & ~x10) + (x76 & x10) + xkey[4*i+1])) & 0xFFFF;
|
||||
|
||||
x10 = ((x10 << 15) | (x10 >> 1));
|
||||
x10 = (x10 - ((x32 & ~x76) + (x54 & x76) + xkey[4*i+0])) & 0xFFFF;
|
||||
}
|
||||
|
||||
pt[0] = (unsigned char)x10;
|
||||
pt[1] = (unsigned char)(x10 >> 8);
|
||||
pt[2] = (unsigned char)x32;
|
||||
pt[3] = (unsigned char)(x32 >> 8);
|
||||
pt[4] = (unsigned char)x54;
|
||||
pt[5] = (unsigned char)(x54 >> 8);
|
||||
pt[6] = (unsigned char)x76;
|
||||
pt[7] = (unsigned char)(x76 >> 8);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc2_ecb_decrypt( const unsigned char *ct,
|
||||
unsigned char *pt,
|
||||
symmetric_key *skey)
|
||||
{
|
||||
int err = _rc2_ecb_decrypt(ct, pt, skey);
|
||||
burn_stack(sizeof(unsigned *) + sizeof(unsigned) * 4 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Performs a self-test of the RC2 block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int rc2_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
int keylen, bits;
|
||||
unsigned char key[16], pt[8], ct[8];
|
||||
} tests[] = {
|
||||
|
||||
{ 8, 63,
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0xeb, 0xb7, 0x73, 0xf9, 0x93, 0x27, 0x8e, 0xff }
|
||||
},
|
||||
{ 8, 64,
|
||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
|
||||
{ 0x27, 0x8b, 0x27, 0xe4, 0x2e, 0x2f, 0x0d, 0x49 }
|
||||
},
|
||||
{ 8, 64,
|
||||
{ 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 },
|
||||
{ 0x30, 0x64, 0x9e, 0xdf, 0x9b, 0xe7, 0xd2, 0xc2 }
|
||||
},
|
||||
{ 1, 64,
|
||||
{ 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x61, 0xa8, 0xa2, 0x44, 0xad, 0xac, 0xcc, 0xf0 }
|
||||
},
|
||||
{ 7, 64,
|
||||
{ 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x6c, 0xcf, 0x43, 0x08, 0x97, 0x4c, 0x26, 0x7f }
|
||||
},
|
||||
{ 16, 64,
|
||||
{ 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x7f,
|
||||
0x0f, 0x79, 0xc3, 0x84, 0x62, 0x7b, 0xaf, 0xb2 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x1a, 0x80, 0x7d, 0x27, 0x2b, 0xbe, 0x5d, 0xb1 }
|
||||
},
|
||||
{ 16, 128,
|
||||
{ 0x88, 0xbc, 0xa9, 0x0e, 0x90, 0x87, 0x5a, 0x7f,
|
||||
0x0f, 0x79, 0xc3, 0x84, 0x62, 0x7b, 0xaf, 0xb2 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x22, 0x69, 0x55, 0x2a, 0xb0, 0xf8, 0x5c, 0xa6 }
|
||||
}
|
||||
};
|
||||
int x, y, err;
|
||||
symmetric_key skey;
|
||||
unsigned char tmp[2][8];
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) {
|
||||
zeromem(tmp, sizeof(tmp));
|
||||
if (tests[x].bits == (tests[x].keylen * 8)) {
|
||||
if ((err = rc2_setup(tests[x].key, tests[x].keylen, 0, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((err = rc2_setup_ex(tests[x].key, tests[x].keylen, tests[x].bits, 0, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
rc2_ecb_encrypt(tests[x].pt, tmp[0], &skey);
|
||||
rc2_ecb_decrypt(tmp[0], tmp[1], &skey);
|
||||
|
||||
if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC2 CT", x) ||
|
||||
compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC2 PT", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 8; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) rc2_ecb_encrypt(tmp[0], tmp[0], &skey);
|
||||
for (y = 0; y < 1000; y++) rc2_ecb_decrypt(tmp[0], tmp[0], &skey);
|
||||
for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void rc2_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int rc2_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 1) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else if (*keysize > 128) {
|
||||
*keysize = 128;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,322 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file rc5.c
|
||||
LTC_RC5 code by Tom St Denis
|
||||
*/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_RC5
|
||||
|
||||
const struct ltc_cipher_descriptor rc5_desc =
|
||||
{
|
||||
"rc5",
|
||||
2,
|
||||
8, 128, 8, 12,
|
||||
&rc5_setup,
|
||||
&rc5_ecb_encrypt,
|
||||
&rc5_ecb_decrypt,
|
||||
&rc5_test,
|
||||
&rc5_done,
|
||||
&rc5_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const ulong32 stab[50] = {
|
||||
0xb7e15163UL, 0x5618cb1cUL, 0xf45044d5UL, 0x9287be8eUL, 0x30bf3847UL, 0xcef6b200UL, 0x6d2e2bb9UL, 0x0b65a572UL,
|
||||
0xa99d1f2bUL, 0x47d498e4UL, 0xe60c129dUL, 0x84438c56UL, 0x227b060fUL, 0xc0b27fc8UL, 0x5ee9f981UL, 0xfd21733aUL,
|
||||
0x9b58ecf3UL, 0x399066acUL, 0xd7c7e065UL, 0x75ff5a1eUL, 0x1436d3d7UL, 0xb26e4d90UL, 0x50a5c749UL, 0xeedd4102UL,
|
||||
0x8d14babbUL, 0x2b4c3474UL, 0xc983ae2dUL, 0x67bb27e6UL, 0x05f2a19fUL, 0xa42a1b58UL, 0x42619511UL, 0xe0990ecaUL,
|
||||
0x7ed08883UL, 0x1d08023cUL, 0xbb3f7bf5UL, 0x5976f5aeUL, 0xf7ae6f67UL, 0x95e5e920UL, 0x341d62d9UL, 0xd254dc92UL,
|
||||
0x708c564bUL, 0x0ec3d004UL, 0xacfb49bdUL, 0x4b32c376UL, 0xe96a3d2fUL, 0x87a1b6e8UL, 0x25d930a1UL, 0xc410aa5aUL,
|
||||
0x62482413UL, 0x007f9dccUL
|
||||
};
|
||||
|
||||
/**
|
||||
Initialize the LTC_RC5 block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
#else
|
||||
int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 L[64], *S, A, B, i, j, v, s, t, l;
|
||||
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LTC_ARGCHK(key != NULL);
|
||||
|
||||
/* test parameters */
|
||||
if (num_rounds == 0) {
|
||||
num_rounds = rc5_desc.default_rounds;
|
||||
}
|
||||
|
||||
if (num_rounds < 12 || num_rounds > 24) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* key must be between 64 and 1024 bits */
|
||||
if (keylen < 8 || keylen > 128) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
skey->rc5.rounds = num_rounds;
|
||||
S = skey->rc5.K;
|
||||
|
||||
/* copy the key into the L array */
|
||||
for (A = i = j = 0; i < (ulong32)keylen; ) {
|
||||
A = (A << 8) | ((ulong32)(key[i++] & 255));
|
||||
if ((i & 3) == 0) {
|
||||
L[j++] = BSWAP(A);
|
||||
A = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((keylen & 3) != 0) {
|
||||
A <<= (ulong32)((8 * (4 - (keylen&3))));
|
||||
L[j++] = BSWAP(A);
|
||||
}
|
||||
|
||||
/* setup the S array */
|
||||
t = (ulong32)(2 * (num_rounds + 1));
|
||||
XMEMCPY(S, stab, t * sizeof(*S));
|
||||
|
||||
/* mix buffer */
|
||||
s = 3 * MAX(t, j);
|
||||
l = j;
|
||||
for (A = B = i = j = v = 0; v < s; v++) {
|
||||
A = S[i] = ROLc(S[i] + A + B, 3);
|
||||
B = L[j] = ROL(L[j] + A + B, (A+B));
|
||||
if (++i == t) { i = 0; }
|
||||
if (++j == l) { j = 0; }
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
int x;
|
||||
x = _rc5_setup(key, keylen, num_rounds, skey);
|
||||
burn_stack(sizeof(ulong32) * 122 + sizeof(int));
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Encrypts a block of text with LTC_RC5
|
||||
@param pt The input plaintext (8 bytes)
|
||||
@param ct The output ciphertext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#else
|
||||
int rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 A, B, *K;
|
||||
int r;
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
|
||||
LOAD32L(A, &pt[0]);
|
||||
LOAD32L(B, &pt[4]);
|
||||
A += skey->rc5.K[0];
|
||||
B += skey->rc5.K[1];
|
||||
K = skey->rc5.K + 2;
|
||||
|
||||
if ((skey->rc5.rounds & 1) == 0) {
|
||||
for (r = 0; r < skey->rc5.rounds; r += 2) {
|
||||
A = ROL(A ^ B, B) + K[0];
|
||||
B = ROL(B ^ A, A) + K[1];
|
||||
A = ROL(A ^ B, B) + K[2];
|
||||
B = ROL(B ^ A, A) + K[3];
|
||||
K += 4;
|
||||
}
|
||||
} else {
|
||||
for (r = 0; r < skey->rc5.rounds; r++) {
|
||||
A = ROL(A ^ B, B) + K[0];
|
||||
B = ROL(B ^ A, A) + K[1];
|
||||
K += 2;
|
||||
}
|
||||
}
|
||||
STORE32L(A, &ct[0]);
|
||||
STORE32L(B, &ct[4]);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
int err = _rc5_ecb_encrypt(pt, ct, skey);
|
||||
burn_stack(sizeof(ulong32) * 2 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Decrypts a block of text with LTC_RC5
|
||||
@param ct The input ciphertext (8 bytes)
|
||||
@param pt The output plaintext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#else
|
||||
int rc5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 A, B, *K;
|
||||
int r;
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
|
||||
LOAD32L(A, &ct[0]);
|
||||
LOAD32L(B, &ct[4]);
|
||||
K = skey->rc5.K + (skey->rc5.rounds << 1);
|
||||
|
||||
if ((skey->rc5.rounds & 1) == 0) {
|
||||
K -= 2;
|
||||
for (r = skey->rc5.rounds - 1; r >= 0; r -= 2) {
|
||||
B = ROR(B - K[3], A) ^ A;
|
||||
A = ROR(A - K[2], B) ^ B;
|
||||
B = ROR(B - K[1], A) ^ A;
|
||||
A = ROR(A - K[0], B) ^ B;
|
||||
K -= 4;
|
||||
}
|
||||
} else {
|
||||
for (r = skey->rc5.rounds - 1; r >= 0; r--) {
|
||||
B = ROR(B - K[1], A) ^ A;
|
||||
A = ROR(A - K[0], B) ^ B;
|
||||
K -= 2;
|
||||
}
|
||||
}
|
||||
A -= skey->rc5.K[0];
|
||||
B -= skey->rc5.K[1];
|
||||
STORE32L(A, &pt[0]);
|
||||
STORE32L(B, &pt[4]);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
int err = _rc5_ecb_decrypt(ct, pt, skey);
|
||||
burn_stack(sizeof(ulong32) * 2 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Performs a self-test of the LTC_RC5 block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int rc5_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
unsigned char key[16], pt[8], ct[8];
|
||||
} tests[] = {
|
||||
{
|
||||
{ 0x91, 0x5f, 0x46, 0x19, 0xbe, 0x41, 0xb2, 0x51,
|
||||
0x63, 0x55, 0xa5, 0x01, 0x10, 0xa9, 0xce, 0x91 },
|
||||
{ 0x21, 0xa5, 0xdb, 0xee, 0x15, 0x4b, 0x8f, 0x6d },
|
||||
{ 0xf7, 0xc0, 0x13, 0xac, 0x5b, 0x2b, 0x89, 0x52 }
|
||||
},
|
||||
{
|
||||
{ 0x78, 0x33, 0x48, 0xe7, 0x5a, 0xeb, 0x0f, 0x2f,
|
||||
0xd7, 0xb1, 0x69, 0xbb, 0x8d, 0xc1, 0x67, 0x87 },
|
||||
{ 0xF7, 0xC0, 0x13, 0xAC, 0x5B, 0x2B, 0x89, 0x52 },
|
||||
{ 0x2F, 0x42, 0xB3, 0xB7, 0x03, 0x69, 0xFC, 0x92 }
|
||||
},
|
||||
{
|
||||
{ 0xDC, 0x49, 0xdb, 0x13, 0x75, 0xa5, 0x58, 0x4f,
|
||||
0x64, 0x85, 0xb4, 0x13, 0xb5, 0xf1, 0x2b, 0xaf },
|
||||
{ 0x2F, 0x42, 0xB3, 0xB7, 0x03, 0x69, 0xFC, 0x92 },
|
||||
{ 0x65, 0xc1, 0x78, 0xb2, 0x84, 0xd1, 0x97, 0xcc }
|
||||
}
|
||||
};
|
||||
unsigned char tmp[2][8];
|
||||
int x, y, err;
|
||||
symmetric_key key;
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) {
|
||||
/* setup key */
|
||||
if ((err = rc5_setup(tests[x].key, 16, 12, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* encrypt and decrypt */
|
||||
rc5_ecb_encrypt(tests[x].pt, tmp[0], &key);
|
||||
rc5_ecb_decrypt(tmp[0], tmp[1], &key);
|
||||
|
||||
/* compare */
|
||||
if (compare_testvector(tmp[0], 8, tests[x].ct, 8, "RC5 Encrypt", x) != 0 ||
|
||||
compare_testvector(tmp[1], 8, tests[x].pt, 8, "RC5 Decrypt", x) != 0) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 8; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) rc5_ecb_encrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 1000; y++) rc5_ecb_decrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 8; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void rc5_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int rc5_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 8) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else if (*keysize > 128) {
|
||||
*keysize = 128;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,331 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file rc6.c
|
||||
LTC_RC6 code by Tom St Denis
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_RC6
|
||||
|
||||
const struct ltc_cipher_descriptor rc6_desc =
|
||||
{
|
||||
"rc6",
|
||||
3,
|
||||
8, 128, 16, 20,
|
||||
&rc6_setup,
|
||||
&rc6_ecb_encrypt,
|
||||
&rc6_ecb_decrypt,
|
||||
&rc6_test,
|
||||
&rc6_done,
|
||||
&rc6_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const ulong32 stab[44] = {
|
||||
0xb7e15163UL, 0x5618cb1cUL, 0xf45044d5UL, 0x9287be8eUL, 0x30bf3847UL, 0xcef6b200UL, 0x6d2e2bb9UL, 0x0b65a572UL,
|
||||
0xa99d1f2bUL, 0x47d498e4UL, 0xe60c129dUL, 0x84438c56UL, 0x227b060fUL, 0xc0b27fc8UL, 0x5ee9f981UL, 0xfd21733aUL,
|
||||
0x9b58ecf3UL, 0x399066acUL, 0xd7c7e065UL, 0x75ff5a1eUL, 0x1436d3d7UL, 0xb26e4d90UL, 0x50a5c749UL, 0xeedd4102UL,
|
||||
0x8d14babbUL, 0x2b4c3474UL, 0xc983ae2dUL, 0x67bb27e6UL, 0x05f2a19fUL, 0xa42a1b58UL, 0x42619511UL, 0xe0990ecaUL,
|
||||
0x7ed08883UL, 0x1d08023cUL, 0xbb3f7bf5UL, 0x5976f5aeUL, 0xf7ae6f67UL, 0x95e5e920UL, 0x341d62d9UL, 0xd254dc92UL,
|
||||
0x708c564bUL, 0x0ec3d004UL, 0xacfb49bdUL, 0x4b32c376UL };
|
||||
|
||||
/**
|
||||
Initialize the LTC_RC6 block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
#else
|
||||
int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 L[64], S[50], A, B, i, j, v, s, l;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* test parameters */
|
||||
if (num_rounds != 0 && num_rounds != 20) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* key must be between 64 and 1024 bits */
|
||||
if (keylen < 8 || keylen > 128) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
/* copy the key into the L array */
|
||||
for (A = i = j = 0; i < (ulong32)keylen; ) {
|
||||
A = (A << 8) | ((ulong32)(key[i++] & 255));
|
||||
if (!(i & 3)) {
|
||||
L[j++] = BSWAP(A);
|
||||
A = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* handle odd sized keys */
|
||||
if (keylen & 3) {
|
||||
A <<= (8 * (4 - (keylen&3)));
|
||||
L[j++] = BSWAP(A);
|
||||
}
|
||||
|
||||
/* setup the S array */
|
||||
XMEMCPY(S, stab, 44 * sizeof(stab[0]));
|
||||
|
||||
/* mix buffer */
|
||||
s = 3 * MAX(44, j);
|
||||
l = j;
|
||||
for (A = B = i = j = v = 0; v < s; v++) {
|
||||
A = S[i] = ROLc(S[i] + A + B, 3);
|
||||
B = L[j] = ROL(L[j] + A + B, (A+B));
|
||||
if (++i == 44) { i = 0; }
|
||||
if (++j == l) { j = 0; }
|
||||
}
|
||||
|
||||
/* copy to key */
|
||||
for (i = 0; i < 44; i++) {
|
||||
skey->rc6.K[i] = S[i];
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
int x;
|
||||
x = _rc6_setup(key, keylen, num_rounds, skey);
|
||||
burn_stack(sizeof(ulong32) * 122);
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Encrypts a block of text with LTC_RC6
|
||||
@param pt The input plaintext (16 bytes)
|
||||
@param ct The output ciphertext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#else
|
||||
int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 a,b,c,d,t,u, *K;
|
||||
int r;
|
||||
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LOAD32L(a,&pt[0]);LOAD32L(b,&pt[4]);LOAD32L(c,&pt[8]);LOAD32L(d,&pt[12]);
|
||||
|
||||
b += skey->rc6.K[0];
|
||||
d += skey->rc6.K[1];
|
||||
|
||||
#define RND(a,b,c,d) \
|
||||
t = (b * (b + b + 1)); t = ROLc(t, 5); \
|
||||
u = (d * (d + d + 1)); u = ROLc(u, 5); \
|
||||
a = ROL(a^t,u) + K[0]; \
|
||||
c = ROL(c^u,t) + K[1]; K += 2;
|
||||
|
||||
K = skey->rc6.K + 2;
|
||||
for (r = 0; r < 20; r += 4) {
|
||||
RND(a,b,c,d);
|
||||
RND(b,c,d,a);
|
||||
RND(c,d,a,b);
|
||||
RND(d,a,b,c);
|
||||
}
|
||||
|
||||
#undef RND
|
||||
|
||||
a += skey->rc6.K[42];
|
||||
c += skey->rc6.K[43];
|
||||
STORE32L(a,&ct[0]);STORE32L(b,&ct[4]);STORE32L(c,&ct[8]);STORE32L(d,&ct[12]);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
int err = _rc6_ecb_encrypt(pt, ct, skey);
|
||||
burn_stack(sizeof(ulong32) * 6 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Decrypts a block of text with LTC_RC6
|
||||
@param ct The input ciphertext (16 bytes)
|
||||
@param pt The output plaintext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#else
|
||||
int rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
ulong32 a,b,c,d,t,u, *K;
|
||||
int r;
|
||||
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
|
||||
LOAD32L(a,&ct[0]);LOAD32L(b,&ct[4]);LOAD32L(c,&ct[8]);LOAD32L(d,&ct[12]);
|
||||
a -= skey->rc6.K[42];
|
||||
c -= skey->rc6.K[43];
|
||||
|
||||
#define RND(a,b,c,d) \
|
||||
t = (b * (b + b + 1)); t = ROLc(t, 5); \
|
||||
u = (d * (d + d + 1)); u = ROLc(u, 5); \
|
||||
c = ROR(c - K[1], t) ^ u; \
|
||||
a = ROR(a - K[0], u) ^ t; K -= 2;
|
||||
|
||||
K = skey->rc6.K + 40;
|
||||
|
||||
for (r = 0; r < 20; r += 4) {
|
||||
RND(d,a,b,c);
|
||||
RND(c,d,a,b);
|
||||
RND(b,c,d,a);
|
||||
RND(a,b,c,d);
|
||||
}
|
||||
|
||||
#undef RND
|
||||
|
||||
b -= skey->rc6.K[0];
|
||||
d -= skey->rc6.K[1];
|
||||
STORE32L(a,&pt[0]);STORE32L(b,&pt[4]);STORE32L(c,&pt[8]);STORE32L(d,&pt[12]);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
int err = _rc6_ecb_decrypt(ct, pt, skey);
|
||||
burn_stack(sizeof(ulong32) * 6 + sizeof(int));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Performs a self-test of the LTC_RC6 block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int rc6_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
int keylen;
|
||||
unsigned char key[32], pt[16], ct[16];
|
||||
} tests[] = {
|
||||
{
|
||||
16,
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x02, 0x13, 0x24, 0x35, 0x46, 0x57, 0x68, 0x79,
|
||||
0x8a, 0x9b, 0xac, 0xbd, 0xce, 0xdf, 0xe0, 0xf1 },
|
||||
{ 0x52, 0x4e, 0x19, 0x2f, 0x47, 0x15, 0xc6, 0x23,
|
||||
0x1f, 0x51, 0xf6, 0x36, 0x7e, 0xa4, 0x3f, 0x18 }
|
||||
},
|
||||
{
|
||||
24,
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
|
||||
0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x02, 0x13, 0x24, 0x35, 0x46, 0x57, 0x68, 0x79,
|
||||
0x8a, 0x9b, 0xac, 0xbd, 0xce, 0xdf, 0xe0, 0xf1 },
|
||||
{ 0x68, 0x83, 0x29, 0xd0, 0x19, 0xe5, 0x05, 0x04,
|
||||
0x1e, 0x52, 0xe9, 0x2a, 0xf9, 0x52, 0x91, 0xd4 }
|
||||
},
|
||||
{
|
||||
32,
|
||||
{ 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||
0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
|
||||
0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0,
|
||||
0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe },
|
||||
{ 0x02, 0x13, 0x24, 0x35, 0x46, 0x57, 0x68, 0x79,
|
||||
0x8a, 0x9b, 0xac, 0xbd, 0xce, 0xdf, 0xe0, 0xf1 },
|
||||
{ 0xc8, 0x24, 0x18, 0x16, 0xf0, 0xd7, 0xe4, 0x89,
|
||||
0x20, 0xad, 0x16, 0xa1, 0x67, 0x4e, 0x5d, 0x48 }
|
||||
}
|
||||
};
|
||||
unsigned char tmp[2][16];
|
||||
int x, y, err;
|
||||
symmetric_key key;
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) {
|
||||
/* setup key */
|
||||
if ((err = rc6_setup(tests[x].key, tests[x].keylen, 0, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* encrypt and decrypt */
|
||||
rc6_ecb_encrypt(tests[x].pt, tmp[0], &key);
|
||||
rc6_ecb_decrypt(tmp[0], tmp[1], &key);
|
||||
|
||||
/* compare */
|
||||
if (compare_testvector(tmp[0], 16, tests[x].ct, 16, "RC6 Encrypt", x) ||
|
||||
compare_testvector(tmp[1], 16, tests[x].pt, 16, "RC6 Decrypt", x)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 16; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) rc6_ecb_encrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 1000; y++) rc6_ecb_decrypt(tmp[0], tmp[0], &key);
|
||||
for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void rc6_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int rc6_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 8) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else if (*keysize > 128) {
|
||||
*keysize = 128;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif /*LTC_RC6*/
|
||||
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,495 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FILE: safer.c
|
||||
*
|
||||
* LTC_DESCRIPTION: block-cipher algorithm LTC_SAFER (Secure And Fast Encryption
|
||||
* Routine) in its four versions: LTC_SAFER K-64, LTC_SAFER K-128,
|
||||
* LTC_SAFER SK-64 and LTC_SAFER SK-128.
|
||||
*
|
||||
* AUTHOR: Richard De Moliner (demoliner@isi.ee.ethz.ch)
|
||||
* Signal and Information Processing Laboratory
|
||||
* Swiss Federal Institute of Technology
|
||||
* CH-8092 Zuerich, Switzerland
|
||||
*
|
||||
* DATE: September 9, 1995
|
||||
*
|
||||
* CHANGE HISTORY:
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_SAFER
|
||||
|
||||
#define __LTC_SAFER_TAB_C__
|
||||
#include "safer_tab.c"
|
||||
|
||||
const struct ltc_cipher_descriptor safer_k64_desc = {
|
||||
"safer-k64",
|
||||
8, 8, 8, 8, LTC_SAFER_K64_DEFAULT_NOF_ROUNDS,
|
||||
&safer_k64_setup,
|
||||
&safer_ecb_encrypt,
|
||||
&safer_ecb_decrypt,
|
||||
&safer_k64_test,
|
||||
&safer_done,
|
||||
&safer_64_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
},
|
||||
|
||||
safer_sk64_desc = {
|
||||
"safer-sk64",
|
||||
9, 8, 8, 8, LTC_SAFER_SK64_DEFAULT_NOF_ROUNDS,
|
||||
&safer_sk64_setup,
|
||||
&safer_ecb_encrypt,
|
||||
&safer_ecb_decrypt,
|
||||
&safer_sk64_test,
|
||||
&safer_done,
|
||||
&safer_64_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
},
|
||||
|
||||
safer_k128_desc = {
|
||||
"safer-k128",
|
||||
10, 16, 16, 8, LTC_SAFER_K128_DEFAULT_NOF_ROUNDS,
|
||||
&safer_k128_setup,
|
||||
&safer_ecb_encrypt,
|
||||
&safer_ecb_decrypt,
|
||||
&safer_sk128_test,
|
||||
&safer_done,
|
||||
&safer_128_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
},
|
||||
|
||||
safer_sk128_desc = {
|
||||
"safer-sk128",
|
||||
11, 16, 16, 8, LTC_SAFER_SK128_DEFAULT_NOF_ROUNDS,
|
||||
&safer_sk128_setup,
|
||||
&safer_ecb_encrypt,
|
||||
&safer_ecb_decrypt,
|
||||
&safer_sk128_test,
|
||||
&safer_done,
|
||||
&safer_128_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
/******************* Constants ************************************************/
|
||||
/* #define TAB_LEN 256 */
|
||||
|
||||
/******************* Assertions ***********************************************/
|
||||
|
||||
/******************* Macros ***************************************************/
|
||||
#define ROL8(x, n) ((unsigned char)((unsigned int)(x) << (n)\
|
||||
|(unsigned int)((x) & 0xFF) >> (8 - (n))))
|
||||
#define EXP(x) safer_ebox[(x) & 0xFF]
|
||||
#define LOG(x) safer_lbox[(x) & 0xFF]
|
||||
#define PHT(x, y) { y += x; x += y; }
|
||||
#define IPHT(x, y) { x -= y; y -= x; }
|
||||
|
||||
/******************* Types ****************************************************/
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static void _Safer_Expand_Userkey(const unsigned char *userkey_1,
|
||||
const unsigned char *userkey_2,
|
||||
unsigned int nof_rounds,
|
||||
int strengthened,
|
||||
safer_key_t key)
|
||||
#else
|
||||
static void Safer_Expand_Userkey(const unsigned char *userkey_1,
|
||||
const unsigned char *userkey_2,
|
||||
unsigned int nof_rounds,
|
||||
int strengthened,
|
||||
safer_key_t key)
|
||||
#endif
|
||||
{ unsigned int i, j, k;
|
||||
unsigned char ka[LTC_SAFER_BLOCK_LEN + 1];
|
||||
unsigned char kb[LTC_SAFER_BLOCK_LEN + 1];
|
||||
|
||||
if (LTC_SAFER_MAX_NOF_ROUNDS < nof_rounds)
|
||||
nof_rounds = LTC_SAFER_MAX_NOF_ROUNDS;
|
||||
*key++ = (unsigned char)nof_rounds;
|
||||
ka[LTC_SAFER_BLOCK_LEN] = (unsigned char)0;
|
||||
kb[LTC_SAFER_BLOCK_LEN] = (unsigned char)0;
|
||||
k = 0;
|
||||
for (j = 0; j < LTC_SAFER_BLOCK_LEN; j++) {
|
||||
ka[j] = ROL8(userkey_1[j], 5);
|
||||
ka[LTC_SAFER_BLOCK_LEN] ^= ka[j];
|
||||
kb[j] = *key++ = userkey_2[j];
|
||||
kb[LTC_SAFER_BLOCK_LEN] ^= kb[j];
|
||||
}
|
||||
for (i = 1; i <= nof_rounds; i++) {
|
||||
for (j = 0; j < LTC_SAFER_BLOCK_LEN + 1; j++) {
|
||||
ka[j] = ROL8(ka[j], 6);
|
||||
kb[j] = ROL8(kb[j], 6);
|
||||
}
|
||||
if (strengthened) {
|
||||
k = 2 * i - 1;
|
||||
while (k >= (LTC_SAFER_BLOCK_LEN + 1)) { k -= LTC_SAFER_BLOCK_LEN + 1; }
|
||||
}
|
||||
for (j = 0; j < LTC_SAFER_BLOCK_LEN; j++) {
|
||||
if (strengthened) {
|
||||
*key++ = (ka[k]
|
||||
+ safer_ebox[(int)safer_ebox[(int)((18 * i + j + 1)&0xFF)]]) & 0xFF;
|
||||
if (++k == (LTC_SAFER_BLOCK_LEN + 1)) { k = 0; }
|
||||
} else {
|
||||
*key++ = (ka[j] + safer_ebox[(int)safer_ebox[(int)((18 * i + j + 1)&0xFF)]]) & 0xFF;
|
||||
}
|
||||
}
|
||||
if (strengthened) {
|
||||
k = 2 * i;
|
||||
while (k >= (LTC_SAFER_BLOCK_LEN + 1)) { k -= LTC_SAFER_BLOCK_LEN + 1; }
|
||||
}
|
||||
for (j = 0; j < LTC_SAFER_BLOCK_LEN; j++) {
|
||||
if (strengthened) {
|
||||
*key++ = (kb[k]
|
||||
+ safer_ebox[(int)safer_ebox[(int)((18 * i + j + 10)&0xFF)]]) & 0xFF;
|
||||
if (++k == (LTC_SAFER_BLOCK_LEN + 1)) { k = 0; }
|
||||
} else {
|
||||
*key++ = (kb[j] + safer_ebox[(int)safer_ebox[(int)((18 * i + j + 10)&0xFF)]]) & 0xFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(ka, sizeof(ka));
|
||||
zeromem(kb, sizeof(kb));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static void Safer_Expand_Userkey(const unsigned char *userkey_1,
|
||||
const unsigned char *userkey_2,
|
||||
unsigned int nof_rounds,
|
||||
int strengthened,
|
||||
safer_key_t key)
|
||||
{
|
||||
_Safer_Expand_Userkey(userkey_1, userkey_2, nof_rounds, strengthened, key);
|
||||
burn_stack(sizeof(unsigned char) * (2 * (LTC_SAFER_BLOCK_LEN + 1)) + sizeof(unsigned int)*2);
|
||||
}
|
||||
#endif
|
||||
|
||||
int safer_k64_setup(const unsigned char *key, int keylen, int numrounds, symmetric_key *skey)
|
||||
{
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (numrounds != 0 && (numrounds < 6 || numrounds > LTC_SAFER_MAX_NOF_ROUNDS)) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
if (keylen != 8) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
Safer_Expand_Userkey(key, key, (unsigned int)(numrounds != 0 ?numrounds:LTC_SAFER_K64_DEFAULT_NOF_ROUNDS), 0, skey->safer.key);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int safer_sk64_setup(const unsigned char *key, int keylen, int numrounds, symmetric_key *skey)
|
||||
{
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (numrounds != 0 && (numrounds < 6 || numrounds > LTC_SAFER_MAX_NOF_ROUNDS)) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
if (keylen != 8) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
Safer_Expand_Userkey(key, key, (unsigned int)(numrounds != 0 ?numrounds:LTC_SAFER_SK64_DEFAULT_NOF_ROUNDS), 1, skey->safer.key);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int safer_k128_setup(const unsigned char *key, int keylen, int numrounds, symmetric_key *skey)
|
||||
{
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (numrounds != 0 && (numrounds < 6 || numrounds > LTC_SAFER_MAX_NOF_ROUNDS)) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
if (keylen != 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
Safer_Expand_Userkey(key, key+8, (unsigned int)(numrounds != 0 ?numrounds:LTC_SAFER_K128_DEFAULT_NOF_ROUNDS), 0, skey->safer.key);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
int safer_sk128_setup(const unsigned char *key, int keylen, int numrounds, symmetric_key *skey)
|
||||
{
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (numrounds != 0 && (numrounds < 6 || numrounds > LTC_SAFER_MAX_NOF_ROUNDS)) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
if (keylen != 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
Safer_Expand_Userkey(key, key+8, (unsigned int)(numrounds != 0?numrounds:LTC_SAFER_SK128_DEFAULT_NOF_ROUNDS), 1, skey->safer.key);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _safer_ecb_encrypt(const unsigned char *block_in,
|
||||
unsigned char *block_out,
|
||||
symmetric_key *skey)
|
||||
#else
|
||||
int safer_ecb_encrypt(const unsigned char *block_in,
|
||||
unsigned char *block_out,
|
||||
symmetric_key *skey)
|
||||
#endif
|
||||
{ unsigned char a, b, c, d, e, f, g, h, t;
|
||||
unsigned int round;
|
||||
unsigned char *key;
|
||||
|
||||
LTC_ARGCHK(block_in != NULL);
|
||||
LTC_ARGCHK(block_out != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
key = skey->safer.key;
|
||||
a = block_in[0]; b = block_in[1]; c = block_in[2]; d = block_in[3];
|
||||
e = block_in[4]; f = block_in[5]; g = block_in[6]; h = block_in[7];
|
||||
if (LTC_SAFER_MAX_NOF_ROUNDS < (round = *key)) round = LTC_SAFER_MAX_NOF_ROUNDS;
|
||||
while(round-- > 0)
|
||||
{
|
||||
a ^= *++key; b += *++key; c += *++key; d ^= *++key;
|
||||
e ^= *++key; f += *++key; g += *++key; h ^= *++key;
|
||||
a = EXP(a) + *++key; b = LOG(b) ^ *++key;
|
||||
c = LOG(c) ^ *++key; d = EXP(d) + *++key;
|
||||
e = EXP(e) + *++key; f = LOG(f) ^ *++key;
|
||||
g = LOG(g) ^ *++key; h = EXP(h) + *++key;
|
||||
PHT(a, b); PHT(c, d); PHT(e, f); PHT(g, h);
|
||||
PHT(a, c); PHT(e, g); PHT(b, d); PHT(f, h);
|
||||
PHT(a, e); PHT(b, f); PHT(c, g); PHT(d, h);
|
||||
t = b; b = e; e = c; c = t; t = d; d = f; f = g; g = t;
|
||||
}
|
||||
a ^= *++key; b += *++key; c += *++key; d ^= *++key;
|
||||
e ^= *++key; f += *++key; g += *++key; h ^= *++key;
|
||||
block_out[0] = a & 0xFF; block_out[1] = b & 0xFF;
|
||||
block_out[2] = c & 0xFF; block_out[3] = d & 0xFF;
|
||||
block_out[4] = e & 0xFF; block_out[5] = f & 0xFF;
|
||||
block_out[6] = g & 0xFF; block_out[7] = h & 0xFF;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int safer_ecb_encrypt(const unsigned char *block_in,
|
||||
unsigned char *block_out,
|
||||
symmetric_key *skey)
|
||||
{
|
||||
int err = _safer_ecb_encrypt(block_in, block_out, skey);
|
||||
burn_stack(sizeof(unsigned char) * 9 + sizeof(unsigned int) + sizeof(unsigned char *));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _safer_ecb_decrypt(const unsigned char *block_in,
|
||||
unsigned char *block_out,
|
||||
symmetric_key *skey)
|
||||
#else
|
||||
int safer_ecb_decrypt(const unsigned char *block_in,
|
||||
unsigned char *block_out,
|
||||
symmetric_key *skey)
|
||||
#endif
|
||||
{ unsigned char a, b, c, d, e, f, g, h, t;
|
||||
unsigned int round;
|
||||
unsigned char *key;
|
||||
|
||||
LTC_ARGCHK(block_in != NULL);
|
||||
LTC_ARGCHK(block_out != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
key = skey->safer.key;
|
||||
a = block_in[0]; b = block_in[1]; c = block_in[2]; d = block_in[3];
|
||||
e = block_in[4]; f = block_in[5]; g = block_in[6]; h = block_in[7];
|
||||
if (LTC_SAFER_MAX_NOF_ROUNDS < (round = *key)) round = LTC_SAFER_MAX_NOF_ROUNDS;
|
||||
key += LTC_SAFER_BLOCK_LEN * (1 + 2 * round);
|
||||
h ^= *key; g -= *--key; f -= *--key; e ^= *--key;
|
||||
d ^= *--key; c -= *--key; b -= *--key; a ^= *--key;
|
||||
while (round--)
|
||||
{
|
||||
t = e; e = b; b = c; c = t; t = f; f = d; d = g; g = t;
|
||||
IPHT(a, e); IPHT(b, f); IPHT(c, g); IPHT(d, h);
|
||||
IPHT(a, c); IPHT(e, g); IPHT(b, d); IPHT(f, h);
|
||||
IPHT(a, b); IPHT(c, d); IPHT(e, f); IPHT(g, h);
|
||||
h -= *--key; g ^= *--key; f ^= *--key; e -= *--key;
|
||||
d -= *--key; c ^= *--key; b ^= *--key; a -= *--key;
|
||||
h = LOG(h) ^ *--key; g = EXP(g) - *--key;
|
||||
f = EXP(f) - *--key; e = LOG(e) ^ *--key;
|
||||
d = LOG(d) ^ *--key; c = EXP(c) - *--key;
|
||||
b = EXP(b) - *--key; a = LOG(a) ^ *--key;
|
||||
}
|
||||
block_out[0] = a & 0xFF; block_out[1] = b & 0xFF;
|
||||
block_out[2] = c & 0xFF; block_out[3] = d & 0xFF;
|
||||
block_out[4] = e & 0xFF; block_out[5] = f & 0xFF;
|
||||
block_out[6] = g & 0xFF; block_out[7] = h & 0xFF;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int safer_ecb_decrypt(const unsigned char *block_in,
|
||||
unsigned char *block_out,
|
||||
symmetric_key *skey)
|
||||
{
|
||||
int err = _safer_ecb_decrypt(block_in, block_out, skey);
|
||||
burn_stack(sizeof(unsigned char) * 9 + sizeof(unsigned int) + sizeof(unsigned char *));
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
int safer_64_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 8) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else {
|
||||
*keysize = 8;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
}
|
||||
|
||||
int safer_128_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 16) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else {
|
||||
*keysize = 16;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
}
|
||||
|
||||
int safer_k64_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const unsigned char k64_pt[] = { 1, 2, 3, 4, 5, 6, 7, 8 },
|
||||
k64_key[] = { 8, 7, 6, 5, 4, 3, 2, 1 },
|
||||
k64_ct[] = { 200, 242, 156, 221, 135, 120, 62, 217 };
|
||||
|
||||
symmetric_key skey;
|
||||
unsigned char buf[2][8];
|
||||
int err;
|
||||
|
||||
/* test K64 */
|
||||
if ((err = safer_k64_setup(k64_key, 8, 6, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
safer_ecb_encrypt(k64_pt, buf[0], &skey);
|
||||
safer_ecb_decrypt(buf[0], buf[1], &skey);
|
||||
|
||||
if (compare_testvector(buf[0], 8, k64_ct, 8, "Safer K64 Encrypt", 0) != 0 ||
|
||||
compare_testvector(buf[1], 8, k64_pt, 8, "Safer K64 Decrypt", 0) != 0) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int safer_sk64_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const unsigned char sk64_pt[] = { 1, 2, 3, 4, 5, 6, 7, 8 },
|
||||
sk64_key[] = { 1, 2, 3, 4, 5, 6, 7, 8 },
|
||||
sk64_ct[] = { 95, 206, 155, 162, 5, 132, 56, 199 };
|
||||
|
||||
symmetric_key skey;
|
||||
unsigned char buf[2][8];
|
||||
int err, y;
|
||||
|
||||
/* test SK64 */
|
||||
if ((err = safer_sk64_setup(sk64_key, 8, 6, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
safer_ecb_encrypt(sk64_pt, buf[0], &skey);
|
||||
safer_ecb_decrypt(buf[0], buf[1], &skey);
|
||||
|
||||
if (compare_testvector(buf[0], 8, sk64_ct, 8, "Safer SK64 Encrypt", 0) != 0 ||
|
||||
compare_testvector(buf[1], 8, sk64_pt, 8, "Safer SK64 Decrypt", 0) != 0) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 8; y++) buf[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) safer_ecb_encrypt(buf[0], buf[0], &skey);
|
||||
for (y = 0; y < 1000; y++) safer_ecb_decrypt(buf[0], buf[0], &skey);
|
||||
for (y = 0; y < 8; y++) if (buf[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void safer_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
int safer_sk128_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const unsigned char sk128_pt[] = { 1, 2, 3, 4, 5, 6, 7, 8 },
|
||||
sk128_key[] = { 1, 2, 3, 4, 5, 6, 7, 8,
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
sk128_ct[] = { 255, 120, 17, 228, 179, 167, 46, 113 };
|
||||
|
||||
symmetric_key skey;
|
||||
unsigned char buf[2][8];
|
||||
int err, y;
|
||||
|
||||
/* test SK128 */
|
||||
if ((err = safer_sk128_setup(sk128_key, 16, 0, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
safer_ecb_encrypt(sk128_pt, buf[0], &skey);
|
||||
safer_ecb_decrypt(buf[0], buf[1], &skey);
|
||||
|
||||
if (compare_testvector(buf[0], 8, sk128_ct, 8, "Safer SK128 Encrypt", 0) != 0 ||
|
||||
compare_testvector(buf[1], 8, sk128_pt, 8, "Safer SK128 Decrypt", 0) != 0) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 8; y++) buf[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) safer_ecb_encrypt(buf[0], buf[0], &skey);
|
||||
for (y = 0; y < 1000; y++) safer_ecb_decrypt(buf[0], buf[0], &skey);
|
||||
for (y = 0; y < 8; y++) if (buf[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,64 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file safer_tab.c
|
||||
Tables for LTC_SAFER block ciphers
|
||||
*/
|
||||
|
||||
#ifdef __LTC_SAFER_TAB_C__
|
||||
|
||||
/* This is the box defined by ebox[x] = 45^x mod 257.
|
||||
* Its assumed that the value "256" corresponds to zero. */
|
||||
static const unsigned char safer_ebox[256] = {
|
||||
1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207, 63,
|
||||
8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247,
|
||||
64, 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177,
|
||||
255, 167, 62, 220, 134, 119, 215, 166, 17, 251, 244, 186, 146, 145, 100, 131,
|
||||
241, 51, 239, 218, 44, 181, 178, 43, 136, 209, 153, 203, 140, 132, 29, 20,
|
||||
129, 151, 113, 202, 95, 163, 139, 87, 60, 130, 196, 82, 92, 28, 232, 160,
|
||||
4, 180, 133, 74, 246, 19, 84, 182, 223, 12, 26, 142, 222, 224, 57, 252,
|
||||
32, 155, 36, 78, 169, 152, 158, 171, 242, 96, 208, 108, 234, 250, 199, 217,
|
||||
0, 212, 31, 110, 67, 188, 236, 83, 137, 254, 122, 93, 73, 201, 50, 194,
|
||||
249, 154, 248, 109, 22, 219, 89, 150, 68, 233, 205, 230, 70, 66, 143, 10,
|
||||
193, 204, 185, 101, 176, 210, 198, 172, 30, 65, 98, 41, 46, 14, 116, 80,
|
||||
2, 90, 195, 37, 123, 138, 42, 91, 240, 6, 13, 71, 111, 112, 157, 126,
|
||||
16, 206, 18, 39, 213, 76, 79, 214, 121, 48, 104, 54, 117, 125, 228, 237,
|
||||
128, 106, 144, 55, 162, 94, 118, 170, 197, 127, 61, 175, 165, 229, 25, 97,
|
||||
253, 77, 124, 183, 11, 238, 173, 75, 34, 245, 231, 115, 35, 33, 200, 5,
|
||||
225, 102, 221, 179, 88, 105, 99, 86, 15, 161, 49, 149, 23, 7, 58, 40
|
||||
};
|
||||
|
||||
/* This is the inverse of ebox or the base 45 logarithm */
|
||||
static const unsigned char safer_lbox[256] = {
|
||||
128, 0, 176, 9, 96, 239, 185, 253, 16, 18, 159, 228, 105, 186, 173, 248,
|
||||
192, 56, 194, 101, 79, 6, 148, 252, 25, 222, 106, 27, 93, 78, 168, 130,
|
||||
112, 237, 232, 236, 114, 179, 21, 195, 255, 171, 182, 71, 68, 1, 172, 37,
|
||||
201, 250, 142, 65, 26, 33, 203, 211, 13, 110, 254, 38, 88, 218, 50, 15,
|
||||
32, 169, 157, 132, 152, 5, 156, 187, 34, 140, 99, 231, 197, 225, 115, 198,
|
||||
175, 36, 91, 135, 102, 39, 247, 87, 244, 150, 177, 183, 92, 139, 213, 84,
|
||||
121, 223, 170, 246, 62, 163, 241, 17, 202, 245, 209, 23, 123, 147, 131, 188,
|
||||
189, 82, 30, 235, 174, 204, 214, 53, 8, 200, 138, 180, 226, 205, 191, 217,
|
||||
208, 80, 89, 63, 77, 98, 52, 10, 72, 136, 181, 86, 76, 46, 107, 158,
|
||||
210, 61, 60, 3, 19, 251, 151, 81, 117, 74, 145, 113, 35, 190, 118, 42,
|
||||
95, 249, 212, 85, 11, 220, 55, 49, 22, 116, 215, 119, 167, 230, 7, 219,
|
||||
164, 47, 70, 243, 97, 69, 103, 227, 12, 162, 59, 28, 133, 24, 4, 29,
|
||||
41, 160, 143, 178, 90, 216, 166, 126, 238, 141, 83, 75, 161, 154, 193, 14,
|
||||
122, 73, 165, 44, 129, 196, 199, 54, 43, 127, 67, 149, 51, 242, 108, 104,
|
||||
109, 240, 2, 40, 206, 221, 155, 234, 94, 153, 124, 20, 134, 207, 229, 66,
|
||||
184, 64, 120, 45, 58, 233, 100, 31, 146, 144, 125, 57, 111, 224, 137, 48
|
||||
};
|
||||
|
||||
#endif /* __LTC_SAFER_TAB_C__ */
|
||||
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,568 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file saferp.c
|
||||
LTC_SAFER+ Implementation by Tom St Denis
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_SAFERP
|
||||
|
||||
#define __LTC_SAFER_TAB_C__
|
||||
#include "safer_tab.c"
|
||||
|
||||
const struct ltc_cipher_descriptor saferp_desc =
|
||||
{
|
||||
"safer+",
|
||||
4,
|
||||
16, 32, 16, 8,
|
||||
&saferp_setup,
|
||||
&saferp_ecb_encrypt,
|
||||
&saferp_ecb_decrypt,
|
||||
&saferp_test,
|
||||
&saferp_done,
|
||||
&saferp_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
/* ROUND(b,i)
|
||||
*
|
||||
* This is one forward key application. Note the basic form is
|
||||
* key addition, substitution, key addition. The safer_ebox and safer_lbox
|
||||
* are the exponentiation box and logarithm boxes respectively.
|
||||
* The value of 'i' is the current round number which allows this
|
||||
* function to be unrolled massively. Most of LTC_SAFER+'s speed
|
||||
* comes from not having to compute indirect accesses into the
|
||||
* array of 16 bytes b[0..15] which is the block of data
|
||||
*/
|
||||
|
||||
#define ROUND(b, i) do { \
|
||||
b[0] = (safer_ebox[(b[0] ^ skey->saferp.K[i][0]) & 255] + skey->saferp.K[i+1][0]) & 255; \
|
||||
b[1] = safer_lbox[(b[1] + skey->saferp.K[i][1]) & 255] ^ skey->saferp.K[i+1][1]; \
|
||||
b[2] = safer_lbox[(b[2] + skey->saferp.K[i][2]) & 255] ^ skey->saferp.K[i+1][2]; \
|
||||
b[3] = (safer_ebox[(b[3] ^ skey->saferp.K[i][3]) & 255] + skey->saferp.K[i+1][3]) & 255; \
|
||||
b[4] = (safer_ebox[(b[4] ^ skey->saferp.K[i][4]) & 255] + skey->saferp.K[i+1][4]) & 255; \
|
||||
b[5] = safer_lbox[(b[5] + skey->saferp.K[i][5]) & 255] ^ skey->saferp.K[i+1][5]; \
|
||||
b[6] = safer_lbox[(b[6] + skey->saferp.K[i][6]) & 255] ^ skey->saferp.K[i+1][6]; \
|
||||
b[7] = (safer_ebox[(b[7] ^ skey->saferp.K[i][7]) & 255] + skey->saferp.K[i+1][7]) & 255; \
|
||||
b[8] = (safer_ebox[(b[8] ^ skey->saferp.K[i][8]) & 255] + skey->saferp.K[i+1][8]) & 255; \
|
||||
b[9] = safer_lbox[(b[9] + skey->saferp.K[i][9]) & 255] ^ skey->saferp.K[i+1][9]; \
|
||||
b[10] = safer_lbox[(b[10] + skey->saferp.K[i][10]) & 255] ^ skey->saferp.K[i+1][10]; \
|
||||
b[11] = (safer_ebox[(b[11] ^ skey->saferp.K[i][11]) & 255] + skey->saferp.K[i+1][11]) & 255; \
|
||||
b[12] = (safer_ebox[(b[12] ^ skey->saferp.K[i][12]) & 255] + skey->saferp.K[i+1][12]) & 255; \
|
||||
b[13] = safer_lbox[(b[13] + skey->saferp.K[i][13]) & 255] ^ skey->saferp.K[i+1][13]; \
|
||||
b[14] = safer_lbox[(b[14] + skey->saferp.K[i][14]) & 255] ^ skey->saferp.K[i+1][14]; \
|
||||
b[15] = (safer_ebox[(b[15] ^ skey->saferp.K[i][15]) & 255] + skey->saferp.K[i+1][15]) & 255; \
|
||||
} while (0)
|
||||
|
||||
/* This is one inverse key application */
|
||||
#define iROUND(b, i) do { \
|
||||
b[0] = safer_lbox[(b[0] - skey->saferp.K[i+1][0]) & 255] ^ skey->saferp.K[i][0]; \
|
||||
b[1] = (safer_ebox[(b[1] ^ skey->saferp.K[i+1][1]) & 255] - skey->saferp.K[i][1]) & 255; \
|
||||
b[2] = (safer_ebox[(b[2] ^ skey->saferp.K[i+1][2]) & 255] - skey->saferp.K[i][2]) & 255; \
|
||||
b[3] = safer_lbox[(b[3] - skey->saferp.K[i+1][3]) & 255] ^ skey->saferp.K[i][3]; \
|
||||
b[4] = safer_lbox[(b[4] - skey->saferp.K[i+1][4]) & 255] ^ skey->saferp.K[i][4]; \
|
||||
b[5] = (safer_ebox[(b[5] ^ skey->saferp.K[i+1][5]) & 255] - skey->saferp.K[i][5]) & 255; \
|
||||
b[6] = (safer_ebox[(b[6] ^ skey->saferp.K[i+1][6]) & 255] - skey->saferp.K[i][6]) & 255; \
|
||||
b[7] = safer_lbox[(b[7] - skey->saferp.K[i+1][7]) & 255] ^ skey->saferp.K[i][7]; \
|
||||
b[8] = safer_lbox[(b[8] - skey->saferp.K[i+1][8]) & 255] ^ skey->saferp.K[i][8]; \
|
||||
b[9] = (safer_ebox[(b[9] ^ skey->saferp.K[i+1][9]) & 255] - skey->saferp.K[i][9]) & 255; \
|
||||
b[10] = (safer_ebox[(b[10] ^ skey->saferp.K[i+1][10]) & 255] - skey->saferp.K[i][10]) & 255; \
|
||||
b[11] = safer_lbox[(b[11] - skey->saferp.K[i+1][11]) & 255] ^ skey->saferp.K[i][11]; \
|
||||
b[12] = safer_lbox[(b[12] - skey->saferp.K[i+1][12]) & 255] ^ skey->saferp.K[i][12]; \
|
||||
b[13] = (safer_ebox[(b[13] ^ skey->saferp.K[i+1][13]) & 255] - skey->saferp.K[i][13]) & 255; \
|
||||
b[14] = (safer_ebox[(b[14] ^ skey->saferp.K[i+1][14]) & 255] - skey->saferp.K[i][14]) & 255; \
|
||||
b[15] = safer_lbox[(b[15] - skey->saferp.K[i+1][15]) & 255] ^ skey->saferp.K[i][15]; \
|
||||
} while (0)
|
||||
|
||||
/* This is a forward single layer PHT transform. */
|
||||
#define PHT(b) do { \
|
||||
b[0] = (b[0] + (b[1] = (b[0] + b[1]) & 255)) & 255; \
|
||||
b[2] = (b[2] + (b[3] = (b[3] + b[2]) & 255)) & 255; \
|
||||
b[4] = (b[4] + (b[5] = (b[5] + b[4]) & 255)) & 255; \
|
||||
b[6] = (b[6] + (b[7] = (b[7] + b[6]) & 255)) & 255; \
|
||||
b[8] = (b[8] + (b[9] = (b[9] + b[8]) & 255)) & 255; \
|
||||
b[10] = (b[10] + (b[11] = (b[11] + b[10]) & 255)) & 255; \
|
||||
b[12] = (b[12] + (b[13] = (b[13] + b[12]) & 255)) & 255; \
|
||||
b[14] = (b[14] + (b[15] = (b[15] + b[14]) & 255)) & 255; \
|
||||
} while (0)
|
||||
|
||||
/* This is an inverse single layer PHT transform */
|
||||
#define iPHT(b) do { \
|
||||
b[15] = (b[15] - (b[14] = (b[14] - b[15]) & 255)) & 255; \
|
||||
b[13] = (b[13] - (b[12] = (b[12] - b[13]) & 255)) & 255; \
|
||||
b[11] = (b[11] - (b[10] = (b[10] - b[11]) & 255)) & 255; \
|
||||
b[9] = (b[9] - (b[8] = (b[8] - b[9]) & 255)) & 255; \
|
||||
b[7] = (b[7] - (b[6] = (b[6] - b[7]) & 255)) & 255; \
|
||||
b[5] = (b[5] - (b[4] = (b[4] - b[5]) & 255)) & 255; \
|
||||
b[3] = (b[3] - (b[2] = (b[2] - b[3]) & 255)) & 255; \
|
||||
b[1] = (b[1] - (b[0] = (b[0] - b[1]) & 255)) & 255; \
|
||||
} while (0)
|
||||
|
||||
/* This is the "Armenian" Shuffle. It takes the input from b and stores it in b2 */
|
||||
#define SHUF(b, b2) do { \
|
||||
b2[0] = b[8]; b2[1] = b[11]; b2[2] = b[12]; b2[3] = b[15]; \
|
||||
b2[4] = b[2]; b2[5] = b[1]; b2[6] = b[6]; b2[7] = b[5]; \
|
||||
b2[8] = b[10]; b2[9] = b[9]; b2[10] = b[14]; b2[11] = b[13]; \
|
||||
b2[12] = b[0]; b2[13] = b[7]; b2[14] = b[4]; b2[15] = b[3]; \
|
||||
} while (0)
|
||||
|
||||
/* This is the inverse shuffle. It takes from b and gives to b2 */
|
||||
#define iSHUF(b, b2) do { \
|
||||
b2[0] = b[12]; b2[1] = b[5]; b2[2] = b[4]; b2[3] = b[15]; \
|
||||
b2[4] = b[14]; b2[5] = b[7]; b2[6] = b[6]; b2[7] = b[13]; \
|
||||
b2[8] = b[0]; b2[9] = b[9]; b2[10] = b[8]; b2[11] = b[1]; \
|
||||
b2[12] = b[2]; b2[13] = b[11]; b2[14] = b[10]; b2[15] = b[3]; \
|
||||
} while (0)
|
||||
|
||||
/* The complete forward Linear Transform layer.
|
||||
* Note that alternating usage of b and b2.
|
||||
* Each round of LT starts in 'b' and ends in 'b2'.
|
||||
*/
|
||||
#define LT(b, b2) do { \
|
||||
PHT(b); SHUF(b, b2); \
|
||||
PHT(b2); SHUF(b2, b); \
|
||||
PHT(b); SHUF(b, b2); \
|
||||
PHT(b2); \
|
||||
} while (0)
|
||||
|
||||
/* This is the inverse linear transform layer. */
|
||||
#define iLT(b, b2) do { \
|
||||
iPHT(b); \
|
||||
iSHUF(b, b2); iPHT(b2); \
|
||||
iSHUF(b2, b); iPHT(b); \
|
||||
iSHUF(b, b2); iPHT(b2); \
|
||||
} while (0)
|
||||
|
||||
#ifdef LTC_SMALL_CODE
|
||||
|
||||
static void _round(unsigned char *b, int i, symmetric_key *skey)
|
||||
{
|
||||
ROUND(b, i);
|
||||
}
|
||||
|
||||
static void _iround(unsigned char *b, int i, symmetric_key *skey)
|
||||
{
|
||||
iROUND(b, i);
|
||||
}
|
||||
|
||||
static void _lt(unsigned char *b, unsigned char *b2)
|
||||
{
|
||||
LT(b, b2);
|
||||
}
|
||||
|
||||
static void _ilt(unsigned char *b, unsigned char *b2)
|
||||
{
|
||||
iLT(b, b2);
|
||||
}
|
||||
|
||||
#undef ROUND
|
||||
#define ROUND(b, i) _round(b, i, skey)
|
||||
|
||||
#undef iROUND
|
||||
#define iROUND(b, i) _iround(b, i, skey)
|
||||
|
||||
#undef LT
|
||||
#define LT(b, b2) _lt(b, b2)
|
||||
|
||||
#undef iLT
|
||||
#define iLT(b, b2) _ilt(b, b2)
|
||||
|
||||
#endif
|
||||
|
||||
/* These are the 33, 128-bit bias words for the key schedule */
|
||||
static const unsigned char safer_bias[33][16] = {
|
||||
{ 70, 151, 177, 186, 163, 183, 16, 10, 197, 55, 179, 201, 90, 40, 172, 100},
|
||||
{ 236, 171, 170, 198, 103, 149, 88, 13, 248, 154, 246, 110, 102, 220, 5, 61},
|
||||
{ 138, 195, 216, 137, 106, 233, 54, 73, 67, 191, 235, 212, 150, 155, 104, 160},
|
||||
{ 93, 87, 146, 31, 213, 113, 92, 187, 34, 193, 190, 123, 188, 153, 99, 148},
|
||||
{ 42, 97, 184, 52, 50, 25, 253, 251, 23, 64, 230, 81, 29, 65, 68, 143},
|
||||
{ 221, 4, 128, 222, 231, 49, 214, 127, 1, 162, 247, 57, 218, 111, 35, 202},
|
||||
{ 58, 208, 28, 209, 48, 62, 18, 161, 205, 15, 224, 168, 175, 130, 89, 44},
|
||||
{ 125, 173, 178, 239, 194, 135, 206, 117, 6, 19, 2, 144, 79, 46, 114, 51},
|
||||
{ 192, 141, 207, 169, 129, 226, 196, 39, 47, 108, 122, 159, 82, 225, 21, 56},
|
||||
{ 252, 32, 66, 199, 8, 228, 9, 85, 94, 140, 20, 118, 96, 255, 223, 215},
|
||||
{ 250, 11, 33, 0, 26, 249, 166, 185, 232, 158, 98, 76, 217, 145, 80, 210},
|
||||
{ 24, 180, 7, 132, 234, 91, 164, 200, 14, 203, 72, 105, 75, 78, 156, 53},
|
||||
{ 69, 77, 84, 229, 37, 60, 12, 74, 139, 63, 204, 167, 219, 107, 174, 244},
|
||||
{ 45, 243, 124, 109, 157, 181, 38, 116, 242, 147, 83, 176, 240, 17, 237, 131},
|
||||
{ 182, 3, 22, 115, 59, 30, 142, 112, 189, 134, 27, 71, 126, 36, 86, 241},
|
||||
{ 136, 70, 151, 177, 186, 163, 183, 16, 10, 197, 55, 179, 201, 90, 40, 172},
|
||||
{ 220, 134, 119, 215, 166, 17, 251, 244, 186, 146, 145, 100, 131, 241, 51, 239},
|
||||
{ 44, 181, 178, 43, 136, 209, 153, 203, 140, 132, 29, 20, 129, 151, 113, 202},
|
||||
{ 163, 139, 87, 60, 130, 196, 82, 92, 28, 232, 160, 4, 180, 133, 74, 246},
|
||||
{ 84, 182, 223, 12, 26, 142, 222, 224, 57, 252, 32, 155, 36, 78, 169, 152},
|
||||
{ 171, 242, 96, 208, 108, 234, 250, 199, 217, 0, 212, 31, 110, 67, 188, 236},
|
||||
{ 137, 254, 122, 93, 73, 201, 50, 194, 249, 154, 248, 109, 22, 219, 89, 150},
|
||||
{ 233, 205, 230, 70, 66, 143, 10, 193, 204, 185, 101, 176, 210, 198, 172, 30},
|
||||
{ 98, 41, 46, 14, 116, 80, 2, 90, 195, 37, 123, 138, 42, 91, 240, 6},
|
||||
{ 71, 111, 112, 157, 126, 16, 206, 18, 39, 213, 76, 79, 214, 121, 48, 104},
|
||||
{ 117, 125, 228, 237, 128, 106, 144, 55, 162, 94, 118, 170, 197, 127, 61, 175},
|
||||
{ 229, 25, 97, 253, 77, 124, 183, 11, 238, 173, 75, 34, 245, 231, 115, 35},
|
||||
{ 200, 5, 225, 102, 221, 179, 88, 105, 99, 86, 15, 161, 49, 149, 23, 7},
|
||||
{ 40, 1, 45, 226, 147, 190, 69, 21, 174, 120, 3, 135, 164, 184, 56, 207},
|
||||
{ 8, 103, 9, 148, 235, 38, 168, 107, 189, 24, 52, 27, 187, 191, 114, 247},
|
||||
{ 53, 72, 156, 81, 47, 59, 85, 227, 192, 159, 216, 211, 243, 141, 177, 255},
|
||||
{ 62, 220, 134, 119, 215, 166, 17, 251, 244, 186, 146, 145, 100, 131, 241, 51}};
|
||||
|
||||
/**
|
||||
Initialize the LTC_SAFER+ block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
unsigned x, y, z;
|
||||
unsigned char t[33];
|
||||
static const int rounds[3] = { 8, 12, 16 };
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* check arguments */
|
||||
if (keylen != 16 && keylen != 24 && keylen != 32) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
/* Is the number of rounds valid? Either use zero for default or
|
||||
* 8,12,16 rounds for 16,24,32 byte keys
|
||||
*/
|
||||
if (num_rounds != 0 && num_rounds != rounds[(keylen/8)-2]) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* 128 bit key version */
|
||||
if (keylen == 16) {
|
||||
/* copy key into t */
|
||||
for (x = y = 0; x < 16; x++) {
|
||||
t[x] = key[x];
|
||||
y ^= key[x];
|
||||
}
|
||||
t[16] = y;
|
||||
|
||||
/* make round keys */
|
||||
for (x = 0; x < 16; x++) {
|
||||
skey->saferp.K[0][x] = t[x];
|
||||
}
|
||||
|
||||
/* make the 16 other keys as a transformation of the first key */
|
||||
for (x = 1; x < 17; x++) {
|
||||
/* rotate 3 bits each */
|
||||
for (y = 0; y < 17; y++) {
|
||||
t[y] = ((t[y]<<3)|(t[y]>>5)) & 255;
|
||||
}
|
||||
|
||||
/* select and add */
|
||||
z = x;
|
||||
for (y = 0; y < 16; y++) {
|
||||
skey->saferp.K[x][y] = (t[z] + safer_bias[x-1][y]) & 255;
|
||||
if (++z == 17) { z = 0; }
|
||||
}
|
||||
}
|
||||
skey->saferp.rounds = 8;
|
||||
} else if (keylen == 24) {
|
||||
/* copy key into t */
|
||||
for (x = y = 0; x < 24; x++) {
|
||||
t[x] = key[x];
|
||||
y ^= key[x];
|
||||
}
|
||||
t[24] = y;
|
||||
|
||||
/* make round keys */
|
||||
for (x = 0; x < 16; x++) {
|
||||
skey->saferp.K[0][x] = t[x];
|
||||
}
|
||||
|
||||
for (x = 1; x < 25; x++) {
|
||||
/* rotate 3 bits each */
|
||||
for (y = 0; y < 25; y++) {
|
||||
t[y] = ((t[y]<<3)|(t[y]>>5)) & 255;
|
||||
}
|
||||
|
||||
/* select and add */
|
||||
z = x;
|
||||
for (y = 0; y < 16; y++) {
|
||||
skey->saferp.K[x][y] = (t[z] + safer_bias[x-1][y]) & 255;
|
||||
if (++z == 25) { z = 0; }
|
||||
}
|
||||
}
|
||||
skey->saferp.rounds = 12;
|
||||
} else {
|
||||
/* copy key into t */
|
||||
for (x = y = 0; x < 32; x++) {
|
||||
t[x] = key[x];
|
||||
y ^= key[x];
|
||||
}
|
||||
t[32] = y;
|
||||
|
||||
/* make round keys */
|
||||
for (x = 0; x < 16; x++) {
|
||||
skey->saferp.K[0][x] = t[x];
|
||||
}
|
||||
|
||||
for (x = 1; x < 33; x++) {
|
||||
/* rotate 3 bits each */
|
||||
for (y = 0; y < 33; y++) {
|
||||
t[y] = ((t[y]<<3)|(t[y]>>5)) & 255;
|
||||
}
|
||||
|
||||
/* select and add */
|
||||
z = x;
|
||||
for (y = 0; y < 16; y++) {
|
||||
skey->saferp.K[x][y] = (t[z] + safer_bias[x-1][y]) & 255;
|
||||
if (++z == 33) { z = 0; }
|
||||
}
|
||||
}
|
||||
skey->saferp.rounds = 16;
|
||||
}
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(t, sizeof(t));
|
||||
#endif
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with LTC_SAFER+
|
||||
@param pt The input plaintext (16 bytes)
|
||||
@param ct The output ciphertext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int saferp_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
unsigned char b[16];
|
||||
int x;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* do eight rounds */
|
||||
for (x = 0; x < 16; x++) {
|
||||
b[x] = pt[x];
|
||||
}
|
||||
ROUND(b, 0); LT(b, ct);
|
||||
ROUND(ct, 2); LT(ct, b);
|
||||
ROUND(b, 4); LT(b, ct);
|
||||
ROUND(ct, 6); LT(ct, b);
|
||||
ROUND(b, 8); LT(b, ct);
|
||||
ROUND(ct, 10); LT(ct, b);
|
||||
ROUND(b, 12); LT(b, ct);
|
||||
ROUND(ct, 14); LT(ct, b);
|
||||
/* 192-bit key? */
|
||||
if (skey->saferp.rounds > 8) {
|
||||
ROUND(b, 16); LT(b, ct);
|
||||
ROUND(ct, 18); LT(ct, b);
|
||||
ROUND(b, 20); LT(b, ct);
|
||||
ROUND(ct, 22); LT(ct, b);
|
||||
}
|
||||
/* 256-bit key? */
|
||||
if (skey->saferp.rounds > 12) {
|
||||
ROUND(b, 24); LT(b, ct);
|
||||
ROUND(ct, 26); LT(ct, b);
|
||||
ROUND(b, 28); LT(b, ct);
|
||||
ROUND(ct, 30); LT(ct, b);
|
||||
}
|
||||
ct[0] = b[0] ^ skey->saferp.K[skey->saferp.rounds*2][0];
|
||||
ct[1] = (b[1] + skey->saferp.K[skey->saferp.rounds*2][1]) & 255;
|
||||
ct[2] = (b[2] + skey->saferp.K[skey->saferp.rounds*2][2]) & 255;
|
||||
ct[3] = b[3] ^ skey->saferp.K[skey->saferp.rounds*2][3];
|
||||
ct[4] = b[4] ^ skey->saferp.K[skey->saferp.rounds*2][4];
|
||||
ct[5] = (b[5] + skey->saferp.K[skey->saferp.rounds*2][5]) & 255;
|
||||
ct[6] = (b[6] + skey->saferp.K[skey->saferp.rounds*2][6]) & 255;
|
||||
ct[7] = b[7] ^ skey->saferp.K[skey->saferp.rounds*2][7];
|
||||
ct[8] = b[8] ^ skey->saferp.K[skey->saferp.rounds*2][8];
|
||||
ct[9] = (b[9] + skey->saferp.K[skey->saferp.rounds*2][9]) & 255;
|
||||
ct[10] = (b[10] + skey->saferp.K[skey->saferp.rounds*2][10]) & 255;
|
||||
ct[11] = b[11] ^ skey->saferp.K[skey->saferp.rounds*2][11];
|
||||
ct[12] = b[12] ^ skey->saferp.K[skey->saferp.rounds*2][12];
|
||||
ct[13] = (b[13] + skey->saferp.K[skey->saferp.rounds*2][13]) & 255;
|
||||
ct[14] = (b[14] + skey->saferp.K[skey->saferp.rounds*2][14]) & 255;
|
||||
ct[15] = b[15] ^ skey->saferp.K[skey->saferp.rounds*2][15];
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(b, sizeof(b));
|
||||
#endif
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Decrypts a block of text with LTC_SAFER+
|
||||
@param ct The input ciphertext (16 bytes)
|
||||
@param pt The output plaintext (16 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int saferp_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
unsigned char b[16];
|
||||
int x;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* do eight rounds */
|
||||
b[0] = ct[0] ^ skey->saferp.K[skey->saferp.rounds*2][0];
|
||||
b[1] = (ct[1] - skey->saferp.K[skey->saferp.rounds*2][1]) & 255;
|
||||
b[2] = (ct[2] - skey->saferp.K[skey->saferp.rounds*2][2]) & 255;
|
||||
b[3] = ct[3] ^ skey->saferp.K[skey->saferp.rounds*2][3];
|
||||
b[4] = ct[4] ^ skey->saferp.K[skey->saferp.rounds*2][4];
|
||||
b[5] = (ct[5] - skey->saferp.K[skey->saferp.rounds*2][5]) & 255;
|
||||
b[6] = (ct[6] - skey->saferp.K[skey->saferp.rounds*2][6]) & 255;
|
||||
b[7] = ct[7] ^ skey->saferp.K[skey->saferp.rounds*2][7];
|
||||
b[8] = ct[8] ^ skey->saferp.K[skey->saferp.rounds*2][8];
|
||||
b[9] = (ct[9] - skey->saferp.K[skey->saferp.rounds*2][9]) & 255;
|
||||
b[10] = (ct[10] - skey->saferp.K[skey->saferp.rounds*2][10]) & 255;
|
||||
b[11] = ct[11] ^ skey->saferp.K[skey->saferp.rounds*2][11];
|
||||
b[12] = ct[12] ^ skey->saferp.K[skey->saferp.rounds*2][12];
|
||||
b[13] = (ct[13] - skey->saferp.K[skey->saferp.rounds*2][13]) & 255;
|
||||
b[14] = (ct[14] - skey->saferp.K[skey->saferp.rounds*2][14]) & 255;
|
||||
b[15] = ct[15] ^ skey->saferp.K[skey->saferp.rounds*2][15];
|
||||
/* 256-bit key? */
|
||||
if (skey->saferp.rounds > 12) {
|
||||
iLT(b, pt); iROUND(pt, 30);
|
||||
iLT(pt, b); iROUND(b, 28);
|
||||
iLT(b, pt); iROUND(pt, 26);
|
||||
iLT(pt, b); iROUND(b, 24);
|
||||
}
|
||||
/* 192-bit key? */
|
||||
if (skey->saferp.rounds > 8) {
|
||||
iLT(b, pt); iROUND(pt, 22);
|
||||
iLT(pt, b); iROUND(b, 20);
|
||||
iLT(b, pt); iROUND(pt, 18);
|
||||
iLT(pt, b); iROUND(b, 16);
|
||||
}
|
||||
iLT(b, pt); iROUND(pt, 14);
|
||||
iLT(pt, b); iROUND(b, 12);
|
||||
iLT(b, pt); iROUND(pt,10);
|
||||
iLT(pt, b); iROUND(b, 8);
|
||||
iLT(b, pt); iROUND(pt,6);
|
||||
iLT(pt, b); iROUND(b, 4);
|
||||
iLT(b, pt); iROUND(pt,2);
|
||||
iLT(pt, b); iROUND(b, 0);
|
||||
for (x = 0; x < 16; x++) {
|
||||
pt[x] = b[x];
|
||||
}
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(b, sizeof(b));
|
||||
#endif
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
Performs a self-test of the LTC_SAFER+ block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int saferp_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
int keylen;
|
||||
unsigned char key[32], pt[16], ct[16];
|
||||
} tests[] = {
|
||||
{
|
||||
16,
|
||||
{ 41, 35, 190, 132, 225, 108, 214, 174,
|
||||
82, 144, 73, 241, 241, 187, 233, 235 },
|
||||
{ 179, 166, 219, 60, 135, 12, 62, 153,
|
||||
36, 94, 13, 28, 6, 183, 71, 222 },
|
||||
{ 224, 31, 182, 10, 12, 255, 84, 70,
|
||||
127, 13, 89, 249, 9, 57, 165, 220 }
|
||||
}, {
|
||||
24,
|
||||
{ 72, 211, 143, 117, 230, 217, 29, 42,
|
||||
229, 192, 247, 43, 120, 129, 135, 68,
|
||||
14, 95, 80, 0, 212, 97, 141, 190 },
|
||||
{ 123, 5, 21, 7, 59, 51, 130, 31,
|
||||
24, 112, 146, 218, 100, 84, 206, 177 },
|
||||
{ 92, 136, 4, 63, 57, 95, 100, 0,
|
||||
150, 130, 130, 16, 193, 111, 219, 133 }
|
||||
}, {
|
||||
32,
|
||||
{ 243, 168, 141, 254, 190, 242, 235, 113,
|
||||
255, 160, 208, 59, 117, 6, 140, 126,
|
||||
135, 120, 115, 77, 208, 190, 130, 190,
|
||||
219, 194, 70, 65, 43, 140, 250, 48 },
|
||||
{ 127, 112, 240, 167, 84, 134, 50, 149,
|
||||
170, 91, 104, 19, 11, 230, 252, 245 },
|
||||
{ 88, 11, 25, 36, 172, 229, 202, 213,
|
||||
170, 65, 105, 153, 220, 104, 153, 138 }
|
||||
}
|
||||
};
|
||||
|
||||
unsigned char tmp[2][16];
|
||||
symmetric_key skey;
|
||||
int err, i, y;
|
||||
|
||||
for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) {
|
||||
if ((err = saferp_setup(tests[i].key, tests[i].keylen, 0, &skey)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
saferp_ecb_encrypt(tests[i].pt, tmp[0], &skey);
|
||||
saferp_ecb_decrypt(tmp[0], tmp[1], &skey);
|
||||
|
||||
/* compare */
|
||||
if (compare_testvector(tmp[0], 16, tests[i].ct, 16, "Safer+ Encrypt", i) ||
|
||||
compare_testvector(tmp[1], 16, tests[i].pt, 16, "Safer+ Decrypt", i)) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 16; y++) tmp[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) saferp_ecb_encrypt(tmp[0], tmp[0], &skey);
|
||||
for (y = 0; y < 1000; y++) saferp_ecb_decrypt(tmp[0], tmp[0], &skey);
|
||||
for (y = 0; y < 16; y++) if (tmp[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void saferp_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int saferp_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
|
||||
if (*keysize < 16)
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
if (*keysize < 24) {
|
||||
*keysize = 16;
|
||||
} else if (*keysize < 32) {
|
||||
*keysize = 24;
|
||||
} else {
|
||||
*keysize = 32;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
@@ -1,343 +0,0 @@
|
||||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file skipjack.c
|
||||
Skipjack Implementation by Tom St Denis
|
||||
*/
|
||||
#include "tomcrypt.h"
|
||||
|
||||
#ifdef LTC_SKIPJACK
|
||||
|
||||
const struct ltc_cipher_descriptor skipjack_desc =
|
||||
{
|
||||
"skipjack",
|
||||
17,
|
||||
10, 10, 8, 32,
|
||||
&skipjack_setup,
|
||||
&skipjack_ecb_encrypt,
|
||||
&skipjack_ecb_decrypt,
|
||||
&skipjack_test,
|
||||
&skipjack_done,
|
||||
&skipjack_keysize,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
static const unsigned char sbox[256] = {
|
||||
0xa3,0xd7,0x09,0x83,0xf8,0x48,0xf6,0xf4,0xb3,0x21,0x15,0x78,0x99,0xb1,0xaf,0xf9,
|
||||
0xe7,0x2d,0x4d,0x8a,0xce,0x4c,0xca,0x2e,0x52,0x95,0xd9,0x1e,0x4e,0x38,0x44,0x28,
|
||||
0x0a,0xdf,0x02,0xa0,0x17,0xf1,0x60,0x68,0x12,0xb7,0x7a,0xc3,0xe9,0xfa,0x3d,0x53,
|
||||
0x96,0x84,0x6b,0xba,0xf2,0x63,0x9a,0x19,0x7c,0xae,0xe5,0xf5,0xf7,0x16,0x6a,0xa2,
|
||||
0x39,0xb6,0x7b,0x0f,0xc1,0x93,0x81,0x1b,0xee,0xb4,0x1a,0xea,0xd0,0x91,0x2f,0xb8,
|
||||
0x55,0xb9,0xda,0x85,0x3f,0x41,0xbf,0xe0,0x5a,0x58,0x80,0x5f,0x66,0x0b,0xd8,0x90,
|
||||
0x35,0xd5,0xc0,0xa7,0x33,0x06,0x65,0x69,0x45,0x00,0x94,0x56,0x6d,0x98,0x9b,0x76,
|
||||
0x97,0xfc,0xb2,0xc2,0xb0,0xfe,0xdb,0x20,0xe1,0xeb,0xd6,0xe4,0xdd,0x47,0x4a,0x1d,
|
||||
0x42,0xed,0x9e,0x6e,0x49,0x3c,0xcd,0x43,0x27,0xd2,0x07,0xd4,0xde,0xc7,0x67,0x18,
|
||||
0x89,0xcb,0x30,0x1f,0x8d,0xc6,0x8f,0xaa,0xc8,0x74,0xdc,0xc9,0x5d,0x5c,0x31,0xa4,
|
||||
0x70,0x88,0x61,0x2c,0x9f,0x0d,0x2b,0x87,0x50,0x82,0x54,0x64,0x26,0x7d,0x03,0x40,
|
||||
0x34,0x4b,0x1c,0x73,0xd1,0xc4,0xfd,0x3b,0xcc,0xfb,0x7f,0xab,0xe6,0x3e,0x5b,0xa5,
|
||||
0xad,0x04,0x23,0x9c,0x14,0x51,0x22,0xf0,0x29,0x79,0x71,0x7e,0xff,0x8c,0x0e,0xe2,
|
||||
0x0c,0xef,0xbc,0x72,0x75,0x6f,0x37,0xa1,0xec,0xd3,0x8e,0x62,0x8b,0x86,0x10,0xe8,
|
||||
0x08,0x77,0x11,0xbe,0x92,0x4f,0x24,0xc5,0x32,0x36,0x9d,0xcf,0xf3,0xa6,0xbb,0xac,
|
||||
0x5e,0x6c,0xa9,0x13,0x57,0x25,0xb5,0xe3,0xbd,0xa8,0x3a,0x01,0x05,0x59,0x2a,0x46
|
||||
};
|
||||
|
||||
/* simple x + 1 (mod 10) in one step. */
|
||||
static const int keystep[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
|
||||
|
||||
/* simple x - 1 (mod 10) in one step */
|
||||
static const int ikeystep[] = { 9, 0, 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
|
||||
/**
|
||||
Initialize the Skipjack block cipher
|
||||
@param key The symmetric key you wish to pass
|
||||
@param keylen The key length in bytes
|
||||
@param num_rounds The number of rounds desired (0 for default)
|
||||
@param skey The key in as scheduled by this function.
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int skipjack_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
|
||||
{
|
||||
int x;
|
||||
|
||||
LTC_ARGCHK(key != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
if (keylen != 10) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
}
|
||||
|
||||
if (num_rounds != 32 && num_rounds != 0) {
|
||||
return CRYPT_INVALID_ROUNDS;
|
||||
}
|
||||
|
||||
/* make sure the key is in range for platforms where CHAR_BIT != 8 */
|
||||
for (x = 0; x < 10; x++) {
|
||||
skey->skipjack.key[x] = key[x] & 255;
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#define RULE_A \
|
||||
tmp = g_func(w1, &kp, skey->skipjack.key); \
|
||||
w1 = tmp ^ w4 ^ x; \
|
||||
w4 = w3; w3 = w2; \
|
||||
w2 = tmp;
|
||||
|
||||
#define RULE_B \
|
||||
tmp = g_func(w1, &kp, skey->skipjack.key); \
|
||||
tmp1 = w4; w4 = w3; \
|
||||
w3 = w1 ^ w2 ^ x; \
|
||||
w1 = tmp1; w2 = tmp;
|
||||
|
||||
#define RULE_A1 \
|
||||
tmp = w1 ^ w2 ^ x; \
|
||||
w1 = ig_func(w2, &kp, skey->skipjack.key); \
|
||||
w2 = w3; w3 = w4; w4 = tmp;
|
||||
|
||||
#define RULE_B1 \
|
||||
tmp = ig_func(w2, &kp, skey->skipjack.key); \
|
||||
w2 = tmp ^ w3 ^ x; \
|
||||
w3 = w4; w4 = w1; w1 = tmp;
|
||||
|
||||
static unsigned g_func(unsigned w, int *kp, unsigned char *key)
|
||||
{
|
||||
unsigned char g1,g2;
|
||||
|
||||
g1 = (w >> 8) & 255; g2 = w & 255;
|
||||
g1 ^= sbox[g2^key[*kp]]; *kp = keystep[*kp];
|
||||
g2 ^= sbox[g1^key[*kp]]; *kp = keystep[*kp];
|
||||
g1 ^= sbox[g2^key[*kp]]; *kp = keystep[*kp];
|
||||
g2 ^= sbox[g1^key[*kp]]; *kp = keystep[*kp];
|
||||
return ((unsigned)g1<<8)|(unsigned)g2;
|
||||
}
|
||||
|
||||
static unsigned ig_func(unsigned w, int *kp, unsigned char *key)
|
||||
{
|
||||
unsigned char g1,g2;
|
||||
|
||||
g1 = (w >> 8) & 255; g2 = w & 255;
|
||||
*kp = ikeystep[*kp]; g2 ^= sbox[g1^key[*kp]];
|
||||
*kp = ikeystep[*kp]; g1 ^= sbox[g2^key[*kp]];
|
||||
*kp = ikeystep[*kp]; g2 ^= sbox[g1^key[*kp]];
|
||||
*kp = ikeystep[*kp]; g1 ^= sbox[g2^key[*kp]];
|
||||
return ((unsigned)g1<<8)|(unsigned)g2;
|
||||
}
|
||||
|
||||
/**
|
||||
Encrypts a block of text with Skipjack
|
||||
@param pt The input plaintext (8 bytes)
|
||||
@param ct The output ciphertext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _skipjack_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#else
|
||||
int skipjack_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
unsigned w1,w2,w3,w4,tmp,tmp1;
|
||||
int x, kp;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* load block */
|
||||
w1 = ((unsigned)pt[0]<<8)|pt[1];
|
||||
w2 = ((unsigned)pt[2]<<8)|pt[3];
|
||||
w3 = ((unsigned)pt[4]<<8)|pt[5];
|
||||
w4 = ((unsigned)pt[6]<<8)|pt[7];
|
||||
|
||||
/* 8 rounds of RULE A */
|
||||
for (x = 1, kp = 0; x < 9; x++) {
|
||||
RULE_A;
|
||||
}
|
||||
|
||||
/* 8 rounds of RULE B */
|
||||
for (; x < 17; x++) {
|
||||
RULE_B;
|
||||
}
|
||||
|
||||
/* 8 rounds of RULE A */
|
||||
for (; x < 25; x++) {
|
||||
RULE_A;
|
||||
}
|
||||
|
||||
/* 8 rounds of RULE B */
|
||||
for (; x < 33; x++) {
|
||||
RULE_B;
|
||||
}
|
||||
|
||||
/* store block */
|
||||
ct[0] = (w1>>8)&255; ct[1] = w1&255;
|
||||
ct[2] = (w2>>8)&255; ct[3] = w2&255;
|
||||
ct[4] = (w3>>8)&255; ct[5] = w3&255;
|
||||
ct[6] = (w4>>8)&255; ct[7] = w4&255;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int skipjack_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey)
|
||||
{
|
||||
int err = _skipjack_ecb_encrypt(pt, ct, skey);
|
||||
burn_stack(sizeof(unsigned) * 8 + sizeof(int) * 2);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Decrypts a block of text with Skipjack
|
||||
@param ct The input ciphertext (8 bytes)
|
||||
@param pt The output plaintext (8 bytes)
|
||||
@param skey The key as scheduled
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
static int _skipjack_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#else
|
||||
int skipjack_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
#endif
|
||||
{
|
||||
unsigned w1,w2,w3,w4,tmp;
|
||||
int x, kp;
|
||||
|
||||
LTC_ARGCHK(pt != NULL);
|
||||
LTC_ARGCHK(ct != NULL);
|
||||
LTC_ARGCHK(skey != NULL);
|
||||
|
||||
/* load block */
|
||||
w1 = ((unsigned)ct[0]<<8)|ct[1];
|
||||
w2 = ((unsigned)ct[2]<<8)|ct[3];
|
||||
w3 = ((unsigned)ct[4]<<8)|ct[5];
|
||||
w4 = ((unsigned)ct[6]<<8)|ct[7];
|
||||
|
||||
/* 8 rounds of RULE B^-1
|
||||
|
||||
Note the value "kp = 8" comes from "kp = (32 * 4) mod 10" where 32*4 is 128 which mod 10 is 8
|
||||
*/
|
||||
for (x = 32, kp = 8; x > 24; x--) {
|
||||
RULE_B1;
|
||||
}
|
||||
|
||||
/* 8 rounds of RULE A^-1 */
|
||||
for (; x > 16; x--) {
|
||||
RULE_A1;
|
||||
}
|
||||
|
||||
|
||||
/* 8 rounds of RULE B^-1 */
|
||||
for (; x > 8; x--) {
|
||||
RULE_B1;
|
||||
}
|
||||
|
||||
/* 8 rounds of RULE A^-1 */
|
||||
for (; x > 0; x--) {
|
||||
RULE_A1;
|
||||
}
|
||||
|
||||
/* store block */
|
||||
pt[0] = (w1>>8)&255; pt[1] = w1&255;
|
||||
pt[2] = (w2>>8)&255; pt[3] = w2&255;
|
||||
pt[4] = (w3>>8)&255; pt[5] = w3&255;
|
||||
pt[6] = (w4>>8)&255; pt[7] = w4&255;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
int skipjack_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey)
|
||||
{
|
||||
int err = _skipjack_ecb_decrypt(ct, pt, skey);
|
||||
burn_stack(sizeof(unsigned) * 7 + sizeof(int) * 2);
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Performs a self-test of the Skipjack block cipher
|
||||
@return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
|
||||
*/
|
||||
int skipjack_test(void)
|
||||
{
|
||||
#ifndef LTC_TEST
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
unsigned char key[10], pt[8], ct[8];
|
||||
} tests[] = {
|
||||
{
|
||||
{ 0x00, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 },
|
||||
{ 0x33, 0x22, 0x11, 0x00, 0xdd, 0xcc, 0xbb, 0xaa },
|
||||
{ 0x25, 0x87, 0xca, 0xe2, 0x7a, 0x12, 0xd3, 0x00 }
|
||||
}
|
||||
};
|
||||
unsigned char buf[2][8];
|
||||
int x, y, err;
|
||||
symmetric_key key;
|
||||
|
||||
for (x = 0; x < (int)(sizeof(tests) / sizeof(tests[0])); x++) {
|
||||
/* setup key */
|
||||
if ((err = skipjack_setup(tests[x].key, 10, 0, &key)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* encrypt and decrypt */
|
||||
skipjack_ecb_encrypt(tests[x].pt, buf[0], &key);
|
||||
skipjack_ecb_decrypt(buf[0], buf[1], &key);
|
||||
|
||||
/* compare */
|
||||
if (compare_testvector(buf[0], 8, tests[x].ct, 8, "Skipjack Encrypt", x) != 0 ||
|
||||
compare_testvector(buf[1], 8, tests[x].pt, 8, "Skipjack Decrypt", x) != 0) {
|
||||
return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
/* now see if we can encrypt all zero bytes 1000 times, decrypt and come back where we started */
|
||||
for (y = 0; y < 8; y++) buf[0][y] = 0;
|
||||
for (y = 0; y < 1000; y++) skipjack_ecb_encrypt(buf[0], buf[0], &key);
|
||||
for (y = 0; y < 1000; y++) skipjack_ecb_decrypt(buf[0], buf[0], &key);
|
||||
for (y = 0; y < 8; y++) if (buf[0][y] != 0) return CRYPT_FAIL_TESTVECTOR;
|
||||
}
|
||||
|
||||
return CRYPT_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Terminate the context
|
||||
@param skey The scheduled key
|
||||
*/
|
||||
void skipjack_done(symmetric_key *skey)
|
||||
{
|
||||
LTC_UNUSED_PARAM(skey);
|
||||
}
|
||||
|
||||
/**
|
||||
Gets suitable key size
|
||||
@param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
|
||||
@return CRYPT_OK if the input key size is acceptable.
|
||||
*/
|
||||
int skipjack_keysize(int *keysize)
|
||||
{
|
||||
LTC_ARGCHK(keysize != NULL);
|
||||
if (*keysize < 10) {
|
||||
return CRYPT_INVALID_KEYSIZE;
|
||||
} else if (*keysize > 10) {
|
||||
*keysize = 10;
|
||||
}
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ref: HEAD -> master, tag: v1.18.2 */
|
||||
/* git commit: 7e7eb695d581782f04b24dc444cbfde86af59853 */
|
||||
/* commit time: 2018-07-01 22:49:01 +0200 */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user