Update to crypto++ 8.0. This fixes an bug where non-AESNI CPUs on Windows decrypted incorrectly

This commit is contained in:
Sebastian Messmer 2019-01-12 11:29:33 -08:00
parent 60aba37eaf
commit 490abd5f31
296 changed files with 56317 additions and 26000 deletions

5
vendor/README vendored
View File

@ -2,6 +2,5 @@ This directory contains external projects, taken from the following locations:
googletest: https://github.com/google/googletest/tree/4e4df226fc197c0dda6e37f5c8c3845ca1e73a49
- changed: added NOLINT comment as workaround for clang-tidy warning https://github.com/google/googletest/issues/853
spdlog: https://github.com/gabime/spdlog/tree/v0.16.3/include/spdlog
cryptopp: https://github.com/weidai11/cryptopp/tree/CRYPTOPP_7_0_0
- changed: added CMakeLists.txt and cryptopp-config.cmake from https://github.com/noloader/cryptopp-cmake/tree/7f3b3540740b365bed673936852d70795c0104f3
- changed: removed cmake warning from CMakeLists.txt
cryptopp: https://github.com/weidai11/cryptopp/tree/CRYPTOPP_8_0_0
- changed: added CMakeLists.txt and cryptopp-config.cmake from https://github.com/noloader/cryptopp-cmake/tree/CRYPTOPP_8_0_0

View File

@ -88,6 +88,7 @@ set(BUILD_TESTING OFF CACHE BOOL "")
set(BUILD_DOCUMENTATION OFF CACHE BOOL "")
set(BUILD_SHARED OFF CACHE BOOL "")
set(BUILD_STATIC ON CACHE BOOL "")
set(cryptocpp_DISPLAY_CMAKE_SUPPORT_WARNING OFF CACHE BOOL "")
add_subdirectory(vendor_cryptopp EXCLUDE_FROM_ALL)
target_link_libraries(cryptopp PRIVATE cryptopp-static)

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,7 @@ PROJECT_NAME = Crypto++
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 7.0
PROJECT_NUMBER = 8.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@ -1225,8 +1225,7 @@ DOCSET_PUBLISHER_NAME = Crypto++
# compressed HTML files.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = YES
GENERATE_HTMLHELP = NO
# The CHM_FILE tag can be used to specify the file name of the resulting .chm
# file. You can add a path in front of the file if the result should not be
@ -1494,7 +1493,10 @@ MATHJAX_CODEFILE =
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = NO
# JW: Do _not_ enable server-side search. It consumes too many resources
# and results in OOM Kills on MySQL, which corrupts the database.
# https://github.com/weidai11/cryptopp/issues/720
SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
@ -1506,7 +1508,10 @@ SEARCHENGINE = NO
# The default value is: NO.
# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
# JW: Do _not_ enable server-side search. It consumes too many resources
# and results in OOM Kills on MySQL, which corrupts the database.
# https://github.com/weidai11/cryptopp/issues/720
SERVER_BASED_SEARCH = NO
# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file

View File

@ -1,10 +1,12 @@
3way.cpp
3way.h
adhoc.cpp.proto
adv-simd.h
adv_simd.h
adler32.cpp
adler32.h
aes.h
aes_armv4.h
aes_armv4.S
algebra.cpp
algebra.h
algparam.cpp
@ -13,7 +15,7 @@ arc4.cpp
arc4.h
ariatab.cpp
aria.cpp
aria-simd.cpp
aria_simd.cpp
aria.h
argnames.h
asn.cpp
@ -30,9 +32,11 @@ bench.h
bds10.zip
bench1.cpp
bench2.cpp
bench3.cpp
bfinit.cpp
blake2.cpp
blake2-simd.cpp
blake2s_simd.cpp
blake2b_simd.cpp
blake2.h
blowfish.cpp
blowfish.h
@ -48,7 +52,12 @@ cbcmac.h
ccm.cpp
ccm.h
chacha.cpp
chacha_avx.cpp
chacha_simd.cpp
chacha.h
cham.cpp
cham_simd.cpp
cham.h
channels.cpp
channels.h
cmac.cpp
@ -57,7 +66,7 @@ config.h
cpu.cpp
cpu.h
crc.cpp
crc-simd.cpp
crc_simd.cpp
crc.h
cryptdll.vcxproj
cryptdll.vcxproj.filters
@ -73,6 +82,8 @@ cryptlib.h
cryptlib.vcxproj
cryptlib.vcxproj.filters
cryptopp.rc
darn.cpp
darn.h
datatest.cpp
default.cpp
default.h
@ -90,6 +101,13 @@ dlltest.vcxproj
dlltest.vcxproj.filters
dmac.h
drbg.h
donna.h
donna_32.h
donna_64.h
donna_sse.h
donna_32.cpp
donna_64.cpp
donna_sse.cpp
dsa.cpp
dsa.h
eax.cpp
@ -121,7 +139,7 @@ fips140.h
fipsalgt.cpp
fipstest.cpp
fltrimpl.h
gcm-simd.cpp
gcm_simd.cpp
gcm.cpp
gcm.h
gf256.cpp
@ -137,8 +155,14 @@ gost.h
gzip.cpp
gzip.h
hashfwd.h
hc128.cpp
hc128.h
hc256.cpp
hc256.h
hex.cpp
hex.h
hight.h
hight.cpp
hkdf.h
hmac.cpp
hmac.h
@ -159,7 +183,12 @@ kalyna.cpp
kalyna.h
keccak.cpp
keccak.h
keccakc.cpp
keccakc.h
lubyrack.h
lea.cpp
lea_simd.cpp
lea.h
luc.cpp
luc.h
mars.cpp
@ -186,9 +215,7 @@ mqv.h
naclite.h
nbtheory.cpp
nbtheory.h
neon-simd.cpp
network.cpp
network.h
neon_simd.cpp
nr.h
oaep.cpp
oaep.h
@ -208,8 +235,11 @@ poly1305.cpp
poly1305.h
polynomi.cpp
polynomi.h
ppc-simd.h
ppc-simd.cpp
ppc_power7.cpp
ppc_power8.cpp
ppc_power9.cpp
ppc_simd.cpp
ppc_simd.h
pssr.cpp
pssr.h
pubkey.cpp
@ -221,6 +251,8 @@ rabin.cpp
rabin.h
randpool.cpp
randpool.h
rabbit.cpp
rabbit.h
rc2.cpp
rc2.h
rc5.cpp
@ -237,9 +269,10 @@ rdtables.cpp
regtest1.cpp
regtest2.cpp
regtest3.cpp
regtest4.cpp
resource.h
rijndael.cpp
rijndael-simd.cpp
rijndael_simd.cpp
rijndael.h
ripemd.cpp
ripemd.h
@ -265,12 +298,12 @@ serpent.cpp
serpent.h
serpentp.h
sha.cpp
sha-simd.cpp
sha_simd.cpp
sha.h
sha3.cpp
sha3.h
shacal2.cpp
shacal2-simd.cpp
shacal2_simd.cpp
shacal2.h
shark.cpp
shark.h
@ -278,27 +311,31 @@ sharkbox.cpp
simple.cpp
simple.h
siphash.h
simeck.cpp
simeck_simd.cpp
simeck.h
simon.cpp
simon-simd.cpp
simon64_simd.cpp
simon128_simd.cpp
simon.h
skipjack.cpp
skipjack.h
sm3.cpp
sm3.h
sm4.cpp
sm4_simd.cpp
sm4.h
smartptr.h
socketft.cpp
socketft.h
sosemanuk.cpp
sosemanuk.h
speck.cpp
speck-simd.cpp
speck64_simd.cpp
speck128_simd.cpp
speck.h
square.cpp
square.h
squaretb.cpp
sse-simd.cpp
sse_simd.cpp
stdcpp.h
strciphr.cpp
strciphr.h
@ -312,8 +349,6 @@ threefish.h
tiger.cpp
tiger.h
tigertab.cpp
trdlocal.cpp
trdlocal.h
trunhash.h
ttmac.cpp
ttmac.h
@ -326,21 +361,25 @@ validat1.cpp
validat2.cpp
validat3.cpp
validat4.cpp
validat5.cpp
validat6.cpp
validat7.cpp
validat8.cpp
validat9.cpp
validat10.cpp
validate.h
vmac.cpp
vmac.h
vs2005.zip
wait.cpp
wait.h
wake.cpp
wake.h
whrlpool.cpp
whrlpool.h
winpipes.cpp
winpipes.h
words.h
x64dll.asm
x64masm.asm
xed25519.h
xed25519.cpp
xtr.cpp
xtr.h
xtrcrypt.cpp
@ -366,6 +405,8 @@ TestData/aria.dat
TestData/camellia.dat
TestData/cast128v.dat
TestData/cast256v.dat
TestData/defdmac1.bin
TestData/defdmac2.bin
TestData/descert.dat
TestData/dh1024.dat
TestData/dh2048.dat
@ -374,6 +415,10 @@ TestData/dlie2048.dat
TestData/dsa1024.dat
TestData/dsa1024b.dat
TestData/dsa512.dat
TestData/ed25519.dat
TestData/ed25519_ver.dat
TestData/ed25519v0.dat
TestData/ed25519v1.dat
TestData/elgc1024.dat
TestData/esig1023.dat
TestData/esig1536.dat
@ -409,10 +454,10 @@ TestData/rc6val.dat
TestData/rijndael.dat
TestData/rsa1024.dat
TestData/rsa2048.dat
TestData/rsa2048a.dat
TestData/rsa400pb.dat
TestData/rsa400pv.dat
TestData/rsa512a.dat
TestData/rsa2048a.dat
TestData/rw1024.dat
TestData/rw2048.dat
TestData/saferval.dat
@ -423,57 +468,68 @@ TestData/skipjack.dat
TestData/squareva.dat
TestData/twofishv.dat
TestData/usage.dat
TestData/x25519.dat
TestData/x25519v0.dat
TestData/x25519v1.dat
TestData/xtrdh171.dat
TestData/xtrdh342.dat
TestVectors/Readme.txt
TestVectors/aes.txt
TestVectors/all.txt
TestVectors/aria.txt
TestVectors/blake2.txt
TestVectors/blake2b.txt
TestVectors/blake2s.txt
TestVectors/aria.txt
TestVectors/camellia.txt
TestVectors/ccm.txt
TestVectors/chacha.txt
TestVectors/chacha_tls.txt
TestVectors/cham.txt
TestVectors/cmac.txt
TestVectors/dlies.txt
TestVectors/dsa.txt
TestVectors/dsa_1363.txt
TestVectors/dsa_rfc6979.txt
TestVectors/eax.txt
TestVectors/esign.txt
TestVectors/gcm.txt
TestVectors/hc128.txt
TestVectors/hc256.txt
TestVectors/hight.txt
TestVectors/hkdf.txt
TestVectors/hmac.txt
TestVectors/kalyna.txt
TestVectors/keccak.txt
TestVectors/lea.txt
TestVectors/mars.txt
TestVectors/nr.txt
TestVectors/ocb.txt
TestVectors/panama.txt
TestVectors/rabbit.txt
TestVectors/Readme.txt
TestVectors/rsa_oaep.txt
TestVectors/rsa_pkcs1_1_5.txt
TestVectors/rsa_pss.txt
TestVectors/dsa_rfc6979.txt
TestVectors/rw.txt
TestVectors/salsa.txt
TestVectors/seal.txt
TestVectors/seed.txt
TestVectors/sha.txt
TestVectors/sha2.txt
TestVectors/sha3.txt
TestVectors/sha1_fips_180.txt
TestVectors/sha1_160_fips_180.txt
TestVectors/sha2_fips_180.txt
TestVectors/sha1_fips_180.txt
TestVectors/sha2.txt
TestVectors/sha2_224_fips_180.txt
TestVectors/sha2_256_fips_180.txt
TestVectors/sha2_384_fips_180.txt
TestVectors/sha2_512_fips_180.txt
TestVectors/sha3_fips_202.txt
TestVectors/sha2_fips_180.txt
TestVectors/sha3.txt
TestVectors/sha3_224_fips_202.txt
TestVectors/sha3_256_fips_202.txt
TestVectors/sha3_384_fips_202.txt
TestVectors/sha3_512_fips_202.txt
TestVectors/sha3_fips_202.txt
TestVectors/shacal2.txt
TestVectors/simeck.txt
TestVectors/simon.txt
TestVectors/siphash.txt
TestVectors/sm3.txt
@ -486,3 +542,39 @@ TestVectors/ttmac.txt
TestVectors/vmac.txt
TestVectors/wake.txt
TestVectors/whrlpool.txt
TestPrograms/test_32bit.cxx
TestPrograms/test_64bit.cxx
TestPrograms/test_arm_acle.cxx
TestPrograms/test_arm_aes.cxx
TestPrograms/test_arm_asimd.cxx
TestPrograms/test_arm_crc.cxx
TestPrograms/test_arm_neon.cxx
TestPrograms/test_arm_pmull.cxx
TestPrograms/test_arm_sha.cxx
TestPrograms/test_arm_sha3.cxx
TestPrograms/test_arm_sha512.cxx
TestPrograms/test_arm_sm3.cxx
TestPrograms/test_arm_sm4.cxx
TestPrograms/test_cxx.cxx
TestPrograms/test_mixed_asm.cxx
TestPrograms/test_newlib.cxx
TestPrograms/test_ppc_aes.cxx
TestPrograms/test_ppc_altivec.cxx
TestPrograms/test_ppc_power7.cxx
TestPrograms/test_ppc_power8.cxx
TestPrograms/test_ppc_power9.cxx
TestPrograms/test_ppc_sha.cxx
TestPrograms/test_ppc_vmull.cxx
TestPrograms/test_pthreads.cxx
TestPrograms/test_x86_aes.cxx
TestPrograms/test_x86_avx.cxx
TestPrograms/test_x86_avx2.cxx
TestPrograms/test_x86_avx512.cxx
TestPrograms/test_x86_clmul.cxx
TestPrograms/test_x86_cpuid.cxx
TestPrograms/test_x86_sha.cxx
TestPrograms/test_x86_sse2.cxx
TestPrograms/test_x86_sse3.cxx
TestPrograms/test_x86_sse41.cxx
TestPrograms/test_x86_sse42.cxx
TestPrograms/test_x86_ssse3.cxx

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,14 @@
SHELL = /bin/sh
# If needed
TMPDIR ?= /tmp
# Used for ARMv7 and NEON.
FP_ABI ?= hard
# Used for feature tests
TOUT ?= a.out
TOUT := $(strip $(TOUT))
# Default CXXFLAGS if none were provided
CXXFLAGS ?= -DNDEBUG -g2 -O3 -fPIC -pipe
@ -22,35 +30,25 @@ INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
# Attempt to determine host machine, fallback to "this" machine.
# The host machine is the one the package runs on. Most people
# call this the "target", but not Autotools.
HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-')
ifeq ($(HOSTX),)
HOSTX := $(shell uname -m 2>/dev/null)
endif
IS_i686 := $(shell echo "$HOSTX" | $(EGREP) -v 64 | $(EGREP) -i -c 'i.86')
IS_x86_64 := $(shell echo "$HOSTX" | $(EGREP) -i -c 'x86_64|amd64')
IS_ARM := $(shell echo "$HOSTX" | $(EGREP) -i -c 'arm')
IS_ARMv8 := $(shell echo "$HOSTX" | $(EGREP) -i -c 'aarch32|aarch64')
CLANG_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang")
IS_IOS ?= 0
IS_ANDROID ?= 0
IS_ARM_EMBEDDED ?= 0
IS_NEON ?= 0
# Fixup ARM
ifeq ($(IS_ARMv8),1)
IS_ARM := 0
endif
# Can be used by Android and Embeeded cross-compiles. Disable by default because
# Android and embedded users typically don't run this configuration.
HAS_SOLIB_VERSION ?= 0
# Formely adhoc.cpp was created from adhoc.cpp.proto when needed.
# This is now needed because ISA tests are performed using adhoc.cpp.
ifeq ($(wildcard adhoc.cpp),)
$(shell cp adhoc.cpp.proto adhoc.cpp)
endif
###########################################################
##### General Variables #####
###########################################################
# Default prefix for make install
ifeq ($(PREFIX),)
PREFIX = /usr/local
@ -72,29 +70,37 @@ endif
# We honor ARFLAGS, but the "v" option used by default causes a noisy make
ifeq ($(ARFLAGS),rv)
ARFLAGS = r
ARFLAGS = r
endif
# Sadly, we can't actually use GCC_PRAGMA_AWARE because of GCC bug 53431.
# Its a shame because GCC has so much to offer by the way of analysis.
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
ifneq ($(CLANG_COMPILER),0)
CXXFLAGS += -Wall
CXXFLAGS += -Wall
endif
###########################################################
##### iOS #####
###########################################################
# iOS cross-compile configuration.
# See http://www.cryptopp.com/wiki/iOS_(Command_Line).
ifeq ($(IS_IOS),1)
CXX = clang++
CXXFLAGS += $(IOS_FLAGS) -arch $(IOS_ARCH)
CXXFLAGS += -isysroot $(IOS_SYSROOT) -stdlib=libc++
CXXFLAGS += -isysroot "$(IOS_SYSROOT)" -stdlib=libc++
AR = libtool
ARFLAGS = -static -o
RANLIB = ranlib
endif
###########################################################
##### Android #####
###########################################################
# Android cross-compile configuration.
# See http://www.cryptopp.com/wiki/Android_(Command_Line).
ifeq ($(IS_ANDROID),1)
@ -116,6 +122,10 @@ ifeq ($(IS_ANDROID),1)
AOSP_CPU_OBJ = cpu-features.o
endif
###########################################################
##### Embedded #####
###########################################################
# ARM embedded cross-compile configuration.
# See http://www.cryptopp.com/wiki/ARM_Embedded_(Command_Line)
# and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal).
@ -124,6 +134,364 @@ ifeq ($(IS_ARM_EMBEDDED),1)
CXXFLAGS += $(ARM_EMBEDDED_FLAGS) --sysroot=$(ARM_EMBEDDED_SYSROOT)
endif
###########################################################
##### Compiler and Platform #####
###########################################################
# Wait until CXXFLAGS have been set by setenv scripts.
GCC_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(EGREP) -v -E 'llvm|clang' | $(EGREP) -i -c -E '(gcc|g\+\+)')
CLANG_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(EGREP) -i -c -E 'llvm|clang')
HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-')
ifeq ($(HOSTX),)
HOSTX := $(shell uname -m 2>/dev/null)
endif
# This dance is because Clang reports the host architecture instead
# of the target architecture. Running Clang on an x86_64 machine with
# -arch arm64 yields x86_64 instead of aarch64 or arm64.
ifeq ($(CLANG_COMPILER),1)
IS_X86 := $(shell echo $(CXXFLAGS) | $(EGREP) -v 64 | $(EGREP) -i -c -E 'i.86')
IS_X64 := $(shell echo $(CXXFLAGS) | $(EGREP) -i -c -E 'x86_64|amd64')
IS_ARM32 := $(shell echo $(CXXFLAGS) | $(EGREP) -v 64 | $(EGREP) -i -c -E 'arm|armhf|arm7l|eabihf')
IS_ARMV8 := $(shell echo $(CXXFLAGS) | $(EGREP) -i -c -E 'aarch32|aarch64|arm64|armv8')
else
IS_X86 := $(shell echo $(HOSTX) | $(EGREP) -v 64 | $(EGREP) -i -c -E 'i.86')
IS_X64 := $(shell echo $(HOSTX) | $(EGREP) -i -c -E 'x86_64|amd64')
IS_ARM32 := $(shell echo $(HOSTX) | $(EGREP) -v 64 | $(EGREP) -i -c -E 'arm|armhf|arm7l|eabihf')
IS_ARMV8 := $(shell echo $(HOSTX) | $(EGREP) -i -c -E 'aarch32|aarch64|arm64|armv8')
endif
$(info Here's what we found... IS_X86: $(IS_X86), IS_X64: $(IS_X64), IS_ARM32: $(IS_ARM32), IS_ARMV8: $(IS_ARMV8))
###########################################################
##### Test Program #####
###########################################################
# Hack to skip CPU feature tests for some recipes
DETECT_FEATURES ?= 1
ifeq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CXXFLAGS)),-DCRYPTOPP_DISABLE_ASM)
DETECT_FEATURES := 0
else ifeq ($(findstring clean,$(MAKECMDGOALS)),clean)
DETECT_FEATURES := 0
else ifeq ($(findstring distclean,$(MAKECMDGOALS)),distclean)
DETECT_FEATURES := 0
else ifeq ($(findstring distclean,$(MAKECMDGOALS)),trim)
DETECT_FEATURES := 0
endif
# Strip out -Wall, -Wextra and friends for feature testing
ifeq ($(DETECT_FEATURES),1)
TCXXFLAGS := $(filter-out -Wall -Wextra -Werror% -Wunused -Wconversion -Wp%, $(CXXFLAGS))
ifneq ($(strip $(TCXXFLAGS)),)
$(info Using testing flags: $(TCXXFLAGS))
endif
endif
# For the previous messages
$(info )
###########################################################
##### X86/X32/X64 Options #####
###########################################################
ifneq ($(IS_X86)$(IS_X64),00)
ifeq ($(DETECT_FEATURES),1)
SSE2_FLAG = -msse2
SSE3_FLAG = -msse3
SSSE3_FLAG = -mssse3
SSE41_FLAG = -msse4.1
SSE42_FLAG = -msse4.2
CLMUL_FLAG = -mpclmul
AESNI_FLAG = -maes
AVX_FLAG = -mavx
AVX2_FLAG = -mavx2
SHANI_FLAG = -msha
TPROG = TestPrograms/test_x86_sse2.cxx
TOPT = $(SSE2_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
CHACHA_FLAG = $(SSE2_FLAG)
else
SSE2_FLAG =
endif
TPROG = TestPrograms/test_x86_ssse3.cxx
TOPT = $(SSSE3_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
ARIA_FLAG = $(SSSE3_FLAG)
CHAM_FLAG = $(SSSE3_FLAG)
LEA_FLAG = $(SSSE3_FLAG)
SIMECK_FLAG = $(SSSE3_FLAG)
SIMON64_FLAG = $(SSSE3_FLAG)
SIMON128_FLAG = $(SSSE3_FLAG)
SPECK64_FLAG = $(SSSE3_FLAG)
SPECK128_FLAG = $(SSSE3_FLAG)
else
SSSE3_FLAG =
endif
TPROG = TestPrograms/test_x86_sse41.cxx
TOPT = $(SSE41_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
BLAKE2B_FLAG = $(SSE41_FLAG)
BLAKE2S_FLAG = $(SSE41_FLAG)
SIMON64_FLAG = $(SSE41_FLAG)
SPECK64_FLAG = $(SSE41_FLAG)
else
SSE41_FLAG =
endif
TPROG = TestPrograms/test_x86_sse42.cxx
TOPT = $(SSE42_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
CRC_FLAG = $(SSE42_FLAG)
else
SSE42_FLAG =
endif
TPROG = TestPrograms/test_x86_clmul.cxx
TOPT = $(CLMUL_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
GCM_FLAG = $(SSSE3_FLAG) $(CLMUL_FLAG)
else
CLMUL_FLAG =
endif
TPROG = TestPrograms/test_x86_aes.cxx
TOPT = $(AESNI_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
AES_FLAG = $(SSE41_FLAG) $(AESNI_FLAG)
SM4_FLAG = $(SSSE3_FLAG) $(AESNI_FLAG)
else
AESNI_FLAG =
endif
TPROG = TestPrograms/test_x86_avx.cxx
TOPT = $(AVX_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
# XXX_FLAG = $(AVX_FLAG)
else
AVX_FLAG =
endif
TPROG = TestPrograms/test_x86_avx2.cxx
TOPT = $(AVX2_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
CHACHA_AVX2_FLAG = $(AVX2_FLAG)
else
AVX2_FLAG =
endif
TPROG = TestPrograms/test_x86_sha.cxx
TOPT = $(SHANI_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
SHA_FLAG = $(SSE42_FLAG) $(SHANI_FLAG)
else
SHANI_FLAG =
endif
ifeq ($(SSE2_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
else ifeq ($(SSE3_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_SSE3
else ifeq ($(SSSE3_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_SSSE3
else ifeq ($(SSE41_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_SSE4
else ifeq ($(SSE42_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_SSE4
endif
ifneq ($(SSE42_FLAG),)
# Unusual GCC/Clang on Macports. It assembles AES, but not CLMUL.
# test_x86_clmul.s:15: no such instruction: 'pclmulqdq $0, %xmm1,%xmm0'
ifeq ($(CLMUL_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_CLMUL
endif
ifeq ($(AESNI_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_AESNI
endif
ifeq ($(AVX_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_AVX
else ifeq ($(AVX2_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_AVX2
else ifeq ($(SHANI_FLAG),)
CXXFLAGS += -DCRYPTOPP_DISABLE_SHANI
endif
endif
# DETECT_FEATURES
endif
# IS_X86, IS_X32 and IS_X64
endif
###########################################################
##### ARM A-32, Aach64 and NEON #####
###########################################################
ifneq ($(IS_ARM32)$(IS_ARMV8),00)
ifeq ($(DETECT_FEATURES),1)
ifeq ($(IS_ARM32),1)
ifneq ($(IS_IOS)$(IS_ANDROID),00)
NEON_FLAG =
else
NEON_FLAG = -march=armv7-a -mfloat-abi=$(FP_ABI) -mfpu=neon
endif
TPROG = TestPrograms/test_arm_neon.cxx
TOPT = $(NEON_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
ARIA_FLAG = $(NEON_FLAG)
AES_FLAG = $(NEON_FLAG)
CRC_FLAG = $(NEON_FLAG)
GCM_FLAG = $(NEON_FLAG)
BLAKE2B_FLAG = $(NEON_FLAG)
BLAKE2S_FLAG = $(NEON_FLAG)
CHACHA_FLAG = $(NEON_FLAG)
CHAM_FLAG = $(NEON_FLAG)
LEA_FLAG = $(NEON_FLAG)
SHA_FLAG = $(NEON_FLAG)
SIMECK_FLAG = $(NEON_FLAG)
SIMON64_FLAG = $(NEON_FLAG)
SIMON128_FLAG = $(NEON_FLAG)
SPECK64_FLAG = $(NEON_FLAG)
SPECK128_FLAG = $(NEON_FLAG)
SM4_FLAG = $(NEON_FLAG)
else
NEON_FLAG =
CXXFLAGS += -DCRYPTOPP_DISABLE_NEON
endif
# IS_NEON
endif
ifeq ($(IS_ARMV8),1)
ifeq ($(IS_IOS),1)
ASIMD_FLAG =
CRC_FLAG =
AES_FLAG =
PMUL_FLAG =
SHA_FLAG =
else
ASIMD_FLAG = -march=armv8-a
CRC_FLAG = -march=armv8-a+crc
AES_FLAG = -march=armv8-a+crypto
PMULL_FLAG = -march=armv8-a+crypto
SHA_FLAG = -march=armv8-a+crypto
endif
TPROG = TestPrograms/test_arm_acle.cxx
TOPT = $(ASIMD_FLAG)
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
ACLE_FLAG += -DCRYPTOPP_ARM_ACLE_AVAILABLE=1
else
CXXFLAGS += -DCRYPTOPP_ARM_ACLE_AVAILABLE=0
endif
TPROG = TestPrograms/test_arm_asimd.cxx
TOPT = $(ASIMD_FLAG)
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
ARIA_FLAG = $(ASIMD_FLAG)
BLAKE2B_FLAG = $(ASIMD_FLAG)
BLAKE2S_FLAG = $(ASIMD_FLAG)
CHACHA_FLAG = $(ASIMD_FLAG)
CHAM_FLAG = $(ASIMD_FLAG)
LEA_FLAG = $(ASIMD_FLAG)
NEON_FLAG = $(ASIMD_FLAG)
SIMECK_FLAG = $(ASIMD_FLAG)
SIMON64_FLAG = $(ASIMD_FLAG)
SIMON128_FLAG = $(ASIMD_FLAG)
SPECK64_FLAG = $(ASIMD_FLAG)
SPECK128_FLAG = $(ASIMD_FLAG)
SM4_FLAG = $(ASIMD_FLAG)
else
ASIMD_FLAG =
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
endif
TPROG = TestPrograms/test_arm_crc.cxx
TOPT = $(CRC_FLAG)
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifneq ($(strip $(HAVE_OPT)),0)
CRC_FLAG =
CXXFLAGS += -DCRYPTOPP_ARM_CRC32_AVAILABLE=0
endif
TPROG = TestPrograms/test_arm_aes.cxx
TOPT = $(AES_FLAG)
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifneq ($(strip $(HAVE_OPT)),0)
AES_FLAG =
CXXFLAGS += -DCRYPTOPP_ARM_AES_AVAILABLE=0
endif
TPROG = TestPrograms/test_arm_pmull.cxx
TOPT = $(PMULL_FLAG)
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifneq ($(strip $(HAVE_OPT)),0)
PMULL_FLAG =
CXXFLAGS += -DCRYPTOPP_ARM_PMULL_AVAILABLE=0
endif
TPROG = TestPrograms/test_arm_sha.cxx
TOPT = $(SHA_FLAG)
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifneq ($(strip $(HAVE_OPT)),0)
SHA_FLAG =
CXXFLAGS += -DCRYPTOPP_ARM_SHA_AVAILABLE=0
endif
TPROG = TestPrograms/test_arm_sm3.cxx
TOPT = -march=armv8.4-a+crypto
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
SM3_FLAG = -march=armv8.4-a+crypto
SM4_FLAG = -march=armv8.4-a+crypto
endif
TPROG = TestPrograms/test_arm_sha3.cxx
TOPT = -march=armv8.4-a+crypto
HAVE_OPT = $(shell $(CXX) $(CXXFLAGS) $(ACLE_FLAG) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l)
ifeq ($(strip $(HAVE_OPT)),0)
SHA3_FLAG = -march=armv8.4-a+crypto
SHA512_FLAG = -march=armv8.4-a+crypto
endif
# IS_ARMV8
endif
# DETECT_FEATURES
endif
# IS_ARM32, IS_ARMV8, IS_NEON
endif
###########################################################
##### Common #####
###########################################################
# No ASM for Travis testing
ifeq ($(findstring no-asm,$(MAKECMDGOALS)),no-asm)
ifeq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CXXFLAGS)),)
@ -178,7 +546,7 @@ endif # Valgrind
# Debug testing on GNU systems. Triggered by -DDEBUG.
# Newlib test due to http://sourceware.org/bugzilla/show_bug.cgi?id=20268
ifneq ($(filter -DDEBUG -DDEBUG=1,$(CXXFLAGS)),)
USING_GLIBCXX := $(shell $(CXX) -x c++ $(CXXFLAGS) -E adhoc.cpp.proto 2>&1 | $(EGREP) -i -c "__GLIBCXX__")
USING_GLIBCXX := $(shell $(CXX) $(CXXFLAGS) -E pch.cpp 2>&1 | $(EGREP) -i -c "__GLIBCXX__")
ifneq ($(USING_GLIBCXX),0)
ifeq ($(HAS_NEWLIB),0)
ifeq ($(findstring -D_GLIBCXX_DEBUG,$(CXXFLAGS)),)
@ -207,115 +575,34 @@ ifeq ($(findstring lean,$(MAKECMDGOALS)),lean)
endif # MAKECMDGOALS
endif # Dead code stripping
# Pickup ARMv7 and NEON. Do it after Android, iOS and Embedded flags have been set.
ifeq ($(IS_ARM),1)
IS_ARMv7 := $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -dM -E - 2>/dev/null | $(EGREP) -i -c '__ARM_ARCH 7')
ifeq ($(IS_ARMv7),1)
IS_NEON := 1
else
IS_NEON := $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -dM -E - 2>/dev/null | $(EGREP) -i -c -E '\<__ARM_NEON\>')
endif
endif
# ARMv7-a
ifeq ($(IS_ARMv7),1)
ifeq ($(findstring -march=armv7-a,$(CXXFLAGS)),)
NEON_FLAG = -march=armv7-a
GCM_FLAG = -march=armv7-a
ARIA_FLAG = -march=armv7-a
BLAKE2_FLAG = -march=armv7-a
endif
endif
# NEON
ifeq ($(IS_NEON),1)
ifeq ($(findstring -mfpu=neon,$(CXXFLAGS)),)
NEON_FLAG += -mfpu=neon
GCM_FLAG += -mfpu=neon
ARIA_FLAG += -mfpu=neon
BLAKE2_FLAG += -mfpu=neon
SIMON_FLAG += -mfpu=neon
SPECK_FLAG += -mfpu=neon
ifeq ($(IS_ANDROID),1)
ifeq ($(findstring -mfloat-abi=softfp,$(CXXFLAGS)),)
NEON_FLAG += -mfloat-abi=softfp
GCM_FLAG += -mfloat-abi=softfp
ARIA_FLAG += -mfloat-abi=softfp
BLAKE2_FLAG += -mfloat-abi=softfp
SIMON_FLAG += -mfloat-abi=softfp
SPECK_FLAG += -mfloat-abi=softfp
endif
endif
endif
endif
# ARMv8-a
ifneq ($(IS_ARMv8),0)
IS_NEON := $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -march=armv8-a -dM -E - 2>/dev/null | $(EGREP) -i -c __ARM_NEON)
ifeq ($(IS_NEON),1)
ARIA_FLAG = -march=armv8-a
BLAKE2_FLAG = -march=armv8-a
NEON_FLAG = -march=armv8-a
SIMON_FLAG = -march=armv8-a
SPECK_FLAG = -march=armv8-a
endif
HAVE_CRC := $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -march=armv8-a+crc -dM -E - 2>/dev/null | $(EGREP) -i -c __ARM_FEATURE_CRC32)
ifeq ($(HAVE_CRC),1)
CRC_FLAG = -march=armv8-a+crc
endif
HAVE_CRYPTO := $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -march=armv8-a+crypto -dM -E - 2>/dev/null | $(EGREP) -i -c __ARM_FEATURE_CRYPTO)
ifeq ($(HAVE_CRYPTO),1)
AES_FLAG = -march=armv8-a+crypto
GCM_FLAG = -march=armv8-a+crypto
SHA_FLAG = -march=armv8-a+crypto
endif
endif
# i686 and x86_64
ifneq ($(IS_i686)$(IS_x86_64),00)
HAVE_SSSE3 = $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -mssse3 -dM -E - 2>/dev/null | $(EGREP) -i -c __SSSE3__)
ifeq ($(HAVE_SSSE3),1)
ARIA_FLAG = -mssse3
SSSE3_FLAG = -mssse3
SIMON_FLAG = -mssse3
SPECK_FLAG = -mssse3
endif
HAVE_SSE4 = $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -msse4.1 -dM -E - 2>/dev/null | $(EGREP) -i -c __SSE4_1__)
ifeq ($(HAVE_SSE4),1)
SIMON_FLAG = -msse4.1
SPECK_FLAG = -msse4.1
endif
HAVE_SSE4 = $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -msse4.2 -dM -E - 2>/dev/null | $(EGREP) -i -c __SSE4_2__)
ifeq ($(HAVE_SSE4),1)
BLAKE2_FLAG = -msse4.2
CRC_FLAG = -msse4.2
endif
HAVE_CLMUL = $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -mssse3 -mpclmul -dM -E - 2>/dev/null | $(EGREP) -i -c __PCLMUL__ )
ifeq ($(HAVE_CLMUL),1)
GCM_FLAG = -mssse3 -mpclmul
endif
HAVE_AES = $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -msse4.1 -maes -dM -E - 2>/dev/null | $(EGREP) -i -c __AES__)
ifeq ($(HAVE_AES),1)
AES_FLAG = -msse4.1 -maes
endif
HAVE_SHA = $(shell echo | $(CXX) -x c++ $(CXXFLAGS) -msse4.2 -msha -dM -E - 2>/dev/null | $(EGREP) -i -c __SHA__)
ifeq ($(HAVE_SHA),1)
SHA_FLAG = -msse4.2 -msha
endif
endif
###########################################################
##### Source and object files #####
###########################################################
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(sort $(wildcard *.cpp)))
SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp cryptlib_bds.cpp,$(sort $(wildcard *.cpp)))
# For Makefile.am; resource.h is Windows
INCL := $(filter-out resource.h,$(sort $(wildcard *.h)))
# Cryptogams AES for ARMv4 and above. We couple to ARMv7.
# Avoid iOS. It cannot consume the assembly.
ifeq ($(IS_ARM32),1)
ifneq ($(IS_IOS),1)
CRYPTOGAMS_AES_FLAG = -march=armv7-a
CRYPTOGAMS_AES_FLAG += -Wa,--noexecstack
SRCS += aes_armv4.S
endif
endif
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
OBJS := $(SRCS:.cpp=.o)
OBJS := $(OBJS:.S=.o)
# List test.cpp first to tame C++ static initialization problems.
TESTSRCS := adhoc.cpp test.cpp bench1.cpp bench2.cpp validat0.cpp validat1.cpp validat2.cpp validat3.cpp validat4.cpp datatest.cpp regtest1.cpp regtest2.cpp regtest3.cpp fipsalgt.cpp dlltest.cpp
TESTSRCS := adhoc.cpp test.cpp bench1.cpp bench2.cpp bench3.cpp datatest.cpp dlltest.cpp fipsalgt.cpp validat0.cpp validat1.cpp validat2.cpp validat3.cpp validat4.cpp validat5.cpp validat6.cpp validat7.cpp validat8.cpp validat9.cpp validat10.cpp regtest1.cpp regtest2.cpp regtest3.cpp regtest4.cpp
TESTINCL := bench.h factory.h validate.h
# Test objects
TESTOBJS := $(TESTSRCS:.cpp=.o)
LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS))
@ -337,11 +624,15 @@ SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR)
SOLIB_FLAGS=-Wl,-soname,libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
endif # HAS_SOLIB_VERSION
###########################################################
##### Targets and Recipes #####
###########################################################
# Default builds program with static library only
.PHONY: default
default: cryptest.exe
.PHONY: all
.PHONY: all static dynamic
all: static dynamic cryptest.exe
ifneq ($(IS_IOS),0)
@ -363,10 +654,10 @@ lean: static dynamic cryptest.exe
.PHONY: clean
clean:
-$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(AOSP_CPU_OBJ) $(TESTOBJS) $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS)
-$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(AOSP_CPU_OBJ) rdrand-*.o $(TESTOBJS) $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS)
@-$(RM) libcryptopp.a libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a
@-$(RM) libcryptopp.so libcryptopp.so$(SOLIB_COMPAT_SUFFIX) libcryptopp.so$(SOLIB_VERSION_SUFFIX)
@-$(RM) cryptest.exe dlltest.exe cryptest.import.exe cryptest.info ct rdrand-???.o
@-$(RM) cryptest.exe dlltest.exe cryptest.import.exe cryptest.info ct et
@-$(RM) *.la *.lo *.gcov *.gcno *.gcda *.stackdump core core-*
@-$(RM) /tmp/adhoc.exe
@-$(RM) -r /tmp/cryptopp_test/
@ -374,31 +665,46 @@ clean:
@-$(RM) -r *.dylib.dSYM/
@-$(RM) -r cov-int/
.PHONY: distclean
distclean: clean
-$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps benchmarks.html cryptest.txt cryptest-*.txt
@-$(RM) cryptopp.tgz *.o *.bc *.ii *~
@-$(RM) -r $(SRCS:.cpp=.obj) cryptlib.lib cryptest.exe *.suo *.sdf *.pdb Win32/ x64/ ipch/
.PHONY: autotools-clean
autotools-clean:
@-$(RM) -f configure.ac configure configure.in Makefile.am Makefile.in Makefile
@-$(RM) -f config.guess config.status config.sub depcomp install-sh compile
@-$(RM) -f stamp-h1 ar-lib *.m4 local.* lt*.sh missing libtool* libcryptopp.pc*
@-$(RM) -f config.guess config.status config.sub config.h.in compile depcomp
@-$(RM) -f install-sh stamp-h1 ar-lib *.lo *.la *.m4 local.* lt*.sh missing
@-$(RM) -f cryptest cryptestcwd libtool* libcryptopp.la libcryptopp.pc*
@-$(RM) -rf m4/ auto*.cache/ .deps/ .libs/
@-$(RM) -r TestCoverage/
@-$(RM) cryptopp$(LIB_VER)\.*
@-$(RM) CryptoPPRef.zip
.PHONY: cmake-clean
cmake-clean:
@-$(RM) -f cryptopp-config.cmake CMakeLists.txt
@-$(RM) -rf cmake_build/
.PHONY: distclean
distclean: clean autotools-clean cmake-clean
-$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps benchmarks.html cryptest.txt
@-$(RM) cryptest-*.txt cryptopp.tgz libcryptopp.pc *.o *.bc *.ii *~
@-$(RM) -r cryptlib.lib cryptest.exe *.suo *.sdf *.pdb Win32/ x64/ ipch/
@-$(RM) -r $(LIBOBJS:.o=.obj) $(TESTOBJS:.o=.obj)
@-$(RM) -r $(LIBOBJS:.o=.lst) $(TESTOBJS:.o=.lst)
@-$(RM) -r TestCoverage/ ref*/
@-$(RM) cryptopp$(LIB_VER)\.* CryptoPPRef.zip
# Install cryptest.exe, libcryptopp.a and libcryptopp.so.
# The library install was broken-out into its own recipe at GH #653.
.PHONY: install
install:
@-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
ifneq ($(wildcard cryptest.exe),)
install: cryptest.exe install-lib
@-$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) cryptest.exe $(DESTDIR)$(BINDIR)
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestData
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
$(INSTALL_DATA) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData
$(INSTALL_DATA) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
endif
# A recipe to install only the library, and not cryptest.exe. Also
# see https://github.com/weidai11/cryptopp/issues/653.
.PHONY: install-lib
install-lib:
@-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp
$(INSTALL_DATA) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
ifneq ($(wildcard libcryptopp.a),)
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) libcryptopp.a $(DESTDIR)$(LIBDIR)
@ -435,15 +741,15 @@ ifeq ($(HAS_SOLIB_VERSION),1)
libcryptopp.so: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
endif
libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS)
$(CXX) -shared $(SOLIB_FLAGS) -o $@ $(strip $(CXXFLAGS)) -Wl,--exclude-libs,ALL $(LIBOBJS) $(LDFLAGS) $(LDLIBS)
libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS) $(AOSP_CPU_OBJ)
$(CXX) -shared $(SOLIB_FLAGS) -o $@ $(strip $(CXXFLAGS)) -Wl,--exclude-libs,ALL $(LIBOBJS) $(AOSP_CPU_OBJ) $(LDFLAGS) $(LDLIBS)
ifeq ($(HAS_SOLIB_VERSION),1)
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
endif
libcryptopp.dylib: $(LIBOBJS)
$(CXX) -dynamiclib -o $@ $(strip $(CXXFLAGS)) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS)
libcryptopp.dylib: $(LIBOBJS) $(AOSP_CPU_OBJ)
$(CXX) -dynamiclib -o $@ $(strip $(CXXFLAGS)) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS) $(AOSP_CPU_OBJ)
cryptest.exe: libcryptopp.a $(TESTOBJS)
$(CXX) -o $@ $(strip $(CXXFLAGS)) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
@ -451,13 +757,17 @@ cryptest.exe: libcryptopp.a $(TESTOBJS)
# Used to generate list of source files for Autotools, CMakeList and Android.mk
.PHONY: sources
sources:
$(info Library sources: $(filter-out $(TESTSRCS),$(SRCS)))
$(info ***** Library sources *****)
$(info $(filter-out $(TESTSRCS),$(SRCS)))
$(info )
$(info Library headers: $(filter-out $(TESTINCL),$(INCL)))
$(info ***** Library headers *****)
$(info $(filter-out $(TESTINCL),$(INCL)))
$(info )
$(info Test sources: $(TESTSRCS))
$(info ***** Test sources *****)
$(info $(TESTSRCS))
$(info )
$(info Test headers: $(TESTINCL))
$(info ***** Test headers *****)
$(info $(TESTINCL))
adhoc.cpp: adhoc.cpp.proto
ifeq ($(wildcard adhoc.cpp),)
@ -471,55 +781,108 @@ ifeq ($(wildcard GNUmakefile.deps),GNUmakefile.deps)
-include GNUmakefile.deps
endif # Dependencies
# Cryptogams ARM asm implementation.
aes_armv4.o : aes_armv4.S
$(CXX) $(strip $(CXXFLAGS) -fpermissive $(CRYPTOGAMS_AES_FLAG) -c) $<
cpu-features.o: cpu-features.h cpu-features.c
$(CXX) $(strip $(CXXFLAGS) -fpermissive -c) cpu-features.c
# SSE4.2 or NEON available
aria-simd.o : aria-simd.cpp
# SSSE3 or NEON available
aria_simd.o : aria_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(ARIA_FLAG) -c) $<
# SSE4.2 or ARMv8a available
blake2-simd.o : blake2-simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(BLAKE2_FLAG) -c) $<
# SSE, NEON or POWER7 available
blake2s_simd.o : blake2s_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(BLAKE2S_FLAG) -c) $<
# SSE2 on i586
cpu.o : cpu.cpp
$(CXX) $(strip $(CXXFLAGS) $(CPU_FLAG) -c) $<
# SSE, NEON or POWER8 available
blake2b_simd.o : blake2b_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(BLAKE2B_FLAG) -c) $<
# SSE2 or NEON available
chacha_simd.o : chacha_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(CHACHA_FLAG) -c) $<
# AVX2 available
chacha_avx.o : chacha_avx.cpp
$(CXX) $(strip $(CXXFLAGS) $(CHACHA_AVX2_FLAG) -c) $<
# SSSE3 available
cham_simd.o : cham_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(CHAM_FLAG) -c) $<
# Power9 available
darn.o : darn.cpp
$(CXX) $(strip $(CXXFLAGS) $(DARN_FLAG) -c) $<
# SSE2 on i686
donna_sse.o : donna_sse.cpp
$(CXX) $(strip $(CXXFLAGS) $(SSE2_FLAG) -c) $<
# SSE2 on i686
sse_simd.o : sse_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SSE2_FLAG) -c) $<
# SSE4.2 or ARMv8a available
crc-simd.o : crc-simd.cpp
crc_simd.o : crc_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(CRC_FLAG) -c) $<
# PCLMUL or ARMv7a/ARMv8a available
gcm-simd.o : gcm-simd.cpp
gcm_simd.o : gcm_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(GCM_FLAG) -c) $<
# SSSE3 available
lea_simd.o : lea_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(LEA_FLAG) -c) $<
# NEON available
neon-simd.o : neon-simd.cpp
neon_simd.o : neon_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(NEON_FLAG) -c) $<
# AESNI or ARMv7a/ARMv8a available
rijndael-simd.o : rijndael-simd.cpp
rijndael_simd.o : rijndael_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(AES_FLAG) -c) $<
# SSE4.2/SHA-NI or ARMv8a available
sha-simd.o : sha-simd.cpp
sha_simd.o : sha_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SHA_FLAG) -c) $<
# SSE4.2/SHA-NI or ARMv8a available
shacal2-simd.o : shacal2-simd.cpp
shacal2_simd.o : shacal2_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SHA_FLAG) -c) $<
# SSSE3 or NEON available
simon-simd.o : simon-simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SIMON_FLAG) -c) $<
simeck_simd.o : simeck_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SIMECK_FLAG) -c) $<
# SSSE3 or NEON available
speck-simd.o : speck-simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SPECK_FLAG) -c) $<
# SSE4.1, NEON or POWER7 available
simon64_simd.o : simon64_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SIMON64_FLAG) -c) $<
# SSSE3, NEON or POWER8 available
simon128_simd.o : simon128_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SIMON128_FLAG) -c) $<
# SSE4.1, NEON or POWER7 available
speck64_simd.o : speck64_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SPECK64_FLAG) -c) $<
# SSSE3, NEON or POWER8 available
speck128_simd.o : speck128_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SPECK128_FLAG) -c) $<
# ARMv8.4 available
sm3_simd.o : sm3_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SM3_FLAG) -c) $<
# AESNI available
sm4_simd.o : sm4_simd.cpp
$(CXX) $(strip $(CXXFLAGS) $(SM4_FLAG) -c) $<
%.o : %.cpp
$(CXX) $(strip $(CXXFLAGS) -c) $<
GNUmakefile.deps:
$(CXX) $(strip $(CXXFLAGS) -MM) *.cpp > GNUmakefile.deps
.PHONY: dep deps depend
dep deps depend GNUmakefile.deps:
$(CXX) $(strip $(CXXFLAGS) -DCRYPTOPP_DISABLE_ASM) -MM *.cpp > GNUmakefile.deps

View File

@ -4,7 +4,8 @@ The History file contains the items that comprise the release notes. The
items in the list below used to be in Readme.txt. Readme.txt now contans the
last several releases.
1.0 - First public release. Withdrawn at the request of RSA DSI.
1.0 - First public release
- Withdrawn at the request of RSA DSI over patent claims
- included Blowfish, BBS, DES, DH, Diamond, DSA, ElGamal, IDEA,
MD5, RC4, RC5, RSA, SHA, WAKE, secret sharing, DEFLATE compression
- had a serious bug in the RSA key generation code.
@ -432,3 +433,22 @@ last several releases.
- remove s_nullNameValuePairs from unnamed namespace
- ported to MSVC 2017, Xcode 9.3, Sun Studio 12.5, GCC 8.0.1,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
8.0.0 - December 28, 2018
- major release, recompile of programs required
- expanded community input and support
* 54 unique contributors as of this release
- add x25519 key exchange and ed25519 signature scheme
- add limited Asymmetric Key Package support from RFC 5958
- add Power9 DARN random number generator support
- add CHAM, HC-128, HC-256, Hight, LEA, Rabbit, Simeck
- fix FixedSizeAllocatorWithCleanup may be unaligned on some platforms
- cutover to GNU Make-based cpu feature tests
- rename files with dashes to underscores
- fix LegacyDecryptor and LegacyDecryptorWithMAC use wrong MAC
- fix incorrect AES/CBC decryption on Windows
- avoid Singleton<T> when possible, avoid std::call_once completely
- fix SPARC alignment problems due to GetAlignmentOf<T>() on word64
- add ARM AES asm implementation from Cryptogams
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support

View File

@ -1,5 +1,5 @@
Crypto++: free C++ Class Library of Cryptographic Schemes
Version 7.0 - APR/08/2018
Version 8.0 - DEC/28/2018
Crypto++ Library is a free C++ class library of cryptographic schemes.
Currently the library contains the following algorithms:
@ -39,11 +39,12 @@ Currently the library contains the following algorithms:
padding schemes for public-key PKCS#1 v2.0, OAEP, PSS, PSSR, IEEE P1363
systems EMSA2 and EMSA5
Diffie-Hellman (DH), Unified Diffie-Hellman
key agreement schemes (DH2), Menezes-Qu-Vanstone (MQV), Hashed MQV (HMQV),
Diffie-Hellman (DH), Unified Diffie-Hellman (DH2),
key agreement schemes Menezes-Qu-Vanstone (MQV), Hashed MQV (HMQV),
Fully Hashed MQV (FHMQV), LUCDIF, XTR-DH
elliptic curve cryptography ECDSA, Determinsitic ECDSA, ECNR, ECIES, ECDH, ECMQV
elliptic curve cryptography ECDSA, Determinsitic ECDSA, ed25519, ECNR, ECIES,
ECDH, ECMQV, x25519
insecure or obsolescent MD2, MD4, MD5, Panama Hash, DES, ARC4, SEAL
algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2,
@ -53,7 +54,7 @@ algorithms retained for backwards 3.0, WAKE-OFB, DESX (DES-XEX3), RC2,
Other features include:
* pseudo random number generators (PRNG): ANSI X9.17 appendix C, RandomPool,
VIA Padlock, RDRAND, RDSEED, NIST Hash and HMAC DRBGs
DARN, VIA Padlock, RDRAND, RDSEED, NIST Hash and HMAC DRBGs
* password based key derivation functions: PBKDF1 and PBKDF2 from PKCS #5,
PBKDF from PKCS #12 appendix B, HKDF from RFC 5869, Scrypt from RFC 7914
* Shamir's secret sharing scheme and Rabin's information dispersal algorithm
@ -91,13 +92,13 @@ The following compilers are supported for this release. Please visit
http://www.cryptopp.com the most up to date build instructions and porting notes.
* Visual Studio 2003 - 2017
* GCC 3.3 - 8.0
* GCC 3.3 - 9.0
* Apple Clang 4.3 - 9.3
* LLVM Clang 2.9 - 4.0
* C++Builder 2010
* LLVM Clang 2.9 - 7.0
* C++Builder 2015
* Intel C++ Compiler 9 - 16.0
* Sun Studio 12u1 - 12.5
* IBM XL C/C++ 10.0 - 13.1
* Sun Studio 12u1 - 12.6
* IBM XL C/C++ 10.0 - 13.3
*** Important Usage Notes ***
@ -282,6 +283,25 @@ documentation is one of the highest returns on investment.
The items in this section comprise the most recent history. Please see History.txt
for the record back to Crypto++ 1.0.
8.0.0 - December 28, 2018
- major release, recompile of programs required
- expanded community input and support
* 54 unique contributors as of this release
- add x25519 key exchange and ed25519 signature scheme
- add limited Asymmetric Key Package support from RFC 5958
- add Power9 DARN random number generator support
- add CHAM, HC-128, HC-256, Hight, LEA, Rabbit, Simeck
- fix FixedSizeAllocatorWithCleanup may be unaligned on some platforms
- cutover to GNU Make-based cpu feature tests
- rename files with dashes to underscores
- fix LegacyDecryptor and LegacyDecryptorWithMAC use wrong MAC
- fix incorrect AES/CBC decryption on Windows
- avoid Singleton<T> when possible, avoid std::call_once completely
- fix SPARC alignment problems due to GetAlignmentOf<T>() on word64
- add ARM AES asm implementation from Cryptogams
- remove CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS support
7.0.0 - April 8, 2018
- major release, recompile of programs required
- expanded community input and support
@ -340,67 +360,6 @@ for the record back to Crypto++ 1.0.
- ported to MSVC 2017, Xcode 8.1, Sun Studio 12.5, GCC 7.3,
MacPorts GCC 7.0, Clang 4.0, Intel C++ 17.00, IBM XL C/C++ 13.1
5.6.5 - October 11, 2016
- maintenance release, recompile of programs recommended
- expanded community input and support
* 25 unique contributors as of this release
- fixed CVE-2016-7420 (Issue 277, document NDEBUG for production/release)
- fixed CVE-2016-7544 (Issue 302, avoid _malloca and _freea)
- shipped library in recommended state
* backwards compatibility achieved with <config.compat>
- Visual Studio project file cleanup
* improved X86 and X64 MSBuild support
* added ARM-based MSBuild awareness
- improved Testing and QA
* expanded platforms and compilers
* expanded Coverity into OS X and Windows platforms
* added Windows test scripts using Strawberry Perl
- ported to MSVC 2015 SP3, Xcode 7.3, Sun Studio 12.5, GCC 7.0,
MacPorts GCC 7.0, Clang 3.8, Intel C++ 17.00
5.6.4 - September 11, 2016
- maintenance release, honored API/ABI/Versioning requirements
- expanded community input and support
* 22 unique contributors for this release
- fixed CVE-2016-3995
- changed SHA3 to FIPS 202 (F1600, XOF d=0x06)
- added Keccak (F1600, XOF d=0x01)
- added ChaCha (ChaCha8/12/20)
- added HMQV and FHMQV
* Hashed and Fully Hashed MQV
- added BLAKE2 (BLAKE2s and BLAKE2b)
* C++, SSE2, SSE4, ARM NEON and ARMv8 ASIMD
- added CRC32-C
* C/C++, Amd64 CRC, and ARMv8 CRC
- improved Rabin-William signatures
* Tweaked roots <em>e</em> and <em>f</em>
- improved C++11 support
* atomics, threads and fences
* alginof, alignas
* constexpr
* noexcept
- improved GCM mode
* ARM NEON and ARMv8 ASIMD
* ARMv8 carry-less multiply
- improved Windows 8 and 10 support
* Windows Phone, Universal Windows Platform, Windows Store
- improved MIPS, ARMv7 and ARMv8 support
* added scripts setenv-{android|embedded|ios}.sh for GNUmakefile-cross
* aggressive use of -march=<arch> and -mfpu=<fpu> in cryptest.sh
- improved build systems
* Visual Studio 2010 default
* added CMake support (lacks FindCryptopp.cmake)
* archived VC++ 5/0/6.0 project files (vc60.zip)
* archived VS2005 project files (vs2005.zip)
* archived Borland project files (bds10.zip)
- improved Testing and QA
* expanded platforms and compilers
* added code generation tests based on CPU features
* added C++03, C++11, C++14, C++17 testing
* added -O3, -O5, -Ofast and -Os testing
- ported to MSVC 2015 SP3, Xcode 9.0, Sun Studio 12.5, GCC 7.0,
MacPorts GCC 7.0, Clang 3.8, Intel C++ 17.00
June 2015 - Changing of the guard. Wei Dai turned the library over to the
community. The first community release was Crypto++ 5.6.3. Wei is
no longer involved with the daily operations of the project. Wei

View File

@ -0,0 +1 @@
nCBţ pIbź_¤_ĺ|źâ+"w˙¶¶†Ž˝í#Aýíż‡„nŢmÖéŠČ‡ű%±kXřťąRňłüw`Ză^s.+ÚÚµ<C39A>ř„Š`ŠÝBf]zó•}¦R`}\ŘdiśbfttÉ^ř˛

Binary file not shown.

View File

@ -0,0 +1 @@
302E020100300506032B65700422042098C59D3F097FB23D44BA90791281B453258D691A55AF5CE4F1EE712FDF91AE6D

View File

@ -0,0 +1 @@
302E020100300506032B65700422042030BF776A497D7F1E0E26AC4FB03F5BE7E187DDFEFB914CD292A6FEDB7F70CE6B

View File

@ -0,0 +1 @@
3053020101300506032B6570042204206861FD53C7643DABDCDF4C3969CE44A156BAC261242A5AAEC140EDE510071C6CA12303210029CF90E6C1CF1ADC7105720303B2EE303412D2B682C6FEEF3D8736A286B2E27F

View File

@ -0,0 +1 @@
302E020100300506032B656E0422042030D407BB0CC97D0EC493BDB00A4A8EFA06A50D2388F5BA62947030E7D9873F49

View File

@ -0,0 +1 @@
302E020100300506032B656E042204202818E54DE6B88EEF3E99E25042CB98E69373B222E4C1E8B3FB10AC9B26C1007B

View File

@ -0,0 +1 @@
3053020101300506032B656E04220420A00FADD6D29BE764B851F64F7620E80B700DF65914BED31E486362281BB5D061A123032100E9AD4CC54DAA36F312D98B253854F0076E2BC26FCE5802B3AC79A5B59B3D2C4F

View File

@ -0,0 +1,7 @@
#include <cstddef>
int main(int argc, char* argv[])
{
enum {N = (sizeof(std::size_t) == 4 ? 4 : -1)};
int x[N];
return 0;
}

View File

@ -0,0 +1,7 @@
#include <cstddef>
int main(int argc, char* argv[])
{
enum {N = (sizeof(std::size_t) == 8 ? 8 : -1)};
int x[N];
return 0;
}

View File

@ -0,0 +1,5 @@
#include <arm_acle.h>
int main(int argc, char* argv[])
{
return 0;
}

View File

@ -0,0 +1,19 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
uint8x16_t x={0};
x=vaeseq_u8(x,x);
x=vaesmcq_u8(x);
x=vaesdq_u8(x,x);
x=vaesimcq_u8(x);
return 0;
}

View File

@ -0,0 +1,16 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
uint32x4_t x={0};
x=veorq_u32(x,x);
return 0;
}

View File

@ -0,0 +1,23 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
uint32_t w=0xffffffff;
w = __crc32w(w,w);
w = __crc32h(w,w);
w = __crc32b(w,w);
w = __crc32cw(w,w);
w = __crc32ch(w,w);
w = __crc32cb(w,w);
return 0;
}

View File

@ -0,0 +1,9 @@
#include <arm_neon.h>
#include <stdint.h>
int main(int argc, char* argv[])
{
uint32x4_t x={0};
x=veorq_u32(x,x);
return 0;
}

View File

@ -0,0 +1,22 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
const poly64_t a=0x60606060, b=0x90909090, c=0xb0b0b0b0;
const poly64x2_t d={0x60606060,0x90909090};
const poly8x16_t e={0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0};
const poly128_t r1 = vmull_p64(a, b);
const poly128_t r2 = vmull_high_p64(d, d);
return 0;
}

View File

@ -0,0 +1,21 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
uint32x4_t y = {0};
y=vsha1cq_u32(y,0,y);
y=vsha1mq_u32(y,1,y);
y=vsha1pq_u32(y,2,y);
y=vsha256hq_u32(y, y, y);
y=vsha256h2q_u32(y, y, y);
y=vsha256su1q_u32(y, y, y);
return 0;
}

View File

@ -0,0 +1,29 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
// SM4 block cipher
uint32x4_t x;
x=vsm4ekeyq_u32(x,x);
x=vsm4eq_u32(x,x);
// SM3 hash
uint32x4_t y;
y=vsm3ss1q_u32(x,y,y);
y=vsm3tt1aq_u32(x,y,y,3);
y=vsm3tt1bq_u32(x,y,y,1);
y=vsm3tt2aq_u32(x,y,y,2);
y=vsm3tt2bq_u32(x,y,y,3);
y=vsm3partw1q_u32(x,y,y);
y=vsm3partw2q_u32(x,y,y);
return 0;
}

View File

@ -0,0 +1,29 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
// SM4 block cipher
uint32x4_t x;
x=vsm4ekeyq_u32(x,x);
x=vsm4eq_u32(x,x);
// SM3 hash
uint32x4_t y;
y=vsm3ss1q_u32(x,y,y);
y=vsm3tt1aq_u32(x,y,y,3);
y=vsm3tt1bq_u32(x,y,y,1);
y=vsm3tt2aq_u32(x,y,y,2);
y=vsm3tt2bq_u32(x,y,y,3);
y=vsm3partw1q_u32(x,y,y);
y=vsm3partw2q_u32(x,y,y);
return 0;
}

View File

@ -0,0 +1,23 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
// SM3 hash
uint32x4_t y;
y=vsm3ss1q_u32(x,y,y);
y=vsm3tt1aq_u32(x,y,y,3);
y=vsm3tt1bq_u32(x,y,y,1);
y=vsm3tt2aq_u32(x,y,y,2);
y=vsm3tt2bq_u32(x,y,y,3);
y=vsm3partw1q_u32(x,y,y);
y=vsm3partw2q_u32(x,y,y);
return 0;
}

View File

@ -0,0 +1,18 @@
#include <arm_neon.h>
#include <stdint.h>
// test_acle.h determines if this is available. Then,
// -DCRYPTOPP_ARM_ACLE_AVAILABLE=0 is added to CXXFLAGS
// if the ACLE header is not available.
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <arm_acle.h>
#endif
int main(int argc, char* argv[])
{
// SM4 block cipher
uint32x4_t x;
x=vsm4ekeyq_u32(x,x);
x=vsm4eq_u32(x,x);
return 0;
}

View File

@ -0,0 +1,6 @@
#include <string>
int main(int argc, char* argv[])
{
unsigned int x=0;
return x;
}

View File

@ -0,0 +1,31 @@
// Most Clang cannot handle mixed asm with positional arguments, where the
// body is Intel style with no prefix and the templates are AT&T style.
// Also see https://bugs.llvm.org/show_bug.cgi?id=39895 .
#include <cstddef>
int main(int argc, char* argv[])
{
size_t ret = 1, N = 1;
asm __volatile__
(
#if defined(__amd64__) || defined(__x86_64__)
".intel_syntax noprefix ;\n"
"xor rsi, rsi ;\n"
"neg %1 ;\n"
"inc %1 ;\n"
"push %1 ;\n"
"pop rax ;\n"
".att_syntax prefix ;\n"
: "=a" (ret) : "c" (N) : "%rsi"
#else
".intel_syntax noprefix ;\n"
"xor esi, esi ;\n"
"neg %1 ;\n"
"inc %1 ;\n"
"push %1 ;\n"
"pop eax ;\n"
".att_syntax prefix ;\n"
: "=a" (ret) : "c" (N) : "%esi"
#endif
);
return (int)ret;
}

View File

@ -0,0 +1,8 @@
#include <string>
int main(int argc, char* argv[])
{
#ifndef __NEWLIB__
XXX
#endif
return 0;
}

View File

@ -0,0 +1,26 @@
#include <altivec.h>
int main(int argc, char* argv[])
{
#if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
__vector unsigned char x = {1,2,3,4,5,6,7,8};
x=__vcipher(x,x);
x=__vcipherlast(x,x);
x=__vncipher(x,x);
x=__vncipherlast(x,x);
#elif defined(__clang__)
__vector unsigned long long x = {1,2};
x=__builtin_altivec_crypto_vcipher(x,x);
x=__builtin_altivec_crypto_vcipherlast(x,x);
x=__builtin_altivec_crypto_vncipher(x,x);
x=__builtin_altivec_crypto_vncipherlast(x,x);
#elif defined(__GNUC__)
__vector unsigned long long x = {1,2};
x=__builtin_crypto_vcipher(x,x);
x=__builtin_crypto_vcipherlast(x,x);
x=__builtin_crypto_vncipher(x,x);
x=__builtin_crypto_vncipherlast(x,x);
#else
int XXX[-1];
#endif
return 0;
}

View File

@ -0,0 +1,8 @@
#include <altivec.h>
int main(int argc, char* argv[])
{
__vector unsigned char x;
x=vec_ld(0, (unsigned char*)argv[0]);
x=vec_add(x,x);
return 0;
}

View File

@ -0,0 +1,41 @@
#include <altivec.h>
// This follows ppc_simd.h. XLC compilers for POWER7 use vec_xlw4 and
// vec_xstw4. Some XLC compilers for POWER7 and above use vec_xl and
// vec_xst. The way to tell the difference is, XLC compilers version
// 13.0 and earlier use use vec_xlw4 and vec_xstw4 XLC compilers 13.1
// and later are use vec_xl and vec_xst. The open question is, how to
// handle early Clang compilers for POWER7. We know the latest Clang
// compilers support vec_xl and vec_xst. Also see
// https://www-01.ibm.com/support/docview.wss?uid=swg21683541
#if defined(__xlc__) && (__xlc__ < 0x0d01)
# define __early_xlc__ 1
#endif
#if defined(__xlC__) && (__xlC__ < 0x0d01)
# define __early_xlC__ 1
#endif
int main(int argc, char* argv[])
{
__vector unsigned char x;
unsigned char res[16];
#if defined(_ARCH_PWR7) && (defined(__early_xlc__) || defined(__early_xlC__))
x=vec_xlw4(0, (unsigned char*)argv[0]);
x=vec_add(x,x);
vec_xstw4(x, 0, res);
#elif defined(_ARCH_PWR7) && (defined(__xlc__) || defined(__xlC__) || defined(__clang__))
x=vec_xl(0, (unsigned char*)argv[0]);
x=vec_add(x,x);
vec_xst(x, 0, res);
#elif defined(_ARCH_PWR7) && defined(__GNUC__)
x=vec_vsx_ld(0, (unsigned char*)argv[0]);
x=vec_add(x,x);
vec_vsx_st(x, 0, res);
#else
int XXX[-1];
#endif
return 0;
}

View File

@ -0,0 +1,7 @@
#include <altivec.h>
int main(int argc, char* argv[])
{
__vector unsigned long long z = {1, 2};
z=vec_add(z,z);
return 0;
}

View File

@ -0,0 +1,36 @@
// The problem we have here is, it appears only GCC 7.0 and above
// support Power9 builtins. Clang 7.0 has support for some (all?)
// assembly instructions but we don't see builtin support. We can't
// determine the state of XLC. Searching IBM's website for
// terms like 'darn' 'random number' is returning irrelevant hits.
// Searching with Google from the outside returns 0 hits.
//
// The support disconnect means we may report Power9 as unavailable
// and support DARN at the same time. We get into that state because
// we use inline asm to detect DARN availablity in the compiler.
// Also see cpu.cpp and the two query functions; and ppc_power9.cpp
// and the two probe functions.
#include <altivec.h>
int main(int argc, char* argv[])
{
#if 0
const unsigned char b = (unsigned char)argc;
const unsigned int r = (0xf << 24) | (0x3 << 16) | (0xf << 8) | (0x3 << 0);
#if defined(__clang__)
bool x = __builtin_altivec_byte_in_range(b, r);
#elif defined(__GNUC__)
bool x = __builtin_byte_in_range(b, r);
#else
int XXX[-1];
#endif
#endif
#if defined(__GNUC__) || defined(__IBM_GCC_ASM)
unsigned int y = __builtin_darn_32();
#else
int XXX[-1];
#endif
return 0;
}

View File

@ -0,0 +1,23 @@
#include <altivec.h>
int main(int argc, char* argv[])
{
#if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
__vector unsigned int x = {1,2,3,4};
x=__vshasigmaw(x, 0, 0);
__vector unsigned long long y = {1,2};
y=__vshasigmad(y, 0, 0);
#elif defined(__clang__)
__vector unsigned int x = {1,2,3,4};
x=__builtin_altivec_crypto_vshasigmaw(x, 0, 0);
__vector unsigned long long y = {1,2};
y=__builtin_altivec_crypto_vshasigmad(y, 0, 0);
#elif defined(__GNUC__)
__vector unsigned int x = {1,2,3,4};
x=__builtin_crypto_vshasigmaw(x, 0, 0);
__vector unsigned long long y = {1,2};
y=__builtin_crypto_vshasigmad(y, 0, 0);
#else
int XXX[-1];
#endif
return 0;
}

View File

@ -0,0 +1,17 @@
#include <altivec.h>
int main(int argc, char* argv[])
{
__vector unsigned long long x = {1,2};
__vector unsigned long long y = {3,4};
#if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
__vector unsigned long long z=__vpmsumd(x,y);
#elif defined(__clang__)
__vector unsigned long long z=__builtin_altivec_crypto_vpmsumd(x,y);
#elif defined(__GNUC__)
__vector unsigned long long z=__builtin_crypto_vpmsumd(x,y);
#else
int XXX[-1];
#endif
return 0;
}

View File

@ -0,0 +1,15 @@
#include <string>
#include <pthread.h>
void* function(void *ptr)
{
return 0;
}
int main(int argc, char* argv[])
{
pthread_t thread;
int ret = pthread_create(&thread, NULL, function, (void*)0);
pthread_join(thread, NULL);
return 0;
}

View File

@ -0,0 +1,11 @@
#include <emmintrin.h>
#include <wmmintrin.h>
int main(int argc, char* argv[])
{
__m128i x = _mm_setzero_si128();
x=_mm_aesenc_si128(x,x);
x=_mm_aesenclast_si128(x,x);
x=_mm_aesdec_si128(x,x);
x=_mm_aesdeclast_si128(x,x);
return 0;
}

View File

@ -0,0 +1,7 @@
#include <immintrin.h>
int main(int argc, char* argv[])
{
__m256d x = _mm256_setzero_pd();
x=_mm256_addsub_pd(x,x);
return 0;
}

View File

@ -0,0 +1,7 @@
#include <immintrin.h>
int main(int argc, char* argv[])
{
__m256i x = _mm256_setzero_si256();
x=_mm256_add_epi64 (x,x);
return 0;
}

View File

@ -0,0 +1,8 @@
#include <stdint.h>
#include <immintrin.h>
int main(int argc, char* argv[])
{
uint64_t x[8] = {0};
__m512i y = _mm512_loadu_si512((__m512i*)x);
return 0;
}

View File

@ -0,0 +1,8 @@
#include <emmintrin.h>
#include <wmmintrin.h>
int main(int argc, char* argv[])
{
__m128i x = _mm_setzero_si128();
x=_mm_clmulepi64_si128(x,x,0x11);
return 0;
}

View File

@ -0,0 +1,7 @@
int main(int argc, char* argv[])
{
unsigned int a, b, c, d;
asm volatile ( "cpuid" : "+a"(a), "=b"(b), "+c"(c), "=d"(d) );
return 0;
}

View File

@ -0,0 +1,14 @@
#include <emmintrin.h>
#include <immintrin.h>
int main(int argc, char* argv[])
{
__m128i x = _mm_setzero_si128();
x=_mm_sha1msg1_epu32(x,x);
x=_mm_sha1msg2_epu32(x,x);
x=_mm_sha1nexte_epu32(x,x);
x=_mm_sha1rnds4_epu32(x,x,0);
x=_mm_sha256msg1_epu32(x,x);
x=_mm_sha256msg2_epu32(x,x);
x=_mm_sha256rnds2_epu32(x,x,x);
return 0;
}

View File

@ -0,0 +1,7 @@
#include <emmintrin.h>
int main(int argc, char* argv[])
{
__m128i x = _mm_setzero_si128();
x=_mm_add_epi64(x,x);
return 0;
}

View File

@ -0,0 +1,8 @@
#include <emmintrin.h>
#include <pmmintrin.h>
int main(int argc, char* argv[])
{
__m128d x = _mm_setzero_pd();
x=_mm_addsub_pd(x,x);
return 0;
}

View File

@ -0,0 +1,10 @@
#include <emmintrin.h>
#include <smmintrin.h>
int main(int argc, char* argv[])
{
__m128i x = _mm_setzero_si128();
__m128i a = _mm_setzero_si128();
__m128i b = _mm_setzero_si128();
x=_mm_blend_epi16(a,b,4);
return 0;
}

View File

@ -0,0 +1,7 @@
#include <nmmintrin.h>
int main(int argc, char* argv[])
{
unsigned int x=32;
x=_mm_crc32_u8(x,4);
return 0;
}

View File

@ -0,0 +1,8 @@
#include <emmintrin.h>
#include <tmmintrin.h>
int main(int argc, char* argv[])
{
__m128i x = _mm_setzero_si128();
x=_mm_alignr_epi8(x,x,2);
return 0;
}

View File

@ -4,6 +4,11 @@
# building the docs. Before running the script, copy it to the root
# directory. After running this script, you can 'make docs'
sed -i 's|Library 6.2 API|Library 6.1 API|g' cryptlib.h
sed -i 's|= 6.2|= 6.1|g' Doxyfile
sed -i 's|CRYPTOPP_VERSION 620|CRYPTOPP_VERSION 610|g' config.h
sed 's|Library 8.1 API|Library 8.0 API|g' cryptlib.h > cryptlib.h.new
mv cryptlib.h.new cryptlib.h
sed 's|= 8.1|= 8.0|g' Doxyfile > Doxyfile.new
mv Doxyfile.new Doxyfile
sed 's|CRYPTOPP_VERSION 810|CRYPTOPP_VERSION 800|g' config.h > config.h.new
mv config.h.new config.h

View File

@ -11,12 +11,19 @@
# ====================================================================
set +e
if [ -z $(command -v ./setenv-android-gcc.sh) ]; then
echo "Failed to locate setenv-android-gcc.sh"
ls -Al *.sh
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if [ -z "${PLATFORM-}" ]; then
PLATFORMS=(armeabi armeabi-v7a armv7a-neon aarch64 mipsel mipsel64 x86 x86_64)
else
PLATFORMS=(${PLATFORM})
fi
RUNTIMES=(gnu-static gnu-shared stlport-static stlport-shared) #llvm-static llvm-shared
for platform in ${PLATFORMS[@]}
do
for runtime in ${RUNTIMES[@]}
@ -28,30 +35,33 @@ do
echo "Testing for Android support of $platform using $runtime"
# Test if we can set the environment for the platform
./setenv-android.sh "$platform" "$runtime"
./setenv-android-gcc.sh "$platform" "$runtime"
if [ "$?" -eq "0" ]; then
if [ "$?" -ne "0" ];
then
echo
echo "Building for $platform using $runtime..."
echo
# run in subshell to not keep any env vars
(
. ./setenv-android.sh "$platform" "$runtime" > /dev/null 2>&1
make -f GNUmakefile-cross static dynamic cryptest.exe
if [ "$?" -eq "0" ]; then
echo "$platform:$runtime ==> SUCCESS" >> /tmp/build.log
else
echo "$platform:$runtime ==> FAILURE" >> /tmp/build.log
touch /tmp/build.failed
fi
)
else
echo
echo "$platform with $runtime not supported by Android"
echo "There were problems testing $platform with $runtime"
echo "$platform:$runtime ==> FAILURE" >> /tmp/build.log
touch /tmp/build.failed
continue
fi
echo
echo "Building for $platform using $runtime..."
echo
# run in subshell to not keep any env vars
(
source ./setenv-android-gcc.sh "$platform" "$runtime" > /dev/null 2>&1
make -f GNUmakefile-cross static dynamic cryptest.exe
if [ "$?" -eq "0" ]; then
echo "$platform:$runtime ==> SUCCESS" >> /tmp/build.log
else
echo "$platform:$runtime ==> FAILURE" >> /tmp/build.log
touch /tmp/build.failed
fi
)
done
done

View File

@ -0,0 +1,155 @@
#!/usr/bin/env bash
PWD_DIR=$(pwd)
function cleanup {
cd "$PWD_DIR"
}
trap cleanup EXIT
GREP=grep
SED=sed
AWK=awk
MAKE=make
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
# Fixup, Solaris and friends
if [[ (-d /usr/xpg4/bin) ]]; then
SED=/usr/xpg4/bin/sed
AWK=/usr/xpg4/bin/awk
GREP=/usr/xpg4/bin/grep
elif [[ (-d /usr/bin/posix) ]]; then
SED=/usr/bin/posix/sed
AWK=/usr/bin/posix/awk
GREP=/usr/bin/posix/grep
fi
# Fixup for sed and "illegal byte sequence"
IS_DARWIN=$(uname -s | "$GREP" -i -c darwin)
if [[ "$IS_DARWIN" -ne 0 ]]; then
export LC_ALL=C
fi
# Fixup for Solaris and BSDs
# Fixup for Solaris and BSDs
if [[ ! -z $(command -v gmake) ]]; then
MAKE=gmake
else
MAKE=make
fi
# Fixup for missing libtool
if [[ ! -z $(command -v libtoolize) ]]; then
LIBTOOLIZE=$(command -v libtoolize)
elif [[ ! -z $(command -v glibtoolize) ]]; then
LIBTOOLIZE=$(command -v glibtoolize)
elif [[ ! -z $(command -v libtool) ]]; then
LIBTOOLIZE=$(command -v libtool)
elif [[ ! -z $(command -v glibtool) ]]; then
LIBTOOLIZE=$(command -v glibtool)
fi
# Fecth the three required files
if ! wget --no-check-certificate 'https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/Makefile.am' -O Makefile.am; then
echo "Makefile.am download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! wget --no-check-certificate 'https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/configure.ac' -O configure.ac; then
echo "configure.ac download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! wget --no-check-certificate 'https://raw.githubusercontent.com/noloader/cryptopp-autotools/master/libcryptopp.pc.in' -O libcryptopp.pc.in; then
echo "libcryptopp.pc.in download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
mkdir -p m4/
if [[ -z $(command -v autoupdate) ]]; then
echo "Cannot find autoupdate. Things may fail."
fi
if [[ -z "$LIBTOOLIZE" ]]; then
echo "Cannot find libtoolize. Things may fail."
fi
if [[ -z $(command -v autoreconf) ]]; then
echo "Cannot find autoreconf. Things may fail."
fi
echo "Running autoupdate"
if ! autoupdate 2>/dev/null; then
echo "autoupdate failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
echo "Running libtoolize"
if ! "$LIBTOOLIZE" 2>/dev/null; then
echo "libtoolize failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
# Run autoreconf twice on failure. Also see
# https://github.com/tracebox/tracebox/issues/57
echo "Running autoreconf"
if ! autoreconf 2>/dev/null; then
echo "autoreconf failed, running again."
if ! autoreconf -fi; then
echo "autoreconf failed, again."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
fi
# Sparc need +w
if [[ -e config.sub ]]; then
chmod +w config.sub
fi
if [[ -e config.guess ]]; then
chmod +w config.guess
fi
# Update config.sub config.guess. GNU recommends using the latest for all projects.
echo "Updating config.sub"
wget --no-check-certificate 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub' -O config.sub
if [[ -e config.sub ]]; then
chmod +x config.sub
fi
echo "Updating config.guess"
wget --no-check-certificate 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess' -O config.guess
if [[ -e config.guess ]]; then
chmod +x config.guess
fi
if ! ./configure; then
echo "configure failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
"$MAKE" clean 2>/dev/null
if ! "$MAKE" -j2 -f Makefile; then
echo "make failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! ./cryptestcwd v; then
echo "cryptestcwd v failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! ./cryptestcwd tv all; then
echo "cryptestcwd tv all failed."
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
# Return success
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0

View File

@ -0,0 +1,73 @@
#!/usr/bin/env bash
PWD_DIR=$(pwd)
function cleanup {
cd "$PWD_DIR"
}
trap cleanup EXIT
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
# Fixup for Solaris and BSDs
if [[ ! -z $(command -v gmake) ]]; then
MAKE=gmake
else
MAKE=make
fi
# Fixup for AIX
if [[ -z "$CMAKE" ]]; then
CMAKE=cmake
fi
# Feth the three required files
if ! wget --no-check-certificate https://raw.githubusercontent.com/noloader/cryptopp-cmake/master/CMakeLists.txt -O CMakeLists.txt; then
echo "CMakeLists.txt download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! wget --no-check-certificate https://github.com/noloader/cryptopp-cmake/blob/master/cryptopp-config.cmake -O cryptopp-config.cmake; then
echo "cryptopp-config.cmake download failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
rm -rf "$PWD_DIR/cmake_build"
mkdir -p "$PWD_DIR/cmake_build"
cd "$PWD_DIR/cmake_build"
if [[ ! -z "$CXX" ]];
then
if ! CXX="$CXX" "$CMAKE" -DCMAKE_CXX_COMPILER="$CXX" ../; then
echo "cmake failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
else
if ! "$CMAKE" ../; then
echo "cmake failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
fi
"$MAKE" clean 2>/dev/null
if ! "$MAKE" -j2 -f Makefile VERBOSE=1; then
echo "make failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! ./cryptest.exe v; then
echo "cryptest.exe v failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if ! ./cryptest.exe tv all; then
echo "cryptest.exe v failed"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
# Return success
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0

View File

@ -10,8 +10,14 @@
# See http://www.cryptopp.com/wiki/iOS_(Command_Line) for more details
# ====================================================================
if [ -z $(command -v ./setenv-ios.sh) ]; then
echo "Failed to locate setenv-ios.sh"
ls -Al *.sh
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
if [ -z "${PLATFORM-}" ]; then
PLATFORMS=(iPhoneOS iPhoneSimulator WatchOS WatchSimulator AppleTVOS AppleTVSimulator)
PLATFORMS=(iPhoneOS iPhoneSimulator Arm64 WatchOS WatchSimulator AppleTVOS AppleTVSimulator)
else
PLATFORMS=(${PLATFORM})
fi
@ -27,28 +33,31 @@ do
# Test if we can set the environment for the platform
./setenv-ios.sh "$platform"
if [ "$?" -eq "0" ]; then
echo
echo "Building for $platform using $runtime..."
echo
# run in subshell to not keep any env vars
(
. ./setenv-ios.sh "$platform" > /dev/null 2>&1
make -f GNUmakefile-cross static dynamic cryptest.exe
if [ "$?" -eq "0" ]; then
echo "$platform ==> SUCCESS" >> /tmp/build.log
else
echo "$platform ==> FAILURE" >> /tmp/build.log
touch /tmp/build.failed
fi
)
else
if [ "$?" -ne "0" ];
then
echo
echo "$platform not supported by Xcode"
echo "$platform ==> FAILURE" >> /tmp/build.log
touch /tmp/build.failed
continue
fi
echo
echo "Building for $platform using $runtime..."
echo
# run in subshell to not keep any env vars
(
source ./setenv-ios.sh "$platform" > /dev/null 2>&1
make -f GNUmakefile-cross static dynamic cryptest.exe
if [ "$?" -eq "0" ]; then
echo "$platform ==> SUCCESS" >> /tmp/build.log
else
echo "$platform ==> FAILURE" >> /tmp/build.log
touch /tmp/build.failed
fi
)
done
cat /tmp/build.log

View File

@ -6,10 +6,16 @@
# This is a test script that can be used on some Linux/Unix/Apple machines to automate testing
# of the shared object to ensure linking and symbols don't go missing from release to release.
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
############################################
# Tags to test
OLD_VERSION_TAG=CRYPTOPP_6_1_0
OLD_VERSION_TAG=CRYPTOPP_7_0_0
NEW_VERSION_TAG=master
############################################
@ -34,11 +40,8 @@ fi
echo
echo "****************************************************************"
echo "****************************************************************"
echo "Testing '$NEW_VERSION_TAG' against '$OLD_VERSION_TAG'"
echo "****************************************************************"
echo "****************************************************************"
echo
############################################
# Setup tools and platforms
@ -224,7 +227,6 @@ echo
echo "****************************************************************"
echo "Patching makefile for dynamic linking by cryptest.exe"
echo "****************************************************************"
echo
if [[ "$IS_DARWIN" -ne "0" ]]; then
"$SED" "$SED_OPTS" -e 's|libcryptopp.a $(TESTOBJS)|libcryptopp.dylib $(TESTOBJS)|g' GNUmakefile-symbols
@ -282,11 +284,10 @@ fi
echo
echo "****************************************************************"
echo "Removing dynamic library for $OLD_VERSION_TAG"
echo "Removing dynamic library and artifacts for $OLD_VERSION_TAG"
echo "****************************************************************"
echo
rm -f adhoc.cpp *.o *.so *.dylib
rm -f adhoc.cpp *.a *.o *.so *.dylib
git checkout "$NEW_VERSION_TAG" -f &>/dev/null

View File

@ -81,6 +81,12 @@ MAKE=make
DISASS=objdump
DISASSARGS=("--disassemble")
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
# Fixup, Solaris and friends
if [[ (-d /usr/xpg4/bin) ]]; then
SED=/usr/xpg4/bin/sed
@ -1009,6 +1015,12 @@ if [[ ("$GCC_COMPILER" -ne "0" || "$CLANG_COMPILER" -ne "0") ]]; then
WARNING_CXXFLAGS+=("-Wcast-align" "-Wwrite-strings" "-Wformat=2" "-Wformat-security")
fi
# On PowerPC we test the original Altivec load and store with unaligned data.
# Modern compilers generate a warning and recommend the new loads and stores.
if [[ ("$GCC_COMPILER" -ne "0" && ("$IS_PPC32" -ne "0" || "$IS_PPC64" -ne "0") ) ]]; then
WARNING_CXXFLAGS+=("-Wno-deprecated")
fi
echo | tee -a "$TEST_RESULTS"
echo "DEBUG_CXXFLAGS: $DEBUG_CXXFLAGS" | tee -a "$TEST_RESULTS"
echo "RELEASE_CXXFLAGS: $RELEASE_CXXFLAGS" | tee -a "$TEST_RESULTS"
@ -1161,7 +1173,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_X86" -ne "0" || "$IS_X64" -ne "0")) ]]; t
TEST_LIST+=("X86 CRC32 code generation")
OBJFILE=crc-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=crc_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1201,7 +1213,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_X86" -ne "0" || "$IS_X64" -ne "0")) ]]; t
TEST_LIST+=("X86 AES-NI code generation")
OBJFILE=rijndael-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=rijndael_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1265,7 +1277,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_X86" -ne "0" || "$IS_X64" -ne "0")) ]]; t
TEST_LIST+=("X86 carryless multiply code generation")
OBJFILE=gcm-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=gcm_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1353,7 +1365,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_X86" -ne "0" || "$IS_X64" -ne "0")) ]]; t
TEST_LIST+=("X86 SHA code generation")
OBJFILE=sha-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=sha_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1424,7 +1436,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
TEST_LIST+=("ARM NEON code generation")
OBJFILE=aria-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=aria_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1532,7 +1544,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
TEST_LIST+=("ARM CRC32 code generation")
OBJFILE=crc-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=crc_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1584,7 +1596,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
TEST_LIST+=("ARM carryless multiply code generation")
OBJFILE=gcm-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=gcm_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1624,7 +1636,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
TEST_LIST+=("ARM AES generation")
OBJFILE=rijndael-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=rijndael_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1676,7 +1688,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_ARM32" -ne "0" || "$IS_ARM64" -ne "0")) ]
TEST_LIST+=("ARM SHA generation")
OBJFILE=sha-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=sha_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1780,7 +1792,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_PPC32" -ne "0" || "$IS_PPC64" -ne "0")) ]
TEST_LIST+=("Power8 AES generation")
OBJFILE=rijndael-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=rijndael_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS $PPC_AES_FLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1843,7 +1855,7 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_PPC32" -ne "0" || "$IS_PPC64" -ne "0")) ]
TEST_LIST+=("Power8 SHA generation")
OBJFILE=sha-simd.o; rm -f "$OBJFILE" 2>/dev/null
OBJFILE=sha_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS $PPC_SHA_FLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
@ -1866,6 +1878,51 @@ if [[ ("$HAVE_DISASS" -ne "0" && ("$IS_PPC32" -ne "0" || "$IS_PPC64" -ne "0")) ]
echo "Verified vshasigmaw and vshasigmad machine instructions" | tee -a "$TEST_RESULTS"
fi
fi
############################################
# Power8 VMULL
PPC_VMULL=0
if [[ ("$PPC_VMULL" -eq "0") ]]; then
"$CXX" -DCRYPTOPP_ADHOC_MAIN -mcpu=power8 adhoc.cpp -o "$TMPDIR/adhoc.exe" > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
PPC_VMULL=1
PPC_VMULL_FLAGS="-mcpu=power8"
fi
fi
if [[ ("$PPC_VMULL" -eq "0") ]]; then
"$CXX" -DCRYPTOPP_ADHOC_MAIN -qarch=pwr8 adhoc.cpp -o "$TMPDIR/adhoc.exe" > /dev/null 2>&1
if [[ "$?" -eq "0" ]]; then
PPC_VMULL=1
PPC_VMULL_FLAGS="-qarch=pwr8"
fi
fi
if [[ ("$PPC_VMULL" -ne "0") ]]; then
echo
echo "************************************" | tee -a "$TEST_RESULTS"
echo "Testing: Power8 carryless multiply generation" | tee -a "$TEST_RESULTS"
echo
TEST_LIST+=("Power8 carryless multiply generation")
OBJFILE=gcm_simd.o; rm -f "$OBJFILE" 2>/dev/null
CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS $PPC_VMULL_FLAGS" "$MAKE" "${MAKEARGS[@]}" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS"
COUNT=0
FAILED=0
DISASS_TEXT=$("$DISASS" "${DISASSARGS[@]}" "$OBJFILE" 2>/dev/null)
COUNT=$(echo -n "$DISASS_TEXT" | "$GREP" -i -c vpmsum)
if [[ ("$COUNT" -eq "0") ]]; then
FAILED=1
echo "ERROR: failed to generate vpmsum instruction" | tee -a "$TEST_RESULTS"
fi
if [[ ("$FAILED" -eq "0") ]]; then
echo "Verified vpmsum machine instruction" | tee -a "$TEST_RESULTS"
fi
fi
fi
############################################
@ -1888,14 +1945,20 @@ if true; then
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
else
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
fi
@ -1916,14 +1979,20 @@ if true; then
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
else
./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS"
if [[ ("${PIPESTATUS[0]}" -ne "0") ]]; then
echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS"
# Stop now if things are broke
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 1 || return 1
fi
echo
fi

View File

@ -6,6 +6,17 @@
# run 'governor.sh powersave' or reboot. The script is based on code by
# Andy Polyakov, http://www.openssl.org/~appro/cryptogams/.
# Fixup ancient Bash
# https://unix.stackexchange.com/q/468579/56041
if [[ -z "$BASH_SOURCE" ]]; then
BASH_SOURCE="$0"
fi
if [[ "$EUID" -ne 0 ]]; then
echo "This script must be run as root"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
fi
if [ "x$1" = "x" ]; then
echo "usage: $0 on[demand]|pe[rformance]|po[wersave]|us[erspace]?"
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
# install android deps
@ -7,11 +7,10 @@ sudo apt-get -qq install --no-install-recommends openjdk-8-jdk unzip
# android skd/ndk
curl -Lo /tmp/android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
mkdir $HOME/android
unzip -qq /tmp/android-sdk.zip -d $HOME/android/sdk/
unzip -qq /tmp/android-sdk.zip -d "$ANDROID_SDK"
rm -f /tmp/android-sdk.zip
echo y | $HOME/android/sdk/tools/bin/sdkmanager --update > /dev/null
echo y | "$ANDROID_SDK/tools/bin/sdkmanager" --update > /dev/null
for package in "ndk-bundle"; do
echo install android $package
echo y | $HOME/android/sdk/tools/bin/sdkmanager "$package" > /dev/null
echo y | "$ANDROID_SDK/tools/bin/sdkmanager" "$package" > /dev/null
done

View File

@ -71,7 +71,7 @@ if [ -z "${AOSP_API-}" ]; then
else
echo "WARNING: Using AOSP_API has been deprecated. Please use AOSP_API_VERSION instead."
echo "If you set for example AOSP_API=android-23 then now instead set AOSP_API_VERSION=23"
exit 1
[ "$0" = "$BASH_SOURCE" ] && exit 1 || return 1
fi
#####################################################################
@ -126,8 +126,8 @@ case "$THE_ARCH" in
AOSP_FLAGS="-march=armv7-a -mthumb -mfpu=vfpv3-d16 -mfloat-abi=softfp -DCRYPTOPP_DISABLE_ASM -Wl,--fix-cortex-a8 -funwind-tables -fexceptions -frtti"
;;
hard|armv7a-hard|armeabi-v7a-hard)
echo hard, armv7a-hard and armeabi-v7a-hard are not supported, as android uses softfloats
exit 1
echo hard, armv7a-hard and armeabi-v7a-hard are not supported, as android uses softfloats
[ "$0" = "$BASH_SOURCE" ] && exit 1 || return 1
#TOOLCHAIN_ARCH="arm-linux-androideabi"
#TOOLCHAIN_NAME="arm-linux-androideabi"
#AOSP_ABI="armeabi-v7a"
@ -167,14 +167,14 @@ case "$THE_ARCH" in
TOOLCHAIN_NAME="i686-linux-android"
AOSP_ABI="x86"
AOSP_ARCH="arch-x86"
AOSP_FLAGS="-mtune=intel -mssse3 -mfpmath=sse -DCRYPTOPP_DISABLE_SSE4 -funwind-tables -fexceptions -frtti"
AOSP_FLAGS="-mtune=intel -mssse3 -mfpmath=sse -funwind-tables -fexceptions -frtti"
;;
x86_64|x64)
TOOLCHAIN_ARCH="x86_64"
TOOLCHAIN_NAME="x86_64-linux-android"
AOSP_ABI="x86_64"
AOSP_ARCH="arch-x86_64"
AOSP_FLAGS="-march=x86-64 -msse4.2 -mpopcnt -mtune=intel -DCRYPTOPP_DISABLE_CLMUL -DCRYPTOPP_DISABLE_AES -DCRYPTOPP_DISABLE_SHA -funwind-tables -fexceptions -frtti"
AOSP_FLAGS="-march=x86-64 -msse4.2 -mpopcnt -mtune=intel -funwind-tables -fexceptions -frtti"
;;
*)
echo "ERROR: Unknown architecture $1"

View File

@ -157,14 +157,14 @@ case "$THE_ARCH" in
TOOLCHAIN_NAME="i686-linux-android"
AOSP_ABI="x86"
AOSP_ARCH="arch-x86"
AOSP_FLAGS="-mtune=intel -mssse3 -mfpmath=sse -DCRYPTOPP_DISABLE_SSE4 -DCRYPTOPP_DISABLE_CLMUL -DCRYPTOPP_DISABLE_AES -DCRYPTOPP_DISABLE_SHA -funwind-tables -fexceptions -frtti"
AOSP_FLAGS="-mtune=intel -mssse3 -mfpmath=sse -funwind-tables -fexceptions -frtti"
;;
x86_64|x64)
TOOLCHAIN_ARCH="x86_64"
TOOLCHAIN_NAME="x86_64-linux-android"
AOSP_ABI="x86_64"
AOSP_ARCH="arch-x86_64"
AOSP_FLAGS="-march=x86-64 -msse4.2 -mpopcnt -mtune=intel -DCRYPTOPP_DISABLE_CLMUL -DCRYPTOPP_DISABLE_AES -DCRYPTOPP_DISABLE_SHA -funwind-tables -fexceptions -frtti"
AOSP_FLAGS="-march=x86-64 -msse4.2 -mpopcnt -mtune=intel -funwind-tables -fexceptions -frtti"
;;
*)
echo "ERROR: Unknown architecture $1"

View File

@ -42,6 +42,7 @@ SETENV_VERBOSE=1
APPLE_SDK=
IOS_ARCH=
BACK_ARCH=
for ARG in "$@"
do
@ -49,66 +50,74 @@ do
# i386 (simulator)
if [ "$CL" == "i386" ]; then
IOS_ARCH=i386
BACK_ARCH=i386
APPLE_SDK=iPhoneSimulator
fi
# x86_64 (simulator)
if [ "$CL" == "x86_64" ]; then
IOS_ARCH=x86_64
BACK_ARCH=x86_64
APPLE_SDK=iPhoneSimulator
fi
# ARMv5
if [ "$CL" == "armv5" ]; then
IOS_ARCH=armv5
BACK_ARCH=armv5
fi
# ARMv6
if [ "$CL" == "armv6" ]; then
IOS_ARCH=armv6
BACK_ARCH=armv6
fi
# ARMv7
if [ "$CL" == "armv7" ]; then
IOS_ARCH=armv7
BACK_ARCH=armv7
fi
# ARMv7s
if [ "$CL" == "armv7s" ]; then
IOS_ARCH=armv7s
BACK_ARCH=armv7s
fi
# ARM64
if [[ ("$CL" == "arm64" || "$CL" == "armv8" || "$CL" == "aarch64") ]]; then
IOS_ARCH=arm64
BACK_ARCH=arm64
fi
# iPhone
if [[ ("$CL" == "iphone" || "$CL" == "iphoneos") ]]; then
BACK_ARCH=armv7
APPLE_SDK=iPhoneOS
fi
# iPhone Simulator
if [[ ("$CL" == "simulator" || "$CL" == "iphonesimulator") ]]; then
BACK_ARCH=i386
APPLE_SDK=iPhoneSimulator
fi
# Watch
if [[ ("$CL" == "watch" || "$CL" == "watchos" || "$CL" == "applewatch") ]]; then
BACK_ARCH=armv7
APPLE_SDK=WatchOS
fi
# Watch Simulator
if [ "$CL" == "watchsimulator" ]; then
BACK_ARCH=i386
APPLE_SDK=WatchSimulator
fi
# Apple TV
if [[ ("$CL" == "tv" || "$CL" == "appletv" || "$CL" == "appletvos") ]]; then
BACK_ARCH=arm64
APPLE_SDK=AppleTVOS
fi
# Apple TV Simulator
if [[ ("$CL" == "tvsimulator" || "$CL" == "appletvsimulator") ]]; then
BACK_ARCH=x86_64
APPLE_SDK=AppleTVSimulator
fi
@ -116,21 +125,13 @@ done
# Defaults if not set
if [ -z "$APPLE_SDK" ]; then
BACK_ARCH=armv7
APPLE_SDK=iPhoneOS
fi
# Defaults if not set
if [ -z "$IOS_ARCH" ]; then
if [ "$APPLE_SDK" == "iPhoneOS" ]; then
IOS_ARCH=armv7
elif [ "$APPLE_SDK" == "iPhoneSimulator" ]; then
IOS_ARCH=i386
elif [ "$APPLE_SDK" == "AppleTVOS" ]; then
IOS_ARCH=arm64
elif [ "$APPLE_SDK" == "WatchOS" ]; then
IOS_ARCH=armv7
fi
# TODO: fill in missing simulator architectures
IOS_ARCH="$BACK_ARCH"
fi
# Allow a user override? I think we should be doing this. The use case is:
@ -195,12 +196,12 @@ fi
# https://github.com/weidai11/cryptopp/issues/635
if [ "$APPLE_SDK" == "iPhoneSimulator" ]; then
IOS_FLAGS="$IOS_FLAGS -DCRYPTOPP_DISABLE_SSSE3"
IOS_FLAGS="$IOS_FLAGS -DCRYPTOPP_DISABLE_ASM"
fi
# Simulator fixup. LD fails to link dylib.
if [ "$APPLE_SDK" == "iPhoneSimulator" ] && [ "$IOS_ARCH" == "i386" ]; then
IOS_FLAGS="$IOS_FLAGS -miphoneos-version-min=5"
IOS_FLAGS="$IOS_FLAGS -miphoneos-version-min=5 -DCRYPTOPP_DISABLE_ASM"
fi
# ARMv7s fixup. Xcode 4/iOS 6
@ -219,8 +220,25 @@ if [ "$APPLE_SDK" == "AppleTVOS" ]; then
fi
# ARM64 Simulator fixup. Under Xcode 6/iOS 8, it uses x86_64 and not i386
# -ios_simulator_version_min does not work though it is in LLVM sources.
if [ "$IOS_ARCH" == "x86_64" ]; then
IOS_FLAGS="$IOS_FLAGS -miphoneos-version-min=8"
IOS_FLAGS="$IOS_FLAGS -DCRYPTOPP_DISABLE_ASM"
fi
# Disable ASM for simulator. We are failing on Travis due to missing _start.
# We may need to link against crt1.o for simulator builds. Also see
# https://stackoverflow.com/q/24841283/608639
# -watchos_simulator_version_min does not work though it is in LLVM sources.
if [ "$APPLE_SDK" == "WatchSimulator" ]; then
IOS_FLAGS="$IOS_FLAGS -DCRYPTOPP_DISABLE_ASM"
fi
# Disable ASM for simulator. We are failing on Travis due to missing _start.
# We may need to link against crt1.o for simulator builds. Also see
# https://stackoverflow.com/q/24841283/608639
# -tvos_simulator_version_min does not work though it is in LLVM sources.
if [ "$APPLE_SDK" == "AppleTVSimulator" ]; then
IOS_FLAGS="$IOS_FLAGS -tvos_simulator_version_min -DCRYPTOPP_DISABLE_ASM"
fi
# Simulator uses i386 or x86_64, Device uses ARMv5, ARMv6, ARMv7, ARMv7s or ARMv8

View File

@ -0,0 +1,18 @@
#/usr/bin/env bash
# This file should be source'd when required.
export ANDROID_HOME="$HOME/.android"
export ANDROID_SDK="$HOME/android/sdk/"
export ANDROID_NDK="$HOME/android/sdk/ndk-bundle"
export ANDROID_SDK_ROOT="$ANDROID_SDK"
export ANDROID_NDK_ROOT="$ANDROID_NDK"
mkdir -p "$ANDROID_HOME"
mkdir -p "$ANDROID_SDK_ROOT"
mkdir -p "$ANDROID_NDK_ROOT"
# https://stackoverflow.com/a/47028911/608639
touch "$ANDROID_HOME/repositories.cfg"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0

View File

@ -24,7 +24,8 @@ before the Test field.
Data Types
==========
int - small integer (less than 2^32) in decimal representation
signed int - small integer (less than 2^32) in decimal representation
unsigned long - large integer (less than 2^64) convertible by strtoul or strtoull
string - human readable string
encoded string - can be one of the following
- quoted string: "message" means "message" without the quotes
@ -68,6 +69,7 @@ DerivedLength - encoded string
Digest - encoded string
TruncatedSize - int, size of truncated digest in bytes
Seek - int, seek location for random access ciphers
Seek64 - unsigned long, seek location for random access ciphers
(more to come here)
Possible Tests

View File

@ -30,13 +30,20 @@ Test: TestVectors/aria.txt
Test: TestVectors/kalyna.txt
Test: TestVectors/threefish.txt
Test: TestVectors/sm4.txt
Test: TestVectors/hight.txt
Test: TestVectors/cham.txt
Test: TestVectors/lea.txt
Test: TestVectors/simeck.txt
Test: TestVectors/simon.txt
Test: TestVectors/speck.txt
Test: TestVectors/salsa.txt
Test: TestVectors/chacha.txt
#Test: TestVectors/tls_chacha.txt
Test: TestVectors/vmac.txt
Test: TestVectors/sosemanuk.txt
Test: TestVectors/rabbit.txt
Test: TestVectors/hc128.txt
Test: TestVectors/hc256.txt
Test: TestVectors/vmac.txt
Test: TestVectors/ccm.txt
Test: TestVectors/gcm.txt
Test: TestVectors/cmac.txt

View File

@ -1,36 +1,43 @@
AlgorithmType: SymmetricCipher
Name: ChaCha8
Name: ChaCha
Source: http://tools.ietf.org/html/draft-strombergson-chacha-test-vectors
#
Comment: TC1 - All zero key and IV (16-byte key).
Key: r16 00
IV: r8 00
Rounds: 8
Plaintext: r64 00
Ciphertext: e28a5fa4a67f8c5defed3e6fb7303486aa8427d31419a729572d777953491120b64ab8e72b8deb85cd6aea7cb6089a101824beeb08814a428aab1fa2c816081b
Test: Encrypt
#
Comment: TC1 - All zero key and IV (32-byte key).
Key: r32 00
IV: r8 00
Plaintext: r64 00
Ciphertext: 3e00ef2f895f40d67f5bb8e81f09a5a12c840ec3ce9a7f3b181be188ef711a1e984ce172b9216f419f445367456d5619314a42a3da86b001387bfdb80e0cfe42
Test: Encrypt
#
Comment: TC2 - Single bit in key set. All zero IV (16-byte key).
Key: 0x01000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: 03a7669888605a0765e8357475e58673f94fc8161da76c2a3aa2f3caf9fe5449e0fcf38eb882656af83d430d410927d55c972ac4c92ab9da3713e19f761eaa14
Test: Encrypt
#
Comment: TC2 - Single bit in key set. All zero IV (32-byte key).
Key: 0x0100000000000000000000000000000000000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: cf5ee9a0494aa9613e05d5ed725b804b12f4a465ee635acc3a311de8740489ea289d04f43c7518db56eb4433e498a1238cd8464d3763ddbb9222ee3bd8fae3c8
Test: Encrypt
#
Comment: TC3 - Single bit in IV set. All zero key (16-byte key).
Key: r16 00
IV: 0x0100000000000000
Plaintext: r64 00
Ciphertext: 25f5bec6683916ff44bccd12d102e692176663f4cac53e719509ca74b6b2eec85da4236fb29902012adc8f0d86c8187d25cd1c486966930d0204c4ee88a6ab35
Test: Encrypt
#
Comment: TC3 - Single bit in IV set. All zero key (32-byte key).
Key: r32 00
IV: 0x0100000000000000
@ -39,31 +46,236 @@ Ciphertext: 2b8f4bb3798306ca5130d47c4f8d4ed13aa0edccc1be6942090faeeca0d7599b7ff0
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: ChaCha12
Name: ChaCha
Source: https://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
#
Comment: All one's key and IV (16-byte key).
Key: r16 ff
IV: r8 ff
Rounds: 8
Plaintext: r512 00
Ciphertext: \
2204D5B81CE662193E00966034F91302F14A3FB047F58B6E6EF0D72113230416 \
3E0FB640D76FF9C3B9CD99996E6E38FAD13F0E31C82244D33ABBC1B11E8BF12D \
9A81D78E9E56604DDFAE136921F51C9D81AE15119DB8E756DD28024493EE571D \
363AE4BBCD6E7D300F99D2673AEB92CCFC6E43A38DC31BACD66B28F17B22B28A \
B9A347AC756CF16B39683DFE4907D76E9318C53E3B892B4C4D477E3649A412DF \
641722732D6B4B4E73541FEEA26F36163B860A6FFEFF2BD736DCB9E40BB49DFB \
18E5060462F7EC41EF61C8EAED8F68987F4BBA84FF37DF645677AA26D59D1608 \
201932E2F91565FC50BCCAE19370BEA3F4F6C9B40C69E1E7EF4993FB5C543246 \
8AD37BDFA57F8C0A27AFABA186B20E08D08009C9AAAEC5BE1DB6A5FFD0F6D122 \
F000015BB76329B170CBE114A17C0CBC8A721C3075EEDF5F131944F3BEA2E84C \
009BF03FC47FAD2A7BA01573FA67FE859AD950A3E40190AA2FA3834D2FB604E0 \
51F919D4C93CBC6272156BE543785691F698304071BA0D8722CD2694F711E4A2 \
6E511837F4C46CDF9EB2A4573E2FBFF7F4320ACCD35DD64F9B2A40C7F017B971 \
0CD9BC404FD17DC6E474B7EBFE03F5526409160760FB7915DACED8358B8B78C4 \
FA9F0C53D408593CBE63FB1C86D34ACF2B412CD114A542A09BA915D091125542 \
A72DBCA31889D0FC5CCC5F07FA227694100EE57E97C6C2B601273AA438F72693
Test: Encrypt
#
Comment: All one's key and IV (32-byte key).
Key: r32 ff
IV: r8 ff
Rounds: 8
Plaintext: r512 00
Ciphertext: \
E163BBF8C9A739D18925EE8362DAD2CDC973DF05225AFB2AA26396F2A9849A4A \
445E0547D31C1623C537DF4BA85C70A9884A35BCBF3DFAB077E98B0F68135F54 \
81D4933F8B322AC0CD762C27235CE2B31534E0244A9A2F1FD5E94498D47FF108 \
790C009CF9E1A348032A7694CB28024CD96D3498361EDB1785AF752D187AB54B \
4194B9407D743285217760B19D0548294855D4C1620CDFF381657E106CA539E3 \
E41CC0EAAFCB1C502BCE537275567F72CAE2C076B7DE295233132517E140ECF1 \
B7B4F9DE5E87123D72AE0FA8672BBE5B73C5382DDD779A963C91E40B6B9EAF39 \
F53B3982D9E4AC76DFAC3D5070373CF9E54036C9F0E9DBB327371D2E69308699 \
8991D340F91458804B2445641E24189956674BAEC8120AC451F9BDDD14B65E99 \
2C526CABF185EA53FD0ABD2DB88DE9FE88E19D3F26DC6BA4B9014924064D15E6 \
7901B9BF0F4EB76C3E06BE3D1CA73289FF819A9DBF456F73686C5CF9207510F3 \
7D95A24249E11E779D301237AF5A2BD3E6F34D7123811E26BB016C73D54A6D39 \
8B4E9BBCD2EE4C31CBD3326148004684F27847CEAC28C341A894A670A0818324 \
446468D08CA1C72BCBD1CE7EFD73D67D53C671C35EA57700D8B581E52E238A7E \
25DDA3E1C1E35D96BDB9CAD13546971B1E5FDB2E83216FEF93E5457DE48A5ED8 \
1F7E4B95484834A58B6AF8CCE9545BBBDC58929A1DEB2F6AEBF0DC2079F644E3
Test: Encrypt
#
Comment: All one's key and IV (16-byte key).
Key: r16 ff
IV: r8 ff
Rounds: 8
Seek: 32
Plaintext: r64 00
Ciphertext: \
3E0FB640D76FF9C3B9CD99996E6E38FAD13F0E31C82244D33ABBC1B11E8BF12D \
9A81D78E9E56604DDFAE136921F51C9D81AE15119DB8E756DD28024493EE571D
Test: Encrypt
#
Comment: All one's key and IV (32-byte key).
Key: r32 ff
IV: r8 ff
Rounds: 8
Seek: 32
Plaintext: r64 00
Ciphertext: \
445E0547D31C1623C537DF4BA85C70A9884A35BCBF3DFAB077E98B0F68135F54 \
81D4933F8B322AC0CD762C27235CE2B31534E0244A9A2F1FD5E94498D47FF108
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffffe*64)
Key: r32 00
IV: r8 00
Rounds: 8
Seek64: 0x3FFFFFFF80
Plaintext: r1024 00
Ciphertext: \
AC22DD35E273D76E47D60D19AD753F578C38D4A8E28BA9F6055E8E0A1D7A6E53 \
CDC46EDD57430E0EB14CF19CC107EE6DFF4836500383CD683CA2E8F11BA754DD \
34A2B737751D19ECE0256B2BB87237F68188C02B10A6DC31939D4E5D319BD3BB \
EE280B968AD567C1F103089F4F7346D1FEA5DEC60DAF906C3C4E889BC49E0049 \
1CCC59A06308E05BE9D29E7288F166C58F2EE06003047710CBFDB7359DA916E8 \
43980F2C3BF39DF2A3E1F451BA18C37F986FF783075484265819602305557DCD \
B7BD167BDFD87E6E4DF89B2F110C9022F16325E2EC113E806A50774673CDB6AF \
B5BD48D1E66C7631EDB52D0941452DDBD67BC790A20CFE24213194AE75B2EE47 \
FE3B0698DD4E8DFA56E1841BC6F549097583143CB3A0D791C230D9C438EADCC9 \
F233969591EDF6EA904FF86C7A541AFE0905D18E62867028E15AEC0B2CD46BF1 \
E939F5026DD82A60AA06B99A3726EA6D76C2D48DDB8B1DCB365249859EDDC8C0 \
CF23BDB1CA6203201206BDDC4844A36D52A10828D0AB77CAACAF7FA680E4ED5D \
5D325C265A49436A691A54BC3D068A80D33187B17FBC4923879760C34DFFDA8F \
BDBEF388A3B86E839E2A83DED9FE816238EEE22B2120BC39D7B26D3ECE4D5FA3 \
8B6808FC587DF4D1E0C579FC6DBF10A0CF4C6696CD5501336EC05C45927565CB \
9CB7626BF510D1EAAD21B208E76D55C15CBDCD36F4CA84A6939DE0C29539DE25 \
E8D17BC489CB723682BE518CC695B127922C88BF8DC99245DBC146512735687F \
079F458CDA31CAA064A3D5AD1020A849B4A587BC60BDDCAEE9517936D30FF11E \
362D524675648DA360224DF3719D6AD569AF9E6B309119E3262FD3189891A140 \
971350EB320109802A664216635F400A1086F8197841457126E2AF7A8AA46924 \
FDD717270BB3A0C4F1723C507B143830E80D691300A1B477E4383D975BCAC73A \
0C33BE5330C83247E330184F7C5E613227FD321A29AC50B75B93FC0B8FD51184 \
648F3305432FC0177C319508D1025C1331EF78ED56D3405DF70980C07756F4F3 \
686B0B0F110BCE4F9CD07463964B67AD7CFC05A6182A3B88F5E7C408C3A4E4E0 \
1B446212735D2F31F53EE1DEEDEBDD353534CF69179DBB87E1C689C3C688CF6C \
C94217963B796CC7CC47C37027B909C9E2C88D55458B838A87953CD0974CE348 \
651E6126416AE7A81C855B1C856F542D76F9252D3EE78AE37C9B6C576E72E2C2 \
71AD7542F22C2B106E3FAFB399864AB1F8B8263CA8D3311951AD0F4463964B68 \
1E96FEBD06E4857986E7146981484DC6DF3692397B68CF953876FD1C2F6E5A80 \
1FBD636D2912A833EA9024450A3ED43ED5D5298BB451578FB279B5ACBE47E35F \
0B1D1094DCEA8272DF55897BEE2440B6B90D0B15F259D0BD2B402D434FFFF2E6 \
79DA0921D748D31B963618DE2D8036D9F54F75BC61A26A9DA0F10E81E075CF5C
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xffffffff*64)
Key: r32 00
IV: r8 00
Rounds: 8
Seek64: 0x3FFFFFFFC0
Plaintext: r1024 00
Ciphertext: \
34A2B737751D19ECE0256B2BB87237F68188C02B10A6DC31939D4E5D319BD3BB \
EE280B968AD567C1F103089F4F7346D1FEA5DEC60DAF906C3C4E889BC49E0049 \
1CCC59A06308E05BE9D29E7288F166C58F2EE06003047710CBFDB7359DA916E8 \
43980F2C3BF39DF2A3E1F451BA18C37F986FF783075484265819602305557DCD \
B7BD167BDFD87E6E4DF89B2F110C9022F16325E2EC113E806A50774673CDB6AF \
B5BD48D1E66C7631EDB52D0941452DDBD67BC790A20CFE24213194AE75B2EE47 \
FE3B0698DD4E8DFA56E1841BC6F549097583143CB3A0D791C230D9C438EADCC9 \
F233969591EDF6EA904FF86C7A541AFE0905D18E62867028E15AEC0B2CD46BF1 \
E939F5026DD82A60AA06B99A3726EA6D76C2D48DDB8B1DCB365249859EDDC8C0 \
CF23BDB1CA6203201206BDDC4844A36D52A10828D0AB77CAACAF7FA680E4ED5D \
5D325C265A49436A691A54BC3D068A80D33187B17FBC4923879760C34DFFDA8F \
BDBEF388A3B86E839E2A83DED9FE816238EEE22B2120BC39D7B26D3ECE4D5FA3 \
8B6808FC587DF4D1E0C579FC6DBF10A0CF4C6696CD5501336EC05C45927565CB \
9CB7626BF510D1EAAD21B208E76D55C15CBDCD36F4CA84A6939DE0C29539DE25 \
E8D17BC489CB723682BE518CC695B127922C88BF8DC99245DBC146512735687F \
079F458CDA31CAA064A3D5AD1020A849B4A587BC60BDDCAEE9517936D30FF11E \
362D524675648DA360224DF3719D6AD569AF9E6B309119E3262FD3189891A140 \
971350EB320109802A664216635F400A1086F8197841457126E2AF7A8AA46924 \
FDD717270BB3A0C4F1723C507B143830E80D691300A1B477E4383D975BCAC73A \
0C33BE5330C83247E330184F7C5E613227FD321A29AC50B75B93FC0B8FD51184 \
648F3305432FC0177C319508D1025C1331EF78ED56D3405DF70980C07756F4F3 \
686B0B0F110BCE4F9CD07463964B67AD7CFC05A6182A3B88F5E7C408C3A4E4E0 \
1B446212735D2F31F53EE1DEEDEBDD353534CF69179DBB87E1C689C3C688CF6C \
C94217963B796CC7CC47C37027B909C9E2C88D55458B838A87953CD0974CE348 \
651E6126416AE7A81C855B1C856F542D76F9252D3EE78AE37C9B6C576E72E2C2 \
71AD7542F22C2B106E3FAFB399864AB1F8B8263CA8D3311951AD0F4463964B68 \
1E96FEBD06E4857986E7146981484DC6DF3692397B68CF953876FD1C2F6E5A80 \
1FBD636D2912A833EA9024450A3ED43ED5D5298BB451578FB279B5ACBE47E35F \
0B1D1094DCEA8272DF55897BEE2440B6B90D0B15F259D0BD2B402D434FFFF2E6 \
79DA0921D748D31B963618DE2D8036D9F54F75BC61A26A9DA0F10E81E075CF5C \
BEDB7A4CB8F33DDC71A836FE332D8DB08CF2833FD582E786CA57B1F5599B0FA8 \
887E279E3863471FA282308B542EDE7741069929FF92B7A12884C074C1FEC48F
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffffc*64)
Key: r32 00
IV: r8 00
Rounds: 8
Seek64: 0x3FFFFFFF00
Plaintext: r1024 00
Ciphertext: \
F75FC0AFC5A56D8F38FDFDD96233B42F926F5A21007D3412C7A28FEEED2B5401 \
07BCC1A5F8AE49260A63E2A5A7F547A56B4807DDCD63BAF082A40F57B3A36A6D \
B7B5E36ACFB9D060F2830903343264C1C3EC582110898C2650B559EE29B7411E \
87EE094887D1D8188563FF64F0755F1361381A6A1EF22D6B8732B2C9B7DE669D \
AC22DD35E273D76E47D60D19AD753F578C38D4A8E28BA9F6055E8E0A1D7A6E53 \
CDC46EDD57430E0EB14CF19CC107EE6DFF4836500383CD683CA2E8F11BA754DD \
34A2B737751D19ECE0256B2BB87237F68188C02B10A6DC31939D4E5D319BD3BB \
EE280B968AD567C1F103089F4F7346D1FEA5DEC60DAF906C3C4E889BC49E0049 \
1CCC59A06308E05BE9D29E7288F166C58F2EE06003047710CBFDB7359DA916E8 \
43980F2C3BF39DF2A3E1F451BA18C37F986FF783075484265819602305557DCD \
B7BD167BDFD87E6E4DF89B2F110C9022F16325E2EC113E806A50774673CDB6AF \
B5BD48D1E66C7631EDB52D0941452DDBD67BC790A20CFE24213194AE75B2EE47 \
FE3B0698DD4E8DFA56E1841BC6F549097583143CB3A0D791C230D9C438EADCC9 \
F233969591EDF6EA904FF86C7A541AFE0905D18E62867028E15AEC0B2CD46BF1 \
E939F5026DD82A60AA06B99A3726EA6D76C2D48DDB8B1DCB365249859EDDC8C0 \
CF23BDB1CA6203201206BDDC4844A36D52A10828D0AB77CAACAF7FA680E4ED5D \
5D325C265A49436A691A54BC3D068A80D33187B17FBC4923879760C34DFFDA8F \
BDBEF388A3B86E839E2A83DED9FE816238EEE22B2120BC39D7B26D3ECE4D5FA3 \
8B6808FC587DF4D1E0C579FC6DBF10A0CF4C6696CD5501336EC05C45927565CB \
9CB7626BF510D1EAAD21B208E76D55C15CBDCD36F4CA84A6939DE0C29539DE25 \
E8D17BC489CB723682BE518CC695B127922C88BF8DC99245DBC146512735687F \
079F458CDA31CAA064A3D5AD1020A849B4A587BC60BDDCAEE9517936D30FF11E \
362D524675648DA360224DF3719D6AD569AF9E6B309119E3262FD3189891A140 \
971350EB320109802A664216635F400A1086F8197841457126E2AF7A8AA46924 \
FDD717270BB3A0C4F1723C507B143830E80D691300A1B477E4383D975BCAC73A \
0C33BE5330C83247E330184F7C5E613227FD321A29AC50B75B93FC0B8FD51184 \
648F3305432FC0177C319508D1025C1331EF78ED56D3405DF70980C07756F4F3 \
686B0B0F110BCE4F9CD07463964B67AD7CFC05A6182A3B88F5E7C408C3A4E4E0 \
1B446212735D2F31F53EE1DEEDEBDD353534CF69179DBB87E1C689C3C688CF6C \
C94217963B796CC7CC47C37027B909C9E2C88D55458B838A87953CD0974CE348 \
651E6126416AE7A81C855B1C856F542D76F9252D3EE78AE37C9B6C576E72E2C2 \
71AD7542F22C2B106E3FAFB399864AB1F8B8263CA8D3311951AD0F4463964B68
Test: Encrypt
#################################################
AlgorithmType: SymmetricCipher
Name: ChaCha
Source: http://tools.ietf.org/html/draft-strombergson-chacha-test-vectors
#
Comment: TC1 - All zero key and IV (16-byte key).
Key: r16 00
IV: r8 00
Rounds: 12
Plaintext: r64 00
Ciphertext: e1047ba9476bf8ff312c01b4345a7d8ca5792b0ad467313f1dc412b5fdce32410dea8b68bd774c36a920f092a04d3f95274fbeff97bc8491fcef37f85970b450
Test: Encrypt
#
Comment: TC1 - All zero key and IV (32-byte key).
Key: r32 00
IV: r8 00
Plaintext: r64 00
Ciphertext: 9bf49a6a0755f953811fce125f2683d50429c3bb49e074147e0089a52eae155f0564f879d27ae3c02ce82834acfa8c793a629f2ca0de6919610be82f411326be
Test: Encrypt
#
Comment: TC2 - Single bit in key set. All zero IV (16-byte key).
Key: 0x01000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: 2a865a3b8999fa83ae8aacf33fc6be4f32c8aa9762738d26963270052f4eef8b86af758f7867560af6d0eeb973b5542bb24c8abceac8b1f36d026963d6c8a9b2
Test: Encrypt
#
Comment: TC2 - Single bit in key set. All zero IV (32-byte key).
Key: 0x0100000000000000000000000000000000000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: 12056e595d56b0f6eef090f0cd25a20949248c2790525d0f930218ff0b4ddd10a6002239d9a454e29e107a7d06fefdfef0210feba044f9f29b1772c960dc29c0
#
Test: Encrypt
Comment: TC3 - Single bit in IV set. All zero key (16-byte key).
Key: r16 00
@ -71,6 +283,7 @@ IV: 0x0100000000000000
Plaintext: r64 00
Ciphertext: 91cdb2f180bc89cfe86b8b6871cd6b3af61abf6eba01635db619c40a0b2e19edfa8ce5a9bd7f53cc2c9bcfea181e9754a9e245731f658cc282c2ae1cab1ae02c
Test: Encrypt
#
Comment: TC3 - Single bit in IV set. All zero key (32-byte key).
Key: r32 00
IV: 0x0100000000000000
@ -79,38 +292,244 @@ Ciphertext: 64b8bdf87b828c4b6dbaf7ef698de03df8b33f635714418f9836ade59be1296946c9
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: ChaCha20
Name: ChaCha
Source: https://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
#
Comment: All one's key and IV (16-byte key).
Key: r16 ff
IV: r8 ff
Rounds: 12
Plaintext: r512 00
Ciphertext: \
60E349E60C38B328C4BAAB90D44A7C727662770D36350D65A1433BD92B00ECF4 \
83D5597D7A616258EC3C5D5B30E1C5C85C5DFE2F92423B8E36870F3185B6ADD9 \
F34DAB6C2BC551898FBDCDFC783F09171CC8B59A8B2852983C3A9B91D29B5761 \
12464A9D8E050263E989906F42C7EFCAC8A70A85BB7FF2211273FBD4CAD96142 \
DB89BA6820D565E1DBA19B70DD2CEB8A9ECA55CA48B92B1B27D4676BE4985508 \
9AA6202B811799D95EA5A239C39861D7E4B56E0847C2CCF8FAAA3768268F80D6 \
87E6DA5D95C303A3A29D2AB10B392F223F426A1E5400D272083DE05B7BEAB22C \
46C667513885DE4EAB9A18660D1247ECFAC6EE049180A4E780158A29D4914F0C \
B87860D4C30C5F2BFADA2615D09907F7059BD6EA7278BAD8CAF57145B6C431CE \
E4EB781A9ADDB1CBDB0ADED70CDA2F195FF311888C9A23409A00529B654332BB \
0E566990895D96E264D56438619F515E29E023D0C434D56142A1916ED6529476 \
7DA1D97911C069FCBF711AA8682A9EA19A41F400BCDF6D9ABFDC518063F5F75D \
0060D6F03B9B78577B89C577643E69590518CEEA869665458E027EA27D002767 \
C22241E8E12C421623B86C667341E0C2E7E3F2FDCC058C26F9A64626CEDFDE08 \
35F6A77CF8BF99FB7ABCD3874366E3B8FDAEDF83B58701C08B1F39027A913868 \
CF84F5C9001701A6ACE8C05C05578E47CA7691F9058C8B7298B756B900BC535A
Test: Encrypt
#
Comment: All one's key and IV (32-byte key).
Key: r32 ff
IV: r8 ff
Rounds: 12
Plaintext: r512 00
Ciphertext: \
04BF88DAE8E47A228FA47B7E6379434BA664A7D28F4DAB84E5F8B464ADD20C3A \
CAA69C5AB221A23A57EB5F345C96F4D1322D0A2FF7A9CD43401CD536639A615A \
5C9429B55CA3C1B55354559669A154ACA46CD761C41AB8ACE385363B95675F06 \
8E18DB5A673C11291BD4187892A9A3A33514F3712B26C13026103298ED76BC9A \
19E1C370231E9F3351C2E71C5D0635D8E9908EBEBFBAA1F493C1ACCD015F7D50 \
4582C1B3D52449D7A707F5D136BF83E019643902FE052AD8577A037343E128F4 \
3514FED8B5B612EBDF26851DE269E2E2398358383CD0067864BFB4E835613E2F \
AA2B4759C7A615614176A133F6F30D063A64A8274A558773E537DCC0753A1208 \
9C90E1574D00E2E444EFC18F1CCFA8EC328163A909C45DFCDB1B92049B2D01D5 \
DEC0F6F102EB3E63B724B7B0ACD038962CA2A153E6B4756BFBB870D20D30C970 \
1EC3FA344E26B02D4CE834630D2A1889DF42F07D48EA08609FAC95DF29BAEF9B \
89BC66265947A35085F7C19BF30CA6019E48A736FDBB1E49236B3538F2F9FE98 \
2882B0524FD01F213F016326ADCD8503DCD928EFC1A02F824B9E9D998CD73EF2 \
5D52E6E6BB2FF8B0284C7565E26868EFD6C1A86DAD733417FB80606EB5BB3A9F \
5E16F52D6857A1A602A7FC6DDD578CA868F1E51AADD3209034A4740036DE08A7 \
A906067C997F01E4E334CBA913407C7A462A968B272834D2D66DF24922F4302C
Test: Encrypt
#
Comment: All one's key and IV (16-byte key).
Key: r16 ff
IV: r8 ff
Rounds: 12
Seek: 32
Plaintext: r64 00
Ciphertext: \
83D5597D7A616258EC3C5D5B30E1C5C85C5DFE2F92423B8E36870F3185B6ADD9 \
F34DAB6C2BC551898FBDCDFC783F09171CC8B59A8B2852983C3A9B91D29B5761
Test: Encrypt
#
Comment: All one's key and IV (32-byte key).
Key: r32 ff
IV: r8 ff
Rounds: 12
Seek: 32
Plaintext: r64 00
Ciphertext: \
CAA69C5AB221A23A57EB5F345C96F4D1322D0A2FF7A9CD43401CD536639A615A \
5C9429B55CA3C1B55354559669A154ACA46CD761C41AB8ACE385363B95675F06
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xffffffff*64)
Key: r32 00
IV: r8 00
Rounds: 12
Seek64: 0x3FFFFFFFC0
Plaintext: r1024 00
Ciphertext: \
D7A6AF50F1C92A29484252BBFCE206F17D01DD139530A3830AB583C1F62E0312 \
829361A19A8A956CEDEA380430FF932CD052DB5E9477835058B80A272406FC74 \
CC7B53DC11894D26240581B8A8F4F4E5AF406705801223B13F821FDCCBA6A618 \
8A63F8D3DC83CCBCED451F4BA4E0DAAB228ABB0D7439CC67E50DF7129F646BAD \
A0F5387AF3FAEC30DC25783285275137394EB539AF19DDC286C20DDFD252F85A \
5D1B9D76F6A4F4C97A49275C18DC040B77432865988C49D2EC9C4366BE926481 \
7F146661C007B7558ABB6C0B5EE94F722913A34AB3AB248031B5929DA1CDE7E3 \
B33DBF441151CD1770073C28D794351A4C42E6DC3B418ED7118BF314CF26AB99 \
E855F6C00854E00D63BFD389EDEA3D557C5016EEF3DFC00D8FF1FE76566AC486 \
51AF4F61CEE3290B007BE9ADF56C3DD30CD4403C78C5AF2603C60F8CC4DC625B \
44A2EB21492D383DF430D07E77DCEE44BA9DD8E806C7170D4AE3AD93586AD6A2 \
FD12501335D0AB7CE42675A0F3D129D25250537E544569EA4D659B052207AEEF \
F458FB1C81B45276B5A7A9BD1FA682FA4CBA0B9284291F11FBBAA363E7F4D1B6 \
9F6BB7FB3D7BBCF4E4C8F5722FE26DD5DE12E9A2722C71A075EBD5AE3BEDF296 \
1CD31D059EDB1E58DE97C9BD64A8C06F91F2699C47B950B3E4742E5423D6FA12 \
0F085C504E4A89F82C5ECAA2459C9F54057DEEE5CD201BF5B96BF1F7CC0A246C \
01EC149DCC8A5A59FCC7B38CE4EA15692CB65587D584414A8BC7EC9A982E92ED \
9275377792A06C5B8E594FFEFC630BA11209AEF8763531255E522B078CC8B4EC \
74BD3AFA9BC4A6C39B3B7A00A706BDD8FC24E97335BB22270BECDDB3E3580812 \
A414586C361D58A9F63836B3D458F2AC43A6099C4031F185E5FA7ACF6946D47A \
47CBA42630D0F39B741FBE29E105DF2DF833B790DE6E825DBF38123DE2C44521 \
A555300EA7FF7949DD19B09FFE192C109A3C132337B6ED69C50F552D658AB83C \
5A6966CAA246168FF5443B305CF53E1B601C44C7D402BEDB8BFFB066C9EC3B1B \
D886235BDFD5CD426323CCDF8E48A1EC39BCF51081683E54E68E7C680CA026DA \
7DC1AD922D2B8B28A815974A7D25FA363AF164A3359F88324E547EF36BE98247 \
E4A4698CAF902D5926EE148D0ED957AB34FE1BFAA82791B7BEB42E358611DF0F \
95FDA7D00918DC1CFA14AD34139DE2C14DB762F54BB5A475891C33BF4259B8CF \
DE0D19DA0CA374F40A48E32685C94795E085813D3DD3771C5B3B1EDF242897E5 \
DA6044325924559C49CC1F88957CEBB2E935772A831578604C898968F331B8D3 \
8B9CDE84C404515402C6A1D5E68C4115D86A571E1DD983CD56E8BF78A3C3C870 \
55674CAF12B50AD4A318899C62F0E549D24EB2FC2D63A57B1B9FA5474B7627A7 \
0DA5BD3D1899134E5546AF682E97517DD9C4FE5374C640DFCC134C5A4762FB1E
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffffe*64)
Key: r32 00
IV: r8 00
Rounds: 12
Seek64: 0x3FFFFFFF80
Plaintext: r1024 00
Ciphertext: \
0502A68D6D5350892D5EE33F1286AEA1897CE4EF1DFE002C49C3D27A497994EB \
7DBE6CA85D5E0C80814D4BA29D57FA8AF838DCC5CD3E62D0D62331D8DAB0B50F \
D7A6AF50F1C92A29484252BBFCE206F17D01DD139530A3830AB583C1F62E0312 \
829361A19A8A956CEDEA380430FF932CD052DB5E9477835058B80A272406FC74 \
CC7B53DC11894D26240581B8A8F4F4E5AF406705801223B13F821FDCCBA6A618 \
8A63F8D3DC83CCBCED451F4BA4E0DAAB228ABB0D7439CC67E50DF7129F646BAD \
A0F5387AF3FAEC30DC25783285275137394EB539AF19DDC286C20DDFD252F85A \
5D1B9D76F6A4F4C97A49275C18DC040B77432865988C49D2EC9C4366BE926481 \
7F146661C007B7558ABB6C0B5EE94F722913A34AB3AB248031B5929DA1CDE7E3 \
B33DBF441151CD1770073C28D794351A4C42E6DC3B418ED7118BF314CF26AB99 \
E855F6C00854E00D63BFD389EDEA3D557C5016EEF3DFC00D8FF1FE76566AC486 \
51AF4F61CEE3290B007BE9ADF56C3DD30CD4403C78C5AF2603C60F8CC4DC625B \
44A2EB21492D383DF430D07E77DCEE44BA9DD8E806C7170D4AE3AD93586AD6A2 \
FD12501335D0AB7CE42675A0F3D129D25250537E544569EA4D659B052207AEEF \
F458FB1C81B45276B5A7A9BD1FA682FA4CBA0B9284291F11FBBAA363E7F4D1B6 \
9F6BB7FB3D7BBCF4E4C8F5722FE26DD5DE12E9A2722C71A075EBD5AE3BEDF296 \
1CD31D059EDB1E58DE97C9BD64A8C06F91F2699C47B950B3E4742E5423D6FA12 \
0F085C504E4A89F82C5ECAA2459C9F54057DEEE5CD201BF5B96BF1F7CC0A246C \
01EC149DCC8A5A59FCC7B38CE4EA15692CB65587D584414A8BC7EC9A982E92ED \
9275377792A06C5B8E594FFEFC630BA11209AEF8763531255E522B078CC8B4EC \
74BD3AFA9BC4A6C39B3B7A00A706BDD8FC24E97335BB22270BECDDB3E3580812 \
A414586C361D58A9F63836B3D458F2AC43A6099C4031F185E5FA7ACF6946D47A \
47CBA42630D0F39B741FBE29E105DF2DF833B790DE6E825DBF38123DE2C44521 \
A555300EA7FF7949DD19B09FFE192C109A3C132337B6ED69C50F552D658AB83C \
5A6966CAA246168FF5443B305CF53E1B601C44C7D402BEDB8BFFB066C9EC3B1B \
D886235BDFD5CD426323CCDF8E48A1EC39BCF51081683E54E68E7C680CA026DA \
7DC1AD922D2B8B28A815974A7D25FA363AF164A3359F88324E547EF36BE98247 \
E4A4698CAF902D5926EE148D0ED957AB34FE1BFAA82791B7BEB42E358611DF0F \
95FDA7D00918DC1CFA14AD34139DE2C14DB762F54BB5A475891C33BF4259B8CF \
DE0D19DA0CA374F40A48E32685C94795E085813D3DD3771C5B3B1EDF242897E5 \
DA6044325924559C49CC1F88957CEBB2E935772A831578604C898968F331B8D3 \
8B9CDE84C404515402C6A1D5E68C4115D86A571E1DD983CD56E8BF78A3C3C870
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffffc*64)
Key: r32 00
IV: r8 00
Rounds: 12
Seek64: 0x3FFFFFFF00
Plaintext: r1024 00
Ciphertext: \
5892C27AFFC04BFF6D877D6958F973D7918E9423C8E92696658A8D47B7231F8E \
FEEC34D15E07621D51EE87D4FB3368483B3722B0CED3580C792C3988F781AF0D \
3460198B28EAB8115D4E75F4AD994CE2619B7942CFF8F862D77655A80F539097 \
4DB43CC4CFC895FECAD6465E81AF7174140D9D4F54A288A343EB1321207D4ADD \
0502A68D6D5350892D5EE33F1286AEA1897CE4EF1DFE002C49C3D27A497994EB \
7DBE6CA85D5E0C80814D4BA29D57FA8AF838DCC5CD3E62D0D62331D8DAB0B50F \
D7A6AF50F1C92A29484252BBFCE206F17D01DD139530A3830AB583C1F62E0312 \
829361A19A8A956CEDEA380430FF932CD052DB5E9477835058B80A272406FC74 \
CC7B53DC11894D26240581B8A8F4F4E5AF406705801223B13F821FDCCBA6A618 \
8A63F8D3DC83CCBCED451F4BA4E0DAAB228ABB0D7439CC67E50DF7129F646BAD \
A0F5387AF3FAEC30DC25783285275137394EB539AF19DDC286C20DDFD252F85A \
5D1B9D76F6A4F4C97A49275C18DC040B77432865988C49D2EC9C4366BE926481 \
7F146661C007B7558ABB6C0B5EE94F722913A34AB3AB248031B5929DA1CDE7E3 \
B33DBF441151CD1770073C28D794351A4C42E6DC3B418ED7118BF314CF26AB99 \
E855F6C00854E00D63BFD389EDEA3D557C5016EEF3DFC00D8FF1FE76566AC486 \
51AF4F61CEE3290B007BE9ADF56C3DD30CD4403C78C5AF2603C60F8CC4DC625B \
44A2EB21492D383DF430D07E77DCEE44BA9DD8E806C7170D4AE3AD93586AD6A2 \
FD12501335D0AB7CE42675A0F3D129D25250537E544569EA4D659B052207AEEF \
F458FB1C81B45276B5A7A9BD1FA682FA4CBA0B9284291F11FBBAA363E7F4D1B6 \
9F6BB7FB3D7BBCF4E4C8F5722FE26DD5DE12E9A2722C71A075EBD5AE3BEDF296 \
1CD31D059EDB1E58DE97C9BD64A8C06F91F2699C47B950B3E4742E5423D6FA12 \
0F085C504E4A89F82C5ECAA2459C9F54057DEEE5CD201BF5B96BF1F7CC0A246C \
01EC149DCC8A5A59FCC7B38CE4EA15692CB65587D584414A8BC7EC9A982E92ED \
9275377792A06C5B8E594FFEFC630BA11209AEF8763531255E522B078CC8B4EC \
74BD3AFA9BC4A6C39B3B7A00A706BDD8FC24E97335BB22270BECDDB3E3580812 \
A414586C361D58A9F63836B3D458F2AC43A6099C4031F185E5FA7ACF6946D47A \
47CBA42630D0F39B741FBE29E105DF2DF833B790DE6E825DBF38123DE2C44521 \
A555300EA7FF7949DD19B09FFE192C109A3C132337B6ED69C50F552D658AB83C \
5A6966CAA246168FF5443B305CF53E1B601C44C7D402BEDB8BFFB066C9EC3B1B \
D886235BDFD5CD426323CCDF8E48A1EC39BCF51081683E54E68E7C680CA026DA \
7DC1AD922D2B8B28A815974A7D25FA363AF164A3359F88324E547EF36BE98247 \
E4A4698CAF902D5926EE148D0ED957AB34FE1BFAA82791B7BEB42E358611DF0F
Test: Encrypt
#################################################
AlgorithmType: SymmetricCipher
Name: ChaCha
Source: http://tools.ietf.org/html/draft-strombergson-chacha-test-vectors
#
Comment: TC1 - All zero key and IV (16-byte key).
Key: r16 00
IV: r8 00
Rounds: 20
Plaintext: r64 00
Ciphertext: 89670952608364fd00b2f90936f031c8e756e15dba04b8493d00429259b20f46cc04f111246b6c2ce066be3bfb32d9aa0fddfbc12123d4b9e44f34dca05a103f
Test: Encrypt
#
Comment: TC1 - All zero key and IV (32-byte key).
Key: r32 00
IV: r8 00
Plaintext: r64 00
Ciphertext: 76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586
Test: Encrypt
#
Comment: TC2 - Single bit in key set. All zero IV (16-byte key).
Key: 0x01000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: ae56060d04f5b597897ff2af1388dbceff5a2a4920335dc17a3cb1b1b10fbe70ece8f4864d8c7cdf0076453a8291c7dbeb3aa9c9d10e8ca36be4449376ed7c42
Test: Encrypt
#
Comment: TC2 - Single bit in key set. All zero IV (32-byte key).
Key: 0x0100000000000000000000000000000000000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: c5d30a7ce1ec119378c84f487d775a8542f13ece238a9455e8229e888de85bbd29eb63d0a17a5b999b52da22be4023eb07620a54f6fa6ad8737b71eb0464dac0
Test: Encrypt
#
Comment: TC3 - Single bit in IV set. All zero key (16-byte key).
Key: r16 00
IV: 0x0100000000000000
Plaintext: r64 00
Ciphertext: 1663879eb3f2c9949e2388caa343d361bb132771245ae6d027ca9cb010dc1fa7178dc41f8278bc1f64b3f12769a24097f40d63a86366bdb36ac08abe60c07fe8
Test: Encrypt
#
Comment: TC3 - Single bit in IV set. All zero key (32-byte key).
Key: r32 00
IV: 0x0100000000000000
@ -118,3 +537,240 @@ Plaintext: r64 00
Ciphertext: ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111e4caf237ee53ca8ad6426194a88545ddc497a0b466e7d6bbdb0041b2f586b
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: ChaCha
Source: https://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
#
Comment: All one's key and IV (16-byte key).
Key: r16 ff
IV: r8 ff
Rounds: 20
Plaintext: r512 00
Ciphertext: \
992947C3966126A0E660A3E95DB048DE091FB9E0185B1E41E41015BB7EE50150 \
399E4760B262F9D53F26D8DD19E56F5C506AE0C3619FA67FB0C408106D0203EE \
40EA3CFA61FA32A2FDA8D1238A2135D9D4178775240F99007064A6A7F0C731B6 \
7C227C52EF796B6BED9F9059BA0614BCF6DD6E38917F3B150E576375BE50ED67 \
B0EDE573FD64189655C22A452CA343A3F63DE7A2BF75DB4BC5EC87AE6B3818E0 \
E4FB1DE2CC047982D6A9FEF37B9D3A11D6329AB81A9ED9FDAB565EE99DDEA1FE \
D207921A4169C3F1B212A886E6AE48FB19E9AF414915B087F9AF7F74EEA49732 \
ED08500D8EEBD8083F9101984E30D4162D3C0A8BE4F18B22491A61DF53A7E629 \
3406AF356940F23C66A4E2A4CE7284C30DCAC3C58B4491D755B02BC91F864E24 \
9097953A8D81737B8CFA80407571E3CC6BA716D1FAAD50209B737665563684B0 \
201D668B79D23D68BA41C92EDB2C66119C662E19B3A317FE1D7F4B7E52211FC2 \
16EE14FB9E7B063D8010036C5C18F73084448A514A4EA32A8FB74E40ADBDBAEE \
14F371872A3864D80695049098ED1B69E425E55BE5B27DD41255E24A27484CDB \
EBD332BCCFE8CC4FFC4669E2EAC7B6202BF1D966AA24C0110DFB80E68A12973B \
5A9793643E862A891DBCF2321F362B9977306405EACD5BB0CB09316803F70F0D \
2CE2AF1C267EB944314DDC515412600FCB7D0A3EC16FDD105F5A4C8507DB36AA
Test: Encrypt
#
Comment: All one's key and IV (32-byte key).
Key: r32 ff
IV: r8 ff
Rounds: 20
Plaintext: r512 00
Ciphertext: \
D9BF3F6BCE6ED0B54254557767FB57443DD4778911B606055C39CC25E674B836 \
3FEABC57FDE54F790C52C8AE43240B79D49042B777BFD6CB80E931270B7F50EB \
5BAC2ACD86A836C5DC98C116C1217EC31D3A63A9451319F097F3B4D6DAB07787 \
19477D24D24B403A12241D7CCA064F790F1D51CCAFF6B1667D4BBCA1958C4306 \
2D83C32143F7D743A87F710C3202AF7D30046775865F3934958597BB38FFE32C \
7C5B456E3E5457D203BB45D304D014D46709EA4DB71A935EFC388CEFA5B894E5 \
D1076A95EC7791AB0AD55C2A2FAC3C61E35BAE153036763326D632C9E004BC6D \
A45D5FC9486C29F002E40A7AB619DDCA1A660765F853C77E1FF44C2A4F49344F \
7530DC05190BD9A256FE38CEDE7DAA540904135BEC993088E712276467166A63 \
04F1FC26C9DDA89CEE93D15441C88FC15E143DB941BBB42424A36E5C8F5AAA49 \
2BFEED0BA93348AA786F40114F4895A6B21A11DB8937A510B2A099F75C1E03E7 \
A6E3E281EC9C66D400F36C232798C6496048028C8D7320F43E97A56D6C4D1183 \
8FD5DD8F45DF7DE235225B5F1C41C3AFED4EC0526AB38DCB8597770803F1261C \
D22CFEAEC86612E53DEFC29848C055053C6B1D462A3CF09B228E47211AFBA0AF \
4E4C2B336E6EE2F471823808523F073C1BC8785D258AC2BD580209A82A875273 \
93DF828B6A6728ABD7AAD0485BFF5CE92C8DB78B1E63929FC76A905E8C7AF310
Test: Encrypt
#
Comment: All one's key and IV (16-byte key).
Key: r16 ff
IV: r8 ff
Rounds: 20
Seek: 32
Plaintext: r64 00
Ciphertext: \
399E4760B262F9D53F26D8DD19E56F5C506AE0C3619FA67FB0C408106D0203EE \
40EA3CFA61FA32A2FDA8D1238A2135D9D4178775240F99007064A6A7F0C731B6
Test: Encrypt
#
Comment: All one's key and IV (32-byte key).
Key: r32 ff
IV: r8 ff
Rounds: 20
Seek: 32
Plaintext: r64 00
Ciphertext: \
3FEABC57FDE54F790C52C8AE43240B79D49042B777BFD6CB80E931270B7F50EB \
5BAC2ACD86A836C5DC98C116C1217EC31D3A63A9451319F097F3B4D6DAB07787
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xffffffff*64)
Key: r32 00
IV: r8 00
Rounds: 20
Seek64: 0x3FFFFFFFC0
Plaintext: r1024 00
Ciphertext: \
ACE4CD09E294D1912D4AD205D06F95D9C2F2BFCF453E8753F128765B62215F4D \
92C74F2F626C6A640C0B1284D839EC81F1696281DAFC3E684593937023B58B1D \
3DB41D3AA0D329285DE6F225E6E24BD59C9A17006943D5C9B680E3873BDC683A \
5819469899989690C281CD17C96159AF0682B5B903468A61F50228CF09622B5A \
46F0F6EFEE15C8F1B198CB49D92B990867905159440CC723916DC00128269810 \
39CE1766AA2542B05DB3BD809AB142489D5DBFE1273E7399637B4B3213768AAA \
89B1889375E99FE2442C4F68ADF54158F4B8135713D00999B92B38E3AAFE5FF4 \
959B1834BE3DC54FC36AA9D32EB121E0F688B90E7C7E2649F4AAEF407BDD2B94 \
09EFEC03114CB5D4FFD1788E0FE1897BD176C1311E368368C657A5EE55C9CA03 \
CC71744F030822D53A0486A97B9D98240274FADEAF262BD81B58BCE3DFA98414 \
C24B5BC517FD91993A6B2E6232B0502125C6F48A6921E2DDA8EB6B3C4ECF2AAE \
889602AD90B5D2537FF45DF525C67B983B51DBD23E1280AA656EAE85B63CC42D \
E8C70E7C19C1D66E3F902BEA9D1ACFD3326B5985AD7C8CABD431ACBC62976CE5 \
23C938EA447D4AF0F560DC52B0AB1D7D66A42AB8272E2C40BD66470FE6F68846 \
12A11D899A0B7EB54907BBEDD6483EFCED1F15621D4673FF928C5AAB5F465257 \
123679EF17C39648C537E150108E0F6608732E9F5B240689EEB5402FA04CCB89 \
B7CA9649A361C526B41ED110402D9497715B03441118BC4953FCBEF395267570 \
BD43EC0EEF7B6167F14FED205EB812907D0C134DC49FA5B18F5A3A3A9BD0A71B \
2FFE445EE4FABEB4054CC922BA360E4589B681F01E2A43B5A0C0F0C39A5ADB94 \
B3BC2D20FF7F287FDF17F53B7CB5E3A1ABD46FC0819A3559C03C6B4106603066 \
359A4A09B468B6DFEF8A363C7B31D9E88ABB85914F4A27C30E9915C66AAC3576 \
9E481C87AEE4C3138CF40F288ED3C172FFC17D3D78F8D32C3C756C13CFBFB95F \
3ECCE6D8B54344D78998F58148C4B43B1A6201ABFF3D4FB4B76E3BBA104CFAA5 \
5D8DA4319A9E0606644B07DC204E9635502186C1EF9E43322EFD69F86D4DA1F6 \
A98BF0B800BA04BD9FBA5C5BE8EC49D48D9EECBADEE669EF69C9522C730110BB \
8339AF0E45185262C9183307C5EEA59DE5095CAC26E8428D4CA9E44DCF8FC7B4 \
1F9624A2DBA36F44415BAC489BF46CB6BB1BD2B70D719772FDABB3B166EA615A \
BDF208C39BA8A708D933CBC8A3236D4A15629FCAA35E00C2B361527326E7AB51 \
409A7DE42C9093346E41D3A3C4529D9557BBC01EEFF927F1052B5E02F74542B0 \
4E78F1E933C67DBC2C9187527C86DA77F045D4B07CF646BA9547646905F1F117 \
0C503C0AEC51EC93F303D61756318EF5999B4B8EFE1C7D74B8FF0E9FD0BAEB55 \
585F41AADA7A83ED42153BF9D87349AD100D40D25B1B05423E56761A32DD01A9
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffffe*64)
Key: r32 00
IV: r8 00
Rounds: 20
Seek64: 0x3FFFFFFF80
Plaintext: r1024 00
Ciphertext: \
032CC123482C31711F94C941AF5AB1F4155784332ED5348FE79AEC5EAD4C06C3 \
F13C280D8CC49925E4A6A5922EC80E13A4CDFA840C70A1427A3CB699166991A5 \
ACE4CD09E294D1912D4AD205D06F95D9C2F2BFCF453E8753F128765B62215F4D \
92C74F2F626C6A640C0B1284D839EC81F1696281DAFC3E684593937023B58B1D \
3DB41D3AA0D329285DE6F225E6E24BD59C9A17006943D5C9B680E3873BDC683A \
5819469899989690C281CD17C96159AF0682B5B903468A61F50228CF09622B5A \
46F0F6EFEE15C8F1B198CB49D92B990867905159440CC723916DC00128269810 \
39CE1766AA2542B05DB3BD809AB142489D5DBFE1273E7399637B4B3213768AAA \
89B1889375E99FE2442C4F68ADF54158F4B8135713D00999B92B38E3AAFE5FF4 \
959B1834BE3DC54FC36AA9D32EB121E0F688B90E7C7E2649F4AAEF407BDD2B94 \
09EFEC03114CB5D4FFD1788E0FE1897BD176C1311E368368C657A5EE55C9CA03 \
CC71744F030822D53A0486A97B9D98240274FADEAF262BD81B58BCE3DFA98414 \
C24B5BC517FD91993A6B2E6232B0502125C6F48A6921E2DDA8EB6B3C4ECF2AAE \
889602AD90B5D2537FF45DF525C67B983B51DBD23E1280AA656EAE85B63CC42D \
E8C70E7C19C1D66E3F902BEA9D1ACFD3326B5985AD7C8CABD431ACBC62976CE5 \
23C938EA447D4AF0F560DC52B0AB1D7D66A42AB8272E2C40BD66470FE6F68846 \
12A11D899A0B7EB54907BBEDD6483EFCED1F15621D4673FF928C5AAB5F465257 \
123679EF17C39648C537E150108E0F6608732E9F5B240689EEB5402FA04CCB89 \
B7CA9649A361C526B41ED110402D9497715B03441118BC4953FCBEF395267570 \
BD43EC0EEF7B6167F14FED205EB812907D0C134DC49FA5B18F5A3A3A9BD0A71B \
2FFE445EE4FABEB4054CC922BA360E4589B681F01E2A43B5A0C0F0C39A5ADB94 \
B3BC2D20FF7F287FDF17F53B7CB5E3A1ABD46FC0819A3559C03C6B4106603066 \
359A4A09B468B6DFEF8A363C7B31D9E88ABB85914F4A27C30E9915C66AAC3576 \
9E481C87AEE4C3138CF40F288ED3C172FFC17D3D78F8D32C3C756C13CFBFB95F \
3ECCE6D8B54344D78998F58148C4B43B1A6201ABFF3D4FB4B76E3BBA104CFAA5 \
5D8DA4319A9E0606644B07DC204E9635502186C1EF9E43322EFD69F86D4DA1F6 \
A98BF0B800BA04BD9FBA5C5BE8EC49D48D9EECBADEE669EF69C9522C730110BB \
8339AF0E45185262C9183307C5EEA59DE5095CAC26E8428D4CA9E44DCF8FC7B4 \
1F9624A2DBA36F44415BAC489BF46CB6BB1BD2B70D719772FDABB3B166EA615A \
BDF208C39BA8A708D933CBC8A3236D4A15629FCAA35E00C2B361527326E7AB51 \
409A7DE42C9093346E41D3A3C4529D9557BBC01EEFF927F1052B5E02F74542B0 \
4E78F1E933C67DBC2C9187527C86DA77F045D4B07CF646BA9547646905F1F117
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffffc*64)
Key: r32 00
IV: r8 00
Rounds: 20
Seek64: 0x3FFFFFFF00
Plaintext: r1024 00
Ciphertext: \
98E5E54215C14F994E957FD3DD6A0309DFC3512CF12937F859A58725F16E9D4C \
3BFBA511BE065C2AE7452DA187096671731A9954137BA780B808F9E93C919871 \
582CB23E8F29E3B966B29D19E01A01DEBB32A8635CF49A1B178C3CD53CBF3EC5 \
12DD6174690DA38FDA7C125351035F99E61042C5DCFA0C312E002F0DC99962DC \
032CC123482C31711F94C941AF5AB1F4155784332ED5348FE79AEC5EAD4C06C3 \
F13C280D8CC49925E4A6A5922EC80E13A4CDFA840C70A1427A3CB699166991A5 \
ACE4CD09E294D1912D4AD205D06F95D9C2F2BFCF453E8753F128765B62215F4D \
92C74F2F626C6A640C0B1284D839EC81F1696281DAFC3E684593937023B58B1D \
3DB41D3AA0D329285DE6F225E6E24BD59C9A17006943D5C9B680E3873BDC683A \
5819469899989690C281CD17C96159AF0682B5B903468A61F50228CF09622B5A \
46F0F6EFEE15C8F1B198CB49D92B990867905159440CC723916DC00128269810 \
39CE1766AA2542B05DB3BD809AB142489D5DBFE1273E7399637B4B3213768AAA \
89B1889375E99FE2442C4F68ADF54158F4B8135713D00999B92B38E3AAFE5FF4 \
959B1834BE3DC54FC36AA9D32EB121E0F688B90E7C7E2649F4AAEF407BDD2B94 \
09EFEC03114CB5D4FFD1788E0FE1897BD176C1311E368368C657A5EE55C9CA03 \
CC71744F030822D53A0486A97B9D98240274FADEAF262BD81B58BCE3DFA98414 \
C24B5BC517FD91993A6B2E6232B0502125C6F48A6921E2DDA8EB6B3C4ECF2AAE \
889602AD90B5D2537FF45DF525C67B983B51DBD23E1280AA656EAE85B63CC42D \
E8C70E7C19C1D66E3F902BEA9D1ACFD3326B5985AD7C8CABD431ACBC62976CE5 \
23C938EA447D4AF0F560DC52B0AB1D7D66A42AB8272E2C40BD66470FE6F68846 \
12A11D899A0B7EB54907BBEDD6483EFCED1F15621D4673FF928C5AAB5F465257 \
123679EF17C39648C537E150108E0F6608732E9F5B240689EEB5402FA04CCB89 \
B7CA9649A361C526B41ED110402D9497715B03441118BC4953FCBEF395267570 \
BD43EC0EEF7B6167F14FED205EB812907D0C134DC49FA5B18F5A3A3A9BD0A71B \
2FFE445EE4FABEB4054CC922BA360E4589B681F01E2A43B5A0C0F0C39A5ADB94 \
B3BC2D20FF7F287FDF17F53B7CB5E3A1ABD46FC0819A3559C03C6B4106603066 \
359A4A09B468B6DFEF8A363C7B31D9E88ABB85914F4A27C30E9915C66AAC3576 \
9E481C87AEE4C3138CF40F288ED3C172FFC17D3D78F8D32C3C756C13CFBFB95F \
3ECCE6D8B54344D78998F58148C4B43B1A6201ABFF3D4FB4B76E3BBA104CFAA5 \
5D8DA4319A9E0606644B07DC204E9635502186C1EF9E43322EFD69F86D4DA1F6 \
A98BF0B800BA04BD9FBA5C5BE8EC49D48D9EECBADEE669EF69C9522C730110BB \
8339AF0E45185262C9183307C5EEA59DE5095CAC26E8428D4CA9E44DCF8FC7B4
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffff0*64)
Key: r32 00
IV: r8 00
Rounds: 20
Seek64: 0x3FFFFFFC00
Plaintext: r1024 00
Ciphertext: \
35C5DDFAD2617B5A6BEDDCE1AF0C115DBD221D7E6760D5520A74EEA6EB1F9C70 \
3307014CCC1AF56B7B72266E087C4193B4230DE3023D86CFAE19A9B71591E2C0 \
8513AFB2CD7D939B5703E6883D460489FF00E3CE6EB5E1ECA5E31B2A895BDB85 \
6B3DE177489BDFDD97AB26141F94C771EBB94D187F2BF64172D3DC5F6FEB7123 \
4C0715DCF16BA0EDD15E8505FA3A97DA766C9348030A4BBA5734617027FC9E47 \
1125AA19C74296AC9CEA414955EBF0F6781E447978F287C1201A481A07BB0F92 \
D7865365B38F87A915FC08A8925DB1124A6477F01B88EB0687606A8C53155E6F \
128FB6FFD03F83BFF2C719A94438CEF64219E1DEE94AD2371985B45BB8544335 \
BCF1CBBA01AAD69D86140AD06553B30817AC31AD88CCE6DC45E493BCF7903955 \
B4B4EB4EFD1537B6BC772AD80CCBC2721A5359A143B999FFFB5F85F9C46A1938 \
73554FD4FD66962C08D661323BD13E367EE6E64B0F7843BE9B91BD285184350C \
F9FF7710208FEFFB7B7F75E46504BC4EB1DB05021EAF656528F5D04C60D71152 \
7C307A8EDA4DE7F391B9924BC18EF13E4ACEF8622C724A2CDA344214415E0613 \
9C057CA6FD78417F38D7C86B53D3484F085397A21594409ECA7C5D193802D33C \
FD1C44E7C93185B3D8101E4A0C184B13F221BF40097A9C0DBBD5932D90BD342F \
A6F56654A7507E902AD9416EC69D692E19372707F530B4998BE876CD772B3933 \
7035102B0F813905C4339FF8F0DC621CA2BC76F6A99163E0751BE6F7968D9C22 \
863A2161DE3126ABB102FCA8AD47A035EA71358F1C418D2BA8AF1AFCB8CEB20D \
FE012D699B31D5F22828772A13A076F789B4B582E9736CDFA48E317AB1FF5443 \
60745F9EFF11847EB86365DC0AB980231B0ACCD8DA22E33867A6C2314D56688E \
17F6EC119B6AD7FE0A639F07EE6F7C0B5B88E8D0C97EC901636A7B62202D40D9 \
176CF64365065EE642430787DB981190A249B7771759157BA8AA3A253C48338C \
9E01BE363682292BB181A75A51C2EEB3069951075DC92CFE58E695AB35364667 \
1336BE145FE90B8C75982D565762F7C48B505B19868F36A6C3633450CB9E165E \
98E5E54215C14F994E957FD3DD6A0309DFC3512CF12937F859A58725F16E9D4C \
3BFBA511BE065C2AE7452DA187096671731A9954137BA780B808F9E93C919871 \
582CB23E8F29E3B966B29D19E01A01DEBB32A8635CF49A1B178C3CD53CBF3EC5 \
12DD6174690DA38FDA7C125351035F99E61042C5DCFA0C312E002F0DC99962DC \
032CC123482C31711F94C941AF5AB1F4155784332ED5348FE79AEC5EAD4C06C3 \
F13C280D8CC49925E4A6A5922EC80E13A4CDFA840C70A1427A3CB699166991A5 \
ACE4CD09E294D1912D4AD205D06F95D9C2F2BFCF453E8753F128765B62215F4D \
92C74F2F626C6A640C0B1284D839EC81F1696281DAFC3E684593937023B58B1D
Test: Encrypt

View File

@ -0,0 +1,471 @@
AlgorithmType: SymmetricCipher
Name: CHAM-64/ECB
#
Source: CHAM paper, Appendix A, test vector 1
Comment: CHAM-64/ECB, 128-bit key
Key: 0100 0302 0504 0706 0908 0b0a 0d0c 0f0e
Plaintext: 1100 3322 5544 7766
Ciphertext: 453c 63bc dcfa bf4e
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: 0277 0a9e a270 1fed 460c c269 9163 e519
Plaintext: 704a 4e91 eb9b 688d
Ciphertext: ceda d4dc 00e3 800d
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: 24cd a3e2 c167 92f3 40b6 0017 cabc 07c4
Plaintext: 115a 31e5 ee65 87f7
Ciphertext: e1af b96f 3079 4233
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: 0914 eef6 827c 21b9 c697 05ce b28b 7dd5
Plaintext: e722 2e2b 0f2c ee49
Ciphertext: 280d 763b 931b da81
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: 2fa2 fb02 1cd5 9124 ee27 1ec9 7307 6a13
Plaintext: 9fc0 8c64 f9f9 8163
Ciphertext: 0277 8604 1b15 8cb9
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: 6035 af8d 6d97 6a47 1bc9 cb88 1a4a f2aa
Plaintext: 657b 5980 aad8 468b
Ciphertext: 5684 2bf7 606d 67f8
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: be3a cf23 eda6 9014 023e 098b 37c3 9b9e
Plaintext: ff83 911e 2f35 84a5
Ciphertext: 9263 2bf9 9819 783a
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: ffde 8a15 21c5 fb5e b6b1 1ec9 05aa c629
Plaintext: 7802 c7a5 d52f 1868
Ciphertext: f810 fad0 80f0 19bd
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: fc25 b83f 5058 9cb6 fe7a 5d6c 1635 5cfd
Plaintext: 1ab2 1791 a5d3 05aa
Ciphertext: e733 fd94 c357 d36c
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-64/ECB, 128-bit key
Key: fae3 5e23 e357 3e33 4468 c725 80e5 4a6e
Plaintext: 5dc5 c55f 6b8d 31e2
Ciphertext: 5bc2 2475 f93f 6cc8
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: CHAM-128/ECB
#
Source: CHAM paper, Appendix A, test vector 2
Comment: CHAM-128/ECB, 128-bit key
Key: 03020100 07060504 0b0a0908 0f0e0d0c
Plaintext: 33221100 77665544 bbaa9988 ffeeddcc
Ciphertext: c3746034 b55700c5 8d64ec32 489332f7
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: a37beb01 15c49898 906f6f1c 73f68cf3
Plaintext: 463e4b34 efe3faa8 d8b74450 967f34d1
Ciphertext: 30269e99 4d70c5de 7b0bc631 a96a1458
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: ad97ae34 49a65961 46872c23 08a85a00
Plaintext: 7c241f66 85111245 83d76a6f 8498946b
Ciphertext: 633b6cb9 00b390d8 d1bb84cb d84b9ccf
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: 012ddb51 d216a550 3b1632f3 69930aac
Plaintext: 440a7ce0 23b8499f 991482fd e6069cbe
Ciphertext: b2b21944 81c5becf 091d3c08 ee6d1749
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: dfd8192b cab7764c 12632c23 95c96b55
Plaintext: a72c2040 1e652249 6ceb83be d90a2816
Ciphertext: 0416aae7 302a5219 cd20a3b8 6d879c22
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: c3fe465e dff5a38c 308bcf68 a6d45ba7
Plaintext: 91167a4b b9641eb2 15195841 f3301521
Ciphertext: 36d1dd06 e42c583d 9aea8e58 08ee2f3b
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: e7365921 729a2e4b 5e9e2d42 6b53c079
Plaintext: 9fd5fb98 d2de3459 42cf3edb 2104e849
Ciphertext: 60f3dd59 406e579e e45a2191 526c5693
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: b880a315 e410aa2d 9d8686e4 ac033a6e
Plaintext: 05251c25 354ded83 67d50c4c 4a73b66f
Ciphertext: e3f879f5 8b41baf8 8b458da7 04343a03
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: f0cb7d27 58d7ac44 937b882d 526fb9f8
Plaintext: 088ede84 315ef415 2e2e22b1 8b45e765
Ciphertext: 4ff2532c 66a12b2e 869f476e aab2d53f
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 128-bit key
Key: 28b841b2 9a5e552c e02170c8 fee72a87
Plaintext: 0fc61c4c fa1db413 9d007659 39df2ba9
Ciphertext: 6fd504e7 091aca2e 32c88718 3e40b4a4
Test: Encrypt
#
#
#
Source: CHAM paper, Appendix A, test vector 3
Comment: CHAM-128/ECB, 256-bit key
Key: 03020100 07060504 0b0a0908 0f0e0d0c f3f2f1f0 f7f6f5f4 fbfaf9f8 fffefdfc
Plaintext: 33221100 77665544 bbaa9988 ffeeddcc
Ciphertext: a899c8a0 c929d55c ab670d38 0c4f7ac8
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: 4031c291 53a38799 8e0a6bad 6098a6c4 e4a852f8 7daf676e 873c3524 e1527db8
Plaintext: aac76bc0 ec99e00e 9648a939 1a37c8db
Ciphertext: c993c682 1545b60c 456af36c b97628e7
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: 0c7be271 0ee365ff 061b8e43 5dbc63e3 52a08866 634223c9 8f4bcc4f a1223aee
Plaintext: 49eec4dd eb938769 a359a6bf f69353a9
Ciphertext: 6252cf6f 6524f0ed 0b3a272a 33827bb4
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: 90c69c18 8fcac90f 7c061078 036f3279 5676641c 40358d9f d74867ca 5debd8fa
Plaintext: c27e5d18 985bd57e 25b7164e 5acb6ceb
Ciphertext: c7c15e12 2287fd3d 45875c14 629a042c
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: f7bae93e 170bbccd 42a1d993 a6247a9c ae609194 075045fc 95b22ad9 59e16c9c
Plaintext: 87cc88e7 9f159afe b2e8967b ff1ddd8b
Ciphertext: 0887e541 4b68e67f a46d19ff 948290b6
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: 15747f3e 359c8462 151d0e6d f06abade 06f246e1 c817332b 1fa9102a 52263db4
Plaintext: 5c11eab6 3fa257df 7da90d0e 1bf46991
Ciphertext: 3cabb22e 79c7ad8e d502abf8 74e7d3bf
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: 4c70d578 34042fbd 8f4b7c40 89ac864e 1dee8bac 4093f375 308aa073 655098f1
Plaintext: 68c7097e ab6c6043 87d2bc67 41dece87
Ciphertext: 362a9742 dd8238a8 d916409a 4a3c11a1
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: 073359a0 5e54c5f8 882ef21f 01be08d5 7d5c5b87 533059a5 204e2bcd 5652dfc5
Plaintext: ef94e8fb 7bf2aa7c ac73ef0a 294ad1f8
Ciphertext: 5914594d db44ba25 ac0bfc05 1b92a9fe
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: dc359e46 f5516d84 89885aee 191494fe 25350de0 69275496 1531e563 59f9e0ee
Plaintext: d1c5fbd0 7d1e85fc 7922d741 6a5a44dc
Ciphertext: bbe95a67 06b38ff2 898dfda8 41fe29c7
Test: Encrypt
#
Source: CHAM reference implementation
Comment: CHAM-128/ECB, 256-bit key
Key: faf3682d cf6e656c 53bd8c06 de0f7f71 678c5a2d 34624762 d88daf37 21d5ad6c
Plaintext: 55b32441 7a787fbc 41b91ab2 9a5bf734
Ciphertext: 2a7dab0b 6769e989 61578998 7e4be9a7
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: CHAM-64/CTR
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: e6b1 552b 7d53 c0d9 8c7b 18a1 b2ef 03bc
IV: cc03 c902 5780 5f72
Plaintext: 83d2 797e 69c6 ecd4 8fce 53fa c686 6389 d3dd e2b7 1f4d dee0 5cbe b3b2 2064 f8e8 226a 5f52 08ea b683 bfc9 ce0f d268 036f 94f3 60d4 8426 8d2e f8f6 c70c f4a1 95d8 5a4a e07f 1bc8 c339 4420 ee04 1460 9995 727f 284f cad1 ad41 9c48 9c8d 8bf4 9ef3
Ciphertext: 0fee 544d 6d11 f5c6 44b4 42b6 9513 1617 ca6d 4036 7ffc 5ee0 6312 5896 3012 6b3e 67c3 031a 0c57 1dce 4be8 7888 cbf5 b12e 4b9c 503e 1cfb 76c1 31ba 5b4e 3673 5e1a bd0f d733 4736 1668 f040 f74f a9c7 bdbc 1fda 5e1a bdec 952b 3f64 9750 c7e8 f11c
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: 780e 51d6 3741 ca88 8419 7f61 8062 2904
IV: a7e8 db3a 9264 ec0a
Plaintext: e7ef e7b0 66df b955 580f 6575 881a 06a2 98c2 9f13 40a7 0121 df40 567b d4ae ba67 0446 944e 1cf8 1efd ce4b a7fd 139e 35fd ffa3 ed21 52db 5bb1 0332 4843 6903 5c28 a1c4 70db f7f2 81b0 6d7e e754 448c a220 3a38 6f30 d6df b5dd 9db4 9426 1c15 7aa4
Ciphertext: 0b95 d934 ea2e 9a67 d37b 8f0f 2d91 7c3f e1bc f6d9 7ef8 a7fd 1ee8 34c3 2cec 7a6e 502a 840e d48e 1f9d 4795 c57c 4ec2 e762 50ce 8e25 e5c5 1b5a 00d7 a203 f453 63b5 d5a1 1c81 4a7a 21f9 0e1e 82ef e41e 4bb7 5b7a a273 164a d8bb 6a9c 76e7 0206 6131
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: def3 7285 6fb2 9ca8 37a2 15d2 4190 c3dd
IV: 2d70 2927 e2e5 6b90
Plaintext: fa0c 3a8c c423 cf46 d8ea 9fb2 2b06 bf16 76ce 84c1 96d9 0795 c09b ecd0 085b 584b 3885 1684 8346 d510 7ad8 d7a9 519c 3b3a d681 3ca3 4e98 61c4 8ff1 142e 2064 33d3 5e61 dd63 206b c4e6 9008 1db5 0abc 249e 4e96 77a4 2764 bce7 dc93 e291 a058 d54e
Ciphertext: dd2f 6c48 f2f0 3915 1be6 9c0e c0f9 510d 1640 de08 152a be0f 4a07 abf1 01ee 5bda ffa3 a59e e22e 1953 8c3e 6cc2 b9ea dfe3 d721 9a32 c4e6 49c0 cfb0 7f1e ad69 9c99 03be f145 c958 d917 d0ea 2503 ec08 ab39 4390 1afa 2e5c 3c13 557c 243b ca75 a703
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: 646f b394 917e 6f3e 03f3 f14a 4bea 460d
IV: f92d 20d9 bc67 75f6
Plaintext: 83db 8ccc cc49 6c58 55fc 79fb d0d0 52b5 5b7a 9378 9d40 e281 777c 0ecc 3c82 99ca f513 ed1a 7740 d0ea 535a 76b6 2f43 0dfe a5dc 937f 878d 95ef f07f 7900 fff7 7c00 e24f 9477 e173 486c 26ef a74b 228e 0f28 2dea feb0 069b e877 ea11 017d b47d 5a79
Ciphertext: a28b d8d4 e2b6 f076 716d 5769 46de 6fad d74a 3438 dd55 c72b 282a c910 0808 c0dc a421 9991 6f45 a3d0 8d85 864f dfc7 8b4c 69e0 ebbc af39 1a7b d620 5a85 ce9b dee6 4cc1 b88a 742e 5907 ad01 fac0 31f7 01bc 0213 3c40 b2cb ab50 00b5 6ae3 b7c1 3fce
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: 9698 a9eb 7003 b35e 47c6 0c0d cd55 fd4d
IV: 96c3 a41c 421c 955d
Plaintext: e7a4 ccd0 0c2d 1f30 e329 1182 dc55 7f92 5e1e 4df1 a77b 4626 09ba 7541 d1f7 6b64 48fd 4cc9 4539 736e 4066 a6db aa62 9617 d3b5 2d14 e414 3981 a911 85c6 93f7 cba4 2976 3ca8 d3be f5bb 6437 ece5 68b9 294f 2ea0 dd4c 3054 b6d0 947a 75d8 9d11 cc78
Ciphertext: 28c8 d228 36f6 0e5a d9cd 7a8a 8375 3bd6 66e8 beb0 5d64 7d9a d309 d89e eaee b4fb 41e5 d199 c70c 7e33 271e a1ba 8160 e4f5 b720 33ef 96b4 0467 e52d 791a 1983 c2c5 88c3 50ef 9b1f a465 75c8 92c5 9f1f 4715 8c7e d6c9 ee9e d073 8c00 cc9c ce0e 77f5
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: 86fa 2b6b d8fc 8486 0c11 f1c2 5b75 ed8a
IV: b318 e5c2 5583 338e
Plaintext: 7860 ba79 52cf e4a4 cc26 4aa5 71d9 7b2e 9273 9a86 38ba 2bec 3ced ddf8 01ed edd9 2786 6e13 e1a6 0a89 92ae 2a09 eb91 c0c4 0006 0a38 3b7a 3ab5 ec0c 9f1a 33f3 e10a 2b75 6f52 8393 31fd 89fb 9697 cd7d d6d3 c33b 988d 9889 dc01 53cd 2f20 be29 811b
Ciphertext: d7a1 f7aa 05cd ce1e 2fcb af67 20eb 1c10 0cb1 45ad 7873 5e7d 0798 4efe fa17 cf54 cc7d 7df1 ec9b 992a f396 50ca 444e 7c98 0608 53a3 6114 d3b0 ec1b c375 6eef 246f e1c4 905d fedd 4df8 c3b1 f177 b948 822d 2243 7311 0d4f 3e8d 95ae 32e3 4457 1edd
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: 5ea8 a98f 6f23 329d 6a36 d40e af1d 2d07
IV: ff5f 72e2 b9f0 5565
Plaintext: c4c3 1942 dcc1 40a7 00a4 41fc 4be9 d17a 1e6a 3a9f 7bb7 7d3b 7a94 a9c0 5dd7 4608 c98d da75 d556 8642 fc98 a0b7 9482 8849 7c0b 80f1 bea8 fdd4 fc73 aa52 3edb e09d 4414 4952 6831 fa9a 5b48 45ac 0e36 0ce3 a403 3089 b7f8 99c0 394e c429 c945 98b4
Ciphertext: f93b ed37 941f ece2 1a89 d7dd a11e 8c51 e239 e5fe 70f9 15c8 ac4f c647 60a4 144c 5bd7 4598 822b f4de 3c5c 089f 503d 06c5 bcdf 258a bfa6 c53b eb6b 373c e03b 7438 e626 138a fc4e 3962 352f 33be 7e05 8357 1268 d621 4bc8 5926 737a 056a 8417 5504
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: e764 1ae3 84bc ca20 88ab 0eb1 8cc5 cc7f
IV: e1ee 11cb b0de 4400
Plaintext: 0a44 7fdb 4dba 1167 c521 1521 5637 d376 3bae cab2 ac86 b087 1cf1 44df 4a43 e77f fd74 7687 ee78 d418 60c4 20ef 9ee9 0fda f972 a4c8 3012 56db e159 75cb fc8f 5d16 8f37 749e bed7 b321 5357 998c d35c c3d3 00f3 7038 2aae 386e bcf8 bc0d e2bc d331
Ciphertext: 9597 b5be 01f8 6981 098a 3f39 9b4f cfc3 27c4 4b89 778f f2f5 2327 c822 b0fd c49d 84ca 1bec ec16 03f8 5031 39ee 9276 41b0 f086 f2fd cbd8 0d09 a6d7 bec3 5112 6f2b 153b 0ab9 92da 8b4f ad6a 3555 7a59 9b65 311f 5277 b50d 4280 7c04 f663 eea5 9d17
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: ba7d 1f51 ccd2 1431 e906 310f 981b 66c5
IV: e41c 02a2 0889 1101
Plaintext: 28d4 c1d4 ccaf aab1 da91 785a 4b78 a976 6468 b2b9 7422 94c1 aed5 793a 85f3 559a 3720 9197 319b 6756 c8bf 782c c0e4 5297 421e b1d3 8837 6a44 32fb dadd 3a0c cccc 2007 d464 17ed 1743 32c4 771b 27c5 afa5 804b feb9 5e58 cb91 137b b931 bc5d ecc7
Ciphertext: f22c d112 f7f8 ef29 c47c 45ad 10a4 d781 1138 110a f9ef e229 10aa 1067 2bdd b937 c904 79df 776b 49c3 e52d 6e6a 1cdd 8e1e afb9 f3d5 7278 2083 777e 931e 028a 27c0 fa73 4bec 8114 0dad 4e8c 2490 223c e557 67bc 07d1 f135 9677 da11 05e7 e09c 4473
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-64/CTR, 128-bit key, 12x blocks
Key: 9b58 14a8 d670 c7ce efbb 5e8b d970 9858
IV: f410 81e9 16d4 704d
Plaintext: 032a 730c 0ba7 1b1e 295e aa2b e229 1bcb ac2d 647b dde3 b1d6 e928 8416 68dd a420 0721 4f46 ab83 0841 68cf 27b8 170f 840b 999d b682 e602 9ce8 b325 caeb 5147 8864 cf38 8a04 56ae 5bf7 f9ce fc82 eb4d 0c03 623c 9870 c5c1 c633 e2ef 4c74 b38f fb67
Ciphertext: 9a4e e2d4 e282 8196 ef45 9e91 60c7 9c1c 2bc3 b165 090b 9fe4 b128 dff1 404f aaca ad6f af95 c545 b574 65d2 6170 9e49 315c 494e 1f62 7090 993a 84c2 be20 f269 450c 9c2f d490 97db 6b72 0bd6 2eb8 271a 8588 f59d 6b7b aa20 25b1 ad39 8997 a7b4 9639
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: CHAM-128/CTR
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: 23dec910 8674de3b 42d4febc ebac3ce1
IV: 434d3806 61578dab 9b8aaa69 2c242a3f
Plaintext: c0933ebb 71c2d940 5f791cda 6c89ff00 9a85507e d696c654 184c5df1 55836873 026b8e7b 5a2497ab 0f67805f 00700588 53840541 b59e0ea6 d16c5798 7458b715 6dc1c5f1 38d2f6d2 02652957 edd26b64 c711733c b772c1cb dfe376c0 4e37d724 4699ee4f f66152b3 76eb3fd3 8f094e03 fb47286b c775073a 9907361c 8c517c10 959a867c 20b11002 34485076 5bf8bb83 9fdd016e b7221cc4 32533042 612a39fa edebeecd 20b14ec1 6c0b9075 03496693 010c146d ea7c7f80 92b1d4bd 4d209707
Ciphertext: 75a7c6a7 6b72d94a b083627b 0d5cb98f fee0e34c adf15e52 6348f350 4e1ab4a2 a9de3226 2f4beb61 01f544ab 3ad609cf f65c1ffc 24d7f132 0d43aeb2 7ff715cf 26c78de4 6d6c3c9c dccab249 cec4858e b1e27ce1 2b4f455f 5c5bf433 c4010664 b0b9f2d0 b3d765c3 fc9b914d f463ddfa 8941880c c728841c e18cb64f ac9a5018 2ac7920a ddc0b973 98fa8428 8a4d19aa 7eebcb4a 0470c8a0 ef10edeb 68191a86 c39c48be 929c00ba fdb2d807 89d6beb7 9037bcd1 0eead8c4 5df80281 d4275481
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: fc461d9f b81c669a 2dcd9b60 dd0dc803
IV: 3a03a72a dd47db7e 371ffb90 1ecd7ef4
Plaintext: 1df4d2e8 e9b59fbd c710ea90 7ea88dfa 1a05307e 8d883c92 f5eff3cf d8eb3dac b4e1fffd be4bb41d 2ad2851a 21f80ea6 e52a3c36 68eb5ba2 6be06596 ef25d7a1 f6b422f1 ce996156 2623e690 f54b2163 ee5b49f1 cf5afebd 88bea2d2 619d8861 3ed4c062 bb1dadf4 28ca3301 735cecd9 ea77113b 31ac1736 8ac8dd46 b1d6d677 312e5318 e84f0036 83133f06 82114d09 448bedcc b134c209 2f5ec84b 6019563e 524f00ed 22a33d84 2976d662 9a46cdec 1911acec d029089e 0c552e22 6ce69283
Ciphertext: 34d5eb84 1a736580 030345f0 dbcb1347 05f02931 954c6fdc 0678019e 2dbad83d 4811b8ab 29595196 9e533b24 278ed0f1 df7d7578 efe356b1 e813abef 148c2560 38fcbee3 6cbcef7f fc0df407 867e7031 9e0b1dda f5501321 a67c22ed c43ecd72 6f6e6c2c 604c3516 bd1e726a 442eb1bf ffaa884b 2742b064 56f7b3b2 36cf6fbf 777b3ce3 f253c05c c882ce7d f4be285f de75d1f6 e0c336da 4bf90ce9 0f2ac558 fc0308c0 3c82176e 2a34b65b bea97726 05ad2e86 58e47259 e1e45834 6947fd40
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: 82e9a10d 1275c400 ef4b1b7a 09c9a74f
IV: c8af984c b4c6c76f 17a2bdce 755d304e
Plaintext: 0b68525d b1bca784 3ef3e525 53c26903 48ddd25b e57587d2 7eaa1ae3 961a006d f3a86cad 0efae3b1 06986845 820b3ee6 4a2bfd22 ab0785ad 923a5c17 551dcc0d 95ca064b d6735935 26a46210 3e3ae41e aeb4b483 d096b043 4d5a7641 5d1bad27 2d211a24 6b862534 aaab034e c4da88c7 5fca22f1 d535c1a5 73f58b5c 083b6720 a50bfa9d 900fdf55 43bb9e36 a0134bd2 42257406 11c4ec3d 88e75774 4a418cc4 1fca2198 814ed5fb cddcc438 0e9438d0 cd421f15 7295de50 72dfc2da e8f5ff6d
Ciphertext: 376d284c 6c3c8b99 67a2d66f 61a9f51c db6f06e2 a4cbda9f 6f48e1fa 695df3cb 7c0563da b6810ba0 291cc0fc 48d337da cbaf9363 9bce9399 7635dc4c 3ad49fd5 f2388208 da515f23 af4177b9 2be7106d d7cf8b5a bd5bbaef b2c8b5da 6610dbe4 65ef3e7b dda5425b c1fd36eb 98f9924e a1fddd39 c9390a3b c8886349 58a66f72 71162967 e9eac4d0 1f0212a2 32ff7b07 643839f2 dd87e6f8 410b4bbe 2afc5d5d 93f040e0 f4f74ad8 c498a1e1 6567520a 8ee926ed da431740 a4c7e2e6 e8f6408a
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: f6c062fc 108d2c2f d5a50b83 c7c7982f
IV: d0c429d8 fcd33338 6c702644 fcfe6f6d
Plaintext: 4bdd5fc1 c43f4c91 ea72162b f57a4ce1 58a599d6 c1dce0b8 6d2d853a 870e62d6 e173e45a a6f6b83b aeff7994 271b14ba 8e7b9d3c 792a3cf5 c86cafab d85e126d 7b5eb348 f6e56c92 f56c87bf 8daf9b83 2239af83 55693192 6f7571b1 e9788d2f e8ed3a51 3ec51868 4651cef3 406c460b 1c53a133 32a34441 4429fb6f 0955ae2c 59905104 5d5c32b8 381d0383 22065578 34e9e5d4 7450f0ba 30ae8b2c 8543699c 3e470912 dcd2c277 e1360e61 ba6b54e9 3d1a04e0 223f1e97 bcce2ca9 fd519ead
Ciphertext: f7d445cd 34467e43 64ca1cc6 d0f24671 91653b80 af0088cc eaaf9813 dc78fd96 6e66484f 02e2e364 ecca13a6 bda61d73 41ada198 97ac9657 fb928e06 95938089 2ce965e7 2c61620c 07b5753e dbd7fce6 81eee3fa f9b06db3 62a8b4f5 1ef865ac 8f7a7459 f74511a6 31a8e6b9 b8fb7628 5d1a1877 40a49e26 4fd3431c e9bbc8ed 2eee705a 8754b6ee 1ca2bec7 89956c0b ee263189 27edfa9e 4b833f84 156e849c 667516ec 079ec133 a95e6796 24f038b0 99b85ae9 c62790e9 9aef8174 ea4279bc
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: 14fb7484 293745d9 0f08dfdd 7d3f3859
IV: 3e75b2dd c7b6535b 7112f3a3 74ac168a
Plaintext: 89c9ab04 33889947 d884a83b aec53b6c 8edb3252 f22cc855 41568a29 85e74315 f74ff239 26ea2257 1a238f6b e9d1ec9b aed292bc 90461768 c0366887 37cf993e 6342586c f354649a 6788e975 d5101a3b 2bdd15bb 1979a4a5 f2feb25d c15e733c f2f1ba8a f7c588fb 8180b2b7 4e82e594 f24079af 95723dc0 e432b5ae 4aafca0e 681fa34d 5f528f82 65471ab1 c1a693cd 329e3e8f 44a7d6a7 3c79d8e1 a5fcc265 660094ad ce7dbc2e 90e3cd1b 31a81a0a 0a32863e 802ca77f 37eb3df4 504faeaa
Ciphertext: 2fac7901 5eed4454 9ed10dee 3bc54894 9d4142e9 368e7ef8 65150306 0ec2f565 d076825e 99812af3 faa153f1 a91153f8 6879b930 7bfd1694 f2836807 5ac59a32 ef1cbac9 138bfb52 1162d688 80184e88 8e40c68c c09e64d8 db1abe25 ca7f42cd 928f2b72 e8334753 86cc940c 54cfd1af be19b2db ee127925 96bc2620 03586adc 6f9d4ab7 662ae5cd 8c565b58 734baff1 6571b94d c92e450e 3bbbdfd1 d0a343a5 9e3ac0cf c2337f70 79ef31ad b7e73450 0aa7a275 765b7e88 130fea0e 0dc2f215
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: 31b86567 c7302957 b4160c07 bcb5aa6b
IV: da46754d 902b8ce0 3fd9bbd7 2ce9ece3
Plaintext: 4802c9c1 94442001 f92c4c3e 6ddcfdce d963854b 1d424dd0 f1ce0349 22d46530 df08dd73 203cc894 340195c9 d296b29c 40a3332f af9371f4 fd92e705 c595390c d97c492b 07ae6363 905fda00 27ef73de 473c1da4 02f22a7a dc97286b 31ba51b0 57eed375 31721843 b6fe0b51 e5e70e49 cd4f6c32 1744a0e8 839aad8d bbfce47d 6c989ed7 52a9f0f0 5572ba21 4c87c4f5 43cddb10 682bd7bc d751ce6d 460deb21 d8d95b84 ff0ebf8a 393f4637 87964588 f0425c77 fc695a60 d8109f72 0f3c619f
Ciphertext: 77e302cc 9b055d22 ebde92e4 edd8511a 8683b658 06bf04fb f15f12ba 12b21aae 2f22dfef 7fe19470 1e969e50 f9e90757 a9f111a3 a0861ae9 193210af 18f1db92 b4690808 2ec1dd37 cf301380 541a9688 659bbb3c d3a4e5b2 95531c1d 33a1501e 0a0ac3a8 36de3795 854dd9ed d0068afe 4887eda5 1779d286 8372b759 7b00eb1c 257ff5ff c44d3012 1bd0be21 849643a5 3273ab9c 51d537d8 ba776686 f16ea201 8dbfd9ed 781308c8 906899e6 bf611041 f1658671 b417b66c b77da2eb 5f10dfd6
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: 963980d9 d4bb79d7 94e66a4d 27659caa
IV: fac948a9 72c9affe dededa37 f2f69bef
Plaintext: ad764329 59837a88 cbf55791 337318d7 5f5cc7c3 0fb7af70 7b1df4b3 f9f38326 bdbd79ec 003ae0f7 65cd816a 619ae4c2 ffbb67bd 41a24d9b 1487944d 0a89e96b 521e3d79 b61c8d7d c8a93f06 a00f3609 904dddae 5272bf38 80049dde cea06df0 f613b773 89447b6e 5cfe6aae 7cbec61e 14ea4b06 b1e1b6ba a03f9daa 11aed9fa 7bb2c9a8 95848b7c 17bf51a8 90a2ce57 7e07028e 479b2b0d e1270007 e6f92685 91d41a7f e7eb0e3d eed1f982 ec79a60c 45da14ac d54bb210 86d608a3 20d220f3
Ciphertext: aa250d3e 670e123e 22ffea33 dfb2905d 1400f11c 2585cf16 4c7670c3 eb6cdf20 d2f93bf9 e4744080 6065ed66 64e0363a 9b822bae 31de646f c21a6a05 7141a997 bd224629 589cb2c4 808425f4 66a79039 81d74426 e58c2c31 a277130c 4fb7ee55 ec4530ff a2d34348 321f9047 c6206faf 5fea5d5e 4e78424a 344de9b4 783f774a 27f8114d 8ca54374 ed21066d 9dfdd20c 95adbd17 6924e06c 48b70fcd 91e4bc41 c2fa2c13 974db72e 5c0f6ed7 a07edfb3 c9e510ca d27327df 828306b8 950887df
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: fcfd68be 11b1b06d 39a46c27 44fe777c
IV: f5ed9c88 eafcef72 53fe7636 a04f31e1
Plaintext: 64ca825c fd30e627 2837c74b c9a9d02f f6de22c0 0681fca5 713be64c 476d3dd6 e30210ff c079fc02 f2610286 8ca6c5f6 f5ffc546 4efdc057 3190aa37 397cfa62 f5ca85d6 af3dbc58 506b22d4 983e4446 79df845d 63341937 48d6aa92 dc337df7 fea769f2 46f1e6b0 2cceee82 40665179 180f2dc8 b2acb95d 1fbbc53c d7aef559 a23d6a77 7344a813 95947e71 2b76b01d 762e917f b0123a4b 35974b7d c9480923 926328e1 dc907e48 7139fb74 ed7d3b01 1bf1027a 765fc81a 63ee2759 174c5011
Ciphertext: 71a98d2e 4a989593 a313eca3 3d057761 b8fc9d2d f304d929 290c1aba 10784032 ff4faee1 f72a66a4 bdfc6f31 6999a4ed 7bafcd1f ece025cd 170b8ea4 d3d78d46 f76ea5fd f2f75f11 c9caf788 776ef9f2 4a2467bf 49e09a47 81da4f6d db289359 50924cf5 f330421f 22f24e9a ec31a088 ddbf42df 6e88e77c 3fd6ce2b 808ebd5f 41627425 883351c4 62bb3e03 31efe098 b11c4a9a 66f1edd5 3f56aab0 3a12b342 442def57 c1a6981b c803cbb8 e743d1c2 bfc531a4 0e799205 dc00a1a3 c01eb932
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: 56ff616d 24483b2f 9a7b074c 704e5dce
IV: 397bdaf8 42c68f71 4f748876 bda823c4
Plaintext: bc6a122d cdc241ce 10262936 92903f3f d005e306 6ed3a8b1 be7aeaf4 786916e7 9f765b2f e070c7d2 232120df e062b6d9 976c6b12 4a3c7f32 5c7f5e27 82d17721 f33d639d a9888a1f a54d2965 2ddcd529 30a660b0 5e66ff66 2eae222e c9e00bb2 9a32715e cbf9ea31 8e05e645 54d41c5d 95525f3f 70810220 19e178b3 e58a0518 cb0ae62f bab3fc4c 74b80709 77d12bfe 33382286 d11222a5 235a8394 0dc4fc02 5225313d 198eb9e9 f88cdf47 95c1142e f5360baf 36d504a8 c6d703cd c1b7f9f6
Ciphertext: 6d17568a d59cb53f d7fb7df2 1e321883 a64639fa 47bccaac 40f1ed03 19b83c45 94b2b509 694c8cd0 738ae112 727731bf e12a820a d9b7fe3c a70178ce fda1aa95 39d415aa a5c13573 0371bc98 d2d79380 59ea46fa 7b18fc14 8eb64552 bda9e32d 086acb5e 1af710ec 2242cdad d46d5154 f540a599 5ff208a0 bf3f8050 dadc74fa b4895f26 936f0c49 16deaaeb 057cd67b 87f0e969 e8a49621 334556de 790ce837 6bd86975 2a61e34e 56bdcfd6 4e0ab34b 6c58ec41 8b0f171a a90fe529 26c65f66
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 128-bit key, 12x blocks
Key: a251ec29 0a9ff830 87dadded 8dfc0744
IV: bedeec77 f8cc7338 3bd8ac73 b0a18d36
Plaintext: c7281e86 9b410cd8 24a4fc6f 940a4ed1 c77c8bc2 e059f3fe 03b5a764 59344464 8d14fd94 13d98caf 750fbaaa 4f3929e8 d871ee00 4300d34f e8eb370e 6e9fef00 93d7d49e 8a713a6b ee8a73a3 556c5de8 1e1285d4 58b726ce 243cbbd5 9bee5f12 58aaa7ab 3edf1a89 05c85883 57ac2a9a 7efb5c55 df38f6d4 1401415c 3b94c741 c829a1c4 67d05b5d 9484ec12 484278a5 0219d02f 6a29f9c9 bcf1cf85 b1a81812 b358059c ec54e04d 775112ab 020d8679 fb6eb18a c12c8a0e 60a5cc72 994d528e
Ciphertext: ff5ee3bb 18191e20 874804bc 5ea7b114 b0f86e2c 0621de5a 0d230028 fe6bf86d 914a1502 27c1d905 db521d60 4f80ed6b 448c6b69 94e95227 b05e18fc 03c09c64 079259f6 e7bc579a ba6e6cfb cbdc007d 3200b369 98c50dfc 8294f8bb f8d374d5 fe975f2a 42296603 c81b5144 89dd15c2 e2402725 dc3e3f14 866dd2e0 a335b17d 68a97880 7af4a63c 996a6328 057ebfb2 3d0c21f2 7c31adbf 2ec6db04 77835d08 dd152e20 ad99957a d6cf8d32 61b391e6 a74955a9 4ee12d70 2540108c 8a13ed26
Test: Encrypt
#
#
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 5c2c26ac 7db54247 df0cbba7 996adacb 96832104 eaedf84f 149f410f f412301a
IV: 873daa9a f2d54617 f6061954 06bfbc72
Plaintext: 5657319b 388d8acb 0cde35fe f2d98570 d34eec3c 8c70be95 708d6688 9722887b 1167d228 d68d6fb8 4d0a488d 3724615e 93939b35 8788783f 6803176d 9f035b5e 4f9f8ac5 d17c15ce afd7c3f1 6b2427bb 4c9e3c98 d240d7a8 831335ba 2ecce959 0c2943b8 1c71a5a6 ed6a727b f28d15d8 cea83589 67f481af 0c531451 86f20c48 57a30027 7af11465 e95226cd d20ea7cf f7c59f0f 0c622d2b 75399583 5cfe785b 28964af8 fa257b51 19300a99 769efdfa 6a106d7c ce4ce6bc 562b85ed 59d05f70
Ciphertext: fc529b45 ad5ee616 ced8872b eb92d95c 938d270c dd462ce8 694f9141 e1671fc2 5629e135 678f286f 7a723b4e 91b396a6 cc2460d6 471ed63f b871209e 56ec6e6a 322b9467 0ed89b48 28b4354c 3b41aba9 172973be 53d0e77c 79ef2cc8 06a1caa2 747e5d93 74b6ec6b e65ce20a 68246733 9ea48eea 91d8ce14 c31341a7 d9dd3653 b85b8326 b8e59576 95824d1f 4ec9d42c 16f88fb4 31ea0b43 a4675c88 b47cff33 908adf9a 6a873418 c9da9a22 23287cdd 1afbab66 a733867d 859249af 1d9ff223
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: df4081ed 165eb7b4 5a8e3d60 af20220c 8f9c3ba3 2c0fa75a ecbfea08 79f95d9b
IV: 135b7449 136e9813 e115ce75 1eeaeaba
Plaintext: 67f8955a 57cdd284 0a461844 7989696a af9961d7 9be62de3 83d7c0b3 527e5980 a28786f4 90010d68 c601d536 7292d001 950c44ad 83276c16 0e181861 7e13a51f a1661fbf 9f7405e1 bbb76759 ab58bf90 21eefa49 8171e655 adbb5df1 6c795180 c211053a 5dbc1b3a f84c8863 a9d48e3c 96267c9b 2ccc02f5 d6d8895d dcbb547c facb1103 7f635792 63b702e1 a2eb3033 c2894258 7947b443 301c9db1 8d7e988f 315ae93e d1d6caa7 b676fde5 423c7955 80750cdc 1d51f35a f83e78bc d37aa4bf
Ciphertext: 16370609 1169208a 5143b810 3f21e266 3cc08245 5de5a2ef 1d41e2e3 4e602172 9653d1a6 c244f48d 67dcb98a 2a99c958 8697a067 1eff8ce5 4ac33551 5a1ce849 e846bba4 4009201c a1f4583a abde5cce 54f90060 47f3cb82 c6505650 126ead67 713cf104 27ac6fbd f652a6eb 41dea62d 3886b001 2a465bad 3e6d652c 61566cbb 53680ad5 04d32d06 90c5dff0 af9fc039 fbdafc1f 27b43141 0ea64e09 3d9788e5 185b2049 57c0453b c130693a fc6e4dc8 f8beabc2 85e6793e e8318eb1 8580cc49
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: d57edf2e 40360311 9d8bb2f0 4ae82012 e81ef354 4b655221 d6e80df6 174ed556
IV: 17ff5622 e16675a8 72cd4ab9 dd1c5a4b
Plaintext: 6e7e860b 8fa45f7b 8899f31e 8ec23040 73376aff bb6384e5 38eb4144 3118e104 31d21ed9 3763b55e 7da3f8b4 23f69cda 4cbfff7b c16c9d2d aea72bc5 36d2f01a 12de0007 231ff9a7 a9d13b86 85381436 5a06878f 0a88fb4c a0b14ea6 2609154e beeea9b5 c847e4e4 019d45b5 6fcb6d3f 73c9d3b0 d50943d1 a5f573d3 c268b5d3 e7de88a6 92b1d95d f35cce90 4052066c 3c526201 602fda97 1fafc915 b3ff6138 b25f1ae2 fb7fcf1b 38c806b2 76160dbd eeeb8f38 18901c4d efa884d3 d74115d0
Ciphertext: 278ec7a5 d4e70656 71427c67 8966a01d 5ca231b0 43a86f5e 8c9804a7 24a68037 a166eab5 b56c1ca3 22d2f43b e3d4474b aa96382b bfdd4256 25db6839 70999746 a6494781 7db0dcfc 5ce14662 63f6f80a 5300081a 8d59bbb3 73c826a8 839467d5 5ea95450 8b6c3c30 95e0efc6 ffa56c55 1db19303 527c76b6 3963e978 fa658cd2 0ac98768 190ce717 7079ee6a 1a838919 c67d5d0f f42e58fa ca44dc45 6eebede6 eb3c5e0a d11222c7 36cbbe00 bff26ed4 a0ec26c4 188e2d8e c59ddf50 4b9f8ccf
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 5c647fbe 6c1b1844 e30f4d18 f80880ee 41e478ff 92cafd10 8b034ae4 1d1e3663
IV: 7569ae27 8065743d 2580fd55 50c1c762
Plaintext: 0166edf3 84a042cd 83eed0ec be8d934d f1d3e640 028a8d71 500826bc 70d54b68 5e56ca08 fa811879 1edb8624 9df223fc b4ce8ab8 b4d0f6a7 bc8f2204 7f7e98cd 73c5eb37 137fe5a2 9413ee5b baeda402 a314378c 64eae015 0b7b6a63 1248df6b 70251730 e72c5683 a59d9019 6f4892b6 6adb55a8 27a92ca2 4a1febdf 88b49a8a 38eee994 261daf07 fd832735 5dd4fc76 97de3346 41aa7f24 27ffdef4 ab37befb 2b5f8dd7 12053488 c8e6a7f6 396b4dd7 d8f9f627 5a33bb35 67ad4138 9fe18563
Ciphertext: 546f0fc1 ac7fe610 fb313716 8cf7d6b2 b43fdab8 2aa4383b 8d9cc4f0 2ea50d13 ab9da632 36ddb6f6 53b6b33d 779836f2 fce817a3 4d5cadce 67180b95 cd3cac1e 121b85a0 265a3df1 19991ba8 4a7f0b7f 65bdeba1 33729ea9 15d1b6da e5df511c b5d2df33 e0f1fa92 1f43d1c8 508c1a0d c974dc6e 6d75804a 04477345 0daad6d9 80fbed04 fa060698 0db5a2bf 14026b0b e40b2829 d0485c3a f5240794 5915196a ab20d328 bfac23d7 33aaaefe 7d7ca616 a8e0c76b 66206957 226f4d67 571e57c1
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 3917caa2 5249c230 12023540 48f49e37 e945b2a9 f83de8df eb9a0780 555d57b6
IV: 8c767f28 e36cd83b 26c2475b 019ed7cd
Plaintext: 97ea851e 3c027751 4f88db02 4007eced f399405f 8c8fa6ca 539092f0 6d2058d3 e17c0929 19785628 f6b45849 3ad36cca 27159ca6 bf54f206 0c1a79f1 58ee3fb8 8c6b3d34 c377cd8d ae6f4bfa f10839c5 77e73123 a33ec7f3 31077bf5 5dc7e23d 37adfecb c53cb4e1 9846a560 31ed786b cff75a71 66239bba 5de00c7b fd67b01b 79d0d2a3 d1cb771e 7dd0e624 d40366c9 31d89060 30692eed 2901e318 ee6f0270 a078a103 d819ec34 6d21034c 7bf7208d e1aba0ac b39065ad d2a4d5f2 8aed7faf
Ciphertext: f8dc6354 1de8d139 d96e4eaf 6f90eeb5 a22a5c7e 305bd2ff acf98aee bfa04159 3c3a4b15 179f7cc5 d47361a2 7f946a56 f0e27f8c dfeefa20 68338010 cceb4c1a bcf6b096 0bd5b867 ce9695d2 dc5eb9cf c0a0749a f3babc37 de777986 9f32c8b1 06704188 d611b337 e12f120a 3ff9bb94 f7d68fbd e910e4db 9d12ef41 4f06d35e 02ac6968 ed6f6ad7 cb7b6041 ffc78563 da4ba3f6 b260a5ab 5e90f716 ca124a83 a266d7de ae77aede 2416e931 feee402a c81e80b8 f6c9853a 6764f37a dc67f93d
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 2bfc50e6 04f53f8b 6f86edd6 ea1f9a2d 13b515ab 48756872 66769762 c8a971e9
IV: 0b4302b5 c5e7f81c ee8d0eb5 e6cf27e0
Plaintext: 2897b693 f5a9e0c0 5e1e65f4 b5b17ec5 09919463 1906b445 58097739 f91c7f47 551424b6 ac4d2427 84dbe409 c00eac8c c52f7fcd f3e07d44 29fdfcb7 d8790d1f 1b6ffc46 0e2941fe be2c17c7 53b71188 149d88dd 17c0e10c 08a75bd5 eadcc5fe 8087b574 518e8900 e3b11446 e85ef7f7 db909b92 97bf0e95 62f94808 62af252b 031271d1 57f62068 5d50d4ea a84704a9 427642df 1902e4f1 fe5afdad c979a385 dde11816 dc6f2a80 aba575a0 4324c92c 6a9a4509 423224ca 32948c23 56d085c8
Ciphertext: e1b89230 abcbee13 2c5e79f8 892a250f 31e400c2 7d4fc1c8 33a83f8a 4e117b06 15d90bf3 9034e303 930d2289 d1408351 f30a409b 9800ca6a f2a196db ecd845af 85519cff 879b529b 345ee957 8da5af95 be1560d9 79104f12 bebb39f2 82bfde4d 3fbe8ea1 2ec0a1d7 abb32d52 a4cbae5e c19e9796 e92a206e fb9a97e6 0c8d69fe 2290c4bd a09bca3c 8bc9576d 770d8b68 95c104da 688e7702 4b183042 343e0a70 047c0e93 1a93db77 9fe7af71 95f5139f b1cb961e f94db18d 7c53b059 da4b4ade
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 919e0958 e4eca268 a70465b6 2dd627cd 08608737 fcb98480 c4908e56 7cffa4eb
IV: 2005f870 b27d437a 1fa6e0a3 d714baf5
Plaintext: cdb55ee2 86d6347e 484c3b03 a57deb15 34464cdb a8cfefbf 12242431 17c96cb2 0a3ef9d9 02a1766c 364c7e80 61c32b19 c7d91e73 5008e147 49c5ff1a c7d19ab1 013fa114 998d19ac e6d24f1d f0d7b733 4cb6de9c 44b369fb bc087b76 720855f7 706651ff 9e3e5ed6 2f4b0fe9 3823c836 bd828469 da93886f 7eb5c44c 63efdb46 a68f0a59 87528843 74b09104 bc1a1b42 8d9bccb1 1ed83f2c 02c2fd03 3c0f6fd3 bb021232 d4f8f2fc 674a2322 748d4aba d053c252 a4345c43 48b0f90f 3f92e3a7
Ciphertext: 4f7696c7 c3aa9d35 51a7b6d7 ae244626 b1a94e08 62ab3ec4 52aa1a32 6ca89cda 6458600f 8da97df7 2da943ac 99f60e19 1598a8b4 8e542460 3580d2d1 3a4cc59d e9627617 5368ee26 932ce289 4a8984a9 778f2833 ec43064c 412830d1 b996daec aa72694c 89fefe8a 8e26e279 08958e02 2e218c51 27e880f6 8a5d6f24 44e66236 de9e5606 b554d185 e08949c2 1996dda8 8cef3dcf 84b8afe9 24acc1cf 16afe884 9729f18b ad608f72 9d764e74 40830899 962ba5b6 e39ae5ff 93abf2f3 dba7ecfd
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 9bfd812b 2bbf83cf 10b8c4ca bfe7b164 6904a8ac 486a44e2 b3e387f7 96ecc103
IV: 60183921 2a5380bf bef34ae8 d05b3b96
Plaintext: f605bbd3 4e870576 39dfb6cd 264ee372 1692ebe6 d3a19181 99809ae9 104b37bc 4f3686e3 ee81a09a a7dc4aef 9f7f537f 8125d120 3855c97c da73f13e 02ce1e6e b0d6548e 44980963 54eb80cd 44fbaee8 c99af4c7 d2b1b458 10e45ab4 0b1a0991 392b86a5 a8b5c844 6c91b02a 4d30d8e8 879932c1 8108daff 2489e886 a0451756 7aed996b 7a2fb5ff 9873e89f 1c02c9a6 a558c0f2 9160de7d 9ab1b2c5 ff7708c5 89302017 d14675e1 3a879c73 fd74e84c 4cbf5446 014082b7 1c0ab69d 93fc94a8
Ciphertext: 71aa7079 728664c1 673b8154 cd75ec1f 8de77adb 583ccf03 bdf7fd33 c4050619 c5bfbc1a 60a61836 386eff52 6d79ef96 c15404be e96b1109 7cec738a 7ebefcbc 73b4ea15 4227c1d5 7cb44094 f1622606 a5121b54 73201417 49b7ef19 0e6964ec 6177ac92 722587e6 8b7a798e 896dd1ef b1ebca39 01cd6a3d ed227d75 85a2a854 9d492f3b f562ae3c 37e45e63 4f05053e 3701064e 4ea56a27 cc6437bd af10b0b8 0d158016 68c1074e e4f7dd5b 7d47566e aa5bce70 0bb8ae45 b65703e2 8a480274
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 6b64714a e8de07ba 7378f9c4 2f66aa3f 5d3e225b 586ed68b a8389fe8 d32f7d64
IV: 1736d879 39ab2d79 e9361049 2c05f78f
Plaintext: 48985b47 97bb2e88 fe3d056f 1896a028 e2519c2d 396d8d6f c1f7eb24 1ffbbdd0 d1f31a40 f9d38015 acb74d44 4c5ed2fc b6d743c6 93ebd262 fe65095c 512f7c47 a19d2cf6 8ea1bb16 305670ac 559c1db9 bc5d0311 624c6d54 5fc5dbc4 02ec794d 565f646f ee991350 648607e7 f10559ee 66f5cda8 57ff310e e1b0ca94 f7ae54c5 051ae163 f32b3e12 9db94c90 fefdd1a1 b8af57dc 801ddba1 ff167095 c873e642 3d55d7ba d76764b7 73bc3cea f4fb6e01 09a44256 894c9e07 cb98df92 707927d9
Ciphertext: 955f9253 40764fb4 a3d25bb6 f9d06a47 25a32f00 90e67e59 390c3ed3 6b943fbb 2bebdddb dbbfa05e 663d3371 88385851 1cbe4c04 44400ad0 a7dd52bb 0d50ba82 f1c49402 3cbbf7c7 240a8353 1139801e 5b0a9471 f085f388 1608f87e 85a8abdc ebb9861c 081984c3 0e234a02 7ac597ca 4fb0bca2 10ca121d e780219c eb5e7d3e bfee2db5 c7ac9a74 a04371ad 4c5aca82 b71ebe2d 5f94ae97 df7e159b 7a00355e d19d09fa 1b8072ed 31f4e388 46b77795 778c8d53 aa16d840 85b9929a 3f9197d7
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: CHAM-128/CTR, 256-bit key, 12x blocks
Key: 1815445c a3d10bee ec6d8662 a3cee6f9 30aea2b6 3030d1ca a9146b12 c0d345ab
IV: ebb1f304 56195ba3 20c5f1ab 0823e481
Plaintext: 61031ca2 c50d2e19 255b222d 317fa27f 003712fa c6dd0403 42e2e49e 32a7ad4f 5f2b0a09 309a7d3c 41b44285 d3ceaca1 2fdbab58 3b9c297b 9f5bd3fd 741fae58 d7d22101 2fb62bb6 d1f95de0 eb81d253 97b54dc6 0f2bdd06 f7760a3d b8dba50f 631fef58 f0ef81ed a4f57787 61b303fd b3161fba 33a307c4 a1a31f40 081fab1d 709e898a 14e6d630 e02445dc 6f48df92 44ca4146 2c29bed1 af735f76 a99cc71a 8d717d3a ff83b049 20df5319 006bd14f 8810cfd8 8a2addb3 2b834695 d8f717e6
Ciphertext: 218e2d8b 53f4b38f 864f2c7a 9f0b3e0a 8042b185 d7452861 aebc2662 cf4aeb92 5b703728 9097c455 63fe424f 8fbc7941 f16f42f5 2bb99888 7f0465a7 5f05760e 82dfabe3 4cc729f6 3704da1d 949032ad a8d4fddd 26aff516 161bc3e9 41eac4c0 12d43f48 36f1e058 94dd2b40 966c6503 b44ff734 7cdb928e ff9b7e06 479a9b42 19f665a6 521a975d 11636959 abb66d82 b8781340 b05f2d6d 5ec6bafa ae435f47 fe2f8a70 e01b914a 853cdeee dfc9bb9b 61ec78a4 84134c41 473cc9fb ce163f1e
Test: Encrypt

View File

@ -0,0 +1,645 @@
# These test vectors were generated using the eSTREAM reference
# implementation for HC-128 using the file hc-128.c.
AlgorithmType: SymmetricCipher
Name: HC-128
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 1-byte msg
Key: 2923be84e16cd6ae 529049f1f1bbe9eb
IV: b3a6db3c870c3e99 245e0d1c06b747de
Plaintext: b3
Ciphertext: 1f
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 2-byte msg
Key: 124dc843bb8ba61f 035a7d0938251f5d
IV: d4cbfc96f5453b13 0d890a1cdbae3220
Plaintext: 9a50
Ciphertext: 3a27
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 3-byte msg
Key: ee407836fd124932 f69e7d49dcad4f14
IV: f2444066d06bc430 b7323ba122f62291
Plaintext: 9de18b
Ciphertext: cd261d
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 4-byte msg
Key: 1fdab0ca9902b972 9d492c807ec599d5
IV: e980b2eac9cc53bf 67d6bf14d67e2ddc
Plaintext: 8e6683ef
Ciphertext: 60f109d3
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 5-byte msg
Key: 574961ff698f61cd d11e9d9c167272e6
IV: 1df0844f4a7702d7 e8392c53cbc9121e
Plaintext: 33749e0cf4
Ciphertext: 7b9108bf48
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 6-byte msg
Key: d5d49fd4a4597e35 cf3222f4cccfd390
IV: 2d48d38f75e6d91d 2ae5c0f72b788187
Plaintext: 440e5f5000d4
Ciphertext: 8702c8d49067
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 7-byte msg
Key: 618dbe7b0515073b 33821f187092da64
IV: 54ceb1853e6915f8 466a0496730ed916
Plaintext: 2f6768d4f74a4a
Ciphertext: 21bec3a785c54d
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 8-byte msg
Key: d0576876fa16bb11 adae248879fe52db
IV: 2543e53cf445d3d8 28ce0bf5c560593d
Plaintext: 97278a59762dd0c2
Ciphertext: ab56d21fc9ba82d2
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 9-byte msg
Key: c9cd68d4496a7925 08614014b13b6aa5
IV: 1128c18cd6a90b87 978c2ff1151d9a95
Plaintext: c1 9be1c07ee9a89aa7
Ciphertext: 63 bf12a1533269e0ea
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 10-byte msg
Key: 86c2b554bf9ae7d9 23d155903828d1d9
IV: 6ca1665e4ee1309c fed9719fe2a5e20c
Plaintext: 9bb4 4765382a4689a982
Ciphertext: f67f 9f1b78ad1839c4c6
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 11-byte msg
Key: 797a7678c263b126 dfda296d3e62e096
IV: 1234bf39a63f895e f16d0ee36c28a11e
Plaintext: 201dcb c2033f4107840f14
Ciphertext: e0136b 3d43448daadfa8c0
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 12-byte msg
Key: 05651b2861c9c5e7 2c8e463608dcf3a8
IV: 8dfebef2eb71ffa0 d03b75068c7e8778
Plaintext: 734dd0be 82bedbc246412b8c
Ciphertext: cce4b159 5e271971a4656bdc
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 13-byte msg
Key: fa307f70f0a75486 3295aa5b68130be6
IV: fcf5cabe7d9f898a 411bfdb84f68f672
Plaintext: 7b1499cdd3 0df0443ab4a66653
Ciphertext: baeff9b617 946cbaa662e5403c
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 14-byte msg
Key: 330bcba1105e4cec 034c73e605b4310e
IV: aaadcfd5b0ca27ff d89d144df4792759
Plaintext: 427c9cc1f8cd 8c87202364b8a687
Ciphertext: d559e24c692d 7ae8507f9ca6c590
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 15-byte msg
Key: 954cb05a8d4e2d99 e73db160deb180ad
IV: 0841e96741a5d59f e4189f15420026fe
Plaintext: 4cd12104932fb3 8f735340438aaf7e
Ciphertext: 05f0d610ecd79f b76805e8309bc909
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 16-byte msg
Key: ca6fd5cfd3a195ce 5abe65272af607ad
IV: a1be65a6b4c9c069 3234092c4d018f17
Plaintext: 56c6db9dc8a6d80b 888138616b681262
Ciphertext: 9e450e2055249807 a66a569666c30c8d
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 17-byte msg
Key: f954d0e771174878 0d92291d86299972
IV: db741cfa4f37b8b5 b09557f5df806c6d
Plaintext: 8d 74d98b43651108a5 f679bdf7eb15b8e0
Ciphertext: 68 209f9b599f668c3e a5b0d25ce23c74c1
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 18-byte msg
Key: e1608f6e3c7bf45b 628a8a8f275cf7e5
IV: 874a3b329b614084 c6c3b1a7304a10ee
Plaintext: 756f 032f9e6aef10509b c8814329288af6e9
Ciphertext: fd43 8d47ebe7e226673b 19a3ae87f6d025b4
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 19-byte msg
Key: 9e47a18148316ccd a49ede81a38c9810
IV: ff9a43cdcf57c750 59bfbd1c2703287f
Plaintext: 5d895f b949344e603ce5de 029842b20d2bb614
Ciphertext: efbde1 ecb739af688af049 ee86a2f1fd625b46
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 20-byte msg
Key: ecbbb82f73e2517e 7d1dd884d31f01be
IV: 506b16d643218319 1518982b2c2e8bf9
Plaintext: 0edcbcf0 ca0e3d6d94319274 af8db5a490d55e6a
Ciphertext: c89eface 1d6774d310836c85 67796d789d4b7b9e
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 21-byte msg
Key: 40fc8076024b176b 36b121db7d5aea72
IV: 1e828d71a88cb85e d94eaffabfb09474
Plaintext: 1d75e5dc10 5846daf25b81a07f 5ccb1d36e9497402
Ciphertext: dbe8350457 21aaf867a97622d7 48a2c71835313e55
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 22-byte msg
Key: 55d2ac1a0bf7a926 23405ba333b93588
IV: 68ade12ad5b2325d 0ae55adce9775deb
Plaintext: b569c53a6c93 980d57eb879adf04 68b2a2d5e6a4c6bc
Ciphertext: 36b85abf397f d6915731982cf8e9 3102f4029f4d17b0
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 23-byte msg
Key: 775f8dc38fd62a21 14a9d4041101188d
IV: aebb731c60ca20cf 5dd62f455329d7a8
Plaintext: 59cc0dea26ed55 4e8084d92bf837b8 edd57aa05c4efa9f
Ciphertext: f257546c1380fb 5ba138ec36766597 1cb5688814092614
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 24-byte msg
Key: 21fc3c36858e81b0 7dbfeeb1e485e912
IV: 078bc6ec66e2a3f3 b9f4900632b9f404
Plaintext: 022d2ce01e0174f8 43900ba237169208 531cb5373e370e72
Ciphertext: 41e720935d60a608 18330bb264fed7fe 76b47d68828c82b0
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 25-byte msg
Key: fbf246cc26097ef6 7ad8ed559712ca57
IV: 02b66c086e3fb0e0 3a1c9bdf3a5f40dd
Plaintext: ba b9e41bc0a6611d92 e5c8bc782b4a77c3 18590a0e6a0a42c4
Ciphertext: a0 ce582b4f50fc2530 6164b7a190785e8b 446b495df81babfa
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 26-byte msg
Key: 71be0fe3c301dbff 30b21a89f8652251
IV: 3c053d4ab3befd8d 9e19d0a1fe69d4fa
Plaintext: 0467 edbfc91914d13ff8 f2086851adc0c5ec 029412ec946930f6
Ciphertext: 51dd 18b8c89eabfd3a9a 5c15ab62947a1004 2c2529ad0e1f5d87
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 27-byte msg
Key: 83af639541e3bddd a158da4f3138cefd
IV: cac55cef65e569c4 30deaf9ce25eb636
Plaintext: 4bbe00 562f87846a54365f 6cda3cc50acb493d 05f3ca0ed7f2b1f4
Ciphertext: 7ed3b5 3b0ba0f76eca6785 2d67b581ebee0e0f ec7e8c248e1e391f
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 28-byte msg
Key: 988f7418224f583f 7447ef42542edfbe
IV: 39b6e60c671c1b74 5cfe779d6b6e9348
Plaintext: a744b33e 02b80487b63022dd e456dd617b6e3d8c 5ce7c467bc2ff2ff
Ciphertext: d1fff5db 9438dd40263d0344 d15e55b5d21d767d 2c591d4b8ab9b30a
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 29-byte msg
Key: c9cc0f1390a92411 1ead4b41e592283f
IV: 62f5b8aefda9492b 3151ca80ec2e451a
Plaintext: 3935aabe1c 65ce77bd57b3d3c9 170a4e1632f60f86 1013d22d84b726b6
Ciphertext: f50c60e896 0d63fc1b7b4df87f eb66194a115f6147 62925c92cd8f766a
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 30-byte msg
Key: a278d802d1eeaf13 21ba5929dec6a62a
IV: 65cff4473621ebdd 4ba26a99a812c0e0
Plaintext: 3491206ec762 4f3d84eea0a8690c 22d0247f183f28c0 a9cb01ffd9bde464
Ciphertext: 5185f4acb30f 28fdb528bd1d9e62 9fc5e97ffafaec59 9cc64559b2787dd1
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 31-byte msg
Key: b8338b9ad9c3408e 066137743283200c
IV: af83fd23a244315c b318da3009e16134
Plaintext: 7577509aed4a63 fb3d49e154f9022c 4eb60a97c2799f79 7c708c803fe04d47
Ciphertext: b856d160d7b03a cb557a8b10a56bd3 93c323e9b93cccf8 a0f24b3e6605eaf5
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 32-byte msg
Key: 0a5f742a9a434b59 305abb2b94dc6cb5
IV: 5a9d2e9c64879827 a848ee98334848bd
Plaintext: 6edef1c2a1c30e49 b5c780bc3ec20be2 b9ceb7b111b37664 69a308cd15281ceb
Ciphertext: c6cc294c71d45ba4 8ae582467d3bea93 0106a4e81452ec93 e77f7536810f6b1a
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 33-byte msg
Key: e95ab8bfb755da5c 13ea603e599525dc
IV: f2af6d80d2e58357 45e9a0c4ec670ffa
Plaintext: 02 3b8fcae4e1f9b9d1 2d2256ee3c03cb8d aa17b1ae050529c6 827f28c0ef6a1242
Ciphertext: d2 9a5a508af59fd703 b59f4da6f6392210 7de9772ac202569b ecfaf8dbb6bd7efa
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 34-byte msg
Key: e93f8b314fb18a77 f790ae049fedd612
IV: 267fecaefc450174 d76d9f9aa7755a30
Plaintext: cd90 a9a5874bf48eaf70 eea3a62a250a8b6b d8d9b08b08d64e32 d1817777fb544d49
Ciphertext: 09b0 3af5818faf384564 19eb39c41b2dbf7c 87b376ea77bf104e 304ae8b7f57f1d08
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 35-byte msg
Key: cd49720e219dbf8b bed33904e1fd40a4
IV: 1d370a1f65745095 687d47ba1d36d234
Plaintext: 9e23f6 44392c8ea9c49d40 c13271aff264d0f2 4841d6465f0996ff 84e65fc517c53efc
Ciphertext: d97bc5 583c737f9078e5a8 6979ebc3654cbe96 23e9642c962ca8ef a3e6fda7f277dd18
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 36-byte msg
Key: 3363c38492ab08a3 aa3ff03f1c55ad51
IV: 4fc48596585ed588 1e81568cbbe99f6d
Plaintext: 25c8eb09 0d191d4a07310158 ec97d50d7c1508aa 480f41c8d014a391 e8b3502f60902b85
Ciphertext: 47ea5dd4 03590c336d6c2d4b be122bf90c195d03 e463a190e0a6e904 25119659f3a79beb
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 37-byte msg
Key: e3b7e31d202f2d62 28d35010175de7e8
IV: f7c4e2a8e1c8cf3a 65ca582c2de20c60
Plaintext: dc2c62053c 62fac599b0274068 c3abba2d24c1109b c461f1fcd8bf4ad3 e61502c020a2e8a5
Ciphertext: 5de3881f6e b719f089e7702010 b1ed0f6f4f563184 c285f2ad13a6a518 40258e14a3951ba5
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 38-byte msg
Key: f2f2ea07d76187b7 70db87b1d7e5e944
IV: 31e11d73828d739c c6ced4573dacb0a1
Plaintext: 069d373aef06 cc4b8cffb64c8657 192536d7259372cb 8ecea7bf3c692887 4379c68215f9a11f
Ciphertext: f199ed956da0 d082cc5763493475 e5f2dbc563db339f 702c4099c54fecff 64653948645ddca5
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 39-byte msg
Key: f76d3e9fb1c6d91d 8a86fccc73245081
IV: 83b2b471a3bd8c3b 8b755b29ed0d95b2
Plaintext: ef65ae44dfe777 4122afaa486eeec3 b53a90126b721c0f d16edced1a253f72 ca9e7b0575a87609
Ciphertext: eb23c2dc0d4ff5 962a652227be862c 9630396eb03cbe81 45e629c417892f4d 43b9b9ef09eb49fc
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 40-byte msg
Key: cacbe769d17eb874 719ab0ec350f4e59
IV: 50d6f8a3de2755e0 6cebf76bbb743d36
Plaintext: c16c7761f10b4c0b bc8d596858e41b13 c0aa0fa6fc591789 a2be20079dab02a7 2deda7b92f7d702f
Ciphertext: 73c35063376c3b44 6af3a249ffb42c0b b947a5db9626518c cacb9bffdc1904c5 076342c5bf283b69
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 41-byte msg
Key: 9ffbd4ae5b574be5 29d26a1efc254f12
IV: 73ff3f02a3b58e03 1635bf9a133ded88
Plaintext: 20 ca6ae7c6d2a57694 35513267f2c326e8 969c8355fba9f385 2e072b26b18bbf4a e3603b22bcf26f08
Ciphertext: be dd969b8adeceab48 0c929588d211188d afed1154b94b4234 a2ea422c392b9506 98979230ef426bb1
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 42-byte msg
Key: bd0b0ac3273c6b07 6c7fb33ce31a1f80
IV: bfc795ef42117c22 2e01d1f57dfa778e
Plaintext: 51e2 cf9b2e8289da6730 badfd6ab2e12d046 fff7584966b29394 d2ca7d85372dd91c a9746e5d296970f6
Ciphertext: cc15 22261b465379c39c 808fc77a818c35ff 4218ad5fd24770dc 64f1f486a4508b6f d6390765773d1fdf
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 43-byte msg
Key: bfc63d22c9404acd 92c45cf92601fb60
IV: 6526235b57ed3e02 bfd84f95f3ba701b
Plaintext: ea7a7e 48971413a475e0b4 ea64174caeb393d9 437ed666dc3a4e39 f18ed84de5648203 e541951413d1d3ca
Ciphertext: e8d35d 3a9126ef55077e22 97ce1086b6e99611 1cb891bdf7d4c3e0 c8205a91f0d406b6 485577a6fc4b8a49
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 44-byte msg
Key: e4c7fd70c6e49807 0754f13af2415f94
IV: 3ba3c8f19d556632 c16ecb3562ce2305
Plaintext: aff7ba4d f01fbe136d8345a2 8bfd91c839d99342 8ae5af75a3c7bf5f d8935acc129d56cd 748c8b663eb0da87
Ciphertext: e3850ee3 02e426ea014b7449 fc3acdda8df56a92 a1f875cdad056158 e0fec7057b01044b 92670fe59756885b
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 45-byte msg
Key: f1966f3db4d9422a f63ae43355f37878
IV: be49ff89d661dad7 995489684185b9cf
Plaintext: 6a337e5c73 4add90277f8dd39d 9bfe695c179ba3c3 ea4d52a99f408140 aae9643ffc488b40 d56a5b66da33bf44
Ciphertext: 8898d30d20 da4602af61e54edc e71fd08f8847aee0 18d11186dc531d00 77cad53293d2cd1f e081483abb1e889d
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 46-byte msg
Key: 675a1bfa26b582a1 e1b728ea94371a01
IV: c7722cb81a5433e1 22f375fb735d5e12
Plaintext: fe9375e09ed5 8e38ed2040a55cf6 994e835d111cb52a bd1fd87fc52e7393 18ce09b15e56a684 2f50b79182211e05
Ciphertext: f25a43b550ac 23640ba97bd8b417 fcd1b086bc09b587 8bacb13ee5cf4f0c cc7378da6bc3725a c38a9ac995fabb92
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 47-byte msg
Key: 68ed86b1fab5f453 8fc29f173347025d
IV: 55422fbdc0a36648 cdb0e611d6a803ed
Plaintext: eda67976cec900 56139221c2a78d47 447d3419be821007 acd02123a9248033 35924304b577a101 bbb057038809496b
Ciphertext: 346697b39b85a8 120b9ee5d5526a6f 88dd026c7a03479a 0eb329bf88a8e976 62d02b9a74bd02b8 ddabe7f77068de85
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 48-byte msg
Key: cff86d6fbc8ce5b1 35a06b166054f2d5
IV: 65be8ace75dc851e 0bcdd8f07141c495
Plaintext: 872fb5d8c0c66a8b 6da556663e4e4612 05d84580bee5bc7f cdd4de8e863843ee f288d3fcd018e6be db47aabc4bfac411
Ciphertext: a2380d5b6f8c4954 1059ef1a037ecc43 1d8a6ad404cf37dd 9c4e818d6504ab99 39c4fb0cf1aa4fe0 6dcbe5b403fb1c1b
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 49-byte msg
Key: 9e4a3ac1987a904d 892c3185ced4119e
IV: 9a6c9184f76aa371 07ef2ebf9041b4fb
Plaintext: b7 7b323a0c8347b0c7 3d997e51fe75cc07 44b5183aa4e7cd7a 03ab1814095df7d9 d3f49321e82acf10 6fde21189fb6a1bf
Ciphertext: d1 6209941df3b38ac2 0d5ee6f9ad56b2fe 27b69fc4f23c5c0c f47b94e5a1f51818 9029034452bf9387 5749b0188070f12e
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 50-byte msg
Key: 76085fa3aefbfabb ede96edf3c082e8b
IV: ba4a73e09181d3eb 2ac7152a9d1d444c
Plaintext: 6c52 023970271f5213b0 6afac0fdc75598fa 824f6794e3e1d61d 0390e2f2dd368c5b a804d2b265c8dfc8 b46c7f84ebbfd5cd
Ciphertext: 5902 a5f41050309e0e51 71d0028ef3fc3cfd 83d34425c61de8fc 64fd5e16d6209d19 fe9820a56d7958b7 7a13f4075bcea4d9
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 51-byte msg
Key: 697950aa2879dba8 9250547d960340ea
IV: fa0dbde6f3a4b7f8 f33d5fe5c252d98b
Plaintext: d06335 0dca3ba1306b74dd 05953defc9a05b17 09f26e0509cf764a 6773950dfc5e17ff 03f0af917d350364 d4026b00be41f6ca
Ciphertext: 8f2d75 204b5d033310f56e 4e31e3970097fa58 0121beb727c562e2 adff066e28e4279d 358378a805110edf ea58ab545fa94437
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 52-byte msg
Key: 6489af30c4f21e27 532711d7e7bc9c94
IV: d5c25e11569906d0 300616dd9285e7bc
Plaintext: 3fe1eda0 ee013ddef1054ca0 1692fadecb69cf8a 853f840b62c9c5ed 0d1635d7e221b3bd 52a7dc568936d0d1 4f8739c42c0d8a65
Ciphertext: e7559d26 10fcca7f254deca1 39ae06323de3632d e5b1d28f7ba512b1 9edb023754783029 aee725a2dcc1f6ab 14024b20da4a0de0
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 53-byte msg
Key: d0ce85fcb1720098 f699e801947286ef
IV: b78a017963e125d0 5b43622d42d51808
Plaintext: 00ef128b67 29504617b909249e fcf09ee452b72ec7 2fd107026f7d0353 ea00dddd4931a0cb 183b5f361c9f2748 e67832a2a8035dfc
Ciphertext: 944818774e 9ad427376a900781 390507e57684ea9c 26013997d6b39c34 b502514b79c71ce2 f76e44fc2aa73978 fa18a2fe6d5a5780
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 54-byte msg
Key: 485edc0bb3902da8 74ca4a2e85ed2324
IV: 644b4b1c6ab2f2da 59a713b934efee4b
Plaintext: 5354b940b6a5 93899affb9bd4a4b fcbb380873914c4b 6d9c7c03a9f19d82 cafc7839056721c3 1d3d842691504155 14d8baf93d5c6970
Ciphertext: 4394d5f1bf96 348e53b011e12c1a b24f502a7c1c9cfb 625eb57581a26004 00645d04bdda58f8 ccd60c9168e75ea3 f567d36b65b151cb
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 55-byte msg
Key: 80d678165d128bc4 d757e19728499bf3
IV: b30e5bc73ab01112 51c212a612476b2c
Plaintext: 13cf746895e3a8 befea3b3f58aaecd 3c3d42476a1ca563 8a9cc369975b18f7 840ed0997fba2d99 77282a19dc935e5e a6a3226f989ff6df
Ciphertext: 467cfa39230b3d 5eb7a9b5a707d545 eb56f79b1beb9f52 18176a85d25458cc 5300c4a74250e95b 70b764c7423aff9f 17a42a198de23b5f
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 56-byte msg
Key: c6de21e7557e98b8 8259210ee535b809
IV: f73b3239d3ab20f7 39cdf6fcd82b6d2c
Plaintext: cdfd25b367e58f53 2ddc0afc226c4c9e 4721043b623abd40 fea30615b328d0f3 a7e317f655f6c573 8d80d38bbcc9b100 6ec0e84811a8fee0
Ciphertext: 70172c2c768e0845 f9674683244326b1 810e93c982863768 ae8ae20c6f70135c de78935c8d3f7ab7 0b475b19f4ad5460 54c17a00d2b15192
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 57-byte msg
Key: fc0e99e3b0fee8db 5d763fd7a81b01be
IV: ab2bc3e23db3aed8 74022588695da880
Plaintext: 3b f4f98e57157d8df6 a0e47fe7bb0ddc8e c6232a2d920dce62 cd0522f1c186c7c4 3f6c3d30d557b07a 4750159a3daf763e 3a3b8a12cd94893f
Ciphertext: c0 eb5dcfec09484f10 6616a822347a8be9 a042dff58efa407e 5d18d7974518b42d 6fd54e75fe2644e4 0c7971717ed927ef 377ead21bf36e652
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 58-byte msg
Key: 0bce3e313c5f5e9e d53b18c4a73dedf2
IV: 55c9c2490bb034c4 6d532b76ce0cb213
Plaintext: a3c9 06b237faecd1a0ae 489af1f8ec65b198 ae7d8cd7bd2749b3 35e0fc3cf0e77d3e a0fb18201a66860c f53a1c5154db4305 00bd28eeba6fb5a3
Ciphertext: 1eb0 775770c7dbbe36f3 20a543b5e52c2c5d 11b593d25acbb922 2ba480829759d788 04dbdddb9d532bb2 0158ca161c0a5516 36afc416b527d7b9
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 59-byte msg
Key: cfd9bfeeecc28175 349549999064719f
IV: 462d910dce5cf357 e19247bbd2a5986a
Plaintext: 21e87f e84eac97b5eb0630 2df5d348ad64fab7 f701f1a9d8788351 08aed0dc515495a4 f3bdada748ecd837 a4f2bcf37f7729f5 d696a14dceee18ae
Ciphertext: 3dbbfb 7da64d579e22b833 b4d65379d5e2391a fbb81f50666d60d5 b5cc7b396d3b0ccf 9a3bfd8e4daf0de4 c882fbf83af44cdb b9ad9ec85c4f302f
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 60-byte msg
Key: 9bf5f868a0906896 d7e1ce99746092c5
IV: c52e26595da643b5 713475c7826ad9c7
Plaintext: 3c502524 9ffceabe5c631655 826fbd4159521964 8e19cf5e918473ff 3c154f02b56760f8 95c1a2824aeb8ec3 ba40e01528059dfb 5cf95558fe2da5de
Ciphertext: a476b404 32eb8bfc632649be ca2e3f61512d7b63 f7c5dc297c07a1a5 b8c6d11a17a972ed dfe59c4e2a260d2c 0e0f7cdd808f66b0 2e27a956b31e569e
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 61-byte msg
Key: 441601c8cde1b0cc cc06184b68203ccc
IV: 63fc83a8faf0bb06 0d6e5d0a80d8134a
Plaintext: e19677824b 671e888af4d5827f ab2a56c6ca2f6297 ba7a6eea9f70dedf 2dc42c5cbd3a96f8 a0b11418b3608d57 33604a2cd36aabc7 0ce3193bb5153be2
Ciphertext: 601a232e76 1236c291d6ec8e36 093352b5cb728188 67d417a0201c203e 717ea340c38de0e1 563a7380a82204bd adea1c275aceca3e b920bb2a508a653e
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 62-byte msg
Key: d3c06dfdb2d16e9c 357158be6a41d6b8
IV: 61e491db3fbfeb51 8efcf048d7d58953
Plaintext: 730ff30c9ec4 70ffcd663dc34201 c36addc0111c35b3 8afee7cfdb582e37 31f8b4baa8d1a89c 06e81199a9716227 be344efcb436ddd0 f096c064c3b5e2c3
Ciphertext: 59c2afded2ee 41fda6e5133e3a6e ca4695dd1355f1b6 f9a7287d6528b01f 40af3ea2c43b864c 277fa7f197807bb9 ec54ff36b9ee3035 8da9957c99551e35
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 63-byte msg
Key: 99993fc77394f9e0 9720a811850ef23b
IV: 2ee05d9e6173609d 86e1c0c18ea51a01
Plaintext: 2a00bb413b9cb8 188a703cd6bae31c c67b34b1b00019e6 a2b2a690f02671fe 7a4cf4d12dea320e cd499e72f12f3806 4f0cf9f339787196 68ddafd7f97161b7
Ciphertext: 8b96f5e3964d5a 7ede97c65316ff59 0bbc3350f08d3ce6 94b604acc4f802a3 d5bcecd7b96a056f d2f443bcaa41ef0f 4a75237ebdfe785d a9802b7d475094dc
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 64-byte msg
Key: b5683c2995679e23 853b72f469cb55d8
IV: 5e4bf6ca42b3c399 7670c23ee259bc6d
Plaintext: 3ae4a16a809a281e cbc8b66a467881bb 7b9ff5dfd2985717 54d1a86db5c5cc47 922aeb3df76b1828 2458307b911d05d7 2f70bcd9f10f7437 8b6a290b7a9cd76e
Ciphertext: d113b9739f49c0d4 e4f2ebcdfa50fc8c 120915d3a8d281bf 8db2d84cde0e135d b519ec5731714db2 677569ffa0ea23d1 b1c067662dc1beb5 fecef91cbe94752b
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 65-byte msg
Key: 44a0e24901c2b568 1a53a9d051a12953
IV: 01271561a7006321 a2a20cc037c8260a
Plaintext: d8 b04d37a687480734 22ea118eee35577a 2ac61ffd536dfe21 e01b36f6300142d7 c1f6aeeea2192cfb 2bb8e550eb710d20 e297bafaf0d8f691 8e1c12bebcaf3ec8
Ciphertext: 00 a66964d05879645d 1f6e05a201bc1fd6 d9dc2ad519cd1705 0474f3786d856fef 2492792d700d7b1f 3a3dff30c5c9878a a2e8040aac1d4677 3a95c22c67cb0968
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 67-byte msg
Key: a357e2fb7000f5d7 def4a080259b7eb7
IV: 52dba7c0ec307913 d8ff98547a273385
Plaintext: 1dda89 7b95abac8e22e785 9598291912bd290a a9f3d561d717a38a e0a825a0092cdeec 08cf54a8b94e6608 1213e07b59a24d2e 94330cd142a0a69f 48825f982e970b11
Ciphertext: ccdf22 5e093f83a33e2b57 47f5cda6bdea9522 a81c32868ce51b46 cd43ac1104a0a487 c0298bdae5175e15 b4d5e681931e9687 30388defb5f76245 8d324cc1605abc19
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 70-byte msg
Key: 68236fbe281830df dee72bf6c7ee186a
IV: f5fe52bc3db1dc74 50fea25c280a02ed
Plaintext: a6418b0779a6 05e54167b14ff4b5 d21181d26badb46c 4b4d5a2947fba583 c714d2d684fa08b7 8f0a848896cef349 63731fb1a57dce7e f3b9e7090e73d71d 66ea3309e0019ff4
Ciphertext: 124aa4be95be 83022a7f9661f984 25f83f611f104a44 d97ac6a4d02c0283 05388b60339a665f 786587c16c5240a6 db005090f8d9caec 7a7b93535ed8ad2f c4223ec08cd42773
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 77-byte msg
Key: 37ee7161d98b54d3 7717c387945390dc
IV: a141c67f2d8681e9 56130329830405e4
Plaintext: 55c84b9ada 837b2a04b02f995a 0b490feeae87228f 7a57573fb8ece6e8 0091be4a5a3dc938 a4687104341e6338 be52938677748002 7a46b98f6beba097 5b406e00ec70775b b6c3b05ee9b76e94
Ciphertext: 7ef1651d1e 8eeb54a8c425df73 a6f28ec68a870c5a 0d8e0ceb914df641 3d941152b4774a6d 594b23ba47ff419a 6727766515085dd5 54479dcea4d9613f 8c2f79d5dca36134 83acf7f8fcb44fc2
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 80-byte msg
Key: 527053e4b620ef50 f6162d7428defadd
IV: bcfb5dc60c2bab81 33edfa182341d733
Plaintext: f2af3c3c758abcc2 1076011bcc28784e aa6d4b30386e90cc 6132c00889646a86 da5728c9d847d399 3ce2f3a8ff067975 b5cdb1711cc77261 f58698031260b3f4 b17001d108de9a9c 2160eb62e801651b
Ciphertext: f6d60dd789ba58ad 61980248c3fe228a 822ed656059b5021 9c57768160766031 cdf1f40577f08351 e4dc830ddf88b7b0 6269172788b7a947 a24d3496541b03f0 678453dd25a72dfa 68b463705e2c5632
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 83-byte msg
Key: 2276d2e1beb90696 f26a4fe6bc1c451f
IV: 03ae9d2dd77b9568 fbd193b0a0a508bc
Plaintext: 74849b afdbcd84ec7c1e35 2c000c40ce161775 6ebbdc4ab8b88d81 7e6c9f0409cbc214 ada716a2a02f9cfd 0db5ebae63b424a0 f3112785baa10774 7becbcd712301884 04a9fd2a5a10ccef b062205789e2bd68
Ciphertext: dc3e0d ea41fe9e930ecc42 d4f87f9938412934 b109139dc3a2ce44 ed8f6f2a0338d686 632b44b90bb96a9a c289bd8ba49d38e1 2aa8c98fdaf3c502 b5a03c0cc4e30806 58d656f2a6323f02 1f78bb5fd67294bf
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 88-byte msg
Key: 61c30c16bd28b6cf a864487eaa6e35db
IV: 69e8e2c12996533e 8f1503e6aaca136c
Plaintext: 3418a77314d68ea1 280021f542ac6d5b 7040947e81e370de c4317a221333eaaf 108e2079affa4319 f5f62821ffbb75ac 456e063920998fb9 8adc83e625e035d7 808d3ed1957d1e61 96b026a7e98195f5 71d801990fa2f8f6
Ciphertext: f3344b1d6e28e2c8 fe3945e92b8c5b56 be73fc0e89007b49 b0c657c7bd5648e3 b2cbe0ce529ae947 99113f4f837fa2d5 c7b3be07e8788041 d2fa769c434ff0f4 5a36995531cbc95a 7f79c507bdbe527f 7e2551f0f9f1b32b
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 94-byte msg
Key: e8dae9b93c0b097d c823ce45679e9394
IV: e23208e7145f7ae8 4c4655e4f3bee77f
Plaintext: 6fa566a74674 35c68716633c66fb 750c266865d53c11 ea05b1e9fa49c839 8d48e1efa5909d39 8bd043535b49629e c27fb8f107345333 4896f62a07b8be8e e53f0562ac5e8784 9304c382be53a5af 05556176f6eaa2ef 1d05e4b083181ee6
Ciphertext: 2e8d0162f582 d2e003be7ec75cd2 f8784708e5d0e710 55bebbf4d2460fbd bcb35b0d85d11e1b 47b3a853cc51aae2 9dd84e17d0d69bb7 6b45db9af9fb6e78 047fd8ed1fd810cd 259c559a25a06b1a db68976f23f3d012 f4ecbdbb3af48dc2
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 98-byte msg
Key: cda5a485f74d7ad6 c8d14a95447557c3
IV: f5e99f3be1716bf0 b9432476533068c4
Plaintext: 5a87 5d38453745db8533 53e7031bbd86c918 13ddff08cf491adb 2de8503c3d5c4f74 36cb2e8c0d2aa4b2 46bc78df0bd538b6 7be42eae44b09073 74e2f78a8cc41234 d6489c96f94c8b16 cb1c8b086639aa8a 7e5955acf2ae83d5 a06b30627e850d8f
Ciphertext: 3067 05cbcf7382aa0014 ec33923d24694a5b 1511a5afdccad134 a0c7533298229a53 568e4c57100093a0 82a99b4d2eec36d7 00fe2391cc354bc4 ff29d1cfec587b9f 4cb48b3c2a825bbf 310b9fe3f37bae17 50060b4682149f96 9e42f9120143a289
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 105-byte msg
Key: b6769b32c8a42789 1024e0f839875dc5
IV: 435c4a00ca5bc75a 8ce30b3b26a74d0e
Plaintext: 1e a4e4e02656ad299f 2bade95d38f7f7aa 2ad0968d80124a4c f8ceea2f4735f587 0db929ef086f52d2 88b8612d2320bd96 a986de7e5b7e17b3 57f3b328571144f9 9b6138aa2436adb0 23498732b1a0bf10 c0b4fd2552d26ac9 e9c2bf9a3ea7a37d 352633df11cae241
Ciphertext: f0 eba22b797cf2cdea f1cea9b6de373607 8ff9bfa9c544061f 3dc7b2d645908c3e b078b0c66a777fe9 63df1a9962660516 781c1b5f378cc941 ff9827d829aff0ca c8921fece7dce996 12f2c3ef61d4fd7e c50ec028e9b84f91 7e192aeb58912774 f715719f0884f070
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 109-byte msg
Key: a783f34a3ea41f57 a11e0aced8ea9794
IV: 82360d64bfb819c3 4e431737f3988db4
Plaintext: 1c7ef857c3 15cc579667b63856 4024417d40073123 2ed72e228fd8fe79 779d79eea0ca3ef8 b91ea6db00b0f615 1378d9f903120d9a abbf5cea40adce23 29781d6610f069a2 391d2db8128072dd 0c9c423faab560eb d7d836ee7d1b0fba 532686ccf7f23e8c 3cd1d475c5af1275
Ciphertext: c547268321 5370e09ace2e69d6 f3512d7a12d88d8d 16de1e4360ff3201 b8b886ee6f1a182b a9920a8f0a38b5b9 d495121b600833b3 212ba68f48720fb8 3cf75bf50448dc1c 868c7471eb048b77 291a0c2d5c4ca5aa 840eeed108b0162f 72063f94ff3b693f 89a2c3e27529ffb0
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 112-byte msg
Key: 9766975b7992df5c 2aa4756fac2907a0
IV: b09e687c59277d6b 43845940c440a70f
Plaintext: 712b483ee40b3edf bd8fc93de784cfb5 1d4b81c8ac8b3c6e 7a23adac47633968 337b9c7d8033d00b 9add30105488dd3d 7577610273d292ec 7e9ab930c0e2f488 e43dd93dd5735c85 c878f3107c9ef8de c0094e533763478d 58d2c5f5b827a014 8c5948a96931acf8 4f465a64e62ce740
Ciphertext: d1069b3c7420e0c6 2248219beac74cdf e984605e2904e2a9 0c4f2ad5b204738f 0383c5b4afdfd11a 51d99f2d8e74871d 19d46891931b16e1 0f031185df52cc42 c7eec87dcb6cc43e ee5b7d99e9c49f5e 76fb99888955a7d6 2ee63de8f12dd283 036f4e98359a5388 79abc5c01e5696e6
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 119-byte msg
Key: e991e37ea823fa0f b21923b79905b733
IV: b631e6c7d6860a38 31ac351a9c730c52
Plaintext: ff72d9d308eedb ab21fde143a0ea17 e23edc1f74cbb363 8a2033aaa15464ea a733385dbbeb6fd7 3509b857e6a419dc a1d8907af977fbac 4dfa35ec02be8281 106d2d99c0b96f97 b45193ae270d58af 766c971fdf41258d 89a9fb22c540947a 949597b269dbb6c3 30e1d60e8e447038 6be33737ae93fbad
Ciphertext: bb906cbd47ab23 921dcd447a0993a7 4b54f78ce5b143c1 3ecedf17f012b68d 4823b6aaf15d1315 da749399ff95b6c6 ff54bbc74590686d 0e00e834b8c85d4c 47179e5793bab2aa f0da289249d419cc 27f4527781e50102 b1ba66aa5fc77da8 fd5b85e90c4eae05 fc9d095db85f6ea6 03a499cb7573dd2b
Test: Encrypt
#
Source: hc-128.c reference implementation
Comment: HC-128, 128-bit key, 128-bit iv, 133-byte msg
Key: 6f392a1fd910aacd 7f4f9a32ef5aa1e9
IV: acc0e01b891079f3 56ee5251be6516c3
Plaintext: 707f7db17d 13ced701dfa2f806 d6ead1a5bb334d6e ef29f70b885ab41f a23db274fa739c56 b94c103a8d8d52a4 fe71424700ed8b6d c4381e99d48bdf6b 5f269dc5d193482c a72e5e7182e5a790 7a3d22d8b4953f4c 37af4e4afb6c386a 43d76da92d651dc7 887cabede5315f93 f1565ba102b4d0d4 ef957164258628e4 f75a0869367284ee
Ciphertext: 033c9cd9b5 04efda94627f0344 a27e496419efd42e 40b5aa7c6e1602b3 1d222676a1219183 69e0807d77368e49 b4e802e1b0879f76 ccbba06e7403e005 c0c8557c3efa64eb 8fe093f2b01cfcc8 30e0cbeb60b82d79 b7d29752924b6d6d bd206ba3a23e9b22 8440fa4cb8eea924 e9cb192a33c9e2b8 2fd090aa5504c663 3210751efe8136e1
Test: Encrypt
#
Source: HC-128 verified test vectors
Comment: HC-128, 128-bit key, 128-bit iv, 512-byte msg
Key: 0000000000000000 0000000000000000
IV: 0000000000000000 0000000000000000
Plaintext: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000
Ciphertext: 82001573a003fd3b 7fd72ffb0eaf63aa c62f12deb629dca7 2785a66268ec758b 1edb369005608981 78e0ad009abf1f49 1330dc1c246e3d6c b264f6900271d59c fb1c12c1efcb64c5 603ca15ac896d1ab c1082b17b096c917 6547992eaa0eb646 f9e1b4bd35cff88f 047043aebedfbd31 0bb6ca762040ac51 c28203fb1873e539 7afea3aa16bf4a9c 6471aeaa6fc3e042 7d311503a31fe37f 0245e30addf14e93 e8df7d746043aa71 d45397b001787347 bcbf5f23b6fae5a9 b83203cfaefc46be 76f5e28163a6f72f 4ab72fcd90c69eed ef6d5c73539f14e7 ca0bf6a9f229f12d 1492efcfdad11ee2 6de44f0e843178d2 c989d4f21fe9b53c 03c12874e83a7026 3cdc1d88eda83676 7090fb77dae5ecc0 0f5bf5ca8879733f ac19e8de5c725636 7e39e8c9c4efcdd7 5dfa9660bbbeb584 b5593dff4566eac3 7e857d9b9e21ff06 395253c287ab3de3 48e133d87509e1f1 678beb1dfa278ade 7d766ae5863307de 2bb04f975864ebab 903123d6ba517ddd 4b145efb28f72896 8e0d7437fc750977 48e1937162416e5c 98dac486bafef1cc 017df9ce8db87b17 eadcdcfc5e6812a2 7f2fb2d97ced2c9e 0b729527b9b93817 facc1adb7c205063 2575c0a3bd7955ce 713b389bd7e1651a 450c051b77f83a96 da277a370fcebc43 03a18ab1c5ff5342 b319f0593a67f2be 6de7d256cec89f65 61ff60b8ab8621b6 720206975269023f
Test: Encrypt
#
Source: HC-128 verified test vectors
Comment: HC-128, 128-bit key, 128-bit iv, 512-byte msg
Key: 8000000000000000 0000000000000000
IV: 0000000000000000 0000000000000000
Plaintext: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000 0000000000000000
Ciphertext: 378602b98f32a748 47515654ae0de7ed 8f72bc34776a0651 03e51595521ffe47 f9af0a4cb47999cf a26d33bf80954598 9d53debfe7a9efd8 b9109ca6efaddf83 2fe82100ecd66118 d73686bdf879cfcb f35bba32db097fea 1015ff9767b8ec40 a0f85f68bfe6cf5e 2da802d7c08ee9e9 c47510dc03d8fa2d 019a26eaeab7d658 38bac93ff6ac2b28 8c53142696c984f1 cdb28811c1587671 5524f5dd1c3a66b8 47565521adcc6caf aa6ee49fe8e03f13 276a1e8b6c4bed16 4812323da40b37bd e7f8dcc6a1d42ecf 6a49651f7c610657 b1df6e58fbef6a24 6d6d4caa83858839 86325be2b4185b4d 63d4bf766c5f4b73 0b89c3cd66018155 dfe9d37b6f5c1251 6d21763b2febadb2 12ac71388ff93586 48aa1a0e874d3b69 32d7f80a5657f88d a44bdc16aa21e531 e3e473cfe6fca9ee 20739339ce4f2dac 793210c8cc20897f bc468056d084995b 46d396dec7e1b8e0 f90a03be7b6804e6 7abd01162e7d9a1a b9df064ff3b775de be9212c7a5b86658 97be1dc3d112ca8f 5b17b8e803a57d30 530469fde4882f2c 8abadeb718ef4c48 303cf20e6453d735 8dd52e67c721381d 8bdc1dadf206f10c 7900453dfb59e3ed ab05d8816b74a79e 05a77945dd27a2f9 5bb39df39c64bfa1 3f2aae924d3df4fa 22899838adb60980 6c022c36180a3e46 a547cff7f4de1151 a81aed3646b2d86e 1f0f3c22c92d3459 593ed599d1a535df
Test: Encrypt

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,107 @@
AlgorithmType: SymmetricCipher
Name: HIGHT/ECB
#
Source: HIGHT reference zip file, file KISA_HIGHT_ECB.c
Comment: HIGHT/ECB, 128-bit key
Key: 88 E3 4F 8F 08 17 79 F1 E9 F3 94 37 0A D4 05 89
Plaintext: D7 6D 0D 18 32 7E C5 62
Ciphertext: E4 BC 2E 31 22 77 E4 DD
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 29 23 BE 84 E1 6C D6 AE 52 90 49 F1 F1 BB E9 EB
Plaintext: B3 A6 DB 3C 87 0C 3E 99
Ciphertext: 23 CA D1 A3 CD DF 7E AB
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 24 5E 0D 1C 06 B7 47 DE B3 12 4D C8 43 BB 8B A6
Plaintext: 1F 03 5A 7D 09 38 25 1F
Ciphertext: 52 BD 91 BB 26 F8 ED 99
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 5D D4 CB FC 96 F5 45 3B 13 0D 89 0A 1C DB AE 32
Plaintext: 20 9A 50 EE 40 78 36 FD
Ciphertext: 95 02 B4 6D 87 B4 41 67
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 12 49 32 F6 9E 7D 49 DC AD 4F 14 F2 44 40 66 D0
Plaintext: 6B C4 30 B7 32 3B A1 22
Ciphertext: 20 CB CF 41 65 24 E5 A6
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: F6 22 91 9D E1 8B 1F DA B0 CA 99 02 B9 72 9D 49
Plaintext: 2C 80 7E C5 99 D5 E9 80
Ciphertext: F3 1C 89 E6 6C 4F 5A 6F
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: B2 EA C9 CC 53 BF 67 D6 BF 14 D6 7E 2D DC 8E 66
Plaintext: 83 EF 57 49 61 FF 69 8F
Ciphertext: 39 21 C8 3B FE 5E 59 6E
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 61 CD D1 1E 9D 9C 16 72 72 E6 1D F0 84 4F 4A 77
Plaintext: 02 D7 E8 39 2C 53 CB C9
Ciphertext: 98 2F D7 56 17 44 97 BF
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 12 1E 33 74 9E 0C F4 D5 D4 9F D4 A4 59 7E 35 CF
Plaintext: 32 22 F4 CC CF D3 90 2D
Ciphertext: BB 80 F5 0B 35 11 5B A8
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 5D D4 CB FC 96 F5 45 3B 13 0D 89 0A 1C DB AE 32
Plaintext : 20 9A 50 EE 40 78 36 FD
Ciphertext : 95 02 B4 6D 87 B4 41 67
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 12 49 32 F6 9E 7D 49 DC AD 4F 14 F2 44 40 66 D0
Plaintext : 6B C4 30 B7 32 3B A1 22
Ciphertext : 20 CB CF 41 65 24 E5 A6
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: F6 22 91 9D E1 8B 1F DA B0 CA 99 02 B9 72 9D 49
Plaintext : 2C 80 7E C5 99 D5 E9 80
Ciphertext : F3 1C 89 E6 6C 4F 5A 6F
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: B2 EA C9 CC 53 BF 67 D6 BF 14 D6 7E 2D DC 8E 66
Plaintext : 83 EF 57 49 61 FF 69 8F
Ciphertext : 39 21 C8 3B FE 5E 59 6E
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 61 CD D1 1E 9D 9C 16 72 72 E6 1D F0 84 4F 4A 77
Plaintext : 02 D7 E8 39 2C 53 CB C9
Ciphertext : 98 2F D7 56 17 44 97 BF
Test: Encrypt
#
Source: HIGHT reference implementation
Comment: HIGHT/ECB, 128-bit key
Key: 12 1E 33 74 9E 0C F4 D5 D4 9F D4 A4 59 7E 35 CF
Plaintext : 32 22 F4 CC CF D3 90 2D
Ciphertext : BB 80 F5 0B 35 11 5B A8
Test: Encrypt

View File

@ -0,0 +1,713 @@
AlgorithmType: SymmetricCipher
Name: LEA-128/ECB
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 07AB6305B025D83F79ADDAA63AC8AD00
Plaintext: F28AE3256AAD23B415E028063B610C60
Ciphertext: 64D908FCB7EBFEF90FD670106DE7C7C5
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 56CEC76DBD39F3EB7F7AD2A492C991A0
Plaintext: 2D8CCE99726D59AF50B0375DA8C3EDACAE17FBA6932FA60E61F7FA4E265610B1
Ciphertext: 381D0BDBC808C408D1BD0C791FB08469F19F6319329F9ECD5CD6CFD0C3892BEC
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 54068DD268A46B55CA03FCD4F4C62B1C
Plaintext: D72E069A7A307910E5CB5C8C3D98B19B30A326BA9479E20D4A827D546991501A98BAF02FBC64F559D49E004720B7FCC6
Ciphertext: 6C83D52A769B4146F77EFB6F64193D9AB4763140CB560574792788D8D051A6F842A3C6A731A9D88AD0AAF959F82309C3
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 8908A3383D1544419AD5C4C34D4DE40D
Plaintext: BB64C14FA0F2A151F51AEC6518DA799B27E00B33AC9F1C5880A3D90BE9216D5D06D382E16D02056112E52AD06B29B180D1D167952A40EFBAC594C21285367571
Ciphertext: 1BB3EB3EEFB15CB8B846714332DEE0579AD3E047D1EFA108A996D3F2F0E6532C6E7449E1286B714356525BA48B8A061476B0517FD563499B4145FA62DEAFCDD4
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 42AF3BCD6CBEAAEFF1A7C26E61CD2BDE
Plaintext: 5183BE45FD2047CE315189C269B483B337A2F2FBE54C17655B09BA2944EE6F1E6DA0182B6D66ABFE8B823601DCC2208AAC52B1531FD4D42918B21CE85AB306A6EECD7E2FC43BA4B29DCFCFB92788D25E
Ciphertext: F3B6BF4AFBA7103E32B2AC2E7B46FF91E872BCBB93CF52E294ED5539871C4893D14C54088646E2FD0B7C62D583F3AF6718B0BA83C7A29E2F962DF06062121C521BB9E76D7035070719EDFB409C5B83C2
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 6A677FBC647F6AA5F04CF093ED4577E0
Plaintext: 9BB4F63948C6B9502DDE5ED1932F24983A8A6521FA74603FAB7C3C1143CC4A323EFD8B3143307241045AEA3166DF9B9EE26369672ADC3E6110EC0A4CA46F08069D5042FFFBA057EDEAE97CC1E8BFC1D92A9996773CDF8D72E944612B5A5638C3
Ciphertext: 5C1F5BE78BE59B992EBBC2C049FDEF3E46EAA59934589643468FC5B8BF96377CEC45441D00A380BB71D544D759867D7906EAC58B455292D33590D915F8722253AA2AA3D1CD26D6E5DFC4D2BFC4297BB2E74EF0592886162A17C6BC409999FE85
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 8253258BB93FF1BCA6331B6963F81DB1
Plaintext: DCD5F13978A4D4DAFC2B4A96ACAA62D1B3B13BBDC434C71702E1CF111DB1378FBEBE849526549B00124ACB75E1930E98F8108C7E66A86164C49BA0A15F1398D99AFD56748D166B4EF249EFB04238C5801B1921B4E5C3480CB50897017146C7F936396FBCF613CA2B66CFBB3017C20EF1
Ciphertext: C59436538731DFF170276D0C2B4CB36820D738B8560AAC289DBB3FA55309DAB2783A51395F1CCCB7BDA561DEE95A0389B0FE78FAA1D4202B193F3773816EF020C0011163563ECBE2A8B020BA4603DD60A6C43C5A9EAB7A540AD1DAC2C1C3646C899936D33984E7A8E8C979ED67C6FE47
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: E27301498AAC03789DD1BB199B714C55
Plaintext: 5A1BD857A97343FF348439DBA858725317C634239D8C1A0F449E15D125BDB057D04A982BEE5D5B332512709A3C23780E80BCC32C668A16387116AB1256517A655F6FB7220DF99C2D011E68561C4BA88AE6FBB54A2CCF7E5DEEE187C2785632E9CE323E234D708D5690532AF591F78A2F102B12673983DAE581A8B1CBD1F3614A
Ciphertext: 131F71B1FF2593741530236C37ECC1771C9F5B51DC1F975105C9EB9D50349EBA432DEB097D5E6239423F774CC62FCFFA364D7F82037BB0B5EB3E985705482B89948C1C1EBFC7634B80EEBA8BDE49C33931CCBEF5BD64AB808C0579D66620771A72971820D52862CEC61C2A05493EA89B8A0A3429041DCE4583E78CCD14AEEA5A
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: E63A3415F8EAB6169956BD61E14FA766
Plaintext: C8F5E36AD3CCB338F3132F13AA518EF06F30A1E2548EA0D6E6D22980547C8695D4012F3B43D58FBE0BC90B844A97414331BB8D71AA85D2FC3D6D773C34A6AF26FDF6FEC2D1C4F9DF93734D05FBEE02ABF38401AA41F7D4F267CFAE7BC7F4AB7F0B7C58E7C4C2760351B8FB7D037E5A907F330475630B2F1E2CA1D627578F010AC63D469266F690920F411FD6AB6ED05A
Ciphertext: F4E15BCF683501B1D3432CD57D246D89CCFCE6714295A16170067981F4BBEBDA8C6B144FA12E3A58FF7113B8C9453379F104F394DBC416BB35ACB036479A260958B20A97A17BC353CFC92E62139114DCE81DD50FB89A178C2F020D3A6AFDC2037AEA91CE323802E1A1EC5C70EF177EB6AB5921EE94151F37A48976992E09B9FD7544F34642B05B7E580F1A9AC6A3D9C1
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 128-bit key
Key: 9B6F9FBA56E96AEA538BF8272A9F392D
Plaintext: F6DECFABFD89CEF493B5C0F73BE7ED7110E0D96163BA0DBDA6341A63884BDC52620AFC1AD2A2B891A5BDE7C8FB10373DA52FBA52D2A6A1FEEB4547C3BBBB71E0D367D4C72D6AD7D10F019B313212382724044A76EBD4AD17EB65842F0A18803F119D5F9A5509B21D9828E41A2A147895530692B3F66DB96F6E3DDB8FBC8A91D6E455A57C94A6D2DB07DBCA6B293F7EF0FCDE99F23A984D6E3C7553CB1A382D0F
Ciphertext: 98D85D7D0D136A80CE74864469D77A03EF56EC9B24A7119DE09508A04D6F437E670B54B36E2CBDE51CDBD01E2CEA53332C2A14879FF77E02000A00F159FB1865E7DBED543357917D783F18B06FD8EFA6686D2E362BCEDE94BB7687ECFD7501B79F912740840683722466440D240EF0355604BFCFBC30F16F03D00543582A52718526079355164E6B8CEC36E346B9092D9706C48946C497629C9C9055D9D89777
Test: Encrypt
#
#
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: 1437AF533069BD7525C1560C78BAD2A1E534671C007EF27C
Plaintext: 1CB4F4CB6C4BDB5168EA8409727BFD51
Ciphertext: 69725C6DF912F8B70EB511E6663C5870
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: BA838FE55FAEFC0ED7AF051790462F01D7A2C778FAEA2405
Plaintext: A9172C84A2041AD98EC87EDF254384A199F77ACD32198D6535E8D3B80B3E8F91
Ciphertext: C6C5F98E4C633E7463518815BF9087C0289DEB0A1B16A9AF31FEE64455A1D025
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: 9F65B0AE082B9A73683929E014A0F3C1F5B5CE242E1F9310
Plaintext: FE2E2174E86FA45E127D176DEC190789117D9AD172EED1D5B1910A06CB7FC96BFA1BB795DAA4EBD4CA0669AB95F6E882
Ciphertext: B465597F4DD76E342F8FCA5D0D095CA9479F6AB6EC86AC51F9F372448AB3CAB73F051704FBD350B2D2EB2B270B416A4D
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: 523DD99B8854A4479632355A5262B7DCF1589F012705ED5B
Plaintext: 8EA9AE4F4CE9C6C6F121EC249EFBF67E6C4157080BEFE6CCAA8DE1A217BB315C280EEF41591A28BDB6D0DD56FC0B4EE2FB6579F73E4FDDA4EE61835EF4EE3F3D
Ciphertext: 104D15C2618A9DA9AF8C563A4CB1E14ED869C864CC1EB190731042183F46C9A4FB09472B8485345F94AF5A55257DC1D7A4FA3A8CD46161C74387360061770C5E
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: 5EDC346904B296CF6BF3B418E9AB35DB0A47A11133A924CA
Plaintext: 857C8F1F04C5A068F9BB83AF95D99864D6317751AF0332D1638EDA3D322644A837870CCC9169DB43C155E6FB53B6B7E4C13330EB943CCD2CCCE3296382EEC4A4CC2A034DE10278387D4F643587727AB7
Ciphertext: 72223A93942F7359FE5E516A05C8E841C59BB74714809B13A9757B8293F9B0B420D1C5A4F440F365D08F9425E347B5DD23A9ED05F2CE1618CCB09E712C59B97B7674517FC875AE9F6F188BFA5A42BAC9
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: F2A1E6CDE17E8E540EEE986C6C282C280B0C7B8A3CB700AE
Plaintext: F754054579346A453122A2DFDDF0FEB2F1562E3E38FD059BBDD67C6AECB0FA0DF50AD21371250DF6485E6B09D2BBA4AC3CC4F3C22E94D565AA2F0FD83816EEBC4019D287B76DEE33FDFE4933060608ABB9DFF0E0951627EE9AC03AB967116425
Ciphertext: 3ED82167994A687B8B4F5FF8DBCB0F15CD3FFB743C126522577491B04FD9308EDC92ED3CD4F103A3ECC8503DD2128DCE772AEB821A518A023EAA9853D01E473EE45F979048ACFD7F832DD3A69A7B77996BB16B1D1CEBDB33AD4EBE4D24489D02
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: A02A0E8A923392621AAA4445C2FAB3182E502C81B7AA809D
Plaintext: 553107F6C2C8E5AFDCE58C024C9F83ED650965274EBF2C5964BEAF8BDA796ADCA2297E779164F8C2BEF156D92BDB483AA7C4B3C2F27CFBD823D282E847AA6C134B50A6241C0C26C60CF774F5780C69B3A78236FCF65AA9FB3234AC7E46660FA8164F87E5AAE9F6238F9EEC407A5D6EBE
Ciphertext: 5277CF7E992F5BDC4EAEBA7DC00BFE36DB3292A73DA86B230ADC91E94C021679A68C6B65FCDC370C0CF443EE945F4748FCEFB8DD1241EF6A2D2036967E9EBCAAFE636DFEBF0BB23792A0F22C9873B54726C7157666B4A331C79C709D29B2D598B86D1CED7725175E882F92AF04DDBCC8
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: 2FECF7BEA180BD2C5B8B35371ED5D904CCCE29A38423F042
Plaintext: 0F8FC8A07BF4E0C505AAFDF13D16BFD2647F26F9191E548F35749544F3E19C89547110FFC1F9472FF263517B1046385416BA86AE7D6A08B118EAD2B23D4B836125EDCA4495952964BEBFF9466336AF1C39E15D3D93E07CD33ED8E8D3AA8A2C334BAB00573FEF10CC3168FF387D0EAC91959FB48EA3A9385B70E4E09184C61F65
Ciphertext: 1EAB3C4E6B81F928D93389D808EAAB91A8B90862E63E2018E9CB50082DD172A094B6ABE3031D6DD282AD79B1AC45A9C7B9368C719EB75665D53342737C924221DB2C709723BFA91CF2070A3FE2A19262608937A23D84EF2E8089C6BD8254BF71C9263E8221609EDE733E33857C37E6A79079654715340D48FF335C133FFB03EA
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: 8F52B920073183CF13036A3BA8F7B71BF1999289F5ECC4B3
Plaintext: 74B9C1D31126E561B78AFE8635800BD52B3B43362A195922177AFF16D0D2A94112FD93809BD3058D8BFDD67410072F4642B591104C9B190ECDE8031D7E836E6F14595E8268F50753D55149CFE1EB778A201C5CB356A58048DC8BA78645269BA440742BC0C0B3741A5B2E5F80F0576B098D16AD06906115360C0DF2396EE3B84760F70122ED35D349E63D216F8571942B
Ciphertext: A466C6A0E7D3E3A3756B591C8F5302E235B0EE64F5188B4DCB51A9204B54094D4A1CC3FC34E22401C618AB8ADB28D41531762A576EBCADC956BF19E5B29701B2A77030EE100B65BCF8397853EB2074402089FF697046D538C560D10172EA8DE81299011E3FF0A0FBD87499FF50A0B3E7E59FA06753FC1BC4171046380323875C24350A9E98DDF69F6D7E37E363DDE1BA
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 192-bit key
Key: 514B8BF141F560412413ED1E40E34EC23A89E99036A4AC4A
Plaintext: 3E259684E86179593365FE5CB389E9D1EE489E1E054EE47C97D3EAF2E22888842B8FC6A86050A2F9FD090E2F2C46394F30510F1F034C03DD3E7C0C303AE8ED5F7523BAC13766987575E1C452F553D721B3D9480A8403324DF92D5733860D6643E38879B8B3CAE233649527AE56D94BB13F864FC8CE9EF9348E8ED4E10EBE78983F670B761DA5089D91CD3F2996001E669C002E402943E0FAC6468A231924ADC6
Ciphertext: 6239867F34D57B91729410F93797C69E45526F13405EC222EDFAE682B6C2D75B332430D30BC2479735ECCD3BD985657EC965EB93394BD88CDCE7A76BE81255AB3418D57082770129C3482A2B1E51F14E2C69A24E6405944487B08554D75A35043D713BAD5643F6C4FC1C5CF22B3C72479DD060AB92B4DA51B76DCA855769143608A92AE8DED684A8A6D093765F4149CF1A3753B849368E99D066D2F711C27F75
Test: Encrypt
#
#
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: 4F6779E2BD1E9319C63015ACFFEFD7A791F0ED59DF1B700769FE82E2F0668C35
Plaintext: DC31CAE3DA5E0A11C966B020D7CFFEDE
Ciphertext: EDA2042098F667E857A02DB8CAA7DFF2
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: E7FE92FD374D30C43F5DC204DCAE9D4EAD6C0663BD8CF5EC6318196B67C71B72
Plaintext: 66D127137801A9970F0C5472232169778CC13649AFD1DD125CEE5677F700B7CB
Ciphertext: 16BFF149DFA234BF7FBE2C59AE88A1E99A1BF8D91910A7F67D088432E1C6D790
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: D612B382EB6161E9A3B23F150DE977193FD8617DF65548EB7C8F712ACFA25951
Plaintext: FF683F34D892E223C1F88CD4E42E4F9D8F588FE6DA3FC1DF8BA4716E36D48A6CA97CD21087BFB4AB32864296EE177A69
Ciphertext: 7BC5E4E4D9C4B5C4694F5580896671B5F58324B62005C8F8A52A65AA8E1A9B01DC90BAC0817013AD6C9DD0F216403D6B
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: 44EAC86EA5B7CD5650D45F2A76BED1849BF674FE3F0E5DEBBE03694575CD7FE7
Plaintext: 263515FC9DE7F6B894C84246D589B6019E7D2DE649A767492C180AC8BF78E67EFCE27D790CF5C36D1F2722A99C5DC14B7AB906B0EDB35A2F466C2C07143E3895
Ciphertext: AB395086E9238A16012DB04844028340C21C557AAD92C0ACA2D261EF3A0F89F9F060462F79879B10C6A9A1C168DCBFE8731E5176604EEB14CA1442D15173C5CF
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: 909809CB3809BCDDB99A083D12617BCAF7530645735ABC04D2A8D7EABE4AFC96
Plaintext: A800C0DB6A4C6A702AC9FAE981BE6BE6DCF3368B23C317309973135904C2BAE80DC1AA91E9E5548F395B03952F9B1A08F3409C6B4517F21B6376E93C2DCFFBF38784CFD5FFFD03A0B0F9282965210E96
Ciphertext: 2A50FA90ED00EBFA1188CC9113DD4337B380D5F8C1582C8077EC6728EC318AB45DE5EFD1D0A62E4E870352832BEC223D8D5DCD397209C824E4A957F65D785BA5D7F9A4CC5D0B353528DBCCA63548668A
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: 02E342CD207DD62DF858607B8298451FDEF13890F2BCFD0D554A738E6B78D1FA
Plaintext: D283309AFD1E4ACE1FC281FE4B4623D4D9AFECA80B49CC3CF1F7EBAA89C7EB9A2BC96DB82422D666A25C53ADD0001A7A4167F30792CDF7974BA798660736E2E0D55D0111DDB0025D47CDDE7158EFB479DEC05693CF6F07842D0383AB2CEF4033
Ciphertext: 247F64E04D91ECA484BE9D60F678EFE6975CAE82D72EAD270F6DD2EA6D63361EB88F6FA6F58FAEBC1A16ABE6E5D92939B669E0C55EB667E9AE0052D747C0B1D5A5F71AD659C297B0D0A45EA2A5088852198FC88DBBAB1A9AB83C67F737769B60
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: 97E6F48C70F0571BD7BE2A302C3A783978631C360958836D5DB2B35F42178CFA
Plaintext: 3A0D4E10240B5C0819D640D4950BEE23D7F74DD78AAFF3B9A45D306B8FD94F9F8779188743299A8CD7BE2743D9879F9DC225F25E989DE0D0CAAC03B85C5B108943D25AD813719710D71DE76740D81210039511B27C4AD11A9746332DF0C5572039C21AEBDD0CDDFAE29C89261426CFE5
Ciphertext: BEABF62347C9DDC68D33015757F5309CC11E9CADBAE3E0BCCD25CF01FC31F68987C5055A41347C4E0D054603D3FF329CC9065923D01A11E7D95DFD5208FEF65122102F9D50B4459839F3720CE24310FDB2124C4E7CEB6D7548C6841852B7A64019D2CAC995F6B84A00BED386FCDCD96A
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: 60EEB5BD7EDD4EFFD3D4C8B19540ADCC30EF62A8E822F4B4C0E3136A9B985F82
Plaintext: A2D9E366E57FDFE745FDCB2E91F498F5EF0139F77EDA62A43999901A1F57495191FDA595FB570D3AB66A438B2D08A2033FA1A8C0E55CB1341566051EE68A15B8F4030232068E5F60EEC338B0B1A4535EE877B5EB66D168CB1BF47C5E385A4C21949203264F4B5EC1B5AFB38565F2326EB22A6B60496110D014E8FCC15FEF75F3
Ciphertext: B97E56C7BED6B27CAD1F79EEFB1B4C04559B8632BC5767734E66C402B406B6682C4DC198F0D640982789B87DBC6EDA1914A9E21AAFFDFC360CA77EA34CE73DCB1E42A61E5A3D01A9D5CB1A8D8CAEC8ADAA2317287E48F450C933EF3BF938A060929307E082D06E6061D3EEFEBBA69FCC43FEC4BA75E77F1F6331B993BB5E58D6
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: 3A53AE571EB790C5D3D6BAF19017C79C6563CF07D63330ADC9ED8E31A2701896
Plaintext: ACED0DAEBBFA7FD50FE158DF7C3E9A4EC8C9EBC8557050C9FFA939964806BE72B30928136D3BB357327892346F8D34EDA405C68C0D3FF98C81C405D69AD8EEEF164F056F7DA2B3B5044272D9B22C1CE2C1BE683947C9B15E16E7FADAE00F30759F66AEA8335807554DE8FFB68D44DA94E79DDAB94B3503A785BA218A62D20C6C14F72BA8D78537A1D51141B347FDF76A
Ciphertext: D0F21340B914957E0E5C180376F4A2B3EB50EA171514246209FF259A32EDDF71EF819AEEED2936B1E8FB5B90FB399468A498B501DEDA9280770D903CD81898ECFFD15C3F27AC0FC2C8586B7E0059E5E4FAFF0E2FEE1DA1CCB145CDFDF3CA9E12BFC5F642DFCF73F0D7146969F8C4E050F83C9FBD71CDD39EF74540BBE9FDF94EB2BA543E556202EDE13C7108A9FD50B1
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/ECB, 256-bit key
Key: DE4923F261AC74CF97E481CE674A0B3C3EA98255B150CBFF646641B92A7EFACE
Plaintext: 6D6B4BCED1568E3E140E228F399EB44DE525BD9909E24CD9C18F06AE7CF06B275EAB5B34E25AD85DC4DF0DB31EF78F07D113E45B26634296B533987C867AD3DC77B05A0BDDE1DA926E0049245F7D25D3C919FD8351FA339E08FA00099045B8578123503D0A121D46DC18DEC84357FD1796E212F8D2CFA959828E453FE279A5FF43AB45B1B11628E2D4D0D58914AEA03C00142AA4F10B2B2FEA946F04C33D1F3C
Ciphertext: B73A0064A429EBE6A7CF35D7ADB94F24A2A0FF7A1D835522453A67EB8FB4FED63DA51D9634FF4C70A764DF3F6F3763E0D3845630774219A819C26EADFD3B93199935A95BD4A951D4467723E12FBA1CA4E8B135FA1FB9ED9FAA7FDC79D2857F78AC8D8C39C11D33D0AE58B6E5E0EF78195C0C8214AB7D3A82B91F9A7BBE89D6A0796E9DEBC69AEE8811011B9D48EECD8DB7BF71566EA6D8A0858E596432E1803D
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: LEA-128/CTR
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0x7A, 0xD3, 0x6A, 0x75, 0xD5, 0x5F, 0x30, 0x22, 0x09, 0x4E, 0x06, 0xF7, 0xC8, 0x97, 0xD8, 0xBB
IV: 0x0C, 0x5F, 0x04, 0xE8, 0xB5, 0x12, 0x19, 0x5E, 0x74, 0xB3, 0xDE, 0x57, 0xE9, 0x70, 0x97, 0x9E
Plaintext: 0x08, 0x7A, 0x83, 0xFC, 0xC1, 0x13, 0xA9, 0xF3, 0xE0, 0xE9, 0xD5, 0xAF, 0x32, 0xA2, 0xDD, 0x3A
Ciphertext: 0x2B, 0x73, 0x49, 0x7C, 0x4F, 0xC9, 0xEF, 0x38, 0xBE, 0x7A, 0x0B, 0xCB, 0x1A, 0xAB, 0x87, 0xA4
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0xE9, 0xB8, 0x28, 0xEF, 0x41, 0x87, 0x71, 0x31, 0x64, 0xA4, 0xC9, 0x5D, 0x8B, 0x71, 0xDB, 0xFC
IV: 0x67, 0xEE, 0x74, 0x3E, 0xBF, 0xD2, 0x43, 0xA4, 0x5A, 0xDB, 0xDD, 0xFC, 0x1F, 0x62, 0x03, 0x92
Plaintext: 0x7B, 0x32, 0x28, 0xA5, 0x03, 0x9A, 0x2E, 0x18, 0x5B, 0xC1, 0x71, 0x6A, 0x56, 0x3A, 0x06, 0xE8, 0x5E, 0xD8, 0x45, 0x21, 0x17, 0xC4, 0x84, 0x9B, 0x3F, 0xCC, 0x26, 0xC4, 0xD9, 0xFE, 0xD5, 0x2B
Ciphertext: 0xFF, 0x94, 0xA7, 0x09, 0xF1, 0xD6, 0xC6, 0x83, 0x32, 0xC6, 0x61, 0xCC, 0x8B, 0x6E, 0xE7, 0x5A, 0xF1, 0x8F, 0x0F, 0x87, 0x88, 0x90, 0xD1, 0xBE, 0x5E, 0xD7, 0x93, 0xCC, 0xE5, 0x07, 0x1E, 0xCC
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0x8A, 0x76, 0x0B, 0xF0, 0x43, 0x74, 0xD7, 0x7A, 0x20, 0xB2, 0xDE, 0x67, 0x90, 0xF4, 0xA0, 0xC9
IV: 0xB7, 0xE0, 0xFC, 0x8F, 0x10, 0x10, 0xF6, 0x41, 0x57, 0x66, 0xB9, 0xF1, 0xA6, 0x9F, 0xD8, 0x6E
Plaintext: 0xDE, 0x2B, 0xD9, 0xBA, 0x48, 0x3C, 0xF4, 0xBE, 0x7C, 0x1E, 0x18, 0x3D, 0x82, 0xC6, 0x2F, 0x07, 0x38, 0xAD, 0xA3, 0x6F, 0xF3, 0xDF, 0x21, 0xFE, 0x69, 0x4E, 0x9D, 0x69, 0xCF, 0x6D, 0x96, 0xC1, 0x3E, 0xFA, 0x9B, 0xEA, 0x5B, 0x1B, 0x0E, 0x4E, 0x37, 0xAD, 0x28, 0xD2, 0x74, 0xD9, 0x3D, 0x0A
Ciphertext: 0xFD, 0x38, 0xDB, 0xF9, 0x13, 0xFD, 0x39, 0xD2, 0x6E, 0x13, 0x87, 0x01, 0x89, 0x35, 0x4A, 0x6D, 0xDC, 0x90, 0xFA, 0x49, 0x44, 0xBD, 0x20, 0x40, 0xC2, 0x24, 0xEF, 0x2D, 0x4F, 0x52, 0x65, 0xB9, 0xD7, 0xEA, 0x18, 0x8A, 0x08, 0xAA, 0x90, 0xC8, 0x36, 0xCD, 0x21, 0x77, 0xB5, 0x69, 0x04, 0x7B
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0xAA, 0xE8, 0x41, 0xA8, 0x08, 0x58, 0x8C, 0x3B, 0x3F, 0x2F, 0xDA, 0x16, 0x9B, 0x8F, 0x96, 0x8D
IV: 0x73, 0x8B, 0x58, 0x68, 0xC4, 0x39, 0xAC, 0x91, 0x19, 0x08, 0x15, 0x10, 0xAE, 0x54, 0x51, 0x39
Plaintext: 0xD4, 0x38, 0xDF, 0x24, 0x97, 0xA4, 0xBF, 0x5E, 0x9F, 0xAF, 0x79, 0xDE, 0x54, 0x2E, 0x60, 0x3B, 0x46, 0x85, 0x18, 0x1C, 0xCB, 0xBD, 0x56, 0xEF, 0xEA, 0xD7, 0xE7, 0xDE, 0x77, 0x60, 0xF4, 0xFE, 0x80, 0x46, 0x84, 0xCA, 0xE8, 0xEA, 0x42, 0xD1, 0x52, 0x76, 0x81, 0xAB, 0x40, 0x71, 0x7D, 0x31, 0x7C, 0x91, 0xE3, 0xEE, 0xB8, 0xD0, 0x94, 0xD0, 0x71, 0xC1, 0xA6, 0x23, 0x19, 0x25, 0xAC, 0xC0
Ciphertext: 0x65, 0xAC, 0x04, 0x22, 0x41, 0x45, 0xF8, 0xD5, 0x26, 0xB9, 0xAA, 0x88, 0xA7, 0xBF, 0x4A, 0xCF, 0x3B, 0x47, 0x33, 0x5B, 0x5E, 0x12, 0xCE, 0x11, 0x1F, 0x1B, 0xC1, 0xF8, 0x07, 0xF4, 0x15, 0x5A, 0x97, 0xCE, 0x73, 0xEB, 0x2F, 0x5F, 0x75, 0x10, 0x4B, 0x74, 0xC2, 0xF8, 0xDF, 0xDF, 0x9A, 0xF8, 0xD6, 0x5C, 0xAF, 0x69, 0x39, 0xD9, 0xFC, 0x75, 0x33, 0xF7, 0x0F, 0xE3, 0x6F, 0xE7, 0x44, 0x78
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0x74, 0xBA, 0x38, 0x82, 0x43, 0x53, 0x9E, 0xFA, 0x20, 0x2D, 0xFA, 0x64, 0xA9, 0x81, 0x74, 0xD9
IV: 0xE0, 0x56, 0xC2, 0xC6, 0xD2, 0x99, 0xEF, 0x9C, 0x77, 0x6F, 0x5B, 0xC9, 0xDA, 0xCA, 0x04, 0xE8
Plaintext: 0x79, 0x3B, 0x03, 0x34, 0xEF, 0x07, 0x5A, 0x43, 0xD0, 0x7C, 0xEC, 0xF1, 0xD5, 0x85, 0xCD, 0x9A, 0x39, 0x7D, 0xBC, 0x8C, 0x62, 0x41, 0xEE, 0xBB, 0xC4, 0x89, 0x0E, 0xB7, 0x03, 0x78, 0x81, 0xDC, 0x57, 0x71, 0xEE, 0xC8, 0x35, 0x2D, 0xFE, 0x13, 0x2C, 0x0A, 0x60, 0x3A, 0x0D, 0xA6, 0x11, 0xDB, 0x4E, 0xAD, 0xDA, 0x28, 0xB0, 0xEF, 0x1A, 0x96, 0x20, 0xB6, 0xC5, 0xD5, 0xDB, 0x56, 0xAD, 0x05, 0xD6, 0x05, 0x00, 0x27, 0x5D, 0xED, 0x12, 0xD1, 0xFA, 0x80, 0x5D, 0x26, 0x98, 0x0C, 0xC7, 0x06
Ciphertext: 0xAF, 0x18, 0x50, 0x91, 0xA0, 0xA4, 0xF1, 0xE2, 0x5B, 0xC2, 0xFC, 0xB0, 0x5C, 0xB6, 0xDD, 0x1B, 0x46, 0xCB, 0x01, 0xD5, 0x8F, 0x90, 0x55, 0xC6, 0x1B, 0x9A, 0xB5, 0x49, 0xD4, 0x6D, 0x1C, 0x55, 0x9A, 0xDC, 0x51, 0x36, 0xE0, 0x6E, 0xB6, 0xCC, 0xD9, 0xF7, 0xC8, 0x5A, 0x2D, 0x6D, 0x3B, 0x5B, 0x22, 0x18, 0x08, 0x1C, 0xFA, 0x76, 0x75, 0x98, 0x60, 0x36, 0x8B, 0x52, 0x3A, 0xD9, 0xF2, 0x26, 0xA3, 0xA7, 0x72, 0x55, 0x3B, 0x67, 0x35, 0xAC, 0xA4, 0x75, 0x6E, 0x9D, 0xA2, 0x0F, 0x91, 0xA5
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0xE8, 0x8F, 0x23, 0x82, 0x04, 0xCC, 0xF9, 0x93, 0x53, 0x9E, 0x8A, 0x0B, 0xAC, 0x8D, 0x0F, 0xCB
IV: 0xBE, 0x9F, 0x42, 0x37, 0xAF, 0x70, 0x1F, 0xE7, 0x03, 0x85, 0xEC, 0x9F, 0xC0, 0xDE, 0x77, 0x82
Plaintext: 0xCF, 0xCA, 0x9F, 0x82, 0xA6, 0x00, 0x15, 0x1B, 0x24, 0xEA, 0x64, 0x41, 0xBC, 0x44, 0x2F, 0x97, 0xD6, 0xE6, 0xBA, 0xE1, 0x72, 0xDE, 0xAD, 0xBC, 0x0F, 0xC2, 0x14, 0x8D, 0xCB, 0x45, 0xA9, 0xB7, 0xCB, 0x07, 0x56, 0x11, 0xDD, 0xB2, 0xF6, 0x97, 0x5C, 0x42, 0x5C, 0x5F, 0x55, 0xA4, 0x96, 0xCF, 0xE7, 0x83, 0x72, 0x0E, 0xF0, 0x5F, 0x42, 0xB8, 0xE6, 0xDF, 0xDD, 0xD6, 0x02, 0x68, 0xE6, 0x0D, 0xA4, 0xEE, 0x51, 0x15, 0xF3, 0x0A, 0x22, 0x6D, 0xC3, 0x4D, 0x78, 0x4D, 0xBD, 0xD5, 0xCB, 0xDD, 0xB9, 0x1D, 0x72, 0xA4, 0x6F, 0x19, 0x68, 0x43, 0x4F, 0x83, 0x4F, 0x63, 0xAD, 0x70, 0xB5, 0xEC
Ciphertext: 0xAE, 0x4E, 0xAF, 0x6D, 0x12, 0xBB, 0xE2, 0x0A, 0x5F, 0x81, 0xF1, 0x0E, 0x21, 0x28, 0xCE, 0x02, 0xAE, 0x1F, 0xC6, 0x32, 0x58, 0xD4, 0x59, 0x90, 0x64, 0xEE, 0xDD, 0x81, 0x20, 0xD5, 0x4E, 0x36, 0x1E, 0x35, 0x45, 0xC0, 0x8E, 0x76, 0xC9, 0xCD, 0xCB, 0x54, 0xE5, 0x94, 0x76, 0xB3, 0xF1, 0x7D, 0x33, 0xF1, 0xEE, 0x45, 0x1A, 0x0B, 0x0F, 0x42, 0x98, 0xE6, 0xDF, 0x14, 0xF9, 0x58, 0xCA, 0xCB, 0x13, 0x3A, 0xA6, 0x5B, 0x42, 0x81, 0xBA, 0x63, 0x0B, 0xDB, 0x29, 0x96, 0x5C, 0x0A, 0xB8, 0x36, 0x3D, 0x10, 0x8A, 0x5F, 0x4A, 0x57, 0x4E, 0xB9, 0xC7, 0xAE, 0x0D, 0x8E, 0x52, 0x39, 0x32, 0x5B
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0x21, 0x26, 0x97, 0x77, 0x2E, 0x31, 0x23, 0x07, 0x21, 0xB4, 0xC2, 0xF3, 0x3C, 0xFE, 0x56, 0x27
IV: 0x14, 0x5D, 0xC0, 0x8D, 0x38, 0x37, 0xA6, 0xC5, 0x13, 0x56, 0x73, 0x1C, 0x14, 0x84, 0x9F, 0xBC
Plaintext: 0x0C, 0x58, 0x30, 0x20, 0xD7, 0x4F, 0x81, 0xCB, 0x3E, 0x1E, 0x42, 0x3A, 0x1C, 0x47, 0xC0, 0x17, 0xC0, 0xEB, 0x66, 0xAF, 0x93, 0xDF, 0x84, 0xA6, 0xFA, 0x02, 0x50, 0xE9, 0x7E, 0xCD, 0x2B, 0xE5, 0x2B, 0x2B, 0x25, 0xF7, 0x35, 0x8B, 0xC2, 0x23, 0xE2, 0x34, 0xFF, 0x08, 0xA3, 0xD9, 0x90, 0x13, 0x84, 0x6E, 0x6C, 0xF4, 0xC7, 0x3A, 0x8B, 0x4E, 0xCC, 0x2C, 0xEE, 0xB3, 0x35, 0x72, 0xE1, 0xCF, 0x47, 0x48, 0x7D, 0xE3, 0x92, 0x0E, 0x70, 0x76, 0xD4, 0x9E, 0x01, 0x47, 0x1B, 0xDC, 0x4E, 0x85, 0x2A, 0x8F, 0xD8, 0x42, 0x1E, 0x6F, 0x42, 0x26, 0x51, 0x7E, 0x56, 0x60, 0x7F, 0x9C, 0x49, 0xE2, 0x27, 0x56, 0x40, 0xCE, 0x34, 0x00, 0x12, 0x2B, 0xDD, 0x03, 0x50, 0xDD, 0xCA, 0x77, 0x83, 0xD4
Ciphertext: 0xC1, 0xCF, 0xF6, 0xC9, 0xF2, 0xBE, 0x60, 0x94, 0xA2, 0x62, 0x54, 0x65, 0xF8, 0x9C, 0x88, 0x92, 0x16, 0x52, 0xF3, 0x67, 0x04, 0xD1, 0x7C, 0x50, 0x11, 0x88, 0x06, 0x6F, 0x4D, 0xE1, 0x73, 0xF3, 0x37, 0x16, 0x7D, 0x6C, 0xE3, 0x0F, 0xD3, 0xF5, 0x74, 0x0B, 0x1E, 0xE7, 0x32, 0xB1, 0x07, 0xAF, 0x0C, 0xFB, 0xD5, 0xA0, 0x23, 0xFA, 0x44, 0x9F, 0x61, 0x25, 0xDB, 0xBD, 0x7E, 0xCA, 0x65, 0x1E, 0xE5, 0x11, 0x59, 0x48, 0xAE, 0x98, 0x64, 0x96, 0xFC, 0xF3, 0xF7, 0xF7, 0xBB, 0x4A, 0x61, 0xF1, 0x42, 0xEF, 0x9A, 0xFA, 0x92, 0xE0, 0xC4, 0x3A, 0x8D, 0x92, 0x07, 0xBB, 0xB3, 0xCD, 0xB7, 0xB4, 0x49, 0x10, 0xB4, 0x4A, 0x41, 0xE4, 0xDD, 0x6D, 0xF3, 0xF4, 0x6B, 0x70, 0x0E, 0x05, 0x65, 0xEB
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0x78, 0xF5, 0xB4, 0x83, 0xDE, 0xA6, 0x32, 0x94, 0x51, 0xA0, 0x8F, 0xDA, 0xA5, 0x73, 0xEC, 0x87
IV: 0x95, 0xFE, 0x76, 0x9F, 0x64, 0x88, 0x31, 0xAC, 0xC5, 0x0C, 0xF5, 0xB4, 0xF9, 0xD3, 0xB6, 0x68
Plaintext: 0x37, 0x48, 0x08, 0x9E, 0x50, 0x09, 0xE1, 0x01, 0x93, 0x3A, 0xA1, 0x07, 0xEE, 0x1E, 0x51, 0x24, 0x57, 0xE8, 0x28, 0x3E, 0x6A, 0xCE, 0x54, 0x60, 0x54, 0x60, 0xF7, 0xB2, 0xEF, 0x18, 0x6F, 0xA9, 0x2E, 0x32, 0xDA, 0x7B, 0xBC, 0xBD, 0xD9, 0xD6, 0xE0, 0xF3, 0x95, 0xD1, 0xA4, 0xC6, 0x00, 0x23, 0x36, 0xBB, 0x5E, 0x92, 0x8E, 0xFB, 0x03, 0xAF, 0x51, 0xA8, 0x5E, 0xC1, 0xF6, 0x6D, 0x36, 0xFF, 0x27, 0x59, 0x34, 0x02, 0x6A, 0xED, 0xA2, 0x79, 0x00, 0x73, 0x72, 0x1F, 0x0D, 0x92, 0x82, 0xEA, 0xFA, 0x20, 0x1E, 0x85, 0x18, 0x37, 0xC7, 0x01, 0x86, 0x8B, 0x32, 0xC8, 0x54, 0xFA, 0x94, 0xD2, 0xE8, 0x65, 0x1D, 0x1B, 0xA1, 0xBF, 0xC2, 0x54, 0xBB, 0x63, 0x40, 0xD8, 0x73, 0xAB, 0x5E, 0xE3, 0x6B, 0xBE, 0x72, 0xFE, 0x4F, 0xA9, 0x26, 0xBE, 0xB9, 0xB2, 0x7C, 0xAE, 0x52, 0xE8, 0x10, 0x8A
Ciphertext: 0xBB, 0x74, 0x55, 0x66, 0xA7, 0xA2, 0xBB, 0x23, 0x59, 0xE5, 0xEC, 0x70, 0xD8, 0x0C, 0xD5, 0xFD, 0x79, 0xCF, 0xC8, 0xDA, 0x27, 0x98, 0xF3, 0x8B, 0x02, 0x88, 0xB2, 0x86, 0x32, 0xCE, 0x9F, 0x72, 0xC6, 0x18, 0x30, 0xDE, 0x6B, 0x31, 0xB7, 0xEE, 0xF0, 0x07, 0x77, 0x78, 0x4D, 0x5E, 0xF7, 0xD5, 0x79, 0x71, 0x19, 0xBD, 0x28, 0x1D, 0xFA, 0x61, 0x3A, 0x36, 0xA8, 0x8D, 0x5D, 0xCD, 0x17, 0x1B, 0xCB, 0x9F, 0xBF, 0xBE, 0x67, 0x10, 0x06, 0xD8, 0x84, 0xB2, 0xD3, 0x30, 0x50, 0x44, 0x4B, 0xAF, 0x34, 0xD4, 0x0D, 0x06, 0xB2, 0x90, 0xC6, 0x6D, 0xB0, 0x90, 0x25, 0x9E, 0x02, 0x45, 0x7B, 0xF3, 0xCE, 0x94, 0x32, 0xC8, 0x53, 0xBD, 0x16, 0xD5, 0x63, 0xA3, 0xA7, 0xFC, 0x7F, 0x07, 0xD9, 0x1A, 0x30, 0xE4, 0xD5, 0x92, 0x78, 0x11, 0x70, 0x4B, 0x21, 0xDF, 0x16, 0x79, 0x42, 0x13, 0xBC, 0x9C
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0x3B, 0xFF, 0x9E, 0xAE, 0xAB, 0x5B, 0xC3, 0xCD, 0xD9, 0x6B, 0x08, 0xE6, 0x1C, 0x38, 0x1C, 0x74
IV: 0x50, 0x3E, 0x61, 0xE6, 0x7D, 0x7A, 0xAA, 0x4E, 0xB3, 0xC4, 0x44, 0x5D, 0x38, 0x5F, 0x33, 0x8F
Plaintext: 0xE6, 0xCF, 0xBD, 0xA3, 0xCE, 0xEA, 0x2D, 0x4E, 0x21, 0x32, 0xD1, 0x30, 0x51, 0x62, 0x45, 0x07, 0x73, 0x47, 0xF3, 0x23, 0xE8, 0xD1, 0xDB, 0x1A, 0x3C, 0x6A, 0x90, 0xBC, 0x4E, 0x86, 0x83, 0x49, 0xB1, 0x7C, 0x84, 0xE2, 0x53, 0x94, 0x86, 0x3E, 0x5C, 0x61, 0xA3, 0x9E, 0x59, 0x51, 0x60, 0x03, 0x9A, 0x82, 0x31, 0x9E, 0xD8, 0xD7, 0x40, 0x88, 0x1C, 0x4C, 0x6A, 0xB3, 0xDB, 0x86, 0x8A, 0x21, 0x66, 0xAF, 0xFB, 0x53, 0x82, 0x80, 0x58, 0x05, 0x52, 0x9F, 0x86, 0x18, 0x7E, 0x2C, 0xF5, 0xD0, 0x8E, 0x96, 0x22, 0x3F, 0x97, 0xB4, 0x61, 0x01, 0x1A, 0x11, 0xD9, 0x2A, 0x29, 0x87, 0xD0, 0x7D, 0xCB, 0x0F, 0x29, 0xDF, 0xA2, 0xD7, 0x2A, 0x0B, 0xCB, 0x95, 0x83, 0x86, 0x06, 0x1C, 0x8C, 0xD6, 0x17, 0x2C, 0xCF, 0xEF, 0x6C, 0x8F, 0xC6, 0xEE, 0xFF, 0x61, 0xE6, 0x09, 0x7E, 0xB0, 0xDC, 0xC6, 0xAA, 0x45, 0x16, 0x6C, 0xFD, 0xC0, 0x85, 0xB7, 0x8F, 0xEB, 0xA1, 0xD0, 0x3A, 0x48, 0xAE, 0x7C
Ciphertext: 0xA4, 0xA9, 0x76, 0xF9, 0xB9, 0xAA, 0x1D, 0x1F, 0x16, 0x23, 0xDF, 0xFF, 0xFC, 0xD1, 0xAA, 0xD9, 0x8F, 0x5E, 0xEE, 0xA0, 0x1E, 0xFB, 0xDE, 0x91, 0xAD, 0x62, 0xD2, 0x2A, 0x8F, 0x99, 0x40, 0xE5, 0xD4, 0x9F, 0xD3, 0x18, 0x41, 0x1D, 0x0F, 0xB5, 0x05, 0xC7, 0xF8, 0x83, 0xE2, 0x5E, 0x2C, 0xB8, 0x06, 0x3D, 0xDA, 0xAB, 0x8D, 0x86, 0x46, 0x0D, 0x3E, 0x9F, 0xFB, 0x86, 0x23, 0x69, 0xBE, 0xAD, 0xBE, 0xB6, 0x2B, 0x3A, 0xD3, 0x9C, 0x72, 0x81, 0xD1, 0xD2, 0x59, 0x46, 0xA0, 0x5F, 0x2B, 0xA4, 0xDD, 0xB8, 0x71, 0xDB, 0xB4, 0xAB, 0x7F, 0x3F, 0xD2, 0xEC, 0x87, 0x0B, 0x7D, 0x43, 0xDA, 0x39, 0x57, 0x70, 0x74, 0xCE, 0xCF, 0x19, 0x2B, 0x3F, 0x78, 0x5A, 0xBA, 0xD5, 0x1B, 0xA1, 0x43, 0xF9, 0xB6, 0x65, 0x09, 0x4E, 0x02, 0xB1, 0xEF, 0x41, 0x86, 0xAA, 0x16, 0xD3, 0xB1, 0x8D, 0xFC, 0xDC, 0x37, 0x5B, 0xC0, 0xC4, 0x28, 0x05, 0xB6, 0x57, 0x43, 0x02, 0xE4, 0x14, 0x5B, 0x24, 0xCE, 0xEB
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 128-bit key
Key: 0xFC, 0xEC, 0x3E, 0x94, 0x9E, 0x90, 0xF8, 0xB5, 0x93, 0xE6, 0x97, 0x38, 0x23, 0x29, 0x36, 0x65
IV: 0xC9, 0xF8, 0xCA, 0xE3, 0xD9, 0x64, 0xF0, 0x73, 0x65, 0x48, 0xE9, 0xDF, 0x62, 0xD9, 0xE2, 0x2C
Plaintext: 0x07, 0x7D, 0x79, 0x17, 0x76, 0xE1, 0x7E, 0xC0, 0x9E, 0x45, 0xF6, 0xA0, 0x60, 0x1B, 0x66, 0xC0, 0xF0, 0xD1, 0x4E, 0x2D, 0x7F, 0xEB, 0xF3, 0xA7, 0x17, 0x54, 0x61, 0x99, 0xC6, 0xF6, 0xB1, 0x4E, 0xFE, 0x88, 0x88, 0x61, 0x3C, 0xA7, 0xE0, 0x75, 0xE8, 0x29, 0x0B, 0x27, 0x7C, 0xAE, 0xF4, 0x41, 0xE9, 0x77, 0xA9, 0x30, 0x37, 0x7C, 0x16, 0xB9, 0x6B, 0xB8, 0x13, 0xE7, 0xAD, 0xC8, 0xA2, 0x48, 0xAA, 0xB4, 0x71, 0x59, 0x38, 0x0D, 0xA7, 0x3E, 0x38, 0x38, 0xDD, 0xB6, 0xC1, 0x09, 0x69, 0x4F, 0x7B, 0x94, 0xE3, 0xD6, 0x48, 0x3F, 0xE2, 0x12, 0x2A, 0x1C, 0x07, 0xB2, 0x61, 0x76, 0x3D, 0x83, 0xD3, 0xAA, 0x3E, 0xE6, 0xB1, 0x38, 0x5A, 0x82, 0x58, 0x1A, 0x74, 0x36, 0x75, 0x55, 0x4D, 0x51, 0x6D, 0xCD, 0x05, 0x06, 0xFC, 0x5D, 0xDE, 0x1A, 0x1C, 0x27, 0x44, 0xE0, 0x28, 0x29, 0x0A, 0x67, 0x41, 0x12, 0xF7, 0xF2, 0xF1, 0x53, 0x81, 0xA8, 0x0E, 0x78, 0xD8, 0x8D, 0xE1, 0xB9, 0x26, 0xB1, 0x88, 0xCC, 0x15, 0xA8, 0x99, 0xFE, 0x93, 0x39, 0x08, 0x82, 0xD2, 0x5A, 0x4B, 0x09, 0x92, 0x5D
Ciphertext: 0xF8, 0x67, 0x10, 0x0F, 0x73, 0x13, 0x15, 0x94, 0xF5, 0x7F, 0x40, 0x3F, 0x5D, 0x60, 0x1A, 0x2F, 0x79, 0xCE, 0xC0, 0x86, 0x27, 0x96, 0x0D, 0xFD, 0x83, 0x01, 0x05, 0xF8, 0x13, 0x47, 0xE9, 0x9E, 0x9D, 0xE2, 0x14, 0x90, 0x75, 0xED, 0xD0, 0x92, 0x6C, 0xC8, 0x74, 0x6E, 0x2B, 0xBD, 0xAF, 0xB8, 0x7F, 0x60, 0x52, 0x75, 0x39, 0xCC, 0x24, 0xA7, 0x15, 0xEC, 0x79, 0x2F, 0x67, 0x5A, 0xCE, 0xC4, 0x13, 0x0A, 0x3F, 0x38, 0x4A, 0xE3, 0x99, 0x14, 0xC8, 0x4E, 0x14, 0xBE, 0xD7, 0x16, 0x17, 0xC1, 0xC9, 0xF4, 0xA8, 0x4A, 0x19, 0x04, 0x90, 0x48, 0x81, 0x6D, 0x3C, 0x84, 0xCE, 0x17, 0xDD, 0x27, 0xE5, 0x1C, 0x0E, 0xD0, 0x51, 0x95, 0xEA, 0x6F, 0xB5, 0xC6, 0x28, 0x18, 0x0B, 0xE9, 0xE2, 0x5D, 0xA8, 0x35, 0xDE, 0x16, 0x7A, 0x4B, 0x26, 0x59, 0x57, 0x38, 0xC8, 0xDE, 0xA6, 0x9A, 0x0A, 0x63, 0xCF, 0x92, 0x2F, 0x49, 0xB3, 0x68, 0xB3, 0x25, 0xA4, 0x16, 0x61, 0xAF, 0xB4, 0xFD, 0x9E, 0xB3, 0xF0, 0xB6, 0x7B, 0x53, 0xD1, 0x86, 0xCA, 0x6A, 0x1E, 0xF5, 0x92, 0x5D, 0x22, 0x0D, 0x0F, 0x70
Test: Encrypt
#
#
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0xBB, 0x93, 0xA2, 0x64, 0x3E, 0x84, 0xA4, 0x1A, 0x23, 0xFA, 0x12, 0xA5, 0x4D, 0x5E, 0x7E, 0xD6, 0x94, 0x39, 0x1E, 0xA3, 0x68, 0x49, 0x87, 0xD8
IV: 0xB7, 0xD5, 0xB9, 0x09, 0x11, 0x3D, 0x5C, 0xCB, 0x0B, 0xD5, 0x49, 0x24, 0xE1, 0xF3, 0x4C, 0x3F
Plaintext: 0x5F, 0x47, 0x28, 0x64, 0x01, 0x6B, 0xDC, 0x28, 0x59, 0xBB, 0x25, 0xE1, 0xB1, 0x67, 0x44, 0x5D
Ciphertext: 0xC6, 0x35, 0x7A, 0xBD, 0x1D, 0x38, 0x24, 0xF2, 0xC7, 0x2E, 0xD6, 0xEF, 0x4B, 0x76, 0xD8, 0x97
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0xF2, 0xC7, 0x01, 0xD4, 0xC4, 0xEE, 0xF0, 0x1A, 0xF7, 0x81, 0xF3, 0x19, 0x22, 0xCA, 0x00, 0x7F, 0x89, 0x08, 0x25, 0xB4, 0x44, 0x09, 0xC9, 0x0F
IV: 0x9E, 0xFB, 0x34, 0x49, 0xBC, 0x80, 0x52, 0x32, 0x7F, 0x00, 0xB3, 0xA2, 0xAA, 0x43, 0xD7, 0xB3
Plaintext: 0x48, 0x3F, 0xA9, 0x2D, 0x48, 0x2E, 0x49, 0x42, 0x6B, 0xE4, 0x0E, 0x7C, 0x60, 0x60, 0xCC, 0xF3, 0x2D, 0xA1, 0x52, 0xC3, 0xD0, 0xBB, 0x37, 0xBD, 0x26, 0x29, 0xD7, 0x5D, 0x0D, 0x65, 0x98, 0xFC
Ciphertext: 0xE7, 0x0C, 0xF1, 0x56, 0xA4, 0x6A, 0x88, 0x6A, 0xF2, 0xF6, 0x40, 0xEF, 0x0A, 0x78, 0x42, 0xA0, 0x90, 0x60, 0xD3, 0x3E, 0x6F, 0x10, 0xCE, 0xD1, 0xA7, 0x9F, 0x3D, 0xD3, 0x3C, 0xE6, 0xDB, 0x99
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0xC5, 0xB6, 0x72, 0x47, 0x9D, 0x49, 0xAE, 0xF0, 0xCB, 0x84, 0xED, 0xA4, 0x9B, 0x97, 0x6D, 0x3C, 0xCC, 0x54, 0x88, 0x37, 0x36, 0x40, 0x7D, 0x68
IV: 0xB1, 0xEA, 0x73, 0xEC, 0x33, 0x7B, 0xBB, 0x5F, 0x38, 0x8F, 0x56, 0x4F, 0x67, 0x43, 0xB7, 0xF1
Plaintext: 0x72, 0x8F, 0xC9, 0x13, 0x3E, 0xD7, 0x34, 0x52, 0x44, 0xBC, 0xDD, 0x8D, 0x37, 0x38, 0xAB, 0x9A, 0xE6, 0xEA, 0x91, 0x37, 0x65, 0xAE, 0xC9, 0x43, 0x67, 0x71, 0x5D, 0x2E, 0xEF, 0x44, 0xEC, 0xAE, 0x28, 0xAE, 0xAB, 0xB3, 0x90, 0x47, 0xAA, 0x9E, 0x5C, 0x82, 0x59, 0xAD, 0x19, 0xCB, 0x4A, 0xBA
Ciphertext: 0x58, 0x77, 0x4D, 0x0A, 0x11, 0x36, 0x57, 0xDB, 0xDC, 0x24, 0xCB, 0x92, 0x8D, 0x20, 0x17, 0x17, 0xB3, 0x0C, 0x5B, 0xDC, 0x5F, 0xCB, 0x04, 0x1B, 0xD6, 0xC8, 0x35, 0x1D, 0x2E, 0x84, 0xE3, 0xDB, 0x2D, 0x17, 0x46, 0x0C, 0x9E, 0xE7, 0x5B, 0x78, 0xC9, 0x75, 0xB4, 0x07, 0x94, 0xDB, 0xDC, 0x50
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0x8F, 0xD2, 0x38, 0x26, 0xEA, 0x26, 0x49, 0x10, 0x1C, 0x05, 0x90, 0xCA, 0x7D, 0x73, 0xD6, 0x8D, 0xB4, 0x89, 0x9A, 0x6B, 0xDB, 0x10, 0x56, 0x86
IV: 0xDE, 0x4E, 0x04, 0x80, 0x24, 0x20, 0xE1, 0x32, 0x72, 0x49, 0x71, 0xA1, 0x0C, 0x0A, 0xC3, 0x2D
Plaintext: 0x1D, 0xF3, 0xF6, 0x0C, 0x58, 0xF8, 0xFC, 0xF7, 0xE0, 0xC7, 0x9E, 0x23, 0x65, 0x59, 0xC0, 0x73, 0x90, 0xC7, 0xE7, 0xEC, 0xA2, 0x60, 0xF8, 0x69, 0x58, 0xF8, 0x43, 0x90, 0x11, 0x82, 0xBF, 0x04, 0x32, 0xE2, 0x97, 0xDC, 0xCA, 0xFC, 0xE6, 0x55, 0x72, 0x11, 0xBF, 0xC3, 0x78, 0x4B, 0x71, 0xCE, 0x3C, 0x96, 0x09, 0xDA, 0xD9, 0xB2, 0x18, 0xC7, 0x08, 0x86, 0xB6, 0xDB, 0x42, 0xB8, 0xC6, 0xFC
Ciphertext: 0x43, 0xA1, 0x5C, 0x83, 0x7A, 0x18, 0x06, 0x35, 0xCE, 0xA9, 0x49, 0x45, 0xC5, 0xA5, 0x9D, 0x44, 0xA0, 0xFC, 0x0D, 0x3B, 0xB7, 0xC1, 0x4E, 0xF0, 0x07, 0xCC, 0x40, 0x42, 0xC5, 0x76, 0x4A, 0x90, 0xA5, 0x68, 0xBD, 0xAC, 0x6D, 0xD8, 0x60, 0x1E, 0xD4, 0x37, 0xFA, 0x1A, 0x45, 0x7E, 0x85, 0x86, 0xF9, 0x3C, 0x5E, 0x4E, 0x03, 0x54, 0xC7, 0x8C, 0x2E, 0x98, 0xDA, 0x31, 0x17, 0xF4, 0x8F, 0x0A
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0x25, 0x7A, 0x7C, 0x23, 0x19, 0xA7, 0x1D, 0x0D, 0x33, 0x0E, 0x06, 0x34, 0x5A, 0x0E, 0xF0, 0xFD, 0xA8, 0x63, 0x72, 0x33, 0x12, 0x3F, 0xC7, 0xB4
IV: 0x4C, 0x9C, 0xD2, 0x6A, 0xE7, 0xD1, 0x5F, 0x7D, 0xBD, 0x64, 0xAC, 0xC7, 0x8E, 0x20, 0x28, 0x89
Plaintext: 0xEB, 0x67, 0x7A, 0x5C, 0x53, 0xC9, 0xC5, 0x6A, 0x9D, 0xD5, 0x2B, 0xDD, 0x95, 0x2E, 0x90, 0x98, 0xEA, 0xE2, 0xA0, 0x25, 0x48, 0xF8, 0x13, 0xEF, 0xC1, 0x48, 0x2F, 0xB2, 0x71, 0x90, 0x8F, 0x2F, 0x62, 0xC3, 0x24, 0x24, 0xAD, 0xA4, 0x79, 0x7B, 0xE2, 0x94, 0x3B, 0xC2, 0xAA, 0xA8, 0xF8, 0xDB, 0xAB, 0xFF, 0x27, 0xF5, 0xAC, 0x53, 0x69, 0xBB, 0xFA, 0xCD, 0x0E, 0xCA, 0x0A, 0x1E, 0xDB, 0x69, 0x5F, 0xCB, 0x0A, 0x74, 0xAE, 0xC8, 0x93, 0x9A, 0x41, 0x49, 0xAA, 0xC9, 0x99, 0xD5, 0x89, 0xE5
Ciphertext: 0xF7, 0xC2, 0xDE, 0x82, 0xDB, 0x28, 0xF7, 0xB7, 0xE6, 0x25, 0x8B, 0xB5, 0x31, 0xB9, 0x22, 0x15, 0x69, 0xE6, 0xDB, 0x58, 0x97, 0x29, 0x02, 0x50, 0xC2, 0xF4, 0x73, 0x80, 0x9D, 0x43, 0x49, 0xCD, 0x48, 0xBE, 0x5C, 0x54, 0x7F, 0x5F, 0x60, 0xFF, 0xFD, 0x42, 0xBE, 0x92, 0xB0, 0x91, 0xBC, 0x96, 0x3F, 0x0D, 0x57, 0x58, 0x39, 0x7D, 0x3C, 0x33, 0xCA, 0x5D, 0x32, 0x83, 0x4E, 0xC1, 0x7F, 0x47, 0x35, 0x12, 0x5C, 0x32, 0xAC, 0xFC, 0xE6, 0x45, 0xB6, 0xDC, 0xB7, 0x16, 0x87, 0x4F, 0x19, 0x00
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0x57, 0x9C, 0x6F, 0xC0, 0x5D, 0x0A, 0xE9, 0x47, 0x30, 0x9C, 0x50, 0xF9, 0xA0, 0xF3, 0x93, 0x9E, 0xAC, 0x27, 0x36, 0x35, 0xA0, 0x5D, 0x9B, 0x2E
IV: 0x80, 0x9C, 0x81, 0xD9, 0xA9, 0xDC, 0xCA, 0x1F, 0xB6, 0x60, 0x81, 0x70, 0xA1, 0x46, 0x1B, 0xFC
Plaintext: 0x2A, 0x5D, 0xFD, 0x26, 0x7D, 0x36, 0x3F, 0x35, 0x0F, 0x7E, 0xB0, 0x4D, 0xC9, 0x8A, 0x1A, 0x9F, 0x68, 0x34, 0xC7, 0xDC, 0x24, 0xE6, 0x43, 0xEF, 0x8F, 0xF4, 0x64, 0xEB, 0xC1, 0x2F, 0x88, 0x42, 0xB2, 0xB7, 0x1E, 0x39, 0xE7, 0x10, 0x68, 0x98, 0x51, 0x78, 0x7E, 0xA6, 0x72, 0x78, 0x97, 0x54, 0xC1, 0xBA, 0x84, 0xB9, 0x50, 0x1A, 0x7D, 0xBE, 0xAC, 0xFF, 0x20, 0x1B, 0x04, 0xEC, 0xB7, 0x82, 0x8E, 0x52, 0xBA, 0x19, 0x27, 0xA9, 0x95, 0x2E, 0x3A, 0xBE, 0xAA, 0x27, 0xE2, 0x4F, 0x9A, 0xB7, 0x53, 0xD5, 0xC0, 0x58, 0x76, 0xA1, 0xFF, 0xF5, 0xD3, 0x2A, 0xBE, 0xE6, 0xB4, 0xA6, 0x30, 0x22
Ciphertext: 0xF7, 0x67, 0x2A, 0x36, 0x32, 0x99, 0xCA, 0xAB, 0xE0, 0x42, 0x51, 0xFC, 0x42, 0x70, 0x07, 0x74, 0xF1, 0x6A, 0x96, 0x3D, 0xC6, 0x8C, 0x14, 0xE9, 0xAF, 0x10, 0x76, 0x19, 0xC3, 0x4A, 0x46, 0x68, 0x57, 0x94, 0x4C, 0x55, 0xCF, 0x8C, 0xFC, 0xD7, 0x48, 0xFF, 0xEB, 0xA6, 0xB0, 0x88, 0x2B, 0x2F, 0x67, 0xBC, 0xF3, 0x09, 0x4F, 0x0A, 0x92, 0x74, 0x55, 0x83, 0xDC, 0x50, 0x00, 0xD9, 0xA0, 0x7B, 0x62, 0xE3, 0x21, 0xB6, 0xC1, 0xBB, 0xC5, 0xE0, 0xAC, 0x41, 0x43, 0x20, 0x41, 0x52, 0x69, 0x7F, 0xD2, 0x76, 0x9E, 0x15, 0x66, 0x76, 0xC2, 0x3E, 0x9C, 0x78, 0x9D, 0xD8, 0x0A, 0x3B, 0xED, 0x11
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0x87, 0xD7, 0xD9, 0xB0, 0x85, 0x28, 0x4E, 0x5F, 0x91, 0xF8, 0x3C, 0xB7, 0x63, 0x36, 0xAB, 0x2F, 0xE5, 0x2E, 0x84, 0xA1, 0xDD, 0xA2, 0x51, 0xFA
IV: 0xCD, 0x1D, 0x45, 0x36, 0x17, 0x84, 0x7C, 0x8C, 0x65, 0xEE, 0x83, 0xE5, 0x48, 0xB5, 0x1B, 0x93
Plaintext: 0x20, 0xCE, 0x3A, 0x40, 0x3B, 0x55, 0x53, 0x24, 0x41, 0x6C, 0xD7, 0x7C, 0xCF, 0x46, 0xFC, 0x37, 0x62, 0x7F, 0xBD, 0xF2, 0x77, 0xAF, 0x22, 0x26, 0xF0, 0x3E, 0xC1, 0xA0, 0xBA, 0x7A, 0x85, 0x32, 0xAD, 0xE6, 0xAE, 0xA9, 0xB3, 0xD5, 0x19, 0xFE, 0x2D, 0x38, 0xC2, 0xD1, 0x92, 0xB5, 0x87, 0x12, 0x59, 0xF9, 0x2F, 0x02, 0x1A, 0x4E, 0xAA, 0x5A, 0xF0, 0x70, 0x9A, 0xC9, 0x21, 0x9C, 0x13, 0xA4, 0x01, 0xEB, 0x9F, 0xDA, 0x13, 0xDE, 0x86, 0x26, 0x72, 0x3A, 0x4C, 0x88, 0x6F, 0x16, 0x7A, 0xF5, 0x7C, 0x32, 0xA2, 0x4E, 0x49, 0x8A, 0x9D, 0x8F, 0x2C, 0x2B, 0x17, 0x49, 0xC6, 0x46, 0x4E, 0x52, 0xE4, 0x83, 0x16, 0xBA, 0xA3, 0x97, 0x21, 0x02, 0xD8, 0x19, 0x7D, 0x89, 0xAE, 0x91, 0x5E, 0x47
Ciphertext: 0xBE, 0x76, 0x4F, 0xEB, 0x48, 0x8B, 0x16, 0x28, 0xF4, 0xC5, 0xFE, 0xFA, 0x71, 0x98, 0x23, 0xFA, 0x64, 0xD7, 0xA7, 0xC6, 0x00, 0x52, 0x18, 0xCC, 0xE0, 0x70, 0xB5, 0x15, 0x31, 0x4E, 0x2C, 0x66, 0xDA, 0x1B, 0xB1, 0xA7, 0x6B, 0x87, 0x87, 0x90, 0x7B, 0x10, 0xB7, 0xB6, 0xAA, 0x00, 0xA5, 0x54, 0x85, 0x54, 0xC9, 0xA1, 0x47, 0x1C, 0x78, 0x2D, 0x92, 0x69, 0xC8, 0x86, 0x78, 0x4E, 0xF4, 0x1F, 0xB6, 0x50, 0x3B, 0x90, 0x08, 0x7A, 0xC5, 0x23, 0xD8, 0x14, 0xB9, 0xDA, 0x4E, 0xDD, 0x47, 0x30, 0x55, 0xF4, 0x90, 0x48, 0x5F, 0x60, 0xD0, 0x66, 0x6B, 0xB2, 0xC5, 0x64, 0xB0, 0x90, 0x98, 0x66, 0xBB, 0x36, 0x9B, 0xB5, 0x25, 0xE8, 0x1F, 0x46, 0x67, 0xBE, 0xB5, 0x55, 0x4A, 0x11, 0x77, 0xE0
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0x91, 0xD3, 0x1E, 0xBD, 0x4B, 0x8B, 0x82, 0x2C, 0x6D, 0x18, 0x3F, 0x06, 0xF1, 0x9E, 0xBC, 0xA2, 0x1D, 0x56, 0x1A, 0x33, 0xAB, 0x29, 0x72, 0xFB
IV: 0x26, 0x7E, 0x5D, 0xBC, 0x97, 0x50, 0xBA, 0x70, 0x61, 0x83, 0xAB, 0x39, 0x6A, 0x78, 0xE1, 0x9B
Plaintext: 0x7B, 0xDF, 0x1A, 0xE9, 0xEA, 0xCC, 0xE7, 0xFD, 0x76, 0x0D, 0xB3, 0x2C, 0x72, 0xBC, 0x01, 0x7A, 0x26, 0x10, 0xF5, 0x09, 0x72, 0x78, 0x16, 0xD8, 0xB4, 0xEB, 0x52, 0xAA, 0xEC, 0x79, 0x43, 0x43, 0x1E, 0x27, 0xB0, 0xDA, 0xF8, 0xF9, 0x57, 0xCC, 0xB5, 0x50, 0xE9, 0x8E, 0x41, 0x76, 0x57, 0xE5, 0x9E, 0x78, 0x4C, 0x59, 0x86, 0x34, 0xFA, 0xE7, 0x52, 0xB2, 0x1A, 0xF6, 0x1A, 0xB8, 0x2E, 0x8C, 0x1E, 0x98, 0x0A, 0xC2, 0x64, 0x4D, 0x92, 0x75, 0xA3, 0xC6, 0xC5, 0x3F, 0x60, 0x82, 0xFB, 0xA5, 0x57, 0x5D, 0x6A, 0x92, 0x1C, 0xAA, 0xEF, 0x05, 0x02, 0x81, 0x0C, 0x06, 0x3C, 0x5A, 0x2D, 0xDE, 0x42, 0xDB, 0x2F, 0x87, 0x77, 0xEF, 0x22, 0x62, 0x08, 0x18, 0x4E, 0x28, 0x17, 0x06, 0x75, 0x23, 0x19, 0x68, 0x58, 0x9E, 0x7C, 0x02, 0x7C, 0x9A, 0x8D, 0x00, 0x2E, 0xC2, 0x9A, 0x8A, 0xC5, 0xA1
Ciphertext: 0x2E, 0x75, 0x27, 0x7C, 0x65, 0xEA, 0xA2, 0xB9, 0x64, 0xE5, 0x60, 0xB1, 0xCC, 0xE3, 0x79, 0xE6, 0x2C, 0xC4, 0x10, 0x1B, 0x28, 0xC0, 0x84, 0x32, 0x73, 0x2B, 0xBE, 0xB3, 0x10, 0x12, 0x30, 0x4E, 0xAB, 0xEC, 0x6F, 0x86, 0x92, 0x12, 0xE6, 0x3C, 0x10, 0x53, 0x41, 0xB2, 0x08, 0x0D, 0x80, 0x85, 0x62, 0x84, 0x47, 0xCB, 0x44, 0x52, 0xD4, 0x9C, 0xF6, 0x22, 0xA3, 0x00, 0x6D, 0x32, 0x79, 0x44, 0xA2, 0x5A, 0x24, 0x91, 0x1B, 0xEA, 0x9F, 0x8B, 0x46, 0x5D, 0xAC, 0xB9, 0x11, 0x40, 0xAD, 0x55, 0x50, 0x0F, 0xA4, 0xA8, 0xD5, 0xC6, 0xFB, 0xD4, 0x00, 0xD2, 0x2A, 0x9C, 0x44, 0x8E, 0xF6, 0x2E, 0x97, 0xD0, 0xDF, 0x94, 0xF5, 0x78, 0xBF, 0x6E, 0xFB, 0x0B, 0x5A, 0xA4, 0x29, 0xA8, 0xD9, 0xB5, 0xAE, 0x07, 0xF4, 0x55, 0x74, 0x03, 0x0D, 0x65, 0x2D, 0xC4, 0x29, 0x76, 0xDA, 0x3A, 0xED, 0x4F
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0x53, 0x98, 0x27, 0x13, 0x76, 0x08, 0x8F, 0xF9, 0xAC, 0xEE, 0x8D, 0x31, 0xAE, 0x2B, 0x4E, 0xC6, 0xAB, 0x41, 0x1D, 0x63, 0xEE, 0x65, 0x2A, 0x0E
IV: 0xBC, 0xD6, 0x8A, 0x12, 0x7B, 0x6E, 0x80, 0x3D, 0x1A, 0x76, 0xFB, 0x4C, 0xAC, 0xBF, 0x5F, 0xA4
Plaintext: 0x56, 0xEE, 0x88, 0x43, 0x6C, 0x18, 0x0D, 0xF5, 0xD7, 0x8F, 0xC1, 0xCB, 0xBA, 0xFB, 0x80, 0xC9, 0x55, 0xAC, 0x28, 0xDF, 0x29, 0x2E, 0xE5, 0x1B, 0x5C, 0x1E, 0xB2, 0x1C, 0x60, 0x3D, 0x1C, 0xCA, 0xD0, 0xC3, 0x49, 0x44, 0x9A, 0xF6, 0x3A, 0x1A, 0x63, 0xFA, 0x4D, 0xBD, 0x27, 0xEB, 0x06, 0x33, 0x20, 0x29, 0x0E, 0x0F, 0xEA, 0xF3, 0x7C, 0xA1, 0xE4, 0x38, 0x54, 0x6A, 0xD9, 0xA9, 0x4D, 0xD2, 0xE0, 0x13, 0xD8, 0x1E, 0x80, 0xEC, 0x5D, 0x9C, 0x18, 0x2C, 0xC8, 0x20, 0x7E, 0x5E, 0x44, 0xB4, 0xE7, 0xF6, 0x46, 0x8C, 0x07, 0xE5, 0xCE, 0x38, 0x79, 0x6B, 0xEA, 0x1D, 0x60, 0x2C, 0x7B, 0x26, 0x4F, 0x87, 0x3B, 0xB7, 0x66, 0x23, 0xFF, 0xE3, 0xBE, 0xCA, 0x3A, 0xDE, 0x08, 0x7B, 0xC3, 0xB5, 0x70, 0xBA, 0xD8, 0x3C, 0xC8, 0x2B, 0x62, 0x48, 0xE2, 0x5F, 0x7A, 0x1F, 0x3D, 0xEE, 0x2D, 0x2D, 0xE4, 0xC6, 0x7C, 0xF9, 0x94, 0xC2, 0xA7, 0x57, 0x1D, 0x7F, 0xAC, 0xDE, 0x0A, 0x6B, 0x0A, 0x9C
Ciphertext: 0x0C, 0xC6, 0x7F, 0xA3, 0x77, 0x1B, 0x23, 0x28, 0x9F, 0xAF, 0xFF, 0xFC, 0xF8, 0x30, 0x90, 0xE9, 0xFB, 0xB2, 0x64, 0xA3, 0xF3, 0xBC, 0x40, 0xB7, 0x1E, 0x53, 0xE4, 0xE7, 0x0A, 0xFE, 0x99, 0x6F, 0xD8, 0xEA, 0x7A, 0x10, 0x38, 0x80, 0x5D, 0x89, 0x89, 0x10, 0x31, 0x41, 0x2C, 0xAD, 0x7F, 0x6F, 0x08, 0x67, 0xB8, 0x31, 0x0B, 0x28, 0xE3, 0x7F, 0x8A, 0x42, 0x25, 0xC4, 0x11, 0x6D, 0x48, 0x89, 0xEE, 0x47, 0x20, 0x1E, 0x5E, 0x97, 0x44, 0x0A, 0x45, 0xAB, 0x24, 0x79, 0xDA, 0xE3, 0xB0, 0x05, 0xF7, 0x6E, 0xDC, 0x28, 0x89, 0xAB, 0xD0, 0x62, 0xEC, 0x65, 0x5E, 0x81, 0xB2, 0x5E, 0xFD, 0x32, 0x81, 0x5F, 0xB0, 0xAF, 0xF6, 0x4C, 0x51, 0x4B, 0xC1, 0x2D, 0x26, 0xC5, 0x2E, 0xB2, 0xF7, 0x27, 0x3E, 0x1E, 0xE5, 0x47, 0x98, 0xF6, 0xEA, 0xD2, 0x03, 0xFF, 0xCB, 0xDC, 0xAA, 0xF6, 0x14, 0x51, 0xF8, 0xB9, 0x20, 0xF2, 0x2C, 0x64, 0x5F, 0x3A, 0x7E, 0x23, 0x5C, 0x12, 0xD7, 0x6D, 0xFF, 0xFA
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 192-bit key
Key: 0x84, 0x1E, 0xCA, 0x09, 0x74, 0xEE, 0xC0, 0x3A, 0xE8, 0xBD, 0x0F, 0x57, 0xB8, 0x16, 0xEB, 0x4F, 0x69, 0x79, 0xA3, 0xCA, 0x51, 0xF2, 0xDE, 0x60
IV: 0xFC, 0xF0, 0x24, 0x08, 0xCF, 0x55, 0xA1, 0xD3, 0xEB, 0xCA, 0x26, 0xDA, 0x55, 0x55, 0x71, 0x74
Plaintext: 0x53, 0x2D, 0xAE, 0xAD, 0x19, 0xCD, 0x3E, 0xF4, 0xA4, 0x47, 0xB6, 0x14, 0xE7, 0xDB, 0x2B, 0x66, 0x25, 0xC8, 0xAD, 0x44, 0x9E, 0x62, 0x11, 0xC0, 0x6D, 0x65, 0xF4, 0x96, 0xB1, 0x89, 0xFC, 0x60, 0xEB, 0x56, 0x61, 0x09, 0xA7, 0x3A, 0xAC, 0x84, 0x5F, 0xD9, 0xBF, 0xBE, 0x9C, 0xA4, 0x16, 0xD1, 0x5E, 0xAD, 0x4C, 0x7A, 0xBE, 0xB9, 0xE1, 0xCD, 0xD2, 0x97, 0x3A, 0x27, 0xD1, 0xB1, 0xE9, 0x65, 0x77, 0xE1, 0x2F, 0x53, 0xAB, 0x86, 0xBF, 0x67, 0x60, 0xD6, 0xC5, 0xB0, 0xB9, 0x76, 0x27, 0x09, 0x70, 0x48, 0x0B, 0x92, 0x78, 0x84, 0x99, 0x61, 0xE1, 0x0A, 0x02, 0x74, 0xFD, 0xF6, 0xC1, 0xEA, 0xC1, 0x75, 0x21, 0x73, 0x6D, 0xD8, 0xFF, 0x06, 0x70, 0xE7, 0xD1, 0xD2, 0x85, 0x78, 0xE7, 0x76, 0x23, 0x40, 0xF1, 0x74, 0x14, 0xE8, 0xC2, 0xE3, 0x63, 0x63, 0x53, 0x65, 0x7C, 0x80, 0x0B, 0x59, 0x8F, 0xBB, 0x3D, 0x52, 0x35, 0x59, 0xF3, 0xC7, 0x56, 0xB4, 0xEA, 0x0C, 0x4A, 0xD3, 0xDD, 0x80, 0x3E, 0x3D, 0x06, 0x09, 0xDA, 0x0F, 0xE3, 0xBD, 0x21, 0x4D, 0x36, 0xE2, 0x98, 0x76, 0x4F, 0x19
Ciphertext: 0x3E, 0x23, 0xF2, 0x14, 0x9F, 0x53, 0xE8, 0x64, 0xD3, 0x4E, 0x6A, 0xBD, 0xA7, 0xAD, 0xF9, 0xA3, 0x80, 0x5F, 0x27, 0x75, 0x2E, 0xEE, 0xCC, 0xDA, 0x72, 0x07, 0x41, 0x99, 0x1D, 0x37, 0x34, 0x3B, 0x00, 0xFD, 0x35, 0x03, 0x06, 0xF3, 0xBA, 0xD8, 0xA8, 0xC0, 0x31, 0x0C, 0x7F, 0x96, 0x1F, 0xCF, 0x46, 0x96, 0x4E, 0x38, 0x93, 0x90, 0xD0, 0xFC, 0xCA, 0x59, 0x1F, 0xE0, 0x5D, 0xC4, 0x9B, 0x48, 0x8D, 0xD2, 0xB4, 0x29, 0x18, 0xFD, 0xAD, 0x89, 0x3A, 0xCF, 0x2F, 0xA2, 0x29, 0x59, 0xC6, 0xC5, 0x91, 0x0C, 0xB7, 0xE5, 0x7A, 0x1E, 0xC7, 0xC1, 0x07, 0x88, 0x90, 0xA1, 0xB3, 0xA3, 0x94, 0x41, 0x56, 0x7E, 0x03, 0x6D, 0x3B, 0x90, 0x0A, 0x83, 0xED, 0x40, 0xB4, 0xD7, 0x83, 0x61, 0xCD, 0xB5, 0xF2, 0xB7, 0x83, 0xBC, 0x1A, 0x0A, 0x41, 0x6D, 0xAB, 0xCA, 0xDB, 0xD8, 0xDE, 0xD4, 0x4A, 0x76, 0xF7, 0x3A, 0xE2, 0x35, 0x76, 0x3B, 0x6E, 0x8C, 0xED, 0xC2, 0x37, 0xB4, 0x32, 0x9F, 0x71, 0x62, 0x4E, 0x55, 0xDC, 0x42, 0xAE, 0xC5, 0xB3, 0x80, 0xD8, 0x04, 0x20, 0xF2, 0x85, 0x94, 0xE6, 0xB3
Test: Encrypt
#
#
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0xAA, 0x5B, 0x8D, 0xD6, 0x4B, 0x30, 0x23, 0x13, 0xDC, 0xE4, 0x18, 0x46, 0x4E, 0xAE, 0x92, 0x90, 0x8B, 0xE9, 0x53, 0x37, 0x11, 0x21, 0x84, 0x56, 0xE0, 0x6E, 0xB1, 0xD3, 0x97, 0x00, 0x16, 0x92
IV: 0xDA, 0xFC, 0x19, 0xE8, 0xF6, 0x87, 0x17, 0x53, 0xC8, 0x1F, 0x63, 0x68, 0xDB, 0x32, 0x8C, 0x0C
Plaintext: 0xD0, 0xE9, 0xDF, 0xE7, 0x03, 0x45, 0x2D, 0x16, 0x6B, 0x6E, 0xCF, 0x20, 0xC2, 0x48, 0xE6, 0x2C
Ciphertext: 0xFC, 0x9A, 0x78, 0xBA, 0x8F, 0x08, 0xAE, 0xA8, 0x2F, 0x9A, 0x37, 0xE5, 0xBD, 0x2C, 0x04, 0xD8
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0xE6, 0x46, 0xE7, 0x71, 0x80, 0x83, 0x58, 0xED, 0xE3, 0x0F, 0xD4, 0x5A, 0x37, 0x86, 0x55, 0x5E, 0xD6, 0xE8, 0xB3, 0x02, 0xF6, 0xA4, 0x67, 0x65, 0x89, 0xF6, 0x95, 0xB2, 0x61, 0x73, 0x4A, 0x4F
IV: 0x98, 0xE3, 0x02, 0x57, 0x2F, 0x4E, 0x6D, 0x4B, 0xF5, 0x5A, 0x72, 0x04, 0xAA, 0xD4, 0x75, 0xEC
Plaintext: 0x65, 0x8C, 0xD5, 0x6E, 0x33, 0x66, 0xB9, 0xAB, 0x01, 0xAE, 0x0D, 0x6F, 0xBC, 0xAC, 0xC7, 0x63, 0xB6, 0x78, 0x6F, 0x84, 0x4C, 0x10, 0xDE, 0xD3, 0xC6, 0xA8, 0x46, 0x4E, 0x7E, 0x41, 0x72, 0x20
Ciphertext: 0x14, 0x93, 0x4B, 0xE0, 0x0D, 0x58, 0x76, 0x42, 0x70, 0x5F, 0x1C, 0x34, 0xAA, 0x10, 0xD1, 0x8E, 0x34, 0x53, 0x44, 0x4F, 0x73, 0x13, 0xF5, 0x6B, 0x42, 0xCD, 0x7C, 0xBE, 0x22, 0x9E, 0xBB, 0x9E
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0x45, 0x7D, 0x4F, 0x15, 0x02, 0xB2, 0xAC, 0x50, 0x9C, 0x3D, 0x3E, 0x40, 0x1A, 0x19, 0xE7, 0xD0, 0x09, 0xB0, 0x37, 0xDE, 0x1E, 0xF0, 0x34, 0xEF, 0x1D, 0xA2, 0x56, 0x21, 0xF9, 0xF7, 0xD6, 0x61
IV: 0x3D, 0x64, 0x29, 0xDD, 0xAA, 0xB0, 0xC7, 0xBC, 0x22, 0x4C, 0x30, 0x0D, 0xC5, 0xE2, 0x31, 0xFE
Plaintext: 0x59, 0x30, 0x63, 0x4F, 0xEF, 0x17, 0xF6, 0x06, 0xC3, 0xEF, 0xAC, 0x63, 0x65, 0x1E, 0x28, 0x16, 0x16, 0xE9, 0x69, 0xB0, 0x75, 0x8A, 0x92, 0x58, 0x5B, 0x82, 0xEC, 0xBF, 0x03, 0x30, 0x2D, 0x56, 0x6E, 0xA3, 0xFB, 0xBE, 0x05, 0xAD, 0xAC, 0x7F, 0x81, 0x38, 0x50, 0xFE, 0x08, 0xDD, 0xF1, 0xA9
Ciphertext: 0x41, 0x89, 0xCE, 0x26, 0xE8, 0xC1, 0xDD, 0x4E, 0xE0, 0xED, 0xE9, 0xE9, 0x5A, 0x21, 0xC2, 0x42, 0x50, 0xE9, 0x16, 0x15, 0x32, 0x54, 0xB5, 0xC8, 0xEC, 0x62, 0x45, 0x32, 0x2D, 0x52, 0x93, 0xEA, 0xC5, 0xFE, 0xE4, 0x44, 0x58, 0xC6, 0x04, 0x65, 0x9E, 0x01, 0xD3, 0x03, 0x9D, 0x8C, 0xF3, 0x78
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0x98, 0xB3, 0x19, 0x75, 0xA9, 0x65, 0x95, 0x8A, 0x0E, 0x88, 0x79, 0x3C, 0x1D, 0x2B, 0x64, 0x3E, 0x0F, 0xAF, 0x05, 0x12, 0xAA, 0xD9, 0xDE, 0xC4, 0x1D, 0x25, 0x48, 0xD8, 0x2B, 0x5D, 0xB8, 0x81
IV: 0x8B, 0x6B, 0x40, 0x14, 0x8F, 0x6C, 0x59, 0xBB, 0x05, 0x05, 0xDF, 0x6E, 0x5B, 0xFA, 0x5D, 0x1F
Plaintext: 0x06, 0xFC, 0x8B, 0x35, 0x23, 0xC3, 0x15, 0x3C, 0x5F, 0x5D, 0x9E, 0xDB, 0x15, 0xC6, 0x05, 0x06, 0xB7, 0xB8, 0xE7, 0x74, 0x6F, 0xC4, 0x65, 0x54, 0x06, 0xA2, 0x27, 0x3C, 0x04, 0xC6, 0xA0, 0x62, 0x19, 0x33, 0x94, 0x0E, 0xBB, 0x94, 0xD8, 0x4F, 0x11, 0x89, 0x5A, 0xEE, 0x10, 0x3F, 0x61, 0xA0, 0xE4, 0x43, 0x15, 0x7F, 0x91, 0x98, 0x41, 0xBB, 0xDA, 0x07, 0x58, 0x8D, 0x62, 0xB6, 0xB6, 0x6D
Ciphertext: 0x8F, 0x7F, 0x09, 0x50, 0x8A, 0xA0, 0xC2, 0x64, 0x0E, 0xEB, 0xC8, 0x1A, 0x87, 0x53, 0xBC, 0xBB, 0xDA, 0xAB, 0x75, 0x1E, 0xD7, 0x04, 0x0B, 0x20, 0x7A, 0x64, 0x0F, 0xC9, 0x6C, 0xDE, 0xB9, 0xB4, 0x15, 0xBC, 0x1E, 0x60, 0x3B, 0xFC, 0x40, 0x50, 0xDE, 0x8A, 0xAD, 0x14, 0xDE, 0x8F, 0x82, 0x4F, 0x3C, 0xBB, 0xC6, 0x5A, 0x51, 0x69, 0x2F, 0x13, 0xAA, 0x4B, 0xBA, 0x5D, 0xB5, 0x57, 0xBD, 0xF0
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0x11, 0xFC, 0x29, 0x85, 0xB9, 0x74, 0xB0, 0x65, 0xF9, 0x50, 0x82, 0xF8, 0x62, 0xF0, 0x52, 0xB7, 0xD9, 0xB4, 0xD2, 0x1C, 0x3C, 0x0E, 0x76, 0x5A, 0x49, 0xDB, 0x7A, 0x4B, 0xBB, 0xF3, 0x26, 0xAA
IV: 0xB5, 0xFE, 0x51, 0x82, 0x64, 0x8A, 0x24, 0xE6, 0xE1, 0x5B, 0x20, 0xE3, 0x54, 0x02, 0x62, 0xB3
Plaintext: 0x5F, 0xB2, 0x26, 0x33, 0xBA, 0x4E, 0x8B, 0x98, 0x1A, 0xC6, 0x96, 0x5D, 0x58, 0xA4, 0x78, 0x7F, 0xCF, 0xE2, 0x14, 0xED, 0x06, 0xFF, 0xBC, 0x3A, 0x8F, 0x52, 0x3B, 0x96, 0x2E, 0x9D, 0x19, 0xFC, 0x3E, 0xE5, 0x1A, 0xAD, 0x51, 0x81, 0x08, 0xDC, 0x17, 0x72, 0xB2, 0xAB, 0x81, 0xF2, 0x35, 0x56, 0x25, 0x4F, 0x7A, 0xAE, 0xE5, 0xFA, 0x00, 0xCA, 0xCB, 0xDB, 0xDC, 0xF9, 0x38, 0xE8, 0xFE, 0xFA, 0x3E, 0xF6, 0xB5, 0x70, 0x4A, 0xCF, 0x76, 0x90, 0x06, 0x84, 0xD9, 0x1D, 0x7D, 0x05, 0xE4, 0x96
Ciphertext: 0xA0, 0x03, 0x29, 0xCC, 0xFD, 0x82, 0xBD, 0x62, 0x39, 0x1C, 0xC9, 0xE0, 0xC8, 0x69, 0x46, 0x45, 0x31, 0xC8, 0x1E, 0x6B, 0x5F, 0x37, 0x97, 0xA2, 0xCB, 0x93, 0x19, 0x4A, 0x02, 0x42, 0x09, 0x2A, 0x85, 0x5C, 0x78, 0x43, 0xB5, 0xE1, 0x1B, 0x69, 0x67, 0x08, 0x79, 0xA3, 0xD5, 0x2D, 0xCB, 0xD5, 0x30, 0x3E, 0x9B, 0xF2, 0x1B, 0xA7, 0x0B, 0x72, 0x5F, 0xE5, 0xF8, 0xD8, 0x40, 0x45, 0xAB, 0x8E, 0x8E, 0x14, 0xF6, 0x0A, 0x85, 0xC1, 0x41, 0x3C, 0x88, 0x56, 0xF0, 0x7D, 0x4D, 0xFD, 0x7E, 0x0E
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0x81, 0xEE, 0x8C, 0xAE, 0x49, 0xA4, 0x79, 0xFC, 0x5F, 0xA1, 0x0A, 0xF4, 0xBA, 0x0C, 0x99, 0x16, 0x26, 0x8D, 0x00, 0x65, 0xED, 0x5F, 0x5B, 0x1B, 0xB0, 0xA7, 0x10, 0x9B, 0x96, 0x04, 0x0D, 0xA7
IV: 0xA9, 0x67, 0x51, 0xD3, 0x7C, 0x25, 0xAE, 0x39, 0x11, 0x4A, 0xCD, 0x6F, 0xFB, 0x31, 0x72, 0xB6
Plaintext: 0xC0, 0x51, 0x01, 0x74, 0x81, 0x5A, 0x42, 0xE5, 0xDD, 0x81, 0x61, 0x0D, 0x12, 0x17, 0x39, 0xF1, 0x65, 0x61, 0xD1, 0x06, 0xC5, 0xA4, 0x27, 0xEA, 0xAB, 0x7F, 0x2D, 0x52, 0x44, 0x7D, 0x12, 0x44, 0xD2, 0xEB, 0xC2, 0x86, 0x50, 0xE7, 0xB0, 0x56, 0x54, 0xBA, 0xD3, 0x5B, 0x3A, 0x68, 0xEE, 0xDC, 0x7F, 0x85, 0x15, 0x30, 0x6B, 0x49, 0x6D, 0x75, 0xF3, 0xE7, 0x33, 0x85, 0xDD, 0x1B, 0x00, 0x26, 0x25, 0x02, 0x4B, 0x81, 0xA0, 0x2F, 0x2F, 0xD6, 0xDF, 0xFB, 0x6E, 0x6D, 0x56, 0x1C, 0xB7, 0xD0, 0xBD, 0x7A, 0x24, 0x37, 0xB7, 0x3E, 0x07, 0x44, 0xB2, 0x2B, 0xE6, 0xF0, 0x0E, 0x31, 0xC4, 0xC6
Ciphertext: 0x8B, 0xF4, 0xA9, 0x42, 0x36, 0x2B, 0x70, 0xF4, 0xCC, 0x06, 0x6C, 0x6E, 0x3D, 0x87, 0xA5, 0xF1, 0x85, 0xAA, 0x16, 0x96, 0x3B, 0x1C, 0x24, 0x31, 0x3C, 0x33, 0x0B, 0x2F, 0x86, 0xD3, 0x70, 0x69, 0xC5, 0x6C, 0x15, 0x69, 0xA0, 0x9B, 0x7F, 0x02, 0x94, 0x68, 0x9D, 0x1D, 0x3F, 0x16, 0x27, 0xE6, 0xFF, 0x9E, 0xCB, 0x37, 0x18, 0xE8, 0xAD, 0x34, 0x95, 0x58, 0xB5, 0x8C, 0x22, 0xBB, 0xA6, 0x9B, 0x1D, 0x7A, 0x28, 0x6F, 0xEB, 0x0C, 0xD8, 0x0E, 0xB6, 0x4E, 0xDC, 0x08, 0x4D, 0x90, 0x9C, 0xEF, 0x69, 0x42, 0x4E, 0xAC, 0x5D, 0xFB, 0xD4, 0xEF, 0x8B, 0x26, 0x47, 0x20, 0xF4, 0xEF, 0x48, 0x65
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0x81, 0x3F, 0xA2, 0x4F, 0xBA, 0x5A, 0x46, 0xCD, 0x44, 0xEC, 0x3B, 0x2B, 0xAE, 0x5E, 0x19, 0x35, 0xE9, 0xE8, 0x07, 0x05, 0xF1, 0xA8, 0x7D, 0xBD, 0xAF, 0xF2, 0x4F, 0x7C, 0x1F, 0xE8, 0xE7, 0x8A
IV: 0xAE, 0x4A, 0xD1, 0xD6, 0xE6, 0x8F, 0x7E, 0xA3, 0x4C, 0x34, 0x41, 0x7E, 0x89, 0x54, 0x9E, 0x73
Plaintext: 0xC9, 0x79, 0xC4, 0x80, 0x61, 0xB2, 0x58, 0x4A, 0xB4, 0xE5, 0x74, 0x0F, 0x57, 0x67, 0xF0, 0xDC, 0x73, 0xCA, 0xE0, 0x00, 0x6B, 0xF6, 0x5D, 0xC0, 0xBF, 0x7B, 0x89, 0x4C, 0x31, 0x26, 0xCD, 0xF2, 0x26, 0xD3, 0x65, 0x92, 0x4E, 0x81, 0x1F, 0x52, 0x87, 0xAC, 0x5F, 0x92, 0xFF, 0xD7, 0x67, 0x23, 0x99, 0x68, 0xD5, 0xB3, 0x93, 0xB8, 0x6D, 0x8C, 0x65, 0x6B, 0x19, 0x7F, 0xEC, 0xFD, 0x2E, 0x1A, 0xC7, 0x9E, 0xF1, 0x22, 0x02, 0x40, 0x5A, 0x3D, 0xF1, 0xEE, 0x18, 0xEE, 0x5F, 0x5F, 0xD4, 0xC6, 0xE9, 0xCB, 0xBA, 0xD9, 0xA4, 0xFD, 0x36, 0x70, 0x06, 0xAA, 0xFB, 0xFD, 0x03, 0x01, 0x4A, 0x54, 0x76, 0x83, 0x71, 0x17, 0xC3, 0x15, 0x92, 0x72, 0xBA, 0x53, 0xA5, 0x09, 0xBF, 0x28, 0xC0, 0x2F
Ciphertext: 0xC9, 0xF7, 0xBA, 0x69, 0xDA, 0xAA, 0xF8, 0xBA, 0x4C, 0x4A, 0xAF, 0xA9, 0x17, 0x87, 0xE1, 0x5F, 0xA0, 0x3F, 0x17, 0x64, 0x07, 0xA2, 0x64, 0x04, 0x5D, 0xD6, 0x55, 0xF2, 0x72, 0x3B, 0x26, 0x0D, 0x42, 0xBD, 0xAC, 0xE6, 0xD2, 0x26, 0xC3, 0x78, 0x34, 0xF2, 0xA3, 0xAE, 0x2A, 0x1D, 0x3B, 0xF5, 0x07, 0x1F, 0x72, 0xDD, 0x67, 0x70, 0xA4, 0x4C, 0x40, 0x92, 0x73, 0x5D, 0x35, 0x05, 0xED, 0x44, 0x05, 0xDE, 0xB9, 0xD4, 0x51, 0x92, 0xC6, 0xF8, 0x3D, 0x83, 0xE3, 0xE2, 0x46, 0x3C, 0x1C, 0x63, 0xD8, 0xB8, 0x35, 0xBE, 0x81, 0x0A, 0x6D, 0x8E, 0xA9, 0x2F, 0x5C, 0xAC, 0x71, 0x99, 0x01, 0x68, 0xF3, 0x94, 0x8D, 0x1C, 0x95, 0x6C, 0x86, 0x51, 0xCD, 0xA0, 0xD9, 0x2E, 0x46, 0x3C, 0x81, 0xFF
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0x28, 0x9B, 0x96, 0x59, 0xE7, 0xEC, 0x3F, 0xD2, 0x69, 0xE0, 0x37, 0xB0, 0xBE, 0x59, 0xA8, 0x06, 0xF9, 0x29, 0xEC, 0x5B, 0xDA, 0x28, 0x4D, 0x5B, 0xAA, 0x85, 0x10, 0xCD, 0x67, 0x59, 0xB3, 0xC5
IV: 0x21, 0x82, 0x72, 0x1B, 0xA4, 0xAE, 0x10, 0x1B, 0x57, 0xB6, 0xD3, 0x7E, 0x64, 0x2E, 0xD1, 0x9A
Plaintext: 0x19, 0x3A, 0x6A, 0xD5, 0x8F, 0xA2, 0x16, 0x5F, 0x89, 0x29, 0x61, 0x21, 0x9E, 0x1B, 0x33, 0xF0, 0x9B, 0x26, 0x55, 0x07, 0x23, 0x6A, 0x31, 0xB4, 0x98, 0xD3, 0xD9, 0x51, 0x3F, 0xA7, 0x4B, 0x76, 0x9E, 0x5B, 0xF4, 0x6D, 0x29, 0xAB, 0x72, 0xE6, 0x1E, 0xEA, 0x9E, 0xEC, 0xAE, 0x96, 0xCA, 0x18, 0x5D, 0x2F, 0x47, 0x05, 0xAB, 0x49, 0x2B, 0x03, 0xF4, 0xE1, 0x50, 0x10, 0x95, 0xED, 0xA0, 0x04, 0x50, 0x36, 0x90, 0x0B, 0xF2, 0x6A, 0xEB, 0x58, 0x32, 0x6D, 0xD1, 0x18, 0xDD, 0xF1, 0xFF, 0xA5, 0x30, 0x46, 0x51, 0xFD, 0x85, 0x73, 0x84, 0x72, 0x33, 0x85, 0x41, 0xA3, 0xAF, 0x27, 0x57, 0xAA, 0xF7, 0x73, 0x49, 0x97, 0x30, 0x08, 0x08, 0x1E, 0x8D, 0x5D, 0x01, 0x8C, 0x74, 0x55, 0x5A, 0xFF, 0xDC, 0x13, 0x79, 0xD7, 0xFA, 0x0F, 0xC7, 0x68, 0x1C, 0x69, 0xB3, 0xF1, 0xD5, 0x7E, 0xF9, 0xD2
Ciphertext: 0x0A, 0x4C, 0x7D, 0xAF, 0xCB, 0x8A, 0x92, 0x8B, 0x0C, 0xEC, 0x6B, 0x08, 0x45, 0x0C, 0x1B, 0xCF, 0x01, 0xA5, 0x6C, 0x3E, 0x71, 0xB6, 0x37, 0x58, 0xE9, 0x10, 0xD3, 0x4F, 0x53, 0x0B, 0x79, 0x05, 0x1D, 0x29, 0xFE, 0xD5, 0xB1, 0x46, 0x04, 0x67, 0x21, 0xA4, 0x09, 0x1B, 0x6D, 0x2C, 0x55, 0x8B, 0x59, 0x6C, 0x7E, 0x06, 0x50, 0x00, 0x78, 0x2C, 0xE0, 0x75, 0x73, 0x6F, 0x39, 0xA2, 0x68, 0xD6, 0x02, 0x4F, 0xD1, 0xF7, 0xAD, 0x7F, 0x8B, 0x17, 0xF3, 0x4B, 0x8D, 0x0F, 0xE1, 0x58, 0x3E, 0x4E, 0x69, 0x62, 0x1B, 0x29, 0x89, 0x59, 0xFD, 0xBC, 0x23, 0xD0, 0xCF, 0xE4, 0x04, 0xD8, 0x3F, 0x7C, 0x22, 0xAF, 0x3F, 0x88, 0x1E, 0x6F, 0xC5, 0x4B, 0x3B, 0x76, 0x13, 0x97, 0x4E, 0x62, 0xA2, 0xFA, 0xB0, 0x6B, 0x01, 0x8B, 0x28, 0xFB, 0x62, 0x13, 0xD5, 0x46, 0x0C, 0xB1, 0x91, 0xF0, 0x33, 0x53
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0x5A, 0xBA, 0x24, 0xF9, 0x2C, 0xAD, 0x51, 0x9E, 0xF7, 0x60, 0x37, 0x30, 0xBA, 0xE9, 0x64, 0x8F, 0x29, 0x3D, 0xC9, 0x7B, 0x50, 0x46, 0x79, 0x4D, 0x78, 0x35, 0xAE, 0xE4, 0x4E, 0x1A, 0x0D, 0xE3
IV: 0x42, 0xB1, 0x2B, 0x1A, 0x2E, 0x7F, 0x4F, 0x41, 0x38, 0x1E, 0x7A, 0xEC, 0xF9, 0xD6, 0xA4, 0xBB
Plaintext: 0xDF, 0x6D, 0x49, 0xD1, 0xCF, 0x3F, 0x24, 0x88, 0x0F, 0x91, 0x3B, 0x63, 0x64, 0x22, 0x1B, 0x45, 0x77, 0x03, 0x65, 0xE0, 0x7D, 0xA9, 0x89, 0x6F, 0x17, 0x41, 0xD2, 0xA8, 0x77, 0x43, 0xA3, 0xEC, 0xC5, 0x4A, 0x00, 0xC2, 0xC1, 0x23, 0x4F, 0x83, 0xA9, 0x23, 0x60, 0x57, 0x5D, 0xBE, 0xAC, 0x5F, 0xC1, 0x56, 0xDA, 0x34, 0x63, 0x51, 0x88, 0x91, 0x5E, 0x6E, 0x47, 0x4C, 0x7E, 0x59, 0xE7, 0x8B, 0xA4, 0x7D, 0xF6, 0x34, 0x6C, 0x19, 0x83, 0xA5, 0x0E, 0x96, 0x27, 0xA6, 0x82, 0x18, 0x47, 0x9B, 0xE8, 0x53, 0x93, 0xFF, 0x26, 0xA0, 0xD2, 0x0D, 0xD3, 0x4F, 0xE2, 0xC0, 0x54, 0x3F, 0xFA, 0xFE, 0x44, 0xAD, 0x33, 0x10, 0x1A, 0x4A, 0x47, 0x56, 0x05, 0x90, 0x98, 0x39, 0x1B, 0x55, 0x74, 0x60, 0xB3, 0xA1, 0x97, 0x27, 0x0F, 0xBD, 0xF1, 0x4D, 0x3F, 0x8C, 0xAA, 0xEC, 0x41, 0x1E, 0x64, 0xAF, 0x6D, 0x83, 0xC0, 0x3F, 0x11, 0xDD, 0x23, 0xFE, 0x58, 0xB9, 0xBA, 0xF8, 0x70, 0xA0, 0xBB, 0x17
Ciphertext: 0x0E, 0xBF, 0x3B, 0x20, 0x1C, 0x7D, 0x30, 0xA8, 0x76, 0xA2, 0xA7, 0xF4, 0x2F, 0x95, 0x0A, 0x43, 0xF7, 0x88, 0x70, 0xFC, 0x8C, 0x1F, 0xC6, 0xAA, 0x6F, 0x7A, 0xF7, 0x32, 0x25, 0x10, 0x73, 0x5D, 0xFE, 0x2F, 0xE6, 0xDD, 0x9C, 0x4E, 0x25, 0xF2, 0xE3, 0x8B, 0xED, 0x55, 0x74, 0xF4, 0x1C, 0x49, 0xCB, 0xC1, 0x88, 0x74, 0xDA, 0x51, 0xEE, 0x17, 0xD7, 0x5F, 0xC7, 0x1C, 0x9E, 0xB9, 0xB6, 0xCC, 0x3B, 0xA1, 0x04, 0xE4, 0x29, 0x85, 0x1F, 0x86, 0x04, 0x7B, 0x34, 0x85, 0xCB, 0xF3, 0xE7, 0x50, 0xD1, 0xE6, 0x1A, 0xE6, 0xF4, 0xBB, 0x7C, 0x48, 0x53, 0x2B, 0x7F, 0xAF, 0x27, 0x20, 0x5E, 0xF1, 0xA5, 0xE1, 0xBA, 0xFB, 0x33, 0x8A, 0xAD, 0xD7, 0x22, 0xB5, 0x38, 0xF3, 0x18, 0x8F, 0xBB, 0xE9, 0x17, 0xF7, 0x81, 0x2B, 0x1E, 0xED, 0xD7, 0x15, 0x1D, 0xA3, 0x76, 0xD5, 0x26, 0x7B, 0xD9, 0xD3, 0x3B, 0xDC, 0xCB, 0x34, 0x69, 0xD0, 0x6B, 0x77, 0xAC, 0xFA, 0x62, 0x90, 0xC5, 0x54, 0xB2, 0xEF
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CTR, 256-bit key
Key: 0xEB, 0xE8, 0xEE, 0x96, 0x66, 0xD0, 0x6D, 0xB7, 0x69, 0xCD, 0xA8, 0xB9, 0x8F, 0x1E, 0xAB, 0x04, 0xE7, 0xA6, 0xA4, 0xA8, 0x99, 0xFB, 0x9F, 0x05, 0xCD, 0xBB, 0x95, 0xCB, 0xC8, 0x1F, 0xA5, 0x26
IV: 0x58, 0xD2, 0xA1, 0x32, 0x73, 0x03, 0xCC, 0xB5, 0x1B, 0xB9, 0xE2, 0x0D, 0x84, 0x66, 0x59, 0x67
Plaintext: 0x79, 0xC0, 0xE7, 0x32, 0xFC, 0xCC, 0x44, 0xD4, 0x2D, 0x3B, 0x31, 0x9B, 0x6D, 0xFA, 0xB9, 0xF6, 0xC2, 0x05, 0xB7, 0xE5, 0x7D, 0x7C, 0x98, 0xAE, 0x1B, 0xF8, 0x62, 0xD2, 0x6A, 0x1F, 0xF5, 0x3F, 0xED, 0x76, 0x92, 0xC7, 0x80, 0x77, 0x99, 0xD1, 0x3F, 0xE4, 0x97, 0x4E, 0xA5, 0x5A, 0x7F, 0xEF, 0xF1, 0x29, 0x38, 0x95, 0xCE, 0x63, 0x58, 0x0A, 0x32, 0x33, 0x30, 0xEE, 0x87, 0x70, 0x08, 0xF4, 0x09, 0x72, 0xAB, 0x4E, 0x6F, 0x25, 0x27, 0x65, 0xCD, 0x5B, 0xCE, 0xCE, 0xB9, 0x67, 0x80, 0x79, 0xAD, 0xE7, 0x2D, 0x2C, 0xAC, 0xE1, 0x95, 0x30, 0x28, 0x12, 0x52, 0x4B, 0x24, 0x82, 0x19, 0xEE, 0x96, 0x5C, 0x3D, 0xAE, 0x0F, 0xFD, 0x74, 0xF8, 0x9D, 0x4B, 0xDE, 0x01, 0xF1, 0x48, 0x43, 0xFD, 0xBD, 0xE7, 0x9D, 0x91, 0x60, 0x1E, 0xD6, 0x8A, 0xC5, 0x3C, 0xD2, 0xCF, 0x88, 0x7D, 0xB0, 0x94, 0x5B, 0xDB, 0x4D, 0xD1, 0xA9, 0x28, 0x0A, 0xF3, 0x79, 0x5A, 0xD0, 0xD1, 0x94, 0x26, 0x51, 0xE1, 0xEA, 0xD0, 0x90, 0xAC, 0x32, 0x41, 0xA3, 0x7F, 0xD1, 0x5A, 0xB7, 0x64, 0xFD, 0x88, 0x56, 0x50
Ciphertext: 0xCA, 0xDD, 0x51, 0xE5, 0xBF, 0x4A, 0x97, 0x8F, 0x79, 0x7A, 0x1C, 0x0A, 0x63, 0x0B, 0x2F, 0xC4, 0x67, 0x40, 0x0D, 0x77, 0x44, 0x30, 0x3C, 0x87, 0x3D, 0xBE, 0x2B, 0x52, 0xB1, 0xE3, 0x13, 0x7C, 0xD3, 0x6B, 0xA5, 0x23, 0x2A, 0x5E, 0xD3, 0x32, 0xB0, 0x2F, 0x20, 0xAD, 0x25, 0x76, 0xBA, 0x76, 0x2E, 0xC1, 0x66, 0x18, 0xEC, 0x4E, 0xC8, 0x1A, 0x33, 0x4B, 0x20, 0x1A, 0x0A, 0x24, 0x41, 0x38, 0x5C, 0xB9, 0xA9, 0x33, 0x5E, 0x91, 0x4F, 0xCD, 0x1E, 0x00, 0x0B, 0x8C, 0x61, 0x04, 0x07, 0x7F, 0x57, 0x4C, 0x21, 0xC0, 0x61, 0x82, 0x57, 0x1D, 0x69, 0x34, 0xA4, 0x7B, 0x93, 0xF2, 0x7A, 0x86, 0xD2, 0x0B, 0x0B, 0x7B, 0xA6, 0xAC, 0xBB, 0x7B, 0x0D, 0x56, 0x24, 0x31, 0x0A, 0x82, 0x81, 0x58, 0xC1, 0xF3, 0x36, 0xCA, 0x04, 0xA0, 0xFA, 0x01, 0xA6, 0x45, 0x1F, 0x0E, 0x87, 0x69, 0x33, 0xE5, 0x4C, 0xDC, 0x32, 0x89, 0x4A, 0xB2, 0xD3, 0x9B, 0x23, 0x2C, 0x30, 0x16, 0x38, 0xAB, 0xE0, 0xBF, 0x50, 0xCE, 0x33, 0x34, 0x45, 0x88, 0xD0, 0xA7, 0x31, 0xBF, 0x31, 0xDB, 0x42, 0x7F, 0xE2, 0x76
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: LEA-128/CBC
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0x87, 0xF1, 0x42, 0x4F, 0x1A, 0x14, 0x83, 0xCC, 0x1F, 0xD0, 0x35, 0x4E, 0x18, 0xA9, 0x94, 0xAB
IV: 0xCF, 0x58, 0x4E, 0x6E, 0xF6, 0xD6, 0x42, 0x88, 0x0A, 0xB7, 0x87, 0x42, 0x7D, 0xB9, 0xB0, 0x76
Plaintext: 0x13, 0x9D, 0x4E, 0xFF, 0x8D, 0x35, 0xB7, 0x6E, 0x85, 0xBF, 0x06, 0xFE, 0x99, 0x71, 0x63, 0xCB
Ciphertext: 0x49, 0xB9, 0xF3, 0x22, 0x6D, 0xA5, 0x4B, 0x4A, 0x0D, 0x38, 0x5A, 0x9C, 0x48, 0x70, 0x52, 0x4B
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0xCB, 0x55, 0x85, 0x3E, 0x28, 0x57, 0x74, 0xCC, 0xA8, 0x9D, 0x94, 0xE0, 0x56, 0x16, 0xDF, 0x15
IV: 0xB0, 0x56, 0x72, 0xA9, 0x51, 0xA1, 0x4B, 0x2F, 0xCD, 0x45, 0x51, 0x83, 0xDD, 0x2D, 0x94, 0x03
Plaintext: 0xBC, 0xB4, 0xD7, 0xFC, 0xD0, 0xB7, 0x4C, 0x63, 0x8D, 0xEE, 0x9E, 0xC6, 0x97, 0x7C, 0x34, 0x81, 0x26, 0xC4, 0xB5, 0x35, 0xAF, 0x7F, 0xC7, 0x76, 0xC1, 0x0B, 0x1D, 0xC4, 0x2D, 0x06, 0xB0, 0xBD
Ciphertext: 0x49, 0x01, 0xFA, 0x73, 0xAC, 0xE6, 0x0A, 0x89, 0xE3, 0xFE, 0x12, 0x81, 0x01, 0xA1, 0x9B, 0x8D, 0x67, 0x08, 0x23, 0x52, 0x01, 0xC0, 0x7B, 0xD9, 0x48, 0x15, 0x76, 0xAA, 0x61, 0xAE, 0x59, 0x90
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0x69, 0x1C, 0x4C, 0x90, 0x36, 0x1D, 0x4F, 0xB5, 0x81, 0x53, 0xAE, 0xDC, 0x87, 0x12, 0x38, 0x23
IV: 0x3D, 0x90, 0x1F, 0x8B, 0xEF, 0xF7, 0xB4, 0xAD, 0x27, 0xB9, 0x72, 0xA9, 0xD0, 0x24, 0x3E, 0x60
Plaintext: 0x9B, 0x36, 0xED, 0xE3, 0xA2, 0xB2, 0x07, 0x2A, 0x4C, 0x73, 0xCA, 0x0A, 0x70, 0x01, 0x72, 0x61, 0xBD, 0x62, 0xB8, 0x94, 0x59, 0x33, 0x99, 0x3B, 0xC8, 0xF7, 0x58, 0x1A, 0x10, 0xAE, 0xC6, 0x54, 0x1A, 0xAA, 0xC1, 0xDB, 0x5C, 0x9E, 0xFB, 0x2B, 0xB5, 0xF8, 0xFD, 0x38, 0x98, 0x70, 0x6B, 0xA4
Ciphertext: 0xA7, 0xF2, 0xAE, 0x1E, 0x83, 0x0A, 0x33, 0x02, 0xC0, 0x62, 0xCF, 0x51, 0x64, 0x6C, 0xE7, 0x60, 0x56, 0xE6, 0xB0, 0x56, 0x15, 0xEB, 0xA8, 0xDE, 0x9E, 0x53, 0x31, 0xAC, 0x65, 0x37, 0x18, 0xB3, 0x1C, 0x6F, 0x65, 0xA6, 0x26, 0xC0, 0x99, 0x25, 0x28, 0x35, 0x4F, 0x65, 0x1A, 0x98, 0x75, 0x1C
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0x6D, 0xE1, 0x89, 0x36, 0x34, 0x58, 0xFE, 0x88, 0x6C, 0x6B, 0xD8, 0xFF, 0x33, 0xCD, 0xD1, 0x00
IV: 0xAE, 0x1F, 0xD0, 0x61, 0xAB, 0x08, 0xB3, 0x1E, 0x85, 0x87, 0x4C, 0x4E, 0x48, 0x88, 0xA9, 0x55
Plaintext: 0x16, 0xB6, 0x99, 0x5A, 0xCA, 0x91, 0x6B, 0xFC, 0xDA, 0xC0, 0xF9, 0x40, 0x82, 0xA8, 0xE6, 0xCE, 0x1F, 0x3D, 0x23, 0x5E, 0xD9, 0x18, 0xB8, 0x6D, 0x84, 0xCB, 0xC1, 0x34, 0xC8, 0x71, 0xB6, 0xDA, 0x80, 0x89, 0xF0, 0xE9, 0x61, 0x04, 0x69, 0xFF, 0xDC, 0x9C, 0xC4, 0xC6, 0x45, 0x68, 0x8D, 0x25, 0x34, 0xAD, 0xC1, 0xB8, 0x2C, 0xF8, 0x91, 0x7E, 0x7A, 0x69, 0x63, 0xD2, 0x60, 0x52, 0x1A, 0x9D
Ciphertext: 0x5C, 0xEE, 0xB0, 0x3D, 0xEF, 0x2A, 0x0E, 0x10, 0xF5, 0xBF, 0xFF, 0x50, 0x5E, 0xA9, 0xC1, 0x10, 0xB0, 0x2E, 0x4A, 0x55, 0x67, 0xA5, 0x72, 0xFB, 0x74, 0xB3, 0x63, 0x4A, 0x3D, 0xC7, 0xD3, 0xD2, 0xA7, 0x00, 0xD2, 0x54, 0x41, 0x3A, 0x9C, 0xCD, 0x41, 0x0B, 0x70, 0x73, 0xB2, 0x26, 0x19, 0xF4, 0x52, 0x0E, 0x45, 0xEB, 0x25, 0x96, 0x75, 0x82, 0xB8, 0xD5, 0x12, 0xC0, 0x3E, 0x36, 0x81, 0x4D
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0x73, 0x01, 0x97, 0xC9, 0x42, 0xD9, 0x7F, 0xF9, 0x38, 0xA8, 0x3F, 0x77, 0xC4, 0x34, 0x4E, 0x6D
IV: 0xB6, 0x17, 0xB2, 0x59, 0xED, 0xCD, 0xC6, 0xBB, 0x2F, 0x0C, 0x3A, 0x10, 0x58, 0x53, 0x5B, 0x04
Plaintext: 0xB7, 0xC6, 0x95, 0xE4, 0xB5, 0x39, 0x36, 0x52, 0xB7, 0x8B, 0x74, 0x3C, 0x46, 0x35, 0xB2, 0x0F, 0x6E, 0x22, 0xFF, 0x27, 0x63, 0xC2, 0xE0, 0x8B, 0x6B, 0x5A, 0x4F, 0xD7, 0xF7, 0x9E, 0x03, 0x79, 0x13, 0x81, 0xF2, 0x20, 0x01, 0x4C, 0x15, 0x72, 0x21, 0xED, 0x6B, 0xFE, 0x15, 0x92, 0x40, 0x71, 0x21, 0x77, 0xAF, 0x0C, 0xD8, 0xFC, 0x66, 0x55, 0xF5, 0xFB, 0xA9, 0x0D, 0x87, 0x58, 0x9A, 0x63, 0x51, 0xDA, 0xB7, 0x67, 0x70, 0x39, 0xA4, 0xC1, 0x3E, 0x78, 0x2B, 0xA3, 0x77, 0x74, 0x81, 0xFC
Ciphertext: 0x7C, 0x96, 0xF9, 0x67, 0x5B, 0xE0, 0x38, 0x54, 0x70, 0x0D, 0xEA, 0xE5, 0x10, 0x06, 0xF4, 0xFC, 0xFC, 0x3A, 0xDA, 0x33, 0xBA, 0xE2, 0x0D, 0x4F, 0xF6, 0x13, 0xFA, 0x6B, 0xA8, 0x74, 0xB1, 0x75, 0xB7, 0xDE, 0x71, 0xDC, 0xF8, 0x7A, 0x18, 0x26, 0x7B, 0x57, 0x74, 0x10, 0xF0, 0xE8, 0xB9, 0xDF, 0x1E, 0x05, 0x37, 0xA5, 0x60, 0xE5, 0xD1, 0xEF, 0xFE, 0xC1, 0x10, 0x22, 0xCE, 0x60, 0x23, 0xB4, 0x98, 0x5C, 0x9D, 0x8D, 0xA2, 0x07, 0x33, 0x70, 0x7C, 0xE7, 0x6A, 0x42, 0x35, 0x82, 0xAF, 0x23
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0x9A, 0xBE, 0xCA, 0xEF, 0x92, 0xA6, 0xE0, 0x83, 0x96, 0x98, 0x50, 0x9C, 0x4E, 0xAC, 0xA6, 0x2A
IV: 0x37, 0x78, 0xEB, 0xA0, 0x48, 0x29, 0x6B, 0xA8, 0xD6, 0xD2, 0xBC, 0x14, 0xB5, 0x03, 0xFB, 0x18
Plaintext: 0xA0, 0x9E, 0x59, 0xB7, 0xDA, 0xE6, 0xD6, 0x7C, 0x16, 0xD9, 0x4D, 0x6A, 0x95, 0xC0, 0xB1, 0x35, 0x8E, 0x04, 0x96, 0xB3, 0xD2, 0x43, 0xF3, 0x8D, 0xB0, 0xA3, 0x26, 0x3A, 0x16, 0x66, 0x38, 0x2E, 0xFA, 0xBF, 0x63, 0x4E, 0xF8, 0xE4, 0xD1, 0xA8, 0x3D, 0x65, 0xA7, 0x61, 0xA3, 0xBC, 0x42, 0xEE, 0x1D, 0x25, 0xC0, 0x87, 0x56, 0xB0, 0xC3, 0xD9, 0x95, 0x94, 0x71, 0xFC, 0xE4, 0xC6, 0xC0, 0xA4, 0x71, 0xCA, 0xF0, 0x9B, 0x34, 0xCA, 0x59, 0x6F, 0xD2, 0xE5, 0x66, 0x68, 0xC2, 0xC9, 0xE2, 0xBC, 0xAE, 0x84, 0x72, 0x06, 0x1C, 0x97, 0x63, 0xF5, 0x4D, 0x4C, 0xA6, 0x41, 0x65, 0x4A, 0x19, 0xE4
Ciphertext: 0xB4, 0x9F, 0xF2, 0xE4, 0xFD, 0x72, 0x45, 0xF8, 0xF1, 0x5A, 0xA3, 0x3C, 0xBB, 0x49, 0xA6, 0x2A, 0x26, 0x02, 0xB8, 0x44, 0xB8, 0xED, 0x56, 0x8D, 0x82, 0x1B, 0x30, 0xA1, 0xD4, 0xA0, 0x10, 0x63, 0x66, 0xA2, 0x72, 0xB7, 0xCF, 0x19, 0xD6, 0x35, 0x13, 0x39, 0x66, 0x35, 0x77, 0x61, 0x29, 0x86, 0x06, 0x5F, 0x13, 0xB1, 0x4A, 0x30, 0x97, 0x3E, 0x9B, 0xA1, 0xAD, 0xB9, 0x57, 0x8D, 0x18, 0x1D, 0xC8, 0x4E, 0x59, 0xBC, 0x45, 0xC9, 0xD9, 0x15, 0x81, 0x1B, 0xDF, 0x9E, 0x08, 0x5C, 0xF8, 0x16, 0x1C, 0xA7, 0x6F, 0x1D, 0x66, 0x19, 0x51, 0x2C, 0xD8, 0x99, 0xD3, 0x9B, 0xC3, 0x7E, 0x43, 0xF4
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0xCD, 0x67, 0x09, 0x86, 0xD6, 0xBD, 0xF4, 0x39, 0x9F, 0x00, 0x93, 0x66, 0x38, 0x0F, 0x17, 0x07
IV: 0x07, 0xC8, 0xB4, 0x17, 0x6B, 0x21, 0x5C, 0x47, 0xA0, 0x74, 0xCD, 0xF3, 0xE3, 0x1B, 0xCD, 0x54
Plaintext: 0xD6, 0x3D, 0xB4, 0xF7, 0x25, 0xE7, 0x2C, 0x6E, 0x6A, 0x5F, 0x35, 0x45, 0x4E, 0xB5, 0x6C, 0x38, 0xF1, 0x9A, 0x8C, 0xA2, 0x8D, 0x75, 0x35, 0x39, 0x56, 0xB4, 0xEC, 0xF9, 0xA4, 0x60, 0x64, 0x5E, 0x53, 0xF5, 0xFB, 0xD6, 0x6A, 0x70, 0x88, 0x76, 0xFC, 0xA9, 0x54, 0xEC, 0x4C, 0xE3, 0x66, 0xB5, 0x34, 0xA2, 0x04, 0x90, 0xC8, 0xBD, 0x76, 0x32, 0x36, 0xB3, 0x0D, 0x3B, 0xF1, 0x42, 0x64, 0x69, 0x0E, 0x36, 0xE6, 0x0B, 0xEE, 0x80, 0x90, 0xB9, 0x1D, 0x87, 0xF8, 0x43, 0x7A, 0xC3, 0x8F, 0xE7, 0x98, 0x87, 0x23, 0xC7, 0x65, 0x1E, 0xA8, 0x9A, 0x09, 0x1A, 0x37, 0xA1, 0x11, 0xE9, 0x57, 0xDC, 0xCD, 0xA9, 0x7C, 0x7F, 0xF6, 0x3D, 0xCD, 0xA0, 0x94, 0xA1, 0x2A, 0x32, 0x1F, 0x7A, 0x6E, 0x36
Ciphertext: 0x27, 0xEF, 0xDD, 0xE7, 0xCD, 0xE3, 0xCA, 0xAD, 0xFB, 0xFF, 0xC7, 0x47, 0x3F, 0x7A, 0x47, 0x3C, 0x84, 0x4C, 0xAA, 0xF6, 0x8B, 0x66, 0x71, 0xBF, 0x91, 0xB8, 0x40, 0xB7, 0x31, 0x6D, 0x4C, 0xBF, 0x80, 0x88, 0xBB, 0x83, 0x4C, 0xE0, 0xCF, 0x9B, 0x02, 0xF5, 0x9E, 0xFC, 0x78, 0xD2, 0xCD, 0xE5, 0xEE, 0xEA, 0x45, 0x52, 0x39, 0x8E, 0x0B, 0xF0, 0xA8, 0x63, 0x0B, 0xF5, 0xC6, 0xEB, 0x0A, 0xCC, 0xF8, 0x61, 0x72, 0xBA, 0x0C, 0x40, 0xBF, 0x59, 0xD5, 0x3E, 0x9D, 0xA3, 0xEA, 0xD5, 0x6D, 0xE2, 0xC0, 0x6C, 0x4D, 0xC8, 0x3F, 0xC4, 0xE1, 0x99, 0x28, 0x3A, 0xC0, 0x83, 0x57, 0xFB, 0xD9, 0xB1, 0x3A, 0x5B, 0x1F, 0x96, 0x16, 0x4D, 0xA1, 0x3A, 0x18, 0x47, 0x90, 0x9D, 0xED, 0x86, 0x19, 0xB5
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0xE5, 0xF2, 0xF1, 0x30, 0xAB, 0xC2, 0x52, 0xD8, 0x97, 0x90, 0x73, 0x13, 0x4E, 0x7C, 0xC4, 0x21
IV: 0x59, 0xF6, 0xC5, 0x18, 0xCD, 0xD2, 0xC6, 0x91, 0x2B, 0x9E, 0xF1, 0xA1, 0x85, 0x33, 0x8B, 0x0B
Plaintext: 0xE2, 0x8A, 0x77, 0xB3, 0xE4, 0xD1, 0xFC, 0x56, 0xA8, 0xBE, 0xC8, 0x79, 0xEE, 0x24, 0x34, 0x9F, 0x7A, 0xC4, 0xC9, 0xBF, 0xBA, 0x65, 0x03, 0xF5, 0xA8, 0x27, 0x56, 0x78, 0xF2, 0x14, 0x6F, 0xCC, 0x58, 0xF8, 0xBC, 0x39, 0x56, 0x72, 0x2E, 0x7B, 0x04, 0x4C, 0x3E, 0xBB, 0x3A, 0x08, 0x2E, 0xBE, 0xF7, 0xBB, 0x91, 0x5D, 0x04, 0x1F, 0x0D, 0x35, 0xD4, 0xE3, 0x60, 0x9F, 0xAF, 0x45, 0xA1, 0xE3, 0x10, 0xE3, 0xC8, 0xA8, 0x4B, 0xCE, 0x71, 0xAF, 0x72, 0xE1, 0xDD, 0xC1, 0x7A, 0x51, 0x3A, 0xE6, 0x9A, 0x84, 0x24, 0xD8, 0xF4, 0x27, 0x6B, 0xB7, 0x77, 0x7B, 0x17, 0xFE, 0x04, 0xEF, 0xA9, 0xB6, 0xCF, 0xF4, 0xA4, 0xEA, 0x09, 0x0D, 0x4C, 0x5A, 0xBC, 0x25, 0xAE, 0x73, 0xF6, 0x26, 0xE0, 0x7F, 0x29, 0xC7, 0x8A, 0x1A, 0xD2, 0xA6, 0xA5, 0xE5, 0x59, 0x96, 0x83, 0x7E, 0x38, 0x3A, 0x10, 0xAF
Ciphertext: 0x4D, 0x60, 0x9C, 0xA3, 0x53, 0xB7, 0xD3, 0x4F, 0x19, 0xAF, 0xB6, 0x80, 0xD6, 0x58, 0xFF, 0x89, 0x49, 0x04, 0xCD, 0x88, 0x17, 0x3B, 0x96, 0xB3, 0xFA, 0x29, 0xA8, 0x99, 0x76, 0x6B, 0x80, 0x47, 0x19, 0x01, 0xCD, 0x80, 0x3E, 0xF3, 0xF2, 0xAB, 0x92, 0x4B, 0x97, 0x2E, 0xFC, 0xB3, 0x4D, 0xBF, 0x82, 0x7C, 0xD7, 0x3D, 0xF5, 0x8F, 0x10, 0x2F, 0x91, 0x6A, 0x13, 0xE0, 0xD4, 0xBE, 0x0D, 0x76, 0x48, 0x50, 0xE2, 0x5C, 0xDF, 0x3A, 0xC7, 0xFF, 0x7D, 0xBF, 0xED, 0x0B, 0xFA, 0xA9, 0xF7, 0x1D, 0x99, 0x45, 0xFA, 0x66, 0xA1, 0x4F, 0x99, 0x76, 0x71, 0x7E, 0x45, 0xB5, 0x24, 0x8D, 0xF3, 0x77, 0xC0, 0xD9, 0x8B, 0xFD, 0xC6, 0x3A, 0xBE, 0x28, 0x59, 0xBA, 0x40, 0xFA, 0x91, 0x9C, 0x59, 0xCD, 0xD5, 0x12, 0x73, 0xF8, 0x85, 0x78, 0xA3, 0xD9, 0x76, 0x4D, 0xE2, 0x18, 0xED, 0xE3, 0x3E, 0xD8
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0x60, 0xD3, 0x57, 0xE5, 0xD8, 0x56, 0x48, 0xE4, 0xA8, 0xC2, 0xB8, 0xBA, 0xF5, 0xB0, 0xA9, 0xF1
IV: 0x6D, 0x2B, 0xCC, 0x09, 0xE6, 0xC3, 0x44, 0x26, 0x41, 0xDD, 0xAD, 0x05, 0x95, 0x4D, 0x5D, 0x34
Plaintext: 0x8A, 0x27, 0xE9, 0x83, 0x02, 0xD1, 0xEB, 0xB6, 0xFF, 0x5D, 0x03, 0x7C, 0xC1, 0x16, 0x1C, 0xA5, 0x2E, 0x59, 0xF1, 0x8F, 0x77, 0xA7, 0xCF, 0xE1, 0xF9, 0xF7, 0x9C, 0x7C, 0x61, 0x51, 0x18, 0xAF, 0x14, 0x98, 0x63, 0xAA, 0xCE, 0xA8, 0xC0, 0x36, 0x88, 0xA1, 0x98, 0xA3, 0xA0, 0x81, 0xC2, 0x01, 0x34, 0xF9, 0x01, 0x93, 0xCE, 0x79, 0xCE, 0x80, 0x47, 0x8E, 0x58, 0xCC, 0xE5, 0x6D, 0xCA, 0x87, 0xC7, 0xD0, 0xCC, 0x44, 0x83, 0x00, 0x4C, 0xCD, 0x0D, 0x33, 0x7E, 0x15, 0xDB, 0x19, 0x21, 0x6E, 0x46, 0xB2, 0x05, 0xFC, 0x34, 0x62, 0xCA, 0x6A, 0xF4, 0x47, 0xEA, 0xDB, 0x69, 0xCA, 0xFA, 0x24, 0x6B, 0x74, 0x2C, 0x38, 0x6A, 0x04, 0x19, 0xE3, 0x54, 0xBE, 0xBD, 0xBC, 0xB9, 0x05, 0xC3, 0x55, 0x2E, 0x2C, 0x03, 0xB4, 0xEF, 0x8A, 0x4A, 0x07, 0xC8, 0xCC, 0x59, 0x93, 0x35, 0x8F, 0x30, 0xEE, 0xC8, 0x2F, 0x8C, 0x6E, 0xCB, 0xD9, 0xAE, 0xE1, 0x27, 0xE8, 0x5E, 0x7E, 0x84, 0x6E, 0x30, 0x1C
Ciphertext: 0xCB, 0x12, 0xCF, 0x19, 0xB5, 0xD4, 0x34, 0xDA, 0x62, 0xFB, 0x58, 0x6B, 0xF8, 0x92, 0x52, 0x2B, 0xE8, 0xEB, 0xBA, 0x69, 0xAE, 0xA2, 0x20, 0x9B, 0xBC, 0xA8, 0x72, 0x09, 0xA8, 0x48, 0x73, 0x67, 0xAC, 0x52, 0x6B, 0xEC, 0x97, 0xA8, 0x37, 0x7A, 0xBB, 0x0E, 0x5F, 0x35, 0x0A, 0x57, 0x8D, 0x29, 0x2B, 0xF5, 0xCD, 0x3A, 0x17, 0x28, 0x16, 0xF5, 0x57, 0x8B, 0x71, 0xB0, 0xCE, 0x1E, 0xCD, 0xEB, 0x19, 0xDA, 0x2E, 0x13, 0xCD, 0xC4, 0xBC, 0x79, 0x05, 0xF5, 0x37, 0xD2, 0xEB, 0x04, 0x6A, 0x1B, 0xCC, 0x76, 0x31, 0x44, 0xF2, 0xD9, 0xFC, 0xAA, 0xF5, 0x9F, 0x4A, 0x74, 0xE7, 0xA1, 0x35, 0x81, 0x0D, 0x32, 0xB5, 0xD7, 0x21, 0x9B, 0xC8, 0x01, 0xB1, 0x9F, 0xBD, 0x90, 0xC0, 0xEC, 0x55, 0xA1, 0x84, 0x4A, 0x5A, 0x7C, 0xB3, 0xDD, 0xE2, 0xCF, 0x9A, 0x25, 0x96, 0x9A, 0xBC, 0x4A, 0xCC, 0x63, 0x06, 0x78, 0x9D, 0xAE, 0x2A, 0xD2, 0x6E, 0x9C, 0x93, 0x46, 0xB1, 0x1E, 0x85, 0x9F, 0x6C, 0x44
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 128-bit key
Key: 0xB2, 0x10, 0x06, 0xA2, 0x47, 0x18, 0xD6, 0xBF, 0x8A, 0xC5, 0xAD, 0xDB, 0x90, 0xE5, 0xF4, 0x4D
IV: 0xA5, 0xA6, 0xF3, 0xCE, 0xEE, 0xAA, 0x93, 0x2D, 0x4C, 0x59, 0x68, 0x45, 0x82, 0x7B, 0xEE, 0x2D
Plaintext: 0x9B, 0x06, 0x13, 0xAE, 0x86, 0x34, 0xF6, 0xFA, 0x04, 0xD9, 0xEF, 0x9A, 0xC4, 0xF4, 0xCF, 0xA9, 0xCB, 0x84, 0x69, 0x40, 0x1A, 0x9D, 0x51, 0x31, 0x8B, 0xBA, 0xE3, 0xF8, 0xFD, 0x55, 0x87, 0xEE, 0xB0, 0xB5, 0x34, 0xC0, 0xF2, 0x08, 0x33, 0x20, 0xFC, 0xB1, 0x26, 0xBA, 0x17, 0xE3, 0x48, 0x6A, 0x03, 0x6F, 0xF6, 0xAC, 0x98, 0xDA, 0x6F, 0x54, 0xAE, 0xB3, 0xD8, 0x7F, 0x3B, 0x23, 0x83, 0xC9, 0xBB, 0xC6, 0x70, 0xC0, 0xD5, 0xB9, 0x14, 0x99, 0x3B, 0xF5, 0x5A, 0x22, 0xD2, 0xDB, 0xE8, 0xF8, 0x13, 0x0F, 0xA3, 0xFA, 0xB1, 0x8A, 0x75, 0xFD, 0x7B, 0xEB, 0x4E, 0xC2, 0x85, 0x0E, 0x68, 0x25, 0x82, 0xE0, 0xD0, 0x96, 0x75, 0x72, 0x22, 0xCD, 0x89, 0x4C, 0x93, 0xBA, 0x3C, 0x03, 0x35, 0xBB, 0xC3, 0x0E, 0x77, 0x12, 0xAA, 0xD5, 0xEB, 0x96, 0xBC, 0x0B, 0x4D, 0xA8, 0x22, 0x3E, 0xC0, 0x69, 0xCF, 0xAC, 0x5A, 0x2B, 0x1B, 0x59, 0xE3, 0x25, 0xAD, 0x5E, 0xDA, 0x6A, 0x9F, 0x84, 0xB9, 0x1C, 0xDD, 0x11, 0x7B, 0xDC, 0xCE, 0xE2, 0x5A, 0x86, 0x37, 0xBA, 0xDD, 0x1B, 0x5C, 0xDA, 0x12, 0xFF
Ciphertext: 0xB2, 0x25, 0x29, 0xEC, 0xC4, 0x7D, 0x73, 0xCA, 0x8C, 0xF2, 0x05, 0xBE, 0x8E, 0x88, 0x94, 0x77, 0xD0, 0x2F, 0xB6, 0x5C, 0x99, 0x23, 0x64, 0x2F, 0x67, 0x4F, 0xAF, 0x76, 0x69, 0x82, 0x6C, 0x97, 0x8F, 0xB4, 0x8A, 0xC7, 0xDD, 0x1B, 0xBE, 0x01, 0x35, 0x07, 0xDF, 0xB9, 0x0F, 0x0D, 0x6B, 0xAB, 0x59, 0x8F, 0xDD, 0x34, 0xC6, 0x93, 0xB1, 0x66, 0x13, 0xF2, 0xB4, 0x78, 0xC0, 0x1D, 0xFF, 0xC4, 0xB7, 0x0B, 0x44, 0x85, 0xBB, 0x93, 0x43, 0x0E, 0x40, 0xE6, 0xBC, 0x0E, 0xBB, 0xF3, 0x53, 0xCE, 0xE5, 0x1B, 0x92, 0xD6, 0xB4, 0xA0, 0x10, 0xF0, 0x4B, 0x1F, 0xBE, 0x7C, 0x2F, 0x4F, 0x6F, 0x24, 0x69, 0xA2, 0xE4, 0x4B, 0xAD, 0x79, 0x68, 0xF7, 0xF9, 0x23, 0xB8, 0x31, 0x6C, 0x21, 0xFD, 0xF8, 0x47, 0xE5, 0x34, 0x0E, 0x10, 0x95, 0x20, 0x9B, 0xFA, 0xA9, 0x1E, 0xA7, 0x0A, 0x5A, 0xC6, 0x3A, 0x39, 0x39, 0xF9, 0x92, 0xED, 0xE2, 0x4E, 0x8D, 0xBA, 0x21, 0x24, 0x50, 0x88, 0x80, 0x89, 0x8A, 0xD3, 0x20, 0x87, 0x0F, 0x74, 0x7D, 0x5C, 0xE6, 0xC7, 0x75, 0xE5, 0xCF, 0xF7, 0xC4, 0x2D, 0xCA}}
Test: Encrypt
#
#
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0x68, 0xD2, 0x18, 0x65, 0x0E, 0x96, 0xE1, 0x07, 0x71, 0xD4, 0x36, 0x1A, 0x41, 0x85, 0xFC, 0x81, 0x27, 0xC3, 0xB5, 0x41, 0x64, 0xDA, 0x4A, 0x35
IV: 0xB5, 0xA1, 0x07, 0x03, 0x79, 0x0B, 0xE7, 0x4E, 0x15, 0xF9, 0x12, 0x2D, 0x98, 0x52, 0xA4, 0xDC
Plaintext: 0x9B, 0x56, 0xB0, 0xB2, 0x6C, 0x2F, 0x85, 0x53, 0x6B, 0xC9, 0x2F, 0x27, 0xB3, 0xE4, 0x41, 0x0B
Ciphertext: 0x72, 0x86, 0x6A, 0xA8, 0xE3, 0xF1, 0xA4, 0x44, 0x96, 0x18, 0xC8, 0xCF, 0x62, 0x3D, 0x9B, 0xBE
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0xFD, 0x68, 0xD2, 0x46, 0xC2, 0xF8, 0xC6, 0xBE, 0xA0, 0xC9, 0x4F, 0x6C, 0xFF, 0xB5, 0xB2, 0x0D, 0xF4, 0x8B, 0x4F, 0x1A, 0x66, 0xAA, 0xDC, 0xFB
IV: 0x6F, 0xCE, 0xF1, 0x78, 0x04, 0x29, 0xC9, 0x70, 0xD9, 0xB6, 0x47, 0xCD, 0x7F, 0xCA, 0x37, 0xB7
Plaintext: 0xCF, 0xEC, 0xD7, 0x08, 0x8C, 0xE6, 0x95, 0x00, 0x44, 0x1C, 0x1B, 0x3B, 0x77, 0x1D, 0x89, 0xDF, 0xFC, 0x78, 0x01, 0x1A, 0x9F, 0xD1, 0x69, 0xCC, 0x0F, 0x33, 0x6C, 0x80, 0xF8, 0xA8, 0xC2, 0xA1
Ciphertext: 0x35, 0x8F, 0xF4, 0x28, 0x33, 0x52, 0x60, 0x81, 0xBB, 0xAC, 0x7C, 0x5A, 0x84, 0xD1, 0xE2, 0x07, 0x2F, 0xEE, 0x96, 0xD5, 0x4A, 0xEE, 0x31, 0x1F, 0xC5, 0xB2, 0x51, 0xA8, 0xC8, 0xE6, 0x4C, 0xED
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0x6C, 0x07, 0xB2, 0xEB, 0x87, 0x0E, 0xD5, 0x1F, 0x53, 0xB0, 0x1C, 0xFB, 0xE9, 0xB0, 0x14, 0x69, 0xD9, 0x6F, 0x69, 0xF7, 0xCC, 0x03, 0xAA, 0x87
IV: 0x68, 0x88, 0x4B, 0x47, 0x74, 0xBB, 0xF0, 0xE4, 0x3D, 0xC5, 0xE9, 0xFB, 0x38, 0x54, 0xF8, 0xD1
Plaintext: 0xE8, 0xF0, 0x5B, 0x43, 0x02, 0x8D, 0x06, 0x00, 0xD0, 0x5C, 0x31, 0xF5, 0xD3, 0xE7, 0x12, 0x09, 0xAC, 0x5D, 0xEC, 0x0B, 0x3D, 0x2A, 0x48, 0xE8, 0x0B, 0xCB, 0x82, 0x22, 0xE6, 0xE1, 0x88, 0x7D, 0xCD, 0x84, 0xDF, 0xFC, 0x0C, 0xD9, 0xE7, 0x0B, 0xA7, 0xE7, 0x5F, 0xFE, 0xFB, 0xA6, 0x2B, 0xBA
Ciphertext: 0x3E, 0x7B, 0x2C, 0x78, 0x61, 0x84, 0x84, 0xA7, 0x25, 0x82, 0x70, 0x87, 0xBE, 0x67, 0x79, 0x46, 0x99, 0x17, 0x9E, 0xD0, 0xA9, 0xB1, 0xDC, 0x80, 0xA9, 0xCB, 0x42, 0x5C, 0x15, 0xD5, 0x94, 0xBA, 0xC3, 0xB3, 0xF4, 0x1F, 0xEC, 0x94, 0x73, 0x60, 0x63, 0x6E, 0x4A, 0xA9, 0xEC, 0xFB, 0xA1, 0x7B
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0xA3, 0x59, 0x55, 0xB2, 0x99, 0x1E, 0x53, 0x16, 0x9D, 0xC4, 0x88, 0x46, 0xDB, 0xDC, 0x0D, 0x8D, 0xC8, 0x13, 0xB0, 0x0C, 0x4D, 0xBF, 0x3D, 0xF4
IV: 0x27, 0xB7, 0xFD, 0xF9, 0x8E, 0x68, 0x7D, 0x03, 0x14, 0x25, 0x90, 0x26, 0xD1, 0xBF, 0x97, 0xD4
Plaintext: 0xBD, 0x56, 0x00, 0x51, 0x5D, 0x6E, 0x0D, 0x68, 0xA2, 0x45, 0xD7, 0x5D, 0x0E, 0x65, 0x92, 0x22, 0x18, 0x75, 0x12, 0xCD, 0xD2, 0x54, 0x8E, 0x4A, 0xC9, 0x69, 0xA5, 0x4D, 0x2C, 0x34, 0x9E, 0x8B, 0x31, 0x29, 0xF4, 0x2A, 0xB5, 0xBF, 0x12, 0x76, 0x23, 0xC4, 0x5B, 0xD5, 0x96, 0xF3, 0x6D, 0xFD, 0x42, 0xC8, 0xA7, 0x64, 0x10, 0x93, 0xE9, 0xF8, 0x88, 0xCC, 0x9A, 0x11, 0xF4, 0xA6, 0xF0, 0xA4
Ciphertext: 0xC5, 0x7D, 0x22, 0x65, 0xAB, 0x4E, 0xE3, 0xE2, 0x31, 0x71, 0x63, 0x1D, 0x19, 0x39, 0x62, 0xDB, 0x25, 0x62, 0x8A, 0xA9, 0x77, 0xD4, 0x86, 0x92, 0xA5, 0xCA, 0x54, 0x8F, 0x47, 0x84, 0x39, 0x04, 0x43, 0x44, 0xE8, 0xAC, 0x01, 0xD2, 0x36, 0x08, 0x0F, 0x22, 0x10, 0x0F, 0x2E, 0xAC, 0x41, 0x9C, 0x84, 0xEE, 0xA1, 0x0F, 0xAA, 0x42, 0x08, 0xEA, 0x2B, 0xD0, 0x21, 0x22, 0x6B, 0xBA, 0xEC, 0xDF
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0xC2, 0xE6, 0x6B, 0xB9, 0x2B, 0xF6, 0xA3, 0x1F, 0x12, 0x35, 0x44, 0x5E, 0x2F, 0x92, 0x57, 0xED, 0x6C, 0x59, 0xC3, 0xA5, 0x8F, 0x4C, 0x13, 0x76
IV: 0x1A, 0xF6, 0x79, 0x59, 0x6F, 0x3C, 0x13, 0x85, 0x38, 0x35, 0x6E, 0xE6, 0x06, 0x3C, 0x49, 0xCB
Plaintext: 0x38, 0x43, 0x9B, 0xDF, 0x1F, 0x6A, 0xD7, 0x5A, 0x60, 0xD0, 0x6E, 0x78, 0x99, 0xA8, 0x95, 0x2B, 0x47, 0x90, 0x4A, 0x0C, 0xE7, 0x1F, 0x91, 0x98, 0x5B, 0xBD, 0x04, 0x99, 0x90, 0xB8, 0x8A, 0xE2, 0x5E, 0x94, 0x67, 0x3F, 0xAF, 0xA2, 0x75, 0xAC, 0xE4, 0xD4, 0xB0, 0xC5, 0x74, 0xCF, 0xF8, 0x7E, 0xD6, 0x42, 0x13, 0x14, 0xA2, 0x76, 0xF2, 0x44, 0xF3, 0x27, 0x35, 0xBA, 0x0F, 0x93, 0xF1, 0xCC, 0x4A, 0xD0, 0xB0, 0x68, 0x27, 0x62, 0xB9, 0x4B, 0xC1, 0x0D, 0x92, 0x74, 0x69, 0xE8, 0xC4, 0xD9
Ciphertext: 0x96, 0xBE, 0x15, 0xC3, 0xB8, 0xD1, 0x47, 0x3B, 0x4A, 0x3C, 0xB8, 0xF5, 0x25, 0x83, 0xB1, 0xAD, 0x80, 0x4F, 0xE4, 0x6D, 0xC1, 0x43, 0xFD, 0x26, 0xC3, 0x8C, 0x4B, 0x01, 0x9C, 0x10, 0xD6, 0x0F, 0x68, 0x15, 0x82, 0x50, 0x95, 0x32, 0xE5, 0x86, 0xCC, 0x23, 0x71, 0x8B, 0x7B, 0xD7, 0x50, 0x45, 0xD5, 0x77, 0xF8, 0xE7, 0x78, 0xCA, 0x4B, 0xF0, 0x27, 0x8E, 0xB2, 0x5A, 0xB7, 0xCD, 0x67, 0x08, 0x00, 0xC5, 0xEC, 0x88, 0x32, 0xFE, 0x91, 0xB8, 0x4E, 0x56, 0xAB, 0x58, 0xDE, 0xE8, 0x49, 0xA8
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0x91, 0xB3, 0xDE, 0x58, 0xE9, 0x6A, 0xBC, 0xF0, 0xC7, 0x1A, 0x09, 0x31, 0xCC, 0xF4, 0x03, 0xF1, 0xC5, 0xA0, 0x7E, 0x41, 0xCF, 0xD4, 0x2C, 0xA0
IV: 0xBF, 0x24, 0x1B, 0x6E, 0xC0, 0x1C, 0x7F, 0xA3, 0x3E, 0x8C, 0xB2, 0xC0, 0x03, 0x23, 0x79, 0x06
Plaintext: 0xA0, 0x3F, 0x89, 0xE6, 0x0F, 0x04, 0x4A, 0xBA, 0x96, 0xAC, 0xDA, 0xB2, 0xEE, 0x1D, 0x55, 0x11, 0xA5, 0xC1, 0x54, 0x99, 0xC1, 0x92, 0xB3, 0x43, 0xA6, 0x74, 0x98, 0x34, 0x3A, 0xC8, 0xB0, 0xED, 0x46, 0x3E, 0xBC, 0xC2, 0x20, 0xEA, 0x4D, 0x8D, 0x87, 0x9B, 0xCB, 0xA3, 0xCE, 0x68, 0xBC, 0x07, 0x3D, 0x8B, 0x43, 0xDE, 0xB4, 0x73, 0xE7, 0x23, 0x91, 0x14, 0x96, 0x9C, 0xD4, 0x82, 0xEA, 0x0D, 0x81, 0xBE, 0xAB, 0xAB, 0x46, 0xCF, 0x94, 0xD3, 0x5E, 0x15, 0x5A, 0xFC, 0xB5, 0xDB, 0xEA, 0xEB, 0x4D, 0x2B, 0xF2, 0x26, 0xE0, 0xE6, 0xA4, 0xAA, 0xC7, 0x14, 0xB7, 0xE0, 0x1A, 0x78, 0xAE, 0xCE
Ciphertext: 0xD1, 0x38, 0x58, 0xA3, 0xE9, 0x6A, 0xF4, 0xB8, 0x40, 0xB7, 0x46, 0x41, 0x87, 0x30, 0x5F, 0x6B, 0x41, 0x32, 0xE1, 0xCE, 0x76, 0x22, 0x39, 0xC0, 0x04, 0xA8, 0x9D, 0xBE, 0xA6, 0xD4, 0xB0, 0x72, 0x0D, 0x8F, 0x4B, 0xF4, 0x52, 0xFF, 0x3C, 0x87, 0xFC, 0xD2, 0xCA, 0x93, 0x2A, 0xC5, 0x75, 0xD7, 0x66, 0x3B, 0xF9, 0x2D, 0x73, 0x54, 0x14, 0x43, 0xE7, 0x7B, 0x08, 0xDC, 0x05, 0x77, 0xFC, 0x8C, 0x2A, 0xE6, 0x23, 0x61, 0x38, 0x96, 0x9F, 0x6F, 0xF0, 0xC2, 0x5A, 0x90, 0xC5, 0x35, 0xF6, 0x01, 0x3E, 0x94, 0xD9, 0x7A, 0xC3, 0xD5, 0x53, 0x75, 0x95, 0x7C, 0x9F, 0xB9, 0x86, 0x94, 0x7F, 0x45
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0x19, 0x67, 0x5C, 0x8A, 0xCA, 0xDB, 0xA8, 0xF5, 0xE4, 0xC4, 0x8E, 0xA5, 0xEC, 0x9E, 0x66, 0x23, 0x9E, 0x48, 0x69, 0x57, 0x8E, 0x14, 0x71, 0x40
IV: 0x0F, 0x1B, 0x00, 0xE9, 0x54, 0xD3, 0x84, 0x98, 0xD5, 0xE3, 0xD9, 0x48, 0xF4, 0x35, 0x10, 0x59
Plaintext: 0xE1, 0x4D, 0x6F, 0x87, 0xBB, 0xDA, 0xB8, 0x19, 0xF8, 0x8B, 0xAF, 0x5A, 0x06, 0x24, 0xD6, 0x4D, 0x32, 0xD1, 0x7B, 0x9D, 0xCA, 0xBA, 0xF4, 0xD3, 0x7E, 0xD7, 0x2A, 0xCB, 0x0C, 0x06, 0x54, 0x69, 0x1D, 0x5B, 0x05, 0x88, 0x69, 0xB7, 0x69, 0x33, 0x22, 0x9C, 0xCB, 0x18, 0x90, 0x3F, 0x5B, 0x39, 0xF9, 0xDF, 0x2F, 0xE5, 0xC3, 0x56, 0x87, 0xE7, 0xDC, 0xEE, 0x55, 0xFD, 0x5A, 0x75, 0xFD, 0x8C, 0x5F, 0x94, 0x59, 0x91, 0x40, 0x5C, 0x00, 0xDB, 0xE6, 0x22, 0xC8, 0x78, 0x74, 0x8D, 0x89, 0x6D, 0x29, 0xED, 0x24, 0xAA, 0x89, 0xCE, 0xC4, 0x3C, 0xB7, 0xCE, 0x64, 0xC5, 0x26, 0xAB, 0x92, 0x29, 0x70, 0xA0, 0x72, 0x8B, 0x86, 0xF2, 0x05, 0x78, 0x0A, 0xC6, 0xAB, 0x61, 0xF9, 0x35, 0xE7, 0x4F
Ciphertext: 0xB3, 0xC1, 0xD0, 0xD9, 0xAB, 0x14, 0xDA, 0xF5, 0xC4, 0x80, 0x52, 0xD1, 0x1A, 0x44, 0xEF, 0xB2, 0x52, 0x63, 0xE8, 0xA9, 0xEE, 0xCB, 0x9D, 0x40, 0x63, 0xBE, 0x44, 0x9D, 0x24, 0xDF, 0x26, 0x62, 0x78, 0x4E, 0x07, 0x34, 0x6D, 0x2D, 0xD7, 0x7D, 0x58, 0x15, 0xB2, 0xE1, 0x50, 0xEA, 0x90, 0xD5, 0xBB, 0x08, 0x10, 0x1F, 0x77, 0x31, 0xCC, 0xE1, 0xEC, 0xB1, 0xBE, 0x39, 0x92, 0x8D, 0x4B, 0xB6, 0x52, 0x11, 0x3D, 0x91, 0x07, 0x7A, 0x64, 0xC2, 0xE5, 0x8F, 0x58, 0x3B, 0x98, 0xBB, 0x7B, 0xF4, 0x3F, 0x38, 0xE2, 0xAA, 0x1B, 0x88, 0x69, 0x34, 0xCC, 0x61, 0x80, 0xB9, 0xF5, 0xB1, 0xBE, 0x8F, 0x20, 0x26, 0x62, 0x4F, 0x1F, 0xEE, 0x2D, 0x6E, 0x57, 0x6E, 0x33, 0xCB, 0x9F, 0xE3, 0xF9, 0x43
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0x8D, 0xA2, 0x63, 0xD2, 0x62, 0x4B, 0x34, 0x3A, 0xD7, 0x1F, 0x5E, 0x0A, 0xB7, 0xD0, 0x9B, 0xAA, 0x19, 0x28, 0x58, 0x5C, 0x84, 0xA0, 0x01, 0x71
IV: 0x57, 0x2F, 0x7E, 0xBD, 0x68, 0x60, 0xFE, 0x48, 0xEC, 0xA7, 0xF3, 0x46, 0x97, 0xF5, 0x5D, 0x4A
Plaintext: 0x04, 0x8A, 0x4C, 0xB6, 0x56, 0x0B, 0xA0, 0x76, 0x20, 0xD4, 0x14, 0xEE, 0x82, 0x8F, 0x7B, 0x30, 0x95, 0x05, 0x49, 0x73, 0x09, 0x35, 0x54, 0xC1, 0x0D, 0xA3, 0xDC, 0xEF, 0x6F, 0xF3, 0xC9, 0xD2, 0x05, 0xB6, 0x35, 0xB0, 0x4B, 0x84, 0x2A, 0xF5, 0x4D, 0x4B, 0xAD, 0x27, 0xC8, 0xE6, 0xFB, 0x1C, 0x8C, 0xF2, 0x12, 0x6B, 0x24, 0xDD, 0x73, 0x20, 0xB9, 0x3F, 0x27, 0xB4, 0x34, 0x6E, 0x00, 0x3C, 0xA3, 0x4D, 0x21, 0xE0, 0xDE, 0x64, 0xC0, 0x8F, 0x6A, 0x36, 0x2B, 0xF1, 0x9D, 0xCE, 0x09, 0x9D, 0x03, 0x9C, 0xE3, 0x8D, 0x01, 0x7F, 0xE3, 0xCE, 0xB8, 0x23, 0xDB, 0x7C, 0x2C, 0x8D, 0x88, 0xEE, 0xA6, 0xF4, 0x19, 0x2E, 0x57, 0xD3, 0xEB, 0xAC, 0x3D, 0x3C, 0x97, 0x33, 0x4B, 0x6F, 0x2E, 0x1B, 0xC4, 0xAB, 0xC3, 0xC1, 0xE8, 0x44, 0x2A, 0x34, 0xD2, 0xF6, 0x00, 0x31, 0xA1, 0x79, 0xEB, 0x52
Ciphertext: 0x69, 0x29, 0xF6, 0x37, 0xDA, 0xC4, 0x24, 0x68, 0x11, 0x49, 0xEC, 0xDD, 0x87, 0x8F, 0xF8, 0x29, 0xF1, 0xEC, 0xEC, 0x64, 0xC1, 0x91, 0x80, 0x2A, 0x29, 0xF0, 0x5C, 0x8B, 0xA1, 0x90, 0xA5, 0x1F, 0x64, 0x30, 0xF2, 0xC8, 0xEE, 0xB7, 0x07, 0x39, 0xE7, 0x59, 0x05, 0x3F, 0x65, 0x15, 0x63, 0x93, 0xD9, 0x64, 0xAB, 0xAF, 0xAF, 0x55, 0x90, 0xA9, 0x40, 0x64, 0x6D, 0x5F, 0xF4, 0xEF, 0x9D, 0x9E, 0x60, 0x5F, 0x36, 0x82, 0xDF, 0x2E, 0xCF, 0x80, 0xA9, 0xF1, 0xC3, 0x7D, 0x7F, 0xC0, 0x30, 0xBF, 0x0D, 0xF2, 0xA0, 0x2E, 0x17, 0xE5, 0x05, 0x51, 0xE4, 0xA8, 0x81, 0x33, 0xCA, 0x63, 0x04, 0x44, 0xDA, 0xBD, 0x7D, 0x50, 0x05, 0xC0, 0x9F, 0xDA, 0x0D, 0x35, 0x20, 0x19, 0x57, 0x29, 0x0A, 0x78, 0x4A, 0x95, 0x80, 0x31, 0xBC, 0x83, 0xA7, 0x1D, 0x3F, 0xCB, 0x4F, 0xD8, 0x51, 0x20, 0xE0, 0xA7
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0xD6, 0x55, 0x23, 0x82, 0xFD, 0xF8, 0x32, 0xB4, 0x90, 0x06, 0xF8, 0xD5, 0x18, 0xF0, 0xF1, 0xFE, 0x95, 0xC8, 0xBB, 0xEF, 0x20, 0x54, 0xD2, 0xB9
IV: 0xCF, 0x61, 0x9F, 0xBA, 0xD9, 0x59, 0xB1, 0xCE, 0xFA, 0x18, 0x4A, 0xC4, 0x19, 0xFC, 0x1D, 0x0F
Plaintext: 0x29, 0x3B, 0x56, 0xBE, 0x4D, 0x7A, 0xDB, 0xAF, 0x3F, 0x9B, 0xD1, 0xFF, 0xF2, 0xD6, 0x63, 0xC4, 0x76, 0x0B, 0xBE, 0xFF, 0x1D, 0x56, 0x60, 0xCC, 0xDC, 0xE5, 0x93, 0xDC, 0xF3, 0x06, 0x34, 0x25, 0xD0, 0x84, 0xB9, 0xD8, 0x31, 0x34, 0x73, 0x94, 0x8A, 0xCB, 0x0F, 0xD9, 0xA6, 0xF2, 0x63, 0xBF, 0x90, 0x9D, 0x68, 0xE8, 0xB4, 0x98, 0x82, 0xB3, 0x42, 0x62, 0x08, 0xB2, 0xD3, 0x3F, 0x00, 0x5F, 0x4F, 0x89, 0x2A, 0x0A, 0x0E, 0x47, 0x41, 0x16, 0x3D, 0x01, 0x7D, 0x65, 0x84, 0xD2, 0x5C, 0x11, 0xE5, 0xBE, 0xA2, 0x5D, 0xE8, 0x46, 0x9E, 0xEB, 0xF5, 0x3A, 0xB0, 0x2F, 0x01, 0xCF, 0x08, 0x23, 0x6D, 0xF1, 0xB0, 0x3C, 0x2A, 0xDA, 0xCD, 0x9D, 0x22, 0xE4, 0x22, 0x8C, 0xD3, 0x9B, 0xD5, 0x22, 0x3D, 0x17, 0x76, 0x46, 0xFF, 0x89, 0x3D, 0xDC, 0xBD, 0x13, 0x93, 0x39, 0xC4, 0xDD, 0xD4, 0xDA, 0xF1, 0x65, 0x54, 0x56, 0xCF, 0x16, 0xA0, 0x92, 0xFF, 0x1D, 0x06, 0x34, 0xDD, 0x78, 0x57, 0x5A
Ciphertext: 0xC8, 0x30, 0x92, 0x15, 0x8B, 0xDE, 0x25, 0x1F, 0x59, 0xC8, 0x20, 0x7B, 0x8D, 0xC3, 0xFC, 0xDE, 0x34, 0xB1, 0x54, 0x6E, 0x20, 0xFE, 0x3E, 0x94, 0x2F, 0x9F, 0x0B, 0xAE, 0x74, 0x5F, 0x54, 0xB1, 0x42, 0x6F, 0x0F, 0xEE, 0xD7, 0x60, 0x5A, 0x78, 0xA2, 0xF1, 0x19, 0xF4, 0x59, 0xAD, 0x0A, 0x79, 0x4F, 0x5F, 0x58, 0x59, 0x23, 0xFE, 0xB8, 0xE6, 0xAF, 0xA5, 0xB5, 0x6D, 0xC2, 0xA7, 0x96, 0x20, 0x13, 0xA5, 0xEA, 0x7D, 0x98, 0xBD, 0x97, 0x6C, 0x68, 0x65, 0x6D, 0x38, 0x0C, 0x1E, 0x3A, 0x30, 0xD0, 0xCB, 0x9C, 0xFA, 0x97, 0x94, 0x0B, 0x65, 0x1B, 0xD8, 0x34, 0x5C, 0x33, 0x60, 0x4B, 0xDD, 0xCC, 0xFC, 0x20, 0x72, 0x8E, 0x5A, 0x28, 0x5D, 0x2C, 0x5C, 0x8F, 0xE0, 0x87, 0xF4, 0x57, 0xC8, 0x94, 0x9F, 0xDC, 0x24, 0x8B, 0xC8, 0xF9, 0xFA, 0xEA, 0xB6, 0x39, 0x9B, 0x9D, 0x25, 0x07, 0xC5, 0x18, 0xB4, 0xD0, 0x6F, 0xFD, 0x9F, 0xC5, 0x96, 0xBD, 0x1C, 0x3C, 0x60, 0x34, 0x74, 0xE5, 0x0E
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 192-bit key
Key: 0x60, 0x4F, 0xEB, 0x8B, 0x42, 0x88, 0xE6, 0xEE, 0x61, 0x96, 0xBA, 0xB9, 0x66, 0x91, 0xED, 0xED, 0xA4, 0x8C, 0x1D, 0x41, 0x43, 0x23, 0x41, 0x5B
IV: 0x9D, 0x53, 0x31, 0x46, 0xE8, 0x8F, 0x69, 0x21, 0x16, 0x0F, 0x09, 0x14, 0xF9, 0x6C, 0x21, 0x89
Plaintext: 0xAB, 0x6A, 0x2C, 0x98, 0x2D, 0x14, 0xDA, 0xC2, 0x4E, 0x0F, 0x13, 0xE3, 0xCE, 0x28, 0x38, 0x62, 0xC4, 0x2F, 0xAC, 0xAB, 0x3D, 0x08, 0x93, 0xDF, 0x26, 0xFF, 0xD9, 0xC9, 0x6C, 0x5C, 0x76, 0x15, 0x61, 0x37, 0xF1, 0xBC, 0x62, 0x8E, 0x23, 0xC3, 0xB7, 0x95, 0x3E, 0x25, 0xBA, 0x4D, 0x0E, 0x0E, 0x3B, 0x58, 0x7E, 0x49, 0x24, 0x0C, 0x5D, 0xFC, 0x59, 0xC6, 0x62, 0x93, 0xE2, 0x81, 0x6E, 0xFA, 0x4C, 0xA7, 0x12, 0x0F, 0x4C, 0x26, 0x51, 0x57, 0xA6, 0xC7, 0xA7, 0xEF, 0x4D, 0xBC, 0x4A, 0xC6, 0xCC, 0x77, 0xAF, 0x0A, 0xE4, 0xC3, 0x50, 0xE0, 0x77, 0x0D, 0xAD, 0x58, 0xA5, 0x02, 0x90, 0xA0, 0x34, 0x60, 0x96, 0x78, 0x35, 0x05, 0xEB, 0xE5, 0xE4, 0x4D, 0x55, 0x2A, 0xD1, 0x9A, 0x74, 0xF4, 0x3D, 0x34, 0x48, 0xD5, 0xC7, 0x54, 0xF3, 0xF3, 0x48, 0x7B, 0xC0, 0x02, 0xFB, 0x08, 0x65, 0x6F, 0xE1, 0x0A, 0x85, 0xDE, 0x63, 0x53, 0x79, 0xD7, 0x3A, 0xCE, 0x50, 0xBC, 0x8C, 0x12, 0x14, 0xFF, 0x57, 0x36, 0x4F, 0x91, 0x13, 0xE7, 0xCE, 0x9E, 0x93, 0xB9, 0xA5, 0x77, 0x2D, 0xBB, 0x74, 0xD0
Ciphertext: 0x55, 0x6B, 0xDA, 0xDC, 0x75, 0x31, 0xEE, 0xE8, 0x88, 0xF6, 0xDE, 0x47, 0x8F, 0xB3, 0x74, 0x0F, 0xA2, 0xBD, 0x15, 0x22, 0x08, 0x76, 0x74, 0xF2, 0xC6, 0xE1, 0x64, 0xDC, 0x6F, 0xB6, 0x08, 0x7C, 0x41, 0x6B, 0xCC, 0x7C, 0x25, 0x29, 0x54, 0x78, 0x25, 0x9D, 0x4E, 0xBB, 0xEC, 0xFD, 0x42, 0xD3, 0x2B, 0x97, 0x23, 0x9E, 0x45, 0x91, 0x02, 0x68, 0x0A, 0x19, 0x79, 0x82, 0xAB, 0x3E, 0xD6, 0xD7, 0x32, 0xD2, 0xBC, 0x8A, 0x2E, 0x37, 0x35, 0x58, 0xB4, 0xC5, 0xE1, 0xC9, 0x12, 0x30, 0xB7, 0x76, 0xCB, 0x1F, 0x02, 0x60, 0x78, 0xBC, 0xA9, 0x10, 0x4C, 0xF2, 0x19, 0xBC, 0x96, 0x06, 0x5E, 0xEF, 0x44, 0xDA, 0x86, 0xA4, 0xA3, 0xAA, 0x99, 0xF2, 0xEC, 0xB9, 0xA6, 0x09, 0xD8, 0x5C, 0x6F, 0x4F, 0x19, 0x07, 0xB7, 0x1D, 0x49, 0xDF, 0x55, 0x2B, 0xD1, 0x43, 0x43, 0xB2, 0xC6, 0x79, 0x75, 0x19, 0x6A, 0x25, 0xD8, 0xA2, 0xAF, 0xDC, 0x96, 0xD3, 0x78, 0x9E, 0xEB, 0x38, 0x3F, 0x4D, 0x5C, 0xCE, 0x42, 0x02, 0x7A, 0xDB, 0xCD, 0xC3, 0x42, 0xA3, 0x41, 0xC0, 0x19, 0x45, 0xC0, 0xB3, 0x89, 0x95}}
Test: Encrypt
#
#
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0x1A, 0x4E, 0xE8, 0x2B, 0x1F, 0x37, 0x84, 0x94, 0x6D, 0xF2, 0xA1, 0x8F, 0xC7, 0x49, 0xB3, 0x4F, 0xE2, 0x26, 0xCF, 0x28, 0x11, 0xA6, 0x6A, 0x47, 0x22, 0x6E, 0x64, 0xA1, 0x82, 0x42, 0x45, 0x29
IV: 0xA8, 0xD4, 0xC6, 0x46, 0xB1, 0xD9, 0x93, 0x84, 0x48, 0x62, 0x4F, 0x8A, 0xC9, 0x6A, 0xD8, 0x4C
Plaintext: 0xA6, 0xAB, 0xCD, 0x81, 0x09, 0xB7, 0x4E, 0x58, 0xBB, 0x43, 0x03, 0x66, 0x44, 0xC6, 0x60, 0xE3
Ciphertext: 0x91, 0xEE, 0x72, 0xE8, 0xE2, 0x6F, 0xA4, 0x23, 0x49, 0x77, 0xE4, 0x64, 0xCA, 0x48, 0x72, 0xCA
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0x54, 0x43, 0x27, 0x17, 0x61, 0x62, 0x2E, 0x0F, 0x92, 0xC6, 0x62, 0x94, 0xDC, 0x9B, 0x0C, 0x5E, 0x6B, 0x6E, 0x53, 0x84, 0x43, 0x42, 0x02, 0x37, 0x27, 0xE0, 0x8C, 0xB0, 0xB9, 0x6E, 0x4E, 0x67
IV: 0xE4, 0x43, 0x13, 0x86, 0x77, 0xFA, 0xDD, 0x9D, 0x12, 0xC5, 0xE3, 0x97, 0x46, 0x04, 0xD6, 0xED
Plaintext: 0xF8, 0x17, 0x68, 0x19, 0x06, 0x70, 0x0F, 0x4E, 0x2E, 0xEC, 0x06, 0x66, 0x2B, 0x63, 0x96, 0x1C, 0x20, 0x7E, 0x93, 0x7B, 0x3A, 0xC8, 0x29, 0x96, 0x91, 0x08, 0xD9, 0x7A, 0x50, 0xCF, 0xBE, 0x61
Ciphertext: 0xE9, 0xD5, 0x2E, 0xE1, 0x8C, 0xFC, 0x74, 0xD8, 0x24, 0xB4, 0x02, 0x57, 0x66, 0x49, 0x92, 0x66, 0xF3, 0x2D, 0x9F, 0xCA, 0xFA, 0x46, 0x98, 0x9F, 0x51, 0x51, 0xC5, 0xE9, 0x70, 0x83, 0x86, 0x90
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0x16, 0x4D, 0x15, 0x28, 0x9C, 0x68, 0xFC, 0x03, 0x97, 0x10, 0x7A, 0x70, 0xE0, 0xCC, 0xC0, 0x69, 0xD2, 0x99, 0xAE, 0xDE, 0xF3, 0xF5, 0x99, 0x62, 0xD7, 0x37, 0x4C, 0x25, 0x42, 0x21, 0x4C, 0x22
IV: 0x8D, 0xB8, 0x61, 0x99, 0x4B, 0x53, 0x51, 0xC0, 0x2C, 0xF3, 0xEF, 0xB6, 0x21, 0xD2, 0x54, 0xB8
Plaintext: 0xC0, 0x3F, 0x6D, 0x97, 0xEB, 0xA8, 0xB6, 0x69, 0xAC, 0xF9, 0x44, 0x7F, 0x64, 0x25, 0x09, 0x98, 0x25, 0x01, 0x54, 0x54, 0x5C, 0x59, 0x97, 0xEC, 0xB3, 0x3E, 0x6D, 0x1F, 0x35, 0x9D, 0xDB, 0x70, 0xB3, 0x16, 0xD6, 0x8E, 0x67, 0x0A, 0x06, 0x14, 0xD8, 0xF6, 0xCA, 0x72, 0xFD, 0x00, 0x7C, 0x2B
Ciphertext: 0xE5, 0xCF, 0xFB, 0x9A, 0xF3, 0x5F, 0x2E, 0xF4, 0x09, 0x9A, 0x05, 0x87, 0xA3, 0x88, 0x51, 0xC3, 0x7E, 0xBE, 0xB3, 0xDD, 0x3F, 0x24, 0xA5, 0x8C, 0xF5, 0x52, 0x24, 0x65, 0xDE, 0x01, 0xC5, 0x98, 0x08, 0xC4, 0xE9, 0xEB, 0x40, 0xC1, 0x32, 0x19, 0xD6, 0x18, 0xC8, 0x4B, 0x33, 0x48, 0xDF, 0xA9
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0xA5, 0xD0, 0xF6, 0x42, 0x17, 0xA1, 0x55, 0xEE, 0xF5, 0x98, 0xFD, 0x95, 0x66, 0x54, 0xDD, 0xF8, 0x73, 0xC6, 0xF4, 0xAC, 0xB2, 0x43, 0x13, 0xC9, 0x22, 0xD7, 0xE5, 0xE6, 0x57, 0xDD, 0x2E, 0x44
IV: 0xD7, 0xCC, 0x50, 0x49, 0xC3, 0x54, 0x13, 0x30, 0xBA, 0xAA, 0xA5, 0x00, 0xFA, 0x20, 0xE0, 0xBA
Plaintext: 0xC8, 0xF8, 0xCC, 0xD7, 0x13, 0x7A, 0x65, 0xF1, 0x54, 0x44, 0x9E, 0xC1, 0xB8, 0xE2, 0xA5, 0x49, 0x81, 0x9E, 0x69, 0x52, 0xA9, 0x99, 0x5A, 0x19, 0xC9, 0x1B, 0x6F, 0x46, 0x3A, 0x28, 0x6E, 0x1D, 0x7A, 0x54, 0x68, 0xF8, 0xD1, 0xD8, 0x82, 0xF5, 0x34, 0xE4, 0xFC, 0xEC, 0x69, 0x37, 0x6B, 0xA4, 0x6C, 0xEE, 0x49, 0x46, 0x12, 0x99, 0xB0, 0x11, 0xEC, 0x94, 0x63, 0x50, 0x6E, 0x95, 0x0E, 0x89
Ciphertext: 0x32, 0xFC, 0x06, 0x46, 0xF1, 0x71, 0x1F, 0xD6, 0x83, 0x59, 0x7D, 0x18, 0xE9, 0xDE, 0x0D, 0x60, 0x9C, 0x42, 0xED, 0x3C, 0x71, 0xA5, 0x35, 0x43, 0x5E, 0x84, 0xE3, 0x43, 0x85, 0x78, 0x72, 0x5A, 0xB5, 0xED, 0x86, 0x5D, 0x4A, 0x87, 0xE1, 0xFC, 0xE8, 0xE1, 0x3B, 0x4C, 0x73, 0xB0, 0xE2, 0xE7, 0x2B, 0x83, 0xC6, 0x08, 0xED, 0xC0, 0x36, 0xB5, 0x64, 0x86, 0x78, 0x82, 0x8A, 0xA4, 0x56, 0x5D
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0x50, 0x81, 0xCF, 0xF8, 0x35, 0x84, 0xF4, 0x3B, 0x8B, 0x60, 0x07, 0x4F, 0xB2, 0x05, 0x08, 0xBB, 0x60, 0x63, 0xF9, 0x0B, 0x44, 0x7C, 0xA0, 0x80, 0xE9, 0xBD, 0x88, 0x06, 0xDE, 0x8E, 0x49, 0x66
IV: 0x14, 0x28, 0x09, 0xBD, 0x87, 0xA6, 0x43, 0x2D, 0x20, 0x5F, 0xC7, 0xD2, 0xDA, 0x74, 0x02, 0xF8
Plaintext: 0x25, 0xA5, 0x80, 0x8B, 0x88, 0x69, 0xAF, 0xCE, 0x89, 0x3D, 0xE6, 0x50, 0xD1, 0x3C, 0xA5, 0x1D, 0x8C, 0xF0, 0x1F, 0x31, 0x0F, 0x68, 0xF5, 0x32, 0xBD, 0x8A, 0x45, 0x5E, 0x2B, 0xAB, 0xE3, 0xC2, 0x82, 0x5D, 0xE6, 0xAC, 0x25, 0x88, 0x67, 0x64, 0x94, 0xBD, 0x85, 0x17, 0x91, 0xC6, 0xAC, 0x14, 0x81, 0x82, 0x18, 0x3B, 0x14, 0xF0, 0x94, 0xB1, 0x28, 0x89, 0x88, 0xD9, 0xEB, 0xD3, 0x32, 0x80, 0x40, 0x33, 0x34, 0x58, 0x65, 0x02, 0x4F, 0xA8, 0xD2, 0xE4, 0x6E, 0x41, 0x64, 0x55, 0xE6, 0xB4
Ciphertext: 0xEE, 0x57, 0xD3, 0x98, 0x7E, 0x62, 0xCF, 0x04, 0xBB, 0x11, 0x21, 0x91, 0x20, 0xB4, 0xA3, 0x92, 0x16, 0x86, 0xAF, 0xA1, 0x86, 0x9B, 0x8A, 0x4C, 0x43, 0x7F, 0xAF, 0xCC, 0x87, 0x99, 0x6A, 0x04, 0xC0, 0x06, 0xB0, 0xC0, 0x4D, 0xE4, 0x98, 0xB2, 0x4B, 0x24, 0x34, 0x87, 0x3D, 0x70, 0xDB, 0x57, 0xE3, 0x71, 0x8C, 0x09, 0x16, 0x9E, 0x56, 0xD0, 0x9A, 0xC4, 0xB7, 0x25, 0x40, 0xCC, 0xC3, 0xED, 0x6D, 0x23, 0x11, 0x29, 0x39, 0x8A, 0x71, 0x75, 0x0C, 0x8F, 0x0C, 0xE4, 0xE4, 0x2B, 0x93, 0x59
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0xBA, 0x85, 0xFC, 0xC2, 0xE0, 0x66, 0xA8, 0x14, 0x2A, 0x03, 0x98, 0x2D, 0x63, 0x13, 0x78, 0x9C, 0x27, 0xCE, 0x71, 0x76, 0x8E, 0xFF, 0xEF, 0x03, 0x0B, 0x5B, 0xA8, 0xB8, 0x93, 0x11, 0xDA, 0x65
IV: 0x01, 0xA2, 0xD3, 0xB0, 0xB9, 0xF3, 0xB7, 0xC2, 0x8B, 0xA1, 0x7E, 0x40, 0xDB, 0x94, 0x3C, 0x7D
Plaintext: 0xFF, 0xD7, 0xA5, 0xEE, 0xE9, 0xA6, 0xD0, 0xDE, 0x06, 0xC9, 0x3B, 0x62, 0x65, 0x21, 0x10, 0x90, 0x1C, 0x81, 0xA6, 0xEC, 0xE8, 0xBF, 0x4B, 0x23, 0x13, 0x0A, 0x41, 0xFC, 0x9B, 0x7D, 0x06, 0x8B, 0x90, 0xF5, 0xD8, 0xA8, 0xBE, 0x20, 0x79, 0x9F, 0x8C, 0xD7, 0x30, 0x29, 0x24, 0xAE, 0x10, 0x9B, 0xD4, 0xC9, 0x7C, 0x5E, 0xB4, 0xF1, 0xEB, 0x9F, 0x8A, 0xE6, 0xE9, 0x47, 0xEA, 0xF7, 0x5F, 0x2E, 0xA2, 0xD1, 0x13, 0x8B, 0x55, 0x95, 0x72, 0xB0, 0x65, 0x2D, 0x8E, 0xF4, 0x16, 0xDF, 0x63, 0xF0, 0xF1, 0x22, 0x5E, 0xEE, 0x67, 0xB1, 0x20, 0x9E, 0xB7, 0xDF, 0x7F, 0x0B, 0x12, 0x2A, 0xCD, 0xCE
Ciphertext: 0xCF, 0x3A, 0x57, 0xE7, 0xC3, 0xFB, 0x96, 0x0D, 0x47, 0x39, 0x0E, 0xDF, 0x47, 0x35, 0xF6, 0x06, 0xCF, 0x21, 0x1A, 0x3A, 0x67, 0x14, 0xE5, 0x0F, 0x2D, 0x5E, 0xA8, 0xFC, 0xC8, 0x7F, 0x89, 0x04, 0x3E, 0x93, 0x51, 0x14, 0xFF, 0x93, 0xAC, 0xD1, 0x97, 0x80, 0x03, 0x13, 0xA9, 0x1F, 0x3E, 0xDF, 0x28, 0x92, 0x43, 0x94, 0xDC, 0x59, 0x6D, 0x0D, 0x64, 0xA8, 0x63, 0x32, 0x38, 0xB6, 0xB3, 0x07, 0x7E, 0x36, 0x73, 0x50, 0xD8, 0xAB, 0x65, 0x79, 0x09, 0xEA, 0x6A, 0x90, 0x6F, 0x57, 0x55, 0x6B, 0x3C, 0x99, 0xC1, 0xF7, 0x96, 0x48, 0x85, 0x60, 0x1C, 0xF4, 0xAF, 0x4F, 0x5F, 0xEB, 0x64, 0x79
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0xFC, 0x12, 0x5D, 0x81, 0xF5, 0x2C, 0x44, 0x77, 0x59, 0x72, 0x5D, 0xAA, 0x85, 0xDD, 0x90, 0xF5, 0x3B, 0x36, 0x53, 0x84, 0x48, 0x29, 0x70, 0x88, 0x63, 0x9B, 0x09, 0x2F, 0x59, 0x3D, 0xDA, 0xD3
IV: 0x67, 0x61, 0xBF, 0x72, 0xE7, 0x0D, 0x76, 0x5E, 0x30, 0x4E, 0xA5, 0x35, 0xB7, 0xCF, 0x1F, 0x14
Plaintext: 0x7A, 0xAA, 0x63, 0x08, 0x9E, 0x7E, 0x66, 0xC5, 0x56, 0xC2, 0x92, 0x9B, 0x08, 0x59, 0x0E, 0xA5, 0xAB, 0x66, 0x40, 0x44, 0x74, 0x61, 0x90, 0xCB, 0xB1, 0x6B, 0x6F, 0x7C, 0xF5, 0xDE, 0x98, 0xB4, 0x75, 0x29, 0x96, 0x62, 0xB2, 0xDB, 0x87, 0xBD, 0x58, 0xFD, 0x1F, 0x37, 0x66, 0xA5, 0xF0, 0xAC, 0x90, 0xC8, 0xE8, 0xE0, 0xE2, 0x50, 0x1B, 0x28, 0xA5, 0x6E, 0xC2, 0x67, 0x86, 0x32, 0x84, 0x3C, 0xF5, 0x59, 0xF5, 0x7A, 0xCC, 0x66, 0x5D, 0xD9, 0x31, 0xF4, 0xBA, 0xEB, 0xBD, 0x4A, 0x08, 0x51, 0xDE, 0x30, 0xBF, 0x2E, 0x79, 0x01, 0x9E, 0xDC, 0xD4, 0x02, 0xA7, 0xDE, 0xB4, 0xF2, 0x6B, 0x16, 0xC2, 0xE2, 0x87, 0x38, 0x33, 0x47, 0x6F, 0x7F, 0xA8, 0x4E, 0x6A, 0x9F, 0x53, 0x6F, 0xDE, 0xFA
Ciphertext: 0xFA, 0x65, 0xC8, 0x62, 0x66, 0xA2, 0xAC, 0x16, 0x99, 0x95, 0x43, 0x3D, 0x7E, 0xA3, 0xAF, 0x9A, 0x9D, 0x24, 0x7E, 0x5E, 0x0D, 0x3B, 0xB9, 0x81, 0x64, 0x9E, 0x15, 0x3C, 0xBE, 0xB8, 0x04, 0x4F, 0xE6, 0x51, 0xD5, 0xE2, 0x48, 0x7F, 0x01, 0x7E, 0x52, 0x32, 0xB7, 0x1B, 0xD1, 0x45, 0x70, 0x12, 0xEE, 0xA1, 0x40, 0x87, 0x8C, 0x0A, 0x0C, 0xEE, 0x68, 0xF6, 0xD0, 0x2A, 0x87, 0x00, 0xDC, 0x61, 0x3E, 0x2F, 0x1C, 0x04, 0x97, 0x94, 0x9A, 0xBF, 0xE7, 0x8B, 0x30, 0xB4, 0x48, 0x55, 0x52, 0xE2, 0x89, 0xBA, 0x21, 0x67, 0x3F, 0x5A, 0xCB, 0x87, 0x93, 0xCC, 0xE6, 0x5A, 0xE3, 0xC6, 0xCC, 0x46, 0x8D, 0xDE, 0x4E, 0xA5, 0x2E, 0x00, 0xE6, 0x0A, 0x06, 0xCF, 0x95, 0xE5, 0x4D, 0xD1, 0x09, 0x66
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0x5C, 0x45, 0xCE, 0x16, 0x83, 0x9D, 0xA1, 0x4F, 0x06, 0xCD, 0x25, 0xC9, 0xC5, 0x47, 0xD3, 0xA9, 0xA4, 0x6D, 0x55, 0x85, 0x31, 0xA7, 0x45, 0x18, 0x87, 0xB3, 0x38, 0x3B, 0x72, 0x3D, 0xFB, 0x11
IV: 0xD3, 0xB0, 0x1C, 0x81, 0x46, 0x4B, 0xAC, 0xE9, 0x03, 0x77, 0x44, 0x10, 0x02, 0x58, 0x46, 0x5D
Plaintext: 0x63, 0xA2, 0x65, 0x47, 0x0C, 0xAE, 0x68, 0x0D, 0x94, 0xCD, 0x2A, 0xA7, 0x60, 0xDC, 0xE6, 0xFC, 0x0B, 0x18, 0xB1, 0x55, 0x0B, 0x34, 0x48, 0x12, 0x92, 0xA9, 0x0C, 0x9C, 0xB3, 0x4E, 0x4B, 0x9A, 0xC6, 0x28, 0xC1, 0x68, 0x0D, 0x83, 0x5F, 0xC4, 0x98, 0x41, 0x4B, 0xCB, 0x65, 0x73, 0x27, 0x25, 0xCC, 0x26, 0x96, 0x7C, 0x1A, 0x7F, 0xFC, 0x32, 0x7D, 0x0B, 0x86, 0x53, 0x20, 0x50, 0x6B, 0xC8, 0x96, 0xA8, 0x71, 0xCE, 0x7C, 0x4F, 0xB2, 0xA7, 0x5A, 0xBA, 0xA0, 0x8F, 0xCB, 0x2A, 0x47, 0xF2, 0xDE, 0x82, 0xD2, 0xDC, 0xBB, 0x55, 0x51, 0xB1, 0x8A, 0x44, 0xB9, 0x1E, 0x90, 0x87, 0x2C, 0x4F, 0x9B, 0xC9, 0x7B, 0x63, 0xA1, 0x39, 0xEA, 0x1D, 0xA4, 0xDE, 0x33, 0xDC, 0xD8, 0x2A, 0xCD, 0xCD, 0x08, 0xD3, 0x6D, 0x5F, 0x36, 0xDE, 0xCE, 0xF7, 0x82, 0xFD, 0xAE, 0xE6, 0x4D, 0x1A, 0x19, 0x98
Ciphertext: 0x33, 0xAA, 0x7E, 0x19, 0xFE, 0x25, 0xAD, 0xA5, 0x67, 0xB5, 0xC9, 0xE2, 0x9E, 0x81, 0x5E, 0xC9, 0x80, 0xF0, 0xFF, 0x9A, 0x7D, 0xE2, 0x97, 0xDF, 0x6E, 0x93, 0x84, 0x36, 0x72, 0x54, 0x64, 0x20, 0x5C, 0x4F, 0x62, 0x60, 0x13, 0xF0, 0x9E, 0x14, 0xAC, 0x3A, 0x6E, 0x08, 0x20, 0x27, 0x71, 0xFF, 0xAB, 0x05, 0x15, 0x74, 0xF6, 0x2E, 0x9B, 0x4C, 0xAF, 0x10, 0x8C, 0xC6, 0x18, 0x88, 0x82, 0x08, 0x60, 0xC6, 0x34, 0x33, 0xA2, 0xD8, 0xB4, 0xEF, 0x0E, 0xD7, 0xA4, 0xFF, 0x5E, 0x81, 0x09, 0x82, 0x02, 0x87, 0x67, 0x3A, 0x3F, 0x43, 0x37, 0x1D, 0x4C, 0x3A, 0xD7, 0x4C, 0x98, 0xD4, 0x94, 0xDE, 0xEC, 0xBB, 0x9F, 0xBB, 0x99, 0x5A, 0x41, 0x14, 0x1E, 0x3A, 0x96, 0xD6, 0x12, 0x9E, 0x0E, 0x04, 0xDC, 0xB9, 0x0C, 0x4F, 0x63, 0xEA, 0x0F, 0xFF, 0xE3, 0xD8, 0xE3, 0x77, 0xD9, 0xF3, 0xC7, 0x63
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0x9D, 0x34, 0xE9, 0x0D, 0xC3, 0x6A, 0x8E, 0x8D, 0x3C, 0x55, 0x0B, 0x98, 0xD6, 0x9B, 0x41, 0x1D, 0x13, 0xC1, 0x70, 0xEC, 0xD2, 0x41, 0xFB, 0x6C, 0x2C, 0xDD, 0x6B, 0x91, 0x9D, 0x32, 0xB7, 0x09
IV: 0x64, 0x90, 0xC3, 0xB6, 0x2C, 0x09, 0x26, 0x61, 0xEB, 0xC8, 0x30, 0xAD, 0x0B, 0xA5, 0x2C, 0x49
Plaintext: 0xC8, 0xF6, 0xE2, 0x6A, 0xD9, 0xA7, 0x60, 0x79, 0x52, 0x8D, 0xFA, 0x08, 0xC9, 0xF7, 0x90, 0x0B, 0xB7, 0x86, 0x0F, 0x45, 0x22, 0x3F, 0x3A, 0x00, 0x79, 0xDF, 0xAB, 0x01, 0xC0, 0x6E, 0x14, 0xBB, 0xEC, 0x17, 0xCB, 0xC3, 0x91, 0x37, 0x86, 0x84, 0xBA, 0xB4, 0x63, 0x34, 0x18, 0x90, 0x2B, 0x07, 0x60, 0xBE, 0xD7, 0xA2, 0xEE, 0x34, 0x53, 0xD2, 0xAE, 0x41, 0x83, 0x7E, 0x3C, 0x21, 0x84, 0xDA, 0x4A, 0xCF, 0x34, 0xDE, 0x43, 0x1A, 0xF4, 0xF7, 0x2D, 0xFB, 0xAC, 0xFC, 0xD4, 0x26, 0x10, 0x63, 0x25, 0xDF, 0x22, 0xB5, 0xD8, 0x0F, 0xF8, 0x3F, 0x52, 0x97, 0xC0, 0x0B, 0xC9, 0xE4, 0x01, 0x0E, 0xA9, 0xC3, 0x24, 0xA3, 0x36, 0x77, 0x32, 0x38, 0x73, 0x0A, 0xDF, 0x47, 0x43, 0xE0, 0xC8, 0x89, 0xCF, 0x92, 0xF9, 0x66, 0x27, 0xF9, 0xB2, 0xAF, 0x2C, 0x88, 0x6B, 0x8F, 0xAD, 0xDF, 0x15, 0xBF, 0xD0, 0x9E, 0xA3, 0xFA, 0xB4, 0x77, 0xC9, 0xB1, 0x54, 0x88, 0x03, 0xFF, 0xAF, 0xE7, 0xDA, 0xDF
Ciphertext: 0x2F, 0xD9, 0xBE, 0x44, 0xEB, 0x6D, 0x21, 0xEA, 0x50, 0xB9, 0x15, 0x33, 0xF4, 0xFD, 0xD3, 0x40, 0x43, 0xB2, 0xA7, 0x55, 0xD8, 0x82, 0x4F, 0x3E, 0xC4, 0xB0, 0x88, 0x23, 0xBC, 0xBD, 0x20, 0xE3, 0x22, 0x4F, 0xC0, 0xD9, 0x90, 0xBA, 0xE3, 0x09, 0xF7, 0xB8, 0x87, 0xF5, 0xAE, 0x60, 0x6A, 0xF5, 0x97, 0x54, 0x79, 0x39, 0x0D, 0xFE, 0xAD, 0x5F, 0xA8, 0x64, 0xE8, 0xC8, 0x5C, 0x41, 0x2F, 0x85, 0x41, 0x2D, 0xFB, 0xEC, 0xA2, 0x9E, 0x4D, 0x3F, 0xD9, 0x1D, 0xF2, 0x69, 0x33, 0x48, 0xCB, 0x0F, 0xD2, 0x81, 0x19, 0x4D, 0x3A, 0xF5, 0x1F, 0x07, 0xD5, 0xB1, 0x58, 0x34, 0x91, 0x1D, 0x5B, 0xCA, 0x01, 0x1C, 0x0B, 0xE1, 0x77, 0x5F, 0xD7, 0xD1, 0xF7, 0x84, 0xF6, 0xF7, 0xE7, 0xE4, 0xEF, 0x3C, 0x55, 0x68, 0xF0, 0x9F, 0xB2, 0x94, 0x2B, 0x8E, 0xB9, 0x73, 0x80, 0xA2, 0x50, 0xA4, 0x5A, 0xF7, 0x68, 0x22, 0x4F, 0xF5, 0x0D, 0x80, 0x05, 0xFB, 0x92, 0xAC, 0xC7, 0x25, 0x62, 0xB9, 0x3C, 0x10
Test: Encrypt
#
Source: LEA reference test vectors, file lea_vs.c
Comment: LEA-128/CBC, 256-bit key
Key: 0x26, 0x7E, 0x63, 0x9D, 0x25, 0x19, 0x08, 0x8A, 0x05, 0xBD, 0x8A, 0xF4, 0x31, 0x3C, 0x47, 0x55, 0x88, 0x06, 0xB9, 0xCB, 0x03, 0x42, 0x40, 0xC8, 0x98, 0x1D, 0x21, 0x0B, 0x5E, 0x62, 0xCE, 0xCF
IV: 0xF1, 0x4C, 0x68, 0x42, 0x18, 0x98, 0x82, 0x38, 0xA5, 0xDD, 0x28, 0x21, 0x9D, 0x20, 0x1F, 0x38
Plaintext: 0x99, 0xA3, 0x6F, 0xFE, 0x6C, 0xFF, 0x1F, 0xE7, 0x06, 0x72, 0x40, 0x53, 0x99, 0x7A, 0x2D, 0xBF, 0xFA, 0xA3, 0x10, 0x3D, 0x49, 0x9D, 0xA8, 0x21, 0xD4, 0x91, 0x4A, 0xFE, 0x39, 0xB5, 0x26, 0xD1, 0xCB, 0x1F, 0xCC, 0x7B, 0x37, 0xD7, 0xEF, 0x75, 0x68, 0x2F, 0x68, 0xBF, 0xA7, 0x57, 0x7D, 0x19, 0x07, 0x2C, 0x64, 0x76, 0x00, 0x51, 0x03, 0xAE, 0x5A, 0x81, 0xFA, 0x73, 0x4C, 0x23, 0xE3, 0x86, 0xE6, 0x1F, 0xD8, 0x2A, 0xAC, 0xF1, 0x36, 0xDA, 0x84, 0xFC, 0xA1, 0x37, 0xD2, 0x20, 0x49, 0x44, 0xE1, 0x8E, 0x6B, 0xD5, 0x85, 0xDB, 0x1A, 0x45, 0xFE, 0x54, 0x3F, 0x68, 0x20, 0x92, 0xDF, 0xC0, 0xB1, 0x4E, 0x9C, 0xF4, 0x13, 0x76, 0x7F, 0x7D, 0x22, 0x7F, 0xF4, 0xA3, 0x60, 0xFE, 0x16, 0xA8, 0x50, 0x72, 0x2D, 0x43, 0x1F, 0x64, 0x75, 0x50, 0x89, 0xB3, 0x22, 0xC5, 0xFB, 0x29, 0xA0, 0xE8, 0xF5, 0x51, 0x1F, 0xBF, 0xB3, 0x8D, 0x4F, 0xC8, 0x0C, 0x63, 0x68, 0xEB, 0x9A, 0x18, 0x6E, 0xAD, 0x1B, 0x80, 0xB3, 0xA6, 0x17, 0x14, 0x9D, 0x35, 0xC4, 0x45, 0xA9, 0x72, 0x26, 0x10, 0xB0, 0x64
Ciphertext: 0xB5, 0x35, 0x2D, 0x1B, 0x32, 0x1D, 0x11, 0x00, 0x7A, 0x50, 0xAA, 0x50, 0x0B, 0x7D, 0x7D, 0xD4, 0x3C, 0x59, 0x89, 0xBF, 0x12, 0xE7, 0x20, 0x9D, 0x96, 0xE4, 0xE3, 0x04, 0xC7, 0x2A, 0x53, 0x44, 0xE4, 0x39, 0x1E, 0xD4, 0x25, 0x89, 0x2C, 0x6A, 0xD4, 0x05, 0xDA, 0x1D, 0x0A, 0xCE, 0xCC, 0x67, 0x7B, 0x80, 0x76, 0xF3, 0x28, 0x0C, 0xB7, 0x85, 0xB1, 0x18, 0x07, 0x7B, 0x78, 0xBE, 0x2D, 0xEC, 0xBE, 0xF6, 0x77, 0x22, 0x74, 0x22, 0xC1, 0x88, 0x00, 0xEF, 0x25, 0xAF, 0x03, 0xCD, 0x69, 0x3C, 0xC1, 0x31, 0x17, 0xAB, 0x92, 0x5C, 0xF7, 0xC3, 0x90, 0x0B, 0xFA, 0xDF, 0xF7, 0xDF, 0x0A, 0x6E, 0x1E, 0x82, 0x39, 0x16, 0x35, 0x3B, 0xA6, 0x2B, 0x96, 0x8D, 0x9D, 0xD3, 0xAA, 0x56, 0xAE, 0x7A, 0xBA, 0x4B, 0xCB, 0x46, 0x8E, 0xAF, 0x37, 0x04, 0xCC, 0x06, 0x21, 0x72, 0x52, 0x0E, 0x94, 0x6F, 0x9B, 0x6C, 0x0C, 0x18, 0x01, 0x97, 0x6D, 0x31, 0x85, 0xB6, 0xBD, 0xFD, 0x50, 0x4D, 0x99, 0x2B, 0x74, 0x23, 0x57, 0x80, 0x15, 0x3F, 0x69, 0xA5, 0xF3, 0x2C, 0xCF, 0xF1, 0x1E, 0xC7, 0xE0, 0x04
Test: Encrypt

File diff suppressed because it is too large Load Diff

View File

@ -65,6 +65,139 @@ Seek: 192
Ciphertext: BB5B6BB2CC8B8A0222DCCC1753ED4AEB23377ACCBD5D4C0B69A8A03BB115EF71871BC10559080ACA7C68F0DEF32A80DDBAF497259BB76A3853A7183B51CC4B9F
Test: Encrypt
#############################################################################
# These test vectors were created using ECRYPT Salsa20.c
# We modified the ref impl to seek to just before crossing the 32-bit block
# counter boundary, and then we generated 16 blocks (1024 bytes). The large
# number of blocks is due to parallel processing of data in SIMD units.
AlgorithmType: SymmetricCipher
Name: Salsa20
Source: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/ref/
#
Comment: Counter crosses 32-bit boundary (0xffffffff*64)
Key: r32 00
IV: r8 00
Rounds: 20
Seek64: 0x3fffffffc0
Plaintext: r1024 00
Ciphertext: \
59FC4DD73F4B7B28CE1B0EF562BAB604824076898A800797B59902A99F312254 \
5231E85B887FFA19F71F24AAF352DC6AFE47281D8F546C9D419194479A369392 \
B65FC777C4F950EC0274FF0FFBB0A6E3EDEDF78477E94945E87F26E3162BF6A1 \
050933421833F249DA1162DB6E92A7678505190C80DC46350B81E831F974B28C \
13A4A90B48300DEB77CDFC5378E32B30E9DD3DDA3B8B090AB4D87EF9C7C2D197 \
6B21DB54289C482083B82083E45E874A54308CE43EC450FAD96A5AEE5D383736 \
542EF270B565257B286F3206D1B52A9A869D0F468DB5527630F2A6CE97625A2C \
A2981C12026168A88B88A7D6461F1896E459A9BA831CECE0B0DCE57BE99E9C84 \
DB5ABE2B64A1581BC10F769E329179DA30F4B4FC919E0766D089D04785EF0435 \
B408E1226F6CFED789CA5C3B9C74E930E07D1153163F4C62062D446602BD3FE7 \
208E7EBB8EF4D00139FF2D12F683B6857D59ECD88511A53A85742D4775C17606 \
D762B03B75BC6C7E479E47851AF596BC2E245B8B5627318F8BAF8C3BD6BDD1D4 \
03AA566FFBF79A28B28620D5A4BB4119D2AD0348098246099BD3301891770B56 \
4F284CF7A7D845BC3339002F02DCFE5C8FA625C28EFA509DA1421E4A35D784E4 \
59BA140F78E5A775B4EE23DF036CF10EB4672081E11EC5ACAC57338A38F5F5D6 \
1858736BC11898E0AE6CB1F6240FE6C2D9695F99A66EFC08BAB06F1BEE38C218 \
62DDE7156E9D384F3C4A2E095BF41D22B189EDF545482A9810069D647217B5CF \
E7743ABCAD72B8CF93B28164D01CAB144C40E79723D942F692392FDDAA367AFF \
B75A171AD4E81DD0320434B93B3AD34333B7670146B60E73C5012CF7DE82F2B6 \
5684D7BCE0C0DE9349AF87864B2328B1ACC053D8BC2E3476B052B14126C5ED4C \
ABFF00F449DCFCD5659ACD10B74C15A7C85B1445D0965CBD1A383FD0C5B44289 \
3E8B30D1B450B12C3FE05132E906BDFBB2A096313949B6A0B944E909FBB17D3F \
45F072F1D1E361F5AC8A785335DBC8E322595F2E0B5457E4BC780780BD18560F \
2C6C60802D2C1D3625508461FB67143C38C981A27F91F73999091F27E24A0371 \
06872E84B33605572552F46B381D56E07AB785F689905AF33DD3BCC6CEB0FD41 \
754552FA59C555B16500DB4D9C81DD933201A2B0E60F3E477D08ECBAD7DBD44D \
BA7F2A3299D6DF3AE4AE198E5F2AFC78DDDF3E87180ED1CE031D91595DDCF411 \
36FA9031ACDDDB3E219C500770E6D98E6B2FC5FFDF85B798368A9211FCEC807D \
9CECD894A4A47D55E5ECBE994809DBB6C8F8A3B797F811B32AFB611EAFFCD153 \
AD240BCE0FA95B2756CC14056870AAD283F6D15408DB26F1FC9A961356D38335 \
DDCEE60FEE213A6872BE4C897F5F276B0C13410CD3FEAA72CD32DD55BED76D7B \
26E821965EBC3A93AF8984490721B08EA797F0FCCCBA9144BB77A6910CAD0450
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffffe*64)
Key: r32 00
IV: r8 00
Rounds: 20
Seek64: 0x3fffffff80
Plaintext: r1024 00
Ciphertext: \
4EA79D03BB6DAB09FB849BDDF6534E8465015F966CB46DD891ECA04B997570E4 \
4E2A9A72DC128CB98865CA9C64319484070D4F85E5B13524B5480B453877869B \
59FC4DD73F4B7B28CE1B0EF562BAB604824076898A800797B59902A99F312254 \
5231E85B887FFA19F71F24AAF352DC6AFE47281D8F546C9D419194479A369392 \
B65FC777C4F950EC0274FF0FFBB0A6E3EDEDF78477E94945E87F26E3162BF6A1 \
050933421833F249DA1162DB6E92A7678505190C80DC46350B81E831F974B28C \
13A4A90B48300DEB77CDFC5378E32B30E9DD3DDA3B8B090AB4D87EF9C7C2D197 \
6B21DB54289C482083B82083E45E874A54308CE43EC450FAD96A5AEE5D383736 \
542EF270B565257B286F3206D1B52A9A869D0F468DB5527630F2A6CE97625A2C \
A2981C12026168A88B88A7D6461F1896E459A9BA831CECE0B0DCE57BE99E9C84 \
DB5ABE2B64A1581BC10F769E329179DA30F4B4FC919E0766D089D04785EF0435 \
B408E1226F6CFED789CA5C3B9C74E930E07D1153163F4C62062D446602BD3FE7 \
208E7EBB8EF4D00139FF2D12F683B6857D59ECD88511A53A85742D4775C17606 \
D762B03B75BC6C7E479E47851AF596BC2E245B8B5627318F8BAF8C3BD6BDD1D4 \
03AA566FFBF79A28B28620D5A4BB4119D2AD0348098246099BD3301891770B56 \
4F284CF7A7D845BC3339002F02DCFE5C8FA625C28EFA509DA1421E4A35D784E4 \
59BA140F78E5A775B4EE23DF036CF10EB4672081E11EC5ACAC57338A38F5F5D6 \
1858736BC11898E0AE6CB1F6240FE6C2D9695F99A66EFC08BAB06F1BEE38C218 \
62DDE7156E9D384F3C4A2E095BF41D22B189EDF545482A9810069D647217B5CF \
E7743ABCAD72B8CF93B28164D01CAB144C40E79723D942F692392FDDAA367AFF \
B75A171AD4E81DD0320434B93B3AD34333B7670146B60E73C5012CF7DE82F2B6 \
5684D7BCE0C0DE9349AF87864B2328B1ACC053D8BC2E3476B052B14126C5ED4C \
ABFF00F449DCFCD5659ACD10B74C15A7C85B1445D0965CBD1A383FD0C5B44289 \
3E8B30D1B450B12C3FE05132E906BDFBB2A096313949B6A0B944E909FBB17D3F \
45F072F1D1E361F5AC8A785335DBC8E322595F2E0B5457E4BC780780BD18560F \
2C6C60802D2C1D3625508461FB67143C38C981A27F91F73999091F27E24A0371 \
06872E84B33605572552F46B381D56E07AB785F689905AF33DD3BCC6CEB0FD41 \
754552FA59C555B16500DB4D9C81DD933201A2B0E60F3E477D08ECBAD7DBD44D \
BA7F2A3299D6DF3AE4AE198E5F2AFC78DDDF3E87180ED1CE031D91595DDCF411 \
36FA9031ACDDDB3E219C500770E6D98E6B2FC5FFDF85B798368A9211FCEC807D \
9CECD894A4A47D55E5ECBE994809DBB6C8F8A3B797F811B32AFB611EAFFCD153 \
AD240BCE0FA95B2756CC14056870AAD283F6D15408DB26F1FC9A961356D38335
Test: Encrypt
#
Comment: Counter crosses 32-bit boundary (0xfffffff2*64)
Key: r32 00
IV: r8 00
Rounds: 20
Seek64: 0x3ffffffc80
Plaintext: r1024 00
Ciphertext: \
DA196754A8E7E3816F1125E5869FB10D138C07A07B9C0C10B1EF6D8408B59DB1 \
8D25812F19AF0E1C1BA020AE4B1C19022776CE998E6B9ECDA6E2D8B946ECF987 \
A448A793D6AF0FA41ED1B31F574A0CD55FC2352D53F6CC5F04C2765DD94A858F \
49E649770E5BDF470CFC879C05B0C2BA3BDFE040EA258DEDF8C047A6564723ED \
60245A40CD404492B2F23717852DB15CCCCC4DFA01E20F6C2D22A4A0BCAD6429 \
4ABBD2F829F023EC8A9110DEFCBD6252B3D81D2BFAA18D222DBDCE519CC6ED49 \
9DF23E480EA415B5B1DF880697B7A7BB76E95BA1C71F36C8489B89D791EF9DC7 \
AF25F0DD23179CC473462FF4B7166A3267F7E538FDA9BEC0E894EF420ACEB25C \
2BCCB1BB4E3E72FF7575EC76D2F9EEFE2B4A22ABFEA5E27F9BC958467D151544 \
C485888676ED238BCD536F579F5451BECE583181DB529488A8F44916842178B6 \
E8D83460F152D9F6D995B4DC5D8FF48DBD66DD46863D1C9EE068E6903C737AAA \
D33A82F3B349897AC9B97F705F7B431A6438B0D2336CCBAE9A00C03A9086A5E8 \
F559134C4337D27A600445FBA2FEAB937483680E0327FAFEFF8F1CD02EF7A7AC \
2E76748F04203A7AD1F3263CA1B17E244CF0BBDAC799BC4E822658427150242A \
FFC1F8BE91475CC5F02CA6E2488CE0913FC191A8F1E49403C783CA06B1DE7DBF \
B25C4E6CB6932DD0CC6F9BC748BDD85EC80EFF37B50432EFFDEDCF7ED4D43673 \
0BCB581D4C0A9CD46F10D05C254902CC1896006FC3B65D1EEB2E333CB808B45F \
F0F51FD264937F74FBA7EC21C1FD347F78220CFC50AA03BEA9A0EEC62D3D833D \
3048618A5983B6191948921EEC72F0C52DC1621F2B7E82AB9940948374014B33 \
8EF906C38A13A5ED3B392777EA1CBDFE50605F995CABE83C2157B48AA273710C \
908F37E7C4A76DDF87DE31A0209323487A1A122582C24CC2D283B32AE96AD0DB \
0C12D2332B36FB54DDB6A9FA776F6A2F38BB0456CD29D208EE19BFD1D0F787B5 \
FBFC3CD1EC25BBE32258C0373E3738F613B4867AB4CE042BFF8D0FC44857E664 \
54E29790B9D72780D0089C06B5C0F12868797F9918F7C0C347AFFED02DAD9AA5 \
4EA79D03BB6DAB09FB849BDDF6534E8465015F966CB46DD891ECA04B997570E4 \
4E2A9A72DC128CB98865CA9C64319484070D4F85E5B13524B5480B453877869B \
59FC4DD73F4B7B28CE1B0EF562BAB604824076898A800797B59902A99F312254 \
5231E85B887FFA19F71F24AAF352DC6AFE47281D8F546C9D419194479A369392 \
B65FC777C4F950EC0274FF0FFBB0A6E3EDEDF78477E94945E87F26E3162BF6A1 \
050933421833F249DA1162DB6E92A7678505190C80DC46350B81E831F974B28C \
13A4A90B48300DEB77CDFC5378E32B30E9DD3DDA3B8B090AB4D87EF9C7C2D197 \
6B21DB54289C482083B82083E45E874A54308CE43EC450FAD96A5AEE5D383736
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: XSalsa20
Source: created by Wei Dai using naclcrypto-20090308

View File

@ -0,0 +1,317 @@
AlgorithmType: SymmetricCipher
Name: SIMECK-32/ECB
#
Source: SIMECK test vector
Comment: SIMECK-32/ECB, 64-bit key
Key: 1918 1110 0908 0100
Plaintext: 6565 6877
Ciphertext: 770d 2c76
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 3d6c 4ae1 6784 18be
Plaintext: 4823 0029
Ciphertext: 6535 9de9
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 6df1 1649 5f90 6952
Plaintext: 72ae 2cd6
Ciphertext: 0ab0 73ca
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 2ea6 0bb3 01eb 26e9
Plaintext: 41bb 5af1
Ciphertext: 6ed0 bc2e
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 0099 0f3e 390c 7e87
Plaintext: 153c 12db
Ciphertext: 7637 4119
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 4db7 4d06 491c 440d
Plaintext: 305e 0124
Ciphertext: 8252 aa91
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 4dc8 074d 2d12 39b3
Plaintext: 54de 1547
Ciphertext: e288 e7ea
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 5d03 701f 26a6 428b
Plaintext: 66bb 6443
Ciphertext: b730 99ae
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 1e1f 3b25 1238 4509
Plaintext: 767d 7a5a
Ciphertext: 058a 62df
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-32/ECB, 64-bit key
Key: 7ff5 7f96 6bfc 63cb
Plaintext: 1ad4 6e5d
Ciphertext: 60c4 43f2
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: SIMECK-32/CTR
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: 454D6DFB E3006317
IV: 94B0A755
Plaintext: 3D249C64 7F8BBFFC 875E70E0 A9859626 6E3B7C01 0BE82C43 6A7A3624 55487CD9 66858665 EFA6C05C 96CFACBD B0D37578
Ciphertext: F4533FF5 74659BB0 2ECADB3F 8FF6BB87 3C193D5F 63AC840C 3A844701 7D50D51B 6818F59D 3D87CAE4 A63B8CE2 DAE80C56
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: ACC7C073 CD410D18
IV: B66742BE
Plaintext: 7B5BAAF2 D13A41AE E146BFEA A00F3032 086F56FB F85C3917 571B41D9 1F2C3B9E 0E9BEB3F 631DCBAB A0ECE6B7 751C2884
Ciphertext: BA3429C8 BA44FDC5 123A1191 4EE3E44A A644DB17 4390B079 97342989 CEDE461F DC5E2885 00A55A45 DB875F37 537DF372
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: 25AD7CCF D13FC20B
IV: 7BFCFF1D
Plaintext: B14E2879 95CFC795 50230736 956FBD15 A5AF5134 3496E3B7 ED82F016 158FD754 679B7BF9 D43379BF 9613783B 695341DA
Ciphertext: 2D63B5A2 8A371B1E 8A10D1DC A1C0B15B 16401077 1871358A A97624A9 3C6121EE 13AF4F0C 8B09E6B4 B2CB0B09 B84BD827
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: 176F8071 C245E3A5
IV: 3201EDC5
Plaintext: 9CA6EE4C 23732374 4BE61C83 10804C20 8DCDED53 85B7AA86 B5881F73 D80A8FCE 77E02A3C 028711F8 F4C902A8 B7CC3804
Ciphertext: 5A98E287 3479F1EC 96F68777 25FC0804 D8FB53BE 4BCDE9C7 AE17DE00 31106C20 18C75DB3 CEBF10A5 FCB5C50A C911B844
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: A3DC9A6E B905B998
IV: DC8785AA
Plaintext: D5E32BAE 12E97583 BFCB8813 B780AC4D E82E1823 0EBB7391 EE78D254 4EDFAE3B A46B2666 57BA4A0A 7CE1BF19 03AD2420
Ciphertext: 8F2F68DE 17F43639 22A49A09 6DF3EAFF 6D536F06 B5C5FC45 F3605347 B5E62E03 8BEBCF43 507EF8D0 8A0CCF11 7E97A2EB
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: 9F6CD0D0 394CA176
IV: C2D22BC1
Plaintext: CAC79890 B6A7C6C1 A5CF6ED6 A04205FC CE2B9AB9 55F2ADC5 D3212FFE 80D57778 74F934E2 6BD2BD15 053BC32D E56B297D
Ciphertext: D34796DD 4F21DA51 0EC90D0E AB3D7166 AD6CC217 FF7E1D52 3D165331 B742C3C2 6303E6B7 D5335015 F2A65CD1 A2069533
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: 72529FE3 6D38A7A2
IV: 08BE1944
Plaintext: 28EEE9F6 534077DE E86E4B09 D438D7AB 903CD574 1F139D08 7D7C5638 79C0A1EA 3A7D8F9B 37B207D2 62B62F7B F71BDE68
Ciphertext: 97647E73 D5EDEAB9 C3B45EDF 35B9C03B 4815C5EE 9E941FF3 EF2BDAA9 7CF984F1 DF3442D0 8E8F9F57 EC4CF4FC 8CA76D99
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: F2E2DB05 59DA448A
IV: 8BCD257F
Plaintext: 9245E0A7 09C2F1FC 0401B9EE 877F6B05 F87D8C82 A5FEA18F 425B8D6D B4AC4E8C 0EFC4FF1 FDFA95E6 24EE87BC C154F0D1
Ciphertext: 33DA4B15 F7778355 5CF86EAF 23618EAC 4C8F95CD 3EE992A6 86AFBB76 104ECA85 1C83FA51 C0A2FD3A 00120437 9E50300B
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: 431F2171 797815BB
IV: 7EFDF0EC
Plaintext: 556149DD 54E5CE05 7113CC87 2645922D 54F21A91 A887A351 25A99554 D29CA58E AC85A62A 498284A9 0FD2710B 47CE9397
Ciphertext: 035EA886 B516D83A A37A72B4 1FB140B4 36630971 E4668E29 531BE247 EF8B6359 22207189 ABFC7D58 A33B3EE3 A77ACF88
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-32/CTR, 64-bit key, 12x blocks
Key: BAB568AE DFE7A74D
IV: F11B48C1
Plaintext: E6198EF2 6A5C7C96 5D689C44 64F71E41 C9D103BC 26B15962 36E4CF0E 5D2957FC AC3C444A 1B2D83A2 854F8A9F BC127E1A
Ciphertext: 19F7BBFF BC29C7E9 49D167E5 EC544B77 0BB973C9 90CAA422 5BD42DF4 0B5DE4C1 F4E61E45 0173760F 49CC325C A139E71F
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: SIMECK-64/ECB
#
Source: SIMECK test vector
Comment: SIMECK-64/ECB, 128-bit key
Key: 1b1a1918 13121110 0b0a0908 03020100
Plaintext: 656b696c 20646e75
Ciphertext: 45ce6902 5f7ab7ed
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: 0938251f 43bb8ba6 06b747de 870c3e99
Plaintext: f1bbe9eb e16cd6ae
Ciphertext: 4d11c6b9 da2f7e28
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: 323ba122 444066d0 9e7d49dc 407836fd
Plaintext: 1cdbae32 96f5453b
Ciphertext: 1e6a0792 f5a717c5
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: 61ff698f 2ddc8e66 53bf67d6 99d5e980
Plaintext: b9729d49 e18b1fda
Ciphertext: fca0fa81 94bda9c7
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: cfd3902d 597e35cf 9e0cf4d5 2c53cbc9
Plaintext: 844f4a77 9d9c1672
Ciphertext: 562b1caa 75266241
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: f8466a04 6454ceb1 3b33821f d4618dbe
Plaintext: 78818744 e6d91d2a
Ciphertext: d946fa49 41516d8e
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: 97278a59 28ce0bf5 2543e53c adae2488
Plaintext: d0576876 162f6768
Ciphertext: ca3e5050 126fa61b
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: a786c2b5 c19be1c0 978c2ff1 1128c18c
Plaintext: 08614014 c9cd68d4
Ciphertext: a307ab5a a10f5c29
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: 63b126df 89a98279 0c9bb447 9cfed971
Plaintext: d96ca166 d923d155
Ciphertext: 5e47b40d 9854418a
Test: Encrypt
#
Source: SIMECK reference implementation
Comment: SIMECK-64/ECB, 128-bit key
Key: 463608dc 1b2861c9 3f410784 28a11e20
Plaintext: 3f895ef1 62e09612
Ciphertext: c5fd5a6c 32056800
Test: Encrypt
AlgorithmType: SymmetricCipher
Name: SIMECK-64/CTR
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: FE3B1C0B2B47784A 3CA99857BC6C65B6
IV: BA8359D201AF6F9B
Plaintext: A3E44524EF89F6CC 3D93BEA482CE919E B35E02217B98F33F 46B271932F1DC1C4 71EB2C4AD5ED8B0D 4CE50A418EA8EBA1 A5981963C0866A09 C485E20643B68604 744577746075BF96 A17E5A14C348D67A 69E7D4AC4B89E625 300D8F744B54BCF2
Ciphertext: DEA57DA44B3C39D5 B948B580F62A1F9C 0E697278C767AAF4 F95CFDE865B035F3 661CD2E287EF22D4 C00901D8DABA4540 DE473A0F3D6A50DA 852F4AE41DBDD96A E19BA5490C60D3EA BEE6C61BFF06F62A 05D49E323AF4A7FC B4AFED218C8BF69D
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: 0D39ADD4C84F9F43 24D5A9BAA86F0208
IV: 297F67F1CE145ED5
Plaintext: D923EBF8B58A8F02 BE0D704DDF1BCF5F B826BF172E810701 905453A966FC0BBD 8176CCEFB905377A AAB66249660192B2 33054EEC37FFCE6E 441AD8A7C4686E7A 04F859C0F1BCD900 D37648DD09CF0A38 BFFCFBE0E1154F39 BCB8B67B29CB355B
Ciphertext: AF113C3645186BB2 97A16F83E2C3517D 9781CE170F6A18D4 B0D15010F5936EF7 B40E474952250568 8309BC50F89D91BE 8D45F337B2E0CDB5 1B04AED774E98443 D0C3A135703D5FAC B8456DB76A25BB29 F90E0D29A6A9DC4B 7327D0E5464BAE72
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: AE0E79D509DFDD03 269AC29D54AF8E90
IV: 07410095B82AB1A7
Plaintext: 8BFBAEC9CFB0BA59 F87C94D2FB3DA211 99AEAD16D8FCEA16 F531A47863BF23C3 ACE36F0E1844A818 C9178830279A4E49 431B7C0DAB7FEE44 55C5DA81DC83ED2C 23EF2788092A50D4 E2F479ED762BA545 CF313AE7EF255EBA 9D1E8A82337ACCEC
Ciphertext: B3004EED0560BD39 ACED314341F6951B D0F7E330E6B3710F 9D89CA1406F0A9B3 7FAE750DDDDB80F7 FA9778BF813729EA E485F07DECBADA48 DFF85CFA38EB04D3 75BF6654BAB44ED4 89A403DB7D336D9A 738E4B46E58AA7DA BC340ED1F0280C72
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: 907999AA2CD157DA 5333ECED531E2AAE
IV: 4565D6B399D67290
Plaintext: 8FE5147A42741524 EF5EDE3B8B9E31C6 5EA131C8693926BD C1B1DBC5F2A8F27D 8683E948037FC06D C1F09AF877A18973 FC58131487A3F18A 34CB23BFA3D4DDF2 7A7BF04313491C50 7CAA9DED424C1ACE F8AE0C79321A9657 FB01CF1FC55ED0E2
Ciphertext: 2E05D7D2D097D40E B2C91486938CA714 0693B7E8441385F5 3DFB681D4F077029 632FD9119020B98E 31CF01712DBC6F5F AAE4DDDD92098012 9F88CAE7E8D87321 27383D3EDC65B72A D1F4D0222B2892C7 E6456323CDB3D5A9 06C64D1C9DAEF874
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: B8500E1606DB42AD 590328F22ACAEE8E
IV: 5E35D1BAE6E79A13
Plaintext: 2FC764B2FA42B248 0C89BCD0C6E6EA4B 6C84F5F5F4FDA446 EFC724C4B8512356 0DCD36B655CB0727 0C1E0D47967F9204 464E1EF85CF331C2 29066907B47B2671 8F92F714171A7D03 374FA8B9893D4896 394904399A8316A8 2108C94C4034C3EF
Ciphertext: 5CADD8F76250E68E 1B4EA84EE2E8294B FB3FB4A57664FE6A 2B1FF710A16292AF A3282479D26C3310 EB53DBE28FB5187D 4768D6D17B9A0AFC 608EC92F9D6964E9 A00E1A5B65E2249C 5CFB54EED9FE5F72 98EA1FD0F0286CE5 881957C91941CE63
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: 3519FD95A81BA076 25A114B9365A029E
IV: EC8B3B7776DCE2D4
Plaintext: 8E16B47439476091 5D80CCC01CC4BB37 9996688C090966C0 8F63021D04DB15AD 7ABF16AD21483FF5 5B329FD33AD3B5D1 29F5AD6DF9CDF286 05E9898433AC08A5 25428F80BA47B4E9 570EE88EFED20D44 F47692BC98726F87 2DC0AA075E835645
Ciphertext: A5452F97199991A9 2B3E35695E9711D2 B8C06700FB56D062 102A0682FACD93E8 796B738DF5A1BBB4 1AD2033621A8687E B3E49EE829F8F146 6D125E8019FD4212 5FE69045F5F702D3 75D50FF1ED313880 FCD9EC200CD07FD9 2BEC661D6D3C3A9E
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: 8B7F582B831BD6E6 A6977D0EEE93BA4A
IV: 989EC701CD85E583
Plaintext: F66303684B09816B 32BA846BF5941339 7E15EB2F58527B17 6297A028A76E1E94 73E154B586B345CB FF10908BE0CC42BD 36D8EB7D5E944AC7 8B0871B1C35721D9 3BF6DF1E54F76358 5F51534A74B27F76 6D8282DED5552054 70005375C17FD71E
Ciphertext: 2D62B730D0EB04D6 EED9FABB2910A247 F149D8577CBA6A95 6D7EA8CE26C56E61 566BDA2EA4D238BD F82D84655D7251A3 ABF23B50729FF8A6 2651BC01A5B412D6 D7E4ECAFB36621AB C041C15A73AE4379 50ADB118875BA47C ECB6D0DD38357A24
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: 9F5C4B54620D1241 7E731CE58D6D5605
IV: 1492E297870E057C
Plaintext: 7BFF26CDE3A245E7 9DBE4A06DD016036 DE886A58DC8A578A 011645E4F300B014 35D1BBD0BBEEAD79 FAD68AC25E8EA44C 494CD8ABD8E11BDC B3E1E470D5161104 DAD371A5F9AEB35C 59A14D74DE252ED9 96A3514482703891 336AF0BA06EA7307
Ciphertext: E78FE71E34BCB41E D5F085B8DCCA6202 E592CF744AF61833 38621EFFD44ADC5E 3279366AC7401292 4A388D671905B402 FD594EEEE328F2D4 92FAD61580FD41AE 28117CE88787F9A8 0AC59316A91D1887 07F1E2FD7EE92AE9 6B905FBF32DA71EC
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: 452B87D54115ECA3 93B3A28899B45774
IV: 933EB7BD1C3A053E
Plaintext: 3CBB780F1A508745 B9541A930060A28A BA82F5B225EC4D5A 92F57FC12E69BDC6 104DCFCA6A94B690 87B5152A1B70CF97 072E0441639C1D97 52F385E8F48B5C8D 714D0EBC1D3F6C6A 2B0BF18687966E1C A168B004376E23DB 33B3287D9C4A343A
Ciphertext: F6F7045A4E6E629B E43B643B49C2199A 5B1000CDA2405AAC 3BA4430B909C907A D8DB91A9DC5D8B37 CAE211881B9DC187 488550C922006519 D57155DDD40778F4 5EBCF51C0186FA04 229CF0F39A0149F8 0C32B52758087545 88303C3C81D6A352
Test: Encrypt
#
Source: Crypto++ 7.0 generated
Comment: SIMECK-64/CTR, 128-bit key, 12x blocks
Key: E8DA7CF058E34A07 3CF875CC87323068
IV: 0DAE4378246B98F0
Plaintext: 37BB881051D17A02 6EE1A19975C7CDDD 8C6D6BAA6E56B3E5 211C8E46E37609D6 2E8EF4F05E083AD4 C7353C4D29B58FDF 8015F9D51E9FE508 1A6A55BBAC6609B5 0AA9E7A076CAC9FC 057F87B1C8E6CE3A 5D40088E1607535D 16319FA8F59CEA6B
Ciphertext: F9A0CA6ED5F24463 39EC8410CE66844E 818956DCF5D4A996 D25F4E2A3588B730 3A26D0FD05AE674C C5DA5071ED3FDA60 CEA4422C2673C088 C0CE6B1EA956FEBF AEACC1FB6BF9CA0F 6B302E73A5562935 19520DF956307C45 828CA8E68EB1B3E9
Test: Encrypt

View File

@ -18,7 +18,7 @@ USING_NAMESPACE(std)
#endif
// Used for testing the compiler and linker in cryptest.sh
#if defined(CRYPTOPP_ADHOC_MAIN)
#if defined(CRYPTOPP_ADHOC_MAIN) || defined(ADHOC_MAIN)
int main(int argc, char *argv[])
{

File diff suppressed because it is too large Load Diff

2381
vendor/cryptopp/vendor_cryptopp/adv_simd.h vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
/* Header file for use with Cryptogam's ARMv4 AES. */
/* Also see http://www.openssl.org/~appro/cryptogams/ and */
/* https://wiki.openssl.org/index.php?title=Cryptogams_AES */
#ifndef CRYPTOGAMS_AES_ARMV4_H
#define CRYPTOGAMS_AES_ARMV4_H
#ifdef __cplusplus
extern "C" {
#endif
//#define AES_MAXNR 14
//typedef struct AES_KEY_st {
// unsigned int rd_key[4 * (AES_MAXNR + 1)];
// int rounds;
//} AES_KEY;
// Instead of AES_KEY we use a 'word32 rkey[4*15+4]'. It has space for
// both the AES_MAXNR round keys and the number of rounds in the tail.
int AES_set_encrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey);
int AES_set_decrypt_key(const unsigned char *userKey, const int bits, unsigned int *rkey);
void AES_encrypt(const unsigned char in[16], unsigned char out[16], const unsigned int *rkey);
void AES_decrypt(const unsigned char in[16], unsigned char out[16], const unsigned int *rkey);
#ifdef __cplusplus
}
#endif
#endif /* CRYPTOGAMS_AES_ARMV4_H */

View File

@ -28,7 +28,7 @@ public:
ConstByteArrayParameter(const char *data = NULLPTR, bool deepCopy = false)
: m_deepCopy(false), m_data(NULLPTR), m_size(0)
{
Assign((const byte *)data, data ? strlen(data) : 0, deepCopy);
Assign(reinterpret_cast<const byte *>(data), data ? strlen(data) : 0, deepCopy);
}
/// \brief Construct a ConstByteArrayParameter
@ -44,8 +44,8 @@ public:
}
/// \brief Construct a ConstByteArrayParameter
/// \tparam T a std::basic_string<char> class
/// \param string a std::basic_string<char> class
/// \tparam T a std::basic_string<char> or std::vector<byte> class
/// \param string a std::basic_string<char> or std::vector<byte> object
/// \param deepCopy flag indicating whether the data should be copied
/// \details The deepCopy option is used when the NameValuePairs object can't
/// keep a copy of the data available
@ -53,7 +53,7 @@ public:
: m_deepCopy(false), m_data(NULLPTR), m_size(0)
{
CRYPTOPP_COMPILE_ASSERT(sizeof(typename T::value_type) == 1);
Assign((const byte *)string.data(), string.size(), deepCopy);
Assign(reinterpret_cast<const byte *>(&string[0]), string.size(), deepCopy);
}
/// \brief Assign contents from a memory buffer

View File

@ -40,7 +40,7 @@ using CryptoPP::ARIATab::X2;
using CryptoPP::ARIATab::KRK;
inline byte ARIA_BRF(const word32 x, const int y) {
return GETBYTE(x, y);
return static_cast<byte>(GETBYTE(x, y));
}
// Key XOR Layer
@ -85,11 +85,11 @@ inline byte ARIA_BRF(const word32 x, const int y) {
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
extern void ARIA_UncheckedSetKey_Schedule_NEON(byte* rk, word32* ws, unsigned int keylen);
extern void ARIA_ProcessAndXorBlock_Xor_NEON(const byte* xorBlock, byte* outblock);
extern void ARIA_ProcessAndXorBlock_NEON(const byte* xorBlock, byte* outblock, const byte *rk, word32 *t);
#endif
#if (CRYPTOPP_SSSE3_AVAILABLE)
extern void ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t);
extern void ARIA_ProcessAndXorBlock_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t);
#endif
// n-bit right shift of Y XORed to X
@ -112,7 +112,6 @@ void ARIA::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const Nam
m_rk.New(16*17); // round keys
m_w.New(4*7); // w0, w1, w2, w3, t and u
const byte *mk = key;
byte *rk = m_rk.data();
int Q, q, R, r;
@ -148,12 +147,10 @@ void ARIA::Base::UncheckedSetKey(const byte *key, unsigned int keylen, const Nam
if (keylen == 32)
{
GetBlock<word32, BigEndian, false>block(mk+16);
block(w1[0])(w1[1])(w1[2])(w1[3]);
}
else if (keylen == 24)
{
GetBlock<word32, BigEndian, false>block(mk+16);
block(w1[0])(w1[1]); w1[2] = w1[3] = 0;
}
else
@ -285,13 +282,20 @@ void ARIA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
#if CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS
if (HasSSSE3())
{
ARIA_ProcessAndXorBlock_Xor_SSSE3(xorBlock, outBlock, rk, t);
ARIA_ProcessAndXorBlock_SSSE3(xorBlock, outBlock, rk, t);
return;
}
else
#endif // CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS
#ifdef CRYPTOPP_LITTLE_ENDIAN
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
{
ARIA_ProcessAndXorBlock_NEON(xorBlock, outBlock, rk, t);
return;
}
else
#endif // CRYPTOPP_ARM_NEON_AVAILABLE
#if (CRYPTOPP_LITTLE_ENDIAN)
{
outBlock[ 0] = (byte)(X1[ARIA_BRF(t[0],3)] ) ^ rk[ 3];
outBlock[ 1] = (byte)(X2[ARIA_BRF(t[0],2)]>>8) ^ rk[ 2];
@ -331,19 +335,9 @@ void ARIA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
}
#endif // CRYPTOPP_LITTLE_ENDIAN
#if CRYPTOPP_ARM_NEON_AVAILABLE
if (HasNEON())
{
if (xorBlock != NULLPTR)
ARIA_ProcessAndXorBlock_Xor_NEON(xorBlock, outBlock);
}
else
#endif // CRYPTOPP_ARM_NEON_AVAILABLE
{
if (xorBlock != NULLPTR)
for (unsigned int n=0; n<ARIA::BLOCKSIZE; ++n)
outBlock[n] ^= xorBlock[n];
}
if (xorBlock != NULLPTR)
for (unsigned int n=0; n<ARIA::BLOCKSIZE; ++n)
outBlock[n] ^= xorBlock[n];
}
NAMESPACE_END

View File

@ -1,4 +1,4 @@
// aria-simd.cpp - written and placed in the public domain by
// aria_simd.cpp - written and placed in the public domain by
// Jeffrey Walton, Uri Blumenthal and Marcel Raad.
//
// This source file uses intrinsics to gain access to ARMv7a and
@ -20,7 +20,7 @@
// Can't use CRYPTOPP_ARM_XXX_AVAILABLE because too many
// compilers don't follow ACLE conventions for the include.
#if defined(CRYPTOPP_ARM_ACLE_AVAILABLE)
#if (CRYPTOPP_ARM_ACLE_AVAILABLE)
# include <stdint.h>
# include <arm_acle.h>
#endif
@ -29,10 +29,6 @@
#define M128_CAST(x) ((__m128i *)(void *)(x))
#define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
// GCC cast warning
#define UINT32_CAST(x) ((uint32_t *)(void *)(x))
#define CONST_UINT32_CAST(x) ((const uint32_t *)(const void *)(x))
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(ARIATab)
@ -45,6 +41,17 @@ extern const word32 KRK[3][4];
NAMESPACE_END
NAMESPACE_END
ANONYMOUS_NAMESPACE_BEGIN
using CryptoPP::byte;
using CryptoPP::word32;
inline byte ARIA_BRF(const word32 x, const int y) {
return GETBYTE(x, y);
}
ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
using CryptoPP::ARIATab::S1;
@ -58,22 +65,23 @@ using CryptoPP::ARIATab::KRK;
template <unsigned int N>
inline void ARIA_GSRK_NEON(const uint32x4_t X, const uint32x4_t Y, byte RK[16])
{
static const unsigned int Q1 = (4-(N/32)) % 4;
static const unsigned int Q2 = (3-(N/32)) % 4;
static const unsigned int R = N % 32;
enum { Q1 = (4-(N/32)) % 4,
Q2 = (3-(N/32)) % 4,
R = N % 32
};
vst1q_u32(UINT32_CAST(RK),
vst1q_u8(RK, vreinterpretq_u8_u32(
veorq_u32(X, veorq_u32(
vshrq_n_u32(vextq_u32(Y, Y, Q1), R),
vshlq_n_u32(vextq_u32(Y, Y, Q2), 32-R))));
vshlq_n_u32(vextq_u32(Y, Y, Q2), 32-R)))));
}
void ARIA_UncheckedSetKey_Schedule_NEON(byte* rk, word32* ws, unsigned int keylen)
{
const uint32x4_t w0 = vld1q_u32(CONST_UINT32_CAST(ws+ 0));
const uint32x4_t w1 = vld1q_u32(CONST_UINT32_CAST(ws+ 8));
const uint32x4_t w2 = vld1q_u32(CONST_UINT32_CAST(ws+12));
const uint32x4_t w3 = vld1q_u32(CONST_UINT32_CAST(ws+16));
const uint32x4_t w0 = vld1q_u32(ws+ 0);
const uint32x4_t w1 = vld1q_u32(ws+ 8);
const uint32x4_t w2 = vld1q_u32(ws+12);
const uint32x4_t w3 = vld1q_u32(ws+16);
ARIA_GSRK_NEON<19>(w0, w1, rk + 0);
ARIA_GSRK_NEON<19>(w1, w2, rk + 16);
@ -102,22 +110,49 @@ void ARIA_UncheckedSetKey_Schedule_NEON(byte* rk, word32* ws, unsigned int keyle
}
}
void ARIA_ProcessAndXorBlock_Xor_NEON(const byte* xorBlock, byte* outBlock)
void ARIA_ProcessAndXorBlock_NEON(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t)
{
vst1q_u32(UINT32_CAST(outBlock), veorq_u32(
vld1q_u32(CONST_UINT32_CAST(outBlock)),
vld1q_u32(CONST_UINT32_CAST(xorBlock))));
outBlock[ 0] = (byte)(X1[ARIA_BRF(t[0],3)] );
outBlock[ 1] = (byte)(X2[ARIA_BRF(t[0],2)]>>8);
outBlock[ 2] = (byte)(S1[ARIA_BRF(t[0],1)] );
outBlock[ 3] = (byte)(S2[ARIA_BRF(t[0],0)] );
outBlock[ 4] = (byte)(X1[ARIA_BRF(t[1],3)] );
outBlock[ 5] = (byte)(X2[ARIA_BRF(t[1],2)]>>8);
outBlock[ 6] = (byte)(S1[ARIA_BRF(t[1],1)] );
outBlock[ 7] = (byte)(S2[ARIA_BRF(t[1],0)] );
outBlock[ 8] = (byte)(X1[ARIA_BRF(t[2],3)] );
outBlock[ 9] = (byte)(X2[ARIA_BRF(t[2],2)]>>8);
outBlock[10] = (byte)(S1[ARIA_BRF(t[2],1)] );
outBlock[11] = (byte)(S2[ARIA_BRF(t[2],0)] );
outBlock[12] = (byte)(X1[ARIA_BRF(t[3],3)] );
outBlock[13] = (byte)(X2[ARIA_BRF(t[3],2)]>>8);
outBlock[14] = (byte)(S1[ARIA_BRF(t[3],1)] );
outBlock[15] = (byte)(S2[ARIA_BRF(t[3],0)] );
// 'outBlock' and 'xorBlock' may be unaligned.
if (xorBlock != NULLPTR)
{
vst1q_u8(outBlock,
veorq_u8(
vld1q_u8(xorBlock),
veorq_u8(
vld1q_u8(outBlock),
vrev32q_u8(vld1q_u8((rk))))));
}
else
{
vst1q_u8(outBlock,
veorq_u8(
vld1q_u8(outBlock),
vrev32q_u8(vld1q_u8(rk))));
}
}
#endif // CRYPTOPP_ARM_NEON_AVAILABLE
#if (CRYPTOPP_SSSE3_AVAILABLE)
inline byte ARIA_BRF(const word32 x, const int y) {
return GETBYTE(x, y);
}
void ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t)
void ARIA_ProcessAndXorBlock_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t)
{
const __m128i MASK = _mm_set_epi8(12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3);
@ -138,18 +173,22 @@ void ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte* xorBlock, byte* outBlock, con
outBlock[14] = (byte)(S1[ARIA_BRF(t[3],1)] );
outBlock[15] = (byte)(S2[ARIA_BRF(t[3],0)] );
// 'outBlock' may be unaligned.
_mm_storeu_si128(M128_CAST(outBlock),
_mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
// 'outBlock' and 'xorBlock' may be unaligned.
if (xorBlock != NULLPTR)
{
_mm_storeu_si128(M128_CAST(outBlock),
_mm_xor_si128(
_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_loadu_si128(CONST_M128_CAST(xorBlock))));
_mm_loadu_si128(CONST_M128_CAST(xorBlock)),
_mm_xor_si128(
_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)))
);
}
else
{
_mm_storeu_si128(M128_CAST(outBlock),
_mm_xor_si128(_mm_loadu_si128(CONST_M128_CAST(outBlock)),
_mm_shuffle_epi8(_mm_load_si128(CONST_M128_CAST(rk)), MASK)));
}
}

View File

@ -201,6 +201,10 @@ public:
/// </pre>
void BERDecodeAndCheck(BufferedTransformation &bt) const;
bool Empty() const {
return m_values.empty();
}
const std::vector<word32>& GetValues() const {
return m_values;
}
@ -413,7 +417,7 @@ public:
virtual void DEREncodePublicKey(BufferedTransformation &bt) const =0;
};
/// \brief Encodes and decodesprivateKeyInfo
/// \brief Encodes and Decodes privateKeyInfo
class CRYPTOPP_DLL PKCS8PrivateKey : public ASN1CryptoMaterial<PrivateKey>
{
public:

View File

@ -61,7 +61,7 @@ public:
/// \details padding is set to -1, which means use default padding. If not
/// required, then the value must be set via IsolatedInitialize().
BaseN_Decoder(BufferedTransformation *attachment=NULLPTR)
: m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0)
: m_lookup(NULLPTR), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
{Detach(attachment);}
@ -74,7 +74,7 @@ public:
/// \details padding is set to -1, which means use default padding. If not
/// required, then the value must be set via IsolatedInitialize().
BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULLPTR)
: m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0)
: m_lookup(NULLPTR), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
{
Detach(attachment);
@ -98,7 +98,7 @@ public:
private:
const int *m_lookup;
int m_padding, m_bitsPerChar, m_outputBlockSize;
int m_bitsPerChar, m_outputBlockSize;
int m_bytePos, m_bitPos;
SecByteBlock m_outBuf;
};

View File

@ -37,7 +37,7 @@ extern const byte defaultKey[];
extern time_t g_testBegin;
extern time_t g_testEnd;
// Command handler
// Benchmark command handler
void BenchmarkWithCommand(int argc, const char* const argv[]);
// Top level, prints preamble and postamble
void Benchmark(Test::TestClass suites, double t, double hertz);
@ -48,8 +48,20 @@ void Benchmark2(double t, double hertz);
// Public key systems
void Benchmark3(double t, double hertz);
void OutputResultBytes(const char *name, double length, double timeTaken);
void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken);
// These are defined in bench1.cpp
extern void OutputResultKeying(double iterations, double timeTaken);
extern void OutputResultBytes(const char *name, const char *provider, double length, double timeTaken);
extern void OutputResultOperations(const char *name, const char *provider, const char *operation, bool pc, unsigned long iterations, double timeTaken);
// These are defined in bench1.cpp
extern void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal);
extern void BenchMark(const char *name, StreamTransformation &cipher, double timeTotal);
extern void BenchMark(const char *name, HashTransformation &ht, double timeTotal);
extern void BenchMark(const char *name, RandomNumberGenerator &rng, double timeTotal);
// These are defined in bench2.cpp
extern void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs &params);
extern void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal);
NAMESPACE_END // Test
NAMESPACE_END // CryptoPP

View File

@ -5,21 +5,23 @@
#include "bench.h"
#include "validate.h"
#include "aes.h"
#include "kalyna.h"
#include "threefish.h"
#include "blumshub.h"
#include "files.h"
#include "filters.h"
#include "hex.h"
#include "modes.h"
#include "factory.h"
#include "smartptr.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#include "stdcpp.h"
#include "osrng.h"
#include "drbg.h"
#include "darn.h"
#include "mersenne.h"
#include "rdrand.h"
#include "padlkrng.h"
#include "stdcpp.h"
#include <iostream>
#include <iomanip>
#include <sstream>
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4355)
@ -40,7 +42,7 @@ const double CLOCK_TICKS_PER_SECOND = (double)CLK_TCK;
const double CLOCK_TICKS_PER_SECOND = 1000000.0;
#endif
const byte defaultKey[] = "0123456789" // 168 + NULL
extern const byte defaultKey[] = "0123456789" // 168 + NULL
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
"00000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000";
@ -49,68 +51,90 @@ double g_allocatedTime = 0.0, g_hertz = 0.0, g_logTotal = 0.0;
unsigned int g_logCount = 0;
time_t g_testBegin, g_testEnd;
void OutputResultBytes(const char *name, double length, double timeTaken)
inline std::string HertzToString(double hertz)
{
// Coverity finding, also see http://stackoverflow.com/a/34509163/608639.
StreamState ss(std::cout);
std::ostringstream oss;
oss.precision(3);
if (hertz >= 0.999e+9)
oss << hertz / 1e+9 << " GHz";
else if (hertz >= 0.999e+6)
oss << hertz / 1e+6 << " MHz";
else if (hertz >= 0.999e+3)
oss << hertz / 1e+3 << " KHz";
else
oss << hertz << " Hz";
return oss.str();
}
void OutputResultBytes(const char *name, const char *provider, double length, double timeTaken)
{
std::ostringstream oss;
// Coverity finding
if (length < 0.000001f) length = 0.000001f;
if (timeTaken < 0.000001f) timeTaken = 0.000001f;
double mbs = length / timeTaken / (1024*1024);
std::cout << "\n<TR><TD>" << name;
std::cout << std::setiosflags(std::ios::fixed);
std::cout << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << mbs;
oss << "\n<TR><TD>" << name << "<TD>" << provider;
oss << std::setiosflags(std::ios::fixed);
oss << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << mbs;
if (g_hertz > 1.0f)
{
const double cpb = timeTaken * g_hertz / length;
if (cpb < 24.0f)
std::cout << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << cpb;
oss << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << cpb;
else
std::cout << "<TD>" << std::setprecision(1) << std::setiosflags(std::ios::fixed) << cpb;
oss << "<TD>" << std::setprecision(1) << std::setiosflags(std::ios::fixed) << cpb;
}
g_logTotal += log(mbs);
g_logCount++;
std::cout << oss.str();
}
void OutputResultKeying(double iterations, double timeTaken)
{
// Coverity finding, also see http://stackoverflow.com/a/34509163/608639.
StreamState ss(std::cout);
std::ostringstream oss;
// Coverity finding
if (iterations < 0.000001f) iterations = 0.000001f;
if (timeTaken < 0.000001f) timeTaken = 0.000001f;
std::cout << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << (1000*1000*timeTaken/iterations);
oss << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << (1000*1000*timeTaken/iterations);
// Coverity finding
if (g_hertz > 1.0f)
std::cout << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << timeTaken * g_hertz / iterations;
oss << "<TD>" << std::setprecision(0) << std::setiosflags(std::ios::fixed) << timeTaken * g_hertz / iterations;
std::cout << oss.str();
}
void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken)
void OutputResultOperations(const char *name, const char *provider, const char *operation, bool pc, unsigned long iterations, double timeTaken)
{
// Coverity finding, also see http://stackoverflow.com/a/34509163/608639.
StreamState ss(std::cout);
CRYPTOPP_UNUSED(provider);
std::ostringstream oss;
// Coverity finding
if (!iterations) iterations++;
if (timeTaken < 0.000001f) timeTaken = 0.000001f;
std::cout << "\n<TR><TD>" << name << " " << operation << (pc ? " with precomputation" : "");
std::cout << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << (1000*timeTaken/iterations);
oss << "\n<TR><TD>" << name << " " << operation << (pc ? " with precomputation" : "");
//oss << "<TD>" << provider;
oss << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << (1000*timeTaken/iterations);
// Coverity finding
if (g_hertz > 1.0f)
{
const double t = timeTaken * g_hertz / iterations / 1000000;
std::cout << "<TD>" << std::setprecision(2) << std::setiosflags(std::ios::fixed) << t;
oss << "<TD>" << std::setprecision(3) << std::setiosflags(std::ios::fixed) << t;
}
g_logTotal += log(iterations/timeTaken);
g_logCount++;
std::cout << oss.str();
}
/*
@ -158,15 +182,8 @@ void BenchMark(const char *name, StreamTransformation &cipher, double timeTotal)
}
while (timeTaken < 2.0/3*timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal)
{
if (cipher.NeedsPrespecifiedDataLengths())
cipher.SpecifyDataLengths(0, cipher.MaxMessageLength(), 0);
BenchMark(name, static_cast<StreamTransformation &>(cipher), timeTotal);
std::string provider = cipher.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, HashTransformation &ht, double timeTotal)
@ -189,7 +206,8 @@ void BenchMark(const char *name, HashTransformation &ht, double timeTotal)
}
while (timeTaken < 2.0/3*timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
std::string provider = ht.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal)
@ -212,7 +230,8 @@ void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal)
}
while (timeTaken < 2.0/3*timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
std::string provider = bt.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMark(const char *name, RandomNumberGenerator &rng, double timeTotal)
@ -243,7 +262,8 @@ void BenchMark(const char *name, RandomNumberGenerator &rng, double timeTotal)
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
} while (timeTaken < timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
std::string provider = rng.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
// Hack, but we probably need a KeyedRandomNumberGenerator interface
@ -269,56 +289,12 @@ void BenchMark(const char *name, NIST_DRBG &rng, double timeTotal)
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
} while (timeTaken < timeTotal);
OutputResultBytes(name, double(blocks) * BUF_SIZE, timeTaken);
}
void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs &params)
{
unsigned long iterations = 0;
double timeTaken;
clock_t start = ::clock();
do
{
for (unsigned int i=0; i<1024; i++)
c.SetKey(defaultKey, keyLength, params);
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
iterations += 1024;
}
while (timeTaken < g_allocatedTime);
OutputResultKeying(iterations, timeTaken);
}
template <class T_FactoryOutput, class T_Interface>
void BenchMarkByName2(const char *factoryName, size_t keyLength = 0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
std::string name(factoryName ? factoryName : "");
member_ptr<T_FactoryOutput> obj(ObjectFactoryRegistry<T_FactoryOutput>::Registry().CreateObject(name.c_str()));
if (!keyLength)
keyLength = obj->DefaultKeyLength();
if (displayName)
name = displayName;
else if (keyLength)
name += " (" + IntToString(keyLength * 8) + "-bit key)";
const int blockSize = params.GetIntValueWithDefault(Name::BlockSize(), 0);
obj->SetKey(defaultKey, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, blockSize ? blockSize : obj->IVSize()), false)));
BenchMark(name.c_str(), *static_cast<T_Interface *>(obj.get()), g_allocatedTime);
BenchMarkKeying(*obj, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, blockSize ? blockSize : obj->IVSize()), false)));
}
template <class T_FactoryOutput>
void BenchMarkByName(const char *factoryName, size_t keyLength = 0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
CRYPTOPP_UNUSED(params);
BenchMarkByName2<T_FactoryOutput, T_FactoryOutput>(factoryName, keyLength, displayName, params);
std::string provider = rng.AlgorithmProvider();
OutputResultBytes(name, provider.c_str(), double(blocks) * BUF_SIZE, timeTaken);
}
template <class T>
void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName = NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
CRYPTOPP_UNUSED(params);
std::string name = factoryName;
@ -331,34 +307,39 @@ void BenchMarkByNameKeyLess(const char *factoryName, const char *displayName=NUL
void AddHtmlHeader()
{
std::ostringstream oss;
// HTML5
std::cout << "<!DOCTYPE HTML>";
std::cout << "\n<HTML lang=\"en\">";
oss << "<!DOCTYPE HTML>";
oss << "\n<HTML lang=\"en\">";
std::cout << "\n<HEAD>";
std::cout << "\n<META charset=\"UTF-8\">";
std::cout << "\n<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>";
std::cout << "\n<STYLE>\n table {border-collapse: collapse;}";
std::cout << "\n table, th, td, tr {border: 1px solid black;}\n</STYLE>";
std::cout << "\n</HEAD>";
oss << "\n<HEAD>";
oss << "\n<META charset=\"UTF-8\">";
oss << "\n<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>";
oss << "\n<STYLE>\n table {border-collapse: collapse;}";
oss << "\n table, th, td, tr {border: 1px solid black;}\n</STYLE>";
oss << "\n</HEAD>";
std::cout << "\n<BODY>";
oss << "\n<BODY>";
std::cout << "\n<H1><A href=\"http://www.cryptopp.com\">Crypto++</A> " << CRYPTOPP_VERSION / 100;
std::cout << '.' << (CRYPTOPP_VERSION % 100) / 10 << '.' << CRYPTOPP_VERSION % 10 << " Benchmarks</H1>";
oss << "\n<H1><A href=\"http://www.cryptopp.com\">Crypto++</A> " << CRYPTOPP_VERSION / 100;
oss << '.' << (CRYPTOPP_VERSION % 100) / 10 << '.' << CRYPTOPP_VERSION % 10 << " Benchmarks</H1>";
std::cout << "\n<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>";
oss << "\n<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>";
if (g_hertz > 1.0f)
std::cout << "\n<P>CPU frequency of the test platform is " << g_hertz << " Hz.</P>";
oss << "\n<P>CPU frequency of the test platform is " << HertzToString(g_hertz) << ".</P>";
else
std::cout << "\n<P>CPU frequency of the test platform was not provided.</P>" << std::endl;
oss << "\n<P>CPU frequency of the test platform was not provided.</P>" << std::endl;
std::cout << oss.str();
}
void AddHtmlFooter()
{
std::cout << "\n</BODY>";
std::cout << "\n</HTML>" << std::endl;
std::ostringstream oss;
oss << "\n</BODY>\n</HTML>\n";
std::cout << oss.str();
}
void BenchmarkWithCommand(int argc, const char* const argv[])
@ -413,15 +394,14 @@ void Benchmark(Test::TestClass suites, double t, double hertz)
g_testEnd = ::time(NULLPTR);
{
StreamState state(std::cout);
std::cout << "\n<P>Throughput Geometric Average: " << std::setiosflags(std::ios::fixed);
std::cout << std::exp(g_logTotal/(g_logCount > 0.0f ? g_logCount : 1.0f)) << std::endl;
}
std::ostringstream oss;
oss << "\n<P>Throughput Geometric Average: " << std::setiosflags(std::ios::fixed);
oss << std::exp(g_logTotal/(g_logCount > 0.0f ? g_logCount : 1.0f)) << std::endl;
std::cout << "\n<P>Test started at " << TimeToString(g_testBegin);
std::cout << "\n<BR>Test ended at " << TimeToString(g_testEnd);
std::cout << std::endl;
oss << "\n<P>Test started at " << TimeToString(g_testBegin);
oss << "\n<BR>Test ended at " << TimeToString(g_testEnd);
oss << "\n";
std::cout << oss.str();
AddHtmlFooter();
}
@ -433,7 +413,7 @@ void Benchmark1(double t, double hertz)
const char *cpb;
if (g_hertz > 1.0f)
cpb = "<TH>Cycles Per Byte";
cpb = "<TH>Cycles/Byte";
else
cpb = "";
@ -442,7 +422,7 @@ void Benchmark1(double t, double hertz)
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=\"text-align: right;\">";
std::cout << "<COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Algorithm<TH>MiB/Second" << cpb;
std::cout << "\n<TR><TH>Algorithm<TH>Provider<TH>MiB/Second" << cpb;
std::cout << "\n<TBODY style=\"background: white;\">";
{
@ -463,6 +443,10 @@ void Benchmark1(double t, double hertz)
BenchMarkByNameKeyLess<RandomNumberGenerator>("RDRAND");
if (HasRDSEED())
BenchMarkByNameKeyLess<RandomNumberGenerator>("RDSEED");
#endif
#if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
if (HasDARN())
BenchMarkByNameKeyLess<RandomNumberGenerator>("DARN");
#endif
BenchMarkByNameKeyLess<RandomNumberGenerator>("AES/OFB RNG");
BenchMarkByNameKeyLess<NIST_DRBG>("Hash_DRBG(SHA1)");
@ -502,153 +486,5 @@ void Benchmark1(double t, double hertz)
std::cout << "\n</TABLE>" << std::endl;
}
void Benchmark2(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *cpb, *cpk;
if (g_hertz > 1.0f)
{
cpb = "<TH>Cycles Per Byte";
cpk = "<TH>Cycles to<BR>Setup Key and IV";
}
else
{
cpb = cpk = "";
}
std::cout << "\n<TABLE>";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=\"text-align: right;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Algorithm<TH>MiB/Second" << cpb;
std::cout << "<TH>Microseconds to<BR>Setup Key and IV" << cpk;
std::cout << "\n<TBODY style=\"background: white;\">";
{
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-64");
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-128");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-1)");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-256)");
BenchMarkByName<MessageAuthenticationCode>("Two-Track-MAC");
BenchMarkByName<MessageAuthenticationCode>("CMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("DMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("Poly1305(AES)");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2s");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2b");
BenchMarkByName<MessageAuthenticationCode>("SipHash-2-4");
BenchMarkByName<MessageAuthenticationCode>("SipHash-4-8");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkByName<SymmetricCipher>("Panama-LE");
BenchMarkByName<SymmetricCipher>("Panama-BE");
BenchMarkByName<SymmetricCipher>("Salsa20");
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12));
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
BenchMarkByName<SymmetricCipher>("ChaCha20");
BenchMarkByName<SymmetricCipher>("ChaCha12");
BenchMarkByName<SymmetricCipher>("ChaCha8");
BenchMarkByName<SymmetricCipher>("Sosemanuk");
BenchMarkByName<SymmetricCipher>("MARC4");
BenchMarkByName<SymmetricCipher>("SEAL-3.0-LE");
BenchMarkByName<SymmetricCipher>("WAKE-OFB-LE");
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkByName<SymmetricCipher>("AES/CTR", 16);
BenchMarkByName<SymmetricCipher>("AES/CTR", 24);
BenchMarkByName<SymmetricCipher>("AES/CTR", 32);
BenchMarkByName<SymmetricCipher>("AES/CBC", 16);
BenchMarkByName<SymmetricCipher>("AES/CBC", 24);
BenchMarkByName<SymmetricCipher>("AES/CBC", 32);
BenchMarkByName<SymmetricCipher>("AES/OFB", 16);
BenchMarkByName<SymmetricCipher>("AES/CFB", 16);
BenchMarkByName<SymmetricCipher>("AES/ECB", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 32);
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 16);
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 32);
BenchMarkByName<SymmetricCipher>("Twofish/CTR");
BenchMarkByName<SymmetricCipher>("Threefish-256(256)/CTR", 32);
BenchMarkByName<SymmetricCipher>("Threefish-512(512)/CTR", 64);
BenchMarkByName<SymmetricCipher>("Threefish-1024(1024)/CTR", 128);
BenchMarkByName<SymmetricCipher>("Serpent/CTR");
BenchMarkByName<SymmetricCipher>("CAST-128/CTR");
BenchMarkByName<SymmetricCipher>("CAST-256/CTR");
BenchMarkByName<SymmetricCipher>("RC6/CTR");
BenchMarkByName<SymmetricCipher>("MARS/CTR");
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 16);
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 64);
BenchMarkByName<SymmetricCipher>("DES/CTR");
BenchMarkByName<SymmetricCipher>("DES-XEX3/CTR");
BenchMarkByName<SymmetricCipher>("DES-EDE3/CTR");
BenchMarkByName<SymmetricCipher>("IDEA/CTR");
BenchMarkByName<SymmetricCipher>("RC5/CTR", 0, "RC5 (r=16)");
BenchMarkByName<SymmetricCipher>("Blowfish/CTR");
BenchMarkByName<SymmetricCipher>("TEA/CTR");
BenchMarkByName<SymmetricCipher>("XTEA/CTR");
BenchMarkByName<SymmetricCipher>("SKIPJACK/CTR");
BenchMarkByName<SymmetricCipher>("SEED/CTR", 0, "SEED/CTR (1/2 K table)");
BenchMarkByName<SymmetricCipher>("SM4/CTR");
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 16, "Kalyna-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 32, "Kalyna-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 32, "Kalyna-256(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 64, "Kalyna-256(512)/CTR (512-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-512/CTR", 64, "Kalyna-512(512)/CTR (512-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 12, "SIMON-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 16, "SIMON-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 16, "SIMON-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 24, "SIMON-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 32, "SIMON-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 12, "SPECK-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 16, "SPECK-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 16, "SPECK-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 24, "SPECK-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 32, "SPECK-128(256)/CTR (256-bit key)");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/CCM");
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/EAX");
}
std::cout << "\n</TABLE>" << std::endl;
}
NAMESPACE_END // Test
NAMESPACE_END // CryptoPP

View File

@ -5,33 +5,16 @@
#include "bench.h"
#include "validate.h"
#include "pubkey.h"
#include "gfpcrypt.h"
#include "eccrypto.h"
#include "pkcspad.h"
#include "files.h"
#include "filters.h"
#include "hex.h"
#include "rsa.h"
#include "nr.h"
#include "dsa.h"
#include "luc.h"
#include "rw.h"
#include "ecp.h"
#include "ec2n.h"
#include "asn.h"
#include "dh.h"
#include "mqv.h"
#include "hmqv.h"
#include "fhmqv.h"
#include "xtrcrypt.h"
#include "esign.h"
#include "pssr.h"
#include "oids.h"
#include "randpool.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#include "stdcpp.h"
#include "hrtimer.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4355)
#endif
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4505 4355)
@ -40,381 +23,228 @@
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(Test)
void BenchMarkEncryption(const char *name, PK_Encryptor &key, double timeTotal, bool pc=false)
void BenchMarkKeying(SimpleKeyingInterface &c, size_t keyLength, const NameValuePairs &params)
{
unsigned int len = 16;
SecByteBlock plaintext(len), ciphertext(key.CiphertextLength(len));
Test::GlobalRNG().GenerateBlock(plaintext, len);
unsigned int i = 0;
unsigned long iterations = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
clock_t start = ::clock();
do
{
key.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
for (unsigned int i=0; i<1024; i++)
c.SetKey(defaultKey, keyLength, params);
timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND;
iterations += 1024;
}
while (timeTaken < timeTotal);
while (timeTaken < g_allocatedTime);
OutputResultOperations(name, "Encryption", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkEncryption(name, key, timeTotal, true);
}
OutputResultKeying(iterations, timeTaken);
}
void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub, double timeTotal)
void BenchMark(const char *name, AuthenticatedSymmetricCipher &cipher, double timeTotal)
{
unsigned int len = 16;
SecByteBlock ciphertext(pub.CiphertextLength(len));
SecByteBlock plaintext(pub.MaxPlaintextLength(ciphertext.size()));
Test::GlobalRNG().GenerateBlock(plaintext, len);
pub.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
if (cipher.NeedsPrespecifiedDataLengths())
cipher.SpecifyDataLengths(0, cipher.MaxMessageLength(), 0);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
priv.Decrypt(Test::GlobalRNG(), ciphertext, ciphertext.size(), plaintext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Decryption", false, i, timeTaken);
BenchMark(name, static_cast<StreamTransformation &>(cipher), timeTotal);
}
void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false)
template <class T_FactoryOutput, class T_Interface>
void BenchMarkByName2(const char *factoryName, size_t keyLength=0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(key.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
std::string name(factoryName ? factoryName : "");
member_ptr<T_FactoryOutput> obj(ObjectFactoryRegistry<T_FactoryOutput>::Registry().CreateObject(name.c_str()));
unsigned int i = 0;
double timeTaken;
if (keyLength == 0)
keyLength = obj->DefaultKeyLength();
ThreadUserTimer timer;
timer.StartTimer();
if (displayName != NULLPTR)
name = displayName;
else if (keyLength != 0)
name += " (" + IntToString(keyLength * 8) + "-bit key)";
do
{
(void)key.SignMessage(Test::GlobalRNG(), message, len, signature);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Signature", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkSigning(name, key, timeTotal, true);
}
obj->SetKey(defaultKey, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false)));
BenchMark(name.c_str(), *static_cast<T_Interface *>(obj.get()), g_allocatedTime);
BenchMarkKeying(*obj, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), ConstByteArrayParameter(defaultKey, obj->IVSize()), false)));
}
void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier &pub, double timeTotal, bool pc=false)
template <class T_FactoryOutput>
void BenchMarkByName(const char *factoryName, size_t keyLength=0, const char *displayName=NULLPTR, const NameValuePairs &params = g_nullNameValuePairs)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(pub.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
priv.SignMessage(Test::GlobalRNG(), message, len, signature);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
(void)pub.VerifyMessage(message, len, signature, signature.size());
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Verification", pc, i, timeTaken);
if (!pc && pub.GetMaterial().SupportsPrecomputation())
{
pub.AccessMaterial().Precompute(16);
BenchMarkVerification(name, priv, pub, timeTotal, true);
}
BenchMarkByName2<T_FactoryOutput,T_FactoryOutput>(factoryName, keyLength, displayName, params);
}
void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.EphemeralPrivateKeyLength()), pub(d.EphemeralPublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkAgreement(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength());
SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength());
d.GenerateKeyPair(Test::GlobalRNG(), priv1, pub1);
d.GenerateKeyPair(Test::GlobalRNG(), priv2, pub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, priv1, pub2);
d.Agree(val, priv2, pub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key Agreement", pc, i, timeTaken);
}
void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength());
SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength());
SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength());
SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength());
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv1, spub1);
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv2, spub2);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv1, epub1);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv2, epub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, spriv1, epriv1, spub2, epub2);
d.Agree(val, spriv2, epriv2, spub1, epub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
OutputResultOperations(name, "Key Agreement", pc, i, timeTaken);
}
template <class SCHEME>
void BenchMarkCrypto(const char *filename, const char *name, double timeTotal)
{
FileSource f(filename, true, new HexDecoder);
typename SCHEME::Decryptor priv(f);
typename SCHEME::Encryptor pub(priv);
BenchMarkEncryption(name, pub, timeTotal);
BenchMarkDecryption(name, priv, pub, timeTotal);
}
template <class SCHEME>
void BenchMarkSignature(const char *filename, const char *name, double timeTotal)
{
FileSource f(filename, true, new HexDecoder);
typename SCHEME::Signer priv(f);
typename SCHEME::Verifier pub(priv);
BenchMarkSigning(name, priv, timeTotal);
BenchMarkVerification(name, priv, pub, timeTotal);
}
template <class D>
void BenchMarkKeyAgreement(const char *filename, const char *name, double timeTotal)
{
FileSource f(filename, true, new HexDecoder);
D d(f);
BenchMarkKeyGen(name, d, timeTotal);
BenchMarkAgreement(name, d, timeTotal);
}
void Benchmark3(double t, double hertz)
void Benchmark2(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *mco;
const char *cpb, *cpk;
if (g_hertz > 1.0f)
mco = "<TH>Megacycles/Operation";
{
cpb = "<TH>Cycles/Byte";
cpk = "<TH>Cycles to<BR>Setup Key and IV";
}
else
mco = "";
{
cpb = cpk = "";
}
std::cout << "\n<TABLE>";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=\"text-align: right;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Operation<TH>Milliseconds/Operation" << mco;
std::cout << "\n<TR><TH>Algorithm<TH>Provider<TH>MiB/Second" << cpb;
std::cout << "<TH>Microseconds to<BR>Setup Key and IV" << cpk;
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie1024.dat", "DLIES 1024", t);
BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc512.dat", "LUCELG 512", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie2048.dat", "DLIES 2048", t);
BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc1024.dat", "LUCELG 1024", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rw1024.dat", "RW 1024", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
BenchMarkSignature<NR<SHA1> >(CRYPTOPP_DATA_DIR "TestData/nr1024.dat", "NR 1024", t);
BenchMarkSignature<DSA>(CRYPTOPP_DATA_DIR "TestData/dsa1024.dat", "DSA 1024", t);
BenchMarkSignature<LUC_HMP<SHA1> >(CRYPTOPP_DATA_DIR "TestData/lucs512.dat", "LUC-HMP 512", t);
BenchMarkSignature<ESIGN<SHA1> >(CRYPTOPP_DATA_DIR "TestData/esig1023.dat", "ESIGN 1023", t);
BenchMarkSignature<ESIGN<SHA1> >(CRYPTOPP_DATA_DIR "TestData/esig1536.dat", "ESIGN 1536", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/rw2048.dat", "RW 2048", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
BenchMarkSignature<NR<SHA1> >(CRYPTOPP_DATA_DIR "TestData/nr2048.dat", "NR 2048", t);
BenchMarkSignature<LUC_HMP<SHA1> >(CRYPTOPP_DATA_DIR "TestData/lucs1024.dat", "LUC-HMP 1024", t);
BenchMarkSignature<ESIGN<SHA1> >(CRYPTOPP_DATA_DIR "TestData/esig2046.dat", "ESIGN 2046", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh171.dat", "XTR-DH 171", t);
BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh342.dat", "XTR-DH 342", t);
BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh1024.dat", "DH 1024", t);
BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh2048.dat", "DH 2048", t);
BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd512.dat", "LUCDIF 512", t);
BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd1024.dat", "LUCDIF 1024", t);
BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv1024.dat", "MQV 1024", t);
BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv2048.dat", "MQV 2048", t);
#if 0
BenchMarkKeyAgreement<ECHMQV160>(CRYPTOPP_DATA_DIR "TestData/hmqv160.dat", "HMQV P-160", t);
BenchMarkKeyAgreement<ECHMQV256>(CRYPTOPP_DATA_DIR "TestData/hmqv256.dat", "HMQV P-256", t);
BenchMarkKeyAgreement<ECHMQV384>(CRYPTOPP_DATA_DIR "TestData/hmqv384.dat", "HMQV P-384", t);
BenchMarkKeyAgreement<ECHMQV512>(CRYPTOPP_DATA_DIR "TestData/hmqv512.dat", "HMQV P-512", t);
BenchMarkKeyAgreement<ECFHMQV160>(CRYPTOPP_DATA_DIR "TestData/fhmqv160.dat", "FHMQV P-160", t);
BenchMarkKeyAgreement<ECFHMQV256>(CRYPTOPP_DATA_DIR "TestData/fhmqv256.dat", "FHMQV P-256", t);
BenchMarkKeyAgreement<ECFHMQV384>(CRYPTOPP_DATA_DIR "TestData/fhmqv384.dat", "FHMQV P-384", t);
BenchMarkKeyAgreement<ECFHMQV512>(CRYPTOPP_DATA_DIR "TestData/fhmqv512.dat", "FHMQV P-512", t);
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#elif CRYPTOPP_POWER8_VMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES)");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, MessageAuthenticationCode>("AES/GCM", 0, "GMAC(AES) (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-64");
BenchMarkByName<MessageAuthenticationCode>("VMAC(AES)-128");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-1)");
BenchMarkByName<MessageAuthenticationCode>("HMAC(SHA-256)");
BenchMarkByName<MessageAuthenticationCode>("Two-Track-MAC");
BenchMarkByName<MessageAuthenticationCode>("CMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("DMAC(AES)");
BenchMarkByName<MessageAuthenticationCode>("Poly1305(AES)");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2s");
BenchMarkByName<MessageAuthenticationCode>("BLAKE2b");
BenchMarkByName<MessageAuthenticationCode>("SipHash-2-4");
BenchMarkByName<MessageAuthenticationCode>("SipHash-4-8");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
ECIES<ECP>::Decryptor cpriv(Test::GlobalRNG(), ASN1::secp256k1());
ECIES<ECP>::Encryptor cpub(cpriv);
ECDSA<ECP, SHA1>::Signer spriv(cpriv);
ECDSA<ECP, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<ECP, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<ECP, SHA1>::Verifier spub2(spriv);
ECGDSA<ECP, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::secp256k1());
ECGDSA<ECP, SHA1>::Verifier spub3(spriv3);
ECDH<ECP>::Domain ecdhc(ASN1::secp256k1());
ECMQV<ECP>::Domain ecmqvc(ASN1::secp256k1());
BenchMarkEncryption("ECIES over GF(p) 256", cpub, t);
BenchMarkDecryption("ECIES over GF(p) 256", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(p) 256", spriv, t);
BenchMarkVerification("ECDSA over GF(p) 256", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(p) 256", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(p) 256", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(p) 256", spriv3, t);
BenchMarkVerification("ECGDSA over GF(p) 256", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(p) 256", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(p) 256", ecmqvc, t);
BenchMarkByName<SymmetricCipher>("Panama-LE");
BenchMarkByName<SymmetricCipher>("Panama-BE");
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20");
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/12", MakeParameters(Name::Rounds(), 12));
BenchMarkByName<SymmetricCipher>("Salsa20", 0, "Salsa20/8", MakeParameters(Name::Rounds(), 8));
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha20");
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha12", MakeParameters(Name::Rounds(), 12));
BenchMarkByName<SymmetricCipher>("ChaCha", 0, "ChaCha8", MakeParameters(Name::Rounds(), 8));
BenchMarkByName<SymmetricCipher>("Sosemanuk");
BenchMarkByName<SymmetricCipher>("Rabbit");
BenchMarkByName<SymmetricCipher>("RabbitWithIV");
BenchMarkByName<SymmetricCipher>("HC-128");
BenchMarkByName<SymmetricCipher>("HC-256");
BenchMarkByName<SymmetricCipher>("MARC4");
BenchMarkByName<SymmetricCipher>("SEAL-3.0-LE");
BenchMarkByName<SymmetricCipher>("WAKE-OFB-LE");
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
ECIES<EC2N>::Decryptor cpriv(Test::GlobalRNG(), ASN1::sect233r1());
ECIES<EC2N>::Encryptor cpub(cpriv);
ECDSA<EC2N, SHA1>::Signer spriv(cpriv);
ECDSA<EC2N, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<EC2N, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<EC2N, SHA1>::Verifier spub2(spriv);
ECGDSA<EC2N, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::sect233r1());
ECGDSA<EC2N, SHA1>::Verifier spub3(spriv3);
ECDH<EC2N>::Domain ecdhc(ASN1::sect233r1());
ECMQV<EC2N>::Domain ecmqvc(ASN1::sect233r1());
BenchMarkByName<SymmetricCipher>("AES/CTR", 16);
BenchMarkByName<SymmetricCipher>("AES/CTR", 24);
BenchMarkByName<SymmetricCipher>("AES/CTR", 32);
BenchMarkByName<SymmetricCipher>("AES/CBC", 16);
BenchMarkByName<SymmetricCipher>("AES/CBC", 24);
BenchMarkByName<SymmetricCipher>("AES/CBC", 32);
BenchMarkByName<SymmetricCipher>("AES/OFB", 16);
BenchMarkByName<SymmetricCipher>("AES/CFB", 16);
BenchMarkByName<SymmetricCipher>("AES/ECB", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 16);
BenchMarkByName<SymmetricCipher>("ARIA/CTR", 32);
BenchMarkByName<SymmetricCipher>("HIGHT/CTR");
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 16);
BenchMarkByName<SymmetricCipher>("Camellia/CTR", 32);
BenchMarkByName<SymmetricCipher>("Twofish/CTR");
BenchMarkByName<SymmetricCipher>("Threefish-256(256)/CTR", 32);
BenchMarkByName<SymmetricCipher>("Threefish-512(512)/CTR", 64);
BenchMarkByName<SymmetricCipher>("Threefish-1024(1024)/CTR", 128);
BenchMarkByName<SymmetricCipher>("Serpent/CTR");
BenchMarkByName<SymmetricCipher>("CAST-128/CTR");
BenchMarkByName<SymmetricCipher>("CAST-256/CTR", 32);
BenchMarkByName<SymmetricCipher>("RC6/CTR");
BenchMarkByName<SymmetricCipher>("MARS/CTR");
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 16);
BenchMarkByName<SymmetricCipher>("SHACAL-2/CTR", 64);
BenchMarkByName<SymmetricCipher>("DES/CTR");
BenchMarkByName<SymmetricCipher>("DES-XEX3/CTR");
BenchMarkByName<SymmetricCipher>("DES-EDE3/CTR");
BenchMarkByName<SymmetricCipher>("IDEA/CTR");
BenchMarkByName<SymmetricCipher>("RC5/CTR", 0, "RC5 (r=16)");
BenchMarkByName<SymmetricCipher>("Blowfish/CTR");
BenchMarkByName<SymmetricCipher>("SKIPJACK/CTR");
BenchMarkByName<SymmetricCipher>("SEED/CTR", 0, "SEED/CTR (1/2 K table)");
BenchMarkByName<SymmetricCipher>("SM4/CTR");
BenchMarkEncryption("ECIES over GF(2^n) 233", cpub, t);
BenchMarkDecryption("ECIES over GF(2^n) 233", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(2^n) 233", spriv, t);
BenchMarkVerification("ECDSA over GF(2^n) 233", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(2^n) 233", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(2^n) 233", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(2^n) 233", spriv3, t);
BenchMarkVerification("ECGDSA over GF(2^n) 233", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(2^n) 233", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(2^n) 233", ecmqvc, t);
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 16, "Kalyna-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-128/CTR", 32, "Kalyna-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 32, "Kalyna-256(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-256/CTR", 64, "Kalyna-256(512)/CTR (512-bit key)");
BenchMarkByName<SymmetricCipher>("Kalyna-512/CTR", 64, "Kalyna-512(512)/CTR (512-bit key)");
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkByName<SymmetricCipher>("CHAM-64/CTR", 16, "CHAM-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("CHAM-128/CTR", 16, "CHAM-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("CHAM-128/CTR", 32, "CHAM-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("LEA-128/CTR", 16, "LEA-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("LEA-128/CTR", 24, "LEA-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("LEA-128/CTR", 32, "LEA-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("SIMECK-32/CTR", 8, "SIMECK-32(64)/CTR (64-bit key)");
BenchMarkByName<SymmetricCipher>("SIMECK-64/CTR", 16, "SIMECK-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 12, "SIMON-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-64/CTR", 16, "SIMON-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 16, "SIMON-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 24, "SIMON-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SIMON-128/CTR", 32, "SIMON-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 12, "SPECK-64(96)/CTR (96-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-64/CTR", 16, "SPECK-64(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 16, "SPECK-128(128)/CTR (128-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 24, "SPECK-128(192)/CTR (192-bit key)");
BenchMarkByName<SymmetricCipher>("SPECK-128/CTR", 32, "SPECK-128(256)/CTR (256-bit key)");
BenchMarkByName<SymmetricCipher>("TEA/CTR");
BenchMarkByName<SymmetricCipher>("XTEA/CTR");
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
#if CRYPTOPP_AESNI_AVAILABLE
if (HasCLMUL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#elif CRYPTOPP_ARM_PMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#elif CRYPTOPP_POWER8_VMULL_AVAILABLE
if (HasPMULL())
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM");
else
#endif
{
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (2K tables)", MakeParameters(Name::TableSize(), 2048));
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/GCM", 0, "AES/GCM (64K tables)", MakeParameters(Name::TableSize(), 64 * 1024));
}
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/CCM");
BenchMarkByName2<AuthenticatedSymmetricCipher, AuthenticatedSymmetricCipher>("AES/EAX");
}
std::cout << "\n</TABLE>" << std::endl;

View File

@ -0,0 +1,452 @@
// bench3.cpp - originally written and placed in the public domain by Wei Dai
// CryptoPP::Test namespace added by JW in February 2017
#include "cryptlib.h"
#include "bench.h"
#include "validate.h"
#include "cpu.h"
#include "factory.h"
#include "algparam.h"
#include "argnames.h"
#include "smartptr.h"
#include "stdcpp.h"
#include "pubkey.h"
#include "gfpcrypt.h"
#include "eccrypto.h"
#include "pkcspad.h"
#include "files.h"
#include "filters.h"
#include "hex.h"
#include "rsa.h"
#include "nr.h"
#include "dsa.h"
#include "luc.h"
#include "rw.h"
#include "ecp.h"
#include "ec2n.h"
#include "asn.h"
#include "dh.h"
#include "mqv.h"
#include "hmqv.h"
#include "fhmqv.h"
#include "xed25519.h"
#include "xtrcrypt.h"
#include "esign.h"
#include "pssr.h"
#include "oids.h"
#include "randpool.h"
#include "stdcpp.h"
#include "hrtimer.h"
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4505 4355)
#endif
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(Test)
void BenchMarkEncryption(const char *name, PK_Encryptor &key, double timeTotal, bool pc = false)
{
unsigned int len = 16;
SecByteBlock plaintext(len), ciphertext(key.CiphertextLength(len));
Test::GlobalRNG().GenerateBlock(plaintext, len);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
key.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = key.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Encryption", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkEncryption(name, key, timeTotal, true);
}
}
void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub, double timeTotal)
{
unsigned int len = 16;
SecByteBlock ciphertext(pub.CiphertextLength(len));
SecByteBlock plaintext(pub.MaxPlaintextLength(ciphertext.size()));
Test::GlobalRNG().GenerateBlock(plaintext, len);
pub.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
priv.Decrypt(Test::GlobalRNG(), ciphertext, ciphertext.size(), plaintext);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = priv.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Decryption", false, i, timeTaken);
}
void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(key.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
(void)key.SignMessage(Test::GlobalRNG(), message, len, signature);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = key.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Signature", pc, i, timeTaken);
if (!pc && key.GetMaterial().SupportsPrecomputation())
{
key.AccessMaterial().Precompute(16);
BenchMarkSigning(name, key, timeTotal, true);
}
}
void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier &pub, double timeTotal, bool pc=false)
{
unsigned int len = 16;
AlignedSecByteBlock message(len), signature(pub.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
priv.SignMessage(Test::GlobalRNG(), message, len, signature);
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
(void)pub.VerifyMessage(message, len, signature, signature.size());
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = pub.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Verification", pc, i, timeTaken);
if (!pc && pub.GetMaterial().SupportsPrecomputation())
{
pub.AccessMaterial().Precompute(16);
BenchMarkVerification(name, priv, pub, timeTotal, true);
}
}
void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv(d.EphemeralPrivateKeyLength()), pub(d.EphemeralPublicKeyLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), priv, pub);
++i; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key-Pair Generation", pc, i, timeTaken);
if (!pc && d.GetMaterial().SupportsPrecomputation())
{
d.AccessMaterial().Precompute(16);
BenchMarkKeyGen(name, d, timeTotal, true);
}
}
void BenchMarkAgreement(const char *name, SimpleKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock priv1(d.PrivateKeyLength()), priv2(d.PrivateKeyLength());
SecByteBlock pub1(d.PublicKeyLength()), pub2(d.PublicKeyLength());
d.GenerateKeyPair(Test::GlobalRNG(), priv1, pub1);
d.GenerateKeyPair(Test::GlobalRNG(), priv2, pub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, priv1, pub2);
d.Agree(val, priv2, pub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key Agreement", pc, i, timeTaken);
}
void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, double timeTotal, bool pc=false)
{
SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength());
SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength());
SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength());
SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength());
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv1, spub1);
d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv2, spub2);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv1, epub1);
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv2, epub2);
SecByteBlock val(d.AgreedValueLength());
unsigned int i = 0;
double timeTaken;
ThreadUserTimer timer;
timer.StartTimer();
do
{
d.Agree(val, spriv1, epriv1, spub2, epub2);
d.Agree(val, spriv2, epriv2, spub1, epub1);
i+=2; timeTaken = timer.ElapsedTimeAsDouble();
}
while (timeTaken < timeTotal);
std::string provider = d.AlgorithmProvider();
OutputResultOperations(name, provider.c_str(), "Key Agreement", pc, i, timeTaken);
}
template <class SCHEME>
void BenchMarkCrypto(const char *filename, const char *name, double timeTotal)
{
FileSource f(DataDir(filename).c_str(), true, new HexDecoder);
typename SCHEME::Decryptor priv(f);
typename SCHEME::Encryptor pub(priv);
BenchMarkEncryption(name, pub, timeTotal);
BenchMarkDecryption(name, priv, pub, timeTotal);
}
template <class SCHEME>
void BenchMarkSignature(const char *filename, const char *name, double timeTotal)
{
FileSource f(DataDir(filename).c_str(), true, new HexDecoder);
typename SCHEME::Signer priv(f);
typename SCHEME::Verifier pub(priv);
BenchMarkSigning(name, priv, timeTotal);
BenchMarkVerification(name, priv, pub, timeTotal);
}
template <class D>
void BenchMarkKeyAgreement(const char *filename, const char *name, double timeTotal)
{
FileSource f(DataDir(filename).c_str(), true, new HexDecoder);
D d(f);
BenchMarkKeyGen(name, d, timeTotal);
BenchMarkAgreement(name, d, timeTotal);
}
void Benchmark3(double t, double hertz)
{
g_allocatedTime = t;
g_hertz = hertz;
const char *mco;
if (g_hertz > 1.0f)
mco = "<TH>Megacycles/Operation";
else
mco = "";
std::cout << "\n<TABLE>";
std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=";
std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\">";
std::cout << "\n<THEAD style=\"background: #F0F0F0\">";
std::cout << "\n<TR><TH>Operation<TH>Milliseconds/Operation" << mco;
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >("TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >("TestData/luc1024.dat", "LUC 1024", t);
BenchMarkCrypto<DLIES<> >("TestData/dlie1024.dat", "DLIES 1024", t);
BenchMarkCrypto<LUC_IES<> >("TestData/lucc512.dat", "LUCELG 512", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkCrypto<RSAES<OAEP<SHA1> > >("TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkCrypto<LUCES<OAEP<SHA1> > >("TestData/luc2048.dat", "LUC 2048", t);
BenchMarkCrypto<DLIES<> >("TestData/dlie2048.dat", "DLIES 2048", t);
BenchMarkCrypto<LUC_IES<> >("TestData/lucc1024.dat", "LUCELG 1024", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >("TestData/rsa1024.dat", "RSA 1024", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >("TestData/rw1024.dat", "RW 1024", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >("TestData/luc1024.dat", "LUC 1024", t);
BenchMarkSignature<NR<SHA1> >("TestData/nr1024.dat", "NR 1024", t);
BenchMarkSignature<DSA>("TestData/dsa1024.dat", "DSA 1024", t);
BenchMarkSignature<LUC_HMP<SHA1> >("TestData/lucs512.dat", "LUC-HMP 512", t);
BenchMarkSignature<ESIGN<SHA1> >("TestData/esig1023.dat", "ESIGN 1023", t);
BenchMarkSignature<ESIGN<SHA1> >("TestData/esig1536.dat", "ESIGN 1536", t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
BenchMarkSignature<RSASS<PSSR, SHA1> >("TestData/rsa2048.dat", "RSA 2048", t);
BenchMarkSignature<RWSS<PSSR, SHA1> >("TestData/rw2048.dat", "RW 2048", t);
BenchMarkSignature<LUCSS<PSSR, SHA1> >("TestData/luc2048.dat", "LUC 2048", t);
BenchMarkSignature<NR<SHA1> >("TestData/nr2048.dat", "NR 2048", t);
BenchMarkSignature<LUC_HMP<SHA1> >("TestData/lucs1024.dat", "LUC-HMP 1024", t);
BenchMarkSignature<ESIGN<SHA1> >("TestData/esig2046.dat", "ESIGN 2046", t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh171.dat", "XTR-DH 171", t);
BenchMarkKeyAgreement<XTR_DH>("TestData/xtrdh342.dat", "XTR-DH 342", t);
BenchMarkKeyAgreement<DH>("TestData/dh1024.dat", "DH 1024", t);
BenchMarkKeyAgreement<DH>("TestData/dh2048.dat", "DH 2048", t);
BenchMarkKeyAgreement<LUC_DH>("TestData/lucd512.dat", "LUCDIF 512", t);
BenchMarkKeyAgreement<LUC_DH>("TestData/lucd1024.dat", "LUCDIF 1024", t);
BenchMarkKeyAgreement<MQV>("TestData/mqv1024.dat", "MQV 1024", t);
BenchMarkKeyAgreement<MQV>("TestData/mqv2048.dat", "MQV 2048", t);
#if 0
BenchMarkKeyAgreement<ECHMQV160>("TestData/hmqv160.dat", "HMQV P-160", t);
BenchMarkKeyAgreement<ECHMQV256>("TestData/hmqv256.dat", "HMQV P-256", t);
BenchMarkKeyAgreement<ECHMQV384>("TestData/hmqv384.dat", "HMQV P-384", t);
BenchMarkKeyAgreement<ECHMQV512>("TestData/hmqv512.dat", "HMQV P-512", t);
BenchMarkKeyAgreement<ECFHMQV160>("TestData/fhmqv160.dat", "FHMQV P-160", t);
BenchMarkKeyAgreement<ECFHMQV256>("TestData/fhmqv256.dat", "FHMQV P-256", t);
BenchMarkKeyAgreement<ECFHMQV384>("TestData/fhmqv384.dat", "FHMQV P-384", t);
BenchMarkKeyAgreement<ECFHMQV512>("TestData/fhmqv512.dat", "FHMQV P-512", t);
#endif
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
ed25519::Signer sign(Test::GlobalRNG());
ed25519::Verifier verify(sign);
x25519 agree(Test::GlobalRNG());
BenchMarkSigning("ed25519", sign, t);
BenchMarkVerification("ed25519", sign, verify, t);
BenchMarkKeyGen("x25519", agree, t);
BenchMarkAgreement("x25519", agree, t);
}
std::cout << "\n<TBODY style=\"background: white;\">";
{
ECIES<ECP>::Decryptor cpriv(Test::GlobalRNG(), ASN1::secp256k1());
ECIES<ECP>::Encryptor cpub(cpriv);
ECDSA<ECP, SHA1>::Signer spriv(cpriv);
ECDSA<ECP, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<ECP, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<ECP, SHA1>::Verifier spub2(spriv);
ECGDSA<ECP, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::secp256k1());
ECGDSA<ECP, SHA1>::Verifier spub3(spriv3);
ECDH<ECP>::Domain ecdhc(ASN1::secp256k1());
ECMQV<ECP>::Domain ecmqvc(ASN1::secp256k1());
BenchMarkEncryption("ECIES over GF(p) 256", cpub, t);
BenchMarkDecryption("ECIES over GF(p) 256", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(p) 256", spriv, t);
BenchMarkVerification("ECDSA over GF(p) 256", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(p) 256", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(p) 256", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(p) 256", spriv3, t);
BenchMarkVerification("ECGDSA over GF(p) 256", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(p) 256", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(p) 256", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(p) 256", ecmqvc, t);
}
std::cout << "\n<TBODY style=\"background: yellow;\">";
{
ECIES<EC2N>::Decryptor cpriv(Test::GlobalRNG(), ASN1::sect233r1());
ECIES<EC2N>::Encryptor cpub(cpriv);
ECDSA<EC2N, SHA1>::Signer spriv(cpriv);
ECDSA<EC2N, SHA1>::Verifier spub(spriv);
ECDSA_RFC6979<EC2N, SHA1>::Signer spriv2(cpriv);
ECDSA_RFC6979<EC2N, SHA1>::Verifier spub2(spriv);
ECGDSA<EC2N, SHA1>::Signer spriv3(Test::GlobalRNG(), ASN1::sect233r1());
ECGDSA<EC2N, SHA1>::Verifier spub3(spriv3);
ECDH<EC2N>::Domain ecdhc(ASN1::sect233r1());
ECMQV<EC2N>::Domain ecmqvc(ASN1::sect233r1());
BenchMarkEncryption("ECIES over GF(2^n) 233", cpub, t);
BenchMarkDecryption("ECIES over GF(2^n) 233", cpriv, cpub, t);
BenchMarkSigning("ECDSA over GF(2^n) 233", spriv, t);
BenchMarkVerification("ECDSA over GF(2^n) 233", spriv, spub, t);
BenchMarkSigning("ECDSA-RFC6979 over GF(2^n) 233", spriv2, t);
BenchMarkVerification("ECDSA-RFC6979 over GF(2^n) 233", spriv2, spub2, t);
BenchMarkSigning("ECGDSA over GF(2^n) 233", spriv3, t);
BenchMarkVerification("ECGDSA over GF(2^n) 233", spriv3, spub3, t);
BenchMarkKeyGen("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkAgreement("ECDHC over GF(2^n) 233", ecdhc, t);
BenchMarkKeyGen("ECMQVC over GF(2^n) 233", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(2^n) 233", ecmqvc, t);
}
std::cout << "\n</TABLE>" << std::endl;
}
NAMESPACE_END // Test
NAMESPACE_END // CryptoPP

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,17 @@
// blake2.cpp - written and placed in the public domain by Jeffrey Walton and Zooko
// Wilcox-O'Hearn. Based on Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
// reference BLAKE2 implementation at http://github.com/BLAKE2/BLAKE2.
// blake2.cpp - written and placed in the public domain by Jeffrey Walton
// and Zooko Wilcox-O'Hearn. Based on Aumasson, Neves,
// Wilcox-O'Hearn and Winnerlein's reference BLAKE2
// implementation at http://github.com/BLAKE2/BLAKE2.
//
// The BLAKE2b and BLAKE2s numbers are consistent with the BLAKE2 team's
// numbers. However, we have an Altivec/POWER7 implementation of BLAKE2s,
// and a POWER8 implementation of BLAKE2b (BLAKE2 is missing them). The
// Altivec/POWER7 code is about 2x faster than C++ when using GCC 5.0 or
// above. The POWER8 code is about 2.5x faster than C++ when using GCC 5.0
// or above. If you use GCC 4.0 (PowerMac) or GCC 4.8 (GCC Compile Farm)
// then the PowerPC code will be slower than C++. Be sure to use GCC 5.0
// or above for PowerPC builds or disable Altivec for BLAKE2b and BLAKE2s
// if using the old compilers.
#include "pch.h"
#include "config.h"
@ -14,6 +25,8 @@
// Do so in both blake2.cpp and blake2-simd.cpp.
// #undef CRYPTOPP_SSE41_AVAILABLE
// #undef CRYPTOPP_ARM_NEON_AVAILABLE
// #undef CRYPTOPP_ALTIVEC_AVAILABLE
// #undef CRYPTOPP_POWER8_AVAILABLE
// Disable NEON/ASIMD for Cortex-A53 and A57. The shifts are too slow and C/C++ is about
// 3 cpb faster than NEON/ASIMD. Also see http://github.com/weidai11/cryptopp/issues/367.
@ -21,6 +34,37 @@
# undef CRYPTOPP_ARM_NEON_AVAILABLE
#endif
// BLAKE2s bug on AIX 7.1 (POWER7) with XLC 12.01
// https://github.com/weidai11/cryptopp/issues/743
#if defined(__xlC__) && (__xlC__ < 0x0d01)
# define CRYPTOPP_DISABLE_ALTIVEC 1
# define CRYPTOPP_POWER7_ALTIVEC 1
# undef CRYPTOPP_POWER7_AVAILABLE
# undef CRYPTOPP_ALTIVEC_AVAILABLE
#endif
NAMESPACE_BEGIN(CryptoPP)
// Export the tables to the SIMD files
extern const word32 BLAKE2S_IV[8];
extern const word64 BLAKE2B_IV[8];
CRYPTOPP_ALIGN_DATA(16)
const word32 BLAKE2S_IV[8] = {
0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
};
CRYPTOPP_ALIGN_DATA(16)
const word64 BLAKE2B_IV[8] = {
W64LIT(0x6a09e667f3bcc908), W64LIT(0xbb67ae8584caa73b),
W64LIT(0x3c6ef372fe94f82b), W64LIT(0xa54ff53a5f1d36f1),
W64LIT(0x510e527fade682d1), W64LIT(0x9b05688c2b3e6c1f),
W64LIT(0x1f83d9abfb41bd6b), W64LIT(0x5be0cd19137e2179)
};
NAMESPACE_END
ANONYMOUS_NAMESPACE_BEGIN
using CryptoPP::byte;
@ -28,27 +72,6 @@ using CryptoPP::word32;
using CryptoPP::word64;
using CryptoPP::rotrConstant;
template <class W, bool T_64bit>
struct BLAKE2_IV
{
CRYPTOPP_ALIGN_DATA(16)
static const W iv[8];
};
template <>
const word32 BLAKE2_IV<word32, false>::iv[8] = {
0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
};
template <>
const word64 BLAKE2_IV<word64, true>::iv[8] = {
W64LIT(0x6a09e667f3bcc908), W64LIT(0xbb67ae8584caa73b),
W64LIT(0x3c6ef372fe94f82b), W64LIT(0xa54ff53a5f1d36f1),
W64LIT(0x510e527fade682d1), W64LIT(0x9b05688c2b3e6c1f),
W64LIT(0x1f83d9abfb41bd6b), W64LIT(0x5be0cd19137e2179)
};
CRYPTOPP_ALIGN_DATA(16)
const byte BLAKE2S_SIGMA[10][16] = {
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
@ -135,346 +158,575 @@ ANONYMOUS_NAMESPACE_END
NAMESPACE_BEGIN(CryptoPP)
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2_State<word32, false>& state);
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2_State<word64, true>& state);
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2s_State& state);
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2b_State& state);
#if CRYPTOPP_SSE41_AVAILABLE
extern void BLAKE2_Compress32_SSE4(const byte* input, BLAKE2_State<word32, false>& state);
extern void BLAKE2_Compress64_SSE4(const byte* input, BLAKE2_State<word64, true>& state);
extern void BLAKE2_Compress32_SSE4(const byte* input, BLAKE2s_State& state);
extern void BLAKE2_Compress64_SSE4(const byte* input, BLAKE2b_State& state);
#endif
#if CRYPTOPP_ARM_NEON_AVAILABLE
extern void BLAKE2_Compress32_NEON(const byte* input, BLAKE2_State<word32, false>& state);
extern void BLAKE2_Compress64_NEON(const byte* input, BLAKE2_State<word64, true>& state);
extern void BLAKE2_Compress32_NEON(const byte* input, BLAKE2s_State& state);
extern void BLAKE2_Compress64_NEON(const byte* input, BLAKE2b_State& state);
#endif
BLAKE2_ParameterBlock<false>::BLAKE2_ParameterBlock(size_t digestLen, size_t keyLen,
#if CRYPTOPP_POWER7_AVAILABLE
extern void BLAKE2_Compress32_POWER7(const byte* input, BLAKE2s_State& state);
#elif CRYPTOPP_ALTIVEC_AVAILABLE
extern void BLAKE2_Compress32_ALTIVEC(const byte* input, BLAKE2s_State& state);
#endif
#if CRYPTOPP_POWER8_AVAILABLE
extern void BLAKE2_Compress64_POWER8(const byte* input, BLAKE2b_State& state);
#endif
unsigned int BLAKE2b::OptimalDataAlignment() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return 16;
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return 4;
else
#endif
#if (CRYPTOPP_POWER8_AVAILABLE)
if (HasPower8())
return 16;
else
#endif
return GetAlignmentOf<word64>();
}
std::string BLAKE2b::AlgorithmProvider() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return "SSE4.1";
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return "NEON";
else
#endif
#if (CRYPTOPP_POWER8_AVAILABLE)
if (HasPower8())
return "Power8";
else
#endif
return "C++";
}
unsigned int BLAKE2s::OptimalDataAlignment() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return 16;
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return 4;
else
#endif
#if (CRYPTOPP_POWER7_AVAILABLE)
if (HasPower7())
return 16;
else
#elif (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return 16;
else
#endif
return GetAlignmentOf<word32>();
}
std::string BLAKE2s::AlgorithmProvider() const
{
#if defined(CRYPTOPP_SSE41_AVAILABLE)
if (HasSSE41())
return "SSE4.1";
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return "NEON";
else
#endif
#if (CRYPTOPP_POWER7_AVAILABLE)
if (HasPower7())
return "Power7";
else
#elif (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return "Altivec";
else
#endif
return "C++";
}
void BLAKE2s_State::Reset()
{
std::memset(m_hft, 0x00, m_hft.SizeInBytes());
m_len = 0;
}
void BLAKE2b_State::Reset()
{
std::memset(m_hft, 0x00, m_hft.SizeInBytes());
m_len = 0;
}
BLAKE2s_ParameterBlock::BLAKE2s_ParameterBlock(size_t digestLen, size_t keyLen,
const byte* saltStr, size_t saltLen,
const byte* personalizationStr, size_t personalizationLen)
{
// Avoid Coverity finding SIZEOF_MISMATCH/suspicious_sizeof
digestLength = (byte)digestLen;
keyLength = (byte)keyLen;
fanout = depth = 1;
nodeDepth = innerLength = 0;
memset(leafLength, 0x00, COUNTOF(leafLength));
memset(nodeOffset, 0x00, COUNTOF(nodeOffset));
Reset(digestLen, keyLen);
if (saltStr && saltLen)
{
memcpy_s(salt, COUNTOF(salt), saltStr, saltLen);
const size_t rem = COUNTOF(salt) - saltLen;
const size_t off = COUNTOF(salt) - rem;
if (rem)
memset(salt+off, 0x00, rem);
}
else
{
memset(salt, 0x00, COUNTOF(salt));
}
memcpy_s(salt(), SALTSIZE, saltStr, saltLen);
if (personalizationStr && personalizationLen)
{
memcpy_s(personalization, COUNTOF(personalization), personalizationStr, personalizationLen);
const size_t rem = COUNTOF(personalization) - personalizationLen;
const size_t off = COUNTOF(personalization) - rem;
if (rem)
memset(personalization+off, 0x00, rem);
}
else
{
memset(personalization, 0x00, COUNTOF(personalization));
}
memcpy_s(personalization(), PERSONALIZATIONSIZE, personalizationStr, personalizationLen);
}
BLAKE2_ParameterBlock<true>::BLAKE2_ParameterBlock(size_t digestLen, size_t keyLen,
BLAKE2b_ParameterBlock::BLAKE2b_ParameterBlock(size_t digestLen, size_t keyLen,
const byte* saltStr, size_t saltLen,
const byte* personalizationStr, size_t personalizationLen)
{
// Avoid Coverity finding SIZEOF_MISMATCH/suspicious_sizeof
digestLength = (byte)digestLen;
keyLength = (byte)keyLen;
fanout = depth = 1;
nodeDepth = innerLength = 0;
memset(rfu, 0x00, COUNTOF(rfu));
memset(leafLength, 0x00, COUNTOF(leafLength));
memset(nodeOffset, 0x00, COUNTOF(nodeOffset));
Reset(digestLen, keyLen);
if (saltStr && saltLen)
{
memcpy_s(salt, COUNTOF(salt), saltStr, saltLen);
const size_t rem = COUNTOF(salt) - saltLen;
const size_t off = COUNTOF(salt) - rem;
if (rem)
memset(salt+off, 0x00, rem);
}
else
{
memset(salt, 0x00, COUNTOF(salt));
}
memcpy_s(salt(), SALTSIZE, saltStr, saltLen);
if (personalizationStr && personalizationLen)
{
memcpy_s(personalization, COUNTOF(personalization), personalizationStr, personalizationLen);
const size_t rem = COUNTOF(personalization) - personalizationLen;
const size_t off = COUNTOF(personalization) - rem;
if (rem)
memset(personalization+off, 0x00, rem);
}
else
{
memset(personalization, 0x00, COUNTOF(personalization));
}
memcpy_s(personalization(), PERSONALIZATIONSIZE, personalizationStr, personalizationLen);
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::UncheckedSetKey(const byte *key, unsigned int length, const CryptoPP::NameValuePairs& params)
void BLAKE2s_ParameterBlock::Reset(size_t digestLen, size_t keyLen)
{
if (key && length)
{
AlignedSecByteBlock temp(BLOCKSIZE);
memcpy_s(temp, BLOCKSIZE, key, length);
const size_t rem = BLOCKSIZE - length;
if (rem)
memset(temp+length, 0x00, rem);
m_key.swap(temp);
}
else
{
m_key.resize(0);
}
// Avoid Coverity finding SIZEOF_MISMATCH/suspicious_sizeof
ParameterBlock& block = *m_block.data();
memset(m_block.data(), 0x00, sizeof(ParameterBlock));
block.keyLength = (byte)length;
block.digestLength = (byte)params.GetIntValueWithDefault(Name::DigestSize(), DIGESTSIZE);
block.fanout = block.depth = 1;
ConstByteArrayParameter t;
if (params.GetValue(Name::Salt(), t) && t.begin() && t.size())
{
memcpy_s(block.salt, COUNTOF(block.salt), t.begin(), t.size());
const size_t rem = COUNTOF(block.salt) - t.size();
const size_t off = COUNTOF(block.salt) - rem;
if (rem)
memset(block.salt+off, 0x00, rem);
}
else
{
memset(block.salt, 0x00, COUNTOF(block.salt));
}
if (params.GetValue(Name::Personalization(), t) && t.begin() && t.size())
{
memcpy_s(block.personalization, COUNTOF(block.personalization), t.begin(), t.size());
const size_t rem = COUNTOF(block.personalization) - t.size();
const size_t off = COUNTOF(block.personalization) - rem;
if (rem)
memset(block.personalization+off, 0x00, rem);
}
else
{
memset(block.personalization, 0x00, COUNTOF(block.personalization));
}
std::memset(m_data, 0x00, m_data.size());
m_data[DigestOff] = static_cast<byte>(digestLen);
m_data[KeyOff] = static_cast<byte>(keyLen);
m_data[FanoutOff] = m_data[DepthOff] = 1;
}
template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base() : m_state(1), m_block(1), m_digestSize(DIGESTSIZE), m_treeMode(false)
void BLAKE2b_ParameterBlock::Reset(size_t digestLen, size_t keyLen)
{
UncheckedSetKey(NULLPTR, 0, g_nullNameValuePairs);
Restart();
std::memset(m_data, 0x00, m_data.size());
m_data[DigestOff] = static_cast<byte>(digestLen);
m_data[KeyOff] = static_cast<byte>(keyLen);
m_data[FanoutOff] = m_data[DepthOff] = 1;
}
template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base(bool treeMode, unsigned int digestSize) : m_state(1), m_block(1), m_digestSize(digestSize), m_treeMode(treeMode)
BLAKE2s::BLAKE2s(bool treeMode, unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(0), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
UncheckedSetKey(NULLPTR, 0, MakeParameters(Name::DigestSize(), (int)digestSize)(Name::TreeMode(), treeMode, false));
Restart();
UncheckedSetKey(NULLPTR, 0, MakeParameters
(Name::DigestSize(), (int)digestSize)
(Name::TreeMode(), treeMode));
}
template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
BLAKE2b::BLAKE2b(bool treeMode, unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(0), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
UncheckedSetKey(NULLPTR, 0, MakeParameters
(Name::DigestSize(), (int)digestSize)
(Name::TreeMode(), treeMode));
}
BLAKE2s::BLAKE2s(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength, bool treeMode, unsigned int digestSize)
: m_state(1), m_block(1), m_digestSize(digestSize), m_treeMode(treeMode)
: m_digestSize(digestSize), m_keyLength(static_cast<unsigned int>(keyLength)), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(keyLength <= MAX_KEYLENGTH);
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
CRYPTOPP_ASSERT(saltLength <= SALTSIZE);
CRYPTOPP_ASSERT(personalizationLength <= PERSONALIZATIONSIZE);
UncheckedSetKey(key, static_cast<unsigned int>(keyLength), MakeParameters(Name::DigestSize(),(int)digestSize)(Name::TreeMode(),treeMode, false)
(Name::Salt(), ConstByteArrayParameter(salt, saltLength))(Name::Personalization(), ConstByteArrayParameter(personalization, personalizationLength)));
UncheckedSetKey(key, static_cast<unsigned int>(keyLength), MakeParameters
(Name::DigestSize(),(int)digestSize)
(Name::TreeMode(),treeMode)
(Name::Salt(), ConstByteArrayParameter(salt, saltLength))
(Name::Personalization(), ConstByteArrayParameter(personalization, personalizationLength)));
}
BLAKE2b::BLAKE2b(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength, bool treeMode, unsigned int digestSize)
: m_digestSize(digestSize), m_keyLength(static_cast<unsigned int>(keyLength)), m_treeMode(treeMode)
{
CRYPTOPP_ASSERT(keyLength <= MAX_KEYLENGTH);
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
CRYPTOPP_ASSERT(saltLength <= SALTSIZE);
CRYPTOPP_ASSERT(personalizationLength <= PERSONALIZATIONSIZE);
UncheckedSetKey(key, static_cast<unsigned int>(keyLength), MakeParameters
(Name::DigestSize(),(int)digestSize)
(Name::TreeMode(),treeMode)
(Name::Salt(), ConstByteArrayParameter(salt, saltLength))
(Name::Personalization(), ConstByteArrayParameter(personalization, personalizationLength)));
}
void BLAKE2s::UncheckedSetKey(const byte *key, unsigned int length, const CryptoPP::NameValuePairs& params)
{
if (key && length)
{
m_key.New(BLOCKSIZE);
std::memcpy(m_key, key, length);
std::memset(m_key + length, 0x00, BLOCKSIZE - length);
m_keyLength = length;
}
else
{
m_key.resize(0);
m_keyLength = 0;
}
m_digestSize = static_cast<unsigned int>(params.GetIntValueWithDefault(
Name::DigestSize(), static_cast<int>(m_digestSize)));
m_state.Reset();
m_block.Reset(m_digestSize, m_keyLength);
(void)params.GetValue(Name::TreeMode(), m_treeMode);
ConstByteArrayParameter t;
if (params.GetValue(Name::Salt(), t) && t.begin() && t.size())
memcpy_s(m_block.salt(), SALTSIZE, t.begin(), t.size());
if (params.GetValue(Name::Personalization(), t) && t.begin() && t.size())
memcpy_s(m_block.personalization(), PERSONALIZATIONSIZE, t.begin(), t.size());
Restart();
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::Restart()
void BLAKE2b::UncheckedSetKey(const byte *key, unsigned int length, const CryptoPP::NameValuePairs& params)
{
static const W zero[2] = {0,0};
Restart(*m_block.data(), zero);
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::Restart(const BLAKE2_ParameterBlock<T_64bit>& block, const W counter[2])
{
// We take a parameter block as a parameter to allow customized state.
// Avoid the copy of the parameter block when we are passing our own block.
if (&block != m_block.data())
if (key && length)
{
memcpy_s(m_block.data(), sizeof(ParameterBlock), &block, sizeof(ParameterBlock));
m_block.data()->digestLength = (byte)m_digestSize;
m_block.data()->keyLength = (byte)m_key.size();
m_key.New(BLOCKSIZE);
std::memcpy(m_key, key, length);
std::memset(m_key + length, 0x00, BLOCKSIZE - length);
m_keyLength = length;
}
else
{
m_key.resize(0);
m_keyLength = 0;
}
State& state = *m_state.data();
state.t[0] = state.t[1] = 0, state.f[0] = state.f[1] = 0, state.length = 0;
m_digestSize = static_cast<unsigned int>(params.GetIntValueWithDefault(
Name::DigestSize(), static_cast<int>(m_digestSize)));
m_state.Reset();
m_block.Reset(m_digestSize, m_keyLength);
(void)params.GetValue(Name::TreeMode(), m_treeMode);
ConstByteArrayParameter t;
if (params.GetValue(Name::Salt(), t) && t.begin() && t.size())
memcpy_s(m_block.salt(), SALTSIZE, t.begin(), t.size());
if (params.GetValue(Name::Personalization(), t) && t.begin() && t.size())
memcpy_s(m_block.personalization(), PERSONALIZATIONSIZE, t.begin(), t.size());
Restart();
}
void BLAKE2s::Restart()
{
static const word32 zero[2] = {0,0};
Restart(m_block, zero);
}
void BLAKE2b::Restart()
{
static const word64 zero[2] = {0,0};
Restart(m_block, zero);
}
void BLAKE2s::Restart(const BLAKE2s_ParameterBlock& block, const word32 counter[2])
{
// We take a counter as a parameter to allow customized state.
m_state.Reset();
if (counter != NULLPTR)
{
state.t[0] = counter[0];
state.t[1] = counter[1];
word32* t = m_state.t();
t[0] = counter[0];
t[1] = counter[1];
}
const W* iv = BLAKE2_IV<W, T_64bit>::iv;
PutBlock<W, LittleEndian, true> put(m_block.data(), &state.h[0]);
// We take a parameter block as a parameter to allow customized state.
// Avoid the copy of the parameter block when we are passing our own block.
if (block.data() == m_block.data())
m_block.Reset(m_digestSize, m_keyLength);
else
{
std::memcpy(m_block.data(), block.data(), m_block.size());
m_block.m_data[BLAKE2s_ParameterBlock::DigestOff] = (byte)m_digestSize;
m_block.m_data[BLAKE2s_ParameterBlock::KeyOff] = (byte)m_keyLength;
}
const word32* iv = BLAKE2S_IV;
PutBlock<word32, LittleEndian, true> put(m_block.data(), m_state.h());
put(iv[0])(iv[1])(iv[2])(iv[3])(iv[4])(iv[5])(iv[6])(iv[7]);
// When BLAKE2 is keyed, the input stream is simply {key||message}. Key it
// during Restart to avoid FirstPut and friends. Key size == 0 means no key.
if (m_key.size())
Update(m_key, m_key.size());
// When BLAKE2 is keyed, the input stream is simply {key || 0 || message}.
// The key is padded to a full Blocksize with 0. Key it during Restart to
// avoid FirstPut and friends. Key size == 0 means no key.
if (m_keyLength)
Update(m_key, BLOCKSIZE);
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::Update(const byte *input, size_t length)
void BLAKE2b::Restart(const BLAKE2b_ParameterBlock& block, const word64 counter[2])
{
State& state = *m_state.data();
if (state.length + length > BLOCKSIZE)
// We take a counter as a parameter to allow customized state.
m_state.Reset();
if (counter != NULLPTR)
{
// Complete current block
const size_t fill = BLOCKSIZE - state.length;
memcpy_s(&state.buffer[state.length], fill, input, fill);
word64* t = m_state.t();
t[0] = counter[0];
t[1] = counter[1];
}
IncrementCounter();
Compress(state.buffer);
state.length = 0;
// We take a parameter block as a parameter to allow customized state.
// Avoid the copy of the parameter block when we are passing our own block.
if (block.data() == m_block.data())
m_block.Reset(m_digestSize, m_keyLength);
else
{
std::memcpy(m_block.data(), block.data(), m_block.size());
m_block.m_data[BLAKE2b_ParameterBlock::DigestOff] = (byte)m_digestSize;
m_block.m_data[BLAKE2b_ParameterBlock::KeyOff] = (byte)m_keyLength;
}
length -= fill, input += fill;
const word64* iv = BLAKE2B_IV;
PutBlock<word64, LittleEndian, true> put(m_block.data(), m_state.h());
put(iv[0])(iv[1])(iv[2])(iv[3])(iv[4])(iv[5])(iv[6])(iv[7]);
// When BLAKE2 is keyed, the input stream is simply {key || 0 || message}.
// The key is padded to a full Blocksize with 0. Key it during Restart to
// avoid FirstPut and friends. Key size == 0 means no key.
if (m_keyLength)
Update(m_key, BLOCKSIZE);
}
void BLAKE2s::Update(const byte *input, size_t length)
{
CRYPTOPP_ASSERT(input != NULLPTR || length == 0);
if (length > BLOCKSIZE - m_state.m_len)
{
if (m_state.m_len != 0)
{
// Complete current block
const size_t fill = BLOCKSIZE - m_state.m_len;
std::memcpy(m_state.m_buf+m_state.m_len, input, fill);
IncrementCounter(BLOCKSIZE);
Compress(m_state.m_buf);
m_state.m_len = 0;
length -= fill, input += fill;
}
// Compress in-place to avoid copies
while (length > BLOCKSIZE)
{
IncrementCounter();
IncrementCounter(BLOCKSIZE);
Compress(input);
length -= BLOCKSIZE, input += BLOCKSIZE;
}
}
// Copy tail bytes
if (input && length)
if (length)
{
CRYPTOPP_ASSERT(length <= BLOCKSIZE - state.length);
memcpy_s(&state.buffer[state.length], length, input, length);
state.length += static_cast<unsigned int>(length);
CRYPTOPP_ASSERT(length <= BLOCKSIZE - m_state.m_len);
std::memcpy(m_state.m_buf+m_state.m_len, input, length);
m_state.m_len += static_cast<unsigned int>(length);
}
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::TruncatedFinal(byte *hash, size_t size)
void BLAKE2b::Update(const byte *input, size_t length)
{
CRYPTOPP_ASSERT(input != NULLPTR || length == 0);
if (length > BLOCKSIZE - m_state.m_len)
{
if (m_state.m_len != 0)
{
// Complete current block
const size_t fill = BLOCKSIZE - m_state.m_len;
std::memcpy(m_state.m_buf+m_state.m_len, input, fill);
IncrementCounter(BLOCKSIZE);
Compress(m_state.m_buf);
m_state.m_len = 0;
length -= fill, input += fill;
}
// Compress in-place to avoid copies
while (length > BLOCKSIZE)
{
CRYPTOPP_ASSERT(m_state.m_len == 0);
IncrementCounter(BLOCKSIZE);
Compress(input);
length -= BLOCKSIZE, input += BLOCKSIZE;
}
}
// Copy tail bytes
if (length)
{
CRYPTOPP_ASSERT(length <= BLOCKSIZE - m_state.m_len);
std::memcpy(m_state.m_buf + m_state.m_len, input, length);
m_state.m_len += static_cast<unsigned int>(length);
}
}
void BLAKE2s::TruncatedFinal(byte *hash, size_t size)
{
CRYPTOPP_ASSERT(hash != NULLPTR);
this->ThrowIfInvalidTruncatedSize(size);
word32* f = m_state.f();
// Set last block unconditionally
State& state = *m_state.data();
state.f[0] = static_cast<W>(-1);
f[0] = ~static_cast<word32>(0);
// Set last node if tree mode
if (m_treeMode)
state.f[1] = static_cast<W>(-1);
f[1] = ~static_cast<word32>(0);
// Increment counter for tail bytes only
IncrementCounter(state.length);
IncrementCounter(m_state.m_len);
memset(state.buffer + state.length, 0x00, BLOCKSIZE - state.length);
Compress(state.buffer);
std::memset(m_state.m_buf + m_state.m_len, 0x00, BLOCKSIZE - m_state.m_len);
Compress(m_state.m_buf);
// Copy to caller buffer
memcpy_s(hash, size, &state.h[0], size);
std::memcpy(hash, m_state.h(), size);
Restart();
}
template <class W, bool T_64bit>
void BLAKE2_Base<W, T_64bit>::IncrementCounter(size_t count)
void BLAKE2b::TruncatedFinal(byte *hash, size_t size)
{
State& state = *m_state.data();
state.t[0] += static_cast<W>(count);
state.t[1] += !!(state.t[0] < count);
CRYPTOPP_ASSERT(hash != NULLPTR);
this->ThrowIfInvalidTruncatedSize(size);
word64* f = m_state.f();
// Set last block unconditionally
f[0] = ~static_cast<word64>(0);
// Set last node if tree mode
if (m_treeMode)
f[1] = ~static_cast<word64>(0);
// Increment counter for tail bytes only
IncrementCounter(m_state.m_len);
std::memset(m_state.m_buf + m_state.m_len, 0x00, BLOCKSIZE - m_state.m_len);
Compress(m_state.m_buf);
// Copy to caller buffer
std::memcpy(hash, m_state.h(), size);
Restart();
}
template <>
void BLAKE2_Base<word64, true>::Compress(const byte *input)
void BLAKE2s::IncrementCounter(size_t count)
{
word32* t = m_state.t();
t[0] += static_cast<word32>(count);
t[1] += !!(t[0] < count);
}
void BLAKE2b::IncrementCounter(size_t count)
{
word64* t = m_state.t();
t[0] += static_cast<word64>(count);
t[1] += !!(t[0] < count);
}
void BLAKE2s::Compress(const byte *input)
{
#if CRYPTOPP_SSE41_AVAILABLE
if(HasSSE41())
{
return BLAKE2_Compress64_SSE4(input, *m_state.data());
return BLAKE2_Compress32_SSE4(input, m_state);
}
#endif
#if CRYPTOPP_ARM_NEON_AVAILABLE
if(HasNEON())
{
return BLAKE2_Compress64_NEON(input, *m_state.data());
return BLAKE2_Compress32_NEON(input, m_state);
}
#endif
return BLAKE2_Compress64_CXX(input, *m_state.data());
#if CRYPTOPP_POWER7_AVAILABLE
if(HasPower7())
{
return BLAKE2_Compress32_POWER7(input, m_state);
}
#elif CRYPTOPP_ALTIVEC_AVAILABLE
if(HasAltivec())
{
return BLAKE2_Compress32_ALTIVEC(input, m_state);
}
#endif
return BLAKE2_Compress32_CXX(input, m_state);
}
template <>
void BLAKE2_Base<word32, false>::Compress(const byte *input)
void BLAKE2b::Compress(const byte *input)
{
#if CRYPTOPP_SSE41_AVAILABLE
if(HasSSE41())
{
return BLAKE2_Compress32_SSE4(input, *m_state.data());
return BLAKE2_Compress64_SSE4(input, m_state);
}
#endif
#if CRYPTOPP_ARM_NEON_AVAILABLE
if(HasNEON())
{
return BLAKE2_Compress32_NEON(input, *m_state.data());
return BLAKE2_Compress64_NEON(input, m_state);
}
#endif
return BLAKE2_Compress32_CXX(input, *m_state.data());
#if CRYPTOPP_POWER8_AVAILABLE
if(HasPower8())
{
return BLAKE2_Compress64_POWER8(input, m_state);
}
#endif
return BLAKE2_Compress64_CXX(input, m_state);
}
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2_State<word64, true>& state)
void BLAKE2_Compress64_CXX(const byte* input, BLAKE2b_State& state)
{
word64 m[16], v[16];
GetBlock<word64, LittleEndian, true> get1(input);
get1(m[0])(m[1])(m[2])(m[3])(m[4])(m[5])(m[6])(m[7])(m[8])(m[9])(m[10])(m[11])(m[12])(m[13])(m[14])(m[15]);
GetBlock<word64, LittleEndian, true> get2(&state.h[0]);
GetBlock<word64, LittleEndian, true> get2(state.h());
get2(v[0])(v[1])(v[2])(v[3])(v[4])(v[5])(v[6])(v[7]);
const word64* iv = BLAKE2_IV<word64, true>::iv;
const word64* iv = BLAKE2B_IV;
const word64* tf = state.t();
v[ 8] = iv[0];
v[ 9] = iv[1];
v[10] = iv[2];
v[11] = iv[3];
v[12] = state.t[0] ^ iv[4];
v[13] = state.t[1] ^ iv[5];
v[14] = state.f[0] ^ iv[6];
v[15] = state.f[1] ^ iv[7];
v[12] = tf[0] ^ iv[4];
v[13] = tf[1] ^ iv[5];
v[14] = tf[2] ^ iv[6];
v[15] = tf[3] ^ iv[7];
BLAKE2B_ROUND<0>(m, v);
BLAKE2B_ROUND<1>(m, v);
@ -489,29 +741,31 @@ void BLAKE2_Compress64_CXX(const byte* input, BLAKE2_State<word64, true>& state)
BLAKE2B_ROUND<10>(m, v);
BLAKE2B_ROUND<11>(m, v);
for(unsigned int i = 0; i < 8; ++i)
state.h[i] = state.h[i] ^ ConditionalByteReverse(LittleEndian::ToEnum(), v[i] ^ v[i + 8]);
word64* h = state.h();
for (unsigned int i = 0; i < 8; ++i)
h[i] = h[i] ^ ConditionalByteReverse(LITTLE_ENDIAN_ORDER, v[i] ^ v[i + 8]);
}
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2_State<word32, false>& state)
void BLAKE2_Compress32_CXX(const byte* input, BLAKE2s_State& state)
{
word32 m[16], v[16];
GetBlock<word32, LittleEndian, true> get1(input);
get1(m[0])(m[1])(m[2])(m[3])(m[4])(m[5])(m[6])(m[7])(m[8])(m[9])(m[10])(m[11])(m[12])(m[13])(m[14])(m[15]);
GetBlock<word32, LittleEndian, true> get2(&state.h[0]);
GetBlock<word32, LittleEndian, true> get2(state.h());
get2(v[0])(v[1])(v[2])(v[3])(v[4])(v[5])(v[6])(v[7]);
const word32* iv = BLAKE2_IV<word32, false>::iv;
const word32* iv = BLAKE2S_IV;
const word32* tf = state.t();
v[ 8] = iv[0];
v[ 9] = iv[1];
v[10] = iv[2];
v[11] = iv[3];
v[12] = state.t[0] ^ iv[4];
v[13] = state.t[1] ^ iv[5];
v[14] = state.f[0] ^ iv[6];
v[15] = state.f[1] ^ iv[7];
v[12] = tf[0] ^ iv[4];
v[13] = tf[1] ^ iv[5];
v[14] = tf[2] ^ iv[6];
v[15] = tf[3] ^ iv[7];
BLAKE2S_ROUND<0>(m, v);
BLAKE2S_ROUND<1>(m, v);
@ -524,11 +778,9 @@ void BLAKE2_Compress32_CXX(const byte* input, BLAKE2_State<word32, false>& state
BLAKE2S_ROUND<8>(m, v);
BLAKE2S_ROUND<9>(m, v);
for(unsigned int i = 0; i < 8; ++i)
state.h[i] = state.h[i] ^ ConditionalByteReverse(LittleEndian::ToEnum(), v[i] ^ v[i + 8]);
word32* h = state.h();
for (unsigned int i = 0; i < 8; ++i)
h[i] = h[i] ^ ConditionalByteReverse(LITTLE_ENDIAN_ORDER, v[i] ^ v[i + 8]);
}
template class BLAKE2_Base<word32, false>;
template class BLAKE2_Base<word64, true>;
NAMESPACE_END

View File

@ -1,6 +1,7 @@
// blake2.h - written and placed in the public domain by Jeffrey Walton and Zooko
// Wilcox-O'Hearn. Based on Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
// reference BLAKE2 implementation at http://github.com/BLAKE2/BLAKE2.
// blake2.h - written and placed in the public domain by Jeffrey Walton
// and Zooko Wilcox-O'Hearn. Based on Aumasson, Neves,
// Wilcox-O'Hearn and Winnerlein's reference BLAKE2
// implementation at http://github.com/BLAKE2/BLAKE2.
/// \file blake2.h
/// \brief Classes for BLAKE2b and BLAKE2s message digests and keyed message digests
@ -9,10 +10,8 @@
/// Static algorithm name return either "BLAKE2b" or "BLAKE2s". An object algorithm name follows
/// the naming described in <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The
/// BLAKE2 Cryptographic Hash and Message Authentication Code (MAC)</A>.
/// \details The library provides specialized SSE2, SSE4 and NEON version of the BLAKE2 compression
/// function. For best results under ARM NEON, specify both an architecture and cpu. For example:
/// <pre>CXXFLAGS="-DNDEBUG -march=armv8-a+crc -mcpu=cortex-a53 ..."</pre>
/// \since Crypto++ 5.6.4
/// \since C++ since Crypto++ 5.6.4, SSE since Crypto++ 5.6.4, NEON since Crypto++ 6.0,
/// Power8 since Crypto++ 8.0
#ifndef CRYPTOPP_BLAKE2_H
#define CRYPTOPP_BLAKE2_H
@ -23,249 +22,206 @@
NAMESPACE_BEGIN(CryptoPP)
/// \brief BLAKE2 hash information
/// \tparam T_64bit flag indicating 64-bit
/// \brief BLAKE2s hash information
/// \since Crypto++ 5.6.4
template <bool T_64bit>
struct BLAKE2_Info : public VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 64 : 32),1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
struct BLAKE2s_Info : public VariableKeyLength<32,0,32,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
{
typedef VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 64 : 32),1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> KeyBase;
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH)
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH)
typedef VariableKeyLength<32,0,32,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> KeyBase;
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH)
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH)
CRYPTOPP_CONSTANT(BLOCKSIZE = (T_64bit ? 128 : 64))
CRYPTOPP_CONSTANT(DIGESTSIZE = (T_64bit ? 64 : 32))
CRYPTOPP_CONSTANT(SALTSIZE = (T_64bit ? 16 : 8))
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = (T_64bit ? 16 : 8))
CRYPTOPP_CONSTANT(BLOCKSIZE = 64)
CRYPTOPP_CONSTANT(DIGESTSIZE = 32)
CRYPTOPP_CONSTANT(SALTSIZE = 8)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = 8)
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return (T_64bit ? "BLAKE2b" : "BLAKE2s");}
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2s";}
};
/// \brief BLAKE2 parameter block
/// \tparam T_64bit flag indicating 64-bit
/// \details BLAKE2b uses BLAKE2_ParameterBlock<true>, while BLAKE2s
/// uses BLAKE2_ParameterBlock<false>.
/// \brief BLAKE2b hash information
/// \since Crypto++ 5.6.4
template <bool T_64bit>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
struct BLAKE2b_Info : public VariableKeyLength<64,0,64,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
{
typedef VariableKeyLength<64,0,64,1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE> KeyBase;
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = KeyBase::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = KeyBase::MAX_KEYLENGTH)
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = KeyBase::DEFAULT_KEYLENGTH)
CRYPTOPP_CONSTANT(BLOCKSIZE = 128)
CRYPTOPP_CONSTANT(DIGESTSIZE = 64)
CRYPTOPP_CONSTANT(SALTSIZE = 16)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = 16)
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2b";}
};
/// \brief BLAKE2b parameter block specialization
template<>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<true>
/// \brief BLAKE2s parameter block
struct CRYPTOPP_NO_VTABLE BLAKE2s_ParameterBlock
{
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<true>::SALTSIZE)
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<true>::DIGESTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<true>::PERSONALIZATIONSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2s_Info::SALTSIZE)
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2s_Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2s_Info::PERSONALIZATIONSIZE)
BLAKE2_ParameterBlock()
{
memset(this, 0x00, sizeof(*this));
digestLength = DIGESTSIZE;
fanout = depth = 1;
}
BLAKE2s_ParameterBlock()
{
Reset();
}
BLAKE2_ParameterBlock(size_t digestSize)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
memset(this, 0x00, sizeof(*this));
digestLength = (byte)digestSize;
fanout = depth = 1;
}
BLAKE2s_ParameterBlock(size_t digestSize)
{
Reset(digestSize);
}
BLAKE2_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
BLAKE2s_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
byte digestLength;
byte keyLength, fanout, depth;
byte leafLength[4];
byte nodeOffset[8];
byte nodeDepth, innerLength, rfu[14];
byte salt[SALTSIZE];
byte personalization[PERSONALIZATIONSIZE];
void Reset(size_t digestLength=DIGESTSIZE, size_t keyLength=0);
byte* data() {
return m_data.data();
}
const byte* data() const {
return m_data.data();
}
size_t size() const {
return m_data.size();
}
byte* salt() {
return m_data + SaltOff;
}
byte* personalization() {
return m_data + PersonalizationOff;
}
// Offsets into the byte array
enum {
DigestOff = 0, KeyOff = 1, FanoutOff = 2, DepthOff = 3, LeafOff = 4, NodeOff = 8,
NodeDepthOff = 14, InnerOff = 15, SaltOff = 16, PersonalizationOff = 24
};
FixedSizeAlignedSecBlock<byte, 32, true> m_data;
};
/// \brief BLAKE2s parameter block specialization
template<>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock<false>
/// \brief BLAKE2b parameter block
struct CRYPTOPP_NO_VTABLE BLAKE2b_ParameterBlock
{
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<false>::SALTSIZE)
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<false>::DIGESTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<false>::PERSONALIZATIONSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2b_Info::SALTSIZE)
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2b_Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2b_Info::PERSONALIZATIONSIZE)
BLAKE2_ParameterBlock()
{
memset(this, 0x00, sizeof(*this));
digestLength = DIGESTSIZE;
fanout = depth = 1;
}
BLAKE2b_ParameterBlock()
{
Reset();
}
BLAKE2_ParameterBlock(size_t digestSize)
{
CRYPTOPP_ASSERT(digestSize <= DIGESTSIZE);
memset(this, 0x00, sizeof(*this));
digestLength = (byte)digestSize;
fanout = depth = 1;
}
BLAKE2b_ParameterBlock(size_t digestSize)
{
Reset(digestSize);
}
BLAKE2_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
BLAKE2b_ParameterBlock(size_t digestSize, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength);
byte digestLength;
byte keyLength, fanout, depth;
byte leafLength[4];
byte nodeOffset[6];
byte nodeDepth, innerLength;
byte salt[SALTSIZE];
byte personalization[PERSONALIZATIONSIZE];
void Reset(size_t digestLength=DIGESTSIZE, size_t keyLength=0);
byte* data() {
return m_data.data();
}
const byte* data() const {
return m_data.data();
}
size_t size() const {
return m_data.size();
}
byte* salt() {
return m_data + SaltOff;
}
byte* personalization() {
return m_data + PersonalizationOff;
}
// Offsets into the byte array
enum {
DigestOff = 0, KeyOff = 1, FanoutOff = 2, DepthOff = 3, LeafOff = 4, NodeOff = 8,
NodeDepthOff = 16, InnerOff = 17, RfuOff = 18, SaltOff = 32, PersonalizationOff = 48
};
FixedSizeAlignedSecBlock<byte, 64, true> m_data;
};
/// \brief BLAKE2 state information
/// \tparam W word type
/// \tparam T_64bit flag indicating 64-bit
/// \details BLAKE2b uses BLAKE2_State<word64, true>, while BLAKE2s
/// uses BLAKE2_State<word32, false>.
/// \brief BLAKE2s state information
/// \since Crypto++ 5.6.4
template <class W, bool T_64bit>
struct CRYPTOPP_NO_VTABLE BLAKE2_State
struct CRYPTOPP_NO_VTABLE BLAKE2s_State
{
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE)
BLAKE2s_State() {
Reset();
}
BLAKE2_State()
{
// Set all members except scratch buffer[]
h[0]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7] = 0;
t[0]=t[1]=f[0]=f[1] = 0;
length = 0;
}
void Reset();
// SSE2, SSE4 and NEON depend upon t[] and f[] being side-by-side
W h[8], t[2], f[2];
byte buffer[BLOCKSIZE];
size_t length;
inline word32* h() {
return m_hft.data();
}
inline word32* t() {
return m_hft.data() + 8;
}
inline word32* f() {
return m_hft.data() + 10;
}
inline byte* data() {
return m_buf.data();
}
// SSE4, Power7 and NEON depend upon t[] and f[] being side-by-side
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2s_Info::BLOCKSIZE)
FixedSizeAlignedSecBlock<word32, 8+2+2, true> m_hft;
FixedSizeAlignedSecBlock<byte, BLOCKSIZE, true> m_buf;
size_t m_len;
};
/// \brief BLAKE2 hash implementation
/// \tparam W word type
/// \tparam T_64bit flag indicating 64-bit
/// \details BLAKE2b uses BLAKE2_Base<word64, true>, while BLAKE2s
/// uses BLAKE2_Base<word32, false>.
/// \brief BLAKE2b state information
/// \since Crypto++ 5.6.4
template <class W, bool T_64bit>
class BLAKE2_Base : public SimpleKeyingInterfaceImpl<MessageAuthenticationCode, BLAKE2_Info<T_64bit> >
struct CRYPTOPP_NO_VTABLE BLAKE2b_State
{
public:
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2_Info<T_64bit>::DEFAULT_KEYLENGTH)
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2_Info<T_64bit>::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2_Info<T_64bit>::MAX_KEYLENGTH)
BLAKE2b_State() {
Reset();
}
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2_Info<T_64bit>::DIGESTSIZE)
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2_Info<T_64bit>::BLOCKSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2_Info<T_64bit>::SALTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2_Info<T_64bit>::PERSONALIZATIONSIZE)
void Reset();
typedef BLAKE2_State<W, T_64bit> State;
typedef BLAKE2_ParameterBlock<T_64bit> ParameterBlock;
typedef SecBlock<State, AllocatorWithCleanup<State, true> > AlignedState;
typedef SecBlock<ParameterBlock, AllocatorWithCleanup<ParameterBlock, true> > AlignedParameterBlock;
inline word64* h() {
return m_hft.data();
}
virtual ~BLAKE2_Base() {}
inline word64* t() {
return m_hft.data() + 8;
}
/// \brief Retrieve the static algorithm name
/// \returns the algorithm name (BLAKE2s or BLAKE2b)
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return BLAKE2_Info<T_64bit>::StaticAlgorithmName();}
inline word64* f() {
return m_hft.data() + 10;
}
/// \brief Retrieve the object's name
/// \returns the object's algorithm name following RFC 7693
/// \details Object algorithm name follows the naming described in
/// <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The BLAKE2 Cryptographic Hash and
/// Message Authentication Code (MAC)</A>. For example, "BLAKE2b-512" and "BLAKE2s-256".
std::string AlgorithmName() const {return std::string(StaticAlgorithmName()) + "-" + IntToString(this->DigestSize()*8);}
inline byte* data() {
return m_buf.data();
}
unsigned int DigestSize() const {return m_digestSize;}
unsigned int OptimalDataAlignment() const {return (CRYPTOPP_BOOL_ALIGN16 ? 16 : GetAlignmentOf<W>());}
void Update(const byte *input, size_t length);
void Restart();
/// \brief Restart a hash with parameter block and counter
/// \param block parameter block
/// \param counter counter array
/// \details Parameter block is persisted across calls to Restart().
void Restart(const BLAKE2_ParameterBlock<T_64bit>& block, const W counter[2]);
/// \brief Set tree mode
/// \param mode the new tree mode
/// \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
/// If <tt>treeMode=false</tt> (default), then State::f[1] is never set. If
/// <tt>treeMode=true</tt>, then State::f[1] is set when State::f[0] is set.
/// Tree mode is persisted across calls to Restart().
void SetTreeMode(bool mode) {m_treeMode=mode;}
/// \brief Get tree mode
/// \returns the current tree mode
/// \details Tree mode is persisted across calls to Restart().
bool GetTreeMode() const {return m_treeMode;}
void TruncatedFinal(byte *hash, size_t size);
protected:
BLAKE2_Base();
BLAKE2_Base(bool treeMode, unsigned int digestSize);
BLAKE2_Base(const byte *key, size_t keyLength, const byte* salt, size_t saltLength,
const byte* personalization, size_t personalizationLength,
bool treeMode, unsigned int digestSize);
// Operates on state buffer and/or input. Must be BLOCKSIZE, final block will pad with 0's.
void Compress(const byte *input);
inline void IncrementCounter(size_t count=BLOCKSIZE);
void UncheckedSetKey(const byte* key, unsigned int length, const CryptoPP::NameValuePairs& params);
private:
AlignedState m_state;
AlignedParameterBlock m_block;
AlignedSecByteBlock m_key;
word32 m_digestSize;
bool m_treeMode;
};
/// \brief The BLAKE2b cryptographic hash function
/// \details BLAKE2b can function as both a hash and keyed hash. If you want only the hash,
/// then use the BLAKE2b constructor that accepts no parameters or digest size. If you
/// want a keyed hash, then use the constructor that accpts the key as a parameter.
/// Once a key and digest size are selected, its effectively immutable. The Restart()
/// method that accepts a ParameterBlock does not allow you to change it.
/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
/// <A HREF="http://blake2.net/blake2.pdf">BLAKE2: simpler, smaller, fast as MD5</A> (2013.01.29).
/// \since Crypto++ 5.6.4
class BLAKE2b : public BLAKE2_Base<word64, true>
{
public:
typedef BLAKE2_Base<word64, true> ThisBase; // Early Visual Studio workaround
typedef BLAKE2_ParameterBlock<true> ParameterBlock;
CRYPTOPP_COMPILE_ASSERT(sizeof(ParameterBlock) == 64);
/// \brief Construct a BLAKE2b hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
BLAKE2b(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
/// \brief Construct a BLAKE2b hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as prsonalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
BLAKE2b(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE)
: ThisBase(key, keyLength, salt, saltLength, personalization, personalizationLength, treeMode, digestSize) {}
// SSE4, Power8 and NEON depend upon t[] and f[] being side-by-side
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2b_Info::BLOCKSIZE)
FixedSizeAlignedSecBlock<word64, 8+2+2, true> m_hft;
FixedSizeAlignedSecBlock<byte, BLOCKSIZE, true> m_buf;
size_t m_len;
};
/// \brief The BLAKE2s cryptographic hash function
@ -276,32 +232,193 @@ public:
/// method that accepts a ParameterBlock does not allow you to change it.
/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
/// <A HREF="http://blake2.net/blake2.pdf">BLAKE2: simpler, smaller, fast as MD5</A> (2013.01.29).
/// \since Crypto++ 5.6.4
class BLAKE2s : public BLAKE2_Base<word32, false>
/// \since C++ since Crypto++ 5.6.4, SSE since Crypto++ 5.6.4, NEON since Crypto++ 6.0,
/// Power8 since Crypto++ 8.0
class BLAKE2s : public SimpleKeyingInterfaceImpl<MessageAuthenticationCode, BLAKE2s_Info>
{
public:
typedef BLAKE2_Base<word32, false> ThisBase; // Early Visual Studio workaround
typedef BLAKE2_ParameterBlock<false> ParameterBlock;
CRYPTOPP_COMPILE_ASSERT(sizeof(ParameterBlock) == 32);
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2s_Info::DEFAULT_KEYLENGTH)
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2s_Info::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2s_Info::MAX_KEYLENGTH)
/// \brief Construct a BLAKE2s hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
BLAKE2s(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2s_Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2s_Info::BLOCKSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2s_Info::SALTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2s_Info::PERSONALIZATIONSIZE)
/// \brief Construct a BLAKE2s hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as prsonalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
BLAKE2s(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE)
: ThisBase(key, keyLength, salt, saltLength, personalization, personalizationLength, treeMode, digestSize) {}
typedef BLAKE2s_State State;
typedef BLAKE2s_ParameterBlock ParameterBlock;
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2s";}
virtual ~BLAKE2s() {}
/// \brief Construct a BLAKE2s hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
BLAKE2s(bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Construct a BLAKE2s hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as prsonalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
BLAKE2s(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Retrieve the object's name
/// \returns the object's algorithm name following RFC 7693
/// \details Object algorithm name follows the naming described in
/// <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The BLAKE2 Cryptographic Hash and
/// Message Authentication Code (MAC)</A>. For example, "BLAKE2b-512" and "BLAKE2s-256".
std::string AlgorithmName() const {return std::string(BLAKE2s_Info::StaticAlgorithmName()) + "-" + IntToString(DigestSize()*8);}
unsigned int DigestSize() const {return m_digestSize;}
unsigned int OptimalDataAlignment() const;
void Update(const byte *input, size_t length);
void Restart();
/// \brief Restart a hash with parameter block and counter
/// \param block parameter block
/// \param counter counter array
/// \details Parameter block is persisted across calls to Restart().
void Restart(const BLAKE2s_ParameterBlock& block, const word32 counter[2]);
/// \brief Set tree mode
/// \param mode the new tree mode
/// \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
/// If <tt>treeMode=false</tt> (default), then State::f[1] is never set. If
/// <tt>treeMode=true</tt>, then State::f[1] is set when State::f[0] is set.
/// Tree mode is persisted across calls to Restart().
void SetTreeMode(bool mode) {m_treeMode=mode;}
/// \brief Get tree mode
/// \returns the current tree mode
/// \details Tree mode is persisted across calls to Restart().
bool GetTreeMode() const {return m_treeMode;}
void TruncatedFinal(byte *hash, size_t size);
std::string AlgorithmProvider() const;
protected:
// Operates on state buffer and/or input. Must be BLOCKSIZE, final block will pad with 0's.
void Compress(const byte *input);
inline void IncrementCounter(size_t count=BLOCKSIZE);
void UncheckedSetKey(const byte* key, unsigned int length, const CryptoPP::NameValuePairs& params);
private:
State m_state;
ParameterBlock m_block;
AlignedSecByteBlock m_key;
word32 m_digestSize, m_keyLength;
bool m_treeMode;
};
/// \brief The BLAKE2b cryptographic hash function
/// \details BLAKE2b can function as both a hash and keyed hash. If you want only the hash,
/// then use the BLAKE2b constructor that accepts no parameters or digest size. If you
/// want a keyed hash, then use the constructor that accpts the key as a parameter.
/// Once a key and digest size are selected, its effectively immutable. The Restart()
/// method that accepts a ParameterBlock does not allow you to change it.
/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
/// <A HREF="http://blake2.net/blake2.pdf">BLAKE2: simpler, smaller, fast as MD5</A> (2013.01.29).
/// \since C++ since Crypto++ 5.6.4, SSE since Crypto++ 5.6.4, NEON since Crypto++ 6.0,
/// Power8 since Crypto++ 8.0
class BLAKE2b : public SimpleKeyingInterfaceImpl<MessageAuthenticationCode, BLAKE2b_Info>
{
public:
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH = BLAKE2b_Info::DEFAULT_KEYLENGTH)
CRYPTOPP_CONSTANT(MIN_KEYLENGTH = BLAKE2b_Info::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH = BLAKE2b_Info::MAX_KEYLENGTH)
CRYPTOPP_CONSTANT(DIGESTSIZE = BLAKE2b_Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(BLOCKSIZE = BLAKE2b_Info::BLOCKSIZE)
CRYPTOPP_CONSTANT(SALTSIZE = BLAKE2b_Info::SALTSIZE)
CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = BLAKE2b_Info::PERSONALIZATIONSIZE)
typedef BLAKE2b_State State;
typedef BLAKE2b_ParameterBlock ParameterBlock;
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BLAKE2b";}
virtual ~BLAKE2b() {}
/// \brief Construct a BLAKE2b hash
/// \param digestSize the digest size, in bytes
/// \param treeMode flag indicating tree mode
BLAKE2b(bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Construct a BLAKE2b hash
/// \param key a byte array used to key the cipher
/// \param keyLength the size of the byte array
/// \param salt a byte array used as salt
/// \param saltLength the size of the byte array
/// \param personalization a byte array used as prsonalization string
/// \param personalizationLength the size of the byte array
/// \param treeMode flag indicating tree mode
/// \param digestSize the digest size, in bytes
BLAKE2b(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE);
/// \brief Retrieve the object's name
/// \returns the object's algorithm name following RFC 7693
/// \details Object algorithm name follows the naming described in
/// <A HREF="http://tools.ietf.org/html/rfc7693#section-4">RFC 7693, The BLAKE2 Cryptographic Hash and
/// Message Authentication Code (MAC)</A>. For example, "BLAKE2b-512" and "BLAKE2s-256".
std::string AlgorithmName() const {return std::string(BLAKE2b_Info::StaticAlgorithmName()) + "-" + IntToString(DigestSize()*8);}
unsigned int DigestSize() const {return m_digestSize;}
unsigned int OptimalDataAlignment() const;
void Update(const byte *input, size_t length);
void Restart();
/// \brief Restart a hash with parameter block and counter
/// \param block parameter block
/// \param counter counter array
/// \details Parameter block is persisted across calls to Restart().
void Restart(const BLAKE2b_ParameterBlock& block, const word64 counter[2]);
/// \brief Set tree mode
/// \param mode the new tree mode
/// \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
/// If <tt>treeMode=false</tt> (default), then State::f[1] is never set. If
/// <tt>treeMode=true</tt>, then State::f[1] is set when State::f[0] is set.
/// Tree mode is persisted across calls to Restart().
void SetTreeMode(bool mode) {m_treeMode=mode;}
/// \brief Get tree mode
/// \returns the current tree mode
/// \details Tree mode is persisted across calls to Restart().
bool GetTreeMode() const {return m_treeMode;}
void TruncatedFinal(byte *hash, size_t size);
std::string AlgorithmProvider() const;
protected:
// Operates on state buffer and/or input. Must be BLOCKSIZE, final block will pad with 0's.
void Compress(const byte *input);
inline void IncrementCounter(size_t count=BLOCKSIZE);
void UncheckedSetKey(const byte* key, unsigned int length, const CryptoPP::NameValuePairs& params);
private:
State m_state;
ParameterBlock m_block;
AlignedSecByteBlock m_key;
word32 m_digestSize, m_keyLength;
bool m_treeMode;
};
NAMESPACE_END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -60,7 +60,7 @@ NAMESPACE_BEGIN(CryptoPP)
ROUND(lh, ll, rh, rl, k0, k1) \
ROUND(rh, rl, lh, ll, k2, k3)
#ifdef CRYPTOPP_LITTLE_ENDIAN
#if (CRYPTOPP_LITTLE_ENDIAN)
#define EFI(i) (1-(i))
#else
#define EFI(i) (i)

View File

@ -24,6 +24,8 @@ public:
// AuthenticatedSymmetricCipher
std::string AlgorithmName() const
{return GetBlockCipher().AlgorithmName() + std::string("/CCM");}
std::string AlgorithmProvider() const
{return GetBlockCipher().AlgorithmProvider();}
size_t MinKeyLength() const
{return GetBlockCipher().MinKeyLength();}
size_t MaxKeyLength() const

View File

@ -1,6 +1,7 @@
// chacha.cpp - written and placed in the public domain by Jeffrey Walton.
// Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha
// family implementation at http://cr.yp.to/chacha.html.
// Based on Wei Dai's Salsa20, Botan's SSE2 implementation,
// and Bernstein's reference ChaCha family implementation at
// http://cr.yp.to/chacha.html.
#include "pch.h"
#include "config.h"
@ -11,142 +12,313 @@
NAMESPACE_BEGIN(CryptoPP)
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
extern void ChaCha_OperateKeystream_NEON(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE)
extern void ChaCha_OperateKeystream_SSE2(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#if (CRYPTOPP_AVX2_AVAILABLE)
extern void ChaCha_OperateKeystream_AVX2(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#if (CRYPTOPP_POWER7_AVAILABLE)
extern void ChaCha_OperateKeystream_POWER7(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#elif (CRYPTOPP_ALTIVEC_AVAILABLE)
extern void ChaCha_OperateKeystream_ALTIVEC(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#define CHACHA_QUARTER_ROUND(a,b,c,d) \
a += b; d ^= a; d = rotlConstant<16,word32>(d); \
c += d; b ^= c; b = rotlConstant<12,word32>(b); \
a += b; d ^= a; d = rotlConstant<8,word32>(d); \
c += d; b ^= c; b = rotlConstant<7,word32>(b);
#define CHACHA_OUTPUT(x){\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, x0 + m_state[0]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, x1 + m_state[1]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, x2 + m_state[2]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, x3 + m_state[3]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 4, x4 + m_state[4]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 5, x5 + m_state[5]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 6, x6 + m_state[6]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 7, x7 + m_state[7]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 8, x8 + m_state[8]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 9, x9 + m_state[9]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 10, x10 + m_state[10]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 11, x11 + m_state[11]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 12, x12 + m_state[12]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 13, x13 + m_state[13]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 14, x14 + m_state[14]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 15, x15 + m_state[15]);}
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void ChaCha_TestInstantiations()
{
ChaCha8::Encryption x1;
ChaCha12::Encryption x2;
ChaCha20::Encryption x3;
ChaCha::Encryption x;
}
#endif
template <unsigned int R>
void ChaCha_Policy<R>::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
std::string ChaCha_Policy::AlgorithmName() const
{
CRYPTOPP_UNUSED(params);
CRYPTOPP_ASSERT(length == 16 || length == 32);
// "expand 16-byte k" or "expand 32-byte k"
m_state[0] = 0x61707865;
m_state[1] = (length == 16) ? 0x3120646e : 0x3320646e;
m_state[2] = (length == 16) ? 0x79622d36 : 0x79622d32;
m_state[3] = 0x6b206574;
GetBlock<word32, LittleEndian> get1(key);
get1(m_state[4])(m_state[5])(m_state[6])(m_state[7]);
GetBlock<word32, LittleEndian> get2(key + ((length == 32) ? 16 : 0));
get2(m_state[8])(m_state[9])(m_state[10])(m_state[11]);
return std::string("ChaCha")+IntToString(m_rounds);
}
template <unsigned int R>
void ChaCha_Policy<R>::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
std::string ChaCha_Policy::AlgorithmProvider() const
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(length==8);
GetBlock<word32, LittleEndian> get(IV);
m_state[12] = m_state[13] = 0;
get(m_state[14])(m_state[15]);
}
template<unsigned int R>
void ChaCha_Policy<R>::SeekToIteration(lword iterationCount)
{
CRYPTOPP_UNUSED(iterationCount);
throw NotImplemented(std::string(ChaCha_Info<R>::StaticAlgorithmName()) + ": SeekToIteration is not yet implemented");
// TODO: these were Salsa20, and Wei re-arranged the state array for SSE2 operations.
// If we can generate some out-of-band test vectors, then test and implement. Also
// see the test vectors in salsa.txt and the use of Seek test argument.
// m_state[8] = (word32)iterationCount;
// m_state[5] = (word32)SafeRightShift<32>(iterationCount);
}
template<unsigned int R>
unsigned int ChaCha_Policy<R>::GetAlignment() const
{
#if CRYPTOPP_SSE2_ASM_AVAILABLE && 0
if (HasSSE2())
return 16;
else
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
return "AVX2";
else
#endif
return GetAlignmentOf<word32>();
}
template<unsigned int R>
unsigned int ChaCha_Policy<R>::GetOptimalBlockSize() const
{
#if CRYPTOPP_SSE2_ASM_AVAILABLE && 0
if (HasSSE2())
return 4*BYTES_PER_ITERATION;
else
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE)
if (HasSSE2())
return "SSE2";
else
#endif
return BYTES_PER_ITERATION;
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return "NEON";
else
#endif
#if (CRYPTOPP_POWER7_AVAILABLE)
if (HasPower7())
return "Power7";
else
#elif (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return "Altivec";
else
#endif
return "C++";
}
template<unsigned int R>
void ChaCha_Policy<R>::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount)
void ChaCha_Policy::CipherSetKey(const NameValuePairs &params, const byte *key, size_t length)
{
word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
CRYPTOPP_UNUSED(params);
CRYPTOPP_ASSERT(length == 16 || length == 32);
while (iterationCount--)
{
x0 = m_state[0]; x1 = m_state[1]; x2 = m_state[2]; x3 = m_state[3];
x4 = m_state[4]; x5 = m_state[5]; x6 = m_state[6]; x7 = m_state[7];
x8 = m_state[8]; x9 = m_state[9]; x10 = m_state[10]; x11 = m_state[11];
x12 = m_state[12]; x13 = m_state[13]; x14 = m_state[14]; x15 = m_state[15];
m_rounds = params.GetIntValueWithDefault(Name::Rounds(), 20);
if (!(m_rounds == 8 || m_rounds == 12 || m_rounds == 20))
throw InvalidRounds(ChaCha::StaticAlgorithmName(), m_rounds);
for (int i = static_cast<int>(ROUNDS); i > 0; i -= 2)
{
CHACHA_QUARTER_ROUND(x0, x4, x8, x12);
CHACHA_QUARTER_ROUND(x1, x5, x9, x13);
CHACHA_QUARTER_ROUND(x2, x6, x10, x14);
CHACHA_QUARTER_ROUND(x3, x7, x11, x15);
// "expand 16-byte k" or "expand 32-byte k"
m_state[0] = 0x61707865;
m_state[1] = (length == 16) ? 0x3120646e : 0x3320646e;
m_state[2] = (length == 16) ? 0x79622d36 : 0x79622d32;
m_state[3] = 0x6b206574;
CHACHA_QUARTER_ROUND(x0, x5, x10, x15);
CHACHA_QUARTER_ROUND(x1, x6, x11, x12);
CHACHA_QUARTER_ROUND(x2, x7, x8, x13);
CHACHA_QUARTER_ROUND(x3, x4, x9, x14);
}
GetBlock<word32, LittleEndian> get1(key);
get1(m_state[4])(m_state[5])(m_state[6])(m_state[7]);
#undef CHACHA_OUTPUT
#define CHACHA_OUTPUT(x){\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 0, x0 + m_state[0]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 1, x1 + m_state[1]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 2, x2 + m_state[2]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 3, x3 + m_state[3]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 4, x4 + m_state[4]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 5, x5 + m_state[5]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 6, x6 + m_state[6]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 7, x7 + m_state[7]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 8, x8 + m_state[8]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 9, x9 + m_state[9]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 10, x10 + m_state[10]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 11, x11 + m_state[11]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 12, x12 + m_state[12]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 13, x13 + m_state[13]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 14, x14 + m_state[14]);\
CRYPTOPP_KEYSTREAM_OUTPUT_WORD(x, LITTLE_ENDIAN_ORDER, 15, x15 + m_state[15]);}
GetBlock<word32, LittleEndian> get2(key + ((length == 32) ? 16 : 0));
get2(m_state[8])(m_state[9])(m_state[10])(m_state[11]);
}
#ifndef CRYPTOPP_DOXYGEN_PROCESSING
CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(CHACHA_OUTPUT, BYTES_PER_ITERATION);
void ChaCha_Policy::CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(length);
CRYPTOPP_ASSERT(length==8);
GetBlock<word32, LittleEndian> get(IV);
m_state[12] = m_state[13] = 0;
get(m_state[14])(m_state[15]);
}
void ChaCha_Policy::SeekToIteration(lword iterationCount)
{
m_state[12] = (word32)iterationCount; // low word
m_state[13] = (word32)SafeRightShift<32>(iterationCount);
}
unsigned int ChaCha_Policy::GetAlignment() const
{
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
return 16;
else
#endif
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE)
if (HasSSE2())
return 16;
else
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return 16;
else
#endif
return GetAlignmentOf<word32>();
}
unsigned int ChaCha_Policy::GetOptimalBlockSize() const
{
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
return 8 * BYTES_PER_ITERATION;
else
#endif
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE)
if (HasSSE2())
return 4*BYTES_PER_ITERATION;
else
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
return 4*BYTES_PER_ITERATION;
else
#endif
#if (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
return 4*BYTES_PER_ITERATION;
else
#endif
return BYTES_PER_ITERATION;
}
bool ChaCha_Policy::MultiBlockSafe(unsigned int blocks) const
{
return 0xffffffff - m_state[12] > blocks;
}
// OperateKeystream always produces a key stream. The key stream is written
// to output. Optionally a message may be supplied to xor with the key stream.
// The message is input, and output = output ^ input.
void ChaCha_Policy::OperateKeystream(KeystreamOperation operation,
byte *output, const byte *input, size_t iterationCount)
{
do
{
#if (CRYPTOPP_AVX2_AVAILABLE)
if (HasAVX2())
{
while (iterationCount >= 8 && MultiBlockSafe(8))
{
const bool xorInput = (operation & INPUT_NULL) != INPUT_NULL;
ChaCha_OperateKeystream_AVX2(m_state, xorInput ? input : NULLPTR, output, m_rounds);
// MultiBlockSafe avoids overflow on the counter words
m_state[12] += 8;
//if (m_state[12] < 8)
// m_state[13]++;
input += (!!xorInput) * 8 * BYTES_PER_ITERATION;
output += 8 * BYTES_PER_ITERATION;
iterationCount -= 8;
}
}
#endif
++m_state[12];
m_state[13] += static_cast<word32>(m_state[12] == 0);
}
}
#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE)
if (HasSSE2())
{
while (iterationCount >= 4 && MultiBlockSafe(4))
{
const bool xorInput = (operation & INPUT_NULL) != INPUT_NULL;
ChaCha_OperateKeystream_SSE2(m_state, xorInput ? input : NULLPTR, output, m_rounds);
template class ChaCha_Policy<8>;
template class ChaCha_Policy<12>;
template class ChaCha_Policy<20>;
// MultiBlockSafe avoids overflow on the counter words
m_state[12] += 4;
//if (m_state[12] < 4)
// m_state[13]++;
input += (!!xorInput)*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}
}
#endif
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
if (HasNEON())
{
while (iterationCount >= 4 && MultiBlockSafe(4))
{
const bool xorInput = (operation & INPUT_NULL) != INPUT_NULL;
ChaCha_OperateKeystream_NEON(m_state, xorInput ? input : NULLPTR, output, m_rounds);
// MultiBlockSafe avoids overflow on the counter words
m_state[12] += 4;
//if (m_state[12] < 4)
// m_state[13]++;
input += (!!xorInput)*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}
}
#endif
#if (CRYPTOPP_POWER7_AVAILABLE)
if (HasPower7())
{
while (iterationCount >= 4 && MultiBlockSafe(4))
{
const bool xorInput = (operation & INPUT_NULL) != INPUT_NULL;
ChaCha_OperateKeystream_POWER7(m_state, xorInput ? input : NULLPTR, output, m_rounds);
// MultiBlockSafe avoids overflow on the counter words
m_state[12] += 4;
//if (m_state[12] < 4)
// m_state[13]++;
input += (!!xorInput)*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}
}
#elif (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
{
while (iterationCount >= 4 && MultiBlockSafe(4))
{
const bool xorInput = (operation & INPUT_NULL) != INPUT_NULL;
ChaCha_OperateKeystream_ALTIVEC(m_state, xorInput ? input : NULLPTR, output, m_rounds);
// MultiBlockSafe avoids overflow on the counter words
m_state[12] += 4;
//if (m_state[12] < 4)
// m_state[13]++;
input += (!!xorInput)*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}
}
#endif
if (iterationCount)
{
word32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
x0 = m_state[0]; x1 = m_state[1]; x2 = m_state[2]; x3 = m_state[3];
x4 = m_state[4]; x5 = m_state[5]; x6 = m_state[6]; x7 = m_state[7];
x8 = m_state[8]; x9 = m_state[9]; x10 = m_state[10]; x11 = m_state[11];
x12 = m_state[12]; x13 = m_state[13]; x14 = m_state[14]; x15 = m_state[15];
for (int i = static_cast<int>(m_rounds); i > 0; i -= 2)
{
CHACHA_QUARTER_ROUND(x0, x4, x8, x12);
CHACHA_QUARTER_ROUND(x1, x5, x9, x13);
CHACHA_QUARTER_ROUND(x2, x6, x10, x14);
CHACHA_QUARTER_ROUND(x3, x7, x11, x15);
CHACHA_QUARTER_ROUND(x0, x5, x10, x15);
CHACHA_QUARTER_ROUND(x1, x6, x11, x12);
CHACHA_QUARTER_ROUND(x2, x7, x8, x13);
CHACHA_QUARTER_ROUND(x3, x4, x9, x14);
}
CRYPTOPP_KEYSTREAM_OUTPUT_SWITCH(CHACHA_OUTPUT, BYTES_PER_ITERATION);
if (++m_state[12] == 0)
m_state[13]++;
}
// We may re-enter a SIMD keystream operation from here.
} while (iterationCount--);
}
NAMESPACE_END

Some files were not shown because too many files have changed in this diff Show More