VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Boot/EFI/DcsBml.efibin0 -> 8544 bytes
-rw-r--r--src/Boot/EFI/DcsBoot.efibin0 -> 12640 bytes
-rw-r--r--src/Boot/EFI/DcsCfg.efibin0 -> 499072 bytes
-rw-r--r--src/Boot/EFI/DcsInt.efibin0 -> 469504 bytes
-rw-r--r--src/Boot/EFI/DcsRe.efibin0 -> 18304 bytes
-rw-r--r--src/Boot/EFI/LegacySpeaker.efibin0 -> 2784 bytes
-rw-r--r--src/Boot/EFI/Readme.txt13
-rw-r--r--src/Boot/EFI/certs/DCS_key_exchange.crtbin0 -> 1093 bytes
-rw-r--r--src/Boot/EFI/certs/DCS_platform.crtbin0 -> 1341 bytes
-rw-r--r--src/Boot/EFI/certs/DCS_sign.crtbin0 -> 826 bytes
-rw-r--r--src/Boot/EFI/certs/MicCorUEFCA2011_2011-06-27.crtbin0 -> 1556 bytes
-rw-r--r--src/Boot/EFI/certs/MicWinProPCA2011_2011-10-19.crtbin0 -> 1499 bytes
-rw-r--r--src/Boot/EFI/certs/Readme.txt3
-rw-r--r--src/Boot/EFI/sb_set_siglists.ps122
-rw-r--r--src/Boot/EFI/siglists/DCS_key_exchange_SigList.binbin0 -> 1137 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.binbin0 -> 1179 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.bin.p7bin0 -> 1996 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_platform_SigList.binbin0 -> 1385 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.binbin0 -> 1425 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.bin.p7bin0 -> 1996 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_sign_SigList.binbin0 -> 870 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.binbin0 -> 910 bytes
-rw-r--r--src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.bin.p7bin0 -> 1492 bytes
-rw-r--r--src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList.binbin0 -> 1600 bytes
-rw-r--r--src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.binbin0 -> 1640 bytes
-rw-r--r--src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin.p7bin0 -> 1492 bytes
-rw-r--r--src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList.binbin0 -> 1543 bytes
-rw-r--r--src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.binbin0 -> 1583 bytes
-rw-r--r--src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.bin.p7bin0 -> 1492 bytes
-rw-r--r--src/Boot/Windows/Boot.vcproj10
-rw-r--r--src/Boot/Windows/Boot.vcxproj273
-rw-r--r--src/Boot/Windows/Boot.vcxproj.filters148
-rw-r--r--src/Boot/Windows/Boot.vcxproj.user3
-rw-r--r--src/Boot/Windows/BootCommon.h134
-rw-r--r--src/Boot/Windows/BootDefs.h11
-rw-r--r--src/Boot/Windows/Makefile3
-rw-r--r--src/Build/Resources/MacOSX/Info.plist.xml6
-rw-r--r--src/Common/Apidrvr.h56
-rw-r--r--src/Common/BaseCom.cpp217
-rw-r--r--src/Common/BaseCom.h16
-rw-r--r--src/Common/BootEncryption.cpp2152
-rw-r--r--src/Common/BootEncryption.h102
-rw-r--r--src/Common/Common.rc59
-rw-r--r--src/Common/Crypto.c161
-rw-r--r--src/Common/Crypto.h61
-rw-r--r--src/Common/Dlgcode.c1107
-rw-r--r--src/Common/Dlgcode.h4
-rw-r--r--src/Common/EncryptionThreadPool.c5
-rw-r--r--src/Common/Endian.h14
-rw-r--r--src/Common/Fat.c2
-rw-r--r--src/Common/Format.c59
-rw-r--r--src/Common/Keyfiles.c7
-rw-r--r--src/Common/Keyfiles.h1
-rw-r--r--src/Common/Language.c4
-rw-r--r--src/Common/Language.xml28
-rw-r--r--src/Common/Password.c44
-rw-r--r--src/Common/Password.h16
-rw-r--r--src/Common/Pkcs5.c324
-rw-r--r--src/Common/Pkcs5.h3
-rw-r--r--src/Common/Random.c17
-rw-r--r--src/Common/Resource.h23
-rw-r--r--src/Common/SecurityToken.cpp28
-rw-r--r--src/Common/SecurityToken.h8
-rw-r--r--src/Common/Tcdefs.h105
-rw-r--r--src/Common/Tests.c261
-rw-r--r--src/Common/Volumes.c192
-rw-r--r--src/Common/Volumes.h24
-rw-r--r--src/Common/XUnzip.cpp4405
-rw-r--r--src/Common/XUnzip.h382
-rw-r--r--src/Common/XZip.cpp3215
-rw-r--r--src/Common/XZip.h323
-rw-r--r--src/Common/Xml.c21
-rw-r--r--src/Common/Xml.h13
-rw-r--r--src/Core/VolumeCreator.cpp63
-rw-r--r--src/Crypto/Aes_hw_cpu.asm25
-rw-r--r--src/Crypto/Camellia.c723
-rw-r--r--src/Crypto/Camellia.h23
-rw-r--r--src/Crypto/CamelliaSmall.c455
-rw-r--r--src/Crypto/CamelliaSmall.h23
-rw-r--r--src/Crypto/Crypto.vcproj70
-rw-r--r--src/Crypto/Crypto.vcxproj257
-rw-r--r--src/Crypto/Crypto.vcxproj.filters119
-rw-r--r--src/Crypto/Crypto.vcxproj.user3
-rw-r--r--src/Crypto/GostCipher.c269
-rw-r--r--src/Crypto/GostCipher.h61
-rw-r--r--src/Crypto/Makefile.inc3
-rw-r--r--src/Crypto/Rmd160.c12
-rw-r--r--src/Crypto/Serpent.c68
-rw-r--r--src/Crypto/Sha2.c6
-rw-r--r--src/Crypto/Sources10
-rw-r--r--src/Crypto/Streebog.c2393
-rw-r--r--src/Crypto/Streebog.h33
-rw-r--r--src/Crypto/Whirlpool.c435
-rw-r--r--src/Crypto/Whirlpool.h2
-rw-r--r--src/Crypto/config.h10
-rw-r--r--src/Crypto/cpu.c151
-rw-r--r--src/Crypto/cpu.h107
-rw-r--r--src/Crypto/gost89_x64.asm481
-rw-r--r--src/Crypto/gost89_x86.asm0
-rw-r--r--src/Crypto/kuznyechik.c2453
-rw-r--r--src/Crypto/kuznyechik.h26
-rw-r--r--src/Crypto/misc.h40
-rw-r--r--src/Driver/BuildDriver.cmd18
-rw-r--r--src/Driver/DriveFilter.c112
-rw-r--r--src/Driver/Driver.vcxproj264
-rw-r--r--src/Driver/Driver.vcxproj.filters199
-rw-r--r--src/Driver/Driver.vcxproj.user3
-rw-r--r--src/Driver/DumpFilter.c12
-rw-r--r--src/Driver/Ntdriver.c35
-rw-r--r--src/ExpandVolume/ExpandVolume.c49
-rw-r--r--src/ExpandVolume/ExpandVolume.vcxproj448
-rw-r--r--src/ExpandVolume/ExpandVolume.vcxproj.filters287
-rw-r--r--src/ExpandVolume/ExpandVolume.vcxproj.user3
-rw-r--r--src/ExpandVolume/InitDataArea.c4
-rw-r--r--src/ExpandVolume/WinMain.cpp10
-rw-r--r--src/Format/Format.vcxproj420
-rw-r--r--src/Format/Format.vcxproj.filters356
-rw-r--r--src/Format/Format.vcxproj.user3
-rw-r--r--src/Format/FormatCom.cpp44
-rw-r--r--src/Format/FormatCom.idl12
-rw-r--r--src/Format/InPlace.c83
-rw-r--r--src/Format/Tcformat.c191
-rw-r--r--src/Main/CommandLineInterface.cpp6
-rw-r--r--src/Main/CommandLineInterface.h1
-rw-r--r--src/Main/Forms/EncryptionOptionsWizardPage.cpp6
-rw-r--r--src/Main/GraphicUserInterface.cpp27
-rw-r--r--src/Main/TextUserInterface.cpp15
-rw-r--r--src/Makefile6
-rw-r--r--src/Mount/MainCom.cpp42
-rw-r--r--src/Mount/MainCom.idl12
-rw-r--r--src/Mount/Mount.c235
-rw-r--r--src/Mount/Mount.h9
-rw-r--r--src/Mount/Mount.rc76
-rw-r--r--src/Mount/Mount.vcxproj445
-rw-r--r--src/Mount/Mount.vcxproj.filters368
-rw-r--r--src/Mount/Mount.vcxproj.user3
-rw-r--r--src/Mount/Resource.h10
-rw-r--r--src/Readme.txt9
-rw-r--r--src/Setup/ComSetup.cpp11
-rw-r--r--src/Setup/Setup.vcxproj225
-rw-r--r--src/Setup/Setup.vcxproj.filters177
-rw-r--r--src/Setup/Setup.vcxproj.user3
-rw-r--r--src/VeraCrypt.sln47
-rw-r--r--src/Volume/Cipher.cpp70
-rw-r--r--src/Volume/Cipher.h3
-rw-r--r--src/Volume/EncryptionAlgorithm.cpp28
-rw-r--r--src/Volume/EncryptionAlgorithm.h3
-rw-r--r--src/Volume/EncryptionTest.cpp75
-rw-r--r--src/Volume/Hash.cpp27
-rw-r--r--src/Volume/Hash.h23
-rw-r--r--src/Volume/Pkcs5Kdf.cpp13
-rw-r--r--src/Volume/Pkcs5Kdf.h34
-rw-r--r--src/Volume/Volume.make4
-rw-r--r--src/Volume/VolumeLayout.cpp16
154 files changed, 25489 insertions, 1499 deletions
diff --git a/src/Boot/EFI/DcsBml.efi b/src/Boot/EFI/DcsBml.efi
new file mode 100644
index 00000000..8775ce4c
--- /dev/null
+++ b/src/Boot/EFI/DcsBml.efi
Binary files differ
diff --git a/src/Boot/EFI/DcsBoot.efi b/src/Boot/EFI/DcsBoot.efi
new file mode 100644
index 00000000..03f15633
--- /dev/null
+++ b/src/Boot/EFI/DcsBoot.efi
Binary files differ
diff --git a/src/Boot/EFI/DcsCfg.efi b/src/Boot/EFI/DcsCfg.efi
new file mode 100644
index 00000000..da5a6ee4
--- /dev/null
+++ b/src/Boot/EFI/DcsCfg.efi
Binary files differ
diff --git a/src/Boot/EFI/DcsInt.efi b/src/Boot/EFI/DcsInt.efi
new file mode 100644
index 00000000..666030ba
--- /dev/null
+++ b/src/Boot/EFI/DcsInt.efi
Binary files differ
diff --git a/src/Boot/EFI/DcsRe.efi b/src/Boot/EFI/DcsRe.efi
new file mode 100644
index 00000000..646a79e3
--- /dev/null
+++ b/src/Boot/EFI/DcsRe.efi
Binary files differ
diff --git a/src/Boot/EFI/LegacySpeaker.efi b/src/Boot/EFI/LegacySpeaker.efi
new file mode 100644
index 00000000..5f49a76a
--- /dev/null
+++ b/src/Boot/EFI/LegacySpeaker.efi
Binary files differ
diff --git a/src/Boot/EFI/Readme.txt b/src/Boot/EFI/Readme.txt
new file mode 100644
index 00000000..882c247a
--- /dev/null
+++ b/src/Boot/EFI/Readme.txt
@@ -0,0 +1,13 @@
+To update secure boot configuration
+1. Enter BIOS configuration
+2. Switch Secure boot to setup mode (or custom mode). It deletes PK (platform certificate) and allows to load DCS platform key.
+3. Boot Windows
+4. execute from admin command prompt
+ powershell -File sb_set_siglists.ps1
+It sets in PK (platform key) - DCS_platform
+It sets in KEK (key exchange key) - DCS_key_exchange
+It sets in db - DCS_sign MicWinProPCA2011_2011-10-19 MicCorUEFCA2011_2011-06-27
+
+All DCS modules are protected by DCS_sign.
+All Windows modules are protected by MicWinProPCA2011_2011-10-19
+All SHIM(linux) modules are protected by MicCorUEFCA2011_2011-06-27 \ No newline at end of file
diff --git a/src/Boot/EFI/certs/DCS_key_exchange.crt b/src/Boot/EFI/certs/DCS_key_exchange.crt
new file mode 100644
index 00000000..80bc7ca4
--- /dev/null
+++ b/src/Boot/EFI/certs/DCS_key_exchange.crt
Binary files differ
diff --git a/src/Boot/EFI/certs/DCS_platform.crt b/src/Boot/EFI/certs/DCS_platform.crt
new file mode 100644
index 00000000..a7cf8ce9
--- /dev/null
+++ b/src/Boot/EFI/certs/DCS_platform.crt
Binary files differ
diff --git a/src/Boot/EFI/certs/DCS_sign.crt b/src/Boot/EFI/certs/DCS_sign.crt
new file mode 100644
index 00000000..f0538dbb
--- /dev/null
+++ b/src/Boot/EFI/certs/DCS_sign.crt
Binary files differ
diff --git a/src/Boot/EFI/certs/MicCorUEFCA2011_2011-06-27.crt b/src/Boot/EFI/certs/MicCorUEFCA2011_2011-06-27.crt
new file mode 100644
index 00000000..9aa6ac6c
--- /dev/null
+++ b/src/Boot/EFI/certs/MicCorUEFCA2011_2011-06-27.crt
Binary files differ
diff --git a/src/Boot/EFI/certs/MicWinProPCA2011_2011-10-19.crt b/src/Boot/EFI/certs/MicWinProPCA2011_2011-10-19.crt
new file mode 100644
index 00000000..a6d001c2
--- /dev/null
+++ b/src/Boot/EFI/certs/MicWinProPCA2011_2011-10-19.crt
Binary files differ
diff --git a/src/Boot/EFI/certs/Readme.txt b/src/Boot/EFI/certs/Readme.txt
new file mode 100644
index 00000000..6663a5d1
--- /dev/null
+++ b/src/Boot/EFI/certs/Readme.txt
@@ -0,0 +1,3 @@
+Apart from DCS certificates, there are two public DB entries - one for Windows and one for the UEFI Certificate Authority (CA).
+Windows DB: http://www.microsoft.com/pkiops/certs/MicWinProPCA2011_2011-10-19.crt
+UEFI DB: http://www.microsoft.com/pkiops/certs/MicCorUEFCA2011_2011-06-27.crt
diff --git a/src/Boot/EFI/sb_set_siglists.ps1 b/src/Boot/EFI/sb_set_siglists.ps1
new file mode 100644
index 00000000..5f664f21
--- /dev/null
+++ b/src/Boot/EFI/sb_set_siglists.ps1
@@ -0,0 +1,22 @@
+Set-ExecutionPolicy Bypass -Force
+Import-Module secureboot
+
+Set-SecureBootUEFI -Name PK -Time 2015-09-11 -Content $null
+Set-SecureBootUEFI -Name KEK -Time 2015-09-11 -Content $null
+Set-SecureBootUEFI -Name db -Time 2015-09-11 -Content $null
+Set-SecureBootUEFI -Name dbx -Time 2015-09-11 -Content $null
+
+Write-Host "Setting self-signed PK..."
+Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_platform_SigList.bin -SignedFilePath siglists\DCS_platform_SigList_Serialization.bin.p7 -Name PK
+
+Write-Host "Setting PK-signed KEK..."
+Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_key_exchange_SigList.bin -SignedFilePath siglists\DCS_key_exchange_SigList_Serialization.bin.p7 -Name KEK
+
+Write-Host "Setting KEK-signed DCS cert in db..."
+Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_sign_SigList.bin -SignedFilePath siglists\DCS_sign_SigList_Serialization.bin.p7 -Name db
+
+Write-Host "Setting KEK-signed MS cert in db..."
+Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\MicWinProPCA2011_2011-10-19_SigList.bin -SignedFilePath siglists\MicWinProPCA2011_2011-10-19_SigList_Serialization.bin.p7 -Name db -AppendWrite:$true
+
+Write-Host "Setting KEK-signed MS UEFI cert in db..."
+Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\MicCorUEFCA2011_2011-06-27_SigList.bin -SignedFilePath siglists\MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin.p7 -Name db -AppendWrite:$true
diff --git a/src/Boot/EFI/siglists/DCS_key_exchange_SigList.bin b/src/Boot/EFI/siglists/DCS_key_exchange_SigList.bin
new file mode 100644
index 00000000..62f5cc6f
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_key_exchange_SigList.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.bin b/src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.bin
new file mode 100644
index 00000000..1cffcf0c
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.bin.p7 b/src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.bin.p7
new file mode 100644
index 00000000..1e9d29ae
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_key_exchange_SigList_Serialization.bin.p7
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_platform_SigList.bin b/src/Boot/EFI/siglists/DCS_platform_SigList.bin
new file mode 100644
index 00000000..0b6d7e12
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_platform_SigList.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.bin b/src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.bin
new file mode 100644
index 00000000..e8fbf79a
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.bin.p7 b/src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.bin.p7
new file mode 100644
index 00000000..19cb86db
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_platform_SigList_Serialization.bin.p7
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_sign_SigList.bin b/src/Boot/EFI/siglists/DCS_sign_SigList.bin
new file mode 100644
index 00000000..9a3f568b
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_sign_SigList.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.bin b/src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.bin
new file mode 100644
index 00000000..de58d77d
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.bin.p7 b/src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.bin.p7
new file mode 100644
index 00000000..01753a8b
--- /dev/null
+++ b/src/Boot/EFI/siglists/DCS_sign_SigList_Serialization.bin.p7
Binary files differ
diff --git a/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList.bin b/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList.bin
new file mode 100644
index 00000000..413ccab9
--- /dev/null
+++ b/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin b/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin
new file mode 100644
index 00000000..735d9626
--- /dev/null
+++ b/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin.p7 b/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin.p7
new file mode 100644
index 00000000..ed8cefda
--- /dev/null
+++ b/src/Boot/EFI/siglists/MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin.p7
Binary files differ
diff --git a/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList.bin b/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList.bin
new file mode 100644
index 00000000..ac542ca0
--- /dev/null
+++ b/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.bin b/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.bin
new file mode 100644
index 00000000..9138dae9
--- /dev/null
+++ b/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.bin
Binary files differ
diff --git a/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.bin.p7 b/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.bin.p7
new file mode 100644
index 00000000..b08c60a3
--- /dev/null
+++ b/src/Boot/EFI/siglists/MicWinProPCA2011_2011-10-19_SigList_Serialization.bin.p7
Binary files differ
diff --git a/src/Boot/Windows/Boot.vcproj b/src/Boot/Windows/Boot.vcproj
index 64ad48ec..c73b099e 100644
--- a/src/Boot/Windows/Boot.vcproj
+++ b/src/Boot/Windows/Boot.vcproj
@@ -24,9 +24,9 @@
>
<Tool
Name="VCNMakeTool"
- BuildCommandLine="md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;md Release_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2"
- ReBuildCommandLine="del /q /s Release &gt;NUL:&#x0D;&#x0A;md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES &gt;NUL:&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent &gt;NUL:&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish &gt;NUL:&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue &gt;NUL:&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_AES &gt;NUL:&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_AES_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Serpent &gt;NUL:&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Serpent_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Twofish &gt;NUL:&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Twofish_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2"
- CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Rescue Rescue_AES Rescue_Serpent Rescue_Twofish &gt;NUL:&#x0D;&#x0A;del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 &gt;NUL:&#x0D;&#x0A;"
+ BuildCommandLine="md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;md Release_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;md Release_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;md Release_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;md Release_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Release_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA&#x0D;&#x0A;&#x0D;&#x0A;md Release_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;md Rescue_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2"
+ ReBuildCommandLine="del /q /s Release &gt;NUL:&#x0D;&#x0A;md Release 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES &gt;NUL:&#x0D;&#x0A;md Release_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_AES_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent &gt;NUL:&#x0D;&#x0A;md Release_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Serpent_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish &gt;NUL:&#x0D;&#x0A;md Release_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Twofish_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Camellia &gt;NUL:&#x0D;&#x0A;md Release_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Release_Camellia_SHA2 &gt;NUL:&#x0D;&#x0A;md Release_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue &gt;NUL:&#x0D;&#x0A;md Rescue 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_AES &gt;NUL:&#x0D;&#x0A;md Rescue_AES 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_AES_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_AES_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Serpent &gt;NUL:&#x0D;&#x0A;md Rescue_Serpent 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Serpent_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Serpent_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Twofish &gt;NUL:&#x0D;&#x0A;md Rescue_Twofish 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Twofish_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Twofish_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Camellia &gt;NUL:&#x0D;&#x0A;md Rescue_Camellia 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1&#x0D;&#x0A;&#x0D;&#x0A;del /q /s Rescue_Camellia_SHA2 &gt;NUL:&#x0D;&#x0A;md Rescue_Camellia_SHA2 2&gt;NUL:&#x0D;&#x0A;nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2"
+ CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Release_Camellia Rescue Rescue_AES Rescue_Serpent Rescue_Twofish Rescue_Camellia &gt;NUL:&#x0D;&#x0A;del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Release_Camellia_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 Rescue_Camellia_SHA2 &gt;NUL:&#x0D;&#x0A;"
Output="Release\BootLoader.com"
PreprocessorDefinitions="WIN32;NDEBUG"
IncludeSearchPath="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)\Common&quot;;&quot;$(SolutionDir)\Crypto&quot;;&quot;$(MSVC16_ROOT)\Include&quot;"
@@ -157,6 +157,10 @@
>
</File>
<File
+ RelativePath="..\..\Crypto\CamelliaSmall.c"
+ >
+ </File>
+ <File
RelativePath="..\..\Crypto\Rmd160.c"
>
</File>
diff --git a/src/Boot/Windows/Boot.vcxproj b/src/Boot/Windows/Boot.vcxproj
new file mode 100644
index 00000000..68d5d270
--- /dev/null
+++ b/src/Boot/Windows/Boot.vcxproj
@@ -0,0 +1,273 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release Loader|Win32">
+ <Configuration>Release Loader</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}</ProjectGuid>
+ <RootNamespace>Boot</RootNamespace>
+ <Keyword>MakeFileProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">md Release 2&gt;NUL:
+nmake.exe /nologo RELEASE=1
+
+md Release_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2
+
+md Release_AES 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
+
+md Release_AES_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2
+
+md Release_Serpent 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
+
+md Release_Serpent_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2
+
+md Release_Twofish 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH
+
+md Release_Twofish_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2
+
+md Release_Camellia 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA
+
+md Release_Camellia_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2
+
+md Rescue 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 RESCUE_DISK=1
+
+md Rescue_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+md Rescue_AES 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1
+
+md Rescue_AES_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+md Rescue_Serpent 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1
+
+md Rescue_Serpent_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+md Rescue_Twofish 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1
+
+md Rescue_Twofish_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+md Rescue_Camellia 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1
+
+md Rescue_Camellia_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">del /q /s Release &gt;NUL:
+md Release 2&gt;NUL:
+nmake.exe /nologo RELEASE=1
+
+del /q /s Release_SHA2 &gt;NUL:
+md Release_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2
+
+del /q /s Release_AES &gt;NUL:
+md Release_AES 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
+
+del /q /s Release_AES_SHA2 &gt;NUL:
+md Release_AES_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2
+
+del /q /s Release_Serpent &gt;NUL:
+md Release_Serpent 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
+
+del /q /s Release_Serpent_SHA2 &gt;NUL:
+md Release_Serpent_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2
+
+del /q /s Release_Twofish &gt;NUL:
+md Release_Twofish 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH
+
+del /q /s Release_Twofish_SHA2 &gt;NUL:
+md Release_Twofish_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2
+
+del /q /s Release_Camellia &gt;NUL:
+md Release_Camellia 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA
+
+del /q /s Release_Camellia_SHA2 &gt;NUL:
+md Release_Camellia_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2
+
+del /q /s Rescue &gt;NUL:
+md Rescue 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 RESCUE_DISK=1
+
+del /q /s Rescue_SHA2 &gt;NUL:
+md Rescue_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+del /q /s Rescue_AES &gt;NUL:
+md Rescue_AES 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1
+
+del /q /s Rescue_AES_SHA2 &gt;NUL:
+md Rescue_AES_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+del /q /s Rescue_Serpent &gt;NUL:
+md Rescue_Serpent 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1
+
+del /q /s Rescue_Serpent_SHA2 &gt;NUL:
+md Rescue_Serpent_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+del /q /s Rescue_Twofish &gt;NUL:
+md Rescue_Twofish 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1
+
+del /q /s Rescue_Twofish_SHA2 &gt;NUL:
+md Rescue_Twofish_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2
+
+del /q /s Rescue_Camellia &gt;NUL:
+md Rescue_Camellia 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1
+
+del /q /s Rescue_Camellia_SHA2 &gt;NUL:
+md Rescue_Camellia_SHA2 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">del /q /s Release Release_AES Release_Serpent Release_Twofish Release_Camellia Rescue Rescue_AES Rescue_Serpent Rescue_Twofish Rescue_Camellia &gt;NUL:
+del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Release_Camellia_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 Rescue_Camellia_SHA2 &gt;NUL:
+</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\BootLoader.com</NMakeOutput>
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(MSVC16_ROOT)\Include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">md Release 2&gt;NUL:
+nmake.exe /nologo RELEASE=1
+
+md Release_AES 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
+
+md Release_Serpent 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
+
+md Release_Twofish 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">del /q /s Release &gt;NUL:
+md Release 2&gt;NUL:
+nmake.exe /nologo RELEASE=1
+
+del /q /s Release_AES &gt;NUL:
+md Release_AES 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
+
+del /q /s Release_Serpent &gt;NUL:
+md Release_Serpent 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
+
+del /q /s Release_Twofish &gt;NUL:
+md Release_Twofish 2&gt;NUL:
+nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">del /q /s Release Release_AES Release_Serpent Release_Twofish &gt;NUL:</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">Release\BootLoader.com</NMakeOutput>
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(MSVC16_ROOT)\Include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="BootConfig.cpp" />
+ <ClCompile Include="BootConsoleIo.cpp" />
+ <ClCompile Include="BootDebug.cpp" />
+ <ClCompile Include="BootDiskIo.cpp" />
+ <ClCompile Include="BootEncryptedIo.cpp" />
+ <ClCompile Include="BootMain.cpp" />
+ <ClCompile Include="BootMemory.cpp" />
+ <ClCompile Include="Decompressor.c" />
+ <ClCompile Include="IntFilter.cpp" />
+ <ClCompile Include="Platform.cpp" />
+ <ClCompile Include="..\..\Common\Crc.c" />
+ <ClCompile Include="..\..\Common\Crypto.c" />
+ <ClCompile Include="..\..\Common\Endian.c" />
+ <ClCompile Include="..\..\Common\Pkcs5.c" />
+ <ClCompile Include="..\..\Common\Volumes.c" />
+ <ClCompile Include="..\..\Common\Xts.c" />
+ <ClCompile Include="..\..\Crypto\AesSmall.c" />
+ <ClCompile Include="..\..\Crypto\CamelliaSmall.c" />
+ <ClCompile Include="..\..\Crypto\Rmd160.c" />
+ <ClCompile Include="..\..\Crypto\Serpent.c" />
+ <ClCompile Include="..\..\Crypto\Sha2Small.c" />
+ <ClCompile Include="..\..\Crypto\Twofish.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="BootCrt.asm" />
+ <None Include="BootSector.asm" />
+ <None Include="..\..\Crypto\Aes_hw_cpu.asm" />
+ <None Include="..\..\Crypto\AesSmall_x86.asm" />
+ <None Include="Makefile" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Bios.h" />
+ <ClInclude Include="BootCommon.h" />
+ <ClInclude Include="BootConfig.h" />
+ <ClInclude Include="BootConsoleIo.h" />
+ <ClInclude Include="BootDebug.h" />
+ <ClInclude Include="BootDefs.h" />
+ <ClInclude Include="BootDiskIo.h" />
+ <ClInclude Include="BootEncryptedIo.h" />
+ <ClInclude Include="BootMain.h" />
+ <ClInclude Include="BootMemory.h" />
+ <ClInclude Include="BootStrings.h" />
+ <ClInclude Include="IntFilter.h" />
+ <ClInclude Include="Platform.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/Boot/Windows/Boot.vcxproj.filters b/src/Boot/Windows/Boot.vcxproj.filters
new file mode 100644
index 00000000..1a60ac81
--- /dev/null
+++ b/src/Boot/Windows/Boot.vcxproj.filters
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Source Files\Common">
+ <UniqueIdentifier>{851ac58e-36e0-4dfa-a208-6da2330f5959}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\Crypto">
+ <UniqueIdentifier>{76da5bdb-fe11-430a-8667-2fe7f9ac3667}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Build Files">
+ <UniqueIdentifier>{732efef1-4474-4845-aa74-17b852cc0f2e}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="BootConfig.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BootConsoleIo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BootDebug.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BootDiskIo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BootEncryptedIo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BootMain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BootMemory.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Decompressor.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="IntFilter.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Platform.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\Crc.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\Crypto.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\Endian.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\Pkcs5.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\Volumes.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Common\Xts.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Crypto\AesSmall.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Crypto\CamelliaSmall.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Crypto\Rmd160.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Crypto\Serpent.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Crypto\Sha2Small.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Crypto\Twofish.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="BootCrt.asm">
+ <Filter>Source Files</Filter>
+ </None>
+ <None Include="BootSector.asm">
+ <Filter>Source Files</Filter>
+ </None>
+ <None Include="..\..\Crypto\Aes_hw_cpu.asm">
+ <Filter>Source Files\Crypto</Filter>
+ </None>
+ <None Include="..\..\Crypto\AesSmall_x86.asm">
+ <Filter>Source Files\Crypto</Filter>
+ </None>
+ <None Include="Makefile">
+ <Filter>Build Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Bios.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootCommon.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootConfig.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootConsoleIo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootDebug.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootDefs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootDiskIo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootEncryptedIo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootMain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootMemory.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BootStrings.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="IntFilter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Platform.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/Boot/Windows/Boot.vcxproj.user b/src/Boot/Windows/Boot.vcxproj.user
new file mode 100644
index 00000000..ace9a86a
--- /dev/null
+++ b/src/Boot/Windows/Boot.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project> \ No newline at end of file
diff --git a/src/Boot/Windows/BootCommon.h b/src/Boot/Windows/BootCommon.h
index 0d4f710d..ea63c08b 100644
--- a/src/Boot/Windows/BootCommon.h
+++ b/src/Boot/Windows/BootCommon.h
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -78,5 +78,137 @@ typedef struct
#define TC_SET_BOOT_ARGUMENTS_SIGNATURE(SG) do { SG[0] = 'T'; SG[1] = 'R'; SG[2] = 'U'; SG[3] = 'E'; SG[4] = 0x11; SG[5] = 0x23; SG[6] = 0x45; SG[7] = 0x66; } while (FALSE)
#define TC_IS_BOOT_ARGUMENTS_SIGNATURE(SG) (SG[0] == 'T' && SG[1] == 'R' && SG[2] == 'U' && SG[3] == 'E' && SG[4] == 0x11 && SG[5] == 0x23 && SG[6] == 0x45 && SG[7] == 0x66)
+#if !defined(TC_WINDOWS_BOOT)
+
+#define DCS_DISK_ENTRY_LIST_HEADER_SIGN SIGNATURE_64 ('D','C','S','D','E','L','S','T')
+
+#define DE_IDX_CRYPTOHEADER 0
+#define DE_IDX_LIST 1
+#define DE_IDX_DISKID 2
+#define DE_IDX_MAINGPTHDR 3
+#define DE_IDX_MAINGPTENTRYS 4
+#define DE_IDX_ALTGPTHDR 5
+#define DE_IDX_ALTGPTENTRYS 6
+#define DE_IDX_EXEC 7
+#define DE_IDX_PWDCACHE 8
+#define DE_IDX_RND 9
+#define DE_IDX_TOTAL 10
+static_assert(DE_IDX_TOTAL <= 15, "DE_IDX_TOTAL too big");
+
+enum DcsDiskEntryTypes {
+ DE_Unused = 0,
+ DE_Sectors,
+ DE_List,
+ DE_DISKID,
+ DE_ExecParams,
+ DE_PwdCache,
+ DE_Rnd
+};
+
+#pragma pack(1)
+typedef struct _SECREGION_BOOT_PARAMS {
+ uint64 Ptr;
+ uint32 Size;
+ uint32 Crc;
+} SECREGION_BOOT_PARAMS;
+
+typedef struct {
+ uint32 Data1;
+ uint16 Data2;
+ uint16 Data3;
+ byte Data4[8];
+} DCS_GUID;
+
+// DE types
+typedef struct _DCS_DISK_ENTRY_SECTORS {
+ uint32 Type;
+ uint32 Offset; // Offset in memory
+ uint64 Reserved;
+ uint64 Start; // Start on disk (byte)
+ uint64 Length; // length on disk (byte)
+} DCS_DISK_ENTRY_SECTORS;
+static_assert(sizeof(DCS_DISK_ENTRY_SECTORS) == 32, "Wrong size DCS_DISK_ENTRY_SECTORS");
+
+typedef struct _DCS_DISK_ENTRY_PARAMS {
+ uint32 Type;
+ uint32 Offset;
+ uint64 Reserved[2];
+ uint64 Length; // size of data
+} DCS_DISK_ENTRY_PARAMS;
+static_assert(sizeof(DCS_DISK_ENTRY_PARAMS) == 32, "Wrong size DCS_DISK_ENTRY_PARAMS");
+
+typedef struct _DCS_DISK_ENTRY_DISKID {
+ uint32 Type;
+ uint32 MbrID;
+ uint64 ReservedDiskId;
+ DCS_GUID GptID;
+} DCS_DISK_ENTRY_DISKID;
+static_assert(sizeof(DCS_DISK_ENTRY_DISKID) == 32, "Wrong size DCS_DISK_ENTRY_DISKID");
+
+#pragma warning(disable:4201)
+typedef struct _DCS_DISK_ENTRY {
+ union {
+ struct {
+ uint32 Type;
+ uint32 Offset;
+ byte reserved[16];
+ uint64 Length; // size of structure at Offset
+ };
+ DCS_DISK_ENTRY_SECTORS Sectors;
+ DCS_DISK_ENTRY_DISKID DiskId;
+ DCS_DISK_ENTRY_PARAMS Prm;
+ };
+} DCS_DISK_ENTRY;
+#pragma warning(default:4201)
+static_assert(sizeof(DCS_DISK_ENTRY) == 32, "Wrong size DCS_DISK_ENTRY");
+
+// Static compile time checks field offsets
+#ifndef FIELD_OFFSET
+#define FIELD_OFFSET(t, f) ((UINTN)(&((t*)0)->f))
+#endif
+static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Type), "Wrong Type offset");
+static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_DISKID, Type), "Wrong Type offset");
+static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Type), "Wrong Type offset");
+static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Length) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Length), "Wrong Length offset");
+static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Length) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Length), "Wrong Length offset");
+static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Offset), "Wrong Offset offset");
+static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Offset), "Wrong Offset offset");
+
+// DE type specific data
+// DE List
+typedef struct _DCS_DISK_ENTRY_LIST {
+ // EFI_TABLE_HEADER
+ uint64 Signature;
+ uint32 Revision;
+ uint32 HeaderSize; //< The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
+ uint32 CRC32; //< The 32-bit CRC for the entire table. This value is computed by setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
+ uint32 Reserved; //< Reserved field that must be set to 0.
+ //
+ uint32 Count;
+ uint32 DataSize;
+ //
+ DCS_DISK_ENTRY DE[15];
+} DCS_DISK_ENTRY_LIST;
+static_assert(sizeof(DCS_DISK_ENTRY_LIST) == 512, "Wrong size DCS_DISK_ENTRY_LIST");
+
+typedef struct _DCS_DEP_EXEC {
+ DCS_GUID ExecPartGuid;
+ uint16 ExecCmd[248];
+} DCS_DEP_EXEC;
+static_assert(sizeof(DCS_DEP_EXEC) == 512, "Wrong size DCS_DEP_EXEC");
+
+#define DCS_DEP_PWD_CACHE_SIGN SIGNATURE_64 ('P','W','D','C','A','C','H','E')
+typedef struct _DCS_DEP_PWD_CACHE {
+ uint64 Sign;
+ uint32 CRC;
+ uint32 Count;
+ Password Pwd[4];
+ int32 Pim[4];
+ byte pad[512 - 8 - 4 - 4 - (sizeof(Password) + 4) * 4];
+} DCS_DEP_PWD_CACHE;
+static_assert(sizeof(DCS_DEP_PWD_CACHE) == 512, "Wrong size DCS_DEP_PWD_CACHE");
+#pragma pack()
+
+#endif // #if !defined(TC_WINDOWS_BOOT)
#endif // TC_HEADER_Boot_BootCommon
diff --git a/src/Boot/Windows/BootDefs.h b/src/Boot/Windows/BootDefs.h
index 1fc923ae..3db227fd 100644
--- a/src/Boot/Windows/BootDefs.h
+++ b/src/Boot/Windows/BootDefs.h
@@ -29,6 +29,8 @@
# define TC__BOOT_MEMORY_REQUIRED 33
# elif defined (TC_WINDOWS_BOOT_TWOFISH)
# define TC__BOOT_MEMORY_REQUIRED 41
+# elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+# define TC__BOOT_MEMORY_REQUIRED 31
# endif
#if 0
@@ -100,6 +102,7 @@
#define TC__BOOT_USER_CFG_FLAG_DISABLE_ESC TC_HEX (02)
#define TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC_HEX (04)
#define TC__BOOT_USER_CFG_FLAG_DISABLE_PIM TC_HEX (08)
+#define TC__BOOT_USER_CFG_FLAG_STORE_HASH TC_HEX (10)
// The following items are treated as a 2-bit value (apply TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE to obtain the value)
#define TC__HIDDEN_OS_CREATION_PHASE_NONE 0
@@ -189,6 +192,7 @@ TC_HIDDEN_OS_CREATION_PHASE_WIPED = TC__HIDDEN_OS_CREATION_PHASE_WIPED
#define TC_BOOT_USER_CFG_FLAG_DISABLE_ESC TC__BOOT_USER_CFG_FLAG_DISABLE_ESC
#define TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION
#define TC_BOOT_USER_CFG_FLAG_DISABLE_PIM TC__BOOT_USER_CFG_FLAG_DISABLE_PIM
+#define TC_BOOT_USER_CFG_FLAG_STORE_HASH TC__BOOT_USER_CFG_FLAG_STORE_HASH
#define TC_HIDDEN_OS_CREATION_PHASE_NONE TC__HIDDEN_OS_CREATION_PHASE_NONE
#define TC_HIDDEN_OS_CREATION_PHASE_CLONING TC__HIDDEN_OS_CREATION_PHASE_CLONING
#define TC_HIDDEN_OS_CREATION_PHASE_WIPING TC__HIDDEN_OS_CREATION_PHASE_WIPING
@@ -196,4 +200,11 @@ TC_HIDDEN_OS_CREATION_PHASE_WIPED = TC__HIDDEN_OS_CREATION_PHASE_WIPED
#endif // TC_ASM_PREPROCESS
+#define EFI_BOOTARGS_REGIONS_LOW 0x90000, 0x88000, 0x80000
+#define EFI_BOOTARGS_REGIONS_HIGH \
+0x100000, 0x200000, 0x300000, 0x400000, 0x500000, 0x600000, 0x700000, 0x800000, \
+0x900000, 0xA00000, 0xB00000, 0xC00000, 0xD00000, 0xE00000, 0xF00000, 0x1000000
+
+#define EFI_BOOTARGS_REGIONS EFI_BOOTARGS_REGIONS_LOW, EFI_BOOTARGS_REGIONS_HIGH
+
#endif // TC_HEADER_Boot_BootDefs
diff --git a/src/Boot/Windows/Makefile b/src/Boot/Windows/Makefile
index 8377520b..c0f5d62f 100644
--- a/src/Boot/Windows/Makefile
+++ b/src/Boot/Windows/Makefile
@@ -104,6 +104,9 @@ OBJS = $(OBJS) $(OUTDIR)\Serpent.obj
OBJS = $(OBJS) $(OUTDIR)\Twofish.obj
!endif
+!if "$(SINGLE_CIPHER)" == "CAMELLIA"
+OBJS = $(OBJS) $(OUTDIR)\CamelliaSmall.obj
+!endif
all: env $(TARGETS)
diff --git a/src/Build/Resources/MacOSX/Info.plist.xml b/src/Build/Resources/MacOSX/Info.plist.xml
index 281d7e1a..fb2fc40f 100644
--- a/src/Build/Resources/MacOSX/Info.plist.xml
+++ b/src/Build/Resources/MacOSX/Info.plist.xml
@@ -40,5 +40,11 @@
<key>CSResourcesFileMapped</key>
<true/>
+
+ <key>NSHighResolutionCapable</key>
+ <true/>
+
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
</dict>
</plist>
diff --git a/src/Common/Apidrvr.h b/src/Common/Apidrvr.h
index 9c16b378..36233d76 100644
--- a/src/Common/Apidrvr.h
+++ b/src/Common/Apidrvr.h
@@ -26,23 +26,77 @@
#define TC_IOCTL(CODE) (CTL_CODE (FILE_DEVICE_UNKNOWN, 0x800 + (CODE), METHOD_BUFFERED, FILE_ANY_ACCESS))
+// IOCTL interface to \\device\veracrypt
+
+// Gets version of driver
+// OUT struct - LONG
#define TC_IOCTL_GET_DRIVER_VERSION TC_IOCTL (1)
+
+// Gets boot loader version
+// OUT struct - int16
#define TC_IOCTL_GET_BOOT_LOADER_VERSION TC_IOCTL (2)
+
+// Mount volume to \\Device\VeraCryptVolume"X"
+// IN OUT - MOUNT_STRUCT
#define TC_IOCTL_MOUNT_VOLUME TC_IOCTL (3)
+
+// Dismount volume
+// IN OUT - UNMOUNT_STRUCT
#define TC_IOCTL_DISMOUNT_VOLUME TC_IOCTL (4)
+
+// Dismount all volumes
+// IN OUT - UNMOUNT_STRUCT
#define TC_IOCTL_DISMOUNT_ALL_VOLUMES TC_IOCTL (5)
+
+// Get list of all mounted volumes
+// IN OUT - MOUNT_LIST_STRUCT (only 26 volumes possible)
#define TC_IOCTL_GET_MOUNTED_VOLUMES TC_IOCTL (6)
+
+// Get properties of the volume selected by driveNo
+// In OUT - VOLUME_PROPERTIES_STRUCT
#define TC_IOCTL_GET_VOLUME_PROPERTIES TC_IOCTL (7)
+
+// Get reference count to main device object
+// OUT - int
#define TC_IOCTL_GET_DEVICE_REFCOUNT TC_IOCTL (8)
+
+// Is it possible to unload driver
+// It check file system cache of mounted drives via unmount IOCTL.
+// OUT - int
#define TC_IOCTL_IS_DRIVER_UNLOAD_DISABLED TC_IOCTL (9)
+
+// Is there any mounted device
+// OUT - int
#define TC_IOCTL_IS_ANY_VOLUME_MOUNTED TC_IOCTL (10)
+
+// Check password cache
+// Result in IOCTL result TRUE if there is chached passwords
#define TC_IOCTL_GET_PASSWORD_CACHE_STATUS TC_IOCTL (11)
+
+// Clean password cache
#define TC_IOCTL_WIPE_PASSWORD_CACHE TC_IOCTL (12)
+
+// Check file/drive container
+// IN OUT - OPEN_TEST_STRUCT
#define TC_IOCTL_OPEN_TEST TC_IOCTL (13)
+
+// result of IOCTL_DISK_GET_PARTITION_INFO
+// IN OUT - DISK_PARTITION_INFO_STRUCT
+// TODO: need IOCTL_DISK_GET_PARTITION_INFO_EX to support GPT
#define TC_IOCTL_GET_DRIVE_PARTITION_INFO TC_IOCTL (14)
+
+// result IOCTL_DISK_GET_DRIVE_GEOMETRY
+// IN OUT - DISK_GEOMETRY_STRUCT
#define TC_IOCTL_GET_DRIVE_GEOMETRY TC_IOCTL (15)
+
+// result IOCTL_DISK_GET_LENGTH_INFO
+// IN OUT - ProbeRealDriveSizeRequest
#define TC_IOCTL_PROBE_REAL_DRIVE_SIZE TC_IOCTL (16)
+
+// result of ZwQuerySymbolicLinkObject
+// IN OUT RESOLVE_SYMLINK_STRUCT
#define TC_IOCTL_GET_RESOLVED_SYMLINK TC_IOCTL (17)
+
#define TC_IOCTL_GET_BOOT_ENCRYPTION_STATUS TC_IOCTL (18)
#define TC_IOCTL_BOOT_ENCRYPTION_SETUP TC_IOCTL (19)
#define TC_IOCTL_ABORT_BOOT_ENCRYPTION_SETUP TC_IOCTL (20)
@@ -287,7 +341,7 @@ typedef struct
typedef struct
{
WipeAlgorithmId WipeAlgorithm;
- byte WipeKey[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) byte WipeKey[MASTER_KEYDATA_SIZE];
} WipeDecoySystemRequest;
typedef struct
diff --git a/src/Common/BaseCom.cpp b/src/Common/BaseCom.cpp
index 5905b6a8..26e2650a 100644
--- a/src/Common/BaseCom.cpp
+++ b/src/Common/BaseCom.cpp
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -161,6 +161,63 @@ DWORD BaseCom::ReadWriteFile (BOOL write, BOOL device, BSTR filePath, BSTR *buff
return ERROR_SUCCESS;
}
+DWORD BaseCom::GetFileSize (BSTR filePath, unsigned __int64 *pSize)
+{
+ if (!pSize)
+ return ERROR_INVALID_PARAMETER;
+
+ try
+ {
+ std::wstring path (filePath);
+ File file(filePath, true);
+ file.CheckOpened (SRC_POS);
+ file.GetFileSize (*pSize);
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+}
+
+DWORD BaseCom::DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output)
+{
+ try
+ {
+ auto_ptr <File> file (device ? new Device (filePath, readOnly == TRUE) : new File (filePath, readOnly == TRUE));
+ file->CheckOpened (SRC_POS);
+ if (!file->IoCtl (dwIoControlCode, (BYTE *) input, !(BYTE *) input ? 0 : ((DWORD *) ((BYTE *) input))[-1],
+ (BYTE *) *output, !(BYTE *) *output ? 0 : ((DWORD *) ((BYTE *) *output))[-1]))
+ {
+ return GetLastError();
+ }
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+}
DWORD BaseCom::RegisterFilterDriver (BOOL registerDriver, int filterType)
{
@@ -244,3 +301,161 @@ DWORD BaseCom::WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName
return ERROR_SUCCESS;
}
+DWORD BaseCom::InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg)
+{
+ try
+ {
+ BootEncryption bootEnc (NULL);
+ bootEnc.InstallBootLoader (preserveUserConfig? true : false, hiddenOSCreation? true : false, pim, hashAlg);
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+}
+
+DWORD BaseCom::BackupEfiSystemLoader ()
+{
+ try
+ {
+ BootEncryption bootEnc (NULL);
+ bootEnc.BackupSystemLoader ();
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+}
+
+DWORD BaseCom::RestoreEfiSystemLoader ()
+{
+ try
+ {
+ BootEncryption bootEnc (NULL);
+ bootEnc.RestoreSystemLoader ();
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+}
+
+DWORD BaseCom::GetEfiBootDeviceNumber (BSTR* pSdn)
+{
+ if (!pSdn || !(*pSdn) || ((((DWORD *) ((BYTE *) *pSdn))[-1]) < sizeof (STORAGE_DEVICE_NUMBER)))
+ return ERROR_INVALID_PARAMETER;
+
+ try
+ {
+ BootEncryption bootEnc (NULL);
+ bootEnc.GetEfiBootDeviceNumber ((PSTORAGE_DEVICE_NUMBER) *pSdn);
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+}
+
+DWORD BaseCom::ReadEfiConfig (BSTR* pContent, DWORD *pcbRead)
+{
+ if (!pContent || !(*pContent))
+ return ERROR_INVALID_PARAMETER;
+
+ try
+ {
+ DWORD maxSize = ((DWORD *) ((BYTE *) *pContent))[-1];
+ BootEncryption bootEnc (NULL);
+ bootEnc.ReadEfiConfig ((byte*) *pContent, maxSize, pcbRead);
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+}
+
+DWORD BaseCom::WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg)
+{
+ if (!customUserMessage)
+ return ERROR_INVALID_PARAMETER;
+
+ try
+ {
+ DWORD maxSize = ((DWORD *) ((BYTE *) customUserMessage))[-1];
+ char* msg = (char*) *customUserMessage;
+ if (maxSize > 0)
+ msg [maxSize - 1] = 0;
+ std::string msgStr = maxSize > 0 ? msg : "";
+ BootEncryption bootEnc (NULL);
+ bootEnc.WriteEfiBootSectorUserConfig ((byte) userConfig, msgStr, pim, hashAlg);
+ }
+ catch (SystemException &)
+ {
+ return GetLastError();
+ }
+ catch (Exception &e)
+ {
+ e.Show (NULL);
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+ catch (...)
+ {
+ return ERROR_EXCEPTION_IN_SERVICE;
+ }
+
+ return ERROR_SUCCESS;
+} \ No newline at end of file
diff --git a/src/Common/BaseCom.h b/src/Common/BaseCom.h
index a5b27473..b103ad59 100644
--- a/src/Common/BaseCom.h
+++ b/src/Common/BaseCom.h
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -20,11 +20,11 @@ class TrueCryptFactory : public IClassFactory
{
public:
- TrueCryptFactory (DWORD messageThreadId) :
+ TrueCryptFactory (DWORD messageThreadId) :
RefCount (1), ServerLockCount (0), MessageThreadId (messageThreadId) { }
~TrueCryptFactory () { }
-
+
virtual ULONG STDMETHODCALLTYPE AddRef ()
{
return InterlockedIncrement (&RefCount) - 1;
@@ -53,7 +53,7 @@ public:
AddRef ();
return S_OK;
}
-
+
virtual HRESULT STDMETHODCALLTYPE CreateInstance (IUnknown *pUnkOuter, REFIID riid, void **ppvObject)
{
if (pUnkOuter != NULL)
@@ -110,6 +110,14 @@ public:
static DWORD RegisterSystemFavoritesService (BOOL registerService);
static DWORD SetDriverServiceStartType (DWORD startType);
static DWORD WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName, DWORD value);
+ static DWORD GetFileSize (BSTR filePath, unsigned __int64 *pSize);
+ static DWORD DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output);
+ static DWORD InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg);
+ static DWORD BackupEfiSystemLoader ();
+ static DWORD RestoreEfiSystemLoader ();
+ static DWORD GetEfiBootDeviceNumber (BSTR* pSdn);
+ static DWORD ReadEfiConfig (BSTR* pContent, DWORD *pcbRead);
+ static DWORD WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg);
};
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp
index 7148ca24..0146c7a5 100644
--- a/src/Common/BootEncryption.cpp
+++ b/src/Common/BootEncryption.cpp
@@ -28,6 +28,9 @@
#include "Random.h"
#include "Registry.h"
#include "Volumes.h"
+#include "Xml.h"
+#include "XZip.h"
+#include "XUnzip.h"
#ifdef VOLFORMAT
#include "Format/FormatCom.h"
@@ -44,7 +47,7 @@ namespace VeraCrypt
class Elevator
{
public:
-
+
static void AddReference ()
{
++ReferenceCount;
@@ -160,6 +163,75 @@ namespace VeraCrypt
memcpy (buffer, (BYTE *) bufferBstr.m_str, size);
}
+ static void GetFileSize (const wstring &filePath, unsigned __int64* pSize)
+ {
+ Elevate();
+
+ DWORD result;
+ CComBSTR fileBstr;
+ BSTR bstr = W2BSTR(filePath.c_str());
+ if (bstr)
+ {
+ fileBstr.Attach (bstr);
+ result = ElevatedComInstance->GetFileSize (fileBstr, pSize);
+ }
+ else
+ {
+ result = ERROR_OUTOFMEMORY;
+ }
+
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ throw SystemException(SRC_POS);
+ }
+ }
+
+ static BOOL DeviceIoControl (BOOL readOnly, BOOL device, const wstring &filePath, DWORD dwIoControlCode, LPVOID input, DWORD inputSize,
+ LPVOID output, DWORD outputSize)
+ {
+ Elevate();
+
+ DWORD result;
+
+ BSTR bstr = W2BSTR(filePath.c_str());
+ if (bstr)
+ {
+ CComBSTR inputBstr;
+ if (input && inputBstr.AppendBytes ((const char *) input, inputSize) != S_OK)
+ {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ CComBSTR outputBstr;
+ if (output && outputBstr.AppendBytes ((const char *) output, outputSize) != S_OK)
+ {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ CComBSTR fileBstr;
+ fileBstr.Attach (bstr);
+ result = ElevatedComInstance->DeviceIoControl (readOnly, device, fileBstr, dwIoControlCode, inputBstr, &outputBstr);
+
+ if (output)
+ memcpy (output, *(void **) &outputBstr, outputSize);
+ }
+ else
+ {
+ result = ERROR_OUTOFMEMORY;
+ }
+
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ return FALSE;
+ }
+ else
+ return TRUE;
+ }
+
static BOOL IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly)
{
Elevate();
@@ -225,6 +297,112 @@ namespace VeraCrypt
}
}
+ static void InstallEfiBootLoader (bool preserveUserConfig, bool hiddenOSCreation, int pim, int hashAlg)
+ {
+ Elevate();
+
+ DWORD result = ElevatedComInstance->InstallEfiBootLoader (preserveUserConfig ? TRUE : FALSE, hiddenOSCreation ? TRUE : FALSE, pim, hashAlg);
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ throw SystemException(SRC_POS);
+ }
+ }
+
+ static void BackupEfiSystemLoader ()
+ {
+ Elevate();
+
+ DWORD result = ElevatedComInstance->BackupEfiSystemLoader ();
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ throw SystemException(SRC_POS);
+ }
+ }
+
+ static void RestoreEfiSystemLoader ()
+ {
+ Elevate();
+
+ DWORD result = ElevatedComInstance->RestoreEfiSystemLoader ();
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ throw SystemException(SRC_POS);
+ }
+ }
+
+ static void GetEfiBootDeviceNumber (PSTORAGE_DEVICE_NUMBER pSdn)
+ {
+ Elevate();
+
+ CComBSTR outputBstr;
+ if (pSdn && outputBstr.AppendBytes ((const char *) pSdn, sizeof (STORAGE_DEVICE_NUMBER)) != S_OK)
+ {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ throw SystemException(SRC_POS);
+ }
+
+ DWORD result = ElevatedComInstance->GetEfiBootDeviceNumber (&outputBstr);
+
+ if (pSdn)
+ memcpy (pSdn, *(void **) &outputBstr, sizeof (STORAGE_DEVICE_NUMBER));
+
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ throw SystemException(SRC_POS);
+ }
+ }
+
+ static void ReadEfiConfig (byte* confContent, DWORD maxSize, DWORD* pcbRead)
+ {
+ Elevate();
+
+ CComBSTR outputBstr;
+ if (confContent && outputBstr.AppendBytes ((const char *) confContent, maxSize) != S_OK)
+ {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ throw SystemException(SRC_POS);
+ }
+
+ DWORD result = ElevatedComInstance->ReadEfiConfig (&outputBstr, pcbRead);
+
+ if (confContent)
+ memcpy (confContent, *(void **) &outputBstr, maxSize);
+
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ throw SystemException(SRC_POS);
+ }
+ }
+
+ static void WriteEfiBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim, int hashAlg)
+ {
+ Elevate();
+
+ DWORD result;
+ CComBSTR customUserMessageBstr;
+ BSTR bstr = A2BSTR(customUserMessage.c_str());
+ if (bstr)
+ {
+ customUserMessageBstr.Attach (bstr);
+ result = ElevatedComInstance->WriteEfiBootSectorUserConfig ((DWORD) userConfig, customUserMessageBstr, pim, hashAlg);
+ }
+ else
+ {
+ result = ERROR_OUTOFMEMORY;
+ }
+
+ if (result != ERROR_SUCCESS)
+ {
+ SetLastError (result);
+ throw SystemException(SRC_POS);
+ }
+ }
+
static void Release ()
{
if (--ReferenceCount == 0 && ElevatedComInstance)
@@ -292,12 +470,19 @@ namespace VeraCrypt
static void RegisterFilterDriver (bool registerDriver, BootEncryption::FilterType filterType) { throw ParameterIncorrect (SRC_POS); }
static void Release () { }
static void SetDriverServiceStartType (DWORD startType) { throw ParameterIncorrect (SRC_POS); }
+ static void GetFileSize (const wstring &filePath, unsigned __int64 *pSize) { throw ParameterIncorrect (SRC_POS); }
+ static BOOL DeviceIoControl (BOOL readOnly, BOOL device, const wstring &filePath, DWORD dwIoControlCode, LPVOID input, DWORD inputSize, LPVOID output, DWORD outputSize) { throw ParameterIncorrect (SRC_POS); }
+ static void InstallEfiBootLoader (bool preserveUserConfig, bool hiddenOSCreation, int pim, int hashAlg) { throw ParameterIncorrect (SRC_POS); }
+ static void BackupEfiSystemLoader () { throw ParameterIncorrect (SRC_POS); }
+ static void RestoreEfiSystemLoader () { throw ParameterIncorrect (SRC_POS); }
+ static void GetEfiBootDeviceNumber (PSTORAGE_DEVICE_NUMBER pSdn) { throw ParameterIncorrect (SRC_POS); }
+ static void ReadEfiConfig (byte* confContent, DWORD maxSize, DWORD* pcbRead) { throw ParameterIncorrect (SRC_POS); }
+ static void WriteEfiBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim, int hashAlg) { throw ParameterIncorrect (SRC_POS); }
};
#endif // SETUP
-
- File::File (wstring path, bool readOnly, bool create) : Elevated (false), FileOpen (false), LastError(0)
+ File::File (wstring path, bool readOnly, bool create) : Elevated (false), FileOpen (false), ReadOnly (readOnly), LastError(0)
{
Handle = CreateFile (path.c_str(),
readOnly ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,
@@ -375,6 +560,34 @@ namespace VeraCrypt
}
}
+ void File::GetFileSize (unsigned __int64& size)
+ {
+ if (!FileOpen)
+ {
+ SetLastError (LastError);
+ throw SystemException (SRC_POS);
+ }
+
+ if (Elevated)
+ {
+ Elevator::GetFileSize (Path, &size);
+ }
+ else
+ {
+ LARGE_INTEGER lSize;
+ lSize.QuadPart = 0;
+ throw_sys_if (!GetFileSizeEx (Handle, &lSize));
+ size = (unsigned __int64) lSize.QuadPart;
+ }
+ }
+
+ void File::GetFileSize (DWORD& dwSize)
+ {
+ unsigned __int64 size64;
+ GetFileSize (size64);
+ dwSize = (DWORD) size64;
+ }
+
void File::Write (byte *buffer, DWORD size)
{
DWORD bytesWritten;
@@ -416,6 +629,25 @@ namespace VeraCrypt
}
}
+ bool File::IoCtl(DWORD code, void* inBuf, DWORD inBufSize, void* outBuf, DWORD outBufSize)
+ {
+ if (!FileOpen)
+ {
+ SetLastError (LastError);
+ throw SystemException (SRC_POS);
+ }
+
+ if (Elevated)
+ {
+ return TRUE == Elevator::DeviceIoControl (ReadOnly, IsDevice, Path, code, inBuf, inBufSize, outBuf, outBufSize);
+ }
+ else
+ {
+ DWORD bytesReturned = 0;
+ return TRUE == DeviceIoControl(Handle, code, inBuf, inBufSize, outBuf, outBufSize, &bytesReturned, NULL);
+ }
+ }
+
void Show (HWND parent, const wstring &str)
{
MessageBox (parent, str.c_str(), NULL, 0);
@@ -449,14 +681,18 @@ namespace VeraCrypt
FilePointerPosition = 0;
IsDevice = true;
Path = path;
+ ReadOnly = readOnly;
}
+ static EfiBoot EfiBootInst;
BootEncryption::BootEncryption (HWND parent)
: DriveConfigValid (false),
ParentWindow (parent),
RealSystemDriveSizeValid (false),
RescueIsoImage (nullptr),
+ RescueZipData (nullptr),
+ RescueZipSize (0),
RescueVolumeHeaderValid (false),
SelectedEncryptionAlgorithmId (0),
SelectedPrfAlgorithmId (0),
@@ -476,7 +712,15 @@ namespace VeraCrypt
BootEncryption::~BootEncryption ()
{
if (RescueIsoImage)
+ {
+ burn (RescueIsoImage, RescueIsoImageSize);
delete[] RescueIsoImage;
+ }
+ if (RescueZipData)
+ {
+ burn (RescueZipData, RescueZipSize);
+ delete [] RescueZipData;
+ }
Elevator::Release();
}
@@ -513,50 +757,54 @@ namespace VeraCrypt
bool activePartitionFound = false;
bool candidateForHiddenOSFound = false;
- if (config.SystemPartition.IsGPT)
- throw ParameterIncorrect (SRC_POS); // It is assumed that CheckRequirements() had been called
-
- // Find the first active partition on the system drive
- foreach (const Partition &partition, config.Partitions)
+ if (!config.SystemPartition.IsGPT)
{
- if (partition.Info.BootIndicator)
+// throw ParameterIncorrect (SRC_POS); // It is assumed that CheckRequirements() had been called
+
+ // Find the first active partition on the system drive
+ foreach (const Partition &partition, config.Partitions)
{
- if (partition.Info.PartitionNumber != config.SystemPartition.Number)
+ if (partition.Info.BootIndicator)
{
- // If there is an extra boot partition, the system partition must be located right behind it
- if (IsOSAtLeast (WIN_7) && config.ExtraBootPartitionPresent)
+ if (partition.Info.PartitionNumber != config.SystemPartition.Number)
{
- int64 minOffsetFound = config.DrivePartition.Info.PartitionLength.QuadPart;
- Partition bootPartition = partition;
- Partition partitionBehindBoot;
-
- foreach (const Partition &partition, config.Partitions)
+ // If there is an extra boot partition, the system partition must be located right behind it
+ if (IsOSAtLeast (WIN_7) && config.ExtraBootPartitionPresent)
{
- if (partition.Info.StartingOffset.QuadPart > bootPartition.Info.StartingOffset.QuadPart
- && partition.Info.StartingOffset.QuadPart < minOffsetFound)
+ int64 minOffsetFound = config.DrivePartition.Info.PartitionLength.QuadPart;
+ Partition bootPartition = partition;
+ Partition partitionBehindBoot;
+
+ foreach (const Partition &partition, config.Partitions)
{
- minOffsetFound = partition.Info.StartingOffset.QuadPart;
- partitionBehindBoot = partition;
+ if (partition.Info.StartingOffset.QuadPart > bootPartition.Info.StartingOffset.QuadPart
+ && partition.Info.StartingOffset.QuadPart < minOffsetFound)
+ {
+ minOffsetFound = partition.Info.StartingOffset.QuadPart;
+ partitionBehindBoot = partition;
+ }
}
- }
- if (minOffsetFound != config.DrivePartition.Info.PartitionLength.QuadPart
- && partitionBehindBoot.Number == config.SystemPartition.Number)
- {
- activePartitionFound = true;
- break;
+ if (minOffsetFound != config.DrivePartition.Info.PartitionLength.QuadPart
+ && partitionBehindBoot.Number == config.SystemPartition.Number)
+ {
+ activePartitionFound = true;
+ break;
+ }
}
+
+ throw ErrorException (wstring (GetString ("SYSTEM_PARTITION_NOT_ACTIVE"))
+ + GetRemarksOnHiddenOS(), SRC_POS);
}
- throw ErrorException (wstring (GetString ("SYSTEM_PARTITION_NOT_ACTIVE"))
- + GetRemarksOnHiddenOS(), SRC_POS);
+ activePartitionFound = true;
+ break;
}
-
- activePartitionFound = true;
- break;
}
+ } else {
+ // For GPT
+ activePartitionFound = true;
}
-
/* WARNING: Note that the partition number at the end of a device path (\Device\HarddiskY\PartitionX) must
NOT be used to find the first partition physically located behind the active one. The reason is that the
user may have deleted and created partitions during this session and e.g. the second partition could have
@@ -1065,6 +1313,7 @@ namespace VeraCrypt
int ea = 0;
int pkcs5_prf = 0;
+ BOOL bIsGPT = GetSystemDriveConfiguration().SystemPartition.IsGPT;
if (GetStatus().DriveMounted)
{
try
@@ -1082,11 +1331,23 @@ namespace VeraCrypt
ea = SERPENT;
else if (_stricmp (request.BootEncryptionAlgorithmName, "Twofish") == 0)
ea = TWOFISH;
+ else if (_stricmp (request.BootEncryptionAlgorithmName, "Camellia") == 0)
+ ea = CAMELLIA;
+#if defined(CIPHER_GOST89)
+ else if (_stricmp (request.BootEncryptionAlgorithmName, "GOST89") == 0)
+ ea = GOST89;
+#endif
if (_stricmp(request.BootPrfAlgorithmName, "SHA-256") == 0)
pkcs5_prf = SHA256;
else if (_stricmp(request.BootPrfAlgorithmName, "RIPEMD-160") == 0)
pkcs5_prf = RIPEMD160;
+ else if (_stricmp(request.BootPrfAlgorithmName, "SHA-512") == 0)
+ pkcs5_prf = SHA512;
+ else if (_stricmp(request.BootPrfAlgorithmName, "Whirlpool") == 0)
+ pkcs5_prf = WHIRLPOOL;
+ else if (_stricmp(request.BootPrfAlgorithmName, "Streebog") == 0)
+ pkcs5_prf = STREEBOG;
else if (strlen(request.BootPrfAlgorithmName) == 0) // case of version < 1.0f
pkcs5_prf = RIPEMD160;
}
@@ -1101,6 +1362,9 @@ namespace VeraCrypt
}
catch (...) { }
}
+
+ if (pkcs5_prf == 0)
+ throw ParameterIncorrect (SRC_POS);
}
else
{
@@ -1111,8 +1375,8 @@ namespace VeraCrypt
pkcs5_prf = SelectedPrfAlgorithmId;
}
- // Only RIPEMD160 and SHA-256 are supported for boot loader
- if (pkcs5_prf != RIPEMD160 && pkcs5_prf != SHA256)
+ // Only RIPEMD160 and SHA-256 are supported for MBR boot loader
+ if (!bIsGPT && pkcs5_prf != RIPEMD160 && pkcs5_prf != SHA256)
throw ParameterIncorrect (SRC_POS);
int bootSectorId = 0;
@@ -1169,6 +1433,19 @@ namespace VeraCrypt
bootLoaderId = rescueDisk ? IDR_RESCUE_LOADER_TWOFISH : IDR_BOOT_LOADER_TWOFISH;
}
break;
+
+ case CAMELLIA:
+ if (pkcs5_prf == SHA256)
+ {
+ bootSectorId = rescueDisk ? IDR_RESCUE_BOOT_SECTOR_CAMELLIA_SHA2 : IDR_BOOT_SECTOR_CAMELLIA_SHA2;
+ bootLoaderId = rescueDisk ? IDR_RESCUE_LOADER_CAMELLIA_SHA2 : IDR_BOOT_LOADER_CAMELLIA_SHA2;
+ }
+ else
+ {
+ bootSectorId = rescueDisk ? IDR_RESCUE_BOOT_SECTOR_CAMELLIA : IDR_BOOT_SECTOR_CAMELLIA;
+ bootLoaderId = rescueDisk ? IDR_RESCUE_LOADER_CAMELLIA : IDR_BOOT_LOADER_CAMELLIA;
+ }
+ break;
}
// Boot sector
@@ -1233,47 +1510,128 @@ namespace VeraCrypt
}
}
-
- void BootEncryption::ReadBootSectorConfig (byte *config, size_t bufLength, byte *userConfig, string *customUserMessage, uint16 *bootLoaderVersion)
+ void BootEncryption::ReadEfiConfig (byte* confContent, DWORD maxSize, DWORD* pcbRead)
{
- if (config && bufLength < TC_BOOT_CFG_FLAG_AREA_SIZE)
+ if (!pcbRead)
throw ParameterIncorrect (SRC_POS);
- GetSystemDriveConfigurationRequest request;
- StringCchCopyW (request.DevicePath, ARRAYSIZE (request.DevicePath), GetSystemDriveConfiguration().DeviceKernelPath.c_str());
+ if (!IsAdmin() && IsUacSupported())
+ {
+ Elevator::ReadEfiConfig (confContent, maxSize, pcbRead);
+ }
+ else
+ {
+ unsigned __int64 ui64Size = 0;
+
+ finally_do ({ EfiBootInst.DismountBootPartition(); });
+ EfiBootInst.MountBootPartition(0);
+
+ EfiBootInst.GetFileSize(L"\\EFI\\VeraCrypt\\DcsProp", ui64Size);
+
+ *pcbRead = (DWORD) ui64Size;
+
+ if (*pcbRead > maxSize)
+ throw ParameterIncorrect (SRC_POS);
+ EfiBootInst.ReadFile (L"\\EFI\\VeraCrypt\\DcsProp", confContent, *pcbRead);
+ }
+ }
+
+ // return false when the user cancel an elevation request
+ bool BootEncryption::ReadBootSectorConfig (byte *config, size_t bufLength, byte *userConfig, string *customUserMessage, uint16 *bootLoaderVersion)
+ {
+ bool bCanceled = false, bExceptionOccured = false;
try
{
- CallDriver (TC_IOCTL_GET_SYSTEM_DRIVE_CONFIG, &request, sizeof (request), &request, sizeof (request));
- if (config)
- *config = request.Configuration;
+ if (GetSystemDriveConfiguration().SystemPartition.IsGPT)
+ {
+ byte confContent[4096];
+ DWORD dwSize;
- if (userConfig)
- *userConfig = request.UserConfiguration;
+ // for now, we don't support any boot config flags, like hidden OS one
+ if (config)
+ memset (config, 0, bufLength);
- if (customUserMessage)
- {
- request.CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH] = 0;
- *customUserMessage = request.CustomUserMessage;
+ // call ReadEfiConfig only when needed since it requires elevation
+ if (userConfig || customUserMessage || bootLoaderVersion)
+ {
+ ReadEfiConfig (confContent, sizeof (confContent) - 1, &dwSize);
+
+ confContent[dwSize] = 0;
+
+ EfiBootConf conf;
+ conf.Load ((char*) confContent);
+
+ if (userConfig)
+ {
+ *userConfig = 0;
+ if (!conf.requestPim)
+ *userConfig |= TC_BOOT_USER_CFG_FLAG_DISABLE_PIM;
+ if (!conf.requestHash)
+ *userConfig |= TC_BOOT_USER_CFG_FLAG_STORE_HASH;
+
+ }
+
+ if (customUserMessage)
+ customUserMessage->clear();
+
+ if (bootLoaderVersion)
+ {
+ *bootLoaderVersion = GetStatus().BootLoaderVersion;
+ }
+ }
}
+ else
+ {
+ if (config && bufLength < TC_BOOT_CFG_FLAG_AREA_SIZE)
+ throw ParameterIncorrect (SRC_POS);
- if (bootLoaderVersion)
- *bootLoaderVersion = request.BootLoaderVersion;
+ GetSystemDriveConfigurationRequest request;
+ StringCchCopyW (request.DevicePath, ARRAYSIZE (request.DevicePath), GetSystemDriveConfiguration().DeviceKernelPath.c_str());
+
+ CallDriver (TC_IOCTL_GET_SYSTEM_DRIVE_CONFIG, &request, sizeof (request), &request, sizeof (request));
+ if (config)
+ *config = request.Configuration;
+
+ if (userConfig)
+ *userConfig = request.UserConfiguration;
+
+ if (customUserMessage)
+ {
+ request.CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH] = 0;
+ *customUserMessage = request.CustomUserMessage;
+ }
+
+ if (bootLoaderVersion)
+ *bootLoaderVersion = request.BootLoaderVersion;
+ }
+ }
+ catch (UserAbort&)
+ {
+ bCanceled = true;
+ bExceptionOccured= true;
}
catch (...)
{
+ bExceptionOccured = true;
+ }
+
+ if (bExceptionOccured)
+ {
if (config)
*config = 0;
if (userConfig)
*userConfig = 0;
-
+
if (customUserMessage)
customUserMessage->clear();
if (bootLoaderVersion)
*bootLoaderVersion = 0;
}
+
+ return !bCanceled;
}
@@ -1299,52 +1657,78 @@ namespace VeraCrypt
throw ErrorException ("ERROR_MBR_PROTECTED", SRC_POS);
}
-
- void BootEncryption::WriteBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim)
+ void BootEncryption::WriteEfiBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim, int hashAlg)
{
- Device device (GetSystemDriveConfiguration().DevicePath);
- device.CheckOpened (SRC_POS);
- byte mbr[TC_SECTOR_SIZE_BIOS];
-
- device.SeekAt (0);
- device.Read (mbr, sizeof (mbr));
-
- if (!BufferContainsString (mbr, sizeof (mbr), TC_APP_NAME)
- || BE16 (*(uint16 *) (mbr + TC_BOOT_SECTOR_VERSION_OFFSET)) != VERSION_NUM)
+ if (!IsAdmin() && IsUacSupported())
{
- return;
+ Elevator::WriteEfiBootSectorUserConfig (userConfig, customUserMessage, pim, hashAlg);
}
-
- mbr[TC_BOOT_SECTOR_USER_CONFIG_OFFSET] = userConfig;
-
- memset (mbr + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, 0, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
-
- if (!customUserMessage.empty())
+ else
{
- if (customUserMessage.size() > TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)
- throw ParameterIncorrect (SRC_POS);
+ finally_do ({ EfiBootInst.DismountBootPartition(); });
+ EfiBootInst.MountBootPartition(0);
- memcpy (mbr + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, customUserMessage.c_str(), customUserMessage.size());
+ if (! (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM))
+ pim = -1;
+ if (! (userConfig & TC_BOOT_USER_CFG_FLAG_STORE_HASH))
+ hashAlg = -1;
+
+ EfiBootInst.UpdateConfig (L"\\EFI\\VeraCrypt\\DcsProp", pim, hashAlg, ParentWindow);
}
+ }
- if (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
+ void BootEncryption::WriteBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim, int hashAlg)
+ {
+ if (GetSystemDriveConfiguration().SystemPartition.IsGPT)
{
- // PIM for pre-boot authentication can be encoded on two bytes since its maximum
- // value is 65535 (0xFFFF)
- memcpy (mbr + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &pim, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
+ WriteEfiBootSectorUserConfig (userConfig, customUserMessage, pim, hashAlg);
}
else
- memset (mbr + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, 0, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
+ {
+ Device device (GetSystemDriveConfiguration().DevicePath);
+ device.CheckOpened (SRC_POS);
+ byte mbr[TC_SECTOR_SIZE_BIOS];
- device.SeekAt (0);
- device.Write (mbr, sizeof (mbr));
+ device.SeekAt (0);
+ device.Read (mbr, sizeof (mbr));
- byte mbrVerificationBuf[TC_SECTOR_SIZE_BIOS];
- device.SeekAt (0);
- device.Read (mbrVerificationBuf, sizeof (mbr));
+ if (!BufferContainsString (mbr, sizeof (mbr), TC_APP_NAME)
+ || BE16 (*(uint16 *) (mbr + TC_BOOT_SECTOR_VERSION_OFFSET)) != VERSION_NUM)
+ {
+ return;
+ }
- if (memcmp (mbr, mbrVerificationBuf, sizeof (mbr)) != 0)
- throw ErrorException ("ERROR_MBR_PROTECTED", SRC_POS);
+ mbr[TC_BOOT_SECTOR_USER_CONFIG_OFFSET] = userConfig;
+
+ memset (mbr + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, 0, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
+
+ if (!customUserMessage.empty())
+ {
+ if (customUserMessage.size() > TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)
+ throw ParameterIncorrect (SRC_POS);
+
+ memcpy (mbr + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, customUserMessage.c_str(), customUserMessage.size());
+ }
+
+ if (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
+ {
+ // PIM for pre-boot authentication can be encoded on two bytes since its maximum
+ // value is 65535 (0xFFFF)
+ memcpy (mbr + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &pim, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
+ }
+ else
+ memset (mbr + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, 0, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
+
+ device.SeekAt (0);
+ device.Write (mbr, sizeof (mbr));
+
+ byte mbrVerificationBuf[TC_SECTOR_SIZE_BIOS];
+ device.SeekAt (0);
+ device.Read (mbrVerificationBuf, sizeof (mbr));
+
+ if (memcmp (mbr, mbrVerificationBuf, sizeof (mbr)) != 0)
+ throw ErrorException ("ERROR_MBR_PROTECTED", SRC_POS);
+ }
}
@@ -1386,7 +1770,7 @@ namespace VeraCrypt
ZeroMemory (&request, sizeof (request));
request.WipeAlgorithm = wipeAlgorithm;
-
+
if (Randinit() != ERR_SUCCESS)
{
if (CryptoAPILastError == ERROR_SUCCESS)
@@ -1414,7 +1798,7 @@ namespace VeraCrypt
CallDriver (TC_IOCTL_ABORT_DECOY_SYSTEM_WIPE);
}
-
+
DecoySystemWipeStatus BootEncryption::GetDecoyOSWipeStatus ()
{
DecoySystemWipeStatus status;
@@ -1448,7 +1832,7 @@ namespace VeraCrypt
device.SeekAt (0);
device.Read (mbr, sizeof (mbr));
-
+
finally_do_arg (BootEncryption *, this,
{
try
@@ -1494,66 +1878,767 @@ namespace VeraCrypt
#endif // !SETUP
+ NtQuerySystemInformationFn NtQuerySystemInformationPtr = NULL;
+
+ EfiBootConf::EfiBootConf() : passwordType (0),
+ passwordMsg ("Enter Password: "),
+ passwordPicture ("login.bmp"),
+ hashMsg ("(0) TEST ALL (1) SHA512 (2) WHIRLPOOL (3) SHA256 (4) RIPEMD160 (5) STREEBOG\nHash: "),
+ hashAlgo (0),
+ requestHash (0),
+ pimMsg ("PIM (Leave empty for default): "),
+ pim (0),
+ requestPim (1),
+ authorizeVisible (0),
+ authorizeRetry (10)
+ {
+
+ }
+
+ BOOL EfiBootConf::ReadConfigValue (char* configContent, const char *configKey, char *configValue, int maxValueSize)
+ {
+ char *xml;
+
+ xml = configContent;
+ if (xml != NULL)
+ {
+ xml = XmlFindElementByAttributeValue (xml, "config", "key", configKey);
+ if (xml != NULL)
+ {
+ XmlGetNodeText (xml, configValue, maxValueSize);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+ }
+
+
+ int EfiBootConf::ReadConfigInteger (char* configContent, const char *configKey, int defaultValue)
+ {
+ char s[32];
+ int iRet;
+ if (ReadConfigValue (configContent, configKey, s, sizeof (s)))
+ iRet = atoi (s);
+ else
+ iRet = defaultValue;
+ burn (s, sizeof (s));
+ return iRet;
+ }
+
+
+ char* EfiBootConf::ReadConfigString (char* configContent, const char *configKey, char *defaultValue, char *str, int maxLen)
+ {
+ if (ReadConfigValue (configContent, configKey, str, maxLen))
+ return str;
+ else
+ {
+ StringCbCopyA (str, maxLen, defaultValue);
+ return defaultValue;
+ }
+ }
+
+ BOOL EfiBootConf::WriteConfigString (FILE* configFile, char* configContent, const char *configKey, const char *configValue)
+ {
+
+ BOOL bRet = FALSE;
+ if (configFile)
+ {
+ char *c;
+ // Mark previous config value as updated
+ if (configContent != NULL)
+ {
+ c = XmlFindElementByAttributeValue (configContent, "config", "key", configKey);
+ if (c != NULL)
+ c[1] = '!';
+ }
+
+ if ( 0 != fwprintf (
+ configFile, L"\n\t\t<config key=\"%hs\">%hs</config>",
+ configKey, configValue))
+ {
+ bRet = TRUE;
+ }
+ }
+ return bRet;
+ }
+
+ BOOL EfiBootConf::WriteConfigInteger (FILE* configFile, char* configContent, const char *configKey, int configValue)
+ {
+ BOOL bRet = FALSE;
+ if (configFile)
+ {
+ char val[32];
+ StringCbPrintfA (val, sizeof(val), "%d", configValue);
+ bRet = WriteConfigString (configFile, configContent, configKey, val);
+ burn (val, sizeof (val));
+ }
+ return bRet;
+ }
+
+ BOOL EfiBootConf::Load (const wchar_t* fileName)
+ {
+ DWORD size = 0;
+ char* configContent = LoadFile (fileName, &size);
+ if (configContent)
+ {
+ Load (configContent);
+ burn (configContent, size);
+ free (configContent);
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+
+ void EfiBootConf::Load (char* configContent)
+ {
+ char buffer[1024];
+
+ passwordType = ReadConfigInteger (configContent, "PasswordType", 0);
+ passwordMsg = ReadConfigString (configContent, "PasswordMsg", "Enter password: ", buffer, sizeof (buffer));
+ passwordPicture = ReadConfigString (configContent, "PasswordPicture", "\\EFI\\VeraCrypt\\login.bmp", buffer, sizeof (buffer));
+ //hashMsg = ReadConfigString (configContent, "HashMsg", "(0) TEST ALL (1) SHA512 (2) WHIRLPOOL (3) SHA256 (4) RIPEMD160 (5) STREEBOG\nHash: ", buffer, sizeof (buffer));
+ hashAlgo = ReadConfigInteger (configContent, "Hash", 0);
+ requestHash = ReadConfigInteger (configContent, "HashRqt", 1);
+ pimMsg = ReadConfigString (configContent, "PimMsg", "PIM: ", buffer, sizeof (buffer));
+ pim = ReadConfigInteger (configContent, "Pim", 0);
+ requestPim = ReadConfigInteger (configContent, "PimRqt", 1);
+ authorizeVisible = ReadConfigInteger (configContent, "AuthorizeVisible", 0);
+ authorizeRetry = ReadConfigInteger (configContent, "AuthorizeRetry", 0);
+
+ burn (buffer, sizeof (buffer));
+ }
+
+ BOOL EfiBootConf::Save (const wchar_t* fileName, HWND hwnd)
+ {
+ FILE *configFile = _wfopen (fileName, L"w,ccs=UTF-8");
+ if (configFile == NULL)
+ return FALSE;
+
+ BOOL bRet = FALSE;
+ DWORD size = 0;
+ char* configContent = LoadFile (fileName, &size);
+
+
+ XmlWriteHeader (configFile);
+ fputws (L"\n\t<configuration>", configFile);
+
+ WriteConfigInteger (configFile, configContent, "PasswordType", passwordType);
+ WriteConfigString (configFile, configContent, "PasswordMsg", passwordMsg.c_str());
+ WriteConfigString (configFile, configContent, "PasswordPicture", passwordPicture.c_str());
+ WriteConfigString (configFile, configContent, "HashMsg", hashMsg.c_str());
+ WriteConfigInteger (configFile, configContent, "Hash", hashAlgo);
+ WriteConfigInteger (configFile, configContent, "HashRqt", requestHash);
+ WriteConfigString (configFile, configContent, "PimMsg", pimMsg.c_str());
+ WriteConfigInteger (configFile, configContent, "Pim", pim);
+ WriteConfigInteger (configFile, configContent, "PimRqt", requestPim);
+ WriteConfigInteger (configFile, configContent, "AuthorizeVisible", authorizeVisible);
+ WriteConfigInteger (configFile, configContent, "AuthorizeRetry", authorizeRetry);
+
+ // Write unmodified values
+ char* xml = configContent;
+ char key[128], value[2048];
+ while (xml && (xml = XmlFindElement (xml, "config")))
+ {
+ XmlGetAttributeText (xml, "key", key, sizeof (key));
+ XmlGetNodeText (xml, value, sizeof (value));
+
+ fwprintf (configFile, L"\n\t\t<config key=\"%hs\">%hs</config>", key, value);
+ xml++;
+ }
+
+ fputws (L"\n\t</configuration>", configFile);
+ XmlWriteFooter (configFile);
+
+ TCFlushFile (configFile);
+
+ bRet = CheckFileStreamWriteErrors (hwnd, configFile, fileName);
+
+ fclose (configFile);
+
+ if (configContent != NULL)
+ {
+ burn (configContent, size);
+ free (configContent);
+ }
+
+ return bRet;
+ }
+
+ static const wchar_t* EfiVarGuid = L"{8BE4DF61-93CA-11D2-AA0D-00E098032B8C}";
+
+ EfiBoot::EfiBoot() {
+ ZeroMemory(EfiBootPartPath, sizeof(EfiBootPartPath));
+ ZeroMemory (systemPartitionPath, sizeof (systemPartitionPath));
+ m_bMounted = false;
+ }
+
+ void EfiBoot::MountBootPartition(WCHAR letter) {
+ NTSTATUS res;
+ ULONG len;
+ memset(tempBuf, 0, sizeof(tempBuf));
+
+ // Load NtQuerySystemInformation function point
+ if (!NtQuerySystemInformationPtr)
+ {
+ NtQuerySystemInformationPtr = (NtQuerySystemInformationFn) GetProcAddress (GetModuleHandle (L"ntdll.dll"), "NtQuerySystemInformation");
+ if (!NtQuerySystemInformationPtr)
+ throw SystemException (SRC_POS);
+ }
+
+ res = NtQuerySystemInformationPtr((SYSTEM_INFORMATION_CLASS)SYSPARTITIONINFORMATION, tempBuf, sizeof(tempBuf), &len);
+ if (res != S_OK)
+ {
+ SetLastError (res);
+ throw SystemException (SRC_POS);
+ }
+
+ PUNICODE_STRING pStr = (PUNICODE_STRING) tempBuf;
+ memcpy (systemPartitionPath, pStr->Buffer, min (pStr->Length, (sizeof (systemPartitionPath) - 2)));
+
+ if (!letter) {
+ if (!GetFreeDriveLetter(&EfiBootPartPath[0])) {
+ throw ErrorException(L"No free letter to mount EFI boot partition", SRC_POS);
+ }
+ } else {
+ EfiBootPartPath[0] = letter;
+ }
+ EfiBootPartPath[1] = ':';
+ EfiBootPartPath[2] = 0;
+ throw_sys_if(!DefineDosDevice(DDD_RAW_TARGET_PATH, EfiBootPartPath, systemPartitionPath));
+
+ Device dev(EfiBootPartPath, TRUE);
+
+ try
+ {
+ dev.CheckOpened(SRC_POS);
+ }
+ catch (...)
+ {
+ DefineDosDevice(DDD_REMOVE_DEFINITION, EfiBootPartPath, NULL);
+ throw;
+ }
+
+ bool bSuccess = dev.IoCtl(IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, &sdn, sizeof(sdn))
+ && dev.IoCtl(IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, &partInfo, sizeof(partInfo));
+ DWORD dwLastError = GetLastError ();
+ dev.Close();
+ if (!bSuccess)
+ {
+ DefineDosDevice(DDD_REMOVE_DEFINITION, EfiBootPartPath, NULL);
+ SetLastError (dwLastError);
+ throw SystemException(SRC_POS);
+ }
+
+ m_bMounted = true;
+ }
+
+ void EfiBoot::DismountBootPartition() {
+ if (m_bMounted)
+ {
+ DefineDosDevice(DDD_REMOVE_DEFINITION, EfiBootPartPath, NULL);
+ m_bMounted = false;
+ }
+ }
+
+ bool EfiBoot::IsEfiBoot() {
+ DWORD BootOrderLen;
+ BootOrderLen = GetFirmwareEnvironmentVariable(L"BootOrder", EfiVarGuid, tempBuf, sizeof(tempBuf));
+ return BootOrderLen != 0;
+ }
+
+ void EfiBoot::DeleteStartExec(uint16 statrtOrderNum, wchar_t* type) {
+ RaisePrivileges();
+ // Check EFI
+ if (!IsEfiBoot()) {
+ throw ErrorException(L"can not detect EFI environment", SRC_POS);
+ }
+ wchar_t varName[256];
+ StringCchPrintfW(varName, ARRAYSIZE (varName), L"%s%04X", type == NULL ? L"Boot" : type, statrtOrderNum);
+ SetFirmwareEnvironmentVariable(varName, EfiVarGuid, NULL, 0);
+
+ wstring order = L"Order";
+ order.insert(0, type == NULL ? L"Boot" : type);
+ uint32 startOrderLen = GetFirmwareEnvironmentVariable(order.c_str(), EfiVarGuid, tempBuf, sizeof(tempBuf));
+ uint32 startOrderNumPos = UINT_MAX;
+ bool startOrderUpdate = false;
+ uint16* startOrder = (uint16*)tempBuf;
+ for (uint32 i = 0; i < startOrderLen / 2; i++) {
+ if (startOrder[i] == statrtOrderNum) {
+ startOrderNumPos = i;
+ break;
+ }
+ }
+
+ // delete entry if present
+ if (startOrderNumPos != UINT_MAX) {
+ for (uint32 i = startOrderNumPos; i < ((startOrderLen / 2) - 1); ++i) {
+ startOrder[i] = startOrder[i + 1];
+ }
+ startOrderLen -= 2;
+ startOrderUpdate = true;
+ }
+
+ if (startOrderUpdate) {
+ SetFirmwareEnvironmentVariable(order.c_str(), EfiVarGuid, startOrder, startOrderLen);
+
+ // remove ourselves from BootNext value
+ uint16 bootNextValue = 0;
+ wstring next = L"Next";
+ next.insert(0, type == NULL ? L"Boot" : type);
+
+ if ( (GetFirmwareEnvironmentVariable(next.c_str(), EfiVarGuid, &bootNextValue, 2) == 2)
+ && (bootNextValue == statrtOrderNum)
+ )
+ {
+ SetFirmwareEnvironmentVariable(next.c_str(), EfiVarGuid, startOrder, 0);
+ }
+ }
+ }
+
+ void EfiBoot::SetStartExec(wstring description, wstring execPath, uint16 statrtOrderNum , wchar_t* type, uint32 attr) {
+ RaisePrivileges();
+ // Check EFI
+ if (!IsEfiBoot()) {
+ throw ErrorException(L"can not detect EFI environment", SRC_POS);
+ }
+
+ uint32 varSize = 56;
+ varSize += ((uint32) description.length()) * 2 + 2;
+ varSize += ((uint32) execPath.length()) * 2 + 2;
+ byte *startVar = new byte[varSize];
+ byte *pVar = startVar;
+
+ // Attributes (1b Active, 1000b - Hidden)
+ *(uint32 *)pVar = attr;
+ pVar += sizeof(uint32);
+
+ // Size Of device path + file path
+ *(uint16 *)pVar = (uint16)(50 + execPath.length() * 2 + 2);
+ pVar += sizeof(uint16);
+
+ // description
+ for (uint32 i = 0; i < description.length(); i++) {
+ *(uint16 *)pVar = description[i];
+ pVar += sizeof(uint16);
+ }
+ *(uint16 *)pVar = 0;
+ pVar += sizeof(uint16);
+
+ /* EFI_DEVICE_PATH_PROTOCOL (HARDDRIVE_DEVICE_PATH \ FILE_PATH \ END) */
+
+ // Type
+ *(byte *)pVar = 0x04;
+ pVar += sizeof(byte);
+
+ // SubType
+ *(byte *)pVar = 0x01;
+ pVar += sizeof(byte);
+
+ // HDD dev path length
+ *(uint16 *)pVar = 0x2A; // 42
+ pVar += sizeof(uint16);
+
+ // PartitionNumber
+ *(uint32 *)pVar = (uint32)partInfo.PartitionNumber;
+ pVar += sizeof(uint32);
+
+ // PartitionStart
+ *(uint64 *)pVar = partInfo.StartingOffset.QuadPart >> 9;
+ pVar += sizeof(uint64);
+
+ // PartitiontSize
+ *(uint64 *)pVar = partInfo.PartitionLength.QuadPart >> 9;
+ pVar += sizeof(uint64);
+
+ // GptGuid
+ memcpy(pVar, &partInfo.Gpt.PartitionId, 16);
+ pVar += 16;
+
+ // MbrType
+ *(byte *)pVar = 0x02;
+ pVar += sizeof(byte);
+
+ // SigType
+ *(byte *)pVar = 0x02;
+ pVar += sizeof(byte);
+
+ // Type and sub type 04 04 (file path)
+ *(uint16 *)pVar = 0x0404;
+ pVar += sizeof(uint16);
+
+ // SizeOfFilePath ((CHAR16)FullPath.length + sizeof(EndOfrecord marker) )
+ *(uint16 *)pVar = (uint16)(execPath.length() * 2 + 2 + sizeof(uint32));
+ pVar += sizeof(uint16);
+
+ // FilePath
+ for (uint32 i = 0; i < execPath.length(); i++) {
+ *(uint16 *)pVar = execPath[i];
+ pVar += sizeof(uint16);
+ }
+ *(uint16 *)pVar = 0;
+ pVar += sizeof(uint16);
+
+ // EndOfrecord
+ *(uint32 *)pVar = 0x04ff7f;
+ pVar += sizeof(uint32);
+
+ // Set variable
+ wchar_t varName[256];
+ StringCchPrintfW(varName, ARRAYSIZE (varName), L"%s%04X", type == NULL ? L"Boot" : type, statrtOrderNum);
+ SetFirmwareEnvironmentVariable(varName, EfiVarGuid, startVar, varSize);
+ delete startVar;
+
+ // Update order
+ wstring order = L"Order";
+ order.insert(0, type == NULL ? L"Boot" : type);
+
+ uint32 startOrderLen = GetFirmwareEnvironmentVariable(order.c_str(), EfiVarGuid, tempBuf, sizeof(tempBuf));
+ uint32 startOrderNumPos = UINT_MAX;
+ bool startOrderUpdate = false;
+ uint16* startOrder = (uint16*)tempBuf;
+ for (uint32 i = 0; i < startOrderLen / 2; i++) {
+ if (startOrder[i] == statrtOrderNum) {
+ startOrderNumPos = i;
+ break;
+ }
+ }
+
+ // Create new entry if absent
+ if (startOrderNumPos == UINT_MAX) {
+ for (uint32 i = startOrderLen / 2; i > 0; --i) {
+ startOrder[i] = startOrder[i - 1];
+ }
+ startOrder[0] = statrtOrderNum;
+ startOrderLen += 2;
+ startOrderUpdate = true;
+ } else if (startOrderNumPos > 0) {
+ for (uint32 i = startOrderNumPos; i > 0; --i) {
+ startOrder[i] = startOrder[i - 1];
+ }
+ startOrder[0] = statrtOrderNum;
+ startOrderUpdate = true;
+ }
+
+ if (startOrderUpdate) {
+ SetFirmwareEnvironmentVariable(order.c_str(), EfiVarGuid, startOrder, startOrderLen);
+ }
+
+ // set BootNext value
+ wstring next = L"Next";
+ next.insert(0, type == NULL ? L"Boot" : type);
+
+ SetFirmwareEnvironmentVariable(next.c_str(), EfiVarGuid, &statrtOrderNum, 2);
- void BootEncryption::InstallBootLoader (bool preserveUserConfig, bool hiddenOSCreation)
+ }
+
+ void EfiBoot::SaveFile(wchar_t* name, byte* data, DWORD size) {
+ wstring path = EfiBootPartPath;
+ path += name;
+ File f(path, false, true);
+ f.Write(data, size);
+ f.Close();
+ }
+
+ void EfiBoot::GetFileSize(const wchar_t* name, unsigned __int64& size) {
+ wstring path = EfiBootPartPath;
+ path += name;
+ File f(path, true);
+ f.GetFileSize(size);
+ f.Close();
+ }
+
+ void EfiBoot::ReadFile(const wchar_t* name, byte* data, DWORD size) {
+ wstring path = EfiBootPartPath;
+ path += name;
+ File f(path, true);
+ f.Read(data, size);
+ f.Close();
+ }
+
+ void EfiBoot::CopyFile(const wchar_t* name, const wchar_t* targetName) {
+ wstring path = EfiBootPartPath;
+ path += name;
+ wstring targetPath;
+ if (targetName[0] == L'\\')
+ {
+ targetPath = EfiBootPartPath;
+ targetPath += targetName;
+ }
+ else
+ targetPath = targetName;
+ throw_sys_if (!::CopyFileW (path.c_str(), targetPath.c_str(), FALSE));
+ }
+
+ BOOL EfiBoot::RenameFile(wchar_t* name, wchar_t* nameNew, BOOL bForce) {
+ wstring path = EfiBootPartPath;
+ path += name;
+ wstring pathNew = EfiBootPartPath;
+ pathNew += nameNew;
+ return MoveFileExW(path.c_str(), pathNew.c_str(), bForce? MOVEFILE_REPLACE_EXISTING : 0);
+ }
+
+ BOOL EfiBoot::DelFile(wchar_t* name) {
+ wstring path = EfiBootPartPath;
+ path += name;
+ return DeleteFile(path.c_str());
+ }
+
+ BOOL EfiBoot::MkDir(wchar_t* name, bool& bAlreadyExists) {
+ wstring path = EfiBootPartPath;
+ path += name;
+ bAlreadyExists = false;
+ BOOL bRet = CreateDirectory(path.c_str(), NULL);
+ if (!bRet && (GetLastError () == ERROR_ALREADY_EXISTS))
+ {
+ bRet = TRUE;
+ bAlreadyExists = true;
+ }
+ return bRet;
+ }
+
+ BOOL EfiBoot::ReadConfig (wchar_t* name, EfiBootConf& conf)
+ {
+ wstring path = EfiBootPartPath;
+ path += name;
+
+ return conf.Load (path.c_str());
+ }
+
+ BOOL EfiBoot::UpdateConfig (wchar_t* name, int pim, int hashAlgo, HWND hwndDlg)
+ {
+ BOOL bRet = FALSE;
+ EfiBootConf conf;
+ wstring path = EfiBootPartPath;
+ path += name;
+
+ if (conf.Load (path.c_str()))
+ {
+ if (pim >= 0)
+ {
+ conf.pim = pim;
+ conf.requestPim = 0;
+ }
+ else
+ {
+ conf.pim = 0;
+ conf.requestPim = 1;
+ }
+
+ if (hashAlgo >= 0)
+ {
+ conf.hashAlgo = hashAlgo;
+ conf.requestHash = 0;
+ }
+ else
+ {
+ conf.hashAlgo = 0;
+ conf.requestHash = 1;
+ }
+
+ return conf.Save (path.c_str(), hwndDlg);
+ }
+
+ return bRet;
+ }
+
+ BOOL EfiBoot::WriteConfig (wchar_t* name, bool preserveUserConfig, int pim, int hashAlgo, const char* passPromptMsg, HWND hwndDlg)
+ {
+ EfiBootConf conf;
+ wstring path = EfiBootPartPath;
+ path += name;
+
+ if (preserveUserConfig)
+ {
+ conf.Load (path.c_str());
+ if (pim >= 0 && (conf.requestPim == 0))
+ {
+ conf.pim = pim;
+ }
+ if (hashAlgo >= 0 && (conf.requestHash == 0))
+ {
+ conf.hashAlgo = hashAlgo;
+ }
+ }
+ else
+ {
+ if (pim >= 0)
+ {
+ conf.pim = pim;
+ conf.requestPim = 0;
+ }
+ else
+ {
+ conf.pim = 0;
+ conf.requestPim = 1;
+ }
+
+ if (hashAlgo >= 0)
+ {
+ conf.hashAlgo = hashAlgo;
+ conf.requestHash = 0;
+ }
+ else
+ {
+ conf.hashAlgo = 0;
+ conf.requestHash = 1;
+ }
+ }
+
+ if (passPromptMsg && strlen (passPromptMsg))
+ {
+ conf.passwordMsg = passPromptMsg;
+ }
+
+ return conf.Save (path.c_str(), hwndDlg);
+ }
+
+ void BootEncryption::InstallBootLoader (bool preserveUserConfig, bool hiddenOSCreation, int pim, int hashAlg)
{
Device device (GetSystemDriveConfiguration().DevicePath);
device.CheckOpened (SRC_POS);
- InstallBootLoader (device, preserveUserConfig, hiddenOSCreation);
+ InstallBootLoader (device, preserveUserConfig, hiddenOSCreation, pim, hashAlg);
}
- void BootEncryption::InstallBootLoader (Device& device, bool preserveUserConfig, bool hiddenOSCreation, int pim)
+ void BootEncryption::InstallBootLoader (Device& device, bool preserveUserConfig, bool hiddenOSCreation, int pim, int hashAlg)
{
- byte bootLoaderBuf[TC_BOOT_LOADER_AREA_SIZE - TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE] = {0};
- CreateBootLoaderInMemory (bootLoaderBuf, sizeof (bootLoaderBuf), false, hiddenOSCreation);
+ SystemDriveConfiguration config = GetSystemDriveConfiguration();
- // Write MBR
- byte mbr[TC_SECTOR_SIZE_BIOS];
+ if (config.SystemPartition.IsGPT) {
+ if (!IsAdmin()) {
+ if (IsUacSupported())
+ {
+ Elevator::InstallEfiBootLoader (preserveUserConfig, hiddenOSCreation, pim, hashAlg);
+ return;
+ }
+ else
+ {
+ Warning ("ADMIN_PRIVILEGES_WARN_DEVICES", ParentWindow);
+ }
+ }
+ DWORD sizeDcsBoot;
+ byte *dcsBootImg = MapResource(L"BIN", IDR_EFI_DCSBOOT, &sizeDcsBoot);
+ if (!dcsBootImg)
+ throw ErrorException(L"Out of resource DcsBoot", SRC_POS);
+ DWORD sizeDcsInt;
+ byte *dcsIntImg = MapResource(L"BIN", IDR_EFI_DCSINT, &sizeDcsInt);
+ if (!dcsIntImg)
+ throw ErrorException(L"Out of resource DcsInt", SRC_POS);
+ DWORD sizeDcsCfg;
+ byte *dcsCfgImg = MapResource(L"BIN", IDR_EFI_DCSCFG, &sizeDcsCfg);
+ if (!dcsCfgImg)
+ throw ErrorException(L"Out of resource DcsCfg", SRC_POS);
+ DWORD sizeLegacySpeaker;
+ byte *LegacySpeakerImg = MapResource(L"BIN", IDR_EFI_LEGACYSPEAKER, &sizeLegacySpeaker);
+ if (!LegacySpeakerImg)
+ throw ErrorException(L"Out of resource LegacySpeaker", SRC_POS);
+ DWORD sizeBootMenuLocker;
+ byte *BootMenuLockerImg = MapResource(L"BIN", IDR_EFI_DCSBML, &sizeBootMenuLocker);
+ if (!BootMenuLockerImg)
+ throw ErrorException(L"Out of resource DcsBml", SRC_POS);
+
+ finally_do ({ EfiBootInst.DismountBootPartition(); });
+ EfiBootInst.MountBootPartition(0);
- device.SeekAt (0);
- device.Read (mbr, sizeof (mbr));
+ try
+ {
+ // Save modules
+ bool bAlreadyExist;
+
+ EfiBootInst.MkDir(L"\\EFI\\VeraCrypt", bAlreadyExist);
+ EfiBootInst.SaveFile(L"\\EFI\\VeraCrypt\\DcsBoot.efi", dcsBootImg, sizeDcsBoot);
+ EfiBootInst.SaveFile(L"\\EFI\\Boot\\bootx64.efi", dcsBootImg, sizeDcsBoot);
+ EfiBootInst.SaveFile(L"\\EFI\\VeraCrypt\\DcsInt.dcs", dcsIntImg, sizeDcsInt);
+ EfiBootInst.SaveFile(L"\\EFI\\VeraCrypt\\DcsCfg.dcs", dcsCfgImg, sizeDcsCfg);
+ EfiBootInst.SaveFile(L"\\EFI\\VeraCrypt\\LegacySpeaker.dcs", LegacySpeakerImg, sizeLegacySpeaker);
+ EfiBootInst.SaveFile(L"\\EFI\\VeraCrypt\\DcsBml.dcs", BootMenuLockerImg, sizeBootMenuLocker);
+ EfiBootInst.SetStartExec(L"VeraCrypt BootLoader (DcsBoot)", L"\\EFI\\VeraCrypt\\DcsBoot.efi");
+
+ // move configuration file from old location (if it exists) to new location
+ // we don't force the move operation if the new location already exists
+ EfiBootInst.RenameFile (L"\\DcsProp", L"\\EFI\\VeraCrypt\\DcsProp", FALSE);
+ EfiBootInst.RenameFile (L"\\DcsBoot", L"\\EFI\\VeraCrypt\\DcsBoot", FALSE);
+
+ // move the original bootloader backup from old location (if it exists) to new location
+ // we don't force the move operation if the new location already exists
+ EfiBootInst.RenameFile (L"\\EFI\\Boot\\original_bootx64_vc_backup.efi", L"\\EFI\\Boot\\original_bootx64.vc_backup", FALSE);
+
+ // Clean beta9
+ EfiBootInst.DelFile(L"\\DcsBoot.efi");
+ EfiBootInst.DelFile(L"\\DcsInt.efi");
+ EfiBootInst.DelFile(L"\\DcsCfg.efi");
+ EfiBootInst.DelFile(L"\\LegacySpeaker.efi");
+ EfiBootInst.DelFile(L"\\DcsBoot");
+ EfiBootInst.DelFile(L"\\DcsProp");
+ }
+ catch (...)
+ {
+ throw;
+ }
- if (preserveUserConfig && BufferContainsString (mbr, sizeof (mbr), TC_APP_NAME))
+ EfiBootInst.WriteConfig (L"\\EFI\\VeraCrypt\\DcsProp", preserveUserConfig, pim, hashAlg, NULL, ParentWindow);
+ }
+ else
{
- uint16 version = BE16 (*(uint16 *) (mbr + TC_BOOT_SECTOR_VERSION_OFFSET));
- if (version != 0)
- {
- bootLoaderBuf[TC_BOOT_SECTOR_USER_CONFIG_OFFSET] = mbr[TC_BOOT_SECTOR_USER_CONFIG_OFFSET];
- memcpy (bootLoaderBuf + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, mbr + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
+ byte bootLoaderBuf[TC_BOOT_LOADER_AREA_SIZE - TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE] = {0};
+ CreateBootLoaderInMemory (bootLoaderBuf, sizeof (bootLoaderBuf), false, hiddenOSCreation);
+
+ // Write MBR
+ byte mbr[TC_SECTOR_SIZE_BIOS];
- if (bootLoaderBuf[TC_BOOT_SECTOR_USER_CONFIG_OFFSET] & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
+ device.SeekAt (0);
+ device.Read (mbr, sizeof (mbr));
+
+ if (preserveUserConfig && BufferContainsString (mbr, sizeof (mbr), TC_APP_NAME))
+ {
+ uint16 version = BE16 (*(uint16 *) (mbr + TC_BOOT_SECTOR_VERSION_OFFSET));
+ if (version != 0)
{
- if (pim >= 0)
+ bootLoaderBuf[TC_BOOT_SECTOR_USER_CONFIG_OFFSET] = mbr[TC_BOOT_SECTOR_USER_CONFIG_OFFSET];
+ memcpy (bootLoaderBuf + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, mbr + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
+
+ if (bootLoaderBuf[TC_BOOT_SECTOR_USER_CONFIG_OFFSET] & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
{
- memcpy (bootLoaderBuf + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &pim, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
+ if (pim >= 0)
+ {
+ memcpy (bootLoaderBuf + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &pim, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
+ }
+ else
+ memcpy (bootLoaderBuf + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, mbr + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
}
- else
- memcpy (bootLoaderBuf + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, mbr + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
}
}
- }
- memcpy (mbr, bootLoaderBuf, TC_MAX_MBR_BOOT_CODE_SIZE);
+ memcpy (mbr, bootLoaderBuf, TC_MAX_MBR_BOOT_CODE_SIZE);
- device.SeekAt (0);
- device.Write (mbr, sizeof (mbr));
+ device.SeekAt (0);
+ device.Write (mbr, sizeof (mbr));
- byte mbrVerificationBuf[TC_SECTOR_SIZE_BIOS];
- device.SeekAt (0);
- device.Read (mbrVerificationBuf, sizeof (mbr));
+ byte mbrVerificationBuf[TC_SECTOR_SIZE_BIOS];
+ device.SeekAt (0);
+ device.Read (mbrVerificationBuf, sizeof (mbr));
- if (memcmp (mbr, mbrVerificationBuf, sizeof (mbr)) != 0)
- throw ErrorException ("ERROR_MBR_PROTECTED", SRC_POS);
+ if (memcmp (mbr, mbrVerificationBuf, sizeof (mbr)) != 0)
+ throw ErrorException ("ERROR_MBR_PROTECTED", SRC_POS);
- // Write boot loader
- device.SeekAt (TC_SECTOR_SIZE_BIOS);
- device.Write (bootLoaderBuf + TC_SECTOR_SIZE_BIOS, sizeof (bootLoaderBuf) - TC_SECTOR_SIZE_BIOS);
+ // Write boot loader
+ device.SeekAt (TC_SECTOR_SIZE_BIOS);
+ device.Write (bootLoaderBuf + TC_SECTOR_SIZE_BIOS, sizeof (bootLoaderBuf) - TC_SECTOR_SIZE_BIOS);
+ }
}
#ifndef SETUP
bool BootEncryption::CheckBootloaderFingerprint (bool bSilent)
{
+ SystemDriveConfiguration config = GetSystemDriveConfiguration();
+
+ // return true for now when EFI system encryption is used until we implement
+ // a dedicated EFI fingerprinting mechanism in VeraCrypt driver
+ if (config.SystemPartition.IsGPT)
+ return true;
+
byte bootLoaderBuf[TC_BOOT_LOADER_AREA_SIZE - TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE] = {0};
byte fingerprint[WHIRLPOOL_DIGESTSIZE + SHA512_DIGESTSIZE];
byte expectedFingerprint[WHIRLPOOL_DIGESTSIZE + SHA512_DIGESTSIZE];
@@ -1594,7 +2679,7 @@ namespace VeraCrypt
WCHAR pathBuf[MAX_PATH];
throw_sys_if (!SUCCEEDED (SHGetFolderPath (NULL, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, pathBuf)));
-
+
wstring path = wstring (pathBuf) + L"\\" _T(TC_APP_NAME);
CreateDirectory (path.c_str(), NULL);
@@ -1622,126 +2707,255 @@ namespace VeraCrypt
BootEncryptionStatus encStatus = GetStatus();
if (encStatus.SetupInProgress)
throw ParameterIncorrect (SRC_POS);
+ BOOL bIsGPT = GetSystemDriveConfiguration().SystemPartition.IsGPT;
+ if (bIsGPT)
+ {
+ // create EFI disk structure
+ DWORD sizeDcsBoot;
+ byte *dcsBootImg = MapResource(L"BIN", IDR_EFI_DCSBOOT, &sizeDcsBoot);
+ if (!dcsBootImg)
+ throw ParameterIncorrect (SRC_POS);
+ DWORD sizeDcsInt;
+ byte *dcsIntImg = MapResource(L"BIN", IDR_EFI_DCSINT, &sizeDcsInt);
+ if (!dcsIntImg)
+ throw ParameterIncorrect (SRC_POS);
+ DWORD sizeDcsCfg;
+ byte *dcsCfgImg = MapResource(L"BIN", IDR_EFI_DCSCFG, &sizeDcsCfg);
+ if (!dcsCfgImg)
+ throw ParameterIncorrect (SRC_POS);
+ DWORD sizeLegacySpeaker;
+ byte *LegacySpeakerImg = MapResource(L"BIN", IDR_EFI_LEGACYSPEAKER, &sizeLegacySpeaker);
+ if (!LegacySpeakerImg)
+ throw ParameterIncorrect (SRC_POS);
+ DWORD sizeBootMenuLocker;
+ byte *BootMenuLockerImg = MapResource(L"BIN", IDR_EFI_DCSBML, &sizeBootMenuLocker);
+ if (!BootMenuLockerImg)
+ throw ParameterIncorrect (SRC_POS);
+ DWORD sizeDcsRescue;
+ byte *DcsRescueImg = MapResource(L"BIN", IDR_EFI_DCSRE, &sizeDcsRescue);
+ if (!DcsRescueImg)
+ throw ParameterIncorrect (SRC_POS);
- Buffer imageBuf (RescueIsoImageSize);
-
- byte *image = imageBuf.Ptr();
- memset (image, 0, RescueIsoImageSize);
-
- // Primary volume descriptor
- const char* szPrimVolDesc = "\001CD001\001";
- const char* szPrimVolLabel = "VeraCrypt Rescue Disk ";
- memcpy (image + 0x8000, szPrimVolDesc, strlen(szPrimVolDesc) + 1);
- memcpy (image + 0x7fff + 41, szPrimVolLabel, strlen(szPrimVolLabel) + 1);
- *(uint32 *) (image + 0x7fff + 81) = RescueIsoImageSize / 2048;
- *(uint32 *) (image + 0x7fff + 85) = BE32 (RescueIsoImageSize / 2048);
- image[0x7fff + 121] = 1;
- image[0x7fff + 124] = 1;
- image[0x7fff + 125] = 1;
- image[0x7fff + 128] = 1;
- image[0x7fff + 130] = 8;
- image[0x7fff + 131] = 8;
-
- image[0x7fff + 133] = 10;
- image[0x7fff + 140] = 10;
- image[0x7fff + 141] = 0x14;
- image[0x7fff + 157] = 0x22;
- image[0x7fff + 159] = 0x18;
-
- // Boot record volume descriptor
- const char* szBootRecDesc = "CD001\001EL TORITO SPECIFICATION";
- memcpy (image + 0x8801, szBootRecDesc, strlen(szBootRecDesc) + 1);
- image[0x8800 + 0x47] = 0x19;
-
- // Volume descriptor set terminator
- const char* szVolDescTerm = "\377CD001\001";
- memcpy (image + 0x9000, szVolDescTerm, strlen(szVolDescTerm) + 1);
-
- // Path table
- image[0xA000 + 0] = 1;
- image[0xA000 + 2] = 0x18;
- image[0xA000 + 6] = 1;
-
- // Root directory
- image[0xc000 + 0] = 0x22;
- image[0xc000 + 2] = 0x18;
- image[0xc000 + 9] = 0x18;
- image[0xc000 + 11] = 0x08;
- image[0xc000 + 16] = 0x08;
- image[0xc000 + 25] = 0x02;
- image[0xc000 + 28] = 0x01;
- image[0xc000 + 31] = 0x01;
- image[0xc000 + 32] = 0x01;
- image[0xc000 + 34] = 0x22;
- image[0xc000 + 36] = 0x18;
- image[0xc000 + 43] = 0x18;
- image[0xc000 + 45] = 0x08;
- image[0xc000 + 50] = 0x08;
- image[0xc000 + 59] = 0x02;
- image[0xc000 + 62] = 0x01;
- *(uint32 *) (image + 0xc000 + 65) = 0x010101;
-
- // Validation entry
- image[0xc800] = 1;
- int offset = 0xc800 + 0x1c;
- image[offset++] = 0xaa;
- image[offset++] = 0x55;
- image[offset++] = 0x55;
- image[offset] = 0xaa;
-
- // Initial entry
- offset = 0xc820;
- image[offset++] = 0x88;
- image[offset++] = 2;
- image[0xc820 + 6] = 1;
- image[0xc820 + 8] = TC_CD_BOOT_LOADER_SECTOR;
-
- // TrueCrypt Boot Loader
- CreateBootLoaderInMemory (image + TC_CD_BOOTSECTOR_OFFSET, TC_BOOT_LOADER_AREA_SIZE, true);
-
- // Volume header
- if (initialSetup)
- {
- if (!RescueVolumeHeaderValid)
+ unsigned int maxRescueZipSize = 4 * 1024 * 1024;
+ ZRESULT res;
+ HZIP hz = CreateZip (0, maxRescueZipSize, ZIP_MEMORY);
+ if (!hz)
throw ParameterIncorrect (SRC_POS);
- memcpy (image + TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET, RescueVolumeHeader, TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
- }
- else
- {
- Device bootDevice (GetSystemDriveConfiguration().DevicePath, true);
- bootDevice.CheckOpened (SRC_POS);
- bootDevice.SeekAt (TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET);
- bootDevice.Read (image + TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET, TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
- }
+ finally_do_arg (HZIP, hz, { CloseZip (finally_arg); });
- // Original system loader
- try
- {
- File sysBakFile (GetSystemLoaderBackupPath(), true);
- sysBakFile.CheckOpened (SRC_POS);
- sysBakFile.Read (image + TC_CD_BOOTSECTOR_OFFSET + TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET, TC_BOOT_LOADER_AREA_SIZE);
+ if (ZR_OK != ZipAdd (hz, L"EFI/Boot/bootx64.efi", DcsRescueImg, sizeDcsRescue, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+ if (ZR_OK !=ZipAdd (hz, L"EFI/VeraCrypt/DcsBml.dcs", BootMenuLockerImg, sizeBootMenuLocker, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+ if (ZR_OK != ZipAdd (hz, L"EFI/VeraCrypt/DcsBoot.efi", dcsBootImg, sizeDcsBoot, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+ if (ZR_OK != ZipAdd (hz, L"EFI/VeraCrypt/DcsCfg.dcs", dcsCfgImg, sizeDcsCfg, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+ if (ZR_OK != ZipAdd (hz, L"EFI/VeraCrypt/DcsInt.dcs", dcsIntImg, sizeDcsInt, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+ if (ZR_OK != ZipAdd (hz, L"EFI/VeraCrypt/LegacySpeaker.dcs", LegacySpeakerImg, sizeLegacySpeaker, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+
+ Buffer volHeader(TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
+
+ // Volume header
+ if (initialSetup)
+ {
+ if (!RescueVolumeHeaderValid)
+ throw ParameterIncorrect (SRC_POS);
+
+ memcpy (volHeader.Ptr (), RescueVolumeHeader, TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
+ }
+ else
+ {
+ Device bootDevice (GetSystemDriveConfiguration().DevicePath, true);
+ bootDevice.CheckOpened (SRC_POS);
+ bootDevice.SeekAt (TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET);
+ bootDevice.Read (volHeader.Ptr (), TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
+ }
+
+ if (ZR_OK != ZipAdd (hz, L"EFI/VeraCrypt/svh_bak", volHeader.Ptr (), TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+
+ // Original system loader
+ res = ZR_WRITE;
+ try
+ {
+ DWORD fileSize = 0;
+ File sysBakFile (GetSystemLoaderBackupPath(), true);
+ sysBakFile.CheckOpened (SRC_POS);
+ sysBakFile.GetFileSize(fileSize);
+ Buffer fileBuf ((DWORD) fileSize);
+ DWORD sizeLoader = sysBakFile.Read (fileBuf.Ptr (), fileSize);
+ res = ZipAdd (hz, L"EFI/Boot/original_bootx64.vc_backup", fileBuf.Ptr (), sizeLoader, ZIP_MEMORY);
+ }
+ catch (Exception &e)
+ {
+ e.Show (ParentWindow);
+ Warning ("SYS_LOADER_UNAVAILABLE_FOR_RESCUE_DISK", ParentWindow);
+ }
+
+ if (res != ZR_OK)
+ throw ParameterIncorrect (SRC_POS);
+
+ EfiBootConf conf;
+ wstring dcsPropFileName = GetTempPathString() + L"_dcsproprescue";
+ finally_do_arg (wstring, dcsPropFileName, { DeleteFileW (finally_arg.c_str()); });
+ if (conf.Save(dcsPropFileName.c_str(), ParentWindow))
+ {
+ DWORD fileSize = 0;
+ File propFile (dcsPropFileName, true, false);
+ propFile.CheckOpened (SRC_POS);
+ propFile.GetFileSize(fileSize);
+ Buffer propBuf (fileSize);
+ DWORD sizeDcsProp = propFile.Read (propBuf.Ptr (), fileSize);
+
+ if (ZR_OK != ZipAdd (hz, L"EFI/VeraCrypt/DcsProp", propBuf.Ptr (), sizeDcsProp, ZIP_MEMORY))
+ throw ParameterIncorrect (SRC_POS);
+ }
+ else
+ throw ParameterIncorrect (SRC_POS);
- image[TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_SECTOR_CONFIG_OFFSET] |= TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER;
+ void* pZipContent = NULL;
+ unsigned long ulZipSize = 0;
+ if (ZR_OK != ZipGetMemory (hz, &pZipContent, &ulZipSize))
+ throw ParameterIncorrect (SRC_POS);
+
+ RescueZipData = new byte[ulZipSize];
+ if (!RescueZipData)
+ throw bad_alloc();
+ memcpy (RescueZipData, pZipContent, ulZipSize);
+ RescueZipSize = ulZipSize;
+
+ if (!isoImagePath.empty())
+ {
+ File isoFile (isoImagePath, false, true);
+ isoFile.Write (RescueZipData, RescueZipSize);
+ }
}
- catch (Exception &e)
+ else
{
- e.Show (ParentWindow);
- Warning ("SYS_LOADER_UNAVAILABLE_FOR_RESCUE_DISK", ParentWindow);
- }
+ Buffer imageBuf (RescueIsoImageSize);
+
+ byte *image = imageBuf.Ptr();
+ memset (image, 0, RescueIsoImageSize);
+
+ // Primary volume descriptor
+ const char* szPrimVolDesc = "\001CD001\001";
+ const char* szPrimVolLabel = "VeraCrypt Rescue Disk ";
+ memcpy (image + 0x8000, szPrimVolDesc, strlen(szPrimVolDesc) + 1);
+ memcpy (image + 0x7fff + 41, szPrimVolLabel, strlen(szPrimVolLabel) + 1);
+ *(uint32 *) (image + 0x7fff + 81) = RescueIsoImageSize / 2048;
+ *(uint32 *) (image + 0x7fff + 85) = BE32 (RescueIsoImageSize / 2048);
+ image[0x7fff + 121] = 1;
+ image[0x7fff + 124] = 1;
+ image[0x7fff + 125] = 1;
+ image[0x7fff + 128] = 1;
+ image[0x7fff + 130] = 8;
+ image[0x7fff + 131] = 8;
+
+ image[0x7fff + 133] = 10;
+ image[0x7fff + 140] = 10;
+ image[0x7fff + 141] = 0x14;
+ image[0x7fff + 157] = 0x22;
+ image[0x7fff + 159] = 0x18;
+
+ // Boot record volume descriptor
+ const char* szBootRecDesc = "CD001\001EL TORITO SPECIFICATION";
+ memcpy (image + 0x8801, szBootRecDesc, strlen(szBootRecDesc) + 1);
+ image[0x8800 + 0x47] = 0x19;
+
+ // Volume descriptor set terminator
+ const char* szVolDescTerm = "\377CD001\001";
+ memcpy (image + 0x9000, szVolDescTerm, strlen(szVolDescTerm) + 1);
+
+ // Path table
+ image[0xA000 + 0] = 1;
+ image[0xA000 + 2] = 0x18;
+ image[0xA000 + 6] = 1;
+
+ // Root directory
+ image[0xc000 + 0] = 0x22;
+ image[0xc000 + 2] = 0x18;
+ image[0xc000 + 9] = 0x18;
+ image[0xc000 + 11] = 0x08;
+ image[0xc000 + 16] = 0x08;
+ image[0xc000 + 25] = 0x02;
+ image[0xc000 + 28] = 0x01;
+ image[0xc000 + 31] = 0x01;
+ image[0xc000 + 32] = 0x01;
+ image[0xc000 + 34] = 0x22;
+ image[0xc000 + 36] = 0x18;
+ image[0xc000 + 43] = 0x18;
+ image[0xc000 + 45] = 0x08;
+ image[0xc000 + 50] = 0x08;
+ image[0xc000 + 59] = 0x02;
+ image[0xc000 + 62] = 0x01;
+ *(uint32 *) (image + 0xc000 + 65) = 0x010101;
+
+ // Validation entry
+ image[0xc800] = 1;
+ int offset = 0xc800 + 0x1c;
+ image[offset++] = 0xaa;
+ image[offset++] = 0x55;
+ image[offset++] = 0x55;
+ image[offset] = 0xaa;
+
+ // Initial entry
+ offset = 0xc820;
+ image[offset++] = 0x88;
+ image[offset++] = 2;
+ image[0xc820 + 6] = 1;
+ image[0xc820 + 8] = TC_CD_BOOT_LOADER_SECTOR;
+
+ // TrueCrypt Boot Loader
+ CreateBootLoaderInMemory (image + TC_CD_BOOTSECTOR_OFFSET, TC_BOOT_LOADER_AREA_SIZE, true);
+
+ // Volume header
+ if (initialSetup)
+ {
+ if (!RescueVolumeHeaderValid)
+ throw ParameterIncorrect (SRC_POS);
+
+ memcpy (image + TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET, RescueVolumeHeader, TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
+ }
+ else
+ {
+ Device bootDevice (GetSystemDriveConfiguration().DevicePath, true);
+ bootDevice.CheckOpened (SRC_POS);
+ bootDevice.SeekAt (TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET);
+ bootDevice.Read (image + TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET, TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
+ }
- // Boot loader backup
- CreateBootLoaderInMemory (image + TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET, TC_BOOT_LOADER_AREA_SIZE, false);
+ // Original system loader
+ try
+ {
+ File sysBakFile (GetSystemLoaderBackupPath(), true);
+ sysBakFile.CheckOpened (SRC_POS);
+ sysBakFile.Read (image + TC_CD_BOOTSECTOR_OFFSET + TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET, TC_BOOT_LOADER_AREA_SIZE);
+
+ image[TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_SECTOR_CONFIG_OFFSET] |= TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER;
+ }
+ catch (Exception &e)
+ {
+ e.Show (ParentWindow);
+ Warning ("SYS_LOADER_UNAVAILABLE_FOR_RESCUE_DISK", ParentWindow);
+ }
+
+ // Boot loader backup
+ CreateBootLoaderInMemory (image + TC_CD_BOOTSECTOR_OFFSET + TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET, TC_BOOT_LOADER_AREA_SIZE, false);
- RescueIsoImage = new byte[RescueIsoImageSize];
- if (!RescueIsoImage)
- throw bad_alloc();
- memcpy (RescueIsoImage, image, RescueIsoImageSize);
+ RescueIsoImage = new byte[RescueIsoImageSize];
+ if (!RescueIsoImage)
+ throw bad_alloc();
+ memcpy (RescueIsoImage, image, RescueIsoImageSize);
- if (!isoImagePath.empty())
- {
- File isoFile (isoImagePath, false, true);
- isoFile.Write (image, RescueIsoImageSize);
+ if (!isoImagePath.empty())
+ {
+ File isoFile (isoImagePath, false, true);
+ isoFile.Write (image, RescueIsoImageSize);
+ }
}
}
#endif
@@ -1766,61 +2980,240 @@ namespace VeraCrypt
bool BootEncryption::VerifyRescueDisk ()
{
- if (!RescueIsoImage)
+ BOOL bIsGPT = GetSystemDriveConfiguration().SystemPartition.IsGPT;
+ if ((bIsGPT && !RescueZipData) || (!bIsGPT && !RescueIsoImage))
throw ParameterIncorrect (SRC_POS);
- for (WCHAR drive = L'Z'; drive >= L'C'; --drive)
+ if (bIsGPT)
{
- try
+ const wchar_t* efiFiles[] = {
+ L"EFI/Boot/bootx64.efi",
+ L"EFI/VeraCrypt/DcsBml.dcs",
+ L"EFI/VeraCrypt/DcsBoot.efi",
+ L"EFI/VeraCrypt/DcsCfg.dcs",
+ L"EFI/VeraCrypt/DcsInt.dcs",
+ L"EFI/VeraCrypt/LegacySpeaker.dcs",
+ L"EFI/VeraCrypt/svh_bak",
+ L"EFI/Boot/original_bootx64.vc_backup"
+ };
+
+ ZRESULT res;
+ HZIP hz = OpenZip(RescueZipData, RescueZipSize, ZIP_MEMORY);
+ if (!hz)
+ throw ParameterIncorrect (SRC_POS);
+ finally_do_arg (HZIP, hz, { CloseZip (finally_arg); });
+
+ for (WCHAR drive = L'Z'; drive >= L'C'; --drive)
+ {
+ try
+ {
+ WCHAR rootPath[4] = { drive, L':', L'\\', 0};
+ UINT driveType = GetDriveType (rootPath);
+ if (DRIVE_REMOVABLE == driveType)
+ {
+ // check if it is FAT/FAT32
+ WCHAR szNameBuffer[TC_MAX_PATH];
+ if (GetVolumeInformationW (rootPath, NULL, 0, NULL, NULL, NULL, szNameBuffer, ARRAYSIZE(szNameBuffer))
+ && !wcsncmp (szNameBuffer, L"FAT", 3))
+ {
+ int index, i;
+ ZIPENTRYW ze;
+ for (i = 0; i < ARRAYSIZE(efiFiles); i++)
+ {
+ bool bMatch = false;
+ res = FindZipItemW (hz, efiFiles[i], true, &index, &ze);
+ if ((res == ZR_OK) && (index >= 0))
+ {
+ // check that the file exists on the disk and that it has the same content
+ StringCbCopyW (szNameBuffer, sizeof (szNameBuffer), rootPath);
+ StringCbCatW (szNameBuffer, sizeof (szNameBuffer), efiFiles[i]);
+
+ try
+ {
+ DWORD dwSize = 0;
+ File diskFile (szNameBuffer, true);
+ diskFile.CheckOpened (SRC_POS);
+ diskFile.GetFileSize (dwSize);
+ if (dwSize == (DWORD) ze.unc_size)
+ {
+ Buffer fileBuf (dwSize);
+ if (dwSize == diskFile.Read (fileBuf.Ptr (), dwSize))
+ {
+ Buffer efiBuf (dwSize);
+ res = UnzipItem (hz, ze.index, efiBuf.Ptr (), dwSize, ZIP_MEMORY);
+ if (res == ZR_OK)
+ {
+ bMatch = (memcmp (efiBuf.Ptr(), fileBuf.Ptr(), dwSize) == 0);
+ }
+ }
+ }
+ }
+ catch (...)
+ {
+ }
+
+ }
+ else
+ {
+ // entry not found in our Rescue ZIP image. Skip it.
+ bMatch = true;
+ }
+
+ if (!bMatch)
+ break;
+ }
+
+ if (i == ARRAYSIZE(efiFiles))
+ {
+ // All entries processed
+ return true;
+ }
+ }
+ }
+ }
+ catch (...) { }
+ }
+ }
+ else
+ {
+ size_t verifiedSectorCount = (TC_CD_BOOTSECTOR_OFFSET + TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET + TC_BOOT_LOADER_AREA_SIZE) / 2048;
+ Buffer buffer ((verifiedSectorCount + 1) * 2048);
+ for (WCHAR drive = L'Z'; drive >= L'C'; --drive)
{
- WCHAR rootPath[4] = { drive, L':', L'\\', 0};
- UINT driveType = GetDriveType (rootPath);
- // check that it is a CD/DVD drive or a removable media in case a bootable
- // USB key was created from the rescue disk ISO file
- if ((DRIVE_CDROM == driveType) || (DRIVE_REMOVABLE == driveType))
+ try
{
- rootPath[2] = 0; // remove trailing backslash
+ WCHAR rootPath[4] = { drive, L':', L'\\', 0};
+ UINT driveType = GetDriveType (rootPath);
+ // check that it is a CD/DVD drive or a removable media in case a bootable
+ // USB key was created from the rescue disk ISO file
+ if ((DRIVE_CDROM == driveType) || (DRIVE_REMOVABLE == driveType))
+ {
+ rootPath[2] = 0; // remove trailing backslash
- Device driveDevice (rootPath, true);
- driveDevice.CheckOpened (SRC_POS);
- size_t verifiedSectorCount = (TC_CD_BOOTSECTOR_OFFSET + TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET + TC_BOOT_LOADER_AREA_SIZE) / 2048;
- Buffer buffer ((verifiedSectorCount + 1) * 2048);
+ Device driveDevice (rootPath, true);
+ driveDevice.CheckOpened (SRC_POS);
- DWORD bytesRead = driveDevice.Read (buffer.Ptr(), (DWORD) buffer.Size());
- if (bytesRead != buffer.Size())
- continue;
+ DWORD bytesRead = driveDevice.Read (buffer.Ptr(), (DWORD) buffer.Size());
+ if (bytesRead != buffer.Size())
+ continue;
- if (memcmp (buffer.Ptr(), RescueIsoImage, buffer.Size()) == 0)
- return true;
+ if (memcmp (buffer.Ptr(), RescueIsoImage, buffer.Size()) == 0)
+ return true;
+ }
}
+ catch (...) { }
}
- catch (...) { }
}
return false;
}
- bool BootEncryption::VerifyRescueDiskIsoImage (const wchar_t* imageFile)
+ bool BootEncryption::VerifyRescueDiskImage (const wchar_t* imageFile)
{
- if (!RescueIsoImage)
+ BOOL bIsGPT = GetSystemDriveConfiguration().SystemPartition.IsGPT;
+ if ((bIsGPT && !RescueZipData) || (!bIsGPT && !RescueIsoImage))
throw ParameterIncorrect (SRC_POS);
- try
+ if (bIsGPT)
{
- File isoFile (imageFile, true);
- isoFile.CheckOpened (SRC_POS);
- size_t verifiedSectorCount = (TC_CD_BOOTSECTOR_OFFSET + TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET + TC_BOOT_LOADER_AREA_SIZE) / 2048;
- Buffer buffer ((verifiedSectorCount + 1) * 2048);
+ try
+ {
+ DWORD dwSize = 0;
+ File rescueFile (imageFile, true);
+ rescueFile.CheckOpened (SRC_POS);
+ rescueFile.GetFileSize (dwSize);
+ Buffer rescueData (dwSize);
- DWORD bytesRead = isoFile.Read (buffer.Ptr(), (DWORD) buffer.Size());
- if ( (bytesRead == buffer.Size())
- && (memcmp (buffer.Ptr(), RescueIsoImage, buffer.Size()) == 0)
- )
+ if (dwSize == rescueFile.Read (rescueData.Ptr (), dwSize))
+ {
+ ZRESULT res;
+ HZIP hzFile = OpenZip(rescueData.Ptr (), dwSize, ZIP_MEMORY);
+ if (hzFile)
+ {
+ finally_do_arg (HZIP, hzFile, { CloseZip (finally_arg); });
+ HZIP hzMem = OpenZip(RescueZipData, RescueZipSize, ZIP_MEMORY);
+ if (hzMem)
+ {
+ finally_do_arg (HZIP, hzMem, { CloseZip (finally_arg); });
+ const wchar_t* efiFiles[] = {
+ L"EFI/Boot/bootx64.efi",
+ L"EFI/VeraCrypt/DcsBml.dcs",
+ L"EFI/VeraCrypt/DcsBoot.efi",
+ L"EFI/VeraCrypt/DcsCfg.dcs",
+ L"EFI/VeraCrypt/DcsInt.dcs",
+ L"EFI/VeraCrypt/LegacySpeaker.dcs",
+ L"EFI/VeraCrypt/svh_bak",
+ L"EFI/Boot/original_bootx64.vc_backup"
+ };
+
+ int index, i;
+ ZIPENTRYW zeFile, zeMem;
+ for (i = 0; i < ARRAYSIZE(efiFiles); i++)
+ {
+ bool bMatch = false;
+ res = FindZipItemW (hzMem, efiFiles[i], true, &index, &zeMem);
+ if ((res == ZR_OK) && (index >= 0))
+ {
+ res = FindZipItemW (hzFile, efiFiles[i], true, &index, &zeFile);
+ if ((res == ZR_OK) && (index >= 0) && (zeMem.unc_size == zeFile.unc_size))
+ {
+ Buffer fileBuf (zeFile.unc_size);
+ Buffer memBuf (zeFile.unc_size);
+
+ res = UnzipItem (hzMem, zeMem.index, memBuf.Ptr (), zeMem.unc_size, ZIP_MEMORY);
+ if (res == ZR_OK)
+ {
+ res = UnzipItem (hzFile, zeFile.index, fileBuf.Ptr (), zeFile.unc_size, ZIP_MEMORY);
+ if (res == ZR_OK)
+ {
+ bMatch = (memcmp (memBuf.Ptr (), fileBuf.Ptr (), zeMem.unc_size) == 0);
+ }
+ }
+ }
+
+ }
+ else
+ {
+ // entry not found in our internal Rescue ZIP image. Skip it.
+ bMatch = true;
+ }
+
+ if (!bMatch)
+ break;
+ }
+
+ if (i == ARRAYSIZE(efiFiles))
+ {
+ // All entries processed
+ return true;
+ }
+
+
+ }
+ }
+ }
+ }
+ catch (...) { }
+ }
+ else
+ {
+ try
{
- return true;
+ File rescueFile (imageFile, true);
+ rescueFile.CheckOpened (SRC_POS);
+ size_t verifiedSectorCount = (TC_CD_BOOTSECTOR_OFFSET + TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET + TC_BOOT_LOADER_AREA_SIZE) / 2048;
+ Buffer buffer ((verifiedSectorCount + 1) * 2048);
+
+ DWORD bytesRead = rescueFile.Read (buffer.Ptr(), (DWORD) buffer.Size());
+ if ( (bytesRead == buffer.Size())
+ && (memcmp (buffer.Ptr(), RescueIsoImage, buffer.Size()) == 0)
+ )
+ {
+ return true;
+ }
}
+ catch (...) { }
}
- catch (...) { }
return false;
}
@@ -1900,51 +3293,133 @@ namespace VeraCrypt
}
+#define VC_EFI_BOOTLOADER_NAME L"DcsBoot"
+
void BootEncryption::BackupSystemLoader ()
{
- Device device (GetSystemDriveConfiguration().DevicePath, true);
- device.CheckOpened (SRC_POS);
- byte bootLoaderBuf[TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS];
+ if (GetSystemDriveConfiguration().SystemPartition.IsGPT)
+ {
+ if (!IsAdmin()) {
+ if (IsUacSupported())
+ {
+ Elevator::BackupEfiSystemLoader ();
+ return;
+ }
+ else
+ {
+ Warning ("ADMIN_PRIVILEGES_WARN_DEVICES", ParentWindow);
+ }
+ }
+ unsigned __int64 loaderSize = 0;
- device.SeekAt (0);
- device.Read (bootLoaderBuf, sizeof (bootLoaderBuf));
+ finally_do ({ EfiBootInst.DismountBootPartition(); });
- // Prevent TrueCrypt loader from being backed up
- for (size_t i = 0; i < sizeof (bootLoaderBuf) - strlen (TC_APP_NAME); ++i)
- {
- if (memcmp (bootLoaderBuf + i, TC_APP_NAME, strlen (TC_APP_NAME)) == 0)
+ EfiBootInst.MountBootPartition(0);
+
+ EfiBootInst.GetFileSize(L"\\EFI\\Boot\\bootx64.efi", loaderSize);
+
+ std::vector<byte> bootLoaderBuf ((size_t) loaderSize);
+
+ EfiBootInst.ReadFile(L"\\EFI\\Boot\\bootx64.efi", &bootLoaderBuf[0], (DWORD) loaderSize);
+
+ // Prevent VeraCrypt EFI loader from being backed up
+ for (size_t i = 0; i < (size_t) loaderSize - (wcslen (VC_EFI_BOOTLOADER_NAME) * 2); ++i)
{
- if (AskWarnNoYes ("TC_BOOT_LOADER_ALREADY_INSTALLED", ParentWindow) == IDNO)
- throw UserAbort (SRC_POS);
- return;
+ if (memcmp (&bootLoaderBuf[i], VC_EFI_BOOTLOADER_NAME, wcslen (VC_EFI_BOOTLOADER_NAME) * 2) == 0)
+ {
+ if (AskWarnNoYes ("TC_BOOT_LOADER_ALREADY_INSTALLED", ParentWindow) == IDNO)
+ throw UserAbort (SRC_POS);
+ return;
+ }
}
+
+ EfiBootInst.CopyFile(L"\\EFI\\Boot\\bootx64.efi", GetSystemLoaderBackupPath().c_str());
+ EfiBootInst.CopyFile(L"\\EFI\\Boot\\bootx64.efi", L"\\EFI\\Boot\\original_bootx64.vc_backup");
}
+ else
+ {
+ Device device (GetSystemDriveConfiguration().DevicePath, true);
+ device.CheckOpened (SRC_POS);
+ byte bootLoaderBuf[TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS];
+
+ device.SeekAt (0);
+ device.Read (bootLoaderBuf, sizeof (bootLoaderBuf));
+
+ // Prevent TrueCrypt loader from being backed up
+ for (size_t i = 0; i < sizeof (bootLoaderBuf) - strlen (TC_APP_NAME); ++i)
+ {
+ if (memcmp (bootLoaderBuf + i, TC_APP_NAME, strlen (TC_APP_NAME)) == 0)
+ {
+ if (AskWarnNoYes ("TC_BOOT_LOADER_ALREADY_INSTALLED", ParentWindow) == IDNO)
+ throw UserAbort (SRC_POS);
+ return;
+ }
+ }
- File backupFile (GetSystemLoaderBackupPath(), false, true);
- backupFile.Write (bootLoaderBuf, sizeof (bootLoaderBuf));
+ File backupFile (GetSystemLoaderBackupPath(), false, true);
+ backupFile.Write (bootLoaderBuf, sizeof (bootLoaderBuf));
+ }
}
void BootEncryption::RestoreSystemLoader ()
{
- byte bootLoaderBuf[TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS];
+ SystemDriveConfiguration config = GetSystemDriveConfiguration();
+ if (config.SystemPartition.IsGPT) {
+ if (!IsAdmin()) {
+ if (IsUacSupported())
+ {
+ Elevator::RestoreEfiSystemLoader ();
+ return;
+ }
+ else
+ {
+ Warning ("ADMIN_PRIVILEGES_WARN_DEVICES", ParentWindow);
+ }
+ }
- File backupFile (GetSystemLoaderBackupPath(), true);
- backupFile.CheckOpened(SRC_POS);
- if (backupFile.Read (bootLoaderBuf, sizeof (bootLoaderBuf)) != sizeof (bootLoaderBuf))
- throw ParameterIncorrect (SRC_POS);
+ finally_do ({ EfiBootInst.DismountBootPartition(); });
+
+ EfiBootInst.MountBootPartition(0);
+
+ EfiBootInst.DeleteStartExec();
+ EfiBootInst.RenameFile(L"\\EFI\\Boot\\original_bootx64.vc_backup", L"\\EFI\\Boot\\bootx64.efi", TRUE);
+
+ EfiBootInst.DelFile(L"\\DcsBoot.efi");
+ EfiBootInst.DelFile(L"\\DcsInt.efi");
+ EfiBootInst.DelFile(L"\\DcsCfg.efi");
+ EfiBootInst.DelFile(L"\\LegacySpeaker.efi");
+ EfiBootInst.DelFile(L"\\DcsBoot");
+ EfiBootInst.DelFile(L"\\DcsProp");
+ EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsBoot.efi");
+ EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsInt.dcs");
+ EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsCfg.dcs");
+ EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\LegacySpeaker.dcs");
+ EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsBml.dcs");
+ EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsBoot");
+ EfiBootInst.DelFile(L"\\EFI\\VeraCrypt\\DcsProp");
+ }
+ else
+ {
+ byte bootLoaderBuf[TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS];
- Device device (GetSystemDriveConfiguration().DevicePath);
- device.CheckOpened (SRC_POS);
+ File backupFile (GetSystemLoaderBackupPath(), true);
+ backupFile.CheckOpened(SRC_POS);
+ if (backupFile.Read (bootLoaderBuf, sizeof (bootLoaderBuf)) != sizeof (bootLoaderBuf))
+ throw ParameterIncorrect (SRC_POS);
- // Preserve current partition table
- byte mbr[TC_SECTOR_SIZE_BIOS];
- device.SeekAt (0);
- device.Read (mbr, sizeof (mbr));
- memcpy (bootLoaderBuf + TC_MAX_MBR_BOOT_CODE_SIZE, mbr + TC_MAX_MBR_BOOT_CODE_SIZE, sizeof (mbr) - TC_MAX_MBR_BOOT_CODE_SIZE);
+ Device device (GetSystemDriveConfiguration().DevicePath);
+ device.CheckOpened (SRC_POS);
- device.SeekAt (0);
- device.Write (bootLoaderBuf, sizeof (bootLoaderBuf));
+ // Preserve current partition table
+ byte mbr[TC_SECTOR_SIZE_BIOS];
+ device.SeekAt (0);
+ device.Read (mbr, sizeof (mbr));
+ memcpy (bootLoaderBuf + TC_MAX_MBR_BOOT_CODE_SIZE, mbr + TC_MAX_MBR_BOOT_CODE_SIZE, sizeof (mbr) - TC_MAX_MBR_BOOT_CODE_SIZE);
+
+ device.SeekAt (0);
+ device.Write (bootLoaderBuf, sizeof (bootLoaderBuf));
+ }
}
#endif // SETUP
@@ -2183,11 +3658,34 @@ namespace VeraCrypt
RegisterSystemFavoritesService (registerService, FALSE);
}
+ void BootEncryption::GetEfiBootDeviceNumber (PSTORAGE_DEVICE_NUMBER pSdn)
+ {
+ SystemDriveConfiguration config = GetSystemDriveConfiguration ();
+ if (config.SystemPartition.IsGPT && pSdn)
+ {
+ if (!IsAdmin() && IsUacSupported())
+ {
+ Elevator::GetEfiBootDeviceNumber (pSdn);
+ }
+ else
+ {
+ finally_do ({ EfiBootInst.DismountBootPartition(); });
+ EfiBootInst.MountBootPartition(0);
+ memcpy (pSdn, EfiBootInst.GetStorageDeviceNumber(), sizeof (STORAGE_DEVICE_NUMBER));
+ }
+ }
+ else
+ {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ throw SystemException (SRC_POS);
+ }
+ }
+
void BootEncryption::CheckRequirements ()
{
if (nCurrentOS == WIN_2000)
throw ErrorException ("SYS_ENCRYPTION_UNSUPPORTED_ON_CURRENT_OS", SRC_POS);
-
+
if (CurrentOSMajor == 6 && CurrentOSMinor == 0 && CurrentOSServicePack < 1)
throw ErrorException ("SYS_ENCRYPTION_UNSUPPORTED_ON_VISTA_SP0", SRC_POS);
@@ -2196,7 +3694,7 @@ namespace VeraCrypt
SystemDriveConfiguration config = GetSystemDriveConfiguration ();
- if (config.SystemPartition.IsGPT)
+ if (config.SystemPartition.IsGPT && !Is64BitOs())
throw ErrorException ("GPT_BOOT_DRIVE_UNSUPPORTED", SRC_POS);
if (SystemDriveIsDynamic())
@@ -2211,7 +3709,13 @@ namespace VeraCrypt
throw ErrorException ("SYSENC_UNSUPPORTED_SECTOR_SIZE_BIOS", SRC_POS);
bool activePartitionFound = false;
- if (!config.SystemPartition.IsGPT)
+ if (config.SystemPartition.IsGPT)
+ {
+ STORAGE_DEVICE_NUMBER sdn;
+ GetEfiBootDeviceNumber (&sdn);
+ activePartitionFound = (config.DriveNumber == (int) sdn.DeviceNumber);
+ }
+ else
{
// Determine whether there is an Active partition on the system drive
foreach (const Partition &partition, config.Partitions)
@@ -2272,7 +3776,7 @@ namespace VeraCrypt
if (!pagingFilesOk)
{
- if (AskWarnYesNoString ((wchar_t *) (wstring (GetString ("PAGING_FILE_NOT_ON_SYS_PARTITION"))
+ if (AskWarnYesNoString ((wchar_t *) (wstring (GetString ("PAGING_FILE_NOT_ON_SYS_PARTITION"))
+ GetString ("LEAKS_OUTSIDE_SYSPART_UNIVERSAL_EXPLANATION")
+ L"\n\n\n"
+ GetString ("RESTRICT_PAGING_FILES_TO_SYS_PARTITION")
@@ -2283,7 +3787,7 @@ namespace VeraCrypt
AbortProcessSilent();
}
- throw ErrorException (wstring (GetString ("PAGING_FILE_NOT_ON_SYS_PARTITION"))
+ throw ErrorException (wstring (GetString ("PAGING_FILE_NOT_ON_SYS_PARTITION"))
+ GetString ("LEAKS_OUTSIDE_SYSPART_UNIVERSAL_EXPLANATION"), SRC_POS);
}
@@ -2291,14 +3795,14 @@ namespace VeraCrypt
wchar_t *configPath = GetConfigPath (L"dummy");
if (configPath && towupper (configPath[0]) != windowsDrive)
{
- throw ErrorException (wstring (GetString ("USER_PROFILE_NOT_ON_SYS_PARTITION"))
+ throw ErrorException (wstring (GetString ("USER_PROFILE_NOT_ON_SYS_PARTITION"))
+ GetString ("LEAKS_OUTSIDE_SYSPART_UNIVERSAL_EXPLANATION"), SRC_POS);
}
// Temporary files
if (towupper (GetTempPathString()[0]) != windowsDrive)
{
- throw ErrorException (wstring (GetString ("TEMP_NOT_ON_SYS_PARTITION"))
+ throw ErrorException (wstring (GetString ("TEMP_NOT_ON_SYS_PARTITION"))
+ GetString ("LEAKS_OUTSIDE_SYSPART_UNIVERSAL_EXPLANATION"), SRC_POS);
}
}
@@ -2315,19 +3819,21 @@ namespace VeraCrypt
SystemDriveConfiguration config = GetSystemDriveConfiguration ();
- if (encStatus.VolumeHeaderPresent)
- {
- // Verify CRC of header salt
- Device device (config.DevicePath, true);
- device.CheckOpened (SRC_POS);
- byte header[TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE];
+ if (!config.SystemPartition.IsGPT) {
+ if (encStatus.VolumeHeaderPresent)
+ {
+ // Verify CRC of header salt
+ Device device(config.DevicePath, true);
+ device.CheckOpened(SRC_POS);
+ byte header[TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE];
- device.SeekAt (TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET);
- device.Read (header, sizeof (header));
+ device.SeekAt(TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET);
+ device.Read(header, sizeof(header));
- if (encStatus.VolumeHeaderSaltCrc32 != GetCrc32 ((byte *) header, PKCS5_SALT_SIZE))
- throw ParameterIncorrect (SRC_POS);
- }
+ if (encStatus.VolumeHeaderSaltCrc32 != GetCrc32((byte *)header, PKCS5_SALT_SIZE))
+ throw ParameterIncorrect(SRC_POS);
+ }
+ }
try
{
@@ -2414,7 +3920,7 @@ namespace VeraCrypt
device.Read ((byte *) header, sizeof (header));
PCRYPTO_INFO cryptoInfo = NULL;
-
+
int status = ReadVolumeHeader (!encStatus.HiddenSystem, header, oldPassword, old_pkcs5, old_pim, FALSE, &cryptoInfo, NULL);
finally_do_arg (PCRYPTO_INFO, cryptoInfo, { if (finally_arg) crypto_close (finally_arg); });
@@ -2447,7 +3953,7 @@ namespace VeraCrypt
UserEnrichRandomPool (hwndDlg);
WaitCursor();
- /* The header will be re-encrypted wipePassCount times to prevent adversaries from using
+ /* The header will be re-encrypted wipePassCount times to prevent adversaries from using
techniques such as magnetic force microscopy or magnetic force scanning tunnelling microscopy
to recover the overwritten header. According to Peter Gutmann, data should be overwritten 22
times (ideally, 35 times) using non-random patterns and pseudorandom data. However, as users might
@@ -2530,20 +4036,24 @@ namespace VeraCrypt
try
{
// check if PIM is stored in MBR
- byte userConfig;
- ReadBootSectorConfig (nullptr, 0, &userConfig);
- if (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
+ byte userConfig = 0;
+ if ( ReadBootSectorConfig (nullptr, 0, &userConfig)
+ && (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
+ )
+ {
storedPimUpdateNeeded = true;
+ }
}
catch (...)
- {}
+ {
+ }
}
try
{
// force update of bootloader if fingerprint doesn't match or if the stored PIM changed
if (storedPimUpdateNeeded || !CheckBootloaderFingerprint (true))
- InstallBootLoader (device, true, false, pim);
+ InstallBootLoader (device, true, false, pim, cryptoInfo->pkcs5);
}
catch (...)
{}
@@ -2561,7 +4071,7 @@ namespace VeraCrypt
}
- void BootEncryption::Install (bool hiddenSystem)
+ void BootEncryption::Install (bool hiddenSystem, int hashAlgo)
{
BootEncryptionStatus encStatus = GetStatus();
if (encStatus.DriveMounted)
@@ -2569,7 +4079,7 @@ namespace VeraCrypt
try
{
- InstallBootLoader (false, hiddenSystem);
+ InstallBootLoader (false, hiddenSystem, -1, hashAlgo);
if (!hiddenSystem)
InstallVolumeHeader ();
@@ -2663,7 +4173,7 @@ namespace VeraCrypt
SelectedEncryptionAlgorithmId = ea;
SelectedPrfAlgorithmId = pkcs5;
CreateVolumeHeader (volumeSize, encryptedAreaStart, &password, ea, mode, pkcs5, pim);
-
+
if (!rescueIsoImagePath.empty())
CreateRescueIsoImage (true, rescueIsoImagePath);
}
@@ -2705,7 +4215,7 @@ namespace VeraCrypt
BootEncryptionSetupRequest request;
ZeroMemory (&request, sizeof (request));
-
+
request.SetupMode = SetupDecryption;
request.DiscardUnreadableEncryptedSectors = discardUnreadableEncryptedSectors;
@@ -2721,7 +4231,7 @@ namespace VeraCrypt
BootEncryptionSetupRequest request;
ZeroMemory (&request, sizeof (request));
-
+
request.SetupMode = SetupEncryption;
request.WipeAlgorithm = wipeAlgorithm;
request.ZeroUnreadableSectors = zeroUnreadableSectors;
diff --git a/src/Common/BootEncryption.h b/src/Common/BootEncryption.h
index d75b650c..c8c9e29f 100644
--- a/src/Common/BootEncryption.h
+++ b/src/Common/BootEncryption.h
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -18,6 +18,16 @@
#include "Exception.h"
#include "Platform/PlatformBase.h"
#include "Volumes.h"
+#include <Winternl.h>
+
+#define SYSPARTITIONINFORMATION 0x62
+
+typedef NTSTATUS (WINAPI *NtQuerySystemInformationFn)(
+ SYSTEM_INFORMATION_CLASS SystemInformationClass,
+ PVOID SystemInformation,
+ ULONG SystemInformationLength,
+ PULONG ReturnLength
+);
using namespace std;
@@ -26,7 +36,7 @@ namespace VeraCrypt
class File
{
public:
- File () : Elevated (false), FileOpen (false), FilePointerPosition(0), Handle(INVALID_HANDLE_VALUE), IsDevice(false), LastError(0) { }
+ File () : Elevated (false), FileOpen (false), ReadOnly (false), FilePointerPosition(0), Handle(INVALID_HANDLE_VALUE), IsDevice(false), LastError(0) { }
File (wstring path,bool readOnly = false, bool create = false);
virtual ~File () { Close(); }
@@ -35,10 +45,14 @@ namespace VeraCrypt
DWORD Read (byte *buffer, DWORD size);
void Write (byte *buffer, DWORD size);
void SeekAt (int64 position);
+ void GetFileSize (unsigned __int64& size);
+ void GetFileSize (DWORD& dwSize);
+ bool IoCtl(DWORD code, void* inBuf, DWORD inBufSize, void* outBuf, DWORD outBufSize);
protected:
bool Elevated;
bool FileOpen;
+ bool ReadOnly;
uint64 FilePointerPosition;
HANDLE Handle;
bool IsDevice;
@@ -131,6 +145,67 @@ namespace VeraCrypt
bool SystemLoaderPresent;
};
+ class EfiBootConf
+ {
+ public:
+
+ int passwordType;
+ string passwordMsg;
+ string passwordPicture;
+ string hashMsg;
+ int hashAlgo;
+ int requestHash;
+ string pimMsg;
+ int pim;
+ int requestPim;
+ int authorizeVisible;
+ int authorizeRetry;
+
+ EfiBootConf();
+
+ static BOOL ReadConfigValue (char* configContent, const char *configKey, char *configValue, int maxValueSize);
+ static int ReadConfigInteger (char* configContent, const char *configKey, int defaultValue);
+ static char *ReadConfigString (char* configContent, const char *configKey, char *defaultValue, char *str, int maxLen);
+ static BOOL WriteConfigString (FILE* configFile, char* configContent, const char *configKey, const char *configValue);
+ static BOOL WriteConfigInteger (FILE* configFile, char* configContent, const char *configKey, int configValue);
+ BOOL Load (const wchar_t* fileName);
+ void Load (char* configContent);
+ BOOL Save (const wchar_t* fileName, HWND hwnd);
+ };
+
+ class EfiBoot {
+ public:
+ EfiBoot();
+
+ void MountBootPartition(WCHAR letter);
+ void DismountBootPartition();
+ bool IsEfiBoot();
+
+ void DeleteStartExec(uint16 statrtOrderNum = 0xDC5B, wchar_t* type = NULL);
+ void SetStartExec(wstring description, wstring execPath, uint16 statrtOrderNum = 0xDC5B, wchar_t* type = NULL, uint32 attr = 1);
+ void SaveFile(wchar_t* name, byte* data, DWORD size);
+ void GetFileSize(const wchar_t* name, unsigned __int64& size);
+ void ReadFile(const wchar_t* name, byte* data, DWORD size);
+ void CopyFile(const wchar_t* name, const wchar_t* targetName);
+
+ BOOL RenameFile(wchar_t* name, wchar_t* nameNew, BOOL bForce);
+ BOOL DelFile(wchar_t* name);
+ BOOL MkDir(wchar_t* name, bool& bAlreadyExists);
+ BOOL ReadConfig (wchar_t* name, EfiBootConf& conf);
+ BOOL UpdateConfig (wchar_t* name, int pim, int hashAlgo, HWND hwndDlg);
+ BOOL WriteConfig (wchar_t* name, bool preserveUserConfig, int pim, int hashAlgo, const char* passPromptMsg, HWND hwndDlg);
+
+ PSTORAGE_DEVICE_NUMBER GetStorageDeviceNumber () { return &sdn;}
+
+ protected:
+ bool m_bMounted;
+ WCHAR EfiBootPartPath[3];
+ STORAGE_DEVICE_NUMBER sdn;
+ PARTITION_INFORMATION_EX partInfo;
+ WCHAR tempBuf[1024];
+ WCHAR systemPartitionPath[MAX_PATH];
+ };
+
class BootEncryption
{
public:
@@ -168,9 +243,9 @@ namespace VeraCrypt
BootEncryptionStatus GetStatus ();
void GetVolumeProperties (VOLUME_PROPERTIES_STRUCT *properties);
SystemDriveConfiguration GetSystemDriveConfiguration ();
- void Install (bool hiddenSystem);
- void InstallBootLoader (Device& device, bool preserveUserConfig = false, bool hiddenOSCreation = false, int pim = -1);
- void InstallBootLoader (bool preserveUserConfig = false, bool hiddenOSCreation = false);
+ void Install (bool hiddenSystem, int hashAlgo);
+ void InstallBootLoader (Device& device, bool preserveUserConfig = false, bool hiddenOSCreation = false, int pim = -1, int hashAlg = -1);
+ void InstallBootLoader (bool preserveUserConfig = false, bool hiddenOSCreation = false, int pim = -1, int hashAlg = -1);
bool CheckBootloaderFingerprint (bool bSilent = false);
void InvalidateCachedSysDriveProperties ();
bool IsCDRecorderPresent ();
@@ -179,8 +254,9 @@ namespace VeraCrypt
void PrepareHiddenOSCreation (int ea, int mode, int pkcs5);
void PrepareInstallation (bool systemPartitionOnly, Password &password, int ea, int mode, int pkcs5, int pim, const wstring &rescueIsoImagePath);
void ProbeRealSystemDriveSize ();
- void ReadBootSectorConfig (byte *config, size_t bufLength, byte *userConfig = nullptr, string *customUserMessage = nullptr, uint16 *bootLoaderVersion = nullptr);
+ bool ReadBootSectorConfig (byte *config, size_t bufLength, byte *userConfig = nullptr, string *customUserMessage = nullptr, uint16 *bootLoaderVersion = nullptr);
uint32 ReadDriverConfigurationFlags ();
+ void ReadEfiConfig (byte* confContent, DWORD maxSize, DWORD* pcbRead);
void RegisterBootDriver (bool hiddenSystem);
void RegisterFilterDriver (bool registerDriver, FilterType filterType);
void RegisterSystemFavoritesService (BOOL registerService);
@@ -202,17 +278,20 @@ namespace VeraCrypt
bool SystemPartitionCoversWholeDrive ();
bool SystemDriveIsDynamic ();
bool VerifyRescueDisk ();
- bool VerifyRescueDiskIsoImage (const wchar_t* imageFile);
+ bool VerifyRescueDiskImage (const wchar_t* imageFile);
void WipeHiddenOSCreationConfig ();
void WriteBootDriveSector (uint64 offset, byte *data);
void WriteBootSectorConfig (const byte newConfig[]);
- void WriteBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim);
+ void WriteBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim, int hashAlg);
+ void WriteEfiBootSectorUserConfig (byte userConfig, const string &customUserMessage, int pim, int hashAlg);
void WriteLocalMachineRegistryDwordValue (wchar_t *keyPath, wchar_t *valueName, DWORD value);
+ void GetEfiBootDeviceNumber (PSTORAGE_DEVICE_NUMBER pSdn);
+ void BackupSystemLoader ();
+ void RestoreSystemLoader ();
protected:
static const uint32 RescueIsoImageSize = 1835008; // Size of ISO9660 image with bootable emulated 1.44MB floppy disk image
- void BackupSystemLoader ();
void CreateBootLoaderInMemory (byte *buffer, size_t bufferSize, bool rescueDisk, bool hiddenOSCreation = false);
void CreateVolumeHeader (uint64 volumeSize, uint64 encryptedAreaStart, Password *password, int ea, int mode, int pkcs5, int pim);
wstring GetSystemLoaderBackupPath ();
@@ -221,8 +300,7 @@ namespace VeraCrypt
PartitionList GetDrivePartitions (int driveNumber);
wstring GetRemarksOnHiddenOS ();
wstring GetWindowsDirectory ();
- void RegisterFilter (bool registerFilter, FilterType filterType, const GUID *deviceClassGuid = nullptr);
- void RestoreSystemLoader ();
+ void RegisterFilter (bool registerFilter, FilterType filterType, const GUID *deviceClassGuid = nullptr);
void InstallVolumeHeader ();
HWND ParentWindow;
@@ -231,6 +309,8 @@ namespace VeraCrypt
int SelectedPrfAlgorithmId;
Partition HiddenOSCandidatePartition;
byte *RescueIsoImage;
+ byte *RescueZipData;
+ unsigned long RescueZipSize;
byte RescueVolumeHeader[TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE];
byte VolumeHeader[TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE];
bool DriveConfigValid;
diff --git a/src/Common/Common.rc b/src/Common/Common.rc
index b84fba8e..c3dd808e 100644
--- a/src/Common/Common.rc
+++ b/src/Common/Common.rc
@@ -138,25 +138,30 @@ BEGIN
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,158,208,1,WS_EX_STATICEDGE
END
-IDD_BENCHMARK_DLG DIALOGEX 0, 0, 330, 223
+IDD_BENCHMARK_DLG DIALOGEX 0, 0, 330, 247
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "VeraCrypt - Encryption Algorithm Benchmark"
+CAPTION "VeraCrypt - Algorithms Benchmark"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- COMBOBOX IDC_BENCHMARK_BUFFER_SIZE,55,7,77,129,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_BENCHMARK_SORT_METHOD,207,7,116,74,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- CONTROL "",IDC_RESULTS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,37,249,160
- DEFPUSHBUTTON "Benchmark",IDC_PERFORM_BENCHMARK,265,37,58,14
- PUSHBUTTON "Close",IDCLOSE,265,55,58,14
- LTEXT "Hardware-accelerated AES:",IDC_HW_AES_LABEL_LINK,148,210,108,9,SS_NOTIFY,WS_EX_RIGHT
- CONTROL "",IDC_HW_AES,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,262,209,57,11,WS_EX_STATICEDGE
- LTEXT "Parallelization:",IDC_PARALLELIZATION_LABEL_LINK,4,210,67,9,SS_NOTIFY,WS_EX_RIGHT
- CONTROL "",IDC_PARALLELIZATION,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,77,209,57,11,WS_EX_STATICEDGE
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,29,328,1,WS_EX_STATICEDGE
- LTEXT "Buffer Size:",IDT_BUFFER_SIZE,0,9,53,8,0,WS_EX_RIGHT
- LTEXT "Sort Method:",IDT_SORT_METHOD,135,9,70,8,0,WS_EX_RIGHT
- LTEXT "Speed is affected by CPU load and storage device characteristics.\n\nThese tests take place in RAM.",IDT_BOX_BENCHMARK_INFO,266,81,57,116
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,205,328,1,WS_EX_STATICEDGE
+ COMBOBOX IDC_BENCHMARK_LIST,55,11,87,53,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_BENCHMARK_BUFFER_SIZE,209,11,87,129,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_PIM,209,11,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER | NOT WS_VISIBLE
+ CONTROL "Pre-Boot",IDC_BENCHMARK_PREBOOT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,258,14,71,10
+ COMBOBOX IDC_BENCHMARK_SORT_METHOD,55,40,139,74,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "Benchmark",IDC_PERFORM_BENCHMARK,265,60,58,14
+ PUSHBUTTON "Close",IDCLOSE,265,79,58,14
+ CONTROL "",IDC_RESULTS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,60,249,160
+ LTEXT "Hardware-accelerated AES:",IDC_HW_AES_LABEL_LINK,148,233,108,9,SS_NOTIFY,WS_EX_RIGHT
+ CONTROL "",IDC_HW_AES,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,262,232,57,11,WS_EX_STATICEDGE
+ LTEXT "Parallelization:",IDC_PARALLELIZATION_LABEL_LINK,4,233,67,9,SS_NOTIFY,WS_EX_RIGHT
+ CONTROL "",IDC_PARALLELIZATION,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,77,232,57,11,WS_EX_STATICEDGE
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,32,328,1,WS_EX_STATICEDGE
+ LTEXT "Buffer Size:",IDT_BUFFER_SIZE,154,14,53,8,0,WS_EX_RIGHT
+ LTEXT "Sort Method:",IDT_SORT_METHOD,0,42,53,8,0,WS_EX_RIGHT
+ LTEXT "Speed is affected by CPU load and storage device characteristics.\n\nThese tests take place in RAM.",IDT_BOX_BENCHMARK_INFO,266,107,57,100
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,228,328,1,WS_EX_STATICEDGE
+ LTEXT "Benchmark: ",IDT_BENCHMARK,0,14,53,8,0,WS_EX_RIGHT
+ RTEXT "Volume PIM:",IDT_PIM,154,14,53,8,NOT WS_VISIBLE
END
IDD_CIPHER_TEST_DLG DIALOGEX 0, 0, 326, 249
@@ -384,7 +389,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 323
TOPMARGIN, 7
- BOTTOMMARGIN, 216
+ BOTTOMMARGIN, 240
END
IDD_CIPHER_TEST_DLG, DIALOG
@@ -486,39 +491,53 @@ IDR_BOOT_SECTOR BIN "..\\Boot\\Windows\\Release\\Boo
IDR_BOOT_SECTOR_AES BIN "..\\Boot\\Windows\\Release_AES\\BootSector.bin"
IDR_BOOT_SECTOR_SERPENT BIN "..\\Boot\\Windows\\Release_Serpent\\BootSector.bin"
IDR_BOOT_SECTOR_TWOFISH BIN "..\\Boot\\Windows\\Release_Twofish\\BootSector.bin"
+IDR_BOOT_SECTOR_CAMELLIA BIN "..\\Boot\\Windows\\Release_Camellia\\BootSector.bin"
IDR_BOOT_LOADER_DECOMPRESSOR BIN "..\\Boot\\Windows\\Release\\Decompressor.com"
IDR_BOOT_LOADER BIN "..\\Boot\\Windows\\Release\\BootLoader.com.gz"
IDR_BOOT_LOADER_AES BIN "..\\Boot\\Windows\\Release_AES\\BootLoader.com.gz"
IDR_BOOT_LOADER_SERPENT BIN "..\\Boot\\Windows\\Release_Serpent\\BootLoader.com.gz"
IDR_BOOT_LOADER_TWOFISH BIN "..\\Boot\\Windows\\Release_Twofish\\BootLoader.com.gz"
+IDR_BOOT_LOADER_CAMELLIA BIN "..\\Boot\\Windows\\Release_Camellia\\BootLoader.com.gz"
IDR_BOOT_SECTOR_SHA2 BIN "..\\Boot\\Windows\\Release_SHA2\\BootSector.bin"
IDR_BOOT_SECTOR_AES_SHA2 BIN "..\\Boot\\Windows\\Release_AES_SHA2\\BootSector.bin"
IDR_BOOT_SECTOR_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Release_Serpent_SHA2\\BootSector.bin"
IDR_BOOT_SECTOR_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Release_Twofish_SHA2\\BootSector.bin"
+IDR_BOOT_SECTOR_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Release_Camellia_SHA2\\BootSector.bin"
IDR_BOOT_LOADER_SHA2 BIN "..\\Boot\\Windows\\Release_SHA2\\BootLoader.com.gz"
IDR_BOOT_LOADER_AES_SHA2 BIN "..\\Boot\\Windows\\Release_AES_SHA2\\BootLoader.com.gz"
IDR_BOOT_LOADER_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Release_Serpent_SHA2\\BootLoader.com.gz"
IDR_BOOT_LOADER_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Release_Twofish_SHA2\\BootLoader.com.gz"
+IDR_BOOT_LOADER_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Release_Camellia_SHA2\\BootLoader.com.gz"
IDR_RESCUE_BOOT_SECTOR BIN "..\\Boot\\Windows\\Rescue\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_AES BIN "..\\Boot\\Windows\\Rescue_AES\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_SERPENT BIN "..\\Boot\\Windows\\Rescue_Serpent\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_TWOFISH BIN "..\\Boot\\Windows\\Rescue_Twofish\\BootSector.bin"
+IDR_RESCUE_BOOT_SECTOR_CAMELLIA BIN "..\\Boot\\Windows\\Rescue_Camellia\\BootSector.bin"
IDR_RESCUE_LOADER BIN "..\\Boot\\Windows\\Rescue\\BootLoader.com.gz"
IDR_RESCUE_LOADER_AES BIN "..\\Boot\\Windows\\Rescue_AES\\BootLoader.com.gz"
IDR_RESCUE_LOADER_SERPENT BIN "..\\Boot\\Windows\\Rescue_Serpent\\BootLoader.com.gz"
IDR_RESCUE_LOADER_TWOFISH BIN "..\\Boot\\Windows\\Rescue_Twofish\\BootLoader.com.gz"
+IDR_RESCUE_LOADER_CAMELLIA BIN "..\\Boot\\Windows\\Rescue_Camellia\\BootLoader.com.gz"
IDR_RESCUE_BOOT_SECTOR_SHA2 BIN "..\\Boot\\Windows\\Rescue_SHA2\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_AES_SHA2 BIN "..\\Boot\\Windows\\Rescue_AES_SHA2\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Rescue_Serpent_SHA2\\BootSector.bin"
IDR_RESCUE_BOOT_SECTOR_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Rescue_Twofish_SHA2\\BootSector.bin"
+IDR_RESCUE_BOOT_SECTOR_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Rescue_Camellia_SHA2\\BootSector.bin"
IDR_RESCUE_LOADER_SHA2 BIN "..\\Boot\\Windows\\Rescue_SHA2\\BootLoader.com.gz"
IDR_RESCUE_LOADER_AES_SHA2 BIN "..\\Boot\\Windows\\Rescue_AES_SHA2\\BootLoader.com.gz"
IDR_RESCUE_LOADER_SERPENT_SHA2 BIN "..\\Boot\\Windows\\Rescue_Serpent_SHA2\\BootLoader.com.gz"
IDR_RESCUE_LOADER_TWOFISH_SHA2 BIN "..\\Boot\\Windows\\Rescue_Twofish_SHA2\\BootLoader.com.gz"
+IDR_RESCUE_LOADER_CAMELLIA_SHA2 BIN "..\\Boot\\Windows\\Rescue_Camellia_SHA2\\BootLoader.com.gz"
+IDR_EFI_DCSBOOT BIN "..\\Boot\\EFI\\DcsBoot.efi"
+IDR_EFI_DCSINT BIN "..\\Boot\\EFI\\DcsInt.efi"
+IDR_EFI_DCSCFG BIN "..\\Boot\\EFI\\DcsCfg.efi"
+IDR_EFI_LEGACYSPEAKER BIN "..\\Boot\\EFI\\LegacySpeaker.efi"
+IDR_EFI_DCSBML BIN "..\\Boot\\EFI\\DcsBml.efi"
+IDR_EFI_DCSRE BIN "..\\Boot\\EFI\\DcsRe.efi"
/////////////////////////////////////////////////////////////////////////////
//
@@ -547,18 +566,18 @@ IDR_LICENSE TEXT "..\\Resources\\Texts\\License.r
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c
index e5a3218e..f3045d0c 100644
--- a/src/Common/Crypto.c
+++ b/src/Common/Crypto.c
@@ -1,11 +1,11 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -16,12 +16,16 @@
#include "Xts.h"
#include "Crc.h"
#include "Common/Endian.h"
+#if !defined(_UEFI)
#include <string.h>
#ifndef TC_WINDOWS_BOOT
#include "EncryptionThreadPool.h"
#endif
+#endif
#include "Volumes.h"
+#include "cpu.h"
+#pragma warning (disable:4706) // assignment within conditional expression
/* Update the following when adding a new cipher or EA:
Crypto.h:
@@ -52,6 +56,11 @@ static Cipher Ciphers[] =
{ AES, L"AES", 16, 32, AES_KS },
{ SERPENT, L"Serpent", 16, 32, 140*4 },
{ TWOFISH, L"Twofish", 16, 32, TWOFISH_KS },
+ { CAMELLIA, L"Camellia", 16, 32, CAMELLIA_KS },
+#if defined(CIPHER_GOST89)
+ { GOST89, L"GOST89", 16, 32, GOST_KS },
+#endif // defined(CIPHER_GOST89)
+ { KUZNYECHIK, L"Kuznyechik",16, 32, KUZNYECHIK_KS },
#endif
{ 0, 0, 0, 0, 0 }
};
@@ -64,16 +73,21 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
#ifndef TC_WINDOWS_BOOT
- { { 0, 0 }, { 0, 0}, 0 }, // Must be all-zero
- { { AES, 0 }, { XTS, 0 }, 1 },
- { { SERPENT, 0 }, { XTS, 0 }, 1 },
- { { TWOFISH, 0 }, { XTS, 0 }, 1 },
- { { TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
- { { SERPENT, TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
- { { AES, SERPENT, 0 }, { XTS, 0 }, 1 },
- { { AES, TWOFISH, SERPENT, 0 }, { XTS, 0 }, 1 },
- { { SERPENT, TWOFISH, 0 }, { XTS, 0 }, 1 },
- { { 0, 0 }, { 0, 0}, 0 } // Must be all-zero
+ { { 0, 0 }, { 0, 0}, 0, 0 }, // Must be all-zero
+ { { AES, 0 }, { XTS, 0 }, 1, 1 },
+ { { SERPENT, 0 }, { XTS, 0 }, 1, 1 },
+ { { TWOFISH, 0 }, { XTS, 0 }, 1, 1 },
+ { { CAMELLIA, 0 }, { XTS, 0 }, 1, 1 },
+#if defined(CIPHER_GOST89)
+ { { GOST89, 0 }, { XTS, 0 }, 0, 1 },
+#endif // defined(CIPHER_GOST89)
+ { { KUZNYECHIK, 0 }, { XTS, 0 }, 0, 1 },
+ { { TWOFISH, AES, 0 }, { XTS, 0 }, 1, 1 },
+ { { SERPENT, TWOFISH, AES, 0 }, { XTS, 0 }, 1, 1 },
+ { { AES, SERPENT, 0 }, { XTS, 0 }, 1, 1 },
+ { { AES, TWOFISH, SERPENT, 0 }, { XTS, 0 }, 1, 1 },
+ { { SERPENT, TWOFISH, 0 }, { XTS, 0 }, 1, 1 },
+ { { 0, 0 }, { 0, 0}, 0, 0 } // Must be all-zero
#else // TC_WINDOWS_BOOT
@@ -97,11 +111,12 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
#ifndef TC_WINDOWS_BOOT
// Hash algorithms
static Hash Hashes[] =
-{ // ID Name Deprecated System Encryption
- { SHA512, L"SHA-512", FALSE, FALSE },
- { WHIRLPOOL, L"Whirlpool", FALSE, FALSE },
- { SHA256, L"SHA-256", FALSE, TRUE },
- { RIPEMD160, L"RIPEMD-160", TRUE, TRUE },
+{ // ID Name Deprecated System Encryption
+ { SHA512, L"SHA-512", FALSE, FALSE },
+ { WHIRLPOOL, L"Whirlpool", FALSE, FALSE },
+ { SHA256, L"SHA-256", FALSE, TRUE },
+ { RIPEMD160, L"RIPEMD-160", TRUE, TRUE },
+ { STREEBOG, L"Streebog", FALSE, FALSE },
{ 0, 0, 0 }
};
#endif
@@ -129,11 +144,28 @@ int CipherInit (int cipher, unsigned char *key, unsigned __int8 *ks)
case SERPENT:
serpent_set_key (key, ks);
break;
-
+
case TWOFISH:
twofish_set_key ((TwofishInstance *)ks, (const u4byte *)key);
break;
+#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_CAMELLIA)
+ case CAMELLIA:
+ camellia_set_key (key, ks);
+ break;
+#endif
+
+#if !defined(TC_WINDOWS_BOOT)
+#if defined(CIPHER_GOST89)
+ case GOST89:
+ gost_set_key(key, (gost_kds*)ks);
+ break;
+#endif // && defined(CIPHER_GOST89)
+ case KUZNYECHIK:
+ kuznyechik_set_key(key, (kuznyechik_kds*)ks);
+ break;
+#endif // !defined(TC_WINDOWS_BOOT)
+
default:
// Unknown/wrong cipher ID
return ERR_CIPHER_INIT_FAILURE;
@@ -146,7 +178,7 @@ void EncipherBlock(int cipher, void *data, void *ks)
{
switch (cipher)
{
- case AES:
+ case AES:
// In 32-bit kernel mode, due to KeSaveFloatingPointState() overhead, AES instructions can be used only when processing the whole data unit.
#if (defined (_WIN64) || !defined (TC_WINDOWS_DRIVER)) && !defined (TC_WINDOWS_BOOT)
if (IsAesHwCpuSupported())
@@ -158,6 +190,15 @@ void EncipherBlock(int cipher, void *data, void *ks)
case TWOFISH: twofish_encrypt (ks, data, data); break;
case SERPENT: serpent_encrypt (data, data, ks); break;
+#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_CAMELLIA)
+ case CAMELLIA: camellia_encrypt (data, data, ks); break;
+#endif
+#if !defined(TC_WINDOWS_BOOT)
+#if defined(CIPHER_GOST89)
+ case GOST89: gost_encrypt(data, data, ks, 1); break;
+#endif // defined(CIPHER_GOST89)
+ case KUZNYECHIK: kuznyechik_encrypt_block(data, data, ks); break;
+#endif // !defined(TC_WINDOWS_BOOT)
default: TC_THROW_FATAL_EXCEPTION; // Unknown/wrong ID
}
}
@@ -191,6 +232,9 @@ void EncipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
KeRestoreFloatingPointState (&floatingPointState);
#endif
}
+ else if (cipher == GOST89) {
+ gost_encrypt(data, data, ks, (int)blockCount);
+ }
else
{
size_t blockSize = CipherGetBlockSize (cipher);
@@ -210,6 +254,17 @@ void DecipherBlock(int cipher, void *data, void *ks)
{
case SERPENT: serpent_decrypt (data, data, ks); break;
case TWOFISH: twofish_decrypt (ks, data, data); break;
+#if !defined (TC_WINDOWS_BOOT) || defined (TC_WINDOWS_BOOT_CAMELLIA)
+ case CAMELLIA: camellia_decrypt (data, data, ks); break;
+#endif
+#if !defined(TC_WINDOWS_BOOT)
+#if defined(CIPHER_GOST89)
+ case GOST89: gost_decrypt(data, data, ks, 1); break;
+#endif // defined(CIPHER_GOST89)
+ case KUZNYECHIK: kuznyechik_decrypt_block(data, data, ks); break;
+#endif // !defined(TC_WINDOWS_BOOT)
+
+
#ifndef TC_WINDOWS_BOOT
case AES:
@@ -257,6 +312,9 @@ void DecipherBlocks (int cipher, void *dataPtr, void *ks, size_t blockCount)
KeRestoreFloatingPointState (&floatingPointState);
#endif
}
+ else if (cipher == GOST89) {
+ gost_decrypt(data, data, ks, (int)blockCount);
+ }
else
{
size_t blockSize = CipherGetBlockSize (cipher);
@@ -325,7 +383,8 @@ int CipherGetKeyScheduleSize (int cipherId)
BOOL CipherSupportsIntraDataUnitParallelization (int cipher)
{
- return cipher == AES && IsAesHwCpuSupported();
+ return cipher == AES && IsAesHwCpuSupported() ||
+ cipher == GOST89;
}
#endif
@@ -399,11 +458,11 @@ BOOL EAInitMode (PCRYPTO_INFO ci)
/* Note: XTS mode could potentially be initialized with a weak key causing all blocks in one data unit
on the volume to be tweaked with zero tweaks (i.e. 512 bytes of the volume would be encrypted in ECB
mode). However, to create a TrueCrypt volume with such a weak key, each human being on Earth would have
- to create approximately 11,378,125,361,078,862 (about eleven quadrillion) TrueCrypt volumes (provided
+ to create approximately 11,378,125,361,078,862 (about eleven quadrillion) TrueCrypt volumes (provided
that the size of each of the volumes is 1024 terabytes). */
break;
- default:
+ default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
}
@@ -450,8 +509,12 @@ int EAGetByName (wchar_t *name)
do
{
- EAGetName (n, ea, 1);
- if (_wcsicmp (n, name) == 0)
+ EAGetName(n, ea, 1);
+#if defined(_UEFI)
+ if (wcscmp(n, name) == 0)
+#else
+ if (_wcsicmp(n, name) == 0)
+#endif
return ea;
}
while (ea = EAGetNext (ea));
@@ -488,7 +551,7 @@ int EAGetNextMode (int ea, int previousModeId)
int c, i = 0;
while (c = EncryptionAlgorithms[ea].Modes[i++])
{
- if (c == previousModeId)
+ if (c == previousModeId)
return EncryptionAlgorithms[ea].Modes[i];
}
@@ -591,7 +654,7 @@ int EAGetNextCipher (int ea, int previousCipherId)
int c, i = 0;
while (c = EncryptionAlgorithms[ea].Ciphers[i++])
{
- if (c == previousCipherId)
+ if (c == previousCipherId)
return EncryptionAlgorithms[ea].Ciphers[i];
}
@@ -608,7 +671,7 @@ int EAGetPreviousCipher (int ea, int previousCipherId)
while (c = EncryptionAlgorithms[ea].Ciphers[i++])
{
- if (c == previousCipherId)
+ if (c == previousCipherId)
return EncryptionAlgorithms[ea].Ciphers[i - 2];
}
@@ -621,6 +684,12 @@ int EAIsFormatEnabled (int ea)
return EncryptionAlgorithms[ea].FormatEnabled;
}
+#ifndef TC_WINDOWS_BOOT
+int EAIsMbrSysEncEnabled (int ea)
+{
+ return EncryptionAlgorithms[ea].MbrSysEncEnabled;
+}
+#endif
// Returns TRUE if the mode of operation is supported for the encryption algorithm
BOOL EAIsModeSupported (int ea, int testedMode)
@@ -720,7 +789,7 @@ PCRYPTO_INFO crypto_open ()
memset (cryptoInfo, 0, sizeof (CRYPTO_INFO));
-#ifndef DEVICE_DRIVER
+#if !defined(DEVICE_DRIVER) && !defined(_UEFI)
VirtualLock (cryptoInfo, sizeof (CRYPTO_INFO));
#endif
@@ -755,7 +824,7 @@ void crypto_close (PCRYPTO_INFO cryptoInfo)
if (cryptoInfo != NULL)
{
burn (cryptoInfo, sizeof (CRYPTO_INFO));
-#ifndef DEVICE_DRIVER
+#if !defined(DEVICE_DRIVER) && !defined(_UEFI)
VirtualUnlock (cryptoInfo, sizeof (CRYPTO_INFO));
#endif
TCfree (cryptoInfo);
@@ -777,7 +846,7 @@ void crypto_close (PCRYPTO_INFO cryptoInfo)
// EncryptBuffer
//
// buf: data to be encrypted; the start of the buffer is assumed to be aligned with the start of a data unit.
-// len: number of bytes to encrypt; must be divisible by the block size (for cascaded ciphers, divisible
+// len: number of bytes to encrypt; must be divisible by the block size (for cascaded ciphers, divisible
// by the largest block size used within the cascade)
void EncryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_INFO cryptoInfo)
{
@@ -808,7 +877,7 @@ void EncryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_
}
break;
- default:
+ default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
}
@@ -819,7 +888,7 @@ void EncryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_
// unitNo: sequential number of the data unit with which the buffer starts
// nbrUnits: number of data units in the buffer
void EncryptDataUnits (unsigned __int8 *buf, const UINT64_STRUCT *structUnitNo, uint32 nbrUnits, PCRYPTO_INFO ci)
-#ifndef TC_WINDOWS_BOOT
+#if !defined(TC_WINDOWS_BOOT) && !defined(_UEFI)
{
EncryptionThreadPoolDoWork (EncryptDataUnitsWork, buf, structUnitNo, nbrUnits, ci);
}
@@ -850,7 +919,7 @@ void EncryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *s
}
break;
- default:
+ default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
}
@@ -859,7 +928,7 @@ void EncryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *s
// DecryptBuffer
//
// buf: data to be decrypted; the start of the buffer is assumed to be aligned with the start of a data unit.
-// len: number of bytes to decrypt; must be divisible by the block size (for cascaded ciphers, divisible
+// len: number of bytes to decrypt; must be divisible by the block size (for cascaded ciphers, divisible
// by the largest block size used within the cascade)
void DecryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_INFO cryptoInfo)
{
@@ -890,7 +959,7 @@ void DecryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_
}
break;
- default:
+ default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
}
@@ -900,7 +969,7 @@ void DecryptBuffer (unsigned __int8 *buf, TC_LARGEST_COMPILER_UINT len, PCRYPTO_
// unitNo: sequential number of the data unit with which the buffer starts
// nbrUnits: number of data units in the buffer
void DecryptDataUnits (unsigned __int8 *buf, const UINT64_STRUCT *structUnitNo, uint32 nbrUnits, PCRYPTO_INFO ci)
-#ifndef TC_WINDOWS_BOOT
+#if !defined(TC_WINDOWS_BOOT) && !defined(_UEFI)
{
EncryptionThreadPoolDoWork (DecryptDataUnitsWork, buf, structUnitNo, nbrUnits, ci);
}
@@ -935,7 +1004,7 @@ void DecryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *s
}
break;
- default:
+ default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
}
@@ -945,7 +1014,7 @@ void DecryptDataUnitsCurrentThread (unsigned __int8 *buf, const UINT64_STRUCT *s
#else // TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
-#if !defined (TC_WINDOWS_BOOT_AES) && !defined (TC_WINDOWS_BOOT_SERPENT) && !defined (TC_WINDOWS_BOOT_TWOFISH)
+#if !defined (TC_WINDOWS_BOOT_AES) && !defined (TC_WINDOWS_BOOT_SERPENT) && !defined (TC_WINDOWS_BOOT_TWOFISH) && !defined (TC_WINDOWS_BOOT_CAMELLIA)
#error No cipher defined
#endif
@@ -955,11 +1024,13 @@ void EncipherBlock(int cipher, void *data, void *ks)
if (IsAesHwCpuSupported())
aes_hw_cpu_encrypt ((byte *) ks, data);
else
- aes_encrypt (data, data, ks);
+ aes_encrypt (data, data, ks);
#elif defined (TC_WINDOWS_BOOT_SERPENT)
serpent_encrypt (data, data, ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_encrypt (ks, data, data);
+#elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_encrypt (data, data, ks);
#endif
}
@@ -969,11 +1040,13 @@ void DecipherBlock(int cipher, void *data, void *ks)
if (IsAesHwCpuSupported())
aes_hw_cpu_decrypt ((byte *) ks + sizeof (aes_encrypt_ctx) + 14 * 16, data);
else
- aes_decrypt (data, data, (aes_decrypt_ctx *) ((byte *) ks + sizeof(aes_encrypt_ctx)));
+ aes_decrypt (data, data, (aes_decrypt_ctx *) ((byte *) ks + sizeof(aes_encrypt_ctx)));
#elif defined (TC_WINDOWS_BOOT_SERPENT)
serpent_decrypt (data, data, ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_decrypt (ks, data, data);
+#elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_decrypt (data, data, ks);
#endif
}
@@ -1033,7 +1106,11 @@ BOOL IsAesHwCpuSupported ()
if (!stateValid)
{
+#ifdef TC_WINDOWS_BOOT_AES
state = is_aes_hw_cpu_supported() ? TRUE : FALSE;
+#else
+ state = g_hasAESNI ? TRUE : FALSE;
+#endif
stateValid = TRUE;
}
diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h
index 5d9fff97..7d99f233 100644
--- a/src/Common/Crypto.h
+++ b/src/Common/Crypto.h
@@ -1,11 +1,11 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -45,20 +45,21 @@ extern "C" {
#define MASTER_KEYDATA_SIZE 256
// The first PRF to try when mounting
-#define FIRST_PRF_ID 1
+#define FIRST_PRF_ID 1
-// Hash algorithms (pseudorandom functions).
+// Hash algorithms (pseudorandom functions).
enum
{
SHA512 = FIRST_PRF_ID,
WHIRLPOOL,
SHA256,
RIPEMD160,
+ STREEBOG,
HASH_ENUM_END_ID
};
// The last PRF to try when mounting and also the number of implemented PRFs
-#define LAST_PRF_ID (HASH_ENUM_END_ID - 1)
+#define LAST_PRF_ID (HASH_ENUM_END_ID - 1)
#define RIPEMD160_BLOCKSIZE 64
#define RIPEMD160_DIGESTSIZE 20
@@ -72,6 +73,9 @@ enum
#define WHIRLPOOL_BLOCKSIZE 64
#define WHIRLPOOL_DIGESTSIZE 64
+#define STREEBOG_BLOCKSIZE 64
+#define STREEBOG_DIGESTSIZE 64
+
#define MAX_DIGESTSIZE WHIRLPOOL_DIGESTSIZE
#define DEFAULT_HASH_ALGORITHM FIRST_PRF_ID
@@ -105,8 +109,11 @@ enum
{
NONE = 0,
AES,
- SERPENT,
- TWOFISH
+ SERPENT,
+ TWOFISH,
+ CAMELLIA,
+ GOST89,
+ KUZNYECHIK
};
typedef struct
@@ -126,6 +133,9 @@ typedef struct
{
int Ciphers[4]; // Null terminated array of ciphers used by encryption algorithm
int Modes[LAST_MODE_OF_OPERATION + 1]; // Null terminated array of modes of operation
+#ifndef TC_WINDOWS_BOOT
+ BOOL MbrSysEncEnabled;
+#endif
int FormatEnabled;
} EncryptionAlgorithm;
@@ -155,12 +165,16 @@ typedef struct
# define MAX_EXPANDED_KEY SERPENT_KS
# elif defined (TC_WINDOWS_BOOT_TWOFISH)
# define MAX_EXPANDED_KEY TWOFISH_KS
+# elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+# define MAX_EXPANDED_KEY CAMELLIA_KS
# endif
#else
-
-#define MAX_EXPANDED_KEY (AES_KS + SERPENT_KS + TWOFISH_KS)
-
+#ifdef TC_WINDOWS_BOOT
+#define MAX_EXPANDED_KEY max((AES_KS + SERPENT_KS + TWOFISH_KS), CAMELLIA_KS)
+#else
+#define MAX_EXPANDED_KEY max(max(max((AES_KS + SERPENT_KS + TWOFISH_KS), GOST_KS), CAMELLIA_KS), KUZNYECHIK_KS)
+#endif
#endif
#ifdef DEBUG
@@ -186,6 +200,12 @@ typedef struct
#ifndef TC_WINDOWS_BOOT
# include "Sha2.h"
# include "Whirlpool.h"
+# include "Streebog.h"
+# include "GostCipher.h"
+# include "kuznyechik.h"
+# include "Camellia.h"
+#else
+# include "CamelliaSmall.h"
#endif
#include "GfMul.h"
@@ -201,7 +221,7 @@ typedef struct keyInfo_t
int keyLength; /* Length of the key */
uint64 dummy; /* Dummy field to ensure 16-byte alignment of this structure */
__int8 salt[PKCS5_SALT_SIZE]; /* PKCS-5 salt */
- __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* Concatenated master primary and secondary key(s) (XTS mode). For LRW (deprecated/legacy), it contains the tweak key before the master key(s). For CBC (deprecated/legacy), it contains the IV seed before the master key(s). */
+ CRYPTOPP_ALIGN_DATA(16) __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* Concatenated master primary and secondary key(s) (XTS mode). For LRW (deprecated/legacy), it contains the tweak key before the master key(s). For CBC (deprecated/legacy), it contains the IV seed before the master key(s). */
CRYPTOPP_ALIGN_DATA(16) __int8 userKey[MAX_PASSWORD]; /* Password (to which keyfiles may have been applied). WITHOUT +1 for the null terminator. */
} KEY_INFO, *PKEY_INFO;
@@ -221,12 +241,12 @@ typedef struct CRYPTO_INFO_t
#ifndef TC_WINDOWS_BOOT
uint16 HeaderVersion;
- GfCtx gf_ctx;
+ GfCtx gf_ctx;
- unsigned __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* This holds the volume header area containing concatenated master key(s) and secondary key(s) (XTS mode). For LRW (deprecated/legacy), it contains the tweak key before the master key(s). For CBC (deprecated/legacy), it contains the IV seed before the master key(s). */
- unsigned __int8 k2[MASTER_KEYDATA_SIZE]; /* For XTS, this contains the secondary key (if cascade, multiple concatenated). For LRW (deprecated/legacy), it contains the tweak key. For CBC (deprecated/legacy), it contains the IV seed. */
+ CRYPTOPP_ALIGN_DATA(16) unsigned __int8 master_keydata[MASTER_KEYDATA_SIZE]; /* This holds the volume header area containing concatenated master key(s) and secondary key(s) (XTS mode). For LRW (deprecated/legacy), it contains the tweak key before the master key(s). For CBC (deprecated/legacy), it contains the IV seed before the master key(s). */
+ CRYPTOPP_ALIGN_DATA(16) unsigned __int8 k2[MASTER_KEYDATA_SIZE]; /* For XTS, this contains the secondary key (if cascade, multiple concatenated). For LRW (deprecated/legacy), it contains the tweak key. For CBC (deprecated/legacy), it contains the IV seed. */
unsigned __int8 salt[PKCS5_SALT_SIZE];
- int noIterations;
+ int noIterations;
BOOL bTrueCryptMode;
int volumePim;
@@ -235,7 +255,7 @@ typedef struct CRYPTO_INFO_t
BOOL bProtectHiddenVolume; // Indicates whether the volume contains a hidden volume to be protected against overwriting
BOOL bHiddenVolProtectionAction; // TRUE if a write operation has been denied by the driver in order to prevent the hidden volume from being overwritten (set to FALSE upon volume mount).
-
+
uint64 volDataAreaOffset; // Absolute position, in bytes, of the first data sector of the volume.
uint64 hiddenVolumeSize; // Size of the hidden volume excluding the header (in bytes). Set to 0 for standard volumes.
@@ -262,7 +282,7 @@ typedef struct CRYPTO_INFO_t
} CRYPTO_INFO, *PCRYPTO_INFO;
-#ifdef _WIN32
+#if defined(_WIN32) || defined(_UEFI)
#pragma pack (push)
#pragma pack(1)
@@ -331,6 +351,9 @@ int EAGetLastCipher (int ea);
int EAGetNextCipher (int ea, int previousCipherId);
int EAGetPreviousCipher (int ea, int previousCipherId);
int EAIsFormatEnabled (int ea);
+#ifndef TC_WINDOWS_BOOT
+int EAIsMbrSysEncEnabled (int ea);
+#endif
BOOL EAIsModeSupported (int ea, int testedMode);
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 13a439e0..30571260 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -1,11 +1,11 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -78,6 +78,7 @@ char *LastDialogId;
wchar_t szHelpFile[TC_MAX_PATH];
wchar_t szHelpFile2[TC_MAX_PATH];
wchar_t SecurityTokenLibraryPath[TC_MAX_PATH];
+char CmdTokenPin [TC_MAX_PATH] = {0};
HFONT hFixedDigitFont = NULL;
HFONT hBoldFont = NULL;
@@ -113,9 +114,9 @@ BOOL bMountFavoritesOnLogon = FALSE;
BOOL bHistory = FALSE;
-// Status of detection of hidden sectors (whole-system-drive encryption).
+// Status of detection of hidden sectors (whole-system-drive encryption).
// 0 - Unknown/undetermined/completed, 1: Detection is or was in progress (but did not complete e.g. due to system crash).
-int HiddenSectorDetectionStatus = 0;
+int HiddenSectorDetectionStatus = 0;
OSVersionEnum nCurrentOS = WIN_UNKNOWN;
int CurrentOSMajor = 0;
@@ -128,7 +129,7 @@ BOOL bPortableModeConfirmed = FALSE; // TRUE if it is certain that the instance
BOOL bInPlaceEncNonSysPending = FALSE; // TRUE if the non-system in-place encryption config file indicates that one or more partitions are scheduled to be encrypted. This flag is set only when config files are loaded during app startup.
-/* Globals used by Mount and Format (separately per instance) */
+/* Globals used by Mount and Format (separately per instance) */
BOOL PimEnable = FALSE;
BOOL KeyFilesEnable = FALSE;
KeyFile *FirstKeyFile = NULL;
@@ -147,7 +148,7 @@ BOOL WaitDialogDisplaying = FALSE;
HANDLE hDriver = INVALID_HANDLE_VALUE;
/* This mutex is used to prevent multiple instances of the wizard or main app from dealing with system encryption */
-volatile HANDLE hSysEncMutex = NULL;
+volatile HANDLE hSysEncMutex = NULL;
/* This mutex is used for non-system in-place encryption but only for informative (non-blocking) purposes,
such as whether an app should prompt the user whether to resume scheduled process. */
@@ -171,7 +172,7 @@ ATOM hDlgClass, hSplashClass;
/* This value may changed only by calling ChangeSystemEncryptionStatus(). Only the wizard can change it
(others may still read it though). */
-int SystemEncryptionStatus = SYSENC_STATUS_NONE;
+int SystemEncryptionStatus = SYSENC_STATUS_NONE;
/* Only the wizard can change this value (others may only read it). */
WipeAlgorithmId nWipeMode = TC_WIPE_NONE;
@@ -238,6 +239,23 @@ HMODULE hwinscarddll = NULL;
#define FREE_DLL(h) if (h) { FreeLibrary (h); h = NULL;}
+#ifndef BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE
+#define BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE 0x00000001
+#endif
+
+#ifndef BASE_SEARCH_PATH_PERMANENT
+#define BASE_SEARCH_PATH_PERMANENT 0x00008000
+#endif
+
+#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
+#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
+#endif
+
+typedef BOOL (WINAPI *SetDllDirectoryPtr)(LPCWSTR lpPathName);
+typedef BOOL (WINAPI *SetSearchPathModePtr)(DWORD Flags);
+typedef BOOL (WINAPI *SetDefaultDllDirectoriesPtr)(DWORD DirectoryFlags);
+
+
typedef void (WINAPI *InitCommonControlsPtr)(void);
typedef HIMAGELIST (WINAPI *ImageList_CreatePtr)(int cx, int cy, UINT flags, int cInitial, int cGrow);
typedef int (WINAPI *ImageList_AddPtr)(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask);
@@ -254,6 +272,10 @@ typedef HRESULT (STDAPICALLTYPE *SHStrDupWPtr)(LPCWSTR psz, LPWSTR *ppwsz);
// ChangeWindowMessageFilter
typedef BOOL (WINAPI *ChangeWindowMessageFilterPtr) (UINT, DWORD);
+SetDllDirectoryPtr SetDllDirectoryFn = NULL;
+SetSearchPathModePtr SetSearchPathModeFn = NULL;
+SetDefaultDllDirectoriesPtr SetDefaultDllDirectoriesFn = NULL;
+
ImageList_CreatePtr ImageList_CreateFn = NULL;
ImageList_AddPtr ImageList_AddFn = NULL;
@@ -294,13 +316,20 @@ ChangeWindowMessageFilterPtr ChangeWindowMessageFilterFn = NULL;
#error PKCS5_BENCHMARKS and HASH_FNC_BENCHMARKS are both TRUE (at least one of them should be FALSE).
#endif
-enum
+enum
+{
+ BENCHMARK_TYPE_ENCRYPTION = 0,
+ BENCHMARK_TYPE_PRF,
+ BENCHMARK_TYPE_HASH
+};
+
+enum
{
BENCHMARK_SORT_BY_NAME = 0,
BENCHMARK_SORT_BY_SPEED
};
-typedef struct
+typedef struct
{
int id;
wchar_t name[100];
@@ -315,11 +344,15 @@ int benchmarkBufferSize = BENCHMARK_DEFAULT_BUF_SIZE;
int benchmarkLastBufferSize = BENCHMARK_DEFAULT_BUF_SIZE;
int benchmarkSortMethod = BENCHMARK_SORT_BY_SPEED;
LARGE_INTEGER benchmarkPerformanceFrequency;
+int benchmarkType = BENCHMARK_TYPE_ENCRYPTION;
+int benchmarkPim = -1;
+BOOL benchmarkPreBoot = FALSE;
+BOOL benchmarkGPT = FALSE;
#endif // #ifndef SETUP
-typedef struct
+typedef struct
{
void *strings;
BOOL bold;
@@ -329,6 +362,8 @@ typedef struct
void cleanup ()
{
+ burn (&CmdTokenPin, sizeof (CmdTokenPin));
+
/* Cleanup the GDI fonts */
if (hFixedFont != NULL)
DeleteObject (hFixedFont);
@@ -356,7 +391,7 @@ void cleanup ()
/* Close the device driver handle */
if (hDriver != INVALID_HANDLE_VALUE)
{
- // Unload driver mode if possible (non-install mode)
+ // Unload driver mode if possible (non-install mode)
if (IsNonInstallMode ())
{
// If a dismount was forced in the lifetime of the driver, Windows may later prevent it to be loaded again from
@@ -710,7 +745,7 @@ BOOL IsDiskError (DWORD error)
DWORD handleWin32Error (HWND hwndDlg, const char* srcPos)
{
PWSTR lpMsgBuf;
- DWORD dwError = GetLastError ();
+ DWORD dwError = GetLastError ();
wchar_t szErrorValue[32];
wchar_t* pszDesc;
@@ -833,7 +868,7 @@ int GetTextGfxWidth (HWND hwndDlgItem, const wchar_t *text, HFONT hFont)
{
SIZE sizes;
TEXTMETRIC textMetrics;
- HDC hdc = GetDC (hwndDlgItem);
+ HDC hdc = GetDC (hwndDlgItem);
SelectObject(hdc, (HGDIOBJ) hFont);
@@ -841,7 +876,7 @@ int GetTextGfxWidth (HWND hwndDlgItem, const wchar_t *text, HFONT hFont)
GetTextMetrics(hdc, &textMetrics); // Necessary for non-TrueType raster fonts (tmOverhang)
- ReleaseDC (hwndDlgItem, hdc);
+ ReleaseDC (hwndDlgItem, hdc);
return ((int) sizes.cx - (int) textMetrics.tmOverhang);
}
@@ -850,13 +885,13 @@ int GetTextGfxWidth (HWND hwndDlgItem, const wchar_t *text, HFONT hFont)
int GetTextGfxHeight (HWND hwndDlgItem, const wchar_t *text, HFONT hFont)
{
SIZE sizes;
- HDC hdc = GetDC (hwndDlgItem);
+ HDC hdc = GetDC (hwndDlgItem);
SelectObject(hdc, (HGDIOBJ) hFont);
GetTextExtentPoint32W (hdc, text, (int) wcslen (text), &sizes);
- ReleaseDC (hwndDlgItem, hdc);
+ ReleaseDC (hwndDlgItem, hdc);
return ((int) sizes.cy);
}
@@ -872,7 +907,7 @@ std::wstring FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::w
rect.right = width;
rect.bottom = LONG_MAX;
- HDC hdc = GetDC (hwnd);
+ HDC hdc = GetDC (hwnd);
SelectObject (hdc, (HGDIOBJ) hFont);
wchar_t pathBuf[TC_MAX_PATH];
@@ -881,7 +916,7 @@ std::wstring FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::w
if (DrawText (hdc, pathBuf, (int) path.size(), &rect, DT_CALCRECT | DT_MODIFYSTRING | DT_PATH_ELLIPSIS | DT_SINGLELINE) != 0)
newPath = pathBuf;
- ReleaseDC (hwnd, hdc);
+ ReleaseDC (hwnd, hdc);
return newPath;
}
@@ -961,12 +996,12 @@ void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate, HFONT h
width = GetTextGfxWidth (hwndCtrl, text, hFont);
height = GetTextGfxHeight (hwndCtrl, text, hFont);
- GetClientRect (hwndCtrl, &rec);
+ GetClientRect (hwndCtrl, &rec);
origWidth = rec.right;
origHeight = rec.bottom;
if (width >= 0
- && (!bFirstUpdate || origWidth > width)) // The original width of the field is the maximum allowed size
+ && (!bFirstUpdate || origWidth > width)) // The original width of the field is the maximum allowed size
{
horizSubOffset = origWidth - width;
vertSubOffset = origHeight - height;
@@ -989,7 +1024,7 @@ void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate, HFONT h
alignPosDiff = horizSubOffset / 2;
else if (windowInfo.dwStyle & SS_RIGHT)
alignPosDiff = horizSubOffset;
-
+
// Resize/move
if (alignPosDiff > 0)
{
@@ -1044,7 +1079,7 @@ static LRESULT CALLBACK BootPwdFieldProc (HWND hwnd, UINT message, WPARAM wParam
// Protects an input field from having its content updated by a Paste action. Used for pre-boot password
-// input fields (only the US keyboard layout is supported in pre-boot environment so we must prevent the
+// input fields (only the US keyboard layout is supported in pre-boot environment so we must prevent the
// user from pasting a password typed using a non-US keyboard layout).
void ToBootPwdField (HWND hwndDlg, UINT ctrlId)
{
@@ -1071,7 +1106,7 @@ BOOL CALLBACK AuxiliaryDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (hDC)
{
ScreenDPI = GetDeviceCaps (hDC, LOGPIXELSY);
- ReleaseDC (hwndDlg, hDC);
+ ReleaseDC (hwndDlg, hDC);
}
DPIScaleFactorX = 1;
@@ -1080,7 +1115,7 @@ BOOL CALLBACK AuxiliaryDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (ScreenDPI != USER_DEFAULT_SCREEN_DPI)
{
- // Windows skews the GUI aspect ratio if the user has a non-default DPI. Hence, working with
+ // Windows skews the GUI aspect ratio if the user has a non-default DPI. Hence, working with
// actual screen DPI is redundant and leads to incorrect results. What really matters here is
// how Windows actually renders our GUI. This is determined by comparing the expected and current
// sizes of a hidden calibration text field.
@@ -1139,7 +1174,7 @@ BOOL CALLBACK AboutDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
GetClientRect (GetDlgItem (hwndDlg, IDC_ABOUT_LOGO_AREA), &rec);
SetWindowPos (GetDlgItem (hwndDlg, IDC_ABOUT_BKG), HWND_TOP, 0, 0, rec.right, rec.bottom, SWP_NOMOVE);
- // Resize the logo bitmap if the user has a non-default DPI
+ // Resize the logo bitmap if the user has a non-default DPI
if (ScreenDPI != USER_DEFAULT_SCREEN_DPI)
{
// Logo (must recreate and keep the original aspect ratio as Windows distorts it)
@@ -1455,7 +1490,7 @@ void InitDialog (HWND hwndDlg)
void ProcessPaintMessages (HWND hwnd, int maxMessagesToProcess)
{
MSG paintMsg;
- int msgCounter = maxMessagesToProcess;
+ int msgCounter = maxMessagesToProcess;
while (PeekMessageW (&paintMsg, hwnd, 0, 0, PM_REMOVE | PM_QS_PAINT) != 0 && msgCounter-- > 0)
{
@@ -1483,16 +1518,16 @@ HDC CreateMemBitmap (HINSTANCE hInstance, HWND hwnd, wchar_t *resource)
}
-/* Renders the specified bitmap at the specified location and stretches it to fit (anti-aliasing is applied).
+/* Renders the specified bitmap at the specified location and stretches it to fit (anti-aliasing is applied).
If bDirectRender is FALSE and both nWidth and nHeight are zero, the width and height of hwndDest are
retrieved and adjusted according to screen DPI (the width and height of the resultant image are adjusted the
same way); furthermore, if bKeepAspectRatio is TRUE, the smaller DPI factor of the two (i.e. horiz. or vert.)
is used both for horiz. and vert. scaling (note that the overall GUI aspect ratio changes irregularly in
-both directions depending on the DPI). If bDirectRender is TRUE, bKeepAspectRatio is ignored.
+both directions depending on the DPI). If bDirectRender is TRUE, bKeepAspectRatio is ignored.
This function returns a handle to the scaled bitmap. When the bitmap is no longer needed, it should be
-deleted by calling DeleteObject() with the handle passed as the parameter.
-Known Windows issues:
-- For some reason, anti-aliasing is not applied if the source bitmap contains less than 16K pixels.
+deleted by calling DeleteObject() with the handle passed as the parameter.
+Known Windows issues:
+- For some reason, anti-aliasing is not applied if the source bitmap contains less than 16K pixels.
- Windows 2000 may produce slightly inaccurate colors even when source, buffer, and target are 24-bit true color. */
HBITMAP RenderBitmap (wchar_t *resource, HWND hwndDest, int x, int y, int nWidth, int nHeight, BOOL bDirectRender, BOOL bKeepAspectRatio)
{
@@ -1541,11 +1576,11 @@ HBITMAP RenderBitmap (wchar_t *resource, HWND hwndDest, int x, int y, int nWidth
GetObject (picture, sizeof (BITMAP), &bitmap);
- hdcRescaled = CreateCompatibleDC (hdcSrc);
+ hdcRescaled = CreateCompatibleDC (hdcSrc);
if (hdcRescaled)
{
- hbmpRescaled = CreateCompatibleBitmap (hdcSrc, nWidth, nHeight);
+ hbmpRescaled = CreateCompatibleBitmap (hdcSrc, nWidth, nHeight);
SelectObject (hdcRescaled, hbmpRescaled);
@@ -1561,7 +1596,7 @@ HBITMAP RenderBitmap (wchar_t *resource, HWND hwndDest, int x, int y, int nWidth
hdcSrc,
0,
0,
- bitmap.bmWidth,
+ bitmap.bmWidth,
bitmap.bmHeight,
SRCCOPY);
@@ -1670,8 +1705,8 @@ RegisterRedTick (HINSTANCE hInstance)
wc.hCursor = NULL;
wc.hbrBackground = (HBRUSH) GetStockObject (LTGRAY_BRUSH);
wc.lpszClassName = L"VCREDTICK";
- wc.lpfnWndProc = &RedTick;
-
+ wc.lpfnWndProc = &RedTick;
+
rc = (ULONG) RegisterClassW (&wc);
return rc == 0 ? FALSE : TRUE;
@@ -1788,7 +1823,7 @@ void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption, B
{
if (!bHeaderWipe)
{
- AddComboPair (hComboBox, GetString ("WIPE_MODE_NONE"), TC_WIPE_NONE);
+ AddComboPair (hComboBox, GetString ("WIPE_MODE_NONE"), TC_WIPE_NONE);
}
AddComboPair (hComboBox, GetString ("WIPE_MODE_1_RAND"), TC_WIPE_1_RAND);
@@ -2055,7 +2090,7 @@ void ExceptionHandlerThread (void *threadArg)
else
lpack[0] = 0;
-
+
sprintf (url, TC_APPLINK_SECURE "&dest=err-report%s&os=%s&osver=%d.%d.%d&arch=%s&cpus=%d&app=%s&cksum=%x&dlg=%s&err=%x&addr=%x"
, lpack
, GetWindowsEdition().c_str()
@@ -2122,9 +2157,48 @@ static LRESULT CALLBACK NonInstallUacWndProc (HWND hWnd, UINT message, WPARAM wP
return DefWindowProcW (hWnd, message, wParam, lParam);
}
+BOOL LaunchElevatedProcess (HWND hwndDlg, const wchar_t* szModPath, const wchar_t* args)
+{
+ wchar_t newCmdLine[4096];
+ WNDCLASSEXW wcex;
+ HWND hWnd;
+
+ memset (&wcex, 0, sizeof (wcex));
+ wcex.cbSize = sizeof(WNDCLASSEX);
+ wcex.lpfnWndProc = (WNDPROC) NonInstallUacWndProc;
+ wcex.hInstance = hInst;
+ wcex.lpszClassName = L"VeraCrypt";
+ RegisterClassExW (&wcex);
+
+ // A small transparent window is necessary to bring the new instance to foreground
+ hWnd = CreateWindowExW (WS_EX_TOOLWINDOW | WS_EX_LAYERED,
+ L"VeraCrypt", L"VeraCrypt", 0,
+ GetSystemMetrics (SM_CXSCREEN)/2,
+ GetSystemMetrics (SM_CYSCREEN)/2,
+ 1, 1, NULL, NULL, hInst, NULL);
+
+ SetLayeredWindowAttributes (hWnd, 0, 0, LWA_ALPHA);
+ ShowWindow (hWnd, SW_SHOWNORMAL);
+
+ StringCbCopyW (newCmdLine, sizeof(newCmdLine), L"/q UAC ");
+ StringCbCatW (newCmdLine, sizeof (newCmdLine), args);
+
+ if ((int)ShellExecuteW (hWnd, L"runas", szModPath, newCmdLine, NULL, SW_SHOWNORMAL) <= 32)
+ {
+ if (hwndDlg)
+ handleWin32Error (hwndDlg, SRC_POS);
+ return FALSE;
+ }
+ else
+ {
+ Sleep (2000);
+ return TRUE;
+ }
+}
+
// Mutex handling to prevent multiple instances of the wizard or main app from dealing with system encryption.
-// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
+// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
BOOL CreateSysEncMutex (void)
{
return TCCreateMutex (&hSysEncMutex, TC_MUTEX_NAME_SYSENC);
@@ -2144,7 +2218,7 @@ void CloseSysEncMutex (void)
}
-// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
+// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
BOOL CreateNonSysInplaceEncMutex (void)
{
return TCCreateMutex (&hNonSysInplaceEncMutex, TC_MUTEX_NAME_NONSYS_INPLACE_ENC);
@@ -2166,14 +2240,14 @@ void CloseNonSysInplaceEncMutex (void)
// Returns TRUE if another instance of the wizard is preparing, resuming or performing non-system in-place encryption
BOOL NonSysInplaceEncInProgressElsewhere (void)
{
- return (!InstanceHasNonSysInplaceEncMutex ()
+ return (!InstanceHasNonSysInplaceEncMutex ()
&& MutexExistsOnSystem (TC_MUTEX_NAME_NONSYS_INPLACE_ENC));
}
// Mutex handling to prevent multiple instances of the wizard or main app from trying to install
// or register the driver or from trying to launch it in portable mode at the same time.
-// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
+// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
BOOL CreateDriverSetupMutex (void)
{
return TCCreateMutex (&hDriverSetupMutex, TC_MUTEX_NAME_DRIVER_SETUP);
@@ -2204,7 +2278,7 @@ BOOL IsTrueCryptInstallerRunning (void)
}
-// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
+// Returns TRUE if the mutex is (or had been) successfully acquired (otherwise FALSE).
BOOL TCCreateMutex (volatile HANDLE *hMutex, wchar_t *name)
{
if (*hMutex != NULL)
@@ -2244,7 +2318,7 @@ void TCCloseMutex (volatile HANDLE *hMutex)
}
-// Returns TRUE if a process running on the system has the specified mutex (otherwise FALSE).
+// Returns TRUE if a process running on the system has the specified mutex (otherwise FALSE).
BOOL MutexExistsOnSystem (wchar_t *name)
{
if (name[0] == 0)
@@ -2258,7 +2332,7 @@ BOOL MutexExistsOnSystem (wchar_t *name)
return FALSE;
if (GetLastError () == ERROR_ACCESS_DENIED) // On Vista, this is returned if the owner of the mutex is elevated while we are not
- return TRUE;
+ return TRUE;
// The call failed and it is not certain whether the mutex exists or not
return FALSE;
@@ -2530,10 +2604,24 @@ static void LoadSystemDll (LPCTSTR szModuleName, HMODULE *pHandle, BOOL bIgnoreE
void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
{
WNDCLASSW wc;
- char langId[6];
- InitCommonControlsPtr InitCommonControlsFn = NULL;
+ char langId[6];
+ InitCommonControlsPtr InitCommonControlsFn = NULL;
+
+ /* remove current directory from dll search path */
+ SetDllDirectoryFn = (SetDllDirectoryPtr) GetProcAddress (GetModuleHandle(L"kernel32.dll"), "SetDllDirectoryW");
+ SetSearchPathModeFn = (SetSearchPathModePtr) GetProcAddress (GetModuleHandle(L"kernel32.dll"), "SetSearchPathMode");
+ SetDefaultDllDirectoriesFn = (SetDefaultDllDirectoriesPtr) GetProcAddress (GetModuleHandle(L"kernel32.dll"), "SetDefaultDllDirectories");
- InitOSVersionInfo();
+ if (SetDllDirectoryFn)
+ SetDllDirectoryFn (L"");
+ if (SetSearchPathModeFn)
+ SetSearchPathModeFn (BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT);
+ if (SetDefaultDllDirectoriesFn)
+ SetDefaultDllDirectoriesFn (LOAD_LIBRARY_SEARCH_SYSTEM32);
+
+ InitOSVersionInfo();
+
+ VirtualLock (&CmdTokenPin, sizeof (CmdTokenPin));
InitializeCriticalSection (&csWNetCalls);
@@ -2551,11 +2639,13 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
LoadSystemDll (L"secur32.dll", &hsecur32dll, TRUE, SRC_POS);
LoadSystemDll (L"msasn1.dll", &hmsasn1dll, TRUE, SRC_POS);
LoadSystemDll (L"Usp10.DLL", &hUsp10Dll, TRUE, SRC_POS);
- LoadSystemDll (L"UXTheme.dll", &hUXThemeDll, TRUE, SRC_POS);
+ if (IsOSAtLeast (WIN_7))
+ LoadSystemDll (L"dwmapi.dll", &hdwmapidll, TRUE, SRC_POS);
+ LoadSystemDll (L"UXTheme.dll", &hUXThemeDll, TRUE, SRC_POS);
- LoadSystemDll (L"msls31.dll", &hMsls31, TRUE, SRC_POS);
+ LoadSystemDll (L"msls31.dll", &hMsls31, TRUE, SRC_POS);
LoadSystemDll (L"SETUPAPI.DLL", &hSetupDll, FALSE, SRC_POS);
- LoadSystemDll (L"SHLWAPI.DLL", &hShlwapiDll, FALSE, SRC_POS);
+ LoadSystemDll (L"SHLWAPI.DLL", &hShlwapiDll, FALSE, SRC_POS);
LoadSystemDll (L"userenv.dll", &hUserenvDll, TRUE, SRC_POS);
LoadSystemDll (L"rsaenh.dll", &hRsaenhDll, TRUE, SRC_POS);
@@ -2572,7 +2662,7 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
}
if (IsOSAtLeast (WIN_VISTA))
- {
+ {
LoadSystemDll (L"netapi32.dll", &hnetapi32dll, TRUE, SRC_POS);
LoadSystemDll (L"authz.dll", &hauthzdll, TRUE, SRC_POS);
LoadSystemDll (L"xmllite.dll", &hxmllitedll, TRUE, SRC_POS);
@@ -2580,10 +2670,11 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
}
if (IsOSAtLeast (WIN_VISTA))
- {
- LoadSystemDll (L"spp.dll", &hsppdll, TRUE, SRC_POS);
- LoadSystemDll (L"vssapi.dll", &vssapidll, TRUE, SRC_POS);
+ {
+ LoadSystemDll (L"atl.dll", &hsppdll, TRUE, SRC_POS);
LoadSystemDll (L"vsstrace.dll", &hvsstracedll, TRUE, SRC_POS);
+ LoadSystemDll (L"vssapi.dll", &vssapidll, TRUE, SRC_POS);
+ LoadSystemDll (L"spp.dll", &hsppdll, TRUE, SRC_POS);
if (IsOSAtLeast (WIN_7))
{
@@ -2593,20 +2684,18 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
LoadSystemDll (L"devobj.dll", &hdevobjdll, TRUE, SRC_POS);
LoadSystemDll (L"powrprof.dll", &hpowrprofdll, TRUE, SRC_POS);
- LoadSystemDll (L"dwmapi.dll", &hdwmapidll, TRUE, SRC_POS);
-
LoadSystemDll (L"crypt32.dll", &hcrypt32dll, TRUE, SRC_POS);
LoadSystemDll (L"bcrypt.dll", &hbcryptdll, TRUE, SRC_POS);
- LoadSystemDll (L"bcryptprimitives.dll", &hbcryptprimitivesdll, TRUE, SRC_POS);
+ LoadSystemDll (L"bcryptprimitives.dll", &hbcryptprimitivesdll, TRUE, SRC_POS);
}
- }
+ }
#else
LoadSystemDll (L"WINSCARD.DLL", &hwinscarddll, TRUE, SRC_POS);
#endif
LoadSystemDll (L"COMCTL32.DLL", &hComctl32Dll, FALSE, SRC_POS);
-
+
// call InitCommonControls function
InitCommonControlsFn = (InitCommonControlsPtr) GetProcAddress (hComctl32Dll, "InitCommonControls");
ImageList_AddFn = (ImageList_AddPtr) GetProcAddress (hComctl32Dll, "ImageList_Add");
@@ -2667,7 +2756,7 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
// Language
langId[0] = 0;
SetPreferredLangId (ConfigReadString ("Language", "", langId, sizeof (langId)));
-
+
if (langId[0] == 0)
{
if (IsNonInstallMode ())
@@ -2692,9 +2781,7 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
// A new instance of the application must be created with elevated privileges.
if (IsNonInstallMode () && !IsAdmin () && IsUacSupported ())
{
- wchar_t modPath[MAX_PATH], newCmdLine[4096];
- WNDCLASSEXW wcex;
- HWND hWnd;
+ wchar_t modPath[MAX_PATH];
if (wcsstr (lpszCommandLine, L"/q UAC ") == lpszCommandLine)
{
@@ -2702,33 +2789,12 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
exit (1);
}
- memset (&wcex, 0, sizeof (wcex));
- wcex.cbSize = sizeof(WNDCLASSEX);
- wcex.lpfnWndProc = (WNDPROC) NonInstallUacWndProc;
- wcex.hInstance = hInstance;
- wcex.lpszClassName = L"VeraCrypt";
- RegisterClassExW (&wcex);
-
- // A small transparent window is necessary to bring the new instance to foreground
- hWnd = CreateWindowExW (WS_EX_TOOLWINDOW | WS_EX_LAYERED,
- L"VeraCrypt", L"VeraCrypt", 0,
- GetSystemMetrics (SM_CXSCREEN)/2,
- GetSystemMetrics (SM_CYSCREEN)/2,
- 1, 1, NULL, NULL, hInstance, NULL);
-
- SetLayeredWindowAttributes (hWnd, 0, 0, LWA_ALPHA);
- ShowWindow (hWnd, SW_SHOWNORMAL);
-
GetModuleFileNameW (NULL, modPath, ARRAYSIZE (modPath));
- StringCbCopyW (newCmdLine, sizeof(newCmdLine), L"/q UAC ");
- StringCbCatW (newCmdLine, sizeof (newCmdLine), lpszCommandLine);
-
- if ((int)ShellExecuteW (hWnd, L"runas", modPath, newCmdLine, NULL, SW_SHOWNORMAL) <= 32)
+ if (LaunchElevatedProcess (NULL, modPath, lpszCommandLine))
+ exit (0);
+ else
exit (1);
-
- Sleep (2000);
- exit (0);
}
#endif
@@ -2781,7 +2847,7 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine)
break;
}
}
-
+
/* Get the attributes for the standard dialog class */
if ((GetClassInfoW (hInst, WINDOWS_DIALOG_CLASS, &wc)) == 0)
{
@@ -2972,7 +3038,7 @@ BOOL OpenDevice (const wchar_t *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectF
&dwResult, NULL);
// check variable driver
- if ( bResult
+ if ( bResult
&& ( (driver->bDetectTCBootLoader != TRUE && driver->bDetectTCBootLoader != FALSE) ||
(driver->TCBootLoaderDetected != TRUE && driver->TCBootLoaderDetected != FALSE) ||
(driver->DetectFilesystem != TRUE && driver->DetectFilesystem != FALSE) ||
@@ -2998,7 +3064,7 @@ BOOL OpenDevice (const wchar_t *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectF
else
return FALSE;
}
-
+
return TRUE;
}
@@ -3026,10 +3092,10 @@ BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize)
/* Stores the device path of the system partition in SysPartitionDevicePath and the device path of the system drive
in SysDriveDevicePath.
-IMPORTANT: As this may take a very long time if called for the first time, it should be called only before performing
- a dangerous operation (such as header backup restore or formatting a supposedly non-system device) never
- at WM_INITDIALOG or any other GUI events -- instead call IsSystemDevicePath (path, hwndDlg, FALSE) for
- very fast preliminary GUI checks; also note that right after the "Select Device" dialog exits with an OK
+IMPORTANT: As this may take a very long time if called for the first time, it should be called only before performing
+ a dangerous operation (such as header backup restore or formatting a supposedly non-system device) never
+ at WM_INITDIALOG or any other GUI events -- instead call IsSystemDevicePath (path, hwndDlg, FALSE) for
+ very fast preliminary GUI checks; also note that right after the "Select Device" dialog exits with an OK
return code, you can use the global flags bSysPartitionSelected and bSysDriveSelected to see if the user
selected the system partition/device.
After this function completes successfully, the results are cached for the rest of the session and repeated
@@ -3037,13 +3103,13 @@ executions complete very fast. Returns TRUE if successful (otherwise FALSE). */
BOOL GetSysDevicePaths (HWND hwndDlg)
{
if (!bCachedSysDevicePathsValid
- || wcslen (SysPartitionDevicePath) <= 1
+ || wcslen (SysPartitionDevicePath) <= 1
|| wcslen (SysDriveDevicePath) <= 1)
{
foreach (const HostDevice &device, GetAvailableHostDevices (false, true))
{
if (device.ContainsSystem)
- StringCchCopyW (device.IsPartition ? SysPartitionDevicePath : SysDriveDevicePath, TC_MAX_PATH, device.Path.c_str());
+ StringCchCopyW (device.IsPartition ? SysPartitionDevicePath : SysDriveDevicePath, TC_MAX_PATH, device.Path.c_str());
}
if (IsOSAtLeast (WIN_7))
@@ -3070,24 +3136,24 @@ BOOL GetSysDevicePaths (HWND hwndDlg)
bCachedSysDevicePathsValid = 1;
}
- return (bCachedSysDevicePathsValid
- && wcslen (SysPartitionDevicePath) > 1
+ return (bCachedSysDevicePathsValid
+ && wcslen (SysPartitionDevicePath) > 1
&& wcslen (SysDriveDevicePath) > 1);
}
-/* Determines whether the device path is the path of the system partition or of the system drive (or neither).
-If bReliableRequired is TRUE, very fast execution is guaranteed, but the results cannot be relied upon.
+/* Determines whether the device path is the path of the system partition or of the system drive (or neither).
+If bReliableRequired is TRUE, very fast execution is guaranteed, but the results cannot be relied upon.
If it's FALSE and the function is called for the first time, execution may take up to one minute but the
results are reliable.
IMPORTANT: As the execution may take a very long time if called for the first time with bReliableRequired set
to TRUE, it should be called with bReliableRequired set to TRUE only before performing a dangerous
- operation (such as header backup restore or formatting a supposedly non-system device) never at
- WM_INITDIALOG or any other GUI events (use IsSystemDevicePath(path, hwndDlg, FALSE) for fast
- preliminary GUI checks; also note that right after the "Select Device" dialog exits with an OK
+ operation (such as header backup restore or formatting a supposedly non-system device) never at
+ WM_INITDIALOG or any other GUI events (use IsSystemDevicePath(path, hwndDlg, FALSE) for fast
+ preliminary GUI checks; also note that right after the "Select Device" dialog exits with an OK
return code, you can use the global flags bSysPartitionSelected and bSysDriveSelected to see if the
user selected the system partition/device).
After this function completes successfully, the results are cached for the rest of the session, bReliableRequired
-is ignored (TRUE implied), repeated executions complete very fast, and the results are always reliable.
+is ignored (TRUE implied), repeated executions complete very fast, and the results are always reliable.
Return codes:
1 - it is the system partition path (e.g. \Device\Harddisk0\Partition1)
2 - it is the system drive path (e.g. \Device\Harddisk0\Partition0)
@@ -3122,10 +3188,10 @@ int IsSystemDevicePath (const wchar_t *path, HWND hwndDlg, BOOL bReliableRequire
/* Determines whether the path points to a non-system partition on the system drive.
IMPORTANT: As this may take a very long time if called for the first time, it should be called
- only before performing a dangerous operation, never at WM_INITDIALOG or any other GUI events.
+ only before performing a dangerous operation, never at WM_INITDIALOG or any other GUI events.
Return codes:
-0 - it isn't a non-system partition on the system drive
-1 - it's a non-system partition on the system drive
+0 - it isn't a non-system partition on the system drive
+1 - it's a non-system partition on the system drive
-1 - the result can't be determined, isn't reliable, or there was an error. */
int IsNonSysPartitionOnSysDrive (const wchar_t *path)
{
@@ -3165,12 +3231,12 @@ int IsNonSysPartitionOnSysDrive (const wchar_t *path)
if (wcsncmp (tmpPath, SysDriveDevicePath, max (wcslen(tmpPath), wcslen(SysDriveDevicePath))) == 0)
{
- // It is a non-system partition on the system drive
+ // It is a non-system partition on the system drive
return 1;
}
- else
+ else
{
- // The partition is not on the system drive
+ // The partition is not on the system drive
return 0;
}
}
@@ -3415,17 +3481,17 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
LocalizeDialog (hwndDlg, "IDD_RAWDEVICES_DLG");
SendMessage (hList,LVM_SETEXTENDEDLISTVIEWSTYLE,0,
- LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_TWOCLICKACTIVATE|LVS_EX_LABELTIP
- );
+ LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_TWOCLICKACTIVATE|LVS_EX_LABELTIP
+ );
- memset (&LvCol,0,sizeof(LvCol));
- LvCol.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM|LVCF_FMT;
+ memset (&LvCol,0,sizeof(LvCol));
+ LvCol.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM|LVCF_FMT;
LvCol.pszText = GetString ("DEVICE");
LvCol.cx = CompensateXDPI (186);
LvCol.fmt = LVCFMT_LEFT;
SendMessage (hList,LVM_INSERTCOLUMNW,0,(LPARAM)&LvCol);
- LvCol.pszText = GetString ("DRIVE");
+ LvCol.pszText = GetString ("DRIVE");
LvCol.cx = CompensateXDPI (38);
LvCol.fmt = LVCFMT_LEFT;
SendMessage (hList,LVM_INSERTCOLUMNW,1,(LPARAM)&LvCol);
@@ -3479,7 +3545,7 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
// Path
if (!device.IsPartition || device.DynamicVolume)
{
- if (!device.Floppy && (device.Size == 0)
+ if (!device.Floppy && (device.Size == 0)
&& (device.IsPartition || device.Partitions.empty() || device.Partitions[0].Size == 0)
)
continue;
@@ -3487,7 +3553,7 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (line > 1)
{
ListItemAdd (hList, item.iItem, L"");
- item.iItem = line++;
+ item.iItem = line++;
}
if (device.Floppy || device.DynamicVolume)
@@ -3540,7 +3606,7 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
}
#endif
- item.iItem = line++;
+ item.iItem = line++;
}
SendMessageW(hList, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(LVSCW_AUTOSIZE_USEHEADER, 0));
@@ -3563,8 +3629,8 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
{
BOOL bEnableOkButton = FALSE;
LVITEM LvItem;
- memset(&LvItem,0,sizeof(LvItem));
- LvItem.mask = LVIF_TEXT | LVIF_PARAM;
+ memset(&LvItem,0,sizeof(LvItem));
+ LvItem.mask = LVIF_TEXT | LVIF_PARAM;
LvItem.iItem = ((LPNMLISTVIEW) lParam)->iItem;
LvItem.pszText = lpszFileName;
LvItem.cchTextMax = TC_MAX_PATH;
@@ -3597,7 +3663,7 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
int selectedItem = ListView_GetSelectionMark (GetDlgItem (hwndDlg, IDC_DEVICELIST));
if (selectedItem == -1 || itemToDeviceMap.find (selectedItem) == itemToDeviceMap.end())
- return 1; // non-device line selected
+ return 1; // non-device line selected
const HostDevice selectedDevice = itemToDeviceMap[selectedItem];
StringCchCopyW (lpszFileName, TC_MAX_PATH, selectedDevice.Path.c_str());
@@ -3710,7 +3776,7 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
}
}
- // Disallow format if the device contains partitions, but not if the partition is virtual or system
+ // Disallow format if the device contains partitions, but not if the partition is virtual or system
if (!selectedDevice.IsVirtualPartition
&& !bHiddenVolDirect)
{
@@ -3731,7 +3797,7 @@ BOOL CALLBACK RawDevicesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
#endif // #ifdef VOLFORMAT
}
- else
+ else
bSysDriveSelected = FALSE;
#ifdef VOLFORMAT
@@ -3908,7 +3974,7 @@ BOOL DriverUnload ()
if (hDriver == INVALID_HANDLE_VALUE)
return TRUE;
-
+
try
{
if (BootEncryption (NULL).GetStatus().DeviceFilterActive)
@@ -4025,7 +4091,7 @@ start:
}
// Try to open a handle to the driver again (keep the mutex in case the other instance failed)
- goto start;
+ goto start;
}
else
{
@@ -4034,7 +4100,7 @@ start:
if (SystemEncryptionStatus != SYSENC_STATUS_NONE)
{
// This is an inconsistent state. The config file indicates system encryption should be
- // active, but the driver is not running. This may happen e.g. when the pretest fails and
+ // active, but the driver is not running. This may happen e.g. when the pretest fails and
// the user selects "Last Known Good Configuration" from the Windows boot menu.
// To fix this, we're going to reinstall the driver, start it, and register it for boot.
@@ -4068,7 +4134,7 @@ load:
return res;
bPortableModeConfirmed = TRUE;
-
+
if (hDriver != INVALID_HANDLE_VALUE)
CloseHandle (hDriver);
hDriver = CreateFile (WIN32_ROOT_PREFIX, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
@@ -4242,7 +4308,7 @@ BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileN
| OFN_PATHMUSTEXIST
| OFN_ALLOWMULTISELECT
| (keepHistory ? 0 : OFN_DONTADDTORECENT);
-
+
if (!keepHistory)
CleanLastVisitedMRU ();
@@ -4272,7 +4338,7 @@ BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileN
CleanLastVisitedMRU ();
status = TRUE;
-
+
ret:
SystemFileSelectorCallPending = FALSE;
ResetCurrentDirectory();
@@ -4306,10 +4372,10 @@ BOOL SelectMultipleFilesNext (wchar_t *lpszFileName, size_t cbFileName)
}
-static int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
+static int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
{
switch(uMsg) {
- case BFFM_INITIALIZED:
+ case BFFM_INITIALIZED:
{
/* WParam is TRUE since we are passing a path.
It would be FALSE if we were passing a pidl. */
@@ -4317,12 +4383,12 @@ static int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pDa
break;
}
- case BFFM_SELCHANGED:
+ case BFFM_SELCHANGED:
{
wchar_t szDir[TC_MAX_PATH];
/* Set the status window to the currently selected path. */
- if (SHGetPathFromIDList((LPITEMIDLIST) lp ,szDir))
+ if (SHGetPathFromIDList((LPITEMIDLIST) lp ,szDir))
{
SendMessage (hwnd,BFFM_SETSTATUSTEXT,0,(LPARAM)szDir);
}
@@ -4346,7 +4412,7 @@ BOOL BrowseDirectories (HWND hwndDlg, char *lpszTitle, wchar_t *dirName)
CoInitialize (NULL);
- if (SUCCEEDED (SHGetMalloc (&pMalloc)))
+ if (SUCCEEDED (SHGetMalloc (&pMalloc)))
{
ZeroMemory (&bi, sizeof(bi));
bi.hwndOwner = hwndDlg;
@@ -4358,9 +4424,9 @@ BOOL BrowseDirectories (HWND hwndDlg, char *lpszTitle, wchar_t *dirName)
bi.lParam = (LPARAM)dirName;
pidl = SHBrowseForFolderW (&bi);
- if (pidl != NULL)
+ if (pidl != NULL)
{
- if (SHGetPathFromIDList(pidl, dirName))
+ if (SHGetPathFromIDList(pidl, dirName))
{
bOK = TRUE;
}
@@ -4574,7 +4640,7 @@ static BOOL CALLBACK LocalizeDialogEnum( HWND hwnd, LPARAM font)
// Font
SendMessageW (hwnd, WM_SETFONT, (WPARAM) font, 0);
-
+
return TRUE;
}
@@ -4588,7 +4654,7 @@ void LocalizeDialog (HWND hwnd, char *stringId)
SetWindowTextW (hwnd, L"VeraCrypt");
else
SetWindowTextW (hwnd, GetString (stringId));
-
+
if (hUserFont != 0)
EnumChildWindows (hwnd, LocalizeDialogEnum, (LPARAM) hUserFont);
}
@@ -4669,10 +4735,10 @@ BOOL UpdateDriveCustomLabel (int driveNo, wchar_t* effectiveLabel, BOOL bSetValu
DWORD cbLabelLen = (DWORD) ((wcslen (effectiveLabel) + 1) * sizeof (wchar_t));
BOOL bToBeDeleted = FALSE;
- StringCbPrintfW (wszRegPath, sizeof (wszRegPath), L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DriveIcons\\%s\\DefaultLabel", driveStr);
-
+ StringCbPrintfW (wszRegPath, sizeof (wszRegPath), L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DriveIcons\\%s\\DefaultLabel", driveStr);
+
if (bSetValue)
- lStatus = RegCreateKeyExW (HKEY_CURRENT_USER, wszRegPath, NULL, NULL, 0,
+ lStatus = RegCreateKeyExW (HKEY_CURRENT_USER, wszRegPath, NULL, NULL, 0,
KEY_READ | KEY_WRITE | KEY_SET_VALUE, NULL, &hKey, NULL);
else
lStatus = RegOpenKeyExW (HKEY_CURRENT_USER, wszRegPath, 0, KEY_READ | KEY_WRITE | KEY_SET_VALUE, &hKey);
@@ -4696,7 +4762,7 @@ BOOL UpdateDriveCustomLabel (int driveNo, wchar_t* effectiveLabel, BOOL bSetValu
if (bToBeDeleted)
{
- StringCbPrintfW (wszRegPath, sizeof (wszRegPath), L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DriveIcons\\%s", driveStr);
+ StringCbPrintfW (wszRegPath, sizeof (wszRegPath), L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DriveIcons\\%s", driveStr);
lStatus = RegOpenKeyExW (HKEY_CURRENT_USER, wszRegPath, 0, KEY_READ | KEY_WRITE | KEY_SET_VALUE, &hKey);
if (ERROR_SUCCESS == lStatus)
{
@@ -4722,7 +4788,7 @@ wstring GetUserFriendlyVersionString (int version)
versionString.insert (version > 0xfff ? 2 : 1,L".");
if (versionString[versionString.length()-1] == L'0')
- versionString.erase (versionString.length()-1, 1);
+ versionString.erase (versionString.length()-1, 1);
return (versionString);
}
@@ -4774,7 +4840,7 @@ bool HexWideStringToArray (const wchar_t* hexStr, std::vector<byte>& arr)
arr.clear();
if (len %2)
return false;
-
+
for (i = 0; i < len/2; i++)
{
if (!HexToByte (*hexStr++, b1) || !HexToByte (*hexStr++, b2))
@@ -4837,7 +4903,7 @@ void GetSpeedString (unsigned __int64 speed, wchar_t *str, size_t cbStr)
{
static wchar_t *b, *kb, *mb, *gb, *tb, *pb;
static int serNo;
-
+
if (b == NULL || serNo != LocalizationSerialNo)
{
serNo = LocalizationSerialNo;
@@ -4871,6 +4937,60 @@ void GetSpeedString (unsigned __int64 speed, wchar_t *str, size_t cbStr)
StringCbPrintfW (str, cbStr, L"%I64d %s", speed, b);
}
+static void ResetBenchmarkList (HWND hwndDlg)
+{
+ LVCOLUMNW LvCol;
+
+ HWND hList = GetDlgItem (hwndDlg, IDC_RESULTS);
+
+ /* Render the results */
+ // delete data
+ SendMessage (hList, LVM_DELETEALLITEMS, 0, 0);
+ // Delete headers
+ SendMessageW (hList, LVM_DELETECOLUMN, 1, 0);
+ SendMessageW (hList, LVM_DELETECOLUMN, 1, 0);
+ SendMessageW (hList, LVM_DELETECOLUMN, 1, 0);
+
+ memset (&LvCol,0,sizeof(LvCol));
+ LvCol.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM|LVCF_FMT;
+ switch(benchmarkType) {
+ case BENCHMARK_TYPE_ENCRYPTION:
+ // Create headers
+ LvCol.pszText = GetString ("ENCRYPTION");
+ LvCol.cx = CompensateXDPI (80);
+ LvCol.fmt = LVCFMT_RIGHT;
+ SendMessageW (hList,LVM_INSERTCOLUMNW,1,(LPARAM)&LvCol);
+
+ LvCol.pszText = GetString ("DECRYPTION");
+ LvCol.cx = CompensateXDPI (80);
+ LvCol.fmt = LVCFMT_RIGHT;
+ SendMessageW (hList,LVM_INSERTCOLUMNW,2,(LPARAM)&LvCol);
+
+ LvCol.pszText = GetString ("MEAN");
+ LvCol.cx = CompensateXDPI (80);
+ LvCol.fmt = LVCFMT_RIGHT;
+ SendMessageW (hList,LVM_INSERTCOLUMNW,3,(LPARAM)&LvCol);
+ break;
+ case BENCHMARK_TYPE_HASH:
+ LvCol.pszText = GetString ("MEAN");
+ LvCol.cx = CompensateXDPI (80);
+ LvCol.fmt = LVCFMT_RIGHT;
+ SendMessageW (hList,LVM_INSERTCOLUMNW,1,(LPARAM)&LvCol);
+ break;
+ case BENCHMARK_TYPE_PRF:
+ LvCol.pszText = GetString ("TIME");
+ LvCol.cx = CompensateXDPI (80);
+ LvCol.fmt = LVCFMT_RIGHT;
+ SendMessageW (hList,LVM_INSERTCOLUMNW,1,(LPARAM)&LvCol);
+
+ LvCol.pszText = GetString ("ITERATIONS");
+ LvCol.cx = CompensateXDPI (80);
+ LvCol.fmt = LVCFMT_RIGHT;
+ SendMessageW (hList,LVM_INSERTCOLUMNW,2,(LPARAM)&LvCol);
+ break;
+ }
+}
+
static void DisplayBenchmarkResults (HWND hwndDlg)
{
wchar_t item1[100]={0};
@@ -4880,6 +5000,8 @@ static void DisplayBenchmarkResults (HWND hwndDlg)
BOOL unsorted = TRUE;
BENCHMARK_REC tmp_line;
+ ResetBenchmarkList (hwndDlg);
+
/* Sort the list */
switch (benchmarkSortMethod)
@@ -4891,7 +5013,10 @@ static void DisplayBenchmarkResults (HWND hwndDlg)
unsorted = FALSE;
for (i = 0; i < benchmarkTotalItems - 1; i++)
{
- if (benchmarkTable[i].meanBytesPerSec < benchmarkTable[i+1].meanBytesPerSec)
+
+ if (((benchmarkType == BENCHMARK_TYPE_PRF) && (benchmarkTable[i].meanBytesPerSec > benchmarkTable[i+1].meanBytesPerSec)) ||
+ ((benchmarkType != BENCHMARK_TYPE_PRF) && (benchmarkTable[i].meanBytesPerSec < benchmarkTable[i+1].meanBytesPerSec))
+ )
{
unsorted = TRUE;
memcpy (&tmp_line, &benchmarkTable[i], sizeof(BENCHMARK_REC));
@@ -4920,11 +5045,7 @@ static void DisplayBenchmarkResults (HWND hwndDlg)
}
break;
}
-
- /* Render the results */
-
- SendMessage (hList,LVM_DELETEALLITEMS,0,(LPARAM)&LvItem);
-
+
for (i = 0; i < benchmarkTotalItems; i++)
{
ea = benchmarkTable[i].id;
@@ -4934,37 +5055,41 @@ static void DisplayBenchmarkResults (HWND hwndDlg)
LvItem.iItem = i;
LvItem.iSubItem = 0;
LvItem.pszText = (LPWSTR) benchmarkTable[i].name;
- SendMessageW (hList, LVM_INSERTITEM, 0, (LPARAM)&LvItem);
-
-#if PKCS5_BENCHMARKS
- wcscpy (item1, L"-");
-#else
- GetSpeedString ((unsigned __int64) (benchmarkLastBufferSize / ((float) benchmarkTable[i].encSpeed / benchmarkPerformanceFrequency.QuadPart)), item1, sizeof(item1));
-#endif
- LvItem.iSubItem = 1;
- LvItem.pszText = item1;
-
- SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
-
-#if PKCS5_BENCHMARKS
- wcscpy (item1, L"-");
-#else
- GetSpeedString ((unsigned __int64) (benchmarkLastBufferSize / ((float) benchmarkTable[i].decSpeed / benchmarkPerformanceFrequency.QuadPart)), item1, sizeof(item1));
-#endif
- LvItem.iSubItem = 2;
- LvItem.pszText = item1;
-
- SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
-
-#if PKCS5_BENCHMARKS
- swprintf (item1, L"%d t", benchmarkTable[i].encSpeed);
-#else
- GetSpeedString (benchmarkTable[i].meanBytesPerSec, item1, sizeof(item1));
-#endif
- LvItem.iSubItem = 3;
- LvItem.pszText = item1;
-
- SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
+ SendMessageW (hList, LVM_INSERTITEM, 0, (LPARAM)&LvItem);
+ switch(benchmarkType) {
+ case BENCHMARK_TYPE_ENCRYPTION:
+ GetSpeedString ((unsigned __int64) (benchmarkLastBufferSize / ((float) benchmarkTable[i].encSpeed / benchmarkPerformanceFrequency.QuadPart)), item1, sizeof(item1));
+ LvItem.iSubItem = 1;
+ LvItem.pszText = item1;
+ SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
+
+ GetSpeedString ((unsigned __int64) (benchmarkLastBufferSize / ((float) benchmarkTable[i].decSpeed / benchmarkPerformanceFrequency.QuadPart)), item1, sizeof(item1));
+ LvItem.iSubItem = 2;
+ LvItem.pszText = item1;
+ SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
+
+ GetSpeedString (benchmarkTable[i].meanBytesPerSec, item1, sizeof(item1));
+ LvItem.iSubItem = 3;
+ LvItem.pszText = item1;
+ SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
+ break;
+ case BENCHMARK_TYPE_HASH:
+ GetSpeedString (benchmarkTable[i].meanBytesPerSec, item1, sizeof(item1));
+ LvItem.iSubItem = 1;
+ LvItem.pszText = item1;
+ SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
+ break;
+ case BENCHMARK_TYPE_PRF:
+ swprintf_s (item1, sizeof(item1) / sizeof(item1[0]), L"%d ms", benchmarkTable[i].meanBytesPerSec);
+ LvItem.iSubItem = 1;
+ LvItem.pszText = item1;
+ SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
+ swprintf_s (item1, sizeof(item1) / sizeof(item1[0]), L"%d", benchmarkTable[i].decSpeed);
+ LvItem.iSubItem = 2;
+ LvItem.pszText = item1;
+ SendMessageW (hList, LVM_SETITEMW, 0, (LPARAM)&LvItem);
+ break;
+ }
}
SendMessageW(hList, LVM_SETCOLUMNWIDTH, 0, MAKELPARAM(LVSCW_AUTOSIZE_USEHEADER, 0));
@@ -4978,7 +5103,7 @@ static void DisplayBenchmarkResults (HWND hwndDlg)
typedef struct
{
HWND hBenchDlg;
- BOOL bStatus;
+ BOOL bStatus;
} BenchmarkThreadParam;
static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg);
@@ -4993,17 +5118,21 @@ void CALLBACK BenchmarkThreadProc(void* pArg, HWND hwndDlg)
static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
{
LARGE_INTEGER performanceCountStart, performanceCountEnd;
- BYTE *lpTestBuffer;
+ BYTE *lpTestBuffer = NULL;
PCRYPTO_INFO ci = NULL;
UINT64_STRUCT startDataUnitNo;
+ SYSTEM_INFO sysInfo = {0};
+ GetSystemInfo (&sysInfo);
startDataUnitNo.Value = 0;
-#if !(PKCS5_BENCHMARKS || HASH_FNC_BENCHMARKS)
+ /* set priority to critical only when there are 2 or more CPUs on the system */
+ if (sysInfo.dwNumberOfProcessors > 1)
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
+
ci = crypto_open ();
if (!ci)
return FALSE;
-#endif
if (QueryPerformanceFrequency (&benchmarkPerformanceFrequency) == 0)
{
@@ -5013,142 +5142,141 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
return FALSE;
}
- lpTestBuffer = (BYTE *) malloc(benchmarkBufferSize - (benchmarkBufferSize % 16));
- if (lpTestBuffer == NULL)
+ if (benchmarkType != BENCHMARK_TYPE_PRF)
{
- if (ci)
- crypto_close (ci);
- MessageBoxW (hwndDlg, GetString ("ERR_MEM_ALLOC"), lpszTitle, ICON_HAND);
- return FALSE;
- }
- VirtualLock (lpTestBuffer, benchmarkBufferSize - (benchmarkBufferSize % 16));
-
- WaitCursor ();
- benchmarkTotalItems = 0;
-
-#if !(PKCS5_BENCHMARKS || HASH_FNC_BENCHMARKS)
- // CPU "warm up" (an attempt to prevent skewed results on systems where CPU frequency
- // gradually changes depending on CPU load).
- ci->ea = EAGetFirst();
- if (!EAInit (ci->ea, ci->master_keydata, ci->ks))
- {
- ci->mode = FIRST_MODE_OF_OPERATION_ID;
- if (EAInitMode (ci))
+ lpTestBuffer = (BYTE *) _aligned_malloc(benchmarkBufferSize - (benchmarkBufferSize % 16), 16);
+ if (lpTestBuffer == NULL)
{
- int i;
-
- for (i = 0; i < 10; i++)
- {
- EncryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
- DecryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
- }
+ if (ci)
+ crypto_close (ci);
+ MessageBoxW (hwndDlg, GetString ("ERR_MEM_ALLOC"), lpszTitle, ICON_HAND);
+ return FALSE;
}
+ VirtualLock (lpTestBuffer, benchmarkBufferSize - (benchmarkBufferSize % 16));
}
-#endif
-
-#if HASH_FNC_BENCHMARKS
- /* Measures the speed at which each of the hash algorithms processes the message to produce
- a single digest.
-
- The hash algorithm benchmarks are included here for development purposes only. Do not enable
- them when building a public release (the benchmark GUI strings wouldn't make sense). */
+ WaitCursor ();
+ benchmarkTotalItems = 0;
- {
- BYTE *digest [MAX_DIGESTSIZE];
- WHIRLPOOL_CTX wctx;
- RMD160_CTX rctx;
- sha512_ctx s2ctx;
- sha256_ctx s256ctx;
- int hid;
+ switch(benchmarkType) {
- for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
+ case BENCHMARK_TYPE_HASH:
+ /* Measures the speed at which each of the hash algorithms processes the message to produce
+ a single digest.
+ */
{
- if (QueryPerformanceCounter (&performanceCountStart) == 0)
- goto counter_error;
+ BYTE *digest [MAX_DIGESTSIZE];
+ WHIRLPOOL_CTX wctx;
+ RMD160_CTX rctx;
+ sha512_ctx s2ctx;
+ sha256_ctx s256ctx;
+ STREEBOG_CTX stctx;
- switch (hid)
- {
+ int hid, i;
- case SHA512:
- sha512_begin (&s2ctx);
- sha512_hash (lpTestBuffer, benchmarkBufferSize, &s2ctx);
- sha512_end ((unsigned char *) digest, &s2ctx);
- break;
+ for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
+ {
+ if (QueryPerformanceCounter (&performanceCountStart) == 0)
+ goto counter_error;
- case SHA256:
- sha256_begin (&s256ctx);
- sha256_hash (lpTestBuffer, benchmarkBufferSize, &s256ctx);
- sha256_end ((unsigned char *) digest, &s256ctx);
- break;
+ for (i = 1; i <= 2; i++)
+ {
+ switch (hid)
+ {
- case RIPEMD160:
- RMD160Init(&rctx);
- RMD160Update(&rctx, lpTestBuffer, benchmarkBufferSize);
- RMD160Final((unsigned char *) digest, &rctx);
- break;
+ case SHA512:
+ sha512_begin (&s2ctx);
+ sha512_hash (lpTestBuffer, benchmarkBufferSize, &s2ctx);
+ sha512_end ((unsigned char *) digest, &s2ctx);
+ break;
+
+ case SHA256:
+ sha256_begin (&s256ctx);
+ sha256_hash (lpTestBuffer, benchmarkBufferSize, &s256ctx);
+ sha256_end ((unsigned char *) digest, &s256ctx);
+ break;
+
+ case RIPEMD160:
+ RMD160Init(&rctx);
+ RMD160Update(&rctx, lpTestBuffer, benchmarkBufferSize);
+ RMD160Final((unsigned char *) digest, &rctx);
+ break;
+
+ case WHIRLPOOL:
+ WHIRLPOOL_init (&wctx);
+ WHIRLPOOL_add (lpTestBuffer, benchmarkBufferSize, &wctx);
+ WHIRLPOOL_finalize (&wctx, (unsigned char *) digest);
+ break;
+
+ case STREEBOG:
+ STREEBOG_init(&stctx);
+ STREEBOG_add(&stctx, lpTestBuffer, benchmarkBufferSize);
+ STREEBOG_finalize(&stctx, (unsigned char *)digest);
+ break;
- case WHIRLPOOL:
- WHIRLPOOL_init (&wctx);
- WHIRLPOOL_add (lpTestBuffer, benchmarkBufferSize * 8, &wctx);
- WHIRLPOOL_finalize (&wctx, (unsigned char *) digest);
- break;
- }
+ }
+ }
- if (QueryPerformanceCounter (&performanceCountEnd) == 0)
- goto counter_error;
+ if (QueryPerformanceCounter (&performanceCountEnd) == 0)
+ goto counter_error;
- benchmarkTable[benchmarkTotalItems].encSpeed = performanceCountEnd.QuadPart - performanceCountStart.QuadPart;
+ benchmarkTable[benchmarkTotalItems].encSpeed = performanceCountEnd.QuadPart - performanceCountStart.QuadPart;
- benchmarkTable[benchmarkTotalItems].decSpeed = benchmarkTable[benchmarkTotalItems].encSpeed;
- benchmarkTable[benchmarkTotalItems].id = hid;
- benchmarkTable[benchmarkTotalItems].meanBytesPerSec = ((unsigned __int64) (benchmarkBufferSize / ((float) benchmarkTable[benchmarkTotalItems].encSpeed / benchmarkPerformanceFrequency.QuadPart)) + (unsigned __int64) (benchmarkBufferSize / ((float) benchmarkTable[benchmarkTotalItems].decSpeed / benchmarkPerformanceFrequency.QuadPart))) / 2;
- StringCbPrintfA (benchmarkTable[benchmarkTotalItems].name, sizeof(benchmarkTable[benchmarkTotalItems].name),"%s", HashGetName(hid));
+ benchmarkTable[benchmarkTotalItems].decSpeed = benchmarkTable[benchmarkTotalItems].encSpeed;
+ benchmarkTable[benchmarkTotalItems].id = hid;
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = (unsigned __int64) (benchmarkBufferSize / ((float) benchmarkTable[benchmarkTotalItems].encSpeed / benchmarkPerformanceFrequency.QuadPart / 2));
+ StringCbPrintfW (benchmarkTable[benchmarkTotalItems].name, sizeof(benchmarkTable[benchmarkTotalItems].name),L"%s", HashGetName(hid));
- benchmarkTotalItems++;
+ benchmarkTotalItems++;
+ }
}
- }
-
-#elif PKCS5_BENCHMARKS // #if HASH_FNC_BENCHMARKS
+ break;
+ case BENCHMARK_TYPE_PRF:
/* Measures the time that it takes for the PKCS-5 routine to derive a header key using
- each of the implemented PRF algorithms.
-
- The PKCS-5 benchmarks are included here for development purposes only. Do not enable
- them when building a public release (the benchmark GUI strings wouldn't make sense). */
+ each of the implemented PRF algorithms.
+ */
{
int thid, i;
char dk[MASTER_KEYDATA_SIZE];
char *tmp_salt = {"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF\x01\x23\x45\x67\x89\xAB\xCD\xEF\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF\x01\x23\x45\x67\x89\xAB\xCD\xEF\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xAA\xBB\xCC\xDD\xEE\xFF"};
- for (thid = FIRST_PRF_ID; thid <= LAST_PRF_ID; thid++)
+ for (thid = FIRST_PRF_ID; thid <= LAST_PRF_ID; thid++)
{
+ if (benchmarkPreBoot && !benchmarkGPT && !HashForSystemEncryption (thid))
+ continue;
+
if (QueryPerformanceCounter (&performanceCountStart) == 0)
goto counter_error;
- for (i = 1; i <= 5; i++)
+ for (i = 1; i <= 2; i++)
{
switch (thid)
{
case SHA512:
/* PKCS-5 test with HMAC-SHA-512 used as the PRF */
- derive_key_sha512 ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, 0, FALSE, FALSE), dk, MASTER_KEYDATA_SIZE);
+ derive_key_sha512 ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, benchmarkPim, FALSE, benchmarkPreBoot), dk, MASTER_KEYDATA_SIZE);
break;
case SHA256:
/* PKCS-5 test with HMAC-SHA-256 used as the PRF */
- derive_key_sha256 ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, 0, FALSE, FALSE), dk, MASTER_KEYDATA_SIZE);
+ derive_key_sha256 ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, benchmarkPim, FALSE, benchmarkPreBoot), dk, MASTER_KEYDATA_SIZE);
break;
case RIPEMD160:
/* PKCS-5 test with HMAC-RIPEMD-160 used as the PRF */
- derive_key_ripemd160 ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, 0, FALSE, FALSE), dk, MASTER_KEYDATA_SIZE);
+ derive_key_ripemd160 ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, benchmarkPim, FALSE, benchmarkPreBoot), dk, MASTER_KEYDATA_SIZE);
break;
case WHIRLPOOL:
/* PKCS-5 test with HMAC-Whirlpool used as the PRF */
- derive_key_whirlpool ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, 0, FALSE, FALSE), dk, MASTER_KEYDATA_SIZE);
+ derive_key_whirlpool ("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, benchmarkPim, FALSE, benchmarkPreBoot), dk, MASTER_KEYDATA_SIZE);
+ break;
+
+ case STREEBOG:
+ /* PKCS-5 test with HMAC-STREEBOG used as the PRF */
+ derive_key_streebog("passphrase-1234567890", 21, tmp_salt, 64, get_pkcs5_iteration_count(thid, benchmarkPim, FALSE, benchmarkPreBoot), dk, MASTER_KEYDATA_SIZE);
break;
}
}
@@ -5158,62 +5286,113 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
benchmarkTable[benchmarkTotalItems].encSpeed = performanceCountEnd.QuadPart - performanceCountStart.QuadPart;
benchmarkTable[benchmarkTotalItems].id = thid;
- StringCbPrintfW (benchmarkTable[benchmarkTotalItems].name, sizeof(benchmarkTable[benchmarkTable[benchmarkTotalItems].name),L"%s", get_pkcs5_prf_name (thid));
+ benchmarkTable[benchmarkTotalItems].decSpeed = get_pkcs5_iteration_count(thid, benchmarkPim, FALSE, benchmarkPreBoot);
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = (unsigned __int64) (1000 * ((float) benchmarkTable[benchmarkTotalItems].encSpeed / benchmarkPerformanceFrequency.QuadPart / 2));
+ if (benchmarkPreBoot)
+ {
+ /* heuristics for boot times */
+ if (benchmarkGPT)
+ {
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = (benchmarkTable[benchmarkTotalItems].meanBytesPerSec * 8) / 5;
+ }
+ else
+ {
+ if (thid == SHA256)
+ {
+#ifdef _WIN64
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = (benchmarkTable[benchmarkTotalItems].meanBytesPerSec * 26);
+#else
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = (benchmarkTable[benchmarkTotalItems].meanBytesPerSec * 24);
+#endif
+ }
+ else
+ {
+#ifdef _WIN64
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = (benchmarkTable[benchmarkTotalItems].meanBytesPerSec * 21) / 5;
+#else
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = (benchmarkTable[benchmarkTotalItems].meanBytesPerSec * 18) / 5;
+#endif
+ }
+ }
+ }
+ StringCbPrintfW (benchmarkTable[benchmarkTotalItems].name, sizeof(benchmarkTable[benchmarkTotalItems].name),L"%s", get_pkcs5_prf_name (thid));
benchmarkTotalItems++;
}
}
+ break;
+ case BENCHMARK_TYPE_ENCRYPTION:
+ {
+ /* Encryption algorithm benchmarks */
-#else // #elif PKCS5_BENCHMARKS
+ // CPU "warm up" (an attempt to prevent skewed results on systems where CPU frequency
+ // gradually changes depending on CPU load).
+ ci->ea = EAGetFirst();
+ if (!EAInit (ci->ea, ci->master_keydata, ci->ks))
+ {
+ ci->mode = FIRST_MODE_OF_OPERATION_ID;
+ if (EAInitMode (ci))
+ {
+ int i;
- /* Encryption algorithm benchmarks */
+ for (i = 0; i < 10; i++)
+ {
+ EncryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
+ DecryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
+ }
+ }
+ }
- for (ci->ea = EAGetFirst(); ci->ea != 0; ci->ea = EAGetNext(ci->ea))
- {
- if (!EAIsFormatEnabled (ci->ea))
- continue;
+ for (ci->ea = EAGetFirst(); ci->ea != 0; ci->ea = EAGetNext(ci->ea))
+ {
+ if (!EAIsFormatEnabled (ci->ea))
+ continue;
- if (ERR_CIPHER_INIT_FAILURE == EAInit (ci->ea, ci->master_keydata, ci->ks))
- goto counter_error;
+ if (ERR_CIPHER_INIT_FAILURE == EAInit (ci->ea, ci->master_keydata, ci->ks))
+ goto counter_error;
- ci->mode = FIRST_MODE_OF_OPERATION_ID;
- if (!EAInitMode (ci))
- goto counter_error;
+ ci->mode = FIRST_MODE_OF_OPERATION_ID;
+ if (!EAInitMode (ci))
+ goto counter_error;
- if (QueryPerformanceCounter (&performanceCountStart) == 0)
- goto counter_error;
+ if (QueryPerformanceCounter (&performanceCountStart) == 0)
+ goto counter_error;
- EncryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
+ EncryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
- if (QueryPerformanceCounter (&performanceCountEnd) == 0)
- goto counter_error;
+ if (QueryPerformanceCounter (&performanceCountEnd) == 0)
+ goto counter_error;
- benchmarkTable[benchmarkTotalItems].encSpeed = performanceCountEnd.QuadPart - performanceCountStart.QuadPart;
+ benchmarkTable[benchmarkTotalItems].encSpeed = performanceCountEnd.QuadPart - performanceCountStart.QuadPart;
- if (QueryPerformanceCounter (&performanceCountStart) == 0)
- goto counter_error;
+ if (QueryPerformanceCounter (&performanceCountStart) == 0)
+ goto counter_error;
- DecryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
+ DecryptDataUnits (lpTestBuffer, &startDataUnitNo, (TC_LARGEST_COMPILER_UINT) benchmarkBufferSize / ENCRYPTION_DATA_UNIT_SIZE, ci);
- if (QueryPerformanceCounter (&performanceCountEnd) == 0)
- goto counter_error;
+ if (QueryPerformanceCounter (&performanceCountEnd) == 0)
+ goto counter_error;
- benchmarkTable[benchmarkTotalItems].decSpeed = performanceCountEnd.QuadPart - performanceCountStart.QuadPart;
- benchmarkTable[benchmarkTotalItems].id = ci->ea;
- benchmarkTable[benchmarkTotalItems].meanBytesPerSec = ((unsigned __int64) (benchmarkBufferSize / ((float) benchmarkTable[benchmarkTotalItems].encSpeed / benchmarkPerformanceFrequency.QuadPart)) + (unsigned __int64) (benchmarkBufferSize / ((float) benchmarkTable[benchmarkTotalItems].decSpeed / benchmarkPerformanceFrequency.QuadPart))) / 2;
- EAGetName (benchmarkTable[benchmarkTotalItems].name, ci->ea, 1);
+ benchmarkTable[benchmarkTotalItems].decSpeed = performanceCountEnd.QuadPart - performanceCountStart.QuadPart;
+ benchmarkTable[benchmarkTotalItems].id = ci->ea;
+ benchmarkTable[benchmarkTotalItems].meanBytesPerSec = ((unsigned __int64) (benchmarkBufferSize / ((float) benchmarkTable[benchmarkTotalItems].encSpeed / benchmarkPerformanceFrequency.QuadPart)) + (unsigned __int64) (benchmarkBufferSize / ((float) benchmarkTable[benchmarkTotalItems].decSpeed / benchmarkPerformanceFrequency.QuadPart))) / 2;
+ EAGetName (benchmarkTable[benchmarkTotalItems].name, ci->ea, 1);
- benchmarkTotalItems++;
+ benchmarkTotalItems++;
+ }
+ }
+ break;
}
-#endif // #elif PKCS5_BENCHMARKS (#else)
-
if (ci)
crypto_close (ci);
- VirtualUnlock (lpTestBuffer, benchmarkBufferSize - (benchmarkBufferSize % 16));
+ if (lpTestBuffer)
+ {
+ VirtualUnlock (lpTestBuffer, benchmarkBufferSize - (benchmarkBufferSize % 16));
- free(lpTestBuffer);
+ _aligned_free(lpTestBuffer);
+ }
benchmarkLastBufferSize = benchmarkBufferSize;
@@ -5226,13 +5405,16 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
return TRUE;
counter_error:
-
+
if (ci)
crypto_close (ci);
- VirtualUnlock (lpTestBuffer, benchmarkBufferSize - (benchmarkBufferSize % 16));
+ if (lpTestBuffer)
+ {
+ VirtualUnlock (lpTestBuffer, benchmarkBufferSize - (benchmarkBufferSize % 16));
- free(lpTestBuffer);
+ _aligned_free(lpTestBuffer);
+ }
NormalCursor ();
@@ -5248,8 +5430,7 @@ BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
{
WORD lw = LOWORD (wParam);
LPARAM nIndex;
- HWND hCboxSortMethod = GetDlgItem (hwndDlg, IDC_BENCHMARK_SORT_METHOD);
- HWND hCboxBufferSize = GetDlgItem (hwndDlg, IDC_BENCHMARK_BUFFER_SIZE);
+ static HWND hCboxSortMethod = NULL, hCboxBufferSize = NULL, hCboxList = NULL;
switch (msg)
{
@@ -5258,37 +5439,35 @@ BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
LVCOLUMNW LvCol;
wchar_t s[128];
HWND hList = GetDlgItem (hwndDlg, IDC_RESULTS);
+ hCboxSortMethod = GetDlgItem (hwndDlg, IDC_BENCHMARK_SORT_METHOD);
+ hCboxBufferSize = GetDlgItem (hwndDlg, IDC_BENCHMARK_BUFFER_SIZE);
+ hCboxList = GetDlgItem (hwndDlg, IDC_BENCHMARK_LIST);
LocalizeDialog (hwndDlg, "IDD_BENCHMARK_DLG");
benchmarkBufferSize = BENCHMARK_DEFAULT_BUF_SIZE;
benchmarkSortMethod = BENCHMARK_SORT_BY_SPEED;
+ benchmarkType = BENCHMARK_TYPE_ENCRYPTION;
+
+ if (lParam)
+ {
+ benchmarkGPT = TRUE;
+ }
+ else
+ benchmarkGPT = FALSE;
SendMessage (hList,LVM_SETEXTENDEDLISTVIEWSTYLE,0,
- LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_LABELTIP
- );
+ LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_LABELTIP
+ );
- memset (&LvCol,0,sizeof(LvCol));
- LvCol.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM|LVCF_FMT;
+ memset (&LvCol,0,sizeof(LvCol));
+ LvCol.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM|LVCF_FMT;
LvCol.pszText = GetString ("ALGORITHM");
LvCol.cx = CompensateXDPI (114);
LvCol.fmt = LVCFMT_LEFT;
SendMessage (hList,LVM_INSERTCOLUMNW,0,(LPARAM)&LvCol);
- LvCol.pszText = GetString ("ENCRYPTION");
- LvCol.cx = CompensateXDPI (80);
- LvCol.fmt = LVCFMT_RIGHT;
- SendMessageW (hList,LVM_INSERTCOLUMNW,1,(LPARAM)&LvCol);
-
- LvCol.pszText = GetString ("DECRYPTION");
- LvCol.cx = CompensateXDPI (80);
- LvCol.fmt = LVCFMT_RIGHT;
- SendMessageW (hList,LVM_INSERTCOLUMNW,2,(LPARAM)&LvCol);
-
- LvCol.pszText = GetString ("MEAN");
- LvCol.cx = CompensateXDPI (80);
- LvCol.fmt = LVCFMT_RIGHT;
- SendMessageW (hList,LVM_INSERTCOLUMNW,3,(LPARAM)&LvCol);
+ ResetBenchmarkList (hwndDlg);
/* Combo boxes */
@@ -5304,6 +5483,21 @@ BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendMessage (hCboxSortMethod, CB_SETCURSEL, 1, 0); // Default sort method
+ // benchmark list
+
+ SendMessage (hCboxList, CB_RESETCONTENT, 0, 0);
+
+ nIndex = SendMessageW (hCboxList, CB_ADDSTRING, 0, (LPARAM) GetString ("ENCRYPTION_ALGORITHM"));
+ SendMessage (hCboxList, CB_SETITEMDATA, nIndex, (LPARAM) 0);
+
+ nIndex = SendMessageW (hCboxList, CB_ADDSTRING, 0, (LPARAM) GetString ("PKCS5_PRF"));
+ SendMessage (hCboxList, CB_SETITEMDATA, nIndex, (LPARAM) 0);
+
+ nIndex = SendMessageW (hCboxList, CB_ADDSTRING, 0, (LPARAM) GetString ("IDT_HASH_ALGO"));
+ SendMessage (hCboxList, CB_SETITEMDATA, nIndex, (LPARAM) 0);
+
+ SendMessage (hCboxList, CB_SETCURSEL, 0, 0); // Default: benchmark of encryption
+
// Buffer size
SendMessage (hCboxBufferSize, CB_RESETCONTENT, 0, 0);
@@ -5352,12 +5546,13 @@ BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
uint32 driverConfig = ReadDriverConfigurationFlags();
+ int isAesHwSupported = is_aes_hw_cpu_supported();
- SetDlgItemTextW (hwndDlg, IDC_HW_AES, (wstring (L" ") + (GetString (is_aes_hw_cpu_supported() ? ((driverConfig & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION) ? "UISTR_DISABLED" : "UISTR_YES") : "NOT_APPLICABLE_OR_NOT_AVAILABLE"))).c_str());
+ SetDlgItemTextW (hwndDlg, IDC_HW_AES, (wstring (L" ") + (GetString (isAesHwSupported ? ((driverConfig & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION) ? "UISTR_DISABLED" : "UISTR_YES") : "NOT_APPLICABLE_OR_NOT_AVAILABLE"))).c_str());
ToHyperlink (hwndDlg, IDC_HW_AES_LABEL_LINK);
- if (is_aes_hw_cpu_supported() && (driverConfig & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION))
+ if (isAesHwSupported && (driverConfig & TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION))
{
Warning ("DISABLED_HW_AES_AFFECTS_PERFORMANCE", hwndDlg);
}
@@ -5409,10 +5604,46 @@ BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
return 1;
+ case IDC_BENCHMARK_LIST:
+
+ nIndex = SendMessage (hCboxList, CB_GETCURSEL, 0, 0);
+ if (nIndex != benchmarkType)
+ {
+ benchmarkType = (int) nIndex;
+ benchmarkTotalItems = 0;
+ ResetBenchmarkList (hwndDlg);
+ }
+
+ if (benchmarkType == BENCHMARK_TYPE_PRF)
+ {
+ ShowWindow (GetDlgItem (hwndDlg, IDC_BENCHMARK_BUFFER_SIZE), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_BUFFER_SIZE), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_PIM), SW_SHOW);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_BENCHMARK_PREBOOT), SW_SHOW);
+ }
+ else
+ {
+ ShowWindow (GetDlgItem (hwndDlg, IDC_BENCHMARK_BUFFER_SIZE), SW_SHOW);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_BUFFER_SIZE), SW_SHOW);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_PIM), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDT_PIM), SW_HIDE);
+ ShowWindow (GetDlgItem (hwndDlg, IDC_BENCHMARK_PREBOOT), SW_HIDE);
+ }
+ return 1;
+
case IDC_PERFORM_BENCHMARK:
- nIndex = SendMessage (hCboxBufferSize, CB_GETCURSEL, 0, 0);
- benchmarkBufferSize = (int) SendMessage (hCboxBufferSize, CB_GETITEMDATA, nIndex, 0);
+ if (benchmarkType == BENCHMARK_TYPE_PRF)
+ {
+ benchmarkPim = GetPim (hwndDlg, IDC_PIM);
+ benchmarkPreBoot = GetCheckBox (hwndDlg, IDC_BENCHMARK_PREBOOT);
+ }
+ else
+ {
+ nIndex = SendMessage (hCboxBufferSize, CB_GETCURSEL, 0, 0);
+ benchmarkBufferSize = (int) SendMessage (hCboxBufferSize, CB_GETITEMDATA, nIndex, 0);
+ }
BenchmarkThreadParam threadParam;
threadParam.hBenchDlg = hwndDlg;
@@ -5518,7 +5749,7 @@ static BOOL CALLBACK RandomPoolEnrichementDlgProc (HWND hwndDlg, UINT msg, WPARA
SetTimer (hwndDlg, 0xfd, RANDPOOL_DISPLAY_REFRESH_INTERVAL, NULL);
SendMessage (GetDlgItem (hwndDlg, IDC_POOL_CONTENTS), WM_SETFONT, (WPARAM) hFixedDigitFont, (LPARAM) TRUE);
-
+
hEntropyBar = GetDlgItem (hwndDlg, IDC_ENTROPY_BAR);
SendMessage (hEntropyBar, PBM_SETRANGE32, 0, maxEntropyLevel);
SendMessage (hEntropyBar, PBM_SETSTEP, 1, 0);
@@ -5553,7 +5784,7 @@ static BOOL CALLBACK RandomPoolEnrichementDlgProc (HWND hwndDlg, UINT msg, WPARA
else if (bUseMask)
{
/* use mask to compute a randomized ascii representation */
- tmpByte = (randPool[row * RANDPOOL_DISPLAY_COLUMNS + col] -
+ tmpByte = (randPool[row * RANDPOOL_DISPLAY_COLUMNS + col] -
lastRandPool[row * RANDPOOL_DISPLAY_COLUMNS + col]) ^ maskRandPool [row * RANDPOOL_DISPLAY_COLUMNS + col];
tmp[0] = (wchar_t) (((tmpByte >> 4) % 6) + L'*');
tmp[1] = (wchar_t) (((tmpByte & 0x0F) % 6) + L'*');
@@ -5714,8 +5945,8 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendMessage (hEntropyBar, PBM_SETSTEP, 1, 0);
SendMessage (hEntropyBar, PBM_SETSTATE, PBST_ERROR, 0);
-#ifndef VOLFORMAT
- if (Randinit ())
+#ifndef VOLFORMAT
+ if (Randinit ())
{
handleError (hwndDlg, (CryptoAPILastError == ERROR_SUCCESS)? ERR_RAND_INIT_FAILED : ERR_CAPI_INIT_FAILED, SRC_POS);
EndDialog (hwndDlg, IDCLOSE);
@@ -5761,7 +5992,7 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
else if (bUseMask)
{
/* use mask to compute a randomized ASCII representation */
- tmpByte = (randPool[row * RANDPOOL_DISPLAY_COLUMNS + col] -
+ tmpByte = (randPool[row * RANDPOOL_DISPLAY_COLUMNS + col] -
lastRandPool[row * RANDPOOL_DISPLAY_COLUMNS + col]) ^ maskRandPool [row * RANDPOOL_DISPLAY_COLUMNS + col];
tmp[0] = (wchar_t) (((tmpByte >> 4) % 6) + L'*');
tmp[1] = (wchar_t) (((tmpByte & 0x0F) % 6) + L'*');
@@ -5889,7 +6120,7 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
for (i= 0; i < keyfilesCount; i++)
{
StringCbCopyW(szFileName, sizeof(szFileName), szDirName);
-
+
if (i > 0)
{
StringCbPrintfW(szSuffix, sizeof(szSuffix), L"_%d", i);
@@ -5946,7 +6177,7 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
NormalCursor();
return 1;
}
-
+
/* since keyfilesSize < 1024 * 1024, we mask with 0x000FFFFF */
keyfilesSize = (long) (((unsigned long) keyfilesSize) & 0x000FFFFF);
@@ -5954,7 +6185,7 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
keyfilesSize += 64;
}
- /* Generate the keyfile */
+ /* Generate the keyfile */
if (!RandgetBytesFull (hwndDlg, keyfile, keyfilesSize, TRUE, TRUE))
{
_close (fhKeyfile);
@@ -5962,7 +6193,7 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCfree(keyfile);
NormalCursor();
return 1;
- }
+ }
/* Write the keyfile */
status = _write (fhKeyfile, keyfile, keyfilesSize);
@@ -5975,7 +6206,7 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP
NormalCursor();
handleWin32Error (hwndDlg, SRC_POS);
return 1;
- }
+ }
}
TCfree(keyfile);
@@ -5994,7 +6225,7 @@ exit:
WaitCursor();
KillTimer (hwndDlg, 0xfd);
-#ifndef VOLFORMAT
+#ifndef VOLFORMAT
RandStop (FALSE);
#endif
/* Cleanup */
@@ -6109,7 +6340,7 @@ CipherTestDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
ShowWindow(GetDlgItem(hwndDlg, IDC_TESTS_MESSAGE), SW_SHOWNORMAL);
SetWindowTextW(GetDlgItem(hwndDlg, IDC_TESTS_MESSAGE), GetString ("TESTS_FAILED"));
- }
+ }
else
{
ShowWindow(GetDlgItem(hwndDlg, IDC_TESTS_MESSAGE), SW_SHOWNORMAL);
@@ -6137,7 +6368,7 @@ CipherTestDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (lw == IDOK || lw == IDC_ENCRYPT || lw == IDC_DECRYPT)
{
- char key[128+1], inputtext[128+1], secondaryKey[64+1], dataUnitNo[16+1];
+ CRYPTOPP_ALIGN_DATA(16) char key[128+1], inputtext[128+1], secondaryKey[64+1], dataUnitNo[16+1];
wchar_t szTmp[128+1];
int ks, pt, n, tlen, blockNo = 0;
BOOL bEncrypt;
@@ -6215,7 +6446,7 @@ CipherTestDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
inputtext[n] = (char) x;
}
-
+
// XTS
if (bXTSTestEnabled)
{
@@ -6272,10 +6503,10 @@ CipherTestDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
blockNo = (int) SendMessage (GetDlgItem (hwndDlg, IDC_TEST_BLOCK_NUMBER), CB_GETITEMDATA, SendMessage (GetDlgItem (hwndDlg, IDC_TEST_BLOCK_NUMBER), CB_GETCURSEL, 0, 0), 0);
} // if (bXTSTestEnabled)
-
+
/* Perform the actual tests */
- if (ks != CB_ERR && pt != CB_ERR)
+ if (ks != CB_ERR && pt != CB_ERR)
{
char tmp[128];
int tmpRetVal;
@@ -6372,7 +6603,7 @@ CipherTestDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
-void
+void
ResetCipherTest(HWND hwndDlg, int idTestCipher)
{
int ndx;
@@ -6406,11 +6637,16 @@ ResetCipherTest(HWND hwndDlg, int idTestCipher)
SetWindowText(GetDlgItem(hwndDlg, IDC_SECONDARY_KEY), L"0000000000000000000000000000000000000000000000000000000000000000");
SetWindowText(GetDlgItem(hwndDlg, IDC_TEST_DATA_UNIT_NUMBER), L"0");
-
+
SetWindowText(GetDlgItem(hwndDlg, IDC_PLAINTEXT), L"0000000000000000");
SetWindowText(GetDlgItem(hwndDlg, IDC_CIPHERTEXT), L"0000000000000000");
- if (idTestCipher == AES || idTestCipher == SERPENT || idTestCipher == TWOFISH)
+ if (idTestCipher == AES || idTestCipher == SERPENT || idTestCipher == TWOFISH || idTestCipher == CAMELLIA
+#if defined(CIPHER_GOST89)
+ || idTestCipher == GOST89
+#endif
+ || idTestCipher == KUZNYECHIK
+ )
{
ndx = (int) SendMessage (GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_ADDSTRING, 0,(LPARAM) L"256");
SendMessage(GetDlgItem(hwndDlg, IDC_KEY_SIZE), CB_SETITEMDATA, ndx,(LPARAM) 32);
@@ -6476,7 +6712,7 @@ BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
pStr++;
pwStr++;
- do
+ do
{
if (*pStr != 0)
{
@@ -6490,7 +6726,7 @@ BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
hUserFont),
nLongestButtonCaptionWidth);
- nLongestButtonCaptionCharLen = max (nLongestButtonCaptionCharLen,
+ nLongestButtonCaptionCharLen = max (nLongestButtonCaptionCharLen,
(int) wcslen ((const wchar_t *) (bResolve ? GetString(*pStr) : *pwStr)));
}
@@ -6509,14 +6745,14 @@ BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
// Length of main message in characters (not bytes)
nMainTextLenInChars = (int) wcslen ((const wchar_t *) (bResolve ? GetString(*(pStrOrig+1)) : *(pwStrOrig+1)));
- if (nMainTextLenInChars > 200
+ if (nMainTextLenInChars > 200
&& nMainTextLenInChars / nLongestButtonCaptionCharLen >= 10)
{
- // As the main text is longer than 200 characters, we will "pad" the widest button caption with
- // spaces (if it is not wide enough) so as to increase the width of the whole dialog window.
+ // As the main text is longer than 200 characters, we will "pad" the widest button caption with
+ // spaces (if it is not wide enough) so as to increase the width of the whole dialog window.
// Otherwise, it would look too tall (dialog boxes look better when they are more wide than tall).
nLongestButtonCaptionWidth = CompensateXDPI (max (
- nLongestButtonCaptionWidth,
+ nLongestButtonCaptionWidth,
min (350, nMainTextLenInChars)));
}
@@ -6544,10 +6780,10 @@ BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
do
{
- offset = FindString ((char *) (bResolve ? GetString(*(pStrOrig+1)) : *(pwStrOrig+1)),
+ offset = FindString ((char *) (bResolve ? GetString(*(pStrOrig+1)) : *(pwStrOrig+1)),
(char *) L"\n",
- nMainTextLenInChars * 2,
- (int) wcslen (L"\n") * 2,
+ nMainTextLenInChars * 2,
+ (int) wcslen (L"\n") * 2,
offset + 1);
newLineSeqCount++;
@@ -6568,8 +6804,8 @@ BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
// Reduction in height according to the number of shown buttons
vertSubOffset = ((MAX_MULTI_CHOICES - nActiveChoices) * nBaseButtonHeight);
- if (horizSubOffset > 0
- || vertMsgHeightOffset > 0
+ if (horizSubOffset > 0
+ || vertMsgHeightOffset > 0
|| vertOffset > 0)
{
// Resize/move each button if necessary
@@ -6603,7 +6839,7 @@ BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
trec.right + 2 + horizSubOffset,
trec.bottom + 2,
TRUE);
-
+
GetWindowRect(GetDlgItem(hwndDlg, IDC_MC_DLG_HR2), &rec);
GetClientRect(GetDlgItem(hwndDlg, IDC_MC_DLG_HR2), &trec);
MoveWindow (GetDlgItem(hwndDlg, IDC_MC_DLG_HR2),
@@ -6657,7 +6893,7 @@ BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA
BOOL CheckCapsLock (HWND hwnd, BOOL quiet)
{
- if ((GetKeyState(VK_CAPITAL) & 1) != 0)
+ if ((GetKeyState(VK_CAPITAL) & 1) != 0)
{
if (!quiet)
{
@@ -6686,7 +6922,7 @@ BOOL CheckFileExtension (wchar_t *fileName)
L".vb", L".vbe", L".vbs", L".vsmacros", L".vss", L".vst", L".vsw", L".ws", L".wsc", L".wsf", L".wsh", L".xsd", L".xsl",
// These additional file extensions are usually watched by antivirus programs
L".386", L".acm", L".ade", L".adp", L".ani", L".app", L".asd", L".asf", L".asx", L".awx", L".ax", L".boo", L".bz2", L".cdf",
- L".class", L".dhtm", L".dhtml",L".dlo", L".emf", L".eml", L".flt", L".fot", L".gz", L".hlp", L".htm", L".html", L".ini",
+ L".class", L".dhtm", L".dhtml",L".dlo", L".emf", L".eml", L".flt", L".fot", L".gz", L".hlp", L".htm", L".html", L".ini",
L".j2k", L".jar", L".jff", L".jif", L".jmh", L".jng", L".jp2", L".jpe", L".jpeg", L".jpg", L".lsp", L".mod", L".nws",
L".obj", L".olb", L".osd", L".ov1", L".ov2", L".ov3", L".ovl", L".ovl", L".ovr", L".pdr", L".pgm", L".php", L".pkg",
L".pl", L".png", L".pot", L".pps", L".ppt", L".ps1", L".ps1xml", L".psc1", L".rar", L".rpl", L".rtf", L".sbf", L".script", L".sh", L".sha", L".shtm",
@@ -6858,7 +7094,7 @@ int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced)
memcpy (wszLabel, prop.wszLabel, sizeof (wszLabel));
bDriverSetLabel = prop.bDriverSetLabel;
}
-
+
unmount.nDosDriveNo = nDosDriveNo;
unmount.ignoreOpenFiles = forced;
@@ -6928,11 +7164,11 @@ void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap)
}
}
- dbv.dbcv_size = sizeof (dbv);
- dbv.dbcv_devicetype = DBT_DEVTYP_VOLUME;
+ dbv.dbcv_size = sizeof (dbv);
+ dbv.dbcv_devicetype = DBT_DEVTYP_VOLUME;
dbv.dbcv_reserved = 0;
dbv.dbcv_unitmask = driveMap;
- dbv.dbcv_flags = 0;
+ dbv.dbcv_flags = 0;
UINT timeOut = 1000;
@@ -7032,8 +7268,8 @@ BOOL CALLBACK WaitDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
SetWindowLongPtrW (hProgress, GWL_STYLE, PBS_MARQUEE | GetWindowLongPtrW (hProgress, GWL_STYLE));
::SendMessageW(hProgress, PBM_SETMARQUEE, (WPARAM) TRUE, (LPARAM) 0);
}
-
- thParam->hwnd = hwndDlg;
+
+ thParam->hwnd = hwndDlg;
// For now, we don't have system menu is the resources but we leave this code
// if it is enabled in the future
@@ -7047,8 +7283,8 @@ BOOL CALLBACK WaitDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
HICON hIcon = (HICON)::LoadImage(hInst, MAKEINTRESOURCE(IDI_TRUECRYPT_ICON), IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
::SendMessage(hwndDlg, WM_SETICON, TRUE, (LPARAM)hIcon);
HICON hIconSmall = (HICON)::LoadImage(hInst, MAKEINTRESOURCE(IDI_TRUECRYPT_ICON), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
- ::SendMessage(hwndDlg, WM_SETICON, FALSE, (LPARAM)hIconSmall);
- }
+ ::SendMessage(hwndDlg, WM_SETICON, FALSE, (LPARAM)hIconSmall);
+ }
LocalizeDialog (hwndDlg, NULL);
_beginthread(WaitThread, 0, thParam);
@@ -7076,26 +7312,26 @@ BOOL CALLBACK WaitDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
void BringToForeground(HWND hWnd)
{
if(!::IsWindow(hWnd)) return;
-
+
DWORD lockTimeOut = 0;
HWND hCurrWnd = ::GetForegroundWindow();
DWORD dwThisTID = ::GetCurrentThreadId(),
dwCurrTID = ::GetWindowThreadProcessId(hCurrWnd,0);
-
+
if (hCurrWnd != hWnd)
{
if(dwThisTID != dwCurrTID)
{
::AttachThreadInput(dwThisTID, dwCurrTID, TRUE);
-
+
::SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT,0,&lockTimeOut,0);
::SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,0,SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);
-
+
::AllowSetForegroundWindow(ASFW_ANY);
}
-
+
::SetForegroundWindow(hWnd);
-
+
if(dwThisTID != dwCurrTID)
{
::SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT,0,(PVOID)lockTimeOut,SPIF_SENDWININICHANGE | SPIF_UPDATEINIFILE);
@@ -7168,12 +7404,12 @@ static BOOL PerformMountIoctl (MOUNT_STRUCT* pmount, LPDWORD pdwResult, BOOL use
CreateFullVolumePath (pmount->wszVolume, sizeof(pmount->wszVolume), devicePath.c_str(), &bDevice);
}
}
-
+
return DeviceIoControl (hDriver, TC_IOCTL_MOUNT_VOLUME, pmount,
sizeof (MOUNT_STRUCT), pmount, sizeof (MOUNT_STRUCT), pdwResult, NULL);
}
-// specific definitions and implementation for support of mount operation
+// specific definitions and implementation for support of mount operation
// in wait dialog mechanism
typedef struct
@@ -7306,7 +7542,7 @@ retry:
path = path.substr (4);
StringCchCopyW (volumePath, TC_MAX_PATH, path.c_str());
}
-
+
if (path.find (L"Volume{") == 0 && path.rfind (L"}\\") == path.size() - 2)
{
wstring resolvedPath = VolumeGuidPathToDevicePath (path);
@@ -7318,7 +7554,7 @@ retry:
if ((path.length () >= 3) && (_wcsnicmp (path.c_str(), L"ID:", 3) == 0))
{
std::vector<byte> arr;
- if ( (path.length() == (3 + 2*VOLUME_ID_SIZE))
+ if ( (path.length() == (3 + 2*VOLUME_ID_SIZE))
&& HexWideStringToArray (path.c_str() + 3, arr)
&& (arr.size() == VOLUME_ID_SIZE)
)
@@ -7355,7 +7591,7 @@ retry:
mount.BytesPerSector = bps;
mount.BytesPerPhysicalSector = bps;
}
-
+
if (IsOSAtLeast (WIN_VISTA))
{
if ( (wcslen(root) >= 2)
@@ -7463,7 +7699,7 @@ retry:
goto retry;
}
- // Ask user
+ // Ask user
if (IDYES == AskWarnNoYes ("FILE_IN_USE", hwndDlg))
{
mount.bExclusiveAccess = FALSE;
@@ -7484,12 +7720,12 @@ retry:
{
if (mount.nReturnCode == ERR_PASSWORD_WRONG)
{
- // Do not report wrong password, if not instructed to
+ // Do not report wrong password, if not instructed to
if (bReportWrongPassword)
{
IncreaseWrongPwdRetryCount (1); // We increase the count here only if bReportWrongPassword is TRUE, because "Auto-Mount All Devices" and other callers do it separately
- if (WrongPwdRetryCountOverLimit ()
+ if (WrongPwdRetryCountOverLimit ()
&& !mount.UseBackupHeader)
{
// Retry using embedded header backup (if any)
@@ -7537,7 +7773,7 @@ retry:
if (bReportWrongPassword && !Silent)
Warning ("HEADER_DAMAGED_AUTO_USED_HEADER_BAK", hwndDlg);
}
-
+
LastMountedVolumeDirty = mount.FilesystemDirty;
if (mount.FilesystemDirty)
@@ -9984,6 +10220,18 @@ void Applink (char *dest, BOOL bSendOS, char *extraOutput)
{
StringCbCopyA (url, sizeof (url),"https://veracrypt.codeplex.com/wikipage?title=Twofish");
}
+ else if (strcmp(dest, "gost89") == 0)
+ {
+ StringCbCopyA (url, sizeof (url),"https://veracrypt.codeplex.com/wikipage?title=GOST89");
+ }
+ else if (strcmp(dest, "kuznyechik") == 0)
+ {
+ StringCbCopyA (url, sizeof (url),"https://veracrypt.codeplex.com/wikipage?title=Kuznyechik");
+ }
+ else if (strcmp(dest, "camellia") == 0)
+ {
+ StringCbCopyA (url, sizeof (url),"https://veracrypt.codeplex.com/wikipage?title=Camellia");
+ }
else if (strcmp(dest, "cascades") == 0)
{
StringCbCopyA (url, sizeof (url),"https://veracrypt.codeplex.com/wikipage?title=Cascades");
@@ -10980,15 +11228,27 @@ BOOL InitSecurityTokenLibrary (HWND hwndDlg)
PinRequestHandler(HWND hwnd) : m_hwnd(hwnd) {}
virtual void operator() (string &str)
{
- HWND hParent = IsWindow (m_hwnd)? m_hwnd : GetActiveWindow();
- if (!hParent)
- hParent = GetForegroundWindow ();
- if (DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_TOKEN_PASSWORD), hParent, (DLGPROC) SecurityTokenPasswordDlgProc, (LPARAM) &str) == IDCANCEL)
- throw UserAbort (SRC_POS);
-
+ if (CmdTokenPin[0])
+ {
+ str = CmdTokenPin;
+ }
+ else
+ {
+ HWND hParent = IsWindow (m_hwnd)? m_hwnd : GetActiveWindow();
+ if (!hParent)
+ hParent = GetForegroundWindow ();
+ if (DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_TOKEN_PASSWORD), hParent, (DLGPROC) SecurityTokenPasswordDlgProc, (LPARAM) &str) == IDCANCEL)
+ throw UserAbort (SRC_POS);
+ }
if (hCursor != NULL)
SetCursor (hCursor);
}
+
+ virtual void notifyIncorrectPin ()
+ {
+ // clear wrong PIN
+ burn (&CmdTokenPin, sizeof (CmdTokenPin));
+ }
};
struct WarningHandler : public SendExceptionFunctor
@@ -11888,3 +12148,52 @@ BOOL CopyTextToClipboard (LPCWSTR txtValue)
return bRet;
}
+
+BOOL GetFreeDriveLetter(WCHAR* pCh) {
+ DWORD dwUsedDrives = GetLogicalDrives();
+ WCHAR l;
+ for (l = L'A'; l <= L'Z'; l++) {
+ if ((dwUsedDrives & 1) == 0) {
+ *pCh = l;
+ return TRUE;
+ }
+ dwUsedDrives = dwUsedDrives >> 1;
+ }
+ return FALSE;
+}
+
+BOOL RaisePrivileges(void)
+{
+ HANDLE hToken;
+ TOKEN_PRIVILEGES tkp;
+ BOOL bRet = FALSE;
+ DWORD dwLastError = 0;
+
+ if (OpenProcessToken(GetCurrentProcess(),
+ TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
+ &hToken))
+ {
+ if (LookupPrivilegeValue(NULL, SE_SYSTEM_ENVIRONMENT_NAME,
+ &tkp.Privileges[0].Luid))
+ {
+ DWORD len;
+
+ tkp.PrivilegeCount = 1;
+ tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+
+ bRet = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, &len);
+ if (!bRet)
+ dwLastError = GetLastError ();
+ }
+ else
+ dwLastError = GetLastError ();
+
+ CloseHandle(hToken);
+ }
+ else
+ dwLastError = GetLastError ();
+
+ SetLastError (dwLastError);
+
+ return bRet;
+} \ No newline at end of file
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 9387336e..9ae9d5b2 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -102,6 +102,7 @@ extern char *ConfigBuffer;
extern wchar_t szHelpFile[TC_MAX_PATH];
extern wchar_t szHelpFile2[TC_MAX_PATH];
extern wchar_t SecurityTokenLibraryPath[TC_MAX_PATH];
+extern char CmdTokenPin [TC_MAX_PATH];
extern HFONT hFixedDigitFont;
extern HFONT hBoldFont;
extern HFONT hTitleFont;
@@ -509,6 +510,9 @@ void AllowMessageInUIPI (UINT msg);
BOOL IsRepeatedByteArray (byte value, const byte* buffer, size_t bufferSize);
BOOL TranslateVolumeID (HWND hwndDlg, wchar_t* pathValue, size_t cchPathValue);
BOOL CopyTextToClipboard (const wchar_t* txtValue);
+BOOL LaunchElevatedProcess (HWND hwndDlg, const wchar_t* szModPath, const wchar_t* args);
+BOOL GetFreeDriveLetter(WCHAR* pCh);
+BOOL RaisePrivileges(void);
#ifdef __cplusplus
}
diff --git a/src/Common/EncryptionThreadPool.c b/src/Common/EncryptionThreadPool.c
index d99512a9..f1207113 100644
--- a/src/Common/EncryptionThreadPool.c
+++ b/src/Common/EncryptionThreadPool.c
@@ -182,6 +182,11 @@ static TC_THREAD_PROC EncryptionThreadProc (void *threadArg)
workItem->KeyDerivation.IterationCount, workItem->KeyDerivation.DerivedKey, GetMaxPkcs5OutSize());
break;
+ case STREEBOG:
+ derive_key_streebog(workItem->KeyDerivation.Password, workItem->KeyDerivation.PasswordLength, workItem->KeyDerivation.Salt, PKCS5_SALT_SIZE,
+ workItem->KeyDerivation.IterationCount, workItem->KeyDerivation.DerivedKey, GetMaxPkcs5OutSize());
+ break;
+
default:
TC_THROW_FATAL_EXCEPTION;
}
diff --git a/src/Common/Endian.h b/src/Common/Endian.h
index 00fed048..fd4c901c 100644
--- a/src/Common/Endian.h
+++ b/src/Common/Endian.h
@@ -1,11 +1,11 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -21,7 +21,7 @@ extern "C"
{
#endif
-#ifdef _WIN32
+#if defined(_WIN32) || defined(_UEFI)
# ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN 1234
@@ -110,7 +110,7 @@ extern "C"
( ( unsigned __int32 ) memPtr[ -2 ] << 8 ) | ( unsigned __int32 ) memPtr[ -1 ] )
#define mgetWord(memPtr) \
- ( memPtr += 2, ((( unsigned short ) memPtr[ -2 ] << 8 ) | ( ( unsigned short ) memPtr[ -1 ] )) )
+ ( memPtr += 2, ((( unsigned short ) memPtr[ -2 ] << 8 ) | ( ( unsigned short ) memPtr[ -1 ] )) )
#define mgetByte(memPtr) \
( ( unsigned char ) *memPtr++ )
@@ -139,7 +139,7 @@ unsigned __int16 MirrorBytes16 (unsigned __int16 x);
unsigned __int32 MirrorBytes32 (unsigned __int32 x);
#ifndef TC_NO_COMPILER_INT64
uint64 MirrorBytes64 (uint64 x);
-#endif
+#endif
void LongReverse ( unsigned __int32 *buffer , unsigned byteCount );
#if defined(__cplusplus)
diff --git a/src/Common/Fat.c b/src/Common/Fat.c
index fb7dc1ff..7625e869 100644
--- a/src/Common/Fat.c
+++ b/src/Common/Fat.c
@@ -262,7 +262,7 @@ FormatFat (void* hwndDlgPtr, unsigned __int64 startSector, fatparams * ft, void
unsigned __int64 nSecNo = startSector;
int x, n;
int retVal;
- char temporaryKey[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) char temporaryKey[MASTER_KEYDATA_SIZE];
HWND hwndDlg = (HWND) hwndDlgPtr;
LARGE_INTEGER startOffset;
diff --git a/src/Common/Format.c b/src/Common/Format.c
index f3114e5e..4df27c1e 100644
--- a/src/Common/Format.c
+++ b/src/Common/Format.c
@@ -566,10 +566,63 @@ begin_format:
// Fill reserved header sectors (including the backup header area) with random data
if (!volParams->hiddenVol)
{
- nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, dataAreaSize, FALSE, FALSE);
+ BOOL bUpdateBackup = FALSE;
+
+ nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, dataAreaSize, FALSE, FALSE, FALSE);
if (nStatus != ERR_SUCCESS)
goto error;
+
+ // write fake hidden volume header to protect against attacks that use statistical entropy
+ // analysis to detect presence of hidden volumes.
+
+ while (TRUE)
+ {
+ PCRYPTO_INFO dummyInfo = NULL;
+ LARGE_INTEGER hiddenOffset;
+
+ hiddenOffset.QuadPart = bUpdateBackup ? dataAreaSize + TC_VOLUME_HEADER_GROUP_SIZE + TC_HIDDEN_VOLUME_HEADER_OFFSET: TC_HIDDEN_VOLUME_HEADER_OFFSET;
+
+ nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE,
+ header,
+ volParams->ea,
+ FIRST_MODE_OF_OPERATION_ID,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ &dummyInfo,
+ dataAreaSize,
+ dataAreaSize,
+ dataOffset,
+ dataAreaSize,
+ 0,
+ volParams->headerFlags,
+ FormatSectorSize,
+ FALSE);
+
+ if (nStatus != ERR_SUCCESS)
+ goto error;
+
+ crypto_close (dummyInfo);
+
+ if (!SetFilePointerEx ((HANDLE) dev, hiddenOffset, NULL, FILE_BEGIN))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto error;
+ }
+
+ if (!WriteEffectiveVolumeHeader (volParams->bDevice, dev, header))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto error;
+ }
+
+ if (bUpdateBackup)
+ break;
+
+ bUpdateBackup = TRUE;
+ }
}
#ifndef DEBUG
@@ -700,8 +753,8 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
unsigned __int64 nSecNo = startSector;
int retVal = 0;
DWORD err;
- char temporaryKey[MASTER_KEYDATA_SIZE];
- char originalK2[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) char temporaryKey[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) char originalK2[MASTER_KEYDATA_SIZE];
LARGE_INTEGER startOffset;
LARGE_INTEGER newOffset;
diff --git a/src/Common/Keyfiles.c b/src/Common/Keyfiles.c
index 5ee5bccf..14d415f0 100644
--- a/src/Common/Keyfiles.c
+++ b/src/Common/Keyfiles.c
@@ -238,11 +238,6 @@ close:
BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile, const wchar_t* volumeFileName)
{
- return KeyFilesApplyWithPin (hwndDlg, password, nullptr, firstKeyFile, volumeFileName);
-}
-
-BOOL KeyFilesApplyWithPin (HWND hwndDlg, Password *password, char* pin, KeyFile *firstKeyFile, const wchar_t* volumeFileName)
-{
BOOL status = TRUE;
KeyFile kfSubStruct;
KeyFile *kf;
@@ -271,7 +266,7 @@ BOOL KeyFilesApplyWithPin (HWND hwndDlg, Password *password, char* pin, KeyFile
// Apply security token keyfile
vector <byte> keyfileData;
SecurityTokenKeyfilePath secPath (kf->FileName);
- SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath, pin), pin, keyfileData);
+ SecurityToken::GetKeyfileData (SecurityTokenKeyfile (secPath), keyfileData);
if (keyfileData.empty())
{
diff --git a/src/Common/Keyfiles.h b/src/Common/Keyfiles.h
index c94f1378..a247cbc7 100644
--- a/src/Common/Keyfiles.h
+++ b/src/Common/Keyfiles.h
@@ -40,7 +40,6 @@ void KeyFileRemoveAll (KeyFile **firstKeyFile);
KeyFile *KeyFileClone (KeyFile *keyFile);
void KeyFileCloneAll (KeyFile *firstKeyFile, KeyFile **outputKeyFile);
BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFilem, const wchar_t* volumeFileName);
-BOOL KeyFilesApplyWithPin (HWND hwndDlg, Password *password, char* pin, KeyFile *firstKeyFilem, const wchar_t* volumeFileName);
BOOL CALLBACK KeyFilesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
BOOL KeyfilesPopupMenu (HWND hwndDlg, POINT popupPosition, KeyFilesDlgParam *dialogParam);
diff --git a/src/Common/Language.c b/src/Common/Language.c
index f03a4e54..cb0178d9 100644
--- a/src/Common/Language.c
+++ b/src/Common/Language.c
@@ -361,9 +361,11 @@ BOOL LoadLanguageFile ()
header = headerPtr;
if (header == NULL) return FALSE;
+ header--;
do
{
+ header++;
if (sscanf (header, "#define %127s %d", key, &intKey) == 2)
{
WCHAR *str = GetString (key);
@@ -372,7 +374,7 @@ BOOL LoadLanguageFile ()
AddDictionaryEntry (NULL, intKey, str);
}
- } while ((header = strchr (header, '\n') + 1) != (char *) 1);
+ } while ((header = strchr (header, '\n')) != NULL);
free (headerPtr);
}
diff --git a/src/Common/Language.xml b/src/Common/Language.xml
index 99e260c0..38f2cc49 100644
--- a/src/Common/Language.xml
+++ b/src/Common/Language.xml
@@ -261,7 +261,7 @@
<control lang="en" key="IDM_UNMOUNTALL">Dismount All Mounted Volumes</control>
<control lang="en" key="IDM_UNMOUNT_VOLUME">Dismount Volume</control>
<control lang="en" key="IDM_VERIFY_RESCUE_DISK">Verify Rescue Disk</control>
- <control lang="en" key="IDM_VERIFY_RESCUE_DISK_ISO">Verify Rescue Disk ISO Image</control>
+ <control lang="en" key="IDM_VERIFY_RESCUE_DISK_ISO">Verify Rescue Disk Image</control>
<control lang="en" key="IDM_VERSION_HISTORY">Version History</control>
<control lang="en" key="IDM_VOLUME_EXPANDER">Volume Expander</control>
<control lang="en" key="IDM_VOLUME_PROPERTIES">Volume Properties</control>
@@ -335,7 +335,7 @@
<control lang="en" key="IDC_USE_EMBEDDED_HEADER_BAK">Use backup header embedded in &amp;volume if available</control>
<control lang="en" key="IDC_XTS_MODE_ENABLED">XTS mode</control>
<control lang="en" key="IDD_ABOUT_DLG">About VeraCrypt</control>
- <control lang="en" key="IDD_BENCHMARK_DLG">VeraCrypt - Encryption Algorithm Benchmark</control>
+ <control lang="en" key="IDD_BENCHMARK_DLG">VeraCrypt - Algorithms Benchmark</control>
<control lang="en" key="IDD_CIPHER_TEST_DLG">VeraCrypt - Test Vectors</control>
<control lang="en" key="IDD_COMMANDHELP_DLG">Command Line Help</control>
<control lang="en" key="IDD_KEYFILES">VeraCrypt - Keyfiles</control>
@@ -962,14 +962,14 @@
<string lang="en" key="VOLUME_HAS_NO_BACKUP_HEADER">There is no backup header embedded in this volume (note that only volumes created by VeraCrypt 6.0 or later contain embedded backup headers).</string>
<string lang="en" key="BACKUP_HEADER_NOT_FOR_SYS_DEVICE">You are attempting to back up the header of the system partition/drive. This is not allowed. Backup/restore operations pertaining to the system partition/drive can be performed only using the VeraCrypt Rescue Disk.\n\nDo you want to create a VeraCrypt Rescue Disk?</string>
<string lang="en" key="RESTORE_HEADER_NOT_FOR_SYS_DEVICE">You are attempting to restore the header of a virtual VeraCrypt volume but you selected the system partition/drive. This is not allowed. Backup/restore operations pertaining to the system partition/drive can be performed only using the VeraCrypt Rescue Disk.\n\nDo you want to create a VeraCrypt Rescue Disk?</string>
- <string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_SELECT_PATH">After you click OK, you will select a filename for the new VeraCrypt Rescue Disk ISO image and the location where you wish to place it.</string>
+ <string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_SELECT_PATH">After you click OK, you will select a filename for the new VeraCrypt Rescue Disk image and the location where you wish to place it.</string>
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_BURN">The Rescue Disk image has been created and stored in this file:\n%s\n\nNow you need to burn the Rescue Disk image to a CD or DVD.\n\nIMPORTANT: Note that the file must be written to the CD/DVD as an ISO disk image (not as an individual file). For information on how to do so, please refer to the documentation of your CD/DVD recording software.\n\nAfter you burn the Rescue Disk, select 'System' > 'Verify Rescue Disk' to verify that it has been correctly burned.</string>
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CREATION_WIN_ISOBURN">The Rescue Disk image has been created and stored in this file:\n%s\n\nNow you need to burn the Rescue Disk image to a CD or DVD.\n\nDo you want to launch the Microsoft Windows Disc Image Burner now?\n\nNote: After you burn the Rescue Disk, select 'System' > 'Verify Rescue Disk' to verify that it has been correctly burned.</string>
- <string lang="en" key="RESCUE_DISK_NON_WIZARD_CHECK_INSERT">Please insert your VeraCrypt Rescue Disk into your CD/DVD drive and click OK to verify it.</string>
+ <string lang="en" key="RESCUE_DISK_NON_WIZARD_CHECK_INSERT">Please insert your VeraCrypt Rescue Disk and click OK to verify it.</string>
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CHECK_PASSED">The VeraCrypt Rescue Disk has been successfully verified.</string>
<string lang="en" key="RESCUE_DISK_NON_WIZARD_CHECK_FAILED">Cannot verify that the Rescue Disk has been correctly burned.\n\nIf you have burned the Rescue Disk, please eject and reinsert the CD/DVD; then try again. If this does not help, please try other CD/DVD recording software and/or medium.\n\nIf you attempted to verify a VeraCrypt Rescue Disk created for a different master key, password, salt, etc., please note that such Rescue Disk will always fail this verification. To create a new Rescue Disk fully compatible with your current configuration, select 'System' > 'Create Rescue Disk'.</string>
- <string lang="en" key="RESCUE_DISK_ISO_IMAGE_CHECK_PASSED">The VeraCrypt Rescue Disk ISO image has been successfully verified.</string>
- <string lang="en" key="RESCUE_DISK_ISO_IMAGE_CHECK_FAILED">The Rescue Disk ISO image verification failed.\n\nIf you attempted to verify a VeraCrypt Rescue Disk ISO image created for a different master key, password, salt, etc., please note that such Rescue Disk ISO image will always fail this verification. To create a new Rescue Disk ISO image fully compatible with your current configuration, select 'System' > 'Create Rescue Disk'.</string>
+ <string lang="en" key="RESCUE_DISK_ISO_IMAGE_CHECK_PASSED">The VeraCrypt Rescue Disk image has been successfully verified.</string>
+ <string lang="en" key="RESCUE_DISK_ISO_IMAGE_CHECK_FAILED">The Rescue Disk image verification failed.\n\nIf you attempted to verify a VeraCrypt Rescue Disk image created for a different master key, password, salt, etc., please note that such Rescue Disk image will always fail this verification. To create a new Rescue Disk image fully compatible with your current configuration, select 'System' > 'Create Rescue Disk'.</string>
<string lang="en" key="ERROR_CREATING_RESCUE_DISK">Error creating VeraCrypt Rescue Disk.</string>
<string lang="en" key="CANNOT_CREATE_RESCUE_DISK_ON_HIDDEN_OS">VeraCrypt Rescue Disk cannot be created when a hidden operating system is running.\n\nTo create a VeraCrypt Rescue Disk, boot the decoy operating system and then select 'System' > 'Create Rescue Disk'.</string>
<string lang="en" key="RESCUE_DISK_CHECK_FAILED">Cannot verify that the Rescue Disk has been correctly burned.\n\nIf you have burned the Rescue Disk, please eject and reinsert the CD/DVD; then click Next to try again. If this does not help, please try another medium%s.\n\nIf you have not burned the Rescue Disk yet, please do so, and then click Next.\n\nIf you attempted to verify a VeraCrypt Rescue Disk created before you started this wizard, please note that such Rescue Disk cannot be used, because it was created for a different master key. You need to burn the newly generated Rescue Disk.</string>
@@ -1077,7 +1077,7 @@
<string lang="en" key="SYS_ENCRYPTION_UPGRADE_UNSUPPORTED_ON_VISTA_SP0">VeraCrypt no longer supports encryption of the system partition/drive on Windows Vista with no Service Pack installed. Before upgrading VeraCrypt, please install Service Pack 1 or higher for Windows Vista.</string>
<string lang="en" key="FEATURE_REQUIRES_INSTALLATION">Error: This feature requires VeraCrypt to be installed on the system (you are running VeraCrypt in portable mode).\n\nPlease install VeraCrypt and then try again.</string>
<string lang="en" key="WINDOWS_NOT_ON_BOOT_DRIVE_ERROR">WARNING: Windows does not appear to be installed on the drive from which it boots. This is not supported.\n\nYou should continue only if you are sure that Windows is installed on the drive from which it boots.\n\nDo you want to continue?</string>
- <string lang="en" key="GPT_BOOT_DRIVE_UNSUPPORTED">Your system drive has a GUID partition table (GPT). Currently, only drives with a MBR partition table are supported.</string>
+ <string lang="en" key="GPT_BOOT_DRIVE_UNSUPPORTED">You are running a 32-bit Windows and your system drive has a GUID partition table (GPT). Currently, only Windows 64-bit is supported for GPT system encryption.</string>
<string lang="en" key="TC_BOOT_LOADER_ALREADY_INSTALLED">CAUTION: The VeraCrypt Boot Loader is already installed on your system drive!\n\nIt is possible that another system on your computer is already encrypted.\n\nWARNING: PROCEEDING WITH ENCRYPTION OF THE CURRENTLY RUNNING SYSTEM MAY MAKE OTHER SYSTEM(S) IMPOSSIBLE TO START AND RELATED DATA INACCESSIBLE.\n\nAre you sure you want to continue?</string>
<string lang="en" key="SYS_LOADER_RESTORE_FAILED">Failed to restore the original system loader.\n\nPlease use your VeraCrypt Rescue Disk ('Repair Options' > 'Restore original system loader') or Windows installation medium to replace the VeraCrypt Boot Loader with the Windows system loader.</string>
<string lang="en" key="SYS_LOADER_UNAVAILABLE_FOR_RESCUE_DISK">The original system loader will not be stored on the Rescue Disk (probable cause: missing backup file).</string>
@@ -1399,6 +1399,20 @@
<string lang="en" key="PIM_TOO_BIG">Personal Iterations Multiplier (PIM) maximum value is 2147468.</string>
<control lang="en" key="IDC_SKIP_RESCUE_VERIFICATION">Skip Rescue Disk verification</control>
<control lang="en" key="IDC_HIDE_WAITING_DIALOG">Don't show wait message dialog when performing operations</control>
+ <control lang="en" key="IDC_DISABLE_BOOT_LOADER_HASH_PROMPT">Do not request Hash algorithm in the pre-boot authentication screen</control>
+ <string lang="en" key="GOST89_HELP">The GOST block cipher, defined in the standard GOST 28147-89 under name Magma, is a Soviet and Russian government standard symmetric key block cipher.\n\nDeveloped in the 1970s, the standard had been marked "Top Secret" and then downgraded to "Secret" in 1990. It was a Soviet alternative to the United States standard algorithm, DES.</string>
+ <string lang="en" key="KUZNYECHIK_HELP">Kuznyechik is a block cipher first published in 2015 and defined in the National Standard of the Russian Federation GOST R 34.12-2015 and also in RFC 7801. 256-bit key, 128-bit block. Mode of operation is XTS.</string>
+ <string lang="en" key="CAMELLIA_HELP">Jointly developed by Mitsubishi Electric and NTT of Japan. First published on 2000. 256-bit key, 128-bit block. Mode of operation is XTS. It has been approved for use by the ISO/IEC, the European Union's NESSIE project and the Japanese CRYPTREC project.</string>
+ <string lang="en" key="TIME">Time</string>
+ <string lang="en" key="ITERATIONS">Iterations</string>
+ <string lang="en" key="PRE-BOOT">Pre-Boot</string>
+ <string lang="en" key="RESCUE_DISK_EFI_INFO">Before you can encrypt the partition, you must create a VeraCrypt Rescue Disk (VRD), which serves the following purposes:\n\n- If the VeraCrypt Boot Loader, master key, or other critical data gets damaged, the VRD allows you to restore it (note, however, that you will still have to enter the correct password then).\n\n- If Windows gets damaged and cannot start, the VRD allows you to permanently decrypt the partition before Windows starts.\n\n- The VRD will contain a backup of the present EFI boot loader and will allow you to restore it if necessary.\n\nThe VeraCrypt Rescue Disk ZIP image will be created in the location specified below.</string>
+ <string lang="en" key="RESCUE_DISK_EFI_EXTRACT_INFO">The Rescue Disk ZIP image has been created and stored in this file:\n%s\n\nNow you need to extract it to a USB stick that is formatted as FAT/FAT32.\n\n%lsAfter you create the Rescue Disk, click Next to verify that it has been correctly created.</string>
+ <string lang="en" key="RESCUE_DISK_EFI_EXTRACT_INFO_NO_CHECK">The Rescue Disk ZIP image has been created and stored in this file:\n%s\n\nNow you should either extract the image to a USB stick that is formatted as FAT/FAT32 or move it to a safe location for later use.\n\n%lsClick Next to continue.</string>
+ <string lang="en" key="RESCUE_DISK_EFI_EXTRACT_INFO_NOTE">IMPORTANT: Note that the zip file must be extracted directly to the root of the USB stick. For example, if the drive letter of the USB stick is E: then extracting the zip file should create a folder E:\\EFI on the USB stick.\n\n</string>
+ <string lang="en" key="RESCUE_DISK_EFI_CHECK_FAILED">Cannot verify that the Rescue Disk has been correctly extracted.\n\nIf you have extracted the Rescue Disk, please eject and reinsert the USB stick; then click Next to try again. If this does not help, please try another USB stick and/or another ZIP software.\n\nIf you have not extracted the Rescue Disk yet, please do so, and then click Next.\n\nIf you attempted to verify a VeraCrypt Rescue Disk created before you started this wizard, please note that such Rescue Disk cannot be used, because it was created for a different master key. You need to extract the newly generated Rescue Disk ZIP image.</string>
+ <string lang="en" key="RESCUE_DISK_EFI_NON_WIZARD_CHECK_FAILED">Cannot verify that the Rescue Disk has been correctly extracted.\n\nIf you have extracted the Rescue Disk image to a USB stick, please eject it and reinsert it; then try again. If this does not help, please try other ZIP software and/or medium.\n\nIf you attempted to verify a VeraCrypt Rescue Disk created for a different master key, password, salt, etc., please note that such Rescue Disk will always fail this verification. To create a new Rescue Disk fully compatible with your current configuration, select 'System' > 'Create Rescue Disk'.</string>
+ <string lang="en" key="RESCUE_DISK_EFI_NON_WIZARD_CREATION">The Rescue Disk image has been created and stored in this file:\n%s\n\nNow you need to extract the Rescue Disk image to a USB stick that is formatted as FAT/FAT32.\n\nIMPORTANT: Note that the zip file must be extracted directly to the root of the USB stick. For example, if the drive letter of the USB stick is E: then extracting the zip file should create a folder E:\\EFI on the USB stick.\n\nAfter you create the Rescue Disk, select 'System' > 'Verify Rescue Disk' to verify that it has been correctly created.</string>
</localization>
<!-- XML Schema -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
diff --git a/src/Common/Password.c b/src/Common/Password.c
index 2c9e77c3..b0f44384 100644
--- a/src/Common/Password.c
+++ b/src/Common/Password.c
@@ -437,9 +437,51 @@ int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5,
&& (cryptoInfo->HeaderFlags & TC_HEADER_FLAG_NONSYS_INPLACE_ENC) != 0
&& (cryptoInfo->HeaderFlags & ~TC_HEADER_FLAG_NONSYS_INPLACE_ENC) == 0)
{
- nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, cryptoInfo->VolumeSize.Value, !backupHeader, backupHeader);
+ PCRYPTO_INFO dummyInfo = NULL;
+ LARGE_INTEGER hiddenOffset;
+
+ nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, cryptoInfo->VolumeSize.Value, !backupHeader, backupHeader, FALSE);
+ if (nStatus != ERR_SUCCESS)
+ goto error;
+
+ // write fake hidden volume header to protect against attacks that use statistical entropy
+ // analysis to detect presence of hidden volumes
+ hiddenOffset.QuadPart = backupHeader ? cryptoInfo->VolumeSize.Value + TC_VOLUME_HEADER_GROUP_SIZE + TC_HIDDEN_VOLUME_HEADER_OFFSET: TC_HIDDEN_VOLUME_HEADER_OFFSET;
+
+ nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE,
+ buffer,
+ cryptoInfo->ea,
+ cryptoInfo->mode,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ &dummyInfo,
+ cryptoInfo->VolumeSize.Value,
+ cryptoInfo->VolumeSize.Value,
+ cryptoInfo->EncryptedAreaStart.Value,
+ cryptoInfo->EncryptedAreaLength.Value,
+ truecryptMode? 0 : cryptoInfo->RequiredProgramVersion,
+ cryptoInfo->HeaderFlags,
+ cryptoInfo->SectorSize,
+ wipePass < wipePassCount - 1);
+
if (nStatus != ERR_SUCCESS)
goto error;
+
+ crypto_close (dummyInfo);
+
+ if (!SetFilePointerEx ((HANDLE) dev, hiddenOffset, NULL, FILE_BEGIN))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto error;
+ }
+
+ if (!WriteEffectiveVolumeHeader (bDevice, dev, buffer))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto error;
+ }
}
FlushFileBuffers (dev);
diff --git a/src/Common/Password.h b/src/Common/Password.h
index 8818804e..9ef2f035 100644
--- a/src/Common/Password.h
+++ b/src/Common/Password.h
@@ -1,11 +1,11 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -36,14 +36,14 @@ typedef struct
char Pad[3]; // keep 64-bit alignment
} Password;
-#if defined(_WIN32) && !defined(TC_WINDOWS_DRIVER)
+#if defined(_WIN32) && !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI)
void VerifyPasswordAndUpdate ( HWND hwndDlg , HWND hButton , HWND hPassword , HWND hVerify , unsigned char *szPassword , char *szVerify, BOOL keyFilesEnabled );
-BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim, BOOL bForBoot, BOOL bSkipPasswordWarning, BOOL bSkipPimWarning);
-BOOL CheckPasswordCharEncoding (HWND hPassword, Password *ptrPw);
+BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim, BOOL bForBoot, BOOL bSkipPasswordWarning, BOOL bSkipPimWarning);
+BOOL CheckPasswordCharEncoding (HWND hPassword, Password *ptrPw);
int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg);
-#endif // defined(_WIN32) && !defined(TC_WINDOWS_DRIVER)
+#endif // defined(_WIN32) && !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI)
#ifdef __cplusplus
}
diff --git a/src/Common/Pkcs5.c b/src/Common/Pkcs5.c
index 8bc828ef..3dbfd322 100644
--- a/src/Common/Pkcs5.c
+++ b/src/Common/Pkcs5.c
@@ -1,24 +1,26 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages. */
#include "Tcdefs.h"
-
+#if !defined(_UEFI)
#include <memory.h>
#include <stdlib.h>
+#endif
#include "Rmd160.h"
#ifndef TC_WINDOWS_BOOT
#include "Sha2.h"
#include "Whirlpool.h"
+#include "cpu.h"
#include "misc.h"
#else
#pragma optimize ("t", on)
@@ -150,7 +152,7 @@ static void derive_u_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, u
char* k = hmac->k;
char* u = hmac->u;
uint32 c;
- int i;
+ int i;
#ifdef TC_WINDOWS_BOOT
/* In bootloader mode, least significant bit of iterations is a boolean (TRUE for boot derivation mode, FALSE otherwise)
@@ -169,7 +171,7 @@ static void derive_u_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, u
/* iteration 1 */
memcpy (k, salt, salt_len); /* salt */
-
+
/* big-endian block number */
memset (&k[salt_len], 0, 3);
k[salt_len + 3] = (char) b;
@@ -191,7 +193,7 @@ static void derive_u_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, u
void derive_key_sha256 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen)
-{
+{
hmac_sha256_ctx hmac;
sha256_ctx* ctx;
char* buf = hmac.k;
@@ -315,7 +317,7 @@ void hmac_sha512
char *k, /* secret key */
int lk, /* length of the key in bytes */
char *d, /* data and also output buffer of at least 64 bytes */
- int ld /* length of data in bytes */
+ int ld /* length of data in bytes */
)
{
hmac_sha512_ctx hmac;
@@ -521,7 +523,7 @@ void hmac_ripemd160 (char *key, int keylen, char *input_digest, int len)
/* If the key is longer than the hash algorithm block size,
let key = ripemd160(key), as per HMAC specifications. */
- if (keylen > RIPEMD160_BLOCKSIZE)
+ if (keylen > RIPEMD160_BLOCKSIZE)
{
RMD160_CTX tctx;
@@ -533,14 +535,14 @@ void hmac_ripemd160 (char *key, int keylen, char *input_digest, int len)
keylen = RIPEMD160_DIGESTSIZE;
burn (&tctx, sizeof(tctx)); // Prevent leaks
- }
+ }
/* perform inner RIPEMD-160 */
ctx = &(hmac.inner_digest_ctx);
/* start out by storing key in pads */
memset(k_pad, 0x36, 64);
/* XOR key with ipad and opad values */
- for (i=0; i<keylen; i++)
+ for (i=0; i<keylen; i++)
{
k_pad[i] ^= key[i];
}
@@ -551,7 +553,7 @@ void hmac_ripemd160 (char *key, int keylen, char *input_digest, int len)
/* perform outer RIPEMD-160 */
ctx = &(hmac.outer_digest_ctx);
memset(k_pad, 0x5c, 64);
- for (i=0; i<keylen; i++)
+ for (i=0; i<keylen; i++)
{
k_pad[i] ^= key[i];
}
@@ -591,7 +593,7 @@ static void derive_u_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len
/* iteration 1 */
memcpy (k, salt, salt_len); /* salt */
-
+
/* big-endian block number */
memset (&k[salt_len], 0, 3);
k[salt_len + 3] = (char) b;
@@ -612,7 +614,7 @@ static void derive_u_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len
}
void derive_key_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen)
-{
+{
int b, l, r;
hmac_ripemd160_ctx hmac;
RMD160_CTX* ctx;
@@ -621,7 +623,7 @@ void derive_key_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len, uin
unsigned char tk[RIPEMD160_DIGESTSIZE];
/* If the password is longer than the hash algorithm block size,
let password = ripemd160(password), as per HMAC specifications. */
- if (pwd_len > RIPEMD160_BLOCKSIZE)
+ if (pwd_len > RIPEMD160_BLOCKSIZE)
{
RMD160_CTX tctx;
@@ -652,7 +654,7 @@ void derive_key_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len, uin
/* start out by storing key in pads */
memset(k_pad, 0x36, 64);
/* XOR key with ipad and opad values */
- for (b=0; b<pwd_len; b++)
+ for (b=0; b<pwd_len; b++)
{
k_pad[b] ^= pwd[b];
}
@@ -663,7 +665,7 @@ void derive_key_ripemd160 (char *pwd, int pwd_len, char *salt, int salt_len, uin
/* perform outer RIPEMD-160 */
ctx = &(hmac.outer_digest_ctx);
memset(k_pad, 0x5c, 64);
- for (b=0; b<pwd_len; b++)
+ for (b=0; b<pwd_len; b++)
{
k_pad[b] ^= pwd[b];
}
@@ -718,7 +720,7 @@ void hmac_whirlpool_internal
memcpy (ctx, &(hmac->inner_digest_ctx), sizeof (WHIRLPOOL_CTX));
- WHIRLPOOL_add ((unsigned char *) d, ld * 8, ctx);
+ WHIRLPOOL_add ((unsigned char *) d, ld, ctx);
WHIRLPOOL_finalize (ctx, (unsigned char *) d);
@@ -726,7 +728,7 @@ void hmac_whirlpool_internal
memcpy (ctx, &(hmac->outer_digest_ctx), sizeof (WHIRLPOOL_CTX));
- WHIRLPOOL_add ((unsigned char *) d, WHIRLPOOL_DIGESTSIZE * 8, ctx);
+ WHIRLPOOL_add ((unsigned char *) d, WHIRLPOOL_DIGESTSIZE, ctx);
WHIRLPOOL_finalize (ctx, (unsigned char *) d);
}
@@ -744,6 +746,12 @@ void hmac_whirlpool
char* buf = hmac.k;
int b;
char key[WHIRLPOOL_DIGESTSIZE];
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ NTSTATUS saveStatus = STATUS_SUCCESS;
+ if (HasISSE())
+ saveStatus = KeSaveFloatingPointState (&floatingPointState);
+#endif
/* If the key is longer than the hash algorithm block size,
let key = whirlpool(key), as per HMAC specifications. */
if (lk > WHIRLPOOL_BLOCKSIZE)
@@ -751,7 +759,7 @@ void hmac_whirlpool
WHIRLPOOL_CTX tctx;
WHIRLPOOL_init (&tctx);
- WHIRLPOOL_add ((unsigned char *) k, lk * 8, &tctx);
+ WHIRLPOOL_add ((unsigned char *) k, lk, &tctx);
WHIRLPOOL_finalize (&tctx, (unsigned char *) key);
k = key;
@@ -770,7 +778,7 @@ void hmac_whirlpool
buf[b] = (char) (k[b] ^ 0x36);
memset (&buf[lk], 0x36, WHIRLPOOL_BLOCKSIZE - lk);
- WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE * 8, ctx);
+ WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE, ctx);
/**** Precompute HMAC Outer Digest ****/
@@ -781,9 +789,14 @@ void hmac_whirlpool
buf[b] = (char) (k[b] ^ 0x5C);
memset (&buf[lk], 0x5C, WHIRLPOOL_BLOCKSIZE - lk);
- WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE * 8, ctx);
+ WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE, ctx);
hmac_whirlpool_internal(k, lk, d, ld, &hmac);
+
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ if (NT_SUCCESS (saveStatus) && HasISSE())
+ KeRestoreFloatingPointState (&floatingPointState);
+#endif
/* Prevent leaks */
burn(&hmac, sizeof(hmac));
}
@@ -797,7 +810,7 @@ static void derive_u_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len
/* iteration 1 */
memcpy (k, salt, salt_len); /* salt */
/* big-endian block number */
- memset (&k[salt_len], 0, 3);
+ memset (&k[salt_len], 0, 3);
k[salt_len + 3] = (char) b;
hmac_whirlpool_internal (pwd, pwd_len, k, salt_len + 4, hmac);
@@ -821,6 +834,12 @@ void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uin
char* buf = hmac.k;
char key[WHIRLPOOL_DIGESTSIZE];
int b, l, r;
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ NTSTATUS saveStatus = STATUS_SUCCESS;
+ if (HasISSE())
+ saveStatus = KeSaveFloatingPointState (&floatingPointState);
+#endif
/* If the password is longer than the hash algorithm block size,
let pwd = whirlpool(pwd), as per HMAC specifications. */
if (pwd_len > WHIRLPOOL_BLOCKSIZE)
@@ -828,7 +847,7 @@ void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uin
WHIRLPOOL_CTX tctx;
WHIRLPOOL_init (&tctx);
- WHIRLPOOL_add ((unsigned char *) pwd, pwd_len * 8, &tctx);
+ WHIRLPOOL_add ((unsigned char *) pwd, pwd_len, &tctx);
WHIRLPOOL_finalize (&tctx, (unsigned char *) key);
pwd = key;
@@ -858,7 +877,7 @@ void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uin
buf[b] = (char) (pwd[b] ^ 0x36);
memset (&buf[pwd_len], 0x36, WHIRLPOOL_BLOCKSIZE - pwd_len);
- WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE * 8, ctx);
+ WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE, ctx);
/**** Precompute HMAC Outer Digest ****/
@@ -869,7 +888,7 @@ void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uin
buf[b] = (char) (pwd[b] ^ 0x5C);
memset (&buf[pwd_len], 0x5C, WHIRLPOOL_BLOCKSIZE - pwd_len);
- WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE * 8, ctx);
+ WHIRLPOOL_add ((unsigned char *) buf, WHIRLPOOL_BLOCKSIZE, ctx);
/* first l - 1 blocks */
for (b = 1; b < l; b++)
@@ -883,6 +902,10 @@ void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uin
derive_u_whirlpool (pwd, pwd_len, salt, salt_len, iterations, b, &hmac);
memcpy (dk, hmac.u, r);
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ if (NT_SUCCESS (saveStatus) && HasISSE())
+ KeRestoreFloatingPointState (&floatingPointState);
+#endif
/* Prevent possible leaks. */
burn (&hmac, sizeof(hmac));
@@ -890,23 +913,242 @@ void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uin
}
+typedef struct hmac_streebog_ctx_struct
+{
+ STREEBOG_CTX ctx;
+ STREEBOG_CTX inner_digest_ctx; /*pre-computed inner digest context */
+ STREEBOG_CTX outer_digest_ctx; /*pre-computed outer digest context */
+ CRYPTOPP_ALIGN_DATA(16) char k[PKCS5_SALT_SIZE + 4]; /* enough to hold (salt_len + 4) and also the Streebog hash */
+ char u[STREEBOG_DIGESTSIZE];
+} hmac_streebog_ctx;
+
+void hmac_streebog_internal
+(
+ char *k, /* secret key */
+ int lk, /* length of the key in bytes */
+ char *d, /* input/output data. d pointer is guaranteed to be at least 64-bytes long */
+ int ld, /* length of input data in bytes */
+ hmac_streebog_ctx* hmac /* HMAC-Whirlpool context which holds temporary variables */
+)
+{
+ STREEBOG_CTX* ctx = &(hmac->ctx);
+
+ /**** Restore Precomputed Inner Digest Context ****/
+
+ memcpy (ctx, &(hmac->inner_digest_ctx), sizeof (STREEBOG_CTX));
+
+ STREEBOG_add (ctx, (unsigned char *) d, ld);
+
+ STREEBOG_finalize (ctx, (unsigned char *) d);
+
+ /**** Restore Precomputed Outer Digest Context ****/
+
+ memcpy (ctx, &(hmac->outer_digest_ctx), sizeof (STREEBOG_CTX));
+
+ STREEBOG_add (ctx, (unsigned char *) d, STREEBOG_DIGESTSIZE);
+
+ STREEBOG_finalize (ctx, (unsigned char *) d);
+}
+
+void hmac_streebog
+(
+ char *k, /* secret key */
+ int lk, /* length of the key in bytes */
+ char *d, /* input data. d pointer is guaranteed to be at least 32-bytes long */
+ int ld /* length of data in bytes */
+)
+{
+ hmac_streebog_ctx hmac;
+ STREEBOG_CTX* ctx;
+ char* buf = hmac.k;
+ int b;
+ CRYPTOPP_ALIGN_DATA(16) char key[STREEBOG_DIGESTSIZE];
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ NTSTATUS saveStatus = STATUS_SUCCESS;
+ if (HasSSE2() || HasSSE41())
+ saveStatus = KeSaveFloatingPointState (&floatingPointState);
+#endif
+ /* If the key is longer than the hash algorithm block size,
+ let key = streebog(key), as per HMAC specifications. */
+ if (lk > STREEBOG_BLOCKSIZE)
+ {
+ STREEBOG_CTX tctx;
+
+ STREEBOG_init (&tctx);
+ STREEBOG_add (&tctx, (unsigned char *) k, lk);
+ STREEBOG_finalize (&tctx, (unsigned char *) key);
+
+ k = key;
+ lk = STREEBOG_DIGESTSIZE;
+
+ burn (&tctx, sizeof(tctx)); // Prevent leaks
+ }
+
+ /**** Precompute HMAC Inner Digest ****/
+
+ ctx = &(hmac.inner_digest_ctx);
+ STREEBOG_init (ctx);
+
+ /* Pad the key for inner digest */
+ for (b = 0; b < lk; ++b)
+ buf[b] = (char) (k[b] ^ 0x36);
+ memset (&buf[lk], 0x36, STREEBOG_BLOCKSIZE - lk);
+
+ STREEBOG_add (ctx, (unsigned char *) buf, STREEBOG_BLOCKSIZE);
+
+ /**** Precompute HMAC Outer Digest ****/
+
+ ctx = &(hmac.outer_digest_ctx);
+ STREEBOG_init (ctx);
+
+ for (b = 0; b < lk; ++b)
+ buf[b] = (char) (k[b] ^ 0x5C);
+ memset (&buf[lk], 0x5C, STREEBOG_BLOCKSIZE - lk);
+
+ STREEBOG_add (ctx, (unsigned char *) buf, STREEBOG_BLOCKSIZE);
+
+ hmac_streebog_internal(k, lk, d, ld, &hmac);
+
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ if (NT_SUCCESS (saveStatus) && (HasSSE2() || HasSSE41()))
+ KeRestoreFloatingPointState (&floatingPointState);
+#endif
+ /* Prevent leaks */
+ burn(&hmac, sizeof(hmac));
+}
+
+static void derive_u_streebog (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, int b, hmac_streebog_ctx* hmac)
+{
+ char* u = hmac->u;
+ char* k = hmac->k;
+ uint32 c, i;
+
+ /* iteration 1 */
+ memcpy (k, salt, salt_len); /* salt */
+ /* big-endian block number */
+ memset (&k[salt_len], 0, 3);
+ k[salt_len + 3] = (char) b;
+
+ hmac_streebog_internal (pwd, pwd_len, k, salt_len + 4, hmac);
+ memcpy (u, k, STREEBOG_DIGESTSIZE);
+
+ /* remaining iterations */
+ for (c = 1; c < iterations; c++)
+ {
+ hmac_streebog_internal (pwd, pwd_len, k, STREEBOG_DIGESTSIZE, hmac);
+ for (i = 0; i < STREEBOG_DIGESTSIZE; i++)
+ {
+ u[i] ^= k[i];
+ }
+ }
+}
+
+void derive_key_streebog (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen)
+{
+ hmac_streebog_ctx hmac;
+ STREEBOG_CTX* ctx;
+ char* buf = hmac.k;
+ char key[STREEBOG_DIGESTSIZE];
+ int b, l, r;
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ NTSTATUS saveStatus = STATUS_SUCCESS;
+ if (HasSSE2() || HasSSE41())
+ saveStatus = KeSaveFloatingPointState (&floatingPointState);
+#endif
+ /* If the password is longer than the hash algorithm block size,
+ let pwd = streebog(pwd), as per HMAC specifications. */
+ if (pwd_len > STREEBOG_BLOCKSIZE)
+ {
+ STREEBOG_CTX tctx;
+
+ STREEBOG_init (&tctx);
+ STREEBOG_add (&tctx, (unsigned char *) pwd, pwd_len);
+ STREEBOG_finalize (&tctx, (unsigned char *) key);
+
+ pwd = key;
+ pwd_len = STREEBOG_DIGESTSIZE;
+
+ burn (&tctx, sizeof(tctx)); // Prevent leaks
+ }
+
+ if (dklen % STREEBOG_DIGESTSIZE)
+ {
+ l = 1 + dklen / STREEBOG_DIGESTSIZE;
+ }
+ else
+ {
+ l = dklen / STREEBOG_DIGESTSIZE;
+ }
+
+ r = dklen - (l - 1) * STREEBOG_DIGESTSIZE;
+
+ /**** Precompute HMAC Inner Digest ****/
+
+ ctx = &(hmac.inner_digest_ctx);
+ STREEBOG_init (ctx);
+
+ /* Pad the key for inner digest */
+ for (b = 0; b < pwd_len; ++b)
+ buf[b] = (char) (pwd[b] ^ 0x36);
+ memset (&buf[pwd_len], 0x36, STREEBOG_BLOCKSIZE - pwd_len);
+
+ STREEBOG_add (ctx, (unsigned char *) buf, STREEBOG_BLOCKSIZE);
+
+ /**** Precompute HMAC Outer Digest ****/
+
+ ctx = &(hmac.outer_digest_ctx);
+ STREEBOG_init (ctx);
+
+ for (b = 0; b < pwd_len; ++b)
+ buf[b] = (char) (pwd[b] ^ 0x5C);
+ memset (&buf[pwd_len], 0x5C, STREEBOG_BLOCKSIZE - pwd_len);
+
+ STREEBOG_add (ctx, (unsigned char *) buf, STREEBOG_BLOCKSIZE);
+
+ /* first l - 1 blocks */
+ for (b = 1; b < l; b++)
+ {
+ derive_u_streebog (pwd, pwd_len, salt, salt_len, iterations, b, &hmac);
+ memcpy (dk, hmac.u, STREEBOG_DIGESTSIZE);
+ dk += STREEBOG_DIGESTSIZE;
+ }
+
+ /* last block */
+ derive_u_streebog (pwd, pwd_len, salt, salt_len, iterations, b, &hmac);
+ memcpy (dk, hmac.u, r);
+
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ if (NT_SUCCESS (saveStatus) && (HasSSE2() || HasSSE41()))
+ KeRestoreFloatingPointState (&floatingPointState);
+#endif
+
+ /* Prevent possible leaks. */
+ burn (&hmac, sizeof(hmac));
+ burn (key, sizeof(key));
+}
+
wchar_t *get_pkcs5_prf_name (int pkcs5_prf_id)
{
switch (pkcs5_prf_id)
{
- case SHA512:
+ case SHA512:
return L"HMAC-SHA-512";
- case SHA256:
+ case SHA256:
return L"HMAC-SHA-256";
- case RIPEMD160:
+ case RIPEMD160:
return L"HMAC-RIPEMD-160";
- case WHIRLPOOL:
+ case WHIRLPOOL:
return L"HMAC-Whirlpool";
- default:
+ case STREEBOG:
+ return L"HMAC-STREEBOG";
+
+ default:
return L"(Unknown)";
}
}
@@ -925,7 +1167,7 @@ int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL truecryptMode, BO
switch (pkcs5_prf_id)
{
- case RIPEMD160:
+ case RIPEMD160:
if (truecryptMode)
return bBoot ? 1000 : 2000;
else if (pim == 0)
@@ -935,10 +1177,10 @@ int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL truecryptMode, BO
return bBoot? pim * 2048 : 15000 + pim * 1000;
}
- case SHA512:
+ case SHA512:
return truecryptMode? 1000 : ((pim == 0)? 500000 : 15000 + pim * 1000);
- case WHIRLPOOL:
+ case WHIRLPOOL:
return truecryptMode? 1000 : ((pim == 0)? 500000 : 15000 + pim * 1000);
case SHA256:
@@ -951,7 +1193,17 @@ int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL truecryptMode, BO
return bBoot? pim * 2048 : 15000 + pim * 1000;
}
- default:
+ case STREEBOG:
+ if (truecryptMode)
+ return 1000;
+ else if (pim == 0)
+ return bBoot? 200000 : 500000;
+ else
+ {
+ return bBoot? pim * 2048 : 15000 + pim * 1000;
+ }
+
+ default:
TC_THROW_FATAL_EXCEPTION; // Unknown/wrong ID
}
return 0;
diff --git a/src/Common/Pkcs5.h b/src/Common/Pkcs5.h
index 81d9de64..261df85d 100644
--- a/src/Common/Pkcs5.h
+++ b/src/Common/Pkcs5.h
@@ -37,6 +37,9 @@ void derive_key_sha512 (char *pwd, int pwd_len, char *salt, int salt_len, uint32
void hmac_whirlpool (char *k, int lk, char *d, int ld);
void derive_key_whirlpool (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
+void hmac_streebog (char *k, int32 lk, char *d, int32 ld);
+void derive_key_streebog (char *pwd, int pwd_len, char *salt, int salt_len, uint32 iterations, char *dk, int dklen);
+
int get_pkcs5_iteration_count (int pkcs5_prf_id, int pim, BOOL truecryptMode, BOOL bBoot);
wchar_t *get_pkcs5_prf_name (int pkcs5_prf_id);
#endif
diff --git a/src/Common/Random.c b/src/Common/Random.c
index 32b38e44..edc6acca 100644
--- a/src/Common/Random.c
+++ b/src/Common/Random.c
@@ -247,6 +247,7 @@ BOOL Randmix ()
RMD160_CTX rctx;
sha512_ctx sctx;
sha256_ctx s256ctx;
+ STREEBOG_CTX stctx;
int poolIndex, digestIndex, digestSize;
switch (HashFunction)
@@ -267,6 +268,10 @@ BOOL Randmix ()
digestSize = WHIRLPOOL_DIGESTSIZE;
break;
+ case STREEBOG:
+ digestSize = STREEBOG_DIGESTSIZE;
+ break;
+
default:
TC_THROW_FATAL_EXCEPTION;
}
@@ -299,10 +304,16 @@ BOOL Randmix ()
case WHIRLPOOL:
WHIRLPOOL_init (&wctx);
- WHIRLPOOL_add (pRandPool, RNG_POOL_SIZE * 8, &wctx);
+ WHIRLPOOL_add (pRandPool, RNG_POOL_SIZE, &wctx);
WHIRLPOOL_finalize (&wctx, hashOutputBuffer);
break;
+ case STREEBOG:
+ STREEBOG_init (&stctx);
+ STREEBOG_add (&stctx, pRandPool, RNG_POOL_SIZE);
+ STREEBOG_finalize (&stctx, hashOutputBuffer);
+ break;
+
default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
@@ -335,6 +346,10 @@ BOOL Randmix ()
burn (&wctx, sizeof(wctx));
break;
+ case STREEBOG:
+ burn (&stctx, sizeof(sctx));
+ break;
+
default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
diff --git a/src/Common/Resource.h b/src/Common/Resource.h
index 03d42664..12907c12 100644
--- a/src/Common/Resource.h
+++ b/src/Common/Resource.h
@@ -59,6 +59,20 @@
#define IDR_RESCUE_LOADER_AES_SHA2 555
#define IDR_RESCUE_LOADER_SERPENT_SHA2 556
#define IDR_RESCUE_LOADER_TWOFISH_SHA2 557
+#define IDR_BOOT_SECTOR_CAMELLIA 558
+#define IDR_BOOT_LOADER_CAMELLIA 559
+#define IDR_RESCUE_BOOT_SECTOR_CAMELLIA 560
+#define IDR_RESCUE_LOADER_CAMELLIA 561
+#define IDR_BOOT_SECTOR_CAMELLIA_SHA2 562
+#define IDR_BOOT_LOADER_CAMELLIA_SHA2 563
+#define IDR_RESCUE_BOOT_SECTOR_CAMELLIA_SHA2 564
+#define IDR_RESCUE_LOADER_CAMELLIA_SHA2 565
+#define IDR_EFI_DCSBOOT 566
+#define IDR_EFI_DCSINT 567
+#define IDR_EFI_DCSCFG 568
+#define IDR_EFI_LEGACYSPEAKER 569
+#define IDR_EFI_DCSBML 570
+#define IDR_EFI_DCSRE 571
#define IDC_HW_AES_LABEL_LINK 5000
#define IDC_HW_AES 5001
#define IDC_PARALLELIZATION_LABEL_LINK 5002
@@ -197,15 +211,18 @@
#define IDC_KEYFILES_TRY_EMPTY_PASSWORD 5135
#define IDC_ENTROPY_BAR 5136
#define IDT_ENTROPY_BAR 5137
+#define IDT_BENCHMARK 5138
+#define IDC_BENCHMARK_LIST 5139
+#define IDC_BENCHMARK_PREBOOT 5140
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 558
+#define _APS_NEXT_RESOURCE_VALUE 572
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 5138
+#define _APS_NEXT_CONTROL_VALUE 5141
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/src/Common/SecurityToken.cpp b/src/Common/SecurityToken.cpp
index 78a3e6c1..05defe5b 100644
--- a/src/Common/SecurityToken.cpp
+++ b/src/Common/SecurityToken.cpp
@@ -36,7 +36,7 @@ using namespace std;
namespace VeraCrypt
{
- SecurityTokenKeyfile::SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path, char* pin)
+ SecurityTokenKeyfile::SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path)
{
wstring pathStr = path;
unsigned long slotId;
@@ -52,7 +52,7 @@ namespace VeraCrypt
Id = pathStr.substr (keyIdPos + wstring (L"/" TC_SECURITY_TOKEN_KEYFILE_URL_FILE L"/").size());
- vector <SecurityTokenKeyfile> keyfiles = SecurityToken::GetAvailableKeyfiles (&SlotId, Id, pin);
+ vector <SecurityTokenKeyfile> keyfiles = SecurityToken::GetAvailableKeyfiles (&SlotId, Id);
if (keyfiles.empty())
throw SecurityTokenKeyfileNotFound();
@@ -180,7 +180,7 @@ namespace VeraCrypt
throw Pkcs11Exception (status);
}
- vector <SecurityTokenKeyfile> SecurityToken::GetAvailableKeyfiles (CK_SLOT_ID *slotIdFilter, const wstring keyfileIdFilter, char* pin)
+ vector <SecurityTokenKeyfile> SecurityToken::GetAvailableKeyfiles (CK_SLOT_ID *slotIdFilter, const wstring keyfileIdFilter)
{
bool unrecognizedTokenPresent = false;
vector <SecurityTokenKeyfile> keyfiles;
@@ -194,7 +194,7 @@ namespace VeraCrypt
try
{
- LoginUserIfRequired (slotId, pin);
+ LoginUserIfRequired (slotId);
token = GetTokenInfo (slotId);
}
catch (UserAbort &)
@@ -314,12 +314,7 @@ namespace VeraCrypt
void SecurityToken::GetKeyfileData (const SecurityTokenKeyfile &keyfile, vector <byte> &keyfileData)
{
- GetKeyfileData (keyfile, nullptr, keyfileData);
- }
-
- void SecurityToken::GetKeyfileData (const SecurityTokenKeyfile &keyfile, char* pin, vector <byte> &keyfileData)
- {
- LoginUserIfRequired (keyfile.SlotId, pin);
+ LoginUserIfRequired (keyfile.SlotId);
GetObjectAttribute (keyfile.SlotId, keyfile.Handle, CKA_VALUE, keyfileData);
}
@@ -438,7 +433,7 @@ namespace VeraCrypt
Sessions[slotId].UserLoggedIn = true;
}
- void SecurityToken::LoginUserIfRequired (CK_SLOT_ID slotId, char* cmdPin)
+ void SecurityToken::LoginUserIfRequired (CK_SLOT_ID slotId)
{
CheckLibraryStatus();
CK_RV status;
@@ -479,10 +474,6 @@ namespace VeraCrypt
if (status != CKR_OK)
throw Pkcs11Exception (status);
}
- else if (cmdPin && cmdPin [0])
- {
- Login (slotId, cmdPin);
- }
else
{
string pin = tokenInfo.LabelUtf8;
@@ -511,12 +502,7 @@ namespace VeraCrypt
}
else if (error == CKR_PIN_INCORRECT && !(tokenInfo.Flags & CKF_PROTECTED_AUTHENTICATION_PATH))
{
- if (cmdPin && cmdPin [0])
- {
- // clear wrong PIN
- size_t cmdPinLen = strlen (cmdPin);
- burn (cmdPin, cmdPinLen);
- }
+ PinCallback->notifyIncorrectPin ();
(*WarningCallback) (Pkcs11Exception (CKR_PIN_INCORRECT));
continue;
}
diff --git a/src/Common/SecurityToken.h b/src/Common/SecurityToken.h
index 95d95fc8..32abfcb5 100644
--- a/src/Common/SecurityToken.h
+++ b/src/Common/SecurityToken.h
@@ -74,7 +74,7 @@ namespace VeraCrypt
struct SecurityTokenKeyfile
{
SecurityTokenKeyfile () : Handle(CK_INVALID_HANDLE), SlotId(CK_UNAVAILABLE_INFORMATION) { Token.SlotId = CK_UNAVAILABLE_INFORMATION; Token.Flags = 0; }
- SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path, char* pin = nullptr);
+ SecurityTokenKeyfile (const SecurityTokenKeyfilePath &path);
operator SecurityTokenKeyfilePath () const;
@@ -170,6 +170,7 @@ namespace VeraCrypt
{
virtual ~GetPinFunctor () { }
virtual void operator() (string &str) = 0;
+ virtual void notifyIncorrectPin () = 0;
};
struct SendExceptionFunctor
@@ -185,9 +186,8 @@ namespace VeraCrypt
static void CloseLibrary ();
static void CreateKeyfile (CK_SLOT_ID slotId, vector <byte> &keyfileData, const string &name);
static void DeleteKeyfile (const SecurityTokenKeyfile &keyfile);
- static vector <SecurityTokenKeyfile> GetAvailableKeyfiles (CK_SLOT_ID *slotIdFilter = nullptr, const wstring keyfileIdFilter = wstring(), char* pin = nullptr);
+ static vector <SecurityTokenKeyfile> GetAvailableKeyfiles (CK_SLOT_ID *slotIdFilter = nullptr, const wstring keyfileIdFilter = wstring());
static void GetKeyfileData (const SecurityTokenKeyfile &keyfile, vector <byte> &keyfileData);
- static void GetKeyfileData (const SecurityTokenKeyfile &keyfile, char* pin, vector <byte> &keyfileData);
static list <SecurityTokenInfo> GetAvailableTokens ();
static SecurityTokenInfo GetTokenInfo (CK_SLOT_ID slotId);
#ifdef TC_WINDOWS
@@ -206,7 +206,7 @@ namespace VeraCrypt
static void GetObjectAttribute (CK_SLOT_ID slotId, CK_OBJECT_HANDLE tokenObject, CK_ATTRIBUTE_TYPE attributeType, vector <byte> &attributeValue);
static list <CK_SLOT_ID> GetTokenSlots ();
static void Login (CK_SLOT_ID slotId, const char* pin);
- static void LoginUserIfRequired (CK_SLOT_ID slotId, char* cmdPin = nullptr);
+ static void LoginUserIfRequired (CK_SLOT_ID slotId);
static void OpenSession (CK_SLOT_ID slotId);
static void CheckLibraryStatus ();
diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h
index 2d8a6fe3..a58df2e3 100644
--- a/src/Common/Tcdefs.h
+++ b/src/Common/Tcdefs.h
@@ -14,18 +14,56 @@
#ifndef TCDEFS_H
#define TCDEFS_H
+#if defined(_UEFI)
+#undef _WIN32
+#undef _WIN64
+#undef _DEBUG
+
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+
+void* VeraCryptMemAlloc(IN UINTN size);
+void VeraCryptMemFree(IN VOID* ptr);
+
+#define BOOL int
+#ifndef FALSE
+#define FALSE 0
+#define TRUE 1
+#endif
+
+#define max(a,b) ((a)>(b))?(a):(b)
+#define min(a,b) ((a)<(b))?(a):(b)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern unsigned __int64 __cdecl _rotl64(unsigned __int64,int);
+extern unsigned __int64 __cdecl _rotr64(unsigned __int64,int);
+extern unsigned int __cdecl _rotl(unsigned int,int);
+extern unsigned int __cdecl _rotr(unsigned int,int);
+extern unsigned char _rotr8(unsigned char value, unsigned char shift);
+extern unsigned short _rotr16(unsigned short value, unsigned char shift);
+extern unsigned char _rotl8(unsigned char value, unsigned char shift);
+extern unsigned short _rotl16(unsigned short value, unsigned char shift);
+#ifdef __cplusplus
+}
+#endif
+
+#endif // defined(_UEFI)
+
#define TC_APP_NAME "VeraCrypt"
-// Version displayed to user
-#define VERSION_STRING "1.17"
+// Version displayed to user
+#define VERSION_STRING "1.18-BETA9"
// Version number to compare against driver
#define VERSION_NUM 0x0117
// Release date
-#define TC_STR_RELEASE_DATE L"February 13th, 2016"
+#define TC_STR_RELEASE_DATE L"May 29th, 2016"
#define TC_RELEASE_DATE_YEAR 2016
-#define TC_RELEASE_DATE_MONTH 2
+#define TC_RELEASE_DATE_MONTH 5
#define BYTES_PER_KB 1024LL
#define BYTES_PER_MB 1048576LL
@@ -55,6 +93,9 @@ typedef unsigned __int64 uint64;
#define LL(x) x##ui64
#endif
+#pragma warning( disable : 4201 ) // disable: 4201 nonstandard extension used : nameless struct/union
+#pragma warning( disable : 4324 ) // disable: 4324 structure was padded due to __declspec(align())
+
#else // !_MSC_VER
#include <inttypes.h>
@@ -123,6 +164,41 @@ typedef union
#define __has_builtin(x) 0 // Compatibility with non-clang compilers
#endif
+#if defined(_UEFI)
+typedef UINTN size_t;
+typedef uint64 uint_64t;
+typedef CHAR16 wchar_t;
+typedef int LONG;
+
+#define wcscpy StrCpy
+#define wcslen StrLen
+#define wcscmp StrCmp
+#define wcscat StrCat
+
+#define memcpy(dest,source,count) CopyMem(dest,source,(UINTN)(count))
+#define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
+#define memchr(buf,ch,count) ScanMem8(buf,(UINTN)(count),(UINT8)ch)
+#define memcmp(buf1,buf2,count) (int)(CompareMem(buf1,buf2,(UINTN)(count)))
+
+#define MAX_STRING_SIZE 0x1000
+#define strcat(strDest,strSource) AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)
+#define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch)
+#define strcmp AsciiStrCmp
+#define strncmp(string1,string2,count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
+#define strcpy(strDest,strSource) AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource)
+#define strncpy(strDest,strSource,count) AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)
+#define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
+#define strstr AsciiStrStr
+
+// #define rotr32(x,n) (((x) >> n) | ((x) << (32 - n)))
+// #define rotl32(x,n) (((x) << n) | ((x) >> (32 - n)))
+// #define rotr64(x,n) (((x) >> n) | ((x) << (64 - n)))
+// #define rotl64(x,n) (((x) << n) | ((x) >> (64 - n)))
+// #define bswap_32(x) (rotl32((((x) & 0xFF00FF00) >> 8) | (((x) & 0x00FF00FF) << 8), 16U))
+// #define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U)
+
+#endif
+
#ifdef TC_WINDOWS_BOOT
# ifdef __cplusplus
@@ -133,6 +209,9 @@ void ThrowFatalException (int line);
# define TC_THROW_FATAL_EXCEPTION ThrowFatalException (__LINE__)
#elif defined (TC_WINDOWS_DRIVER)
# define TC_THROW_FATAL_EXCEPTION KeBugCheckEx (SECURITY_SYSTEM, __LINE__, 0, 0, 'VC')
+#elif defined(_UEFI)
+void ThrowFatalException(int line);
+# define TC_THROW_FATAL_EXCEPTION ThrowFatalException (__LINE__)
#elif (defined(__clang__) && __has_builtin(__builtin_trap)) \
|| (defined(__GNUC__ ) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) \
|| (__has_builtin(__builtin_trap))
@@ -170,9 +249,13 @@ typedef int BOOL;
#endif
#else /* !TC_WINDOWS_DRIVER */
-
+#if !defined(_UEFI)
#define TCalloc malloc
#define TCfree free
+#else
+#define TCalloc VeraCryptMemAlloc
+#define TCfree VeraCryptMemFree
+#endif //!defined(_UEFI)
#ifdef _WIN32
@@ -198,8 +281,8 @@ typedef int BOOL;
#endif
#ifdef DEVICE_DRIVER
-# if defined (DEBUG) || 0
-# if 1 // DbgPrintEx is not available on Windows 2000
+# if defined (DEBUG) || defined (DEBUG_TRACE)
+# if 0 // DbgPrintEx is not available on Windows 2000
# define Dump DbgPrint
# else
# define Dump(...) DbgPrintEx (DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL, __VA_ARGS__)
@@ -212,11 +295,13 @@ typedef int BOOL;
#endif
#if !defined (trace_msg) && !defined (TC_WINDOWS_BOOT)
-# ifdef DEBUG
+# if defined(DEBUG) || defined (DEBUG_TRACE)
# ifdef DEVICE_DRIVER
# define trace_msg Dump
# elif defined (_WIN32)
# define trace_msg(...) do { char msg[2048]; StringCbPrintfA (msg, sizeof (msg), __VA_ARGS__); OutputDebugString (msg); } while (0)
+# else
+# define trace_msg(...)
# endif
# define trace_point trace_msg (__FUNCTION__ ":" TC_TO_STRING(__LINE__) "\n")
# else
@@ -233,7 +318,7 @@ typedef int BOOL;
# define TC_WAIT_EVENT(EVENT) WaitForSingleObject (EVENT, INFINITE)
#endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UEFI)
#define burn(mem,size) do { volatile char *burnm = (volatile char *)(mem); size_t burnc = size; RtlSecureZeroMemory (mem, size); while (burnc--) *burnm++ = 0; } while (0)
#else
#define burn(mem,size) do { volatile char *burnm = (volatile char *)(mem); int burnc = size; while (burnc--) *burnm++ = 0; } while (0)
@@ -251,7 +336,7 @@ typedef int BOOL;
# define max(a,b) (((a) > (b)) ? (a) : (b))
# endif
-# ifdef __cplusplus
+# if defined(__cplusplus) && !defined(_UEFI)
extern "C"
# endif
void EraseMemory (void *memory, int size);
diff --git a/src/Common/Tests.c b/src/Common/Tests.c
index 9d9e8118..c51b6338 100644
--- a/src/Common/Tests.c
+++ b/src/Common/Tests.c
@@ -19,10 +19,11 @@
#include "Xts.h"
#include <string.h>
#include "Pkcs5.h"
+#include "cpu.h"
typedef struct {
- unsigned __int8 key1[32];
- unsigned __int8 key2[32];
+ CRYPTOPP_ALIGN_DATA(16) unsigned __int8 key1[32];
+ CRYPTOPP_ALIGN_DATA(16) unsigned __int8 key2[32];
unsigned __int8 dataUnitNo[8];
unsigned int blockNo;
unsigned __int8 plaintext[ENCRYPTION_DATA_UNIT_SIZE];
@@ -348,6 +349,35 @@ TWOFISH_TEST twofish_vectors[TWOFISH_TEST_COUNT] = {
0x6C, 0xB4, 0x56, 0x1C, 0x40, 0xBF, 0x0A, 0x97, 0x05, 0x93, 0x1C, 0xB6, 0xD4, 0x08, 0xE7, 0xFA
};
+// Camellia ECB test vectors
+#define CAMELLIA_TEST_COUNT 2
+
+typedef struct {
+ unsigned char key[32];
+ unsigned char plaintext[16];
+ unsigned char ciphertext[16];
+ } CAMELLIA_TEST;
+
+CAMELLIA_TEST camellia_vectors[CAMELLIA_TEST_COUNT] = {
+{
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98,
+ 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x01, 0x23, 0x45, 0x67,
+ 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
+ 0x9A, 0xCC, 0x23, 0x7D, 0xFF, 0x16, 0xD7, 0x6C, 0x20, 0xEF, 0x7C, 0x91,
+ 0x9E, 0x3A, 0x75, 0x09
+},
+{
+ 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10,
+ 0x48, 0x81, 0xFF, 0x48, 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00,
+ 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, 0xFF, 0x48, 0xE6, 0x84, 0x42, 0x17,
+ 0x16, 0xFC, 0x0B, 0x01, 0xAE, 0xB5, 0xC6, 0x76, 0x51, 0x20, 0xF9, 0x5F,
+ 0xEA, 0x02, 0x47, 0x14, 0xAD, 0x5C, 0x4D, 0x84, 0xEA, 0x02, 0x47, 0x14,
+ 0xAD, 0x5C, 0x4D, 0x84
+}
+};
+
+
/* Test vectors from FIPS 198a, RFC 4231, RFC 2104, RFC 2202, and other sources. */
char *hmac_sha256_test_keys[] =
@@ -446,6 +476,95 @@ char *hmac_whirlpool_test_vectors =
"\x6a\xbf\xa4\x02"
};
+typedef struct _HashTestVector
+{
+ const char* hexInput;
+ const char* hexOutput;
+
+} HashTestVector;
+
+typedef int (__cdecl HashFunction) (unsigned char* input, unsigned long inputLen, unsigned char* output);
+
+unsigned char HexCharToByte (char c)
+{
+ if (c >= ('0') && c <= ('9'))
+ return c - ('0');
+ else if (c >= ('A') && c <= ('F'))
+ return c - ('A') + 10;
+ else if (c >= ('a') && c <= ('f'))
+ return c - ('a') + 10;
+ else
+ return 0xFF;
+}
+
+unsigned long HexStringToByteArray(const char* hexStr, unsigned char* pbData)
+{
+ unsigned long count = 0;
+ while (*hexStr)
+ {
+ *pbData++ = (HexCharToByte(hexStr[0]) << 4) | HexCharToByte(hexStr[1]);
+ hexStr += 2;
+ count++;
+ }
+ return count;
+}
+
+BOOL RunHashTest (HashFunction fn, HashTestVector* vector, BOOL bUseSSE)
+{
+ ALIGN (16) unsigned char input[256];
+ unsigned char output[64];
+ unsigned char digest[64];
+ unsigned long i = 0, inputLen, outputLen, digestLen;
+ BOOL bRet = TRUE;
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ NTSTATUS saveStatus = STATUS_SUCCESS;
+ if (bUseSSE && (HasSSE2() || HasSSE41()))
+ saveStatus = KeSaveFloatingPointState (&floatingPointState);
+#endif
+ while (vector[i].hexInput && vector[i].hexOutput)
+ {
+ inputLen = HexStringToByteArray (vector[i].hexInput, input);
+ outputLen = HexStringToByteArray (vector[i].hexOutput, output);
+ digestLen = fn (input, inputLen, digest);
+ if ((digestLen != outputLen) || (0 != memcmp (digest, output, digestLen)))
+ {
+ bRet = FALSE;
+ break;
+ }
+ i++;
+ }
+
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ if (NT_SUCCESS (saveStatus) && bUseSSE && (HasSSE2() || HasSSE41()))
+ KeRestoreFloatingPointState (&floatingPointState);
+#endif
+
+ return bRet;
+}
+
+
+/* https://www.streebog.net/src/trunk/examples/ */
+HashTestVector Streebog512TestVectors[] = {
+ /* M1 */
+ {"303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132",
+ "1b54d01a4af5b9d5cc3d86d68d285462b19abc2475222f35c085122be4ba1ffa00ad30f8767b3a82384c6574f024c311e2a481332b08ef7f41797891c1646f48"
+ },
+ /* M2 */
+ {"d1e520e2e5f2f0e82c20d1f2f0e8e1eee6e820e2edf3f6e82c20e2e5fef2fa20f120eceef0ff20f1f2f0e5ebe0ece820ede020f5f0e0e1f0fbff20efebfaeafb20c8e3eef0e5e2fb",
+ "1e88e62226bfca6f9994f1f2d51569e0daf8475a3b0fe61a5300eee46d961376035fe83549ada2b8620fcd7c496ce5b33f0cb9dddc2b6460143b03dabac9fb28"
+ },
+ /* M3 */
+ {"",
+ "8e945da209aa869f0455928529bcae4679e9873ab707b55315f56ceb98bef0a7362f715528356ee83cda5f2aac4c6ad2ba3a715c1bcd81cb8e9f90bf4c1c1a8a"
+ },
+ /* M4 */
+ {"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "b0fd29ac1b0df441769ff3fdb8dc564df67721d6ac06fb28ceffb7bbaa7948c6c014ac999235b58cb26fb60fb112a145d7b4ade9ae566bf2611402c552d20db7"
+ },
+ {NULL, NULL}
+};
+
unsigned char ks_tmp[MAX_EXPANDED_KEY];
void CipherInit2(int cipher, void* key, void* ks, int key_len)
@@ -464,7 +583,18 @@ void CipherInit2(int cipher, void* key, void* ks, int key_len)
case TWOFISH:
CipherInit(cipher,key,ks);
break;
-
+
+ case CAMELLIA:
+ CipherInit(cipher,key,ks);
+ break;
+#if defined(CIPHER_GOST89)
+ case GOST89:
+ CipherInit(cipher,key,ks);
+ break;
+#endif // defined(CIPHER_GOST89)
+ case KUZNYECHIK:
+ CipherInit(cipher, key, ks);
+ break;
default:
/* Unknown/wrong ID */
TC_THROW_FATAL_EXCEPTION;
@@ -484,7 +614,7 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
int testCase = 0;
int nTestsPerformed = 0;
- static unsigned char key1[] =
+ static CRYPTOPP_ALIGN_DATA(16) unsigned char key1[] =
{
0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45, 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26, 0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69, 0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93, 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95, 0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37, 0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
@@ -625,6 +755,32 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
break;
}
}
+ else if (wcscmp (name, L"Camellia") == 0)
+ {
+ switch (testCase)
+ {
+ case 0:
+ if (crc != 0x2436badb)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ case 1:
+ if (crc != 0x247d2272)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ case 2:
+ if (crc != 0x72b49cde)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ case 3:
+ if (crc != 0xb838d2c1)
+ return FALSE;
+ nTestsPerformed++;
+ break;
+ }
+ }
else if (wcscmp (name, L"AES-Twofish") == 0)
{
switch (testCase)
@@ -819,6 +975,12 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
return FALSE;
nTestsPerformed++;
}
+ else if (wcscmp (name, L"Camellia") == 0)
+ {
+ if (crc != 0x8176b223)
+ return FALSE;
+ nTestsPerformed++;
+ }
else if (wcscmp (name, L"AES-Twofish") == 0)
{
if (crc != 0x14ce7385)
@@ -860,14 +1022,17 @@ BOOL TestSectorBufEncryption (PCRYPTO_INFO ci)
nTestsPerformed++;
}
-
- return (nTestsPerformed == 80);
+#if defined(CIPHER_GOST89)
+ return (nTestsPerformed == 100);
+#else
+ return (nTestsPerformed == 95);
+#endif
}
static BOOL DoAutoTestAlgorithms (void)
{
PCRYPTO_INFO ci;
- char key[32];
+ CRYPTOPP_ALIGN_DATA(16) char key[32];
unsigned char tmp[16];
BOOL bFailed = FALSE;
int i;
@@ -963,6 +1128,26 @@ static BOOL DoAutoTestAlgorithms (void)
}
if (i != TWOFISH_TEST_COUNT)
bFailed = TRUE;
+
+ /* Camellia */
+
+ for (i = 0; i < CAMELLIA_TEST_COUNT; i++)
+ {
+ int cipher = CAMELLIA;
+ memcpy(key, camellia_vectors[i].key, 32);
+ memcpy(tmp, camellia_vectors[i].plaintext, 16);
+ CipherInit(cipher, key, ks_tmp);
+
+ EncipherBlock(cipher, tmp, ks_tmp);
+ if (memcmp(camellia_vectors[i].ciphertext, tmp, 16) != 0)
+ break;
+
+ DecipherBlock(cipher, tmp, ks_tmp);
+ if (memcmp(camellia_vectors[i].plaintext, tmp, 16) != 0)
+ break;
+ }
+ if (i != CAMELLIA_TEST_COUNT)
+ bFailed = TRUE;
/* PKCS #5 and HMACs */
@@ -1080,6 +1265,50 @@ BOOL test_hmac_whirlpool ()
return TRUE;
}
+/* http://www.tc26.ru/methods/recommendation/%D0%A2%D0%9A26%D0%90%D0%9B%D0%93.pdf */
+/* https://tools.ietf.org/html/draft-smyshlyaev-gost-usage-00 */
+/* https://datatracker.ietf.org/doc/rfc7836/?include_text=1 */
+static const unsigned char gost3411_2012_hmac_k1[] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
+};
+static const unsigned char gost3411_2012_hmac_m1[] = {
+ 0x01, 0x26, 0xbd, 0xb8, 0x78, 0x00, 0xaf, 0x21,
+ 0x43, 0x41, 0x45, 0x65, 0x63, 0x78, 0x01, 0x00
+};
+static const unsigned char gost3411_2012_hmac_r1[] = {
+ 0xA5, 0x9B, 0xAB, 0x22, 0xEC, 0xAE, 0x19, 0xC6, 0x5F, 0xBD, 0xE6, 0xE5,
+ 0xF4, 0xE9, 0xF5, 0xD8, 0x54, 0x9D, 0x31, 0xF0, 0x37, 0xF9, 0xDF, 0x9B,
+ 0x90, 0x55, 0x00, 0xE1, 0x71, 0x92, 0x3A, 0x77, 0x3D, 0x5F, 0x15, 0x30,
+ 0xF2, 0xED, 0x7E, 0x96, 0x4C, 0xB2, 0xEE, 0xDC, 0x29, 0xE9, 0xAD, 0x2F,
+ 0x3A, 0xFE, 0x93, 0xB2, 0x81, 0x4F, 0x79, 0xF5, 0x00, 0x0F, 0xFC, 0x03,
+ 0x66, 0xC2, 0x51, 0xE6
+};
+
+
+BOOL test_hmac_streebog ()
+{
+ ALIGN(16) char digest[64]; /* large enough to hold digets and test vector inputs */
+
+ memcpy (digest, gost3411_2012_hmac_m1, sizeof (gost3411_2012_hmac_m1));
+ hmac_streebog ((char*) gost3411_2012_hmac_k1, sizeof(gost3411_2012_hmac_k1), digest, (int) sizeof (gost3411_2012_hmac_m1));
+ if (memcmp (digest, gost3411_2012_hmac_r1, STREEBOG_DIGESTSIZE) != 0)
+ return FALSE;
+
+ return TRUE;
+}
+
+int __cdecl StreebogHash (unsigned char* input, unsigned long inputLen, unsigned char* output)
+{
+ STREEBOG_CTX ctx;
+ STREEBOG_init (&ctx);
+ STREEBOG_add (&ctx, input, inputLen);
+ STREEBOG_finalize (&ctx, output);
+ return STREEBOG_DIGESTSIZE;
+}
+
BOOL test_pkcs5 ()
{
char dk[144];
@@ -1100,6 +1329,14 @@ BOOL test_pkcs5 ()
if (test_hmac_whirlpool() == FALSE)
return FALSE;
+ /* HMAC-STREEBOG tests */
+ if (test_hmac_streebog() == FALSE)
+ return FALSE;
+
+ /* STREEBOG hash tests */
+ if (RunHashTest (StreebogHash, Streebog512TestVectors, TRUE) == FALSE)
+ return FALSE;
+
/* PKCS-5 test 1 with HMAC-SHA-256 used as the PRF (https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-00) */
derive_key_sha256 ("passwd", 6, "\x73\x61\x6C\x74", 4, 1, dk, 64);
if (memcmp (dk, "\x55\xac\x04\x6e\x56\xe3\x08\x9f\xec\x16\x91\xc2\x25\x44\xb6\x05\xf9\x41\x85\x21\x6d\xde\x04\x65\xe6\x8b\x9d\x57\xc2\x0d\xac\xbc\x49\xca\x9c\xcc\xf1\x79\xb6\x45\x99\x16\x64\xb3\x9d\x77\xef\x31\x7c\x71\xb8\x45\xb1\xe3\x0b\xd5\x09\x11\x20\x41\xd3\xa1\x97\x83", 64) != 0)
@@ -1151,5 +1388,15 @@ BOOL test_pkcs5 ()
if (memcmp (dk, "\x50\x7c\x36\x6f\xee\x10\x2e\x9a\xe2\x8a\xd5\x82\x72\x7d\x27\x0f\xe8\x4d\x7f\x68\x7a\xcf\xb5\xe7\x43\x67\xaa\x98\x93\x52\x2b\x09\x6e\x42\xdf\x2c\x59\x4a\x91\x6d\x7e\x10\xae\xb2\x1a\x89\x8f\xb9\x8f\xe6\x31\xa9\xd8\x9f\x98\x26\xf4\xda\xcd\x7d\x65\x65\xde\x10\x95\x91\xb4\x84\x26\xae\x43\xa1\x00\x5b\x1e\xb8\x38\x97\xa4\x1e\x4b\xd2\x65\x64\xbc\xfa\x1f\x35\x85\xdb\x4f\x97\x65\x6f\xbd\x24", 96) != 0)
return FALSE;
+ /* PKCS-5 test 1 with HMAC-STREEBOG used as the PRF */
+ derive_key_streebog ("password", 8, "\x12\x34\x56\x78", 4, 5, dk, 4);
+ if (memcmp (dk, "\xd0\x53\xa2\x30", 4) != 0)
+ return FALSE;
+
+ /* PKCS-5 test 2 with HMAC-STREEBOG used as the PRF (derives a key longer than the underlying hash) */
+ derive_key_streebog ("password", 8, "\x12\x34\x56\x78", 4, 5, dk, 96);
+ if (memcmp (dk, "\xd0\x53\xa2\x30\x6f\x45\x81\xeb\xbc\x06\x81\xc5\xe7\x53\xa8\x5d\xc7\xf1\x23\x33\x1e\xbe\x64\x2c\x3b\x0f\x26\xd7\x00\xe1\x95\xc9\x65\x26\xb1\x85\xbe\x1e\xe2\xf4\x9b\xfc\x6b\x14\x84\xda\x24\x61\xa0\x1b\x9e\x79\x5c\xee\x69\x6e\xf9\x25\xb1\x1d\xca\xa0\x31\xba\x02\x6f\x9e\x99\x0f\xdb\x25\x01\x5b\xf1\xc7\x10\x19\x53\x3b\x29\x3f\x18\x00\xd6\xfc\x85\x03\xdc\xf2\xe5\xe9\x5a\xb1\x1e\x61\xde", 96) != 0)
+ return FALSE;
+
return TRUE;
}
diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c
index 007a1c08..3228aadc 100644
--- a/src/Common/Volumes.c
+++ b/src/Common/Volumes.c
@@ -12,8 +12,8 @@
code distribution packages. */
#include "Tcdefs.h"
-
-#ifndef TC_WINDOWS_BOOT
+#if !defined(_UEFI)
+#if !defined(TC_WINDOWS_BOOT)
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -28,6 +28,7 @@
#ifndef DEVICE_DRIVER
#include "Random.h"
#endif
+#endif // !defined(_UEFI)
#include "Crc.h"
#include "Crypto.h"
@@ -35,7 +36,7 @@
#include "Volumes.h"
#include "Pkcs5.h"
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UEFI)
#include <Strsafe.h>
#include "../Boot/Windows/BootCommon.h"
#endif
@@ -171,21 +172,22 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int
char header[TC_VOLUME_HEADER_EFFECTIVE_SIZE];
CRYPTOPP_ALIGN_DATA(16) KEY_INFO keyInfo;
PCRYPTO_INFO cryptoInfo;
- char dk[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) char dk[MASTER_KEYDATA_SIZE];
int enqPkcs5Prf, pkcs5_prf;
uint16 headerVersion;
int status = ERR_PARAMETER_INCORRECT;
int primaryKeyOffset;
-
+ int pkcs5PrfCount = LAST_PRF_ID - FIRST_PRF_ID + 1;
+#if !defined(_UEFI)
TC_EVENT keyDerivationCompletedEvent;
TC_EVENT noOutstandingWorkItemEvent;
KeyDerivationWorkItem *keyDerivationWorkItems;
KeyDerivationWorkItem *item;
- int pkcs5PrfCount = LAST_PRF_ID - FIRST_PRF_ID + 1;
size_t encryptionThreadCount = GetEncryptionThreadCount();
- size_t queuedWorkItems = 0;
LONG outstandingWorkItemCount = 0;
int i;
+#endif
+ size_t queuedWorkItems = 0;
// if no PIM specified, use default value
if (pim < 0)
@@ -212,7 +214,7 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int
if (cryptoInfo == NULL)
return ERR_OUTOFMEMORY;
}
-
+#if !defined(_UEFI)
/* use thread pool only if no PRF was specified */
if ((selected_pkcs5_prf == 0) && (encryptionThreadCount > 1))
{
@@ -244,10 +246,11 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int
#endif
}
-#ifndef DEVICE_DRIVER
+#if !defined(DEVICE_DRIVER)
VirtualLock (&keyInfo, sizeof (keyInfo));
VirtualLock (&dk, sizeof (dk));
#endif
+#endif // !defined(_UEFI)
crypto_loadkey (&keyInfo, password->Text, (int) password->Length);
@@ -264,7 +267,7 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int
// skip SHA-256 in case of TrueCrypt mode
if (truecryptMode && (enqPkcs5Prf == SHA256))
continue;
-
+#if !defined(_UEFI)
if ((selected_pkcs5_prf == 0) && (encryptionThreadCount > 1))
{
// Enqueue key derivation on thread pool
@@ -319,6 +322,7 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int
KeyReady: ;
}
else
+#endif // !defined(_UEFI)
{
pkcs5_prf = enqPkcs5Prf;
keyInfo.noIterations = get_pkcs5_iteration_count (enqPkcs5Prf, pim, truecryptMode, bBoot);
@@ -345,6 +349,10 @@ KeyReady: ;
PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
break;
+ case STREEBOG:
+ derive_key_streebog(keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
+ break;
default:
// Unknown/wrong ID
TC_THROW_FATAL_EXCEPTION;
@@ -564,11 +572,12 @@ ret:
burn (&keyInfo, sizeof (keyInfo));
burn (dk, sizeof(dk));
-#ifndef DEVICE_DRIVER
+#if !defined(DEVICE_DRIVER) && !defined(_UEFI)
VirtualUnlock (&keyInfo, sizeof (keyInfo));
VirtualUnlock (&dk, sizeof (dk));
#endif
+#if !defined(_UEFI)
if ((selected_pkcs5_prf == 0) && (encryptionThreadCount > 1))
{
TC_WAIT_EVENT (noOutstandingWorkItemEvent);
@@ -576,16 +585,16 @@ ret:
burn (keyDerivationWorkItems, sizeof (KeyDerivationWorkItem) * pkcs5PrfCount);
TCfree (keyDerivationWorkItems);
-#ifndef DEVICE_DRIVER
+#if !defined(DEVICE_DRIVER)
CloseHandle (keyDerivationCompletedEvent);
CloseHandle (noOutstandingWorkItemEvent);
#endif
}
-
+#endif
return status;
}
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UEFI)
void ComputeBootloaderFingerprint (byte *bootLoaderBuf, unsigned int bootLoaderSize, byte* fingerprint)
{
// compute Whirlpool+SHA512 fingerprint of bootloader including MBR
@@ -605,16 +614,16 @@ void ComputeBootloaderFingerprint (byte *bootLoaderBuf, unsigned int bootLoaderS
WHIRLPOOL_init (&whirlpool);
sha512_begin (&sha2);
- WHIRLPOOL_add (bootLoaderBuf, TC_BOOT_SECTOR_PIM_VALUE_OFFSET * 8, &whirlpool);
+ WHIRLPOOL_add (bootLoaderBuf, TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &whirlpool);
sha512_hash (bootLoaderBuf, TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &sha2);
- WHIRLPOOL_add (bootLoaderBuf + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, (TC_BOOT_SECTOR_USER_CONFIG_OFFSET - (TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)) * 8, &whirlpool);
+ WHIRLPOOL_add (bootLoaderBuf + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, (TC_BOOT_SECTOR_USER_CONFIG_OFFSET - (TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)), &whirlpool);
sha512_hash (bootLoaderBuf + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, (TC_BOOT_SECTOR_USER_CONFIG_OFFSET - (TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)), &sha2);
- WHIRLPOOL_add (bootLoaderBuf + TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1, (TC_MAX_MBR_BOOT_CODE_SIZE - (TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1)) * 8, &whirlpool);
+ WHIRLPOOL_add (bootLoaderBuf + TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1, (TC_MAX_MBR_BOOT_CODE_SIZE - (TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1)), &whirlpool);
sha512_hash (bootLoaderBuf + TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1, (TC_MAX_MBR_BOOT_CODE_SIZE - (TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1)), &sha2);
- WHIRLPOOL_add (bootLoaderBuf + TC_SECTOR_SIZE_BIOS, (bootLoaderSize - TC_SECTOR_SIZE_BIOS) * 8, &whirlpool);
+ WHIRLPOOL_add (bootLoaderBuf + TC_SECTOR_SIZE_BIOS, (bootLoaderSize - TC_SECTOR_SIZE_BIOS), &whirlpool);
sha512_hash (bootLoaderBuf + TC_SECTOR_SIZE_BIOS, (bootLoaderSize - TC_SECTOR_SIZE_BIOS), &sha2);
WHIRLPOOL_finalize (&whirlpool, fingerprint);
@@ -667,6 +676,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk, cryptoInfo->ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *) cryptoInfo->ks, (const u4byte *) dk);
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk, cryptoInfo->ks);
#else
status = EAInit (dk, cryptoInfo->ks);
if (status == ERR_CIPHER_INIT_FAILURE)
@@ -683,6 +694,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk + 32, cryptoInfo->ks2);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *)cryptoInfo->ks2, (const u4byte *) (dk + 32));
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk + 32, cryptoInfo->ks2);
#else
EAInit (dk + 32, cryptoInfo->ks2);
#endif
@@ -742,6 +755,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk, cryptoInfo->ks);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *) cryptoInfo->ks, (const u4byte *) dk);
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk, cryptoInfo->ks);
#else
status = EAInit (dk, cryptoInfo->ks);
if (status == ERR_CIPHER_INIT_FAILURE)
@@ -759,6 +774,8 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, int pim, PCR
serpent_set_key (dk + 32, cryptoInfo->ks2);
#elif defined (TC_WINDOWS_BOOT_TWOFISH)
twofish_set_key ((TwofishInstance *)cryptoInfo->ks2, (const u4byte *) (dk + 32));
+ #elif defined (TC_WINDOWS_BOOT_CAMELLIA)
+ camellia_set_key (dk + 32, cryptoInfo->ks2);
#else
EAInit (dk + 32, cryptoInfo->ks2);
#endif
@@ -793,15 +810,22 @@ ret:
#endif
// Creates a volume header in memory
+#if defined(_UEFI)
+int CreateVolumeHeaderInMemory(BOOL bBoot, char *header, int ea, int mode, Password *password,
+ int pkcs5_prf, int pim, char *masterKeydata, PCRYPTO_INFO *retInfo,
+ unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize,
+ unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode)
+#else
int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea, int mode, Password *password,
int pkcs5_prf, int pim, char *masterKeydata, PCRYPTO_INFO *retInfo,
unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize,
unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode)
+#endif // !defined(_UEFI)
{
unsigned char *p = (unsigned char *) header;
static CRYPTOPP_ALIGN_DATA(16) KEY_INFO keyInfo;
- int nUserKeyLen = password->Length;
+ int nUserKeyLen = password? password->Length : 0;
PCRYPTO_INFO cryptoInfo = crypto_open ();
static char dk[MASTER_KEYDATA_SIZE];
int x;
@@ -816,9 +840,10 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
pim = 0;
memset (header, 0, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
-
+#if !defined(_UEFI)
VirtualLock (&keyInfo, sizeof (keyInfo));
VirtualLock (&dk, sizeof (dk));
+#endif // !defined(_UEFI)
/* Encryption setup */
@@ -835,8 +860,15 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
bytesNeeded = EAGetKeySize (ea) * 2; // Size of primary + secondary key(s)
}
+#if !defined(_UEFI)
if (!RandgetBytes (hwndDlg, keyInfo.master_keydata, bytesNeeded, TRUE))
+#else
+ if (!RandgetBytes(keyInfo.master_keydata, bytesNeeded, TRUE))
+#endif
+ {
+ crypto_close (cryptoInfo);
return ERR_CIPHER_INIT_WEAK_KEY;
+ }
}
else
{
@@ -845,9 +877,17 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
}
// User key
- memcpy (keyInfo.userKey, password->Text, nUserKeyLen);
- keyInfo.keyLength = nUserKeyLen;
- keyInfo.noIterations = get_pkcs5_iteration_count (pkcs5_prf, pim, FALSE, bBoot);
+ if (password)
+ {
+ memcpy (keyInfo.userKey, password->Text, nUserKeyLen);
+ keyInfo.keyLength = nUserKeyLen;
+ keyInfo.noIterations = get_pkcs5_iteration_count (pkcs5_prf, pim, FALSE, bBoot);
+ }
+ else
+ {
+ keyInfo.keyLength = 0;
+ keyInfo.noIterations = 0;
+ }
// User selected encryption algorithm
cryptoInfo->ea = ea;
@@ -862,35 +902,64 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
cryptoInfo->mode = mode;
// Salt for header key derivation
- if (!RandgetBytes (hwndDlg, keyInfo.salt, PKCS5_SALT_SIZE, !bWipeMode))
- return ERR_CIPHER_INIT_WEAK_KEY;
+#if !defined(_UEFI)
+ if (!RandgetBytes(hwndDlg, keyInfo.salt, PKCS5_SALT_SIZE, !bWipeMode))
+#else
+ if (!RandgetBytes(keyInfo.salt, PKCS5_SALT_SIZE, !bWipeMode))
+#endif
+ {
+ crypto_close (cryptoInfo);
+ return ERR_CIPHER_INIT_WEAK_KEY;
+ }
- // PBKDF2 (PKCS5) is used to derive primary header key(s) and secondary header key(s) (XTS) from the password/keyfiles
- switch (pkcs5_prf)
+ if (password)
{
- case SHA512:
- derive_key_sha512 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
- PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
- break;
-
- case SHA256:
- derive_key_sha256 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
- PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
- break;
-
- case RIPEMD160:
- derive_key_ripemd160 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
- PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
- break;
-
- case WHIRLPOOL:
- derive_key_whirlpool (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
- PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
- break;
+ // PBKDF2 (PKCS5) is used to derive primary header key(s) and secondary header key(s) (XTS) from the password/keyfiles
+ switch (pkcs5_prf)
+ {
+ case SHA512:
+ derive_key_sha512 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
+ break;
- default:
- // Unknown/wrong ID
- TC_THROW_FATAL_EXCEPTION;
+ case SHA256:
+ derive_key_sha256 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
+ break;
+
+ case RIPEMD160:
+ derive_key_ripemd160 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
+ break;
+
+ case WHIRLPOOL:
+ derive_key_whirlpool (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
+ break;
+
+ case STREEBOG:
+ derive_key_streebog(keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
+ break;
+
+ default:
+ // Unknown/wrong ID
+ crypto_close (cryptoInfo);
+ TC_THROW_FATAL_EXCEPTION;
+ }
+ }
+ else
+ {
+ // generate a random key
+#if !defined(_UEFI)
+ if (!RandgetBytes(hwndDlg, dk, GetMaxPkcs5OutSize(), !bWipeMode))
+#else
+ if (!RandgetBytes(dk, GetMaxPkcs5OutSize(), !bWipeMode))
+#endif
+ {
+ crypto_close (cryptoInfo);
+ return ERR_CIPHER_INIT_WEAK_KEY;
+ }
}
/* Header setup */
@@ -942,6 +1011,7 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
|| sectorSize > TC_MAX_VOLUME_SECTOR_SIZE
|| sectorSize % ENCRYPTION_DATA_UNIT_SIZE != 0)
{
+ crypto_close (cryptoInfo);
TC_THROW_FATAL_EXCEPTION;
}
@@ -970,11 +1040,17 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
retVal = EAInit (cryptoInfo->ea, dk + primaryKeyOffset, cryptoInfo->ks);
if (retVal != ERR_SUCCESS)
+ {
+ crypto_close (cryptoInfo);
return retVal;
+ }
// Mode of operation
if (!EAInitMode (cryptoInfo))
+ {
+ crypto_close (cryptoInfo);
return ERR_OUTOFMEMORY;
+ }
// Encrypt the entire header (except the salt)
@@ -988,7 +1064,10 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
// Init with the master key(s)
retVal = EAInit (cryptoInfo->ea, keyInfo.master_keydata + primaryKeyOffset, cryptoInfo->ks);
if (retVal != ERR_SUCCESS)
+ {
+ crypto_close (cryptoInfo);
return retVal;
+ }
memcpy (cryptoInfo->master_keydata, keyInfo.master_keydata, MASTER_KEYDATA_SIZE);
@@ -1002,7 +1081,10 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
// Mode of operation
if (!EAInitMode (cryptoInfo))
+ {
+ crypto_close (cryptoInfo);
return ERR_OUTOFMEMORY;
+ }
#ifdef VOLFORMAT
@@ -1054,7 +1136,7 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
return 0;
}
-
+#if !defined(_UEFI)
BOOL ReadEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header, DWORD *bytesRead)
{
#if TC_VOLUME_HEADER_EFFECTIVE_SIZE > TC_MAX_VOLUME_SECTOR_SIZE
@@ -1157,7 +1239,7 @@ BOOL WriteEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header)
// Writes randomly generated data to unused/reserved header areas.
// When bPrimaryOnly is TRUE, then only the primary header area (not the backup header area) is filled with random data.
// When bBackupOnly is TRUE, only the backup header area (not the primary header area) is filled with random data.
-int WriteRandomDataToReservedHeaderAreas (HWND hwndDlg, HANDLE dev, CRYPTO_INFO *cryptoInfo, uint64 dataAreaSize, BOOL bPrimaryOnly, BOOL bBackupOnly)
+int WriteRandomDataToReservedHeaderAreas (HWND hwndDlg, HANDLE dev, CRYPTO_INFO *cryptoInfo, uint64 dataAreaSize, BOOL bPrimaryOnly, BOOL bBackupOnly, BOOL bInPlaceEnc)
{
char temporaryKey[MASTER_KEYDATA_SIZE];
char originalK2[MASTER_KEYDATA_SIZE];
@@ -1216,6 +1298,13 @@ int WriteRandomDataToReservedHeaderAreas (HWND hwndDlg, HANDLE dev, CRYPTO_INFO
goto final_seq;
}
+ if (backupHeaders || !bInPlaceEnc)
+ {
+ // encrypt random data instead of existing data for better entropy, except in case of primary
+ // header of an in-place encrypted disk
+ RandgetBytes (hwndDlg, buf + TC_VOLUME_HEADER_EFFECTIVE_SIZE, sizeof (buf) - TC_VOLUME_HEADER_EFFECTIVE_SIZE, FALSE);
+ }
+
EncryptBuffer (buf + TC_VOLUME_HEADER_EFFECTIVE_SIZE, sizeof (buf) - TC_VOLUME_HEADER_EFFECTIVE_SIZE, cryptoInfo);
if (!SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
@@ -1267,4 +1356,5 @@ final_seq:
return nStatus;
}
+#endif // !defined(_UEFI)
#endif // !defined (DEVICE_DRIVER) && !defined (TC_WINDOWS_BOOT)
diff --git a/src/Common/Volumes.h b/src/Common/Volumes.h
index fdd1444f..68ba6720 100644
--- a/src/Common/Volumes.h
+++ b/src/Common/Volumes.h
@@ -1,11 +1,11 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -19,7 +19,7 @@ extern "C" {
#endif
// Volume header version
-#define VOLUME_HEADER_VERSION 0x0005
+#define VOLUME_HEADER_VERSION 0x0005
// Version number written to volume header during format;
// specifies the minimum program version required to mount the volume
@@ -101,7 +101,7 @@ extern "C" {
#define HEADER_SALT_OFFSET 0
#define HEADER_ENCRYPTED_DATA_OFFSET PKCS5_SALT_SIZE
#define HEADER_MASTER_KEYDATA_OFFSET 256
-
+
#define TC_HEADER_OFFSET_MAGIC 64
#define TC_HEADER_OFFSET_VERSION 68
#define TC_HEADER_OFFSET_REQUIRED_VERSION 70
@@ -130,20 +130,24 @@ extern BOOL ReadVolumeHeaderRecoveryMode;
uint16 GetHeaderField16 (byte *header, int offset);
uint32 GetHeaderField32 (byte *header, int offset);
UINT64_STRUCT GetHeaderField64 (byte *header, int offset);
-#ifdef TC_WINDOWS_BOOT
+#if defined(TC_WINDOWS_BOOT)
int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int pim, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo);
+#elif defined(_UEFI)
+int ReadVolumeHeader(BOOL bBoot, char *encryptedHeader, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo);
+int CreateVolumeHeaderInMemory(BOOL bBoot, char *encryptedHeader, int ea, int mode, Password *password, int pkcs5_prf, int pim, char *masterKeydata, PCRYPTO_INFO *retInfo, unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize, unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode);
+BOOL RandgetBytes(unsigned char *buf, int len, BOOL forceSlowPoll);
#else
int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo);
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(_UEFI)
void ComputeBootloaderFingerprint (byte *bootLoaderBuf, unsigned int bootLoaderSize, byte* fingerprint);
#endif
#endif
-#if !defined (DEVICE_DRIVER) && !defined (TC_WINDOWS_BOOT)
+#if !defined (DEVICE_DRIVER) && !defined (TC_WINDOWS_BOOT) && !defined(_UEFI)
int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *encryptedHeader, int ea, int mode, Password *password, int pkcs5_prf, int pim, char *masterKeydata, PCRYPTO_INFO *retInfo, unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize, unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode);
BOOL ReadEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header, DWORD *bytesRead);
BOOL WriteEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header);
-int WriteRandomDataToReservedHeaderAreas (HWND hwndDlg, HANDLE dev, CRYPTO_INFO *cryptoInfo, uint64 dataAreaSize, BOOL bPrimaryOnly, BOOL bBackupOnly);
+int WriteRandomDataToReservedHeaderAreas (HWND hwndDlg, HANDLE dev, CRYPTO_INFO *cryptoInfo, uint64 dataAreaSize, BOOL bPrimaryOnly, BOOL bBackupOnly, BOOL bInPlaceEnc);
#endif
#endif // !TC_HEADER_Volume_VolumeHeader
diff --git a/src/Common/XUnzip.cpp b/src/Common/XUnzip.cpp
new file mode 100644
index 00000000..913f4408
--- /dev/null
+++ b/src/Common/XUnzip.cpp
@@ -0,0 +1,4405 @@
+// XUnzip.cpp Version 1.3
+//
+// Authors: Mark Adler et al. (see below)
+//
+// Modified by: Lucian Wischik
+// lu@wischik.com
+//
+// Version 1.0 - Turned C files into just a single CPP file
+// - Made them compile cleanly as C++ files
+// - Gave them simpler APIs
+// - Added the ability to zip/unzip directly in memory without
+// any intermediate files
+//
+// Modified by: Hans Dietrich
+// hdietrich@gmail.com
+//
+// Version 1.3: - Corrected size bug introduced by 1.2
+//
+// Version 1.2: - Many bug fixes. See CodeProject article for list.
+//
+// Version 1.1: - Added Unicode support to CreateZip() and ZipAdd()
+// - Changed file names to avoid conflicts with Lucian's files
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Lucian Wischik's comments:
+// --------------------------
+// THIS FILE is almost entirely based upon code by Info-ZIP.
+// It has been modified by Lucian Wischik.
+// The original code may be found at http://www.info-zip.org
+// The original copyright text follows.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Original authors' comments:
+// ---------------------------
+// This is version 2002-Feb-16 of the Info-ZIP copyright and license. The
+// definitive version of this document should be available at
+// ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely.
+//
+// Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
+//
+// For the purposes of this copyright and license, "Info-ZIP" is defined as
+// the following set of individuals:
+//
+// Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
+// Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase,
+// Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
+// David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
+// Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
+// Kai Uwe Rommel, Steve Salisbury, Dave Smith, Christian Spieler,
+// Antoine Verheijen, Paul von Behren, Rich Wales, Mike White
+//
+// This software is provided "as is", without warranty of any kind, express
+// or implied. In no event shall Info-ZIP or its contributors be held liable
+// for any direct, indirect, incidental, special or consequential damages
+// arising out of the use of or inability to use this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// definition, disclaimer, and this list of conditions.
+//
+// 2. Redistributions in binary form (compiled executables) must reproduce
+// the above copyright notice, definition, disclaimer, and this list of
+// conditions in documentation and/or other materials provided with the
+// distribution. The sole exception to this condition is redistribution
+// of a standard UnZipSFX binary as part of a self-extracting archive;
+// that is permitted without inclusion of this license, as long as the
+// normal UnZipSFX banner has not been removed from the binary or disabled.
+//
+// 3. Altered versions--including, but not limited to, ports to new
+// operating systems, existing ports with new graphical interfaces, and
+// dynamic, shared, or static library versions--must be plainly marked
+// as such and must not be misrepresented as being the original source.
+// Such altered versions also must not be misrepresented as being
+// Info-ZIP releases--including, but not limited to, labeling of the
+// altered versions with the names "Info-ZIP" (or any variation thereof,
+// including, but not limited to, different capitalizations),
+// "Pocket UnZip", "WiZ" or "MacZip" without the explicit permission of
+// Info-ZIP. Such altered versions are further prohibited from
+// misrepresentative use of the Zip-Bugs or Info-ZIP e-mail addresses or
+// of the Info-ZIP URL(s).
+//
+// 4. Info-ZIP retains the right to use the names "Info-ZIP", "Zip", "UnZip",
+// "UnZipSFX", "WiZ", "Pocket UnZip", "Pocket Zip", and "MacZip" for its
+// own source and binary releases.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WIN64
+#define _USE_32BIT_TIME_T //+++1.2
+#endif
+
+
+#define STRICT
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <tchar.h>
+#include "XUnzip.h"
+
+#pragma warning(disable : 4996) // disable bogus deprecation warning
+
+// THIS FILE is almost entirely based upon code by Jean-loup Gailly
+// and Mark Adler. It has been modified by Lucian Wischik.
+// The original code may be found at http://www.gzip.org/zlib/
+// The original copyright text follows.
+//
+//
+//
+// zlib.h -- interface of the 'zlib' general purpose compression library
+// version 1.1.3, July 9th, 1998
+//
+// Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would be
+// appreciated but is not required.
+// 2. Altered source versions must be plainly marked as such, and must not be
+// misrepresented as being the original software.
+// 3. This notice may not be removed or altered from any source distribution.
+//
+// Jean-loup Gailly Mark Adler
+// jloup@gzip.org madler@alumni.caltech.edu
+//
+//
+// The data format used by the zlib library is described by RFCs (Request for
+// Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
+// (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+//
+//
+// The 'zlib' compression library provides in-memory compression and
+// decompression functions, including integrity checks of the uncompressed
+// data. This version of the library supports only one compression method
+// (deflation) but other algorithms will be added later and will have the same
+// stream interface.
+//
+// Compression can be done in a single step if the buffers are large
+// enough (for example if an input file is mmap'ed), or can be done by
+// repeated calls of the compression function. In the latter case, the
+// application must provide more input and/or consume the output
+// (providing more output space) before each call.
+//
+// The library also supports reading and writing files in gzip (.gz) format
+// with an interface similar to that of stdio.
+//
+// The library does not install any signal handler. The decoder checks
+// the consistency of the compressed data, so the library should never
+// crash even in case of corrupted input.
+//
+// for more info about .ZIP format, see ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
+// PkWare has also a specification at ftp://ftp.pkware.com/probdesc.zip
+
+#define zmalloc(len) malloc(len)
+
+#define zfree(p) free(p)
+
+/*
+void *zmalloc(unsigned int len)
+{ char *buf = new char[len+32];
+ for (int i=0; i<16; i++)
+ { buf[i]=i;
+ buf[len+31-i]=i;
+ }
+ *((unsigned int*)buf) = len;
+ char c[1000]; wsprintf(c,"malloc 0x%lx - %lu",buf+16,len);
+ OutputDebugString(c);
+ return buf+16;
+}
+
+void zfree(void *buf)
+{ char c[1000]; wsprintf(c,"free 0x%lx",buf);
+ OutputDebugString(c);
+ char *p = ((char*)buf)-16;
+ unsigned int len = *((unsigned int*)p);
+ bool blown=false;
+ for (int i=0; i<16; i++)
+ { char lo = p[i];
+ char hi = p[len+31-i];
+ if (hi!=i || (lo!=i && i>4)) blown=true;
+ }
+ if (blown)
+ { OutputDebugString("BLOWN!!!");
+ }
+ delete[] p;
+}
+*/
+
+#pragma warning(disable : 4702) // unreachable code
+
+static ZRESULT zopenerror = ZR_OK; //+++1.2
+
+typedef struct tm_unz_s
+{ unsigned int tm_sec; // seconds after the minute - [0,59]
+ unsigned int tm_min; // minutes after the hour - [0,59]
+ unsigned int tm_hour; // hours since midnight - [0,23]
+ unsigned int tm_mday; // day of the month - [1,31]
+ unsigned int tm_mon; // months since January - [0,11]
+ unsigned int tm_year; // years - [1980..2044]
+} tm_unz;
+
+
+// unz_global_info structure contain global data about the ZIPfile
+typedef struct unz_global_info_s
+{ unsigned long number_entry; // total number of entries in the central dir on this disk
+ unsigned long size_comment; // size of the global comment of the zipfile
+} unz_global_info;
+
+// unz_file_info contain information about a file in the zipfile
+typedef struct unz_file_info_s
+{ unsigned long version; // version made by 2 bytes
+ unsigned long version_needed; // version needed to extract 2 bytes
+ unsigned long flag; // general purpose bit flag 2 bytes
+ unsigned long compression_method; // compression method 2 bytes
+ unsigned long dosDate; // last mod file date in Dos fmt 4 bytes
+ unsigned long crc; // crc-32 4 bytes
+ unsigned long compressed_size; // compressed size 4 bytes
+ unsigned long uncompressed_size; // uncompressed size 4 bytes
+ unsigned long size_filename; // filename length 2 bytes
+ unsigned long size_file_extra; // extra field length 2 bytes
+ unsigned long size_file_comment; // file comment length 2 bytes
+ unsigned long disk_num_start; // disk number start 2 bytes
+ unsigned long internal_fa; // internal file attributes 2 bytes
+ unsigned long external_fa; // external file attributes 4 bytes
+ tm_unz tmu_date;
+} unz_file_info;
+
+
+#define UNZ_OK (0)
+#define UNZ_END_OF_LIST_OF_FILE (-100)
+#define UNZ_ERRNO (Z_ERRNO)
+#define UNZ_EOF (0)
+#define UNZ_PARAMERROR (-102)
+#define UNZ_BADZIPFILE (-103)
+#define UNZ_INTERNALERROR (-104)
+#define UNZ_CRCERROR (-105)
+
+
+
+
+
+
+
+#define ZLIB_VERSION "1.1.3"
+
+
+// Allowed flush values; see deflate() for details
+#define Z_NO_FLUSH 0
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+
+
+// compression levels
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+
+// compression strategy; see deflateInit2() for details
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+
+// Possible values of the data_type field
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+
+// The deflate compression method (the only one supported in this version)
+#define Z_DEFLATED 8
+
+// for initializing zalloc, zfree, opaque
+#define Z_NULL 0
+
+// case sensitivity when searching for filenames
+#define CASE_SENSITIVE 1
+#define CASE_INSENSITIVE 2
+
+
+// Return codes for the compression/decompression functions. Negative
+// values are errors, positive values are used for special but normal events.
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+
+
+
+// Basic data types
+typedef unsigned char Byte; // 8 bits
+typedef unsigned int uInt; // 16 bits or more
+typedef unsigned long uLong; // 32 bits or more
+typedef void *voidpf;
+typedef void *voidp;
+typedef long z_off_t;
+
+
+
+
+
+
+
+
+
+
+
+
+typedef voidpf (*alloc_func) (voidpf opaque, uInt items, uInt size);
+typedef void (*free_func) (voidpf opaque, voidpf address);
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Byte *next_in; // next input byte
+ uInt avail_in; // number of bytes available at next_in
+ uLong total_in; // total nb of input bytes read so far
+
+ Byte *next_out; // next output byte should be put there
+ uInt avail_out; // remaining free space at next_out
+ uLong total_out; // total nb of bytes output so far
+
+ char *msg; // last error message, NULL if no error
+ struct internal_state *state; // not visible by applications
+
+ alloc_func zalloc; // used to allocate the internal state
+ free_func zfree; // used to free the internal state
+ voidpf opaque; // private data object passed to zalloc and zfree
+
+ int data_type; // best guess about the data type: ascii or binary
+ uLong adler; // adler32 value of the uncompressed data
+ uLong reserved; // reserved for future use
+} z_stream;
+
+typedef z_stream *z_streamp;
+
+
+// The application must update next_in and avail_in when avail_in has
+// dropped to zero. It must update next_out and avail_out when avail_out
+// has dropped to zero. The application must initialize zalloc, zfree and
+// opaque before calling the init function. All other fields are set by the
+// compression library and must not be updated by the application.
+//
+// The opaque value provided by the application will be passed as the first
+// parameter for calls of zalloc and zfree. This can be useful for custom
+// memory management. The compression library attaches no meaning to the
+// opaque value.
+//
+// zalloc must return Z_NULL if there is not enough memory for the object.
+// If zlib is used in a multi-threaded application, zalloc and zfree must be
+// thread safe.
+//
+// The fields total_in and total_out can be used for statistics or
+// progress reports. After compression, total_in holds the total size of
+// the uncompressed data and may be saved for use in the decompressor
+// (particularly if the decompressor wants to decompress everything in
+// a single step).
+//
+
+
+// basic functions
+
+const char *zlibVersion ();
+// The application can compare zlibVersion and ZLIB_VERSION for consistency.
+// If the first character differs, the library code actually used is
+// not compatible with the zlib.h header file used by the application.
+// This check is automatically made by inflateInit.
+
+
+
+
+
+
+int inflate (z_streamp strm, int flush);
+//
+// inflate decompresses as much data as possible, and stops when the input
+// buffer becomes empty or the output buffer becomes full. It may some
+// introduce some output latency (reading input without producing any output)
+// except when forced to flush.
+//
+// The detailed semantics are as follows. inflate performs one or both of the
+// following actions:
+//
+// - Decompress more input starting at next_in and update next_in and avail_in
+// accordingly. If not all input can be processed (because there is not
+// enough room in the output buffer), next_in is updated and processing
+// will resume at this point for the next call of inflate().
+//
+// - Provide more output starting at next_out and update next_out and avail_out
+// accordingly. inflate() provides as much output as possible, until there
+// is no more input data or no more space in the output buffer (see below
+// about the flush parameter).
+//
+// Before the call of inflate(), the application should ensure that at least
+// one of the actions is possible, by providing more input and/or consuming
+// more output, and updating the next_* and avail_* values accordingly.
+// The application can consume the uncompressed output when it wants, for
+// example when the output buffer is full (avail_out == 0), or after each
+// call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+// must be called again after making room in the output buffer because there
+// might be more output pending.
+//
+// If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
+// output as possible to the output buffer. The flushing behavior of inflate is
+// not specified for values of the flush parameter other than Z_SYNC_FLUSH
+// and Z_FINISH, but the current implementation actually flushes as much output
+// as possible anyway.
+//
+// inflate() should normally be called until it returns Z_STREAM_END or an
+// error. However if all decompression is to be performed in a single step
+// (a single call of inflate), the parameter flush should be set to
+// Z_FINISH. In this case all pending input is processed and all pending
+// output is flushed; avail_out must be large enough to hold all the
+// uncompressed data. (The size of the uncompressed data may have been saved
+// by the compressor for this purpose.) The next operation on this stream must
+// be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+// is never required, but can be used to inform inflate that a faster routine
+// may be used for the single inflate() call.
+//
+// If a preset dictionary is needed at this point (see inflateSetDictionary
+// below), inflate sets strm-adler to the adler32 checksum of the
+// dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+// it sets strm->adler to the adler32 checksum of all output produced
+// so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+// an error code as described below. At the end of the stream, inflate()
+// checks that its computed adler32 checksum is equal to that saved by the
+// compressor and returns Z_STREAM_END only if the checksum is correct.
+//
+// inflate() returns Z_OK if some progress has been made (more input processed
+// or more output produced), Z_STREAM_END if the end of the compressed data has
+// been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+// preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+// corrupted (input stream not conforming to the zlib format or incorrect
+// adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+// (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+// enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+// enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+// case, the application may then call inflateSync to look for a good
+// compression block.
+//
+
+
+int inflateEnd (z_streamp strm);
+//
+// All dynamically allocated data structures for this stream are freed.
+// This function discards any unprocessed input and does not flush any
+// pending output.
+//
+// inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+// was inconsistent. In the error case, msg may be set but then points to a
+// static string (which must not be deallocated).
+
+ // Advanced functions
+
+// The following functions are needed only in some special applications.
+
+
+
+
+
+int inflateSetDictionary (z_streamp strm,
+ const Byte *dictionary,
+ uInt dictLength);
+//
+// Initializes the decompression dictionary from the given uncompressed byte
+// sequence. This function must be called immediately after a call of inflate
+// if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+// can be determined from the Adler32 value returned by this call of
+// inflate. The compressor and decompressor must use exactly the same
+// dictionary.
+//
+// inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+// parameter is invalid (such as NULL dictionary) or the stream state is
+// inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+// expected one (incorrect Adler32 value). inflateSetDictionary does not
+// perform any decompression: this will be done by subsequent calls of
+// inflate().
+
+
+int inflateSync (z_streamp strm);
+//
+// Skips invalid compressed data until a full flush point can be found, or until all
+// available input is skipped. No output is provided.
+//
+// inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+// if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+// or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+// case, the application may save the current current value of total_in which
+// indicates where valid compressed data was found. In the error case, the
+// application may repeatedly call inflateSync, providing more input each time,
+// until success or end of the input data.
+
+
+int inflateReset (z_streamp strm);
+// This function is equivalent to inflateEnd followed by inflateInit,
+// but does not free and reallocate all the internal decompression state.
+// The stream will keep attributes that may have been set by inflateInit2.
+//
+// inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+// stream state was inconsistent (such as zalloc or state being NULL).
+//
+
+
+
+// checksum functions
+// These functions are not related to compression but are exported
+// anyway because they might be useful in applications using the
+// compression library.
+
+uLong adler32 (uLong adler, const Byte *buf, uInt len);
+// Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+// return the updated checksum. If buf is NULL, this function returns
+// the required initial value for the checksum.
+// An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+// much faster. Usage example:
+//
+// uLong adler = adler32(0L, Z_NULL, 0);
+//
+// while (read_buffer(buffer, length) != EOF) {
+// adler = adler32(adler, buffer, length);
+// }
+// if (adler != original_adler) error();
+
+uLong ucrc32 (uLong crc, const Byte *buf, uInt len);
+// Update a running crc with the bytes buf[0..len-1] and return the updated
+// crc. If buf is NULL, this function returns the required initial value
+// for the crc. Pre- and post-conditioning (one's complement) is performed
+// within this function so it shouldn't be done by the application.
+// Usage example:
+//
+// uLong crc = crc32(0L, Z_NULL, 0);
+//
+// while (read_buffer(buffer, length) != EOF) {
+// crc = crc32(crc, buffer, length);
+// }
+// if (crc != original_crc) error();
+
+
+
+
+const char *zError (int err);
+int inflateSyncPoint (z_streamp z);
+const uLong *get_crc_table (void);
+
+
+
+typedef unsigned char uch;
+typedef uch uchf;
+typedef unsigned short ush;
+typedef ush ushf;
+typedef unsigned long ulg;
+
+
+
+const char * const z_errmsg[10] = { // indexed by 2-zlib_error
+"need dictionary", // Z_NEED_DICT 2
+"stream end", // Z_STREAM_END 1
+"", // Z_OK 0
+"file error", // Z_ERRNO (-1)
+"stream error", // Z_STREAM_ERROR (-2)
+"data error", // Z_DATA_ERROR (-3)
+"insufficient memory", // Z_MEM_ERROR (-4)
+"buffer error", // Z_BUF_ERROR (-5)
+"incompatible version",// Z_VERSION_ERROR (-6)
+""};
+
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+ return (strm->msg = (char*)ERR_MSG(err), (err))
+// To be used only when the state is known to be valid
+
+ // common constants
+
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+// The three kinds of block type
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+// The minimum and maximum match lengths
+
+#define PRESET_DICT 0x20 // preset dictionary flag in zlib header
+
+ // target dependencies
+
+#define OS_CODE 0x0b // Window 95 & Windows NT
+
+
+
+ // functions
+
+#define zmemzero(dest, len) memset(dest, 0, len)
+
+// Diagnostic functions
+#undef Assert
+#undef Trace
+#undef Tracev
+#undef Tracevv
+#undef Tracec
+#undef Tracecv
+
+#ifdef DEBUG
+
+ int z_verbose = 0;
+ void z_error (char *m) {fprintf(stderr, "%s\n", m); exit(1);}
+
+#define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+#define Trace(x) {if (z_verbose>=0) fprintf x ;}
+#define Tracev(x) {if (z_verbose>0) fprintf x ;}
+#define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+#define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+#define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+
+#else
+
+#ifndef __noop
+#if _MSC_VER < 1300
+#define __noop ((void)0)
+#endif
+#endif
+
+#define Assert(cond,msg) __noop
+#define Trace(x) __noop
+#define Tracev(x) __noop
+#define Tracevv(x) __noop
+#define Tracec(c,x) __noop
+#define Tracecv(c,x) __noop
+
+#endif
+
+
+typedef uLong (*check_func) (uLong check, const Byte *buf, uInt len);
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size);
+void zcfree (voidpf opaque, voidpf ptr);
+
+#define ZALLOC(strm, items, size) \
+ (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+
+//void ZFREE(z_streamp strm,voidpf addr)
+//{ *((strm)->zfree))((strm)->opaque, addr);
+//}
+
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+
+
+
+// Huffman code lookup table entry--this entry is four bytes for machines
+// that have 16-bit pointers (e.g. PC's in the small or medium model).
+
+
+typedef struct inflate_huft_s inflate_huft;
+
+struct inflate_huft_s {
+ union {
+ struct {
+ Byte Exop; // number of extra bits or operation
+ Byte Bits; // number of bits in this code or subcode
+ } what;
+ uInt pad; // pad structure to a power of 2 (4 bytes for
+ } word; // 16-bit, 8 bytes for 32-bit int's)
+ uInt base; // literal, length base, distance base, or table offset
+};
+
+// Maximum size of dynamic tree. The maximum found in a long but non-
+// exhaustive search was 1004 huft structures (850 for length/literals
+// and 154 for distances, the latter actually the result of an
+// exhaustive search). The actual maximum is not known, but the
+// value below is more than safe.
+#define MANY 1440
+
+int inflate_trees_bits (
+ uInt *, // 19 code lengths
+ uInt *, // bits tree desired/actual depth
+ inflate_huft * *, // bits tree result
+ inflate_huft *, // space for trees
+ z_streamp); // for messages
+
+int inflate_trees_dynamic (
+ uInt, // number of literal/length codes
+ uInt, // number of distance codes
+ uInt *, // that many (total) code lengths
+ uInt *, // literal desired/actual bit depth
+ uInt *, // distance desired/actual bit depth
+ inflate_huft * *, // literal/length tree result
+ inflate_huft * *, // distance tree result
+ inflate_huft *, // space for trees
+ z_streamp); // for messages
+
+int inflate_trees_fixed (
+ uInt *, // literal desired/actual bit depth
+ uInt *, // distance desired/actual bit depth
+ const inflate_huft * *, // literal/length tree result
+ const inflate_huft * *, // distance tree result
+ z_streamp); // for memory allocation
+
+
+
+
+
+struct inflate_blocks_state;
+typedef struct inflate_blocks_state inflate_blocks_statef;
+
+inflate_blocks_statef * inflate_blocks_new (
+ z_streamp z,
+ check_func c, // check function
+ uInt w); // window size
+
+int inflate_blocks (
+ inflate_blocks_statef *,
+ z_streamp ,
+ int); // initial return code
+
+void inflate_blocks_reset (
+ inflate_blocks_statef *,
+ z_streamp ,
+ uLong *); // check value on output
+
+int inflate_blocks_free (
+ inflate_blocks_statef *,
+ z_streamp);
+
+void inflate_set_dictionary (
+ inflate_blocks_statef *s,
+ const Byte *d, // dictionary
+ uInt n); // dictionary length
+
+int inflate_blocks_sync_point (
+ inflate_blocks_statef *s);
+
+
+
+
+struct inflate_codes_state;
+typedef struct inflate_codes_state inflate_codes_statef;
+
+inflate_codes_statef *inflate_codes_new (
+ uInt, uInt,
+ const inflate_huft *, const inflate_huft *,
+ z_streamp );
+
+int inflate_codes (
+ inflate_blocks_statef *,
+ z_streamp ,
+ int);
+
+void inflate_codes_free (
+ inflate_codes_statef *,
+ z_streamp );
+
+
+
+
+typedef enum {
+ IBM_TYPE, // get type bits (3, including end bit)
+ IBM_LENS, // get lengths for stored
+ IBM_STORED, // processing stored block
+ IBM_TABLE, // get table lengths
+ IBM_BTREE, // get bit lengths tree for a dynamic block
+ IBM_DTREE, // get length, distance trees for a dynamic block
+ IBM_CODES, // processing fixed or dynamic block
+ IBM_DRY, // output remaining window bytes
+ IBM_DONE, // finished last block, done
+ IBM_BAD} // got a data error--stuck here
+inflate_block_mode;
+
+// inflate blocks semi-private state
+struct inflate_blocks_state {
+
+ // mode
+ inflate_block_mode mode; // current inflate_block mode
+
+ // mode dependent information
+ union {
+ uInt left; // if STORED, bytes left to copy
+ struct {
+ uInt table; // table lengths (14 bits)
+ uInt index; // index into blens (or border)
+ uInt *blens; // bit lengths of codes
+ uInt bb; // bit length tree depth
+ inflate_huft *tb; // bit length decoding tree
+ } trees; // if DTREE, decoding info for trees
+ struct {
+ inflate_codes_statef
+ *codes;
+ } decode; // if CODES, current state
+ } sub; // submode
+ uInt last; // true if this block is the last block
+
+ // mode independent information
+ uInt bitk; // bits in bit buffer
+ uLong bitb; // bit buffer
+ inflate_huft *hufts; // single malloc for tree space
+ Byte *window; // sliding window
+ Byte *end; // one byte after sliding window
+ Byte *read; // window read pointer
+ Byte *write; // window write pointer
+ check_func checkfn; // check function
+ uLong check; // check on output
+
+};
+
+
+// defines for inflate input/output
+// update pointers and return
+#define UPDBITS {s->bitb=b;s->bitk=k;}
+#define UPDIN {z->avail_in=n;z->total_in+=(uLong)(p-z->next_in);z->next_in=p;}
+#define UPDOUT {s->write=q;}
+#define UPDATE {UPDBITS UPDIN UPDOUT}
+#define LEAVE {UPDATE return inflate_flush(s,z,r);}
+// get bytes and bits
+#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
+#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
+#define NEXTBYTE (n--,*p++)
+#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define DUMPBITS(j) {b>>=(j);k-=(j);}
+// output bytes
+#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
+#define LOADOUT {q=s->write;m=(uInt)WAVAIL;m;}
+#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
+#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
+#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
+#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
+// load local pointers
+#define LOAD {LOADIN LOADOUT}
+
+// masks for lower bits (size given to avoid silly warnings with Visual C++)
+// And'ing with mask[n] masks the lower n bits
+const uInt inflate_mask[17] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
+};
+
+// copy as much as possible from the sliding window to the output area
+int inflate_flush (inflate_blocks_statef *, z_streamp, int);
+
+int inflate_fast (uInt, uInt, const inflate_huft *, const inflate_huft *, inflate_blocks_statef *, z_streamp );
+
+
+
+const uInt fixed_bl = 9;
+const uInt fixed_bd = 5;
+const inflate_huft fixed_tl[] = {
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
+ };
+const inflate_huft fixed_td[] = {
+ {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
+ {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
+ {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
+ {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
+ {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
+ {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
+ {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
+ {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
+ };
+
+
+
+
+
+
+
+// copy as much as possible from the sliding window to the output area
+int inflate_flush(inflate_blocks_statef *s,z_streamp z,int r)
+{
+ uInt n;
+ Byte *p;
+ Byte *q;
+
+ // local copies of source and destination pointers
+ p = z->next_out;
+ q = s->read;
+
+ // compute number of bytes to copy as far as end of window
+ n = (uInt)((q <= s->write ? s->write : s->end) - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ // update counters
+ z->avail_out -= n;
+ z->total_out += n;
+
+ // update check information
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ // copy as far as end of window
+ if (n!=0) // check for n!=0 to avoid waking up CodeGuard
+ { memcpy(p, q, n);
+ p += n;
+ q += n;
+ }
+
+ // see if more to copy at beginning of window
+ if (q == s->end)
+ {
+ // wrap pointers
+ q = s->window;
+ if (s->write == s->end)
+ s->write = s->window;
+
+ // compute bytes to copy
+ n = (uInt)(s->write - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ // update counters
+ z->avail_out -= n;
+ z->total_out += n;
+
+ // update check information
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ // copy
+ memcpy(p, q, n);
+ p += n;
+ q += n;
+ }
+
+ // update pointers
+ z->next_out = p;
+ s->read = q;
+
+ // done
+ return r;
+}
+
+
+
+
+
+
+// simplify the use of the inflate_huft type with some defines
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+typedef enum { // waiting for "i:"=input, "o:"=output, "x:"=nothing
+ START, // x: set up for LEN
+ LEN, // i: get length/literal/eob next
+ LENEXT, // i: getting length extra (have base)
+ DIST, // i: get distance next
+ DISTEXT, // i: getting distance extra
+ COPY, // o: copying bytes in window, waiting for space
+ LIT, // o: got literal, waiting for output space
+ WASH, // o: got eob, possibly still output waiting
+ END, // x: got eob and all data flushed
+ BADCODE} // x: got error
+inflate_codes_mode;
+
+// inflate codes private state
+struct inflate_codes_state {
+
+ // mode
+ inflate_codes_mode mode; // current inflate_codes mode
+
+ // mode dependent information
+ uInt len;
+ union {
+ struct {
+ const inflate_huft *tree; // pointer into tree
+ uInt need; // bits needed
+ } code; // if LEN or DIST, where in tree
+ uInt lit; // if LIT, literal
+ struct {
+ uInt get; // bits to get for extra
+ uInt dist; // distance back to copy from
+ } copy; // if EXT or COPY, where and how much
+ } sub; // submode
+
+ // mode independent information
+ Byte lbits; // ltree bits decoded per branch
+ Byte dbits; // dtree bits decoder per branch
+ const inflate_huft *ltree; // literal/length/eob tree
+ const inflate_huft *dtree; // distance tree
+
+};
+
+
+inflate_codes_statef *inflate_codes_new(
+uInt bl, uInt bd,
+const inflate_huft *tl,
+const inflate_huft *td, // need separate declaration for Borland C++
+z_streamp z)
+{
+ inflate_codes_statef *c;
+
+ if ((c = (inflate_codes_statef *)
+ ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
+ {
+ c->mode = START;
+ c->lbits = (Byte)bl;
+ c->dbits = (Byte)bd;
+ c->ltree = tl;
+ c->dtree = td;
+ Tracev((stderr, "inflate: codes new\n"));
+ }
+ return c;
+}
+
+
+int inflate_codes(inflate_blocks_statef *s, z_streamp z, int r)
+{
+ uInt j; // temporary storage
+ const inflate_huft *t; // temporary pointer
+ uInt e; // extra bits or operation
+ uLong b; // bit buffer
+ uInt k; // bits in bit buffer
+ Byte *p; // input data pointer
+ uInt n; // bytes available there
+ Byte *q; // output window write pointer
+ uInt m; // bytes to end of window or read pointer
+ Byte *f; // pointer to copy strings from
+ inflate_codes_statef *c = s->sub.decode.codes; // codes state
+
+ // copy input/output information to locals (UPDATE macro restores)
+ LOAD
+
+ // process input and output based on current state
+ for(;;) switch (c->mode)
+ { // waiting for "i:"=input, "o:"=output, "x:"=nothing
+ case START: // x: set up for LEN
+#ifndef SLOW
+ if (m >= 258 && n >= 10)
+ {
+ UPDATE
+ r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
+ LOAD
+ if (r != Z_OK)
+ {
+ c->mode = r == Z_STREAM_END ? WASH : BADCODE;
+ break;
+ }
+ }
+#endif // !SLOW
+ c->sub.code.need = c->lbits;
+ c->sub.code.tree = c->ltree;
+ c->mode = LEN;
+ case LEN: // i: get length/literal/eob next
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e == 0) // literal
+ {
+ c->sub.lit = t->base;
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", t->base));
+ c->mode = LIT;
+ break;
+ }
+ if (e & 16) // length
+ {
+ c->sub.copy.get = e & 15;
+ c->len = t->base;
+ c->mode = LENEXT;
+ break;
+ }
+ if ((e & 64) == 0) // next table
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ if (e & 32) // end of block
+ {
+ Tracevv((stderr, "inflate: end of block\n"));
+ c->mode = WASH;
+ break;
+ }
+ c->mode = BADCODE; // invalid code
+ z->msg = (char*)"invalid literal/length code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case LENEXT: // i: getting length extra (have base)
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->len += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ c->sub.code.need = c->dbits;
+ c->sub.code.tree = c->dtree;
+ Tracevv((stderr, "inflate: length %u\n", c->len));
+ c->mode = DIST;
+ case DIST: // i: get distance next
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e & 16) // distance
+ {
+ c->sub.copy.get = e & 15;
+ c->sub.copy.dist = t->base;
+ c->mode = DISTEXT;
+ break;
+ }
+ if ((e & 64) == 0) // next table
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ c->mode = BADCODE; // invalid code
+ z->msg = (char*)"invalid distance code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case DISTEXT: // i: getting distance extra
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->sub.copy.dist += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
+ c->mode = COPY;
+ case COPY: // o: copying bytes in window, waiting for space
+ f = (uInt)(q - s->window) < c->sub.copy.dist ?
+ s->end - (c->sub.copy.dist - (q - s->window)) :
+ q - c->sub.copy.dist;
+ while (c->len)
+ {
+ NEEDOUT
+ OUTBYTE(*f++)
+ if (f == s->end)
+ f = s->window;
+ c->len--;
+ }
+ c->mode = START;
+ break;
+ case LIT: // o: got literal, waiting for output space
+ NEEDOUT
+ OUTBYTE(c->sub.lit)
+ c->mode = START;
+ break;
+ case WASH: // o: got eob, possibly more output
+ if (k > 7) // return unused byte, if any
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes");
+ k -= 8;
+ n++;
+ p--; // can always return one
+ }
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ c->mode = END;
+ case END:
+ r = Z_STREAM_END;
+ LEAVE
+ case BADCODE: // x: got error
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+}
+
+
+void inflate_codes_free(inflate_codes_statef *c,z_streamp z)
+{ ZFREE(z, c);
+ Tracev((stderr, "inflate: codes free\n"));
+}
+
+
+
+// infblock.c -- interpret and process block types to last block
+// Copyright (C) 1995-1998 Mark Adler
+// For conditions of distribution and use, see copyright notice in zlib.h
+
+//struct inflate_codes_state {int dummy;}; // for buggy compilers
+
+
+
+// Table for deflate from PKZIP's appnote.txt.
+const uInt border[] = { // Order of the bit length code lengths
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+//
+// Notes beyond the 1.93a appnote.txt:
+//
+// 1. Distance pointers never point before the beginning of the output stream.
+// 2. Distance pointers can point back across blocks, up to 32k away.
+// 3. There is an implied maximum of 7 bits for the bit length table and
+// 15 bits for the actual data.
+// 4. If only one code exists, then it is encoded using one bit. (Zero
+// would be more efficient, but perhaps a little confusing.) If two
+// codes exist, they are coded using one bit each (0 and 1).
+// 5. There is no way of sending zero distance codes--a dummy must be
+// sent if there are none. (History: a pre 2.0 version of PKZIP would
+// store blocks with no distance codes, but this was discovered to be
+// too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
+// zero distance codes, which is sent as one code of zero bits in
+// length.
+// 6. There are up to 286 literal/length codes. Code 256 represents the
+// end-of-block. Note however that the static length tree defines
+// 288 codes just to fill out the Huffman codes. Codes 286 and 287
+// cannot be used though, since there is no length base or extra bits
+// defined for them. Similarily, there are up to 30 distance codes.
+// However, static trees define 32 codes (all 5 bits) to fill out the
+// Huffman codes, but the last two had better not show up in the data.
+// 7. Unzip can check dynamic Huffman blocks for complete code sets.
+// The exception is that a single code would not be complete (see #4).
+// 8. The five bits following the block type is really the number of
+// literal codes sent minus 257.
+// 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
+// (1+6+6). Therefore, to output three times the length, you output
+// three codes (1+1+1), whereas to output four times the same length,
+// you only need two codes (1+3). Hmm.
+//10. In the tree reconstruction algorithm, Code = Code + Increment
+// only if BitLength(i) is not zero. (Pretty obvious.)
+//11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
+//12. Note: length code 284 can represent 227-258, but length code 285
+// really is 258. The last length deserves its own, short code
+// since it gets used a lot in very redundant files. The length
+// 258 is special since 258 - 3 (the min match length) is 255.
+//13. The literal/length and distance code bit lengths are read as a
+// single stream of lengths. It is possible (and advantageous) for
+// a repeat code (16, 17, or 18) to go across the boundary between
+// the two sets of lengths.
+
+
+void inflate_blocks_reset(inflate_blocks_statef *s, z_streamp z, uLong *c)
+{
+ if (c != Z_NULL)
+ *c = s->check;
+ if (s->mode == IBM_BTREE || s->mode == IBM_DTREE)
+ ZFREE(z, s->sub.trees.blens);
+ if (s->mode == IBM_CODES)
+ inflate_codes_free(s->sub.decode.codes, z);
+ s->mode = IBM_TYPE;
+ s->bitk = 0;
+ s->bitb = 0;
+ s->read = s->write = s->window;
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(0L, (const Byte *)Z_NULL, 0);
+ Tracev((stderr, "inflate: blocks reset\n"));
+}
+
+
+inflate_blocks_statef *inflate_blocks_new(z_streamp z, check_func c, uInt w)
+{
+ inflate_blocks_statef *s;
+
+ if ((s = (inflate_blocks_statef *)ZALLOC
+ (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
+ return s;
+ if ((s->hufts =
+ (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
+ {
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ if ((s->window = (Byte *)ZALLOC(z, 1, w)) == Z_NULL)
+ {
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ s->end = s->window + w;
+ s->checkfn = c;
+ s->mode = IBM_TYPE;
+ Tracev((stderr, "inflate: blocks allocated\n"));
+ inflate_blocks_reset(s, z, Z_NULL);
+ return s;
+}
+
+
+int inflate_blocks(inflate_blocks_statef *s, z_streamp z, int r)
+{
+ uInt t; // temporary storage
+ uLong b; // bit buffer
+ uInt k; // bits in bit buffer
+ Byte *p; // input data pointer
+ uInt n; // bytes available there
+ Byte *q; // output window write pointer
+ uInt m; // bytes to end of window or read pointer
+
+ // copy input/output information to locals (UPDATE macro restores)
+ LOAD
+
+ // process input based on current state
+ for(;;) switch (s->mode)
+ {
+ case IBM_TYPE:
+ NEEDBITS(3)
+ t = (uInt)b & 7;
+ s->last = t & 1;
+ switch (t >> 1)
+ {
+ case 0: // stored
+ Tracev((stderr, "inflate: stored block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ t = k & 7; // go to byte boundary
+ DUMPBITS(t)
+ s->mode = IBM_LENS; // get length of stored block
+ break;
+ case 1: // fixed
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ s->last ? " (last)" : ""));
+ {
+ uInt bl, bd;
+ const inflate_huft *tl, *td;
+
+ inflate_trees_fixed(&bl, &bd, &tl, &td, z);
+ s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
+ if (s->sub.decode.codes == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ }
+ DUMPBITS(3)
+ s->mode = IBM_CODES;
+ break;
+ case 2: // dynamic
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ s->mode = IBM_TABLE;
+ break;
+ case 3: // illegal
+ DUMPBITS(3)
+ s->mode = IBM_BAD;
+ z->msg = (char*)"invalid block type";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ break;
+ case IBM_LENS:
+ NEEDBITS(32)
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
+ {
+ s->mode = IBM_BAD;
+ z->msg = (char*)"invalid stored block lengths";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ s->sub.left = (uInt)b & 0xffff;
+ b = k = 0; // dump bits
+ Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
+ s->mode = s->sub.left ? IBM_STORED : (s->last ? IBM_DRY : IBM_TYPE);
+ break;
+ case IBM_STORED:
+ if (n == 0)
+ LEAVE
+ NEEDOUT
+ t = s->sub.left;
+ if (t > n) t = n;
+ if (t > m) t = m;
+ memcpy(q, p, t);
+ p += t; n -= t;
+ q += t; m -= t;
+ if ((s->sub.left -= t) != 0)
+ break;
+ Tracev((stderr, "inflate: stored end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ s->mode = s->last ? IBM_DRY : IBM_TYPE;
+ break;
+ case IBM_TABLE:
+ NEEDBITS(14)
+ s->sub.trees.table = t = (uInt)b & 0x3fff;
+ // remove this section to workaround bug in pkzip
+ if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
+ {
+ s->mode = IBM_BAD;
+ z->msg = (char*)"too many length or distance symbols";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ // end remove
+ t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
+ if ((s->sub.trees.blens = (uInt*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ DUMPBITS(14)
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: table sizes ok\n"));
+ s->mode = IBM_BTREE;
+ case IBM_BTREE:
+ while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
+ {
+ NEEDBITS(3)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
+ DUMPBITS(3)
+ }
+ while (s->sub.trees.index < 19)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
+ s->sub.trees.bb = 7;
+ t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
+ &s->sub.trees.tb, s->hufts, z);
+ if (t != Z_OK)
+ {
+ ZFREE(z, s->sub.trees.blens);
+ r = t;
+ if (r == Z_DATA_ERROR)
+ s->mode = IBM_BAD;
+ LEAVE
+ }
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: bits tree ok\n"));
+ s->mode = IBM_DTREE;
+ case IBM_DTREE:
+ while (t = s->sub.trees.table,
+ s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
+ {
+ inflate_huft *h;
+ uInt i, j, c;
+
+ t = s->sub.trees.bb;
+ NEEDBITS(t)
+ h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
+ t = h->bits;
+ c = h->base;
+ if (c < 16)
+ {
+ DUMPBITS(t)
+ s->sub.trees.blens[s->sub.trees.index++] = c;
+ }
+ else // c == 16..18
+ {
+ i = c == 18 ? 7 : c - 14;
+ j = c == 18 ? 11 : 3;
+ NEEDBITS(t + i)
+ DUMPBITS(t)
+ j += (uInt)b & inflate_mask[i];
+ DUMPBITS(i)
+ i = s->sub.trees.index;
+ t = s->sub.trees.table;
+ if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
+ (c == 16 && i < 1))
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = IBM_BAD;
+ z->msg = (char*)"invalid bit length repeat";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
+ do {
+ s->sub.trees.blens[i++] = c;
+ } while (--j);
+ s->sub.trees.index = i;
+ }
+ }
+ s->sub.trees.tb = Z_NULL;
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ inflate_codes_statef *c;
+
+ bl = 9; // must be <= 9 for lookahead assumptions
+ bd = 6; // must be <= 9 for lookahead assumptions
+ t = s->sub.trees.table;
+ t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
+ s->sub.trees.blens, &bl, &bd, &tl, &td,
+ s->hufts, z);
+ ZFREE(z, s->sub.trees.blens);
+ if (t != Z_OK)
+ {
+ if (t == (uInt)Z_DATA_ERROR)
+ s->mode = IBM_BAD;
+ r = t;
+ LEAVE
+ }
+ Tracev((stderr, "inflate: trees ok\n"));
+ if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ s->sub.decode.codes = c;
+ }
+ s->mode = IBM_CODES;
+ case IBM_CODES:
+ UPDATE
+ if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
+ return inflate_flush(s, z, r);
+ r = Z_OK;
+ inflate_codes_free(s->sub.decode.codes, z);
+ LOAD
+ Tracev((stderr, "inflate: codes end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ if (!s->last)
+ {
+ s->mode = IBM_TYPE;
+ break;
+ }
+ s->mode = IBM_DRY;
+ case IBM_DRY:
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ s->mode = IBM_DONE;
+ case IBM_DONE:
+ r = Z_STREAM_END;
+ LEAVE
+ case IBM_BAD:
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+}
+
+
+int inflate_blocks_free(inflate_blocks_statef *s, z_streamp z)
+{
+ inflate_blocks_reset(s, z, Z_NULL);
+ ZFREE(z, s->window);
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ Tracev((stderr, "inflate: blocks freed\n"));
+ return Z_OK;
+}
+
+
+
+// inftrees.c -- generate Huffman trees for efficient decoding
+// Copyright (C) 1995-1998 Mark Adler
+// For conditions of distribution and use, see copyright notice in zlib.h
+//
+
+
+
+extern const char inflate_copyright[] =
+ " ";//inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
+// If you use the zlib library in a product, an acknowledgment is welcome
+// in the documentation of your product. If for some reason you cannot
+// include such an acknowledgment, I would appreciate that you keep this
+// copyright string in the executable of your product.
+
+
+
+int huft_build (
+ uInt *, // code lengths in bits
+ uInt, // number of codes
+ uInt, // number of "simple" codes
+ const uInt *, // list of base values for non-simple codes
+ const uInt *, // list of extra bits for non-simple codes
+ inflate_huft **,// result: starting table
+ uInt *, // maximum lookup bits (returns actual)
+ inflate_huft *, // space for trees
+ uInt *, // hufts used in space
+ uInt * ); // space for values
+
+// Tables for deflate from PKZIP's appnote.txt.
+const uInt cplens[31] = { // Copy lengths for literal codes 257..285
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ // see note #13 above about 258
+const uInt cplext[31] = { // Extra bits for literal codes 257..285
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; // 112==invalid
+const uInt cpdist[30] = { // Copy offsets for distance codes 0..29
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577};
+const uInt cpdext[30] = { // Extra bits for distance codes
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13};
+
+//
+// Huffman code decoding is performed using a multi-level table lookup.
+// The fastest way to decode is to simply build a lookup table whose
+// size is determined by the longest code. However, the time it takes
+// to build this table can also be a factor if the data being decoded
+// is not very long. The most common codes are necessarily the
+// shortest codes, so those codes dominate the decoding time, and hence
+// the speed. The idea is you can have a shorter table that decodes the
+// shorter, more probable codes, and then point to subsidiary tables for
+// the longer codes. The time it costs to decode the longer codes is
+// then traded against the time it takes to make longer tables.
+//
+// This results of this trade are in the variables lbits and dbits
+// below. lbits is the number of bits the first level table for literal/
+// length codes can decode in one step, and dbits is the same thing for
+// the distance codes. Subsequent tables are also less than or equal to
+// those sizes. These values may be adjusted either when all of the
+// codes are shorter than that, in which case the longest code length in
+// bits is used, or when the shortest code is *longer* than the requested
+// table size, in which case the length of the shortest code in bits is
+// used.
+//
+// There are two different values for the two tables, since they code a
+// different number of possibilities each. The literal/length table
+// codes 286 possible values, or in a flat code, a little over eight
+// bits. The distance table codes 30 possible values, or a little less
+// than five bits, flat. The optimum values for speed end up being
+// about one bit more than those, so lbits is 8+1 and dbits is 5+1.
+// The optimum values may differ though from machine to machine, and
+// possibly even between compilers. Your mileage may vary.
+//
+
+
+// If BMAX needs to be larger than 16, then h and x[] should be uLong.
+#define BMAX 15 // maximum bit length of any code
+
+int huft_build(
+uInt *b, // code lengths in bits (all assumed <= BMAX)
+uInt n, // number of codes (assumed <= 288)
+uInt s, // number of simple-valued codes (0..s-1)
+const uInt *d, // list of base values for non-simple codes
+const uInt *e, // list of extra bits for non-simple codes
+inflate_huft * *t, // result: starting table
+uInt *m, // maximum lookup bits, returns actual
+inflate_huft *hp, // space for trees
+uInt *hn, // hufts used in space
+uInt *v) // working area: values in order of bit length
+// Given a list of code lengths and a maximum table size, make a set of
+// tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
+// if the given code set is incomplete (the tables are still built in this
+// case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
+// lengths), or Z_MEM_ERROR if not enough memory.
+{
+
+ uInt a; // counter for codes of length k
+ uInt c[BMAX+1]; // bit length count table
+ uInt f; // i repeats in table every f entries
+ int g; // maximum code length
+ int h; // table level
+ register uInt i; // counter, current code
+ register uInt j; // counter
+ register int k; // number of bits in current code
+ int l; // bits per table (returned in m)
+ uInt mask; // (1 << w) - 1, to avoid cc -O bug on HP
+ register uInt *p; // pointer into c[], b[], or v[]
+ inflate_huft *q; // points to current table
+ struct inflate_huft_s r; // table entry for structure assignment
+ inflate_huft *u[BMAX]; // table stack
+ register int w; // bits before this table == (l * h)
+ uInt x[BMAX+1]; // bit offsets, then code stack
+ uInt *xp; // pointer into x
+ int y; // number of dummy codes added
+ uInt z; // number of entries in current table
+
+
+ // Generate counts for each bit length
+ p = c;
+#define C0 *p++ = 0;
+#define C2 C0 C0 C0 C0
+#define C4 C2 C2 C2 C2
+ C4; p; // clear c[]--assume BMAX+1 is 16
+ p = b; i = n;
+ do {
+ c[*p++]++; // assume all entries <= BMAX
+ } while (--i);
+ if (c[0] == n) // null input--all zero length codes
+ {
+ *t = (inflate_huft *)Z_NULL;
+ *m = 0;
+ return Z_OK;
+ }
+
+
+ // Find minimum and maximum length, bound *m by those
+ l = *m;
+ for (j = 1; j <= BMAX; j++)
+ if (c[j])
+ break;
+ k = j; // minimum code length
+ if ((uInt)l < j)
+ l = j;
+ for (i = BMAX; i; i--)
+ if (c[i])
+ break;
+ g = i; // maximum code length
+ if ((uInt)l > i)
+ l = i;
+ *m = l;
+
+
+ // Adjust last length count to fill out codes, if needed
+ for (y = 1 << j; j < i; j++, y <<= 1)
+ if ((y -= c[j]) < 0)
+ return Z_DATA_ERROR;
+ if ((y -= c[i]) < 0)
+ return Z_DATA_ERROR;
+ c[i] += y;
+
+
+ // Generate starting offsets into the value table for each length
+ x[1] = j = 0;
+ p = c + 1; xp = x + 2;
+ while (--i) { // note that i == g from above
+ *xp++ = (j += *p++);
+ }
+
+
+ // Make a table of values in order of bit lengths
+ p = b; i = 0;
+ do {
+ if ((j = *p++) != 0)
+ v[x[j]++] = i;
+ } while (++i < n);
+ n = x[g]; // set n to length of v
+
+
+ // Generate the Huffman codes and for each, make the table entries
+ x[0] = i = 0; // first Huffman code is zero
+ p = v; // grab values in bit order
+ h = -1; // no tables yet--level -1
+ w = -l; // bits decoded == (l * h)
+ u[0] = (inflate_huft *)Z_NULL; // just to keep compilers happy
+ q = (inflate_huft *)Z_NULL; // ditto
+ z = 0; // ditto
+
+ // go through the bit lengths (k already is bits in shortest code)
+ for (; k <= g; k++)
+ {
+ a = c[k];
+ while (a--)
+ {
+ // here i is the Huffman code of length k bits for value *p
+ // make tables up to required level
+ while (k > w + l)
+ {
+ h++;
+ w += l; // previous table always l bits
+
+ // compute minimum size table less than or equal to l bits
+ z = g - w;
+ z = z > (uInt)l ? l : z; // table size upper limit
+ if ((f = 1 << (j = k - w)) > a + 1) // try a k-w bit table
+ { // too few codes for k-w bit table
+ f -= a + 1; // deduct codes from patterns left
+ xp = c + k;
+ if (j < z)
+ while (++j < z) // try smaller tables up to z bits
+ {
+ if ((f <<= 1) <= *++xp)
+ break; // enough codes to use up j bits
+ f -= *xp; // else deduct codes from patterns
+ }
+ }
+ z = 1 << j; // table entries for j-bit table
+
+ // allocate new table
+ if (*hn + z > MANY) // (note: doesn't matter for fixed)
+ return Z_MEM_ERROR; // not enough memory
+ u[h] = q = hp + *hn;
+ *hn += z;
+
+ // connect to last table, if there is one
+ if (h)
+ {
+ x[h] = i; // save pattern for backing up
+ r.bits = (Byte)l; // bits to dump before this table
+ r.exop = (Byte)j; // bits in this table
+ j = i >> (w - l);
+ r.base = (uInt)(q - u[h-1] - j); // offset to this table
+ u[h-1][j] = r; // connect to last table
+ }
+ else
+ *t = q; // first table is returned result
+ }
+
+ // set up table entry in r
+ r.bits = (Byte)(k - w);
+ if (p >= v + n)
+ r.exop = 128 + 64; // out of values--invalid code
+ else if (*p < s)
+ {
+ r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); // 256 is end-of-block
+ r.base = *p++; // simple code is just the value
+ }
+ else
+ {
+ r.exop = (Byte)(e[*p - s] + 16 + 64);// non-simple--look up in lists
+ r.base = d[*p++ - s];
+ }
+
+ // fill code-like entries with r
+ f = 1 << (k - w);
+ for (j = i >> w; j < z; j += f)
+ q[j] = r;
+
+ // backwards increment the k-bit code i
+ for (j = 1 << (k - 1); i & j; j >>= 1)
+ i ^= j;
+ i ^= j;
+
+ // backup over finished tables
+ mask = (1 << w) - 1; // needed on HP, cc -O bug
+ while ((i & mask) != x[h])
+ {
+ h--; // don't need to update q
+ w -= l;
+ mask = (1 << w) - 1;
+ }
+ }
+ }
+
+
+ // Return Z_BUF_ERROR if we were given an incomplete table
+ return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
+}
+
+
+int inflate_trees_bits(
+uInt *c, // 19 code lengths
+uInt *bb, // bits tree desired/actual depth
+inflate_huft * *tb, // bits tree result
+inflate_huft *hp, // space for trees
+z_streamp z) // for messages
+{
+ int r;
+ uInt hn = 0; // hufts used in space
+ uInt *v; // work area for huft_build
+
+ if ((v = (uInt*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ r = huft_build(c, 19, 19, (uInt*)Z_NULL, (uInt*)Z_NULL,
+ tb, bb, hp, &hn, v);
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed dynamic bit lengths tree";
+ else if (r == Z_BUF_ERROR || *bb == 0)
+ {
+ z->msg = (char*)"incomplete dynamic bit lengths tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+}
+
+
+int inflate_trees_dynamic(
+uInt nl, // number of literal/length codes
+uInt nd, // number of distance codes
+uInt *c, // that many (total) code lengths
+uInt *bl, // literal desired/actual bit depth
+uInt *bd, // distance desired/actual bit depth
+inflate_huft * *tl, // literal/length tree result
+inflate_huft * *td, // distance tree result
+inflate_huft *hp, // space for trees
+z_streamp z) // for messages
+{
+ int r;
+ uInt hn = 0; // hufts used in space
+ uInt *v; // work area for huft_build
+
+ // allocate work area
+ if ((v = (uInt*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+
+ // build literal/length tree
+ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
+ if (r != Z_OK || *bl == 0)
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed literal/length tree";
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"incomplete literal/length tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+ }
+
+ // build distance tree
+ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
+ if (r != Z_OK || (*bd == 0 && nl > 257))
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed distance tree";
+ else if (r == Z_BUF_ERROR) {
+ z->msg = (char*)"incomplete distance tree";
+ r = Z_DATA_ERROR;
+ }
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"empty distance tree with lengths";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+ }
+
+ // done
+ ZFREE(z, v);
+ return Z_OK;
+}
+
+
+
+
+
+int inflate_trees_fixed(
+uInt *bl, // literal desired/actual bit depth
+uInt *bd, // distance desired/actual bit depth
+const inflate_huft * * tl, // literal/length tree result
+const inflate_huft * *td, // distance tree result
+z_streamp ) // for memory allocation
+{
+ *bl = fixed_bl;
+ *bd = fixed_bd;
+ *tl = fixed_tl;
+ *td = fixed_td;
+ return Z_OK;
+}
+
+
+// inffast.c -- process literals and length/distance pairs fast
+// Copyright (C) 1995-1998 Mark Adler
+// For conditions of distribution and use, see copyright notice in zlib.h
+//
+
+
+//struct inflate_codes_state {int dummy;}; // for buggy compilers
+
+
+// macros for bit input with no checking and for returning unused bytes
+#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
+
+// Called with number of bytes left to write in window at least 258
+// (the maximum string length) and number of input bytes available
+// at least ten. The ten bytes are six bytes for the longest length/
+// distance pair plus four bytes for overloading the bit buffer.
+
+int inflate_fast(
+uInt bl, uInt bd,
+const inflate_huft *tl,
+const inflate_huft *td, // need separate declaration for Borland C++
+inflate_blocks_statef *s,
+z_streamp z)
+{
+ const inflate_huft *t; // temporary pointer
+ uInt e; // extra bits or operation
+ uLong b; // bit buffer
+ uInt k; // bits in bit buffer
+ Byte *p; // input data pointer
+ uInt n; // bytes available there
+ Byte *q; // output window write pointer
+ uInt m; // bytes to end of window or read pointer
+ uInt ml; // mask for literal/length tree
+ uInt md; // mask for distance tree
+ uInt c; // bytes to copy
+ uInt d; // distance back to copy from
+ Byte *r; // copy source pointer
+
+ // load input, output, bit values
+ LOAD
+
+ // initialize masks
+ ml = inflate_mask[bl];
+ md = inflate_mask[bd];
+
+ // do until not enough input or output space for fast loop
+ do { // assume called with m >= 258 && n >= 10
+ // get literal/length code
+ GRABBITS(20) // max bits for literal/length code
+ if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ continue;
+ }
+ for (;;) {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ // get extra bits for length
+ e &= 15;
+ c = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * length %u\n", c));
+
+ // decode distance base of block to copy
+ GRABBITS(15); // max bits for distance code
+ e = (t = td + ((uInt)b & md))->exop;
+ for (;;) {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ // get extra bits to add to distance base
+ e &= 15;
+ GRABBITS(e) // get extra bits (up to 13)
+ d = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * distance %u\n", d));
+
+ // do the copy
+ m -= c;
+ if ((uInt)(q - s->window) >= d) // offset before dest
+ { // just copy
+ r = q - d;
+ *q++ = *r++; c--; // minimum count is three,
+ *q++ = *r++; c--; // so unroll loop a little
+ }
+ else // else offset after destination
+ {
+ e = d - (uInt)(q - s->window); // bytes from offset to end
+ r = s->end - e; // pointer to offset
+ if (c > e) // if source crosses,
+ {
+ c -= e; // copy to end of window
+ do {
+ *q++ = *r++;
+ } while (--e);
+ r = s->window; // copy rest from start of window
+ }
+ }
+ do { // copy all or what's left
+ *q++ = *r++;
+ } while (--c);
+ break;
+ }
+ else if ((e & 64) == 0)
+ {
+ t += t->base;
+ e = (t += ((uInt)b & inflate_mask[e]))->exop;
+ }
+ else
+ {
+ z->msg = (char*)"invalid distance code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ };
+ break;
+ }
+ if ((e & 64) == 0)
+ {
+ t += t->base;
+ if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ break;
+ }
+ }
+ else if (e & 32)
+ {
+ Tracevv((stderr, "inflate: * end of block\n"));
+ UNGRAB
+ UPDATE
+ return Z_STREAM_END;
+ }
+ else
+ {
+ z->msg = (char*)"invalid literal/length code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ };
+ } while (m >= 258 && n >= 10);
+
+ // not enough input or output--restore pointers and return
+ UNGRAB
+ UPDATE
+ return Z_OK;
+}
+
+
+
+
+
+
+// crc32.c -- compute the CRC-32 of a data stream
+// Copyright (C) 1995-1998 Mark Adler
+// For conditions of distribution and use, see copyright notice in zlib.h
+
+// @(#) $Id$
+
+
+
+
+
+
+// Table of CRC-32's of all single-byte values (made by make_crc_table)
+const uLong crc_table[256] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+};
+
+const uLong * get_crc_table()
+{ return (const uLong *)crc_table;
+}
+
+#define CRC_DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
+#define CRC_DO2(buf) CRC_DO1(buf); CRC_DO1(buf);
+#define CRC_DO4(buf) CRC_DO2(buf); CRC_DO2(buf);
+#define CRC_DO8(buf) CRC_DO4(buf); CRC_DO4(buf);
+
+uLong ucrc32(uLong crc, const Byte *buf, uInt len)
+{ if (buf == Z_NULL) return 0L;
+ crc = crc ^ 0xffffffffL;
+ while (len >= 8) {CRC_DO8(buf); len -= 8;}
+ if (len) do {CRC_DO1(buf);} while (--len);
+ return crc ^ 0xffffffffL;
+}
+
+
+// adler32.c -- compute the Adler-32 checksum of a data stream
+// Copyright (C) 1995-1998 Mark Adler
+// For conditions of distribution and use, see copyright notice in zlib.h
+
+// @(#) $Id$
+
+
+#define BASE 65521L // largest prime smaller than 65536
+#define NMAX 5552
+// NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1
+
+#define AD_DO1(buf,i) {s1 += buf[i]; s2 += s1;}
+#define AD_DO2(buf,i) AD_DO1(buf,i); AD_DO1(buf,i+1);
+#define AD_DO4(buf,i) AD_DO2(buf,i); AD_DO2(buf,i+2);
+#define AD_DO8(buf,i) AD_DO4(buf,i); AD_DO4(buf,i+4);
+#define AD_DO16(buf) AD_DO8(buf,0); AD_DO8(buf,8);
+
+// =========================================================================
+uLong adler32(uLong adler, const Byte *buf, uInt len)
+{
+ unsigned long s1 = adler & 0xffff;
+ unsigned long s2 = (adler >> 16) & 0xffff;
+ int k;
+
+ if (buf == Z_NULL) return 1L;
+
+ while (len > 0) {
+ k = len < NMAX ? len : NMAX;
+ len -= k;
+ while (k >= 16) {
+ AD_DO16(buf);
+ buf += 16;
+ k -= 16;
+ }
+ if (k != 0) do {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k);
+ s1 %= BASE;
+ s2 %= BASE;
+ }
+ return (s2 << 16) | s1;
+}
+
+
+
+// zutil.c -- target dependent utility functions for the compression library
+// Copyright (C) 1995-1998 Jean-loup Gailly.
+// For conditions of distribution and use, see copyright notice in zlib.h
+// @(#) $Id$
+
+
+
+
+
+
+const char * zlibVersion()
+{
+ return ZLIB_VERSION;
+}
+
+// exported to allow conversion of error code to string for compress() and
+// uncompress()
+const char * zError(int err)
+{ return ERR_MSG(err);
+}
+
+
+
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ if (opaque) items += size - size; // make compiler happy
+ return (voidpf)calloc(items, size);
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ zfree(ptr);
+ if (opaque) return; // make compiler happy
+}
+
+
+
+// inflate.c -- zlib interface to inflate modules
+// Copyright (C) 1995-1998 Mark Adler
+// For conditions of distribution and use, see copyright notice in zlib.h
+
+//struct inflate_blocks_state {int dummy;}; // for buggy compilers
+
+typedef enum {
+ IM_METHOD, // waiting for method byte
+ IM_FLAG, // waiting for flag byte
+ IM_DICT4, // four dictionary check bytes to go
+ IM_DICT3, // three dictionary check bytes to go
+ IM_DICT2, // two dictionary check bytes to go
+ IM_DICT1, // one dictionary check byte to go
+ IM_DICT0, // waiting for inflateSetDictionary
+ IM_BLOCKS, // decompressing blocks
+ IM_CHECK4, // four check bytes to go
+ IM_CHECK3, // three check bytes to go
+ IM_CHECK2, // two check bytes to go
+ IM_CHECK1, // one check byte to go
+ IM_DONE, // finished check, done
+ IM_BAD} // got an error--stay here
+inflate_mode;
+
+// inflate private state
+struct internal_state {
+
+ // mode
+ inflate_mode mode; // current inflate mode
+
+ // mode dependent information
+ union {
+ uInt method; // if IM_FLAGS, method byte
+ struct {
+ uLong was; // computed check value
+ uLong need; // stream check value
+ } check; // if CHECK, check values to compare
+ uInt marker; // if IM_BAD, inflateSync's marker bytes count
+ } sub; // submode
+
+ // mode independent information
+ int nowrap; // flag for no wrapper
+ uInt wbits; // log2(window size) (8..15, defaults to 15)
+ inflate_blocks_statef
+ *blocks; // current inflate_blocks state
+
+};
+
+int inflateReset(z_streamp z)
+{
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->total_in = z->total_out = 0;
+ z->msg = Z_NULL;
+ z->state->mode = z->state->nowrap ? IM_BLOCKS : IM_METHOD;
+ inflate_blocks_reset(z->state->blocks, z, Z_NULL);
+ Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
+
+int inflateEnd(z_streamp z)
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->blocks != Z_NULL)
+ inflate_blocks_free(z->state->blocks, z);
+ ZFREE(z, z->state);
+ z->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
+
+
+int inflateInit2(z_streamp z)
+{ const char *version = ZLIB_VERSION; int stream_size = sizeof(z_stream);
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || stream_size != sizeof(z_stream)) return Z_VERSION_ERROR;
+
+ int w = -15; // MAX_WBITS: 32K LZ77 window.
+ // Warning: reducing MAX_WBITS makes minigzip unable to extract .gz files created by gzip.
+ // The memory requirements for deflate are (in bytes):
+ // (1 << (windowBits+2)) + (1 << (memLevel+9))
+ // that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ // plus a few kilobytes for small objects. For example, if you want to reduce
+ // the default memory requirements from 256K to 128K, compile with
+ // make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ // Of course this will generally degrade compression (there's no free lunch).
+ //
+ // The memory requirements for inflate are (in bytes) 1 << windowBits
+ // that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ // for small objects.
+
+ // initialize state
+ if (z == Z_NULL) return Z_STREAM_ERROR;
+ z->msg = Z_NULL;
+ if (z->zalloc == Z_NULL)
+ {
+ z->zalloc = zcalloc;
+ z->opaque = (voidpf)0;
+ }
+ if (z->zfree == Z_NULL) z->zfree = zcfree;
+ if ((z->state = (struct internal_state *)
+ ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
+ return Z_MEM_ERROR;
+ z->state->blocks = Z_NULL;
+
+ // handle undocumented nowrap option (no zlib header or check)
+ z->state->nowrap = 0;
+ if (w < 0)
+ {
+ w = - w;
+ z->state->nowrap = 1;
+ }
+
+ // set window size
+ if (w < 8 || w > 15)
+ {
+ inflateEnd(z);
+ return Z_STREAM_ERROR;
+ }
+ z->state->wbits = (uInt)w;
+
+ // create inflate_blocks state
+ if ((z->state->blocks =
+ inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
+ == Z_NULL)
+ {
+ inflateEnd(z);
+ return Z_MEM_ERROR;
+ }
+ Tracev((stderr, "inflate: allocated\n"));
+
+ // reset state
+ inflateReset(z);
+ return Z_OK;
+}
+
+
+
+#define IM_NEEDBYTE {if(z->avail_in==0)return r;r=f;}
+#define IM_NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
+
+int inflate(z_streamp z, int f)
+{
+ int r;
+ uInt b;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
+ return Z_STREAM_ERROR;
+ f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
+ r = Z_BUF_ERROR;
+ for (;;) switch (z->state->mode)
+ {
+ case IM_METHOD:
+ IM_NEEDBYTE
+ if (((z->state->sub.method = IM_NEXTBYTE) & 0xf) != Z_DEFLATED)
+ {
+ z->state->mode = IM_BAD;
+ z->msg = (char*)"unknown compression method";
+ z->state->sub.marker = 5; // can't try inflateSync
+ break;
+ }
+ if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
+ {
+ z->state->mode = IM_BAD;
+ z->msg = (char*)"invalid window size";
+ z->state->sub.marker = 5; // can't try inflateSync
+ break;
+ }
+ z->state->mode = IM_FLAG;
+ case IM_FLAG:
+ IM_NEEDBYTE
+ b = IM_NEXTBYTE;
+ if (((z->state->sub.method << 8) + b) % 31)
+ {
+ z->state->mode = IM_BAD;
+ z->msg = (char*)"incorrect header check";
+ z->state->sub.marker = 5; // can't try inflateSync
+ break;
+ }
+ Tracev((stderr, "inflate: zlib header ok\n"));
+ if (!(b & PRESET_DICT))
+ {
+ z->state->mode = IM_BLOCKS;
+ break;
+ }
+ z->state->mode = IM_DICT4;
+ case IM_DICT4:
+ IM_NEEDBYTE
+ z->state->sub.check.need = (uLong)IM_NEXTBYTE << 24;
+ z->state->mode = IM_DICT3;
+ case IM_DICT3:
+ IM_NEEDBYTE
+ z->state->sub.check.need += (uLong)IM_NEXTBYTE << 16;
+ z->state->mode = IM_DICT2;
+ case IM_DICT2:
+ IM_NEEDBYTE
+ z->state->sub.check.need += (uLong)IM_NEXTBYTE << 8;
+ z->state->mode = IM_DICT1;
+ case IM_DICT1:
+ IM_NEEDBYTE; r;
+ z->state->sub.check.need += (uLong)IM_NEXTBYTE;
+ z->adler = z->state->sub.check.need;
+ z->state->mode = IM_DICT0;
+ return Z_NEED_DICT;
+ case IM_DICT0:
+ z->state->mode = IM_BAD;
+ z->msg = (char*)"need dictionary";
+ z->state->sub.marker = 0; // can try inflateSync
+ return Z_STREAM_ERROR;
+ case IM_BLOCKS:
+ r = inflate_blocks(z->state->blocks, z, r);
+ if (r == Z_DATA_ERROR)
+ {
+ z->state->mode = IM_BAD;
+ z->state->sub.marker = 0; // can try inflateSync
+ break;
+ }
+ if (r == Z_OK)
+ r = f;
+ if (r != Z_STREAM_END)
+ return r;
+ r = f;
+ inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
+ if (z->state->nowrap)
+ {
+ z->state->mode = IM_DONE;
+ break;
+ }
+ z->state->mode = IM_CHECK4;
+ case IM_CHECK4:
+ IM_NEEDBYTE
+ z->state->sub.check.need = (uLong)IM_NEXTBYTE << 24;
+ z->state->mode = IM_CHECK3;
+ case IM_CHECK3:
+ IM_NEEDBYTE
+ z->state->sub.check.need += (uLong)IM_NEXTBYTE << 16;
+ z->state->mode = IM_CHECK2;
+ case IM_CHECK2:
+ IM_NEEDBYTE
+ z->state->sub.check.need += (uLong)IM_NEXTBYTE << 8;
+ z->state->mode = IM_CHECK1;
+ case IM_CHECK1:
+ IM_NEEDBYTE
+ z->state->sub.check.need += (uLong)IM_NEXTBYTE;
+
+ if (z->state->sub.check.was != z->state->sub.check.need)
+ {
+ z->state->mode = IM_BAD;
+ z->msg = (char*)"incorrect data check";
+ z->state->sub.marker = 5; // can't try inflateSync
+ break;
+ }
+ Tracev((stderr, "inflate: zlib check ok\n"));
+ z->state->mode = IM_DONE;
+ case IM_DONE:
+ return Z_STREAM_END;
+ case IM_BAD:
+ return Z_DATA_ERROR;
+ default:
+ return Z_STREAM_ERROR;
+ }
+}
+
+
+
+#ifdef _UNICODE
+
+static int GetAnsiFileName(LPCWSTR name, char * buf, int nBufSize)
+{
+ memset(buf, 0, nBufSize);
+
+ int n = WideCharToMultiByte(CP_ACP, // code page
+ 0, // performance and mapping flags
+ name, // wide-character string
+ -1, // number of chars in string
+ buf, // buffer for new string
+ nBufSize, // size of buffer
+ NULL, // default for unmappable chars
+ NULL); // set when default char used
+ return n;
+}
+
+static int GetUnicodeFileName(const char * name, LPWSTR buf, int nBufSize)
+{
+ memset(buf, 0, nBufSize*sizeof(TCHAR));
+
+ int n = MultiByteToWideChar(CP_ACP, // code page
+ 0, // character-type options
+ name, // string to map
+ -1, // number of bytes in string
+ buf, // wide-character buffer
+ nBufSize); // size of buffer
+
+ return n;
+}
+
+#endif
+
+
+// unzip.c -- IO on .zip files using zlib
+// Version 0.15 beta, Mar 19th, 1998,
+// Read unzip.h for more info
+
+
+
+
+#define UNZ_BUFSIZE (16384)
+#define UNZ_MAXFILENAMEINZIP (256)
+#define SIZECENTRALDIRITEM (0x2e)
+#define SIZEZIPLOCALHEADER (0x1e)
+
+
+
+
+const char unz_copyright[] = " ";//unzip 0.15 Copyright 1998 Gilles Vollant ";
+
+// unz_file_info_interntal contain internal info about a file in zipfile
+typedef struct unz_file_info_internal_s
+{
+ uLong offset_curfile;// relative offset of local header 4 bytes
+} unz_file_info_internal;
+
+
+typedef struct
+{ bool is_handle; // either a handle or memory
+ bool canseek;
+ // for handles:
+ HANDLE h; bool herr; unsigned long initial_offset;
+ // for memory:
+ void *buf; unsigned int len,pos; // if it's a memory block
+} LUFILE;
+
+
+LUFILE *lufopen(void *z,unsigned int len,DWORD flags,ZRESULT *err)
+{
+ if (flags!=ZIP_HANDLE && flags!=ZIP_FILENAME && flags!=ZIP_MEMORY)
+ {
+ *err=ZR_ARGS;
+ return NULL;
+ }
+ //
+ HANDLE h=0; bool canseek=false; *err=ZR_OK;
+ if (flags==ZIP_HANDLE||flags==ZIP_FILENAME)
+ {
+ if (flags==ZIP_HANDLE)
+ {
+ HANDLE hf = z;
+
+ BOOL res = DuplicateHandle(GetCurrentProcess(),hf,GetCurrentProcess(),&h,0,FALSE,DUPLICATE_SAME_ACCESS);
+
+ if (!res)
+ {
+ *err=ZR_NODUPH;
+ return NULL;
+ }
+ }
+ else
+ {
+ h = CreateFile((const TCHAR *)z, GENERIC_READ, FILE_SHARE_READ,
+ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ *err = ZR_NOFILE;
+ return NULL;
+ }
+ }
+ DWORD type = GetFileType(h);
+ canseek = (type==FILE_TYPE_DISK);
+ }
+ LUFILE *lf = new LUFILE;
+ if (flags==ZIP_HANDLE||flags==ZIP_FILENAME)
+ {
+ lf->is_handle=true;
+ lf->canseek=canseek;
+ lf->h=h; lf->herr=false;
+ lf->initial_offset=0;
+ if (canseek)
+ lf->initial_offset = SetFilePointer(h,0,NULL,FILE_CURRENT);
+ }
+ else
+ {
+ lf->is_handle=false;
+ lf->canseek=true;
+ lf->buf=z;
+ lf->len=len;
+ lf->pos=0;
+ lf->initial_offset=0;
+ }
+ *err=ZR_OK;
+ return lf;
+}
+
+
+int lufclose(LUFILE *stream)
+{ if (stream==NULL) return EOF;
+ if (stream->is_handle) CloseHandle(stream->h);
+ delete stream;
+ return 0;
+}
+
+int luferror(LUFILE *stream)
+{ if (stream->is_handle && stream->herr) return 1;
+ else return 0;
+}
+
+long int luftell(LUFILE *stream)
+{ if (stream->is_handle && stream->canseek) return SetFilePointer(stream->h,0,NULL,FILE_CURRENT)-stream->initial_offset;
+ else if (stream->is_handle) return 0;
+ else return stream->pos;
+}
+
+int lufseek(LUFILE *stream, long offset, int whence)
+{ if (stream->is_handle && stream->canseek)
+ { if (whence==SEEK_SET) SetFilePointer(stream->h,stream->initial_offset+offset,0,FILE_BEGIN);
+ else if (whence==SEEK_CUR) SetFilePointer(stream->h,offset,NULL,FILE_CURRENT);
+ else if (whence==SEEK_END) SetFilePointer(stream->h,offset,NULL,FILE_END);
+ else return 19; // EINVAL
+ return 0;
+ }
+ else if (stream->is_handle) return 29; // ESPIPE
+ else
+ { if (whence==SEEK_SET) stream->pos=offset;
+ else if (whence==SEEK_CUR) stream->pos+=offset;
+ else if (whence==SEEK_END) stream->pos=stream->len+offset;
+ return 0;
+ }
+}
+
+
+size_t lufread(void *ptr,size_t size,size_t n,LUFILE *stream)
+{ unsigned int toread = (unsigned int)(size*n);
+ if (stream->is_handle)
+ { DWORD red; BOOL res = ReadFile(stream->h,ptr,toread,&red,NULL);
+ if (!res) stream->herr=true;
+ return red/size;
+ }
+ if (stream->pos+toread > stream->len) toread = stream->len-stream->pos;
+ memcpy(ptr, (char*)stream->buf + stream->pos, toread); DWORD red = toread;
+ stream->pos += red;
+ return red/size;
+}
+
+
+
+
+// file_in_zip_read_info_s contain internal information about a file in zipfile,
+// when reading and decompress it
+typedef struct
+{
+ char *read_buffer; // internal buffer for compressed data
+ z_stream stream; // zLib stream structure for inflate
+
+ uLong pos_in_zipfile; // position in byte on the zipfile, for fseek
+ uLong stream_initialised; // flag set if stream structure is initialised
+
+ uLong offset_local_extrafield;// offset of the local extra field
+ uInt size_local_extrafield;// size of the local extra field
+ uLong pos_local_extrafield; // position in the local extra field in read
+
+ uLong crc32; // crc32 of all data uncompressed
+ uLong crc32_wait; // crc32 we must obtain after decompress all
+ uLong rest_read_compressed; // number of byte to be decompressed
+ uLong rest_read_uncompressed;//number of byte to be obtained after decomp
+ LUFILE* file; // io structore of the zipfile
+ uLong compression_method; // compression method (0==store)
+ uLong byte_before_the_zipfile;// byte before the zipfile, (>0 for sfx)
+} file_in_zip_read_info_s;
+
+
+// unz_s contain internal information about the zipfile
+typedef struct
+{
+ LUFILE* file; // io structore of the zipfile
+ unz_global_info gi; // public global information
+ uLong byte_before_the_zipfile;// byte before the zipfile, (>0 for sfx)
+ uLong num_file; // number of the current file in the zipfile
+ uLong pos_in_central_dir; // pos of the current file in the central dir
+ uLong current_file_ok; // flag about the usability of the current file
+ uLong central_pos; // position of the beginning of the central dir
+
+ uLong size_central_dir; // size of the central directory
+ uLong offset_central_dir; // offset of start of central directory with respect to the starting disk number
+
+ unz_file_info cur_file_info; // public info about the current file in zip
+ unz_file_info_internal cur_file_info_internal; // private info about it
+ file_in_zip_read_info_s* pfile_in_zip_read; // structure about the current file if we are decompressing it
+} unz_s, *unzFile;
+
+
+int unzStringFileNameCompare (const char* fileName1,const char* fileName2,int iCaseSensitivity);
+// Compare two filename (fileName1,fileName2).
+
+z_off_t unztell (unzFile file);
+// Give the current position in uncompressed data
+
+int unzeof (unzFile file);
+// return 1 if the end of file was reached, 0 elsewhere
+
+int unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len);
+// Read extra field from the current file (opened by unzOpenCurrentFile)
+// This is the local-header version of the extra field (sometimes, there is
+// more info in the local-header version than in the central-header)
+//
+// if buf==NULL, it return the size of the local extra field
+//
+// if buf!=NULL, len is the size of the buffer, the extra header is copied in
+// buf.
+// the return value is the number of bytes copied in buf, or (if <0)
+// the error code
+
+
+
+// ===========================================================================
+// Read a byte from a gz_stream; update next_in and avail_in. Return EOF
+// for end of file.
+// IN assertion: the stream s has been sucessfully opened for reading.
+
+int unzlocal_getByte(LUFILE *fin,int *pi)
+{ unsigned char c;
+ int err = (int)lufread(&c, 1, 1, fin);
+ if (err==1)
+ { *pi = (int)c;
+ return UNZ_OK;
+ }
+ else
+ { if (luferror(fin)) return UNZ_ERRNO;
+ else return UNZ_EOF;
+ }
+}
+
+
+// ===========================================================================
+// Reads a long in LSB order from the given gz_stream. Sets
+int unzlocal_getShort (LUFILE *fin,uLong *pX)
+{
+ uLong x ;
+ int i;
+ int err;
+
+ err = unzlocal_getByte(fin,&i);
+ x = (uLong)i;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<8;
+
+ if (err==UNZ_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+int unzlocal_getLong (LUFILE *fin,uLong *pX)
+{
+ uLong x ;
+ int i;
+ int err;
+
+ err = unzlocal_getByte(fin,&i);
+ x = (uLong)i;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<8;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<16;
+
+ if (err==UNZ_OK)
+ err = unzlocal_getByte(fin,&i);
+ x += ((uLong)i)<<24;
+
+ if (err==UNZ_OK)
+ *pX = x;
+ else
+ *pX = 0;
+ return err;
+}
+
+
+// My own strcmpi / strcasecmp
+int strcmpcasenosensitive_internal (const char* fileName1,const char *fileName2)
+{
+ for (;;)
+ {
+ char c1=*(fileName1++);
+ char c2=*(fileName2++);
+ if ((c1>='a') && (c1<='z'))
+ c1 -= (char)0x20;
+ if ((c2>='a') && (c2<='z'))
+ c2 -= (char)0x20;
+ if (c1=='\0')
+ return ((c2=='\0') ? 0 : -1);
+ if (c2=='\0')
+ return 1;
+ if (c1<c2)
+ return -1;
+ if (c1>c2)
+ return 1;
+ }
+}
+
+
+
+
+//
+// Compare two filename (fileName1,fileName2).
+// If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+// If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi or strcasecmp)
+//
+int unzStringFileNameCompare (const char*fileName1,const char*fileName2,int iCaseSensitivity)
+{ if (iCaseSensitivity==1) return strcmp(fileName1,fileName2);
+ else return strcmpcasenosensitive_internal(fileName1,fileName2);
+}
+
+#define BUFREADCOMMENT (0x400)
+
+
+// Locate the Central directory of a zipfile (at the end, just before
+// the global comment)
+uLong unzlocal_SearchCentralDir(LUFILE *fin)
+{ if (lufseek(fin,0,SEEK_END) != 0) return 0;
+ uLong uSizeFile = luftell(fin);
+
+ uLong uMaxBack=0xffff; // maximum size of global comment
+ if (uMaxBack>uSizeFile) uMaxBack = uSizeFile;
+
+ unsigned char *buf = (unsigned char*)zmalloc(BUFREADCOMMENT+4);
+ if (buf==NULL) return 0;
+ uLong uPosFound=0;
+
+ uLong uBackRead = 4;
+ while (uBackRead<uMaxBack)
+ { uLong uReadSize,uReadPos ;
+ int i;
+ if (uBackRead+BUFREADCOMMENT>uMaxBack) uBackRead = uMaxBack;
+ else uBackRead+=BUFREADCOMMENT;
+ uReadPos = uSizeFile-uBackRead ;
+ uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? (BUFREADCOMMENT+4) : (uSizeFile-uReadPos);
+ if (lufseek(fin,uReadPos,SEEK_SET)!=0) break;
+ if (lufread(buf,(uInt)uReadSize,1,fin)!=1) break;
+ for (i=(int)uReadSize-3; (i--)>0;)
+ { if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
+ { uPosFound = uReadPos+i; break;
+ }
+ }
+ if (uPosFound!=0) break;
+ }
+ if (buf) zfree(buf);
+ return uPosFound;
+}
+
+
+int unzGoToFirstFile (unzFile file);
+int unzCloseCurrentFile (unzFile file);
+
+// Open a Zip file.
+// If the zipfile cannot be opened (file don't exist or in not valid), return NULL.
+// Otherwise, the return value is a unzFile Handle, usable with other unzip functions
+unzFile unzOpenInternal(LUFILE *fin)
+{
+ zopenerror = ZR_OK; //+++1.2
+ if (fin==NULL) { zopenerror = ZR_ARGS; return NULL; } //+++1.2
+ if (unz_copyright[0]!=' ') {lufclose(fin); zopenerror = ZR_CORRUPT; return NULL; } //+++1.2
+
+ int err=UNZ_OK;
+ unz_s us;
+ uLong central_pos,uL;
+ central_pos = unzlocal_SearchCentralDir(fin);
+ if (central_pos==0) err=UNZ_ERRNO;
+ if (lufseek(fin,central_pos,SEEK_SET)!=0) err=UNZ_ERRNO;
+ // the signature, already checked
+ if (unzlocal_getLong(fin,&uL)!=UNZ_OK) err=UNZ_ERRNO;
+ // number of this disk
+ uLong number_disk; // number of the current dist, used for spanning ZIP, unsupported, always 0
+ if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK) err=UNZ_ERRNO;
+ // number of the disk with the start of the central directory
+ uLong number_disk_with_CD; // number the the disk with central dir, used for spaning ZIP, unsupported, always 0
+ if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK) err=UNZ_ERRNO;
+ // total number of entries in the central dir on this disk
+ if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK) err=UNZ_ERRNO;
+ // total number of entries in the central dir
+ uLong number_entry_CD; // total number of entries in the central dir (same than number_entry on nospan)
+ if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK) err=UNZ_ERRNO;
+ if ((number_entry_CD!=us.gi.number_entry) || (number_disk_with_CD!=0) || (number_disk!=0)) err=UNZ_BADZIPFILE;
+ // size of the central directory
+ if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK) err=UNZ_ERRNO;
+ // offset of start of central directory with respect to the starting disk number
+ if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK) err=UNZ_ERRNO;
+ // zipfile comment length
+ if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK) err=UNZ_ERRNO;
+ if ((central_pos+fin->initial_offset<us.offset_central_dir+us.size_central_dir) && (err==UNZ_OK)) err=UNZ_BADZIPFILE;
+ //if (err!=UNZ_OK) {lufclose(fin);return NULL;}
+ if (err!=UNZ_OK) {lufclose(fin); zopenerror = err; return NULL;} //+++1.2
+
+ us.file=fin;
+ us.byte_before_the_zipfile = central_pos+fin->initial_offset - (us.offset_central_dir+us.size_central_dir);
+ us.central_pos = central_pos;
+ us.pfile_in_zip_read = NULL;
+ fin->initial_offset = 0; // since the zipfile itself is expected to handle this
+
+ unz_s *s = (unz_s*)zmalloc(sizeof(unz_s));
+ *s=us;
+ unzGoToFirstFile((unzFile)s);
+ return (unzFile)s;
+}
+
+
+
+// Close a ZipFile opened with unzipOpen.
+// If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
+// these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+// return UNZ_OK if there is no problem.
+int unzClose (unzFile file)
+{
+ unz_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+
+ if (s->pfile_in_zip_read!=NULL)
+ unzCloseCurrentFile(file);
+
+ lufclose(s->file);
+ if (s) zfree(s); // unused s=0;
+ return UNZ_OK;
+}
+
+
+// Write info about the ZipFile in the *pglobal_info structure.
+// No preparation of the structure is needed
+// return UNZ_OK if there is no problem.
+int unzGetGlobalInfo (unzFile file,unz_global_info *pglobal_info)
+{
+ unz_s* s;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ *pglobal_info=s->gi;
+ return UNZ_OK;
+}
+
+
+// Translate date/time from Dos format to tm_unz (readable more easilty)
+void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz* ptm)
+{
+ uLong uDate;
+ uDate = (uLong)(ulDosDate>>16);
+ ptm->tm_mday = (uInt)(uDate&0x1f) ;
+ ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
+ ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
+
+ ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
+ ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
+ ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
+}
+
+// Get Info about the current file in the zipfile, with internal only info
+int unzlocal_GetCurrentFileInfoInternal (unzFile file,
+ unz_file_info *pfile_info,
+ unz_file_info_internal
+ *pfile_info_internal,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize);
+
+int unzlocal_GetCurrentFileInfoInternal (unzFile file, unz_file_info *pfile_info,
+ unz_file_info_internal *pfile_info_internal, char *szFileName,
+ uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize,
+ char *szComment, uLong commentBufferSize)
+{
+ unz_s* s;
+ unz_file_info file_info;
+ unz_file_info_internal file_info_internal;
+ int err=UNZ_OK;
+ uLong uMagic;
+ long lSeek=0;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ if (lufseek(s->file,s->pos_in_central_dir+s->byte_before_the_zipfile,SEEK_SET)!=0)
+ err=UNZ_ERRNO;
+
+
+ // we check the magic
+ if (err==UNZ_OK)
+ if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if (uMagic!=0x02014b50)
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.version_needed) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.flag) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.compression_method) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.dosDate) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);
+
+ if (unzlocal_getLong(s->file,&file_info.crc) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.compressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.uncompressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.size_filename) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.size_file_extra) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.size_file_comment) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.disk_num_start) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&file_info.internal_fa) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info.external_fa) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&file_info_internal.offset_curfile) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ lSeek+=file_info.size_filename;
+ if ((err==UNZ_OK) && (szFileName!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_filename<fileNameBufferSize)
+ {
+ *(szFileName+file_info.size_filename)='\0';
+ uSizeRead = file_info.size_filename;
+ }
+ else
+ uSizeRead = fileNameBufferSize;
+
+ if ((file_info.size_filename>0) && (fileNameBufferSize>0))
+ if (lufread(szFileName,(uInt)uSizeRead,1,s->file)!=1)
+ err=UNZ_ERRNO;
+ lSeek -= uSizeRead;
+ }
+
+
+ if ((err==UNZ_OK) && (extraField!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_file_extra<extraFieldBufferSize)
+ uSizeRead = file_info.size_file_extra;
+ else
+ uSizeRead = extraFieldBufferSize;
+
+ if (lSeek!=0)
+ if (lufseek(s->file,lSeek,SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
+ if (lufread(extraField,(uInt)uSizeRead,1,s->file)!=1)
+ err=UNZ_ERRNO;
+ lSeek += file_info.size_file_extra - uSizeRead;
+ }
+ else
+ lSeek+=file_info.size_file_extra;
+
+
+ if ((err==UNZ_OK) && (szComment!=NULL))
+ {
+ uLong uSizeRead ;
+ if (file_info.size_file_comment<commentBufferSize)
+ {
+ *(szComment+file_info.size_file_comment)='\0';
+ uSizeRead = file_info.size_file_comment;
+ }
+ else
+ uSizeRead = commentBufferSize;
+
+ if (lSeek!=0)
+ if (lufseek(s->file,lSeek,SEEK_CUR)==0)
+ {} // unused lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ if ((file_info.size_file_comment>0) && (commentBufferSize>0))
+ if (lufread(szComment,(uInt)uSizeRead,1,s->file)!=1)
+ err=UNZ_ERRNO;
+ //unused lSeek+=file_info.size_file_comment - uSizeRead;
+ }
+ else {} //unused lSeek+=file_info.size_file_comment;
+
+ if ((err==UNZ_OK) && (pfile_info!=NULL))
+ *pfile_info=file_info;
+
+ if ((err==UNZ_OK) && (pfile_info_internal!=NULL))
+ *pfile_info_internal=file_info_internal;
+
+ return err;
+}
+
+
+
+// Write info about the ZipFile in the *pglobal_info structure.
+// No preparation of the structure is needed
+// return UNZ_OK if there is no problem.
+int unzGetCurrentFileInfo (unzFile file, unz_file_info *pfile_info,
+ char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize,
+ char *szComment, uLong commentBufferSize)
+{ return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,szFileName,fileNameBufferSize,
+ extraField,extraFieldBufferSize, szComment,commentBufferSize);
+}
+
+
+// Set the current file of the zipfile to the first file.
+// return UNZ_OK if there is no problem
+int unzGoToFirstFile (unzFile file)
+{
+ int err;
+ unz_s* s;
+ if (file==NULL) return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ s->pos_in_central_dir=s->offset_central_dir;
+ s->num_file=0;
+ err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+
+// Set the current file of the zipfile to the next file.
+// return UNZ_OK if there is no problem
+// return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+int unzGoToNextFile (unzFile file)
+{
+ unz_s* s;
+ int err;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_END_OF_LIST_OF_FILE;
+ if (s->num_file+1==s->gi.number_entry)
+ return UNZ_END_OF_LIST_OF_FILE;
+
+ s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
+ s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;
+ s->num_file++;
+ err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
+
+
+// Try locate the file szFileName in the zipfile.
+// For the iCaseSensitivity signification, see unzStringFileNameCompare
+// return value :
+// UNZ_OK if the file is found. It becomes the current file.
+// UNZ_END_OF_LIST_OF_FILE if the file is not found
+int unzLocateFile (unzFile file, const TCHAR *szFileName, int iCaseSensitivity)
+{
+ unz_s* s;
+ int err;
+
+ uLong num_fileSaved;
+ uLong pos_in_central_dirSaved;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+
+ if (_tcslen(szFileName)>=UNZ_MAXFILENAMEINZIP)
+ return UNZ_PARAMERROR;
+
+ char szFileNameA[MAX_PATH];
+
+#ifdef _UNICODE
+ GetAnsiFileName(szFileName, szFileNameA, MAX_PATH-1);
+#else
+ strcpy(szFileNameA, szFileName);
+#endif
+
+ s=(unz_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_END_OF_LIST_OF_FILE;
+
+ num_fileSaved = s->num_file;
+ pos_in_central_dirSaved = s->pos_in_central_dir;
+
+ err = unzGoToFirstFile(file);
+
+ while (err == UNZ_OK)
+ {
+ char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
+ unzGetCurrentFileInfo(file,NULL,
+ szCurrentFileName,sizeof(szCurrentFileName)-1,
+ NULL,0,NULL,0);
+ if (unzStringFileNameCompare(szCurrentFileName,szFileNameA,iCaseSensitivity)==0)
+ return UNZ_OK;
+ err = unzGoToNextFile(file);
+ }
+
+ s->num_file = num_fileSaved ;
+ s->pos_in_central_dir = pos_in_central_dirSaved ;
+ return err;
+}
+
+
+// Read the local header of the current zipfile
+// Check the coherency of the local header and info in the end of central
+// directory about this file
+// store in *piSizeVar the size of extra info in local header
+// (filename and size of extra field data)
+int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s,uInt *piSizeVar,
+ uLong *poffset_local_extrafield, uInt *psize_local_extrafield)
+{
+ uLong uMagic,uData,uFlags;
+ uLong size_filename;
+ uLong size_extra_field;
+ int err=UNZ_OK;
+
+ *piSizeVar = 0;
+ *poffset_local_extrafield = 0;
+ *psize_local_extrafield = 0;
+
+ if (lufseek(s->file,s->cur_file_info_internal.offset_curfile + s->byte_before_the_zipfile,SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+
+ if (err==UNZ_OK)
+ if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if (uMagic!=0x04034b50)
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
+ err=UNZ_ERRNO;
+// else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))
+// err=UNZ_BADZIPFILE;
+ if (unzlocal_getShort(s->file,&uFlags) != UNZ_OK)
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))
+ err=UNZ_BADZIPFILE;
+
+ if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
+ (s->cur_file_info.compression_method!=Z_DEFLATED))
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) // date/time
+ err=UNZ_ERRNO;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) // crc
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) &&
+ ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) // size compr
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) &&
+ ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) // size uncompr
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) &&
+ ((uFlags & 8)==0))
+ err=UNZ_BADZIPFILE;
+
+
+ if (unzlocal_getShort(s->file,&size_filename) != UNZ_OK)
+ err=UNZ_ERRNO;
+ else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))
+ err=UNZ_BADZIPFILE;
+
+ *piSizeVar += (uInt)size_filename;
+
+ if (unzlocal_getShort(s->file,&size_extra_field) != UNZ_OK)
+ err=UNZ_ERRNO;
+ *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +
+ SIZEZIPLOCALHEADER + size_filename;
+ *psize_local_extrafield = (uInt)size_extra_field;
+
+ *piSizeVar += (uInt)size_extra_field;
+
+ return err;
+}
+
+
+
+
+
+// Open for reading data the current file in the zipfile.
+// If there is no error and the file is opened, the return value is UNZ_OK.
+int unzOpenCurrentFile (unzFile file)
+{
+ int err;
+ int Store;
+ uInt iSizeVar;
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ uLong offset_local_extrafield; // offset of the local extra field
+ uInt size_local_extrafield; // size of the local extra field
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ if (!s->current_file_ok)
+ return UNZ_PARAMERROR;
+
+ if (s->pfile_in_zip_read != NULL)
+ unzCloseCurrentFile(file);
+
+ if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar,
+ &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)
+ return UNZ_BADZIPFILE;
+
+ pfile_in_zip_read_info = (file_in_zip_read_info_s*)zmalloc(sizeof(file_in_zip_read_info_s));
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_INTERNALERROR;
+
+ pfile_in_zip_read_info->read_buffer=(char*)zmalloc(UNZ_BUFSIZE);
+ pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;
+ pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;
+ pfile_in_zip_read_info->pos_local_extrafield=0;
+
+ if (pfile_in_zip_read_info->read_buffer==NULL)
+ {
+ if (pfile_in_zip_read_info!=0) zfree(pfile_in_zip_read_info); //unused pfile_in_zip_read_info=0;
+ return UNZ_INTERNALERROR;
+ }
+
+ pfile_in_zip_read_info->stream_initialised=0;
+
+ if ((s->cur_file_info.compression_method!=0) && (s->cur_file_info.compression_method!=Z_DEFLATED))
+ { // unused err=UNZ_BADZIPFILE;
+ }
+ Store = s->cur_file_info.compression_method==0;
+
+ pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;
+ pfile_in_zip_read_info->crc32=0;
+ pfile_in_zip_read_info->compression_method =
+ s->cur_file_info.compression_method;
+ pfile_in_zip_read_info->file=s->file;
+ pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;
+
+ pfile_in_zip_read_info->stream.total_out = 0;
+
+ if (!Store)
+ {
+ pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;
+ pfile_in_zip_read_info->stream.zfree = (free_func)0;
+ pfile_in_zip_read_info->stream.opaque = (voidpf)0;
+
+ err=inflateInit2(&pfile_in_zip_read_info->stream);
+ if (err == Z_OK)
+ pfile_in_zip_read_info->stream_initialised=1;
+ // windowBits is passed < 0 to tell that there is no zlib header.
+ // Note that in this case inflate *requires* an extra "dummy" byte
+ // after the compressed stream in order to complete decompression and
+ // return Z_STREAM_END.
+ // In unzip, i don't wait absolutely Z_STREAM_END because I known the
+ // size of both compressed and uncompressed data
+ }
+ pfile_in_zip_read_info->rest_read_compressed =
+ s->cur_file_info.compressed_size ;
+ pfile_in_zip_read_info->rest_read_uncompressed =
+ s->cur_file_info.uncompressed_size ;
+
+
+ pfile_in_zip_read_info->pos_in_zipfile =
+ s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +
+ iSizeVar;
+
+ pfile_in_zip_read_info->stream.avail_in = (uInt)0;
+
+
+ s->pfile_in_zip_read = pfile_in_zip_read_info;
+ return UNZ_OK;
+}
+
+
+// Read bytes from the current file.
+// buf contain buffer where data must be copied
+// len the size of buf.
+// return the number of byte copied if somes bytes are copied
+// return 0 if the end of file was reached
+// return <0 with error code if there is an error
+// (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+int unzReadCurrentFile (unzFile file, voidp buf, unsigned len)
+{ int err=UNZ_OK;
+ uInt iRead = 0;
+
+ unz_s *s = (unz_s*)file;
+ if (s==NULL) return UNZ_PARAMERROR;
+
+ file_in_zip_read_info_s* pfile_in_zip_read_info = s->pfile_in_zip_read;
+ if (pfile_in_zip_read_info==NULL) return UNZ_PARAMERROR;
+ if ((pfile_in_zip_read_info->read_buffer == NULL)) return UNZ_END_OF_LIST_OF_FILE;
+ if (len==0) return 0;
+
+ pfile_in_zip_read_info->stream.next_out = (Byte*)buf;
+ pfile_in_zip_read_info->stream.avail_out = (uInt)len;
+
+ if (len>pfile_in_zip_read_info->rest_read_uncompressed)
+ { pfile_in_zip_read_info->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
+ }
+
+ while (pfile_in_zip_read_info->stream.avail_out>0)
+ { if ((pfile_in_zip_read_info->stream.avail_in==0) && (pfile_in_zip_read_info->rest_read_compressed>0))
+ { uInt uReadThis = UNZ_BUFSIZE;
+ if (pfile_in_zip_read_info->rest_read_compressed<uReadThis) uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;
+ if (uReadThis == 0) return UNZ_EOF;
+ if (lufseek(pfile_in_zip_read_info->file, pfile_in_zip_read_info->pos_in_zipfile + pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0) return UNZ_ERRNO;
+ if (lufread(pfile_in_zip_read_info->read_buffer,uReadThis,1,pfile_in_zip_read_info->file)!=1) return UNZ_ERRNO;
+ pfile_in_zip_read_info->pos_in_zipfile += uReadThis;
+ pfile_in_zip_read_info->rest_read_compressed-=uReadThis;
+ pfile_in_zip_read_info->stream.next_in = (Byte*)pfile_in_zip_read_info->read_buffer;
+ pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;
+ }
+
+ if (pfile_in_zip_read_info->compression_method==0)
+ { uInt uDoCopy,i ;
+ if (pfile_in_zip_read_info->stream.avail_out < pfile_in_zip_read_info->stream.avail_in)
+ { uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
+ }
+ else
+ { uDoCopy = pfile_in_zip_read_info->stream.avail_in ;
+ }
+ for (i=0;i<uDoCopy;i++)
+ { *(pfile_in_zip_read_info->stream.next_out+i) = *(pfile_in_zip_read_info->stream.next_in+i);
+ }
+ pfile_in_zip_read_info->crc32 = ucrc32(pfile_in_zip_read_info->crc32,pfile_in_zip_read_info->stream.next_out,uDoCopy);
+ pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;
+ pfile_in_zip_read_info->stream.avail_in -= uDoCopy;
+ pfile_in_zip_read_info->stream.avail_out -= uDoCopy;
+ pfile_in_zip_read_info->stream.next_out += uDoCopy;
+ pfile_in_zip_read_info->stream.next_in += uDoCopy;
+ pfile_in_zip_read_info->stream.total_out += uDoCopy;
+ iRead += uDoCopy;
+ }
+ else
+ { uLong uTotalOutBefore,uTotalOutAfter;
+ const Byte *bufBefore;
+ uLong uOutThis;
+ int flush=Z_SYNC_FLUSH;
+ uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;
+ bufBefore = pfile_in_zip_read_info->stream.next_out;
+ err=inflate(&pfile_in_zip_read_info->stream,flush);
+ uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
+ uOutThis = uTotalOutAfter-uTotalOutBefore;
+ pfile_in_zip_read_info->crc32 = ucrc32(pfile_in_zip_read_info->crc32,bufBefore,(uInt)(uOutThis));
+ pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis;
+ iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
+ if (err==Z_STREAM_END)
+ {
+ if( pfile_in_zip_read_info->rest_read_uncompressed > 0 )
+ {
+ return iRead; // More to go
+ }
+ return Z_OK; // No point returning UNZ_EOF as it is also zero
+ }
+ //if (err==Z_STREAM_END) return (iRead==0) ? UNZ_EOF : iRead; //+++1.3
+ //if (err==Z_STREAM_END) return (iRead==len) ? UNZ_EOF : iRead; //+++1.2
+
+ if (err != Z_OK) break;
+ }
+ }
+
+ // if (err==Z_OK) return iRead;
+ if( err == Z_OK )
+ {
+ if( pfile_in_zip_read_info->rest_read_uncompressed > 0 )
+ {
+ return iRead; // More to go
+ }
+ return Z_OK; // Done
+ }
+
+ return iRead;
+}
+
+
+// Give the current position in uncompressed data
+z_off_t unztell (unzFile file)
+{
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ return (z_off_t)pfile_in_zip_read_info->stream.total_out;
+}
+
+
+// return 1 if the end of file was reached, 0 elsewhere
+int unzeof (unzFile file)
+{
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
+ return 1;
+ else
+ return 0;
+}
+
+
+
+// Read extra field from the current file (opened by unzOpenCurrentFile)
+// This is the local-header version of the extra field (sometimes, there is
+// more info in the local-header version than in the central-header)
+// if buf==NULL, it return the size of the local extra field that can be read
+// if buf!=NULL, len is the size of the buffer, the extra header is copied in buf.
+// the return value is the number of bytes copied in buf, or (if <0) the error code
+int unzGetLocalExtrafield (unzFile file,voidp buf,unsigned len)
+{
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ uInt read_now;
+ uLong size_to_read;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+ size_to_read = (pfile_in_zip_read_info->size_local_extrafield -
+ pfile_in_zip_read_info->pos_local_extrafield);
+
+ if (buf==NULL)
+ return (int)size_to_read;
+
+ if (len>size_to_read)
+ read_now = (uInt)size_to_read;
+ else
+ read_now = (uInt)len ;
+
+ if (read_now==0)
+ return 0;
+
+ if (lufseek(pfile_in_zip_read_info->file, pfile_in_zip_read_info->offset_local_extrafield + pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0)
+ return UNZ_ERRNO;
+
+ if (lufread(buf,(uInt)size_to_read,1,pfile_in_zip_read_info->file)!=1)
+ return UNZ_ERRNO;
+
+ return (int)read_now;
+}
+
+// Close the file in zip opened with unzipOpenCurrentFile
+// Return UNZ_CRCERROR if all the file was read but the CRC is not good
+int unzCloseCurrentFile (unzFile file)
+{
+ int err=UNZ_OK;
+
+ unz_s* s;
+ file_in_zip_read_info_s* pfile_in_zip_read_info;
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ pfile_in_zip_read_info=s->pfile_in_zip_read;
+
+ if (pfile_in_zip_read_info==NULL)
+ return UNZ_PARAMERROR;
+
+
+ if (pfile_in_zip_read_info->rest_read_uncompressed == 0)
+ {
+ if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)
+ err=UNZ_CRCERROR;
+ }
+
+
+ if (pfile_in_zip_read_info->read_buffer!=0)
+ { void *buf = pfile_in_zip_read_info->read_buffer;
+ zfree(buf);
+ pfile_in_zip_read_info->read_buffer=0;
+ }
+ pfile_in_zip_read_info->read_buffer = NULL;
+ if (pfile_in_zip_read_info->stream_initialised)
+ inflateEnd(&pfile_in_zip_read_info->stream);
+
+ pfile_in_zip_read_info->stream_initialised = 0;
+ if (pfile_in_zip_read_info!=0) zfree(pfile_in_zip_read_info); // unused pfile_in_zip_read_info=0;
+
+ s->pfile_in_zip_read=NULL;
+
+ return err;
+}
+
+
+// Get the global comment string of the ZipFile, in the szComment buffer.
+// uSizeBuf is the size of the szComment buffer.
+// return the number of byte copied or an error code <0
+int unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
+{ //int err=UNZ_OK;
+ unz_s* s;
+ uLong uReadThis ;
+ if (file==NULL) return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ uReadThis = uSizeBuf;
+ if (uReadThis>s->gi.size_comment) uReadThis = s->gi.size_comment;
+ if (lufseek(s->file,s->central_pos+22,SEEK_SET)!=0) return UNZ_ERRNO;
+ if (uReadThis>0)
+ { *szComment='\0';
+ if (lufread(szComment,(uInt)uReadThis,1,s->file)!=1) return UNZ_ERRNO;
+ }
+ if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) *(szComment+s->gi.size_comment)='\0';
+ return (int)uReadThis;
+}
+
+
+
+
+
+int unzOpenCurrentFile (unzFile file);
+int unzReadCurrentFile (unzFile file, void *buf, unsigned len);
+int unzCloseCurrentFile (unzFile file);
+
+
+FILETIME timet2filetime(__time32_t timer)
+{
+ struct tm *tm = _gmtime32(&timer);
+ SYSTEMTIME st;
+
+ if (tm == NULL)
+ {
+ _time32(&timer);
+ tm = _gmtime32(&timer);
+ }
+
+ st.wYear = (WORD)(tm->tm_year+1900);
+ st.wMonth = (WORD)(tm->tm_mon+1);
+ st.wDay = (WORD)(tm->tm_mday);
+ st.wHour = (WORD)(tm->tm_hour);
+ st.wMinute = (WORD)(tm->tm_min);
+ st.wSecond = (WORD)(tm->tm_sec);
+ st.wMilliseconds=0;
+ FILETIME ft;
+ SystemTimeToFileTime(&st,&ft);
+ return ft;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+class TUnzip
+{ public:
+ TUnzip() : uf(0), currentfile(-1), czei(-1) {}
+
+ unzFile uf; int currentfile; ZIPENTRY cze; int czei;
+ TCHAR rootdir[MAX_PATH];
+
+ ZRESULT Open(void *z,unsigned int len,DWORD flags);
+ ZRESULT Get(int index,ZIPENTRY *ze);
+ ZRESULT Find(const TCHAR *name,bool ic,int *index,ZIPENTRY *ze);
+ ZRESULT Unzip(int index,void *dst,unsigned int len,DWORD flags);
+ ZRESULT Close();
+};
+
+
+ZRESULT TUnzip::Open(void *z,unsigned int len,DWORD flags)
+{
+ if (uf!=0 || currentfile!=-1)
+ return ZR_NOTINITED;
+ GetCurrentDirectory(MAX_PATH,rootdir);
+ _tcscat(rootdir,_T("\\"));
+ if (flags==ZIP_HANDLE)
+ {
+ DWORD type = GetFileType(z);
+ if (type!=FILE_TYPE_DISK)
+ return ZR_SEEK;
+ }
+ ZRESULT e;
+ LUFILE *f = lufopen(z,len,flags,&e);
+ if (f==NULL)
+ return e;
+ uf = unzOpenInternal(f);
+ //return ZR_OK;
+ return zopenerror; //+++1.2
+}
+
+ZRESULT TUnzip::Get(int index,ZIPENTRY *ze)
+{ if (index<-1 || index>=(int)uf->gi.number_entry)
+ return ZR_ARGS;
+ if (currentfile!=-1)
+ unzCloseCurrentFile(uf);
+ currentfile=-1;
+ if (index==czei && index!=-1) {memcpy(ze,&cze,sizeof(ZIPENTRY)); return ZR_OK;}
+ if (index==-1)
+ { ze->index = uf->gi.number_entry;
+ ze->name[0]=0;
+ ze->attr=0;
+ ze->atime.dwLowDateTime=0; ze->atime.dwHighDateTime=0;
+ ze->ctime.dwLowDateTime=0; ze->ctime.dwHighDateTime=0;
+ ze->mtime.dwLowDateTime=0; ze->mtime.dwHighDateTime=0;
+ ze->comp_size=0;
+ ze->unc_size=0;
+ return ZR_OK;
+ }
+ if (index<(int)uf->num_file) unzGoToFirstFile(uf);
+ while ((int)uf->num_file<index) unzGoToNextFile(uf);
+ unz_file_info ufi;
+ char fn[MAX_PATH];
+ unzGetCurrentFileInfo(uf,&ufi,fn,MAX_PATH,NULL,0,NULL,0);
+
+ // now get the extra header. We do this ourselves, instead of
+ // calling unzOpenCurrentFile &c., to avoid allocating more than necessary.
+ unsigned int extralen,iSizeVar; unsigned long offset;
+ int res = unzlocal_CheckCurrentFileCoherencyHeader(uf,&iSizeVar,&offset,&extralen);
+ if (res!=UNZ_OK) return ZR_CORRUPT;
+ if (lufseek(uf->file,offset,SEEK_SET)!=0) return ZR_READ;
+ char *extra = new char[extralen];
+ if (lufread(extra,1,(uInt)extralen,uf->file)!=extralen) {delete[] extra; return ZR_READ;}
+ //
+ ze->index=uf->num_file;
+ strcpy(ze->name,fn);
+ // zip has an 'attribute' 32bit value. Its lower half is windows stuff
+ // its upper half is standard unix attr.
+ unsigned long a = ufi.external_fa;
+ bool uisdir = (a&0x40000000)!=0;
+ //bool uwriteable= (a&0x08000000)!=0;
+ bool uwriteable= (a&0x00800000)!=0; // ***hd***
+ //bool ureadable= (a&0x01000000)!=0;
+ //bool uexecutable=(a&0x00400000)!=0;
+ bool wreadonly= (a&0x00000001)!=0;
+ bool whidden= (a&0x00000002)!=0;
+ bool wsystem= (a&0x00000004)!=0;
+ bool wisdir= (a&0x00000010)!=0;
+ bool warchive= (a&0x00000020)!=0;
+ ze->attr=FILE_ATTRIBUTE_NORMAL;
+ if (uisdir || wisdir) ze->attr |= FILE_ATTRIBUTE_DIRECTORY;
+ if (warchive) ze->attr|=FILE_ATTRIBUTE_ARCHIVE;
+ if (whidden) ze->attr|=FILE_ATTRIBUTE_HIDDEN;
+ if (!uwriteable||wreadonly) ze->attr|=FILE_ATTRIBUTE_READONLY;
+ if (wsystem) ze->attr|=FILE_ATTRIBUTE_SYSTEM;
+ ze->comp_size = ufi.compressed_size;
+ ze->unc_size = ufi.uncompressed_size;
+ //
+ WORD dostime = (WORD)(ufi.dosDate&0xFFFF);
+ WORD dosdate = (WORD)((ufi.dosDate>>16)&0xFFFF);
+ FILETIME lt, ft;
+ DosDateTimeToFileTime(dosdate,dostime,&lt);
+ LocalFileTimeToFileTime(&lt,&ft);
+ ze->atime=ft; ze->ctime=ft; ze->mtime=ft;
+ // the zip will always have at least that dostime. But if it also has
+ // an extra header, then we'll instead get the info from that.
+ unsigned int epos=0;
+ while (epos+4<extralen)
+ { char etype[3]; etype[0]=extra[epos+0]; etype[1]=extra[epos+1]; etype[2]=0;
+ int size = extra[epos+2];
+ if (strcmp(etype,"UT")!=0) {epos += 4+size; continue;}
+ int flags = extra[epos+4];
+ bool hasmtime = (flags&1)!=0;
+ bool hasatime = (flags&2)!=0;
+ bool hasctime = (flags&4)!=0;
+ epos+=5;
+ if (hasmtime)
+ { __time32_t mtime = *(__time32_t*)(extra+epos); epos+=4;
+ ze->mtime = timet2filetime(mtime);
+ }
+ if (hasatime)
+ { __time32_t atime = *(__time32_t*)(extra+epos); epos+=4;
+ ze->atime = timet2filetime(atime);
+ }
+ if (hasctime)
+ { __time32_t ctime = *(__time32_t*)(extra+epos);
+ ze->ctime = timet2filetime(ctime);
+ }
+ break;
+ }
+ //
+ if (extra!=0) delete[] extra;
+ memcpy(&cze,ze,sizeof(ZIPENTRY)); czei=index;
+ return ZR_OK;
+}
+
+ZRESULT TUnzip::Find(const TCHAR *name, bool ic, int *index, ZIPENTRY *ze)
+{
+ int res = unzLocateFile(uf,name,ic?CASE_INSENSITIVE:CASE_SENSITIVE);
+ if (res!=UNZ_OK)
+ {
+ if (index!=0)
+ *index=-1;
+ if (ze!=NULL)
+ {
+ ZeroMemory(ze,sizeof(ZIPENTRY)); ze->index=-1;
+ }
+ return ZR_NOTFOUND;
+ }
+ if (currentfile!=-1)
+ unzCloseCurrentFile(uf); currentfile=-1;
+ int i = (int)uf->num_file;
+ if (index!=NULL)
+ *index=i;
+ if (ze!=NULL)
+ {
+ ZRESULT zres = Get(i,ze);
+ if (zres!=ZR_OK)
+ return zres;
+ }
+ return ZR_OK;
+}
+
+void EnsureDirectory(const TCHAR *rootdir, const TCHAR *dir)
+{
+ if (dir==NULL || dir[0] == _T('\0'))
+ return;
+ const TCHAR *lastslash = dir, *c = lastslash;
+ while (*c != _T('\0'))
+ {
+ if (*c==_T('/') || *c==_T('\\'))
+ lastslash=c;
+ c++;
+ }
+ const TCHAR *name=lastslash;
+ if (lastslash!=dir)
+ {
+ TCHAR tmp[MAX_PATH];
+ _tcsncpy(tmp, dir, lastslash-dir);
+ tmp[lastslash-dir] = _T('\0');
+ EnsureDirectory(rootdir,tmp);
+ name++;
+ }
+ TCHAR cd[MAX_PATH];
+ _tcscpy(cd,rootdir);
+ //_tcscat(cd,name);
+ _tcscat(cd,dir); //+++1.2
+ CreateDirectory(cd,NULL);
+}
+
+ZRESULT TUnzip::Unzip(int index,void *dst,unsigned int len,DWORD flags)
+{
+ if (flags!=ZIP_MEMORY && flags!=ZIP_FILENAME && flags!=ZIP_HANDLE)
+ return ZR_ARGS;
+ if (flags==ZIP_MEMORY)
+ {
+ if (index!=currentfile)
+ {
+ if (currentfile!=-1)
+ unzCloseCurrentFile(uf);
+ currentfile=-1;
+ if (index>=(int)uf->gi.number_entry)
+ return ZR_ARGS;
+ if (index<(int)uf->num_file)
+ unzGoToFirstFile(uf);
+ while ((int)uf->num_file<index)
+ unzGoToNextFile(uf);
+ unzOpenCurrentFile(uf);
+ currentfile=index;
+ }
+ int res = unzReadCurrentFile(uf,dst,len);
+ if (res>0)
+ return ZR_MORE;
+ unzCloseCurrentFile(uf);
+ currentfile=-1;
+ if (res==0)
+ return ZR_OK;
+ else
+ return ZR_FLATE;
+ }
+
+ // otherwise we're writing to a handle or a file
+ if (currentfile!=-1)
+ unzCloseCurrentFile(uf);
+ currentfile=-1;
+ if (index >= (int)uf->gi.number_entry)
+ return ZR_ARGS;
+ if (index < (int)uf->num_file)
+ unzGoToFirstFile(uf);
+ while ((int)uf->num_file<index)
+ unzGoToNextFile(uf);
+ ZIPENTRY ze;
+ Get(index,&ze);
+
+ // zipentry=directory is handled specially
+ if ((ze.attr & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ if (flags==ZIP_HANDLE)
+ return ZR_OK; // don't do anything
+#ifdef _UNICODE
+ TCHAR uname[MAX_PATH];
+ GetUnicodeFileName(ze.name, uname, MAX_PATH-1);
+ EnsureDirectory(rootdir, uname);
+#else
+ EnsureDirectory(rootdir, ze.name);
+#endif
+ return ZR_OK;
+ }
+
+ // otherwise, we write the zipentry to a file/handle
+ HANDLE h;
+ if (flags==ZIP_HANDLE)
+ h=dst;
+ else
+ {
+ const TCHAR *name = (const TCHAR *)dst;
+ const TCHAR *c = name;
+ while (*c)
+ {
+ if (*c == _T('/') || *c == _T('\\'))
+ name = c + 1;
+ c++;
+ }
+ // if it's a relative filename, ensure directories. We do this as a service
+ // to the caller so they can just unzip straight unto ze.name.
+ if (name != (const TCHAR *)dst)
+ {
+ TCHAR dir[MAX_PATH];
+ _tcscpy(dir,(const TCHAR*)dst);
+ dir[name-(const TCHAR*)dst-1] = _T('\0');
+ bool isabsolute = (dir[0]==_T('/') || dir[0]==_T('\\') || dir[1]==_T(':'));
+ isabsolute |= (_tcsstr(dir,_T("../"))!=0) | (_tcsstr(dir,_T("..\\"))!=0);
+ if (!isabsolute)
+ EnsureDirectory(rootdir,dir);
+ }
+ h = ::CreateFile((const TCHAR*)dst, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
+ ze.attr, NULL);
+ }
+
+ if (h == INVALID_HANDLE_VALUE)
+ return ZR_NOFILE;
+
+ unzOpenCurrentFile(uf);
+ BYTE buf[16384];
+ bool haderr=false;
+
+ for (;;)
+ {
+ int res = unzReadCurrentFile(uf,buf,16384);
+ if (res<0)
+ {
+ haderr=true;
+ break;
+ }
+ if (res==0)
+ break;
+ DWORD writ;
+ BOOL bres = WriteFile(h,buf,res,&writ,NULL);
+ if (!bres)
+ {
+ haderr=true;
+ break;
+ }
+ }
+ bool settime=false;
+ DWORD type = GetFileType(h);
+ if (type==FILE_TYPE_DISK && !haderr)
+ settime=true;
+ if (settime)
+ SetFileTime(h,&ze.ctime,&ze.atime,&ze.mtime);
+ if (flags!=ZIP_HANDLE)
+ CloseHandle(h);
+ if (unzCloseCurrentFile(uf) == UNZ_CRCERROR)
+ return ZR_CORRUPT;
+ if (haderr)
+ return ZR_WRITE;
+ return ZR_OK;
+}
+
+ZRESULT TUnzip::Close()
+{ if (currentfile!=-1) unzCloseCurrentFile(uf); currentfile=-1;
+ if (uf!=0) unzClose(uf); uf=0;
+ return ZR_OK;
+}
+
+
+
+
+
+ZRESULT lasterrorU=ZR_OK;
+
+unsigned int FormatZipMessageU(ZRESULT code, char *buf,unsigned int len)
+{ if (code==ZR_RECENT) code=lasterrorU;
+ const char *msg="unknown zip result code";
+ switch (code)
+ { case ZR_OK: msg="Success"; break;
+ case ZR_NODUPH: msg="Culdn't duplicate handle"; break;
+ case ZR_NOFILE: msg="Couldn't create/open file"; break;
+ case ZR_NOALLOC: msg="Failed to allocate memory"; break;
+ case ZR_WRITE: msg="Error writing to file"; break;
+ case ZR_NOTFOUND: msg="File not found in the zipfile"; break;
+ case ZR_MORE: msg="Still more data to unzip"; break;
+ case ZR_CORRUPT: msg="Zipfile is corrupt or not a zipfile"; break;
+ case ZR_READ: msg="Error reading file"; break;
+ case ZR_ARGS: msg="Caller: faulty arguments"; break;
+ case ZR_PARTIALUNZ: msg="Caller: the file had already been partially unzipped"; break;
+ case ZR_NOTMMAP: msg="Caller: can only get memory of a memory zipfile"; break;
+ case ZR_MEMSIZE: msg="Caller: not enough space allocated for memory zipfile"; break;
+ case ZR_FAILED: msg="Caller: there was a previous error"; break;
+ case ZR_ENDED: msg="Caller: additions to the zip have already been ended"; break;
+ case ZR_ZMODE: msg="Caller: mixing creation and opening of zip"; break;
+ case ZR_NOTINITED: msg="Zip-bug: internal initialisation not completed"; break;
+ case ZR_SEEK: msg="Zip-bug: trying to seek the unseekable"; break;
+ case ZR_MISSIZE: msg="Zip-bug: the anticipated size turned out wrong"; break;
+ case ZR_NOCHANGE: msg="Zip-bug: tried to change mind, but not allowed"; break;
+ case ZR_FLATE: msg="Zip-bug: an internal error during flation"; break;
+ }
+ unsigned int mlen=(unsigned int)strlen(msg);
+ if (buf==0 || len==0) return mlen;
+ unsigned int n=mlen; if (n+1>len) n=len-1;
+ strncpy(buf,msg,n); buf[n]=0;
+ return mlen;
+}
+
+
+typedef struct
+{ DWORD flag;
+ TUnzip *unz;
+} TUnzipHandleData;
+
+HZIP OpenZipU(void *z,unsigned int len,DWORD flags)
+{
+ TUnzip *unz = new TUnzip();
+ lasterrorU = unz->Open(z,len,flags);
+ if (lasterrorU!=ZR_OK)
+ {
+ delete unz;
+ return 0;
+ }
+ TUnzipHandleData *han = new TUnzipHandleData;
+ han->flag=1;
+ han->unz=unz;
+ return (HZIP)han;
+}
+
+ZRESULT GetZipItemA(HZIP hz, int index, ZIPENTRY *ze)
+{
+ if (hz==0)
+ {
+ lasterrorU=ZR_ARGS;
+ return ZR_ARGS;
+ }
+ TUnzipHandleData *han = (TUnzipHandleData*)hz;
+ if (han->flag!=1)
+ {
+ lasterrorU=ZR_ZMODE;
+ return ZR_ZMODE;
+ }
+ TUnzip *unz = han->unz;
+ lasterrorU = unz->Get(index,ze);
+ return lasterrorU;
+}
+
+ZRESULT GetZipItemW(HZIP hz, int index, ZIPENTRYW *zew)
+{
+ if (hz==0)
+ {
+ lasterrorU=ZR_ARGS;
+ return ZR_ARGS;
+ }
+ TUnzipHandleData *han = (TUnzipHandleData*)hz;
+ if (han->flag!=1)
+ {
+ lasterrorU=ZR_ZMODE;
+ return ZR_ZMODE;
+ }
+ TUnzip *unz = han->unz;
+ ZIPENTRY ze;
+ lasterrorU = unz->Get(index,&ze);
+ if (lasterrorU == ZR_OK)
+ {
+ zew->index = ze.index;
+ zew->attr = ze.attr;
+ zew->atime = ze.atime;
+ zew->ctime = ze.ctime;
+ zew->mtime = ze.mtime;
+ zew->comp_size = ze.comp_size;
+ zew->unc_size = ze.unc_size;
+#ifdef _UNICODE
+ GetUnicodeFileName(ze.name, zew->name, MAX_PATH-1);
+#else
+ strcpy(zew->name, ze.name);
+#endif
+ }
+ return lasterrorU;
+}
+
+ZRESULT FindZipItemA(HZIP hz, const TCHAR *name, bool ic, int *index, ZIPENTRY *ze)
+{
+ if (hz==0)
+ {
+ lasterrorU=ZR_ARGS;
+ return ZR_ARGS;
+ }
+ TUnzipHandleData *han = (TUnzipHandleData*)hz;
+ if (han->flag!=1)
+ {
+ lasterrorU=ZR_ZMODE;
+ return ZR_ZMODE;
+ }
+ TUnzip *unz = han->unz;
+ lasterrorU = unz->Find(name,ic,index,ze);
+ return lasterrorU;
+}
+
+ZRESULT FindZipItemW(HZIP hz, const TCHAR *name, bool ic, int *index, ZIPENTRYW *zew)
+{
+ if (hz==0)
+ {
+ lasterrorU=ZR_ARGS;
+ return ZR_ARGS;
+ }
+ TUnzipHandleData *han = (TUnzipHandleData*)hz;
+ if (han->flag!=1)
+ {
+ lasterrorU=ZR_ZMODE;
+ return ZR_ZMODE;
+ }
+ TUnzip *unz = han->unz;
+ ZIPENTRY ze;
+ lasterrorU = unz->Find(name,ic,index,&ze);
+ if (lasterrorU == ZR_OK)
+ {
+ zew->index = ze.index;
+ zew->attr = ze.attr;
+ zew->atime = ze.atime;
+ zew->ctime = ze.ctime;
+ zew->mtime = ze.mtime;
+ zew->comp_size = ze.comp_size;
+ zew->unc_size = ze.unc_size;
+#ifdef _UNICODE
+ GetUnicodeFileName(ze.name, zew->name, MAX_PATH-1);
+#else
+ strcpy(zew->name, ze.name);
+#endif
+ }
+
+ return lasterrorU;
+}
+
+ZRESULT UnzipItem(HZIP hz, int index, void *dst, unsigned int len, DWORD flags)
+{
+ if (hz==0)
+ {
+ lasterrorU=ZR_ARGS;
+ return ZR_ARGS;
+ }
+ TUnzipHandleData *han = (TUnzipHandleData*)hz;
+ if (han->flag!=1)
+ {
+ lasterrorU=ZR_ZMODE;
+ return ZR_ZMODE;
+ }
+ TUnzip *unz = han->unz;
+ lasterrorU = unz->Unzip(index,dst,len,flags);
+ return lasterrorU;
+}
+
+ZRESULT CloseZipU(HZIP hz)
+{ if (hz==0) {lasterrorU=ZR_ARGS;return ZR_ARGS;}
+ TUnzipHandleData *han = (TUnzipHandleData*)hz;
+ if (han->flag!=1) {lasterrorU=ZR_ZMODE;return ZR_ZMODE;}
+ TUnzip *unz = han->unz;
+ lasterrorU = unz->Close();
+ delete unz;
+ delete han;
+ return lasterrorU;
+}
+
+bool IsZipHandleU(HZIP hz)
+{ if (hz==0) return true;
+ TUnzipHandleData *han = (TUnzipHandleData*)hz;
+ return (han->flag==1);
+}
+
+
diff --git a/src/Common/XUnzip.h b/src/Common/XUnzip.h
new file mode 100644
index 00000000..573dc7d8
--- /dev/null
+++ b/src/Common/XUnzip.h
@@ -0,0 +1,382 @@
+// XUnzip.h Version 1.3
+//
+// Authors: Mark Adler et al. (see below)
+//
+// Modified by: Lucian Wischik
+// lu@wischik.com
+//
+// Version 1.0 - Turned C files into just a single CPP file
+// - Made them compile cleanly as C++ files
+// - Gave them simpler APIs
+// - Added the ability to zip/unzip directly in memory without
+// any intermediate files
+//
+// Modified by: Hans Dietrich
+// hdietrich@gmail.com
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Lucian Wischik's comments:
+// --------------------------
+// THIS FILE is almost entirely based upon code by info-zip.
+// It has been modified by Lucian Wischik.
+// The original code may be found at http://www.info-zip.org
+// The original copyright text follows.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Original authors' comments:
+// ---------------------------
+// This is version 2002-Feb-16 of the Info-ZIP copyright and license. The
+// definitive version of this document should be available at
+// ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely.
+//
+// Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
+//
+// For the purposes of this copyright and license, "Info-ZIP" is defined as
+// the following set of individuals:
+//
+// Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
+// Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase,
+// Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
+// David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
+// Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
+// Kai Uwe Rommel, Steve Salisbury, Dave Smith, Christian Spieler,
+// Antoine Verheijen, Paul von Behren, Rich Wales, Mike White
+//
+// This software is provided "as is", without warranty of any kind, express
+// or implied. In no event shall Info-ZIP or its contributors be held liable
+// for any direct, indirect, incidental, special or consequential damages
+// arising out of the use of or inability to use this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// definition, disclaimer, and this list of conditions.
+//
+// 2. Redistributions in binary form (compiled executables) must reproduce
+// the above copyright notice, definition, disclaimer, and this list of
+// conditions in documentation and/or other materials provided with the
+// distribution. The sole exception to this condition is redistribution
+// of a standard UnZipSFX binary as part of a self-extracting archive;
+// that is permitted without inclusion of this license, as long as the
+// normal UnZipSFX banner has not been removed from the binary or disabled.
+//
+// 3. Altered versions--including, but not limited to, ports to new
+// operating systems, existing ports with new graphical interfaces, and
+// dynamic, shared, or static library versions--must be plainly marked
+// as such and must not be misrepresented as being the original source.
+// Such altered versions also must not be misrepresented as being
+// Info-ZIP releases--including, but not limited to, labeling of the
+// altered versions with the names "Info-ZIP" (or any variation thereof,
+// including, but not limited to, different capitalizations),
+// "Pocket UnZip", "WiZ" or "MacZip" without the explicit permission of
+// Info-ZIP. Such altered versions are further prohibited from
+// misrepresentative use of the Zip-Bugs or Info-ZIP e-mail addresses or
+// of the Info-ZIP URL(s).
+//
+// 4. Info-ZIP retains the right to use the names "Info-ZIP", "Zip", "UnZip",
+// "UnZipSFX", "WiZ", "Pocket UnZip", "Pocket Zip", and "MacZip" for its
+// own source and binary releases.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef XUNZIP_H
+#define XUNZIP_H
+
+
+#ifndef XZIP_H
+DECLARE_HANDLE(HZIP); // An HZIP identifies a zip file that has been opened
+#endif
+
+typedef DWORD ZRESULT;
+// return codes from any of the zip functions. Listed later.
+
+#define ZIP_HANDLE 1
+#define ZIP_FILENAME 2
+#define ZIP_MEMORY 3
+
+typedef struct
+{ int index; // index of this file within the zip
+ char name[MAX_PATH]; // filename within the zip
+ DWORD attr; // attributes, as in GetFileAttributes.
+ FILETIME atime,ctime,mtime;// access, create, modify filetimes
+ long comp_size; // sizes of item, compressed and uncompressed. These
+ long unc_size; // may be -1 if not yet known (e.g. being streamed in)
+} ZIPENTRY;
+
+typedef struct
+{ int index; // index of this file within the zip
+ TCHAR name[MAX_PATH]; // filename within the zip
+ DWORD attr; // attributes, as in GetFileAttributes.
+ FILETIME atime,ctime,mtime;// access, create, modify filetimes
+ long comp_size; // sizes of item, compressed and uncompressed. These
+ long unc_size; // may be -1 if not yet known (e.g. being streamed in)
+} ZIPENTRYW;
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// OpenZip()
+//
+// Purpose: Open an existing zip archive file
+//
+// Parameters: z - archive file name if flags is ZIP_FILENAME; for other
+// uses see below
+// len - for memory (ZIP_MEMORY) should be the buffer size;
+// for other uses, should be 0
+// flags - indicates usage, see below; for files, this will be
+// ZIP_FILENAME
+//
+// Returns: HZIP - non-zero if zip archive opened ok, otherwise 0
+//
+HZIP OpenZip(void *z, unsigned int len, DWORD flags);
+// OpenZip - opens a zip file and returns a handle with which you can
+// subsequently examine its contents. You can open a zip file from:
+// from a pipe: OpenZip(hpipe_read,0, ZIP_HANDLE);
+// from a file (by handle): OpenZip(hfile,0, ZIP_HANDLE);
+// from a file (by name): OpenZip("c:\\test.zip",0, ZIP_FILENAME);
+// from a memory block: OpenZip(bufstart, buflen, ZIP_MEMORY);
+// If the file is opened through a pipe, then items may only be
+// accessed in increasing order, and an item may only be unzipped once,
+// although GetZipItem can be called immediately before and after unzipping
+// it. If it's opened i n any other way, then full random access is possible.
+// Note: pipe input is not yet implemented.
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// GetZipItem()
+//
+// Purpose: Get information about an item in an open zip archive
+//
+// Parameters: hz - handle of open zip archive
+// index - index number (0 based) of item in zip
+// ze - pointer to a ZIPENTRY (if ANSI) or ZIPENTRYW struct
+// (if Unicode)
+//
+// Returns: ZRESULT - ZR_OK if success, otherwise some other value
+//
+
+#ifdef _UNICODE
+#define GetZipItem GetZipItemW
+#else
+#define GetZipItem GetZipItemA
+#endif
+
+ZRESULT GetZipItemA(HZIP hz, int index, ZIPENTRY *ze);
+ZRESULT GetZipItemW(HZIP hz, int index, ZIPENTRYW *ze);
+// GetZipItem - call this to get information about an item in the zip.
+// If index is -1 and the file wasn't opened through a pipe,
+// then it returns information about the whole zipfile
+// (and in particular ze.index returns the number of index items).
+// Note: the item might be a directory (ze.attr & FILE_ATTRIBUTE_DIRECTORY)
+// See below for notes on what happens when you unzip such an item.
+// Note: if you are opening the zip through a pipe, then random access
+// is not possible and GetZipItem(-1) fails and you can't discover the number
+// of items except by calling GetZipItem on each one of them in turn,
+// starting at 0, until eventually the call fails. Also, in the event that
+// you are opening through a pipe and the zip was itself created into a pipe,
+// then then comp_size and sometimes unc_size as well may not be known until
+// after the item has been unzipped.
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// FindZipItem()
+//
+// Purpose: Find item by name and return information about it
+//
+// Parameters: hz - handle of open zip archive
+// name - name of file to look for inside zip archive
+// ic - TRUE = case insensitive
+// index - pointer to index number returned, or -1
+// ze - pointer to a ZIPENTRY (if ANSI) or ZIPENTRYW struct
+// (if Unicode)
+//
+// Returns: ZRESULT - ZR_OK if success, otherwise some other value
+//
+
+#ifdef _UNICODE
+#define FindZipItem FindZipItemW
+#else
+#define FindZipItem FindZipItemA
+#endif
+
+ZRESULT FindZipItemA(HZIP hz, const TCHAR *name, bool ic, int *index, ZIPENTRY *ze);
+ZRESULT FindZipItemW(HZIP hz, const TCHAR *name, bool ic, int *index, ZIPENTRYW *ze);
+// FindZipItem - finds an item by name. ic means 'insensitive to case'.
+// It returns the index of the item, and returns information about it.
+// If nothing was found, then index is set to -1 and the function returns
+// an error code.
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// UnzipItem()
+//
+// Purpose: Find item by index and unzip it
+//
+// Parameters: hz - handle of open zip archive
+// index - index number of file to unzip
+// dst - target file name of unzipped file
+// len - for memory (ZIP_MEMORY. length of buffer;
+// otherwise 0
+// flags - indicates usage, see below; for files, this will be
+// ZIP_FILENAME
+//
+// Returns: ZRESULT - ZR_OK if success, otherwise some other value
+//
+
+ZRESULT UnzipItem(HZIP hz, int index, void *dst, unsigned int len, DWORD flags);
+// UnzipItem - given an index to an item, unzips it. You can unzip to:
+// to a pipe: UnzipItem(hz,i, hpipe_write,0,ZIP_HANDLE);
+// to a file (by handle): UnzipItem(hz,i, hfile,0,ZIP_HANDLE);
+// to a file (by name): UnzipItem(hz,i, ze.name,0,ZIP_FILENAME);
+// to a memory block: UnzipItem(hz,i, buf,buflen,ZIP_MEMORY);
+// In the final case, if the buffer isn't large enough to hold it all,
+// then the return code indicates that more is yet to come. If it was
+// large enough, and you want to know precisely how big, GetZipItem.
+// Note: zip files are normally stored with relative pathnames. If you
+// unzip with ZIP_FILENAME a relative pathname then the item gets created
+// relative to the current directory - it first ensures that all necessary
+// subdirectories have been created. Also, the item may itself be a directory.
+// If you unzip a directory with ZIP_FILENAME, then the directory gets created.
+// If you unzip it to a handle or a memory block, then nothing gets created
+// and it emits 0 bytes.
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// CloseZip()
+//
+// Purpose: Close an open zip archive
+//
+// Parameters: hz - handle to an open zip archive
+//
+// Returns: ZRESULT - ZR_OK if success, otherwise some other value
+//
+ZRESULT CloseZip(HZIP hz);
+// CloseZip - the zip handle must be closed with this function.
+
+unsigned int FormatZipMessage(ZRESULT code, char *buf,unsigned int len);
+// FormatZipMessage - given an error code, formats it as a string.
+// It returns the length of the error message. If buf/len points
+// to a real buffer, then it also writes as much as possible into there.
+
+
+// These are the result codes:
+#define ZR_OK 0x00000000 // nb. the pseudo-code zr-recent is never returned,
+#define ZR_RECENT 0x00000001 // but can be passed to FormatZipMessage.
+// The following come from general system stuff (e.g. files not openable)
+#define ZR_GENMASK 0x0000FF00
+#define ZR_NODUPH 0x00000100 // couldn't duplicate the handle
+#define ZR_NOFILE 0x00000200 // couldn't create/open the file
+#define ZR_NOALLOC 0x00000300 // failed to allocate some resource
+#define ZR_WRITE 0x00000400 // a general error writing to the file
+#define ZR_NOTFOUND 0x00000500 // couldn't find that file in the zip
+#define ZR_MORE 0x00000600 // there's still more data to be unzipped
+#define ZR_CORRUPT 0x00000700 // the zipfile is corrupt or not a zipfile
+#define ZR_READ 0x00000800 // a general error reading the file
+// The following come from mistakes on the part of the caller
+#define ZR_CALLERMASK 0x00FF0000
+#define ZR_ARGS 0x00010000 // general mistake with the arguments
+#define ZR_NOTMMAP 0x00020000 // tried to ZipGetMemory, but that only works on mmap zipfiles, which yours wasn't
+#define ZR_MEMSIZE 0x00030000 // the memory size is too small
+#define ZR_FAILED 0x00040000 // the thing was already failed when you called this function
+#define ZR_ENDED 0x00050000 // the zip creation has already been closed
+#define ZR_MISSIZE 0x00060000 // the indicated input file size turned out mistaken
+#define ZR_PARTIALUNZ 0x00070000 // the file had already been partially unzipped
+#define ZR_ZMODE 0x00080000 // tried to mix creating/opening a zip
+// The following come from bugs within the zip library itself
+#define ZR_BUGMASK 0xFF000000
+#define ZR_NOTINITED 0x01000000 // initialisation didn't work
+#define ZR_SEEK 0x02000000 // trying to seek in an unseekable file
+#define ZR_NOCHANGE 0x04000000 // changed its mind on storage, but not allowed
+#define ZR_FLATE 0x05000000 // an internal error in the de/inflation code
+
+
+
+
+
+// e.g.
+//
+// SetCurrentDirectory("c:\\docs\\stuff");
+// HZIP hz = OpenZip("c:\\stuff.zip",0,ZIP_FILENAME);
+// ZIPENTRY ze; GetZipItem(hz,-1,&ze); int numitems=ze.index;
+// for (int i=0; i<numitems; i++)
+// { GetZipItem(hz,i,&ze);
+// UnzipItem(hz,i,ze.name,0,ZIP_FILENAME);
+// }
+// CloseZip(hz);
+//
+//
+// HRSRC hrsrc = FindResource(hInstance,MAKEINTRESOURCE(1),RT_RCDATA);
+// HANDLE hglob = LoadResource(hInstance,hrsrc);
+// void *zipbuf=LockResource(hglob);
+// unsigned int ziplen=SizeofResource(hInstance,hrsrc);
+// HZIP hz = OpenZip(zipbuf, ziplen, ZIP_MEMORY);
+// - unzip to a membuffer -
+// ZIPENTRY ze; int i; FindZipItem(hz,"file.dat",&i,&ze);
+// char *ibuf = new char[ze.unc_size];
+// UnzipItem(hz,i, ibuf, ze.unc_size,ZIP_MEMORY);
+// delete[] buf;
+// - unzip to a fixed membuff -
+// ZIPENTRY ze; int i; FindZipItem(hz,"file.dat",&i,&ze);
+// char ibuf[1024]; ZIPRESULT zr=ZR_MORE; unsigned long totsize=0;
+// while (zr==ZR_MORE)
+// { zr = UnzipItem(hz,i, ibuf,1024,ZIP_MEMORY);
+// unsigned long bufsize=1024; if (zr==ZR_OK) bufsize=ze.unc_size-totsize;
+// totsize+=bufsize;
+// }
+// - unzip to a pipe -
+// HANDLE hthread=CreateWavReaderThread(&hread,&hwrite);
+// FindZipItem(hz,"sound.wav",&i,&ze);
+// UnzipItem(hz,i, hwrite,0,ZIP_HANDLE);
+// CloseHandle(hwrite);
+// WaitForSingleObject(hthread,INFINITE);
+// CloseHandle(hread); CloseHandle(hthread);
+// - finished -
+// CloseZip(hz);
+// // note: no need to free resources obtained through Find/Load/LockResource
+//
+//
+// SetCurrentDirectory("c:\\docs\\pipedzipstuff");
+// HANDLE hread,hwrite; CreatePipe(&hread,&hwrite);
+// CreateZipWriterThread(hwrite);
+// HZIP hz = OpenZip(hread,0,ZIP_HANDLE);
+// for (int i=0; ; i++)
+// { ZIPENTRY ze; ZRESULT res = GetZipItem(hz,i,&ze);
+// if (res!=ZE_OK) break; // no more
+// UnzipItem(hz,i, ze.name,0,ZIP_FILENAME);
+// }
+// CloseZip(hz);
+//
+
+
+
+
+// Now we indulge in a little skullduggery so that the code works whether
+// the user has included just zip or both zip and unzip.
+// Idea: if header files for both zip and unzip are present, then presumably
+// the cpp files for zip and unzip are both present, so we will call
+// one or the other of them based on a dynamic choice. If the header file
+// for only one is present, then we will bind to that particular one.
+HZIP OpenZipU(void *z,unsigned int len,DWORD flags);
+ZRESULT CloseZipU(HZIP hz);
+unsigned int FormatZipMessageU(ZRESULT code, char *buf,unsigned int len);
+bool IsZipHandleU(HZIP hz);
+#define OpenZip OpenZipU
+
+#ifdef XZIP_H
+#undef CloseZip
+#define CloseZip(hz) (IsZipHandleU(hz)?CloseZipU(hz):CloseZipZ(hz))
+#else
+#define CloseZip CloseZipU
+#define FormatZipMessage FormatZipMessageU
+#endif
+
+
+#endif //XUNZIP_H
diff --git a/src/Common/XZip.cpp b/src/Common/XZip.cpp
new file mode 100644
index 00000000..9ce6de5d
--- /dev/null
+++ b/src/Common/XZip.cpp
@@ -0,0 +1,3215 @@
+// XZip.cpp Version 1.3
+//
+// Authors: Mark Adler et al. (see below)
+//
+// Modified by: Lucian Wischik
+// lu@wischik.com
+//
+// Version 1.0 - Turned C files into just a single CPP file
+// - Made them compile cleanly as C++ files
+// - Gave them simpler APIs
+// - Added the ability to zip/unzip directly in memory without
+// any intermediate files
+//
+// Modified by: Hans Dietrich
+// hdietrich@gmail.com
+//
+// Version 1.3: - Fixed UTC problem
+//
+// Version 1.2: - Many bug fixes. See CodeProject article for list.
+//
+// Version 1.1: - Added Unicode support to CreateZip() and ZipAdd()
+// - Changed file names to avoid conflicts with Lucian's files
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Lucian Wischik's comments:
+// --------------------------
+// THIS FILE is almost entirely based upon code by Info-ZIP.
+// It has been modified by Lucian Wischik.
+// The original code may be found at http://www.info-zip.org
+// The original copyright text follows.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Original authors' comments:
+// ---------------------------
+// This is version 2002-Feb-16 of the Info-ZIP copyright and license. The
+// definitive version of this document should be available at
+// ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely.
+//
+// Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
+//
+// For the purposes of this copyright and license, "Info-ZIP" is defined as
+// the following set of individuals:
+//
+// Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
+// Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase,
+// Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
+// David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
+// Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
+// Kai Uwe Rommel, Steve Salisbury, Dave Smith, Christian Spieler,
+// Antoine Verheijen, Paul von Behren, Rich Wales, Mike White
+//
+// This software is provided "as is", without warranty of any kind, express
+// or implied. In no event shall Info-ZIP or its contributors be held liable
+// for any direct, indirect, incidental, special or consequential damages
+// arising out of the use of or inability to use this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// definition, disclaimer, and this list of conditions.
+//
+// 2. Redistributions in binary form (compiled executables) must reproduce
+// the above copyright notice, definition, disclaimer, and this list of
+// conditions in documentation and/or other materials provided with the
+// distribution. The sole exception to this condition is redistribution
+// of a standard UnZipSFX binary as part of a self-extracting archive;
+// that is permitted without inclusion of this license, as long as the
+// normal UnZipSFX banner has not been removed from the binary or disabled.
+//
+// 3. Altered versions--including, but not limited to, ports to new
+// operating systems, existing ports with new graphical interfaces, and
+// dynamic, shared, or static library versions--must be plainly marked
+// as such and must not be misrepresented as being the original source.
+// Such altered versions also must not be misrepresented as being
+// Info-ZIP releases--including, but not limited to, labeling of the
+// altered versions with the names "Info-ZIP" (or any variation thereof,
+// including, but not limited to, different capitalizations),
+// "Pocket UnZip", "WiZ" or "MacZip" without the explicit permission of
+// Info-ZIP. Such altered versions are further prohibited from
+// misrepresentative use of the Zip-Bugs or Info-ZIP e-mail addresses or
+// of the Info-ZIP URL(s).
+//
+// 4. Info-ZIP retains the right to use the names "Info-ZIP", "Zip", "UnZip",
+// "UnZipSFX", "WiZ", "Pocket UnZip", "Pocket Zip", and "MacZip" for its
+// own source and binary releases.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WIN64
+#define _USE_32BIT_TIME_T //+++1.2
+#endif
+
+
+#define STRICT
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <tchar.h>
+#include <time.h>
+#include "xzip.h"
+
+#pragma warning(disable : 4996) // disable bogus deprecation warning
+
+typedef unsigned char uch; // unsigned 8-bit value
+typedef unsigned short ush; // unsigned 16-bit value
+typedef unsigned long ulg; // unsigned 32-bit value
+typedef size_t extent; // file size
+typedef unsigned Pos; // must be at least 32 bits
+typedef unsigned IPos; // A Pos is an index in the character window. Pos is used only for parameter passing
+
+#ifndef EOF
+#define EOF (-1)
+#endif
+
+
+// Error return values. The values 0..4 and 12..18 follow the conventions
+// of PKZIP. The values 4..10 are all assigned to "insufficient memory"
+// by PKZIP, so the codes 5..10 are used here for other purposes.
+#define ZE_MISS -1 // used by procname(), zipbare()
+#define ZE_OK 0 // success
+#define ZE_EOF 2 // unexpected end of zip file
+#define ZE_FORM 3 // zip file structure error
+#define ZE_MEM 4 // out of memory
+#define ZE_LOGIC 5 // internal logic error
+#define ZE_BIG 6 // entry too large to split
+#define ZE_NOTE 7 // invalid comment format
+#define ZE_TEST 8 // zip test (-T) failed or out of memory
+#define ZE_ABORT 9 // user interrupt or termination
+#define ZE_TEMP 10 // error using a temp file
+#define ZE_READ 11 // read or seek error
+#define ZE_NONE 12 // nothing to do
+#define ZE_NAME 13 // missing or empty zip file
+#define ZE_WRITE 14 // error writing to a file
+#define ZE_CREAT 15 // couldn't open to write
+#define ZE_PARMS 16 // bad command line
+#define ZE_OPEN 18 // could not open a specified file to read
+#define ZE_MAXERR 18 // the highest error number
+
+
+// internal file attribute
+#define UNKNOWN (-1)
+#define BINARY 0
+#define ASCII 1
+
+#define BEST -1 // Use best method (deflation or store)
+#define STORE 0 // Store method
+#define DEFLATE 8 // Deflation method
+
+#define CRCVAL_INITIAL 0L
+
+// MSDOS file or directory attributes
+#define MSDOS_HIDDEN_ATTR 0x02
+#define MSDOS_DIR_ATTR 0x10
+
+// Lengths of headers after signatures in bytes
+#define LOCHEAD 26
+#define CENHEAD 42
+#define ENDHEAD 18
+
+// Definitions for extra field handling:
+#define EB_HEADSIZE 4 /* length of a extra field block header */
+#define EB_LEN 2 /* offset of data length field in header */
+#define EB_UT_MINLEN 1 /* minimal UT field contains Flags byte */
+#define EB_UT_FLAGS 0 /* byte offset of Flags field */
+#define EB_UT_TIME1 1 /* byte offset of 1st time value */
+#define EB_UT_FL_MTIME (1 << 0) /* mtime present */
+#define EB_UT_FL_ATIME (1 << 1) /* atime present */
+#define EB_UT_FL_CTIME (1 << 2) /* ctime present */
+#define EB_UT_LEN(n) (EB_UT_MINLEN + 4 * (n))
+#define EB_L_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(3))
+#define EB_C_UT_SIZE (EB_HEADSIZE + EB_UT_LEN(1))
+
+
+// Macros for writing machine integers to little-endian format
+#define PUTSH(a,f) {char _putsh_c=(char)((a)&0xff); wfunc(param,&_putsh_c,1); _putsh_c=(char)((a)>>8); wfunc(param,&_putsh_c,1);}
+#define PUTLG(a,f) {PUTSH((a) & 0xffff,(f)) PUTSH((a) >> 16,(f))}
+
+
+// -- Structure of a ZIP file --
+// Signatures for zip file information headers
+#define LOCSIG 0x04034b50L
+#define CENSIG 0x02014b50L
+#define ENDSIG 0x06054b50L
+#define EXTLOCSIG 0x08074b50L
+
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+// The minimum and maximum match lengths
+
+
+#define WSIZE (0x8000)
+// Maximum window size = 32K. If you are really short of memory, compile
+// with a smaller WSIZE but this reduces the compression ratio for files
+// of size > WSIZE. WSIZE must be a power of two in the current implementation.
+//
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+// Minimum amount of lookahead, except at the end of the input file.
+// See deflate.c for comments about the MIN_MATCH+1.
+//
+
+#define MAX_DIST (WSIZE-MIN_LOOKAHEAD)
+// In order to simplify the code, particularly on 16 bit machines, match
+// distances are limited to MAX_DIST instead of WSIZE.
+//
+
+
+
+
+
+// ===========================================================================
+// Constants
+//
+
+#define MAX_BITS 15
+// All codes must not exceed MAX_BITS bits
+
+#define MAX_BL_BITS 7
+// Bit length codes must not exceed MAX_BL_BITS bits
+
+#define LENGTH_CODES 29
+// number of length codes, not counting the special END_BLOCK code
+
+#define LITERALS 256
+// number of literal bytes 0..255
+
+#define END_BLOCK 256
+// end of block literal code
+
+#define L_CODES (LITERALS+1+LENGTH_CODES)
+// number of Literal or Length codes, including the END_BLOCK code
+
+#define D_CODES 30
+// number of distance codes
+
+#define BL_CODES 19
+// number of codes used to transfer the bit lengths
+
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+// The three kinds of block type
+
+#define LIT_BUFSIZE 0x8000
+#define DIST_BUFSIZE LIT_BUFSIZE
+// Sizes of match buffers for literals/lengths and distances. There are
+// 4 reasons for limiting LIT_BUFSIZE to 64K:
+// - frequencies can be kept in 16 bit counters
+// - if compression is not successful for the first block, all input data is
+// still in the window so we can still emit a stored block even when input
+// comes from standard input. (This can also be done for all blocks if
+// LIT_BUFSIZE is not greater than 32K.)
+// - if compression is not successful for a file smaller than 64K, we can
+// even emit a stored file instead of a stored block (saving 5 bytes).
+// - creating new Huffman trees less frequently may not provide fast
+// adaptation to changes in the input data statistics. (Take for
+// example a binary file with poorly compressible code followed by
+// a highly compressible string table.) Smaller buffer sizes give
+// fast adaptation but have of course the overhead of transmitting trees
+// more frequently.
+// - I can't count above 4
+// The current code is general and allows DIST_BUFSIZE < LIT_BUFSIZE (to save
+// memory at the expense of compression). Some optimizations would be possible
+// if we rely on DIST_BUFSIZE == LIT_BUFSIZE.
+//
+
+#define REP_3_6 16
+// repeat previous bit length 3-6 times (2 bits of repeat count)
+
+#define REPZ_3_10 17
+// repeat a zero length 3-10 times (3 bits of repeat count)
+
+#define REPZ_11_138 18
+// repeat a zero length 11-138 times (7 bits of repeat count)
+
+#define HEAP_SIZE (2*L_CODES+1)
+// maximum heap size
+
+
+// ===========================================================================
+// Local data used by the "bit string" routines.
+//
+
+#define Buf_size (8 * 2*sizeof(char))
+// Number of bits used within bi_buf. (bi_buf may be implemented on
+// more than 16 bits on some systems.)
+
+// Output a 16 bit value to the bit stream, lower (oldest) byte first
+#if 0 // -----------------------------------------------------------
+#define PUTSHORT(state,w) \
+{ \
+ if (state.bs.out_offset >= state.bs.out_size-1) \
+ state.flush_outbuf(state.param,state.bs.out_buf, &state.bs.out_offset); \
+ state.bs.out_buf[state.bs.out_offset++] = (char) ((w) & 0xff); \
+ state.bs.out_buf[state.bs.out_offset++] = (char) ((ush)(w) >> 8); \
+}
+#endif // -----------------------------------------------------------
+
+//+++1.2
+#define PUTSHORT(state,w) \
+{ \
+ if (state.bs.out_offset >= state.bs.out_size-1) \
+ state.flush_outbuf(state.param,state.bs.out_buf, &state.bs.out_offset); \
+ if (state.bs.out_offset < state.bs.out_size-1) \
+ { \
+ state.bs.out_buf[state.bs.out_offset++] = (char) ((w) & 0xff); \
+ state.bs.out_buf[state.bs.out_offset++] = (char) ((ush)(w) >> 8); \
+ }\
+}
+
+#if 0 // -----------------------------------------------------------
+#define PUTBYTE(state,b) \
+{ \
+ if (state.bs.out_offset >= state.bs.out_size) \
+ state.flush_outbuf(state.param,state.bs.out_buf, &state.bs.out_offset); \
+ state.bs.out_buf[state.bs.out_offset++] = (char) (b); \
+}
+#endif // -----------------------------------------------------------
+
+//+++1.2
+#define PUTBYTE(state,b) \
+{ \
+ if (state.bs.out_offset >= state.bs.out_size) \
+ state.flush_outbuf(state.param,state.bs.out_buf, &state.bs.out_offset); \
+ if (state.bs.out_offset < state.bs.out_size) \
+ state.bs.out_buf[state.bs.out_offset++] = (char) (b); \
+}
+
+// DEFLATE.CPP HEADER
+
+#define HASH_BITS 15
+// For portability to 16 bit machines, do not use values above 15.
+
+#define HASH_SIZE (unsigned)(1<<HASH_BITS)
+#define HASH_MASK (HASH_SIZE-1)
+#define WMASK (WSIZE-1)
+// HASH_SIZE and WSIZE must be powers of two
+
+#define NIL 0
+// Tail of hash chains
+
+#define FAST 4
+#define SLOW 2
+// speed options for the general purpose bit flag
+
+#define TOO_FAR 4096
+// Matches of length 3 are discarded if their distance exceeds TOO_FAR
+
+
+
+#define EQUAL 0
+// result of memcmp for equal strings
+
+
+// ===========================================================================
+// Local data used by the "longest match" routines.
+
+#define H_SHIFT ((HASH_BITS+MIN_MATCH-1)/MIN_MATCH)
+// Number of bits by which ins_h and del_h must be shifted at each
+// input step. It must be such that after MIN_MATCH steps, the oldest
+// byte no longer takes part in the hash key, that is:
+// H_SHIFT * MIN_MATCH >= HASH_BITS
+
+#define max_insert_length max_lazy_match
+// Insert new strings in the hash table only if the match length
+// is not greater than this length. This saves time but degrades compression.
+// max_insert_length is used only for compression levels <= 3.
+
+
+
+const int extra_lbits[LENGTH_CODES] // extra bits for each length code
+ = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+
+const int extra_dbits[D_CODES] // extra bits for each distance code
+ = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+const int extra_blbits[BL_CODES]// extra bits for each bit length code
+ = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+
+const uch bl_order[BL_CODES] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+// The lengths of the bit length codes are sent in order of decreasing
+// probability, to avoid transmitting the lengths for unused bit length codes.
+
+
+typedef struct config {
+ ush good_length; // reduce lazy search above this match length
+ ush max_lazy; // do not perform lazy search above this match length
+ ush nice_length; // quit search above this match length
+ ush max_chain;
+} config;
+
+// Values for max_lazy_match, good_match, nice_match and max_chain_length,
+// depending on the desired pack level (0..9). The values given below have
+// been tuned to exclude worst case performance for pathological files.
+// Better values may be found for specific files.
+//
+
+const config configuration_table[10] = {
+// good lazy nice chain
+ {0, 0, 0, 0}, // 0 store only
+ {4, 4, 8, 4}, // 1 maximum speed, no lazy matches
+ {4, 5, 16, 8}, // 2
+ {4, 6, 32, 32}, // 3
+ {4, 4, 16, 16}, // 4 lazy matches */
+ {8, 16, 32, 32}, // 5
+ {8, 16, 128, 128}, // 6
+ {8, 32, 128, 256}, // 7
+ {32, 128, 258, 1024}, // 8
+ {32, 258, 258, 4096}};// 9 maximum compression */
+
+// Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
+// For deflate_fast() (levels <= 3) good is ignored and lazy has a different meaning.
+
+
+
+
+
+// Data structure describing a single value and its code string.
+typedef struct ct_data {
+ union {
+ ush freq; // frequency count
+ ush code; // bit string
+ } fc;
+ union {
+ ush dad; // father node in Huffman tree
+ ush len; // length of bit string
+ } dl;
+} ct_data;
+
+typedef struct tree_desc
+{
+ ct_data *dyn_tree; // the dynamic tree
+ ct_data *static_tree; // corresponding static tree or NULL
+ const int *extra_bits; // extra bits for each code or NULL
+ int extra_base; // base index for extra_bits
+ int elems; // max number of elements in the tree
+ int max_length; // max bit length for the codes
+ int max_code; // largest code with non zero frequency
+} tree_desc;
+
+
+class TTreeState
+{
+public:
+ TTreeState();
+
+ ct_data dyn_ltree[HEAP_SIZE]; // literal and length tree
+ ct_data dyn_dtree[2*D_CODES+1]; // distance tree
+ ct_data static_ltree[L_CODES+2]; // the static literal tree...
+ // ... Since the bit lengths are imposed, there is no need for the L_CODES
+ // extra codes used during heap construction. However the codes 286 and 287
+ // are needed to build a canonical tree (see ct_init below).
+ ct_data static_dtree[D_CODES]; // the static distance tree...
+ // ... (Actually a trivial tree since all codes use 5 bits.)
+ ct_data bl_tree[2*BL_CODES+1]; // Huffman tree for the bit lengths
+
+ tree_desc l_desc;
+ tree_desc d_desc;
+ tree_desc bl_desc;
+
+ ush bl_count[MAX_BITS+1]; // number of codes at each bit length for an optimal tree
+
+ int heap[2*L_CODES+1]; // heap used to build the Huffman trees
+ int heap_len; // number of elements in the heap
+ int heap_max; // element of largest frequency
+ // The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+ // The same heap array is used to build all trees.
+
+ uch depth[2*L_CODES+1];
+ // Depth of each subtree used as tie breaker for trees of equal frequency
+
+ uch length_code[MAX_MATCH-MIN_MATCH+1];
+ // length code for each normalized match length (0 == MIN_MATCH)
+
+ uch dist_code[512];
+ // distance codes. The first 256 values correspond to the distances
+ // 3 .. 258, the last 256 values correspond to the top 8 bits of
+ // the 15 bit distances.
+
+ int base_length[LENGTH_CODES];
+ // First normalized length for each code (0 = MIN_MATCH)
+
+ int base_dist[D_CODES];
+ // First normalized distance for each code (0 = distance of 1)
+
+ uch far l_buf[LIT_BUFSIZE]; // buffer for literals/lengths
+ ush far d_buf[DIST_BUFSIZE]; // buffer for distances
+
+ uch flag_buf[(LIT_BUFSIZE/8)];
+ // flag_buf is a bit array distinguishing literals from lengths in
+ // l_buf, and thus indicating the presence or absence of a distance.
+
+ unsigned last_lit; // running index in l_buf
+ unsigned last_dist; // running index in d_buf
+ unsigned last_flags; // running index in flag_buf
+ uch flags; // current flags not yet saved in flag_buf
+ uch flag_bit; // current bit used in flags
+ // bits are filled in flags starting at bit 0 (least significant).
+ // Note: these flags are overkill in the current code since we don't
+ // take advantage of DIST_BUFSIZE == LIT_BUFSIZE.
+
+ ulg opt_len; // bit length of current block with optimal trees
+ ulg static_len; // bit length of current block with static trees
+
+ ulg cmpr_bytelen; // total byte length of compressed file
+ ulg cmpr_len_bits; // number of bits past 'cmpr_bytelen'
+
+ ulg input_len; // total byte length of input file
+ // input_len is for debugging only since we can get it by other means.
+
+ ush *file_type; // pointer to UNKNOWN, BINARY or ASCII
+// int *file_method; // pointer to DEFLATE or STORE
+};
+
+TTreeState::TTreeState()
+{
+ tree_desc a = {dyn_ltree, static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS, 0}; l_desc = a;
+ tree_desc b = {dyn_dtree, static_dtree, extra_dbits, 0, D_CODES, MAX_BITS, 0}; d_desc = b;
+ tree_desc c = {bl_tree, NULL, extra_blbits, 0, BL_CODES, MAX_BL_BITS, 0}; bl_desc = c;
+ last_lit = 0;
+ last_dist = 0;
+ last_flags = 0;
+
+ memset(dyn_ltree, 0, sizeof(dyn_ltree));
+ memset(dyn_dtree, 0, sizeof(dyn_dtree));
+ memset(static_ltree, 0, sizeof(static_ltree));
+ memset(static_dtree, 0, sizeof(static_dtree));
+ memset(bl_tree, 0, sizeof(bl_tree));
+ memset(bl_count, 0, sizeof(bl_count));
+ memset(heap, 0, sizeof(heap));
+ heap_len = 0;
+ heap_max = 0;
+
+ memset(depth, 0, sizeof(depth));
+ memset(length_code, 0, sizeof(length_code));
+ memset(dist_code, 0, sizeof(dist_code));
+ memset(base_length, 0, sizeof(base_length));
+ memset(base_dist, 0, sizeof(base_dist));
+ memset(l_buf, 0, sizeof(l_buf));
+ memset(d_buf, 0, sizeof(d_buf));
+ memset(flag_buf, 0, sizeof(flag_buf));
+
+ last_lit = 0;
+ last_dist = 0;
+ last_flags = 0;
+ flags = 0;
+ flag_bit = 0;
+ opt_len = 0;
+ static_len = 0;
+ cmpr_bytelen = 0;
+ cmpr_len_bits = 0;
+ input_len = 0;
+ file_type = 0;
+}
+
+class TBitState
+{
+public:
+ TBitState()
+ {
+ flush_flg = 0;
+ bi_buf = 0;
+ bi_valid = 0;
+ out_buf = 0;
+ out_offset = 0;
+ out_size = 0;
+ bits_sent = 0;
+ }
+
+ int flush_flg;
+ //
+ unsigned bi_buf;
+ // Output buffer. bits are inserted starting at the bottom (least significant
+ // bits). The width of bi_buf must be at least 16 bits.
+ int bi_valid;
+ // Number of valid bits in bi_buf. All bits above the last valid bit
+ // are always zero.
+ char *out_buf;
+ // Current output buffer.
+ unsigned out_offset;
+ // Current offset in output buffer.
+ // On 16 bit machines, the buffer is limited to 64K.
+ unsigned out_size;
+ // Size of current output buffer
+ ulg bits_sent; // bit length of the compressed data only needed for debugging???
+};
+
+
+class TDeflateState
+{
+public:
+ TDeflateState()
+ {
+ memset(window, 0, sizeof(window));
+ memset(prev, 0, sizeof(prev));
+ memset(head, 0, sizeof(head));
+ window_size = 0;
+ block_start = 0;
+ sliding = 0;
+ ins_h = 0;
+ prev_length = 0;
+ strstart = 0;
+ match_start = 0;
+ eofile = 0;
+ lookahead = 0;
+ max_chain_length = 0;
+ max_lazy_match = 0;
+ good_match = 0;
+ nice_match = 0;
+ }
+
+ uch window[2L*WSIZE];
+ // Sliding window. Input bytes are read into the second half of the window,
+ // and move to the first half later to keep a dictionary of at least WSIZE
+ // bytes. With this organization, matches are limited to a distance of
+ // WSIZE-MAX_MATCH bytes, but this ensures that IO is always
+ // performed with a length multiple of the block size. Also, it limits
+ // the window size to 64K, which is quite useful on MSDOS.
+ // To do: limit the window size to WSIZE+CBSZ if SMALL_MEM (the code would
+ // be less efficient since the data would have to be copied WSIZE/CBSZ times)
+ Pos prev[WSIZE];
+ // Link to older string with same hash index. To limit the size of this
+ // array to 64K, this link is maintained only for the last 32K strings.
+ // An index in this array is thus a window index modulo 32K.
+ Pos head[HASH_SIZE];
+ // Heads of the hash chains or NIL. If your compiler thinks that
+ // HASH_SIZE is a dynamic value, recompile with -DDYN_ALLOC.
+
+ ulg window_size;
+ // window size, 2*WSIZE except for MMAP or BIG_MEM, where it is the
+ // input file length plus MIN_LOOKAHEAD.
+
+ long block_start;
+ // window position at the beginning of the current output block. Gets
+ // negative when the window is moved backwards.
+
+ int sliding;
+ // Set to false when the input file is already in memory
+
+ unsigned ins_h; // hash index of string to be inserted
+
+ unsigned int prev_length;
+ // Length of the best match at previous step. Matches not greater than this
+ // are discarded. This is used in the lazy match evaluation.
+
+ unsigned strstart; // start of string to insert
+ unsigned match_start; // start of matching string
+ int eofile; // flag set at end of input file
+ unsigned lookahead; // number of valid bytes ahead in window
+
+ unsigned max_chain_length;
+ // To speed up deflation, hash chains are never searched beyond this length.
+ // A higher limit improves compression ratio but degrades the speed.
+
+ unsigned int max_lazy_match;
+ // Attempt to find a better match only when the current match is strictly
+ // smaller than this value. This mechanism is used only for compression
+ // levels >= 4.
+
+ unsigned good_match;
+ // Use a faster search when the previous match is longer than this
+
+ int nice_match; // Stop searching when current match exceeds this
+};
+
+
+typedef struct iztimes {
+ __time32_t atime,mtime,ctime;
+} iztimes; // access, modify, create times
+
+typedef struct zlist {
+ ush vem, ver, flg, how; // See central header in zipfile.c for what vem..off are
+ ulg tim, crc, siz, len;
+ extent nam, ext, cext, com; // offset of ext must be >= LOCHEAD
+ ush dsk, att, lflg; // offset of lflg must be >= LOCHEAD
+ ulg atx, off;
+ char name[MAX_PATH]; // File name in zip file
+ char *extra; // Extra field (set only if ext != 0)
+ char *cextra; // Extra in central (set only if cext != 0)
+ char *comment; // Comment (set only if com != 0)
+ char iname[MAX_PATH]; // Internal file name after cleanup
+ char zname[MAX_PATH]; // External version of internal name
+ int mark; // Marker for files to operate on
+ int trash; // Marker for files to delete
+ int dosflag; // Set to force MSDOS file attributes
+ struct zlist far *nxt; // Pointer to next header in list
+} TZipFileInfo;
+
+
+class TState;
+typedef unsigned (*READFUNC)(TState &state, char *buf,unsigned size);
+typedef unsigned (*FLUSHFUNC)(void *param, const char *buf, unsigned *size);
+typedef unsigned (*WRITEFUNC)(void *param, const char *buf, unsigned size);
+
+class TState
+{
+public:
+ TState() //+++1.2
+ {
+ param = 0;
+ level = 0;
+ seekable = FALSE;
+ readfunc = 0;
+ flush_outbuf = 0;
+ err = 0;
+ }
+
+ void *param;
+ int level;
+ bool seekable;
+ READFUNC readfunc;
+ FLUSHFUNC flush_outbuf;
+ TTreeState ts;
+ TBitState bs;
+ TDeflateState ds;
+ const char *err;
+};
+
+void Assert(TState &state,bool cond, const char *msg)
+{ if (cond) return;
+ state.err=msg;
+}
+void __cdecl Trace(const char *x, ...) {va_list paramList; va_start(paramList, x); paramList; va_end(paramList);}
+void __cdecl Tracec(bool ,const char *x, ...) {va_list paramList; va_start(paramList, x); paramList; va_end(paramList);}
+
+// ===========================================================================
+// Local (static) routines in this file.
+//
+
+void init_block (TState &);
+void pqdownheap (TState &,ct_data *tree, int k);
+void gen_bitlen (TState &,tree_desc *desc);
+void gen_codes (TState &state,ct_data *tree, int max_code);
+void build_tree (TState &,tree_desc *desc);
+void scan_tree (TState &,ct_data *tree, int max_code);
+void send_tree (TState &state,ct_data *tree, int max_code);
+int build_bl_tree (TState &);
+void send_all_trees (TState &state,int lcodes, int dcodes, int blcodes);
+void compress_block (TState &state,ct_data *ltree, ct_data *dtree);
+void set_file_type (TState &);
+void send_bits (TState &state, int value, int length);
+unsigned bi_reverse (unsigned code, int len);
+void bi_windup (TState &state);
+void copy_block (TState &state,char *buf, unsigned len, int header);
+
+
+#define send_code(state, c, tree) send_bits(state, tree[c].fc.code, tree[c].dl.len)
+// Send a code of the given tree. c and tree must not have side effects
+
+// alternatively...
+//#define send_code(state, c, tree)
+// { if (state.verbose>1) fprintf(stderr,"\ncd %3d ",(c));
+// send_bits(state, tree[c].fc.code, tree[c].dl.len); }
+
+#define d_code(dist) ((dist) < 256 ? state.ts.dist_code[dist] : state.ts.dist_code[256+((dist)>>7)])
+// Mapping from a distance to a distance code. dist is the distance - 1 and
+// must not have side effects. dist_code[256] and dist_code[257] are never used.
+
+#define Max(a,b) (a >= b ? a : b)
+/* the arguments must not have side effects */
+
+/* ===========================================================================
+ * Allocate the match buffer, initialize the various tables and save the
+ * location of the internal file attribute (ascii/binary) and method
+ * (DEFLATE/STORE).
+ */
+void ct_init(TState &state, ush *attr)
+{
+ int n; /* iterates over tree elements */
+ int bits; /* bit counter */
+ int length; /* length value */
+ int code; /* code value */
+ int dist; /* distance index */
+
+ state.ts.file_type = attr;
+ //state.ts.file_method = method;
+ state.ts.cmpr_bytelen = state.ts.cmpr_len_bits = 0L;
+ state.ts.input_len = 0L;
+
+ if (state.ts.static_dtree[0].dl.len != 0) return; /* ct_init already called */
+
+ /* Initialize the mapping length (0..255) -> length code (0..28) */
+ length = 0;
+ for (code = 0; code < LENGTH_CODES-1; code++) {
+ state.ts.base_length[code] = length;
+ for (n = 0; n < (1<<extra_lbits[code]); n++) {
+ state.ts.length_code[length++] = (uch)code;
+ }
+ }
+ Assert(state,length == 256, "ct_init: length != 256");
+ /* Note that the length 255 (match length 258) can be represented
+ * in two different ways: code 284 + 5 bits or code 285, so we
+ * overwrite length_code[255] to use the best encoding:
+ */
+ state.ts.length_code[length-1] = (uch)code;
+
+ /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+ dist = 0;
+ for (code = 0 ; code < 16; code++) {
+ state.ts.base_dist[code] = dist;
+ for (n = 0; n < (1<<extra_dbits[code]); n++) {
+ state.ts.dist_code[dist++] = (uch)code;
+ }
+ }
+ Assert(state,dist == 256, "ct_init: dist != 256");
+ dist >>= 7; /* from now on, all distances are divided by 128 */
+ for ( ; code < D_CODES; code++) {
+ state.ts.base_dist[code] = dist << 7;
+ for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+ state.ts.dist_code[256 + dist++] = (uch)code;
+ }
+ }
+ Assert(state,dist == 256, "ct_init: 256+dist != 512");
+
+ /* Construct the codes of the static literal tree */
+ for (bits = 0; bits <= MAX_BITS; bits++) state.ts.bl_count[bits] = 0;
+ n = 0;
+ while (n <= 143) state.ts.static_ltree[n++].dl.len = 8, state.ts.bl_count[8]++;
+ while (n <= 255) state.ts.static_ltree[n++].dl.len = 9, state.ts.bl_count[9]++;
+ while (n <= 279) state.ts.static_ltree[n++].dl.len = 7, state.ts.bl_count[7]++;
+ while (n <= 287) state.ts.static_ltree[n++].dl.len = 8, state.ts.bl_count[8]++;
+ /* fc.codes 286 and 287 do not exist, but we must include them in the
+ * tree construction to get a canonical Huffman tree (longest code
+ * all ones)
+ */
+ gen_codes(state,(ct_data *)state.ts.static_ltree, L_CODES+1);
+
+ /* The static distance tree is trivial: */
+ for (n = 0; n < D_CODES; n++) {
+ state.ts.static_dtree[n].dl.len = 5;
+ state.ts.static_dtree[n].fc.code = (ush)bi_reverse(n, 5);
+ }
+
+ /* Initialize the first block of the first file: */
+ init_block(state);
+}
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+void init_block(TState &state)
+{
+ int n; /* iterates over tree elements */
+
+ /* Initialize the trees. */
+ for (n = 0; n < L_CODES; n++) state.ts.dyn_ltree[n].fc.freq = 0;
+ for (n = 0; n < D_CODES; n++) state.ts.dyn_dtree[n].fc.freq = 0;
+ for (n = 0; n < BL_CODES; n++) state.ts.bl_tree[n].fc.freq = 0;
+
+ state.ts.dyn_ltree[END_BLOCK].fc.freq = 1;
+ state.ts.opt_len = state.ts.static_len = 0L;
+ state.ts.last_lit = state.ts.last_dist = state.ts.last_flags = 0;
+ state.ts.flags = 0; state.ts.flag_bit = 1;
+}
+
+#define SMALLEST 1
+/* Index within the heap array of least frequent node in the Huffman tree */
+
+
+/* ===========================================================================
+ * Remove the smallest element from the heap and recreate the heap with
+ * one less element. Updates heap and heap_len.
+ */
+#define pqremove(tree, top) \
+{\
+ top = state.ts.heap[SMALLEST]; \
+ state.ts.heap[SMALLEST] = state.ts.heap[state.ts.heap_len--]; \
+ pqdownheap(state,tree, SMALLEST); \
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+#define smaller(tree, n, m) \
+ (tree[n].fc.freq < tree[m].fc.freq || \
+ (tree[n].fc.freq == tree[m].fc.freq && state.ts.depth[n] <= state.ts.depth[m]))
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+void pqdownheap(TState &state,ct_data *tree, int k)
+{
+ int v = state.ts.heap[k];
+ int j = k << 1; /* left son of k */
+ int htemp; /* required because of bug in SASC compiler */
+
+ while (j <= state.ts.heap_len) {
+ /* Set j to the smallest of the two sons: */
+ if (j < state.ts.heap_len && smaller(tree, state.ts.heap[j+1], state.ts.heap[j])) j++;
+
+ /* Exit if v is smaller than both sons */
+ htemp = state.ts.heap[j];
+ if (smaller(tree, v, htemp)) break;
+
+ /* Exchange v with the smallest son */
+ state.ts.heap[k] = htemp;
+ k = j;
+
+ /* And continue down the tree, setting j to the left son of k */
+ j <<= 1;
+ }
+ state.ts.heap[k] = v;
+}
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ * above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ * array bl_count contains the frequencies for each bit length.
+ * The length opt_len is updated; static_len is also updated if stree is
+ * not null.
+ */
+void gen_bitlen(TState &state,tree_desc *desc)
+{
+ ct_data *tree = desc->dyn_tree;
+ const int *extra = desc->extra_bits;
+ int base = desc->extra_base;
+ int max_code = desc->max_code;
+ int max_length = desc->max_length;
+ ct_data *stree = desc->static_tree;
+ int h; /* heap index */
+ int n, m; /* iterate over the tree elements */
+ int bits; /* bit length */
+ int xbits; /* extra bits */
+ ush f; /* frequency */
+ int overflow = 0; /* number of elements with bit length too large */
+
+ for (bits = 0; bits <= MAX_BITS; bits++) state.ts.bl_count[bits] = 0;
+
+ /* In a first pass, compute the optimal bit lengths (which may
+ * overflow in the case of the bit length tree).
+ */
+ tree[state.ts.heap[state.ts.heap_max]].dl.len = 0; /* root of the heap */
+
+ for (h = state.ts.heap_max+1; h < HEAP_SIZE; h++) {
+ n = state.ts.heap[h];
+ bits = tree[tree[n].dl.dad].dl.len + 1;
+ if (bits > max_length) bits = max_length, overflow++;
+ tree[n].dl.len = (ush)bits;
+ /* We overwrite tree[n].dl.dad which is no longer needed */
+
+ if (n > max_code) continue; /* not a leaf node */
+
+ state.ts.bl_count[bits]++;
+ xbits = 0;
+ if (n >= base) xbits = extra[n-base];
+ f = tree[n].fc.freq;
+ state.ts.opt_len += (ulg)f * (bits + xbits);
+ if (stree) state.ts.static_len += (ulg)f * (stree[n].dl.len + xbits);
+ }
+ if (overflow == 0) return;
+
+ Trace("\nbit length overflow\n");
+ /* This happens for example on obj2 and pic of the Calgary corpus */
+
+ /* Find the first bit length which could increase: */
+ do {
+ bits = max_length-1;
+ while (state.ts.bl_count[bits] == 0) bits--;
+ state.ts.bl_count[bits]--; /* move one leaf down the tree */
+ state.ts.bl_count[bits+1] += (ush)2; /* move one overflow item as its brother */
+ state.ts.bl_count[max_length]--;
+ /* The brother of the overflow item also moves one step up,
+ * but this does not affect bl_count[max_length]
+ */
+ overflow -= 2;
+ } while (overflow > 0);
+
+ /* Now recompute all bit lengths, scanning in increasing frequency.
+ * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+ * lengths instead of fixing only the wrong ones. This idea is taken
+ * from 'ar' written by Haruhiko Okumura.)
+ */
+ for (bits = max_length; bits != 0; bits--) {
+ n = state.ts.bl_count[bits];
+ while (n != 0) {
+ m = state.ts.heap[--h];
+ if (m > max_code) continue;
+ if (tree[m].dl.len != (ush)bits) {
+ Trace("code %d bits %d->%d\n", m, tree[m].dl.len, bits);
+ state.ts.opt_len += ((long)bits-(long)tree[m].dl.len)*(long)tree[m].fc.freq;
+ tree[m].dl.len = (ush)bits;
+ }
+ n--;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ * zero code length.
+ */
+void gen_codes (TState &state, ct_data *tree, int max_code)
+{
+ ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+ ush code = 0; /* running code value */
+ int bits; /* bit index */
+ int n; /* code index */
+
+ /* The distribution counts are first used to generate the code values
+ * without bit reversal.
+ */
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ next_code[bits] = code = (ush)((code + state.ts.bl_count[bits-1]) << 1);
+ }
+ /* Check that the bit counts in bl_count are consistent. The last code
+ * must be all ones.
+ */
+ Assert(state,code + state.ts.bl_count[MAX_BITS]-1 == (1<< ((ush) MAX_BITS)) - 1,
+ "inconsistent bit counts");
+ Trace("\ngen_codes: max_code %d ", max_code);
+
+ for (n = 0; n <= max_code; n++) {
+ int len = tree[n].dl.len;
+ if (len == 0) continue;
+ /* Now reverse the bits */
+ tree[n].fc.code = (ush)bi_reverse(next_code[len]++, len);
+
+ //Tracec(tree != state.ts.static_ltree, "\nn %3d %c l %2d c %4x (%x) ", n, (isgraph(n) ? n : ' '), len, tree[n].fc.code, next_code[len]-1);
+ }
+}
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ * and corresponding code. The length opt_len is updated; static_len is
+ * also updated if stree is not null. The field max_code is set.
+ */
+void build_tree(TState &state,tree_desc *desc)
+{
+ ct_data *tree = desc->dyn_tree;
+ ct_data *stree = desc->static_tree;
+ int elems = desc->elems;
+ int n, m; /* iterate over heap elements */
+ int max_code = -1; /* largest code with non zero frequency */
+ int node = elems; /* next internal node of the tree */
+
+ /* Construct the initial heap, with least frequent element in
+ * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+ * heap[0] is not used.
+ */
+ state.ts.heap_len = 0, state.ts.heap_max = HEAP_SIZE;
+
+ for (n = 0; n < elems; n++) {
+ if (tree[n].fc.freq != 0) {
+ state.ts.heap[++state.ts.heap_len] = max_code = n;
+ state.ts.depth[n] = 0;
+ } else {
+ tree[n].dl.len = 0;
+ }
+ }
+
+ /* The pkzip format requires that at least one distance code exists,
+ * and that at least one bit should be sent even if there is only one
+ * possible code. So to avoid special checks later on we force at least
+ * two codes of non zero frequency.
+ */
+ while (state.ts.heap_len < 2) {
+ int newcp = state.ts.heap[++state.ts.heap_len] = (max_code < 2 ? ++max_code : 0);
+ tree[newcp].fc.freq = 1;
+ state.ts.depth[newcp] = 0;
+ state.ts.opt_len--; if (stree) state.ts.static_len -= stree[newcp].dl.len;
+ /* new is 0 or 1 so it does not have extra bits */
+ }
+ desc->max_code = max_code;
+
+ /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+ * establish sub-heaps of increasing lengths:
+ */
+ for (n = state.ts.heap_len/2; n >= 1; n--) pqdownheap(state,tree, n);
+
+ /* Construct the Huffman tree by repeatedly combining the least two
+ * frequent nodes.
+ */
+ do {
+ pqremove(tree, n); /* n = node of least frequency */
+ m = state.ts.heap[SMALLEST]; /* m = node of next least frequency */
+
+ state.ts.heap[--state.ts.heap_max] = n; /* keep the nodes sorted by frequency */
+ state.ts.heap[--state.ts.heap_max] = m;
+
+ /* Create a new node father of n and m */
+ tree[node].fc.freq = (ush)(tree[n].fc.freq + tree[m].fc.freq);
+ state.ts.depth[node] = (uch) (Max(state.ts.depth[n], state.ts.depth[m]) + 1);
+ tree[n].dl.dad = tree[m].dl.dad = (ush)node;
+ /* and insert the new node in the heap */
+ state.ts.heap[SMALLEST] = node++;
+ pqdownheap(state,tree, SMALLEST);
+
+ } while (state.ts.heap_len >= 2);
+
+ state.ts.heap[--state.ts.heap_max] = state.ts.heap[SMALLEST];
+
+ /* At this point, the fields freq and dad are set. We can now
+ * generate the bit lengths.
+ */
+ gen_bitlen(state,(tree_desc *)desc);
+
+ /* The field len is now set, we can generate the bit codes */
+ gen_codes (state,(ct_data *)tree, max_code);
+}
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree. Updates opt_len to take into account the repeat
+ * counts. (The contribution of the bit length codes will be added later
+ * during the construction of bl_tree.)
+ */
+void scan_tree (TState &state,ct_data *tree, int max_code)
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].dl.len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ if (nextlen == 0) max_count = 138, min_count = 3;
+ tree[max_code+1].dl.len = (ush)-1; /* guard */
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].dl.len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ state.ts.bl_tree[curlen].fc.freq = (ush)(state.ts.bl_tree[curlen].fc.freq + count);
+ } else if (curlen != 0) {
+ if (curlen != prevlen) state.ts.bl_tree[curlen].fc.freq++;
+ state.ts.bl_tree[REP_3_6].fc.freq++;
+ } else if (count <= 10) {
+ state.ts.bl_tree[REPZ_3_10].fc.freq++;
+ } else {
+ state.ts.bl_tree[REPZ_11_138].fc.freq++;
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+void send_tree (TState &state, ct_data *tree, int max_code)
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].dl.len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ /* tree[max_code+1].dl.len = -1; */ /* guard already set */
+ if (nextlen == 0) max_count = 138, min_count = 3;
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].dl.len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ do { send_code(state, curlen, state.ts.bl_tree); } while (--count != 0);
+
+ } else if (curlen != 0) {
+ if (curlen != prevlen) {
+ send_code(state, curlen, state.ts.bl_tree); count--;
+ }
+ Assert(state,count >= 3 && count <= 6, " 3_6?");
+ send_code(state,REP_3_6, state.ts.bl_tree); send_bits(state,count-3, 2);
+
+ } else if (count <= 10) {
+ send_code(state,REPZ_3_10, state.ts.bl_tree); send_bits(state,count-3, 3);
+
+ } else {
+ send_code(state,REPZ_11_138, state.ts.bl_tree); send_bits(state,count-11, 7);
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+int build_bl_tree(TState &state)
+{
+ int max_blindex; /* index of last bit length code of non zero freq */
+
+ /* Determine the bit length frequencies for literal and distance trees */
+ scan_tree(state,(ct_data *)state.ts.dyn_ltree, state.ts.l_desc.max_code);
+ scan_tree(state,(ct_data *)state.ts.dyn_dtree, state.ts.d_desc.max_code);
+
+ /* Build the bit length tree: */
+ build_tree(state,(tree_desc *)(&state.ts.bl_desc));
+ /* opt_len now includes the length of the tree representations, except
+ * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+ */
+
+ /* Determine the number of bit length codes to send. The pkzip format
+ * requires that at least 4 bit length codes be sent. (appnote.txt says
+ * 3 but the actual value used is 4.)
+ */
+ for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+ if (state.ts.bl_tree[bl_order[max_blindex]].dl.len != 0) break;
+ }
+ /* Update opt_len to include the bit length tree and counts */
+ state.ts.opt_len += 3*(max_blindex+1) + 5+5+4;
+ Trace("\ndyn trees: dyn %ld, stat %ld", state.ts.opt_len, state.ts.static_len);
+
+ return max_blindex;
+}
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+void send_all_trees(TState &state,int lcodes, int dcodes, int blcodes)
+{
+ int rank; /* index in bl_order */
+
+ Assert(state,lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+ Assert(state,lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+ "too many codes");
+ Trace("\nbl counts: ");
+ send_bits(state,lcodes-257, 5);
+ /* not +255 as stated in appnote.txt 1.93a or -256 in 2.04c */
+ send_bits(state,dcodes-1, 5);
+ send_bits(state,blcodes-4, 4); /* not -3 as stated in appnote.txt */
+ for (rank = 0; rank < blcodes; rank++) {
+ Trace("\nbl code %2d ", bl_order[rank]);
+ send_bits(state,state.ts.bl_tree[bl_order[rank]].dl.len, 3);
+ }
+ Trace("\nbl tree: sent %ld", state.bs.bits_sent);
+
+ send_tree(state,(ct_data *)state.ts.dyn_ltree, lcodes-1); /* send the literal tree */
+ Trace("\nlit tree: sent %ld", state.bs.bits_sent);
+
+ send_tree(state,(ct_data *)state.ts.dyn_dtree, dcodes-1); /* send the distance tree */
+ Trace("\ndist tree: sent %ld", state.bs.bits_sent);
+}
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and output the encoded block to the zip file. This function
+ * returns the total compressed length (in bytes) for the file so far.
+ */
+ulg flush_block(TState &state,char *buf, ulg stored_len, int eof)
+{
+ ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+ int max_blindex; /* index of last bit length code of non zero freq */
+
+ state.ts.flag_buf[state.ts.last_flags] = state.ts.flags; /* Save the flags for the last 8 items */
+
+ /* Check if the file is ascii or binary */
+ if (*state.ts.file_type == (ush)UNKNOWN) set_file_type(state);
+
+ /* Construct the literal and distance trees */
+ build_tree(state,(tree_desc *)(&state.ts.l_desc));
+ Trace("\nlit data: dyn %ld, stat %ld", state.ts.opt_len, state.ts.static_len);
+
+ build_tree(state,(tree_desc *)(&state.ts.d_desc));
+ Trace("\ndist data: dyn %ld, stat %ld", state.ts.opt_len, state.ts.static_len);
+ /* At this point, opt_len and static_len are the total bit lengths of
+ * the compressed block data, excluding the tree representations.
+ */
+
+ /* Build the bit length tree for the above two trees, and get the index
+ * in bl_order of the last bit length code to send.
+ */
+ max_blindex = build_bl_tree(state);
+
+ /* Determine the best encoding. Compute first the block length in bytes */
+ opt_lenb = (state.ts.opt_len+3+7)>>3;
+ static_lenb = (state.ts.static_len+3+7)>>3;
+ state.ts.input_len += stored_len; /* for debugging only */
+
+ Trace("\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ",
+ opt_lenb, state.ts.opt_len, static_lenb, state.ts.static_len, stored_len,
+ state.ts.last_lit, state.ts.last_dist);
+
+ if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+
+ // Originally, zip allowed the file to be transformed from a compressed
+ // into a stored file in the case where compression failed, there
+ // was only one block, and it was allowed to change. I've removed this
+ // possibility since the code's cleaner if no changes are allowed.
+ //if (stored_len <= opt_lenb && eof && state.ts.cmpr_bytelen == 0L
+ // && state.ts.cmpr_len_bits == 0L && state.seekable)
+ //{ // && state.ts.file_method != NULL
+ // // Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there:
+ // Assert(state,buf!=NULL,"block vanished");
+ // copy_block(state,buf, (unsigned)stored_len, 0); // without header
+ // state.ts.cmpr_bytelen = stored_len;
+ // Assert(state,false,"unimplemented *state.ts.file_method = STORE;");
+ // //*state.ts.file_method = STORE;
+ //}
+ //else
+ if (stored_len+4 <= opt_lenb && buf != (char*)NULL) {
+ /* 4: two words for the lengths */
+ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+ * Otherwise we can't have processed more than WSIZE input bytes since
+ * the last block flush, because compression would have been
+ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+ * transform a block into a stored block.
+ */
+ send_bits(state,(STORED_BLOCK<<1)+eof, 3); /* send block type */
+ state.ts.cmpr_bytelen += ((state.ts.cmpr_len_bits + 3 + 7) >> 3) + stored_len + 4;
+ state.ts.cmpr_len_bits = 0L;
+
+ copy_block(state,buf, (unsigned)stored_len, 1); /* with header */
+ }
+ else if (static_lenb == opt_lenb) {
+ send_bits(state,(STATIC_TREES<<1)+eof, 3);
+ compress_block(state,(ct_data *)state.ts.static_ltree, (ct_data *)state.ts.static_dtree);
+ state.ts.cmpr_len_bits += 3 + state.ts.static_len;
+ state.ts.cmpr_bytelen += state.ts.cmpr_len_bits >> 3;
+ state.ts.cmpr_len_bits &= 7L;
+ }
+ else {
+ send_bits(state,(DYN_TREES<<1)+eof, 3);
+ send_all_trees(state,state.ts.l_desc.max_code+1, state.ts.d_desc.max_code+1, max_blindex+1);
+ compress_block(state,(ct_data *)state.ts.dyn_ltree, (ct_data *)state.ts.dyn_dtree);
+ state.ts.cmpr_len_bits += 3 + state.ts.opt_len;
+ state.ts.cmpr_bytelen += state.ts.cmpr_len_bits >> 3;
+ state.ts.cmpr_len_bits &= 7L;
+ }
+ Assert(state,((state.ts.cmpr_bytelen << 3) + state.ts.cmpr_len_bits) == state.bs.bits_sent, "bad compressed size");
+ init_block(state);
+
+ if (eof) {
+ // Assert(state,input_len == isize, "bad input size");
+ bi_windup(state);
+ state.ts.cmpr_len_bits += 7; /* align on byte boundary */
+ }
+ Trace("\n");
+
+ return state.ts.cmpr_bytelen + (state.ts.cmpr_len_bits >> 3);
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+int ct_tally (TState &state,int dist, int lc)
+{
+ state.ts.l_buf[state.ts.last_lit++] = (uch)lc;
+ if (dist == 0) {
+ /* lc is the unmatched char */
+ state.ts.dyn_ltree[lc].fc.freq++;
+ } else {
+ /* Here, lc is the match length - MIN_MATCH */
+ dist--; /* dist = match distance - 1 */
+ Assert(state,(ush)dist < (ush)MAX_DIST &&
+ (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+ (ush)d_code(dist) < (ush)D_CODES, "ct_tally: bad match");
+
+ state.ts.dyn_ltree[state.ts.length_code[lc]+LITERALS+1].fc.freq++;
+ state.ts.dyn_dtree[d_code(dist)].fc.freq++;
+
+ state.ts.d_buf[state.ts.last_dist++] = (ush)dist;
+ state.ts.flags |= state.ts.flag_bit;
+ }
+ state.ts.flag_bit <<= 1;
+
+ /* Output the flags if they fill a byte: */
+ if ((state.ts.last_lit & 7) == 0) {
+ state.ts.flag_buf[state.ts.last_flags++] = state.ts.flags;
+ state.ts.flags = 0, state.ts.flag_bit = 1;
+ }
+ /* Try to guess if it is profitable to stop the current block here */
+ if (state.level > 2 && (state.ts.last_lit & 0xfff) == 0) {
+ /* Compute an upper bound for the compressed length */
+ ulg out_length = (ulg)state.ts.last_lit*8L;
+ ulg in_length = (ulg)state.ds.strstart-state.ds.block_start;
+ int dcode;
+ for (dcode = 0; dcode < D_CODES; dcode++) {
+ out_length += (ulg)state.ts.dyn_dtree[dcode].fc.freq*(5L+extra_dbits[dcode]);
+ }
+ out_length >>= 3;
+ Trace("\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ",
+ state.ts.last_lit, state.ts.last_dist, in_length, out_length,
+ 100L - out_length*100L/in_length);
+ if (state.ts.last_dist < state.ts.last_lit/2 && out_length < in_length/2) return 1;
+ }
+ return (state.ts.last_lit == LIT_BUFSIZE-1 || state.ts.last_dist == DIST_BUFSIZE);
+ /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K
+ * on 16 bit machines and because stored blocks are restricted to
+ * 64K-1 bytes.
+ */
+}
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+void compress_block(TState &state,ct_data *ltree, ct_data *dtree)
+{
+ unsigned dist; /* distance of matched string */
+ int lc; /* match length or unmatched char (if dist == 0) */
+ unsigned lx = 0; /* running index in l_buf */
+ unsigned dx = 0; /* running index in d_buf */
+ unsigned fx = 0; /* running index in flag_buf */
+ uch flag = 0; /* current flags */
+ unsigned code; /* the code to send */
+ int extra; /* number of extra bits to send */
+
+ if (state.ts.last_lit != 0) do {
+ if ((lx & 7) == 0) flag = state.ts.flag_buf[fx++];
+ lc = state.ts.l_buf[lx++];
+ if ((flag & 1) == 0) {
+ send_code(state,lc, ltree); /* send a literal byte */
+ } else {
+ /* Here, lc is the match length - MIN_MATCH */
+ code = state.ts.length_code[lc];
+ send_code(state,code+LITERALS+1, ltree); /* send the length code */
+ extra = extra_lbits[code];
+ if (extra != 0) {
+ lc -= state.ts.base_length[code];
+ send_bits(state,lc, extra); /* send the extra length bits */
+ }
+ dist = state.ts.d_buf[dx++];
+ /* Here, dist is the match distance - 1 */
+ code = d_code(dist);
+ Assert(state,code < D_CODES, "bad d_code");
+
+ send_code(state,code, dtree); /* send the distance code */
+ extra = extra_dbits[code];
+ if (extra != 0) {
+ dist -= state.ts.base_dist[code];
+ send_bits(state,dist, extra); /* send the extra distance bits */
+ }
+ } /* literal or match pair ? */
+ flag >>= 1;
+ } while (lx < state.ts.last_lit);
+
+ send_code(state,END_BLOCK, ltree);
+}
+
+/* ===========================================================================
+ * Set the file type to ASCII or BINARY, using a crude approximation:
+ * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise.
+ * IN assertion: the fields freq of dyn_ltree are set and the total of all
+ * frequencies does not exceed 64K (to fit in an int on 16 bit machines).
+ */
+void set_file_type(TState &state)
+{
+ int n = 0;
+ unsigned ascii_freq = 0;
+ unsigned bin_freq = 0;
+ while (n < 7) bin_freq += state.ts.dyn_ltree[n++].fc.freq;
+ while (n < 128) ascii_freq += state.ts.dyn_ltree[n++].fc.freq;
+ while (n < LITERALS) bin_freq += state.ts.dyn_ltree[n++].fc.freq;
+ *state.ts.file_type = (ush)(bin_freq > (ascii_freq >> 2) ? BINARY : ASCII);
+}
+
+
+/* ===========================================================================
+ * Initialize the bit string routines.
+ */
+void bi_init (TState &state,char *tgt_buf, unsigned tgt_size, int flsh_allowed)
+{
+ state.bs.out_buf = tgt_buf;
+ state.bs.out_size = tgt_size;
+ state.bs.out_offset = 0;
+ state.bs.flush_flg = flsh_allowed;
+
+ state.bs.bi_buf = 0;
+ state.bs.bi_valid = 0;
+ state.bs.bits_sent = 0L;
+}
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+void send_bits(TState &state,int value, int length)
+{
+ Assert(state,length > 0 && length <= 15, "invalid length");
+ state.bs.bits_sent += (ulg)length;
+ /* If not enough room in bi_buf, use (bi_valid) bits from bi_buf and
+ * (Buf_size - bi_valid) bits from value to flush the filled bi_buf,
+ * then fill in the rest of (value), leaving (length - (Buf_size-bi_valid))
+ * unused bits in bi_buf.
+ */
+ state.bs.bi_buf |= (value << state.bs.bi_valid);
+ state.bs.bi_valid += length;
+ if (state.bs.bi_valid > (int)Buf_size) {
+ PUTSHORT(state,state.bs.bi_buf);
+ state.bs.bi_valid -= Buf_size;
+ state.bs.bi_buf = (unsigned)value >> (length - state.bs.bi_valid);
+ }
+}
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+unsigned bi_reverse(unsigned code, int len)
+{
+ register unsigned res = 0;
+ do {
+ res |= code & 1;
+ code >>= 1, res <<= 1;
+ } while (--len > 0);
+ return res >> 1;
+}
+
+/* ===========================================================================
+ * Write out any remaining bits in an incomplete byte.
+ */
+void bi_windup(TState &state)
+{
+ if (state.bs.bi_valid > 8) {
+ PUTSHORT(state,state.bs.bi_buf);
+ } else if (state.bs.bi_valid > 0) {
+ PUTBYTE(state,state.bs.bi_buf);
+ }
+ if (state.bs.flush_flg) {
+ state.flush_outbuf(state.param,state.bs.out_buf, &state.bs.out_offset);
+ }
+ state.bs.bi_buf = 0;
+ state.bs.bi_valid = 0;
+ state.bs.bits_sent = (state.bs.bits_sent+7) & ~7;
+}
+
+/* ===========================================================================
+ * Copy a stored block to the zip file, storing first the length and its
+ * one's complement if requested.
+ */
+void copy_block(TState &state, char *block, unsigned len, int header)
+{
+ bi_windup(state); /* align on byte boundary */
+
+ if (header) {
+ PUTSHORT(state,(ush)len);
+ PUTSHORT(state,(ush)~len);
+ state.bs.bits_sent += 2*16;
+ }
+ if (state.bs.flush_flg) {
+ state.flush_outbuf(state.param,state.bs.out_buf, &state.bs.out_offset);
+ state.bs.out_offset = len;
+ state.flush_outbuf(state.param,block, &state.bs.out_offset);
+ } else if (state.bs.out_offset + len > state.bs.out_size) {
+ Assert(state,false,"output buffer too small for in-memory compression");
+ } else {
+ memcpy(state.bs.out_buf + state.bs.out_offset, block, len);
+ state.bs.out_offset += len;
+ }
+ state.bs.bits_sent += (ulg)len<<3;
+}
+
+
+
+
+
+
+
+
+/* ===========================================================================
+ * Prototypes for functions.
+ */
+
+void fill_window (TState &state);
+ulg deflate_fast (TState &state);
+
+int longest_match (TState &state,IPos cur_match);
+
+
+/* ===========================================================================
+ * Update a hash value with the given input byte
+ * IN assertion: all calls to to UPDATE_HASH are made with consecutive
+ * input characters, so that a running hash key can be computed from the
+ * previous key instead of complete recalculation each time.
+ */
+#define UPDATE_HASH(h,c) (h = (((h)<<H_SHIFT) ^ (c)) & HASH_MASK)
+
+/* ===========================================================================
+ * Insert string s in the dictionary and set match_head to the previous head
+ * of the hash chain (the most recent string with same hash key). Return
+ * the previous length of the hash chain.
+ * IN assertion: all calls to to INSERT_STRING are made with consecutive
+ * input characters and the first MIN_MATCH bytes of s are valid
+ * (except for the last MIN_MATCH-1 bytes of the input file).
+ */
+#define INSERT_STRING(s, match_head) \
+ (UPDATE_HASH(state.ds.ins_h, state.ds.window[(s) + (MIN_MATCH-1)]), \
+ state.ds.prev[(s) & WMASK] = match_head = state.ds.head[state.ds.ins_h], \
+ state.ds.head[state.ds.ins_h] = (s))
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new file
+ *
+ * IN assertion: window_size is > 0 if the input file is already read or
+ * mmap'ed in the window[] array, 0 otherwise. In the first case,
+ * window_size is sufficient to contain the whole input file plus
+ * MIN_LOOKAHEAD bytes (to avoid referencing memory beyond the end
+ * of window[] when looking for matches towards the end).
+ */
+void lm_init (TState &state, int pack_level, ush *flags)
+{
+ register unsigned j;
+
+ Assert(state,pack_level>=1 && pack_level<=8,"bad pack level");
+
+ /* Do not slide the window if the whole input is already in memory
+ * (window_size > 0)
+ */
+ state.ds.sliding = 0;
+ if (state.ds.window_size == 0L) {
+ state.ds.sliding = 1;
+ state.ds.window_size = (ulg)2L*WSIZE;
+ }
+
+ /* Initialize the hash table (avoiding 64K overflow for 16 bit systems).
+ * prev[] will be initialized on the fly.
+ */
+ state.ds.head[HASH_SIZE-1] = NIL;
+ memset((char*)state.ds.head, NIL, (unsigned)(HASH_SIZE-1)*sizeof(*state.ds.head));
+
+ /* Set the default configuration parameters:
+ */
+ state.ds.max_lazy_match = configuration_table[pack_level].max_lazy;
+ state.ds.good_match = configuration_table[pack_level].good_length;
+ state.ds.nice_match = configuration_table[pack_level].nice_length;
+ state.ds.max_chain_length = configuration_table[pack_level].max_chain;
+ if (pack_level <= 2) {
+ *flags |= FAST;
+ } else if (pack_level >= 8) {
+ *flags |= SLOW;
+ }
+ /* ??? reduce max_chain_length for binary files */
+
+ state.ds.strstart = 0;
+ state.ds.block_start = 0L;
+
+ j = WSIZE;
+ j <<= 1; // Can read 64K in one step
+ state.ds.lookahead = state.readfunc(state, (char*)state.ds.window, j);
+
+ if (state.ds.lookahead == 0 || state.ds.lookahead == (unsigned)EOF) {
+ state.ds.eofile = 1, state.ds.lookahead = 0;
+ return;
+ }
+ state.ds.eofile = 0;
+ /* Make sure that we always have enough lookahead. This is important
+ * if input comes from a device such as a tty.
+ */
+ if (state.ds.lookahead < MIN_LOOKAHEAD) fill_window(state);
+
+ state.ds.ins_h = 0;
+ for (j=0; j<MIN_MATCH-1; j++) UPDATE_HASH(state.ds.ins_h, state.ds.window[j]);
+ /* If lookahead < MIN_MATCH, ins_h is garbage, but this is
+ * not important since only literal bytes will be emitted.
+ */
+}
+
+
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ */
+// For 80x86 and 680x0 and ARM, an optimized version is in match.asm or
+// match.S. The code is functionally equivalent, so you can use the C version
+// if desired. Which I do so desire!
+int longest_match(TState &state,IPos cur_match)
+{
+ unsigned chain_length = state.ds.max_chain_length; /* max hash chain length */
+ register uch far *scan = state.ds.window + state.ds.strstart; /* current string */
+ register uch far *match; /* matched string */
+ register int len; /* length of current match */
+ int best_len = state.ds.prev_length; /* best match length so far */
+ IPos limit = state.ds.strstart > (IPos)MAX_DIST ? state.ds.strstart - (IPos)MAX_DIST : NIL;
+ /* Stop when cur_match becomes <= limit. To simplify the code,
+ * we prevent matches with the string of window index 0.
+ */
+
+ // The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ // It is easy to get rid of this optimization if necessary.
+ Assert(state,HASH_BITS>=8 && MAX_MATCH==258,"Code too clever");
+
+
+
+ register uch far *strend = state.ds.window + state.ds.strstart + MAX_MATCH;
+ register uch scan_end1 = scan[best_len-1];
+ register uch scan_end = scan[best_len];
+
+ /* Do not waste too much time if we already have a good match: */
+ if (state.ds.prev_length >= state.ds.good_match) {
+ chain_length >>= 2;
+ }
+
+ Assert(state,state.ds.strstart <= state.ds.window_size-MIN_LOOKAHEAD, "insufficient lookahead");
+
+ do {
+ Assert(state,cur_match < state.ds.strstart, "no future");
+ match = state.ds.window + cur_match;
+
+ /* Skip to next match if the match length cannot increase
+ * or if the match length is less than 2:
+ */
+ if (match[best_len] != scan_end ||
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match++;
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(state,scan <= state.ds.window+(unsigned)(state.ds.window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+ scan = strend - MAX_MATCH;
+
+
+ if (len > best_len) {
+ state.ds.match_start = cur_match;
+ best_len = len;
+ if (len >= state.ds.nice_match) break;
+ scan_end1 = scan[best_len-1];
+ scan_end = scan[best_len];
+ }
+ } while ((cur_match = state.ds.prev[cur_match & WMASK]) > limit
+ && --chain_length != 0);
+
+ return best_len;
+}
+
+
+
+#define check_match(state,start, match, length)
+// or alternatively...
+//void check_match(TState &state,IPos start, IPos match, int length)
+//{ // check that the match is indeed a match
+// if (memcmp((char*)state.ds.window + match,
+// (char*)state.ds.window + start, length) != EQUAL) {
+// fprintf(stderr,
+// " start %d, match %d, length %d\n",
+// start, match, length);
+// error("invalid match");
+// }
+// if (state.verbose > 1) {
+// fprintf(stderr,"\\[%d,%d]", start-match, length);
+// do { fprintf(stdout,"%c",state.ds.window[start++]); } while (--length != 0);
+// }
+//}
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead, and sets eofile if end of input file.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ * At least one byte has been read, or eofile is set; file reads are
+ * performed for at least two bytes (required for the translate_eol option).
+ */
+void fill_window(TState &state)
+{
+ register unsigned n, m;
+ unsigned more; /* Amount of free space at the end of the window. */
+
+ do {
+ more = (unsigned)(state.ds.window_size - (ulg)state.ds.lookahead - (ulg)state.ds.strstart);
+
+ /* If the window is almost full and there is insufficient lookahead,
+ * move the upper half to the lower one to make room in the upper half.
+ */
+ if (more == (unsigned)EOF) {
+ /* Very unlikely, but possible on 16 bit machine if strstart == 0
+ * and lookahead == 1 (input done one byte at time)
+ */
+ more--;
+
+ /* For MMAP or BIG_MEM, the whole input file is already in memory so
+ * we must not perform sliding. We must however call (*read_buf)() in
+ * order to compute the crc, update lookahead and possibly set eofile.
+ */
+ } else if (state.ds.strstart >= WSIZE+MAX_DIST && state.ds.sliding) {
+
+ /* By the IN assertion, the window is not empty so we can't confuse
+ * more == 0 with more == 64K on a 16 bit machine.
+ */
+ memcpy((char*)state.ds.window, (char*)state.ds.window+WSIZE, (unsigned)WSIZE);
+ state.ds.match_start -= WSIZE;
+ state.ds.strstart -= WSIZE; /* we now have strstart >= MAX_DIST: */
+
+ state.ds.block_start -= (long) WSIZE;
+
+ for (n = 0; n < HASH_SIZE; n++) {
+ m = state.ds.head[n];
+ state.ds.head[n] = (Pos)(m >= WSIZE ? m-WSIZE : NIL);
+ }
+ for (n = 0; n < WSIZE; n++) {
+ m = state.ds.prev[n];
+ state.ds.prev[n] = (Pos)(m >= WSIZE ? m-WSIZE : NIL);
+ /* If n is not on any hash chain, prev[n] is garbage but
+ * its value will never be used.
+ */
+ }
+ more += WSIZE;
+ }
+ if (state.ds.eofile) return;
+
+ /* If there was no sliding:
+ * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+ * more == window_size - lookahead - strstart
+ * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+ * => more >= window_size - 2*WSIZE + 2
+ * In the MMAP or BIG_MEM case (not yet supported in gzip),
+ * window_size == input_size + MIN_LOOKAHEAD &&
+ * strstart + lookahead <= input_size => more >= MIN_LOOKAHEAD.
+ * Otherwise, window_size == 2*WSIZE so more >= 2.
+ * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+ */
+ Assert(state,more >= 2, "more < 2");
+
+ n = state.readfunc(state, (char*)state.ds.window+state.ds.strstart+state.ds.lookahead, more);
+
+ if (n == 0 || n == (unsigned)EOF) {
+ state.ds.eofile = 1;
+ } else {
+ state.ds.lookahead += n;
+ }
+ } while (state.ds.lookahead < MIN_LOOKAHEAD && !state.ds.eofile);
+}
+
+/* ===========================================================================
+ * Flush the current block, with given end-of-file flag.
+ * IN assertion: strstart is set to the end of the current match.
+ */
+#define FLUSH_BLOCK(state,eof) \
+ flush_block(state,state.ds.block_start >= 0L ? (char*)&state.ds.window[(unsigned)state.ds.block_start] : \
+ (char*)NULL, (long)state.ds.strstart - state.ds.block_start, (eof))
+
+/* ===========================================================================
+ * Processes a new input file and return its compressed length. This
+ * function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+ulg deflate_fast(TState &state)
+{
+ IPos hash_head = NIL; /* head of the hash chain */
+ int flush; /* set if current block must be flushed */
+ unsigned match_length = 0; /* length of best match */
+
+ state.ds.prev_length = MIN_MATCH-1;
+ while (state.ds.lookahead != 0) {
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (state.ds.lookahead >= MIN_MATCH)
+ INSERT_STRING(state.ds.strstart, hash_head);
+
+ /* Find the longest match, discarding those <= prev_length.
+ * At this point we have always match_length < MIN_MATCH
+ */
+ if (hash_head != NIL && state.ds.strstart - hash_head <= MAX_DIST) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ /* Do not look for matches beyond the end of the input.
+ * This is necessary to make deflate deterministic.
+ */
+ if ((unsigned)state.ds.nice_match > state.ds.lookahead) state.ds.nice_match = (int)state.ds.lookahead;
+ match_length = longest_match (state,hash_head);
+ /* longest_match() sets match_start */
+ if (match_length > state.ds.lookahead) match_length = state.ds.lookahead;
+ }
+ if (match_length >= MIN_MATCH) {
+ check_match(state,state.ds.strstart, state.ds.match_start, match_length);
+
+ flush = ct_tally(state,state.ds.strstart-state.ds.match_start, match_length - MIN_MATCH);
+
+ state.ds.lookahead -= match_length;
+
+ /* Insert new strings in the hash table only if the match length
+ * is not too large. This saves time but degrades compression.
+ */
+ if (match_length <= state.ds.max_insert_length
+ && state.ds.lookahead >= MIN_MATCH) {
+ match_length--; /* string at strstart already in hash table */
+ do {
+ state.ds.strstart++;
+ INSERT_STRING(state.ds.strstart, hash_head);
+ /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+ * always MIN_MATCH bytes ahead.
+ */
+ } while (--match_length != 0);
+ state.ds.strstart++;
+ } else {
+ state.ds.strstart += match_length;
+ match_length = 0;
+ state.ds.ins_h = state.ds.window[state.ds.strstart];
+ UPDATE_HASH(state.ds.ins_h, state.ds.window[state.ds.strstart+1]);
+ Assert(state,MIN_MATCH==3,"Call UPDATE_HASH() MIN_MATCH-3 more times");
+ }
+ } else {
+ /* No match, output a literal byte */
+ flush = ct_tally (state,0, state.ds.window[state.ds.strstart]);
+ state.ds.lookahead--;
+ state.ds.strstart++;
+ }
+ if (flush) FLUSH_BLOCK(state,0), state.ds.block_start = state.ds.strstart;
+
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (state.ds.lookahead < MIN_LOOKAHEAD) fill_window(state);
+ }
+ return FLUSH_BLOCK(state,1); /* eof */
+}
+
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+ulg deflate(TState &state)
+{
+ IPos hash_head = NIL; /* head of hash chain */
+ IPos prev_match; /* previous match */
+ int flush; /* set if current block must be flushed */
+ int match_available = 0; /* set if previous match exists */
+ register unsigned match_length = MIN_MATCH-1; /* length of best match */
+
+ if (state.level <= 3) return deflate_fast(state); /* optimized for speed */
+
+ /* Process the input block. */
+ while (state.ds.lookahead != 0) {
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (state.ds.lookahead >= MIN_MATCH)
+ INSERT_STRING(state.ds.strstart, hash_head);
+
+ /* Find the longest match, discarding those <= prev_length.
+ */
+ state.ds.prev_length = match_length, prev_match = state.ds.match_start;
+ match_length = MIN_MATCH-1;
+
+ if (hash_head != NIL && state.ds.prev_length < state.ds.max_lazy_match &&
+ state.ds.strstart - hash_head <= MAX_DIST) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ /* Do not look for matches beyond the end of the input.
+ * This is necessary to make deflate deterministic.
+ */
+ if ((unsigned)state.ds.nice_match > state.ds.lookahead) state.ds.nice_match = (int)state.ds.lookahead;
+ match_length = longest_match (state,hash_head);
+ /* longest_match() sets match_start */
+ if (match_length > state.ds.lookahead) match_length = state.ds.lookahead;
+
+ /* Ignore a length 3 match if it is too distant: */
+ if (match_length == MIN_MATCH && state.ds.strstart-state.ds.match_start > TOO_FAR){
+ /* If prev_match is also MIN_MATCH, match_start is garbage
+ * but we will ignore the current match anyway.
+ */
+ match_length = MIN_MATCH-1;
+ }
+ }
+ /* If there was a match at the previous step and the current
+ * match is not better, output the previous match:
+ */
+ if (state.ds.prev_length >= MIN_MATCH && match_length <= state.ds.prev_length) {
+ unsigned max_insert = state.ds.strstart + state.ds.lookahead - MIN_MATCH;
+ check_match(state,state.ds.strstart-1, prev_match, state.ds.prev_length);
+ flush = ct_tally(state,state.ds.strstart-1-prev_match, state.ds.prev_length - MIN_MATCH);
+
+ /* Insert in hash table all strings up to the end of the match.
+ * strstart-1 and strstart are already inserted.
+ */
+ state.ds.lookahead -= state.ds.prev_length-1;
+ state.ds.prev_length -= 2;
+ do {
+ if (++state.ds.strstart <= max_insert) {
+ INSERT_STRING(state.ds.strstart, hash_head);
+ /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+ * always MIN_MATCH bytes ahead.
+ */
+ }
+ } while (--state.ds.prev_length != 0);
+ state.ds.strstart++;
+ match_available = 0;
+ match_length = MIN_MATCH-1;
+
+ if (flush) FLUSH_BLOCK(state,0), state.ds.block_start = state.ds.strstart;
+
+ } else if (match_available) {
+ /* If there was no match at the previous position, output a
+ * single literal. If there was a match but the current match
+ * is longer, truncate the previous match to a single literal.
+ */
+ if (ct_tally (state,0, state.ds.window[state.ds.strstart-1])) {
+ FLUSH_BLOCK(state,0), state.ds.block_start = state.ds.strstart;
+ }
+ state.ds.strstart++;
+ state.ds.lookahead--;
+ } else {
+ /* There is no previous match to compare with, wait for
+ * the next step to decide.
+ */
+ match_available = 1;
+ state.ds.strstart++;
+ state.ds.lookahead--;
+ }
+// Assert(state,strstart <= isize && lookahead <= isize, "a bit too far");
+
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (state.ds.lookahead < MIN_LOOKAHEAD) fill_window(state);
+ }
+ if (match_available) ct_tally (state,0, state.ds.window[state.ds.strstart-1]);
+
+ return FLUSH_BLOCK(state,1); /* eof */
+}
+
+
+
+
+
+
+
+
+
+
+
+
+int putlocal(struct zlist far *z, WRITEFUNC wfunc,void *param)
+{ // Write a local header described by *z to file *f. Return a ZE_ error code.
+ PUTLG(LOCSIG, f);
+ PUTSH(z->ver, f);
+ PUTSH(z->lflg, f);
+ PUTSH(z->how, f);
+ PUTLG(z->tim, f);
+ PUTLG(z->crc, f);
+ PUTLG(z->siz, f);
+ PUTLG(z->len, f);
+ PUTSH(z->nam, f);
+ PUTSH(z->ext, f);
+ size_t res = (size_t)wfunc(param, z->iname, (unsigned int)z->nam);
+ if (res!=z->nam) return ZE_TEMP;
+ if (z->ext)
+ { res = (size_t)wfunc(param, z->extra, (unsigned int)z->ext);
+ if (res!=z->ext) return ZE_TEMP;
+ }
+ return ZE_OK;
+}
+
+int putextended(struct zlist far *z, WRITEFUNC wfunc, void *param)
+{ // Write an extended local header described by *z to file *f. Returns a ZE_ code
+ PUTLG(EXTLOCSIG, f);
+ PUTLG(z->crc, f);
+ PUTLG(z->siz, f);
+ PUTLG(z->len, f);
+ return ZE_OK;
+}
+
+int putcentral(struct zlist far *z, WRITEFUNC wfunc, void *param)
+{ // Write a central header entry of *z to file *f. Returns a ZE_ code.
+ PUTLG(CENSIG, f);
+ PUTSH(z->vem, f);
+ PUTSH(z->ver, f);
+ PUTSH(z->flg, f);
+ PUTSH(z->how, f);
+ PUTLG(z->tim, f);
+ PUTLG(z->crc, f);
+ PUTLG(z->siz, f);
+ PUTLG(z->len, f);
+ PUTSH(z->nam, f);
+ PUTSH(z->cext, f);
+ PUTSH(z->com, f);
+ PUTSH(z->dsk, f);
+ PUTSH(z->att, f);
+ PUTLG(z->atx, f);
+ PUTLG(z->off, f);
+ if ((size_t)wfunc(param, z->iname, (unsigned int)z->nam) != z->nam ||
+ (z->cext && (size_t)wfunc(param, z->cextra, (unsigned int)z->cext) != z->cext) ||
+ (z->com && (size_t)wfunc(param, z->comment, (unsigned int)z->com) != z->com))
+ return ZE_TEMP;
+ return ZE_OK;
+}
+
+
+int putend(int n, ulg s, ulg c, extent m, char *z, WRITEFUNC wfunc, void *param)
+{ // write the end of the central-directory-data to file *f.
+ PUTLG(ENDSIG, f);
+ PUTSH(0, f);
+ PUTSH(0, f);
+ PUTSH(n, f);
+ PUTSH(n, f);
+ PUTLG(s, f);
+ PUTLG(c, f);
+ PUTSH(m, f);
+ // Write the comment, if any
+ if (m && wfunc(param, z, (unsigned int)m) != m) return ZE_TEMP;
+ return ZE_OK;
+}
+
+
+
+
+
+
+const ulg crc_table[256] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+};
+
+#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
+#define DO1(buf) crc = CRC32(crc, *buf++)
+#define DO2(buf) DO1(buf); DO1(buf)
+#define DO4(buf) DO2(buf); DO2(buf)
+#define DO8(buf) DO4(buf); DO4(buf)
+
+ulg crc32(ulg crc, const uch *buf, extent len)
+{ if (buf==NULL) return 0L;
+ crc = crc ^ 0xffffffffL;
+ while (len >= 8) {DO8(buf); len -= 8;}
+ if (len) do {DO1(buf);} while (--len);
+ return crc ^ 0xffffffffL; // (instead of ~c for 64-bit machines)
+}
+
+
+
+
+
+
+
+
+bool HasZipSuffix(const char *fn)
+{ const char *ext = fn+strlen(fn);
+ while (ext>fn && *ext!='.') ext--;
+ if (ext==fn && *ext!='.') return false;
+ if (stricmp(ext,".Z")==0) return true;
+ if (stricmp(ext,".zip")==0) return true;
+ if (stricmp(ext,".zoo")==0) return true;
+ if (stricmp(ext,".arc")==0) return true;
+ if (stricmp(ext,".lzh")==0) return true;
+ if (stricmp(ext,".arj")==0) return true;
+ if (stricmp(ext,".gz")==0) return true;
+ if (stricmp(ext,".tgz")==0) return true;
+ return false;
+}
+
+
+__time32_t filetime2timet(const FILETIME ft)
+{ SYSTEMTIME st; FileTimeToSystemTime(&ft,&st);
+ if (st.wYear<1970) {st.wYear=1970; st.wMonth=1; st.wDay=1;}
+ if (st.wYear>=2038) {st.wYear=2037; st.wMonth=12; st.wDay=31;}
+ struct tm tm;
+ tm.tm_sec = st.wSecond;
+ tm.tm_min = st.wMinute;
+ tm.tm_hour = st.wHour;
+ tm.tm_mday = st.wDay;
+ tm.tm_mon = st.wMonth-1;
+ tm.tm_year = st.wYear-1900;
+ tm.tm_isdst = 0;
+ __time32_t t = _mktime32(&tm);
+ return t;
+}
+
+
+ZRESULT GetFileInfo(HANDLE hf, ulg *attr, long *size, iztimes *times, ulg *timestamp)
+{
+ DWORD type=GetFileType(hf);
+ if (type!=FILE_TYPE_DISK)
+ return ZR_NOTINITED;
+ // The handle must be a handle to a file
+ // The date and time is returned in a long with the date most significant to allow
+ // unsigned integer comparison of absolute times. The attributes have two
+ // high bytes unix attr, and two low bytes a mapping of that to DOS attr.
+ //struct stat s; int res=stat(fn,&s); if (res!=0) return false;
+ // translate windows file attributes into zip ones.
+ BY_HANDLE_FILE_INFORMATION bhi;
+ BOOL res=GetFileInformationByHandle(hf,&bhi);
+ if (!res)
+ return ZR_NOFILE;
+
+ // +++1.3
+ /// Convert times from UTC to local time. MSDN says that FILETIME is local
+ /// for FAT file system and UTC for NTFS system, but tests show that both FAT and NTFS
+ /// return UTC time.
+ {
+ // Get time zone difference
+ SYSTEMTIME stUTC, stLocal;
+ GetSystemTime(&stUTC);
+ GetLocalTime(&stLocal); // could be a few milliseconds difference, but should we care?
+ FILETIME ftUTC, ftLocal;
+ SystemTimeToFileTime(&stUTC, &ftUTC);
+ SystemTimeToFileTime(&stLocal, &ftLocal);
+ LONG64 uiUTC, uiLocal;
+ memcpy (&uiUTC, &ftUTC, min(sizeof(LONG64), sizeof(FILETIME))); // use 'min' as safeguard, however both sizes should be the same: 64-bit
+ memcpy (&uiLocal, &ftLocal, min(sizeof(LONG64), sizeof(FILETIME)));
+ LONG64 uiTimeDiff = uiUTC - uiLocal;
+
+ // apply difference
+ FILETIME* pFileTimes[3] = { &bhi.ftLastWriteTime, &bhi.ftLastAccessTime, &bhi.ftCreationTime };
+ for (int i=0; i<3; i++){
+ LONG64 uiUTC_file;
+ memcpy (&uiUTC_file, pFileTimes[i], min(sizeof(LONG64), sizeof(FILETIME)));
+ LONG64 uiLocal_file = uiUTC_file - uiTimeDiff;
+ memcpy (pFileTimes[i], &uiLocal_file, min(sizeof(LONG64), sizeof(FILETIME)));
+ }
+ }
+
+ DWORD fa=bhi.dwFileAttributes;
+ ulg a=0;
+ // Zip uses the lower word for its interpretation of windows stuff
+ if (fa&FILE_ATTRIBUTE_READONLY) a|=0x01;
+ if (fa&FILE_ATTRIBUTE_HIDDEN) a|=0x02;
+ if (fa&FILE_ATTRIBUTE_SYSTEM) a|=0x04;
+ if (fa&FILE_ATTRIBUTE_DIRECTORY)a|=0x10;
+ if (fa&FILE_ATTRIBUTE_ARCHIVE) a|=0x20;
+ // It uses the upper word for standard unix attr, which we must manually construct
+ if (fa&FILE_ATTRIBUTE_DIRECTORY)a|=0x40000000; // directory
+ else a|=0x80000000; // normal file
+ a|=0x01000000; // readable
+ if (fa&FILE_ATTRIBUTE_READONLY) {}
+ else a|=0x00800000; // writeable
+ // now just a small heuristic to check if it's an executable:
+ DWORD red, hsize=GetFileSize(hf,NULL); if (hsize>40)
+ { SetFilePointer(hf,0,NULL,FILE_BEGIN); unsigned short magic; ReadFile(hf,&magic,sizeof(magic),&red,NULL);
+ SetFilePointer(hf,36,NULL,FILE_BEGIN); unsigned long hpos; ReadFile(hf,&hpos,sizeof(hpos),&red,NULL);
+ if (magic==0x54AD && hsize>hpos+4+20+28)
+ { SetFilePointer(hf,hpos,NULL,FILE_BEGIN); unsigned long signature; ReadFile(hf,&signature,sizeof(signature),&red,NULL);
+ if (signature==IMAGE_DOS_SIGNATURE || signature==IMAGE_OS2_SIGNATURE
+ || signature==IMAGE_OS2_SIGNATURE_LE || signature==IMAGE_NT_SIGNATURE)
+ { a |= 0x00400000; // executable
+ }
+ }
+ }
+ //
+ if (attr!=NULL) *attr = a;
+ if (size!=NULL) *size = hsize;
+ if (times!=NULL)
+ { // time_t is 32bit number of seconds elapsed since 0:0:0GMT, Jan1, 1970.
+ // but FILETIME is 64bit number of 100-nanosecs since Jan1, 1601
+ times->atime = filetime2timet(bhi.ftLastAccessTime);
+ times->mtime = filetime2timet(bhi.ftLastWriteTime);
+ times->ctime = filetime2timet(bhi.ftCreationTime);
+ }
+ if (timestamp!=NULL)
+ { WORD dosdate,dostime;
+ FileTimeToDosDateTime(&bhi.ftLastWriteTime,&dosdate,&dostime);
+ *timestamp = (WORD)dostime | (((DWORD)dosdate)<<16);
+ }
+ return ZR_OK;
+}
+
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+class TZip
+{ public:
+ TZip() : hfout(0),hmapout(0),zfis(0),obuf(0),hfin(0),writ(0),oerr(false),hasputcen(false),ooffset(0) {}
+ ~TZip() {}
+
+ // These variables say about the file we're writing into
+ // We can write to pipe, file-by-handle, file-by-name, memory-to-memmapfile
+ HANDLE hfout; // if valid, we'll write here (for files or pipes)
+ HANDLE hmapout; // otherwise, we'll write here (for memmap)
+ unsigned ooffset; // for hfout, this is where the pointer was initially
+ ZRESULT oerr; // did a write operation give rise to an error?
+ unsigned writ; // how far have we written. This is maintained by Add, not write(), to avoid confusion over seeks
+ bool ocanseek; // can we seek?
+ char *obuf; // this is where we've locked mmap to view.
+ unsigned int opos; // current pos in the mmap
+ unsigned int mapsize; // the size of the map we created
+ bool hasputcen; // have we yet placed the central directory?
+ //
+ TZipFileInfo *zfis; // each file gets added onto this list, for writing the table at the end
+
+ ZRESULT Create(void *z,unsigned int len,DWORD flags);
+ static unsigned sflush(void *param,const char *buf, unsigned *size);
+ static unsigned swrite(void *param,const char *buf, unsigned size);
+ unsigned int write(const char *buf,unsigned int size);
+ bool oseek(unsigned int pos);
+ ZRESULT GetMemory(void **pbuf, unsigned long *plen);
+ ZRESULT Close();
+
+ // some variables to do with the file currently being read:
+ // I haven't done it object-orientedly here, just put them all
+ // together, since OO didn't seem to make the design any clearer.
+ ulg attr; iztimes times; ulg timestamp; // all open_* methods set these
+ bool iseekable; long isize,ired; // size is not set until close() on pips
+ ulg crc; // crc is not set until close(). iwrit is cumulative
+ HANDLE hfin; bool selfclosehf; // for input files and pipes
+ const char *bufin; unsigned int lenin,posin; // for memory
+ // and a variable for what we've done with the input: (i.e. compressed it!)
+ ulg csize; // compressed size, set by the compression routines
+ // and this is used by some of the compression routines
+ char buf[16384];
+
+
+ ZRESULT open_file(const TCHAR *fn);
+ ZRESULT open_handle(HANDLE hf,unsigned int len);
+ ZRESULT open_mem(void *src,unsigned int len);
+ ZRESULT open_dir();
+ static unsigned sread(TState &s,char *buf,unsigned size);
+ unsigned read(char *buf, unsigned size);
+ ZRESULT iclose();
+
+ ZRESULT ideflate(TZipFileInfo *zfi);
+ ZRESULT istore();
+
+ ZRESULT Add(const char *odstzn, void *src,unsigned int len, DWORD flags);
+ ZRESULT AddCentral();
+
+};
+
+ZRESULT TZip::Create(void *z,unsigned int len,DWORD flags)
+{
+ if (hfout!=0 || hmapout!=0 || obuf!=0 || writ!=0 || oerr!=ZR_OK || hasputcen)
+ return ZR_NOTINITED;
+ //
+ if (flags==ZIP_HANDLE)
+ {
+ HANDLE hf = (HANDLE)z;
+ BOOL res = DuplicateHandle(GetCurrentProcess(),hf,GetCurrentProcess(),&hfout,0,FALSE,DUPLICATE_SAME_ACCESS);
+ if (!res)
+ return ZR_NODUPH;
+ // now we have our own hfout, which we must close. And the caller will close hf
+ DWORD type = GetFileType(hfout);
+ ocanseek = (type==FILE_TYPE_DISK);
+ if (type==FILE_TYPE_DISK)
+ ooffset=SetFilePointer(hfout,0,NULL,FILE_CURRENT);
+ else
+ ooffset=0;
+ return ZR_OK;
+ }
+ else if (flags==ZIP_FILENAME)
+ {
+#ifdef _UNICODE
+ const TCHAR *fn = (const TCHAR*)z;
+ hfout = CreateFileW(fn,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+#else
+ const char *fn = (const char*)z;
+ hfout = CreateFileA(fn,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+#endif
+
+ if (hfout==INVALID_HANDLE_VALUE)
+ {
+ hfout=0;
+ return ZR_NOFILE;
+ }
+ ocanseek=true;
+ ooffset=0;
+ return ZR_OK;
+ }
+ else if (flags==ZIP_MEMORY)
+ {
+ unsigned int size = len;
+ if (size==0)
+ return ZR_MEMSIZE;
+ if (z!=0)
+ obuf=(char*)z;
+ else
+ {
+ hmapout = CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_READWRITE,0,size,NULL);
+ if (hmapout==NULL)
+ return ZR_NOALLOC;
+ obuf = (char*)MapViewOfFile(hmapout,FILE_MAP_ALL_ACCESS,0,0,size);
+ if (obuf==0)
+ {
+ CloseHandle(hmapout);
+ hmapout=0;
+ return ZR_NOALLOC;
+ }
+ }
+ ocanseek=true;
+ opos=0;
+ mapsize=size;
+ return ZR_OK;
+ }
+ else
+ return ZR_ARGS;
+}
+
+
+unsigned TZip::sflush(void *param,const char *buf, unsigned *size)
+{ // static
+ if (*size==0) return 0;
+ TZip *zip = (TZip*)param;
+ unsigned int writ = zip->write(buf,*size);
+ if (writ!=0) *size=0;
+ return writ;
+}
+unsigned TZip::swrite(void *param,const char *buf, unsigned size)
+{ // static
+ if (size==0) return 0;
+ TZip *zip=(TZip*)param; return zip->write(buf,size);
+}
+
+#if 0 // -----------------------------------------------------------
+unsigned int TZip::write(const char *buf,unsigned int size)
+{ if (obuf!=0)
+ { if (opos+size>=mapsize) {oerr=ZR_MEMSIZE; return 0;}
+ memcpy(obuf+opos, buf, size);
+ opos+=size;
+ return size;
+ }
+ else if (hfout!=0)
+ { DWORD writ; WriteFile(hfout,buf,size,&writ,NULL);
+ return writ;
+ }
+ oerr=ZR_NOTINITED; return 0;
+}
+#endif // -----------------------------------------------------------
+
+//+++1.2
+unsigned int TZip::write(const char *buf, unsigned int size)
+{
+ if (obuf != 0)
+ {
+ if (opos+size >= mapsize)
+ {
+ int newmapsize = 2*mapsize>opos+size?2*mapsize:opos+size;
+ HANDLE hmapout2 = CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_READWRITE,0,newmapsize,NULL);
+ if (hmapout2 == NULL)
+ return ZR_NOALLOC;
+ char *obuf2 = NULL; // this is where we've locked mmap to view.
+
+ obuf2 = (char*)MapViewOfFile(hmapout2,FILE_MAP_ALL_ACCESS,0,0,newmapsize);
+ if (obuf2 == 0)
+ {
+ CloseHandle(hmapout2);
+ hmapout2 = 0;
+ return ZR_NOALLOC;
+ }
+
+ memcpy(obuf2, obuf, mapsize);
+
+ UnmapViewOfFile(obuf);
+ CloseHandle(hmapout);
+
+ mapsize = newmapsize;
+ obuf = obuf2;
+ hmapout = hmapout2;
+ }
+ memcpy(obuf+opos, buf, size);
+ opos += size;
+ return size;
+ }
+ else if (hfout!=0)
+ {
+ DWORD writ = 0;
+ WriteFile(hfout,buf,size,&writ,NULL);
+ return writ;
+ }
+ oerr = ZR_NOTINITED;
+ return 0;
+}
+
+
+bool TZip::oseek(unsigned int pos)
+{ if (!ocanseek) {oerr=ZR_SEEK; return false;}
+ if (obuf!=0)
+ { if (pos>=mapsize) {oerr=ZR_MEMSIZE; return false;}
+ opos=pos;
+ return true;
+ }
+ else if (hfout!=0)
+ { SetFilePointer(hfout,pos+ooffset,NULL,FILE_BEGIN);
+ return true;
+ }
+ oerr=ZR_NOTINITED; return 0;
+}
+
+ZRESULT TZip::GetMemory(void **pbuf, unsigned long *plen)
+{ // When the user calls GetMemory, they're presumably at the end
+ // of all their adding. In any case, we have to add the central
+ // directory now, otherwise the memory we tell them won't be complete.
+ if (!hasputcen) AddCentral(); hasputcen=true;
+ if (pbuf!=NULL) *pbuf=(void*)obuf;
+ if (plen!=NULL) *plen=writ;
+ if (obuf==NULL) return ZR_NOTMMAP;
+ return ZR_OK;
+}
+
+ZRESULT TZip::Close()
+{ // if the directory hadn't already been added through a call to GetMemory,
+ // then we do it now
+ ZRESULT res=ZR_OK; if (!hasputcen) res=AddCentral(); hasputcen=true;
+ if (obuf!=0 && hmapout!=0) UnmapViewOfFile(obuf); obuf=0;
+ if (hmapout!=0) CloseHandle(hmapout); hmapout=0;
+ if (hfout!=0) CloseHandle(hfout); hfout=0;
+ return res;
+}
+
+
+
+
+ZRESULT TZip::open_file(const TCHAR *fn)
+{ hfin=0; bufin=0; selfclosehf=false; crc=CRCVAL_INITIAL; isize=0; csize=0; ired=0;
+ if (fn==0) return ZR_ARGS;
+ HANDLE hf = CreateFile(fn,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
+ if (hf==INVALID_HANDLE_VALUE) return ZR_NOFILE;
+ ZRESULT res = open_handle(hf,0);
+ if (res!=ZR_OK) {CloseHandle(hf); return res;}
+ selfclosehf=true;
+ return ZR_OK;
+}
+ZRESULT TZip::open_handle(HANDLE hf,unsigned int len)
+{ hfin=0; bufin=0; selfclosehf=false; crc=CRCVAL_INITIAL; isize=0; csize=0; ired=0;
+ if (hf==0 || hf==INVALID_HANDLE_VALUE) return ZR_ARGS;
+ DWORD type = GetFileType(hf);
+ if (type==FILE_TYPE_DISK)
+ { ZRESULT res = GetFileInfo(hf,&attr,&isize,&times,&timestamp);
+ if (res!=ZR_OK) return res;
+ SetFilePointer(hf,0,NULL,FILE_BEGIN); // because GetFileInfo will have screwed it up
+ iseekable=true; hfin=hf;
+ return ZR_OK;
+ }
+ else
+ { attr= 0x80000000; // just a normal file
+ isize = -1; // can't know size until at the end
+ if (len!=0) isize=len; // unless we were told explicitly!
+ iseekable=false;
+ SYSTEMTIME st; GetLocalTime(&st);
+ FILETIME ft; SystemTimeToFileTime(&st,&ft);
+ WORD dosdate,dostime; FileTimeToDosDateTime(&ft,&dosdate,&dostime);
+ times.atime = filetime2timet(ft);
+ times.mtime = times.atime;
+ times.ctime = times.atime;
+ timestamp = (WORD)dostime | (((DWORD)dosdate)<<16);
+ hfin=hf;
+ return ZR_OK;
+ }
+}
+ZRESULT TZip::open_mem(void *src,unsigned int len)
+{ hfin=0; bufin=(const char*)src; selfclosehf=false; crc=CRCVAL_INITIAL; ired=0; csize=0; ired=0;
+ lenin=len; posin=0;
+ if (src==0 || len==0) return ZR_ARGS;
+ attr= 0x80000000; // just a normal file
+ isize = len;
+ iseekable=true;
+ SYSTEMTIME st; GetLocalTime(&st);
+ FILETIME ft; SystemTimeToFileTime(&st,&ft);
+ WORD dosdate,dostime; FileTimeToDosDateTime(&ft,&dosdate,&dostime);
+ times.atime = filetime2timet(ft);
+ times.mtime = times.atime;
+ times.ctime = times.atime;
+ timestamp = (WORD)dostime | (((DWORD)dosdate)<<16);
+ return ZR_OK;
+}
+ZRESULT TZip::open_dir()
+{ hfin=0; bufin=0; selfclosehf=false; crc=CRCVAL_INITIAL; isize=0; csize=0; ired=0;
+ attr= 0x41C00010; // a readable writable directory, and again directory
+ isize = 0;
+ iseekable=false;
+ SYSTEMTIME st; GetLocalTime(&st);
+ FILETIME ft; SystemTimeToFileTime(&st,&ft);
+ WORD dosdate,dostime; FileTimeToDosDateTime(&ft,&dosdate,&dostime);
+ times.atime = filetime2timet(ft);
+ times.mtime = times.atime;
+ times.ctime = times.atime;
+ timestamp = (WORD)dostime | (((DWORD)dosdate)<<16);
+ return ZR_OK;
+}
+
+unsigned TZip::sread(TState &s,char *buf,unsigned size)
+{ // static
+ TZip *zip = (TZip*)s.param;
+ return zip->read(buf,size);
+}
+
+unsigned TZip::read(char *buf, unsigned size)
+{ if (bufin!=0)
+ { if (posin>=lenin) return 0; // end of input
+ ulg red = lenin-posin;
+ if (red>size) red=size;
+ memcpy(buf, bufin+posin, red);
+ posin += red;
+ ired += red;
+ crc = crc32(crc, (uch*)buf, red);
+ return red;
+ }
+ else if (hfin!=0)
+ { DWORD red;
+ BOOL ok = ReadFile(hfin,buf,size,&red,NULL);
+ if (!ok) return 0;
+ ired += red;
+ crc = crc32(crc, (uch*)buf, red);
+ return red;
+ }
+ else {oerr=ZR_NOTINITED; return 0;}
+}
+
+ZRESULT TZip::iclose()
+{ if (selfclosehf && hfin!=0) CloseHandle(hfin); hfin=0;
+ bool mismatch = (isize!=-1 && isize!=ired);
+ isize=ired; // and crc has been being updated anyway
+ if (mismatch) return ZR_MISSIZE;
+ else return ZR_OK;
+}
+
+
+
+#if 0 // -----------------------------------------------------------
+ZRESULT TZip::ideflate(TZipFileInfo *zfi)
+{ TState state;
+ state.readfunc=sread; state.flush_outbuf=sflush;
+ state.param=this; state.level=8; state.seekable=iseekable; state.err=NULL;
+ // the following line will make ct_init realise it has to perform the init
+ state.ts.static_dtree[0].dl.len = 0;
+ // It would be nicer if I could figure out precisely which data had to
+ // be initted each time, and which didn't, but that's kind of difficult.
+ // Maybe for the next version...
+ //
+ bi_init(state,buf, sizeof(buf), TRUE); // it used to be just 1024-size, not 16384 as here
+ ct_init(state,&zfi->att);
+ lm_init(state,state.level, &zfi->flg);
+ ulg sz = deflate(state);
+ csize=sz;
+ if (state.err!=NULL) return ZR_FLATE;
+ else return ZR_OK;
+}
+#endif // -----------------------------------------------------------
+
+//+++1.2
+// create state object on heap
+ZRESULT TZip::ideflate(TZipFileInfo *zfi)
+{
+ ZRESULT zr = ZR_OK;
+ TState* state=new TState();
+ (*state).readfunc=sread; (*state).flush_outbuf=sflush;
+ (*state).param=this; (*state).level=8; (*state).seekable=iseekable; (*state).err=NULL;
+ // the following line will make ct_init realise it has to perform the init
+ (*state).ts.static_dtree[0].dl.len = 0;
+ // It would be nicer if I could figure out precisely which data had to
+ // be initted each time, and which didn't, but that's kind of difficult.
+ // Maybe for the next version...
+ //
+ bi_init(*state,buf, sizeof(buf), TRUE); // it used to be just 1024-size, not 16384 as here
+ ct_init(*state,&zfi->att);
+ lm_init(*state,(*state).level, &zfi->flg);
+ ulg sz = deflate(*state);
+ csize=sz;
+ if ((*state).err!=NULL)
+ {
+ zr = ZR_FLATE;
+ }
+ delete state;
+ return zr;
+}
+
+ZRESULT TZip::istore()
+{ ulg size=0;
+ for (;;)
+ { unsigned int cin=read(buf,16384); if (cin<=0 || cin==(unsigned int)EOF) break;
+ unsigned int cout = write(buf,cin); if (cout!=cin) return ZR_MISSIZE;
+ size += cin;
+ }
+ csize=size;
+ return ZR_OK;
+}
+
+
+
+
+ZRESULT TZip::Add(const char *odstzn, void *src,unsigned int len, DWORD flags)
+{
+ if (oerr)
+ return ZR_FAILED;
+ if (hasputcen)
+ return ZR_ENDED;
+
+ // zip has its own notion of what its names should look like: i.e. dir/file.stuff
+ char dstzn[MAX_PATH];
+ strcpy(dstzn, odstzn);
+ if (*dstzn == 0)
+ return ZR_ARGS;
+ char *d=dstzn;
+ while (*d != 0)
+ {
+ if (*d == '\\')
+ *d = '/'; d++;
+ }
+ bool isdir = (flags==ZIP_FOLDER);
+ bool needs_trailing_slash = (isdir && dstzn[strlen(dstzn)-1]!='/');
+ int method=DEFLATE;
+ if (isdir || HasZipSuffix(dstzn))
+ method=STORE;
+
+ // now open whatever was our input source:
+ ZRESULT openres;
+ if (flags==ZIP_FILENAME)
+ openres=open_file((const TCHAR*)src);
+ else if (flags==ZIP_HANDLE)
+ openres=open_handle((HANDLE)src,len);
+ else if (flags==ZIP_MEMORY)
+ openres=open_mem(src,len);
+ else if (flags==ZIP_FOLDER)
+ openres=open_dir();
+ else return ZR_ARGS;
+ if (openres!=ZR_OK)
+ return openres;
+
+ // A zip "entry" consists of a local header (which includes the file name),
+ // then the compressed data, and possibly an extended local header.
+
+ // Initialize the local header
+ TZipFileInfo zfi; zfi.nxt=NULL;
+ strcpy(zfi.name,"");
+ strcpy(zfi.iname,dstzn);
+ zfi.nam=strlen(zfi.iname);
+ if (needs_trailing_slash)
+ {
+ strcat(zfi.iname,"/");
+ zfi.nam++;
+ }
+ strcpy(zfi.zname,"");
+ zfi.extra=NULL; zfi.ext=0; // extra header to go after this compressed data, and its length
+ zfi.cextra=NULL; zfi.cext=0; // extra header to go in the central end-of-zip directory, and its length
+ zfi.comment=NULL; zfi.com=0; // comment, and its length
+ zfi.mark = 1;
+ zfi.dosflag = 0;
+ zfi.att = (ush)BINARY;
+ zfi.vem = (ush)0xB17; // 0xB00 is win32 os-code. 0x17 is 23 in decimal: zip 2.3
+ zfi.ver = (ush)20; // Needs PKUNZIP 2.0 to unzip it
+ zfi.tim = timestamp;
+ // Even though we write the header now, it will have to be rewritten, since we don't know compressed size or crc.
+ zfi.crc = 0; // to be updated later
+ zfi.flg = 8; // 8 means 'there is an extra header'. Assume for the moment that we need it.
+ zfi.lflg = zfi.flg; // to be updated later
+ zfi.how = (ush)method; // to be updated later
+ zfi.siz = (ulg)(method==STORE && isize>=0 ? isize : 0); // to be updated later
+ zfi.len = (ulg)(isize); // to be updated later
+ zfi.dsk = 0;
+ zfi.atx = attr;
+ zfi.off = writ+ooffset; // offset within file of the start of this local record
+ // stuff the 'times' structure into zfi.extra
+ char xloc[EB_L_UT_SIZE];
+ zfi.extra=xloc;
+ zfi.ext=EB_L_UT_SIZE;
+ char xcen[EB_C_UT_SIZE];
+ zfi.cextra=xcen;
+ zfi.cext=EB_C_UT_SIZE;
+ xloc[0] = 'U';
+ xloc[1] = 'T';
+ xloc[2] = EB_UT_LEN(3); // length of data part of e.f.
+ xloc[3] = 0;
+ xloc[4] = EB_UT_FL_MTIME | EB_UT_FL_ATIME | EB_UT_FL_CTIME;
+ xloc[5] = (char)(times.mtime);
+ xloc[6] = (char)(times.mtime >> 8);
+ xloc[7] = (char)(times.mtime >> 16);
+ xloc[8] = (char)(times.mtime >> 24);
+ xloc[9] = (char)(times.atime);
+ xloc[10] = (char)(times.atime >> 8);
+ xloc[11] = (char)(times.atime >> 16);
+ xloc[12] = (char)(times.atime >> 24);
+ xloc[13] = (char)(times.ctime);
+ xloc[14] = (char)(times.ctime >> 8);
+ xloc[15] = (char)(times.ctime >> 16);
+ xloc[16] = (char)(times.ctime >> 24);
+ memcpy(zfi.cextra,zfi.extra,EB_C_UT_SIZE);
+ zfi.cextra[EB_LEN] = EB_UT_LEN(1);
+
+
+ // (1) Start by writing the local header:
+ int r = putlocal(&zfi,swrite,this);
+ if (r!=ZE_OK)
+ {
+ iclose();
+ return ZR_WRITE;
+ }
+ writ += 4 + LOCHEAD + (unsigned int)zfi.nam + (unsigned int)zfi.ext;
+ if (oerr!=ZR_OK)
+ {
+ iclose();
+ return oerr;
+ }
+
+ //(2) Write deflated/stored file to zip file
+ ZRESULT writeres=ZR_OK;
+ if (!isdir && method==DEFLATE)
+ writeres=ideflate(&zfi);
+ else if (!isdir && method==STORE)
+ writeres=istore();
+ else if (isdir)
+ csize=0;
+ iclose();
+ writ += csize;
+ if (oerr!=ZR_OK)
+ return oerr;
+ if (writeres!=ZR_OK)
+ return ZR_WRITE;
+
+ // (3) Either rewrite the local header with correct information...
+ bool first_header_has_size_right = (zfi.siz==csize);
+ zfi.crc = crc;
+ zfi.siz = csize;
+ zfi.len = isize;
+ if (ocanseek)
+ {
+ zfi.how = (ush)method;
+ if ((zfi.flg & 1) == 0)
+ zfi.flg &= ~8; // clear the extended local header flag
+ zfi.lflg = zfi.flg;
+ // rewrite the local header:
+ if (!oseek(zfi.off-ooffset))
+ return ZR_SEEK;
+ if ((r = putlocal(&zfi, swrite,this)) != ZE_OK)
+ return ZR_WRITE;
+ if (!oseek(writ))
+ return ZR_SEEK;
+ }
+ else
+ {
+ // (4) ... or put an updated header at the end
+ if (zfi.how != (ush) method)
+ return ZR_NOCHANGE;
+ if (method==STORE && !first_header_has_size_right)
+ return ZR_NOCHANGE;
+ if ((r = putextended(&zfi, swrite,this)) != ZE_OK)
+ return ZR_WRITE;
+ writ += 16L;
+ zfi.flg = zfi.lflg; // if flg modified by inflate, for the central index
+ }
+ if (oerr!=ZR_OK)
+ return oerr;
+
+ // Keep a copy of the zipfileinfo, for our end-of-zip directory
+ char *cextra = new char[zfi.cext];
+ memcpy(cextra,zfi.cextra,zfi.cext); zfi.cextra=cextra;
+ TZipFileInfo *pzfi = new TZipFileInfo;
+ memcpy(pzfi,&zfi,sizeof(zfi));
+ if (zfis==NULL)
+ zfis=pzfi;
+ else
+ {
+ TZipFileInfo *z=zfis;
+ while (z->nxt!=NULL)
+ z=z->nxt;
+ z->nxt=pzfi;
+ }
+ return ZR_OK;
+}
+
+ZRESULT TZip::AddCentral()
+{ // write central directory
+ int numentries = 0;
+ ulg pos_at_start_of_central = writ;
+ //ulg tot_unc_size=0, tot_compressed_size=0;
+ bool okay=true;
+ for (TZipFileInfo *zfi=zfis; zfi!=NULL; )
+ { if (okay)
+ { int res = putcentral(zfi, swrite,this);
+ if (res!=ZE_OK) okay=false;
+ }
+ writ += 4 + CENHEAD + (unsigned int)zfi->nam + (unsigned int)zfi->cext + (unsigned int)zfi->com;
+ //tot_unc_size += zfi->len;
+ //tot_compressed_size += zfi->siz;
+ numentries++;
+ //
+ TZipFileInfo *zfinext = zfi->nxt;
+ if (zfi->cextra!=0) delete[] zfi->cextra;
+ delete zfi;
+ zfi = zfinext;
+ }
+ ulg center_size = writ - pos_at_start_of_central;
+ if (okay)
+ { int res = putend(numentries, center_size, pos_at_start_of_central+ooffset, 0, NULL, swrite,this);
+ if (res!=ZE_OK) okay=false;
+ writ += 4 + ENDHEAD + 0;
+ }
+ if (!okay) return ZR_WRITE;
+ return ZR_OK;
+}
+
+
+
+
+
+ZRESULT lasterrorZ=ZR_OK;
+
+unsigned int FormatZipMessageZ(ZRESULT code, char *buf,unsigned int len)
+{ if (code==ZR_RECENT) code=lasterrorZ;
+ const char *msg="unknown zip result code";
+ switch (code)
+ { case ZR_OK: msg="Success"; break;
+ case ZR_NODUPH: msg="Culdn't duplicate handle"; break;
+ case ZR_NOFILE: msg="Couldn't create/open file"; break;
+ case ZR_NOALLOC: msg="Failed to allocate memory"; break;
+ case ZR_WRITE: msg="Error writing to file"; break;
+ case ZR_NOTFOUND: msg="File not found in the zipfile"; break;
+ case ZR_MORE: msg="Still more data to unzip"; break;
+ case ZR_CORRUPT: msg="Zipfile is corrupt or not a zipfile"; break;
+ case ZR_READ: msg="Error reading file"; break;
+ case ZR_ARGS: msg="Caller: faulty arguments"; break;
+ case ZR_PARTIALUNZ: msg="Caller: the file had already been partially unzipped"; break;
+ case ZR_NOTMMAP: msg="Caller: can only get memory of a memory zipfile"; break;
+ case ZR_MEMSIZE: msg="Caller: not enough space allocated for memory zipfile"; break;
+ case ZR_FAILED: msg="Caller: there was a previous error"; break;
+ case ZR_ENDED: msg="Caller: additions to the zip have already been ended"; break;
+ case ZR_ZMODE: msg="Caller: mixing creation and opening of zip"; break;
+ case ZR_NOTINITED: msg="Zip-bug: internal initialisation not completed"; break;
+ case ZR_SEEK: msg="Zip-bug: trying to seek the unseekable"; break;
+ case ZR_MISSIZE: msg="Zip-bug: the anticipated size turned out wrong"; break;
+ case ZR_NOCHANGE: msg="Zip-bug: tried to change mind, but not allowed"; break;
+ case ZR_FLATE: msg="Zip-bug: an internal error during flation"; break;
+ }
+ unsigned int mlen=(unsigned int)strlen(msg);
+ if (buf==0 || len==0) return mlen;
+ unsigned int n=mlen; if (n+1>len) n=len-1;
+ strncpy(buf,msg,n); buf[n]=0;
+ return mlen;
+}
+
+
+
+typedef struct
+{ DWORD flag;
+ TZip *zip;
+} TZipHandleData;
+
+
+HZIP CreateZipZ(void *z,unsigned int len,DWORD flags)
+{
+ tzset();
+ TZip *zip = new TZip();
+ lasterrorZ = zip->Create(z,len,flags);
+ if (lasterrorZ != ZR_OK)
+ {
+ delete zip;
+ return 0;
+ }
+ TZipHandleData *han = new TZipHandleData;
+ han->flag = 2;
+ han->zip = zip;
+ return (HZIP)han;
+}
+
+ZRESULT ZipAdd(HZIP hz, const TCHAR *dstzn, void *src, unsigned int len, DWORD flags)
+{
+ if (hz == 0)
+ {
+ lasterrorZ = ZR_ARGS;
+ return ZR_ARGS;
+ }
+
+ if (dstzn == NULL)
+ {
+ lasterrorZ = ZR_ARGS;
+ return ZR_ARGS;
+ }
+
+ TZipHandleData *han = (TZipHandleData*)hz;
+ if (han->flag != 2)
+ {
+ lasterrorZ = ZR_ZMODE;
+ return ZR_ZMODE;
+ }
+ TZip *zip = han->zip;
+
+
+ char szDest[MAX_PATH*2];
+ memset(szDest, 0, sizeof(szDest));
+
+#ifdef _UNICODE
+ // need to convert Unicode dest to ANSI
+ int nActualChars = WideCharToMultiByte(CP_ACP, // code page
+ 0, // performance and mapping flags
+ (LPCWSTR) dstzn, // wide-character string
+ -1, // number of chars in string
+ szDest, // buffer for new string
+ MAX_PATH*2, // size of buffer
+ NULL, // default for unmappable chars
+ NULL); // set when default char used
+ if (nActualChars == 0)
+ return ZR_ARGS;
+#else
+ strcpy(szDest, dstzn);
+#endif
+
+ lasterrorZ = zip->Add(szDest, src, len, flags);
+
+ return lasterrorZ;
+}
+
+ZRESULT ZipGetMemory(HZIP hz, void **buf, unsigned long *len)
+{ if (hz==0) {if (buf!=0) *buf=0; if (len!=0) *len=0; lasterrorZ=ZR_ARGS;return ZR_ARGS;}
+ TZipHandleData *han = (TZipHandleData*)hz;
+ if (han->flag!=2) {lasterrorZ=ZR_ZMODE;return ZR_ZMODE;}
+ TZip *zip = han->zip;
+ lasterrorZ = zip->GetMemory(buf,len);
+ return lasterrorZ;
+}
+
+ZRESULT CloseZipZ(HZIP hz)
+{ if (hz==0) {lasterrorZ=ZR_ARGS;return ZR_ARGS;}
+ TZipHandleData *han = (TZipHandleData*)hz;
+ if (han->flag!=2) {lasterrorZ=ZR_ZMODE;return ZR_ZMODE;}
+ TZip *zip = han->zip;
+ lasterrorZ = zip->Close();
+ delete zip;
+ delete han;
+ return lasterrorZ;
+}
+
+bool IsZipHandleZ(HZIP hz)
+{ if (hz==0) return true;
+ TZipHandleData *han = (TZipHandleData*)hz;
+ return (han->flag==2);
+}
+
+//+++1.2
+/**
+* Added by Renaud Deysine. This fonctionnality was missing in API
+* @brief Add a folder to the zip file. Empty folders will also be added.
+* This method add recursively the content of a directory
+* @param AbsolutePath like "C:\\Windows" or "C:\\Windows\"
+* @param DirToAdd like "System32"
+*
+*/
+BOOL AddFolderContent(HZIP hZip, TCHAR* AbsolutePath, TCHAR* DirToAdd)
+{
+ HANDLE hFind; // file handle
+ WIN32_FIND_DATA FindFileData;
+ TCHAR PathToSearchInto [MAX_PATH] = {0};
+
+ if (NULL != DirToAdd)
+ {
+ ZipAdd(hZip, DirToAdd, 0, 0, ZIP_FOLDER);
+ }
+
+ // Construct the path to search into "C:\\Windows\\System32\\*"
+ _tcscpy(PathToSearchInto, AbsolutePath);
+ _tcscat(PathToSearchInto, _T("\\"));
+ _tcscat(PathToSearchInto, DirToAdd);
+ _tcscat(PathToSearchInto, _T("\\*"));
+
+ hFind = FindFirstFile(PathToSearchInto,&FindFileData); // find the first file
+ if(hFind == INVALID_HANDLE_VALUE)
+ {
+ return FALSE;
+ }
+
+ bool bSearch = true;
+ while(bSearch) // until we finds an entry
+ {
+ if(FindNextFile(hFind,&FindFileData))
+ {
+ // Don't care about . and ..
+ //if(IsDots(FindFileData.cFileName))
+ if ((_tcscmp(FindFileData.cFileName, _T(".")) == 0) ||
+ (_tcscmp(FindFileData.cFileName, _T("..")) == 0))
+ continue;
+
+ // We have found a directory
+ if((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ TCHAR RelativePathNewDirFound[MAX_PATH] = {0};
+ _tcscat(RelativePathNewDirFound, DirToAdd);
+ _tcscat(RelativePathNewDirFound, _T("\\"));
+ _tcscat(RelativePathNewDirFound, FindFileData.cFileName);
+
+ // Recursive call with the new directory found
+ if (AddFolderContent(hZip, AbsolutePath, RelativePathNewDirFound)== FALSE)
+ {
+ return FALSE ;
+ }
+
+ }
+ // We have found a file
+ else
+ {
+ // Add the found file to the zip file
+ TCHAR RelativePathNewFileFound[MAX_PATH] = {0};
+ _tcscpy(RelativePathNewFileFound, DirToAdd);
+ _tcscat(RelativePathNewFileFound, _T("\\"));
+ _tcscat(RelativePathNewFileFound, FindFileData.cFileName);
+
+ TCHAR AbsoluteSourceFile[MAX_PATH] = { 0 };
+ _tcscpy(AbsoluteSourceFile, AbsolutePath);
+ _tcscat(AbsoluteSourceFile, RelativePathNewFileFound);
+
+ if (ZipAdd(hZip, RelativePathNewFileFound, AbsoluteSourceFile, 0, ZIP_FILENAME) != ZR_OK)
+ {
+ return FALSE;
+ }
+ }
+
+ }//FindNextFile
+ else
+ {
+ if(GetLastError() == ERROR_NO_MORE_FILES) // no more files there
+ bSearch = false;
+ else {
+ // some error occured, close the handle and return FALSE
+ FindClose(hFind);
+ return FALSE;
+ }
+ }
+ }//while
+
+ FindClose(hFind); // closing file handle
+ return true;
+
+}
+
diff --git a/src/Common/XZip.h b/src/Common/XZip.h
new file mode 100644
index 00000000..b1d43a92
--- /dev/null
+++ b/src/Common/XZip.h
@@ -0,0 +1,323 @@
+// XZip.h Version 1.3
+//
+// Authors: Mark Adler et al. (see below)
+//
+// Modified by: Lucian Wischik
+// lu@wischik.com
+//
+// Version 1.0 - Turned C files into just a single CPP file
+// - Made them compile cleanly as C++ files
+// - Gave them simpler APIs
+// - Added the ability to zip/unzip directly in memory without
+// any intermediate files
+//
+// Modified by: Hans Dietrich
+// hdietrich@gmail.com
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Lucian Wischik's comments:
+// --------------------------
+// THIS FILE is almost entirely based upon code by info-zip.
+// It has been modified by Lucian Wischik.
+// The original code may be found at http://www.info-zip.org
+// The original copyright text follows.
+//
+///////////////////////////////////////////////////////////////////////////////
+//
+// Original authors' comments:
+// ---------------------------
+// This is version 2002-Feb-16 of the Info-ZIP copyright and license. The
+// definitive version of this document should be available at
+// ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely.
+//
+// Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
+//
+// For the purposes of this copyright and license, "Info-ZIP" is defined as
+// the following set of individuals:
+//
+// Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
+// Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase,
+// Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
+// David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
+// Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
+// Kai Uwe Rommel, Steve Salisbury, Dave Smith, Christian Spieler,
+// Antoine Verheijen, Paul von Behren, Rich Wales, Mike White
+//
+// This software is provided "as is", without warranty of any kind, express
+// or implied. In no event shall Info-ZIP or its contributors be held liable
+// for any direct, indirect, incidental, special or consequential damages
+// arising out of the use of or inability to use this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. Redistributions of source code must retain the above copyright notice,
+// definition, disclaimer, and this list of conditions.
+//
+// 2. Redistributions in binary form (compiled executables) must reproduce
+// the above copyright notice, definition, disclaimer, and this list of
+// conditions in documentation and/or other materials provided with the
+// distribution. The sole exception to this condition is redistribution
+// of a standard UnZipSFX binary as part of a self-extracting archive;
+// that is permitted without inclusion of this license, as long as the
+// normal UnZipSFX banner has not been removed from the binary or disabled.
+//
+// 3. Altered versions--including, but not limited to, ports to new
+// operating systems, existing ports with new graphical interfaces, and
+// dynamic, shared, or static library versions--must be plainly marked
+// as such and must not be misrepresented as being the original source.
+// Such altered versions also must not be misrepresented as being
+// Info-ZIP releases--including, but not limited to, labeling of the
+// altered versions with the names "Info-ZIP" (or any variation thereof,
+// including, but not limited to, different capitalizations),
+// "Pocket UnZip", "WiZ" or "MacZip" without the explicit permission of
+// Info-ZIP. Such altered versions are further prohibited from
+// misrepresentative use of the Zip-Bugs or Info-ZIP e-mail addresses or
+// of the Info-ZIP URL(s).
+//
+// 4. Info-ZIP retains the right to use the names "Info-ZIP", "Zip", "UnZip",
+// "UnZipSFX", "WiZ", "Pocket UnZip", "Pocket Zip", and "MacZip" for its
+// own source and binary releases.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef XZIP_H
+#define XZIP_H
+
+// ZIP functions -- for creating zip files
+// This file is a repackaged form of the Info-Zip source code available
+// at www.info-zip.org. The original copyright notice may be found in
+// zip.cpp. The repackaging was done by Lucian Wischik to simplify its
+// use in Windows/C++.
+
+#ifndef XUNZIP_H
+DECLARE_HANDLE(HZIP); // An HZIP identifies a zip file that is being created
+#endif
+
+typedef DWORD ZRESULT; // result codes from any of the zip functions. Listed later.
+
+// flag values passed to some functions
+#define ZIP_HANDLE 1
+#define ZIP_FILENAME 2
+#define ZIP_MEMORY 3
+#define ZIP_FOLDER 4
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// CreateZip()
+//
+// Purpose: Create a zip archive file
+//
+// Parameters: z - archive file name if flags is ZIP_FILENAME; for other
+// uses see below
+// len - for memory (ZIP_MEMORY) should be the buffer size;
+// for other uses, should be 0
+// flags - indicates usage, see below; for files, this will be
+// ZIP_FILENAME
+//
+// Returns: HZIP - non-zero if zip archive created ok, otherwise 0
+//
+HZIP CreateZip(void *z, unsigned int len, DWORD flags);
+// CreateZip - call this to start the creation of a zip file.
+// As the zip is being created, it will be stored somewhere:
+// to a pipe: CreateZip(hpipe_write, 0,ZIP_HANDLE);
+// in a file (by handle): CreateZip(hfile, 0,ZIP_HANDLE);
+// in a file (by name): CreateZip("c:\\test.zip", 0,ZIP_FILENAME);
+// in memory: CreateZip(buf, len,ZIP_MEMORY);
+// or in pagefile memory: CreateZip(0, len,ZIP_MEMORY);
+// The final case stores it in memory backed by the system paging file,
+// where the zip may not exceed len bytes. This is a bit friendlier than
+// allocating memory with new[]: it won't lead to fragmentation, and the
+// memory won't be touched unless needed.
+// Note: because pipes don't allow random access, the structure of a zipfile
+// created into a pipe is slightly different from that created into a file
+// or memory. In particular, the compressed-size of the item cannot be
+// stored in the zipfile until after the item itself. (Also, for an item added
+// itself via a pipe, the uncompressed-size might not either be known until
+// after.) This is not normally a problem. But if you try to unzip via a pipe
+// as well, then the unzipper will not know these things about the item until
+// after it has been unzipped. Therefore: for unzippers which don't just write
+// each item to disk or to a pipe, but instead pre-allocate memory space into
+// which to unzip them, then either you have to create the zip not to a pipe,
+// or you have to add items not from a pipe, or at least when adding items
+// from a pipe you have to specify the length.
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// ZipAdd()
+//
+// Purpose: Add a file to a zip archive
+//
+// Parameters: hz - handle to an open zip archive
+// dstzn - name used inside the zip archive to identify the file
+// src - for a file (ZIP_FILENAME) this specifies the filename
+// to be added to the archive; for other uses, see below
+// len - for memory (ZIP_MEMORY) this specifies the buffer
+// length; for other uses, this should be 0
+// flags - indicates usage, see below; for files, this will be
+// ZIP_FILENAME
+//
+// Returns: ZRESULT - ZR_OK if success, otherwise some other value
+//
+ZRESULT ZipAdd(HZIP hz, const TCHAR *dstzn, void *src, unsigned int len, DWORD flags);
+// ZipAdd - call this for each file to be added to the zip.
+// dstzn is the name that the file will be stored as in the zip file.
+// The file to be added to the zip can come
+// from a pipe: ZipAdd(hz,"file.dat", hpipe_read,0,ZIP_HANDLE);
+// from a file: ZipAdd(hz,"file.dat", hfile,0,ZIP_HANDLE);
+// from a fname: ZipAdd(hz,"file.dat", "c:\\docs\\origfile.dat",0,ZIP_FILENAME);
+// from memory: ZipAdd(hz,"subdir\\file.dat", buf,len,ZIP_MEMORY);
+// (folder): ZipAdd(hz,"subdir", 0,0,ZIP_FOLDER);
+// Note: if adding an item from a pipe, and if also creating the zip file itself
+// to a pipe, then you might wish to pass a non-zero length to the ZipAdd
+// function. This will let the zipfile store the items size ahead of the
+// compressed item itself, which in turn makes it easier when unzipping the
+// zipfile into a pipe.
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// CloseZip()
+//
+// Purpose: Close an open zip archive
+//
+// Parameters: hz - handle to an open zip archive
+//
+// Returns: ZRESULT - ZR_OK if success, otherwise some other value
+//
+ZRESULT CloseZip(HZIP hz);
+// CloseZip - the zip handle must be closed with this function.
+
+
+ZRESULT ZipGetMemory(HZIP hz, void **buf, unsigned long *len);
+// ZipGetMemory - If the zip was created in memory, via ZipCreate(0,ZIP_MEMORY),
+// then this function will return information about that memory block.
+// buf will receive a pointer to its start, and len its length.
+// Note: you can't add any more after calling this.
+
+
+unsigned int FormatZipMessage(ZRESULT code, char *buf,unsigned int len);
+// FormatZipMessage - given an error code, formats it as a string.
+// It returns the length of the error message. If buf/len points
+// to a real buffer, then it also writes as much as possible into there.
+
+
+
+// These are the result codes:
+#define ZR_OK 0x00000000 // nb. the pseudo-code zr-recent is never returned,
+#define ZR_RECENT 0x00000001 // but can be passed to FormatZipMessage.
+// The following come from general system stuff (e.g. files not openable)
+#define ZR_GENMASK 0x0000FF00
+#define ZR_NODUPH 0x00000100 // couldn't duplicate the handle
+#define ZR_NOFILE 0x00000200 // couldn't create/open the file
+#define ZR_NOALLOC 0x00000300 // failed to allocate some resource
+#define ZR_WRITE 0x00000400 // a general error writing to the file
+#define ZR_NOTFOUND 0x00000500 // couldn't find that file in the zip
+#define ZR_MORE 0x00000600 // there's still more data to be unzipped
+#define ZR_CORRUPT 0x00000700 // the zipfile is corrupt or not a zipfile
+#define ZR_READ 0x00000800 // a general error reading the file
+// The following come from mistakes on the part of the caller
+#define ZR_CALLERMASK 0x00FF0000
+#define ZR_ARGS 0x00010000 // general mistake with the arguments
+#define ZR_NOTMMAP 0x00020000 // tried to ZipGetMemory, but that only works on mmap zipfiles, which yours wasn't
+#define ZR_MEMSIZE 0x00030000 // the memory size is too small
+#define ZR_FAILED 0x00040000 // the thing was already failed when you called this function
+#define ZR_ENDED 0x00050000 // the zip creation has already been closed
+#define ZR_MISSIZE 0x00060000 // the indicated input file size turned out mistaken
+#define ZR_PARTIALUNZ 0x00070000 // the file had already been partially unzipped
+#define ZR_ZMODE 0x00080000 // tried to mix creating/opening a zip
+// The following come from bugs within the zip library itself
+#define ZR_BUGMASK 0xFF000000
+#define ZR_NOTINITED 0x01000000 // initialisation didn't work
+#define ZR_SEEK 0x02000000 // trying to seek in an unseekable file
+#define ZR_NOCHANGE 0x04000000 // changed its mind on storage, but not allowed
+#define ZR_FLATE 0x05000000 // an internal error in the de/inflation code
+
+
+
+// e.g.
+//
+// (1) Traditional use, creating a zipfile from existing files
+// HZIP hz = CreateZip("c:\\temp.zip",0,ZIP_FILENAME);
+// ZipAdd(hz,"src1.txt", "c:\\src1.txt",0,ZIP_FILENAME);
+// ZipAdd(hz,"src2.bmp", "c:\\src2_origfn.bmp",0,ZIP_FILENAME);
+// CloseZip(hz);
+//
+// (2) Memory use, creating an auto-allocated mem-based zip file from various sources
+// HZIP hz = CreateZip(0,100000,ZIP_MEMORY);
+// // adding a conventional file...
+// ZipAdd(hz,"src1.txt", "c:\\src1.txt",0,ZIP_FILENAME);
+// // adding something from memory...
+// char buf[1000]; for (int i=0; i<1000; i++) buf[i]=(char)(i&0x7F);
+// ZipAdd(hz,"file.dat", buf,1000,ZIP_MEMORY);
+// // adding something from a pipe...
+// HANDLE hread,hwrite; CreatePipe(&hread,&write,NULL,0);
+// HANDLE hthread = CreateThread(ThreadFunc,(void*)hwrite);
+// ZipAdd(hz,"unz3.dat", hread,0,ZIP_HANDLE);
+// WaitForSingleObject(hthread,INFINITE);
+// CloseHandle(hthread); CloseHandle(hread);
+// ... meanwhile DWORD CALLBACK ThreadFunc(void *dat)
+// { HANDLE hwrite = (HANDLE)dat;
+// char buf[1000]={17};
+// DWORD writ; WriteFile(hwrite,buf,1000,&writ,NULL);
+// CloseHandle(hwrite);
+// return 0;
+// }
+// // and now that the zip is created, let's do something with it:
+// void *zbuf; unsigned long zlen; ZipGetMemory(hz,&zbuf,&zlen);
+// HANDLE hfz = CreateFile("test2.zip",GENERIC_WRITE,CREATE_ALWAYS);
+// DWORD writ; WriteFile(hfz,zbuf,zlen,&writ,NULL);
+// CloseHandle(hfz);
+// CloseZip(hz);
+//
+// (3) Handle use, for file handles and pipes
+// HANDLE hzread,hzwrite; CreatePipe(&hzread,&hzwrite);
+// HANDLE hthread = CreateThread(ZipReceiverThread,(void*)hread);
+// HZIP hz = ZipCreate(hzwrite,ZIP_HANDLE);
+// // ... add to it
+// CloseZip(hz);
+// CloseHandle(hzwrite);
+// WaitForSingleObject(hthread,INFINITE);
+// CloseHandle(hthread);
+// ... meanwhile DWORD CALLBACK ThreadFunc(void *dat)
+// { HANDLE hread = (HANDLE)dat;
+// char buf[1000];
+// while (true)
+// { DWORD red; ReadFile(hread,buf,1000,&red,NULL);
+// // ... and do something with this zip data we're receiving
+// if (red==0) break;
+// }
+// CloseHandle(hread);
+// return 0;
+// }
+//
+
+
+// Now we indulge in a little skullduggery so that the code works whether
+// the user has included just zip or both zip and unzip.
+// Idea: if header files for both zip and unzip are present, then presumably
+// the cpp files for zip and unzip are both present, so we will call
+// one or the other of them based on a dynamic choice. If the header file
+// for only one is present, then we will bind to that particular one.
+HZIP CreateZipZ(void *z,unsigned int len,DWORD flags);
+ZRESULT CloseZipZ(HZIP hz);
+unsigned int FormatZipMessageZ(ZRESULT code, char *buf,unsigned int len);
+bool IsZipHandleZ(HZIP hz);
+BOOL AddFolderContent(HZIP hZip, TCHAR* AbsolutePath, TCHAR* DirToAdd);
+
+#define CreateZip CreateZipZ
+
+#ifdef XUNZIP_H
+#undef CloseZip
+#define CloseZip(hz) (IsZipHandleZ(hz)?CloseZipZ(hz):CloseZipU(hz))
+#else
+#define CloseZip CloseZipZ
+#define FormatZipMessage FormatZipMessageZ
+#endif
+
+
+#endif //XZIP_H
diff --git a/src/Common/Xml.c b/src/Common/Xml.c
index d733dac1..6abbed6d 100644
--- a/src/Common/Xml.c
+++ b/src/Common/Xml.c
@@ -9,9 +9,13 @@
contained in the file License.txt included in VeraCrypt binary and source
code distribution packages.
*/
-
+#if !defined(_UEFI)
#include <windows.h>
#include <stdio.h>
+#else
+#include "Tcdefs.h"
+#pragma warning( disable : 4706 ) // assignment within conditional expression
+#endif
#include "Xml.h"
@@ -59,7 +63,7 @@ char *XmlFindElement (char *xmlNode, char *nodeName)
}
-char *XmlFindElementByAttributeValue (char *xml, char *nodeName, char *attrName, char *attrValue)
+char *XmlFindElementByAttributeValue (char *xml, char *nodeName, const char *attrName, const char *attrValue)
{
char attr[2048];
@@ -76,7 +80,7 @@ char *XmlFindElementByAttributeValue (char *xml, char *nodeName, char *attrName,
}
-char *XmlGetAttributeText (char *xmlNode, char *xmlAttrName, char *xmlAttrValue, int xmlAttrValueSize)
+char *XmlGetAttributeText (char *xmlNode, const char *xmlAttrName, char *xmlAttrValue, int xmlAttrValueSize)
{
char *t = xmlNode;
char *e = xmlNode;
@@ -105,7 +109,7 @@ char *XmlGetAttributeText (char *xmlNode, char *xmlAttrName, char *xmlAttrValue,
if (t == NULL || t > e) return NULL;
- t = strchr (t, '"') + 1;
+ t = ((char*)strchr (t, '"')) + 1;
e = strchr (t, '"');
l = (int)(e - t);
if (e == NULL || l > xmlAttrValueSize) return NULL;
@@ -128,9 +132,10 @@ char *XmlGetNodeText (char *xmlNode, char *xmlText, int xmlTextSize)
if (t[0] != '<')
return NULL;
- t = strchr (t, '>') + 1;
- if (t == (char *)1) return NULL;
+ t = (char*) strchr (t, '>');
+ if (t == NULL) return NULL;
+ t++;
e = strchr (e, '<');
if (e == NULL) return NULL;
@@ -255,7 +260,8 @@ wchar_t *XmlQuoteTextW (const wchar_t *textSrc, wchar_t *textDst, int textDstMax
return textDst;
}
-
+#if !defined(_UEFI)
+#pragma warning( default : 4706 )
int XmlWriteHeader (FILE *file)
{
return fputws (L"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<VeraCrypt>", file);
@@ -266,3 +272,4 @@ int XmlWriteFooter (FILE *file)
{
return fputws (L"\n</VeraCrypt>", file);
}
+#endif !defined(_UEFI)
diff --git a/src/Common/Xml.h b/src/Common/Xml.h
index 3dfb58e1..ceae2bf1 100644
--- a/src/Common/Xml.h
+++ b/src/Common/Xml.h
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -16,14 +16,17 @@ extern "C" {
char *XmlNextNode (char *xmlNode);
char *XmlFindElement (char *xmlNode, char *nodeName);
-char *XmlGetAttributeText (char *xmlNode, char *xmlAttrName, char *xmlAttrValue, int xmlAttrValueSize);
+char *XmlGetAttributeText (char *xmlNode, const char *xmlAttrName, char *xmlAttrValue, int xmlAttrValueSize);
char *XmlGetNodeText (char *xmlNode, char *xmlText, int xmlTextSize);
-int XmlWriteHeader (FILE *file);
-int XmlWriteFooter (FILE *file);
-char *XmlFindElementByAttributeValue (char *xml, char *nodeName, char *attrName, char *attrValue);
+char *XmlFindElementByAttributeValue (char *xml, char *nodeName, const char *attrName, const char *attrValue);
char *XmlQuoteText (const char *textSrc, char *textDst, int textDstMaxSize);
wchar_t *XmlQuoteTextW (const wchar_t *textSrc, wchar_t *textDst, int textDstMaxSize);
+#if !defined(_UEFI)
+int XmlWriteHeader (FILE *file);
+int XmlWriteFooter (FILE *file);
+#endif !defined(_UEFI)
+
#ifdef __cplusplus
}
#endif
diff --git a/src/Core/VolumeCreator.cpp b/src/Core/VolumeCreator.cpp
index 94aba4bc..403e0c67 100644
--- a/src/Core/VolumeCreator.cpp
+++ b/src/Core/VolumeCreator.cpp
@@ -151,9 +151,37 @@ namespace VeraCrypt
if (Options->Type == VolumeType::Normal)
{
- // Write random data to space reserved for hidden volume backup header
- Core->RandomizeEncryptionAlgorithmKey (Options->EA);
- Options->EA->Encrypt (backupHeader);
+ // Write fake random header to space reserved for hidden volume header
+ VolumeLayoutV2Hidden hiddenLayout;
+ shared_ptr <VolumeHeader> hiddenHeader (hiddenLayout.GetHeader());
+ SecureBuffer hiddenHeaderBuffer (hiddenLayout.GetHeaderSize());
+
+ VolumeHeaderCreationOptions headerOptions;
+ headerOptions.EA = Options->EA;
+ headerOptions.Kdf = Options->VolumeHeaderKdf;
+ headerOptions.Type = VolumeType::Hidden;
+
+ headerOptions.SectorSize = Options->SectorSize;
+
+ headerOptions.VolumeDataStart = HostSize - hiddenLayout.GetHeaderSize() * 2 - Options->Size;
+ headerOptions.VolumeDataSize = hiddenLayout.GetMaxDataSize (Options->Size);
+
+ // Master data key
+ SecureBuffer hiddenMasterKey(Options->EA->GetKeySize() * 2);
+ RandomNumberGenerator::GetData (hiddenMasterKey);
+ headerOptions.DataKey = hiddenMasterKey;
+
+ // PKCS5 salt
+ SecureBuffer hiddenSalt (VolumeHeader::GetSaltSize());
+ RandomNumberGenerator::GetData (hiddenSalt);
+ headerOptions.Salt = hiddenSalt;
+
+ // Header key
+ SecureBuffer hiddenHeaderKey (VolumeHeader::GetLargestSerializedKeySize());
+ RandomNumberGenerator::GetData (hiddenHeaderKey);
+ headerOptions.HeaderKey = hiddenHeaderKey;
+
+ hiddenHeader->Create (backupHeader, headerOptions);
VolumeFile->Write (backupHeader);
}
@@ -295,9 +323,32 @@ namespace VeraCrypt
if (options->Type == VolumeType::Normal)
{
- // Write random data to space reserved for hidden volume header
- Core->RandomizeEncryptionAlgorithmKey (options->EA);
- options->EA->Encrypt (headerBuffer);
+ // Write fake random header to space reserved for hidden volume header
+ VolumeLayoutV2Hidden hiddenLayout;
+ shared_ptr <VolumeHeader> hiddenHeader (hiddenLayout.GetHeader());
+ SecureBuffer hiddenHeaderBuffer (hiddenLayout.GetHeaderSize());
+
+ headerOptions.Type = VolumeType::Hidden;
+
+ headerOptions.VolumeDataStart = HostSize - hiddenLayout.GetHeaderSize() * 2 - options->Size;
+ headerOptions.VolumeDataSize = hiddenLayout.GetMaxDataSize (options->Size);
+
+ // Master data key
+ SecureBuffer hiddenMasterKey(options->EA->GetKeySize() * 2);
+ RandomNumberGenerator::GetData (hiddenMasterKey);
+ headerOptions.DataKey = hiddenMasterKey;
+
+ // PKCS5 salt
+ SecureBuffer hiddenSalt (VolumeHeader::GetSaltSize());
+ RandomNumberGenerator::GetData (hiddenSalt);
+ headerOptions.Salt = hiddenSalt;
+
+ // Header key
+ SecureBuffer hiddenHeaderKey (VolumeHeader::GetLargestSerializedKeySize());
+ RandomNumberGenerator::GetData (hiddenHeaderKey);
+ headerOptions.HeaderKey = hiddenHeaderKey;
+
+ hiddenHeader->Create (headerBuffer, headerOptions);
VolumeFile->Write (headerBuffer);
}
diff --git a/src/Crypto/Aes_hw_cpu.asm b/src/Crypto/Aes_hw_cpu.asm
index faaba4f3..edc20b29 100644
--- a/src/Crypto/Aes_hw_cpu.asm
+++ b/src/Crypto/Aes_hw_cpu.asm
@@ -286,17 +286,20 @@
; byte is_aes_hw_cpu_supported ();
- export_function is_aes_hw_cpu_supported
- push %[R]bx
-
- mov eax, 1
- cpuid
- mov eax, ecx
- shr eax, 25
- and eax, 1
-
- pop %[R]bx
- ret
+; We comment this since we have an alternative C implementation
+; that supports Hyper-V detection workaround
+;
+; export_function is_aes_hw_cpu_supported
+; push %[R]bx
+;
+; mov eax, 1
+; cpuid
+; mov eax, ecx
+; shr eax, 25
+; and eax, 1
+;
+; pop %[R]bx
+; ret
; void aes_hw_cpu_decrypt (const byte *ks, byte *data);
diff --git a/src/Crypto/Camellia.c b/src/Crypto/Camellia.c
new file mode 100644
index 00000000..33cf818c
--- /dev/null
+++ b/src/Crypto/Camellia.c
@@ -0,0 +1,723 @@
+/*
+This code is written by kerukuro for cppcrypto library (http://cppcrypto.sourceforge.net/)
+and released into public domain.
+*/
+
+/* Adapted for VeraCrypt */
+
+
+#include "Camellia.h"
+#include "Common/Endian.h"
+#include "Crypto/misc.h"
+
+
+
+//#define CPPCRYPTO_DEBUG
+
+ static const uint64 S[8][256] = {
+ {
+ 0x7070700070000070, 0x8282820082000082, 0x2c2c2c002c00002c, 0xececec00ec0000ec, 0xb3b3b300b30000b3, 0x2727270027000027, 0xc0c0c000c00000c0, 0xe5e5e500e50000e5,
+ 0xe4e4e400e40000e4, 0x8585850085000085, 0x5757570057000057, 0x3535350035000035, 0xeaeaea00ea0000ea, 0x0c0c0c000c00000c, 0xaeaeae00ae0000ae, 0x4141410041000041,
+ 0x2323230023000023, 0xefefef00ef0000ef, 0x6b6b6b006b00006b, 0x9393930093000093, 0x4545450045000045, 0x1919190019000019, 0xa5a5a500a50000a5, 0x2121210021000021,
+ 0xededed00ed0000ed, 0x0e0e0e000e00000e, 0x4f4f4f004f00004f, 0x4e4e4e004e00004e, 0x1d1d1d001d00001d, 0x6565650065000065, 0x9292920092000092, 0xbdbdbd00bd0000bd,
+ 0x8686860086000086, 0xb8b8b800b80000b8, 0xafafaf00af0000af, 0x8f8f8f008f00008f, 0x7c7c7c007c00007c, 0xebebeb00eb0000eb, 0x1f1f1f001f00001f, 0xcecece00ce0000ce,
+ 0x3e3e3e003e00003e, 0x3030300030000030, 0xdcdcdc00dc0000dc, 0x5f5f5f005f00005f, 0x5e5e5e005e00005e, 0xc5c5c500c50000c5, 0x0b0b0b000b00000b, 0x1a1a1a001a00001a,
+ 0xa6a6a600a60000a6, 0xe1e1e100e10000e1, 0x3939390039000039, 0xcacaca00ca0000ca, 0xd5d5d500d50000d5, 0x4747470047000047, 0x5d5d5d005d00005d, 0x3d3d3d003d00003d,
+ 0xd9d9d900d90000d9, 0x0101010001000001, 0x5a5a5a005a00005a, 0xd6d6d600d60000d6, 0x5151510051000051, 0x5656560056000056, 0x6c6c6c006c00006c, 0x4d4d4d004d00004d,
+ 0x8b8b8b008b00008b, 0x0d0d0d000d00000d, 0x9a9a9a009a00009a, 0x6666660066000066, 0xfbfbfb00fb0000fb, 0xcccccc00cc0000cc, 0xb0b0b000b00000b0, 0x2d2d2d002d00002d,
+ 0x7474740074000074, 0x1212120012000012, 0x2b2b2b002b00002b, 0x2020200020000020, 0xf0f0f000f00000f0, 0xb1b1b100b10000b1, 0x8484840084000084, 0x9999990099000099,
+ 0xdfdfdf00df0000df, 0x4c4c4c004c00004c, 0xcbcbcb00cb0000cb, 0xc2c2c200c20000c2, 0x3434340034000034, 0x7e7e7e007e00007e, 0x7676760076000076, 0x0505050005000005,
+ 0x6d6d6d006d00006d, 0xb7b7b700b70000b7, 0xa9a9a900a90000a9, 0x3131310031000031, 0xd1d1d100d10000d1, 0x1717170017000017, 0x0404040004000004, 0xd7d7d700d70000d7,
+ 0x1414140014000014, 0x5858580058000058, 0x3a3a3a003a00003a, 0x6161610061000061, 0xdedede00de0000de, 0x1b1b1b001b00001b, 0x1111110011000011, 0x1c1c1c001c00001c,
+ 0x3232320032000032, 0x0f0f0f000f00000f, 0x9c9c9c009c00009c, 0x1616160016000016, 0x5353530053000053, 0x1818180018000018, 0xf2f2f200f20000f2, 0x2222220022000022,
+ 0xfefefe00fe0000fe, 0x4444440044000044, 0xcfcfcf00cf0000cf, 0xb2b2b200b20000b2, 0xc3c3c300c30000c3, 0xb5b5b500b50000b5, 0x7a7a7a007a00007a, 0x9191910091000091,
+ 0x2424240024000024, 0x0808080008000008, 0xe8e8e800e80000e8, 0xa8a8a800a80000a8, 0x6060600060000060, 0xfcfcfc00fc0000fc, 0x6969690069000069, 0x5050500050000050,
+ 0xaaaaaa00aa0000aa, 0xd0d0d000d00000d0, 0xa0a0a000a00000a0, 0x7d7d7d007d00007d, 0xa1a1a100a10000a1, 0x8989890089000089, 0x6262620062000062, 0x9797970097000097,
+ 0x5454540054000054, 0x5b5b5b005b00005b, 0x1e1e1e001e00001e, 0x9595950095000095, 0xe0e0e000e00000e0, 0xffffff00ff0000ff, 0x6464640064000064, 0xd2d2d200d20000d2,
+ 0x1010100010000010, 0xc4c4c400c40000c4, 0x0000000000000000, 0x4848480048000048, 0xa3a3a300a30000a3, 0xf7f7f700f70000f7, 0x7575750075000075, 0xdbdbdb00db0000db,
+ 0x8a8a8a008a00008a, 0x0303030003000003, 0xe6e6e600e60000e6, 0xdadada00da0000da, 0x0909090009000009, 0x3f3f3f003f00003f, 0xdddddd00dd0000dd, 0x9494940094000094,
+ 0x8787870087000087, 0x5c5c5c005c00005c, 0x8383830083000083, 0x0202020002000002, 0xcdcdcd00cd0000cd, 0x4a4a4a004a00004a, 0x9090900090000090, 0x3333330033000033,
+ 0x7373730073000073, 0x6767670067000067, 0xf6f6f600f60000f6, 0xf3f3f300f30000f3, 0x9d9d9d009d00009d, 0x7f7f7f007f00007f, 0xbfbfbf00bf0000bf, 0xe2e2e200e20000e2,
+ 0x5252520052000052, 0x9b9b9b009b00009b, 0xd8d8d800d80000d8, 0x2626260026000026, 0xc8c8c800c80000c8, 0x3737370037000037, 0xc6c6c600c60000c6, 0x3b3b3b003b00003b,
+ 0x8181810081000081, 0x9696960096000096, 0x6f6f6f006f00006f, 0x4b4b4b004b00004b, 0x1313130013000013, 0xbebebe00be0000be, 0x6363630063000063, 0x2e2e2e002e00002e,
+ 0xe9e9e900e90000e9, 0x7979790079000079, 0xa7a7a700a70000a7, 0x8c8c8c008c00008c, 0x9f9f9f009f00009f, 0x6e6e6e006e00006e, 0xbcbcbc00bc0000bc, 0x8e8e8e008e00008e,
+ 0x2929290029000029, 0xf5f5f500f50000f5, 0xf9f9f900f90000f9, 0xb6b6b600b60000b6, 0x2f2f2f002f00002f, 0xfdfdfd00fd0000fd, 0xb4b4b400b40000b4, 0x5959590059000059,
+ 0x7878780078000078, 0x9898980098000098, 0x0606060006000006, 0x6a6a6a006a00006a, 0xe7e7e700e70000e7, 0x4646460046000046, 0x7171710071000071, 0xbababa00ba0000ba,
+ 0xd4d4d400d40000d4, 0x2525250025000025, 0xababab00ab0000ab, 0x4242420042000042, 0x8888880088000088, 0xa2a2a200a20000a2, 0x8d8d8d008d00008d, 0xfafafa00fa0000fa,
+ 0x7272720072000072, 0x0707070007000007, 0xb9b9b900b90000b9, 0x5555550055000055, 0xf8f8f800f80000f8, 0xeeeeee00ee0000ee, 0xacacac00ac0000ac, 0x0a0a0a000a00000a,
+ 0x3636360036000036, 0x4949490049000049, 0x2a2a2a002a00002a, 0x6868680068000068, 0x3c3c3c003c00003c, 0x3838380038000038, 0xf1f1f100f10000f1, 0xa4a4a400a40000a4,
+ 0x4040400040000040, 0x2828280028000028, 0xd3d3d300d30000d3, 0x7b7b7b007b00007b, 0xbbbbbb00bb0000bb, 0xc9c9c900c90000c9, 0x4343430043000043, 0xc1c1c100c10000c1,
+ 0x1515150015000015, 0xe3e3e300e30000e3, 0xadadad00ad0000ad, 0xf4f4f400f40000f4, 0x7777770077000077, 0xc7c7c700c70000c7, 0x8080800080000080, 0x9e9e9e009e00009e
+ },
+ {
+ 0x00e0e0e0e0e00000, 0x0005050505050000, 0x0058585858580000, 0x00d9d9d9d9d90000, 0x0067676767670000, 0x004e4e4e4e4e0000, 0x0081818181810000, 0x00cbcbcbcbcb0000,
+ 0x00c9c9c9c9c90000, 0x000b0b0b0b0b0000, 0x00aeaeaeaeae0000, 0x006a6a6a6a6a0000, 0x00d5d5d5d5d50000, 0x0018181818180000, 0x005d5d5d5d5d0000, 0x0082828282820000,
+ 0x0046464646460000, 0x00dfdfdfdfdf0000, 0x00d6d6d6d6d60000, 0x0027272727270000, 0x008a8a8a8a8a0000, 0x0032323232320000, 0x004b4b4b4b4b0000, 0x0042424242420000,
+ 0x00dbdbdbdbdb0000, 0x001c1c1c1c1c0000, 0x009e9e9e9e9e0000, 0x009c9c9c9c9c0000, 0x003a3a3a3a3a0000, 0x00cacacacaca0000, 0x0025252525250000, 0x007b7b7b7b7b0000,
+ 0x000d0d0d0d0d0000, 0x0071717171710000, 0x005f5f5f5f5f0000, 0x001f1f1f1f1f0000, 0x00f8f8f8f8f80000, 0x00d7d7d7d7d70000, 0x003e3e3e3e3e0000, 0x009d9d9d9d9d0000,
+ 0x007c7c7c7c7c0000, 0x0060606060600000, 0x00b9b9b9b9b90000, 0x00bebebebebe0000, 0x00bcbcbcbcbc0000, 0x008b8b8b8b8b0000, 0x0016161616160000, 0x0034343434340000,
+ 0x004d4d4d4d4d0000, 0x00c3c3c3c3c30000, 0x0072727272720000, 0x0095959595950000, 0x00ababababab0000, 0x008e8e8e8e8e0000, 0x00bababababa0000, 0x007a7a7a7a7a0000,
+ 0x00b3b3b3b3b30000, 0x0002020202020000, 0x00b4b4b4b4b40000, 0x00adadadadad0000, 0x00a2a2a2a2a20000, 0x00acacacacac0000, 0x00d8d8d8d8d80000, 0x009a9a9a9a9a0000,
+ 0x0017171717170000, 0x001a1a1a1a1a0000, 0x0035353535350000, 0x00cccccccccc0000, 0x00f7f7f7f7f70000, 0x0099999999990000, 0x0061616161610000, 0x005a5a5a5a5a0000,
+ 0x00e8e8e8e8e80000, 0x0024242424240000, 0x0056565656560000, 0x0040404040400000, 0x00e1e1e1e1e10000, 0x0063636363630000, 0x0009090909090000, 0x0033333333330000,
+ 0x00bfbfbfbfbf0000, 0x0098989898980000, 0x0097979797970000, 0x0085858585850000, 0x0068686868680000, 0x00fcfcfcfcfc0000, 0x00ececececec0000, 0x000a0a0a0a0a0000,
+ 0x00dadadadada0000, 0x006f6f6f6f6f0000, 0x0053535353530000, 0x0062626262620000, 0x00a3a3a3a3a30000, 0x002e2e2e2e2e0000, 0x0008080808080000, 0x00afafafafaf0000,
+ 0x0028282828280000, 0x00b0b0b0b0b00000, 0x0074747474740000, 0x00c2c2c2c2c20000, 0x00bdbdbdbdbd0000, 0x0036363636360000, 0x0022222222220000, 0x0038383838380000,
+ 0x0064646464640000, 0x001e1e1e1e1e0000, 0x0039393939390000, 0x002c2c2c2c2c0000, 0x00a6a6a6a6a60000, 0x0030303030300000, 0x00e5e5e5e5e50000, 0x0044444444440000,
+ 0x00fdfdfdfdfd0000, 0x0088888888880000, 0x009f9f9f9f9f0000, 0x0065656565650000, 0x0087878787870000, 0x006b6b6b6b6b0000, 0x00f4f4f4f4f40000, 0x0023232323230000,
+ 0x0048484848480000, 0x0010101010100000, 0x00d1d1d1d1d10000, 0x0051515151510000, 0x00c0c0c0c0c00000, 0x00f9f9f9f9f90000, 0x00d2d2d2d2d20000, 0x00a0a0a0a0a00000,
+ 0x0055555555550000, 0x00a1a1a1a1a10000, 0x0041414141410000, 0x00fafafafafa0000, 0x0043434343430000, 0x0013131313130000, 0x00c4c4c4c4c40000, 0x002f2f2f2f2f0000,
+ 0x00a8a8a8a8a80000, 0x00b6b6b6b6b60000, 0x003c3c3c3c3c0000, 0x002b2b2b2b2b0000, 0x00c1c1c1c1c10000, 0x00ffffffffff0000, 0x00c8c8c8c8c80000, 0x00a5a5a5a5a50000,
+ 0x0020202020200000, 0x0089898989890000, 0x0000000000000000, 0x0090909090900000, 0x0047474747470000, 0x00efefefefef0000, 0x00eaeaeaeaea0000, 0x00b7b7b7b7b70000,
+ 0x0015151515150000, 0x0006060606060000, 0x00cdcdcdcdcd0000, 0x00b5b5b5b5b50000, 0x0012121212120000, 0x007e7e7e7e7e0000, 0x00bbbbbbbbbb0000, 0x0029292929290000,
+ 0x000f0f0f0f0f0000, 0x00b8b8b8b8b80000, 0x0007070707070000, 0x0004040404040000, 0x009b9b9b9b9b0000, 0x0094949494940000, 0x0021212121210000, 0x0066666666660000,
+ 0x00e6e6e6e6e60000, 0x00cecececece0000, 0x00ededededed0000, 0x00e7e7e7e7e70000, 0x003b3b3b3b3b0000, 0x00fefefefefe0000, 0x007f7f7f7f7f0000, 0x00c5c5c5c5c50000,
+ 0x00a4a4a4a4a40000, 0x0037373737370000, 0x00b1b1b1b1b10000, 0x004c4c4c4c4c0000, 0x0091919191910000, 0x006e6e6e6e6e0000, 0x008d8d8d8d8d0000, 0x0076767676760000,
+ 0x0003030303030000, 0x002d2d2d2d2d0000, 0x00dedededede0000, 0x0096969696960000, 0x0026262626260000, 0x007d7d7d7d7d0000, 0x00c6c6c6c6c60000, 0x005c5c5c5c5c0000,
+ 0x00d3d3d3d3d30000, 0x00f2f2f2f2f20000, 0x004f4f4f4f4f0000, 0x0019191919190000, 0x003f3f3f3f3f0000, 0x00dcdcdcdcdc0000, 0x0079797979790000, 0x001d1d1d1d1d0000,
+ 0x0052525252520000, 0x00ebebebebeb0000, 0x00f3f3f3f3f30000, 0x006d6d6d6d6d0000, 0x005e5e5e5e5e0000, 0x00fbfbfbfbfb0000, 0x0069696969690000, 0x00b2b2b2b2b20000,
+ 0x00f0f0f0f0f00000, 0x0031313131310000, 0x000c0c0c0c0c0000, 0x00d4d4d4d4d40000, 0x00cfcfcfcfcf0000, 0x008c8c8c8c8c0000, 0x00e2e2e2e2e20000, 0x0075757575750000,
+ 0x00a9a9a9a9a90000, 0x004a4a4a4a4a0000, 0x0057575757570000, 0x0084848484840000, 0x0011111111110000, 0x0045454545450000, 0x001b1b1b1b1b0000, 0x00f5f5f5f5f50000,
+ 0x00e4e4e4e4e40000, 0x000e0e0e0e0e0000, 0x0073737373730000, 0x00aaaaaaaaaa0000, 0x00f1f1f1f1f10000, 0x00dddddddddd0000, 0x0059595959590000, 0x0014141414140000,
+ 0x006c6c6c6c6c0000, 0x0092929292920000, 0x0054545454540000, 0x00d0d0d0d0d00000, 0x0078787878780000, 0x0070707070700000, 0x00e3e3e3e3e30000, 0x0049494949490000,
+ 0x0080808080800000, 0x0050505050500000, 0x00a7a7a7a7a70000, 0x00f6f6f6f6f60000, 0x0077777777770000, 0x0093939393930000, 0x0086868686860000, 0x0083838383830000,
+ 0x002a2a2a2a2a0000, 0x00c7c7c7c7c70000, 0x005b5b5b5b5b0000, 0x00e9e9e9e9e90000, 0x00eeeeeeeeee0000, 0x008f8f8f8f8f0000, 0x0001010101010000, 0x003d3d3d3d3d0000
+ },
+ {
+ 0x3800383800383800, 0x4100414100414100, 0x1600161600161600, 0x7600767600767600, 0xd900d9d900d9d900, 0x9300939300939300, 0x6000606000606000, 0xf200f2f200f2f200,
+ 0x7200727200727200, 0xc200c2c200c2c200, 0xab00abab00abab00, 0x9a009a9a009a9a00, 0x7500757500757500, 0x0600060600060600, 0x5700575700575700, 0xa000a0a000a0a000,
+ 0x9100919100919100, 0xf700f7f700f7f700, 0xb500b5b500b5b500, 0xc900c9c900c9c900, 0xa200a2a200a2a200, 0x8c008c8c008c8c00, 0xd200d2d200d2d200, 0x9000909000909000,
+ 0xf600f6f600f6f600, 0x0700070700070700, 0xa700a7a700a7a700, 0x2700272700272700, 0x8e008e8e008e8e00, 0xb200b2b200b2b200, 0x4900494900494900, 0xde00dede00dede00,
+ 0x4300434300434300, 0x5c005c5c005c5c00, 0xd700d7d700d7d700, 0xc700c7c700c7c700, 0x3e003e3e003e3e00, 0xf500f5f500f5f500, 0x8f008f8f008f8f00, 0x6700676700676700,
+ 0x1f001f1f001f1f00, 0x1800181800181800, 0x6e006e6e006e6e00, 0xaf00afaf00afaf00, 0x2f002f2f002f2f00, 0xe200e2e200e2e200, 0x8500858500858500, 0x0d000d0d000d0d00,
+ 0x5300535300535300, 0xf000f0f000f0f000, 0x9c009c9c009c9c00, 0x6500656500656500, 0xea00eaea00eaea00, 0xa300a3a300a3a300, 0xae00aeae00aeae00, 0x9e009e9e009e9e00,
+ 0xec00ecec00ecec00, 0x8000808000808000, 0x2d002d2d002d2d00, 0x6b006b6b006b6b00, 0xa800a8a800a8a800, 0x2b002b2b002b2b00, 0x3600363600363600, 0xa600a6a600a6a600,
+ 0xc500c5c500c5c500, 0x8600868600868600, 0x4d004d4d004d4d00, 0x3300333300333300, 0xfd00fdfd00fdfd00, 0x6600666600666600, 0x5800585800585800, 0x9600969600969600,
+ 0x3a003a3a003a3a00, 0x0900090900090900, 0x9500959500959500, 0x1000101000101000, 0x7800787800787800, 0xd800d8d800d8d800, 0x4200424200424200, 0xcc00cccc00cccc00,
+ 0xef00efef00efef00, 0x2600262600262600, 0xe500e5e500e5e500, 0x6100616100616100, 0x1a001a1a001a1a00, 0x3f003f3f003f3f00, 0x3b003b3b003b3b00, 0x8200828200828200,
+ 0xb600b6b600b6b600, 0xdb00dbdb00dbdb00, 0xd400d4d400d4d400, 0x9800989800989800, 0xe800e8e800e8e800, 0x8b008b8b008b8b00, 0x0200020200020200, 0xeb00ebeb00ebeb00,
+ 0x0a000a0a000a0a00, 0x2c002c2c002c2c00, 0x1d001d1d001d1d00, 0xb000b0b000b0b000, 0x6f006f6f006f6f00, 0x8d008d8d008d8d00, 0x8800888800888800, 0x0e000e0e000e0e00,
+ 0x1900191900191900, 0x8700878700878700, 0x4e004e4e004e4e00, 0x0b000b0b000b0b00, 0xa900a9a900a9a900, 0x0c000c0c000c0c00, 0x7900797900797900, 0x1100111100111100,
+ 0x7f007f7f007f7f00, 0x2200222200222200, 0xe700e7e700e7e700, 0x5900595900595900, 0xe100e1e100e1e100, 0xda00dada00dada00, 0x3d003d3d003d3d00, 0xc800c8c800c8c800,
+ 0x1200121200121200, 0x0400040400040400, 0x7400747400747400, 0x5400545400545400, 0x3000303000303000, 0x7e007e7e007e7e00, 0xb400b4b400b4b400, 0x2800282800282800,
+ 0x5500555500555500, 0x6800686800686800, 0x5000505000505000, 0xbe00bebe00bebe00, 0xd000d0d000d0d000, 0xc400c4c400c4c400, 0x3100313100313100, 0xcb00cbcb00cbcb00,
+ 0x2a002a2a002a2a00, 0xad00adad00adad00, 0x0f000f0f000f0f00, 0xca00caca00caca00, 0x7000707000707000, 0xff00ffff00ffff00, 0x3200323200323200, 0x6900696900696900,
+ 0x0800080800080800, 0x6200626200626200, 0x0000000000000000, 0x2400242400242400, 0xd100d1d100d1d100, 0xfb00fbfb00fbfb00, 0xba00baba00baba00, 0xed00eded00eded00,
+ 0x4500454500454500, 0x8100818100818100, 0x7300737300737300, 0x6d006d6d006d6d00, 0x8400848400848400, 0x9f009f9f009f9f00, 0xee00eeee00eeee00, 0x4a004a4a004a4a00,
+ 0xc300c3c300c3c300, 0x2e002e2e002e2e00, 0xc100c1c100c1c100, 0x0100010100010100, 0xe600e6e600e6e600, 0x2500252500252500, 0x4800484800484800, 0x9900999900999900,
+ 0xb900b9b900b9b900, 0xb300b3b300b3b300, 0x7b007b7b007b7b00, 0xf900f9f900f9f900, 0xce00cece00cece00, 0xbf00bfbf00bfbf00, 0xdf00dfdf00dfdf00, 0x7100717100717100,
+ 0x2900292900292900, 0xcd00cdcd00cdcd00, 0x6c006c6c006c6c00, 0x1300131300131300, 0x6400646400646400, 0x9b009b9b009b9b00, 0x6300636300636300, 0x9d009d9d009d9d00,
+ 0xc000c0c000c0c000, 0x4b004b4b004b4b00, 0xb700b7b700b7b700, 0xa500a5a500a5a500, 0x8900898900898900, 0x5f005f5f005f5f00, 0xb100b1b100b1b100, 0x1700171700171700,
+ 0xf400f4f400f4f400, 0xbc00bcbc00bcbc00, 0xd300d3d300d3d300, 0x4600464600464600, 0xcf00cfcf00cfcf00, 0x3700373700373700, 0x5e005e5e005e5e00, 0x4700474700474700,
+ 0x9400949400949400, 0xfa00fafa00fafa00, 0xfc00fcfc00fcfc00, 0x5b005b5b005b5b00, 0x9700979700979700, 0xfe00fefe00fefe00, 0x5a005a5a005a5a00, 0xac00acac00acac00,
+ 0x3c003c3c003c3c00, 0x4c004c4c004c4c00, 0x0300030300030300, 0x3500353500353500, 0xf300f3f300f3f300, 0x2300232300232300, 0xb800b8b800b8b800, 0x5d005d5d005d5d00,
+ 0x6a006a6a006a6a00, 0x9200929200929200, 0xd500d5d500d5d500, 0x2100212100212100, 0x4400444400444400, 0x5100515100515100, 0xc600c6c600c6c600, 0x7d007d7d007d7d00,
+ 0x3900393900393900, 0x8300838300838300, 0xdc00dcdc00dcdc00, 0xaa00aaaa00aaaa00, 0x7c007c7c007c7c00, 0x7700777700777700, 0x5600565600565600, 0x0500050500050500,
+ 0x1b001b1b001b1b00, 0xa400a4a400a4a400, 0x1500151500151500, 0x3400343400343400, 0x1e001e1e001e1e00, 0x1c001c1c001c1c00, 0xf800f8f800f8f800, 0x5200525200525200,
+ 0x2000202000202000, 0x1400141400141400, 0xe900e9e900e9e900, 0xbd00bdbd00bdbd00, 0xdd00dddd00dddd00, 0xe400e4e400e4e400, 0xa100a1a100a1a100, 0xe000e0e000e0e000,
+ 0x8a008a8a008a8a00, 0xf100f1f100f1f100, 0xd600d6d600d6d600, 0x7a007a7a007a7a00, 0xbb00bbbb00bbbb00, 0xe300e3e300e3e300, 0x4000404000404000, 0x4f004f4f004f4f00
+ },
+ {
+ 0x7070007000007070, 0x2c2c002c00002c2c, 0xb3b300b30000b3b3, 0xc0c000c00000c0c0, 0xe4e400e40000e4e4, 0x5757005700005757, 0xeaea00ea0000eaea, 0xaeae00ae0000aeae,
+ 0x2323002300002323, 0x6b6b006b00006b6b, 0x4545004500004545, 0xa5a500a50000a5a5, 0xeded00ed0000eded, 0x4f4f004f00004f4f, 0x1d1d001d00001d1d, 0x9292009200009292,
+ 0x8686008600008686, 0xafaf00af0000afaf, 0x7c7c007c00007c7c, 0x1f1f001f00001f1f, 0x3e3e003e00003e3e, 0xdcdc00dc0000dcdc, 0x5e5e005e00005e5e, 0x0b0b000b00000b0b,
+ 0xa6a600a60000a6a6, 0x3939003900003939, 0xd5d500d50000d5d5, 0x5d5d005d00005d5d, 0xd9d900d90000d9d9, 0x5a5a005a00005a5a, 0x5151005100005151, 0x6c6c006c00006c6c,
+ 0x8b8b008b00008b8b, 0x9a9a009a00009a9a, 0xfbfb00fb0000fbfb, 0xb0b000b00000b0b0, 0x7474007400007474, 0x2b2b002b00002b2b, 0xf0f000f00000f0f0, 0x8484008400008484,
+ 0xdfdf00df0000dfdf, 0xcbcb00cb0000cbcb, 0x3434003400003434, 0x7676007600007676, 0x6d6d006d00006d6d, 0xa9a900a90000a9a9, 0xd1d100d10000d1d1, 0x0404000400000404,
+ 0x1414001400001414, 0x3a3a003a00003a3a, 0xdede00de0000dede, 0x1111001100001111, 0x3232003200003232, 0x9c9c009c00009c9c, 0x5353005300005353, 0xf2f200f20000f2f2,
+ 0xfefe00fe0000fefe, 0xcfcf00cf0000cfcf, 0xc3c300c30000c3c3, 0x7a7a007a00007a7a, 0x2424002400002424, 0xe8e800e80000e8e8, 0x6060006000006060, 0x6969006900006969,
+ 0xaaaa00aa0000aaaa, 0xa0a000a00000a0a0, 0xa1a100a10000a1a1, 0x6262006200006262, 0x5454005400005454, 0x1e1e001e00001e1e, 0xe0e000e00000e0e0, 0x6464006400006464,
+ 0x1010001000001010, 0x0000000000000000, 0xa3a300a30000a3a3, 0x7575007500007575, 0x8a8a008a00008a8a, 0xe6e600e60000e6e6, 0x0909000900000909, 0xdddd00dd0000dddd,
+ 0x8787008700008787, 0x8383008300008383, 0xcdcd00cd0000cdcd, 0x9090009000009090, 0x7373007300007373, 0xf6f600f60000f6f6, 0x9d9d009d00009d9d, 0xbfbf00bf0000bfbf,
+ 0x5252005200005252, 0xd8d800d80000d8d8, 0xc8c800c80000c8c8, 0xc6c600c60000c6c6, 0x8181008100008181, 0x6f6f006f00006f6f, 0x1313001300001313, 0x6363006300006363,
+ 0xe9e900e90000e9e9, 0xa7a700a70000a7a7, 0x9f9f009f00009f9f, 0xbcbc00bc0000bcbc, 0x2929002900002929, 0xf9f900f90000f9f9, 0x2f2f002f00002f2f, 0xb4b400b40000b4b4,
+ 0x7878007800007878, 0x0606000600000606, 0xe7e700e70000e7e7, 0x7171007100007171, 0xd4d400d40000d4d4, 0xabab00ab0000abab, 0x8888008800008888, 0x8d8d008d00008d8d,
+ 0x7272007200007272, 0xb9b900b90000b9b9, 0xf8f800f80000f8f8, 0xacac00ac0000acac, 0x3636003600003636, 0x2a2a002a00002a2a, 0x3c3c003c00003c3c, 0xf1f100f10000f1f1,
+ 0x4040004000004040, 0xd3d300d30000d3d3, 0xbbbb00bb0000bbbb, 0x4343004300004343, 0x1515001500001515, 0xadad00ad0000adad, 0x7777007700007777, 0x8080008000008080,
+ 0x8282008200008282, 0xecec00ec0000ecec, 0x2727002700002727, 0xe5e500e50000e5e5, 0x8585008500008585, 0x3535003500003535, 0x0c0c000c00000c0c, 0x4141004100004141,
+ 0xefef00ef0000efef, 0x9393009300009393, 0x1919001900001919, 0x2121002100002121, 0x0e0e000e00000e0e, 0x4e4e004e00004e4e, 0x6565006500006565, 0xbdbd00bd0000bdbd,
+ 0xb8b800b80000b8b8, 0x8f8f008f00008f8f, 0xebeb00eb0000ebeb, 0xcece00ce0000cece, 0x3030003000003030, 0x5f5f005f00005f5f, 0xc5c500c50000c5c5, 0x1a1a001a00001a1a,
+ 0xe1e100e10000e1e1, 0xcaca00ca0000caca, 0x4747004700004747, 0x3d3d003d00003d3d, 0x0101000100000101, 0xd6d600d60000d6d6, 0x5656005600005656, 0x4d4d004d00004d4d,
+ 0x0d0d000d00000d0d, 0x6666006600006666, 0xcccc00cc0000cccc, 0x2d2d002d00002d2d, 0x1212001200001212, 0x2020002000002020, 0xb1b100b10000b1b1, 0x9999009900009999,
+ 0x4c4c004c00004c4c, 0xc2c200c20000c2c2, 0x7e7e007e00007e7e, 0x0505000500000505, 0xb7b700b70000b7b7, 0x3131003100003131, 0x1717001700001717, 0xd7d700d70000d7d7,
+ 0x5858005800005858, 0x6161006100006161, 0x1b1b001b00001b1b, 0x1c1c001c00001c1c, 0x0f0f000f00000f0f, 0x1616001600001616, 0x1818001800001818, 0x2222002200002222,
+ 0x4444004400004444, 0xb2b200b20000b2b2, 0xb5b500b50000b5b5, 0x9191009100009191, 0x0808000800000808, 0xa8a800a80000a8a8, 0xfcfc00fc0000fcfc, 0x5050005000005050,
+ 0xd0d000d00000d0d0, 0x7d7d007d00007d7d, 0x8989008900008989, 0x9797009700009797, 0x5b5b005b00005b5b, 0x9595009500009595, 0xffff00ff0000ffff, 0xd2d200d20000d2d2,
+ 0xc4c400c40000c4c4, 0x4848004800004848, 0xf7f700f70000f7f7, 0xdbdb00db0000dbdb, 0x0303000300000303, 0xdada00da0000dada, 0x3f3f003f00003f3f, 0x9494009400009494,
+ 0x5c5c005c00005c5c, 0x0202000200000202, 0x4a4a004a00004a4a, 0x3333003300003333, 0x6767006700006767, 0xf3f300f30000f3f3, 0x7f7f007f00007f7f, 0xe2e200e20000e2e2,
+ 0x9b9b009b00009b9b, 0x2626002600002626, 0x3737003700003737, 0x3b3b003b00003b3b, 0x9696009600009696, 0x4b4b004b00004b4b, 0xbebe00be0000bebe, 0x2e2e002e00002e2e,
+ 0x7979007900007979, 0x8c8c008c00008c8c, 0x6e6e006e00006e6e, 0x8e8e008e00008e8e, 0xf5f500f50000f5f5, 0xb6b600b60000b6b6, 0xfdfd00fd0000fdfd, 0x5959005900005959,
+ 0x9898009800009898, 0x6a6a006a00006a6a, 0x4646004600004646, 0xbaba00ba0000baba, 0x2525002500002525, 0x4242004200004242, 0xa2a200a20000a2a2, 0xfafa00fa0000fafa,
+ 0x0707000700000707, 0x5555005500005555, 0xeeee00ee0000eeee, 0x0a0a000a00000a0a, 0x4949004900004949, 0x6868006800006868, 0x3838003800003838, 0xa4a400a40000a4a4,
+ 0x2828002800002828, 0x7b7b007b00007b7b, 0xc9c900c90000c9c9, 0xc1c100c10000c1c1, 0xe3e300e30000e3e3, 0xf4f400f40000f4f4, 0xc7c700c70000c7c7, 0x9e9e009e00009e9e
+ },
+ {
+ 0x00e0e0e000e0e0e0, 0x0005050500050505, 0x0058585800585858, 0x00d9d9d900d9d9d9, 0x0067676700676767, 0x004e4e4e004e4e4e, 0x0081818100818181, 0x00cbcbcb00cbcbcb,
+ 0x00c9c9c900c9c9c9, 0x000b0b0b000b0b0b, 0x00aeaeae00aeaeae, 0x006a6a6a006a6a6a, 0x00d5d5d500d5d5d5, 0x0018181800181818, 0x005d5d5d005d5d5d, 0x0082828200828282,
+ 0x0046464600464646, 0x00dfdfdf00dfdfdf, 0x00d6d6d600d6d6d6, 0x0027272700272727, 0x008a8a8a008a8a8a, 0x0032323200323232, 0x004b4b4b004b4b4b, 0x0042424200424242,
+ 0x00dbdbdb00dbdbdb, 0x001c1c1c001c1c1c, 0x009e9e9e009e9e9e, 0x009c9c9c009c9c9c, 0x003a3a3a003a3a3a, 0x00cacaca00cacaca, 0x0025252500252525, 0x007b7b7b007b7b7b,
+ 0x000d0d0d000d0d0d, 0x0071717100717171, 0x005f5f5f005f5f5f, 0x001f1f1f001f1f1f, 0x00f8f8f800f8f8f8, 0x00d7d7d700d7d7d7, 0x003e3e3e003e3e3e, 0x009d9d9d009d9d9d,
+ 0x007c7c7c007c7c7c, 0x0060606000606060, 0x00b9b9b900b9b9b9, 0x00bebebe00bebebe, 0x00bcbcbc00bcbcbc, 0x008b8b8b008b8b8b, 0x0016161600161616, 0x0034343400343434,
+ 0x004d4d4d004d4d4d, 0x00c3c3c300c3c3c3, 0x0072727200727272, 0x0095959500959595, 0x00ababab00ababab, 0x008e8e8e008e8e8e, 0x00bababa00bababa, 0x007a7a7a007a7a7a,
+ 0x00b3b3b300b3b3b3, 0x0002020200020202, 0x00b4b4b400b4b4b4, 0x00adadad00adadad, 0x00a2a2a200a2a2a2, 0x00acacac00acacac, 0x00d8d8d800d8d8d8, 0x009a9a9a009a9a9a,
+ 0x0017171700171717, 0x001a1a1a001a1a1a, 0x0035353500353535, 0x00cccccc00cccccc, 0x00f7f7f700f7f7f7, 0x0099999900999999, 0x0061616100616161, 0x005a5a5a005a5a5a,
+ 0x00e8e8e800e8e8e8, 0x0024242400242424, 0x0056565600565656, 0x0040404000404040, 0x00e1e1e100e1e1e1, 0x0063636300636363, 0x0009090900090909, 0x0033333300333333,
+ 0x00bfbfbf00bfbfbf, 0x0098989800989898, 0x0097979700979797, 0x0085858500858585, 0x0068686800686868, 0x00fcfcfc00fcfcfc, 0x00ececec00ececec, 0x000a0a0a000a0a0a,
+ 0x00dadada00dadada, 0x006f6f6f006f6f6f, 0x0053535300535353, 0x0062626200626262, 0x00a3a3a300a3a3a3, 0x002e2e2e002e2e2e, 0x0008080800080808, 0x00afafaf00afafaf,
+ 0x0028282800282828, 0x00b0b0b000b0b0b0, 0x0074747400747474, 0x00c2c2c200c2c2c2, 0x00bdbdbd00bdbdbd, 0x0036363600363636, 0x0022222200222222, 0x0038383800383838,
+ 0x0064646400646464, 0x001e1e1e001e1e1e, 0x0039393900393939, 0x002c2c2c002c2c2c, 0x00a6a6a600a6a6a6, 0x0030303000303030, 0x00e5e5e500e5e5e5, 0x0044444400444444,
+ 0x00fdfdfd00fdfdfd, 0x0088888800888888, 0x009f9f9f009f9f9f, 0x0065656500656565, 0x0087878700878787, 0x006b6b6b006b6b6b, 0x00f4f4f400f4f4f4, 0x0023232300232323,
+ 0x0048484800484848, 0x0010101000101010, 0x00d1d1d100d1d1d1, 0x0051515100515151, 0x00c0c0c000c0c0c0, 0x00f9f9f900f9f9f9, 0x00d2d2d200d2d2d2, 0x00a0a0a000a0a0a0,
+ 0x0055555500555555, 0x00a1a1a100a1a1a1, 0x0041414100414141, 0x00fafafa00fafafa, 0x0043434300434343, 0x0013131300131313, 0x00c4c4c400c4c4c4, 0x002f2f2f002f2f2f,
+ 0x00a8a8a800a8a8a8, 0x00b6b6b600b6b6b6, 0x003c3c3c003c3c3c, 0x002b2b2b002b2b2b, 0x00c1c1c100c1c1c1, 0x00ffffff00ffffff, 0x00c8c8c800c8c8c8, 0x00a5a5a500a5a5a5,
+ 0x0020202000202020, 0x0089898900898989, 0x0000000000000000, 0x0090909000909090, 0x0047474700474747, 0x00efefef00efefef, 0x00eaeaea00eaeaea, 0x00b7b7b700b7b7b7,
+ 0x0015151500151515, 0x0006060600060606, 0x00cdcdcd00cdcdcd, 0x00b5b5b500b5b5b5, 0x0012121200121212, 0x007e7e7e007e7e7e, 0x00bbbbbb00bbbbbb, 0x0029292900292929,
+ 0x000f0f0f000f0f0f, 0x00b8b8b800b8b8b8, 0x0007070700070707, 0x0004040400040404, 0x009b9b9b009b9b9b, 0x0094949400949494, 0x0021212100212121, 0x0066666600666666,
+ 0x00e6e6e600e6e6e6, 0x00cecece00cecece, 0x00ededed00ededed, 0x00e7e7e700e7e7e7, 0x003b3b3b003b3b3b, 0x00fefefe00fefefe, 0x007f7f7f007f7f7f, 0x00c5c5c500c5c5c5,
+ 0x00a4a4a400a4a4a4, 0x0037373700373737, 0x00b1b1b100b1b1b1, 0x004c4c4c004c4c4c, 0x0091919100919191, 0x006e6e6e006e6e6e, 0x008d8d8d008d8d8d, 0x0076767600767676,
+ 0x0003030300030303, 0x002d2d2d002d2d2d, 0x00dedede00dedede, 0x0096969600969696, 0x0026262600262626, 0x007d7d7d007d7d7d, 0x00c6c6c600c6c6c6, 0x005c5c5c005c5c5c,
+ 0x00d3d3d300d3d3d3, 0x00f2f2f200f2f2f2, 0x004f4f4f004f4f4f, 0x0019191900191919, 0x003f3f3f003f3f3f, 0x00dcdcdc00dcdcdc, 0x0079797900797979, 0x001d1d1d001d1d1d,
+ 0x0052525200525252, 0x00ebebeb00ebebeb, 0x00f3f3f300f3f3f3, 0x006d6d6d006d6d6d, 0x005e5e5e005e5e5e, 0x00fbfbfb00fbfbfb, 0x0069696900696969, 0x00b2b2b200b2b2b2,
+ 0x00f0f0f000f0f0f0, 0x0031313100313131, 0x000c0c0c000c0c0c, 0x00d4d4d400d4d4d4, 0x00cfcfcf00cfcfcf, 0x008c8c8c008c8c8c, 0x00e2e2e200e2e2e2, 0x0075757500757575,
+ 0x00a9a9a900a9a9a9, 0x004a4a4a004a4a4a, 0x0057575700575757, 0x0084848400848484, 0x0011111100111111, 0x0045454500454545, 0x001b1b1b001b1b1b, 0x00f5f5f500f5f5f5,
+ 0x00e4e4e400e4e4e4, 0x000e0e0e000e0e0e, 0x0073737300737373, 0x00aaaaaa00aaaaaa, 0x00f1f1f100f1f1f1, 0x00dddddd00dddddd, 0x0059595900595959, 0x0014141400141414,
+ 0x006c6c6c006c6c6c, 0x0092929200929292, 0x0054545400545454, 0x00d0d0d000d0d0d0, 0x0078787800787878, 0x0070707000707070, 0x00e3e3e300e3e3e3, 0x0049494900494949,
+ 0x0080808000808080, 0x0050505000505050, 0x00a7a7a700a7a7a7, 0x00f6f6f600f6f6f6, 0x0077777700777777, 0x0093939300939393, 0x0086868600868686, 0x0083838300838383,
+ 0x002a2a2a002a2a2a, 0x00c7c7c700c7c7c7, 0x005b5b5b005b5b5b, 0x00e9e9e900e9e9e9, 0x00eeeeee00eeeeee, 0x008f8f8f008f8f8f, 0x0001010100010101, 0x003d3d3d003d3d3d
+ },
+ {
+ 0x3800383838003838, 0x4100414141004141, 0x1600161616001616, 0x7600767676007676, 0xd900d9d9d900d9d9, 0x9300939393009393, 0x6000606060006060, 0xf200f2f2f200f2f2,
+ 0x7200727272007272, 0xc200c2c2c200c2c2, 0xab00ababab00abab, 0x9a009a9a9a009a9a, 0x7500757575007575, 0x0600060606000606, 0x5700575757005757, 0xa000a0a0a000a0a0,
+ 0x9100919191009191, 0xf700f7f7f700f7f7, 0xb500b5b5b500b5b5, 0xc900c9c9c900c9c9, 0xa200a2a2a200a2a2, 0x8c008c8c8c008c8c, 0xd200d2d2d200d2d2, 0x9000909090009090,
+ 0xf600f6f6f600f6f6, 0x0700070707000707, 0xa700a7a7a700a7a7, 0x2700272727002727, 0x8e008e8e8e008e8e, 0xb200b2b2b200b2b2, 0x4900494949004949, 0xde00dedede00dede,
+ 0x4300434343004343, 0x5c005c5c5c005c5c, 0xd700d7d7d700d7d7, 0xc700c7c7c700c7c7, 0x3e003e3e3e003e3e, 0xf500f5f5f500f5f5, 0x8f008f8f8f008f8f, 0x6700676767006767,
+ 0x1f001f1f1f001f1f, 0x1800181818001818, 0x6e006e6e6e006e6e, 0xaf00afafaf00afaf, 0x2f002f2f2f002f2f, 0xe200e2e2e200e2e2, 0x8500858585008585, 0x0d000d0d0d000d0d,
+ 0x5300535353005353, 0xf000f0f0f000f0f0, 0x9c009c9c9c009c9c, 0x6500656565006565, 0xea00eaeaea00eaea, 0xa300a3a3a300a3a3, 0xae00aeaeae00aeae, 0x9e009e9e9e009e9e,
+ 0xec00ececec00ecec, 0x8000808080008080, 0x2d002d2d2d002d2d, 0x6b006b6b6b006b6b, 0xa800a8a8a800a8a8, 0x2b002b2b2b002b2b, 0x3600363636003636, 0xa600a6a6a600a6a6,
+ 0xc500c5c5c500c5c5, 0x8600868686008686, 0x4d004d4d4d004d4d, 0x3300333333003333, 0xfd00fdfdfd00fdfd, 0x6600666666006666, 0x5800585858005858, 0x9600969696009696,
+ 0x3a003a3a3a003a3a, 0x0900090909000909, 0x9500959595009595, 0x1000101010001010, 0x7800787878007878, 0xd800d8d8d800d8d8, 0x4200424242004242, 0xcc00cccccc00cccc,
+ 0xef00efefef00efef, 0x2600262626002626, 0xe500e5e5e500e5e5, 0x6100616161006161, 0x1a001a1a1a001a1a, 0x3f003f3f3f003f3f, 0x3b003b3b3b003b3b, 0x8200828282008282,
+ 0xb600b6b6b600b6b6, 0xdb00dbdbdb00dbdb, 0xd400d4d4d400d4d4, 0x9800989898009898, 0xe800e8e8e800e8e8, 0x8b008b8b8b008b8b, 0x0200020202000202, 0xeb00ebebeb00ebeb,
+ 0x0a000a0a0a000a0a, 0x2c002c2c2c002c2c, 0x1d001d1d1d001d1d, 0xb000b0b0b000b0b0, 0x6f006f6f6f006f6f, 0x8d008d8d8d008d8d, 0x8800888888008888, 0x0e000e0e0e000e0e,
+ 0x1900191919001919, 0x8700878787008787, 0x4e004e4e4e004e4e, 0x0b000b0b0b000b0b, 0xa900a9a9a900a9a9, 0x0c000c0c0c000c0c, 0x7900797979007979, 0x1100111111001111,
+ 0x7f007f7f7f007f7f, 0x2200222222002222, 0xe700e7e7e700e7e7, 0x5900595959005959, 0xe100e1e1e100e1e1, 0xda00dadada00dada, 0x3d003d3d3d003d3d, 0xc800c8c8c800c8c8,
+ 0x1200121212001212, 0x0400040404000404, 0x7400747474007474, 0x5400545454005454, 0x3000303030003030, 0x7e007e7e7e007e7e, 0xb400b4b4b400b4b4, 0x2800282828002828,
+ 0x5500555555005555, 0x6800686868006868, 0x5000505050005050, 0xbe00bebebe00bebe, 0xd000d0d0d000d0d0, 0xc400c4c4c400c4c4, 0x3100313131003131, 0xcb00cbcbcb00cbcb,
+ 0x2a002a2a2a002a2a, 0xad00adadad00adad, 0x0f000f0f0f000f0f, 0xca00cacaca00caca, 0x7000707070007070, 0xff00ffffff00ffff, 0x3200323232003232, 0x6900696969006969,
+ 0x0800080808000808, 0x6200626262006262, 0x0000000000000000, 0x2400242424002424, 0xd100d1d1d100d1d1, 0xfb00fbfbfb00fbfb, 0xba00bababa00baba, 0xed00ededed00eded,
+ 0x4500454545004545, 0x8100818181008181, 0x7300737373007373, 0x6d006d6d6d006d6d, 0x8400848484008484, 0x9f009f9f9f009f9f, 0xee00eeeeee00eeee, 0x4a004a4a4a004a4a,
+ 0xc300c3c3c300c3c3, 0x2e002e2e2e002e2e, 0xc100c1c1c100c1c1, 0x0100010101000101, 0xe600e6e6e600e6e6, 0x2500252525002525, 0x4800484848004848, 0x9900999999009999,
+ 0xb900b9b9b900b9b9, 0xb300b3b3b300b3b3, 0x7b007b7b7b007b7b, 0xf900f9f9f900f9f9, 0xce00cecece00cece, 0xbf00bfbfbf00bfbf, 0xdf00dfdfdf00dfdf, 0x7100717171007171,
+ 0x2900292929002929, 0xcd00cdcdcd00cdcd, 0x6c006c6c6c006c6c, 0x1300131313001313, 0x6400646464006464, 0x9b009b9b9b009b9b, 0x6300636363006363, 0x9d009d9d9d009d9d,
+ 0xc000c0c0c000c0c0, 0x4b004b4b4b004b4b, 0xb700b7b7b700b7b7, 0xa500a5a5a500a5a5, 0x8900898989008989, 0x5f005f5f5f005f5f, 0xb100b1b1b100b1b1, 0x1700171717001717,
+ 0xf400f4f4f400f4f4, 0xbc00bcbcbc00bcbc, 0xd300d3d3d300d3d3, 0x4600464646004646, 0xcf00cfcfcf00cfcf, 0x3700373737003737, 0x5e005e5e5e005e5e, 0x4700474747004747,
+ 0x9400949494009494, 0xfa00fafafa00fafa, 0xfc00fcfcfc00fcfc, 0x5b005b5b5b005b5b, 0x9700979797009797, 0xfe00fefefe00fefe, 0x5a005a5a5a005a5a, 0xac00acacac00acac,
+ 0x3c003c3c3c003c3c, 0x4c004c4c4c004c4c, 0x0300030303000303, 0x3500353535003535, 0xf300f3f3f300f3f3, 0x2300232323002323, 0xb800b8b8b800b8b8, 0x5d005d5d5d005d5d,
+ 0x6a006a6a6a006a6a, 0x9200929292009292, 0xd500d5d5d500d5d5, 0x2100212121002121, 0x4400444444004444, 0x5100515151005151, 0xc600c6c6c600c6c6, 0x7d007d7d7d007d7d,
+ 0x3900393939003939, 0x8300838383008383, 0xdc00dcdcdc00dcdc, 0xaa00aaaaaa00aaaa, 0x7c007c7c7c007c7c, 0x7700777777007777, 0x5600565656005656, 0x0500050505000505,
+ 0x1b001b1b1b001b1b, 0xa400a4a4a400a4a4, 0x1500151515001515, 0x3400343434003434, 0x1e001e1e1e001e1e, 0x1c001c1c1c001c1c, 0xf800f8f8f800f8f8, 0x5200525252005252,
+ 0x2000202020002020, 0x1400141414001414, 0xe900e9e9e900e9e9, 0xbd00bdbdbd00bdbd, 0xdd00dddddd00dddd, 0xe400e4e4e400e4e4, 0xa100a1a1a100a1a1, 0xe000e0e0e000e0e0,
+ 0x8a008a8a8a008a8a, 0xf100f1f1f100f1f1, 0xd600d6d6d600d6d6, 0x7a007a7a7a007a7a, 0xbb00bbbbbb00bbbb, 0xe300e3e3e300e3e3, 0x4000404040004040, 0x4f004f4f4f004f4f
+ },
+ {
+ 0x7070007070700070, 0x2c2c002c2c2c002c, 0xb3b300b3b3b300b3, 0xc0c000c0c0c000c0, 0xe4e400e4e4e400e4, 0x5757005757570057, 0xeaea00eaeaea00ea, 0xaeae00aeaeae00ae,
+ 0x2323002323230023, 0x6b6b006b6b6b006b, 0x4545004545450045, 0xa5a500a5a5a500a5, 0xeded00ededed00ed, 0x4f4f004f4f4f004f, 0x1d1d001d1d1d001d, 0x9292009292920092,
+ 0x8686008686860086, 0xafaf00afafaf00af, 0x7c7c007c7c7c007c, 0x1f1f001f1f1f001f, 0x3e3e003e3e3e003e, 0xdcdc00dcdcdc00dc, 0x5e5e005e5e5e005e, 0x0b0b000b0b0b000b,
+ 0xa6a600a6a6a600a6, 0x3939003939390039, 0xd5d500d5d5d500d5, 0x5d5d005d5d5d005d, 0xd9d900d9d9d900d9, 0x5a5a005a5a5a005a, 0x5151005151510051, 0x6c6c006c6c6c006c,
+ 0x8b8b008b8b8b008b, 0x9a9a009a9a9a009a, 0xfbfb00fbfbfb00fb, 0xb0b000b0b0b000b0, 0x7474007474740074, 0x2b2b002b2b2b002b, 0xf0f000f0f0f000f0, 0x8484008484840084,
+ 0xdfdf00dfdfdf00df, 0xcbcb00cbcbcb00cb, 0x3434003434340034, 0x7676007676760076, 0x6d6d006d6d6d006d, 0xa9a900a9a9a900a9, 0xd1d100d1d1d100d1, 0x0404000404040004,
+ 0x1414001414140014, 0x3a3a003a3a3a003a, 0xdede00dedede00de, 0x1111001111110011, 0x3232003232320032, 0x9c9c009c9c9c009c, 0x5353005353530053, 0xf2f200f2f2f200f2,
+ 0xfefe00fefefe00fe, 0xcfcf00cfcfcf00cf, 0xc3c300c3c3c300c3, 0x7a7a007a7a7a007a, 0x2424002424240024, 0xe8e800e8e8e800e8, 0x6060006060600060, 0x6969006969690069,
+ 0xaaaa00aaaaaa00aa, 0xa0a000a0a0a000a0, 0xa1a100a1a1a100a1, 0x6262006262620062, 0x5454005454540054, 0x1e1e001e1e1e001e, 0xe0e000e0e0e000e0, 0x6464006464640064,
+ 0x1010001010100010, 0x0000000000000000, 0xa3a300a3a3a300a3, 0x7575007575750075, 0x8a8a008a8a8a008a, 0xe6e600e6e6e600e6, 0x0909000909090009, 0xdddd00dddddd00dd,
+ 0x8787008787870087, 0x8383008383830083, 0xcdcd00cdcdcd00cd, 0x9090009090900090, 0x7373007373730073, 0xf6f600f6f6f600f6, 0x9d9d009d9d9d009d, 0xbfbf00bfbfbf00bf,
+ 0x5252005252520052, 0xd8d800d8d8d800d8, 0xc8c800c8c8c800c8, 0xc6c600c6c6c600c6, 0x8181008181810081, 0x6f6f006f6f6f006f, 0x1313001313130013, 0x6363006363630063,
+ 0xe9e900e9e9e900e9, 0xa7a700a7a7a700a7, 0x9f9f009f9f9f009f, 0xbcbc00bcbcbc00bc, 0x2929002929290029, 0xf9f900f9f9f900f9, 0x2f2f002f2f2f002f, 0xb4b400b4b4b400b4,
+ 0x7878007878780078, 0x0606000606060006, 0xe7e700e7e7e700e7, 0x7171007171710071, 0xd4d400d4d4d400d4, 0xabab00ababab00ab, 0x8888008888880088, 0x8d8d008d8d8d008d,
+ 0x7272007272720072, 0xb9b900b9b9b900b9, 0xf8f800f8f8f800f8, 0xacac00acacac00ac, 0x3636003636360036, 0x2a2a002a2a2a002a, 0x3c3c003c3c3c003c, 0xf1f100f1f1f100f1,
+ 0x4040004040400040, 0xd3d300d3d3d300d3, 0xbbbb00bbbbbb00bb, 0x4343004343430043, 0x1515001515150015, 0xadad00adadad00ad, 0x7777007777770077, 0x8080008080800080,
+ 0x8282008282820082, 0xecec00ececec00ec, 0x2727002727270027, 0xe5e500e5e5e500e5, 0x8585008585850085, 0x3535003535350035, 0x0c0c000c0c0c000c, 0x4141004141410041,
+ 0xefef00efefef00ef, 0x9393009393930093, 0x1919001919190019, 0x2121002121210021, 0x0e0e000e0e0e000e, 0x4e4e004e4e4e004e, 0x6565006565650065, 0xbdbd00bdbdbd00bd,
+ 0xb8b800b8b8b800b8, 0x8f8f008f8f8f008f, 0xebeb00ebebeb00eb, 0xcece00cecece00ce, 0x3030003030300030, 0x5f5f005f5f5f005f, 0xc5c500c5c5c500c5, 0x1a1a001a1a1a001a,
+ 0xe1e100e1e1e100e1, 0xcaca00cacaca00ca, 0x4747004747470047, 0x3d3d003d3d3d003d, 0x0101000101010001, 0xd6d600d6d6d600d6, 0x5656005656560056, 0x4d4d004d4d4d004d,
+ 0x0d0d000d0d0d000d, 0x6666006666660066, 0xcccc00cccccc00cc, 0x2d2d002d2d2d002d, 0x1212001212120012, 0x2020002020200020, 0xb1b100b1b1b100b1, 0x9999009999990099,
+ 0x4c4c004c4c4c004c, 0xc2c200c2c2c200c2, 0x7e7e007e7e7e007e, 0x0505000505050005, 0xb7b700b7b7b700b7, 0x3131003131310031, 0x1717001717170017, 0xd7d700d7d7d700d7,
+ 0x5858005858580058, 0x6161006161610061, 0x1b1b001b1b1b001b, 0x1c1c001c1c1c001c, 0x0f0f000f0f0f000f, 0x1616001616160016, 0x1818001818180018, 0x2222002222220022,
+ 0x4444004444440044, 0xb2b200b2b2b200b2, 0xb5b500b5b5b500b5, 0x9191009191910091, 0x0808000808080008, 0xa8a800a8a8a800a8, 0xfcfc00fcfcfc00fc, 0x5050005050500050,
+ 0xd0d000d0d0d000d0, 0x7d7d007d7d7d007d, 0x8989008989890089, 0x9797009797970097, 0x5b5b005b5b5b005b, 0x9595009595950095, 0xffff00ffffff00ff, 0xd2d200d2d2d200d2,
+ 0xc4c400c4c4c400c4, 0x4848004848480048, 0xf7f700f7f7f700f7, 0xdbdb00dbdbdb00db, 0x0303000303030003, 0xdada00dadada00da, 0x3f3f003f3f3f003f, 0x9494009494940094,
+ 0x5c5c005c5c5c005c, 0x0202000202020002, 0x4a4a004a4a4a004a, 0x3333003333330033, 0x6767006767670067, 0xf3f300f3f3f300f3, 0x7f7f007f7f7f007f, 0xe2e200e2e2e200e2,
+ 0x9b9b009b9b9b009b, 0x2626002626260026, 0x3737003737370037, 0x3b3b003b3b3b003b, 0x9696009696960096, 0x4b4b004b4b4b004b, 0xbebe00bebebe00be, 0x2e2e002e2e2e002e,
+ 0x7979007979790079, 0x8c8c008c8c8c008c, 0x6e6e006e6e6e006e, 0x8e8e008e8e8e008e, 0xf5f500f5f5f500f5, 0xb6b600b6b6b600b6, 0xfdfd00fdfdfd00fd, 0x5959005959590059,
+ 0x9898009898980098, 0x6a6a006a6a6a006a, 0x4646004646460046, 0xbaba00bababa00ba, 0x2525002525250025, 0x4242004242420042, 0xa2a200a2a2a200a2, 0xfafa00fafafa00fa,
+ 0x0707000707070007, 0x5555005555550055, 0xeeee00eeeeee00ee, 0x0a0a000a0a0a000a, 0x4949004949490049, 0x6868006868680068, 0x3838003838380038, 0xa4a400a4a4a400a4,
+ 0x2828002828280028, 0x7b7b007b7b7b007b, 0xc9c900c9c9c900c9, 0xc1c100c1c1c100c1, 0xe3e300e3e3e300e3, 0xf4f400f4f4f400f4, 0xc7c700c7c7c700c7, 0x9e9e009e9e9e009e
+ },
+ {
+ 0x7070700070707000, 0x8282820082828200, 0x2c2c2c002c2c2c00, 0xececec00ececec00, 0xb3b3b300b3b3b300, 0x2727270027272700, 0xc0c0c000c0c0c000, 0xe5e5e500e5e5e500,
+ 0xe4e4e400e4e4e400, 0x8585850085858500, 0x5757570057575700, 0x3535350035353500, 0xeaeaea00eaeaea00, 0x0c0c0c000c0c0c00, 0xaeaeae00aeaeae00, 0x4141410041414100,
+ 0x2323230023232300, 0xefefef00efefef00, 0x6b6b6b006b6b6b00, 0x9393930093939300, 0x4545450045454500, 0x1919190019191900, 0xa5a5a500a5a5a500, 0x2121210021212100,
+ 0xededed00ededed00, 0x0e0e0e000e0e0e00, 0x4f4f4f004f4f4f00, 0x4e4e4e004e4e4e00, 0x1d1d1d001d1d1d00, 0x6565650065656500, 0x9292920092929200, 0xbdbdbd00bdbdbd00,
+ 0x8686860086868600, 0xb8b8b800b8b8b800, 0xafafaf00afafaf00, 0x8f8f8f008f8f8f00, 0x7c7c7c007c7c7c00, 0xebebeb00ebebeb00, 0x1f1f1f001f1f1f00, 0xcecece00cecece00,
+ 0x3e3e3e003e3e3e00, 0x3030300030303000, 0xdcdcdc00dcdcdc00, 0x5f5f5f005f5f5f00, 0x5e5e5e005e5e5e00, 0xc5c5c500c5c5c500, 0x0b0b0b000b0b0b00, 0x1a1a1a001a1a1a00,
+ 0xa6a6a600a6a6a600, 0xe1e1e100e1e1e100, 0x3939390039393900, 0xcacaca00cacaca00, 0xd5d5d500d5d5d500, 0x4747470047474700, 0x5d5d5d005d5d5d00, 0x3d3d3d003d3d3d00,
+ 0xd9d9d900d9d9d900, 0x0101010001010100, 0x5a5a5a005a5a5a00, 0xd6d6d600d6d6d600, 0x5151510051515100, 0x5656560056565600, 0x6c6c6c006c6c6c00, 0x4d4d4d004d4d4d00,
+ 0x8b8b8b008b8b8b00, 0x0d0d0d000d0d0d00, 0x9a9a9a009a9a9a00, 0x6666660066666600, 0xfbfbfb00fbfbfb00, 0xcccccc00cccccc00, 0xb0b0b000b0b0b000, 0x2d2d2d002d2d2d00,
+ 0x7474740074747400, 0x1212120012121200, 0x2b2b2b002b2b2b00, 0x2020200020202000, 0xf0f0f000f0f0f000, 0xb1b1b100b1b1b100, 0x8484840084848400, 0x9999990099999900,
+ 0xdfdfdf00dfdfdf00, 0x4c4c4c004c4c4c00, 0xcbcbcb00cbcbcb00, 0xc2c2c200c2c2c200, 0x3434340034343400, 0x7e7e7e007e7e7e00, 0x7676760076767600, 0x0505050005050500,
+ 0x6d6d6d006d6d6d00, 0xb7b7b700b7b7b700, 0xa9a9a900a9a9a900, 0x3131310031313100, 0xd1d1d100d1d1d100, 0x1717170017171700, 0x0404040004040400, 0xd7d7d700d7d7d700,
+ 0x1414140014141400, 0x5858580058585800, 0x3a3a3a003a3a3a00, 0x6161610061616100, 0xdedede00dedede00, 0x1b1b1b001b1b1b00, 0x1111110011111100, 0x1c1c1c001c1c1c00,
+ 0x3232320032323200, 0x0f0f0f000f0f0f00, 0x9c9c9c009c9c9c00, 0x1616160016161600, 0x5353530053535300, 0x1818180018181800, 0xf2f2f200f2f2f200, 0x2222220022222200,
+ 0xfefefe00fefefe00, 0x4444440044444400, 0xcfcfcf00cfcfcf00, 0xb2b2b200b2b2b200, 0xc3c3c300c3c3c300, 0xb5b5b500b5b5b500, 0x7a7a7a007a7a7a00, 0x9191910091919100,
+ 0x2424240024242400, 0x0808080008080800, 0xe8e8e800e8e8e800, 0xa8a8a800a8a8a800, 0x6060600060606000, 0xfcfcfc00fcfcfc00, 0x6969690069696900, 0x5050500050505000,
+ 0xaaaaaa00aaaaaa00, 0xd0d0d000d0d0d000, 0xa0a0a000a0a0a000, 0x7d7d7d007d7d7d00, 0xa1a1a100a1a1a100, 0x8989890089898900, 0x6262620062626200, 0x9797970097979700,
+ 0x5454540054545400, 0x5b5b5b005b5b5b00, 0x1e1e1e001e1e1e00, 0x9595950095959500, 0xe0e0e000e0e0e000, 0xffffff00ffffff00, 0x6464640064646400, 0xd2d2d200d2d2d200,
+ 0x1010100010101000, 0xc4c4c400c4c4c400, 0x0000000000000000, 0x4848480048484800, 0xa3a3a300a3a3a300, 0xf7f7f700f7f7f700, 0x7575750075757500, 0xdbdbdb00dbdbdb00,
+ 0x8a8a8a008a8a8a00, 0x0303030003030300, 0xe6e6e600e6e6e600, 0xdadada00dadada00, 0x0909090009090900, 0x3f3f3f003f3f3f00, 0xdddddd00dddddd00, 0x9494940094949400,
+ 0x8787870087878700, 0x5c5c5c005c5c5c00, 0x8383830083838300, 0x0202020002020200, 0xcdcdcd00cdcdcd00, 0x4a4a4a004a4a4a00, 0x9090900090909000, 0x3333330033333300,
+ 0x7373730073737300, 0x6767670067676700, 0xf6f6f600f6f6f600, 0xf3f3f300f3f3f300, 0x9d9d9d009d9d9d00, 0x7f7f7f007f7f7f00, 0xbfbfbf00bfbfbf00, 0xe2e2e200e2e2e200,
+ 0x5252520052525200, 0x9b9b9b009b9b9b00, 0xd8d8d800d8d8d800, 0x2626260026262600, 0xc8c8c800c8c8c800, 0x3737370037373700, 0xc6c6c600c6c6c600, 0x3b3b3b003b3b3b00,
+ 0x8181810081818100, 0x9696960096969600, 0x6f6f6f006f6f6f00, 0x4b4b4b004b4b4b00, 0x1313130013131300, 0xbebebe00bebebe00, 0x6363630063636300, 0x2e2e2e002e2e2e00,
+ 0xe9e9e900e9e9e900, 0x7979790079797900, 0xa7a7a700a7a7a700, 0x8c8c8c008c8c8c00, 0x9f9f9f009f9f9f00, 0x6e6e6e006e6e6e00, 0xbcbcbc00bcbcbc00, 0x8e8e8e008e8e8e00,
+ 0x2929290029292900, 0xf5f5f500f5f5f500, 0xf9f9f900f9f9f900, 0xb6b6b600b6b6b600, 0x2f2f2f002f2f2f00, 0xfdfdfd00fdfdfd00, 0xb4b4b400b4b4b400, 0x5959590059595900,
+ 0x7878780078787800, 0x9898980098989800, 0x0606060006060600, 0x6a6a6a006a6a6a00, 0xe7e7e700e7e7e700, 0x4646460046464600, 0x7171710071717100, 0xbababa00bababa00,
+ 0xd4d4d400d4d4d400, 0x2525250025252500, 0xababab00ababab00, 0x4242420042424200, 0x8888880088888800, 0xa2a2a200a2a2a200, 0x8d8d8d008d8d8d00, 0xfafafa00fafafa00,
+ 0x7272720072727200, 0x0707070007070700, 0xb9b9b900b9b9b900, 0x5555550055555500, 0xf8f8f800f8f8f800, 0xeeeeee00eeeeee00, 0xacacac00acacac00, 0x0a0a0a000a0a0a00,
+ 0x3636360036363600, 0x4949490049494900, 0x2a2a2a002a2a2a00, 0x6868680068686800, 0x3c3c3c003c3c3c00, 0x3838380038383800, 0xf1f1f100f1f1f100, 0xa4a4a400a4a4a400,
+ 0x4040400040404000, 0x2828280028282800, 0xd3d3d300d3d3d300, 0x7b7b7b007b7b7b00, 0xbbbbbb00bbbbbb00, 0xc9c9c900c9c9c900, 0x4343430043434300, 0xc1c1c100c1c1c100,
+ 0x1515150015151500, 0xe3e3e300e3e3e300, 0xadadad00adadad00, 0xf4f4f400f4f4f400, 0x7777770077777700, 0xc7c7c700c7c7c700, 0x8080800080808000, 0x9e9e9e009e9e9e00
+ }
+ };
+
+ const uint64 KS[] = { 0xA09E667F3BCC908B, 0xB67AE8584CAA73B2, 0xC6EF372FE94F82BE, 0x54FF53A5F1D36F1C, 0x10E527FADE682D1D, 0xB05688C2B3E6C1FD };
+
+ VC_INLINE uint64 F(uint64 x, uint64 k)
+ {
+ uint64 t = x ^ k;
+ return S[0][(t >> 56) & 0xFF] ^ S[1][(t >> 48) & 0xFF] ^ S[2][(t >> 40) & 0xFF] ^ S[3][(t >> 32) & 0xFF] ^ S[4][(t >> 24) & 0xFF] ^ S[5][(t >> 16) & 0xFF] ^ S[6][(t >> 8) & 0xFF] ^ S[7][t & 0xFF];
+ }
+
+ VC_INLINE uint64 FL(uint64 x, uint64 k)
+ {
+ uint32 xl = (uint32)(x >> 32);
+ uint32 xr = (uint32)(x);
+ uint32 kl = (uint32)(k >> 32);
+ uint32 kr = (uint32)(k);
+
+ uint32 yr = rotl32(xl & kl, 1) ^ xr;
+ uint32 yl = (yr | kr) ^ xl;
+ return (((uint64)(yl)) << 32) | yr;
+ }
+
+ VC_INLINE uint64 FL1(uint64 y, uint64 k)
+ {
+ uint32 yl = (uint32)(y >> 32);
+ uint32 yr = (uint32)(y);
+ uint32 kl = (uint32)(k >> 32);
+ uint32 kr = (uint32)(k);
+
+ uint32 xl = (yr | kr) ^ yl;
+ uint32 xr = rotl32(xl & kl, 1) ^ yr;
+ return (((uint64)(xl)) << 32) | xr;
+ }
+
+ VC_INLINE uint64 rotl128l(uint64 l, uint64 r, int n)
+ {
+ return (l << n) | (r >> (64 - n));
+ }
+
+ VC_INLINE uint64 rotl128r(uint64 l, uint64 r, int n)
+ {
+ return (r << n) | (l >> (64 - n));
+ }
+
+
+void camellia_set_key(const unsigned __int8 key[], unsigned __int8 *ksPtr)
+{
+ uint64 *ks = (uint64 *) ksPtr;
+ uint64 kll = bswap_64(*((uint64*)key));
+ uint64 klr = bswap_64(*((uint64*)(key + 8)));
+ uint64 krl = bswap_64(*((uint64*)(key + 16)));
+ uint64 krr = bswap_64(*((uint64*)(key + 24)));
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("kl: %016I64x %016I64x\n", kll, klr);
+ printf("kr: %016I64x %016I64x\n", krl, krr);
+#endif
+
+ uint64 kal = kll ^ krl;
+ uint64 kar = klr ^ krr;
+ uint64 lp = kal;
+ uint64 kbl, kbr;
+
+ kal = kar ^ F(kal, KS[0]);
+ kar = kal;
+ kal = lp ^ F(kal, KS[1]);
+ kal ^= kll;
+ kar ^= klr;
+
+ lp = kal;
+ kal = kar ^ F(kal, KS[2]);
+ kar = kal;
+ kal = lp ^ F(kal, KS[3]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("ka: %016I64x %016I64x\n", kal, kar);
+#endif
+ kbl = kal ^ krl;
+ kbr = kar ^ krr;
+ lp = kbl;
+ kbl = kbr ^ F(kbl, KS[4]);
+ kbr = kbl;
+ kbl = lp ^ F(kbl, KS[5]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("kb: %016I64x %016I64x\n", kbl, kbr);
+#endif
+
+ ks[0] = kll;
+ ks[1] = klr;
+ ks[2] = kbl;
+ ks[3] = kbr;
+ ks[4] = rotl128l(krl, krr, 15);
+ ks[5] = rotl128r(krl, krr, 15);
+ ks[6] = rotl128l(kal, kar, 15);
+ ks[7] = rotl128r(kal, kar, 15);
+ ks[8] = rotl128l(krl, krr, 30);
+ ks[9] = rotl128r(krl, krr, 30);
+
+ ks[10] = rotl128l(kbl, kbr, 30);
+ ks[11] = rotl128r(kbl, kbr, 30);
+ ks[12] = rotl128l(kll, klr, 45);
+ ks[13] = rotl128r(kll, klr, 45);
+ ks[14] = rotl128l(kal, kar, 45);
+ ks[15] = rotl128r(kal, kar, 45);
+ ks[16] = rotl128l(kll, klr, 60);
+ ks[17] = rotl128r(kll, klr, 60);
+
+ ks[18] = rotl128l(krl, krr, 60);
+ ks[19] = rotl128r(krl, krr, 60);
+ ks[20] = rotl128l(kbl, kbr, 60);
+ ks[21] = rotl128r(kbl, kbr, 60);
+ ks[22] = rotl128r(kll, klr, 13);
+ ks[23] = rotl128l(kll, klr, 13);
+ ks[24] = rotl128r(kal, kar, 13);
+ ks[25] = rotl128l(kal, kar, 13);
+
+ ks[26] = ks[9]; // rotl128r(krl, krr, 30);
+ ks[27] = ks[8]; // rotl128l(krl, krr, 30);
+ ks[28] = rotl128r(kal, kar, 30);
+ ks[29] = rotl128l(kal, kar, 30);
+ ks[30] = rotl128r(kll, klr, 47);
+ ks[31] = rotl128l(kll, klr, 47);
+ ks[32] = rotl128r(kbl, kbr, 47);
+ ks[33] = rotl128l(kbl, kbr, 47);
+
+#ifdef CPPCRYPTO_DEBUG
+ for (int i = 0; i < 34; i++)
+ printf("ks[%d]: %016I64x\n", i, ks[i]);
+#endif
+}
+
+void camellia_encrypt(const unsigned __int8 *in, unsigned __int8 *out, unsigned __int8 *ksPtr)
+{
+ uint64 *ks = (uint64 *) ksPtr;
+ uint64 l = bswap_64(*((uint64*)in)) ^ ks[0];
+ uint64 r = bswap_64(*((uint64*)(in + 8))) ^ ks[1];
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("r0: %016I64x %016I64x\n", l, r);
+#endif
+ // r = 1
+ uint64 lp = l;
+ l = r ^ F(l, ks[2]);
+ // r = lp;
+#ifdef CPPCRYPTO_DEBUG
+ printf("r1: %016I64x %016I64x\n", l, lp);
+#endif
+
+ // r = 2
+ r = l;
+ l = lp ^ F(l, ks[3]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("r2: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 3
+ lp = l;
+ l = r ^ F(l, ks[4]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("r3: %016I64x %016I64x\n", l, lp);
+#endif
+
+ // r = 4
+ r = l;
+ l = lp ^ F(l, ks[5]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("r4: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 5
+ lp = l;
+ l = r ^ F(l, ks[6]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("r5: %016I64x %016I64x\n", l, lp);
+#endif
+
+ // r = 6
+ r = l;
+ l = lp ^ F(l, ks[7]);
+ l = FL(l, ks[8]);
+ r = FL1(r, ks[9]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("r6: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 7
+ lp = l;
+ l = r ^ F(l, ks[10]);
+
+ // r = 8
+ r = l;
+ l = lp ^ F(l, ks[11]);
+
+ // r = 9
+ lp = l;
+ l = r ^ F(l, ks[12]);
+
+ // r = 10
+ r = l;
+ l = lp ^ F(l, ks[13]);
+
+ // r = 11
+ lp = l;
+ l = r ^ F(l, ks[14]);
+
+ // r = 12
+ r = l;
+ l = lp ^ F(l, ks[15]);
+ l = FL(l, ks[16]);
+ r = FL1(r, ks[17]);
+
+ // r = 13
+ lp = l;
+ l = r ^ F(l, ks[18]);
+
+ // r = 14
+ r = l;
+ l = lp ^ F(l, ks[19]);
+
+ // r = 15
+ lp = l;
+ l = r ^ F(l, ks[20]);
+
+ // r = 16
+ r = l;
+ l = lp ^ F(l, ks[21]);
+
+ // r = 17
+ lp = l;
+ l = r ^ F(l, ks[22]);
+
+ // r = 18
+ r = l;
+ l = lp ^ F(l, ks[23]);
+ l = FL(l, ks[24]);
+ r = FL1(r, ks[25]);
+
+ // r = 19
+ lp = l;
+ l = r ^ F(l, ks[26]);
+
+ // r = 20
+ r = l;
+ l = lp ^ F(l, ks[27]);
+
+ // r = 21
+ lp = l;
+ l = r ^ F(l, ks[28]);
+
+ // r = 22
+ r = l;
+ l = lp ^ F(l, ks[29]);
+
+ // r = 23
+ lp = l;
+ l = r ^ F(l, ks[30]);
+
+ // r = 24
+ r = l;
+ l = lp ^ F(l, ks[31]);
+
+ r ^= ks[32];
+ l ^= ks[33];
+
+ *(uint64*)out = bswap_64(r);
+ *(uint64*)(out + 8) = bswap_64(l);
+}
+
+
+void camellia_decrypt(const unsigned __int8 *in, unsigned __int8 *out, unsigned __int8 *ksPtr)
+{
+ uint64 *ks = (uint64 *) ksPtr;
+ uint64 r = bswap_64(*((uint64*)in)) ^ ks[32];
+ uint64 l = bswap_64(*((uint64*)(in + 8))) ^ ks[33];
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 24
+ uint64 rp = r;
+ r = l ^ F(r, ks[31]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", rp, r);
+#endif
+
+ // r = 23
+ l = r;
+ r = rp ^ F(r, ks[30]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 22
+ rp = r;
+ r = l ^ F(r, ks[29]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", rp, r);
+#endif
+
+ // r = 21
+ l = r;
+ r = rp ^ F(r, ks[28]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 20
+ rp = r;
+ r = l ^ F(r, ks[27]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", rp, r);
+#endif
+
+ // r = 19
+ l = r;
+ r = rp ^ F(r, ks[26]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", l, r);
+#endif
+ l = FL1(l, ks[24]);
+ r = FL(r, ks[25]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPTFL: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 18
+ rp = r;
+ r = l ^ F(r, ks[23]);
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT18: %016I64x %016I64x\n", rp, r);
+#endif
+
+ // r = 17
+ l = r;
+ r = rp ^ F(r, ks[22]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 16
+ rp = r;
+ r = l ^ F(r, ks[21]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", rp, r);
+#endif
+
+ // r = 15
+ l = r;
+ r = rp ^ F(r, ks[20]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 14
+ rp = r;
+ r = l ^ F(r, ks[19]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", rp, r);
+#endif
+
+ // r = 13
+ l = r;
+ r = rp ^ F(r, ks[18]);
+ l = FL1(l, ks[16]);
+ r = FL(r, ks[17]);
+
+#ifdef CPPCRYPTO_DEBUG
+ printf("DECRYPT: %016I64x %016I64x\n", l, r);
+#endif
+
+ // r = 12
+ rp = r;
+ r = l ^ F(r, ks[15]);
+
+ // r = 11
+ l = r;
+ r = rp ^ F(r, ks[14]);
+
+ // r = 10
+ rp = r;
+ r = l ^ F(r, ks[13]);
+
+ // r = 9
+ l = r;
+ r = rp ^ F(r, ks[12]);
+
+ // r = 8
+ rp = r;
+ r = l ^ F(r, ks[11]);
+
+ // r = 7
+ l = r;
+ r = rp ^ F(r, ks[10]);
+ l = FL1(l, ks[8]);
+ r = FL(r, ks[9]);
+
+ // r = 6
+ rp = r;
+ r = l ^ F(r, ks[7]);
+
+ // r = 5
+ l = r;
+ r = rp ^ F(r, ks[6]);
+
+ // r = 4
+ rp = r;
+ r = l ^ F(r, ks[5]);
+
+ // r = 3
+ l = r;
+ r = rp ^ F(r, ks[4]);
+
+ // r = 2
+ rp = r;
+ r = l ^ F(r, ks[3]);
+
+ // r = 1
+ l = r;
+ r = rp ^ F(r, ks[2]);
+
+ // r = 0
+ l ^= ks[0];
+ r ^= ks[1];
+
+ *(uint64*)out = bswap_64(l);
+ *(uint64*)(out + 8) = bswap_64(r);
+}
diff --git a/src/Crypto/Camellia.h b/src/Crypto/Camellia.h
new file mode 100644
index 00000000..75e89b5f
--- /dev/null
+++ b/src/Crypto/Camellia.h
@@ -0,0 +1,23 @@
+#ifndef HEADER_Crypto_Camellia
+#define HEADER_Crypto_Camellia
+
+#include "Common/Tcdefs.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define CAMELLIA_KS 34 * 8
+
+/* userKey is always 32-bytes long */
+/* size of ks is 34*8 bytes */
+void camellia_set_key(const unsigned __int8 userKey[], unsigned __int8 *ks);
+void camellia_encrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks);
+void camellia_decrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // HEADER_Crypto_Camellia
diff --git a/src/Crypto/CamelliaSmall.c b/src/Crypto/CamelliaSmall.c
new file mode 100644
index 00000000..8ba7ed74
--- /dev/null
+++ b/src/Crypto/CamelliaSmall.c
@@ -0,0 +1,455 @@
+/*
+ * Camellia implementation
+ *
+ * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This file is part of mbed TLS (https://tls.mbed.org)
+ */
+/*
+ * The Camellia block cipher was designed by NTT and Mitsubishi Electric
+ * Corporation.
+ *
+ * http://info.isl.ntt.co.jp/crypt/eng/camellia/dl/01espec.pdf
+ */
+
+/* Adapted for VeraCrypt */
+
+#ifdef TC_WINDOWS_BOOT
+#pragma optimize ("t", on)
+#endif
+
+#include "camelliaSmall.h"
+#include <memory.h>
+
+
+//#define MBEDTLS_CAMELLIA_SMALL_MEMORY
+
+/*
+ * 32-bit integer manipulation macros (big endian)
+ */
+#ifndef GET_UINT32_BE
+#define GET_UINT32_BE(n,b,i) \
+{ \
+ (n) = ( (unsigned __int32) (b)[(i) ] << 24 ) \
+ | ( (unsigned __int32) (b)[(i) + 1] << 16 ) \
+ | ( (unsigned __int32) (b)[(i) + 2] << 8 ) \
+ | ( (unsigned __int32) (b)[(i) + 3] ); \
+}
+#endif
+
+#ifndef PUT_UINT32_BE
+#define PUT_UINT32_BE(n,b,i) \
+{ \
+ (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \
+ (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \
+ (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \
+ (b)[(i) + 3] = (unsigned char) ( (n) ); \
+}
+#endif
+
+static const unsigned char SIGMA_CHARS[6][8] =
+{
+ { 0xa0, 0x9e, 0x66, 0x7f, 0x3b, 0xcc, 0x90, 0x8b },
+ { 0xb6, 0x7a, 0xe8, 0x58, 0x4c, 0xaa, 0x73, 0xb2 },
+ { 0xc6, 0xef, 0x37, 0x2f, 0xe9, 0x4f, 0x82, 0xbe },
+ { 0x54, 0xff, 0x53, 0xa5, 0xf1, 0xd3, 0x6f, 0x1c },
+ { 0x10, 0xe5, 0x27, 0xfa, 0xde, 0x68, 0x2d, 0x1d },
+ { 0xb0, 0x56, 0x88, 0xc2, 0xb3, 0xe6, 0xc1, 0xfd }
+};
+
+#if defined(MBEDTLS_CAMELLIA_SMALL_MEMORY)
+
+static const unsigned char FSb[256] =
+{
+ 112,130, 44,236,179, 39,192,229,228,133, 87, 53,234, 12,174, 65,
+ 35,239,107,147, 69, 25,165, 33,237, 14, 79, 78, 29,101,146,189,
+ 134,184,175,143,124,235, 31,206, 62, 48,220, 95, 94,197, 11, 26,
+ 166,225, 57,202,213, 71, 93, 61,217, 1, 90,214, 81, 86,108, 77,
+ 139, 13,154,102,251,204,176, 45,116, 18, 43, 32,240,177,132,153,
+ 223, 76,203,194, 52,126,118, 5,109,183,169, 49,209, 23, 4,215,
+ 20, 88, 58, 97,222, 27, 17, 28, 50, 15,156, 22, 83, 24,242, 34,
+ 254, 68,207,178,195,181,122,145, 36, 8,232,168, 96,252,105, 80,
+ 170,208,160,125,161,137, 98,151, 84, 91, 30,149,224,255,100,210,
+ 16,196, 0, 72,163,247,117,219,138, 3,230,218, 9, 63,221,148,
+ 135, 92,131, 2,205, 74,144, 51,115,103,246,243,157,127,191,226,
+ 82,155,216, 38,200, 55,198, 59,129,150,111, 75, 19,190, 99, 46,
+ 233,121,167,140,159,110,188,142, 41,245,249,182, 47,253,180, 89,
+ 120,152, 6,106,231, 70,113,186,212, 37,171, 66,136,162,141,250,
+ 114, 7,185, 85,248,238,172, 10, 54, 73, 42,104, 60, 56,241,164,
+ 64, 40,211,123,187,201, 67,193, 21,227,173,244,119,199,128,158
+};
+
+#define SBOX1(n) FSb[(n)]
+#define SBOX2(n) (unsigned char)((FSb[(n)] >> 7 ^ FSb[(n)] << 1) & 0xff)
+#define SBOX3(n) (unsigned char)((FSb[(n)] >> 1 ^ FSb[(n)] << 7) & 0xff)
+#define SBOX4(n) FSb[((n) << 1 ^ (n) >> 7) &0xff]
+
+#else /* MBEDTLS_CAMELLIA_SMALL_MEMORY */
+
+static const unsigned char FSb[256] =
+{
+ 112, 130, 44, 236, 179, 39, 192, 229, 228, 133, 87, 53, 234, 12, 174, 65,
+ 35, 239, 107, 147, 69, 25, 165, 33, 237, 14, 79, 78, 29, 101, 146, 189,
+ 134, 184, 175, 143, 124, 235, 31, 206, 62, 48, 220, 95, 94, 197, 11, 26,
+ 166, 225, 57, 202, 213, 71, 93, 61, 217, 1, 90, 214, 81, 86, 108, 77,
+ 139, 13, 154, 102, 251, 204, 176, 45, 116, 18, 43, 32, 240, 177, 132, 153,
+ 223, 76, 203, 194, 52, 126, 118, 5, 109, 183, 169, 49, 209, 23, 4, 215,
+ 20, 88, 58, 97, 222, 27, 17, 28, 50, 15, 156, 22, 83, 24, 242, 34,
+ 254, 68, 207, 178, 195, 181, 122, 145, 36, 8, 232, 168, 96, 252, 105, 80,
+ 170, 208, 160, 125, 161, 137, 98, 151, 84, 91, 30, 149, 224, 255, 100, 210,
+ 16, 196, 0, 72, 163, 247, 117, 219, 138, 3, 230, 218, 9, 63, 221, 148,
+ 135, 92, 131, 2, 205, 74, 144, 51, 115, 103, 246, 243, 157, 127, 191, 226,
+ 82, 155, 216, 38, 200, 55, 198, 59, 129, 150, 111, 75, 19, 190, 99, 46,
+ 233, 121, 167, 140, 159, 110, 188, 142, 41, 245, 249, 182, 47, 253, 180, 89,
+ 120, 152, 6, 106, 231, 70, 113, 186, 212, 37, 171, 66, 136, 162, 141, 250,
+ 114, 7, 185, 85, 248, 238, 172, 10, 54, 73, 42, 104, 60, 56, 241, 164,
+ 64, 40, 211, 123, 187, 201, 67, 193, 21, 227, 173, 244, 119, 199, 128, 158
+};
+
+static const unsigned char FSb2[256] =
+{
+ 224, 5, 88, 217, 103, 78, 129, 203, 201, 11, 174, 106, 213, 24, 93, 130,
+ 70, 223, 214, 39, 138, 50, 75, 66, 219, 28, 158, 156, 58, 202, 37, 123,
+ 13, 113, 95, 31, 248, 215, 62, 157, 124, 96, 185, 190, 188, 139, 22, 52,
+ 77, 195, 114, 149, 171, 142, 186, 122, 179, 2, 180, 173, 162, 172, 216, 154,
+ 23, 26, 53, 204, 247, 153, 97, 90, 232, 36, 86, 64, 225, 99, 9, 51,
+ 191, 152, 151, 133, 104, 252, 236, 10, 218, 111, 83, 98, 163, 46, 8, 175,
+ 40, 176, 116, 194, 189, 54, 34, 56, 100, 30, 57, 44, 166, 48, 229, 68,
+ 253, 136, 159, 101, 135, 107, 244, 35, 72, 16, 209, 81, 192, 249, 210, 160,
+ 85, 161, 65, 250, 67, 19, 196, 47, 168, 182, 60, 43, 193, 255, 200, 165,
+ 32, 137, 0, 144, 71, 239, 234, 183, 21, 6, 205, 181, 18, 126, 187, 41,
+ 15, 184, 7, 4, 155, 148, 33, 102, 230, 206, 237, 231, 59, 254, 127, 197,
+ 164, 55, 177, 76, 145, 110, 141, 118, 3, 45, 222, 150, 38, 125, 198, 92,
+ 211, 242, 79, 25, 63, 220, 121, 29, 82, 235, 243, 109, 94, 251, 105, 178,
+ 240, 49, 12, 212, 207, 140, 226, 117, 169, 74, 87, 132, 17, 69, 27, 245,
+ 228, 14, 115, 170, 241, 221, 89, 20, 108, 146, 84, 208, 120, 112, 227, 73,
+ 128, 80, 167, 246, 119, 147, 134, 131, 42, 199, 91, 233, 238, 143, 1, 61
+};
+
+static const unsigned char FSb3[256] =
+{
+ 56, 65, 22, 118, 217, 147, 96, 242, 114, 194, 171, 154, 117, 6, 87, 160,
+ 145, 247, 181, 201, 162, 140, 210, 144, 246, 7, 167, 39, 142, 178, 73, 222,
+ 67, 92, 215, 199, 62, 245, 143, 103, 31, 24, 110, 175, 47, 226, 133, 13,
+ 83, 240, 156, 101, 234, 163, 174, 158, 236, 128, 45, 107, 168, 43, 54, 166,
+ 197, 134, 77, 51, 253, 102, 88, 150, 58, 9, 149, 16, 120, 216, 66, 204,
+ 239, 38, 229, 97, 26, 63, 59, 130, 182, 219, 212, 152, 232, 139, 2, 235,
+ 10, 44, 29, 176, 111, 141, 136, 14, 25, 135, 78, 11, 169, 12, 121, 17,
+ 127, 34, 231, 89, 225, 218, 61, 200, 18, 4, 116, 84, 48, 126, 180, 40,
+ 85, 104, 80, 190, 208, 196, 49, 203, 42, 173, 15, 202, 112, 255, 50, 105,
+ 8, 98, 0, 36, 209, 251, 186, 237, 69, 129, 115, 109, 132, 159, 238, 74,
+ 195, 46, 193, 1, 230, 37, 72, 153, 185, 179, 123, 249, 206, 191, 223, 113,
+ 41, 205, 108, 19, 100, 155, 99, 157, 192, 75, 183, 165, 137, 95, 177, 23,
+ 244, 188, 211, 70, 207, 55, 94, 71, 148, 250, 252, 91, 151, 254, 90, 172,
+ 60, 76, 3, 53, 243, 35, 184, 93, 106, 146, 213, 33, 68, 81, 198, 125,
+ 57, 131, 220, 170, 124, 119, 86, 5, 27, 164, 21, 52, 30, 28, 248, 82,
+ 32, 20, 233, 189, 221, 228, 161, 224, 138, 241, 214, 122, 187, 227, 64, 79
+};
+
+static const unsigned char FSb4[256] =
+{
+ 112, 44, 179, 192, 228, 87, 234, 174, 35, 107, 69, 165, 237, 79, 29, 146,
+ 134, 175, 124, 31, 62, 220, 94, 11, 166, 57, 213, 93, 217, 90, 81, 108,
+ 139, 154, 251, 176, 116, 43, 240, 132, 223, 203, 52, 118, 109, 169, 209, 4,
+ 20, 58, 222, 17, 50, 156, 83, 242, 254, 207, 195, 122, 36, 232, 96, 105,
+ 170, 160, 161, 98, 84, 30, 224, 100, 16, 0, 163, 117, 138, 230, 9, 221,
+ 135, 131, 205, 144, 115, 246, 157, 191, 82, 216, 200, 198, 129, 111, 19, 99,
+ 233, 167, 159, 188, 41, 249, 47, 180, 120, 6, 231, 113, 212, 171, 136, 141,
+ 114, 185, 248, 172, 54, 42, 60, 241, 64, 211, 187, 67, 21, 173, 119, 128,
+ 130, 236, 39, 229, 133, 53, 12, 65, 239, 147, 25, 33, 14, 78, 101, 189,
+ 184, 143, 235, 206, 48, 95, 197, 26, 225, 202, 71, 61, 1, 214, 86, 77,
+ 13, 102, 204, 45, 18, 32, 177, 153, 76, 194, 126, 5, 183, 49, 23, 215,
+ 88, 97, 27, 28, 15, 22, 24, 34, 68, 178, 181, 145, 8, 168, 252, 80,
+ 208, 125, 137, 151, 91, 149, 255, 210, 196, 72, 247, 219, 3, 218, 63, 148,
+ 92, 2, 74, 51, 103, 243, 127, 226, 155, 38, 55, 59, 150, 75, 190, 46,
+ 121, 140, 110, 142, 245, 182, 253, 89, 152, 106, 70, 186, 37, 66, 162, 250,
+ 7, 85, 238, 10, 73, 104, 56, 164, 40, 123, 201, 193, 227, 244, 199, 158
+};
+
+#define SBOX1(n) FSb[(n)]
+#define SBOX2(n) FSb2[(n)]
+#define SBOX3(n) FSb3[(n)]
+#define SBOX4(n) FSb4[(n)]
+
+#endif /* MBEDTLS_CAMELLIA_SMALL_MEMORY */
+
+static const unsigned char shifts[4][4] =
+{
+ { 1, 0, 1, 1 }, /* KL */
+ { 1, 1, 0, 1 }, /* KR */
+ { 1, 1, 1, 0 }, /* KA */
+ { 1, 1, 0, 1 } /* KB */
+};
+
+static const signed char indexes[4][20] =
+{
+ { 0, 1, 2, 3, 61, 62, 63, 60, -1, -1,
+ -1, -1, 27, 24, 25, 26, 35, 32, 33, 34 }, /* KL -> RK */
+ { -1, -1, -1, -1, 8, 9, 10, 11, 16, 17,
+ 18, 19, -1, -1, -1, -1, 39, 36, 37, 38 }, /* KR -> RK */
+ { -1, -1, -1, -1, 12, 13, 14, 15, 58, 59,
+ 56, 57, 31, 28, 29, 30, -1, -1, -1, -1 }, /* KA -> RK */
+ { 4, 5, 6, 7, 65, 66, 67, 64, 20, 21,
+ 22, 23, -1, -1, -1, -1, 43, 40, 41, 42 } /* KB -> RK */
+};
+
+static const signed char transposes[20] =
+{
+ 25, 26, 27, 24,
+ 29, 30, 31, 28,
+ 18, 19, 16, 17,
+ -1, -1, -1, -1,
+ -1, -1, -1, -1
+};
+
+/* Shift macro for 128 bit strings with rotation smaller than 32 bits (!) */
+#define ROTL(DEST, SRC, SHIFT) \
+{ \
+ (DEST)[0] = (SRC)[0] << (SHIFT) ^ (SRC)[1] >> (32 - (SHIFT)); \
+ (DEST)[1] = (SRC)[1] << (SHIFT) ^ (SRC)[2] >> (32 - (SHIFT)); \
+ (DEST)[2] = (SRC)[2] << (SHIFT) ^ (SRC)[3] >> (32 - (SHIFT)); \
+ (DEST)[3] = (SRC)[3] << (SHIFT) ^ (SRC)[0] >> (32 - (SHIFT)); \
+}
+
+#define FL(XL, XR, KL, KR) \
+{ \
+ (XR) = ((((XL) & (KL)) << 1) | (((XL) & (KL)) >> 31)) ^ (XR); \
+ (XL) = ((XR) | (KR)) ^ (XL); \
+}
+
+#define FLInv(YL, YR, KL, KR) \
+{ \
+ (YL) = ((YR) | (KR)) ^ (YL); \
+ (YR) = ((((YL) & (KL)) << 1) | (((YL) & (KL)) >> 31)) ^ (YR); \
+}
+
+#define SHIFT_AND_PLACE(OFFSET) \
+{ \
+ TK[0] = KC[(OFFSET) * 4 + 0]; \
+ TK[1] = KC[(OFFSET) * 4 + 1]; \
+ TK[2] = KC[(OFFSET) * 4 + 2]; \
+ TK[3] = KC[(OFFSET) * 4 + 3]; \
+ \
+ for( i = 1; i <= 4; i++ ) \
+ if( shifts[(OFFSET)][i -1] ) \
+ ROTL(TK + i * 4, TK, ( 15 * i ) % 32); \
+ \
+ for( i = 0; i < 20; i++ ) \
+ if( indexes[(OFFSET)][i] != -1 ) { \
+ RK[indexes[(OFFSET)][i]] = TK[ i ]; \
+ } \
+}
+
+static void camellia_feistel( const unsigned __int32 x[2], const unsigned __int32 k[2],
+ unsigned __int32 z[2])
+{
+ unsigned __int32 I0, I1;
+ I0 = x[0] ^ k[0];
+ I1 = x[1] ^ k[1];
+
+ I0 = ((unsigned __int32) SBOX1((I0 >> 24) & 0xFF) << 24) |
+ ((unsigned __int32) SBOX2((I0 >> 16) & 0xFF) << 16) |
+ ((unsigned __int32) SBOX3((I0 >> 8) & 0xFF) << 8) |
+ ((unsigned __int32) SBOX4((I0 ) & 0xFF) );
+ I1 = ((unsigned __int32) SBOX2((I1 >> 24) & 0xFF) << 24) |
+ ((unsigned __int32) SBOX3((I1 >> 16) & 0xFF) << 16) |
+ ((unsigned __int32) SBOX4((I1 >> 8) & 0xFF) << 8) |
+ ((unsigned __int32) SBOX1((I1 ) & 0xFF) );
+
+ I0 ^= (I1 << 8) | (I1 >> 24);
+ I1 ^= (I0 << 16) | (I0 >> 16);
+ I0 ^= (I1 >> 8) | (I1 << 24);
+ I1 ^= (I0 >> 8) | (I0 << 24);
+
+ z[0] ^= I1;
+ z[1] ^= I0;
+}
+
+/*
+ * Camellia key schedule (encryption)
+ */
+void mbedtls_camellia_setkey_enc( const unsigned char *key, unsigned __int32 *RK)
+{
+ int i;
+ unsigned char t[64];
+ unsigned __int32 SIGMA[6][2];
+ unsigned __int32 KC[16];
+ unsigned __int32 TK[20];
+
+ memset( t, 0, 64 );
+ memset( RK, 0, CAMELLIA_KS/2 );
+
+ for( i = 0; i < 32; ++i )
+ t[i] = key[i];
+
+ /*
+ * Prepare SIGMA values
+ */
+ for( i = 0; i < 6; i++ ) {
+ GET_UINT32_BE( SIGMA[i][0], SIGMA_CHARS[i], 0 );
+ GET_UINT32_BE( SIGMA[i][1], SIGMA_CHARS[i], 4 );
+ }
+
+ /*
+ * Key storage in KC
+ * Order: KL, KR, KA, KB
+ */
+ memset( KC, 0, sizeof(KC) );
+
+ /* Store KL, KR */
+ for( i = 0; i < 8; i++ )
+ GET_UINT32_BE( KC[i], t, i * 4 );
+
+ /* Generate KA */
+ for( i = 0; i < 4; ++i )
+ KC[8 + i] = KC[i] ^ KC[4 + i];
+
+ camellia_feistel( KC + 8, SIGMA[0], KC + 10 );
+ camellia_feistel( KC + 10, SIGMA[1], KC + 8 );
+
+ for( i = 0; i < 4; ++i )
+ KC[8 + i] ^= KC[i];
+
+ camellia_feistel( KC + 8, SIGMA[2], KC + 10 );
+ camellia_feistel( KC + 10, SIGMA[3], KC + 8 );
+
+ /* Generate KB */
+ for( i = 0; i < 4; ++i )
+ KC[12 + i] = KC[4 + i] ^ KC[8 + i];
+
+ camellia_feistel( KC + 12, SIGMA[4], KC + 14 );
+ camellia_feistel( KC + 14, SIGMA[5], KC + 12 );
+
+ /*
+ * Generating subkeys
+ */
+
+ /* Manipulating KL */
+ SHIFT_AND_PLACE( 0 );
+
+ /* Manipulating KR */
+ SHIFT_AND_PLACE( 1 );
+
+ /* Manipulating KA */
+ SHIFT_AND_PLACE( 2 );
+
+ /* Manipulating KB */
+ SHIFT_AND_PLACE( 3 );
+
+ /* Do transpositions */
+ for( i = 0; i < 20; i++ ) {
+ if( transposes[i] != -1 ) {
+ RK[32 + 12 + i] = RK[transposes[i]];
+ }
+ }
+}
+
+/*
+ * Camellia key schedule (decryption)
+ */
+void camellia_set_key(const unsigned __int8 key[], unsigned __int8 *ks)
+{
+ int i;
+ unsigned __int32 *RK = (unsigned __int32 *) (ks + (CAMELLIA_KS /2));
+ unsigned __int32 *SK;
+
+ mbedtls_camellia_setkey_enc( key, (unsigned __int32 *) ks );
+
+ SK = ((unsigned __int32 *) ks) + 24 * 2 + 8 * 2;
+
+ *RK++ = *SK++;
+ *RK++ = *SK++;
+ *RK++ = *SK++;
+ *RK++ = *SK++;
+
+ for( i = 22 + 8, SK -= 6; i > 0; i--, SK -= 4 )
+ {
+ *RK++ = *SK++;
+ *RK++ = *SK++;
+ }
+
+ SK -= 2;
+
+ *RK++ = *SK++;
+ *RK++ = *SK++;
+ *RK++ = *SK++;
+ *RK++ = *SK++;
+}
+
+/*
+ * Camellia-ECB block encryption/decryption
+ */
+void mbedtls_camellia_crypt_ecb(const unsigned __int8 *input,
+ unsigned __int8 *output, unsigned __int8 * ks)
+{
+ int NR = 4;
+ unsigned __int32 *RK = (unsigned __int32 *) ks;
+ unsigned __int32 X[4];
+
+ GET_UINT32_BE( X[0], input, 0 );
+ GET_UINT32_BE( X[1], input, 4 );
+ GET_UINT32_BE( X[2], input, 8 );
+ GET_UINT32_BE( X[3], input, 12 );
+
+ X[0] ^= *RK++;
+ X[1] ^= *RK++;
+ X[2] ^= *RK++;
+ X[3] ^= *RK++;
+
+ while( NR ) {
+ --NR;
+ camellia_feistel( X, RK, X + 2 );
+ RK += 2;
+ camellia_feistel( X + 2, RK, X );
+ RK += 2;
+ camellia_feistel( X, RK, X + 2 );
+ RK += 2;
+ camellia_feistel( X + 2, RK, X );
+ RK += 2;
+ camellia_feistel( X, RK, X + 2 );
+ RK += 2;
+ camellia_feistel( X + 2, RK, X );
+ RK += 2;
+
+ if( NR ) {
+ FL(X[0], X[1], RK[0], RK[1]);
+ RK += 2;
+ FLInv(X[2], X[3], RK[0], RK[1]);
+ RK += 2;
+ }
+ }
+
+ X[2] ^= *RK++;
+ X[3] ^= *RK++;
+ X[0] ^= *RK++;
+ X[1] ^= *RK++;
+
+ PUT_UINT32_BE( X[2], output, 0 );
+ PUT_UINT32_BE( X[3], output, 4 );
+ PUT_UINT32_BE( X[0], output, 8 );
+ PUT_UINT32_BE( X[1], output, 12 );
+}
+
+void camellia_encrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks)
+{
+ mbedtls_camellia_crypt_ecb (inBlock, outBlock, ks);
+}
+
+void camellia_decrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks)
+{
+ mbedtls_camellia_crypt_ecb (inBlock, outBlock, ks + (CAMELLIA_KS / 2));
+}
+
diff --git a/src/Crypto/CamelliaSmall.h b/src/Crypto/CamelliaSmall.h
new file mode 100644
index 00000000..3781ac02
--- /dev/null
+++ b/src/Crypto/CamelliaSmall.h
@@ -0,0 +1,23 @@
+#ifndef SMALL_CAMELLIA_H
+#define SMALL_CAMELLIA_H
+
+#include "Common/Tcdefs.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define CAMELLIA_KS 34 * 8 * 2
+
+/* userKey is always 32-bytes long */
+/* size of ks is 34 */
+void camellia_set_key(const unsigned __int8 userKey[], unsigned __int8 *ks);
+void camellia_encrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks);
+void camellia_decrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* camellia.h */
diff --git a/src/Crypto/Crypto.vcproj b/src/Crypto/Crypto.vcproj
index 50f67a11..15c5c4fb 100644
--- a/src/Crypto/Crypto.vcproj
+++ b/src/Crypto/Crypto.vcproj
@@ -427,10 +427,60 @@
>
</File>
<File
+ RelativePath=".\Camellia.c"
+ >
+ </File>
+ <File
RelativePath=".\cpu.c"
>
</File>
<File
+ RelativePath=".\Gost89_x64.asm"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo $(InputFileName) &amp; nasm.exe -Xvc -f win64 -Ox -o &quot;$(TargetDir)\$(InputName).obj&quot; -l &quot;$(TargetDir)\$(InputName).lst&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+ Outputs="$(TargetDir)\$(InputName).obj"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ CommandLine="echo $(InputFileName) &amp; nasm.exe -Xvc -f win64 -Ox -o &quot;$(TargetDir)\$(InputName).obj&quot; -l &quot;$(TargetDir)\$(InputName).lst&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+ Outputs="$(TargetDir)\$(InputName).obj"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\GostCipher.c"
+ >
+ </File>
+ <File
+ RelativePath=".\kuznyechik.c"
+ >
+ </File>
+ <File
RelativePath=".\Rmd160.c"
>
</File>
@@ -443,6 +493,10 @@
>
</File>
<File
+ RelativePath=".\Streebog.c"
+ >
+ </File>
+ <File
RelativePath=".\Twofish.c"
>
</File>
@@ -473,6 +527,10 @@
>
</File>
<File
+ RelativePath=".\Camellia.h"
+ >
+ </File>
+ <File
RelativePath=".\config.h"
>
</File>
@@ -481,6 +539,14 @@
>
</File>
<File
+ RelativePath=".\GostCipher.h"
+ >
+ </File>
+ <File
+ RelativePath=".\kuznyechik.h"
+ >
+ </File>
+ <File
RelativePath=".\misc.h"
>
</File>
@@ -497,6 +563,10 @@
>
</File>
<File
+ RelativePath=".\Streebog.h"
+ >
+ </File>
+ <File
RelativePath=".\Twofish.h"
>
</File>
diff --git a/src/Crypto/Crypto.vcxproj b/src/Crypto/Crypto.vcxproj
new file mode 100644
index 00000000..3db1e789
--- /dev/null
+++ b/src/Crypto/Crypto.vcxproj
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{993245CF-6B70-47EE-91BB-39F8FC6DC0E7}</ProjectGuid>
+ <RootNamespace>Crypto</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(ProjectDir)\..;$(ProjectDir)\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;DEBUG;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4100;4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Lib>
+ <OutputFile>$(OutDir)Crypto.lib</OutputFile>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(ProjectDir)\..;$(ProjectDir)\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;DEBUG;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4100;4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Lib>
+ <OutputFile>$(OutDir)Crypto.lib</OutputFile>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>$(ProjectDir)\..;$(ProjectDir)\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4100;4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Lib>
+ <OutputFile>$(OutDir)Crypto.lib</OutputFile>
+ <AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>$(ProjectDir)\..;$(ProjectDir)\..\Common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4100;4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Lib>
+ <OutputFile>$(OutDir)Crypto.lib</OutputFile>
+ <AdditionalLibraryDirectories>$(TargetDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <CustomBuild Include="Aes_hw_cpu.asm">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ </CustomBuild>
+ <CustomBuild Include="Aes_x64.asm">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ </CustomBuild>
+ <CustomBuild Include="Aes_x86.asm">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox --prefix _ -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ </CustomBuild>
+ <CustomBuild Include="Gost89_x64.asm">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -o "$(TargetDir)\%(Filename).obj" -l "$(TargetDir)\%(Filename).lst" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="Aeskey.c" />
+ <ClCompile Include="Aestab.c" />
+ <ClCompile Include="Camellia.c" />
+ <ClCompile Include="cpu.c" />
+ <ClCompile Include="GostCipher.c" />
+ <ClCompile Include="kuznyechik.c" />
+ <ClCompile Include="Rmd160.c" />
+ <ClCompile Include="Serpent.c" />
+ <ClCompile Include="Sha2.c" />
+ <ClCompile Include="Streebog.c" />
+ <ClCompile Include="Twofish.c" />
+ <ClCompile Include="Whirlpool.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Aes.h" />
+ <ClInclude Include="Aes_hw_cpu.h" />
+ <ClInclude Include="Aesopt.h" />
+ <ClInclude Include="Aestab.h" />
+ <ClInclude Include="Camellia.h" />
+ <ClInclude Include="config.h" />
+ <ClInclude Include="cpu.h" />
+ <ClInclude Include="GostCipher.h" />
+ <ClInclude Include="kuznyechik.h" />
+ <ClInclude Include="misc.h" />
+ <ClInclude Include="Rmd160.h" />
+ <ClInclude Include="Serpent.h" />
+ <ClInclude Include="Sha2.h" />
+ <ClInclude Include="Streebog.h" />
+ <ClInclude Include="Twofish.h" />
+ <ClInclude Include="Whirlpool.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Boot\Windows\Boot.vcxproj">
+ <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/Crypto/Crypto.vcxproj.filters b/src/Crypto/Crypto.vcxproj.filters
new file mode 100644
index 00000000..91e83c60
--- /dev/null
+++ b/src/Crypto/Crypto.vcxproj.filters
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="Aeskey.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Aestab.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Camellia.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="cpu.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Rmd160.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Serpent.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Sha2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Twofish.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Whirlpool.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="GostCipher.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="kuznyechik.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Streebog.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Aes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Aes_hw_cpu.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Aesopt.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Aestab.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Camellia.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="cpu.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="misc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Rmd160.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Serpent.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Sha2.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Twofish.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Whirlpool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="GostCipher.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="kuznyechik.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Streebog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="Aes_hw_cpu.asm">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="Aes_x64.asm">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="Aes_x86.asm">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="Gost89_x64.asm">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/Crypto/Crypto.vcxproj.user b/src/Crypto/Crypto.vcxproj.user
new file mode 100644
index 00000000..ace9a86a
--- /dev/null
+++ b/src/Crypto/Crypto.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project> \ No newline at end of file
diff --git a/src/Crypto/GostCipher.c b/src/Crypto/GostCipher.c
new file mode 100644
index 00000000..a745210f
--- /dev/null
+++ b/src/Crypto/GostCipher.c
@@ -0,0 +1,269 @@
+/** @file
+GOST89 implementation
+
+Copyright (c) 2016. Disk Cryptography Services for EFI (DCS), Alex Kolotnikov
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the Apache License, Version 2.0. The full text of the license may be found at
+https://opensource.org/licenses/Apache-2.0
+
+Dynamic SBOX idea is from GostCrypt project. Copyright (c) 2008-2011 TrueCrypt Developers Association
+**/
+
+
+
+#include "GostCipher.h"
+#include "Streebog.h"
+#include "common\Tcdefs.h"
+#include "cpu.h"
+
+#if defined(CIPHER_GOST89)
+
+// Crypto Pro
+byte S_CryptoPro[8][16] = {
+ {0x1,0x3,0xA,0x9,0x5,0xB,0x4,0xF,0x8,0x6,0x7,0xE,0xD,0x0,0x2,0xC},
+ {0xD,0xE,0x4,0x1,0x7,0x0,0x5,0xA,0x3,0xC,0x8,0xF,0x6,0x2,0x9,0xB},
+ {0x7,0x6,0x2,0x4,0xD,0x9,0xF,0x0,0xA,0x1,0x5,0xB,0x8,0xE,0xC,0x3},
+ {0x7,0x6,0x4,0xB,0x9,0xC,0x2,0xA,0x1,0x8,0x0,0xE,0xF,0xD,0x3,0x5},
+ {0x4,0xA,0x7,0xC,0x0,0xF,0x2,0x8,0xE,0x1,0x6,0x5,0xD,0xB,0x9,0x3},
+ {0x7,0xF,0xC,0xE,0x9,0x4,0x1,0x0,0x3,0xB,0x5,0x2,0x6,0xA,0x8,0xD},
+ {0x5,0xF,0x4,0x0,0x2,0xD,0xB,0x9,0x1,0x7,0x6,0x3,0xC,0xE,0xA,0x8},
+ {0xA,0x4,0x5,0x6,0x8,0x1,0x3,0x7,0xD,0xC,0xE,0x0,0x9,0x2,0xB,0xF}
+ };
+
+// TC26
+byte S_TC26[8][16] =
+{
+ { 0xc, 0x4, 0x6, 0x2, 0xa, 0x5, 0xb, 0x9, 0xe, 0x8, 0xd, 0x7, 0x0, 0x3, 0xf, 0x1 },
+ { 0x6, 0x8, 0x2, 0x3, 0x9, 0xa, 0x5, 0xc, 0x1, 0xe, 0x4, 0x7, 0xb, 0xd, 0x0, 0xf },
+ { 0xb, 0x3, 0x5, 0x8, 0x2, 0xf, 0xa, 0xd, 0xe, 0x1, 0x7, 0x4, 0xc, 0x9, 0x6, 0x0 },
+ { 0xc, 0x8, 0x2, 0x1, 0xd, 0x4, 0xf, 0x6, 0x7, 0x0, 0xa, 0x5, 0x3, 0xe, 0x9, 0xb },
+ { 0x7, 0xf, 0x5, 0xa, 0x8, 0x1, 0x6, 0xd, 0x0, 0x9, 0x3, 0xe, 0xb, 0x4, 0x2, 0xc },
+ { 0x5, 0xd, 0xf, 0x6, 0x9, 0x2, 0xc, 0xa, 0xb, 0x7, 0x8, 0x1, 0x4, 0x3, 0xe, 0x0 },
+ { 0x8, 0xe, 0x2, 0x5, 0x6, 0x9, 0x1, 0xc, 0xf, 0x4, 0xb, 0x0, 0xd, 0xa, 0x3, 0x7 },
+ { 0x1, 0x7, 0xe, 0xd, 0x0, 0x5, 0x8, 0x3, 0x4, 0xf, 0xa, 0x6, 0x9, 0xc, 0xb, 0x2 },
+};
+
+void gost_prepare_kds(gost_kds* kds) {
+ uint32 i;
+ // Build substitution tables.
+ for (i = 0; i < 256; ++i) {
+ uint32 p;
+ p = kds->sbox[7][i >> 4] << 4 | kds->sbox[6][i & 15];
+ p = p << 24; p = p << 11 | p >> 21;
+ kds->sbox_cvt[i] = p; // S87
+
+ p = kds->sbox[5][i >> 4] << 4 | kds->sbox[4][i & 15];
+ p = p << 16; p = p << 11 | p >> 21;
+ kds->sbox_cvt[256 + i] = p; // S65
+
+ p = kds->sbox[3][i >> 4] << 4 | kds->sbox[2][i & 15];
+ p = p << 8; p = p << 11 | p >> 21;
+ kds->sbox_cvt[256 * 2 + i] = p; // S43
+
+ p = kds->sbox[1][i >> 4] << 4 | kds->sbox[0][i & 15];
+ p = p << 11 | p >> 21;
+ kds->sbox_cvt[256 * 3 + i] = p; // S21
+ }
+}
+
+
+#ifdef GOST_DYNAMIC_SBOXES
+static void xor_s_box(byte s_box[8][16], byte *seed)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ {
+ s_box[1][i] ^= (seed[ (i * 4) + 0 ] ) & 0xF;
+ s_box[2][i] ^= (seed[ (i * 4) + 0 ]>>4) & 0xF;
+ s_box[3][i] ^= (seed[ (i * 4) + 1 ] ) & 0xF;
+ s_box[4][i] ^= (seed[ (i * 4) + 1 ]>>4) & 0xF;
+ s_box[5][i] ^= (seed[ (i * 4) + 2 ] ) & 0xF;
+ s_box[6][i] ^= (seed[ (i * 4) + 2 ]>>4) & 0xF;
+ s_box[7][i] ^= (seed[ (i * 4) + 3 ] ) & 0xF;
+ s_box[8][i] ^= (seed[ (i * 4) + 3 ]>>4) & 0xF;
+ }
+}
+#endif
+
+void gost_set_key(byte *key, gost_kds *ks)
+{
+#ifdef GOST_DYNAMIC_SBOXES
+ STREEBOG_CTX sctx;
+ byte sbox_seed[64];
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ NTSTATUS saveStatus = STATUS_SUCCESS;
+ if (HasSSE2() || HasSSE41())
+ saveStatus = KeSaveFloatingPointState (&floatingPointState);
+#endif
+#endif
+
+ memcpy(ks->key, key, GOST_KEYSIZE);
+ memcpy(ks->sbox, S_TC26, sizeof(ks->sbox));
+
+#ifdef GOST_DYNAMIC_SBOXES
+ //Generate pseudorandom data based on the key
+ STREEBOG_init(&sctx);
+ STREEBOG_add(&sctx, key, 32);
+ STREEBOG_finalize(&sctx, sbox_seed);
+
+#if defined (DEVICE_DRIVER) && !defined (_WIN64)
+ if (NT_SUCCESS (saveStatus) && (HasSSE2() || HasSSE41()))
+ KeRestoreFloatingPointState (&floatingPointState);
+#endif
+
+ xor_s_box(ks->sbox, sbox_seed);
+#endif
+
+ gost_prepare_kds(ks);
+}
+
+static uint32 f(uint32 v, uint32* sbox){
+ byte* x =(byte*) &v;
+ /* Do substitutions */
+ return sbox[x[3]] | sbox[256 + x[2]] | sbox[256*2 + x[1]] | sbox[256*3 + x[0]];
+}
+
+void gost_encrypt_block(uint64 in_, uint64* out_, gost_kds* kds) {
+ uint32* in = (uint32*)&in_;
+ uint32* out = (uint32*)out_;
+ uint32* key = (uint32*)kds->key;
+ uint32* sbox = kds->sbox_cvt;
+
+ // As named in the GOST
+ uint32 n1 = in[0];
+ uint32 n2 = in[1];
+
+ n2 ^= f(n1+key[0], sbox);
+ n1 ^= f(n2+key[1], sbox);
+ n2 ^= f(n1+key[2], sbox);
+ n1 ^= f(n2+key[3], sbox);
+ n2 ^= f(n1+key[4], sbox);
+ n1 ^= f(n2+key[5], sbox);
+ n2 ^= f(n1+key[6], sbox);
+ n1 ^= f(n2+key[7], sbox);
+
+ n2 ^= f(n1+key[0], sbox);
+ n1 ^= f(n2+key[1], sbox);
+ n2 ^= f(n1+key[2], sbox);
+ n1 ^= f(n2+key[3], sbox);
+ n2 ^= f(n1+key[4], sbox);
+ n1 ^= f(n2+key[5], sbox);
+ n2 ^= f(n1+key[6], sbox);
+ n1 ^= f(n2+key[7], sbox);
+
+ n2 ^= f(n1+key[0], sbox);
+ n1 ^= f(n2+key[1], sbox);
+ n2 ^= f(n1+key[2], sbox);
+ n1 ^= f(n2+key[3], sbox);
+ n2 ^= f(n1+key[4], sbox);
+ n1 ^= f(n2+key[5], sbox);
+ n2 ^= f(n1+key[6], sbox);
+ n1 ^= f(n2+key[7], sbox);
+
+ n2 ^= f(n1+key[7], sbox);
+ n1 ^= f(n2+key[6], sbox);
+ n2 ^= f(n1+key[5], sbox);
+ n1 ^= f(n2+key[4], sbox);
+ n2 ^= f(n1+key[3], sbox);
+ n1 ^= f(n2+key[2], sbox);
+ n2 ^= f(n1+key[1], sbox);
+ n1 ^= f(n2+key[0], sbox);
+
+ // There is no swap after the last round
+ out[0] = n2;
+ out[1] = n1;
+}
+
+void gost_decrypt_block(uint64 in_, uint64* out_, gost_kds* kds) {
+ uint32* in = (uint32*)&in_;
+ uint32* out = (uint32*)out_;
+ uint32* key = (uint32*)kds->key;
+ uint32* sbox = kds->sbox_cvt;
+
+ // As named in the GOST
+ uint32 n1 = in[0];
+ uint32 n2 = in[1];
+
+ n2 ^= f(n1+key[0], sbox);
+ n1 ^= f(n2+key[1], sbox);
+ n2 ^= f(n1+key[2], sbox);
+ n1 ^= f(n2+key[3], sbox);
+ n2 ^= f(n1+key[4], sbox);
+ n1 ^= f(n2+key[5], sbox);
+ n2 ^= f(n1+key[6], sbox);
+ n1 ^= f(n2+key[7], sbox);
+
+ n2 ^= f(n1+key[7], sbox);
+ n1 ^= f(n2+key[6], sbox);
+ n2 ^= f(n1+key[5], sbox);
+ n1 ^= f(n2+key[4], sbox);
+ n2 ^= f(n1+key[3], sbox);
+ n1 ^= f(n2+key[2], sbox);
+ n2 ^= f(n1+key[1], sbox);
+ n1 ^= f(n2+key[0], sbox);
+
+ n2 ^= f(n1+key[7], sbox);
+ n1 ^= f(n2+key[6], sbox);
+ n2 ^= f(n1+key[5], sbox);
+ n1 ^= f(n2+key[4], sbox);
+ n2 ^= f(n1+key[3], sbox);
+ n1 ^= f(n2+key[2], sbox);
+ n2 ^= f(n1+key[1], sbox);
+ n1 ^= f(n2+key[0], sbox);
+
+ n2 ^= f(n1+key[7], sbox);
+ n1 ^= f(n2+key[6], sbox);
+ n2 ^= f(n1+key[5], sbox);
+ n1 ^= f(n2+key[4], sbox);
+ n2 ^= f(n1+key[3], sbox);
+ n1 ^= f(n2+key[2], sbox);
+ n2 ^= f(n1+key[1], sbox);
+ n1 ^= f(n2+key[0], sbox);
+
+ out[0] = n2;
+ out[1] = n1;
+}
+
+#if defined(_M_AMD64)
+void gost_encrypt_128_CBC_asm(byte *in, byte *out, gost_kds *ks, uint64 count);
+void gost_decrypt_128_CBC_asm(byte *in, byte *out, gost_kds *ks, uint64 count);
+#endif
+
+void gost_encrypt(byte *in, byte *out, gost_kds *ks, int count) {
+#if defined(_M_AMD64)
+ gost_encrypt_128_CBC_asm(in, out, ks, (uint64)count);
+#else
+ while (count > 0) {
+ // encrypt two blocks in CBC mode
+ gost_encrypt_block(*((uint64*)in), (uint64*)out, ks);
+ *((gst_udword*)(out + 8)) = *((gst_udword*)(in + 8)) ^ *((gst_udword*)(out));
+ *((gst_udword*)(out + 12)) = *((gst_udword*)(in + 12)) ^ *((gst_udword*)(out + 4));
+ gost_encrypt_block(*((uint64*)(out + 8)), (uint64*)(out + 8), ks);
+ count--;
+ in += 16;
+ out += 16;
+ }
+#endif
+}
+
+void gost_decrypt(byte *in, byte *out, gost_kds *ks, int count) {
+#if defined(_M_AMD64)
+ gost_decrypt_128_CBC_asm(in, out, ks, (uint64)count);
+#else
+ while (count > 0) {
+ // decrypt two blocks in CBC mode
+ gost_decrypt_block(*((uint64*)(in + 8)), (uint64*)(out + 8), ks);
+ *((gst_udword*)(out + 8)) ^= *((gst_udword*)(in));;
+ *((gst_udword*)(out + 12)) ^= *((gst_udword*)(in + 4));;
+ gost_decrypt_block(*((uint64*)(in)), (uint64*)(out), ks);
+ count--;
+ in += 16;
+ out += 16;
+ }
+#endif
+}
+
+#endif \ No newline at end of file
diff --git a/src/Crypto/GostCipher.h b/src/Crypto/GostCipher.h
new file mode 100644
index 00000000..9b9e18b4
--- /dev/null
+++ b/src/Crypto/GostCipher.h
@@ -0,0 +1,61 @@
+
+/*
+ Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.
+
+ Governed by the TrueCrypt License 3.0 the full text of which is contained in
+ the file License.txt included in TrueCrypt binary and source code distribution
+ packages.
+*/
+
+
+
+#ifndef GOST_CIPHER_H
+#define GOST_CIPHER_H
+
+//In unsigned chars
+#define GOST_KEYSIZE 32
+#define GOST_BLOCKSIZE 8
+#define GOST_SBOX_SIZE 16
+
+//Production setting, but can be turned off to compare the algorithm with other implementations
+#define CIPHER_GOST89
+#define GOST_DYNAMIC_SBOXES
+
+#if defined(CIPHER_GOST89)
+
+#ifndef rotl32
+#define rotl32(b, shift) ((b << shift) | (b >> (32 - shift)))
+#endif
+
+typedef unsigned char byte;
+#ifdef GST_WINDOWS_BOOT
+typedef int gst_word;
+typedef long gst_dword;
+typedef unsigned int gst_uword;
+typedef unsigned long gst_udword;
+#else
+typedef short gst_word;
+typedef int gst_dword;
+typedef unsigned short gst_uword;
+typedef unsigned int gst_udword;
+#endif
+
+typedef struct gost_kds
+{
+ byte key[32];
+ gst_udword sbox_cvt[256 * 4];
+ byte sbox[8][16];
+} gost_kds;
+
+#define GOST_KS (sizeof(gost_kds))
+
+void gost_encrypt(byte *in, byte *out, gost_kds *ks, int count);
+void gost_decrypt(byte *in, byte *out, gost_kds *ks, int count);
+void gost_set_key(byte *key, gost_kds *ks);
+
+#else
+#define GOST_KS (0)
+#endif
+
+
+#endif
diff --git a/src/Crypto/Makefile.inc b/src/Crypto/Makefile.inc
index 955f2a76..bd5b80d9 100644
--- a/src/Crypto/Makefile.inc
+++ b/src/Crypto/Makefile.inc
@@ -8,6 +8,9 @@ TC_ASFLAGS = $(TC_ASFLAGS) -f win64
TC_ASM_ERR_LOG = ..\Driver\build_errors_asm.log
+"$(OBJ_PATH)\$(O)\gost89_$(TC_ARCH).obj": gost89_$(TC_ARCH).asm
+ nasm.exe $(TC_ASFLAGS) -o "$@" -l "$(OBJ_PATH)\$(O)\gost89_$(TC_ARCH).lst" gost89_$(TC_ARCH).asm 2>$(TC_ASM_ERR_LOG)
+
"$(OBJ_PATH)\$(O)\Aes_$(TC_ARCH).obj": Aes_$(TC_ARCH).asm
nasm.exe $(TC_ASFLAGS) -o "$@" -l "$(OBJ_PATH)\$(O)\Aes_$(TC_ARCH).lst" Aes_$(TC_ARCH).asm 2>$(TC_ASM_ERR_LOG)
diff --git a/src/Crypto/Rmd160.c b/src/Crypto/Rmd160.c
index 9387f9ba..386a1a80 100644
--- a/src/Crypto/Rmd160.c
+++ b/src/Crypto/Rmd160.c
@@ -9,13 +9,15 @@
/* Adapted for TrueCrypt */
/* Adapted for VeraCrypt */
-
+#if !defined(_UEFI)
#include <memory.h>
+#endif !defined(_UEFI)
+
#include "Common/Tcdefs.h"
#include "Common/Endian.h"
#include "Rmd160.h"
-#define F(x, y, z) (x ^ y ^ z)
+#define F(x, y, z) (x ^ y ^ z)
#define G(x, y, z) (z ^ (x & (y^z)))
#define H(x, y, z) (z ^ (x | ~y))
#define I(x, y, z) (y ^ (z & (x^y)))
@@ -300,7 +302,7 @@ void RMD160Transform (unsigned __int32 *digest, const unsigned __int32 *data)
Subround(J, b2, c2, d2, e2, a2, X[ 3], 12, k5);
Subround(J, a2, b2, c2, d2, e2, X[12], 6, k5);
- Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6);
+ Subround(I, e2, a2, b2, c2, d2, X[ 6], 9, k6);
Subround(I, d2, e2, a2, b2, c2, X[11], 13, k6);
Subround(I, c2, d2, e2, a2, b2, X[ 3], 15, k6);
Subround(I, b2, c2, d2, e2, a2, X[ 7], 7, k6);
@@ -383,7 +385,7 @@ void RMD160Transform (unsigned __int32 *digest, const unsigned __int32 *data)
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -454,7 +456,7 @@ void RMD160Transform (unsigned __int32 *state, const unsigned __int32 *data)
for (pos = 0; pos < 160; ++pos)
{
tmp = a + data[OrderTab[pos]] + KTab[pos >> 4];
-
+
switch (pos >> 4)
{
case 0: case 9: tmp += F (b, c, d); break;
diff --git a/src/Crypto/Serpent.c b/src/Crypto/Serpent.c
index 2db76deb..25bcea96 100644
--- a/src/Crypto/Serpent.c
+++ b/src/Crypto/Serpent.c
@@ -10,37 +10,39 @@
#include "Serpent.h"
#include "Common/Endian.h"
-#include <memory.h>
-
-#if defined(_WIN32) && !defined(_DEBUG)
+#ifdef TC_WINDOWS_BOOT
#include <stdlib.h>
-#define rotlFixed _rotl
-#define rotrFixed _rotr
+#pragma intrinsic(_lrotr,_lrotl)
+#define rotr32(x,n) _lrotr(x, n)
+#define rotl32(x,n) _lrotl(x, n)
#else
-#define rotlFixed(x,n) (((x) << (n)) | ((x) >> (32 - (n))))
-#define rotrFixed(x,n) (((x) >> (n)) | ((x) << (32 - (n))))
+#include "Crypto/misc.h"
#endif
+#if !defined(_UEFI)
+#include <memory.h>
+#endif !defined(_UEFI)
+
// linear transformation
#define LT(i,a,b,c,d,e) {\
- a = rotlFixed(a, 13); \
- c = rotlFixed(c, 3); \
- d = rotlFixed(d ^ c ^ (a << 3), 7); \
- b = rotlFixed(b ^ a ^ c, 1); \
- a = rotlFixed(a ^ b ^ d, 5); \
- c = rotlFixed(c ^ d ^ (b << 7), 22);}
+ a = rotl32(a, 13); \
+ c = rotl32(c, 3); \
+ d = rotl32(d ^ c ^ (a << 3), 7); \
+ b = rotl32(b ^ a ^ c, 1); \
+ a = rotl32(a ^ b ^ d, 5); \
+ c = rotl32(c ^ d ^ (b << 7), 22);}
// inverse linear transformation
#define ILT(i,a,b,c,d,e) {\
- c = rotrFixed(c, 22); \
- a = rotrFixed(a, 5); \
+ c = rotr32(c, 22); \
+ a = rotr32(a, 5); \
c ^= d ^ (b << 7); \
a ^= b ^ d; \
- b = rotrFixed(b, 1); \
- d = rotrFixed(d, 7) ^ c ^ (a << 3); \
+ b = rotr32(b, 1); \
+ d = rotr32(d, 7) ^ c ^ (a << 3); \
b ^= a ^ c; \
- c = rotrFixed(c, 3); \
- a = rotrFixed(a, 13);}
+ c = rotr32(c, 3); \
+ a = rotr32(a, 13);}
// order of output from S-box functions
#define beforeS0(f) f(0,a,b,c,d,e)
@@ -644,7 +646,7 @@ void serpent_set_key(const unsigned __int8 userKey[],unsigned __int8 *ks)
k += 8;
t = k[-1];
for (i = 0; i < 132; ++i)
- k[i] = t = rotlFixed(k[i-8] ^ k[i-5] ^ k[i-3] ^ t ^ 0x9e3779b9 ^ i, 11);
+ k[i] = t = rotl32(k[i-8] ^ k[i-5] ^ k[i-3] ^ t ^ 0x9e3779b9 ^ i, 11);
k -= 20;
#define LK(r, a, b, c, d, e) {\
@@ -705,7 +707,7 @@ void serpent_set_key(const unsigned __int8 userKey[], unsigned __int8 *ks)
k += 8;
t = k[-1];
for (i = 0; i < 132; ++i)
- k[i] = t = rotlFixed(k[i-8] ^ k[i-5] ^ k[i-3] ^ t ^ 0x9e3779b9 ^ i, 11);
+ k[i] = t = rotl32(k[i-8] ^ k[i-5] ^ k[i-3] ^ t ^ 0x9e3779b9 ^ i, 11);
k -= 20;
for (i=0; i<4; i++)
@@ -780,12 +782,12 @@ typedef unsigned __int32 uint32;
static void LTf (uint32 *a, uint32 *b, uint32 *c, uint32 *d)
{
- *a = rotlFixed(*a, 13);
- *c = rotlFixed(*c, 3);
- *d = rotlFixed(*d ^ *c ^ (*a << 3), 7);
- *b = rotlFixed(*b ^ *a ^ *c, 1);
- *a = rotlFixed(*a ^ *b ^ *d, 5);
- *c = rotlFixed(*c ^ *d ^ (*b << 7), 22);
+ *a = rotl32(*a, 13);
+ *c = rotl32(*c, 3);
+ *d = rotl32(*d ^ *c ^ (*a << 3), 7);
+ *b = rotl32(*b ^ *a ^ *c, 1);
+ *a = rotl32(*a ^ *b ^ *d, 5);
+ *c = rotl32(*c ^ *d ^ (*b << 7), 22);
}
void serpent_encrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks)
@@ -883,15 +885,15 @@ start:
static void ILTf (uint32 *a, uint32 *b, uint32 *c, uint32 *d)
{
- *c = rotrFixed(*c, 22);
- *a = rotrFixed(*a, 5);
+ *c = rotr32(*c, 22);
+ *a = rotr32(*a, 5);
*c ^= *d ^ (*b << 7);
*a ^= *b ^ *d;
- *b = rotrFixed(*b, 1);
- *d = rotrFixed(*d, 7) ^ *c ^ (*a << 3);
+ *b = rotr32(*b, 1);
+ *d = rotr32(*d, 7) ^ *c ^ (*a << 3);
*b ^= *a ^ *c;
- *c = rotrFixed(*c, 3);
- *a = rotrFixed(*a, 13);
+ *c = rotr32(*c, 3);
+ *a = rotr32(*a, 13);
}
void serpent_decrypt(const unsigned __int8 *inBlock, unsigned __int8 *outBlock, unsigned __int8 *ks)
diff --git a/src/Crypto/Sha2.c b/src/Crypto/Sha2.c
index 02680eb5..6bc0bd84 100644
--- a/src/Crypto/Sha2.c
+++ b/src/Crypto/Sha2.c
@@ -69,7 +69,9 @@
*/
#include "Common/Endian.h"
+#include "Common/Tcdefs.h"
#include "Crypto/misc.h"
+
#define PLATFORM_BYTE_ORDER BYTE_ORDER
#define IS_LITTLE_ENDIAN LITTLE_ENDIAN
@@ -77,7 +79,9 @@
#define UNROLL_SHA2 /* for SHA2 loop unroll */
#endif
+#if !defined(_UEFI)
#include <string.h> /* for memcpy() etc. */
+#endif !defined(_UEFI)
#include "Sha2.h"
@@ -86,7 +90,7 @@ extern "C"
{
#endif
-#if defined( _MSC_VER ) && ( _MSC_VER > 800 )
+#if defined( _MSC_VER ) && ( _MSC_VER > 800 ) && !defined(_UEFI)
#pragma intrinsic(memcpy)
#endif
diff --git a/src/Crypto/Sources b/src/Crypto/Sources
index 6eb7b7b4..c7601a02 100644
--- a/src/Crypto/Sources
+++ b/src/Crypto/Sources
@@ -5,10 +5,12 @@ INCLUDES = ..
NTTARGETFILES = \
"$(OBJ_PATH)\$(O)\Aes_$(TC_ARCH).obj" \
- "$(OBJ_PATH)\$(O)\Aes_hw_cpu.obj"
+ "$(OBJ_PATH)\$(O)\Aes_hw_cpu.obj" \
+ "$(OBJ_PATH)\$(O)\gost89_$(TC_ARCH).obj"
SOURCES = \
Aes_$(TC_ARCH).asm \
+ gost89_$(TC_ARCH).asm \
Aes_hw_cpu.asm \
Aeskey.c \
Aestab.c \
@@ -17,4 +19,8 @@ SOURCES = \
Serpent.c \
Sha2.c \
Twofish.c \
- Whirlpool.c
+ GostCipher.c \
+ Streebog.c \
+ kuznyechik.c \
+ Whirlpool.c \
+ Camellia.c
diff --git a/src/Crypto/Streebog.c b/src/Crypto/Streebog.c
new file mode 100644
index 00000000..9430bfa3
--- /dev/null
+++ b/src/Crypto/Streebog.c
@@ -0,0 +1,2393 @@
+
+/*
+* Copyright (c) 2013, Alexey Degtyarev.
+* All rights reserved.
+*/
+
+/* Adapted to VeraCrypt with assembly enhancements*/
+
+#include "Streebog.h"
+#include "cpu.h"
+
+#if defined (_MSC_VER) && (_MSC_VER < 1600)
+#error "Streebog SSE code requires at least Visual C++ 2010 when building on Windows"
+#endif
+
+#if 1
+/*
+* Iteration constants defined in standard.
+*/
+ALIGN(16) static const unsigned long long buffer0[8] = { 0x0ULL, 0x0ULL, 0x0ULL,
+ 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL };
+
+#ifndef __GOST3411_BIG_ENDIAN__
+ALIGN(16) static const unsigned long long buffer512[8] = {0x0000000000000200ULL,
+ 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL };
+#else
+ALIGN(16) static const unsigned long long buffer512[8] = {{ 0x0002000000000000ULL,
+ 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL, 0x0ULL }};
+#endif
+
+#ifndef __GOST3411_BIG_ENDIAN__
+ALIGN(16) static const unsigned long long C[12][8] = {
+ {
+ 0xdd806559f2a64507ULL,
+ 0x05767436cc744d23ULL,
+ 0xa2422a08a460d315ULL,
+ 0x4b7ce09192676901ULL,
+ 0x714eb88d7585c4fcULL,
+ 0x2f6a76432e45d016ULL,
+ 0xebcb2f81c0657c1fULL,
+ 0xb1085bda1ecadae9ULL
+ },
+ {
+ 0xe679047021b19bb7ULL,
+ 0x55dda21bd7cbcd56ULL,
+ 0x5cb561c2db0aa7caULL,
+ 0x9ab5176b12d69958ULL,
+ 0x61d55e0f16b50131ULL,
+ 0xf3feea720a232b98ULL,
+ 0x4fe39d460f70b5d7ULL,
+ 0x6fa3b58aa99d2f1aULL
+ },
+ {
+ 0x991e96f50aba0ab2ULL,
+ 0xc2b6f443867adb31ULL,
+ 0xc1c93a376062db09ULL,
+ 0xd3e20fe490359eb1ULL,
+ 0xf2ea7514b1297b7bULL,
+ 0x06f15e5f529c1f8bULL,
+ 0x0a39fc286a3d8435ULL,
+ 0xf574dcac2bce2fc7ULL
+ },
+ {
+ 0x220cbebc84e3d12eULL,
+ 0x3453eaa193e837f1ULL,
+ 0xd8b71333935203beULL,
+ 0xa9d72c82ed03d675ULL,
+ 0x9d721cad685e353fULL,
+ 0x488e857e335c3c7dULL,
+ 0xf948e1a05d71e4ddULL,
+ 0xef1fdfb3e81566d2ULL
+ },
+ {
+ 0x601758fd7c6cfe57ULL,
+ 0x7a56a27ea9ea63f5ULL,
+ 0xdfff00b723271a16ULL,
+ 0xbfcd1747253af5a3ULL,
+ 0x359e35d7800fffbdULL,
+ 0x7f151c1f1686104aULL,
+ 0x9a3f410c6ca92363ULL,
+ 0x4bea6bacad474799ULL
+ },
+ {
+ 0xfa68407a46647d6eULL,
+ 0xbf71c57236904f35ULL,
+ 0x0af21f66c2bec6b6ULL,
+ 0xcffaa6b71c9ab7b4ULL,
+ 0x187f9ab49af08ec6ULL,
+ 0x2d66c4f95142a46cULL,
+ 0x6fa4c33b7a3039c0ULL,
+ 0xae4faeae1d3ad3d9ULL
+ },
+ {
+ 0x8886564d3a14d493ULL,
+ 0x3517454ca23c4af3ULL,
+ 0x06476983284a0504ULL,
+ 0x0992abc52d822c37ULL,
+ 0xd3473e33197a93c9ULL,
+ 0x399ec6c7e6bf87c9ULL,
+ 0x51ac86febf240954ULL,
+ 0xf4c70e16eeaac5ecULL
+ },
+ {
+ 0xa47f0dd4bf02e71eULL,
+ 0x36acc2355951a8d9ULL,
+ 0x69d18d2bd1a5c42fULL,
+ 0xf4892bcb929b0690ULL,
+ 0x89b4443b4ddbc49aULL,
+ 0x4eb7f8719c36de1eULL,
+ 0x03e7aa020c6e4141ULL,
+ 0x9b1f5b424d93c9a7ULL
+ },
+ {
+ 0x7261445183235adbULL,
+ 0x0e38dc92cb1f2a60ULL,
+ 0x7b2b8a9aa6079c54ULL,
+ 0x800a440bdbb2ceb1ULL,
+ 0x3cd955b7e00d0984ULL,
+ 0x3a7d3a1b25894224ULL,
+ 0x944c9ad8ec165fdeULL,
+ 0x378f5a541631229bULL
+ },
+ {
+ 0x74b4c7fb98459cedULL,
+ 0x3698fad1153bb6c3ULL,
+ 0x7a1e6c303b7652f4ULL,
+ 0x9fe76702af69334bULL,
+ 0x1fffe18a1b336103ULL,
+ 0x8941e71cff8a78dbULL,
+ 0x382ae548b2e4f3f3ULL,
+ 0xabbedea680056f52ULL
+ },
+ {
+ 0x6bcaa4cd81f32d1bULL,
+ 0xdea2594ac06fd85dULL,
+ 0xefbacd1d7d476e98ULL,
+ 0x8a1d71efea48b9caULL,
+ 0x2001802114846679ULL,
+ 0xd8fa6bbbebab0761ULL,
+ 0x3002c6cd635afe94ULL,
+ 0x7bcd9ed0efc889fbULL
+ },
+ {
+ 0x48bc924af11bd720ULL,
+ 0xfaf417d5d9b21b99ULL,
+ 0xe71da4aa88e12852ULL,
+ 0x5d80ef9d1891cc86ULL,
+ 0xf82012d430219f9bULL,
+ 0xcda43c32bcdf1d77ULL,
+ 0xd21380b00449b17aULL,
+ 0x378ee767f11631baULL
+ }
+};
+#else
+ALIGN(16) static const unsigned long long C[12][8] = {
+ {
+ 0x0745a6f2596580ddULL,
+ 0x234d74cc36747605ULL,
+ 0x15d360a4082a42a2ULL,
+ 0x0169679291e07c4bULL,
+ 0xfcc485758db84e71ULL,
+ 0x16d0452e43766a2fULL,
+ 0x1f7c65c0812fcbebULL,
+ 0xe9daca1eda5b08b1ULL
+ },
+ {
+ 0xb79bb121700479e6ULL,
+ 0x56cdcbd71ba2dd55ULL,
+ 0xcaa70adbc261b55cULL,
+ 0x5899d6126b17b59aULL,
+ 0x3101b5160f5ed561ULL,
+ 0x982b230a72eafef3ULL,
+ 0xd7b5700f469de34fULL,
+ 0x1a2f9da98ab5a36fULL
+ },
+ {
+ 0xb20aba0af5961e99ULL,
+ 0x31db7a8643f4b6c2ULL,
+ 0x09db6260373ac9c1ULL,
+ 0xb19e3590e40fe2d3ULL,
+ 0x7b7b29b11475eaf2ULL,
+ 0x8b1f9c525f5ef106ULL,
+ 0x35843d6a28fc390aULL,
+ 0xc72fce2bacdc74f5ULL
+ },
+ {
+ 0x2ed1e384bcbe0c22ULL,
+ 0xf137e893a1ea5334ULL,
+ 0xbe0352933313b7d8ULL,
+ 0x75d603ed822cd7a9ULL,
+ 0x3f355e68ad1c729dULL,
+ 0x7d3c5c337e858e48ULL,
+ 0xdde4715da0e148f9ULL,
+ 0xd26615e8b3df1fefULL
+ },
+ {
+ 0x57fe6c7cfd581760ULL,
+ 0xf563eaa97ea2567aULL,
+ 0x161a2723b700ffdfULL,
+ 0xa3f53a254717cdbfULL,
+ 0xbdff0f80d7359e35ULL,
+ 0x4a1086161f1c157fULL,
+ 0x6323a96c0c413f9aULL,
+ 0x994747adac6bea4bULL
+ },
+ {
+ 0x6e7d64467a4068faULL,
+ 0x354f903672c571bfULL,
+ 0xb6c6bec2661ff20aULL,
+ 0xb4b79a1cb7a6facfULL,
+ 0xc68ef09ab49a7f18ULL,
+ 0x6ca44251f9c4662dULL,
+ 0xc039307a3bc3a46fULL,
+ 0xd9d33a1daeae4faeULL
+ },
+ {
+ 0x93d4143a4d568688ULL,
+ 0xf34a3ca24c451735ULL,
+ 0x04054a2883694706ULL,
+ 0x372c822dc5ab9209ULL,
+ 0xc9937a19333e47d3ULL,
+ 0xc987bfe6c7c69e39ULL,
+ 0x540924bffe86ac51ULL,
+ 0xecc5aaee160ec7f4ULL
+ },
+ {
+ 0x1ee702bfd40d7fa4ULL,
+ 0xd9a8515935c2ac36ULL,
+ 0x2fc4a5d12b8dd169ULL,
+ 0x90069b92cb2b89f4ULL,
+ 0x9ac4db4d3b44b489ULL,
+ 0x1ede369c71f8b74eULL,
+ 0x41416e0c02aae703ULL,
+ 0xa7c9934d425b1f9bULL
+ },
+ {
+ 0xdb5a238351446172ULL,
+ 0x602a1fcb92dc380eULL,
+ 0x549c07a69a8a2b7bULL,
+ 0xb1ceb2db0b440a80ULL,
+ 0x84090de0b755d93cULL,
+ 0x244289251b3a7d3aULL,
+ 0xde5f16ecd89a4c94ULL,
+ 0x9b223116545a8f37ULL
+ },
+ {
+ 0xed9c4598fbc7b474ULL,
+ 0xc3b63b15d1fa9836ULL,
+ 0xf452763b306c1e7aULL,
+ 0x4b3369af0267e79fULL,
+ 0x0361331b8ae1ff1fULL,
+ 0xdb788aff1ce74189ULL,
+ 0xf3f3e4b248e52a38ULL,
+ 0x526f0580a6debeabULL
+ },
+ {
+ 0x1b2df381cda4ca6bULL,
+ 0x5dd86fc04a59a2deULL,
+ 0x986e477d1dcdbaefULL,
+ 0xcab948eaef711d8aULL,
+ 0x7966841421800120ULL,
+ 0x6107abebbb6bfad8ULL,
+ 0x94fe5a63cdc60230ULL,
+ 0xfb89c8efd09ecd7bULL
+ },
+ {
+ 0x20d71bf14a92bc48ULL,
+ 0x991bb2d9d517f4faULL,
+ 0x5228e188aaa41de7ULL,
+ 0x86cc91189def805dULL,
+ 0x9b9f2130d41220f8ULL,
+ 0x771ddfbc323ca4cdULL,
+ 0x7ab14904b08013d2ULL,
+ 0xba3116f167e78e37ULL
+ }
+};
+#endif
+
+#ifndef __GOST3411_BIG_ENDIAN__
+static const unsigned long long A[64] = {
+ 0x8e20faa72ba0b470ULL, 0x47107ddd9b505a38ULL, 0xad08b0e0c3282d1cULL,
+ 0xd8045870ef14980eULL, 0x6c022c38f90a4c07ULL, 0x3601161cf205268dULL,
+ 0x1b8e0b0e798c13c8ULL, 0x83478b07b2468764ULL, 0xa011d380818e8f40ULL,
+ 0x5086e740ce47c920ULL, 0x2843fd2067adea10ULL, 0x14aff010bdd87508ULL,
+ 0x0ad97808d06cb404ULL, 0x05e23c0468365a02ULL, 0x8c711e02341b2d01ULL,
+ 0x46b60f011a83988eULL, 0x90dab52a387ae76fULL, 0x486dd4151c3dfdb9ULL,
+ 0x24b86a840e90f0d2ULL, 0x125c354207487869ULL, 0x092e94218d243cbaULL,
+ 0x8a174a9ec8121e5dULL, 0x4585254f64090fa0ULL, 0xaccc9ca9328a8950ULL,
+ 0x9d4df05d5f661451ULL, 0xc0a878a0a1330aa6ULL, 0x60543c50de970553ULL,
+ 0x302a1e286fc58ca7ULL, 0x18150f14b9ec46ddULL, 0x0c84890ad27623e0ULL,
+ 0x0642ca05693b9f70ULL, 0x0321658cba93c138ULL, 0x86275df09ce8aaa8ULL,
+ 0x439da0784e745554ULL, 0xafc0503c273aa42aULL, 0xd960281e9d1d5215ULL,
+ 0xe230140fc0802984ULL, 0x71180a8960409a42ULL, 0xb60c05ca30204d21ULL,
+ 0x5b068c651810a89eULL, 0x456c34887a3805b9ULL, 0xac361a443d1c8cd2ULL,
+ 0x561b0d22900e4669ULL, 0x2b838811480723baULL, 0x9bcf4486248d9f5dULL,
+ 0xc3e9224312c8c1a0ULL, 0xeffa11af0964ee50ULL, 0xf97d86d98a327728ULL,
+ 0xe4fa2054a80b329cULL, 0x727d102a548b194eULL, 0x39b008152acb8227ULL,
+ 0x9258048415eb419dULL, 0x492c024284fbaec0ULL, 0xaa16012142f35760ULL,
+ 0x550b8e9e21f7a530ULL, 0xa48b474f9ef5dc18ULL, 0x70a6a56e2440598eULL,
+ 0x3853dc371220a247ULL, 0x1ca76e95091051adULL, 0x0edd37c48a08a6d8ULL,
+ 0x07e095624504536cULL, 0x8d70c431ac02a736ULL, 0xc83862965601dd1bULL,
+ 0x641c314b2b8ee083ULL
+};
+#else
+static const unsigned long long A[64] = {
+ 0x70b4a02ba7fa208eULL, 0x385a509bdd7d1047ULL, 0x1c2d28c3e0b008adULL,
+ 0x0e9814ef705804d8ULL, 0x074c0af9382c026cULL, 0x8d2605f21c160136ULL,
+ 0xc8138c790e0b8e1bULL, 0x648746b2078b4783ULL, 0x408f8e8180d311a0ULL,
+ 0x20c947ce40e78650ULL, 0x10eaad6720fd4328ULL, 0x0875d8bd10f0af14ULL,
+ 0x04b46cd00878d90aULL, 0x025a3668043ce205ULL, 0x012d1b34021e718cULL,
+ 0x8e98831a010fb646ULL, 0x6fe77a382ab5da90ULL, 0xb9fd3d1c15d46d48ULL,
+ 0xd2f0900e846ab824ULL, 0x6978480742355c12ULL, 0xba3c248d21942e09ULL,
+ 0x5d1e12c89e4a178aULL, 0xa00f09644f258545ULL, 0x50898a32a99cccacULL,
+ 0x5114665f5df04d9dULL, 0xa60a33a1a078a8c0ULL, 0x530597de503c5460ULL,
+ 0xa78cc56f281e2a30ULL, 0xdd46ecb9140f1518ULL, 0xe02376d20a89840cULL,
+ 0x709f3b6905ca4206ULL, 0x38c193ba8c652103ULL, 0xa8aae89cf05d2786ULL,
+ 0x5455744e78a09d43ULL, 0x2aa43a273c50c0afULL, 0x15521d9d1e2860d9ULL,
+ 0x842980c00f1430e2ULL, 0x429a4060890a1871ULL, 0x214d2030ca050cb6ULL,
+ 0x9ea81018658c065bULL, 0xb905387a88346c45ULL, 0xd28c1c3d441a36acULL,
+ 0x69460e90220d1b56ULL, 0xba2307481188832bULL, 0x5d9f8d248644cf9bULL,
+ 0xa0c1c8124322e9c3ULL, 0x50ee6409af11faefULL, 0x2877328ad9867df9ULL,
+ 0x9c320ba85420fae4ULL, 0x4e198b542a107d72ULL, 0x2782cb2a1508b039ULL,
+ 0x9d41eb1584045892ULL, 0xc0aefb8442022c49ULL, 0x6057f342210116aaULL,
+ 0x30a5f7219e8e0b55ULL, 0x18dcf59e4f478ba4ULL, 0x8e5940246ea5a670ULL,
+ 0x47a2201237dc5338ULL, 0xad511009956ea71cULL, 0xd8a6088ac437dd0eULL,
+ 0x6c5304456295e007ULL, 0x36a702ac31c4708dULL, 0x1bdd0156966238c8ULL,
+ 0x83e08e2b4b311c64ULL
+};
+#endif
+
+static const unsigned char Tau[64] = {
+ 0, 8, 16, 24, 32, 40, 48, 56,
+ 1, 9, 17, 25, 33, 41, 49, 57,
+ 2, 10, 18, 26, 34, 42, 50, 58,
+ 3, 11, 19, 27, 35, 43, 51, 59,
+ 4, 12, 20, 28, 36, 44, 52, 60,
+ 5, 13, 21, 29, 37, 45, 53, 61,
+ 6, 14, 22, 30, 38, 46, 54, 62,
+ 7, 15, 23, 31, 39, 47, 55, 63
+};
+
+static const unsigned char Pi[256] = {
+ 252, 238, 221, 17, 207, 110, 49, 22,
+ 251, 196, 250, 218, 35, 197, 4, 77,
+ 233, 119, 240, 219, 147, 46, 153, 186,
+ 23, 54, 241, 187, 20, 205, 95, 193,
+ 249, 24, 101, 90, 226, 92, 239, 33,
+ 129, 28, 60, 66, 139, 1, 142, 79,
+ 5, 132, 2, 174, 227, 106, 143, 160,
+ 6, 11, 237, 152, 127, 212, 211, 31,
+ 235, 52, 44, 81, 234, 200, 72, 171,
+ 242, 42, 104, 162, 253, 58, 206, 204,
+ 181, 112, 14, 86, 8, 12, 118, 18,
+ 191, 114, 19, 71, 156, 183, 93, 135,
+ 21, 161, 150, 41, 16, 123, 154, 199,
+ 243, 145, 120, 111, 157, 158, 178, 177,
+ 50, 117, 25, 61, 255, 53, 138, 126,
+ 109, 84, 198, 128, 195, 189, 13, 87,
+ 223, 245, 36, 169, 62, 168, 67, 201,
+ 215, 121, 214, 246, 124, 34, 185, 3,
+ 224, 15, 236, 222, 122, 148, 176, 188,
+ 220, 232, 40, 80, 78, 51, 10, 74,
+ 167, 151, 96, 115, 30, 0, 98, 68,
+ 26, 184, 56, 130, 100, 159, 38, 65,
+ 173, 69, 70, 146, 39, 94, 85, 47,
+ 140, 163, 165, 125, 105, 213, 149, 59,
+ 7, 88, 179, 64, 134, 172, 29, 247,
+ 48, 55, 107, 228, 136, 217, 231, 137,
+ 225, 27, 131, 73, 76, 63, 248, 254,
+ 141, 83, 170, 144, 202, 216, 133, 97,
+ 32, 113, 103, 164, 45, 43, 9, 91,
+ 203, 155, 37, 208, 190, 229, 108, 82,
+ 89, 166, 116, 210, 230, 244, 180, 192,
+ 209, 102, 175, 194, 57, 75, 99, 182
+};
+#endif // CONSTS
+
+#if 1
+#ifndef __GOST3411_BIG_ENDIAN__
+/*
+* Precalculation of matrix A multiplication.
+*/
+ALIGN(16) static const unsigned long long Ax[8][256] =
+{
+ {
+ 0xd01f715b5c7ef8e6ULL, 0x16fa240980778325ULL, 0xa8a42e857ee049c8ULL,
+ 0x6ac1068fa186465bULL, 0x6e417bd7a2e9320bULL, 0x665c8167a437daabULL,
+ 0x7666681aa89617f6ULL, 0x4b959163700bdcf5ULL, 0xf14be6b78df36248ULL,
+ 0xc585bd689a625cffULL, 0x9557d7fca67d82cbULL, 0x89f0b969af6dd366ULL,
+ 0xb0833d48749f6c35ULL, 0xa1998c23b1ecbc7cULL, 0x8d70c431ac02a736ULL,
+ 0xd6dfbc2fd0a8b69eULL, 0x37aeb3e551fa198bULL, 0x0b7d128a40b5cf9cULL,
+ 0x5a8f2008b5780cbcULL, 0xedec882284e333e5ULL, 0xd25fc177d3c7c2ceULL,
+ 0x5e0f5d50b61778ecULL, 0x1d873683c0c24cb9ULL, 0xad040bcbb45d208cULL,
+ 0x2f89a0285b853c76ULL, 0x5732fff6791b8d58ULL, 0x3e9311439ef6ec3fULL,
+ 0xc9183a809fd3c00fULL, 0x83adf3f5260a01eeULL, 0xa6791941f4e8ef10ULL,
+ 0x103ae97d0ca1cd5dULL, 0x2ce948121dee1b4aULL, 0x39738421dbf2bf53ULL,
+ 0x093da2a6cf0cf5b4ULL, 0xcd9847d89cbcb45fULL, 0xf9561c078b2d8ae8ULL,
+ 0x9c6a755a6971777fULL, 0xbc1ebaa0712ef0c5ULL, 0x72e61542abf963a6ULL,
+ 0x78bb5fde229eb12eULL, 0x14ba94250fceb90dULL, 0x844d6697630e5282ULL,
+ 0x98ea08026a1e032fULL, 0xf06bbea144217f5cULL, 0xdb6263d11ccb377aULL,
+ 0x641c314b2b8ee083ULL, 0x320e96ab9b4770cfULL, 0x1ee7deb986a96b85ULL,
+ 0xe96cf57a878c47b5ULL, 0xfdd6615f8842feb8ULL, 0xc83862965601dd1bULL,
+ 0x2ea9f83e92572162ULL, 0xf876441142ff97fcULL, 0xeb2c455608357d9dULL,
+ 0x5612a7e0b0c9904cULL, 0x6c01cbfb2d500823ULL, 0x4548a6a7fa037a2dULL,
+ 0xabc4c6bf388b6ef4ULL, 0xbade77d4fdf8bebdULL, 0x799b07c8eb4cac3aULL,
+ 0x0c9d87e805b19cf0ULL, 0xcb588aac106afa27ULL, 0xea0c1d40c1e76089ULL,
+ 0x2869354a1e816f1aULL, 0xff96d17307fbc490ULL, 0x9f0a9d602f1a5043ULL,
+ 0x96373fc6e016a5f7ULL, 0x5292dab8b3a6e41cULL, 0x9b8ae0382c752413ULL,
+ 0x4f15ec3b7364a8a5ULL, 0x3fb349555724f12bULL, 0xc7c50d4415db66d7ULL,
+ 0x92b7429ee379d1a7ULL, 0xd37f99611a15dfdaULL, 0x231427c05e34a086ULL,
+ 0xa439a96d7b51d538ULL, 0xb403401077f01865ULL, 0xdda2aea5901d7902ULL,
+ 0x0a5d4a9c8967d288ULL, 0xc265280adf660f93ULL, 0x8bb0094520d4e94eULL,
+ 0x2a29856691385532ULL, 0x42a833c5bf072941ULL, 0x73c64d54622b7eb2ULL,
+ 0x07e095624504536cULL, 0x8a905153e906f45aULL, 0x6f6123c16b3b2f1fULL,
+ 0xc6e55552dc097bc3ULL, 0x4468feb133d16739ULL, 0xe211e7f0c7398829ULL,
+ 0xa2f96419f7879b40ULL, 0x19074bdbc3ad38e9ULL, 0xf4ebc3f9474e0b0cULL,
+ 0x43886bd376d53455ULL, 0xd8028beb5aa01046ULL, 0x51f23282f5cdc320ULL,
+ 0xe7b1c2be0d84e16dULL, 0x081dfab006dee8a0ULL, 0x3b33340d544b857bULL,
+ 0x7f5bcabc679ae242ULL, 0x0edd37c48a08a6d8ULL, 0x81ed43d9a9b33bc6ULL,
+ 0xb1a3655ebd4d7121ULL, 0x69a1eeb5e7ed6167ULL, 0xf6ab73d5c8f73124ULL,
+ 0x1a67a3e185c61fd5ULL, 0x2dc91004d43c065eULL, 0x0240b02c8fb93a28ULL,
+ 0x90f7f2b26cc0eb8fULL, 0x3cd3a16f114fd617ULL, 0xaae49ea9f15973e0ULL,
+ 0x06c0cd748cd64e78ULL, 0xda423bc7d5192a6eULL, 0xc345701c16b41287ULL,
+ 0x6d2193ede4821537ULL, 0xfcf639494190e3acULL, 0x7c3b228621f1c57eULL,
+ 0xfb16ac2b0494b0c0ULL, 0xbf7e529a3745d7f9ULL, 0x6881b6a32e3f7c73ULL,
+ 0xca78d2bad9b8e733ULL, 0xbbfe2fc2342aa3a9ULL, 0x0dbddffecc6381e4ULL,
+ 0x70a6a56e2440598eULL, 0xe4d12a844befc651ULL, 0x8c509c2765d0ba22ULL,
+ 0xee8c6018c28814d9ULL, 0x17da7c1f49a59e31ULL, 0x609c4c1328e194d3ULL,
+ 0xb3e3d57232f44b09ULL, 0x91d7aaa4a512f69bULL, 0x0ffd6fd243dabbccULL,
+ 0x50d26a943c1fde34ULL, 0x6be15e9968545b4fULL, 0x94778fea6faf9fdfULL,
+ 0x2b09dd7058ea4826ULL, 0x677cd9716de5c7bfULL, 0x49d5214fffb2e6ddULL,
+ 0x0360e83a466b273cULL, 0x1fc786af4f7b7691ULL, 0xa0b9d435783ea168ULL,
+ 0xd49f0c035f118cb6ULL, 0x01205816c9d21d14ULL, 0xac2453dd7d8f3d98ULL,
+ 0x545217cc3f70aa64ULL, 0x26b4028e9489c9c2ULL, 0xdec2469fd6765e3eULL,
+ 0x04807d58036f7450ULL, 0xe5f17292823ddb45ULL, 0xf30b569b024a5860ULL,
+ 0x62dcfc3fa758aefbULL, 0xe84cad6c4e5e5aa1ULL, 0xccb81fce556ea94bULL,
+ 0x53b282ae7a74f908ULL, 0x1b47fbf74c1402c1ULL, 0x368eebf39828049fULL,
+ 0x7afbeff2ad278b06ULL, 0xbe5e0a8cfe97caedULL, 0xcfd8f7f413058e77ULL,
+ 0xf78b2bc301252c30ULL, 0x4d555c17fcdd928dULL, 0x5f2f05467fc565f8ULL,
+ 0x24f4b2a21b30f3eaULL, 0x860dd6bbecb768aaULL, 0x4c750401350f8f99ULL,
+ 0x0000000000000000ULL, 0xecccd0344d312ef1ULL, 0xb5231806be220571ULL,
+ 0xc105c030990d28afULL, 0x653c695de25cfd97ULL, 0x159acc33c61ca419ULL,
+ 0xb89ec7f872418495ULL, 0xa9847693b73254dcULL, 0x58cf90243ac13694ULL,
+ 0x59efc832f3132b80ULL, 0x5c4fed7c39ae42c4ULL, 0x828dabe3efd81cfaULL,
+ 0xd13f294d95ace5f2ULL, 0x7d1b7a90e823d86aULL, 0xb643f03cf849224dULL,
+ 0x3df3f979d89dcb03ULL, 0x7426d836272f2ddeULL, 0xdfe21e891fa4432aULL,
+ 0x3a136c1b9d99986fULL, 0xfa36f43dcd46add4ULL, 0xc025982650df35bbULL,
+ 0x856d3e81aadc4f96ULL, 0xc4a5e57e53b041ebULL, 0x4708168b75ba4005ULL,
+ 0xaf44bbe73be41aa4ULL, 0x971767d029c4b8e3ULL, 0xb9be9feebb939981ULL,
+ 0x215497ecd18d9aaeULL, 0x316e7e91dd2c57f3ULL, 0xcef8afe2dad79363ULL,
+ 0x3853dc371220a247ULL, 0x35ee03c9de4323a3ULL, 0xe6919aa8c456fc79ULL,
+ 0xe05157dc4880b201ULL, 0x7bdbb7e464f59612ULL, 0x127a59518318f775ULL,
+ 0x332ecebd52956ddbULL, 0x8f30741d23bb9d1eULL, 0xd922d3fd93720d52ULL,
+ 0x7746300c61440ae2ULL, 0x25d4eab4d2e2eefeULL, 0x75068020eefd30caULL,
+ 0x135a01474acaea61ULL, 0x304e268714fe4ae7ULL, 0xa519f17bb283c82cULL,
+ 0xdc82f6b359cf6416ULL, 0x5baf781e7caa11a8ULL, 0xb2c38d64fb26561dULL,
+ 0x34ce5bdf17913eb7ULL, 0x5d6fb56af07c5fd0ULL, 0x182713cd0a7f25fdULL,
+ 0x9e2ac576e6c84d57ULL, 0x9aaab82ee5a73907ULL, 0xa3d93c0f3e558654ULL,
+ 0x7e7b92aaae48ff56ULL, 0x872d8ead256575beULL, 0x41c8dbfff96c0e7dULL,
+ 0x99ca5014a3cc1e3bULL, 0x40e883e930be1369ULL, 0x1ca76e95091051adULL,
+ 0x4e35b42dbab6b5b1ULL, 0x05a0254ecabd6944ULL, 0xe1710fca8152af15ULL,
+ 0xf22b0e8dcb984574ULL, 0xb763a82a319b3f59ULL, 0x63fca4296e8ab3efULL,
+ 0x9d4a2d4ca0a36a6bULL, 0xe331bfe60eeb953dULL, 0xd5bf541596c391a2ULL,
+ 0xf5cb9bef8e9c1618ULL, 0x46284e9dbc685d11ULL, 0x2074cffa185f87baULL,
+ 0xbd3ee2b6b8fcedd1ULL, 0xae64e3f1f23607b0ULL, 0xfeb68965ce29d984ULL,
+ 0x55724fdaf6a2b770ULL, 0x29496d5cd753720eULL, 0xa75941573d3af204ULL,
+ 0x8e102c0bea69800aULL, 0x111ab16bc573d049ULL, 0xd7ffe439197aab8aULL,
+ 0xefac380e0b5a09cdULL, 0x48f579593660fbc9ULL, 0x22347fd697e6bd92ULL,
+ 0x61bc1405e13389c7ULL, 0x4ab5c975b9d9c1e1ULL, 0x80cd1bcf606126d2ULL,
+ 0x7186fd78ed92449aULL, 0x93971a882aabccb3ULL, 0x88d0e17f66bfce72ULL,
+ 0x27945a985d5bd4d6ULL
+ },
+ {
+ 0xde553f8c05a811c8ULL, 0x1906b59631b4f565ULL, 0x436e70d6b1964ff7ULL,
+ 0x36d343cb8b1e9d85ULL, 0x843dfacc858aab5aULL, 0xfdfc95c299bfc7f9ULL,
+ 0x0f634bdea1d51fa2ULL, 0x6d458b3b76efb3cdULL, 0x85c3f77cf8593f80ULL,
+ 0x3c91315fbe737cb2ULL, 0x2148b03366ace398ULL, 0x18f8b8264c6761bfULL,
+ 0xc830c1c495c9fb0fULL, 0x981a76102086a0aaULL, 0xaa16012142f35760ULL,
+ 0x35cc54060c763cf6ULL, 0x42907d66cc45db2dULL, 0x8203d44b965af4bcULL,
+ 0x3d6f3cefc3a0e868ULL, 0xbc73ff69d292bda7ULL, 0x8722ed0102e20a29ULL,
+ 0x8f8185e8cd34deb7ULL, 0x9b0561dda7ee01d9ULL, 0x5335a0193227fad6ULL,
+ 0xc9cecc74e81a6fd5ULL, 0x54f5832e5c2431eaULL, 0x99e47ba05d553470ULL,
+ 0xf7bee756acd226ceULL, 0x384e05a5571816fdULL, 0xd1367452a47d0e6aULL,
+ 0xf29fde1c386ad85bULL, 0x320c77316275f7caULL, 0xd0c879e2d9ae9ab0ULL,
+ 0xdb7406c69110ef5dULL, 0x45505e51a2461011ULL, 0xfc029872e46c5323ULL,
+ 0xfa3cb6f5f7bc0cc5ULL, 0x031f17cd8768a173ULL, 0xbd8df2d9af41297dULL,
+ 0x9d3b4f5ab43e5e3fULL, 0x4071671b36feee84ULL, 0x716207e7d3e3b83dULL,
+ 0x48d20ff2f9283a1aULL, 0x27769eb4757cbc7eULL, 0x5c56ebc793f2e574ULL,
+ 0xa48b474f9ef5dc18ULL, 0x52cbada94ff46e0cULL, 0x60c7da982d8199c6ULL,
+ 0x0e9d466edc068b78ULL, 0x4eec2175eaf865fcULL, 0x550b8e9e21f7a530ULL,
+ 0x6b7ba5bc653fec2bULL, 0x5eb7f1ba6949d0ddULL, 0x57ea94e3db4c9099ULL,
+ 0xf640eae6d101b214ULL, 0xdd4a284182c0b0bbULL, 0xff1d8fbf6304f250ULL,
+ 0xb8accb933bf9d7e8ULL, 0xe8867c478eb68c4dULL, 0x3f8e2692391bddc1ULL,
+ 0xcb2fd60912a15a7cULL, 0xaec935dbab983d2fULL, 0xf55ffd2b56691367ULL,
+ 0x80e2ce366ce1c115ULL, 0x179bf3f8edb27e1dULL, 0x01fe0db07dd394daULL,
+ 0xda8a0b76ecc37b87ULL, 0x44ae53e1df9584cbULL, 0xb310b4b77347a205ULL,
+ 0xdfab323c787b8512ULL, 0x3b511268d070b78eULL, 0x65e6e3d2b9396753ULL,
+ 0x6864b271e2574d58ULL, 0x259784c98fc789d7ULL, 0x02e11a7dfabb35a9ULL,
+ 0x8841a6dfa337158bULL, 0x7ade78c39b5dcdd0ULL, 0xb7cf804d9a2cc84aULL,
+ 0x20b6bd831b7f7742ULL, 0x75bd331d3a88d272ULL, 0x418f6aab4b2d7a5eULL,
+ 0xd9951cbb6babdaf4ULL, 0xb6318dfde7ff5c90ULL, 0x1f389b112264aa83ULL,
+ 0x492c024284fbaec0ULL, 0xe33a0363c608f9a0ULL, 0x2688930408af28a4ULL,
+ 0xc7538a1a341ce4adULL, 0x5da8e677ee2171aeULL, 0x8c9e92254a5c7fc4ULL,
+ 0x63d8cd55aae938b5ULL, 0x29ebd8daa97a3706ULL, 0x959827b37be88aa1ULL,
+ 0x1484e4356adadf6eULL, 0xa7945082199d7d6bULL, 0xbf6ce8a455fa1cd4ULL,
+ 0x9cc542eac9edcae5ULL, 0x79c16f0e1c356ca3ULL, 0x89bfab6fdee48151ULL,
+ 0xd4174d1830c5f0ffULL, 0x9258048415eb419dULL, 0x6139d72850520d1cULL,
+ 0x6a85a80c18ec78f1ULL, 0xcd11f88e0171059aULL, 0xcceff53e7ca29140ULL,
+ 0xd229639f2315af19ULL, 0x90b91ef9ef507434ULL, 0x5977d28d074a1be1ULL,
+ 0x311360fce51d56b9ULL, 0xc093a92d5a1f2f91ULL, 0x1a19a25bb6dc5416ULL,
+ 0xeb996b8a09de2d3eULL, 0xfee3820f1ed7668aULL, 0xd7085ad5b7ad518cULL,
+ 0x7fff41890fe53345ULL, 0xec5948bd67dde602ULL, 0x2fd5f65dbaaa68e0ULL,
+ 0xa5754affe32648c2ULL, 0xf8ddac880d07396cULL, 0x6fa491468c548664ULL,
+ 0x0c7c5c1326bdbed1ULL, 0x4a33158f03930fb3ULL, 0x699abfc19f84d982ULL,
+ 0xe4fa2054a80b329cULL, 0x6707f9af438252faULL, 0x08a368e9cfd6d49eULL,
+ 0x47b1442c58fd25b8ULL, 0xbbb3dc5ebc91769bULL, 0x1665fe489061eac7ULL,
+ 0x33f27a811fa66310ULL, 0x93a609346838d547ULL, 0x30ed6d4c98cec263ULL,
+ 0x1dd9816cd8df9f2aULL, 0x94662a03063b1e7bULL, 0x83fdd9fbeb896066ULL,
+ 0x7b207573e68e590aULL, 0x5f49fc0a149a4407ULL, 0x343259b671a5a82cULL,
+ 0xfbc2bb458a6f981fULL, 0xc272b350a0a41a38ULL, 0x3aaf1fd8ada32354ULL,
+ 0x6cbb868b0b3c2717ULL, 0xa2b569c88d2583feULL, 0xf180c9d1bf027928ULL,
+ 0xaf37386bd64ba9f5ULL, 0x12bacab2790a8088ULL, 0x4c0d3b0810435055ULL,
+ 0xb2eeb9070e9436dfULL, 0xc5b29067cea7d104ULL, 0xdcb425f1ff132461ULL,
+ 0x4f122cc5972bf126ULL, 0xac282fa651230886ULL, 0xe7e537992f6393efULL,
+ 0xe61b3a2952b00735ULL, 0x709c0a57ae302ce7ULL, 0xe02514ae416058d3ULL,
+ 0xc44c9dd7b37445deULL, 0x5a68c5408022ba92ULL, 0x1c278cdca50c0bf0ULL,
+ 0x6e5a9cf6f18712beULL, 0x86dce0b17f319ef3ULL, 0x2d34ec2040115d49ULL,
+ 0x4bcd183f7e409b69ULL, 0x2815d56ad4a9a3dcULL, 0x24698979f2141d0dULL,
+ 0x0000000000000000ULL, 0x1ec696a15fb73e59ULL, 0xd86b110b16784e2eULL,
+ 0x8e7f8858b0e74a6dULL, 0x063e2e8713d05fe6ULL, 0xe2c40ed3bbdb6d7aULL,
+ 0xb1f1aeca89fc97acULL, 0xe1db191e3cb3cc09ULL, 0x6418ee62c4eaf389ULL,
+ 0xc6ad87aa49cf7077ULL, 0xd6f65765ca7ec556ULL, 0x9afb6c6dda3d9503ULL,
+ 0x7ce05644888d9236ULL, 0x8d609f95378feb1eULL, 0x23a9aa4e9c17d631ULL,
+ 0x6226c0e5d73aac6fULL, 0x56149953a69f0443ULL, 0xeeb852c09d66d3abULL,
+ 0x2b0ac2a753c102afULL, 0x07c023376e03cb3cULL, 0x2ccae1903dc2c993ULL,
+ 0xd3d76e2f5ec63bc3ULL, 0x9e2458973356ff4cULL, 0xa66a5d32644ee9b1ULL,
+ 0x0a427294356de137ULL, 0x783f62be61e6f879ULL, 0x1344c70204d91452ULL,
+ 0x5b96c8f0fdf12e48ULL, 0xa90916ecc59bf613ULL, 0xbe92e5142829880eULL,
+ 0x727d102a548b194eULL, 0x1be7afebcb0fc0ccULL, 0x3e702b2244c8491bULL,
+ 0xd5e940a84d166425ULL, 0x66f9f41f3e51c620ULL, 0xabe80c913f20c3baULL,
+ 0xf07ec461c2d1edf2ULL, 0xf361d3ac45b94c81ULL, 0x0521394a94b8fe95ULL,
+ 0xadd622162cf09c5cULL, 0xe97871f7f3651897ULL, 0xf4a1f09b2bba87bdULL,
+ 0x095d6559b2054044ULL, 0x0bbc7f2448be75edULL, 0x2af4cf172e129675ULL,
+ 0x157ae98517094bb4ULL, 0x9fda55274e856b96ULL, 0x914713499283e0eeULL,
+ 0xb952c623462a4332ULL, 0x74433ead475b46a8ULL, 0x8b5eb112245fb4f8ULL,
+ 0xa34b6478f0f61724ULL, 0x11a5dd7ffe6221fbULL, 0xc16da49d27ccbb4bULL,
+ 0x76a224d0bde07301ULL, 0x8aa0bca2598c2022ULL, 0x4df336b86d90c48fULL,
+ 0xea67663a740db9e4ULL, 0xef465f70e0b54771ULL, 0x39b008152acb8227ULL,
+ 0x7d1e5bf4f55e06ecULL, 0x105bd0cf83b1b521ULL, 0x775c2960c033e7dbULL,
+ 0x7e014c397236a79fULL, 0x811cc386113255cfULL, 0xeda7450d1a0e72d8ULL,
+ 0x5889df3d7a998f3bULL, 0x2e2bfbedc779fc3aULL, 0xce0eef438619a4e9ULL,
+ 0x372d4e7bf6cd095fULL, 0x04df34fae96b6a4fULL, 0xf923a13870d4adb6ULL,
+ 0xa1aa7e050a4d228dULL, 0xa8f71b5cb84862c9ULL, 0xb52e9a306097fde3ULL,
+ 0x0d8251a35b6e2a0bULL, 0x2257a7fee1c442ebULL, 0x73831d9a29588d94ULL,
+ 0x51d4ba64c89ccf7fULL, 0x502ab7d4b54f5ba5ULL, 0x97793dce8153bf08ULL,
+ 0xe5042de4d5d8a646ULL, 0x9687307efc802bd2ULL, 0xa05473b5779eb657ULL,
+ 0xb4d097801d446939ULL, 0xcff0e2f3fbca3033ULL, 0xc38cbee0dd778ee2ULL,
+ 0x464f499c252eb162ULL, 0xcad1dbb96f72cea6ULL, 0xba4dd1eec142e241ULL,
+ 0xb00fa37af42f0376ULL
+ },
+ {
+ 0xcce4cd3aa968b245ULL, 0x089d5484e80b7fafULL, 0x638246c1b3548304ULL,
+ 0xd2fe0ec8c2355492ULL, 0xa7fbdf7ff2374eeeULL, 0x4df1600c92337a16ULL,
+ 0x84e503ea523b12fbULL, 0x0790bbfd53ab0c4aULL, 0x198a780f38f6ea9dULL,
+ 0x2ab30c8f55ec48cbULL, 0xe0f7fed6b2c49db5ULL, 0xb6ecf3f422cadbdcULL,
+ 0x409c9a541358df11ULL, 0xd3ce8a56dfde3fe3ULL, 0xc3e9224312c8c1a0ULL,
+ 0x0d6dfa58816ba507ULL, 0xddf3e1b179952777ULL, 0x04c02a42748bb1d9ULL,
+ 0x94c2abff9f2decb8ULL, 0x4f91752da8f8acf4ULL, 0x78682befb169bf7bULL,
+ 0xe1c77a48af2ff6c4ULL, 0x0c5d7ec69c80ce76ULL, 0x4cc1e4928fd81167ULL,
+ 0xfeed3d24d9997b62ULL, 0x518bb6dfc3a54a23ULL, 0x6dbf2d26151f9b90ULL,
+ 0xb5bc624b05ea664fULL, 0xe86aaa525acfe21aULL, 0x4801ced0fb53a0beULL,
+ 0xc91463e6c00868edULL, 0x1027a815cd16fe43ULL, 0xf67069a0319204cdULL,
+ 0xb04ccc976c8abce7ULL, 0xc0b9b3fc35e87c33ULL, 0xf380c77c58f2de65ULL,
+ 0x50bb3241de4e2152ULL, 0xdf93f490435ef195ULL, 0xf1e0d25d62390887ULL,
+ 0xaf668bfb1a3c3141ULL, 0xbc11b251f00a7291ULL, 0x73a5eed47e427d47ULL,
+ 0x25bee3f6ee4c3b2eULL, 0x43cc0beb34786282ULL, 0xc824e778dde3039cULL,
+ 0xf97d86d98a327728ULL, 0xf2b043e24519b514ULL, 0xe297ebf7880f4b57ULL,
+ 0x3a94a49a98fab688ULL, 0x868516cb68f0c419ULL, 0xeffa11af0964ee50ULL,
+ 0xa4ab4ec0d517f37dULL, 0xa9c6b498547c567aULL, 0x8e18424f80fbbbb6ULL,
+ 0x0bcdc53bcf2bc23cULL, 0x137739aaea3643d0ULL, 0x2c1333ec1bac2ff0ULL,
+ 0x8d48d3f0a7db0625ULL, 0x1e1ac3f26b5de6d7ULL, 0xf520f81f16b2b95eULL,
+ 0x9f0f6ec450062e84ULL, 0x0130849e1deb6b71ULL, 0xd45e31ab8c7533a9ULL,
+ 0x652279a2fd14e43fULL, 0x3209f01e70f1c927ULL, 0xbe71a770cac1a473ULL,
+ 0x0e3d6be7a64b1894ULL, 0x7ec8148cff29d840ULL, 0xcb7476c7fac3be0fULL,
+ 0x72956a4a63a91636ULL, 0x37f95ec21991138fULL, 0x9e3fea5a4ded45f5ULL,
+ 0x7b38ba50964902e8ULL, 0x222e580bbde73764ULL, 0x61e253e0899f55e6ULL,
+ 0xfc8d2805e352ad80ULL, 0x35994be3235ac56dULL, 0x09add01af5e014deULL,
+ 0x5e8659a6780539c6ULL, 0xb17c48097161d796ULL, 0x026015213acbd6e2ULL,
+ 0xd1ae9f77e515e901ULL, 0xb7dc776a3f21b0adULL, 0xaba6a1b96eb78098ULL,
+ 0x9bcf4486248d9f5dULL, 0x582666c536455efdULL, 0xfdbdac9bfeb9c6f1ULL,
+ 0xc47999be4163cdeaULL, 0x765540081722a7efULL, 0x3e548ed8ec710751ULL,
+ 0x3d041f67cb51bac2ULL, 0x7958af71ac82d40aULL, 0x36c9da5c047a78feULL,
+ 0xed9a048e33af38b2ULL, 0x26ee7249c96c86bdULL, 0x900281bdeba65d61ULL,
+ 0x11172c8bd0fd9532ULL, 0xea0abf73600434f8ULL, 0x42fc8f75299309f3ULL,
+ 0x34a9cf7d3eb1ae1cULL, 0x2b838811480723baULL, 0x5ce64c8742ceef24ULL,
+ 0x1adae9b01fd6570eULL, 0x3c349bf9d6bad1b3ULL, 0x82453c891c7b75c0ULL,
+ 0x97923a40b80d512bULL, 0x4a61dbf1c198765cULL, 0xb48ce6d518010d3eULL,
+ 0xcfb45c858e480fd6ULL, 0xd933cbf30d1e96aeULL, 0xd70ea014ab558e3aULL,
+ 0xc189376228031742ULL, 0x9262949cd16d8b83ULL, 0xeb3a3bed7def5f89ULL,
+ 0x49314a4ee6b8cbcfULL, 0xdcc3652f647e4c06ULL, 0xda635a4c2a3e2b3dULL,
+ 0x470c21a940f3d35bULL, 0x315961a157d174b4ULL, 0x6672e81dda3459acULL,
+ 0x5b76f77a1165e36eULL, 0x445cb01667d36ec8ULL, 0xc5491d205c88a69bULL,
+ 0x456c34887a3805b9ULL, 0xffddb9bac4721013ULL, 0x99af51a71e4649bfULL,
+ 0xa15be01cbc7729d5ULL, 0x52db2760e485f7b0ULL, 0x8c78576eba306d54ULL,
+ 0xae560f6507d75a30ULL, 0x95f22f6182c687c9ULL, 0x71c5fbf54489aba5ULL,
+ 0xca44f259e728d57eULL, 0x88b87d2ccebbdc8dULL, 0xbab18d32be4a15aaULL,
+ 0x8be8ec93e99b611eULL, 0x17b713e89ebdf209ULL, 0xb31c5d284baa0174ULL,
+ 0xeeca9531148f8521ULL, 0xb8d198138481c348ULL, 0x8988f9b2d350b7fcULL,
+ 0xb9e11c8d996aa839ULL, 0x5a4673e40c8e881fULL, 0x1687977683569978ULL,
+ 0xbf4123eed72acf02ULL, 0x4ea1f1b3b513c785ULL, 0xe767452be16f91ffULL,
+ 0x7505d1b730021a7cULL, 0xa59bca5ec8fc980cULL, 0xad069eda20f7e7a3ULL,
+ 0x38f4b1bba231606aULL, 0x60d2d77e94743e97ULL, 0x9affc0183966f42cULL,
+ 0x248e6768f3a7505fULL, 0xcdd449a4b483d934ULL, 0x87b59255751baf68ULL,
+ 0x1bea6d2e023d3c7fULL, 0x6b1f12455b5ffcabULL, 0x743555292de9710dULL,
+ 0xd8034f6d10f5fddfULL, 0xc6198c9f7ba81b08ULL, 0xbb8109aca3a17edbULL,
+ 0xfa2d1766ad12cabbULL, 0xc729080166437079ULL, 0x9c5fff7b77269317ULL,
+ 0x0000000000000000ULL, 0x15d706c9a47624ebULL, 0x6fdf38072fd44d72ULL,
+ 0x5fb6dd3865ee52b7ULL, 0xa33bf53d86bcff37ULL, 0xe657c1b5fc84fa8eULL,
+ 0xaa962527735cebe9ULL, 0x39c43525bfda0b1bULL, 0x204e4d2a872ce186ULL,
+ 0x7a083ece8ba26999ULL, 0x554b9c9db72efbfaULL, 0xb22cd9b656416a05ULL,
+ 0x96a2bedea5e63a5aULL, 0x802529a826b0a322ULL, 0x8115ad363b5bc853ULL,
+ 0x8375b81701901eb1ULL, 0x3069e53f4a3a1fc5ULL, 0xbd2136cfede119e0ULL,
+ 0x18bafc91251d81ecULL, 0x1d4a524d4c7d5b44ULL, 0x05f0aedc6960daa8ULL,
+ 0x29e39d3072ccf558ULL, 0x70f57f6b5962c0d4ULL, 0x989fd53903ad22ceULL,
+ 0xf84d024797d91c59ULL, 0x547b1803aac5908bULL, 0xf0d056c37fd263f6ULL,
+ 0xd56eb535919e58d8ULL, 0x1c7ad6d351963035ULL, 0x2e7326cd2167f912ULL,
+ 0xac361a443d1c8cd2ULL, 0x697f076461942a49ULL, 0x4b515f6fdc731d2dULL,
+ 0x8ad8680df4700a6fULL, 0x41ac1eca0eb3b460ULL, 0x7d988533d80965d3ULL,
+ 0xa8f6300649973d0bULL, 0x7765c4960ac9cc9eULL, 0x7ca801adc5e20ea2ULL,
+ 0xdea3700e5eb59ae4ULL, 0xa06b6482a19c42a4ULL, 0x6a2f96db46b497daULL,
+ 0x27def6d7d487edccULL, 0x463ca5375d18b82aULL, 0xa6cb5be1efdc259fULL,
+ 0x53eba3fef96e9cc1ULL, 0xce84d81b93a364a7ULL, 0xf4107c810b59d22fULL,
+ 0x333974806d1aa256ULL, 0x0f0def79bba073e5ULL, 0x231edc95a00c5c15ULL,
+ 0xe437d494c64f2c6cULL, 0x91320523f64d3610ULL, 0x67426c83c7df32ddULL,
+ 0x6eefbc99323f2603ULL, 0x9d6f7be56acdf866ULL, 0x5916e25b2bae358cULL,
+ 0x7ff89012e2c2b331ULL, 0x035091bf2720bd93ULL, 0x561b0d22900e4669ULL,
+ 0x28d319ae6f279e29ULL, 0x2f43a2533c8c9263ULL, 0xd09e1be9f8fe8270ULL,
+ 0xf740ed3e2c796fbcULL, 0xdb53ded237d5404cULL, 0x62b2c25faebfe875ULL,
+ 0x0afd41a5d2c0a94dULL, 0x6412fd3ce0ff8f4eULL, 0xe3a76f6995e42026ULL,
+ 0x6c8fa9b808f4f0e1ULL, 0xc2d9a6dd0f23aad1ULL, 0x8f28c6d19d10d0c7ULL,
+ 0x85d587744fd0798aULL, 0xa20b71a39b579446ULL, 0x684f83fa7c7f4138ULL,
+ 0xe507500adba4471dULL, 0x3f640a46f19a6c20ULL, 0x1247bd34f7dd28a1ULL,
+ 0x2d23b77206474481ULL, 0x93521002cc86e0f2ULL, 0x572b89bc8de52d18ULL,
+ 0xfb1d93f8b0f9a1caULL, 0xe95a2ecc4724896bULL, 0x3ba420048511ddf9ULL,
+ 0xd63e248ab6bee54bULL, 0x5dd6c8195f258455ULL, 0x06a03f634e40673bULL,
+ 0x1f2a476c76b68da6ULL, 0x217ec9b49ac78af7ULL, 0xecaa80102e4453c3ULL,
+ 0x14e78257b99d4f9aULL
+ },
+ {
+ 0x20329b2cc87bba05ULL, 0x4f5eb6f86546a531ULL, 0xd4f44775f751b6b1ULL,
+ 0x8266a47b850dfa8bULL, 0xbb986aa15a6ca985ULL, 0xc979eb08f9ae0f99ULL,
+ 0x2da6f447a2375ea1ULL, 0x1e74275dcd7d8576ULL, 0xbc20180a800bc5f8ULL,
+ 0xb4a2f701b2dc65beULL, 0xe726946f981b6d66ULL, 0x48e6c453bf21c94cULL,
+ 0x42cad9930f0a4195ULL, 0xefa47b64aacccd20ULL, 0x71180a8960409a42ULL,
+ 0x8bb3329bf6a44e0cULL, 0xd34c35de2d36daccULL, 0xa92f5b7cbc23dc96ULL,
+ 0xb31a85aa68bb09c3ULL, 0x13e04836a73161d2ULL, 0xb24dfc4129c51d02ULL,
+ 0x8ae44b70b7da5acdULL, 0xe671ed84d96579a7ULL, 0xa4bb3417d66f3832ULL,
+ 0x4572ab38d56d2de8ULL, 0xb1b47761ea47215cULL, 0xe81c09cf70aba15dULL,
+ 0xffbdb872ce7f90acULL, 0xa8782297fd5dc857ULL, 0x0d946f6b6a4ce4a4ULL,
+ 0xe4df1f4f5b995138ULL, 0x9ebc71edca8c5762ULL, 0x0a2c1dc0b02b88d9ULL,
+ 0x3b503c115d9d7b91ULL, 0xc64376a8111ec3a2ULL, 0xcec199a323c963e4ULL,
+ 0xdc76a87ec58616f7ULL, 0x09d596e073a9b487ULL, 0x14583a9d7d560dafULL,
+ 0xf4c6dc593f2a0cb4ULL, 0xdd21d19584f80236ULL, 0x4a4836983ddde1d3ULL,
+ 0xe58866a41ae745f9ULL, 0xf591a5b27e541875ULL, 0x891dc05074586693ULL,
+ 0x5b068c651810a89eULL, 0xa30346bc0c08544fULL, 0x3dbf3751c684032dULL,
+ 0x2a1e86ec785032dcULL, 0xf73f5779fca830eaULL, 0xb60c05ca30204d21ULL,
+ 0x0cc316802b32f065ULL, 0x8770241bdd96be69ULL, 0xb861e18199ee95dbULL,
+ 0xf805cad91418fcd1ULL, 0x29e70dccbbd20e82ULL, 0xc7140f435060d763ULL,
+ 0x0f3a9da0e8b0cc3bULL, 0xa2543f574d76408eULL, 0xbd7761e1c175d139ULL,
+ 0x4b1f4f737ca3f512ULL, 0x6dc2df1f2fc137abULL, 0xf1d05c3967b14856ULL,
+ 0xa742bf3715ed046cULL, 0x654030141d1697edULL, 0x07b872abda676c7dULL,
+ 0x3ce84eba87fa17ecULL, 0xc1fb0403cb79afdfULL, 0x3e46bc7105063f73ULL,
+ 0x278ae987121cd678ULL, 0xa1adb4778ef47cd0ULL, 0x26dd906c5362c2b9ULL,
+ 0x05168060589b44e2ULL, 0xfbfc41f9d79ac08fULL, 0x0e6de44ba9ced8faULL,
+ 0x9feb08068bf243a3ULL, 0x7b341749d06b129bULL, 0x229c69e74a87929aULL,
+ 0xe09ee6c4427c011bULL, 0x5692e30e725c4c3aULL, 0xda99a33e5e9f6e4bULL,
+ 0x353dd85af453a36bULL, 0x25241b4c90e0fee7ULL, 0x5de987258309d022ULL,
+ 0xe230140fc0802984ULL, 0x93281e86a0c0b3c6ULL, 0xf229d719a4337408ULL,
+ 0x6f6c2dd4ad3d1f34ULL, 0x8ea5b2fbae3f0aeeULL, 0x8331dd90c473ee4aULL,
+ 0x346aa1b1b52db7aaULL, 0xdf8f235e06042aa9ULL, 0xcc6f6b68a1354b7bULL,
+ 0x6c95a6f46ebf236aULL, 0x52d31a856bb91c19ULL, 0x1a35ded6d498d555ULL,
+ 0xf37eaef2e54d60c9ULL, 0x72e181a9a3c2a61cULL, 0x98537aad51952fdeULL,
+ 0x16f6c856ffaa2530ULL, 0xd960281e9d1d5215ULL, 0x3a0745fa1ce36f50ULL,
+ 0x0b7b642bf1559c18ULL, 0x59a87eae9aec8001ULL, 0x5e100c05408bec7cULL,
+ 0x0441f98b19e55023ULL, 0xd70dcc5534d38aefULL, 0x927f676de1bea707ULL,
+ 0x9769e70db925e3e5ULL, 0x7a636ea29115065aULL, 0x468b201816ef11b6ULL,
+ 0xab81a9b73edff409ULL, 0xc0ac7de88a07bb1eULL, 0x1f235eb68c0391b7ULL,
+ 0x6056b074458dd30fULL, 0xbe8eeac102f7ed67ULL, 0xcd381283e04b5fbaULL,
+ 0x5cbefecec277c4e3ULL, 0xd21b4c356c48ce0dULL, 0x1019c31664b35d8cULL,
+ 0x247362a7d19eea26ULL, 0xebe582efb3299d03ULL, 0x02aef2cb82fc289fULL,
+ 0x86275df09ce8aaa8ULL, 0x28b07427faac1a43ULL, 0x38a9b7319e1f47cfULL,
+ 0xc82e92e3b8d01b58ULL, 0x06ef0b409b1978bcULL, 0x62f842bfc771fb90ULL,
+ 0x9904034610eb3b1fULL, 0xded85ab5477a3e68ULL, 0x90d195a663428f98ULL,
+ 0x5384636e2ac708d8ULL, 0xcbd719c37b522706ULL, 0xae9729d76644b0ebULL,
+ 0x7c8c65e20a0c7ee6ULL, 0x80c856b007f1d214ULL, 0x8c0b40302cc32271ULL,
+ 0xdbcedad51fe17a8aULL, 0x740e8ae938dbdea0ULL, 0xa615c6dc549310adULL,
+ 0x19cc55f6171ae90bULL, 0x49b1bdb8fe5fdd8dULL, 0xed0a89af2830e5bfULL,
+ 0x6a7aadb4f5a65bd6ULL, 0x7e22972988f05679ULL, 0xf952b3325566e810ULL,
+ 0x39fecedadf61530eULL, 0x6101c99f04f3c7ceULL, 0x2e5f7f6761b562ffULL,
+ 0xf08725d226cf5c97ULL, 0x63af3b54860fef51ULL, 0x8ff2cb10ef411e2fULL,
+ 0x884ab9bb35267252ULL, 0x4df04433e7ba8daeULL, 0x9afd8866d3690741ULL,
+ 0x66b9bb34de94abb3ULL, 0x9baaf18d92171380ULL, 0x543c11c5f0a064a5ULL,
+ 0x17a1b1bdbed431f1ULL, 0xb5f58eeaf3a2717fULL, 0xc355f6c849858740ULL,
+ 0xec5df044694ef17eULL, 0xd83751f5dc6346d4ULL, 0xfc4433520dfdacf2ULL,
+ 0x0000000000000000ULL, 0x5a51f58e596ebc5fULL, 0x3285aaf12e34cf16ULL,
+ 0x8d5c39db6dbd36b0ULL, 0x12b731dde64f7513ULL, 0x94906c2d7aa7dfbbULL,
+ 0x302b583aacc8e789ULL, 0x9d45facd090e6b3cULL, 0x2165e2c78905aec4ULL,
+ 0x68d45f7f775a7349ULL, 0x189b2c1d5664fdcaULL, 0xe1c99f2f030215daULL,
+ 0x6983269436246788ULL, 0x8489af3b1e148237ULL, 0xe94b702431d5b59cULL,
+ 0x33d2d31a6f4adbd7ULL, 0xbfd9932a4389f9a6ULL, 0xb0e30e8aab39359dULL,
+ 0xd1e2c715afcaf253ULL, 0x150f43763c28196eULL, 0xc4ed846393e2eb3dULL,
+ 0x03f98b20c3823c5eULL, 0xfd134ab94c83b833ULL, 0x556b682eb1de7064ULL,
+ 0x36c4537a37d19f35ULL, 0x7559f30279a5ca61ULL, 0x799ae58252973a04ULL,
+ 0x9c12832648707ffdULL, 0x78cd9c6913e92ec5ULL, 0x1d8dac7d0effb928ULL,
+ 0x439da0784e745554ULL, 0x413352b3cc887dcbULL, 0xbacf134a1b12bd44ULL,
+ 0x114ebafd25cd494dULL, 0x2f08068c20cb763eULL, 0x76a07822ba27f63fULL,
+ 0xeab2fb04f25789c2ULL, 0xe3676de481fe3d45ULL, 0x1b62a73d95e6c194ULL,
+ 0x641749ff5c68832cULL, 0xa5ec4dfc97112cf3ULL, 0xf6682e92bdd6242bULL,
+ 0x3f11c59a44782bb2ULL, 0x317c21d1edb6f348ULL, 0xd65ab5be75ad9e2eULL,
+ 0x6b2dd45fb4d84f17ULL, 0xfaab381296e4d44eULL, 0xd0b5befeeeb4e692ULL,
+ 0x0882ef0b32d7a046ULL, 0x512a91a5a83b2047ULL, 0x963e9ee6f85bf724ULL,
+ 0x4e09cf132438b1f0ULL, 0x77f701c9fb59e2feULL, 0x7ddb1c094b726a27ULL,
+ 0x5f4775ee01f5f8bdULL, 0x9186ec4d223c9b59ULL, 0xfeeac1998f01846dULL,
+ 0xac39db1ce4b89874ULL, 0xb75b7c21715e59e0ULL, 0xafc0503c273aa42aULL,
+ 0x6e3b543fec430bf5ULL, 0x704f7362213e8e83ULL, 0x58ff0745db9294c0ULL,
+ 0x67eec2df9feabf72ULL, 0xa0facd9ccf8a6811ULL, 0xb936986ad890811aULL,
+ 0x95c715c63bd9cb7aULL, 0xca8060283a2c33c7ULL, 0x507de84ee9453486ULL,
+ 0x85ded6d05f6a96f6ULL, 0x1cdad5964f81ade9ULL, 0xd5a33e9eb62fa270ULL,
+ 0x40642b588df6690aULL, 0x7f75eec2c98e42b8ULL, 0x2cf18dace3494a60ULL,
+ 0x23cb100c0bf9865bULL, 0xeef3028febb2d9e1ULL, 0x4425d2d394133929ULL,
+ 0xaad6d05c7fa1e0c8ULL, 0xad6ea2f7a5c68cb5ULL, 0xc2028f2308fb9381ULL,
+ 0x819f2f5b468fc6d5ULL, 0xc5bafd88d29cfffcULL, 0x47dc59f357910577ULL,
+ 0x2b49ff07392e261dULL, 0x57c59ae5332258fbULL, 0x73b6f842e2bcb2ddULL,
+ 0xcf96e04862b77725ULL, 0x4ca73dd8a6c4996fULL, 0x015779eb417e14c1ULL,
+ 0x37932a9176af8bf4ULL
+ },
+ {
+ 0x190a2c9b249df23eULL, 0x2f62f8b62263e1e9ULL, 0x7a7f754740993655ULL,
+ 0x330b7ba4d5564d9fULL, 0x4c17a16a46672582ULL, 0xb22f08eb7d05f5b8ULL,
+ 0x535f47f40bc148ccULL, 0x3aec5d27d4883037ULL, 0x10ed0a1825438f96ULL,
+ 0x516101f72c233d17ULL, 0x13cc6f949fd04eaeULL, 0x739853c441474bfdULL,
+ 0x653793d90d3f5b1bULL, 0x5240647b96b0fc2fULL, 0x0c84890ad27623e0ULL,
+ 0xd7189b32703aaea3ULL, 0x2685de3523bd9c41ULL, 0x99317c5b11bffefaULL,
+ 0x0d9baa854f079703ULL, 0x70b93648fbd48ac5ULL, 0xa80441fce30bc6beULL,
+ 0x7287704bdc36ff1eULL, 0xb65384ed33dc1f13ULL, 0xd36417343ee34408ULL,
+ 0x39cd38ab6e1bf10fULL, 0x5ab861770a1f3564ULL, 0x0ebacf09f594563bULL,
+ 0xd04572b884708530ULL, 0x3cae9722bdb3af47ULL, 0x4a556b6f2f5cbaf2ULL,
+ 0xe1704f1f76c4bd74ULL, 0x5ec4ed7144c6dfcfULL, 0x16afc01d4c7810e6ULL,
+ 0x283f113cd629ca7aULL, 0xaf59a8761741ed2dULL, 0xeed5a3991e215facULL,
+ 0x3bf37ea849f984d4ULL, 0xe413e096a56ce33cULL, 0x2c439d3a98f020d1ULL,
+ 0x637559dc6404c46bULL, 0x9e6c95d1e5f5d569ULL, 0x24bb9836045fe99aULL,
+ 0x44efa466dac8ecc9ULL, 0xc6eab2a5c80895d6ULL, 0x803b50c035220cc4ULL,
+ 0x0321658cba93c138ULL, 0x8f9ebc465dc7ee1cULL, 0xd15a5137190131d3ULL,
+ 0x0fa5ec8668e5e2d8ULL, 0x91c979578d1037b1ULL, 0x0642ca05693b9f70ULL,
+ 0xefca80168350eb4fULL, 0x38d21b24f36a45ecULL, 0xbeab81e1af73d658ULL,
+ 0x8cbfd9cae7542f24ULL, 0xfd19cc0d81f11102ULL, 0x0ac6430fbb4dbc90ULL,
+ 0x1d76a09d6a441895ULL, 0x2a01573ff1cbbfa1ULL, 0xb572e161894fde2bULL,
+ 0x8124734fa853b827ULL, 0x614b1fdf43e6b1b0ULL, 0x68ac395c4238cc18ULL,
+ 0x21d837bfd7f7b7d2ULL, 0x20c714304a860331ULL, 0x5cfaab726324aa14ULL,
+ 0x74c5ba4eb50d606eULL, 0xf3a3030474654739ULL, 0x23e671bcf015c209ULL,
+ 0x45f087e947b9582aULL, 0xd8bd77b418df4c7bULL, 0xe06f6c90ebb50997ULL,
+ 0x0bd96080263c0873ULL, 0x7e03f9410e40dcfeULL, 0xb8e94be4c6484928ULL,
+ 0xfb5b0608e8ca8e72ULL, 0x1a2b49179e0e3306ULL, 0x4e29e76961855059ULL,
+ 0x4f36c4e6fcf4e4baULL, 0x49740ee395cf7bcaULL, 0xc2963ea386d17f7dULL,
+ 0x90d65ad810618352ULL, 0x12d34c1b02a1fa4dULL, 0xfa44258775bb3a91ULL,
+ 0x18150f14b9ec46ddULL, 0x1491861e6b9a653dULL, 0x9a1019d7ab2c3fc2ULL,
+ 0x3668d42d06fe13d7ULL, 0xdcc1fbb25606a6d0ULL, 0x969490dd795a1c22ULL,
+ 0x3549b1a1bc6dd2efULL, 0xc94f5e23a0ed770eULL, 0xb9f6686b5b39fdcbULL,
+ 0xc4d4f4a6efeae00dULL, 0xe732851a1fff2204ULL, 0x94aad6de5eb869f9ULL,
+ 0x3f8ff2ae07206e7fULL, 0xfe38a9813b62d03aULL, 0xa7a1ad7a8bee2466ULL,
+ 0x7b6056c8dde882b6ULL, 0x302a1e286fc58ca7ULL, 0x8da0fa457a259bc7ULL,
+ 0xb3302b64e074415bULL, 0x5402ae7eff8b635fULL, 0x08f8050c9cafc94bULL,
+ 0xae468bf98a3059ceULL, 0x88c355cca98dc58fULL, 0xb10e6d67c7963480ULL,
+ 0xbad70de7e1aa3cf3ULL, 0xbfb4a26e320262bbULL, 0xcb711820870f02d5ULL,
+ 0xce12b7a954a75c9dULL, 0x563ce87dd8691684ULL, 0x9f73b65e7884618aULL,
+ 0x2b1e74b06cba0b42ULL, 0x47cec1ea605b2df1ULL, 0x1c698312f735ac76ULL,
+ 0x5fdbcefed9b76b2cULL, 0x831a354c8fb1cdfcULL, 0x820516c312c0791fULL,
+ 0xb74ca762aeadabf0ULL, 0xfc06ef821c80a5e1ULL, 0x5723cbf24518a267ULL,
+ 0x9d4df05d5f661451ULL, 0x588627742dfd40bfULL, 0xda8331b73f3d39a0ULL,
+ 0x17b0e392d109a405ULL, 0xf965400bcf28fba9ULL, 0x7c3dbf4229a2a925ULL,
+ 0x023e460327e275dbULL, 0x6cd0b55a0ce126b3ULL, 0xe62da695828e96e7ULL,
+ 0x42ad6e63b3f373b9ULL, 0xe50cc319381d57dfULL, 0xc5cbd729729b54eeULL,
+ 0x46d1e265fd2a9912ULL, 0x6428b056904eeff8ULL, 0x8be23040131e04b7ULL,
+ 0x6709d5da2add2ec0ULL, 0x075de98af44a2b93ULL, 0x8447dcc67bfbe66fULL,
+ 0x6616f655b7ac9a23ULL, 0xd607b8bded4b1a40ULL, 0x0563af89d3a85e48ULL,
+ 0x3db1b4ad20c21ba4ULL, 0x11f22997b8323b75ULL, 0x292032b34b587e99ULL,
+ 0x7f1cdace9331681dULL, 0x8e819fc9c0b65affULL, 0xa1e3677fe2d5bb16ULL,
+ 0xcd33d225ee349da5ULL, 0xd9a2543b85aef898ULL, 0x795e10cbfa0af76dULL,
+ 0x25a4bbb9992e5d79ULL, 0x78413344677b438eULL, 0xf0826688cef68601ULL,
+ 0xd27b34bba392f0ebULL, 0x551d8df162fad7bcULL, 0x1e57c511d0d7d9adULL,
+ 0xdeffbdb171e4d30bULL, 0xf4feea8e802f6caaULL, 0xa480c8f6317de55eULL,
+ 0xa0fc44f07fa40ff5ULL, 0x95b5f551c3c9dd1aULL, 0x22f952336d6476eaULL,
+ 0x0000000000000000ULL, 0xa6be8ef5169f9085ULL, 0xcc2cf1aa73452946ULL,
+ 0x2e7ddb39bf12550aULL, 0xd526dd3157d8db78ULL, 0x486b2d6c08becf29ULL,
+ 0x9b0f3a58365d8b21ULL, 0xac78cdfaadd22c15ULL, 0xbc95c7e28891a383ULL,
+ 0x6a927f5f65dab9c3ULL, 0xc3891d2c1ba0cb9eULL, 0xeaa92f9f50f8b507ULL,
+ 0xcf0d9426c9d6e87eULL, 0xca6e3baf1a7eb636ULL, 0xab25247059980786ULL,
+ 0x69b31ad3df4978fbULL, 0xe2512a93cc577c4cULL, 0xff278a0ea61364d9ULL,
+ 0x71a615c766a53e26ULL, 0x89dc764334fc716cULL, 0xf87a638452594f4aULL,
+ 0xf2bc208be914f3daULL, 0x8766b94ac1682757ULL, 0xbbc82e687cdb8810ULL,
+ 0x626a7a53f9757088ULL, 0xa2c202f358467a2eULL, 0x4d0882e5db169161ULL,
+ 0x09e7268301de7da8ULL, 0xe897699c771ac0dcULL, 0xc8507dac3d9cc3edULL,
+ 0xc0a878a0a1330aa6ULL, 0x978bb352e42ba8c1ULL, 0xe9884a13ea6b743fULL,
+ 0x279afdbabecc28a2ULL, 0x047c8c064ed9eaabULL, 0x507e2278b15289f4ULL,
+ 0x599904fbb08cf45cULL, 0xbd8ae46d15e01760ULL, 0x31353da7f2b43844ULL,
+ 0x8558ff49e68a528cULL, 0x76fbfc4d92ef15b5ULL, 0x3456922e211c660cULL,
+ 0x86799ac55c1993b4ULL, 0x3e90d1219a51da9cULL, 0x2d5cbeb505819432ULL,
+ 0x982e5fd48cce4a19ULL, 0xdb9c1238a24c8d43ULL, 0xd439febecaa96f9bULL,
+ 0x418c0bef0960b281ULL, 0x158ea591f6ebd1deULL, 0x1f48e69e4da66d4eULL,
+ 0x8afd13cf8e6fb054ULL, 0xf5e1c9011d5ed849ULL, 0xe34e091c5126c8afULL,
+ 0xad67ee7530a398f6ULL, 0x43b24dec2e82c75aULL, 0x75da99c1287cd48dULL,
+ 0x92e81cdb3783f689ULL, 0xa3dd217cc537cecdULL, 0x60543c50de970553ULL,
+ 0x93f73f54aaf2426aULL, 0xa91b62737e7a725dULL, 0xf19d4507538732e2ULL,
+ 0x77e4dfc20f9ea156ULL, 0x7d229ccdb4d31dc6ULL, 0x1b346a98037f87e5ULL,
+ 0xedf4c615a4b29e94ULL, 0x4093286094110662ULL, 0xb0114ee85ae78063ULL,
+ 0x6ff1d0d6b672e78bULL, 0x6dcf96d591909250ULL, 0xdfe09e3eec9567e8ULL,
+ 0x3214582b4827f97cULL, 0xb46dc2ee143e6ac8ULL, 0xf6c0ac8da7cd1971ULL,
+ 0xebb60c10cd8901e4ULL, 0xf7df8f023abcad92ULL, 0x9c52d3d2c217a0b2ULL,
+ 0x6b8d5cd0f8ab0d20ULL, 0x3777f7a29b8fa734ULL, 0x011f238f9d71b4e3ULL,
+ 0xc1b75b2f3c42be45ULL, 0x5de588fdfe551ef7ULL, 0x6eeef3592b035368ULL,
+ 0xaa3a07ffc4e9b365ULL, 0xecebe59a39c32a77ULL, 0x5ba742f8976e8187ULL,
+ 0x4b4a48e0b22d0e11ULL, 0xddded83dcb771233ULL, 0xa59feb79ac0c51bdULL,
+ 0xc7f5912a55792135ULL
+ },
+ {
+ 0x6d6ae04668a9b08aULL, 0x3ab3f04b0be8c743ULL, 0xe51e166b54b3c908ULL,
+ 0xbe90a9eb35c2f139ULL, 0xb2c7066637f2bec1ULL, 0xaa6945613392202cULL,
+ 0x9a28c36f3b5201ebULL, 0xddce5a93ab536994ULL, 0x0e34133ef6382827ULL,
+ 0x52a02ba1ec55048bULL, 0xa2f88f97c4b2a177ULL, 0x8640e513ca2251a5ULL,
+ 0xcdf1d36258137622ULL, 0xfe6cb708dedf8ddbULL, 0x8a174a9ec8121e5dULL,
+ 0x679896036b81560eULL, 0x59ed033395795feeULL, 0x1dd778ab8b74edafULL,
+ 0xee533ef92d9f926dULL, 0x2a8c79baf8a8d8f5ULL, 0x6bcf398e69b119f6ULL,
+ 0xe20491742fafdd95ULL, 0x276488e0809c2aecULL, 0xea955b82d88f5cceULL,
+ 0x7102c63a99d9e0c4ULL, 0xf9763017a5c39946ULL, 0x429fa2501f151b3dULL,
+ 0x4659c72bea05d59eULL, 0x984b7fdccf5a6634ULL, 0xf742232953fbb161ULL,
+ 0x3041860e08c021c7ULL, 0x747bfd9616cd9386ULL, 0x4bb1367192312787ULL,
+ 0x1b72a1638a6c44d3ULL, 0x4a0e68a6e8359a66ULL, 0x169a5039f258b6caULL,
+ 0xb98a2ef44edee5a4ULL, 0xd9083fe85e43a737ULL, 0x967f6ce239624e13ULL,
+ 0x8874f62d3c1a7982ULL, 0x3c1629830af06e3fULL, 0x9165ebfd427e5a8eULL,
+ 0xb5dd81794ceeaa5cULL, 0x0de8f15a7834f219ULL, 0x70bd98ede3dd5d25ULL,
+ 0xaccc9ca9328a8950ULL, 0x56664eda1945ca28ULL, 0x221db34c0f8859aeULL,
+ 0x26dbd637fa98970dULL, 0x1acdffb4f068f932ULL, 0x4585254f64090fa0ULL,
+ 0x72de245e17d53afaULL, 0x1546b25d7c546cf4ULL, 0x207e0ffffb803e71ULL,
+ 0xfaaad2732bcf4378ULL, 0xb462dfae36ea17bdULL, 0xcf926fd1ac1b11fdULL,
+ 0xe0672dc7dba7ba4aULL, 0xd3fa49ad5d6b41b3ULL, 0x8ba81449b216a3bcULL,
+ 0x14f9ec8a0650d115ULL, 0x40fc1ee3eb1d7ce2ULL, 0x23a2ed9b758ce44fULL,
+ 0x782c521b14fddc7eULL, 0x1c68267cf170504eULL, 0xbcf31558c1ca96e6ULL,
+ 0xa781b43b4ba6d235ULL, 0xf6fd7dfe29ff0c80ULL, 0xb0a4bad5c3fad91eULL,
+ 0xd199f51ea963266cULL, 0x414340349119c103ULL, 0x5405f269ed4dadf7ULL,
+ 0xabd61bb649969dcdULL, 0x6813dbeae7bdc3c8ULL, 0x65fb2ab09f8931d1ULL,
+ 0xf1e7fae152e3181dULL, 0xc1a67cef5a2339daULL, 0x7a4feea8e0f5bba1ULL,
+ 0x1e0b9acf05783791ULL, 0x5b8ebf8061713831ULL, 0x80e53cdbcb3af8d9ULL,
+ 0x7e898bd315e57502ULL, 0xc6bcfbf0213f2d47ULL, 0x95a38e86b76e942dULL,
+ 0x092e94218d243cbaULL, 0x8339debf453622e7ULL, 0xb11be402b9fe64ffULL,
+ 0x57d9100d634177c9ULL, 0xcc4e8db52217cbc3ULL, 0x3b0cae9c71ec7aa2ULL,
+ 0xfb158ca451cbfe99ULL, 0x2b33276d82ac6514ULL, 0x01bf5ed77a04bde1ULL,
+ 0xc5601994af33f779ULL, 0x75c4a3416cc92e67ULL, 0xf3844652a6eb7fc2ULL,
+ 0x3487e375fdd0ef64ULL, 0x18ae430704609eedULL, 0x4d14efb993298efbULL,
+ 0x815a620cb13e4538ULL, 0x125c354207487869ULL, 0x9eeea614ce42cf48ULL,
+ 0xce2d3106d61fac1cULL, 0xbbe99247bad6827bULL, 0x071a871f7b1c149dULL,
+ 0x2e4a1cc10db81656ULL, 0x77a71ff298c149b8ULL, 0x06a5d9c80118a97cULL,
+ 0xad73c27e488e34b1ULL, 0x443a7b981e0db241ULL, 0xe3bbcfa355ab6074ULL,
+ 0x0af276450328e684ULL, 0x73617a896dd1871bULL, 0x58525de4ef7de20fULL,
+ 0xb7be3dcab8e6cd83ULL, 0x19111dd07e64230cULL, 0x842359a03e2a367aULL,
+ 0x103f89f1f3401fb6ULL, 0xdc710444d157d475ULL, 0xb835702334da5845ULL,
+ 0x4320fc876511a6dcULL, 0xd026abc9d3679b8dULL, 0x17250eee885c0b2bULL,
+ 0x90dab52a387ae76fULL, 0x31fed8d972c49c26ULL, 0x89cba8fa461ec463ULL,
+ 0x2ff5421677bcabb7ULL, 0x396f122f85e41d7dULL, 0xa09b332430bac6a8ULL,
+ 0xc888e8ced7070560ULL, 0xaeaf201ac682ee8fULL, 0x1180d7268944a257ULL,
+ 0xf058a43628e7a5fcULL, 0xbd4c4b8fbbce2b07ULL, 0xa1246df34abe7b49ULL,
+ 0x7d5569b79be9af3cULL, 0xa9b5a705bd9efa12ULL, 0xdb6b835baa4bc0e8ULL,
+ 0x05793bac8f147342ULL, 0x21c1512881848390ULL, 0xfdb0556c50d357e5ULL,
+ 0x613d4fcb6a99ff72ULL, 0x03dce2648e0cda3eULL, 0xe949b9e6568386f0ULL,
+ 0xfc0f0bbb2ad7ea04ULL, 0x6a70675913b5a417ULL, 0x7f36d5046fe1c8e3ULL,
+ 0x0c57af8d02304ff8ULL, 0x32223abdfcc84618ULL, 0x0891caf6f720815bULL,
+ 0xa63eeaec31a26fd4ULL, 0x2507345374944d33ULL, 0x49d28ac266394058ULL,
+ 0xf5219f9aa7f3d6beULL, 0x2d96fea583b4cc68ULL, 0x5a31e1571b7585d0ULL,
+ 0x8ed12fe53d02d0feULL, 0xdfade6205f5b0e4bULL, 0x4cabb16ee92d331aULL,
+ 0x04c6657bf510cea3ULL, 0xd73c2cd6a87b8f10ULL, 0xe1d87310a1a307abULL,
+ 0x6cd5be9112ad0d6bULL, 0x97c032354366f3f2ULL, 0xd4e0ceb22677552eULL,
+ 0x0000000000000000ULL, 0x29509bde76a402cbULL, 0xc27a9e8bd42fe3e4ULL,
+ 0x5ef7842cee654b73ULL, 0xaf107ecdbc86536eULL, 0x3fcacbe784fcb401ULL,
+ 0xd55f90655c73e8cfULL, 0xe6c2f40fdabf1336ULL, 0xe8f6e7312c873b11ULL,
+ 0xeb2a0555a28be12fULL, 0xe4a148bc2eb774e9ULL, 0x9b979db84156bc0aULL,
+ 0x6eb60222e6a56ab4ULL, 0x87ffbbc4b026ec44ULL, 0xc703a5275b3b90a6ULL,
+ 0x47e699fc9001687fULL, 0x9c8d1aa73a4aa897ULL, 0x7cea3760e1ed12ddULL,
+ 0x4ec80ddd1d2554c5ULL, 0x13e36b957d4cc588ULL, 0x5d2b66486069914dULL,
+ 0x92b90999cc7280b0ULL, 0x517cc9c56259deb5ULL, 0xc937b619ad03b881ULL,
+ 0xec30824ad997f5b2ULL, 0xa45d565fc5aa080bULL, 0xd6837201d27f32f1ULL,
+ 0x635ef3789e9198adULL, 0x531f75769651b96aULL, 0x4f77530a6721e924ULL,
+ 0x486dd4151c3dfdb9ULL, 0x5f48dafb9461f692ULL, 0x375b011173dc355aULL,
+ 0x3da9775470f4d3deULL, 0x8d0dcd81b30e0ac0ULL, 0x36e45fc609d888bbULL,
+ 0x55baacbe97491016ULL, 0x8cb29356c90ab721ULL, 0x76184125e2c5f459ULL,
+ 0x99f4210bb55edbd5ULL, 0x6f095cf59ca1d755ULL, 0x9f51f8c3b44672a9ULL,
+ 0x3538bda287d45285ULL, 0x50c39712185d6354ULL, 0xf23b1885dcefc223ULL,
+ 0x79930ccc6ef9619fULL, 0xed8fdc9da3934853ULL, 0xcb540aaa590bdf5eULL,
+ 0x5c94389f1a6d2cacULL, 0xe77daad8a0bbaed7ULL, 0x28efc5090ca0bf2aULL,
+ 0xbf2ff73c4fc64cd8ULL, 0xb37858b14df60320ULL, 0xf8c96ec0dfc724a7ULL,
+ 0x828680683f329f06ULL, 0x941cd051cd6a29ccULL, 0xc3c5c05cae2b5e05ULL,
+ 0xb601631dc2e27062ULL, 0xc01922382027843bULL, 0x24b86a840e90f0d2ULL,
+ 0xd245177a276ffc52ULL, 0x0f8b4de98c3c95c6ULL, 0x3e759530fef809e0ULL,
+ 0x0b4d2892792c5b65ULL, 0xc4df4743d5374a98ULL, 0xa5e20888bfaeb5eaULL,
+ 0xba56cc90c0d23f9aULL, 0x38d04cf8ffe0a09cULL, 0x62e1adafe495254cULL,
+ 0x0263bcb3f40867dfULL, 0xcaeb547d230f62bfULL, 0x6082111c109d4293ULL,
+ 0xdad4dd8cd04f7d09ULL, 0xefec602e579b2f8cULL, 0x1fb4c4187f7c8a70ULL,
+ 0xffd3e9dfa4db303aULL, 0x7bf0b07f9af10640ULL, 0xf49ec14dddf76b5fULL,
+ 0x8f6e713247066d1fULL, 0x339d646a86ccfbf9ULL, 0x64447467e58d8c30ULL,
+ 0x2c29a072f9b07189ULL, 0xd8b7613f24471ad6ULL, 0x6627c8d41185ebefULL,
+ 0xa347d140beb61c96ULL, 0xde12b8f7255fb3aaULL, 0x9d324470404e1576ULL,
+ 0x9306574eb6763d51ULL, 0xa80af9d2c79a47f3ULL, 0x859c0777442e8b9bULL,
+ 0x69ac853d9db97e29ULL
+ },
+ {
+ 0xc3407dfc2de6377eULL, 0x5b9e93eea4256f77ULL, 0xadb58fdd50c845e0ULL,
+ 0x5219ff11a75bed86ULL, 0x356b61cfd90b1de9ULL, 0xfb8f406e25abe037ULL,
+ 0x7a5a0231c0f60796ULL, 0x9d3cd216e1f5020bULL, 0x0c6550fb6b48d8f3ULL,
+ 0xf57508c427ff1c62ULL, 0x4ad35ffa71cb407dULL, 0x6290a2da1666aa6dULL,
+ 0xe284ec2349355f9fULL, 0xb3c307c53d7c84ecULL, 0x05e23c0468365a02ULL,
+ 0x190bac4d6c9ebfa8ULL, 0x94bbbee9e28b80faULL, 0xa34fc777529cb9b5ULL,
+ 0xcc7b39f095bcd978ULL, 0x2426addb0ce532e3ULL, 0x7e79329312ce4fc7ULL,
+ 0xab09a72eebec2917ULL, 0xf8d15499f6b9d6c2ULL, 0x1a55b8babf8c895dULL,
+ 0xdb8add17fb769a85ULL, 0xb57f2f368658e81bULL, 0x8acd36f18f3f41f6ULL,
+ 0x5ce3b7bba50f11d3ULL, 0x114dcc14d5ee2f0aULL, 0xb91a7fcded1030e8ULL,
+ 0x81d5425fe55de7a1ULL, 0xb6213bc1554adeeeULL, 0x80144ef95f53f5f2ULL,
+ 0x1e7688186db4c10cULL, 0x3b912965db5fe1bcULL, 0xc281715a97e8252dULL,
+ 0x54a5d7e21c7f8171ULL, 0x4b12535ccbc5522eULL, 0x1d289cefbea6f7f9ULL,
+ 0x6ef5f2217d2e729eULL, 0xe6a7dc819b0d17ceULL, 0x1b94b41c05829b0eULL,
+ 0x33d7493c622f711eULL, 0xdcf7f942fa5ce421ULL, 0x600fba8b7f7a8ecbULL,
+ 0x46b60f011a83988eULL, 0x235b898e0dcf4c47ULL, 0x957ab24f588592a9ULL,
+ 0x4354330572b5c28cULL, 0xa5f3ef84e9b8d542ULL, 0x8c711e02341b2d01ULL,
+ 0x0b1874ae6a62a657ULL, 0x1213d8e306fc19ffULL, 0xfe6d7c6a4d9dba35ULL,
+ 0x65ed868f174cd4c9ULL, 0x88522ea0e6236550ULL, 0x899322065c2d7703ULL,
+ 0xc01e690bfef4018bULL, 0x915982ed8abddaf8ULL, 0xbe675b98ec3a4e4cULL,
+ 0xa996bf7f82f00db1ULL, 0xe1daf8d49a27696aULL, 0x2effd5d3dc8986e7ULL,
+ 0xd153a51f2b1a2e81ULL, 0x18caa0ebd690adfbULL, 0x390e3134b243c51aULL,
+ 0x2778b92cdff70416ULL, 0x029f1851691c24a6ULL, 0x5e7cafeacc133575ULL,
+ 0xfa4e4cc89fa5f264ULL, 0x5a5f9f481e2b7d24ULL, 0x484c47ab18d764dbULL,
+ 0x400a27f2a1a7f479ULL, 0xaeeb9b2a83da7315ULL, 0x721c626879869734ULL,
+ 0x042330a2d2384851ULL, 0x85f672fd3765aff0ULL, 0xba446b3a3e02061dULL,
+ 0x73dd6ecec3888567ULL, 0xffac70ccf793a866ULL, 0xdfa9edb5294ed2d4ULL,
+ 0x6c6aea7014325638ULL, 0x834a5a0e8c41c307ULL, 0xcdba35562fb2cb2bULL,
+ 0x0ad97808d06cb404ULL, 0x0f3b440cb85aee06ULL, 0xe5f9c876481f213bULL,
+ 0x98deee1289c35809ULL, 0x59018bbfcd394bd1ULL, 0xe01bf47220297b39ULL,
+ 0xde68e1139340c087ULL, 0x9fa3ca4788e926adULL, 0xbb85679c840c144eULL,
+ 0x53d8f3b71d55ffd5ULL, 0x0da45c5dd146caa0ULL, 0x6f34fe87c72060cdULL,
+ 0x57fbc315cf6db784ULL, 0xcee421a1fca0fddeULL, 0x3d2d0196607b8d4bULL,
+ 0x642c8a29ad42c69aULL, 0x14aff010bdd87508ULL, 0xac74837beac657b3ULL,
+ 0x3216459ad821634dULL, 0x3fb219c70967a9edULL, 0x06bc28f3bb246cf7ULL,
+ 0xf2082c9126d562c6ULL, 0x66b39278c45ee23cULL, 0xbd394f6f3f2878b9ULL,
+ 0xfd33689d9e8f8cc0ULL, 0x37f4799eb017394fULL, 0x108cc0b26fe03d59ULL,
+ 0xda4bd1b1417888d6ULL, 0xb09d1332ee6eb219ULL, 0x2f3ed975668794b4ULL,
+ 0x58c0871977375982ULL, 0x7561463d78ace990ULL, 0x09876cff037e82f1ULL,
+ 0x7fb83e35a8c05d94ULL, 0x26b9b58a65f91645ULL, 0xef20b07e9873953fULL,
+ 0x3148516d0b3355b8ULL, 0x41cb2b541ba9e62aULL, 0x790416c613e43163ULL,
+ 0xa011d380818e8f40ULL, 0x3a5025c36151f3efULL, 0xd57095bdf92266d0ULL,
+ 0x498d4b0da2d97688ULL, 0x8b0c3a57353153a5ULL, 0x21c491df64d368e1ULL,
+ 0x8f2f0af5e7091bf4ULL, 0x2da1c1240f9bb012ULL, 0xc43d59a92ccc49daULL,
+ 0xbfa6573e56345c1fULL, 0x828b56a8364fd154ULL, 0x9a41f643e0df7cafULL,
+ 0xbcf843c985266aeaULL, 0x2b1de9d7b4bfdce5ULL, 0x20059d79dedd7ab2ULL,
+ 0x6dabe6d6ae3c446bULL, 0x45e81bf6c991ae7bULL, 0x6351ae7cac68b83eULL,
+ 0xa432e32253b6c711ULL, 0xd092a9b991143cd2ULL, 0xcac711032e98b58fULL,
+ 0xd8d4c9e02864ac70ULL, 0xc5fc550f96c25b89ULL, 0xd7ef8dec903e4276ULL,
+ 0x67729ede7e50f06fULL, 0xeac28c7af045cf3dULL, 0xb15c1f945460a04aULL,
+ 0x9cfddeb05bfb1058ULL, 0x93c69abce3a1fe5eULL, 0xeb0380dc4a4bdd6eULL,
+ 0xd20db1e8f8081874ULL, 0x229a8528b7c15e14ULL, 0x44291750739fbc28ULL,
+ 0xd3ccbd4e42060a27ULL, 0xf62b1c33f4ed2a97ULL, 0x86a8660ae4779905ULL,
+ 0xd62e814a2a305025ULL, 0x477703a7a08d8addULL, 0x7b9b0e977af815c5ULL,
+ 0x78c51a60a9ea2330ULL, 0xa6adfb733aaae3b7ULL, 0x97e5aa1e3199b60fULL,
+ 0x0000000000000000ULL, 0xf4b404629df10e31ULL, 0x5564db44a6719322ULL,
+ 0x9207961a59afec0dULL, 0x9624a6b88b97a45cULL, 0x363575380a192b1cULL,
+ 0x2c60cd82b595a241ULL, 0x7d272664c1dc7932ULL, 0x7142769faa94a1c1ULL,
+ 0xa1d0df263b809d13ULL, 0x1630e841d4c451aeULL, 0xc1df65ad44fa13d8ULL,
+ 0x13d2d445bcf20bacULL, 0xd915c546926abe23ULL, 0x38cf3d92084dd749ULL,
+ 0xe766d0272103059dULL, 0xc7634d5effde7f2fULL, 0x077d2455012a7ea4ULL,
+ 0xedbfa82ff16fb199ULL, 0xaf2a978c39d46146ULL, 0x42953fa3c8bbd0dfULL,
+ 0xcb061da59496a7dcULL, 0x25e7a17db6eb20b0ULL, 0x34aa6d6963050fbaULL,
+ 0xa76cf7d580a4f1e4ULL, 0xf7ea10954ee338c4ULL, 0xfcf2643b24819e93ULL,
+ 0xcf252d0746aeef8dULL, 0x4ef06f58a3f3082cULL, 0x563acfb37563a5d7ULL,
+ 0x5086e740ce47c920ULL, 0x2982f186dda3f843ULL, 0x87696aac5e798b56ULL,
+ 0x5d22bb1d1f010380ULL, 0x035e14f7d31236f5ULL, 0x3cec0d30da759f18ULL,
+ 0xf3c920379cdb7095ULL, 0xb8db736b571e22bbULL, 0xdd36f5e44052f672ULL,
+ 0xaac8ab8851e23b44ULL, 0xa857b3d938fe1fe2ULL, 0x17f1e4e76eca43fdULL,
+ 0xec7ea4894b61a3caULL, 0x9e62c6e132e734feULL, 0xd4b1991b432c7483ULL,
+ 0x6ad6c283af163acfULL, 0x1ce9904904a8e5aaULL, 0x5fbda34c761d2726ULL,
+ 0xf910583f4cb7c491ULL, 0xc6a241f845d06d7cULL, 0x4f3163fe19fd1a7fULL,
+ 0xe99c988d2357f9c8ULL, 0x8eee06535d0709a7ULL, 0x0efa48aa0254fc55ULL,
+ 0xb4be23903c56fa48ULL, 0x763f52caabbedf65ULL, 0xeee1bcd8227d876cULL,
+ 0xe345e085f33b4dccULL, 0x3e731561b369bbbeULL, 0x2843fd2067adea10ULL,
+ 0x2adce5710eb1ceb6ULL, 0xb7e03767ef44ccbdULL, 0x8db012a48e153f52ULL,
+ 0x61ceb62dc5749c98ULL, 0xe85d942b9959eb9bULL, 0x4c6f7709caef2c8aULL,
+ 0x84377e5b8d6bbda3ULL, 0x30895dcbb13d47ebULL, 0x74a04a9bc2a2fbc3ULL,
+ 0x6b17ce251518289cULL, 0xe438c4d0f2113368ULL, 0x1fb784bed7bad35fULL,
+ 0x9b80fae55ad16efcULL, 0x77fe5e6c11b0cd36ULL, 0xc858095247849129ULL,
+ 0x08466059b97090a2ULL, 0x01c10ca6ba0e1253ULL, 0x6988d6747c040c3aULL,
+ 0x6849dad2c60a1e69ULL, 0x5147ebe67449db73ULL, 0xc99905f4fd8a837aULL,
+ 0x991fe2b433cd4a5aULL, 0xf09734c04fc94660ULL, 0xa28ecbd1e892abe6ULL,
+ 0xf1563866f5c75433ULL, 0x4dae7baf70e13ed9ULL, 0x7ce62ac27bd26b61ULL,
+ 0x70837a39109ab392ULL, 0x90988e4b30b3c8abULL, 0xb2020b63877296bfULL,
+ 0x156efcb607d6675bULL
+ },
+ {
+ 0xe63f55ce97c331d0ULL, 0x25b506b0015bba16ULL, 0xc8706e29e6ad9ba8ULL,
+ 0x5b43d3775d521f6aULL, 0x0bfa3d577035106eULL, 0xab95fc172afb0e66ULL,
+ 0xf64b63979e7a3276ULL, 0xf58b4562649dad4bULL, 0x48f7c3dbae0c83f1ULL,
+ 0xff31916642f5c8c5ULL, 0xcbb048dc1c4a0495ULL, 0x66b8f83cdf622989ULL,
+ 0x35c130e908e2b9b0ULL, 0x7c761a61f0b34fa1ULL, 0x3601161cf205268dULL,
+ 0x9e54ccfe2219b7d6ULL, 0x8b7d90a538940837ULL, 0x9cd403588ea35d0bULL,
+ 0xbc3c6fea9ccc5b5aULL, 0xe5ff733b6d24aeedULL, 0xceed22de0f7eb8d2ULL,
+ 0xec8581cab1ab545eULL, 0xb96105e88ff8e71dULL, 0x8ca03501871a5eadULL,
+ 0x76ccce65d6db2a2fULL, 0x5883f582a7b58057ULL, 0x3f7be4ed2e8adc3eULL,
+ 0x0fe7be06355cd9c9ULL, 0xee054e6c1d11be83ULL, 0x1074365909b903a6ULL,
+ 0x5dde9f80b4813c10ULL, 0x4a770c7d02b6692cULL, 0x5379c8d5d7809039ULL,
+ 0xb4067448161ed409ULL, 0x5f5e5026183bd6cdULL, 0xe898029bf4c29df9ULL,
+ 0x7fb63c940a54d09cULL, 0xc5171f897f4ba8bcULL, 0xa6f28db7b31d3d72ULL,
+ 0x2e4f3be7716eaa78ULL, 0x0d6771a099e63314ULL, 0x82076254e41bf284ULL,
+ 0x2f0fd2b42733df98ULL, 0x5c9e76d3e2dc49f0ULL, 0x7aeb569619606cdbULL,
+ 0x83478b07b2468764ULL, 0xcfadcb8d5923cd32ULL, 0x85dac7f05b95a41eULL,
+ 0xb5469d1b4043a1e9ULL, 0xb821ecbbd9a592fdULL, 0x1b8e0b0e798c13c8ULL,
+ 0x62a57b6d9a0be02eULL, 0xfcf1b793b81257f8ULL, 0x9d94ea0bd8fe28ebULL,
+ 0x4cea408aeb654a56ULL, 0x23284a47e888996cULL, 0x2d8f1d128b893545ULL,
+ 0xf4cbac3132c0d8abULL, 0xbd7c86b9ca912ebaULL, 0x3a268eef3dbe6079ULL,
+ 0xf0d62f6077a9110cULL, 0x2735c916ade150cbULL, 0x89fd5f03942ee2eaULL,
+ 0x1acee25d2fd16628ULL, 0x90f39bab41181bffULL, 0x430dfe8cde39939fULL,
+ 0xf70b8ac4c8274796ULL, 0x1c53aeaac6024552ULL, 0x13b410acf35e9c9bULL,
+ 0xa532ab4249faa24fULL, 0x2b1251e5625a163fULL, 0xd7e3e676da4841c7ULL,
+ 0xa7b264e4e5404892ULL, 0xda8497d643ae72d3ULL, 0x861ae105a1723b23ULL,
+ 0x38a6414991048aa4ULL, 0x6578dec92585b6b4ULL, 0x0280cfa6acbaeaddULL,
+ 0x88bdb650c273970aULL, 0x9333bd5ebbff84c2ULL, 0x4e6a8f2c47dfa08bULL,
+ 0x321c954db76cef2aULL, 0x418d312a72837942ULL, 0xb29b38bfffcdf773ULL,
+ 0x6c022c38f90a4c07ULL, 0x5a033a240b0f6a8aULL, 0x1f93885f3ce5da6fULL,
+ 0xc38a537e96988bc6ULL, 0x39e6a81ac759ff44ULL, 0x29929e43cee0fce2ULL,
+ 0x40cdd87924de0ca2ULL, 0xe9d8ebc8a29fe819ULL, 0x0c2798f3cfbb46f4ULL,
+ 0x55e484223e53b343ULL, 0x4650948ecd0d2fd8ULL, 0x20e86cb2126f0651ULL,
+ 0x6d42c56baf5739e7ULL, 0xa06fc1405ace1e08ULL, 0x7babbfc54f3d193bULL,
+ 0x424d17df8864e67fULL, 0xd8045870ef14980eULL, 0xc6d7397c85ac3781ULL,
+ 0x21a885e1443273b1ULL, 0x67f8116f893f5c69ULL, 0x24f5efe35706cff6ULL,
+ 0xd56329d076f2ab1aULL, 0x5e1eb9754e66a32dULL, 0x28d2771098bd8902ULL,
+ 0x8f6013f47dfdc190ULL, 0x17a993fdb637553cULL, 0xe0a219397e1012aaULL,
+ 0x786b9930b5da8606ULL, 0x6e82e39e55b0a6daULL, 0x875a0856f72f4ec3ULL,
+ 0x3741ff4fa458536dULL, 0xac4859b3957558fcULL, 0x7ef6d5c75c09a57cULL,
+ 0xc04a758b6c7f14fbULL, 0xf9acdd91ab26ebbfULL, 0x7391a467c5ef9668ULL,
+ 0x335c7c1ee1319acaULL, 0xa91533b18641e4bbULL, 0xe4bf9a683b79db0dULL,
+ 0x8e20faa72ba0b470ULL, 0x51f907737b3a7ae4ULL, 0x2268a314bed5ec8cULL,
+ 0xd944b123b949edeeULL, 0x31dcb3b84d8b7017ULL, 0xd3fe65279f218860ULL,
+ 0x097af2f1dc8ffab3ULL, 0x9b09a6fc312d0b91ULL, 0xcc6ded78a3c4520fULL,
+ 0x3481d9ba5ebfcc50ULL, 0x4f2a667f1182d56bULL, 0xdfd9fdd4509ace94ULL,
+ 0x26752045fbbc252bULL, 0xbffc491f662bc467ULL, 0xdd593272fc202449ULL,
+ 0x3cbbc218d46d4303ULL, 0x91b372f817456e1fULL, 0x681faf69bc6385a0ULL,
+ 0xb686bbeebaa43ed4ULL, 0x1469b5084cd0ca01ULL, 0x98c98009cbca94acULL,
+ 0x6438379a73d8c354ULL, 0xc2caba2dc0c5fe26ULL, 0x3e3b0dbe78d7a9deULL,
+ 0x50b9ee202d670f04ULL, 0x4590b27b37eab0e5ULL, 0x6025b4cb36b10af3ULL,
+ 0xfb2c1237079c0162ULL, 0xa12f28130c936be8ULL, 0x4b37e52e54eb1cccULL,
+ 0x083a1ba28ad28f53ULL, 0xc10a9cd83a22611bULL, 0x9f1425ad7444c236ULL,
+ 0x069d4cf7e9d3237aULL, 0xedc56899e7f621beULL, 0x778c273680865fcfULL,
+ 0x309c5aeb1bd605f7ULL, 0x8de0dc52d1472b4dULL, 0xf8ec34c2fd7b9e5fULL,
+ 0xea18cd3d58787724ULL, 0xaad515447ca67b86ULL, 0x9989695a9d97e14cULL,
+ 0x0000000000000000ULL, 0xf196c63321f464ecULL, 0x71116bc169557cb5ULL,
+ 0xaf887f466f92c7c1ULL, 0x972e3e0ffe964d65ULL, 0x190ec4a8d536f915ULL,
+ 0x95aef1a9522ca7b8ULL, 0xdc19db21aa7d51a9ULL, 0x94ee18fa0471d258ULL,
+ 0x8087adf248a11859ULL, 0xc457f6da2916dd5cULL, 0xfa6cfb6451c17482ULL,
+ 0xf256e0c6db13fbd1ULL, 0x6a9f60cf10d96f7dULL, 0x4daaa9d9bd383fb6ULL,
+ 0x03c026f5fae79f3dULL, 0xde99148706c7bb74ULL, 0x2a52b8b6340763dfULL,
+ 0x6fc20acd03edd33aULL, 0xd423c08320afdefaULL, 0xbbe1ca4e23420dc0ULL,
+ 0x966ed75ca8cb3885ULL, 0xeb58246e0e2502c4ULL, 0x055d6a021334bc47ULL,
+ 0xa47242111fa7d7afULL, 0xe3623fcc84f78d97ULL, 0x81c744a11efc6db9ULL,
+ 0xaec8961539cfb221ULL, 0xf31609958d4e8e31ULL, 0x63e5923ecc5695ceULL,
+ 0x47107ddd9b505a38ULL, 0xa3afe7b5a0298135ULL, 0x792b7063e387f3e6ULL,
+ 0x0140e953565d75e0ULL, 0x12f4f9ffa503e97bULL, 0x750ce8902c3cb512ULL,
+ 0xdbc47e8515f30733ULL, 0x1ed3610c6ab8af8fULL, 0x5239218681dde5d9ULL,
+ 0xe222d69fd2aaf877ULL, 0xfe71783514a8bd25ULL, 0xcaf0a18f4a177175ULL,
+ 0x61655d9860ec7f13ULL, 0xe77fbc9dc19e4430ULL, 0x2ccff441ddd440a5ULL,
+ 0x16e97aaee06a20dcULL, 0xa855dae2d01c915bULL, 0x1d1347f9905f30b2ULL,
+ 0xb7c652bdecf94b34ULL, 0xd03e43d265c6175dULL, 0xfdb15ec0ee4f2218ULL,
+ 0x57644b8492e9599eULL, 0x07dda5a4bf8e569aULL, 0x54a46d71680ec6a3ULL,
+ 0x5624a2d7c4b42c7eULL, 0xbebca04c3076b187ULL, 0x7d36f332a6ee3a41ULL,
+ 0x3b6667bc6be31599ULL, 0x695f463aea3ef040ULL, 0xad08b0e0c3282d1cULL,
+ 0xb15b1e4a052a684eULL, 0x44d05b2861b7c505ULL, 0x15295c5b1a8dbfe1ULL,
+ 0x744c01c37a61c0f2ULL, 0x59c31cd1f1e8f5b7ULL, 0xef45a73f4b4ccb63ULL,
+ 0x6bdf899c46841a9dULL, 0x3dfb2b4b823036e3ULL, 0xa2ef0ee6f674f4d5ULL,
+ 0x184e2dfb836b8cf5ULL, 0x1134df0a5fe47646ULL, 0xbaa1231d751f7820ULL,
+ 0xd17eaa81339b62bdULL, 0xb01bf71953771daeULL, 0x849a2ea30dc8d1feULL,
+ 0x705182923f080955ULL, 0x0ea757556301ac29ULL, 0x041d83514569c9a7ULL,
+ 0x0abad4042668658eULL, 0x49b72a88f851f611ULL, 0x8a3d79f66ec97dd7ULL,
+ 0xcd2d042bf59927efULL, 0xc930877ab0f0ee48ULL, 0x9273540deda2f122ULL,
+ 0xc797d02fd3f14261ULL, 0xe1e2f06a284d674aULL, 0xd2be8c74c97cfd80ULL,
+ 0x9a494faf67707e71ULL, 0xb3dbd1eca9908293ULL, 0x72d14d3493b2e388ULL,
+ 0xd6a30f258c153427ULL
+ }
+};
+#else
+ALIGN(16) static const unsigned long long Ax[8][256] =
+{
+ {
+ 0xe6f87e5c5b711fd0ULL, 0x258377800924fa16ULL, 0xc849e07e852ea4a8ULL,
+ 0x5b4686a18f06c16aULL, 0x0b32e9a2d77b416eULL, 0xabda37a467815c66ULL,
+ 0xf61796a81a686676ULL, 0xf5dc0b706391954bULL, 0x4862f38db7e64bf1ULL,
+ 0xff5c629a68bd85c5ULL, 0xcb827da6fcd75795ULL, 0x66d36daf69b9f089ULL,
+ 0x356c9f74483d83b0ULL, 0x7cbcecb1238c99a1ULL, 0x36a702ac31c4708dULL,
+ 0x9eb6a8d02fbcdfd6ULL, 0x8b19fa51e5b3ae37ULL, 0x9ccfb5408a127d0bULL,
+ 0xbc0c78b508208f5aULL, 0xe533e3842288ecedULL, 0xcec2c7d377c15fd2ULL,
+ 0xec7817b6505d0f5eULL, 0xb94cc2c08336871dULL, 0x8c205db4cb0b04adULL,
+ 0x763c855b28a0892fULL, 0x588d1b79f6ff3257ULL, 0x3fecf69e4311933eULL,
+ 0x0fc0d39f803a18c9ULL, 0xee010a26f5f3ad83ULL, 0x10efe8f4411979a6ULL,
+ 0x5dcda10c7de93a10ULL, 0x4a1bee1d1248e92cULL, 0x53bff2db21847339ULL,
+ 0xb4f50ccfa6a23d09ULL, 0x5fb4bc9cd84798cdULL, 0xe88a2d8b071c56f9ULL,
+ 0x7f7771695a756a9cULL, 0xc5f02e71a0ba1ebcULL, 0xa663f9ab4215e672ULL,
+ 0x2eb19e22de5fbb78ULL, 0x0db9ce0f2594ba14ULL, 0x82520e6397664d84ULL,
+ 0x2f031e6a0208ea98ULL, 0x5c7f2144a1be6bf0ULL, 0x7a37cb1cd16362dbULL,
+ 0x83e08e2b4b311c64ULL, 0xcf70479bab960e32ULL, 0x856ba986b9dee71eULL,
+ 0xb5478c877af56ce9ULL, 0xb8fe42885f61d6fdULL, 0x1bdd0156966238c8ULL,
+ 0x622157923ef8a92eULL, 0xfc97ff42114476f8ULL, 0x9d7d350856452cebULL,
+ 0x4c90c9b0e0a71256ULL, 0x2308502dfbcb016cULL, 0x2d7a03faa7a64845ULL,
+ 0xf46e8b38bfc6c4abULL, 0xbdbef8fdd477debaULL, 0x3aac4cebc8079b79ULL,
+ 0xf09cb105e8879d0cULL, 0x27fa6a10ac8a58cbULL, 0x8960e7c1401d0ceaULL,
+ 0x1a6f811e4a356928ULL, 0x90c4fb0773d196ffULL, 0x43501a2f609d0a9fULL,
+ 0xf7a516e0c63f3796ULL, 0x1ce4a6b3b8da9252ULL, 0x1324752c38e08a9bULL,
+ 0xa5a864733bec154fULL, 0x2bf124575549b33fULL, 0xd766db15440dc5c7ULL,
+ 0xa7d179e39e42b792ULL, 0xdadf151a61997fd3ULL, 0x86a0345ec0271423ULL,
+ 0x38d5517b6da939a4ULL, 0x6518f077104003b4ULL, 0x02791d90a5aea2ddULL,
+ 0x88d267899c4a5d0aULL, 0x930f66df0a2865c2ULL, 0x4ee9d4204509b08bULL,
+ 0x325538916685292aULL, 0x412907bfc533a842ULL, 0xb27e2b62544dc673ULL,
+ 0x6c5304456295e007ULL, 0x5af406e95351908aULL, 0x1f2f3b6bc123616fULL,
+ 0xc37b09dc5255e5c6ULL, 0x3967d133b1fe6844ULL, 0x298839c7f0e711e2ULL,
+ 0x409b87f71964f9a2ULL, 0xe938adc3db4b0719ULL, 0x0c0b4e47f9c3ebf4ULL,
+ 0x5534d576d36b8843ULL, 0x4610a05aeb8b02d8ULL, 0x20c3cdf58232f251ULL,
+ 0x6de1840dbec2b1e7ULL, 0xa0e8de06b0fa1d08ULL, 0x7b854b540d34333bULL,
+ 0x42e29a67bcca5b7fULL, 0xd8a6088ac437dd0eULL, 0xc63bb3a9d943ed81ULL,
+ 0x21714dbd5e65a3b1ULL, 0x6761ede7b5eea169ULL, 0x2431f7c8d573abf6ULL,
+ 0xd51fc685e1a3671aULL, 0x5e063cd40410c92dULL, 0x283ab98f2cb04002ULL,
+ 0x8febc06cb2f2f790ULL, 0x17d64f116fa1d33cULL, 0xe07359f1a99ee4aaULL,
+ 0x784ed68c74cdc006ULL, 0x6e2a19d5c73b42daULL, 0x8712b4161c7045c3ULL,
+ 0x371582e4ed93216dULL, 0xace390414939f6fcULL, 0x7ec5f12186223b7cULL,
+ 0xc0b094042bac16fbULL, 0xf9d745379a527ebfULL, 0x737c3f2ea3b68168ULL,
+ 0x33e7b8d9bad278caULL, 0xa9a32a34c22ffebbULL, 0xe48163ccfedfbd0dULL,
+ 0x8e5940246ea5a670ULL, 0x51c6ef4b842ad1e4ULL, 0x22bad065279c508cULL,
+ 0xd91488c218608ceeULL, 0x319ea5491f7cda17ULL, 0xd394e128134c9c60ULL,
+ 0x094bf43272d5e3b3ULL, 0x9bf612a5a4aad791ULL, 0xccbbda43d26ffd0fULL,
+ 0x34de1f3c946ad250ULL, 0x4f5b5468995ee16bULL, 0xdf9faf6fea8f7794ULL,
+ 0x2648ea5870dd092bULL, 0xbfc7e56d71d97c67ULL, 0xdde6b2ff4f21d549ULL,
+ 0x3c276b463ae86003ULL, 0x91767b4faf86c71fULL, 0x68a13e7835d4b9a0ULL,
+ 0xb68c115f030c9fd4ULL, 0x141dd2c916582001ULL, 0x983d8f7ddd5324acULL,
+ 0x64aa703fcc175254ULL, 0xc2c989948e02b426ULL, 0x3e5e76d69f46c2deULL,
+ 0x50746f03587d8004ULL, 0x45db3d829272f1e5ULL, 0x60584a029b560bf3ULL,
+ 0xfbae58a73ffcdc62ULL, 0xa15a5e4e6cad4ce8ULL, 0x4ba96e55ce1fb8ccULL,
+ 0x08f9747aae82b253ULL, 0xc102144cf7fb471bULL, 0x9f042898f3eb8e36ULL,
+ 0x068b27adf2effb7aULL, 0xedca97fe8c0a5ebeULL, 0x778e0513f4f7d8cfULL,
+ 0x302c2501c32b8bf7ULL, 0x8d92ddfc175c554dULL, 0xf865c57f46052f5fULL,
+ 0xeaf3301ba2b2f424ULL, 0xaa68b7ecbbd60d86ULL, 0x998f0f350104754cULL,
+ 0x0000000000000000ULL, 0xf12e314d34d0ccecULL, 0x710522be061823b5ULL,
+ 0xaf280d9930c005c1ULL, 0x97fd5ce25d693c65ULL, 0x19a41cc633cc9a15ULL,
+ 0x95844172f8c79eb8ULL, 0xdc5432b7937684a9ULL, 0x9436c13a2490cf58ULL,
+ 0x802b13f332c8ef59ULL, 0xc442ae397ced4f5cULL, 0xfa1cd8efe3ab8d82ULL,
+ 0xf2e5ac954d293fd1ULL, 0x6ad823e8907a1b7dULL, 0x4d2249f83cf043b6ULL,
+ 0x03cb9dd879f9f33dULL, 0xde2d2f2736d82674ULL, 0x2a43a41f891ee2dfULL,
+ 0x6f98999d1b6c133aULL, 0xd4ad46cd3df436faULL, 0xbb35df50269825c0ULL,
+ 0x964fdcaa813e6d85ULL, 0xeb41b0537ee5a5c4ULL, 0x0540ba758b160847ULL,
+ 0xa41ae43be7bb44afULL, 0xe3b8c429d0671797ULL, 0x819993bbee9fbeb9ULL,
+ 0xae9a8dd1ec975421ULL, 0xf3572cdd917e6e31ULL, 0x6393d7dae2aff8ceULL,
+ 0x47a2201237dc5338ULL, 0xa32343dec903ee35ULL, 0x79fc56c4a89a91e6ULL,
+ 0x01b28048dc5751e0ULL, 0x1296f564e4b7db7bULL, 0x75f7188351597a12ULL,
+ 0xdb6d9552bdce2e33ULL, 0x1e9dbb231d74308fULL, 0x520d7293fdd322d9ULL,
+ 0xe20a44610c304677ULL, 0xfeeee2d2b4ead425ULL, 0xca30fdee20800675ULL,
+ 0x61eaca4a47015a13ULL, 0xe74afe1487264e30ULL, 0x2cc883b27bf119a5ULL,
+ 0x1664cf59b3f682dcULL, 0xa811aa7c1e78af5bULL, 0x1d5626fb648dc3b2ULL,
+ 0xb73e9117df5bce34ULL, 0xd05f7cf06ab56f5dULL, 0xfd257f0acd132718ULL,
+ 0x574dc8e676c52a9eULL, 0x0739a7e52eb8aa9aULL, 0x5486553e0f3cd9a3ULL,
+ 0x56ff48aeaa927b7eULL, 0xbe756525ad8e2d87ULL, 0x7d0e6cf9ffdbc841ULL,
+ 0x3b1ecca31450ca99ULL, 0x6913be30e983e840ULL, 0xad511009956ea71cULL,
+ 0xb1b5b6ba2db4354eULL, 0x4469bdca4e25a005ULL, 0x15af5281ca0f71e1ULL,
+ 0x744598cb8d0e2bf2ULL, 0x593f9b312aa863b7ULL, 0xefb38a6e29a4fc63ULL,
+ 0x6b6aa3a04c2d4a9dULL, 0x3d95eb0ee6bf31e3ULL, 0xa291c3961554bfd5ULL,
+ 0x18169c8eef9bcbf5ULL, 0x115d68bc9d4e2846ULL, 0xba875f18facf7420ULL,
+ 0xd1edfcb8b6e23ebdULL, 0xb00736f2f1e364aeULL, 0x84d929ce6589b6feULL,
+ 0x70b7a2f6da4f7255ULL, 0x0e7253d75c6d4929ULL, 0x04f23a3d574159a7ULL,
+ 0x0a8069ea0b2c108eULL, 0x49d073c56bb11a11ULL, 0x8aab7a1939e4ffd7ULL,
+ 0xcd095a0b0e38acefULL, 0xc9fb60365979f548ULL, 0x92bde697d67f3422ULL,
+ 0xc78933e10514bc61ULL, 0xe1c1d9b975c9b54aULL, 0xd2266160cf1bcd80ULL,
+ 0x9a4492ed78fd8671ULL, 0xb3ccab2a881a9793ULL, 0x72cebf667fe1d088ULL,
+ 0xd6d45b5d985a9427ULL
+ },
+ {
+ 0xc811a8058c3f55deULL, 0x65f5b43196b50619ULL, 0xf74f96b1d6706e43ULL,
+ 0x859d1e8bcb43d336ULL, 0x5aab8a85ccfa3d84ULL, 0xf9c7bf99c295fcfdULL,
+ 0xa21fd5a1de4b630fULL, 0xcdb3ef763b8b456dULL, 0x803f59f87cf7c385ULL,
+ 0xb27c73be5f31913cULL, 0x98e3ac6633b04821ULL, 0xbf61674c26b8f818ULL,
+ 0x0ffbc995c4c130c8ULL, 0xaaa0862010761a98ULL, 0x6057f342210116aaULL,
+ 0xf63c760c0654cc35ULL, 0x2ddb45cc667d9042ULL, 0xbcf45a964bd40382ULL,
+ 0x68e8a0c3ef3c6f3dULL, 0xa7bd92d269ff73bcULL, 0x290ae20201ed2287ULL,
+ 0xb7de34cde885818fULL, 0xd901eea7dd61059bULL, 0xd6fa273219a03553ULL,
+ 0xd56f1ae874cccec9ULL, 0xea31245c2e83f554ULL, 0x7034555da07be499ULL,
+ 0xce26d2ac56e7bef7ULL, 0xfd161857a5054e38ULL, 0x6a0e7da4527436d1ULL,
+ 0x5bd86a381cde9ff2ULL, 0xcaf7756231770c32ULL, 0xb09aaed9e279c8d0ULL,
+ 0x5def1091c60674dbULL, 0x111046a2515e5045ULL, 0x23536ce4729802fcULL,
+ 0xc50cbcf7f5b63cfaULL, 0x73a16887cd171f03ULL, 0x7d2941afd9f28dbdULL,
+ 0x3f5e3eb45a4f3b9dULL, 0x84eefe361b677140ULL, 0x3db8e3d3e7076271ULL,
+ 0x1a3a28f9f20fd248ULL, 0x7ebc7c75b49e7627ULL, 0x74e5f293c7eb565cULL,
+ 0x18dcf59e4f478ba4ULL, 0x0c6ef44fa9adcb52ULL, 0xc699812d98dac760ULL,
+ 0x788b06dc6e469d0eULL, 0xfc65f8ea7521ec4eULL, 0x30a5f7219e8e0b55ULL,
+ 0x2bec3f65bca57b6bULL, 0xddd04969baf1b75eULL, 0x99904cdbe394ea57ULL,
+ 0x14b201d1e6ea40f6ULL, 0xbbb0c08241284addULL, 0x50f20463bf8f1dffULL,
+ 0xe8d7f93b93cbacb8ULL, 0x4d8cb68e477c86e8ULL, 0xc1dd1b3992268e3fULL,
+ 0x7c5aa11209d62fcbULL, 0x2f3d98abdb35c9aeULL, 0x671369562bfd5ff5ULL,
+ 0x15c1e16c36cee280ULL, 0x1d7eb2edf8f39b17ULL, 0xda94d37db00dfe01ULL,
+ 0x877bc3ec760b8adaULL, 0xcb8495dfe153ae44ULL, 0x05a24773b7b410b3ULL,
+ 0x12857b783c32abdfULL, 0x8eb770d06812513bULL, 0x536739b9d2e3e665ULL,
+ 0x584d57e271b26468ULL, 0xd789c78fc9849725ULL, 0xa935bbfa7d1ae102ULL,
+ 0x8b1537a3dfa64188ULL, 0xd0cd5d9bc378de7aULL, 0x4ac82c9a4d80cfb7ULL,
+ 0x42777f1b83bdb620ULL, 0x72d2883a1d33bd75ULL, 0x5e7a2d4bab6a8f41ULL,
+ 0xf4daab6bbb1c95d9ULL, 0x905cffe7fd8d31b6ULL, 0x83aa6422119b381fULL,
+ 0xc0aefb8442022c49ULL, 0xa0f908c663033ae3ULL, 0xa428af0804938826ULL,
+ 0xade41c341a8a53c7ULL, 0xae7121ee77e6a85dULL, 0xc47f5c4a25929e8cULL,
+ 0xb538e9aa55cdd863ULL, 0x06377aa9dad8eb29ULL, 0xa18ae87bb3279895ULL,
+ 0x6edfda6a35e48414ULL, 0x6b7d9d19825094a7ULL, 0xd41cfa55a4e86cbfULL,
+ 0xe5caedc9ea42c59cULL, 0xa36c351c0e6fc179ULL, 0x5181e4de6fabbf89ULL,
+ 0xfff0c530184d17d4ULL, 0x9d41eb1584045892ULL, 0x1c0d525028d73961ULL,
+ 0xf178ec180ca8856aULL, 0x9a0571018ef811cdULL, 0x4091a27c3ef5efccULL,
+ 0x19af15239f6329d2ULL, 0x347450eff91eb990ULL, 0xe11b4a078dd27759ULL,
+ 0xb9561de5fc601331ULL, 0x912f1f5a2da993c0ULL, 0x1654dcb65ba2191aULL,
+ 0x3e2dde098a6b99ebULL, 0x8a66d71e0f82e3feULL, 0x8c51adb7d55a08d7ULL,
+ 0x4533e50f8941ff7fULL, 0x02e6dd67bd4859ecULL, 0xe068aaba5df6d52fULL,
+ 0xc24826e3ff4a75a5ULL, 0x6c39070d88acddf8ULL, 0x6486548c4691a46fULL,
+ 0xd1bebd26135c7c0cULL, 0xb30f93038f15334aULL, 0x82d9849fc1bf9a69ULL,
+ 0x9c320ba85420fae4ULL, 0xfa528243aff90767ULL, 0x9ed4d6cfe968a308ULL,
+ 0xb825fd582c44b147ULL, 0x9b7691bc5edcb3bbULL, 0xc7ea619048fe6516ULL,
+ 0x1063a61f817af233ULL, 0x47d538683409a693ULL, 0x63c2ce984c6ded30ULL,
+ 0x2a9fdfd86c81d91dULL, 0x7b1e3b06032a6694ULL, 0x666089ebfbd9fd83ULL,
+ 0x0a598ee67375207bULL, 0x07449a140afc495fULL, 0x2ca8a571b6593234ULL,
+ 0x1f986f8a45bbc2fbULL, 0x381aa4a050b372c2ULL, 0x5423a3add81faf3aULL,
+ 0x17273c0b8b86bb6cULL, 0xfe83258dc869b5a2ULL, 0x287902bfd1c980f1ULL,
+ 0xf5a94bd66b3837afULL, 0x88800a79b2caba12ULL, 0x55504310083b0d4cULL,
+ 0xdf36940e07b9eeb2ULL, 0x04d1a7ce6790b2c5ULL, 0x612413fff125b4dcULL,
+ 0x26f12b97c52c124fULL, 0x86082351a62f28acULL, 0xef93632f9937e5e7ULL,
+ 0x3507b052293a1be6ULL, 0xe72c30ae570a9c70ULL, 0xd3586041ae1425e0ULL,
+ 0xde4574b3d79d4cc4ULL, 0x92ba228040c5685aULL, 0xf00b0ca5dc8c271cULL,
+ 0xbe1287f1f69c5a6eULL, 0xf39e317fb1e0dc86ULL, 0x495d114020ec342dULL,
+ 0x699b407e3f18cd4bULL, 0xdca3a9d46ad51528ULL, 0x0d1d14f279896924ULL,
+ 0x0000000000000000ULL, 0x593eb75fa196c61eULL, 0x2e4e78160b116bd8ULL,
+ 0x6d4ae7b058887f8eULL, 0xe65fd013872e3e06ULL, 0x7a6ddbbbd30ec4e2ULL,
+ 0xac97fc89caaef1b1ULL, 0x09ccb33c1e19dbe1ULL, 0x89f3eac462ee1864ULL,
+ 0x7770cf49aa87adc6ULL, 0x56c57eca6557f6d6ULL, 0x03953dda6d6cfb9aULL,
+ 0x36928d884456e07cULL, 0x1eeb8f37959f608dULL, 0x31d6179c4eaaa923ULL,
+ 0x6fac3ad7e5c02662ULL, 0x43049fa653991456ULL, 0xabd3669dc052b8eeULL,
+ 0xaf02c153a7c20a2bULL, 0x3ccb036e3723c007ULL, 0x93c9c23d90e1ca2cULL,
+ 0xc33bc65e2f6ed7d3ULL, 0x4cff56339758249eULL, 0xb1e94e64325d6aa6ULL,
+ 0x37e16d359472420aULL, 0x79f8e661be623f78ULL, 0x5214d90402c74413ULL,
+ 0x482ef1fdf0c8965bULL, 0x13f69bc5ec1609a9ULL, 0x0e88292814e592beULL,
+ 0x4e198b542a107d72ULL, 0xccc00fcbebafe71bULL, 0x1b49c844222b703eULL,
+ 0x2564164da840e9d5ULL, 0x20c6513e1ff4f966ULL, 0xbac3203f910ce8abULL,
+ 0xf2edd1c261c47ef0ULL, 0x814cb945acd361f3ULL, 0x95feb8944a392105ULL,
+ 0x5c9cf02c1622d6adULL, 0x971865f3f77178e9ULL, 0xbd87ba2b9bf0a1f4ULL,
+ 0x444005b259655d09ULL, 0xed75be48247fbc0bULL, 0x7596122e17cff42aULL,
+ 0xb44b091785e97a15ULL, 0x966b854e2755da9fULL, 0xeee0839249134791ULL,
+ 0x32432a4623c652b9ULL, 0xa8465b47ad3e4374ULL, 0xf8b45f2412b15e8bULL,
+ 0x2417f6f078644ba3ULL, 0xfb2162fe7fdda511ULL, 0x4bbbcc279da46dc1ULL,
+ 0x0173e0bdd024a276ULL, 0x22208c59a2bca08aULL, 0x8fc4906db836f34dULL,
+ 0xe4b90d743a6667eaULL, 0x7147b5e0705f46efULL, 0x2782cb2a1508b039ULL,
+ 0xec065ef5f45b1e7dULL, 0x21b5b183cfd05b10ULL, 0xdbe733c060295c77ULL,
+ 0x9fa73672394c017eULL, 0xcf55321186c31c81ULL, 0xd8720e1a0d45a7edULL,
+ 0x3b8f997a3ddf8958ULL, 0x3afc79c7edfb2b2eULL, 0xe9a4198643ef0eceULL,
+ 0x5f09cdf67b4e2d37ULL, 0x4f6a6be9fa34df04ULL, 0xb6add47038a123f9ULL,
+ 0x8d224d0a057eaaa1ULL, 0xc96248b85c1bf7a8ULL, 0xe3fd9760309a2eb5ULL,
+ 0x0b2a6e5ba351820dULL, 0xeb42c4e1fea75722ULL, 0x948d58299a1d8373ULL,
+ 0x7fcf9cc864bad451ULL, 0xa55b4fb5d4b72a50ULL, 0x08bf5381ce3d7997ULL,
+ 0x46a6d8d5e42d04e5ULL, 0xd22b80fc7e308796ULL, 0x57b69e77b57354a0ULL,
+ 0x3969441d8097d0b4ULL, 0x3330cafbf3e2f0cfULL, 0xe28e77dde0be8cc3ULL,
+ 0x62b12e259c494f46ULL, 0xa6ce726fb9dbd1caULL, 0x41e242c1eed14dbaULL,
+ 0x76032ff47aa30fb0ULL
+ },
+ {
+ 0x45b268a93acde4ccULL, 0xaf7f0be884549d08ULL, 0x048354b3c1468263ULL,
+ 0x925435c2c80efed2ULL, 0xee4e37f27fdffba7ULL, 0x167a33920c60f14dULL,
+ 0xfb123b52ea03e584ULL, 0x4a0cab53fdbb9007ULL, 0x9deaf6380f788a19ULL,
+ 0xcb48ec558f0cb32aULL, 0xb59dc4b2d6fef7e0ULL, 0xdcdbca22f4f3ecb6ULL,
+ 0x11df5813549a9c40ULL, 0xe33fdedf568aced3ULL, 0xa0c1c8124322e9c3ULL,
+ 0x07a56b8158fa6d0dULL, 0x77279579b1e1f3ddULL, 0xd9b18b74422ac004ULL,
+ 0xb8ec2d9fffabc294ULL, 0xf4acf8a82d75914fULL, 0x7bbf69b1ef2b6878ULL,
+ 0xc4f62faf487ac7e1ULL, 0x76ce809cc67e5d0cULL, 0x6711d88f92e4c14cULL,
+ 0x627b99d9243dedfeULL, 0x234aa5c3dfb68b51ULL, 0x909b1f15262dbf6dULL,
+ 0x4f66ea054b62bcb5ULL, 0x1ae2cf5a52aa6ae8ULL, 0xbea053fbd0ce0148ULL,
+ 0xed6808c0e66314c9ULL, 0x43fe16cd15a82710ULL, 0xcd049231a06970f6ULL,
+ 0xe7bc8a6c97cc4cb0ULL, 0x337ce835fcb3b9c0ULL, 0x65def2587cc780f3ULL,
+ 0x52214ede4132bb50ULL, 0x95f15e4390f493dfULL, 0x870839625dd2e0f1ULL,
+ 0x41313c1afb8b66afULL, 0x91720af051b211bcULL, 0x477d427ed4eea573ULL,
+ 0x2e3b4ceef6e3be25ULL, 0x82627834eb0bcc43ULL, 0x9c03e3dd78e724c8ULL,
+ 0x2877328ad9867df9ULL, 0x14b51945e243b0f2ULL, 0x574b0f88f7eb97e2ULL,
+ 0x88b6fa989aa4943aULL, 0x19c4f068cb168586ULL, 0x50ee6409af11faefULL,
+ 0x7df317d5c04eaba4ULL, 0x7a567c5498b4c6a9ULL, 0xb6bbfb804f42188eULL,
+ 0x3cc22bcf3bc5cd0bULL, 0xd04336eaaa397713ULL, 0xf02fac1bec33132cULL,
+ 0x2506dba7f0d3488dULL, 0xd7e65d6bf2c31a1eULL, 0x5eb9b2161ff820f5ULL,
+ 0x842e0650c46e0f9fULL, 0x716beb1d9e843001ULL, 0xa933758cab315ed4ULL,
+ 0x3fe414fda2792265ULL, 0x27c9f1701ef00932ULL, 0x73a4c1ca70a771beULL,
+ 0x94184ba6e76b3d0eULL, 0x40d829ff8c14c87eULL, 0x0fbec3fac77674cbULL,
+ 0x3616a9634a6a9572ULL, 0x8f139119c25ef937ULL, 0xf545ed4d5aea3f9eULL,
+ 0xe802499650ba387bULL, 0x6437e7bd0b582e22ULL, 0xe6559f89e053e261ULL,
+ 0x80ad52e305288dfcULL, 0x6dc55a23e34b9935ULL, 0xde14e0f51ad0ad09ULL,
+ 0xc6390578a659865eULL, 0x96d7617109487cb1ULL, 0xe2d6cb3a21156002ULL,
+ 0x01e915e5779faed1ULL, 0xadb0213f6a77dcb7ULL, 0x9880b76eb9a1a6abULL,
+ 0x5d9f8d248644cf9bULL, 0xfd5e4536c5662658ULL, 0xf1c6b9fe9bacbdfdULL,
+ 0xeacd6341be9979c4ULL, 0xefa7221708405576ULL, 0x510771ecd88e543eULL,
+ 0xc2ba51cb671f043dULL, 0x0ad482ac71af5879ULL, 0xfe787a045cdac936ULL,
+ 0xb238af338e049aedULL, 0xbd866cc94972ee26ULL, 0x615da6ebbd810290ULL,
+ 0x3295fdd08b2c1711ULL, 0xf834046073bf0aeaULL, 0xf3099329758ffc42ULL,
+ 0x1caeb13e7dcfa934ULL, 0xba2307481188832bULL, 0x24efce42874ce65cULL,
+ 0x0e57d61fb0e9da1aULL, 0xb3d1bad6f99b343cULL, 0xc0757b1c893c4582ULL,
+ 0x2b510db8403a9297ULL, 0x5c7698c1f1db614aULL, 0x3e0d0118d5e68cb4ULL,
+ 0xd60f488e855cb4cfULL, 0xae961e0df3cb33d9ULL, 0x3a8e55ab14a00ed7ULL,
+ 0x42170328623789c1ULL, 0x838b6dd19c946292ULL, 0x895fef7ded3b3aebULL,
+ 0xcfcbb8e64e4a3149ULL, 0x064c7e642f65c3dcULL, 0x3d2b3e2a4c5a63daULL,
+ 0x5bd3f340a9210c47ULL, 0xb474d157a1615931ULL, 0xac5934da1de87266ULL,
+ 0x6ee365117af7765bULL, 0xc86ed36716b05c44ULL, 0x9ba6885c201d49c5ULL,
+ 0xb905387a88346c45ULL, 0x131072c4bab9ddffULL, 0xbf49461ea751af99ULL,
+ 0xd52977bc1ce05ba1ULL, 0xb0f785e46027db52ULL, 0x546d30ba6e57788cULL,
+ 0x305ad707650f56aeULL, 0xc987c682612ff295ULL, 0xa5ab8944f5fbc571ULL,
+ 0x7ed528e759f244caULL, 0x8ddcbbce2c7db888ULL, 0xaa154abe328db1baULL,
+ 0x1e619be993ece88bULL, 0x09f2bd9ee813b717ULL, 0x7401aa4b285d1cb3ULL,
+ 0x21858f143195caeeULL, 0x48c381841398d1b8ULL, 0xfcb750d3b2f98889ULL,
+ 0x39a86a998d1ce1b9ULL, 0x1f888e0ce473465aULL, 0x7899568376978716ULL,
+ 0x02cf2ad7ee2341bfULL, 0x85c713b5b3f1a14eULL, 0xff916fe12b4567e7ULL,
+ 0x7c1a0230b7d10575ULL, 0x0c98fcc85eca9ba5ULL, 0xa3e7f720da9e06adULL,
+ 0x6a6031a2bbb1f438ULL, 0x973e74947ed7d260ULL, 0x2cf4663918c0ff9aULL,
+ 0x5f50a7f368678e24ULL, 0x34d983b4a449d4cdULL, 0x68af1b755592b587ULL,
+ 0x7f3c3d022e6dea1bULL, 0xabfc5f5b45121f6bULL, 0x0d71e92d29553574ULL,
+ 0xdffdf5106d4f03d8ULL, 0x081ba87b9f8c19c6ULL, 0xdb7ea1a3ac0981bbULL,
+ 0xbbca12ad66172dfaULL, 0x79704366010829c7ULL, 0x179326777bff5f9cULL,
+ 0x0000000000000000ULL, 0xeb2476a4c906d715ULL, 0x724dd42f0738df6fULL,
+ 0xb752ee6538ddb65fULL, 0x37ffbc863df53ba3ULL, 0x8efa84fcb5c157e6ULL,
+ 0xe9eb5c73272596aaULL, 0x1b0bdabf2535c439ULL, 0x86e12c872a4d4e20ULL,
+ 0x9969a28bce3e087aULL, 0xfafb2eb79d9c4b55ULL, 0x056a4156b6d92cb2ULL,
+ 0x5a3ae6a5debea296ULL, 0x22a3b026a8292580ULL, 0x53c85b3b36ad1581ULL,
+ 0xb11e900117b87583ULL, 0xc51f3a4a3fe56930ULL, 0xe019e1edcf3621bdULL,
+ 0xec811d2591fcba18ULL, 0x445b7d4c4d524a1dULL, 0xa8da6069dcaef005ULL,
+ 0x58f5cc72309de329ULL, 0xd4c062596b7ff570ULL, 0xce22ad0339d59f98ULL,
+ 0x591cd99747024df8ULL, 0x8b90c5aa03187b54ULL, 0xf663d27fc356d0f0ULL,
+ 0xd8589e9135b56ed5ULL, 0x35309651d3d67a1cULL, 0x12f96721cd26732eULL,
+ 0xd28c1c3d441a36acULL, 0x492a946164077f69ULL, 0x2d1d73dc6f5f514bULL,
+ 0x6f0a70f40d68d88aULL, 0x60b4b30eca1eac41ULL, 0xd36509d83385987dULL,
+ 0x0b3d97490630f6a8ULL, 0x9eccc90a96c46577ULL, 0xa20ee2c5ad01a87cULL,
+ 0xe49ab55e0e70a3deULL, 0xa4429ca182646ba0ULL, 0xda97b446db962f6aULL,
+ 0xcced87d4d7f6de27ULL, 0x2ab8185d37a53c46ULL, 0x9f25dcefe15bcba6ULL,
+ 0xc19c6ef9fea3eb53ULL, 0xa764a3931bd884ceULL, 0x2fd2590b817c10f4ULL,
+ 0x56a21a6d80743933ULL, 0xe573a0bb79ef0d0fULL, 0x155c0ca095dc1e23ULL,
+ 0x6c2c4fc694d437e4ULL, 0x10364df623053291ULL, 0xdd32dfc7836c4267ULL,
+ 0x03263f3299bcef6eULL, 0x66f8cd6ae57b6f9dULL, 0x8c35ae2b5be21659ULL,
+ 0x31b3c2e21290f87fULL, 0x93bd2027bf915003ULL, 0x69460e90220d1b56ULL,
+ 0x299e276fae19d328ULL, 0x63928c3c53a2432fULL, 0x7082fef8e91b9ed0ULL,
+ 0xbc6f792c3eed40f7ULL, 0x4c40d537d2de53dbULL, 0x75e8bfae5fc2b262ULL,
+ 0x4da9c0d2a541fd0aULL, 0x4e8fffe03cfd1264ULL, 0x2620e495696fa7e3ULL,
+ 0xe1f0f408b8a98f6cULL, 0xd1aa230fdda6d9c2ULL, 0xc7d0109dd1c6288fULL,
+ 0x8a79d04f7487d585ULL, 0x4694579ba3710ba2ULL, 0x38417f7cfa834f68ULL,
+ 0x1d47a4db0a5007e5ULL, 0x206c9af1460a643fULL, 0xa128ddf734bd4712ULL,
+ 0x8144470672b7232dULL, 0xf2e086cc02105293ULL, 0x182de58dbc892b57ULL,
+ 0xcaa1f9b0f8931dfbULL, 0x6b892447cc2e5ae9ULL, 0xf9dd11850420a43bULL,
+ 0x4be5beb68a243ed6ULL, 0x5584255f19c8d65dULL, 0x3b67404e633fa006ULL,
+ 0xa68db6766c472a1fULL, 0xf78ac79ab4c97e21ULL, 0xc353442e1080aaecULL,
+ 0x9a4f9db95782e714ULL
+ },
+ {
+ 0x05ba7bc82c9b3220ULL, 0x31a54665f8b65e4fULL, 0xb1b651f77547f4d4ULL,
+ 0x8bfa0d857ba46682ULL, 0x85a96c5aa16a98bbULL, 0x990faef908eb79c9ULL,
+ 0xa15e37a247f4a62dULL, 0x76857dcd5d27741eULL, 0xf8c50b800a1820bcULL,
+ 0xbe65dcb201f7a2b4ULL, 0x666d1b986f9426e7ULL, 0x4cc921bf53c4e648ULL,
+ 0x95410a0f93d9ca42ULL, 0x20cdccaa647ba4efULL, 0x429a4060890a1871ULL,
+ 0x0c4ea4f69b32b38bULL, 0xccda362dde354cd3ULL, 0x96dc23bc7c5b2fa9ULL,
+ 0xc309bb68aa851ab3ULL, 0xd26131a73648e013ULL, 0x021dc52941fc4db2ULL,
+ 0xcd5adab7704be48aULL, 0xa77965d984ed71e6ULL, 0x32386fd61734bba4ULL,
+ 0xe82d6dd538ab7245ULL, 0x5c2147ea6177b4b1ULL, 0x5da1ab70cf091ce8ULL,
+ 0xac907fce72b8bdffULL, 0x57c85dfd972278a8ULL, 0xa4e44c6a6b6f940dULL,
+ 0x3851995b4f1fdfe4ULL, 0x62578ccaed71bc9eULL, 0xd9882bb0c01d2c0aULL,
+ 0x917b9d5d113c503bULL, 0xa2c31e11a87643c6ULL, 0xe463c923a399c1ceULL,
+ 0xf71686c57ea876dcULL, 0x87b4a973e096d509ULL, 0xaf0d567d9d3a5814ULL,
+ 0xb40c2a3f59dcc6f4ULL, 0x3602f88495d121ddULL, 0xd3e1dd3d9836484aULL,
+ 0xf945e71aa46688e5ULL, 0x7518547eb2a591f5ULL, 0x9366587450c01d89ULL,
+ 0x9ea81018658c065bULL, 0x4f54080cbc4603a3ULL, 0x2d0384c65137bf3dULL,
+ 0xdc325078ec861e2aULL, 0xea30a8fc79573ff7ULL, 0x214d2030ca050cb6ULL,
+ 0x65f0322b8016c30cULL, 0x69be96dd1b247087ULL, 0xdb95ee9981e161b8ULL,
+ 0xd1fc1814d9ca05f8ULL, 0x820ed2bbcc0de729ULL, 0x63d76050430f14c7ULL,
+ 0x3bccb0e8a09d3a0fULL, 0x8e40764d573f54a2ULL, 0x39d175c1e16177bdULL,
+ 0x12f5a37c734f1f4bULL, 0xab37c12f1fdfc26dULL, 0x5648b167395cd0f1ULL,
+ 0x6c04ed1537bf42a7ULL, 0xed97161d14304065ULL, 0x7d6c67daab72b807ULL,
+ 0xec17fa87ba4ee83cULL, 0xdfaf79cb0304fbc1ULL, 0x733f060571bc463eULL,
+ 0x78d61c1287e98a27ULL, 0xd07cf48e77b4ada1ULL, 0xb9c262536c90dd26ULL,
+ 0xe2449b5860801605ULL, 0x8fc09ad7f941fcfbULL, 0xfad8cea94be46d0eULL,
+ 0xa343f28b0608eb9fULL, 0x9b126bd04917347bULL, 0x9a92874ae7699c22ULL,
+ 0x1b017c42c4e69ee0ULL, 0x3a4c5c720ee39256ULL, 0x4b6e9f5e3ea399daULL,
+ 0x6ba353f45ad83d35ULL, 0xe7fee0904c1b2425ULL, 0x22d009832587e95dULL,
+ 0x842980c00f1430e2ULL, 0xc6b3c0a0861e2893ULL, 0x087433a419d729f2ULL,
+ 0x341f3dadd42d6c6fULL, 0xee0a3faefbb2a58eULL, 0x4aee73c490dd3183ULL,
+ 0xaab72db5b1a16a34ULL, 0xa92a04065e238fdfULL, 0x7b4b35a1686b6fccULL,
+ 0x6a23bf6ef4a6956cULL, 0x191cb96b851ad352ULL, 0x55d598d4d6de351aULL,
+ 0xc9604de5f2ae7ef3ULL, 0x1ca6c2a3a981e172ULL, 0xde2f9551ad7a5398ULL,
+ 0x3025aaff56c8f616ULL, 0x15521d9d1e2860d9ULL, 0x506fe31cfa45073aULL,
+ 0x189c55f12b647b0bULL, 0x0180ec9aae7ea859ULL, 0x7cec8b40050c105eULL,
+ 0x2350e5198bf94104ULL, 0xef8ad33455cc0dd7ULL, 0x07a7bee16d677f92ULL,
+ 0xe5e325b90de76997ULL, 0x5a061591a26e637aULL, 0xb611ef1618208b46ULL,
+ 0x09f4df3eb7a981abULL, 0x1ebb078ae87dacc0ULL, 0xb791038cb65e231fULL,
+ 0x0fd38d4574b05660ULL, 0x67edf702c1ea8ebeULL, 0xba5f4be0831238cdULL,
+ 0xe3c477c2cefebe5cULL, 0x0dce486c354c1bd2ULL, 0x8c5db36416c31910ULL,
+ 0x26ea9ed1a7627324ULL, 0x039d29b3ef82e5ebULL, 0x9f28fc82cbf2ae02ULL,
+ 0xa8aae89cf05d2786ULL, 0x431aacfa2774b028ULL, 0xcf471f9e31b7a938ULL,
+ 0x581bd0b8e3922ec8ULL, 0xbc78199b400bef06ULL, 0x90fb71c7bf42f862ULL,
+ 0x1f3beb1046030499ULL, 0x683e7a47b55ad8deULL, 0x988f4263a695d190ULL,
+ 0xd808c72a6e638453ULL, 0x0627527bc319d7cbULL, 0xebb04466d72997aeULL,
+ 0xe67e0c0ae2658c7cULL, 0x14d2f107b056c880ULL, 0x7122c32c30400b8cULL,
+ 0x8a7ae11fd5dacedbULL, 0xa0dedb38e98a0e74ULL, 0xad109354dcc615a6ULL,
+ 0x0be91a17f655cc19ULL, 0x8ddd5ffeb8bdb149ULL, 0xbfe53028af890aedULL,
+ 0xd65ba6f5b4ad7a6aULL, 0x7956f0882997227eULL, 0x10e8665532b352f9ULL,
+ 0x0e5361dfdacefe39ULL, 0xcec7f3049fc90161ULL, 0xff62b561677f5f2eULL,
+ 0x975ccf26d22587f0ULL, 0x51ef0f86543baf63ULL, 0x2f1e41ef10cbf28fULL,
+ 0x52722635bbb94a88ULL, 0xae8dbae73344f04dULL, 0x410769d36688fd9aULL,
+ 0xb3ab94de34bbb966ULL, 0x801317928df1aa9bULL, 0xa564a0f0c5113c54ULL,
+ 0xf131d4bebdb1a117ULL, 0x7f71a2f3ea8ef5b5ULL, 0x40878549c8f655c3ULL,
+ 0x7ef14e6944f05decULL, 0xd44663dcf55137d8ULL, 0xf2acfd0d523344fcULL,
+ 0x0000000000000000ULL, 0x5fbc6e598ef5515aULL, 0x16cf342ef1aa8532ULL,
+ 0xb036bd6ddb395c8dULL, 0x13754fe6dd31b712ULL, 0xbbdfa77a2d6c9094ULL,
+ 0x89e7c8ac3a582b30ULL, 0x3c6b0e09cdfa459dULL, 0xc4ae0589c7e26521ULL,
+ 0x49735a777f5fd468ULL, 0xcafd64561d2c9b18ULL, 0xda1502032f9fc9e1ULL,
+ 0x8867243694268369ULL, 0x3782141e3baf8984ULL, 0x9cb5d53124704be9ULL,
+ 0xd7db4a6f1ad3d233ULL, 0xa6f989432a93d9bfULL, 0x9d3539ab8a0ee3b0ULL,
+ 0x53f2caaf15c7e2d1ULL, 0x6e19283c76430f15ULL, 0x3debe2936384edc4ULL,
+ 0x5e3c82c3208bf903ULL, 0x33b8834cb94a13fdULL, 0x6470deb12e686b55ULL,
+ 0x359fd1377a53c436ULL, 0x61caa57902f35975ULL, 0x043a975282e59a79ULL,
+ 0xfd7f70482683129cULL, 0xc52ee913699ccd78ULL, 0x28b9ff0e7dac8d1dULL,
+ 0x5455744e78a09d43ULL, 0xcb7d88ccb3523341ULL, 0x44bd121b4a13cfbaULL,
+ 0x4d49cd25fdba4e11ULL, 0x3e76cb208c06082fULL, 0x3ff627ba2278a076ULL,
+ 0xc28957f204fbb2eaULL, 0x453dfe81e46d67e3ULL, 0x94c1e6953da7621bULL,
+ 0x2c83685cff491764ULL, 0xf32c1197fc4deca5ULL, 0x2b24d6bd922e68f6ULL,
+ 0xb22b78449ac5113fULL, 0x48f3b6edd1217c31ULL, 0x2e9ead75beb55ad6ULL,
+ 0x174fd8b45fd42d6bULL, 0x4ed4e4961238abfaULL, 0x92e6b4eefebeb5d0ULL,
+ 0x46a0d7320bef8208ULL, 0x47203ba8a5912a51ULL, 0x24f75bf8e69e3e96ULL,
+ 0xf0b1382413cf094eULL, 0xfee259fbc901f777ULL, 0x276a724b091cdb7dULL,
+ 0xbdf8f501ee75475fULL, 0x599b3c224dec8691ULL, 0x6d84018f99c1eafeULL,
+ 0x7498b8e41cdb39acULL, 0xe0595e71217c5bb7ULL, 0x2aa43a273c50c0afULL,
+ 0xf50b43ec3f543b6eULL, 0x838e3e2162734f70ULL, 0xc09492db4507ff58ULL,
+ 0x72bfea9fdfc2ee67ULL, 0x11688acf9ccdfaa0ULL, 0x1a8190d86a9836b9ULL,
+ 0x7acbd93bc615c795ULL, 0xc7332c3a286080caULL, 0x863445e94ee87d50ULL,
+ 0xf6966a5fd0d6de85ULL, 0xe9ad814f96d5da1cULL, 0x70a22fb69e3ea3d5ULL,
+ 0x0a69f68d582b6440ULL, 0xb8428ec9c2ee757fULL, 0x604a49e3ac8df12cULL,
+ 0x5b86f90b0c10cb23ULL, 0xe1d9b2eb8f02f3eeULL, 0x29391394d3d22544ULL,
+ 0xc8e0a17f5cd0d6aaULL, 0xb58cc6a5f7a26eadULL, 0x8193fb08238f02c2ULL,
+ 0xd5c68f465b2f9f81ULL, 0xfcff9cd288fdbac5ULL, 0x77059157f359dc47ULL,
+ 0x1d262e3907ff492bULL, 0xfb582233e59ac557ULL, 0xddb2bce242f8b673ULL,
+ 0x2577b76248e096cfULL, 0x6f99c4a6d83da74cULL, 0xc1147e41eb795701ULL,
+ 0xf48baf76912a9337ULL
+ },
+ {
+ 0x3ef29d249b2c0a19ULL, 0xe9e16322b6f8622fULL, 0x5536994047757f7aULL,
+ 0x9f4d56d5a47b0b33ULL, 0x822567466aa1174cULL, 0xb8f5057deb082fb2ULL,
+ 0xcc48c10bf4475f53ULL, 0x373088d4275dec3aULL, 0x968f4325180aed10ULL,
+ 0x173d232cf7016151ULL, 0xae4ed09f946fcc13ULL, 0xfd4b4741c4539873ULL,
+ 0x1b5b3f0dd9933765ULL, 0x2ffcb0967b644052ULL, 0xe02376d20a89840cULL,
+ 0xa3ae3a70329b18d7ULL, 0x419cbd2335de8526ULL, 0xfafebf115b7c3199ULL,
+ 0x0397074f85aa9b0dULL, 0xc58ad4fb4836b970ULL, 0xbec60be3fc4104a8ULL,
+ 0x1eff36dc4b708772ULL, 0x131fdc33ed8453b6ULL, 0x0844e33e341764d3ULL,
+ 0x0ff11b6eab38cd39ULL, 0x64351f0a7761b85aULL, 0x3b5694f509cfba0eULL,
+ 0x30857084b87245d0ULL, 0x47afb3bd2297ae3cULL, 0xf2ba5c2f6f6b554aULL,
+ 0x74bdc4761f4f70e1ULL, 0xcfdfc64471edc45eULL, 0xe610784c1dc0af16ULL,
+ 0x7aca29d63c113f28ULL, 0x2ded411776a859afULL, 0xac5f211e99a3d5eeULL,
+ 0xd484f949a87ef33bULL, 0x3ce36ca596e013e4ULL, 0xd120f0983a9d432cULL,
+ 0x6bc40464dc597563ULL, 0x69d5f5e5d1956c9eULL, 0x9ae95f043698bb24ULL,
+ 0xc9ecc8da66a4ef44ULL, 0xd69508c8a5b2eac6ULL, 0xc40c2235c0503b80ULL,
+ 0x38c193ba8c652103ULL, 0x1ceec75d46bc9e8fULL, 0xd331011937515ad1ULL,
+ 0xd8e2e56886eca50fULL, 0xb137108d5779c991ULL, 0x709f3b6905ca4206ULL,
+ 0x4feb50831680caefULL, 0xec456af3241bd238ULL, 0x58d673afe181abbeULL,
+ 0x242f54e7cad9bf8cULL, 0x0211f1810dcc19fdULL, 0x90bc4dbb0f43c60aULL,
+ 0x9518446a9da0761dULL, 0xa1bfcbf13f57012aULL, 0x2bde4f8961e172b5ULL,
+ 0x27b853a84f732481ULL, 0xb0b1e643df1f4b61ULL, 0x18cc38425c39ac68ULL,
+ 0xd2b7f7d7bf37d821ULL, 0x3103864a3014c720ULL, 0x14aa246372abfa5cULL,
+ 0x6e600db54ebac574ULL, 0x394765740403a3f3ULL, 0x09c215f0bc71e623ULL,
+ 0x2a58b947e987f045ULL, 0x7b4cdf18b477bdd8ULL, 0x9709b5eb906c6fe0ULL,
+ 0x73083c268060d90bULL, 0xfedc400e41f9037eULL, 0x284948c6e44be9b8ULL,
+ 0x728ecae808065bfbULL, 0x06330e9e17492b1aULL, 0x5950856169e7294eULL,
+ 0xbae4f4fce6c4364fULL, 0xca7bcf95e30e7449ULL, 0x7d7fd186a33e96c2ULL,
+ 0x52836110d85ad690ULL, 0x4dfaa1021b4cd312ULL, 0x913abb75872544faULL,
+ 0xdd46ecb9140f1518ULL, 0x3d659a6b1e869114ULL, 0xc23f2cabd719109aULL,
+ 0xd713fe062dd46836ULL, 0xd0a60656b2fbc1dcULL, 0x221c5a79dd909496ULL,
+ 0xefd26dbca1b14935ULL, 0x0e77eda0235e4fc9ULL, 0xcbfd395b6b68f6b9ULL,
+ 0x0de0eaefa6f4d4c4ULL, 0x0422ff1f1a8532e7ULL, 0xf969b85eded6aa94ULL,
+ 0x7f6e2007aef28f3fULL, 0x3ad0623b81a938feULL, 0x6624ee8b7aada1a7ULL,
+ 0xb682e8ddc856607bULL, 0xa78cc56f281e2a30ULL, 0xc79b257a45faa08dULL,
+ 0x5b4174e0642b30b3ULL, 0x5f638bff7eae0254ULL, 0x4bc9af9c0c05f808ULL,
+ 0xce59308af98b46aeULL, 0x8fc58da9cc55c388ULL, 0x803496c7676d0eb1ULL,
+ 0xf33caae1e70dd7baULL, 0xbb6202326ea2b4bfULL, 0xd5020f87201871cbULL,
+ 0x9d5ca754a9b712ceULL, 0x841669d87de83c56ULL, 0x8a6184785eb6739fULL,
+ 0x420bba6cb0741e2bULL, 0xf12d5b60eac1ce47ULL, 0x76ac35f71283691cULL,
+ 0x2c6bb7d9fecedb5fULL, 0xfccdb18f4c351a83ULL, 0x1f79c012c3160582ULL,
+ 0xf0abadae62a74cb7ULL, 0xe1a5801c82ef06fcULL, 0x67a21845f2cb2357ULL,
+ 0x5114665f5df04d9dULL, 0xbf40fd2d74278658ULL, 0xa0393d3fb73183daULL,
+ 0x05a409d192e3b017ULL, 0xa9fb28cf0b4065f9ULL, 0x25a9a22942bf3d7cULL,
+ 0xdb75e22703463e02ULL, 0xb326e10c5ab5d06cULL, 0xe7968e8295a62de6ULL,
+ 0xb973f3b3636ead42ULL, 0xdf571d3819c30ce5ULL, 0xee549b7229d7cbc5ULL,
+ 0x12992afd65e2d146ULL, 0xf8ef4e9056b02864ULL, 0xb7041e134030e28bULL,
+ 0xc02edd2adad50967ULL, 0x932b4af48ae95d07ULL, 0x6fe6fb7bc6dc4784ULL,
+ 0x239aacb755f61666ULL, 0x401a4bedbdb807d6ULL, 0x485ea8d389af6305ULL,
+ 0xa41bc220adb4b13dULL, 0x753b32b89729f211ULL, 0x997e584bb3322029ULL,
+ 0x1d683193ceda1c7fULL, 0xff5ab6c0c99f818eULL, 0x16bbd5e27f67e3a1ULL,
+ 0xa59d34ee25d233cdULL, 0x98f8ae853b54a2d9ULL, 0x6df70afacb105e79ULL,
+ 0x795d2e99b9bba425ULL, 0x8e437b6744334178ULL, 0x0186f6ce886682f0ULL,
+ 0xebf092a3bb347bd2ULL, 0xbcd7fa62f18d1d55ULL, 0xadd9d7d011c5571eULL,
+ 0x0bd3e471b1bdffdeULL, 0xaa6c2f808eeafef4ULL, 0x5ee57d31f6c880a4ULL,
+ 0xf50fa47ff044fca0ULL, 0x1addc9c351f5b595ULL, 0xea76646d3352f922ULL,
+ 0x0000000000000000ULL, 0x85909f16f58ebea6ULL, 0x46294573aaf12cccULL,
+ 0x0a5512bf39db7d2eULL, 0x78dbd85731dd26d5ULL, 0x29cfbe086c2d6b48ULL,
+ 0x218b5d36583a0f9bULL, 0x152cd2adfacd78acULL, 0x83a39188e2c795bcULL,
+ 0xc3b9da655f7f926aULL, 0x9ecba01b2c1d89c3ULL, 0x07b5f8509f2fa9eaULL,
+ 0x7ee8d6c926940dcfULL, 0x36b67e1aaf3b6ecaULL, 0x86079859702425abULL,
+ 0xfb7849dfd31ab369ULL, 0x4c7c57cc932a51e2ULL, 0xd96413a60e8a27ffULL,
+ 0x263ea566c715a671ULL, 0x6c71fc344376dc89ULL, 0x4a4f595284637af8ULL,
+ 0xdaf314e98b20bcf2ULL, 0x572768c14ab96687ULL, 0x1088db7c682ec8bbULL,
+ 0x887075f9537a6a62ULL, 0x2e7a4658f302c2a2ULL, 0x619116dbe582084dULL,
+ 0xa87dde018326e709ULL, 0xdcc01a779c6997e8ULL, 0xedc39c3dac7d50c8ULL,
+ 0xa60a33a1a078a8c0ULL, 0xc1a82be452b38b97ULL, 0x3f746bea134a88e9ULL,
+ 0xa228ccbebafd9a27ULL, 0xabead94e068c7c04ULL, 0xf48952b178227e50ULL,
+ 0x5cf48cb0fb049959ULL, 0x6017e0156de48abdULL, 0x4438b4f2a73d3531ULL,
+ 0x8c528ae649ff5885ULL, 0xb515ef924dfcfb76ULL, 0x0c661c212e925634ULL,
+ 0xb493195cc59a7986ULL, 0x9cda519a21d1903eULL, 0x32948105b5be5c2dULL,
+ 0x194ace8cd45f2e98ULL, 0x438d4ca238129cdbULL, 0x9b6fa9cabefe39d4ULL,
+ 0x81b26009ef0b8c41ULL, 0xded1ebf691a58e15ULL, 0x4e6da64d9ee6481fULL,
+ 0x54b06f8ecf13fd8aULL, 0x49d85e1d01c9e1f5ULL, 0xafc826511c094ee3ULL,
+ 0xf698a33075ee67adULL, 0x5ac7822eec4db243ULL, 0x8dd47c28c199da75ULL,
+ 0x89f68337db1ce892ULL, 0xcdce37c57c21dda3ULL, 0x530597de503c5460ULL,
+ 0x6a42f2aa543ff793ULL, 0x5d727a7e73621ba9ULL, 0xe232875307459df1ULL,
+ 0x56a19e0fc2dfe477ULL, 0xc61dd3b4cd9c227dULL, 0xe5877f03986a341bULL,
+ 0x949eb2a415c6f4edULL, 0x6206119460289340ULL, 0x6380e75ae84e11b0ULL,
+ 0x8be772b6d6d0f16fULL, 0x50929091d596cf6dULL, 0xe86795ec3e9ee0dfULL,
+ 0x7cf927482b581432ULL, 0xc86a3e14eec26db4ULL, 0x7119cda78dacc0f6ULL,
+ 0xe40189cd100cb6ebULL, 0x92adbc3a028fdff7ULL, 0xb2a017c2d2d3529cULL,
+ 0x200dabf8d05c8d6bULL, 0x34a78f9ba2f77737ULL, 0xe3b4719d8f231f01ULL,
+ 0x45be423c2f5bb7c1ULL, 0xf71e55fefd88e55dULL, 0x6853032b59f3ee6eULL,
+ 0x65b3e9c4ff073aaaULL, 0x772ac3399ae5ebecULL, 0x87816e97f842a75bULL,
+ 0x110e2db2e0484a4bULL, 0x331277cb3dd8deddULL, 0xbd510cac79eb9fa5ULL,
+ 0x352179552a91f5c7ULL
+ },
+ {
+ 0x8ab0a96846e06a6dULL, 0x43c7e80b4bf0b33aULL, 0x08c9b3546b161ee5ULL,
+ 0x39f1c235eba990beULL, 0xc1bef2376606c7b2ULL, 0x2c209233614569aaULL,
+ 0xeb01523b6fc3289aULL, 0x946953ab935aceddULL, 0x272838f63e13340eULL,
+ 0x8b0455eca12ba052ULL, 0x77a1b2c4978ff8a2ULL, 0xa55122ca13e54086ULL,
+ 0x2276135862d3f1cdULL, 0xdb8ddfde08b76cfeULL, 0x5d1e12c89e4a178aULL,
+ 0x0e56816b03969867ULL, 0xee5f79953303ed59ULL, 0xafed748bab78d71dULL,
+ 0x6d929f2df93e53eeULL, 0xf5d8a8f8ba798c2aULL, 0xf619b1698e39cf6bULL,
+ 0x95ddaf2f749104e2ULL, 0xec2a9c80e0886427ULL, 0xce5c8fd8825b95eaULL,
+ 0xc4e0d9993ac60271ULL, 0x4699c3a5173076f9ULL, 0x3d1b151f50a29f42ULL,
+ 0x9ed505ea2bc75946ULL, 0x34665acfdc7f4b98ULL, 0x61b1fb53292342f7ULL,
+ 0xc721c0080e864130ULL, 0x8693cd1696fd7b74ULL, 0x872731927136b14bULL,
+ 0xd3446c8a63a1721bULL, 0x669a35e8a6680e4aULL, 0xcab658f239509a16ULL,
+ 0xa4e5de4ef42e8ab9ULL, 0x37a7435ee83f08d9ULL, 0x134e6239e26c7f96ULL,
+ 0x82791a3c2df67488ULL, 0x3f6ef00a8329163cULL, 0x8e5a7e42fdeb6591ULL,
+ 0x5caaee4c7981ddb5ULL, 0x19f234785af1e80dULL, 0x255ddde3ed98bd70ULL,
+ 0x50898a32a99cccacULL, 0x28ca4519da4e6656ULL, 0xae59880f4cb31d22ULL,
+ 0x0d9798fa37d6db26ULL, 0x32f968f0b4ffcd1aULL, 0xa00f09644f258545ULL,
+ 0xfa3ad5175e24de72ULL, 0xf46c547c5db24615ULL, 0x713e80fbff0f7e20ULL,
+ 0x7843cf2b73d2aafaULL, 0xbd17ea36aedf62b4ULL, 0xfd111bacd16f92cfULL,
+ 0x4abaa7dbc72d67e0ULL, 0xb3416b5dad49fad3ULL, 0xbca316b24914a88bULL,
+ 0x15d150068aecf914ULL, 0xe27c1debe31efc40ULL, 0x4fe48c759beda223ULL,
+ 0x7edcfd141b522c78ULL, 0x4e5070f17c26681cULL, 0xe696cac15815f3bcULL,
+ 0x35d2a64b3bb481a7ULL, 0x800cff29fe7dfdf6ULL, 0x1ed9fac3d5baa4b0ULL,
+ 0x6c2663a91ef599d1ULL, 0x03c1199134404341ULL, 0xf7ad4ded69f20554ULL,
+ 0xcd9d9649b61bd6abULL, 0xc8c3bde7eadb1368ULL, 0xd131899fb02afb65ULL,
+ 0x1d18e352e1fae7f1ULL, 0xda39235aef7ca6c1ULL, 0xa1bbf5e0a8ee4f7aULL,
+ 0x91377805cf9a0b1eULL, 0x3138716180bf8e5bULL, 0xd9f83acbdb3ce580ULL,
+ 0x0275e515d38b897eULL, 0x472d3f21f0fbbcc6ULL, 0x2d946eb7868ea395ULL,
+ 0xba3c248d21942e09ULL, 0xe7223645bfde3983ULL, 0xff64feb902e41bb1ULL,
+ 0xc97741630d10d957ULL, 0xc3cb1722b58d4eccULL, 0xa27aec719cae0c3bULL,
+ 0x99fecb51a48c15fbULL, 0x1465ac826d27332bULL, 0xe1bd047ad75ebf01ULL,
+ 0x79f733af941960c5ULL, 0x672ec96c41a3c475ULL, 0xc27feba6524684f3ULL,
+ 0x64efd0fd75e38734ULL, 0xed9e60040743ae18ULL, 0xfb8e2993b9ef144dULL,
+ 0x38453eb10c625a81ULL, 0x6978480742355c12ULL, 0x48cf42ce14a6ee9eULL,
+ 0x1cac1fd606312dceULL, 0x7b82d6ba4792e9bbULL, 0x9d141c7b1f871a07ULL,
+ 0x5616b80dc11c4a2eULL, 0xb849c198f21fa777ULL, 0x7ca91801c8d9a506ULL,
+ 0xb1348e487ec273adULL, 0x41b20d1e987b3a44ULL, 0x7460ab55a3cfbbe3ULL,
+ 0x84e628034576f20aULL, 0x1b87d16d897a6173ULL, 0x0fe27defe45d5258ULL,
+ 0x83cde6b8ca3dbeb7ULL, 0x0c23647ed01d1119ULL, 0x7a362a3ea0592384ULL,
+ 0xb61f40f3f1893f10ULL, 0x75d457d1440471dcULL, 0x4558da34237035b8ULL,
+ 0xdca6116587fc2043ULL, 0x8d9b67d3c9ab26d0ULL, 0x2b0b5c88ee0e2517ULL,
+ 0x6fe77a382ab5da90ULL, 0x269cc472d9d8fe31ULL, 0x63c41e46faa8cb89ULL,
+ 0xb7abbc771642f52fULL, 0x7d1de4852f126f39ULL, 0xa8c6ba3024339ba0ULL,
+ 0x600507d7cee888c8ULL, 0x8fee82c61a20afaeULL, 0x57a2448926d78011ULL,
+ 0xfca5e72836a458f0ULL, 0x072bcebb8f4b4cbdULL, 0x497bbe4af36d24a1ULL,
+ 0x3cafe99bb769557dULL, 0x12fa9ebd05a7b5a9ULL, 0xe8c04baa5b836bdbULL,
+ 0x4273148fac3b7905ULL, 0x908384812851c121ULL, 0xe557d3506c55b0fdULL,
+ 0x72ff996acb4f3d61ULL, 0x3eda0c8e64e2dc03ULL, 0xf0868356e6b949e9ULL,
+ 0x04ead72abb0b0ffcULL, 0x17a4b5135967706aULL, 0xe3c8e16f04d5367fULL,
+ 0xf84f30028daf570cULL, 0x1846c8fcbd3a2232ULL, 0x5b8120f7f6ca9108ULL,
+ 0xd46fa231ecea3ea6ULL, 0x334d947453340725ULL, 0x58403966c28ad249ULL,
+ 0xbed6f3a79a9f21f5ULL, 0x68ccb483a5fe962dULL, 0xd085751b57e1315aULL,
+ 0xfed0023de52fd18eULL, 0x4b0e5b5f20e6addfULL, 0x1a332de96eb1ab4cULL,
+ 0xa3ce10f57b65c604ULL, 0x108f7ba8d62c3cd7ULL, 0xab07a3a11073d8e1ULL,
+ 0x6b0dad1291bed56cULL, 0xf2f366433532c097ULL, 0x2e557726b2cee0d4ULL,
+ 0x0000000000000000ULL, 0xcb02a476de9b5029ULL, 0xe4e32fd48b9e7ac2ULL,
+ 0x734b65ee2c84f75eULL, 0x6e5386bccd7e10afULL, 0x01b4fc84e7cbca3fULL,
+ 0xcfe8735c65905fd5ULL, 0x3613bfda0ff4c2e6ULL, 0x113b872c31e7f6e8ULL,
+ 0x2fe18ba255052aebULL, 0xe974b72ebc48a1e4ULL, 0x0abc5641b89d979bULL,
+ 0xb46aa5e62202b66eULL, 0x44ec26b0c4bbff87ULL, 0xa6903b5b27a503c7ULL,
+ 0x7f680190fc99e647ULL, 0x97a84a3aa71a8d9cULL, 0xdd12ede16037ea7cULL,
+ 0xc554251ddd0dc84eULL, 0x88c54c7d956be313ULL, 0x4d91696048662b5dULL,
+ 0xb08072cc9909b992ULL, 0xb5de5962c5c97c51ULL, 0x81b803ad19b637c9ULL,
+ 0xb2f597d94a8230ecULL, 0x0b08aac55f565da4ULL, 0xf1327fd2017283d6ULL,
+ 0xad98919e78f35e63ULL, 0x6ab9519676751f53ULL, 0x24e921670a53774fULL,
+ 0xb9fd3d1c15d46d48ULL, 0x92f66194fbda485fULL, 0x5a35dc7311015b37ULL,
+ 0xded3f4705477a93dULL, 0xc00a0eb381cd0d8dULL, 0xbb88d809c65fe436ULL,
+ 0x16104997beacba55ULL, 0x21b70ac95693b28cULL, 0x59f4c5e225411876ULL,
+ 0xd5db5eb50b21f499ULL, 0x55d7a19cf55c096fULL, 0xa97246b4c3f8519fULL,
+ 0x8552d487a2bd3835ULL, 0x54635d181297c350ULL, 0x23c2efdc85183bf2ULL,
+ 0x9f61f96ecc0c9379ULL, 0x534893a39ddc8fedULL, 0x5edf0b59aa0a54cbULL,
+ 0xac2c6d1a9f38945cULL, 0xd7aebba0d8aa7de7ULL, 0x2abfa00c09c5ef28ULL,
+ 0xd84cc64f3cf72fbfULL, 0x2003f64db15878b3ULL, 0xa724c7dfc06ec9f8ULL,
+ 0x069f323f68808682ULL, 0xcc296acd51d01c94ULL, 0x055e2bae5cc0c5c3ULL,
+ 0x6270e2c21d6301b6ULL, 0x3b842720382219c0ULL, 0xd2f0900e846ab824ULL,
+ 0x52fc6f277a1745d2ULL, 0xc6953c8ce94d8b0fULL, 0xe009f8fe3095753eULL,
+ 0x655b2c7992284d0bULL, 0x984a37d54347dfc4ULL, 0xeab5aebf8808e2a5ULL,
+ 0x9a3fd2c090cc56baULL, 0x9ca0e0fff84cd038ULL, 0x4c2595e4afade162ULL,
+ 0xdf6708f4b3bc6302ULL, 0xbf620f237d54ebcaULL, 0x93429d101c118260ULL,
+ 0x097d4fd08cddd4daULL, 0x8c2f9b572e60ecefULL, 0x708a7c7f18c4b41fULL,
+ 0x3a30dba4dfe9d3ffULL, 0x4006f19a7fb0f07bULL, 0x5f6bf7dd4dc19ef4ULL,
+ 0x1f6d064732716e8fULL, 0xf9fbcc866a649d33ULL, 0x308c8de567744464ULL,
+ 0x8971b0f972a0292cULL, 0xd61a47243f61b7d8ULL, 0xefeb8511d4c82766ULL,
+ 0x961cb6be40d147a3ULL, 0xaab35f25f7b812deULL, 0x76154e407044329dULL,
+ 0x513d76b64e570693ULL, 0xf3479ac7d2f90aa8ULL, 0x9b8b2e4477079c85ULL,
+ 0x297eb99d3d85ac69ULL
+ },
+ {
+ 0x7e37e62dfc7d40c3ULL, 0x776f25a4ee939e5bULL, 0xe045c850dd8fb5adULL,
+ 0x86ed5ba711ff1952ULL, 0xe91d0bd9cf616b35ULL, 0x37e0ab256e408ffbULL,
+ 0x9607f6c031025a7aULL, 0x0b02f5e116d23c9dULL, 0xf3d8486bfb50650cULL,
+ 0x621cff27c40875f5ULL, 0x7d40cb71fa5fd34aULL, 0x6daa6616daa29062ULL,
+ 0x9f5f354923ec84e2ULL, 0xec847c3dc507c3b3ULL, 0x025a3668043ce205ULL,
+ 0xa8bf9e6c4dac0b19ULL, 0xfa808be2e9bebb94ULL, 0xb5b99c5277c74fa3ULL,
+ 0x78d9bc95f0397bccULL, 0xe332e50cdbad2624ULL, 0xc74fce129332797eULL,
+ 0x1729eceb2ea709abULL, 0xc2d6b9f69954d1f8ULL, 0x5d898cbfbab8551aULL,
+ 0x859a76fb17dd8adbULL, 0x1be85886362f7fb5ULL, 0xf6413f8ff136cd8aULL,
+ 0xd3110fa5bbb7e35cULL, 0x0a2feed514cc4d11ULL, 0xe83010edcd7f1ab9ULL,
+ 0xa1e75de55f42d581ULL, 0xeede4a55c13b21b6ULL, 0xf2f5535ff94e1480ULL,
+ 0x0cc1b46d1888761eULL, 0xbce15fdb6529913bULL, 0x2d25e8975a7181c2ULL,
+ 0x71817f1ce2d7a554ULL, 0x2e52c5cb5c53124bULL, 0xf9f7a6beef9c281dULL,
+ 0x9e722e7d21f2f56eULL, 0xce170d9b81dca7e6ULL, 0x0e9b82051cb4941bULL,
+ 0x1e712f623c49d733ULL, 0x21e45cfa42f9f7dcULL, 0xcb8e7a7f8bba0f60ULL,
+ 0x8e98831a010fb646ULL, 0x474ccf0d8e895b23ULL, 0xa99285584fb27a95ULL,
+ 0x8cc2b57205335443ULL, 0x42d5b8e984eff3a5ULL, 0x012d1b34021e718cULL,
+ 0x57a6626aae74180bULL, 0xff19fc06e3d81312ULL, 0x35ba9d4d6a7c6dfeULL,
+ 0xc9d44c178f86ed65ULL, 0x506523e6a02e5288ULL, 0x03772d5c06229389ULL,
+ 0x8b01f4fe0b691ec0ULL, 0xf8dabd8aed825991ULL, 0x4c4e3aec985b67beULL,
+ 0xb10df0827fbf96a9ULL, 0x6a69279ad4f8dae1ULL, 0xe78689dcd3d5ff2eULL,
+ 0x812e1a2b1fa553d1ULL, 0xfbad90d6eba0ca18ULL, 0x1ac543b234310e39ULL,
+ 0x1604f7df2cb97827ULL, 0xa6241c6951189f02ULL, 0x753513cceaaf7c5eULL,
+ 0x64f2a59fc84c4efaULL, 0x247d2b1e489f5f5aULL, 0xdb64d718ab474c48ULL,
+ 0x79f4a7a1f2270a40ULL, 0x1573da832a9bebaeULL, 0x3497867968621c72ULL,
+ 0x514838d2a2302304ULL, 0xf0af6537fd72f685ULL, 0x1d06023e3a6b44baULL,
+ 0x678588c3ce6edd73ULL, 0x66a893f7cc70acffULL, 0xd4d24e29b5eda9dfULL,
+ 0x3856321470ea6a6cULL, 0x07c3418c0e5a4a83ULL, 0x2bcbb22f5635bacdULL,
+ 0x04b46cd00878d90aULL, 0x06ee5ab80c443b0fULL, 0x3b211f4876c8f9e5ULL,
+ 0x0958c38912eede98ULL, 0xd14b39cdbf8b0159ULL, 0x397b292072f41be0ULL,
+ 0x87c0409313e168deULL, 0xad26e98847caa39fULL, 0x4e140c849c6785bbULL,
+ 0xd5ff551db7f3d853ULL, 0xa0ca46d15d5ca40dULL, 0xcd6020c787fe346fULL,
+ 0x84b76dcf15c3fb57ULL, 0xdefda0fca121e4ceULL, 0x4b8d7b6096012d3dULL,
+ 0x9ac642ad298a2c64ULL, 0x0875d8bd10f0af14ULL, 0xb357c6ea7b8374acULL,
+ 0x4d6321d89a451632ULL, 0xeda96709c719b23fULL, 0xf76c24bbf328bc06ULL,
+ 0xc662d526912c08f2ULL, 0x3ce25ec47892b366ULL, 0xb978283f6f4f39bdULL,
+ 0xc08c8f9e9d6833fdULL, 0x4f3917b09e79f437ULL, 0x593de06fb2c08c10ULL,
+ 0xd6887841b1d14bdaULL, 0x19b26eee32139db0ULL, 0xb494876675d93e2fULL,
+ 0x825937771987c058ULL, 0x90e9ac783d466175ULL, 0xf1827e03ff6c8709ULL,
+ 0x945dc0a8353eb87fULL, 0x4516f9658ab5b926ULL, 0x3f9573987eb020efULL,
+ 0xb855330b6d514831ULL, 0x2ae6a91b542bcb41ULL, 0x6331e413c6160479ULL,
+ 0x408f8e8180d311a0ULL, 0xeff35161c325503aULL, 0xd06622f9bd9570d5ULL,
+ 0x8876d9a20d4b8d49ULL, 0xa5533135573a0c8bULL, 0xe168d364df91c421ULL,
+ 0xf41b09e7f50a2f8fULL, 0x12b09b0f24c1a12dULL, 0xda49cc2ca9593dc4ULL,
+ 0x1f5c34563e57a6bfULL, 0x54d14f36a8568b82ULL, 0xaf7cdfe043f6419aULL,
+ 0xea6a2685c943f8bcULL, 0xe5dcbfb4d7e91d2bULL, 0xb27addde799d0520ULL,
+ 0x6b443caed6e6ab6dULL, 0x7bae91c9f61be845ULL, 0x3eb868ac7cae5163ULL,
+ 0x11c7b65322e332a4ULL, 0xd23c1491b9a992d0ULL, 0x8fb5982e0311c7caULL,
+ 0x70ac6428e0c9d4d8ULL, 0x895bc2960f55fcc5ULL, 0x76423e90ec8defd7ULL,
+ 0x6ff0507ede9e7267ULL, 0x3dcf45f07a8cc2eaULL, 0x4aa06054941f5cb1ULL,
+ 0x5810fb5bb0defd9cULL, 0x5efea1e3bc9ac693ULL, 0x6edd4b4adc8003ebULL,
+ 0x741808f8e8b10dd2ULL, 0x145ec1b728859a22ULL, 0x28bc9f7350172944ULL,
+ 0x270a06424ebdccd3ULL, 0x972aedf4331c2bf6ULL, 0x059977e40a66a886ULL,
+ 0x2550302a4a812ed6ULL, 0xdd8a8da0a7037747ULL, 0xc515f87a970e9b7bULL,
+ 0x3023eaa9601ac578ULL, 0xb7e3aa3a73fbada6ULL, 0x0fb699311eaae597ULL,
+ 0x0000000000000000ULL, 0x310ef19d6204b4f4ULL, 0x229371a644db6455ULL,
+ 0x0decaf591a960792ULL, 0x5ca4978bb8a62496ULL, 0x1c2b190a38753536ULL,
+ 0x41a295b582cd602cULL, 0x3279dcc16426277dULL, 0xc1a194aa9f764271ULL,
+ 0x139d803b26dfd0a1ULL, 0xae51c4d441e83016ULL, 0xd813fa44ad65dfc1ULL,
+ 0xac0bf2bc45d4d213ULL, 0x23be6a9246c515d9ULL, 0x49d74d08923dcf38ULL,
+ 0x9d05032127d066e7ULL, 0x2f7fdeff5e4d63c7ULL, 0xa47e2a0155247d07ULL,
+ 0x99b16ff12fa8bfedULL, 0x4661d4398c972aafULL, 0xdfd0bbc8a33f9542ULL,
+ 0xdca79694a51d06cbULL, 0xb020ebb67da1e725ULL, 0xba0f0563696daa34ULL,
+ 0xe4f1a480d5f76ca7ULL, 0xc438e34e9510eaf7ULL, 0x939e81243b64f2fcULL,
+ 0x8defae46072d25cfULL, 0x2c08f3a3586ff04eULL, 0xd7a56375b3cf3a56ULL,
+ 0x20c947ce40e78650ULL, 0x43f8a3dd86f18229ULL, 0x568b795eac6a6987ULL,
+ 0x8003011f1dbb225dULL, 0xf53612d3f7145e03ULL, 0x189f75da300dec3cULL,
+ 0x9570db9c3720c9f3ULL, 0xbb221e576b73dbb8ULL, 0x72f65240e4f536ddULL,
+ 0x443be25188abc8aaULL, 0xe21ffe38d9b357a8ULL, 0xfd43ca6ee7e4f117ULL,
+ 0xcaa3614b89a47eecULL, 0xfe34e732e1c6629eULL, 0x83742c431b99b1d4ULL,
+ 0xcf3a16af83c2d66aULL, 0xaae5a8044990e91cULL, 0x26271d764ca3bd5fULL,
+ 0x91c4b74c3f5810f9ULL, 0x7c6dd045f841a2c6ULL, 0x7f1afd19fe63314fULL,
+ 0xc8f957238d989ce9ULL, 0xa709075d5306ee8eULL, 0x55fc5402aa48fa0eULL,
+ 0x48fa563c9023beb4ULL, 0x65dfbeabca523f76ULL, 0x6c877d22d8bce1eeULL,
+ 0xcc4d3bf385e045e3ULL, 0xbebb69b36115733eULL, 0x10eaad6720fd4328ULL,
+ 0xb6ceb10e71e5dc2aULL, 0xbdcc44ef6737e0b7ULL, 0x523f158ea412b08dULL,
+ 0x989c74c52db6ce61ULL, 0x9beb59992b945de8ULL, 0x8a2cefca09776f4cULL,
+ 0xa3bd6b8d5b7e3784ULL, 0xeb473db1cb5d8930ULL, 0xc3fba2c29b4aa074ULL,
+ 0x9c28181525ce176bULL, 0x683311f2d0c438e4ULL, 0x5fd3bad7be84b71fULL,
+ 0xfc6ed15ae5fa809bULL, 0x36cdb0116c5efe77ULL, 0x29918447520958c8ULL,
+ 0xa29070b959604608ULL, 0x53120ebaa60cc101ULL, 0x3a0c047c74d68869ULL,
+ 0x691e0ac6d2da4968ULL, 0x73db4974e6eb4751ULL, 0x7a838afdf40599c9ULL,
+ 0x5a4acd33b4e21f99ULL, 0x6046c94fc03497f0ULL, 0xe6ab92e8d1cb8ea2ULL,
+ 0x3354c7f5663856f1ULL, 0xd93ee170af7bae4dULL, 0x616bd27bc22ae67cULL,
+ 0x92b39a10397a8370ULL, 0xabc8b3304b8e9890ULL, 0xbf967287630b02b2ULL,
+ 0x5b67d607b6fc6e15ULL
+ },
+ {
+ 0xd031c397ce553fe6ULL, 0x16ba5b01b006b525ULL, 0xa89bade6296e70c8ULL,
+ 0x6a1f525d77d3435bULL, 0x6e103570573dfa0bULL, 0x660efb2a17fc95abULL,
+ 0x76327a9e97634bf6ULL, 0x4bad9d6462458bf5ULL, 0xf1830caedbc3f748ULL,
+ 0xc5c8f542669131ffULL, 0x95044a1cdc48b0cbULL, 0x892962df3cf8b866ULL,
+ 0xb0b9e208e930c135ULL, 0xa14fb3f0611a767cULL, 0x8d2605f21c160136ULL,
+ 0xd6b71922fecc549eULL, 0x37089438a5907d8bULL, 0x0b5da38e5803d49cULL,
+ 0x5a5bcc9cea6f3cbcULL, 0xedae246d3b73ffe5ULL, 0xd2b87e0fde22edceULL,
+ 0x5e54abb1ca8185ecULL, 0x1de7f88fe80561b9ULL, 0xad5e1a870135a08cULL,
+ 0x2f2adbd665cecc76ULL, 0x5780b5a782f58358ULL, 0x3edc8a2eede47b3fULL,
+ 0xc9d95c3506bee70fULL, 0x83be111d6c4e05eeULL, 0xa603b90959367410ULL,
+ 0x103c81b4809fde5dULL, 0x2c69b6027d0c774aULL, 0x399080d7d5c87953ULL,
+ 0x09d41e16487406b4ULL, 0xcdd63b1826505e5fULL, 0xf99dc2f49b0298e8ULL,
+ 0x9cd0540a943cb67fULL, 0xbca84b7f891f17c5ULL, 0x723d1db3b78df2a6ULL,
+ 0x78aa6e71e73b4f2eULL, 0x1433e699a071670dULL, 0x84f21be454620782ULL,
+ 0x98df3327b4d20f2fULL, 0xf049dce2d3769e5cULL, 0xdb6c60199656eb7aULL,
+ 0x648746b2078b4783ULL, 0x32cd23598dcbadcfULL, 0x1ea4955bf0c7da85ULL,
+ 0xe9a143401b9d46b5ULL, 0xfd92a5d9bbec21b8ULL, 0xc8138c790e0b8e1bULL,
+ 0x2ee00b9a6d7ba562ULL, 0xf85712b893b7f1fcULL, 0xeb28fed80bea949dULL,
+ 0x564a65eb8a40ea4cULL, 0x6c9988e8474a2823ULL, 0x4535898b121d8f2dULL,
+ 0xabd8c03231accbf4ULL, 0xba2e91cab9867cbdULL, 0x7960be3def8e263aULL,
+ 0x0c11a977602fd6f0ULL, 0xcb50e1ad16c93527ULL, 0xeae22e94035ffd89ULL,
+ 0x2866d12f5de2ce1aULL, 0xff1b1841ab9bf390ULL, 0x9f9339de8cfe0d43ULL,
+ 0x964727c8c48a0bf7ULL, 0x524502c6aaae531cULL, 0x9b9c5ef3ac10b413ULL,
+ 0x4fa2fa4942ab32a5ULL, 0x3f165a62e551122bULL, 0xc74148da76e6e3d7ULL,
+ 0x924840e5e464b2a7ULL, 0xd372ae43d69784daULL, 0x233b72a105e11a86ULL,
+ 0xa48a04914941a638ULL, 0xb4b68525c9de7865ULL, 0xddeabaaca6cf8002ULL,
+ 0x0a9773c250b6bd88ULL, 0xc284ffbb5ebd3393ULL, 0x8ba0df472c8f6a4eULL,
+ 0x2aef6cb74d951c32ULL, 0x427983722a318d41ULL, 0x73f7cdffbf389bb2ULL,
+ 0x074c0af9382c026cULL, 0x8a6a0f0b243a035aULL, 0x6fdae53c5f88931fULL,
+ 0xc68b98967e538ac3ULL, 0x44ff59c71aa8e639ULL, 0xe2fce0ce439e9229ULL,
+ 0xa20cde2479d8cd40ULL, 0x19e89fa2c8ebd8e9ULL, 0xf446bbcff398270cULL,
+ 0x43b3533e2284e455ULL, 0xd82f0dcd8e945046ULL, 0x51066f12b26ce820ULL,
+ 0xe73957af6bc5426dULL, 0x081ece5a40c16fa0ULL, 0x3b193d4fc5bfab7bULL,
+ 0x7fe66488df174d42ULL, 0x0e9814ef705804d8ULL, 0x8137ac857c39d7c6ULL,
+ 0xb1733244e185a821ULL, 0x695c3f896f11f867ULL, 0xf6cf0657e3eff524ULL,
+ 0x1aabf276d02963d5ULL, 0x2da3664e75b91e5eULL, 0x0289bd981077d228ULL,
+ 0x90c1fd7df413608fULL, 0x3c5537b6fd93a917ULL, 0xaa12107e3919a2e0ULL,
+ 0x0686dab530996b78ULL, 0xdaa6b0559ee3826eULL, 0xc34e2ff756085a87ULL,
+ 0x6d5358a44fff4137ULL, 0xfc587595b35948acULL, 0x7ca5095cc7d5f67eULL,
+ 0xfb147f6c8b754ac0ULL, 0xbfeb26ab91ddacf9ULL, 0x6896efc567a49173ULL,
+ 0xca9a31e11e7c5c33ULL, 0xbbe44186b13315a9ULL, 0x0ddb793b689abfe4ULL,
+ 0x70b4a02ba7fa208eULL, 0xe47a3a7b7307f951ULL, 0x8cecd5be14a36822ULL,
+ 0xeeed49b923b144d9ULL, 0x17708b4db8b3dc31ULL, 0x6088219f2765fed3ULL,
+ 0xb3fa8fdcf1f27a09ULL, 0x910b2d31fca6099bULL, 0x0f52c4a378ed6dccULL,
+ 0x50ccbf5ebad98134ULL, 0x6bd582117f662a4fULL, 0x94ce9a50d4fdd9dfULL,
+ 0x2b25bcfb45207526ULL, 0x67c42b661f49fcbfULL, 0x492420fc723259ddULL,
+ 0x03436dd418c2bb3cULL, 0x1f6e4517f872b391ULL, 0xa08563bc69af1f68ULL,
+ 0xd43ea4baeebb86b6ULL, 0x01cad04c08b56914ULL, 0xac94cacb0980c998ULL,
+ 0x54c3d8739a373864ULL, 0x26fec5c02dbacac2ULL, 0xdea9d778be0d3b3eULL,
+ 0x040f672d20eeb950ULL, 0xe5b0ea377bb29045ULL, 0xf30ab136cbb42560ULL,
+ 0x62019c0737122cfbULL, 0xe86b930c13282fa1ULL, 0xcc1ceb542ee5374bULL,
+ 0x538fd28aa21b3a08ULL, 0x1b61223ad89c0ac1ULL, 0x36c24474ad25149fULL,
+ 0x7a23d3e9f74c9d06ULL, 0xbe21f6e79968c5edULL, 0xcf5f868036278c77ULL,
+ 0xf705d61beb5a9c30ULL, 0x4d2b47d152dce08dULL, 0x5f9e7bfdc234ecf8ULL,
+ 0x247778583dcd18eaULL, 0x867ba67c4415d5aaULL, 0x4ce1979d5a698999ULL,
+ 0x0000000000000000ULL, 0xec64f42133c696f1ULL, 0xb57c5569c16b1171ULL,
+ 0xc1c7926f467f88afULL, 0x654d96fe0f3e2e97ULL, 0x15f936d5a8c40e19ULL,
+ 0xb8a72c52a9f1ae95ULL, 0xa9517daa21db19dcULL, 0x58d27104fa18ee94ULL,
+ 0x5918a148f2ad8780ULL, 0x5cdd1629daf657c4ULL, 0x8274c15164fb6cfaULL,
+ 0xd1fb13dbc6e056f2ULL, 0x7d6fd910cf609f6aULL, 0xb63f38bdd9a9aa4dULL,
+ 0x3d9fe7faf526c003ULL, 0x74bbc706871499deULL, 0xdf630734b6b8522aULL,
+ 0x3ad3ed03cd0ac26fULL, 0xfadeaf2083c023d4ULL, 0xc00d42234ecae1bbULL,
+ 0x8538cba85cd76e96ULL, 0xc402250e6e2458ebULL, 0x47bc3413026a5d05ULL,
+ 0xafd7a71f114272a4ULL, 0x978df784cc3f62e3ULL, 0xb96dfc1ea144c781ULL,
+ 0x21b2cf391596c8aeULL, 0x318e4e8d950916f3ULL, 0xce9556cc3e92e563ULL,
+ 0x385a509bdd7d1047ULL, 0x358129a0b5e7afa3ULL, 0xe6f387e363702b79ULL,
+ 0xe0755d5653e94001ULL, 0x7be903a5fff9f412ULL, 0x12b53c2c90e80c75ULL,
+ 0x3307f315857ec4dbULL, 0x8fafb86a0c61d31eULL, 0xd9e5dd8186213952ULL,
+ 0x77f8aad29fd622e2ULL, 0x25bda814357871feULL, 0x7571174a8fa1f0caULL,
+ 0x137fec60985d6561ULL, 0x30449ec19dbc7fe7ULL, 0xa540d4dd41f4cf2cULL,
+ 0xdc206ae0ae7ae916ULL, 0x5b911cd0e2da55a8ULL, 0xb2305f90f947131dULL,
+ 0x344bf9ecbd52c6b7ULL, 0x5d17c665d2433ed0ULL, 0x18224feec05eb1fdULL,
+ 0x9e59e992844b6457ULL, 0x9a568ebfa4a5dd07ULL, 0xa3c60e68716da454ULL,
+ 0x7e2cb4c4d7a22456ULL, 0x87b176304ca0bcbeULL, 0x413aeea632f3367dULL,
+ 0x9915e36bbc67663bULL, 0x40f03eea3a465f69ULL, 0x1c2d28c3e0b008adULL,
+ 0x4e682a054a1e5bb1ULL, 0x05c5b761285bd044ULL, 0xe1bf8d1a5b5c2915ULL,
+ 0xf2c0617ac3014c74ULL, 0xb7f5e8f1d11cc359ULL, 0x63cb4c4b3fa745efULL,
+ 0x9d1a84469c89df6bULL, 0xe33630824b2bfb3dULL, 0xd5f474f6e60eefa2ULL,
+ 0xf58c6b83fb2d4e18ULL, 0x4676e45f0adf3411ULL, 0x20781f751d23a1baULL,
+ 0xbd629b3381aa7ed1ULL, 0xae1d775319f71bb0ULL, 0xfed1c80da32e9a84ULL,
+ 0x5509083f92825170ULL, 0x29ac01635557a70eULL, 0xa7c9694551831d04ULL,
+ 0x8e65682604d4ba0aULL, 0x11f651f8882ab749ULL, 0xd77dc96ef6793d8aULL,
+ 0xef2799f52b042dcdULL, 0x48eef0b07a8730c9ULL, 0x22f1a2ed0d547392ULL,
+ 0x6142f1d32fd097c7ULL, 0x4a674d286af0e2e1ULL, 0x80fd7cc9748cbed2ULL,
+ 0x717e7067af4f499aULL, 0x938290a9ecd1dbb3ULL, 0x88e3b293344dd172ULL,
+ 0x2734158c250fa3d6ULL
+ }
+};
+#endif
+#endif // PRECALC matrix
+
+void STREEBOG_init(STREEBOG_CTX *CTX)
+{
+ unsigned int i;
+
+ memset(CTX, 0x00, sizeof(STREEBOG_CTX));
+ CTX->digest_size = 512;
+
+ for (i = 0; i < 8; i++)
+ {
+ CTX->h[i] = 0x00ULL;
+ }
+}
+
+void
+STREEBOG_init256(STREEBOG_CTX *CTX)
+{
+ unsigned int i;
+
+ memset(CTX, 0x00, sizeof(STREEBOG_CTX));
+ CTX->digest_size = 256;
+
+ for (i = 0; i < 8; i++)
+ {
+ CTX->h[i] = 0x0101010101010101ULL;
+ }
+}
+
+static void
+pad(STREEBOG_CTX *CTX)
+{
+ unsigned char buf[64];
+
+ if (CTX->bufsize > 63)
+ return;
+
+ memset(&buf, 0x00, sizeof buf);
+ memcpy(&buf, CTX->buffer, CTX->bufsize);
+
+ buf[CTX->bufsize] = 0x01;
+ memcpy(CTX->buffer, &buf, sizeof buf);
+}
+
+static void
+add512(const unsigned long long *x, const unsigned long long *y, unsigned long long *r)
+{
+#ifndef __GOST3411_BIG_ENDIAN__
+ unsigned int CF, OF;
+ unsigned int i;
+
+ CF = 0;
+ for (i = 0; i < 8; i++)
+ {
+ r[i] = x[i] + y[i];
+ if ( (r[i] < y[i]) ||
+ (r[i] < x[i]) )
+ OF = 1;
+ else
+ OF = 0;
+
+ r[i] += CF;
+ CF = OF;
+ }
+#else
+ const unsigned char *xp, *yp;
+ unsigned char *rp;
+ unsigned int i;
+ int buf;
+
+ xp = (const unsigned char *) x;
+ yp = (const unsigned char *) y;
+ rp = (unsigned char *) r;
+
+ buf = 0;
+ for (i = 0; i < 64; i++)
+ {
+ buf = xp[i] + yp[i] + (buf >> 8);
+ rp[i] = (unsigned char) buf & 0xFF;
+ }
+#endif
+}
+
+#define X(x, y, z) { \
+ z[0] = x[0] ^ y[0]; \
+ z[1] = x[1] ^ y[1]; \
+ z[2] = x[2] ^ y[2]; \
+ z[3] = x[3] ^ y[3]; \
+ z[4] = x[4] ^ y[4]; \
+ z[5] = x[5] ^ y[5]; \
+ z[6] = x[6] ^ y[6]; \
+ z[7] = x[7] ^ y[7]; \
+}
+
+#ifndef __GOST3411_BIG_ENDIAN__
+#define __XLPS_FOR for (_i = 0; _i <= 7; _i++)
+#define _datai _i
+#else
+#define __XLPS_FOR for (_i = 7; _i >= 0; _i--)
+#define _datai 7 - _i
+#endif
+
+#define XLPS(x, y, data) { \
+ register unsigned long long r0, r1, r2, r3, r4, r5, r6, r7; \
+ int _i; \
+ \
+ r0 = x[0] ^ y[0]; \
+ r1 = x[1] ^ y[1]; \
+ r2 = x[2] ^ y[2]; \
+ r3 = x[3] ^ y[3]; \
+ r4 = x[4] ^ y[4]; \
+ r5 = x[5] ^ y[5]; \
+ r6 = x[6] ^ y[6]; \
+ r7 = x[7] ^ y[7]; \
+ \
+ \
+ __XLPS_FOR \
+ {\
+ data[_datai] = Ax[0][(r0 >> (_i << 3)) & 0xFF]; \
+ data[_datai] ^= Ax[1][(r1 >> (_i << 3)) & 0xFF]; \
+ data[_datai] ^= Ax[2][(r2 >> (_i << 3)) & 0xFF]; \
+ data[_datai] ^= Ax[3][(r3 >> (_i << 3)) & 0xFF]; \
+ data[_datai] ^= Ax[4][(r4 >> (_i << 3)) & 0xFF]; \
+ data[_datai] ^= Ax[5][(r5 >> (_i << 3)) & 0xFF]; \
+ data[_datai] ^= Ax[6][(r6 >> (_i << 3)) & 0xFF]; \
+ data[_datai] ^= Ax[7][(r7 >> (_i << 3)) & 0xFF]; \
+ }\
+}
+
+#define ROUND(i, Ki, data) { \
+ XLPS(Ki, (C[i]), Ki); \
+ XLPS(Ki, data, data); \
+}
+
+#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
+
+#define LO(v) ((unsigned char) (v))
+#define HI(v) ((unsigned char) (((unsigned int) (v)) >> 8))
+
+#if CRYPTOPP_BOOL_X86
+#define EXTRACT EXTRACT32
+#define EXTRACTSSE4 EXTRACT32
+#else
+#define EXTRACT EXTRACT64
+#define EXTRACTSSE4 EXTRACT64SSE4
+#endif
+
+#ifndef __ICC
+#ifdef _MSC_VER
+__inline __m64 _mm_set_pi64x (const __int64 i) {
+ union {
+ __int64 i;
+ __m64 v;
+ } u;
+
+ u.i = i;
+ return u.v;
+}
+#define _mm_cvtsi64_m64(v) _mm_set_pi64x (v)
+#else
+#define _mm_cvtsi64_m64(v) (__m64) v
+#endif
+#define _mm_cvtm64_si64(v) (long long) v
+#endif
+
+#if CRYPTOPP_BOOL_X86
+// This custom function works faster than _mm_set_epi64x intrinsic in 32bit mode on both VC++ 2015 and gcc
+VC_INLINE __m128i _mm_set_epi64x_a(uint64 i0, uint64 i1) {
+ union {
+ uint64 q[2];
+ uint32 r[4];
+ } u;
+ u.q[0] = i1; u.q[1] = i0;
+ return _mm_setr_epi32(u.r[0], u.r[1], u.r[2], u.r[3]);
+}
+#define _mm_cvtsi64_si128(a) _mm_set_epi64x_a(0, a)
+#endif
+
+#define LOAD(P, xmm0, xmm1, xmm2, xmm3) { \
+ const __m128i *__m128p = (const __m128i *) &P[0]; \
+ xmm0 = _mm_load_si128(&__m128p[0]); \
+ xmm1 = _mm_load_si128(&__m128p[1]); \
+ xmm2 = _mm_load_si128(&__m128p[2]); \
+ xmm3 = _mm_load_si128(&__m128p[3]); \
+}
+
+#define UNLOAD(P, xmm0, xmm1, xmm2, xmm3) { \
+ __m128i *__m128p = (__m128i *) &P[0]; \
+ _mm_store_si128(&__m128p[0], xmm0); \
+ _mm_store_si128(&__m128p[1], xmm1); \
+ _mm_store_si128(&__m128p[2], xmm2); \
+ _mm_store_si128(&__m128p[3], xmm3); \
+}
+
+#define X128R(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7) { \
+ xmm0 = _mm_xor_si128(xmm0, xmm4); \
+ xmm1 = _mm_xor_si128(xmm1, xmm5); \
+ xmm2 = _mm_xor_si128(xmm2, xmm6); \
+ xmm3 = _mm_xor_si128(xmm3, xmm7); \
+}
+
+#define X128M(P, xmm0, xmm1, xmm2, xmm3) { \
+ const __m128i *__m128p = (const __m128i *) &P[0]; \
+ xmm0 = _mm_xor_si128(xmm0, _mm_load_si128(&__m128p[0])); \
+ xmm1 = _mm_xor_si128(xmm1, _mm_load_si128(&__m128p[1])); \
+ xmm2 = _mm_xor_si128(xmm2, _mm_load_si128(&__m128p[2])); \
+ xmm3 = _mm_xor_si128(xmm3, _mm_load_si128(&__m128p[3])); \
+}
+
+#define _mm_xor_64(mm0, mm1) _mm_xor_si64(mm0, _mm_cvtsi64_m64(mm1))
+
+#define EXTRACT32(row, xmm0, xmm1, xmm2, xmm3, xmm4) { \
+ register unsigned short ax; \
+ __m64 mm0, mm1; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm0, row + 0); \
+ mm0 = _mm_cvtsi64_m64(Ax[0][LO(ax)]); \
+ mm1 = _mm_cvtsi64_m64(Ax[0][HI(ax)]); \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm0, row + 4); \
+ mm0 = _mm_xor_64(mm0, Ax[1][LO(ax)]); \
+ mm1 = _mm_xor_64(mm1, Ax[1][HI(ax)]); \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm1, row + 0); \
+ mm0 = _mm_xor_64(mm0, Ax[2][LO(ax)]); \
+ mm1 = _mm_xor_64(mm1, Ax[2][HI(ax)]); \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm1, row + 4); \
+ mm0 = _mm_xor_64(mm0, Ax[3][LO(ax)]); \
+ mm1 = _mm_xor_64(mm1, Ax[3][HI(ax)]); \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm2, row + 0); \
+ mm0 = _mm_xor_64(mm0, Ax[4][LO(ax)]); \
+ mm1 = _mm_xor_64(mm1, Ax[4][HI(ax)]); \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm2, row + 4); \
+ mm0 = _mm_xor_64(mm0, Ax[5][LO(ax)]); \
+ mm1 = _mm_xor_64(mm1, Ax[5][HI(ax)]); \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm3, row + 0); \
+ mm0 = _mm_xor_64(mm0, Ax[6][LO(ax)]); \
+ mm1 = _mm_xor_64(mm1, Ax[6][HI(ax)]); \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm3, row + 4); \
+ mm0 = _mm_xor_64(mm0, Ax[7][LO(ax)]); \
+ mm1 = _mm_xor_64(mm1, Ax[7][HI(ax)]); \
+ \
+ xmm4 = _mm_set_epi64(mm1, mm0); \
+}
+
+#define __EXTRACT64(row, xmm0, xmm1, xmm2, xmm3, xmm4) { \
+ __m128i tmm4; \
+ register unsigned long long r0, r1; \
+ r0 = Ax[0][_mm_extract_epi8(xmm0, row + 0)]; \
+ r0 ^= Ax[1][_mm_extract_epi8(xmm0, row + 8)]; \
+ r0 ^= Ax[2][_mm_extract_epi8(xmm1, row + 0)]; \
+ r0 ^= Ax[3][_mm_extract_epi8(xmm1, row + 8)]; \
+ r0 ^= Ax[4][_mm_extract_epi8(xmm2, row + 0)]; \
+ r0 ^= Ax[5][_mm_extract_epi8(xmm2, row + 8)]; \
+ r0 ^= Ax[6][_mm_extract_epi8(xmm3, row + 0)]; \
+ r0 ^= Ax[7][_mm_extract_epi8(xmm3, row + 8)]; \
+ \
+ r1 = Ax[0][_mm_extract_epi8(xmm0, row + 1)]; \
+ r1 ^= Ax[1][_mm_extract_epi8(xmm0, row + 9)]; \
+ r1 ^= Ax[2][_mm_extract_epi8(xmm1, row + 1)]; \
+ r1 ^= Ax[3][_mm_extract_epi8(xmm1, row + 9)]; \
+ r1 ^= Ax[4][_mm_extract_epi8(xmm2, row + 1)]; \
+ r1 ^= Ax[5][_mm_extract_epi8(xmm2, row + 9)]; \
+ r1 ^= Ax[6][_mm_extract_epi8(xmm3, row + 1)]; \
+ r1 ^= Ax[7][_mm_extract_epi8(xmm3, row + 9)]; \
+ xmm4 = _mm_cvtsi64_si128((long long) r0); \
+ tmm4 = _mm_cvtsi64_si128((long long) r1); \
+ xmm4 = _mm_unpacklo_epi64(xmm4, tmm4); \
+}
+
+#define EXTRACT64(row, xmm0, xmm1, xmm2, xmm3, xmm4) { \
+ __m128i tmm4; \
+ register unsigned short ax; \
+ register unsigned long long r0, r1; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm0, row + 0); \
+ r0 = Ax[0][LO(ax)]; \
+ r1 = Ax[0][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm0, row + 4); \
+ r0 ^= Ax[1][LO(ax)]; \
+ r1 ^= Ax[1][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm1, row + 0); \
+ r0 ^= Ax[2][LO(ax)]; \
+ r1 ^= Ax[2][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm1, row + 4); \
+ r0 ^= Ax[3][LO(ax)]; \
+ r1 ^= Ax[3][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm2, row + 0); \
+ r0 ^= Ax[4][LO(ax)]; \
+ r1 ^= Ax[4][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm2, row + 4); \
+ r0 ^= Ax[5][LO(ax)]; \
+ r1 ^= Ax[5][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm3, row + 0); \
+ r0 ^= Ax[6][LO(ax)]; \
+ r1 ^= Ax[6][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm3, row + 4); \
+ r0 ^= Ax[7][LO(ax)]; \
+ r1 ^= Ax[7][HI(ax)]; \
+ \
+ xmm4 = _mm_cvtsi64_si128((long long) r0); \
+ tmm4 = _mm_cvtsi64_si128((long long) r1); \
+ xmm4 = _mm_unpacklo_epi64(xmm4, tmm4); \
+}
+
+#define EXTRACT64SSE4(row, xmm0, xmm1, xmm2, xmm3, xmm4) { \
+ register unsigned short ax; \
+ register unsigned long long r0, r1; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm0, row + 0); \
+ r0 = Ax[0][LO(ax)]; \
+ r1 = Ax[0][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm0, row + 4); \
+ r0 ^= Ax[1][LO(ax)]; \
+ r1 ^= Ax[1][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm1, row + 0); \
+ r0 ^= Ax[2][LO(ax)]; \
+ r1 ^= Ax[2][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm1, row + 4); \
+ r0 ^= Ax[3][LO(ax)]; \
+ r1 ^= Ax[3][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm2, row + 0); \
+ r0 ^= Ax[4][LO(ax)]; \
+ r1 ^= Ax[4][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm2, row + 4); \
+ r0 ^= Ax[5][LO(ax)]; \
+ r1 ^= Ax[5][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm3, row + 0); \
+ r0 ^= Ax[6][LO(ax)]; \
+ r1 ^= Ax[6][HI(ax)]; \
+ \
+ ax = (unsigned short) _mm_extract_epi16(xmm3, row + 4); \
+ r0 ^= Ax[7][LO(ax)]; \
+ r1 ^= Ax[7][HI(ax)]; \
+ \
+ xmm4 = _mm_cvtsi64_si128((long long) r0); \
+ xmm4 = _mm_insert_epi64(xmm4, (long long) r1, 1);\
+}
+
+#define XLPS128M(P, xmm0, xmm1, xmm2, xmm3) { \
+ __m128i tmm0, tmm1, tmm2, tmm3; \
+ X128M(P, xmm0, xmm1, xmm2, xmm3); \
+ \
+ EXTRACT(0, xmm0, xmm1, xmm2, xmm3, tmm0); \
+ EXTRACT(1, xmm0, xmm1, xmm2, xmm3, tmm1); \
+ EXTRACT(2, xmm0, xmm1, xmm2, xmm3, tmm2); \
+ EXTRACT(3, xmm0, xmm1, xmm2, xmm3, tmm3); \
+ \
+ xmm0 = tmm0; \
+ xmm1 = tmm1; \
+ xmm2 = tmm2; \
+ xmm3 = tmm3; \
+}
+
+#define XLPS128MSSE4(P, xmm0, xmm1, xmm2, xmm3) { \
+ __m128i tmm0, tmm1, tmm2, tmm3; \
+ X128M(P, xmm0, xmm1, xmm2, xmm3); \
+ \
+ EXTRACTSSE4(0, xmm0, xmm1, xmm2, xmm3, tmm0); \
+ EXTRACTSSE4(1, xmm0, xmm1, xmm2, xmm3, tmm1); \
+ EXTRACTSSE4(2, xmm0, xmm1, xmm2, xmm3, tmm2); \
+ EXTRACTSSE4(3, xmm0, xmm1, xmm2, xmm3, tmm3); \
+ \
+ xmm0 = tmm0; \
+ xmm1 = tmm1; \
+ xmm2 = tmm2; \
+ xmm3 = tmm3; \
+}
+
+#define XLPS128R(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7) { \
+ __m128i tmm0, tmm1, tmm2, tmm3; \
+ X128R(xmm4, xmm5, xmm6, xmm7, xmm0, xmm1, xmm2, xmm3); \
+ \
+ EXTRACT(0, xmm4, xmm5, xmm6, xmm7, tmm0); \
+ EXTRACT(1, xmm4, xmm5, xmm6, xmm7, tmm1); \
+ EXTRACT(2, xmm4, xmm5, xmm6, xmm7, tmm2); \
+ EXTRACT(3, xmm4, xmm5, xmm6, xmm7, tmm3); \
+ \
+ xmm4 = tmm0; \
+ xmm5 = tmm1; \
+ xmm6 = tmm2; \
+ xmm7 = tmm3; \
+}
+
+#define XLPS128RSSE4(xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7) { \
+ __m128i tmm0, tmm1, tmm2, tmm3; \
+ X128R(xmm4, xmm5, xmm6, xmm7, xmm0, xmm1, xmm2, xmm3); \
+ \
+ EXTRACTSSE4(0, xmm4, xmm5, xmm6, xmm7, tmm0); \
+ EXTRACTSSE4(1, xmm4, xmm5, xmm6, xmm7, tmm1); \
+ EXTRACTSSE4(2, xmm4, xmm5, xmm6, xmm7, tmm2); \
+ EXTRACTSSE4(3, xmm4, xmm5, xmm6, xmm7, tmm3); \
+ \
+ xmm4 = tmm0; \
+ xmm5 = tmm1; \
+ xmm6 = tmm2; \
+ xmm7 = tmm3; \
+}
+
+#define ROUND128(i, xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7) { \
+ XLPS128M((&C[i]), xmm0, xmm2, xmm4, xmm6); \
+ XLPS128R(xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7); \
+}
+
+#define ROUND128SSE4(i, xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7) { \
+ XLPS128MSSE4((&C[i]), xmm0, xmm2, xmm4, xmm6); \
+ XLPS128RSSE4(xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7); \
+}
+
+#endif // defined(CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE)
+
+static void
+g(unsigned long long *h, const unsigned long long *N, const unsigned char *m)
+{
+#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
+ if (HasSSE41()) {
+ __m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */
+ __m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */
+ unsigned int i;
+
+ LOAD(N, xmm0, xmm2, xmm4, xmm6);
+ XLPS128MSSE4(h, xmm0, xmm2, xmm4, xmm6);
+
+ LOAD(m, xmm1, xmm3, xmm5, xmm7);
+ XLPS128RSSE4(xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7);
+
+ for (i = 0; i < 11; i++)
+ ROUND128SSE4(i, xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7);
+
+ XLPS128MSSE4((&C[11]), xmm0, xmm2, xmm4, xmm6);
+ X128R(xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7);
+
+ X128M(h, xmm0, xmm2, xmm4, xmm6);
+ X128M(m, xmm0, xmm2, xmm4, xmm6);
+
+ UNLOAD(h, xmm0, xmm2, xmm4, xmm6);
+
+ /* Restore the Floating-point status on the CPU */
+#if CRYPTOPP_BOOL_X86
+ _mm_empty();
+#endif
+ }
+ else if (HasSSE2()) {
+ __m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */
+ __m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */
+ unsigned int i;
+
+ LOAD(N, xmm0, xmm2, xmm4, xmm6);
+ XLPS128M(h, xmm0, xmm2, xmm4, xmm6);
+
+ LOAD(m, xmm1, xmm3, xmm5, xmm7);
+ XLPS128R(xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7);
+
+ for (i = 0; i < 11; i++)
+ ROUND128(i, xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7);
+
+ XLPS128M((&C[11]), xmm0, xmm2, xmm4, xmm6);
+ X128R(xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7);
+
+ X128M(h, xmm0, xmm2, xmm4, xmm6);
+ X128M(m, xmm0, xmm2, xmm4, xmm6);
+
+ UNLOAD(h, xmm0, xmm2, xmm4, xmm6);
+
+ /* Restore the Floating-point status on the CPU */
+#if CRYPTOPP_BOOL_X86
+ _mm_empty();
+#endif
+ } else
+#endif
+ {
+ ALIGN(16) unsigned long long Ki[8], data[8];
+ unsigned int i;
+
+ XLPS(h, N, (data));
+
+ /* Starting E() */
+ // memcpy (Ki, data, sizeof (data));
+ Ki[0] = data[0];Ki[1] = data[1];Ki[2] = data[2];Ki[3] = data[3];
+ Ki[4] = data[4];Ki[5] = data[5];Ki[6] = data[6];Ki[7] = data[7];
+ XLPS((Ki), ((const unsigned long long *) m), (data));
+
+ for (i = 0; i < 11; i++)
+ ROUND(i, (Ki), (data));
+
+ XLPS((Ki), (C[11]), (Ki));
+ X((Ki), (data), (data));
+ /* E() done */
+
+ X((data), h, (data));
+ X((data), ((const unsigned long long *) m), h);
+ }
+}
+
+static void
+stage2(STREEBOG_CTX *CTX, const unsigned char *data)
+{
+ g((CTX->h), (CTX->N), data);
+
+ add512((CTX->N), buffer512, (CTX->N));
+ add512((CTX->Sigma), (const unsigned long long *) data, (CTX->Sigma));
+}
+
+static void
+stage3(STREEBOG_CTX *CTX)
+{
+ ALIGN(16) unsigned long long buf[8];
+
+ memset(buf, 0x00, sizeof buf);
+ memcpy(buf, (CTX->buffer), CTX->bufsize);
+ memcpy((CTX->buffer), buf, 8 * sizeof (unsigned long long));
+
+ memset(buf, 0x00, sizeof buf);
+#ifndef __GOST3411_BIG_ENDIAN__
+ buf[0] = CTX->bufsize << 3;
+#else
+ buf[0] = BSWAP64(CTX->bufsize << 3);
+#endif
+
+ pad(CTX);
+
+ g((CTX->h), (CTX->N), (const unsigned char *) (CTX->buffer));
+
+ add512((CTX->N), buf, (CTX->N));
+ add512((CTX->Sigma), (const unsigned long long *) CTX->buffer,
+ (CTX->Sigma));
+
+ g((CTX->h), buffer0, (const unsigned char *) (CTX->N));
+
+ g((CTX->h), buffer0, (const unsigned char *) (CTX->Sigma));
+ memcpy((CTX->hash), (CTX->h), 8 * sizeof(unsigned long long));
+}
+
+void STREEBOG_add(STREEBOG_CTX *CTX, byte *data, size_t len)
+{
+ size_t chunksize;
+
+ while (len > 63 && CTX->bufsize == 0)
+ {
+ stage2(CTX, data);
+
+ data += 64;
+ len -= 64;
+ }
+
+ while (len)
+ {
+ chunksize = 64 - CTX->bufsize;
+ if (chunksize > len)
+ chunksize = len;
+
+ memcpy(&CTX->buffer[CTX->bufsize], data, chunksize);
+
+ CTX->bufsize += chunksize;
+ len -= chunksize;
+ data += chunksize;
+
+ if (CTX->bufsize == 64)
+ {
+ stage2(CTX, CTX->buffer);
+
+ CTX->bufsize = 0;
+ }
+ }
+}
+
+void STREEBOG_finalize(STREEBOG_CTX *CTX, byte *digest)
+{
+ stage3(CTX);
+
+ CTX->bufsize = 0;
+
+ if (CTX->digest_size == 256)
+ memcpy(digest, &(CTX->hash[4]), 32);
+ else
+ memcpy(digest, CTX->hash, 64);
+}
diff --git a/src/Crypto/Streebog.h b/src/Crypto/Streebog.h
new file mode 100644
index 00000000..61630234
--- /dev/null
+++ b/src/Crypto/Streebog.h
@@ -0,0 +1,33 @@
+
+/*
+* Copyright (c) 2013, Alexey Degtyarev.
+* All rights reserved.
+*/
+
+/* Adapted to VeraCrypt */
+
+#ifndef STREEBOG_H
+#define STREEBOG_H
+
+#include "Common/Tcdefs.h"
+#include "config.h"
+
+#define ALIGN(a) CRYPTOPP_ALIGN_DATA(a)
+
+typedef ALIGN(16) struct _STREEBOG_CTX
+{
+ ALIGN(16) unsigned char buffer[64];
+ ALIGN(16) unsigned long long hash[8];
+ ALIGN(16) unsigned long long h[8];
+ ALIGN(16) unsigned long long N[8];
+ ALIGN(16) unsigned long long Sigma[8];
+ size_t bufsize;
+ unsigned int digest_size;
+} STREEBOG_CTX;
+
+void STREEBOG_init(STREEBOG_CTX *ctx);
+void STREEBOG_init256(STREEBOG_CTX *ctx);
+void STREEBOG_add(STREEBOG_CTX *ctx, byte *msg, size_t len);
+void STREEBOG_finalize(STREEBOG_CTX *ctx, byte *out);
+
+#endif
diff --git a/src/Crypto/Whirlpool.c b/src/Crypto/Whirlpool.c
index ee109d81..86b3ebf6 100644
--- a/src/Crypto/Whirlpool.c
+++ b/src/Crypto/Whirlpool.c
@@ -26,7 +26,7 @@
* ``The Whirlpool hashing function,''
* NESSIE submission, 2000 (tweaked version, 2001),
* <https://www.cosic.esat.kuleuven.ac.be/nessie/workshop/submissions/whirlpool.zip>
- *
+ *
* @author Paulo S.L.M. Barreto
* @author Vincent Rijmen.
*
@@ -68,14 +68,16 @@
*
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
+#include "Common/Tcdefs.h"
#include "Common/Endian.h"
+#if !defined(_UEFI)
+#include <memory.h>
+#include <stdlib.h>
+#endif
+
#include "cpu.h"
-#include "misc.h"
+#include "misc.h"
#include "Whirlpool.h"
/*
@@ -91,9 +93,9 @@
*/
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
-CRYPTOPP_ALIGN_DATA(16) static const uint64 Whirlpool_C[4*256+R] CRYPTOPP_SECTION_ALIGN16 = {
+CRYPTOPP_ALIGN_DATA(16) static const uint64 Whirlpool_C[8*256+R] CRYPTOPP_SECTION_ALIGN16 = {
#else
-static const uint64 Whirlpool_C[4*256+R] = {
+static const uint64 Whirlpool_C[8*256+R] = {
#endif
LL(0x18186018c07830d8), LL(0x23238c2305af4626), LL(0xc6c63fc67ef991b8), LL(0xe8e887e8136fcdfb),
LL(0x878726874ca113cb), LL(0xb8b8dab8a9626d11), LL(0x0101040108050209), LL(0x4f4f214f426e9e0d),
@@ -355,6 +357,266 @@ static const uint64 Whirlpool_C[4*256+R] = {
LL(0xdb85e2cccc17cc2e), LL(0x578468424215422a), LL(0xc22d2c98985a98b4), LL(0x0e55eda4a4aaa449),
LL(0x8850752828a0285d), LL(0x31b8865c5c6d5cda), LL(0x3fed6bf8f8c7f893), LL(0xa411c28686228644),
+ LL(0xc07830d818186018), LL(0x05af462623238c23), LL(0x7ef991b8c6c63fc6), LL(0x136fcdfbe8e887e8),
+ LL(0x4ca113cb87872687), LL(0xa9626d11b8b8dab8), LL(0x0805020901010401), LL(0x426e9e0d4f4f214f),
+ LL(0xadee6c9b3636d836), LL(0x590451ffa6a6a2a6), LL(0xdebdb90cd2d26fd2), LL(0xfb06f70ef5f5f3f5),
+ LL(0xef80f2967979f979), LL(0x5fcede306f6fa16f), LL(0xfcef3f6d91917e91), LL(0xaa07a4f852525552),
+ LL(0x27fdc04760609d60), LL(0x89766535bcbccabc), LL(0xaccd2b379b9b569b), LL(0x048c018a8e8e028e),
+ LL(0x71155bd2a3a3b6a3), LL(0x603c186c0c0c300c), LL(0xff8af6847b7bf17b), LL(0xb5e16a803535d435),
+ LL(0xe8693af51d1d741d), LL(0x5347ddb3e0e0a7e0), LL(0xf6acb321d7d77bd7), LL(0x5eed999cc2c22fc2),
+ LL(0x6d965c432e2eb82e), LL(0x627a96294b4b314b), LL(0xa321e15dfefedffe), LL(0x8216aed557574157),
+ LL(0xa8412abd15155415), LL(0x9fb6eee87777c177), LL(0xa5eb6e923737dc37), LL(0x7b56d79ee5e5b3e5),
+ LL(0x8cd923139f9f469f), LL(0xd317fd23f0f0e7f0), LL(0x6a7f94204a4a354a), LL(0x9e95a944dada4fda),
+ LL(0xfa25b0a258587d58), LL(0x06ca8fcfc9c903c9), LL(0x558d527c2929a429), LL(0x5022145a0a0a280a),
+ LL(0xe14f7f50b1b1feb1), LL(0x691a5dc9a0a0baa0), LL(0x7fdad6146b6bb16b), LL(0x5cab17d985852e85),
+ LL(0x8173673cbdbdcebd), LL(0xd234ba8f5d5d695d), LL(0x8050209010104010), LL(0xf303f507f4f4f7f4),
+ LL(0x16c08bddcbcb0bcb), LL(0xedc67cd33e3ef83e), LL(0x28110a2d05051405), LL(0x1fe6ce7867678167),
+ LL(0x7353d597e4e4b7e4), LL(0x25bb4e0227279c27), LL(0x3258827341411941), LL(0x2c9d0ba78b8b168b),
+ LL(0x510153f6a7a7a6a7), LL(0xcf94fab27d7de97d), LL(0xdcfb374995956e95), LL(0x8e9fad56d8d847d8),
+ LL(0x8b30eb70fbfbcbfb), LL(0x2371c1cdeeee9fee), LL(0xc791f8bb7c7ced7c), LL(0x17e3cc7166668566),
+ LL(0xa68ea77bdddd53dd), LL(0xb84b2eaf17175c17), LL(0x02468e4547470147), LL(0x84dc211a9e9e429e),
+ LL(0x1ec589d4caca0fca), LL(0x75995a582d2db42d), LL(0x9179632ebfbfc6bf), LL(0x381b0e3f07071c07),
+ LL(0x012347acadad8ead), LL(0xea2fb4b05a5a755a), LL(0x6cb51bef83833683), LL(0x85ff66b63333cc33),
+ LL(0x3ff2c65c63639163), LL(0x100a041202020802), LL(0x39384993aaaa92aa), LL(0xafa8e2de7171d971),
+ LL(0x0ecf8dc6c8c807c8), LL(0xc87d32d119196419), LL(0x7270923b49493949), LL(0x869aaf5fd9d943d9),
+ LL(0xc31df931f2f2eff2), LL(0x4b48dba8e3e3abe3), LL(0xe22ab6b95b5b715b), LL(0x34920dbc88881a88),
+ LL(0xa4c8293e9a9a529a), LL(0x2dbe4c0b26269826), LL(0x8dfa64bf3232c832), LL(0xe94a7d59b0b0fab0),
+ LL(0x1b6acff2e9e983e9), LL(0x78331e770f0f3c0f), LL(0xe6a6b733d5d573d5), LL(0x74ba1df480803a80),
+ LL(0x997c6127bebec2be), LL(0x26de87ebcdcd13cd), LL(0xbde468893434d034), LL(0x7a75903248483d48),
+ LL(0xab24e354ffffdbff), LL(0xf78ff48d7a7af57a), LL(0xf4ea3d6490907a90), LL(0xc23ebe9d5f5f615f),
+ LL(0x1da0403d20208020), LL(0x67d5d00f6868bd68), LL(0xd07234ca1a1a681a), LL(0x192c41b7aeae82ae),
+ LL(0xc95e757db4b4eab4), LL(0x9a19a8ce54544d54), LL(0xece53b7f93937693), LL(0x0daa442f22228822),
+ LL(0x07e9c86364648d64), LL(0xdb12ff2af1f1e3f1), LL(0xbfa2e6cc7373d173), LL(0x905a248212124812),
+ LL(0x3a5d807a40401d40), LL(0x4028104808082008), LL(0x56e89b95c3c32bc3), LL(0x337bc5dfecec97ec),
+ LL(0x9690ab4ddbdb4bdb), LL(0x611f5fc0a1a1bea1), LL(0x1c8307918d8d0e8d), LL(0xf5c97ac83d3df43d),
+ LL(0xccf1335b97976697), LL(0x0000000000000000), LL(0x36d483f9cfcf1bcf), LL(0x4587566e2b2bac2b),
+ LL(0x97b3ece17676c576), LL(0x64b019e682823282), LL(0xfea9b128d6d67fd6), LL(0xd87736c31b1b6c1b),
+ LL(0xc15b7774b5b5eeb5), LL(0x112943beafaf86af), LL(0x77dfd41d6a6ab56a), LL(0xba0da0ea50505d50),
+ LL(0x124c8a5745450945), LL(0xcb18fb38f3f3ebf3), LL(0x9df060ad3030c030), LL(0x2b74c3c4efef9bef),
+ LL(0xe5c37eda3f3ffc3f), LL(0x921caac755554955), LL(0x791059dba2a2b2a2), LL(0x0365c9e9eaea8fea),
+ LL(0x0fecca6a65658965), LL(0xb9686903babad2ba), LL(0x65935e4a2f2fbc2f), LL(0x4ee79d8ec0c027c0),
+ LL(0xbe81a160dede5fde), LL(0xe06c38fc1c1c701c), LL(0xbb2ee746fdfdd3fd), LL(0x52649a1f4d4d294d),
+ LL(0xe4e0397692927292), LL(0x8fbceafa7575c975), LL(0x301e0c3606061806), LL(0x249809ae8a8a128a),
+ LL(0xf940794bb2b2f2b2), LL(0x6359d185e6e6bfe6), LL(0x70361c7e0e0e380e), LL(0xf8633ee71f1f7c1f),
+ LL(0x37f7c45562629562), LL(0xeea3b53ad4d477d4), LL(0x29324d81a8a89aa8), LL(0xc4f4315296966296),
+ LL(0x9b3aef62f9f9c3f9), LL(0x66f697a3c5c533c5), LL(0x35b14a1025259425), LL(0xf220b2ab59597959),
+ LL(0x54ae15d084842a84), LL(0xb7a7e4c57272d572), LL(0xd5dd72ec3939e439), LL(0x5a6198164c4c2d4c),
+ LL(0xca3bbc945e5e655e), LL(0xe785f09f7878fd78), LL(0xddd870e53838e038), LL(0x148605988c8c0a8c),
+ LL(0xc6b2bf17d1d163d1), LL(0x410b57e4a5a5aea5), LL(0x434dd9a1e2e2afe2), LL(0x2ff8c24e61619961),
+ LL(0xf1457b42b3b3f6b3), LL(0x15a5423421218421), LL(0x94d625089c9c4a9c), LL(0xf0663cee1e1e781e),
+ LL(0x2252866143431143), LL(0x76fc93b1c7c73bc7), LL(0xb32be54ffcfcd7fc), LL(0x2014082404041004),
+ LL(0xb208a2e351515951), LL(0xbcc72f2599995e99), LL(0x4fc4da226d6da96d), LL(0x68391a650d0d340d),
+ LL(0x8335e979fafacffa), LL(0xb684a369dfdf5bdf), LL(0xd79bfca97e7ee57e), LL(0x3db4481924249024),
+ LL(0xc5d776fe3b3bec3b), LL(0x313d4b9aabab96ab), LL(0x3ed181f0cece1fce), LL(0x8855229911114411),
+ LL(0x0c8903838f8f068f), LL(0x4a6b9c044e4e254e), LL(0xd1517366b7b7e6b7), LL(0x0b60cbe0ebeb8beb),
+ LL(0xfdcc78c13c3cf03c), LL(0x7cbf1ffd81813e81), LL(0xd4fe354094946a94), LL(0xeb0cf31cf7f7fbf7),
+ LL(0xa1676f18b9b9deb9), LL(0x985f268b13134c13), LL(0x7d9c58512c2cb02c), LL(0xd6b8bb05d3d36bd3),
+ LL(0x6b5cd38ce7e7bbe7), LL(0x57cbdc396e6ea56e), LL(0x6ef395aac4c437c4), LL(0x180f061b03030c03),
+ LL(0x8a13acdc56564556), LL(0x1a49885e44440d44), LL(0xdf9efea07f7fe17f), LL(0x21374f88a9a99ea9),
+ LL(0x4d8254672a2aa82a), LL(0xb16d6b0abbbbd6bb), LL(0x46e29f87c1c123c1), LL(0xa202a6f153535153),
+ LL(0xae8ba572dcdc57dc), LL(0x582716530b0b2c0b), LL(0x9cd327019d9d4e9d), LL(0x47c1d82b6c6cad6c),
+ LL(0x95f562a43131c431), LL(0x87b9e8f37474cd74), LL(0xe309f115f6f6fff6), LL(0x0a438c4c46460546),
+ LL(0x092645a5acac8aac), LL(0x3c970fb589891e89), LL(0xa04428b414145014), LL(0x5b42dfbae1e1a3e1),
+ LL(0xb04e2ca616165816), LL(0xcdd274f73a3ae83a), LL(0x6fd0d2066969b969), LL(0x482d124109092409),
+ LL(0xa7ade0d77070dd70), LL(0xd954716fb6b6e2b6), LL(0xceb7bd1ed0d067d0), LL(0x3b7ec7d6eded93ed),
+ LL(0x2edb85e2cccc17cc), LL(0x2a57846842421542), LL(0xb4c22d2c98985a98), LL(0x490e55eda4a4aaa4),
+ LL(0x5d8850752828a028), LL(0xda31b8865c5c6d5c), LL(0x933fed6bf8f8c7f8), LL(0x44a411c286862286),
+
+ LL(0x18c07830d8181860), LL(0x2305af462623238c), LL(0xc67ef991b8c6c63f), LL(0xe8136fcdfbe8e887),
+ LL(0x874ca113cb878726), LL(0xb8a9626d11b8b8da), LL(0x0108050209010104), LL(0x4f426e9e0d4f4f21),
+ LL(0x36adee6c9b3636d8), LL(0xa6590451ffa6a6a2), LL(0xd2debdb90cd2d26f), LL(0xf5fb06f70ef5f5f3),
+ LL(0x79ef80f2967979f9), LL(0x6f5fcede306f6fa1), LL(0x91fcef3f6d91917e), LL(0x52aa07a4f8525255),
+ LL(0x6027fdc04760609d), LL(0xbc89766535bcbcca), LL(0x9baccd2b379b9b56), LL(0x8e048c018a8e8e02),
+ LL(0xa371155bd2a3a3b6), LL(0x0c603c186c0c0c30), LL(0x7bff8af6847b7bf1), LL(0x35b5e16a803535d4),
+ LL(0x1de8693af51d1d74), LL(0xe05347ddb3e0e0a7), LL(0xd7f6acb321d7d77b), LL(0xc25eed999cc2c22f),
+ LL(0x2e6d965c432e2eb8), LL(0x4b627a96294b4b31), LL(0xfea321e15dfefedf), LL(0x578216aed5575741),
+ LL(0x15a8412abd151554), LL(0x779fb6eee87777c1), LL(0x37a5eb6e923737dc), LL(0xe57b56d79ee5e5b3),
+ LL(0x9f8cd923139f9f46), LL(0xf0d317fd23f0f0e7), LL(0x4a6a7f94204a4a35), LL(0xda9e95a944dada4f),
+ LL(0x58fa25b0a258587d), LL(0xc906ca8fcfc9c903), LL(0x29558d527c2929a4), LL(0x0a5022145a0a0a28),
+ LL(0xb1e14f7f50b1b1fe), LL(0xa0691a5dc9a0a0ba), LL(0x6b7fdad6146b6bb1), LL(0x855cab17d985852e),
+ LL(0xbd8173673cbdbdce), LL(0x5dd234ba8f5d5d69), LL(0x1080502090101040), LL(0xf4f303f507f4f4f7),
+ LL(0xcb16c08bddcbcb0b), LL(0x3eedc67cd33e3ef8), LL(0x0528110a2d050514), LL(0x671fe6ce78676781),
+ LL(0xe47353d597e4e4b7), LL(0x2725bb4e0227279c), LL(0x4132588273414119), LL(0x8b2c9d0ba78b8b16),
+ LL(0xa7510153f6a7a7a6), LL(0x7dcf94fab27d7de9), LL(0x95dcfb374995956e), LL(0xd88e9fad56d8d847),
+ LL(0xfb8b30eb70fbfbcb), LL(0xee2371c1cdeeee9f), LL(0x7cc791f8bb7c7ced), LL(0x6617e3cc71666685),
+ LL(0xdda68ea77bdddd53), LL(0x17b84b2eaf17175c), LL(0x4702468e45474701), LL(0x9e84dc211a9e9e42),
+ LL(0xca1ec589d4caca0f), LL(0x2d75995a582d2db4), LL(0xbf9179632ebfbfc6), LL(0x07381b0e3f07071c),
+ LL(0xad012347acadad8e), LL(0x5aea2fb4b05a5a75), LL(0x836cb51bef838336), LL(0x3385ff66b63333cc),
+ LL(0x633ff2c65c636391), LL(0x02100a0412020208), LL(0xaa39384993aaaa92), LL(0x71afa8e2de7171d9),
+ LL(0xc80ecf8dc6c8c807), LL(0x19c87d32d1191964), LL(0x497270923b494939), LL(0xd9869aaf5fd9d943),
+ LL(0xf2c31df931f2f2ef), LL(0xe34b48dba8e3e3ab), LL(0x5be22ab6b95b5b71), LL(0x8834920dbc88881a),
+ LL(0x9aa4c8293e9a9a52), LL(0x262dbe4c0b262698), LL(0x328dfa64bf3232c8), LL(0xb0e94a7d59b0b0fa),
+ LL(0xe91b6acff2e9e983), LL(0x0f78331e770f0f3c), LL(0xd5e6a6b733d5d573), LL(0x8074ba1df480803a),
+ LL(0xbe997c6127bebec2), LL(0xcd26de87ebcdcd13), LL(0x34bde468893434d0), LL(0x487a75903248483d),
+ LL(0xffab24e354ffffdb), LL(0x7af78ff48d7a7af5), LL(0x90f4ea3d6490907a), LL(0x5fc23ebe9d5f5f61),
+ LL(0x201da0403d202080), LL(0x6867d5d00f6868bd), LL(0x1ad07234ca1a1a68), LL(0xae192c41b7aeae82),
+ LL(0xb4c95e757db4b4ea), LL(0x549a19a8ce54544d), LL(0x93ece53b7f939376), LL(0x220daa442f222288),
+ LL(0x6407e9c86364648d), LL(0xf1db12ff2af1f1e3), LL(0x73bfa2e6cc7373d1), LL(0x12905a2482121248),
+ LL(0x403a5d807a40401d), LL(0x0840281048080820), LL(0xc356e89b95c3c32b), LL(0xec337bc5dfecec97),
+ LL(0xdb9690ab4ddbdb4b), LL(0xa1611f5fc0a1a1be), LL(0x8d1c8307918d8d0e), LL(0x3df5c97ac83d3df4),
+ LL(0x97ccf1335b979766), LL(0x0000000000000000), LL(0xcf36d483f9cfcf1b), LL(0x2b4587566e2b2bac),
+ LL(0x7697b3ece17676c5), LL(0x8264b019e6828232), LL(0xd6fea9b128d6d67f), LL(0x1bd87736c31b1b6c),
+ LL(0xb5c15b7774b5b5ee), LL(0xaf112943beafaf86), LL(0x6a77dfd41d6a6ab5), LL(0x50ba0da0ea50505d),
+ LL(0x45124c8a57454509), LL(0xf3cb18fb38f3f3eb), LL(0x309df060ad3030c0), LL(0xef2b74c3c4efef9b),
+ LL(0x3fe5c37eda3f3ffc), LL(0x55921caac7555549), LL(0xa2791059dba2a2b2), LL(0xea0365c9e9eaea8f),
+ LL(0x650fecca6a656589), LL(0xbab9686903babad2), LL(0x2f65935e4a2f2fbc), LL(0xc04ee79d8ec0c027),
+ LL(0xdebe81a160dede5f), LL(0x1ce06c38fc1c1c70), LL(0xfdbb2ee746fdfdd3), LL(0x4d52649a1f4d4d29),
+ LL(0x92e4e03976929272), LL(0x758fbceafa7575c9), LL(0x06301e0c36060618), LL(0x8a249809ae8a8a12),
+ LL(0xb2f940794bb2b2f2), LL(0xe66359d185e6e6bf), LL(0x0e70361c7e0e0e38), LL(0x1ff8633ee71f1f7c),
+ LL(0x6237f7c455626295), LL(0xd4eea3b53ad4d477), LL(0xa829324d81a8a89a), LL(0x96c4f43152969662),
+ LL(0xf99b3aef62f9f9c3), LL(0xc566f697a3c5c533), LL(0x2535b14a10252594), LL(0x59f220b2ab595979),
+ LL(0x8454ae15d084842a), LL(0x72b7a7e4c57272d5), LL(0x39d5dd72ec3939e4), LL(0x4c5a6198164c4c2d),
+ LL(0x5eca3bbc945e5e65), LL(0x78e785f09f7878fd), LL(0x38ddd870e53838e0), LL(0x8c148605988c8c0a),
+ LL(0xd1c6b2bf17d1d163), LL(0xa5410b57e4a5a5ae), LL(0xe2434dd9a1e2e2af), LL(0x612ff8c24e616199),
+ LL(0xb3f1457b42b3b3f6), LL(0x2115a54234212184), LL(0x9c94d625089c9c4a), LL(0x1ef0663cee1e1e78),
+ LL(0x4322528661434311), LL(0xc776fc93b1c7c73b), LL(0xfcb32be54ffcfcd7), LL(0x0420140824040410),
+ LL(0x51b208a2e3515159), LL(0x99bcc72f2599995e), LL(0x6d4fc4da226d6da9), LL(0x0d68391a650d0d34),
+ LL(0xfa8335e979fafacf), LL(0xdfb684a369dfdf5b), LL(0x7ed79bfca97e7ee5), LL(0x243db44819242490),
+ LL(0x3bc5d776fe3b3bec), LL(0xab313d4b9aabab96), LL(0xce3ed181f0cece1f), LL(0x1188552299111144),
+ LL(0x8f0c8903838f8f06), LL(0x4e4a6b9c044e4e25), LL(0xb7d1517366b7b7e6), LL(0xeb0b60cbe0ebeb8b),
+ LL(0x3cfdcc78c13c3cf0), LL(0x817cbf1ffd81813e), LL(0x94d4fe354094946a), LL(0xf7eb0cf31cf7f7fb),
+ LL(0xb9a1676f18b9b9de), LL(0x13985f268b13134c), LL(0x2c7d9c58512c2cb0), LL(0xd3d6b8bb05d3d36b),
+ LL(0xe76b5cd38ce7e7bb), LL(0x6e57cbdc396e6ea5), LL(0xc46ef395aac4c437), LL(0x03180f061b03030c),
+ LL(0x568a13acdc565645), LL(0x441a49885e44440d), LL(0x7fdf9efea07f7fe1), LL(0xa921374f88a9a99e),
+ LL(0x2a4d8254672a2aa8), LL(0xbbb16d6b0abbbbd6), LL(0xc146e29f87c1c123), LL(0x53a202a6f1535351),
+ LL(0xdcae8ba572dcdc57), LL(0x0b582716530b0b2c), LL(0x9d9cd327019d9d4e), LL(0x6c47c1d82b6c6cad),
+ LL(0x3195f562a43131c4), LL(0x7487b9e8f37474cd), LL(0xf6e309f115f6f6ff), LL(0x460a438c4c464605),
+ LL(0xac092645a5acac8a), LL(0x893c970fb589891e), LL(0x14a04428b4141450), LL(0xe15b42dfbae1e1a3),
+ LL(0x16b04e2ca6161658), LL(0x3acdd274f73a3ae8), LL(0x696fd0d2066969b9), LL(0x09482d1241090924),
+ LL(0x70a7ade0d77070dd), LL(0xb6d954716fb6b6e2), LL(0xd0ceb7bd1ed0d067), LL(0xed3b7ec7d6eded93),
+ LL(0xcc2edb85e2cccc17), LL(0x422a578468424215), LL(0x98b4c22d2c98985a), LL(0xa4490e55eda4a4aa),
+ LL(0x285d8850752828a0), LL(0x5cda31b8865c5c6d), LL(0xf8933fed6bf8f8c7), LL(0x8644a411c2868622),
+
+ LL(0x6018c07830d81818), LL(0x8c2305af46262323), LL(0x3fc67ef991b8c6c6), LL(0x87e8136fcdfbe8e8),
+ LL(0x26874ca113cb8787), LL(0xdab8a9626d11b8b8), LL(0x0401080502090101), LL(0x214f426e9e0d4f4f),
+ LL(0xd836adee6c9b3636), LL(0xa2a6590451ffa6a6), LL(0x6fd2debdb90cd2d2), LL(0xf3f5fb06f70ef5f5),
+ LL(0xf979ef80f2967979), LL(0xa16f5fcede306f6f), LL(0x7e91fcef3f6d9191), LL(0x5552aa07a4f85252),
+ LL(0x9d6027fdc0476060), LL(0xcabc89766535bcbc), LL(0x569baccd2b379b9b), LL(0x028e048c018a8e8e),
+ LL(0xb6a371155bd2a3a3), LL(0x300c603c186c0c0c), LL(0xf17bff8af6847b7b), LL(0xd435b5e16a803535),
+ LL(0x741de8693af51d1d), LL(0xa7e05347ddb3e0e0), LL(0x7bd7f6acb321d7d7), LL(0x2fc25eed999cc2c2),
+ LL(0xb82e6d965c432e2e), LL(0x314b627a96294b4b), LL(0xdffea321e15dfefe), LL(0x41578216aed55757),
+ LL(0x5415a8412abd1515), LL(0xc1779fb6eee87777), LL(0xdc37a5eb6e923737), LL(0xb3e57b56d79ee5e5),
+ LL(0x469f8cd923139f9f), LL(0xe7f0d317fd23f0f0), LL(0x354a6a7f94204a4a), LL(0x4fda9e95a944dada),
+ LL(0x7d58fa25b0a25858), LL(0x03c906ca8fcfc9c9), LL(0xa429558d527c2929), LL(0x280a5022145a0a0a),
+ LL(0xfeb1e14f7f50b1b1), LL(0xbaa0691a5dc9a0a0), LL(0xb16b7fdad6146b6b), LL(0x2e855cab17d98585),
+ LL(0xcebd8173673cbdbd), LL(0x695dd234ba8f5d5d), LL(0x4010805020901010), LL(0xf7f4f303f507f4f4),
+ LL(0x0bcb16c08bddcbcb), LL(0xf83eedc67cd33e3e), LL(0x140528110a2d0505), LL(0x81671fe6ce786767),
+ LL(0xb7e47353d597e4e4), LL(0x9c2725bb4e022727), LL(0x1941325882734141), LL(0x168b2c9d0ba78b8b),
+ LL(0xa6a7510153f6a7a7), LL(0xe97dcf94fab27d7d), LL(0x6e95dcfb37499595), LL(0x47d88e9fad56d8d8),
+ LL(0xcbfb8b30eb70fbfb), LL(0x9fee2371c1cdeeee), LL(0xed7cc791f8bb7c7c), LL(0x856617e3cc716666),
+ LL(0x53dda68ea77bdddd), LL(0x5c17b84b2eaf1717), LL(0x014702468e454747), LL(0x429e84dc211a9e9e),
+ LL(0x0fca1ec589d4caca), LL(0xb42d75995a582d2d), LL(0xc6bf9179632ebfbf), LL(0x1c07381b0e3f0707),
+ LL(0x8ead012347acadad), LL(0x755aea2fb4b05a5a), LL(0x36836cb51bef8383), LL(0xcc3385ff66b63333),
+ LL(0x91633ff2c65c6363), LL(0x0802100a04120202), LL(0x92aa39384993aaaa), LL(0xd971afa8e2de7171),
+ LL(0x07c80ecf8dc6c8c8), LL(0x6419c87d32d11919), LL(0x39497270923b4949), LL(0x43d9869aaf5fd9d9),
+ LL(0xeff2c31df931f2f2), LL(0xabe34b48dba8e3e3), LL(0x715be22ab6b95b5b), LL(0x1a8834920dbc8888),
+ LL(0x529aa4c8293e9a9a), LL(0x98262dbe4c0b2626), LL(0xc8328dfa64bf3232), LL(0xfab0e94a7d59b0b0),
+ LL(0x83e91b6acff2e9e9), LL(0x3c0f78331e770f0f), LL(0x73d5e6a6b733d5d5), LL(0x3a8074ba1df48080),
+ LL(0xc2be997c6127bebe), LL(0x13cd26de87ebcdcd), LL(0xd034bde468893434), LL(0x3d487a7590324848),
+ LL(0xdbffab24e354ffff), LL(0xf57af78ff48d7a7a), LL(0x7a90f4ea3d649090), LL(0x615fc23ebe9d5f5f),
+ LL(0x80201da0403d2020), LL(0xbd6867d5d00f6868), LL(0x681ad07234ca1a1a), LL(0x82ae192c41b7aeae),
+ LL(0xeab4c95e757db4b4), LL(0x4d549a19a8ce5454), LL(0x7693ece53b7f9393), LL(0x88220daa442f2222),
+ LL(0x8d6407e9c8636464), LL(0xe3f1db12ff2af1f1), LL(0xd173bfa2e6cc7373), LL(0x4812905a24821212),
+ LL(0x1d403a5d807a4040), LL(0x2008402810480808), LL(0x2bc356e89b95c3c3), LL(0x97ec337bc5dfecec),
+ LL(0x4bdb9690ab4ddbdb), LL(0xbea1611f5fc0a1a1), LL(0x0e8d1c8307918d8d), LL(0xf43df5c97ac83d3d),
+ LL(0x6697ccf1335b9797), LL(0x0000000000000000), LL(0x1bcf36d483f9cfcf), LL(0xac2b4587566e2b2b),
+ LL(0xc57697b3ece17676), LL(0x328264b019e68282), LL(0x7fd6fea9b128d6d6), LL(0x6c1bd87736c31b1b),
+ LL(0xeeb5c15b7774b5b5), LL(0x86af112943beafaf), LL(0xb56a77dfd41d6a6a), LL(0x5d50ba0da0ea5050),
+ LL(0x0945124c8a574545), LL(0xebf3cb18fb38f3f3), LL(0xc0309df060ad3030), LL(0x9bef2b74c3c4efef),
+ LL(0xfc3fe5c37eda3f3f), LL(0x4955921caac75555), LL(0xb2a2791059dba2a2), LL(0x8fea0365c9e9eaea),
+ LL(0x89650fecca6a6565), LL(0xd2bab9686903baba), LL(0xbc2f65935e4a2f2f), LL(0x27c04ee79d8ec0c0),
+ LL(0x5fdebe81a160dede), LL(0x701ce06c38fc1c1c), LL(0xd3fdbb2ee746fdfd), LL(0x294d52649a1f4d4d),
+ LL(0x7292e4e039769292), LL(0xc9758fbceafa7575), LL(0x1806301e0c360606), LL(0x128a249809ae8a8a),
+ LL(0xf2b2f940794bb2b2), LL(0xbfe66359d185e6e6), LL(0x380e70361c7e0e0e), LL(0x7c1ff8633ee71f1f),
+ LL(0x956237f7c4556262), LL(0x77d4eea3b53ad4d4), LL(0x9aa829324d81a8a8), LL(0x6296c4f431529696),
+ LL(0xc3f99b3aef62f9f9), LL(0x33c566f697a3c5c5), LL(0x942535b14a102525), LL(0x7959f220b2ab5959),
+ LL(0x2a8454ae15d08484), LL(0xd572b7a7e4c57272), LL(0xe439d5dd72ec3939), LL(0x2d4c5a6198164c4c),
+ LL(0x655eca3bbc945e5e), LL(0xfd78e785f09f7878), LL(0xe038ddd870e53838), LL(0x0a8c148605988c8c),
+ LL(0x63d1c6b2bf17d1d1), LL(0xaea5410b57e4a5a5), LL(0xafe2434dd9a1e2e2), LL(0x99612ff8c24e6161),
+ LL(0xf6b3f1457b42b3b3), LL(0x842115a542342121), LL(0x4a9c94d625089c9c), LL(0x781ef0663cee1e1e),
+ LL(0x1143225286614343), LL(0x3bc776fc93b1c7c7), LL(0xd7fcb32be54ffcfc), LL(0x1004201408240404),
+ LL(0x5951b208a2e35151), LL(0x5e99bcc72f259999), LL(0xa96d4fc4da226d6d), LL(0x340d68391a650d0d),
+ LL(0xcffa8335e979fafa), LL(0x5bdfb684a369dfdf), LL(0xe57ed79bfca97e7e), LL(0x90243db448192424),
+ LL(0xec3bc5d776fe3b3b), LL(0x96ab313d4b9aabab), LL(0x1fce3ed181f0cece), LL(0x4411885522991111),
+ LL(0x068f0c8903838f8f), LL(0x254e4a6b9c044e4e), LL(0xe6b7d1517366b7b7), LL(0x8beb0b60cbe0ebeb),
+ LL(0xf03cfdcc78c13c3c), LL(0x3e817cbf1ffd8181), LL(0x6a94d4fe35409494), LL(0xfbf7eb0cf31cf7f7),
+ LL(0xdeb9a1676f18b9b9), LL(0x4c13985f268b1313), LL(0xb02c7d9c58512c2c), LL(0x6bd3d6b8bb05d3d3),
+ LL(0xbbe76b5cd38ce7e7), LL(0xa56e57cbdc396e6e), LL(0x37c46ef395aac4c4), LL(0x0c03180f061b0303),
+ LL(0x45568a13acdc5656), LL(0x0d441a49885e4444), LL(0xe17fdf9efea07f7f), LL(0x9ea921374f88a9a9),
+ LL(0xa82a4d8254672a2a), LL(0xd6bbb16d6b0abbbb), LL(0x23c146e29f87c1c1), LL(0x5153a202a6f15353),
+ LL(0x57dcae8ba572dcdc), LL(0x2c0b582716530b0b), LL(0x4e9d9cd327019d9d), LL(0xad6c47c1d82b6c6c),
+ LL(0xc43195f562a43131), LL(0xcd7487b9e8f37474), LL(0xfff6e309f115f6f6), LL(0x05460a438c4c4646),
+ LL(0x8aac092645a5acac), LL(0x1e893c970fb58989), LL(0x5014a04428b41414), LL(0xa3e15b42dfbae1e1),
+ LL(0x5816b04e2ca61616), LL(0xe83acdd274f73a3a), LL(0xb9696fd0d2066969), LL(0x2409482d12410909),
+ LL(0xdd70a7ade0d77070), LL(0xe2b6d954716fb6b6), LL(0x67d0ceb7bd1ed0d0), LL(0x93ed3b7ec7d6eded),
+ LL(0x17cc2edb85e2cccc), LL(0x15422a5784684242), LL(0x5a98b4c22d2c9898), LL(0xaaa4490e55eda4a4),
+ LL(0xa0285d8850752828), LL(0x6d5cda31b8865c5c), LL(0xc7f8933fed6bf8f8), LL(0x228644a411c28686),
+
+ LL(0x186018c07830d818), LL(0x238c2305af462623), LL(0xc63fc67ef991b8c6), LL(0xe887e8136fcdfbe8),
+ LL(0x8726874ca113cb87), LL(0xb8dab8a9626d11b8), LL(0x0104010805020901), LL(0x4f214f426e9e0d4f),
+ LL(0x36d836adee6c9b36), LL(0xa6a2a6590451ffa6), LL(0xd26fd2debdb90cd2), LL(0xf5f3f5fb06f70ef5),
+ LL(0x79f979ef80f29679), LL(0x6fa16f5fcede306f), LL(0x917e91fcef3f6d91), LL(0x525552aa07a4f852),
+ LL(0x609d6027fdc04760), LL(0xbccabc89766535bc), LL(0x9b569baccd2b379b), LL(0x8e028e048c018a8e),
+ LL(0xa3b6a371155bd2a3), LL(0x0c300c603c186c0c), LL(0x7bf17bff8af6847b), LL(0x35d435b5e16a8035),
+ LL(0x1d741de8693af51d), LL(0xe0a7e05347ddb3e0), LL(0xd77bd7f6acb321d7), LL(0xc22fc25eed999cc2),
+ LL(0x2eb82e6d965c432e), LL(0x4b314b627a96294b), LL(0xfedffea321e15dfe), LL(0x5741578216aed557),
+ LL(0x155415a8412abd15), LL(0x77c1779fb6eee877), LL(0x37dc37a5eb6e9237), LL(0xe5b3e57b56d79ee5),
+ LL(0x9f469f8cd923139f), LL(0xf0e7f0d317fd23f0), LL(0x4a354a6a7f94204a), LL(0xda4fda9e95a944da),
+ LL(0x587d58fa25b0a258), LL(0xc903c906ca8fcfc9), LL(0x29a429558d527c29), LL(0x0a280a5022145a0a),
+ LL(0xb1feb1e14f7f50b1), LL(0xa0baa0691a5dc9a0), LL(0x6bb16b7fdad6146b), LL(0x852e855cab17d985),
+ LL(0xbdcebd8173673cbd), LL(0x5d695dd234ba8f5d), LL(0x1040108050209010), LL(0xf4f7f4f303f507f4),
+ LL(0xcb0bcb16c08bddcb), LL(0x3ef83eedc67cd33e), LL(0x05140528110a2d05), LL(0x6781671fe6ce7867),
+ LL(0xe4b7e47353d597e4), LL(0x279c2725bb4e0227), LL(0x4119413258827341), LL(0x8b168b2c9d0ba78b),
+ LL(0xa7a6a7510153f6a7), LL(0x7de97dcf94fab27d), LL(0x956e95dcfb374995), LL(0xd847d88e9fad56d8),
+ LL(0xfbcbfb8b30eb70fb), LL(0xee9fee2371c1cdee), LL(0x7ced7cc791f8bb7c), LL(0x66856617e3cc7166),
+ LL(0xdd53dda68ea77bdd), LL(0x175c17b84b2eaf17), LL(0x47014702468e4547), LL(0x9e429e84dc211a9e),
+ LL(0xca0fca1ec589d4ca), LL(0x2db42d75995a582d), LL(0xbfc6bf9179632ebf), LL(0x071c07381b0e3f07),
+ LL(0xad8ead012347acad), LL(0x5a755aea2fb4b05a), LL(0x8336836cb51bef83), LL(0x33cc3385ff66b633),
+ LL(0x6391633ff2c65c63), LL(0x020802100a041202), LL(0xaa92aa39384993aa), LL(0x71d971afa8e2de71),
+ LL(0xc807c80ecf8dc6c8), LL(0x196419c87d32d119), LL(0x4939497270923b49), LL(0xd943d9869aaf5fd9),
+ LL(0xf2eff2c31df931f2), LL(0xe3abe34b48dba8e3), LL(0x5b715be22ab6b95b), LL(0x881a8834920dbc88),
+ LL(0x9a529aa4c8293e9a), LL(0x2698262dbe4c0b26), LL(0x32c8328dfa64bf32), LL(0xb0fab0e94a7d59b0),
+ LL(0xe983e91b6acff2e9), LL(0x0f3c0f78331e770f), LL(0xd573d5e6a6b733d5), LL(0x803a8074ba1df480),
+ LL(0xbec2be997c6127be), LL(0xcd13cd26de87ebcd), LL(0x34d034bde4688934), LL(0x483d487a75903248),
+ LL(0xffdbffab24e354ff), LL(0x7af57af78ff48d7a), LL(0x907a90f4ea3d6490), LL(0x5f615fc23ebe9d5f),
+ LL(0x2080201da0403d20), LL(0x68bd6867d5d00f68), LL(0x1a681ad07234ca1a), LL(0xae82ae192c41b7ae),
+ LL(0xb4eab4c95e757db4), LL(0x544d549a19a8ce54), LL(0x937693ece53b7f93), LL(0x2288220daa442f22),
+ LL(0x648d6407e9c86364), LL(0xf1e3f1db12ff2af1), LL(0x73d173bfa2e6cc73), LL(0x124812905a248212),
+ LL(0x401d403a5d807a40), LL(0x0820084028104808), LL(0xc32bc356e89b95c3), LL(0xec97ec337bc5dfec),
+ LL(0xdb4bdb9690ab4ddb), LL(0xa1bea1611f5fc0a1), LL(0x8d0e8d1c8307918d), LL(0x3df43df5c97ac83d),
+ LL(0x976697ccf1335b97), LL(0x0000000000000000), LL(0xcf1bcf36d483f9cf), LL(0x2bac2b4587566e2b),
+ LL(0x76c57697b3ece176), LL(0x82328264b019e682), LL(0xd67fd6fea9b128d6), LL(0x1b6c1bd87736c31b),
+ LL(0xb5eeb5c15b7774b5), LL(0xaf86af112943beaf), LL(0x6ab56a77dfd41d6a), LL(0x505d50ba0da0ea50),
+ LL(0x450945124c8a5745), LL(0xf3ebf3cb18fb38f3), LL(0x30c0309df060ad30), LL(0xef9bef2b74c3c4ef),
+ LL(0x3ffc3fe5c37eda3f), LL(0x554955921caac755), LL(0xa2b2a2791059dba2), LL(0xea8fea0365c9e9ea),
+ LL(0x6589650fecca6a65), LL(0xbad2bab9686903ba), LL(0x2fbc2f65935e4a2f), LL(0xc027c04ee79d8ec0),
+ LL(0xde5fdebe81a160de), LL(0x1c701ce06c38fc1c), LL(0xfdd3fdbb2ee746fd), LL(0x4d294d52649a1f4d),
+ LL(0x927292e4e0397692), LL(0x75c9758fbceafa75), LL(0x061806301e0c3606), LL(0x8a128a249809ae8a),
+ LL(0xb2f2b2f940794bb2), LL(0xe6bfe66359d185e6), LL(0x0e380e70361c7e0e), LL(0x1f7c1ff8633ee71f),
+ LL(0x62956237f7c45562), LL(0xd477d4eea3b53ad4), LL(0xa89aa829324d81a8), LL(0x966296c4f4315296),
+ LL(0xf9c3f99b3aef62f9), LL(0xc533c566f697a3c5), LL(0x25942535b14a1025), LL(0x597959f220b2ab59),
+ LL(0x842a8454ae15d084), LL(0x72d572b7a7e4c572), LL(0x39e439d5dd72ec39), LL(0x4c2d4c5a6198164c),
+ LL(0x5e655eca3bbc945e), LL(0x78fd78e785f09f78), LL(0x38e038ddd870e538), LL(0x8c0a8c148605988c),
+ LL(0xd163d1c6b2bf17d1), LL(0xa5aea5410b57e4a5), LL(0xe2afe2434dd9a1e2), LL(0x6199612ff8c24e61),
+ LL(0xb3f6b3f1457b42b3), LL(0x21842115a5423421), LL(0x9c4a9c94d625089c), LL(0x1e781ef0663cee1e),
+ LL(0x4311432252866143), LL(0xc73bc776fc93b1c7), LL(0xfcd7fcb32be54ffc), LL(0x0410042014082404),
+ LL(0x515951b208a2e351), LL(0x995e99bcc72f2599), LL(0x6da96d4fc4da226d), LL(0x0d340d68391a650d),
+ LL(0xfacffa8335e979fa), LL(0xdf5bdfb684a369df), LL(0x7ee57ed79bfca97e), LL(0x2490243db4481924),
+ LL(0x3bec3bc5d776fe3b), LL(0xab96ab313d4b9aab), LL(0xce1fce3ed181f0ce), LL(0x1144118855229911),
+ LL(0x8f068f0c8903838f), LL(0x4e254e4a6b9c044e), LL(0xb7e6b7d1517366b7), LL(0xeb8beb0b60cbe0eb),
+ LL(0x3cf03cfdcc78c13c), LL(0x813e817cbf1ffd81), LL(0x946a94d4fe354094), LL(0xf7fbf7eb0cf31cf7),
+ LL(0xb9deb9a1676f18b9), LL(0x134c13985f268b13), LL(0x2cb02c7d9c58512c), LL(0xd36bd3d6b8bb05d3),
+ LL(0xe7bbe76b5cd38ce7), LL(0x6ea56e57cbdc396e), LL(0xc437c46ef395aac4), LL(0x030c03180f061b03),
+ LL(0x5645568a13acdc56), LL(0x440d441a49885e44), LL(0x7fe17fdf9efea07f), LL(0xa99ea921374f88a9),
+ LL(0x2aa82a4d8254672a), LL(0xbbd6bbb16d6b0abb), LL(0xc123c146e29f87c1), LL(0x535153a202a6f153),
+ LL(0xdc57dcae8ba572dc), LL(0x0b2c0b582716530b), LL(0x9d4e9d9cd327019d), LL(0x6cad6c47c1d82b6c),
+ LL(0x31c43195f562a431), LL(0x74cd7487b9e8f374), LL(0xf6fff6e309f115f6), LL(0x4605460a438c4c46),
+ LL(0xac8aac092645a5ac), LL(0x891e893c970fb589), LL(0x145014a04428b414), LL(0xe1a3e15b42dfbae1),
+ LL(0x165816b04e2ca616), LL(0x3ae83acdd274f73a), LL(0x69b9696fd0d20669), LL(0x092409482d124109),
+ LL(0x70dd70a7ade0d770), LL(0xb6e2b6d954716fb6), LL(0xd067d0ceb7bd1ed0), LL(0xed93ed3b7ec7d6ed),
+ LL(0xcc17cc2edb85e2cc), LL(0x4215422a57846842), LL(0x985a98b4c22d2c98), LL(0xa4aaa4490e55eda4),
+ LL(0x28a0285d88507528), LL(0x5c6d5cda31b8865c), LL(0xf8c7f8933fed6bf8), LL(0x86228644a411c286),
+
LL(0x1823c6e887b8014f),
LL(0x36a6d2f5796f9152),
LL(0x60bc9b8ea30c7b35),
@@ -374,7 +636,6 @@ void WhirlpoolTransform(uint64 *digest, const uint64 *block)
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
if (HasISSE())
{
- // MMX version has the same structure as C version below
#ifdef __GNUC__
#if CRYPTOPP_BOOL_X64
uint64 workspace[16];
@@ -397,7 +658,7 @@ void WhirlpoolTransform(uint64 *digest, const uint64 *block)
AS2( and esp, -16)
AS2( sub esp, 16*8)
AS_PUSH_IF86( ax)
-
+
#if CRYPTOPP_BOOL_X86
#define SSE2_workspace esp+WORD_SZ
#elif CRYPTOPP_BOOL_X32
@@ -511,7 +772,7 @@ void WhirlpoolTransform(uint64 *digest, const uint64 *block)
KSH(2, 3, 2, 1, 0, 7)
KSH(2, 7, 6, 5, 4, 3)
- AS2( pxor mm0, [AS_REG_6 + 8*1024 + WORD_REG(si)*8])
+ AS2( pxor mm0, [AS_REG_6 + 16*1024 + WORD_REG(si)*8])
AS2( movq [SSE2_workspace], mm0)
TSL(0, 4, 3, 2, 1, 0)
@@ -570,117 +831,35 @@ void WhirlpoolTransform(uint64 *digest, const uint64 *block)
else
#endif // #ifdef CRYPTOPP_X86_ASM_AVAILABLE
{
- uint64 s[8]; // the cipher state
- uint64 k[8]; // the round key
- int r;
- uint64 w0 = 0, w1 = 0, w2 = 0, w3 = 0, w4 = 0, w5 = 0, w6 = 0, w7 = 0; // temporary storage
-
- // Compute and apply K^0 to the cipher state
- // Also apply part of the Miyaguchi-Preneel compression function
- for (r=0; r<8; r++)
- digest[r] = s[r] = block[r] ^ (k[r] = digest[r]);
-
-#define KSL(op, i, a, b, c, d) \
- t = (uint32)k[i];\
- w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : 0);\
- t >>= 8;\
- w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : 0);\
- t >>= 8;\
- w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : 0);\
- t >>= 8;\
- w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : 0);
-
-#define KSH(op, i, a, b, c, d) \
- t = (uint32)(k[(i+4)%8]>>32);\
- w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : rotr64(w##a, 32));\
- if (op==2) k[a] = w##a;\
- t >>= 8;\
- w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : rotr64(w##b, 32));\
- if (op==2) k[b] = w##b;\
- t >>= 8;\
- w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : rotr64(w##c, 32));\
- if (op==2) k[c] = w##c;\
- t >>= 8;\
- w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : rotr64(w##d, 32));\
- if (op==2) k[d] = w##d;\
-
-#define TSL(op, i, a, b, c, d) \
- t = (uint32)s[i];\
- w##a = Whirlpool_C[3*256 + (byte)t] ^ (op ? w##a : 0);\
- t >>= 8;\
- w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : 0);\
- t >>= 8;\
- w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : 0);\
- t >>= 8;\
- w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : 0);
-
-#define TSH_OP(op, a, b) \
- w##a = Whirlpool_C[b*256 + (byte)t] ^ (op ? w##a : rotr64(w##a, 32) ^ k[a]);\
- if (op==2) s[a] = w##a;\
- if (op==3) digest[a] ^= w##a;\
-
-#define TSH(op, i, a, b, c, d) \
- t = (uint32)(s[(i+4)%8]>>32);\
- TSH_OP(op, a, 3);\
- t >>= 8;\
- TSH_OP(op, b, 2);\
- t >>= 8;\
- TSH_OP(op, c, 1);\
- t >>= 8;\
- TSH_OP(op, d, 0);\
-
- // Iterate over all rounds:
- r=0;
- while (1)
- {
- uint32 t = 0;
-
- KSL(0, 4, 3, 2, 1, 0)
- KSL(0, 0, 7, 6, 5, 4)
- KSL(1, 1, 0, 7, 6, 5)
- KSL(1, 2, 1, 0, 7, 6)
- KSL(1, 3, 2, 1, 0, 7)
- KSL(1, 5, 4, 3, 2, 1)
- KSL(1, 6, 5, 4, 3, 2)
- KSL(1, 7, 6, 5, 4, 3)
- KSH(0, 0, 7, 6, 5, 4)
- KSH(0, 4, 3, 2, 1, 0)
- KSH(1, 1, 0, 7, 6, 5)
- KSH(1, 2, 1, 0, 7, 6)
- KSH(1, 5, 4, 3, 2, 1)
- KSH(1, 6, 5, 4, 3, 2)
- KSH(2, 3, 2, 1, 0, 7)
- KSH(2, 7, 6, 5, 4, 3)
-
- k[0] ^= Whirlpool_C[1024+r];
-
- TSL(0, 4, 3, 2, 1, 0)
- TSL(0, 0, 7, 6, 5, 4)
- TSL(1, 1, 0, 7, 6, 5)
- TSL(1, 2, 1, 0, 7, 6)
- TSL(1, 3, 2, 1, 0, 7)
- TSL(1, 5, 4, 3, 2, 1)
- TSL(1, 6, 5, 4, 3, 2)
- TSL(1, 7, 6, 5, 4, 3)
- TSH(0, 0, 7, 6, 5, 4)
- TSH(0, 4, 3, 2, 1, 0)
- TSH(1, 1, 0, 7, 6, 5)
- TSH(1, 2, 1, 0, 7, 6)
- TSH(1, 5, 4, 3, 2, 1)
- TSH(1, 6, 5, 4, 3, 2)
-
- if (++r < R)
- {
- TSH(2, 3, 2, 1, 0, 7)
- TSH(2, 7, 6, 5, 4, 3)
- }
- else
- {
- TSH(3, 3, 2, 1, 0, 7)
- TSH(3, 7, 6, 5, 4, 3)
- break;
- }
- }
+ union { unsigned char ch[64]; unsigned long long ll[8]; } K, state;
+ unsigned long long L[8];
+ int r, i;
+
+ i = 0; do state.ll[i] = (K.ll[i] = digest[i]) ^ (block)[i]; while (++i < 8);
+
+ r = 0; do {
+ L[0] = Whirlpool_C[0*256 + K.ch[0 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[7 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[6 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[5 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[4 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[3 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[2 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[1 * 8 + 0]] ^ Whirlpool_C[2048 + r];
+ L[1] = Whirlpool_C[0*256 + K.ch[1 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[0 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[7 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[6 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[5 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[4 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[3 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[2 * 8 + 0]];
+ L[2] = Whirlpool_C[0*256 + K.ch[2 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[1 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[0 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[7 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[6 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[5 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[4 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[3 * 8 + 0]];
+ L[3] = Whirlpool_C[0*256 + K.ch[3 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[2 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[1 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[0 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[7 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[6 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[5 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[4 * 8 + 0]];
+ L[4] = Whirlpool_C[0*256 + K.ch[4 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[3 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[2 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[1 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[0 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[7 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[6 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[5 * 8 + 0]];
+ L[5] = Whirlpool_C[0*256 + K.ch[5 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[4 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[3 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[2 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[1 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[0 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[7 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[6 * 8 + 0]];
+ L[6] = Whirlpool_C[0*256 + K.ch[6 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[5 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[4 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[3 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[2 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[1 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[0 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[7 * 8 + 0]];
+ L[7] = Whirlpool_C[0*256 + K.ch[7 * 8 + 7]] ^ Whirlpool_C[1*256 + K.ch[6 * 8 + 6]] ^ Whirlpool_C[2*256 + K.ch[5 * 8 + 5]] ^ Whirlpool_C[3*256 + K.ch[4 * 8 + 4]] ^ Whirlpool_C[4*256 + K.ch[3 * 8 + 3]] ^ Whirlpool_C[5*256 + K.ch[2 * 8 + 2]] ^ Whirlpool_C[6*256 + K.ch[1 * 8 + 1]] ^ Whirlpool_C[7*256 + K.ch[0 * 8 + 0]];
+
+ L[0] = (K.ll[0] = L[0]) ^ Whirlpool_C[0*256 + state.ch[0 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[7 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[6 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[5 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[4 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[3 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[2 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[1 * 8 + 0]];
+ L[1] = (K.ll[1] = L[1]) ^ Whirlpool_C[0*256 + state.ch[1 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[0 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[7 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[6 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[5 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[4 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[3 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[2 * 8 + 0]];
+ L[2] = (K.ll[2] = L[2]) ^ Whirlpool_C[0*256 + state.ch[2 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[1 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[0 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[7 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[6 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[5 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[4 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[3 * 8 + 0]];
+ L[3] = (K.ll[3] = L[3]) ^ Whirlpool_C[0*256 + state.ch[3 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[2 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[1 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[0 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[7 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[6 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[5 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[4 * 8 + 0]];
+ L[4] = (K.ll[4] = L[4]) ^ Whirlpool_C[0*256 + state.ch[4 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[3 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[2 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[1 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[0 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[7 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[6 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[5 * 8 + 0]];
+ L[5] = (K.ll[5] = L[5]) ^ Whirlpool_C[0*256 + state.ch[5 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[4 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[3 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[2 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[1 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[0 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[7 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[6 * 8 + 0]];
+ L[6] = (K.ll[6] = L[6]) ^ Whirlpool_C[0*256 + state.ch[6 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[5 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[4 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[3 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[2 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[1 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[0 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[7 * 8 + 0]];
+ L[7] = (K.ll[7] = L[7]) ^ Whirlpool_C[0*256 + state.ch[7 * 8 + 7]] ^ Whirlpool_C[1*256 + state.ch[6 * 8 + 6]] ^ Whirlpool_C[2*256 + state.ch[5 * 8 + 5]] ^ Whirlpool_C[3*256 + state.ch[4 * 8 + 4]] ^ Whirlpool_C[4*256 + state.ch[3 * 8 + 3]] ^ Whirlpool_C[5*256 + state.ch[2 * 8 + 2]] ^ Whirlpool_C[6*256 + state.ch[1 * 8 + 1]] ^ Whirlpool_C[7*256 + state.ch[0 * 8 + 0]];
+
+ memcpy(state.ll, L, sizeof(L));
+ } while (++r < 10);
+
+ i = 0; do digest[i] ^= L[i] ^ (block)[i]; while (++i < 8);
}
}
@@ -721,11 +900,11 @@ void WHIRLPOOL_init(WHIRLPOOL_CTX * const ctx) {
* This method maintains the invariant: bufferBits < DIGESTBITS
*/
void WHIRLPOOL_add(const unsigned char * input,
- unsigned __int32 sourceBits,
- WHIRLPOOL_CTX * const ctx)
+ unsigned __int32 sourceBytes,
+ WHIRLPOOL_CTX * const ctx)
{
uint64 num, oldCountLo = ctx->countLo, oldCountHi = ctx->countHi;
- uint64 len = sourceBits >> 3;
+ uint64 len = sourceBytes;
if ((ctx->countLo = oldCountLo + (uint64)len) < oldCountLo)
ctx->countHi++; // carry from low to high
@@ -734,7 +913,7 @@ void WHIRLPOOL_add(const unsigned char * input,
else
{
uint64* dataBuf = ctx->data;
- byte* data = (byte *)dataBuf;
+ byte* data = (byte *)dataBuf;
num = oldCountLo & 63;
if (num != 0) // process left over data
@@ -786,11 +965,11 @@ void WHIRLPOOL_add(const unsigned char * input,
/**
* Get the hash value from the hashing state.
- *
+ *
* This method uses the invariant: bufferBits < DIGESTBITS
*/
void WHIRLPOOL_finalize(WHIRLPOOL_CTX * const ctx,
- unsigned char * result)
+ unsigned char * result)
{
unsigned int num = ctx->countLo & 63;
uint64* dataBuf = ctx->data;
diff --git a/src/Crypto/Whirlpool.h b/src/Crypto/Whirlpool.h
index 9e771935..fe618a9b 100644
--- a/src/Crypto/Whirlpool.h
+++ b/src/Crypto/Whirlpool.h
@@ -16,7 +16,7 @@ typedef struct WHIRLPOOL_CTX {
extern "C" {
#endif
-void WHIRLPOOL_add(const unsigned char * source, unsigned __int32 sourceBits, WHIRLPOOL_CTX * const ctx);
+void WHIRLPOOL_add(const unsigned char * source, unsigned __int32 sourceBytes, WHIRLPOOL_CTX * const ctx);
void WHIRLPOOL_finalize(WHIRLPOOL_CTX* const ctx, unsigned char * result);
void WHIRLPOOL_init(WHIRLPOOL_CTX* const ctx);
diff --git a/src/Crypto/config.h b/src/Crypto/config.h
index da9276db..d3638121 100644
--- a/src/Crypto/config.h
+++ b/src/Crypto/config.h
@@ -38,6 +38,10 @@
#endif
#endif
+#if defined(_MSC_VER) && (_MSC_VER > 1200)
+ #define CRYPTOPP_MSVC6PP_OR_LATER
+#endif
+
#ifndef CRYPTOPP_ALIGN_DATA
#if defined(_MSC_VER)
#define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
@@ -172,6 +176,12 @@
#endif
#endif
+// this version of the macro is fastest on Pentium 3 and Pentium 4 with MSVC 6 SP5 w/ Processor Pack
#define GETBYTE(x, y) (unsigned int)((unsigned char)((x)>>(8*(y))))
+// these may be faster on other CPUs/compilers
+// #define GETBYTE(x, y) (unsigned int)(((x)>>(8*(y)))&255)
+// #define GETBYTE(x, y) (((byte *)&(x))[y])
+
+#define CRYPTOPP_GET_BYTE_AS_BYTE(x, y) ((byte)((x)>>(8*(y))))
#endif
diff --git a/src/Crypto/cpu.c b/src/Crypto/cpu.c
index 3de87069..c358088d 100644
--- a/src/Crypto/cpu.c
+++ b/src/Crypto/cpu.c
@@ -12,10 +12,6 @@
#include <setjmp.h>
#endif
-#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
-#include <emmintrin.h>
-#endif
-
#ifdef CRYPTOPP_CPUID_AVAILABLE
#if _MSC_VER >= 1400 && CRYPTOPP_BOOL_X64
@@ -42,6 +38,12 @@ static void SigIllHandlerCPUID(int p)
longjmp(s_jmpNoCPUID, 1);
}
+static jmp_buf s_jmpNoAESNI;
+static void SigIllHandlerAESNI(int p)
+{
+ longjmp(s_jmpNoAESNI, 1);
+}
+
#if CRYPTOPP_BOOL_X64 == 0
static jmp_buf s_jmpNoSSE2;
static void SigIllHandlerSSE2(int p)
@@ -58,8 +60,10 @@ static void SigIllHandlerSSE2(int p)
int CpuId(uint32 input, uint32 output[4])
{
#ifdef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
+#ifndef _UEFI
__try
{
+#endif
__asm
{
mov eax, input
@@ -71,11 +75,13 @@ int CpuId(uint32 input, uint32 output[4])
mov [edi+8], ecx
mov [edi+12], edx
}
- }
- __except (EXCEPTION_EXECUTE_HANDLER)
+#ifndef _UEFI
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER)
{
return 0;
}
+#endif
// function 0 returns the highest basic function understood in EAX
if(input == 0)
@@ -121,22 +127,34 @@ static int TrySSE2()
{
#if CRYPTOPP_BOOL_X64
return 1;
-#elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY)
+#elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) && !defined(_UEFI)
+ volatile int result = 1;
+#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ if (NT_SUCCESS (KeSaveFloatingPointState (&floatingPointState)))
+ {
+#endif
__try
{
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE
AS2(por xmm0, xmm0) // executing SSE2 instruction
#elif CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
__m128i x = _mm_setzero_si128();
- return _mm_cvtsi128_si32(x) == 0 ? 1 : 0;
+ result = _mm_cvtsi128_si32(x) == 0 ? 1 : 0;
#endif
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
+ result = 0;
+ }
+#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64)
+ KeRestoreFloatingPointState (&floatingPointState);
+ }
+ else
return 0;
- }
- return 1;
-#else
+#endif
+ return result;
+#elif !defined(_UEFI)
// longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24
// http://stackoverflow.com/q/7721854
@@ -160,11 +178,14 @@ static int TrySSE2()
signal(SIGILL, oldHandler);
return result;
+#else
+ return 1;
#endif
}
int g_x86DetectionDone = 0;
int g_hasISSE = 0, g_hasSSE2 = 0, g_hasSSSE3 = 0, g_hasMMX = 0, g_hasAESNI = 0, g_hasCLMUL = 0, g_isP4 = 0;
+int g_hasAVX = 0, g_hasSSE42 = 0, g_hasSSE41 = 0;
uint32 g_cacheLineSize = CRYPTOPP_L1_CACHE_LINE_SIZE;
VC_INLINE int IsIntel(const uint32 output[4])
@@ -183,6 +204,79 @@ VC_INLINE int IsAMD(const uint32 output[4])
(output[3] /*EDX*/ == 0x444D4163);
}
+#if !defined (_UEFI) && ((defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE)
+
+static int TryAESNI ()
+{
+ volatile int result = 0;
+#ifdef _MSC_VER
+ __try
+#else
+ SigHandler oldHandler = signal(SIGILL, SigIllHandlerAESNI);
+ if (oldHandler == SIG_ERR)
+ return 0;
+
+ if (setjmp(s_jmpNoAESNI))
+ result = 0;
+ else
+#endif
+ {
+ __m128i block, subkey, ciphered;
+ // perform AES round.
+ block = _mm_setr_epi32(0x11223344,0x55667788,0x99AABBCC,0xDDEEFF00);
+ subkey = _mm_setr_epi32(0xA5A5A5A5,0xA5A5A5A5,0x5A5A5A5A,0x5A5A5A5A);
+ ciphered = _mm_aesenc_si128(block, subkey);
+#ifdef _MSC_VER
+ if (ciphered.m128i_u64[0] == LL(0x2f4654b9485061fa) && ciphered.m128i_u64[1] == LL(0xc8b51f1fe1256f99))
+#else
+ if (((uint64_t*)(&ciphered))[0] == LL(0x2f4654b9485061fa) && ((uint64_t*)(&ciphered))[1] == LL(0xc8b51f1fe1256f99))
+#endif
+ result = 1;
+ }
+#ifdef _MSC_VER
+ __except (EXCEPTION_EXECUTE_HANDLER)
+ {
+ // ignore error if AES-NI not supported
+ }
+#else
+ signal(SIGILL, oldHandler);
+#endif
+
+ return result;
+}
+
+static int Detect_MS_HyperV_AES ()
+{
+ int hasAesNI = 0;
+ // when Hyper-V is enabled on older versions of Windows Server (i.e. 2008 R2), the AES-NI capability
+ // gets masked out for all applications, even running on the host.
+ // We try to detect Hyper-V virtual CPU and perform a dummy AES-NI operation to check its real presence
+ uint32 cpuid[4];
+ char HvProductName[13];
+
+ CpuId(0x40000000, cpuid);
+ memcpy (HvProductName, &cpuid[1], 12);
+ HvProductName[12] = 0;
+ if (_stricmp(HvProductName, "Microsoft Hv") == 0)
+ {
+#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ if (NT_SUCCESS (KeSaveFloatingPointState (&floatingPointState)))
+ {
+#endif
+ hasAesNI = TryAESNI ();
+
+#if defined (TC_WINDOWS_DRIVER) && !defined (_WIN64)
+ KeRestoreFloatingPointState (&floatingPointState);
+ }
+#endif
+ }
+
+ return hasAesNI;
+}
+
+#endif
+
void DetectX86Features()
{
uint32 cpuid[4], cpuid1[4];
@@ -194,10 +288,22 @@ void DetectX86Features()
g_hasMMX = (cpuid1[3] & (1 << 23)) != 0;
if ((cpuid1[3] & (1 << 26)) != 0)
g_hasSSE2 = TrySSE2();
+ g_hasAVX = g_hasSSE2 && (cpuid1[2] & (1 << 28));
+ g_hasSSE42 = g_hasSSE2 && (cpuid1[2] & (1 << 20));
+ g_hasSSE41 = g_hasSSE2 && (cpuid1[2] & (1 << 19));
g_hasSSSE3 = g_hasSSE2 && (cpuid1[2] & (1<<9));
g_hasAESNI = g_hasSSE2 && (cpuid1[2] & (1<<25));
g_hasCLMUL = g_hasSSE2 && (cpuid1[2] & (1<<1));
+#if !defined (_UEFI) && ((defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE)
+ // Hypervisor = bit 31 of ECX of CPUID leaf 0x1
+ // reference: http://artemonsecurity.com/vmde.pdf
+ if (!g_hasAESNI && (cpuid1[2] & (1<<31)))
+ {
+ g_hasAESNI = Detect_MS_HyperV_AES ();
+ }
+#endif
+
if ((cpuid1[3] & (1 << 25)) != 0)
g_hasISSE = 1;
else
@@ -228,4 +334,27 @@ void DetectX86Features()
*((volatile int*)&g_x86DetectionDone) = 1;
}
+int is_aes_hw_cpu_supported ()
+{
+ int bHasAESNI = 0;
+ uint32 cpuid[4];
+
+ if (CpuId(1, cpuid))
+ {
+ if (cpuid[2] & (1<<25))
+ bHasAESNI = 1;
+#if !defined (_UEFI) && ((defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE)
+ // Hypervisor = bit 31 of ECX of CPUID leaf 0x1
+ // reference: http://artemonsecurity.com/vmde.pdf
+ if (!bHasAESNI && (cpuid[2] & (1<<31)))
+ {
+ bHasAESNI = Detect_MS_HyperV_AES ();
+ }
+#endif
+ }
+
+ return bHasAESNI;
+}
+
#endif
+
diff --git a/src/Crypto/cpu.h b/src/Crypto/cpu.h
index 44da8cc3..2d26e927 100644
--- a/src/Crypto/cpu.h
+++ b/src/Crypto/cpu.h
@@ -13,30 +13,112 @@
#else
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
+#if defined(TC_WINDOWS_DRIVER) || defined (_UEFI)
+#if defined(__cplusplus)
+extern "C" {
+#endif
+typedef union __declspec(intrin_type) CRYPTOPP_ALIGN_DATA(8) __m64
+{
+ unsigned __int64 m64_u64;
+ float m64_f32[2];
+ __int8 m64_i8[8];
+ __int16 m64_i16[4];
+ __int32 m64_i32[2];
+ __int64 m64_i64;
+ unsigned __int8 m64_u8[8];
+ unsigned __int16 m64_u16[4];
+ unsigned __int32 m64_u32[2];
+} __m64;
+
+typedef union __declspec(intrin_type) CRYPTOPP_ALIGN_DATA(16) __m128 {
+ float m128_f32[4];
+ unsigned __int64 m128_u64[2];
+ __int8 m128_i8[16];
+ __int16 m128_i16[8];
+ __int32 m128_i32[4];
+ __int64 m128_i64[2];
+ unsigned __int8 m128_u8[16];
+ unsigned __int16 m128_u16[8];
+ unsigned __int32 m128_u32[4];
+ } __m128;
+
+typedef union __declspec(intrin_type) CRYPTOPP_ALIGN_DATA(16) __m128i {
+ __int8 m128i_i8[16];
+ __int16 m128i_i16[8];
+ __int32 m128i_i32[4];
+ __int64 m128i_i64[2];
+ unsigned __int8 m128i_u8[16];
+ unsigned __int16 m128i_u16[8];
+ unsigned __int32 m128i_u32[4];
+ unsigned __int64 m128i_u64[2];
+} __m128i;
+
+typedef struct __declspec(intrin_type) CRYPTOPP_ALIGN_DATA(16) __m128d {
+ double m128d_f64[2];
+} __m128d;
+
+#define _MM_SHUFFLE2(x,y) (((x)<<1) | (y))
+
+extern void _m_empty(void);
+extern int _mm_extract_epi16(__m128i _A, int _Imm);
+extern __m128i _mm_load_si128(__m128i const*_P);
+extern __m128i _mm_xor_si128(__m128i _A, __m128i _B);
+extern __m128i _mm_cvtsi64_si128(__int64);
+extern __m128i _mm_unpacklo_epi64(__m128i _A, __m128i _B);
+extern void _mm_store_si128(__m128i *_P, __m128i _B);
+extern __m64 _m_pxor(__m64 _MM1, __m64 _MM2);
+extern __m128i _mm_set_epi64(__m64 _Q1, __m64 _Q0);
+extern __m128i _mm_setr_epi32(int _I0, int _I1, int _I2, int _I3);
+#define _mm_xor_si64 _m_pxor
+#define _mm_empty _m_empty
+#if defined(__cplusplus)
+}
+#endif
+#else
+#include <mmintrin.h>
#include <emmintrin.h>
#endif
+#endif
#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE
#if defined(__SSSE3__) || defined(__INTEL_COMPILER)
-#ifdef TC_WINDOWS_DRIVER
+#if defined(TC_WINDOWS_DRIVER) || defined (_UEFI)
+#if defined(__cplusplus)
+extern "C" {
+#endif
extern __m128i _mm_shuffle_epi8 (__m128i a, __m128i b);
+#if defined(__cplusplus)
+}
+#endif
#else
#include <tmmintrin.h>
#endif
#endif
-#if defined(__SSE4_1__) || defined(__INTEL_COMPILER)
-#ifdef TC_WINDOWS_DRIVER
+#if defined(__SSE4_1__) || defined(__INTEL_COMPILER) || defined(_MSC_VER)
+#if defined(TC_WINDOWS_DRIVER) || defined (_UEFI)
+#if defined(__cplusplus)
+extern "C" {
+#endif
extern int _mm_extract_epi32(__m128i src, const int ndx);
extern __m128i _mm_insert_epi32(__m128i dst, int s, const int ndx);
+#if defined(_M_X64)
+extern __m128i _mm_insert_epi64(__m128i dst, __int64 s, const int ndx);
+#endif
+#if defined(__cplusplus)
+}
+#endif
#else
#include <smmintrin.h>
#endif
#endif
-#if (defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER)
-#ifdef TC_WINDOWS_DRIVER
-extern __m128i _mm_clmulepi64_si128(__m128i v1, __m128i v2,
+#if (defined(__AES__) && defined(__PCLMUL__)) || defined(__INTEL_COMPILER) || CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE
+#if defined(TC_WINDOWS_DRIVER) || defined (_UEFI)
+#if defined(__cplusplus)
+extern "C" {
+#endif
+extern __m128i _mm_clmulepi64_si128(__m128i v1, __m128i v2,
const int imm8);
extern __m128i _mm_aeskeygenassist_si128(__m128i ckey, const int rcon);
extern __m128i _mm_aesimc_si128(__m128i v);
@@ -44,6 +126,9 @@ extern __m128i _mm_aesenc_si128(__m128i v, __m128i rkey);
extern __m128i _mm_aesenclast_si128(__m128i v, __m128i rkey);
extern __m128i _mm_aesdec_si128(__m128i v, __m128i rkey);
extern __m128i _mm_aesdeclast_si128(__m128i v, __m128i rkey);
+#if defined(__cplusplus)
+}
+#endif
#else
#include <wmmintrin.h>
#endif
@@ -52,14 +137,17 @@ extern __m128i _mm_aesdeclast_si128(__m128i v, __m128i rkey);
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64
-#define CRYPTOPP_CPUID_AVAILABLE
-
#if defined(__cplusplus)
extern "C" {
#endif
+#define CRYPTOPP_CPUID_AVAILABLE
+
// these should not be used directly
extern int g_x86DetectionDone;
+extern int g_hasAVX;
+extern int g_hasSSE42;
+extern int g_hasSSE41;
extern int g_hasSSSE3;
extern int g_hasAESNI;
extern int g_hasCLMUL;
@@ -84,6 +172,9 @@ extern int g_hasMMX;
#endif
+#define HasSSE42() g_hasSSE42
+#define HasSSE41() g_hasSSE41
+#define HasSAVX() g_hasAVX
#define HasSSSE3() g_hasSSSE3
#define HasAESNI() g_hasAESNI
#define HasCLMUL() g_hasCLMUL
diff --git a/src/Crypto/gost89_x64.asm b/src/Crypto/gost89_x64.asm
new file mode 100644
index 00000000..f2e49cb7
--- /dev/null
+++ b/src/Crypto/gost89_x64.asm
@@ -0,0 +1,481 @@
+;
+; GOST89 implementation x64
+;
+; Copyright (c) 2016. Disk Cryptography Services for EFI (DCS), Alex Kolotnikov
+;
+; This program and the accompanying materials
+; are licensed and made available under the terms and conditions
+; of the Apache License, Version 2.0. The full text of the license may be found at
+; https://opensource.org/licenses/Apache-2.0
+;
+; Some ideas from article https://xakep.ru/2013/10/19/shifrovanie-gost-28147-89/
+;
+
+[section .bss align=16]
+
+;///////////////////////////////////////////////////////////////////
+;// Win64 registers to save
+;///////////////////////////////////////////////////////////////////
+%macro SaveRegs 0
+ sub rsp,8*8+10*16
+ mov [rsp], rbx
+ mov [rsp+8], rbp
+ mov [rsp+8*2], rdi
+ mov [rsp+8*3], rsi
+ mov [rsp+8*4], r12
+ mov [rsp+8*5], r13
+ mov [rsp+8*6], r14
+ mov [rsp+8*7], r15
+%endmacro
+
+%macro RestoreRegs 0
+ mov rbx, [rsp]
+ mov rbp, [rsp+8]
+ mov rdi, [rsp+8*2]
+ mov rsi, [rsp+8*3]
+ mov r12, [rsp+8*4]
+ mov r13, [rsp+8*5]
+ mov r14, [rsp+8*6]
+ mov r15, [rsp+8*7]
+ add rsp,8*8+10*16
+%endmacro
+
+[section .text align=16]
+;///////////////////////////////////////////////////////////////////
+;// Crypting 2 blocks
+;///////////////////////////////////////////////////////////////////
+%macro gost_round2 2 ; 1 - pos1, 2 - pos2
+ ; 1st
+ ; 1-2 byte
+ add ecx, r13d ; add key
+ movzx edi, cl
+ movzx esi, ch
+ xor r14d, dword [r8 + 32 + 256*3*4 + rdi*4]
+ xor r14d, dword [r8 + 32 + 256*2*4 + rsi*4]
+ shr ecx, 16
+ ; 3-4 áàéò
+ movzx edi, cl
+ xor r14d, dword [r8 + 32 + 256*4 + rdi*4]
+ movzx esi, ch
+ xor r14d, dword [r8 + 32 + rsi*4]
+ mov edx, [r8 + %1*4] ; read key for second step
+
+ ; 2nd
+ ; 1-2 byte
+ add eax, r10d ; read key
+ movzx r15d, al
+ movzx ebp, ah
+ xor r11d, dword [r8 + 32 + 256*3*4 + r15*4]
+ xor r11d, dword [r8 + 32 + 256*2*4 + rbp*4]
+ shr eax, 16
+ ; 3-4 áàéò
+ movzx r15d, al
+ xor r11d, dword [r8 + 32 + 256*4 + r15*4]
+ movzx ebp, ah
+ xor r11d, dword [r8 + 32 + rbp*4]
+ mov ebx, [r8 + %1*4] ; read key for second step
+
+ ; second step
+ ; 1st
+ ; 1-2 byte
+ add edx, r14d ; add key
+ movzx edi, dl
+ movzx esi, dh
+ xor r13d, dword [r8 + 32 + 256*3*4 + rdi*4]
+ xor r13d, dword [r8 + 32 + 256*2*4 + rsi*4]
+ shr edx, 16
+ ; 3-4 áàéò
+ movzx edi, dl
+ xor r13d, dword [r8 + 32 + 256*4 + rdi*4]
+ movzx esi, dh
+ xor r13d, dword [r8 + 32 + rsi*4]
+ mov ecx, [r8 + %2*4] ; read key
+
+ ; 2nd
+ ; 1-2 byte
+ add ebx, r11d; ; add key
+ movzx r15d, bl;
+ movzx ebp, bh;
+ xor r10d, dword [r8 + 32 + 256*3*4 + r15*4]
+ xor r10d, dword [r8 + 32 + 256*2*4 + rbp*4]
+ shr ebx, 16
+ ; 3-4 áàéò
+ movzx r15d, bl
+ xor r10d, dword [r8 + 32 + 256*4 + r15*4]
+ movzx ebp, bh
+ xor r10d, dword [r8 + 32 + rbp*4]
+ mov eax, [r8 + %2*4] ; read key
+%endmacro
+
+; input: r8 - &key, rdx - &IN
+; returns: (r13) & (r10)
+GostEncrypt2x64:
+ ; 1st
+ mov r13d, [rdx]
+ mov r14, [rdx]
+ shr r14, 32
+
+ ; 2nd
+ mov r10d, [rdx + 16]
+ mov r11, [rdx + 16]
+ shr r11, 32
+
+ mov ecx, [r8]
+ mov eax, ecx
+
+ gost_round2 1, 2
+ gost_round2 3, 4
+ gost_round2 5, 6
+ gost_round2 7, 0
+
+ gost_round2 1, 2
+ gost_round2 3, 4
+ gost_round2 5, 6
+ gost_round2 7, 0
+
+ gost_round2 1, 2
+ gost_round2 3, 4
+ gost_round2 5, 6
+ gost_round2 7, 7
+
+ gost_round2 6, 5
+ gost_round2 4, 3
+ gost_round2 2, 1
+ gost_round2 0, 0
+
+ shl r13, 32 ; combine
+ or r13, r14
+
+ shl r10, 32 ; combine
+ or r10, r11
+ ret
+
+; input: r8 - &key, rdx - &IN
+; returns: (r13) & (r10)
+GostDecrypt2x64:
+ ; 1st
+ mov r13d, [rdx]
+ mov r14, [rdx]
+ shr r14, 32
+
+ ; 2nd
+ mov r10d, [rdx + 16]
+ mov r11, [rdx + 16]
+ shr r11, 32
+
+ mov ecx, [r8]
+ mov eax, ecx
+
+ gost_round2 1, 2
+ gost_round2 3, 4
+ gost_round2 5, 6
+ gost_round2 7, 7
+
+ gost_round2 6, 5
+ gost_round2 4, 3
+ gost_round2 2, 1
+ gost_round2 0, 7
+
+ gost_round2 6, 5
+ gost_round2 4, 3
+ gost_round2 2, 1
+ gost_round2 0, 7
+
+ gost_round2 6, 5
+ gost_round2 4, 3
+ gost_round2 2, 1
+ gost_round2 0, 0
+
+ shl r13, 32 ; combine
+ or r13, r14
+
+ shl r10, 32 ; combine
+ or r10, r11
+ret
+
+;///////////////////////////////////////////////////////////////////
+;// Crypting 1 block
+;///////////////////////////////////////////////////////////////////
+%macro gost_round1 2 ; 1 - pos1, 2 - pos2
+ ; 1-2 byte
+ add ecx, r13d ; add key
+ movzx edi, cl
+ movzx esi, ch
+ xor r14d, dword [r8 + 32 + 256*3*4 + rdi*4]
+ xor r14d, dword [r8 + 32 + 256*2*4 + rsi*4]
+ shr ecx, 16
+ ; 3-4 áàéò
+ movzx edi, cl
+ xor r14d, dword [r8 + 32 + 256*4 + rdi*4]
+ movzx esi, ch
+ xor r14d, dword [r8 + 32 + rsi*4]
+ mov edx, [r8 + %1*4] ; read key for second step
+
+ ; second step
+ ; 1-2 byte
+ add edx, r14d ; add key
+ movzx edi, dl
+ movzx esi, dh
+ xor r13d, dword [r8 + 32 + 256*3*4 + rdi*4]
+ xor r13d, dword [r8 + 32 + 256*2*4 + rsi*4]
+ shr edx, 16
+ ; 3-4 áàéò
+ movzx edi, dl
+ xor r13d, dword [r8 + 32 + 256*4 + rdi*4]
+ movzx esi, dh
+ xor r13d, dword [r8 + 32 + rsi*4]
+ mov ecx, [r8 + %2*4] ; read key
+%endmacro
+
+; input: r8 - &gost_kds rdx - &IN
+; returns: r13
+GostEncrypt1x64:
+ mov r13d, [rdx]
+ mov r14, [rdx]
+ shr r14, 32
+ mov ecx, [r8]
+
+ gost_round1 1, 2
+ gost_round1 3, 4
+ gost_round1 5, 6
+ gost_round1 7, 0
+
+ gost_round1 1, 2
+ gost_round1 3, 4
+ gost_round1 5, 6
+ gost_round1 7, 0
+
+ gost_round1 1, 2
+ gost_round1 3, 4
+ gost_round1 5, 6
+ gost_round1 7, 7
+
+ gost_round1 6, 5
+ gost_round1 4, 3
+ gost_round1 2, 1
+ gost_round1 0, 0
+
+ shl r13, 32 ; combine
+ or r13, r14
+ret
+
+; input: r8 - &gost_kds rdx - IN
+; returns: r13
+GostDecrypt1x64:
+ mov r13d, [rdx]
+ mov r14, [rdx]
+ shr r14, 32
+ mov ecx, [r8]
+
+ gost_round1 1, 2
+ gost_round1 3, 4
+ gost_round1 5, 6
+ gost_round1 7, 7
+
+ gost_round1 6, 5
+ gost_round1 4, 3
+ gost_round1 2, 1
+ gost_round1 0, 7
+
+ gost_round1 6, 5
+ gost_round1 4, 3
+ gost_round1 2, 1
+ gost_round1 0, 7
+
+ gost_round1 6, 5
+ gost_round1 4, 3
+ gost_round1 2, 1
+ gost_round1 0, 0
+
+ shl r13, 32 ; combine
+ or r13, r14
+ret
+
+global gost_encrypt_128_CBC_asm ; gost_encrypt_128_CBC_asm(uint64* out, uint64* in, gost_kds* kds, uint64 count);
+; rcx - &out
+; rdx - &in
+; r8 - &gost_kds
+; r9 - count
+gost_encrypt_128_CBC_asm:
+ SaveRegs ; Saving
+
+ sub rsp, 32
+ mov [rsp], rcx ; Save out addr
+ mov [rsp + 8], rdx ; Save in addr
+ mov [rsp + 16], r8 ; key addr
+
+.do:
+ mov [rsp + 24], r9 ; Save count
+ cmp r9, 2
+ jge .blk2
+ cmp r9, 1
+ jge .blk1
+ jmp .end
+
+; One 128 block encryption
+.blk1:
+ mov rdx, [rsp + 8] ; set in addr
+ call GostEncrypt1x64
+
+ mov rcx, [rsp] ; Restore out
+ mov rdx, [rsp + 8] ; restore in
+
+ mov [rcx], r13
+ mov rax, [rdx + 8]
+ xor rax, r13 ; CBC
+
+ add rcx, 8 ;next 8 bytes
+ mov [rcx], rax
+
+ mov rdx, rcx
+ call GostEncrypt1x64
+
+ mov rcx, [rsp] ; Restore out addr
+ mov rdx, [rsp+8] ; Restore in addr
+
+ mov [rcx + 8], r13
+
+ add rcx,16
+ mov [rsp], rcx
+
+ add rdx, 16
+ mov [rsp+8], rdx
+
+ mov r9, [rsp + 24]
+ dec r9
+
+ jmp .do
+
+.blk2:
+ mov rdx, [rsp + 8] ; set in addr
+ call GostEncrypt2x64
+
+ mov rcx, [rsp] ; Restore out
+ mov rdx, [rsp + 8] ; restore in
+
+ mov [rcx], r13
+
+ mov rax, [rdx + 8]
+ xor rax, r13 ; CBC
+
+ mov [rcx + 16], r10
+
+ mov rbx, [rdx + 24]
+ xor rbx, r10 ; CBC
+
+ mov [rcx + 8], rax
+ mov [rcx + 24], rbx
+
+ add rcx, 8 ;next 8 bytes
+
+ mov rdx, rcx
+ call GostEncrypt2x64
+
+ mov rcx, [rsp] ; Restore out addr
+ mov rdx, [rsp+8] ; Restore in addr
+
+ mov [rcx + 8], r13
+ mov [rcx + 24], r10
+
+ add rcx,32
+ mov [rsp], rcx
+
+ add rdx, 32
+ mov [rsp+8], rdx
+
+ mov r9, [rsp + 24]
+ sub r9, 2
+
+ jmp .do
+
+.end:
+ add rsp, 32 ; Load out addr
+ RestoreRegs ; Load
+ret
+
+global gost_decrypt_128_CBC_asm ; gost_decrypt_128_CBC_asm(uint64* out, uint64* in, const gost_kds* kds, uint64 count);
+; rcx - &out
+; rdx - &in
+; r8 - &gost_kds
+; r9 - count
+gost_decrypt_128_CBC_asm:
+ SaveRegs ; Saving
+
+ sub rsp, 32
+ mov [rsp], rdx ; Save out addr
+ mov [rsp+8], rcx ; Save in addr
+ mov [rsp+16], r8 ; key addr
+
+.do:
+ mov [rsp + 24], r9 ; Save count
+ cmp r9, 2
+ jge .blk2
+ cmp r9, 1
+ jge .blk1
+ jmp .end
+
+; One 128 block decryption
+.blk1:
+ add rdx, 8
+ call GostDecrypt1x64
+ mov rcx, [rsp] ; Restore out
+ mov rdx, [rsp + 8] ; Restore in
+ mov rax, [rdx]
+ xor rax, r13 ; CBC
+ mov [rcx + 8], rax
+
+ call GostDecrypt1x64
+
+ mov rcx, [rsp] ; Restore out addr
+ mov rdx, [rsp+8] ; Restore in addr
+
+ mov [rcx], r13
+
+ add rcx,16
+ mov [rsp], rcx
+
+ add rdx, 16
+ mov [rsp+8], rdx
+
+ mov r9, [rsp + 24]
+ dec r9
+
+ jmp .do
+
+.blk2:
+ add rdx, 8
+ call GostDecrypt2x64
+ mov rcx, [rsp] ; Restore out
+ mov rdx, [rsp + 8] ; Restore in
+
+ mov rax, [rdx]
+ xor rax, r13 ; CBC
+ mov [rcx + 8], rax
+
+ mov rbx, [rdx+16]
+ xor rbx, r10 ; CBC
+ mov [rcx + 24], rbx
+
+ call GostDecrypt2x64
+
+ mov rcx, [rsp] ; Restore out addr
+ mov rdx, [rsp+8] ; Restore in addr
+
+ mov [rcx], r13
+ mov [rcx+16], r10
+
+ add rcx,32
+ mov [rsp], rcx
+
+ add rdx,32
+ mov [rsp+8], rdx
+
+ mov r9, [rsp + 24]
+ sub r9, 2
+
+ jmp .do
+
+.end:
+ add rsp, 32 ; Load out addr
+ RestoreRegs ; Load
+ret
diff --git a/src/Crypto/gost89_x86.asm b/src/Crypto/gost89_x86.asm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/Crypto/gost89_x86.asm
diff --git a/src/Crypto/kuznyechik.c b/src/Crypto/kuznyechik.c
new file mode 100644
index 00000000..7c063f6e
--- /dev/null
+++ b/src/Crypto/kuznyechik.c
@@ -0,0 +1,2453 @@
+/*
+This code is written by kerukuro for cppcrypto library (http://cppcrypto.sourceforge.net/)
+and released into public domain.
+*/
+
+#include "kuznyechik.h"
+// #include <memory.h>
+// #include <algorithm>
+// #include "portability.h"
+
+#ifdef _MSC_VER
+#define inline __forceinline
+#endif
+
+//#define CPPCRYPTO_DEBUG
+
+ static const byte S[256] = {
+ 252, 238, 221, 17, 207, 110, 49, 22, 251, 196, 250, 218, 35, 197, 4, 77, 233, 119, 240, 219, 147, 46, 153, 186, 23, 54, 241, 187, 20, 205, 95, 193,
+ 249, 24, 101, 90, 226, 92, 239, 33, 129, 28, 60, 66, 139, 1, 142, 79, 5, 132, 2, 174, 227, 106, 143, 160, 6, 11, 237, 152, 127, 212, 211, 31,
+ 235, 52, 44, 81, 234, 200, 72, 171, 242, 42, 104, 162, 253, 58, 206, 204, 181, 112, 14, 86, 8, 12, 118, 18, 191, 114, 19, 71, 156, 183, 93, 135,
+ 21, 161, 150, 41, 16, 123, 154, 199, 243, 145, 120, 111, 157, 158, 178, 177, 50, 117, 25, 61, 255, 53, 138, 126, 109, 84, 198, 128, 195, 189, 13, 87,
+ 223, 245, 36, 169, 62, 168, 67, 201, 215, 121, 214, 246, 124, 34, 185, 3, 224, 15, 236, 222, 122, 148, 176, 188, 220, 232, 40, 80, 78, 51, 10, 74,
+ 167, 151, 96, 115, 30, 0, 98, 68, 26, 184, 56, 130, 100, 159, 38, 65, 173, 69, 70, 146, 39, 94, 85, 47, 140, 163, 165, 125, 105, 213, 149, 59,
+ 7, 88, 179, 64, 134, 172, 29, 247, 48, 55, 107, 228, 136, 217, 231, 137, 225, 27, 131, 73, 76, 63, 248, 254, 141, 83, 170, 144, 202, 216, 133, 97,
+ 32, 113, 103, 164, 45, 43, 9, 91, 203, 155, 37, 208, 190, 229, 108, 82, 89, 166, 116, 210, 230, 244, 180, 192, 209, 102, 175, 194, 57, 75, 99, 182
+ };
+
+ static const byte IS[256] = {
+ 165, 45, 50, 143, 14, 48, 56, 192, 84, 230, 158, 57, 85, 126, 82, 145, 100, 3, 87, 90, 28, 96, 7, 24, 33, 114, 168, 209, 41, 198, 164, 63,
+ 224, 39, 141, 12, 130, 234, 174, 180, 154, 99, 73, 229, 66, 228, 21, 183, 200, 6, 112, 157, 65, 117, 25, 201, 170, 252, 77, 191, 42, 115, 132, 213,
+ 195, 175, 43, 134, 167, 177, 178, 91, 70, 211, 159, 253, 212, 15, 156, 47, 155, 67, 239, 217, 121, 182, 83, 127, 193, 240, 35, 231, 37, 94, 181, 30,
+ 162, 223, 166, 254, 172, 34, 249, 226, 74, 188, 53, 202, 238, 120, 5, 107, 81, 225, 89, 163, 242, 113, 86, 17, 106, 137, 148, 101, 140, 187, 119, 60,
+ 123, 40, 171, 210, 49, 222, 196, 95, 204, 207, 118, 44, 184, 216, 46, 54, 219, 105, 179, 20, 149, 190, 98, 161, 59, 22, 102, 233, 92, 108, 109, 173,
+ 55, 97, 75, 185, 227, 186, 241, 160, 133, 131, 218, 71, 197, 176, 51, 250, 150, 111, 110, 194, 246, 80, 255, 93, 169, 142, 23, 27, 151, 125, 236, 88,
+ 247, 31, 251, 124, 9, 13, 122, 103, 69, 135, 220, 232, 79, 29, 78, 4, 235, 248, 243, 62, 61, 189, 138, 136, 221, 205, 11, 19, 152, 2, 147, 128,
+ 144, 208, 36, 52, 203, 237, 244, 206, 153, 16, 68, 64, 146, 58, 1, 38, 18, 26, 72, 104, 245, 129, 139, 199, 214, 32, 10, 8, 0, 76, 215, 116
+ };
+
+ static const uint64 T[16][256][2] = {
+ {
+ { 0x9680c07a0cd5fbe9, 0xb5aec91b93871119 }, { 0xce1a17b28ce00819, 0x0af2fef8abfc327b }, { 0x77dcb250a2d0cbbf, 0x89c7884eefcabdc0 }, { 0xd642635e1a104162, 0xc01393d33c12c469 },
+ { 0x2f46659822e5384f, 0x369bbfadd7b19ea2 }, { 0xe74a6f116a39b338, 0xefc0cb2f2997703c }, { 0x4d567d06c2b71ffb, 0x68fe0f96fd783508 }, { 0x7379a4c39bf8884a, 0xaa09c5a389e794c7 },
+ { 0x33bb07e78d3d32c1, 0xdfb49f6b267241b7 }, { 0xf79b37188e997c6a, 0x637e3c1d7223d420 }, { 0x49f36b95fb9f5c0e, 0x4b30427b9b551c0f }, { 0xd2e775cd23380297, 0xe3ddde3e5a3fed6e },
+ { 0x15ccaace4282ec0b, 0xd7a23875c503166a }, { 0x8dd35b6af83b12a5, 0xf7fae10dcf048998 }, { 0x2be3730b1bcd7bba, 0x1555f240b19cb7a5 }, { 0xf286c5df28bb5f33, 0x3862f35aec946656 },
+ { 0x6b21d02f0d08c131, 0x60e8a8881e0962d5 }, { 0x670dea59467004ed, 0x05797f7cb47e19dc }, { 0xeb665567214176e4, 0x8a511cdb83e00b35 }, { 0xa8af19bf559a6c58, 0x7759032ee718b0d6 },
+ { 0x0b82c319104e261e, 0xceeadf2407373c9d }, { 0x126253a119b40fc9, 0x7cd930a5684351fe }, { 0xa917fdebca900cf4, 0x0f8b81841f822ba7 }, { 0xbcdb57258812e0ff, 0xd829b9f1da813dcd },
+ { 0x0931c8b1ed5ae685, 0x3e8d18b334c0c97f }, { 0xe86dba9b435fd6d3, 0x02e459e6488d65a6 }, { 0x912e391557e3182b, 0x1ed5c1cb3ec7568d }, { 0xc6933b57feb08e30, 0x4cad64e167a66075 },
+ { 0x87e97c27777f5417, 0x41c2bc8330a92e74 }, { 0xdbd6bd7cce62e412, 0xdd50c68d6eff2411 }, { 0xaa1c1217a88eacc3, 0x873ec4b9d4ef4534 }, { 0xa6302861e3f6691f, 0xe2af134d7e983e3d },
+ { 0xc72bdf0361baee9c, 0x347fe64b9f3cfb04 }, { 0xfa0fe93a5aebd91a, 0x7e3d694320ce3458 }, { 0x3f973d91c645f71d, 0xba25489f8c053abe }, { 0xfbb70d6ec5e1b9b6, 0x06efebe9d854af29 },
+ { 0xb3fc82afa1748514, 0x350d2b38bb9b2857 }, { 0x24c4a68132ab1e51, 0xf8716089d086a23f }, { 0xb4527bc0fa4266d6, 0x9e7623e816db6fc3 }, { 0xe15c722aae053056, 0x3c6941557c4dacd9 },
+ { 0x531814d1907bd5ee, 0x71b6e8c73f4c1fff }, { 0xd1ec9a314126a2a0, 0x6b689b03915283fd }, { 0x4af884699981fc39, 0xc38507465038729c }, { 0x01b8e4549f0a60ac, 0x78d282aaf89a9b71 },
+ { 0xf18d2a234aa5ff04, 0xb0d7b66727f908c5 }, { 0x7a486c7276a26ecf, 0x9484dd10bd275db8 }, { 0xa026355a27caea71, 0x310699372b42e2d8 }, { 0x06161d3bc43c836e, 0xd3a98a7a55dadce5 },
+ { 0x51ab1f796d6f1575, 0x81d12f500cbbea1d }, { 0x02b30ba8fd14c09b, 0xf067c79733f7f5e2 }, { 0xf490d8e4ec87dc5d, 0xebcb7920b94ebab3 }, { 0x3b322b02ff6db4e8, 0x99eb0572ea2813b9 },
+ { 0xc9b4eeddd7d6ebdb, 0xa189f62806bc75ef }, { 0xcca91c1a71f4c882, 0xfa95396f980bc799 }, { 0xda6e5928516884be, 0xa58244279665bf60 }, { 0xb24466fb3e7ee5b8, 0x4ddfa9924301b326 },
+ { 0xdf73abeff74aa7e7, 0xfe9e8b6008d20d16 }, { 0xd8dd5280ac7c4425, 0x55e583b0a5924a82 }, { 0x40c2a32416c5ba8b, 0x75bd5ac8af95d570 }, { 0xd35f9199bc32623b, 0x9b0f5c94a2a5761f },
+ { 0x31080c4f7029f25a, 0x2fd358fc1585b455 }, { 0x5b913834e22b53c7, 0x37e972def3164df1 }, { 0xfeaaffa963c39aef, 0x5df324ae46e31d5f }, { 0x5f342ea7db031032, 0x14273f33953b64f6 },
+ { 0x9fb108cbe18f1d6c, 0x8b23d1a8a747d866 }, { 0x1cfd627fafd80a8e, 0xe92f20c6f1c3df15 }, { 0xe6f28b45f533d394, 0x97124985d10deb4d }, { 0x236a5fee699dfd93, 0x530a68597dc6e5ab },
+ { 0xe5f964b9972d73a3, 0x1fa70cb81a6085de }, { 0x8a7da205a30df167, 0x5c81e9dd6244ce0c }, { 0xa32ddaa645d44a46, 0xb9b3dc0ae02f8c4b }, { 0x6a99347b9202a19d, 0x183a2a22e693f9a4 },
+ { 0x1ff68d83cdc6aab9, 0x619a65fb3aaeb186 }, { 0x398120aa02797473, 0x698cc2e5d9dfe65b }, { 0x3839c4fe9d7314df, 0x115e404f21457d2a }, { 0x46d4be1fd2f939e5, 0xa614d0b2fa4f0995 },
+ { 0xecc8ac087a779526, 0x212a140b2ea04ca1 }, { 0x958b2f866ecb5bde, 0x3d1b8c2658ea7f8a }, { 0x550e09ea54475680, 0xa21f62bd6a96c31a }, { 0xa19ed10eb8c08add, 0x49d41b9dd3d879a9 },
+ { 0x4fe576ae3fa3df60, 0x9899c801ce8fc0ea }, { 0xc2362dc4c798cdc5, 0x6f63290c018b4972 }, { 0x89764df9c1135150, 0xd434ace0a929a09f }, { 0x86519873e87534bb, 0x39103e29c833b505 },
+ { 0x5605e6163659f6b7, 0x2aaa2780a1fbad89 }, { 0x7de6951d2d948d0d, 0x3fffd5c010671a2c }, { 0x1d45862b30d26a22, 0x91fda26c09594464 }, { 0x589ad7c88035f3f0, 0xbf5c37e3387b2362 },
+ { 0xed70485ce57df58a, 0x59f896a1d63ad7d0 }, { 0x36a6f5202b1f1198, 0x84a8502cb8c5f3c1 }, { 0x22d2bbbaf6979d3f, 0x2bd8eaf3855c7eda }, { 0x5013fb2df26575d9, 0xf903adfaf421716c },
+ { 0xf8bce292a7ff1981, 0x8e5aaed41339c1ba }, { 0xbb75ae4ad324033d, 0x7352b12177c17a59 }, { 0x5e8ccaf34409709e, 0x6cf5bd996da1ff87 }, { 0x8c6bbf3e67317209, 0x8f2863a7379e12e9 },
+ { 0xfda1105501dd3ad8, 0xd54661938d8e73cc }, { 0xc80c0a8948dc8b77, 0xd95b7482fe26ee9e }, { 0x5a29dc607d21336b, 0x4f3bf0740b8cd680 }, { 0xb759943c985cc6e1, 0x16c366d5ddb60150 },
+ { 0xac0a0f2c6cb22fad, 0x54974ec3813599d1 }, { 0x1aeb7f446be489e0, 0x3a86aabca41903f0 }, { 0x27cf497d50b5be66, 0x70c425b41bebccac }, { 0x7943838e14bccef8, 0x1c31982d764a332b },
+ { 0x65bee1f1bb64c476, 0xf51eb8eb8789ec3e }, { 0xff121bfdfcc9fa43, 0x2521a604be79862e }, { 0x9433cbd2f1c13b72, 0x45c90e8ca070e4fb }, { 0x9d0203631c9bddf7, 0x7b44163f94b02d84 },
+ { 0x82f48ee0d15d774e, 0x1ade73c4ae1e9c02 }, { 0x0c2c3a764b78c5dc, 0x6591d7f4aa777b09 }, { 0xeadeb133be4b1648, 0xf2839e717b7a9044 }, { 0x640605a5246ea4da, 0x8dcc3a417f13774f },
+ { 0xc38ec9905892ad69, 0x17b1aba6f911d203 }, { 0x939d32bdaaf7d8b0, 0xeeb2065c0d30a36f }, { 0x804785482c49b7d5, 0xeab9b4539de969e0 }, { 0x30b0e81bef2392f6, 0x5701da56ed1f2f24 },
+ { 0x185874ec96f0497b, 0xcae16d2b97eef612 }, { 0x66b50e0dd97a6441, 0x7dabfdd64ce482ad }, { 0x8bc546513c0791cb, 0x24536b779ade557d }, { 0x4b40603d068b9c95, 0xbb5785eca8a2e9ed },
+ { 0x6992db87f01c01aa, 0x908f6f1f2dfe9737 }, { 0x72c1409704f2e8e6, 0xd2db4709717d0fb6 }, { 0x030beffc621ea037, 0x88b5453dcb6d6e93 }, { 0x295078a3e6d9bb21, 0xe53235d7826b4247 },
+ { 0x52a0f0850f71b542, 0x09646a6dc7d6848e }, { 0x19e090b809fa29d7, 0xb233ef816f746d63 }, { 0x07aef96f5b36e3c2, 0xab7b08d0ad404794 }, { 0xfc19f4019ed75a74, 0xad94e3397514e8bd },
+ { 0x834c6ab44e5717e2, 0x620cf16e56840773 }, { 0xbacd4a1e4c2e6391, 0x0b80338b8f5be128 }, { 0xb0f76d53c36a2523, 0xbdb86e0570f646c4 }, { 0x9e09ec9f7e857dc0, 0xf3f153025fdd4317 },
+ { 0xbe685c8d75062064, 0x284e7e66e976c82f }, { 0xe44180ed0827130f, 0x67758e12e2fa1eaf }, { 0x7bf08826e9a80e63, 0xec565fba45bdc6c9 }, { 0xf035ce77d5af9fa8, 0xc80534cddf6393b4 },
+ { 0xd5498ca2780ee155, 0x48a6d6eef77faafa }, { 0xee7ba7a0876355bd, 0xd14dd39c1d57b943 }, { 0xaf01e0d00eac8f9a, 0xdc220bfe4a58f742 }, { 0x3415fe88d60bd103, 0x74cf97bb8b320623 },
+ { 0xbfd0b8d9ea0c40c8, 0x509cfccc11ec535e }, { 0x6f84c6bc342082c4, 0x4326e56578244bd2 }, { 0x3203e3b31237526d, 0xa7661dc1dee8dac6 }, { 0x8ed8b4969a25b292, 0x7f4fa4300469e70b },
+ { 0x476c5a4b4df35949, 0xdec6521802d592e4 }, { 0xf33e218bb7b13f9f, 0x40b071f0140efd27 }, { 0x3a8acf566067d444, 0xe13987d812b288c8 }, { 0xf90406c638f5792d, 0xf6882c7eeba35acb },
+ { 0x60a313361d46e72f, 0xae0277ac193e5e48 }, { 0xaeb9048491a6ef36, 0xa4f08954b2c26c33 }, { 0x1e4e69d752ccca15, 0x1948e751c2342af7 }, { 0x63a8fcca7f584718, 0x26b73291d25330db },
+ { 0x0d94de22d472a570, 0x1d43555e52ede078 }, { 0x1169bc5d7baaaffe, 0xf46c7598a32e3f6d }, { 0xcd11f84eeefea82e, 0x8247bbc560915ce8 }, { 0x5922339c1f3f935c, 0xc78eb549c0e1b813 },
+ { 0x7c5e7149b29eeda1, 0x472d576ae8fd815d }, { 0xb9c6a5e22e30c3a6, 0x833576b644368fbb }, { 0xa2953ef2dade2aea, 0xc1615ea018b5173a }, { 0x57bd0242a953961b, 0x5278a52a596136f8 },
+ { 0x177fa166bf962c90, 0x27c5ffe2f6f4e388 }, { 0x2061b0120b835da4, 0xdbbf2d64b6ab8b38 }, { 0x6e3c22e8ab2ae268, 0x3bf467cf80bed0a3 }, { 0x4cee99525dbd7f57, 0x102c8d3c05e2ae79 },
+ { 0x257c42d5ada17efd, 0x80a3e223281c394e }, { 0x0000000000000000, 0x0000000000000000 }, { 0x9aacfa0c47ad3e35, 0xd03f1eef39f06a10 }, { 0xdecb4fbb6840c74b, 0x864c09caf0489667 },
+ { 0x0e9f31deb66c0547, 0x95f6106399808eeb }, { 0x484b8fc164953ca2, 0x33e2c0d163cf877e }, { 0x611bf762824c8783, 0xd6d0f506e1a4c539 }, { 0xddc0a0470a5e677c, 0x0ef94cf73b25f8f4 },
+ { 0x45df51e3b0e799d2, 0x2ea1958f31226706 }, { 0x766456043ddaab13, 0xf1150ae4175026b1 }, { 0x4467b5b72fedf97e, 0x56731725c9b8fc77 }, { 0x8f6050c2052fd23e, 0x079d269afcf37c7a },
+ { 0xb5ea9f946548067a, 0xe6a4a142ee41f4b2 }, { 0xa48323c91ee2a984, 0x12c8d4da4d6fcbdf }, { 0x2a5b975f84c71b16, 0x6d8770ea49062cd4 }, { 0x71caaf6b66ec48d1, 0x5a6e0234ba106125 },
+ { 0x3e2fd9c5594f97b1, 0xc2f7ca35749fa1cf }, { 0xd0547e65de2cc20c, 0x13ba19a969c8188c }, { 0x08892ce572508629, 0x465f9a19cc5a520e }, { 0x682a3fd36f166106, 0xe85dedb5d5640c46 },
+ { 0x54b6edbecb4d362c, 0xdacde017920c586b }, { 0x3c9cd26da45b572a, 0x32900da24768542d }, { 0xe3ef79825311f0cd, 0xcc0e86c24fba593b }, { 0xc598d4ab9cae2e07, 0xc41821dcaccb0ee6 },
+ { 0x4271a88cebd17a10, 0x85da9d5f9c622092 }, { 0x21d9544694893d08, 0xa36dafce4e311049 }, { 0xd4f168f6e70481f9, 0x307454440fe5318b }, { 0xefc343f418693511, 0xa99f5136e5cd2232 },
+ { 0xa53bc79d81e8c928, 0x6a1a5670b5f550ae }, { 0x0f27d58a296665eb, 0xed2492c9611a159a }, { 0x9096dd41c8e97887, 0x66074361c65dcdfc }, { 0xf5283cb0738dbcf1, 0x9319fb8a41d421c2 },
+ { 0xf623d34c11931cc6, 0x1bacbeb78ab94f51 }, { 0xcfa2f3e613ea68b5, 0x72207c525366a90a }, { 0xaba4f6433784cc6f, 0xffec46132c75de45 }, { 0x4e5d92faa0a9bfcc, 0xe04b4aab36155b9b },
+ { 0x371e1174b4157134, 0xfc7ad286405f68b0 }, { 0x9225d6e935fdb81c, 0x966084f6f5aa381e }, { 0xb6e170680756a64d, 0x6e11e47f252c9a21 }, { 0x6c8f2940563e22f3, 0xcb93a058b3492541 },
+ { 0x7f559eb5d0804d96, 0xcf9812572390efce }, { 0x5c3fc15bb91db005, 0x9c927a0e5e560a65 }, { 0xe2579dd6cc1b9061, 0xb4dc0468b720c24a }, { 0x051df2c7a6222359, 0x5b1ccf479eb7b276 },
+ { 0x3d2436393b513786, 0x4a428f08bff2cf5c }, { 0x74d75dacc0ce6b88, 0x0172cd7324a7d353 }, { 0xa788cc357cfc09b3, 0x9a7d91e78602a54c }, { 0xd965b6d433762489, 0x2d37011a5d08d1f3 },
+ { 0x88cea9ad5e1931fc, 0xace62e4a51b33bee }, { 0xc42030ff03a44eab, 0xbccaa37654519597 }, { 0xbd63b37117188053, 0xa0fb3b5b221ba6bc }, { 0x6210189ee05227b4, 0x5e65b03b2ac9abaa },
+ { 0x2efe81ccbdef58e3, 0x4e493d072f2b05d3 }, { 0xd7fa870a851a21ce, 0xb8c11179c4885f18 }, { 0x10d15809e4a0cf52, 0x8cbef7325bb4a41c }, { 0x855a778f8a6b948c, 0xb1a57b14035edb96 },
+ { 0x7eed7ae14f8a2d3a, 0xb74a90fddb0a74bf }, { 0x2677ad29cfbfdeca, 0x0816a71ee37157dd }, { 0x78fb67da8bb6ae54, 0x64e31a878ed0a85a }, { 0x14744e9add888ca7, 0xaf70badf3d998d1b },
+ { 0x9b141e58d8a75e99, 0xa8ed9c45c16af161 }, { 0xb87e41b6b13aa30a, 0xfbe7f41cbcac14ca }, { 0xcb07e5752ac22b40, 0x51ee31bf354b800d }, { 0x99a715f025b39e02, 0x588a5bd2f29d0483 },
+ { 0x9cbae7378391bd5b, 0x039694956c2ab6f5 }, { 0x43c94cd874db1abc, 0xfd081ff564f8bbe3 }, { 0x2c4d8a6440fb9878, 0xbe2efa901cdcf031 }, { 0x81ff611cb343d779, 0x926b36f96573f291 },
+ { 0x04a51693392843f5, 0x23ce4ded662d2907 }, { 0x5d87250f2617d0a9, 0xe440f8a4a6cc9114 }, { 0xcabf0121b5c84bec, 0x293cb315cdd11b7c }, { 0x70724b3ff9e6287d, 0x22bc809e428afa54 },
+ { 0x9738242e93df9b45, 0xcd7c4bb16b1d8a68 }, { 0x16c74532209c4c3c, 0x5f177d480e6e78f9 }, { 0x13dab7f586be6f65, 0x040bb20f90d9ca8f }, { 0xadb2eb78f3b84f01, 0x2c45cc6979af02a0 },
+ { 0x756fb9f85fc40b24, 0x79a04fd9dc3d4822 }, { 0x6d37cd14c934425f, 0xb34122f24bd3be30 }, { 0xe9d55ecfdc55b67f, 0x7a36db4cb017fed7 }, { 0x84e293db1561f420, 0xc977f9befbc440e7 },
+ { 0x981ff1a4bab9feae, 0x2058d9780a079ff2 }, { 0xc085266c3a8c0d5e, 0x9f04ee9b327cbc90 }, { 0x35ad1adc4901b1af, 0x0c1d151173a89d52 }, { 0xdc784413955407d0, 0x762bce5dc3bf6385 },
+ { 0x0a3a274d8f4446b2, 0xb6385d8effada7ec }, { 0xb14f89075c60458f, 0xc56aecaf886cddb5 }, { 0x417a477089cfda27, 0x0d6fd862570f4e01 }, { 0x28e89cf779d3db8d, 0x9de0b77d7af1d936 },
+ { 0x1b539b10f4eee94c, 0x425428165c839881 }, { 0x2df56e30dff1f8d4, 0xc6fc783ae4466b40 }, { 0xe0e4967e310f50fa, 0x44bbc3ff84d737a8 }, { 0xc13dc238a5866df2, 0xe7d66c31cae627e1 }
+ }, {
+ { 0xcf250ca2ea58362f, 0x3650d392499ed97c }, { 0xb8828c7e3ad63348, 0x339fa60be4876cf4 }, { 0xd9afa26576e99c5c, 0x9c9481a8540a7201 }, { 0x9e1b1a098515650c, 0x65b81d61d17b0a53 },
+ { 0xae0822b9a667993b, 0x995bf431f913c789 }, { 0xfe3d6aaac3f15e62, 0x5ebd0cc181ab5324 }, { 0x6e44c23c2a6cefe7, 0xef51d6b259707567 }, { 0x69759b921c288542, 0x857b54bbbc20636f },
+ { 0x384b8d397365d661, 0xd6939a4824c5b040 }, { 0x7bd38ef0a8733a1a, 0x3a87de8da703175f }, { 0xde9efbcb40adf6f9, 0xf6be03a1b15a6409 }, { 0x2ec123feefd47c12, 0x7c57c87239511b3d },
+ { 0x19e342e0fae2ea80, 0xea9ea32bf469c0ef }, { 0x9d06f8029bbb1a82, 0x1aaa4764329cc316 }, { 0x1ed21b4ecca68025, 0x80b421221139d6e7 }, { 0xe7de284a3913b4e2, 0xb423afea75c293cb },
+ { 0x4fec0de5a3ebd306, 0xd35cefd189dc05c8 }, { 0x5c41463f1d6bf824, 0xf8ae53e472a2367a }, { 0xed9021707d717540, 0x754fb0f47ad56096 }, { 0xc814550cdc1c5c8a, 0x5c7a519baccecf74 },
+ { 0xd7cd10fa1a6148d5, 0x48c046ba5daa5e11 }, { 0xdd8319c05e038977, 0x89ac59a452bdad4c }, { 0xe4c3ca4127bdcb6c, 0xcb31f5ef96255a8e }, { 0xfd2088a1dd5f21ec, 0x21af56c4624c9a61 },
+ { 0x8fa0ed602fe0a5da, 0xa556cd5229bfb726 }, { 0x992a43a7b3510fa9, 0x0f929f68342b1c5b }, { 0x0b4557824eb955d8, 0x5562291def4ab4df }, { 0x1bf5fe53ee970174, 0x0182cf2df7d34e28 },
+ { 0x661c77b57a7bc5b1, 0xc521a5aa55dd08fd }, { 0xa161ce9ec034d9c8, 0xd901052010eeac1b }, { 0x9079a896e99db185, 0xb1ecda73d8db2643 }, { 0x83d4e34c571d9aa7, 0x9a1e664623a515f1 },
+ { 0x3722611e15369692, 0x96c96b59cd38dbd2 }, { 0x44a95a67ed5286de, 0x863ec6cc6696b117 }, { 0x2be6c6e3cde5fd43, 0xfd61267ddfbb83f2 }, { 0x687ec52a16f31138, 0x117562b85c7d24ed },
+ { 0x9a37a1acadff7027, 0x7080c56dd7ccd51e }, { 0x79c53243bc06d1ee, 0xd19bb28ba4b99998 }, { 0x5e57fa8c091e13d0, 0x13b23fe27118b8bd }, { 0x168aaec79cb1aa73, 0xaac4523a1d94ab7d },
+ { 0xa06a9026caef4db2, 0x4d0f3323f0b3eb99 }, { 0x5a7b412921f406fb, 0x068ae7ee77af67f0 }, { 0xaa24991c8e8d8c10, 0x8c632c3dffa418c4 }, { 0x2cd79f4dfba197e6, 0x974ba4743aeb95fa },
+ { 0x93644a9df733ce0b, 0xcefe80763b3cef06 }, { 0xe6d576f233c82098, 0x202d99e9959fd449 }, { 0x6b632721085d6eb6, 0x6e6738bdbf9aeda8 }, { 0xe8b7c46d5f40f411, 0xf4795efb9c3ff859 },
+ { 0xf8076dbcff6ea0bd, 0xa099b8cb84a602ae }, { 0x586dfd9a3581ed0f, 0xed968be87415e937 }, { 0x0f69ec27665340f3, 0x405af111e9fd6b92 }, { 0x9b3cff14a724e45d, 0xe48ef36e3791929c },
+ { 0x7ce2d75e9e3750bf, 0x50ad5c8442530157 }, { 0xe0ef71e40f57de47, 0xde092de3909285c3 }, { 0x8db651d33b954e2e, 0x4e4aa1542a0539e1 }, { 0xb6e03ee1565ee7c1, 0xe7cb6119ed2740e4 },
+ { 0x11bbf769aaf5c0d6, 0xc0eed033f8c4bd75 }, { 0xd5dbac490e14a321, 0xa3dc2abc5e10d0d6 }, { 0x513e16ab6f4d5323, 0x53e8cef398e5d32f }, { 0x0216bcb31475ebf4, 0xeb1c6c0603ba8ec7 },
+ { 0x602670a346e43b6e, 0x3b0511a050d05977 }, { 0x031de20b1eae7f8e, 0x7f125a05e3e7c945 }, { 0xf473639087939fc0, 0x9fd113df8ebca079 }, { 0xb3c7dbfc746f6690, 0x66fd8f160bcdd82b },
+ { 0x4085e1c2c5b893f5, 0x93061ec060216e5a }, { 0x9643af80d5024f5a, 0x4fc86e79ddd677c9 }, { 0xd2eaf5e73850c984, 0xc9f6a8b5bb40c6de }, { 0xbda5696318e7b219, 0xb2a94804026df43b },
+ { 0xa6509730f670b36d, 0xb32b8729f5beba13 }, { 0x5966a3223f5a7975, 0x7998bdeb9448aeb5 }, { 0x1fd945f6c67d145f, 0x14ba1721f1649165 }, { 0x633b92a8584a44e0, 0x44174ba5b3379032 },
+ { 0xe2f9cd571b2235b3, 0x351541e593280b04 }, { 0xc351028e92a50952, 0x0918788643847bab }, { 0xef869dc369049eb4, 0x9e53dcf2796fee51 }, { 0xb989d2c6300da732, 0xa791900804da2b76 },
+ { 0x29f07a50d99016b7, 0x167d4a7bdc010d35 }, { 0xbb9f6e7524784cc6, 0x4c8dfc0e0760a5b1 }, { 0x48dd544b95afb9a3, 0xb9766dd86c8c13c0 }, { 0x47b4b86cf3fcf950, 0xf92c9cc985717852 },
+ { 0x36293fa61fed02e8, 0x02c75d5a2d659c50 }, { 0xab2fc7a48456186a, 0x186d1a3e1ff95f46 }, { 0x2ddcc1f5f17a039c, 0x03459277dab6d278 }, { 0x4acbe8f881da5257, 0x526a01de6f369d07 },
+ { 0x3c67369c5b8fc34a, 0xc3ab424422726f0d }, { 0x22b52dd29729436f, 0x431f6366334bb9ea }, { 0xba9430cd2ea3d8bc, 0xd883ca0de73de233 }, { 0x77a780dcd08e0567, 0x05cf7599ad19b588 },
+ { 0x0527e51d22318151, 0x8136ee0fe6ea98cf }, { 0xa4462b83e2055899, 0x5837eb2ff60434d4 }, { 0x9172f62ee34625ff, 0x25e2ec70388661c1 }, { 0xd4d0f2f104cf375b, 0x37d21cbfbe4d9754 },
+ { 0x1cc4a7fdd8d36bd1, 0x6ba84d2412835820 }, { 0x3940d38179be421b, 0x429dac4bc498f7c2 }, { 0x9f1044b18fcef176, 0xf1b62b6231264dd1 }, { 0xb1d1674f601a8d64, 0x8de1e310087756ec },
+ { 0x80c9014749b3e529, 0xe50c3c43c042dcb4 }, { 0x503548136596c759, 0xc7e6f8f078b894ad }, { 0x2fca7d46e50fe868, 0xe859fe71d90c5cbf }, { 0x2aed985bc73e6939, 0x696f107e3fe6c470 },
+ { 0x78ce6cfbb6dd4594, 0x4595848844e4de1a }, { 0x7ef46bed8a42bb4b, 0xbbb1308241e98f90 }, { 0x0d7f50947226ab07, 0xab469d17ea47e555 }, { 0x926f1425fde85a71, 0x5af0b675db61a884 },
+ { 0x042cbba528ea152b, 0x1538d80c06b7df4d }, { 0xd8a4fcdd7c320826, 0x089ab7abb4573583 }, { 0x9748f138dfd9db20, 0xdbc6587a3d8b304b }, { 0x18e81c58f0397efa, 0x7e9095281434876d },
+ { 0xfa11d10feb1b4b49, 0x4b85d4cd871c8c69 }, { 0x13ad4bdabe802b22, 0x2bf2bc35fb7e33b2 }, { 0xc147be3d86d0e2a6, 0xe2041480403ef56c }, { 0x28fb24e8d34b82cd, 0x82737c783c5c4ab7 },
+ { 0x87f858e97ff78f8c, 0x8f26be4a2512cabc }, { 0x5328aa187b38b8d7, 0xb8f4a2f59b5f5de8 }, { 0xa27c2c95de9aa646, 0xa6135f25f309655e }, { 0x4cf1efeebd45ac88, 0xac4eb5d46a3bcc8d },
+ { 0x26999677bfc35644, 0x5627bb6a35fc66a7 }, { 0x7096d972e6ca6fc2, 0x6fe5f7904849a380 }, { 0x75b13c6fc4fbee93, 0xeed3199faea33b4f }, { 0x86f30651752c1bf6, 0x1b288849c54f8d3e },
+ { 0x1781f07f966a3e09, 0x3eca6439fdc9ecff }, { 0x45a204dfe78912a4, 0x1230f0cf86cbf695 }, { 0x74ba62d7ce207ae9, 0x7add2f9c4efe7ccd }, { 0x46bfe6d4f9276d2a, 0x6d22aaca652c3fd0 },
+ { 0x8cbd0f6b314eda54, 0xda449757ca587e63 }, { 0x0a4e093a4462c1a2, 0xc16c1f1e0f17f35d }, { 0xc4605b20a4e163f7, 0x6332fa8fa6d46da3 }, { 0xac1e9e0ab21272cf, 0x72479837faa9494e },
+ { 0xd6c64e4210badcaf, 0xdcce70b9bdf71993 }, { 0x15974ccc821fd5fd, 0xd5d6083ffe736238 }, { 0xee8dc37b63df0ace, 0x0a5deaf19932a9d3 }, { 0x6c527e8f3e190413, 0x044dbab45acafba0 },
+ { 0xa54d753be8decce3, 0xcc39dd2c16597356 }, { 0x8a87087d0dd1248b, 0x2460235dcf552fe9 }, { 0xca02e9bfc869b77e, 0xb7663d9daf7441b3 }, { 0xbfb3d5d00c9259ed, 0x59b5240201d77afc },
+ { 0xeaa178de4b351fe5, 0x1f6532fd9f85769e }, { 0x719d87caec11fbb8, 0xfbebc193a814e402 }, { 0x0c740e2c78fd3f7d, 0x3f48ab140a1aa2d7 }, { 0xfc2bd619d784b596, 0xb5a160c78211dde3 },
+ { 0x899aea76137f5b05, 0x5b7279582cb2e6ac }, { 0xff363412c92aca18, 0xcab33ac261f614a6 }, { 0x149c127488c44187, 0x41d83e3c1e2e25ba }, { 0xe9bc9ad5559b606b, 0x607768f87c62bfdb },
+ { 0x955e4d8bcbac30d4, 0x30da347c3e31be8c }, { 0xcb09b707c2b22304, 0x23680b9e4f290631 }, { 0xb7eb60595c8573bb, 0x73c5571a0d7a0766 }, { 0x301338b02372fc37, 0xfce3e9502868cdda },
+ { 0x98211d1fb98a9bd3, 0x9b9ca96bd4765bd9 }, { 0x20a39161835ca89b, 0xa8030f6030f1372d }, { 0xce2e521ae083a255, 0xa25ee591a9c39efe }, { 0xec9b7fc877aae13a, 0xe14186f79a882714 },
+ { 0x3f7ad4974521bcc4, 0xbcb91841c195a648 }, { 0xa9397b179023f39e, 0xf37176381c43d181 }, { 0xcc38eea9f4f649a1, 0x49428997aa791039 }, { 0x5b701f912b2f9281, 0x9284d1ed97f22072 },
+ { 0x0e62b29f6c88d489, 0xd454c71209a02c10 }, { 0x612d2e1b4c3faf14, 0xaf0b27a3b08d1ef5 }, { 0x330edabb3ddc83b9, 0x83f1b355cb8f049f }, { 0x10b0a9d1a02e54ac, 0x54e0e6301899faf7 },
+ { 0x418ebf7acf63078f, 0x070828c3807c29d8 }, { 0xc91f0bb4d6c7c8f0, 0xc87467984c9388f6 }, { 0xd3e1ab5f328b5dfe, 0x5df89eb65b1d815c }, { 0x42935d71d1cd7801, 0x781a72c6639be09d },
+ { 0x5512ad0e47a74608, 0x46d016ff9e520c62 }, { 0x0000000000000000, 0x0000000000000000 }, { 0xdc88477854d81d0d, 0x1da26fa7b2e0eace }, { 0x3d6c682451545730, 0x57a57447c22f288f },
+ { 0x4bc0b6408b01c62d, 0xc66437dd8f6bda85 }, { 0xf2496486bb0c611f, 0x61f5a7d58bb1f1f3 }, { 0xb4f68252422b0c35, 0x0cd70d1fee9dce23 }, { 0x49d60af39f742dd9, 0x2d785bdb8cd15442 },
+ { 0xcd33b011fe2ddddb, 0xdd4cbf944a2457bb }, { 0xf5783d288d480bba, 0x0bdf25dc6ee1e7fb }, { 0xe1e42f5c058c4a3d, 0x4a071be070cfc241 }, { 0xc56b0598ae3af78d, 0xf73ccc8c46892a21 },
+ { 0x728065c1f2bf8436, 0x84f99b964bf32d47 }, { 0xdbb91ed6629c77a8, 0x7788edae57b0fcc6 }, { 0x32058403370717c3, 0x17ff85562bd2431d }, { 0x3118660829a9684d, 0x68eddf53c8358a58 },
+ { 0x073159ae36446aa5, 0x6a2a8209e5501608 }, { 0x76acde64da55911d, 0x91c1439a4d44f20a }, { 0xa377722dd441323c, 0x321d6926135422dc }, { 0x3b566f326dcba9ef, 0xa981c04dc7227905 },
+ { 0x640acb066e0e2e45, 0x2e3dc9ac5667863a }, { 0x5f5ca43403c587aa, 0x87bc09e19145ff3f }, { 0x4ee7535da930477c, 0x4752d9d26981424a }, { 0x6f4f9c8420b77b9d, 0x7b5fe0b1b92d32e5 },
+ { 0x0953eb315accbe2c, 0xbe7e451becf03a18 }, { 0xe5c894f92d665f16, 0x5f3fc3ec76781d0c }, { 0xc676e793b0948803, 0x882e9689a56ee364 }, { 0x5d4a188717b06c5e, 0x6ca065e792ff71f8 },
+ { 0xf76e819b993de04e, 0xe0c349da6d5b693c }, { 0x6717290d70a051cb, 0x512f93a9b5804f7f }, { 0x2792c8cfb518c23e, 0xc2298d69d5a12125 }, { 0x23be736a9df2d715, 0xd7115565d316fe68 },
+ { 0x570411bd53d2adfc, 0xadcc7af99de882a5 }, { 0x94551333c177a4ae, 0xa4d4027fde6cf90e }, { 0xbcae37db123c2663, 0x26a77e07e230b3b9 }, { 0x1afea0ebe44c950e, 0x958cf92e178e09aa },
+ { 0x8891b4ce19a4cf7f, 0xcf7c4f5bccefa12e }, { 0x7fff355580992f31, 0x2fbf0681a1b4c812 }, { 0x063a07163c9ffedf, 0xfe24b40a050d518a }, { 0x8b8c56c5070ab0f1, 0xb06e155e2f08686b },
+ { 0x7ad8d048a2a8ae60, 0xae89e88e475e50dd }, { 0xc77db92bba4f1c79, 0x1c20a08a4533a4e6 }, { 0x6230cc105291d09a, 0xd0197da6536ad7b0 }, { 0x9c0da6ba91608ef8, 0x8ea47167d2c18494 },
+ { 0x738b3b79f864104c, 0x10f7ad95abae6ac5 }, { 0xad15c0b2b8c9e6b5, 0xe649ae341af40ecc }, { 0xaf037c01acbc0d41, 0x0d55c232194e800b }, { 0xf90c3304f5b534c7, 0x34978ec864fb452c },
+ { 0x010b5eb80adb947a, 0x940e3603e05d4782 }, { 0x439803c9db16ec7b, 0xec1444c583c6a71f }, { 0xd1f717ec26feb60a, 0xb6e4f2b058a70f9b }, { 0xc04ce0858c0b76dc, 0x760a2283a063b2ee },
+ { 0x82dfbdf45dc60edd, 0x0e105045c3f85273 }, { 0xb2cc85447eb4f2ea, 0xf2f3b915eb909fa9 }, { 0x85eee45a6b826478, 0x643ad24c26a8447b }, { 0x3e718a2f4ffa28be, 0x28b72e4221c8e1ca },
+ { 0x560f4f0559093986, 0x39c24cfa7db5c527 }, { 0x21a8cfd989873ce1, 0x3c0d3963d0ac70af }, { 0xbeb88b680649cd97, 0xcdbb1201e18a3d7e }, { 0x3534ddad01437d66, 0x7dd5075fce825515 },
+ { 0xf05fd835af798aeb, 0x8ae9cbd3880b7f34 }, { 0x4dfab156b79e38f2, 0x384083d78a668b0f }, { 0x248f2ac4abb6bdb0, 0xbd3bd76c3646e860 }, { 0xa83225af9af867e4, 0x677f403bfc1e9603 },
+ { 0x343f83150b98e91c, 0xe9db315c2edf1297 }, { 0x2584747ca16d29ca, 0x2935e16fd61bafe2 }, { 0xdab2406e6847e3d2, 0xe386dbadb7edbb44 }, { 0x8eabb3d8253b31a0, 0x3158fb51c9e2f0a4 },
+ { 0xb0da39f76ac1191e, 0x19efd513e82a116e }, { 0xebaa266641ee8b9f, 0x8b6b04fe7fd8311c }, { 0x0858b58950172a56, 0x2a7073180cad7d9a }, { 0x1dcff945d208ffab, 0xffa67b27f2de1fa2 },
+ { 0xe3f293ef11f9a1c9, 0xa11b77e673754c86 }, { 0x6d59203734c29069, 0x90438cb7ba97bc22 }, { 0xf154868da5a21e91, 0x1ee7fdd0685638b6 }, { 0x5419f3b64d7cd272, 0xd2de20fc7e0f4be0 },
+ { 0x81c25fff43687153, 0x71020a40201f9b36 }, { 0xa75bc988fcab2717, 0x2725b12a15e3fd91 }, { 0xb5fddcea48f0984f, 0x98d93b1c0ec089a1 }, { 0x12a61562b45bbf58, 0xbffc8a361b237430 },
+ { 0x84e5bae26159f002, 0xf034e44fc6f503f9 }, { 0xf3423a3eb1d7f565, 0xf5fb91d66becb671 }, { 0xd0fc49542c252270, 0x22eac4b3b8fa4819 }, { 0x650195be64d5ba3f, 0xba33ffafb63ac1b8 },
+ { 0xfb1a8fb7e1c0df33, 0xdf8be2ce6741cbeb }, { 0xc25a5c36987e9d28, 0x9d164e85a3d93c29 }, { 0x7de989e694ecc4c5, 0xc4a36a87a20e46d5 }, { 0x6a6879990286facc, 0xfa690ebe5fc7aa2a },
+ { 0x5223f4a071e32cad, 0x2cfa94f67b021a6a }, { 0xf665df2393e67434, 0x74cd7fd98d062ebe }, { 0x3a5d318a67103d95, 0x3d8ff64e277f3e87 }, { 0xdf95a5734a766283, 0x62b035a25107238b }
+ }, {
+ { 0xcd6118711b69f937, 0x5237cbafd6541969 }, { 0x3b4adbd8f8038b93, 0x1c937d52c35a7b03 }, { 0x571e87e44e6345db, 0x1adb0680194bc063 }, { 0x248d3414d320fb38, 0x0238294ef70f6920 },
+ { 0xa135444dad09377f, 0x547fb07d0c45a209 }, { 0xed3ed4a62f72a0b6, 0xaeb6d828c29b3c72 }, { 0xf09047ea96ad81a0, 0xcfa091b166ae08ad }, { 0x0d60f5c6a333ecb7, 0x1fb7a13baeb3c733 },
+ { 0xe48cd9a36b7aeeb8, 0x4fb843da8fe8b77a }, { 0x4605df2e1df141c5, 0xbac501815bfd20f1 }, { 0xaaee35c87bfd28cc, 0xcacc360ad1560ffd }, { 0x7ef346363e705254, 0x07548ef540f76e70 },
+ { 0x06bb844375c7f304, 0x8104274c73a06ac7 }, { 0x086733450d7687b1, 0x3fb1745105439876 }, { 0xfb4b366f40599e13, 0x511317c6bbbda559 }, { 0xeb8550e55ab553b2, 0x2fb2ff64b13b56b5 },
+ { 0x12a71a0a88109c1c, 0x011cf5279ae6d510 }, { 0xfc258c6c7ce0a4a8, 0x0ea8df29802ddce0 }, { 0x03bc42c0db829802, 0xa102f226d8503582 }, { 0x3091aa5d2ef79420, 0x8220fb251e49d6f7 },
+ { 0x6e3d20bc249c9ff5, 0x79f566574a719d9c }, { 0x86043299a5ab5445, 0xf7456b15231afeab }, { 0xc76f57b484e32f3b, 0x123ba27b4377a7e3 }, { 0xc1d4d3f7f124dc3f, 0x933f853730d7cd24 },
+ { 0x430219adb3b42ac3, 0x9ac3d4ebf00d7fb4 }, { 0xd97d8638e6be962f, 0xd22f19c43f12a6be }, { 0x4ddeaeabcb055e76, 0x247687f686ee8d05 }, { 0x8fb63f9ce1a31a4b, 0x164bf0e76e6975a3 },
+ { 0x91a4ee1083fea35f, 0xd65f4b58120c74fe }, { 0x3df15f9b8dc47897, 0x9d975a1eb0fa11c4 }, { 0x1dae934cb9df2116, 0x61164999a43534df }, { 0xf32c052a4d2f19a2, 0x6ea26397befe3d2f },
+ { 0x7848c2754bb7a150, 0x8650a9b9335704b7 }, { 0x5f79b4a14315c26a, 0x256a72d11c085815 }, { 0x0a0e4fc59f8ad60c, 0x400c69d49523be8a }, { 0xa8874948e9017971, 0xb5712b8f41362901 },
+ { 0xf597816938e8eaa6, 0xefa644dbcd5e57e8 }, { 0xcf0864f18995a88a, 0x2d8ad62a46343f95 }, { 0x752837b3e8844de7, 0x99e708829de4c384 }, { 0x9a7f9f95550abcec, 0x48eccd2fcf1fd90a },
+ { 0x9816e315c7f6ed51, 0x3751d0aa5f7ffff6 }, { 0xa43282ce034c5c79, 0x74796517a7b5fd4c }, { 0x702ff13046c126e1, 0xb9e1dde836149cc1 }, { 0xf7fefde9aa14bb1b, 0x901b595e5d3e7114 },
+ { 0x3144941d67895d9f, 0x5c9f14865679c589 }, { 0x4e62ec6b1087c674, 0x857475d05ebeb887 }, { 0x846d4e19375705f8, 0x88f87690b37ad857 }, { 0x77414b337a781c5a, 0xe65a15070d84e578 },
+ { 0xb529da0450de5867, 0xd4676216e5031dde }, { 0x2d3f39119728b536, 0xe336b2bcba7ce228 }, { 0x9cc41bd620cd4fe8, 0xc9e8ea63bcbfb3cd }, { 0x50703de772da7f60, 0x4560ce6f22dbb9da },
+ { 0xbbf56d02286f2cd2, 0x6ad2310b93e0ef6f }, { 0x1675e2c96f2b3ea5, 0xffa5cfee7926992b }, { 0xca0fa27227d0c38c, 0x0d8c0340edc460d0 }, { 0x02697c8092fc51bd, 0x7fbd1d85906026fc },
+ { 0x678f2db96094d1fb, 0x98fbfda507021694 }, { 0xe7309b63b0f876ba, 0xeebab1fc57b882f8 }, { 0xe9ec2c65c849020f, 0x500fe2e1215b7049 }, { 0x890dbbdf9464e94f, 0x974fd7ab1dc91f64 },
+ { 0xc9b3e0b2fc525b8e, 0xac8ef16635945552 }, { 0x2cea0751de567c89, 0x3d895d1ff24cf156 }, { 0x0507c683ae456b06, 0x2006d56aabf05f45 }, { 0x769475733306d5e5, 0x38e5faa445b4f606 },
+ { 0x8e6301dca8ddd3f4, 0xc8f41f44265966dd }, { 0x45b99deec673d9c7, 0x1bc7f3a783ad1573 }, { 0x1ac0294f85661bad, 0x3ead81769fa54d66 }, { 0x4fb7d22b59f90fcb, 0x5bcb9a73168eabf9 },
+ { 0xc001edb7b85a1580, 0x4d806a9478e7de5a }, { 0x88d8859fdd1a20f0, 0x49f0380855f90c1a }, { 0x5eac8ae10a6b0bd5, 0xfbd59d7254384b6b }, { 0xe559e7e322042707, 0x9107ac79c7d8a404 },
+ { 0x9f785916fb4fd7ea, 0x68ea184564ef864f }, { 0x7d4f04f6e5f2ca56, 0xa6567cd398a75bf2 }, { 0x8ab1f91f4fe6714d, 0x364d258dc5992ae6 }, { 0x9ead6756b2311e55, 0xb655f7e62cdf9531 },
+ { 0x8303f41a0bee3f43, 0xd743be7f88eaa1ee }, { 0x17a0dc892655f71a, 0x211a204d31168a55 }, { 0xef57a826bd8ef10b, 0xd10bc5ad52fb1a8e }, { 0x7393b3f09d43bee3, 0x18e32fceee44a943 },
+ { 0xddaf7efb01853496, 0x2c96230ddcd2ea85 }, { 0xd5c84dbe0cf3b327, 0x1327575cd99172f3 }, { 0x52194167e0262edd, 0x3addd3eab2bb9f26 }, { 0x665a13f929ea1844, 0x464412064f3205ea },
+ { 0x35966cde80b2ff26, 0xa2262e4fb5b989b2 }, { 0xcedd5ab1c0eb6135, 0xf33539890e042ceb }, { 0xb24760076c6762dc, 0x8bdcaaf9de936467 }, { 0xf62bc3a9e36a72a4, 0x4ea4b6fd150e626a },
+ { 0x74fd09f3a1fa8458, 0x4758e721d5d4d0fa }, { 0x490c56682c3efccf, 0xdacfbd3f652ec13e }, { 0xb8492fc2f3edb4d0, 0xcbd0c32d4bb0daed }, { 0x42d727edfacae37c, 0x447c3b48b83d6cca },
+ { 0x72468db0d43d775c, 0xc65cc06da674ba3d }, { 0x416b652d21487b7e, 0xe57ec96e606d5948 }, { 0x816a889a99126efe, 0xa8fea3fa188a8712 }, { 0xff99ceaca7623caa, 0xafaa2d0f587de962 },
+ { 0xdfc6027b9379652b, 0x532b3e884cb2cc79 }, { 0x4c0b90eb827b97c9, 0xfac96855cede9e7b }, { 0xdb14fab87442c792, 0xad920441af728042 }, { 0xafe9f34bd5b843ca, 0xeacae3607aa650b8 },
+ { 0x6aefd87fc3a73d4c, 0x874c5c9ea9b1d1a7 }, { 0x32f8d6ddbc0bc59d, 0xfd9de6a08e29f00b }, { 0x15c9a009b4a9a6a7, 0x5ea73dc8a176aca9 }, { 0x94a328932dbbc859, 0xf6599e32b9fc2bbb },
+ { 0xd11ab57debc8119e, 0xed9e6d953a513ec8 }, { 0xf2f93b6a0451d01d, 0xb01d8c34f6ce2e51 }, { 0xe05e21608c414c01, 0xb10179136c28fb41 }, { 0xa35c38cd3ff566c2, 0x2bc2adf89c2584f5 },
+ { 0x3c2461dbc4bab128, 0x4328b5bdf8ca02ba }, { 0xee829666f4f038b4, 0x0fb42a0e1acb09f0 }, { 0xf442bf2971962319, 0x3119ab78856e4496 }, { 0x26e4489441dcaa85, 0x7d8534cb676f4fdc },
+ { 0x2236b057a6e7083c, 0x833c0e0284af03e7 }, { 0x60e197ba5c2deb40, 0xc740354a3c926f2d }, { 0x111b58ca5392041e, 0xa01e070142b6e092 }, { 0x3e4d1d5b5646e095, 0x3c95a83868aa2446 },
+ { 0x1fc7efcc2b2370ab, 0x1eab541c34551223 }, { 0x0bdb7185d6f41fb3, 0x9eb38677dd13adf4 }, { 0x7f267876770e9beb, 0xd9eb615608c77d0e }, { 0x87d10cd9ecd59dfa, 0x29fa84b66b2aedd5 },
+ { 0x3f98231b1f38292a, 0xe22a479b209a3738 }, { 0xfa9e082f092757ac, 0x8facf865f38db627 }, { 0xdac1c4f83d3c0e2d, 0x732debe2e742933c }, { 0xd6740f7ed7712b25, 0xb225a57a01c14771 },
+ { 0x6fe81efc6de2564a, 0xa74a89f402418ee2 }, { 0xe83912258137cbb0, 0x8eb00d42696b6337 }, { 0x80bfb6dad06ca741, 0x76414c5950ba946c }, { 0x2838ff92396dde30, 0xc33067d6118cbd6d },
+ { 0xcbda9c326eae0a33, 0xd333ece3a5f473ae }, { 0xb69598c48b5cc065, 0x756590303d53285c }, { 0x2f56459105d4e48b, 0x9c8baf392a1cc4d4 }, { 0x799dfc3502c968ef, 0x58ef461a7b6717c9 },
+ { 0xecebeae6660c6909, 0x7009378b8aab2f0c }, { 0x37ff105e124eae9b, 0xdd9b33ca25d9af4e }, { 0xb99c1182ba937d6f, 0x156f2c8e0380c993 }, { 0xc6ba69f4cd9de684, 0xcc844dd80b47b49d },
+ { 0xfe4cf0ecee1cf515, 0x7115c2ac104dfa1c }, { 0xae3ccd0b9cc68a75, 0x34750cc3329643c6 }, { 0xb02e1c87fe9b3361, 0xf461b77c4ef3429b }, { 0x64336f79bb1649f9, 0x39f90f83df522316 },
+ { 0x1b15170fcc18d212, 0xe0126ed5d7955e18 }, { 0x48d9682865403570, 0x0470529c2d1ed240 }, { 0x1372244ac16e55a3, 0xdfa31a84d2d6c66e }, { 0xd2a6f7bd304a899c, 0x4c9c9fb3e2010b4a },
+ { 0x69539abf1825a54e, 0x264eaeb871e1e425 }, { 0x1c7bad0cf0a1e8a9, 0xbfa9a63aec0527a1 }, { 0xa78ec00ed8cec47b, 0xd57b97317fe5c8ce }, { 0x85b870597e29cc47, 0x56479933fb4acb29 },
+ { 0x7c9a3ab6ac8c03e9, 0x78e99370d097488c }, { 0x47d0e16e548f887a, 0x647aee2213cd338f }, { 0x6886a4ff515b6cf1, 0xf8f1411b39d1f75b }, { 0xa65bfe4e91b00dc4, 0x0bc4789237d5dbb0 },
+ { 0x197c6b8f5ee483af, 0x9faf735047f578e4 }, { 0x5cc5f66198975a68, 0x846880f7c4586d97 }, { 0xe18b1f20c53f85be, 0x6fbe96b02418e83f }, { 0x01d53e40497ec9bf, 0xdebfefa34830137e },
+ { 0x3923a7586affda2e, 0x632e60d7533a5dff }, { 0x6c545c3cb660ce48, 0x06487bd2da11bb60 }, { 0xa9527708a07fb0ce, 0x6bcec42c09063a7f }, { 0xc26891372aa6443d, 0x323d7711e887f8a6 },
+ { 0x2b84bd52e2ef4632, 0x623295f0c9dc88ef }, { 0x957616d364c501e6, 0x28e67191f1cc38c5 }, { 0xbf2795c1cf548e6b, 0x946b0bc27020a354 }, { 0x076eba033cb93abb, 0x5fbbc8ef3b9079b9 },
+ { 0x38f6991823811391, 0xbd918f741b0a4e81 }, { 0x0000000000000000, 0x0000000000000000 }, { 0x23e38e17ef99c183, 0x5d83e1a1cc9f1099 }, { 0x9071d050ca806ae0, 0x08e0a4fb5a3c6780 },
+ { 0xc3bdaf7763d88d82, 0xec8298b2a0b7ebd8 }, { 0x5d10c821d1e993d7, 0x5ad76f548c687ee9 }, { 0x8b64c75f0698b8f2, 0xe8f2ca2e8da93998 }, { 0x4ab014a8f7bc64cd, 0x7bcd4f19bd7ef4bc },
+ { 0x446ca3ae8f0d1078, 0xc5781c04cb9d060d }, { 0xa0e07a0de477fec0, 0x8ac05fde4475b177 }, { 0xb3925e472519ab63, 0x5563455a96a37719 }, { 0x25580a549a5e3287, 0xdc87c6edbf3f7a5e },
+ { 0x82d6ca5a4290f6fc, 0x09fc51dcc0dab290 }, { 0xde133c3bda07ac94, 0x8d94d12b0482df07 }, { 0x0cb5cb86ea4d2508, 0xc1084e98e683d44d }, { 0x205fccd7341b5981, 0xfc81138714cf251b },
+ { 0xfdf0b22c359e6d17, 0xd017308ac81dcf9e }, { 0x53cc7f27a958e762, 0xe4623c49fa8b8c58 }, { 0xb4fce44419a091d8, 0x0ad88db5ad330ea0 }, { 0xc866def2b52c9231, 0x72311ec57da4462c },
+ { 0x18a955cf179a4a10, 0x41109cf30fc56b9a }, { 0xd0cf8b3da2b6d821, 0x3321823672612db6 }, { 0xb740a684c22209da, 0xabda7f9375633b22 }, { 0x5577fb64dc9f1466, 0x65661b05892be69f },
+ { 0xc4d315745f61b739, 0xb339505d9b279261 }, { 0x6288eb3aced1bafd, 0xb8fd28cfacf249d1 }, { 0x09b20d0544084e0e, 0xe10e9bf24d738b08 }, { 0x59c230e236d2316e, 0xa46e559d6fa832d2 },
+ { 0x29edc1d27013178f, 0x1d8f887559bcae13 }, { 0x3443529ec9cc3699, 0x7c99c1ecfd899acc }, { 0xba2053426111e56d, 0xb46ddea8dbd0fc11 }, { 0x6b3ae63f8ad9f4f3, 0x59f3b33de181c2d9 },
+ { 0xb1fb22c7b7e5fade, 0x2ade58df06c351e5 }, { 0xccb4263152173088, 0x8c88240c9e640a17 }, { 0xea506ea513cb9a0d, 0xf10d10c7f90b45cb }, { 0x2a518312ab918f8d, 0xbc8d7a5381ec9b91 },
+ { 0xbef2ab81862a47d4, 0x4ad4e4613810b02a }, { 0x971f6a53f639505b, 0x575b6c1461ac1e39 }, { 0x58170ea27facf8d1, 0x7ad1ba3e279821ac }, { 0x9218acd0587c3b5d, 0x775db97eca5c417c },
+ { 0xe3e263a057c3d403, 0x10038b35b478cec3 }, { 0xac55b18b0e3adbc8, 0x4bc81146a2f6653a }, { 0x40be5b6d6836b2c1, 0x3bc126cd285d4a36 }, { 0xad808fcb47441277, 0x9577fee5eac67644 },
+ { 0x273176d408a2633a, 0xa33adb682f5f5ca2 }, { 0x8ddf431c735f4bf6, 0x69f6ed62fe09535f }, { 0x04d2f8c3e73ba2b9, 0xfeb93ac9e3c04c3b }, { 0x10ce668a1aeccda1, 0x7ea1e8a20a86f3ec },
+ { 0xa5e7bc8e4a3295c6, 0xaac68ab4ef85ee32 }, { 0xa289068d768baf7d, 0xf57d425bd415978b }, { 0x362a2e1e5b306724, 0x0324dc696de9bc30 }, { 0x51a503a73ba4b6df, 0x9bdf21cc6aebaaa4 },
+ { 0x56cbb9a4071d8c64, 0xc464e923517bd31d }, { 0xd373c9fd79344023, 0x92237010aa311834 }, { 0xab3b0b883283e173, 0x1473d9a999661c83 }, { 0xbc9bd70114d61669, 0x3569f9e4a87096d6 },
+ { 0x141c9e49fdd76f18, 0x8018d26be946bfd7 }, { 0xe2375de01ebd1dbc, 0xcebc6496fc48ddbd }, { 0x635dd57a87af7342, 0x6642c76ce4c25aaf }, { 0xf14579aadfd3481f, 0x111f7e122e9e1bd3 },
+ { 0xd41d73fe458d7a98, 0xcd98b8ff91a1618d }, { 0x9baaa1d51c747553, 0x9653228c872fca74 }, { 0x96ca5413bf4799e4, 0x89e483b7299c0d47 }, { 0xf9224aefd2a5cfae, 0x2eae0a432bdd83a5 },
+ { 0x54a2c52495e1ddd9, 0xbbd9f4a6c11bf5e1 }, { 0x332de89df5750c22, 0x23220903c619e375 }, { 0x7bf480b590353952, 0x27525b9feb073135 }, { 0xe6e5a523f986bf05, 0x30055e5f1f889186 },
+ { 0x5a7e7222ed50a96c, 0x056ca7bbb7f80750 }, { 0x5bab4c62a42e60d3, 0xdbd34818ffc8142e }, { 0x6134a9fa155322ff, 0x19ffdae974a27c53 }, { 0xd7a1313e9e0fe29a, 0x6c9a4ad949f1540f },
+ { 0x3a9fe598b17d422c, 0xc22c92f18b6a687d }, { 0xdc7a40bb48fbfd29, 0xf229ccae94e2f9fb }, { 0x71facf700fbfef5e, 0x675e324b7e248fbf }, { 0x9d11259669b38657, 0x175705c0f48fa0b3 },
+ { 0x7a21bef5d94bf0ed, 0xf9edb43ca337224b }, { 0x65e65139f2688046, 0xe746e02097623068 }, { 0x2e837bd14caa2d34, 0x4234409a622cd7aa }, { 0x4b652ae8bec2ad72, 0xa572a0baf54ee7c2 },
+ { 0x0edcb70678b174b5, 0xbeb5531d76e3f2b1 }, { 0xf8f774af9bdb0611, 0xf011e5e063ed90db }, { 0x93cd92901102f2e2, 0xa9e256dd826c5202 }, { 0xbd4ee9415da8dfd6, 0xebd61647e04085a8 },
+ { 0x99c3dd558e8824ee, 0xe9ee3f09174fec88 }, { 0xd8a8b878afc05f90, 0x0c90f6677722b5c0 }, { 0x1e12d18c625db914, 0xc014bbbf7c65015d }, { 0x218af2977d65903e, 0x223efc245cff3665 },
+ { 0xc5062b34161f7e86, 0x6d86bffed317811f }, { 0x8c0a7d5c3a218249, 0xb74902c1b6394021 }, { 0x6d81627cff1e07f7, 0xd8f794719221a81e }, { 0x0f09894631cfbd0a, 0x600abcbe3ed3e1cf }
+ }, {
+ { 0xccaa9a639a4178a8, 0x1b8e63bf2db66b6d }, { 0x9b3742c942ad31b4, 0xf815c9c0cb2980c6 }, { 0x1018d590d529de96, 0x4ef0907ad240edbc }, { 0x79a4cc37cc7ce41e, 0xd3e237d7b6279a97 },
+ { 0x47850d3a0dc5978a, 0xad6b3a0534df0617 }, { 0x05e68d2d8dcd02f5, 0x2f332db071146154 }, { 0xbf018f0e8f64989f, 0x960a0ecb79b93352 }, { 0x3fc1e804e8efa7a5, 0xa386049d26fc57fb },
+ { 0x8acfbe50bed23b13, 0x6bea50f5bd6da601 }, { 0xb904793879532539, 0x1d2838aa27a1cc8b }, { 0x90d8b29ab2a2e1ac, 0x7b7c9a2c8d058915 }, { 0x567df1a3f1ba9d2d, 0x3e94a330429b20d0 },
+ { 0xe89c57a45788d183, 0x7591a4b49f26d8f9 }, { 0xa31375f27523ff86, 0x0dbef27317c9e39f }, { 0x685c30ae3003eeb9, 0x401daee2c063bc50 }, { 0xed7ada89da45d376, 0x5aa28904ee32b9ad },
+ { 0xdd5266fa663e720f, 0x8871fa8a5bf24daa }, { 0xacfa218521b7f95a, 0x7ceb856084f54063 }, { 0x744eca52ca4489a0, 0xdba9525aae136c9d }, { 0x4c6afd69fdca4792, 0x2e0269e972f30fc4 },
+ { 0xd35b1b841bfca0e2, 0x242b84d66cca252d }, { 0x4a6f0b5f0bfdfa34, 0xa5205f882cebf01d }, { 0x37cd634c631ac8ee, 0x84fe4ca04fdcc0a5 }, { 0xdf5134e83492196d, 0xf16fe814d0fa185c },
+ { 0x25d6e4cee49f7d1a, 0xb310ce44169478ef }, { 0xf964ab3dabf7db24, 0xe66e3d81e962fe3e }, { 0x6e59c698c634531f, 0xcb3f98839e7b4389 }, { 0xc546382238e2c3d2, 0xe1f922cde0923748 },
+ { 0x0beff053f00fd018, 0x836953ec462c09d3 }, { 0x73ab156d1525e037, 0x8d846d74540f583f }, { 0xbae7022302a99a6a, 0xb939237b08ad5206 }, { 0xcb4f455c4520113f, 0x4da35c91d7aa5fcf },
+ { 0xbee1a607a6324cae, 0x4b050784ddbdf829 }, { 0xb30ba062a00a2110, 0x434e6209c5890e23 }, { 0xfb67f92ff95bb046, 0x9f702f1f626aabc8 }, { 0xc8ac3e473edaae6c, 0xe9b24740f8a6c142 },
+ { 0x23d312f812a8c0bc, 0x3832f825488c8736 }, { 0x94de16be16393768, 0x8940bed35815233a }, { 0x81204e034eddeb0b, 0xe8830319fb41afd2 }, { 0xdcb24ff34f68a63e, 0x557ef3c5fff686d1 },
+ { 0x84c6c32ec310e9fe, 0xc7b02ea98a55ce86 }, { 0xdb5790cc9009cfa9, 0x0353cceb05eab273 }, { 0x1df2d3f5d311b328, 0x46bbf5f7ca741bb6 }, { 0x7ba79e259ed08f7c, 0xaafc25493d2fcf61 },
+ { 0x6050bbe6bbf681f2, 0x6765e6dfa9432b0e }, { 0x1a170cca0c70dabf, 0x1096cad930682f14 }, { 0x121b87828785b5f4, 0x37ee82e45948b84a }, { 0xd954c2dec2a5a4cb, 0x7a4dde758ee2e785 },
+ { 0x724b3c643c733406, 0x508b643bf00b9344 }, { 0xf68dff4aff63ddf8, 0x973b4a927a5e5dc2 }, { 0x342e185718e077bd, 0x20ef577160d05e28 }, { 0xd4bec4bbc49dc975, 0x7206bbf896d6118f },
+ { 0x39c41e321ed81a03, 0x28a432fc78e4a822 }, { 0x6dbabd83bdceec4c, 0x6f2e8352b177dd04 }, { 0x080c8b488bf56f4b, 0x2778483d6920975e }, { 0x58748cdd8c784fc0, 0x92cedd6c75a34857 },
+ { 0x5c7228f928e39904, 0x60f2f993a0b3e278 }, { 0xfe8174027496b2b3, 0xb04302af137eca9c }, { 0xb50e5654563d9cb6, 0xc86c54689b91f1fa }, { 0x2dda6f866f6a1251, 0x946886797fb4efb1 },
+ { 0x7c42411a41b1e6eb, 0xfcd11a67c733fbc3 }, { 0xdab7b9c5b95f1b98, 0xde5cc5a4a1ee7908 }, { 0x9cd29df69dcc5823, 0xae38f6ee3135b464 }, { 0xf56e8451849962ab, 0x332a51435552c34f },
+ { 0xe97c7ead7ede05b2, 0xa89eadfb3b221382 }, { 0xcd4ab36ab317ac99, 0xc6816af089b2a016 }, { 0x7e411308131d8d89, 0x85cf08f94c3bae35 }, { 0x362d4a454a4c1cdf, 0x59f145efebd80bde },
+ { 0xf36b726772aedf0d, 0xb80867220b4a3c96 }, { 0x01e029092956d431, 0xdd0f094fa404cb7b }, { 0x9f31e6ede636e770, 0x0a29ed3f1e392ae9 }, { 0xa6f5f8dff8eefd73, 0x228ddfc366dd82cb },
+ { 0x4060d205d2a4fe1d, 0xfb46052bcec332b5 }, { 0x22333bf13bfe148d, 0xe53df16aec884c4d }, { 0x5994a5d4a52e9bf1, 0x4fc1d423d1a7832c }, { 0x6c5a948a9498387d, 0xb2218a1d1573167f },
+ { 0xd6bd96a99631a217, 0x0b18a9661dde4479 }, { 0x4180fb0cfbf22a2c, 0x26490c646ac7f9ce }, { 0x5d9201f001b54d35, 0xbdfdf0dc04b72903 }, { 0x69bc19a719553a88, 0x9d12a7ad6467772b },
+ { 0x498c704470074567, 0x0131445903e76e90 }, { 0xea9f05b60524bae1, 0x0c8fb62a142e8d0f }, { 0x8cca486648e586b5, 0xe0c86694e37559d8 }, { 0x70486e766edf5f64, 0x299576a57b03c6b2 },
+ { 0xd0b8609f60061fb1, 0x803a9f0743c6bba0 }, { 0xb8e450315005f108, 0xc02731e583a507f0 }, { 0xb6ed2d4f2dc723e5, 0x6c7d4fb9b49d6f77 }, { 0x579dd8aad8ec491c, 0xe39baa7fe69febab },
+ { 0xad1a088c08e12d6b, 0xa1e48c2f20f18b18 }, { 0xdeb11de11dc4cd5c, 0x2c60e15b74fed327 }, { 0x4d8ad460d49c93a3, 0xf30d60a6d6f7c4bf }, { 0x09eca241a2a3bb7a, 0xfa774172cd245c25 },
+ { 0x45865f285f69fce8, 0xd475289bbfd753e1 }, { 0x7da2681368e732da, 0x21de1328633730b8 }, { 0x8ec91a741a49edd7, 0x99d6740a687d0c2e }, { 0xd8b4ebd7ebf370fa, 0xa742d73a2ae62cfe },
+ { 0x11f8fc99fc7f0aa7, 0x93ff9935764426c7 }, { 0x426380178008957f, 0x825817b545cb6743 }, { 0xa11027e0278f94e4, 0x74a0e0ed9cc1b669 }, { 0x0c0a2f6c2f6eb98f, 0xd5446cc2bc303d71 },
+ { 0x63b3c0fdc00c3ea1, 0xc374fd0e864fb583 }, { 0x141e71b471b20852, 0xbcccb48507504793 }, { 0x19f477d1778a65ec, 0xb487d1081f64b199 }, { 0x973d6da56dc3883b, 0x2d51a5027719bdb7 },
+ { 0x5a77decfded424a2, 0xebd0cff2feab1da1 }, { 0xe77503d3031cd75f, 0x04c4d3a70c1a7b05 }, { 0x3a2765296522a550, 0x8cb5292d57e836af }, { 0x1ff181e781bdd84a, 0x3fa5e769417c4e40 },
+ { 0x5f9153e253192657, 0xc4e3e2428fbf7cf5 }, { 0x71a8477f47898b55, 0xf49a7feadf070dc9 }, { 0x0fe95477549406dc, 0x71557713933ca3fc }, { 0x21d040ea4004abde, 0x412ceabbc384d2c0 },
+ { 0x91389b939bf4359d, 0xa67393632901426e }, { 0x98d439d239578ee7, 0x5c04d211e4251e4b }, { 0xa91caca8ac7afbaf, 0x53d8a8d0f5e12137 }, { 0x07e5df3fdf616997, 0x562d3f2efa1c34a2 },
+ { 0xe2938efe8ed1d5aa, 0x2bf7fe177d0e1a51 }, { 0xd75dbfa0bf677626, 0xd617a029b9da8f02 }, { 0x7a47b72cb7865b4d, 0x77f32c06992b041a }, { 0x66554dd04dc13c54, 0xec47d0bef75bd4d7 },
+ { 0x2bdf99b0995daff7, 0x1f4ab01821ac1068 }, { 0x44667621763f28d9, 0x097a21d41bd3989a }, { 0x8d2a616f61b35284, 0x3dc76fdb477192a3 }, { 0x9ed1cfe4cf603341, 0xd726e470ba3de192 },
+ { 0xff615d0b5dc06682, 0x6d4c0be0b77a01e7 }, { 0x993410db10015ad6, 0x810bdb5e4021d530 }, { 0xa2f35cfb5c752bb7, 0xd0b1fb3cb3cd28e4 }, { 0x6a5f62bc62af85db, 0x3903bc7c4b6be9a6 },
+ { 0x2436cdc7cdc9a92b, 0x6e1fc70bb290b394 }, { 0x0605f636f637bda6, 0x8b2236615e18ffd9 }, { 0xaef97397731b9238, 0x05f597fe0ffd1595 }, { 0x92dbe088e00e8ace, 0x026288b2060ddce3 },
+ { 0x29dccba2cbf1c495, 0x6654a286aaa4459e }, { 0x88ccec42ec7e5071, 0x12f4426b3665f3f7 }, { 0x61b092ef92a055c3, 0xba6aef900d47e075 }, { 0x1bf725c325260e8e, 0xcd99c396946ce46f },
+ { 0xf48ead58adcfb69a, 0xee25580cf1560834 }, { 0x203069e369527fef, 0x9c23e3f4678019bb }, { 0xee99a192a1bf6c25, 0xfeb392d5c13e2720 }, { 0x283ce2abe2a710a4, 0xbb5babc90ea08ee5 },
+ { 0x527b558755214be9, 0xcca887cf978b8aff }, { 0xf28b5b6e5bf80b3c, 0x65076e6daf4ef7ed }, { 0xf16820752002b46f, 0xc11675bc80426960 }, { 0x2e39149d1490ad02, 0x30799da850b8713c },
+ { 0x17fd0aaf0a48b701, 0x18ddaf54285cd91e }, { 0x96dd44ac44955c0a, 0xf05eac4dd31d76cc }, { 0xaf195a9e5a4d4609, 0xd8fa9eb1abf9deee }, { 0x3e21c10dc1b97394, 0x7e890dd282f89c80 },
+ { 0x0e097d7e7dc2d2ed, 0xac5a7e5c37386887 }, { 0x953e3fb73f6fe359, 0x544fb79cfc11e841 }, { 0x3bc74c204c747161, 0x51ba2062f3ecfdd4 }, { 0x83231c111c718069, 0x919d11877049fa24 },
+ { 0x0a0fd95ad9590429, 0x5e665aa3e228c2a8 }, { 0xc7456a306a4ea8b0, 0x98e730536b9a62be }, { 0x161d23a6231e6330, 0xc5d2a61b8c581265 }, { 0x2c3a468f463cc660, 0x49678f36dbb024ca },
+ { 0xc343ce14ced57e74, 0x6adb14acbe8ac891 }, { 0x8b2f97599784ef22, 0xb6e559ba19696d7a }, { 0xe49678c878e6680c, 0xa0d5c8762316e588 }, { 0xab1ffebafed690cd, 0x2ac6ba4e7ee974c1 },
+ { 0x1e11a8eea8eb0c7b, 0xe2aaee26e578853b }, { 0xbb072b2a2bff4e5b, 0x64362a34aca9997d }, { 0x892cc54bc5288440, 0xcffb4b249261388c }, { 0xc4a6112b11b417e3, 0x3cf62b824496fc33 },
+ { 0xef79889b88e9b814, 0x23bc9b9a653aec5b }, { 0x0000000000000000, 0x0000000000000000 }, { 0xbd02dd1cddc8f3fd, 0xef141c55f2b166a4 }, { 0x27d5b6dcb6331678, 0xca0edcda9d9c2d19 },
+ { 0x8725b835b8ea56ad, 0x63a13578a559500b }, { 0xeb7f2cbf2c726ed0, 0xd180bf65b02a4674 }, { 0x75aee35be3125d91, 0x06a65b150a17a7e6 }, { 0xaaffd7b3d78044fc, 0xf7c9b301daedbfba },
+ { 0xe170f5e5f52b6af9, 0x8fe6e5c6520284dc }, { 0x6bbf4bb54bf951ea, 0xe40cb533ef6f22dd }, { 0x9ad76bc06bfbe585, 0x251ac08f6f2d4bbd }, { 0x559e8ab88a40227e, 0x9a85b8e16d97be5d },
+ { 0xfa87d026d00d6477, 0x427f2650c66e60b3 }, { 0x3dc2ba16ba43ccc7, 0xda981603adf4020d }, { 0x13fbae8baed361c5, 0xeae18babfd4c7331 }, { 0xc94c174e178c7a5d, 0x34bd4e0f5ca20a39 },
+ { 0x80c0670a678b3f3a, 0x358c0a565f4564a9 }, { 0xa0f00ee90ed940d5, 0xa9afe9a238c57d12 }, { 0x5e717aeb7a4ff266, 0x19eceb0d2bbbb78e }, { 0x50780795078d208b, 0xb5b695511c83df09 },
+ { 0x26359fd59f65c249, 0x1701d5953998e662 }, { 0x764d984098e8e2c2, 0xa2b740c4251b396b }, { 0x2a3fb0b9b00b7bc6, 0xc245b95785a8db13 }, { 0x486c594d59519156, 0xdc3e4d16a7e3a5eb },
+ { 0x4383a91ea95e414e, 0x5f571efae1cfac38 }, { 0xc0a0b50fb52fc127, 0xceca0f7d9186561c }, { 0x8f29337d331f39e6, 0x44d97d45cc79c755 }, { 0x5b97f7c6f782f093, 0x36dfc6bd5aafd6da },
+ { 0x46652433249343bb, 0x7064334a90dbcd6c }, { 0xfc822610263ad9d1, 0xc95d103198769f6a }, { 0x15fe58bd58e4dc63, 0x61c3bdcaa3548ce8 }, { 0x4f8986728630f8c1, 0x8a1372385dff9149 },
+ { 0xc2a3e71de783aa45, 0xb7d41de31a8e03ea }, { 0xe090dcecdc7dbec8, 0x52e9ec89f6064fa7 }, { 0xc1409c069c791516, 0x13c5063235829d67 }, { 0x322bee61eed7ca1b, 0xabcd61103ec8a1f1 },
+ { 0xa51683c483144220, 0x869cc41249d11c46 }, { 0xe373a7f7a787019b, 0xf6f8f758d90ad12a }, { 0x77adb149b1be36f3, 0x7fb8498b811ff210 }, { 0x7fa13a013a4b59b8, 0x58c001b6e83f654e },
+ { 0x4e69af7baf662cf0, 0x571c7b77f9fb5a32 }, { 0x7844e53ee52a302f, 0x0eed3e98122351ec }, { 0x51982e9c2edbf4ba, 0x68b99c1eb8871472 }, { 0x547ea3b1a316f64f, 0x478ab1aec9937526 },
+ { 0x0dea066506386dbe, 0x084b658d1834f60a }, { 0x9d32b4ffb49a8c12, 0x7337ffa195317f1f }, { 0xb0e8db79dbf09e43, 0xe75f79d8ea8590ae }, { 0x8526ea27ea463dcf, 0x1abf27e62e5105fd },
+ { 0xf76dd643d63509c9, 0x4a3443ddde5a96b9 }, { 0x33cbc768c7811e2a, 0x76c2685f9acc6a8a }, { 0xa4f6aacdaa429611, 0x5b93cd5dedd5d73d }, { 0xf884823482a10f15, 0x3b6134ce4d663545 },
+ { 0x3c22931f931518f6, 0x07971f4c09f0c976 }, { 0x0203521252ac6b62, 0x791e129e8b0855f6 }, { 0xbce2f415f49e27cc, 0x321b151a56b5addf }, { 0xfd620f190f6c0de0, 0x1452197e3c725411 },
+ { 0x35ce315e31b6a38c, 0xfde05e3ec4d49553 }, { 0x6253e9f4e95aea90, 0x1e7bf441224b7ef8 }, { 0xec9af380f3130747, 0x87ad804b4a3672d6 }, { 0x933bc981c9585eff, 0xdf6d81fda2091798 },
+ { 0xc6a5433943187c81, 0x45e8391ccf9ea9c5 }, { 0xf088097c0954605e, 0x1c197cf32446a21b }, { 0xcf49e178e1bbc7fb, 0xbf9f786e02baf5e0 }, { 0x3028bc73bc7ba179, 0xd2d3738eb5c0f407 },
+ { 0x64561fc21f6d5736, 0x9559c2207c538121 }, { 0x3824373b378ece32, 0xf5ab3bb3dce06359 }, { 0xcaaf6c556c76c50e, 0x90ac55de73ae94b4 }, { 0xd2bb328d32aa74d3, 0xf9248d99c8ceee56 },
+ { 0x2fd93d943dc67933, 0xed7694e7f4bcba47 }, { 0x03e37b1b7bfabf53, 0xa4111bd12f0c9e8d }, { 0xb4ee7f5d7f6b4887, 0x15635d273f953a81 }, { 0xb2eb896b895cf521, 0x9e416b46618dc558 },
+ { 0xb70d04460491f7d4, 0xb17246f61099a40c }, { 0x65b636cb363b8307, 0x4856cb6fd8574a5a }, { 0x31c8957a952d7548, 0x0fdc7ac111c43f7c }, { 0x18145ed85edcb1dd, 0x6988d847bb607ae2 },
+ { 0xe6952ada2a4a036e, 0xd9cbdae8a81eb07e }, { 0x0406a424a49bd6c4, 0xf23c24ffd510aa2f }, { 0x82c3351835275458, 0x4c9218c8d44d315f }, { 0x86c5913c91bc829c, 0xbeae3c37015d9b70 },
+ { 0x4b8f225622ab2e05, 0x782f56c788ef3b66 }, { 0x1c12fafcfa476719, 0x9bb4fcb86e70d0cd }, { 0x539b7c8e7c779fd8, 0x11a78e80338f4184 }, { 0xd15849964950cb80, 0x5d359648e7c270db },
+ { 0xa8fc85a1852c2f9e, 0x8ed7a19f51e5ea4c }, { 0xd55eedb2edcb1d44, 0xaf09b2b732d2daf4 }, { 0xcea9c871c8ed13ca, 0x62907121a6be3e9b }, { 0xe57651c151b0bc3d, 0x7ddac13987122ef3 },
+ { 0x6fb9ef91ef62872e, 0x163091cc3a7f88f2 }, { 0xb108f270f2a64a72, 0x3a5070974e815bd5 }, { 0xa715d1d6d1b82942, 0xff82d68cc2d949b0 }, { 0x67b564d96497e865, 0x3148d9f1535f1fac }
+ }, {
+ { 0xde4d3e3681b6c304, 0x8f11725e92ccbe9f }, { 0x8a217a33ba2934c5, 0xb532fb900b9b6027 }, { 0x648be19c9b407bdf, 0xb7bd2db8a8103d4d }, { 0x5a66c8651f2784b7, 0xbfc4f31861798a26 },
+ { 0x30e7a599a0df8c1e, 0x8d9ea4763147e3f5 }, { 0x8ea7125ea2149426, 0xdb705dc4c1055843 }, { 0x5ba6d2ef19b9acff, 0x45353b0db2bf843f }, { 0xfd74d6854bfcf2c8, 0xb4949084bb3faf12 },
+ { 0x795f20d6d56db57b, 0x844111c2488a9bab }, { 0xafddce3a64a1f57a, 0xd7d4ec348db955fc }, { 0xc259e5f6c90525e8, 0x461c8631a1901660 }, { 0xc399ff7ccf9b0da0, 0xbced4e2472561879 },
+ { 0x0fca96ea22265b3e, 0x7f16b2c32be85a87 }, { 0x14db0b1a78c965e9, 0x15897bc764a3d837 }, { 0xa918928070630509, 0x8eb7194a226871aa }, { 0x816d84b48032cf18, 0xa466ef07eaed02c4 },
+ { 0x2d3364d3eef242ba, 0xbe62980cd1dd4513 }, { 0x45f13df85df51a83, 0xbb199c48e4ac30f2 }, { 0xe6654b751113cc1f, 0xde0b5980f4742da2 }, { 0x789f3a5cd3f39d33, 0x7eb0d9d79b4c95b2 },
+ { 0xebece9483fcac7b1, 0x963cb869bad36b17 }, { 0x8ce42689aeebc4b6, 0xec510eeea44a4471 }, { 0xcfd047cbe7dc2e46, 0x0e2b67d8ef3750d5 }, { 0xc01ad121c5fa7578, 0x713dd51bc4df0a52 },
+ { 0x467213a55794625b, 0x76c90777522522d9 }, { 0xfcb4cc0f4d62da80, 0x4e65589168f9a10b }, { 0x5d638e550d7b5c8c, 0x1c56ce731d6ea069 }, { 0x7b1c1401d992e5eb, 0xb36042e82dc58799 },
+ { 0x48789fc5732c112d, 0xf32e7da1aa0b7647 }, { 0x85ebecd9980f6ffb, 0xca24495320733aa0 }, { 0xd501c0b1bbad38d9, 0x9e4566c973badc7c }, { 0xbdc3999a08aa60e0, 0x9b3e628d46cba99d },
+ { 0xcc536996edbd569e, 0xc3fbfce759be42fe }, { 0x7050ea86e3891e36, 0xa234567fccb3e57a }, { 0x119d79fd666aed42, 0x813a15867dfbee4a }, { 0xc71f9711d7a6ad43, 0xd2afe870b8c8201d },
+ { 0xb2090f702a8c3bde, 0xe428d04e6d23f31a }, { 0xdb0b4cd19f154baf, 0x1ba21c1f8b9488e2 }, { 0x3127bf13a641a456, 0x776f6c63e281edec }, { 0xbac6dfaa1af6b8db, 0x38ac5fe63adc83d2 },
+ { 0xbf80ad4d04553070, 0xac1f31a72384b5af }, { 0xd948780693ea1b3f, 0x2c834f35eedb94d0 }, { 0xd888628c95743377, 0xd67287203d1d9ac9 }, { 0xb74f7d97342fb375, 0x709bbe0f747bc567 },
+ { 0x9bbc03cedc43d987, 0x3408ee1676608e6d }, { 0xbb06c5201c689093, 0xc25d97f3e91a8dcb }, { 0x89a2546eb0484c1d, 0x78e260afbd12720c }, { 0x3461cdf4b8e22cfd, 0xe3dc0222fbd9db91 },
+ { 0x121e57a06c0b959a, 0x4cea8eb9cb72fc61 }, { 0xad9efaed685ea5ea, 0xe0f5bf1ee8f649ce }, { 0xb50c494038d0e3e5, 0x47baed251134d955 }, { 0x88624ee4b6d66455, 0x8213a8ba6ed47c15 },
+ { 0x090fca5036e4ab4d, 0x267547bd84397ed1 }, { 0x27bf80ded277912f, 0x55c7448ee36d29e9 }, { 0x32a4914eac20dc8e, 0xbabff75c5408ffc7 }, { 0x054672e71ea388ab, 0x94b36e411958367d },
+ { 0x1c14dbc048b3e6ec, 0xc90df46f335ca8ff }, { 0x9f3a6ba3c47e7964, 0x5a4a4842bcfeb609 }, { 0x842bf6539e9147b3, 0x30d58146f3b534b9 }, { 0x74d682ebfbb4bed5, 0xcc76f02b062ddd1e },
+ { 0xd4c1da3bbd331091, 0x64b4aedca07cd265 }, { 0x4ebdc37f67eee15e, 0xaa4d88df05da5211 }, { 0xe9afdd9f33359721, 0xa11deb43df9c7725 }, { 0xd742f466b7526849, 0xa96435e316f5c04e },
+ { 0x983f2d93d622a15f, 0xf9d87529c0e99c46 }, { 0x49b8854f75b23965, 0x09dfb5b479cd785e }, { 0x39e86fc9963b2753, 0xabebe3cbb57e9d24 }, { 0x5825fcb213d8d427, 0x88e5a03204369614 },
+ { 0x2339e8b3ca4a31cc, 0x3b85e2da29f3118d }, { 0x97f5bb79f404fa61, 0x86cec7eaeb01c6c1 }, { 0x9373d314ec395a82, 0xe88c61be219ffea5 }, { 0x9a7c1944daddf1cf, 0xcef92603a5a68074 },
+ { 0x5369023529c32ffa, 0x99b1b4a5e540f4f7 }, { 0x25fcb409de88c1bf, 0x62e617a4862235db }, { 0x92b3c99eeaa772ca, 0x127da9abf259f0bc }, { 0xb04a3ba726736b4e, 0xd3098364086cef28 },
+ { 0x654bfb169dde5397, 0x4d4ce5ad7bd63354 }, { 0xc49cb94cddc7d59b, 0x1f7f734f0e413236 }, { 0x8be160b9bcb71c8d, 0x4fc33385d85d6e3e }, { 0x3eed29f98467ff68, 0x0879dea0c969b76b },
+ { 0xf638280271e70915, 0xa5c084135a49cdf1 }, { 0xe2e32318092e6cfc, 0xb049ffd43eea15c6 }, { 0x8d243c03a875ecfe, 0x16a0c6fb778c4a68 }, { 0xff37e2524703a258, 0x83b5c3aede70b320 },
+ { 0x9130e7c3e0c60a12, 0xdfad329444d0e297 }, { 0x3828754390a50f1b, 0x511a2bde66b8933d }, { 0xfef7f8d8419d8a10, 0x79440bbb0db6bd39 }, { 0x546c44053b9ff7c1, 0x3a2389ce9957deb8 },
+ { 0xd2048681a9f1e0e2, 0x3dd75ba20fadf633 }, { 0x57ef6a5831fe8f19, 0xf7f312f12fdecc93 }, { 0xef6a812527f76752, 0xf87e1e3d704d5373 }, { 0xa5512a37582426ef, 0x3c7130b6bf093906 },
+ { 0xddce106b8bd7bbdc, 0x42c1e9612445acb4 }, { 0x433461424937eaf0, 0xe27a69364b7d14a4 }, { 0x600d89f1837ddb3c, 0xd9ff8bec628e0529 }, { 0xa394768d4ce6d69c, 0x6512c5c810d81d50 },
+ { 0xf37e5ae56f4481be, 0x3173ea524311fb8c }, { 0xbe40b7c702cb1838, 0x56eef9b2f042bbb6 }, { 0xf9f2bee853c1522b, 0xdad636d071a19776 }, { 0x2bf63869fa30b2c9, 0xe7016d727e0c6145 },
+ { 0xe1600d45034f1424, 0x7d9964eb886307ed }, { 0x7dd948bbcd501598, 0xea03b7968214a3cf }, { 0xc1dacbabc3645d30, 0x8bcc1d0e1719044b }, { 0xa1d7425a4019860c, 0x523396e275970162 },
+ { 0xe86fc71535abbf69, 0x5bec23560c5a793c }, { 0x5ee0a008071a2454, 0xd186554cabe7b242 }, { 0x73d3c4dbe9e866ee, 0x6fe4cd407a3af751 }, { 0x35a1d77ebe7c04b5, 0x192dca37281fd588 },
+ { 0x66c8d54b97bf2b4f, 0x809c7e92cd5f217f }, { 0x68c2592bb3075839, 0x057b0444357175e1 }, { 0x512a36e2253c7f6a, 0xae90e78f800fe8c5 }, { 0x5f20ba8201840c1c, 0x2b779d597821bc5b },
+ { 0x55ac5e8f3d01df89, 0xc0d241db4a91d0a1 }, { 0xf0fd74b86525f966, 0xfca3716df598e9a7 }, { 0xcb562fa6ffe18ea5, 0x6069c18c25a968b1 }, { 0x638ea7ac891ca3e4, 0x142f10d3d4071702 },
+ { 0xd047b256a50eb072, 0x0af608886ae2ea01 }, { 0xf2be406f69daa9f6, 0xcb82224790d7f595 }, { 0x20bac6eec02b4914, 0xf65579e59f7a03a6 }, { 0x6fc71f1ba15b8002, 0xa6e9392f49665fae },
+ { 0x80ad9e3e86ace750, 0x5e972712392b0cdd }, { 0x4a3bab127fd341bd, 0xc40f2e8bcf446a75 }, { 0x1ad1877a5c71169f, 0x906e01119c8d8ca9 }, { 0x0486686d183da0e3, 0x6e42a654ca9e3864 },
+ { 0x08cfd0da307a8305, 0xdc848fa857ff70c8 }, { 0x6708cfc191210307, 0x7a6db6871e992f66 }, { 0x832eb0638ccd9f88, 0x9347bc2d8fa21ef6 }, { 0x443127725b6b32cb, 0x41e8545d376a3eeb },
+ { 0xd187a8dca390983a, 0xf007c09db924e418 }, { 0xf47b1cd57d185985, 0x92e1d7393f06d1c3 }, { 0xa8d8880a76fd2d41, 0x7446d15ff1ae7fb3 }, { 0x2f705004e20d122a, 0x8943cb26b4925921 },
+ { 0x6d842bccada4d092, 0x91c86a052c29439c }, { 0x94769524fe6582b9, 0x4b1e5cd55d88d4ea }, { 0x0c49b8b7284723e6, 0xb2c629fc9d6148ac }, { 0x2cf37e59e86c6af2, 0x44935019021b4b0a },
+ { 0x40b74f1f43569228, 0x2faaf209fdf4068f }, { 0xc8d501fbf580f67d, 0xadb95ab393207a9a }, { 0xfbb18a3f5f3e02bb, 0xedf765fa14ee8b44 }, { 0xfa7190b559a02af3, 0x1706adefc728855d },
+ { 0xdacb565b998b63e7, 0xe153d40a585286fb }, { 0xb4cc53ca3e4ecbad, 0xbd4b2530c2f2d74c }, { 0xce105d41e142060e, 0xf4daafcd3cf15ecc }, { 0x0e0a8c6024b87376, 0x85e77ad6f82e549e },
+ { 0x07054630125cd83b, 0xa3923d6b7c172a4f }, { 0x3622f923b41d7c6d, 0xd4fd51089e96c7a3 }, { 0x3f2d337382f9d720, 0xf28816b51aafb972 }, { 0x6a816dfcbff808a9, 0x325a576e503e69d3 },
+ { 0xc6df8d9bd138850b, 0x285e20656b0e2e04 }, { 0x4cfef7a86b11b1ce, 0x9d6cdbf560954e23 }, { 0xe4267fa21dec9c8f, 0xe92a0aaa913b3190 }, { 0xdc0e0ae18d499394, 0xb8302174f783a2ad },
+ { 0xdf8d24bc8728eb4c, 0x75e0ba4b410ab086 }, { 0x9635a1f3f29ad229, 0x7c3f0fff38c7c8d8 }, { 0x90f0fd49e658225a, 0x255cfa819716ec8e }, { 0xe32339920fb044b4, 0x4ab837c1ed2c1bdf },
+ { 0x8f6708d4a48abc6e, 0x218195d112c3565a }, { 0xeeaa9baf21694f1a, 0x028fd628a38b5d6a }, { 0x243cae83d816e9f7, 0x9817dfb155e43bc2 }, { 0x267f9a54d4e9b967, 0xaf368c9b30ab27f0 },
+ { 0xa2546c074a78fed4, 0x9fe30dddc31e1349 }, { 0x42f47bc84fa9c2b8, 0x188ba12398bb1abd }, { 0x03832e5d0a6178d8, 0xcdd09b3fb689122b }, { 0xece9af782d961f8a, 0x35ae8502c6c44158 },
+ { 0x6c443146ab3af8da, 0x6b39a210ffef4d85 }, { 0x0000000000000000, 0x0000000000000000 }, { 0xb68f671d32b19b3d, 0x8a6a761aa7bdcb7e }, { 0xab5ba6577c9c5599, 0xb9964a6047276d98 },
+ { 0xc55ca3c6db59fdd3, 0xe58ebb5add873c2f }, { 0x75169861fd2a969d, 0x3687383ed5ebd307 }, { 0x7190f00ce517367e, 0x58c59e6a1f75eb63 }, { 0xb18a212d20ed4306, 0x29f84b71dbaae131 },
+ { 0xaa9bbcdd7a027dd1, 0x4367827594e16381 }, { 0xd3c49c0baf6fc8aa, 0xc72693b7dc6bf82a }, { 0x1dd4c14a4e2dcea4, 0x33fc3c7ae09aa6e6 }, { 0xb945f1f71097c003, 0xf57cc4d98c5591f9 },
+ { 0x8668c284926e1723, 0x07f4d26c96fa288b }, { 0x105d637760f4c50a, 0x7bcbdd93ae3de053 }, { 0x1e57ef17444cb67c, 0xfe2ca7455613b4cd }, { 0x50ea2c6823a25722, 0x54612f9a53c9e6dc },
+ { 0xa6d2046a52455e37, 0xf1a1ab8909802b2d }, { 0x6e070591a7c5a84a, 0x5c18f13a9aa051b7 }, { 0xf13d6e3263bbd12e, 0x0652b978265ee7be }, { 0x37e2e3a9b2835425, 0x2e0c991d4d50c9ba },
+ { 0x3cae1d2e8898aff8, 0x3f588d8aac26ab59 }, { 0x0b4cfe873a1bfbdd, 0x11541497e17662e3 }, { 0x1758254772a81d31, 0xd859e0f8d22aca1c }, { 0x61cd937b85e3f374, 0x230e43f9b1480b30 },
+ { 0x29b50cbef6cfe259, 0xd0203e581b437d77 }, { 0xf5bb065f7b8671cd, 0x68101f2cecc0dfda }, { 0xf7f832887779215d, 0x5f314c06898fc3e8 }, { 0x7f9a7c6cc1af4508, 0xdd22e4bce75bbffd },
+ { 0xa7121ee054db767f, 0x0b50639cda462534 }, { 0x7213de51ef764ea6, 0x95150555a9fcf948 }, { 0xea2cf3c23954eff9, 0x6ccd707c6915650e }, { 0x024334d70cff5090, 0x3721532a654f1c32 },
+ { 0x1892b3ad508e460f, 0xa74f523bf9c2909b }, { 0x3d6e07a48e0687b0, 0xc5a9459f7fe0a540 }, { 0x624ebd268f828bac, 0xeeded8c607c1191b }, { 0x4177559545c8ba60, 0xd55b3a1c2e320896 },
+ { 0xe0a017cf05d13c6c, 0x8768acfe5ba509f4 }, { 0x47b2092f510a4a13, 0x8c38cf6281e32cc0 }, { 0x9cb945fece1f01bc, 0x979ad37d0a77a422 }, { 0xae1dd4b0623fdd32, 0x2d2524215e7f5be5 },
+ { 0x95b68faef8fbaaf1, 0xb1ef94c08e4edaf3 }, { 0xcd93731ceb237ed6, 0x390a34f28a784ce7 }, { 0xa01758d04687ae44, 0xa8c25ef7a6510f7b }, { 0x2eb04a8ee4933a62, 0x73b2033367545738 },
+ { 0xbc0383100e3448a8, 0x61cfaa98950da784 }, { 0x7e5a66e6c7316d40, 0x27d32ca9349db1e4 }, { 0x0a8ce40d3c85d395, 0xeba5dc8232b06cfa }, { 0x28751634f051ca11, 0x2ad1f64dc885736e },
+ { 0x3a6b41949c5a5f8b, 0x663b78f403f78f0f }, { 0xd682eeecb1cc4001, 0x5395fdf6c533ce57 }, { 0x7755acb6f1d5c60d, 0x01a66b14b0a4cf35 }, { 0x6b417776b96620e1, 0xc8ab9f7b83f867ca },
+ { 0x87a8d80e94f03f6b, 0xfd051a79453c2692 }, { 0xed29b5f22b0837c2, 0xcf5f4d1715024f41 }, { 0x217adc64c6b5615c, 0x0ca4b1f04cbc0dbf }, { 0xe5e665281b72b4c7, 0x13dbc2bf42fd3f89 },
+ { 0x22f9f239ccd41984, 0xc1742acffa351f94 }, { 0x7695b63cf74bee45, 0xfb57a3016362c12c }, { 0x16983fcd74363579, 0x22a828ed01ecc405 }, { 0xb885eb7d1609e84b, 0x0f8d0ccc5f939fe0 },
+ { 0x01c01a8a069e2848, 0xfaf1c815d3c60e19 }, { 0x59e5e6381546fc6f, 0x72146827d7f0980d }, { 0xa49130bd5eba0ea7, 0xc680f8a36ccf371f }, { 0xac5ee0676ec08da2, 0x1a04770b3b3047d7 },
+ { 0x82eeaae98a53b7c0, 0x69b674385c6410ef }, { 0x9efa7129c2e0512c, 0xa0bb80576f38b810 }, { 0x2a3622e3fcae9a81, 0x1df0a567adca6f5c }, { 0x7c195231cbce3dd0, 0x10f27f8351d2add6 },
+ { 0x99ff3719d0bc8917, 0x0329bd3c132f925f }, { 0x7adc0e8bdf0ccda3, 0x49918afdfe038980 }, { 0x13de4d2a6a95bdd2, 0xb61b46ac18b4f278 }, { 0xe7a551ff178de457, 0x24fa919527b223bb },
+ { 0x690243a1b5997071, 0xff8acc51e6b77bf8 }, { 0x151b11907e574da1, 0xef78b3d2b765d62e }, { 0x3bab5b1e9ac477c3, 0x9ccab0e1d0318116 }, { 0x562f70d23760a751, 0x0d02dae4fc18c28a },
+ { 0xc9151b71f31ede35, 0x574892a640e67483 }, { 0x1952a92756106e47, 0x5dbe9a2e2a049e82 }, { 0x4bfbb198794d69f5, 0x3efee69e1c82646c }, { 0x52a918bf2f5d07b2, 0x63407cb03686faee },
+ { 0x1b119df05aef3ed7, 0x6a9fc9044f4b82b0 }, { 0x4f7dd9f56170c916, 0x50bc40cad61c5c08 }, { 0x4d3eed226d8f9986, 0x679d13e0b353403a }, { 0x06c55cba14c2f073, 0x5963f57eafd12456 },
+ { 0x5ca394df0be574c4, 0xe6a70666cea8ae70 }, { 0x1f97f59d42d29e34, 0x04dd6f5085d5bad4 }, { 0x33648bc4aabef4c6, 0x404e3f4987cef1de }, { 0xb3c915fa2c121396, 0x1ed9185bbee5fd03 },
+ { 0xca96352cf97fa6ed, 0x9a980999f66f66a8 }, { 0x9d795f74c88129f4, 0x6d6b1b68d9b1aa3b }, { 0x0d89a23d2ed90bae, 0x4837e1e94ea746b5 }, { 0xf832a462555f7a63, 0x2027fec5a267996f }
+ }, {
+ { 0x97506fa9e7ab8079, 0xb4f01ab55adb20be }, { 0x6e9f451416971a91, 0xaa62580a55efe760 }, { 0x309432d1935fdc99, 0xce7f098967fc373d }, { 0x8bb82d43c2f942b9, 0x9d0b8ec0afb0f18a },
+ { 0xc95b186c62634671, 0xd0ed4b3668c8f0e3 }, { 0x0fbd471d410e4aea, 0x0704c7efe240f358 }, { 0x0251ccd0a74e56d7, 0x27f3d968f2ebf484 }, { 0x417b9f97b5f37995, 0x988d91aa4c078faf },
+ { 0x5d93dd7d90a1bb55, 0xb17605dfb96c5e9b }, { 0x0887b6c6d9fb9bda, 0x9c4ae2634e2a5655 }, { 0x73be619681e2f3db, 0x7101414bd9104c16 }, { 0xfa578005e455e7b5, 0xcbf916e3844b4918 },
+ { 0xfb9ee66d5672cc3f, 0x39619bd7fddf335a }, { 0x26aa0a2dc8b8d354, 0x5c3da6f72e5644d8 }, { 0xb8b4b52a44cfe37d, 0x861fd31543334871 }, { 0xf423a170177c86d5, 0x3e655c381f9fc002 },
+ { 0xa45cf7c0619d21bd, 0xafe44760b6589945 }, { 0x37aec30a0baa0da9, 0x55312c05cb969230 }, { 0x9c4f73d72b3966fe, 0xfdd1ac8a9f8ef82d }, { 0xd47a3ceef516af3b, 0x0b8e5277e4375b95 },
+ { 0xb6c0945fb7e6821d, 0x738399ced8e7c16b }, { 0xdeac46f88ba36236, 0xb037697c58f6f944 }, { 0x5931861e1d3d1738, 0xff53740f9e797550 }, { 0xa2af60734b4fdb07, 0xc632efd863a6460a },
+ { 0x6f56237ca4b0311b, 0x58fad53e2c7b9d22 }, { 0xc8927e04d0446dfb, 0x2275c602115c8aa1 }, { 0xb262cf3c3a7a2e70, 0x3da6e81efff2eaa0 }, { 0x8c82dc985a0c9389, 0x0645ab4c03da5487 },
+ { 0x1d2124829775e94a, 0xdb6319418cffab76 }, { 0x9501a37940e5d6ae, 0x9303c3dda830d43a }, { 0x0dec8bcde6401c3d, 0x20f71e8710ab07dc }, { 0x9e1ebf078c773029, 0xda2275e26d650ca9 },
+ { 0x01c96668b2272b8a, 0xf2988d3479947a42 }, { 0x163e38fc5be70fcd, 0x9242af7e49aa73e5 }, { 0xce61e9b7fa969741, 0x4ba36ebac4a255ee }, { 0x9b75820cb3ccb7ce, 0x669f890633e45d20 },
+ { 0x6580596ada05fc16, 0xe343ee3590ba3ff3 }, { 0x7f9b8c33d585c46c, 0xa36ed2f8b02f3188 }, { 0x40b2f9ff07d4521f, 0x6a151c9e3593f5ed }, { 0xa7c45d7874f45ce0, 0x7a8f133c3d271783 },
+ { 0x4f0fbee246da18f5, 0x6d11db71d7d306b5 }, { 0xae8a8dd61f28ecb0, 0x145d7c6b0a993b94 }, { 0x27636c457a9ff8de, 0xaea52bc357c23e9a }, { 0x8d4bbaf0e82bb803, 0xf4dd26787a4e2ec5 },
+ { 0xa0feaca3ec018dd0, 0xe1c136b0914db28e }, { 0x2e2dbceb1143488e, 0xc0774494607c128d }, { 0x3667a562b98d2623, 0xa7a9a131b202e872 }, { 0xa8791a6535fa160a, 0x7d8bd4d3df67e4db },
+ { 0x969909c1558cabf3, 0x46689781234f5afc }, { 0xd996b7231356b306, 0x2b794cf0f49c5c49 }, { 0x5c5abb15228690df, 0x43ee88ebc0f824d9 }, { 0xbf8e44f1dc3a324d, 0x1d51f699ef59ed7c },
+ { 0x4bade581cb46b498, 0x2334aaa1f0c62d7e }, { 0xb709f23705c1a997, 0x811b14faa173bb29 }, { 0x184a1989a8ce6ead, 0x67dee5a5d27efaff }, { 0xe8cbe39a322e4415, 0x179ec84deaf41136 },
+ { 0xe4ee0e3f664973a2, 0xc5f15bfe83cb6ca8 }, { 0xc1dcaeaabb98ddab, 0x4ca7a95526e2a6b6 }, { 0x1ce842ea2552c2c0, 0x29fb9475f56bd134 }, { 0x771c3af50c7e5fb6, 0x3f24309bfe0567dd },
+ { 0x84056a5e83f70853, 0x9a0f492f4df002d2 }, { 0xad12276e0a4191ed, 0xc136283781e6b552 }, { 0x67d195ba7d4baac1, 0xc4b0375d6251cb77 }, { 0xdcfd8a282ced34e1, 0x97c4b014aa1d0dc0 },
+ { 0xf8064cd5431bb162, 0xec0acf8b76a0bd9c }, { 0x94c8c511f2c2fd24, 0x619b4ee9d1a4ae78 }, { 0x82f6fdeda925f2e9, 0xf3d9e197980edd9d }, { 0x5aa92ca608546a65, 0x2a3820531506fb96 },
+ { 0xd62bf03e5258f9ec, 0x2c7d8b1f16dcaf11 }, { 0x0398aab815697d5d, 0xd56b545c8b7f8ec6 }, { 0x62baa8b142f02d26, 0x780dcbb93cd09afe }, { 0x29174d3089b699be, 0x5b396118cc16b780 },
+ { 0xc015c8c209bff621, 0xbe3f24615f76dcf4 }, { 0x6618f3d2cf6c814b, 0x3628ba691bc5b135 }, { 0xeb53492227473948, 0xc2f59c11618b9ff0 }, { 0xb491588f10a8d4ca, 0x547040a62a0c35ef },
+ { 0xb97dd342f6e8c8f7, 0x74875e213aa73233 }, { 0xc38d627a1cd68b7c, 0x6b54703dd4095232 }, { 0xe776a48773200eff, 0x109a0fa208b4e26e }, { 0xbb2c1f9251a69e20, 0x53748749c84cc6b7 },
+ { 0xdbc77bf3b418e5d1, 0x0c8a95980677a8cd }, { 0xfd6d71de7ca03685, 0x50b7336f2821ec15 }, { 0x5745a76bee147658, 0x0acf3ed405adfc4a }, { 0x906a9e727f5e5149, 0x2fbe3f39f6b185b3 },
+ { 0xb3aba954885d05fa, 0xcf3e652a866690e2 }, { 0x0b1f1c7ecc92e687, 0x4921b63fc555d893 }, { 0x19837fe11ae94527, 0x95466891abea80bd }, { 0xf9cf2abdf13c9ae8, 0x1e9242bf0f34c7de },
+ { 0x343669b21ec370f4, 0x805a785940e91cf6 }, { 0xa137cacb5e26a65a, 0x1359bb84e8d9c8cc }, { 0xd7e29656e07fd266, 0xdee5062b6f48d553 }, { 0x1bd2b331bda713f0, 0xb2b5b1f959017439 },
+ { 0xcfa88fdf48b1bccb, 0xb93be38ebd362fac }, { 0x879dc0e6969e750e, 0x4f641d73c68f8c14 }, { 0x51b630d8c4c68ce2, 0x6319966cd0532305 }, { 0xabe1b0dd20936b57, 0xa8e0808f54186a1d },
+ { 0x330c98698636a1c4, 0x1b145dd5ec83b9fb }, { 0xc6e65f71236d0c9b, 0xd7e98cd98a8803bb }, { 0x20599d9ee26a29ee, 0x35eb0e4ffba89b97 }, { 0x146ff42cfca9591a, 0xb5b17616bb418761 },
+ { 0xa59591a8d3ba0a37, 0x5d7cca54cfcce307 }, { 0x3cb1df74c738eb2e, 0x1c109a3a0ec34aa3 }, { 0x2b4681e02ef8cf69, 0x7ccab8703efd4304 }, { 0x7af0b138ea3e438b, 0x1fd32e1ceeae6001 },
+ { 0xee38742918fcbeaf, 0x7e4860f53f0ace79 }, { 0xea9a2f4a956012c2, 0x306d1125181fe5b2 }, { 0x4ec6d88af4fd337f, 0x9f895645ae477cf7 }, { 0x2190fbf6504d0264, 0xc773837b823ce1d5 },
+ { 0xe185333459f2f445, 0x794ca71add4a3d21 }, { 0x93f234ca6a372c14, 0xfad56b657dce0b75 }, { 0x1104c927c312defd, 0x090c8af2e5c0d6e8 }, { 0x6373ced9f0d706ac, 0x8a95468d4544e0bc },
+ { 0x7026cb2e948b8e86, 0xa46a1517526fc2d0 }, { 0x6bf4781f292c9d76, 0x16dfa4ee0b6eb6e9 }, { 0x381384174aa44743, 0x5235ebea29d66168 }, { 0x094ed0ae6bdcb050, 0x6ed26f5737be2c17 },
+ { 0xe5276857d46e5828, 0x3769d6cafa5f16ea }, { 0xbae579fae381b5aa, 0xa1ec0a7db1d8bcf5 }, { 0x8ed31048fd42c55e, 0x21b67224f131a003 }, { 0xaa28d6b592b440dd, 0x5a780dbb2d8c105f },
+ { 0x7dca40e372cb92bb, 0x849d0b9042c4c50c }, { 0xcc3025675dd8c196, 0x6c50b7d23649a16a }, { 0x54dd0dd3fb7d0b05, 0xdfa46a888ed2728c }, { 0x612202095799507b, 0xad669fe5b7af1438 },
+ { 0xc2440412aef1a0f6, 0x99ccfd09ad9d2870 }, { 0x686cd2a73c45e02b, 0xc3b4f0b28011382f }, { 0x2532a095ddd1ae09, 0x8956f2aba529ca1e }, { 0xbe4722996e1d19c7, 0xefc97bad96cd973e },
+ { 0x6cce89c4b1d94c46, 0x8d918162a70413e4 }, { 0x0ad67a167eb5cd0d, 0xbbb93b0bbcc1a2d1 }, { 0x315d54b92178f713, 0x3ce784bd1e684d7f }, { 0x754df625ab300961, 0x18d7e9f30cee9359 },
+ { 0x7b39d75058196801, 0xed4ba328973a1a43 }, { 0x5b604aceba7341ef, 0xd8a0ad676c9281d4 }, { 0xa366061bf968f08d, 0x34aa62ec1a323c48 }, { 0x2db51653042a35d3, 0x151c10c8eb039c4b },
+ { 0xdf652090398449bc, 0x42afe44821628306 }, { 0x60eb6461e5be7bf1, 0x5ffe12d1ce3b6e7a }, { 0xf1489c7b28c70132, 0x82d8a0dc411e918b }, { 0x78a17de84d70155c, 0x3820f7741c459485 },
+ { 0xf6726da0b032d002, 0x19968550ed743486 }, { 0xd5b35a86473184b1, 0xf916df439da321d7 }, { 0xd0d8678d788a0356, 0x45ab23a7c322705e }, { 0x727707fe33c5d851, 0x8399cc7fa0843654 },
+ { 0x39dae27ff8836cc9, 0xa0ad66de50421b2a }, { 0x79681b80ff573ed6, 0xcab87a4065d1eec7 }, { 0x32c5fe0134118a4e, 0xe98cd0e19517c3b9 }, { 0x42e3352fa09a04c8, 0x4de6c5f6c7780169 },
+ { 0x129c639fd67ba3a0, 0xdc67deae6ebf582e }, { 0x7c03268bc0ecb931, 0x760586a43b50bf4e }, { 0x4d5e7232e1944e22, 0x4ae202192538f231 }, { 0x46416e4c2d06a8a5, 0x03c3b426e06d2aa2 },
+ { 0x1eb98e3a821c9417, 0x0e084d1d078025b0 }, { 0x8a714b2b70de6933, 0x6f9303f4d6248bc8 }, { 0x3a4248c7edea1194, 0x75c63282db3d95ec }, { 0x7484904d191722eb, 0xea4f64c7757ae91b },
+ { 0x8654a68e24b95e84, 0xbdfc9047bf1bf656 }, { 0x5e0b77c585c8c608, 0x641d51833213d05d }, { 0xeff11241aadb9525, 0x8cd0edc1469eb43b }, { 0x3ee013a46076bdf9, 0x3be34352fc28be27 },
+ { 0x2208514e45247f39, 0x1218d72709436f13 }, { 0x0e742175f3296160, 0xf59c4adb9bd4891a }, { 0x58f8e076af1a3cb2, 0x0dcbf93be7ed0f12 }, { 0x8f1a76204f65eed4, 0xd32eff1088a5da41 },
+ { 0xf2d036c33dae7c6f, 0x57b3f480ca611f4d }, { 0x0000000000000000, 0x0000000000000000 }, { 0x04a25b638d9cac6d, 0x4e2571d027152bcb }, { 0x69a5b4cf8e62cba1, 0x312c7d86f985426d },
+ { 0x4a6483e979619f12, 0xd1ac27958952573c }, { 0xfef5db6669c94bd8, 0x85dc6733a35e62d3 }, { 0x9fd7d96f3e501ba3, 0x28baf8d614f176eb }, { 0x3d78b91c751fc0a4, 0xee88170e775730e1 },
+ { 0xe04c555cebd5dfcf, 0x8bd42a2ea4de4763 }, { 0xbddf88217b74649a, 0x3aa22ff11db219f8 }, { 0x6d07efac03fe67cc, 0x7f090c56de9069a6 }, { 0xff3cbd0edbee6052, 0x7744ea07daca1891 },
+ { 0xcdf9430fefffea1c, 0x9ec83ae64fdddb28 }, { 0x478808249f21832f, 0xf15b391299f950e0 }, { 0x35ff0fdaace45b7e, 0x72c2f56d397d66b4 }, { 0x98ed28b4a6a5ca93, 0xb3f4dd5ab89bd3e6 },
+ { 0x432a534712bd2f42, 0xbf7e48c2beec7b2b }, { 0x23c13726f70354b3, 0xe0805a1370d71551 }, { 0xe21d998c4c9b8918, 0xac27f3465635b3e7 }, { 0xf081fa139ae02ab8, 0x70402de8388aebc9 },
+ { 0x6a3d1e779b0bb6fc, 0xe44729da72faccab }, { 0x9abce46401eb9c44, 0x940704324a702762 }, { 0x7e52ea5b67a2efe6, 0x51f65fccc9bb4bca }, { 0xd85fd14ba171988c, 0xd9e1c1c48d08260b },
+ { 0xc57ef5c9360471c6, 0x0282d88501f78d7d }, { 0x833f9b851b02d963, 0x01416ca3e19aa7df }, { 0x522e9a60d1aff1bf, 0xb672c2305b2cadc3 }, { 0xeda0de910d95c3f2, 0xab2334a9b47540bf },
+ { 0xcac3b2d4770a3b2c, 0x05861f6ae3b77e25 }, { 0xc72f3919914a2711, 0x257101edf31c79f9 }, { 0x3f2975ccd2519673, 0xc97bce6685bcc465 }, { 0xd11101e5caad28dc, 0xb733ae93bab60a1c },
+ { 0x85cc0c3631d023d9, 0x6897c41b34647890 }, { 0xe3d4ffe4febca292, 0x5ebf7e722fa1c9a5 }, { 0x80a7313d0e6ba43e, 0xd42a38ff6ae52919 }, { 0x568cc1035c335dd2, 0xf857b3e07c398608 },
+ { 0x2c7c703bb60d1e59, 0xe7849dfc9297e609 }, { 0xe6bfc2efc1072575, 0xe20282967120982c }, { 0x99244edc1482e119, 0x416c506ec10fa9a4 }, { 0x816e5755bc4c8fb4, 0x26b2b5cb1371535b },
+ { 0xd289ab5ddfc45581, 0x6258facf31c984da }, { 0x882087fbd7903fe4, 0x4860da9c24cf7f4c }, { 0xf31950ab8f8957e5, 0xa52b79b4b3f5650f }, { 0xfca417b6ce871d0f, 0xa22fbe5b51b59657 },
+ { 0x17f75e94e9c02447, 0x60da224a303e09a7 }, { 0x64493f026822d79c, 0x11db6301e92e45b1 }, { 0x135505f7645c882a, 0x2eff539a172b226c }, { 0x4c97145a53b365a8, 0xb87a8f2d5cac8873 },
+ { 0xda0e1d9b063fce5b, 0xfe1218ac7fe3d28f }, { 0x55146bbb495a208f, 0x2d3ce7bcf74608ce }, { 0x2fe4da83a3646304, 0x32efc9a019e868cf }, { 0xcb0ad4bcc52d10a6, 0xf71e925e9a230467 },
+ { 0x4410a29c8a48fe72, 0x24306d4e1286de26 }, { 0x06f397b32ad2faba, 0x69d6a8b8d5fedf4f }, { 0x073af1db98f5d130, 0x9b4e258cac6aa50d }, { 0xc4b793a184235a4c, 0xf01a55b17863f73f },
+ { 0x5fc211ad37efed82, 0x9685dcb74b87aa1f }, { 0xa60d3b10c6d3776a, 0x88179e0844b36dc1 }, { 0xf7bb0bc80215fb88, 0xeb0e086494e04ec4 }, { 0x76d55c9dbe59743c, 0xcdbcbdaf87911d9f },
+ { 0x89e9e19365b7146e, 0xbaf857a85d5b050e }, { 0xd340cd356de37e0b, 0x90c077fb485dfe98 }, { 0x923b52a2d810079e, 0x084de651045a7137 }, { 0x507f56b076e1a768, 0x91811b58a9c75947 },
+ { 0xacdb4106b866ba67, 0x33aea503f872cf10 }, { 0x48354f39de2fc9c5, 0xf65ffefd7bb9a3b8 }, { 0x9d8615bf991e4d74, 0x0f4921bee61a826f }, { 0xb5583ee7a28fff40, 0xa6e8cd9253984fad },
+ { 0x71efad4626aca50c, 0x56f298232bfbb892 }, { 0x056b3d0b3fbb87e7, 0xbcbdfce45e815189 }, { 0x1f70e852303bbf9d, 0xfc90c0297e145ff2 }, { 0x15a692444e8e7290, 0x4729fb22c2d5fd23 },
+ { 0x1a1bd5590f80387a, 0x402d3ccd20950e7b }, { 0xaf43ebbead0fc73a, 0xe6c5f15f730d41d6 }, { 0x53e7fc086388da35, 0x44ea4f0422b8d781 }, { 0x28de2b583b91b234, 0xa9a1ec2cb582cdc2 },
+ { 0xe90285f280096f9f, 0xe506457993606b74 }, { 0x0c25eda5546737b7, 0xd26f93b3693f7d9e }, { 0x45d9c4f4386fd5f8, 0xd6a8e07a6b12a464 }, { 0x49fc29516c08e24f, 0x04c773c9022dd9fa },
+ { 0xdd34ec409eca1f6b, 0x655c3d20d3897782 }, { 0x24fbc6fd6ff68583, 0x7bce7f9fdcbdb05c }, { 0xf5eac718a55bad5f, 0xccfdd10c660bba40 }, { 0xb03303ec9d3478a7, 0x1a5531760d191e24 },
+ { 0x3b8b2eaf5fcd3a1e, 0x875ebfb6a2a9efae }, { 0xbc16ee49c9534f10, 0xc83aa2c5642663ba }, { 0x91a3f81acd797ac3, 0xdd26b20d8f25fff1 }, { 0xec69b8f9bfb2e878, 0x59bbb99dcde13afd },
+ { 0xb1fa65842f13532d, 0xe8cdbc42748d6466 }, { 0x10cdaf4f7135f577, 0xfb9407c69c54acaa }, { 0x2a8fe7889cdfe4e3, 0x8e52354447693946 }, { 0xa9b07c0d87dd3d80, 0x8f1359e7a6f39e99 }
+ }, {
+ { 0x65c2b33be281c8a2, 0xfc07a04ba88823c5 }, { 0x8f944c1f73ba5e7e, 0xeee6fd67b453c472 }, { 0xc13cd8790b9bcf65, 0xdd16ebda96a1fe2a }, { 0x3ad9cd22281fce09, 0x1150b36b1eef1689 },
+ { 0x2b6a275d9aa059b9, 0xcff7b6f68a7a199d }, { 0x187cdadc8fa223aa, 0x6eddb992f50608a1 }, { 0x6fe309621719403c, 0x312ea2c79f6b25cd }, { 0xa8c0062c4f4bf792, 0x169ef6d8a52ad95e },
+ { 0xf7db783585d5f139, 0xfbc9e5f8134dec12 }, { 0x7f0a244b5c64c3f0, 0xc4b8cd9a396f94b2 }, { 0x061fd73753c978cb, 0xfaa6bfc5ace002b9 }, { 0x532513776ccff6fe, 0xdad8ae692d6431fd },
+ { 0x85b5f6468622d6e0, 0x23cfffeb83b0c27a }, { 0x8ece8b498a784a02, 0xc5d797a786c27a19 }, { 0x4296f908de70614e, 0x047fabf4b9f13ee9 }, { 0x9dc92c9a0980f54a, 0x4d12467976b6cadb },
+ { 0x1d8d871114ee67e5, 0xe928b8d40f960ba5 }, { 0xa64a26eed85d2f3f, 0x77739fd25ac86239 }, { 0xa3bb7b2343116b70, 0xf0869e94a058613d }, { 0xa2e1bc75bad37f0c, 0xdbb7f45492c9df56 },
+ { 0x8c7ac6e5bb3f62fa, 0x93b543e4e223c5cf }, { 0xb208915cf1aefcc0, 0x2e219b0934cd6e29 }, { 0x29de6af1abe77141, 0x999562b5ee9ba64b }, { 0xac6b9cb72dc5a7a1, 0xba5a9d5e6d2b6431 },
+ { 0x5904a92e99577e60, 0x17f1ace51a8737f5 }, { 0xfdfac26c704d79a7, 0x36e0e77424aeea1a }, { 0x527fd421950de282, 0xf1e9c4a91ff58f96 }, { 0x5daf33b5fbd92e53, 0xbb35c763d2868a9a },
+ { 0x898b9b28207326b5, 0x144042a218b3c6cb }, { 0x0a21ba59f598889e, 0xcd29028c37e30608 }, { 0x779fd3be98bb6396, 0x5ff31b556a6d2d6c }, { 0xcc58724154082b4c, 0xc1a83c533f3344f0 },
+ { 0xd690e531eaed201e, 0xf9175182aed4f387 }, { 0x4ff2533081e38567, 0x18c17c7d10638433 }, { 0x4c1cd9ca4966b9e3, 0x6592c2fe4613858e }, { 0xc4cd85b490d78b2a, 0x5ae3ea9c6c31fd2e },
+ { 0x49ed8407d22afdac, 0xe267c3b8bc83868a }, { 0xa710e1b8219f3b43, 0x5c42f5126859dc52 }, { 0x7e50e31da5a6d78c, 0xef89a75a0bfe2ad9 }, { 0xa4fe6b42e91a07c7, 0x21114b913e29ddef },
+ { 0x662c39c12a04f426, 0x81541ec8fef82278 }, { 0x0d64aa385f93e429, 0x1cbed789a992bada }, { 0x585e6e7860956a1c, 0x3cc0c6252816899e }, { 0x8b3fd68411340e4d, 0x422296e17c52791d },
+ { 0xc38895d53adce79d, 0x8b743f99f24041fc }, { 0xf1c4af02d61c89f2, 0x016f5a3dbfadeeab }, { 0x70dac3df32b00f21, 0x8e64ce50f41c91be }, { 0xbc82b19e66b8246d, 0x4fccf203cb2fd54e },
+ { 0xb352560a086ce8bc, 0x0510f1c9065cd042 }, { 0xd57e6fcb22681c9a, 0x8444ef01f8a4f23a }, { 0x214b9d046f38d127, 0x02deb47abd991f95 }, { 0x25e0079f0db68114, 0xae1adffc7598a2fa },
+ { 0xb8292b050436745e, 0xe3089985032e6821 }, { 0x5aea23d451d242e4, 0x6aa212664cf73648 }, { 0x811e6cdde4ac86d3, 0x8f0b946d4bb17f15 }, { 0xc2d25283c31ef3e1, 0xa0455559c0d1ff97 },
+ { 0x63dd640cb148b069, 0x06a11f8e0468217c }, { 0x54600316c6c49a49, 0x0b4f7b6cb3158d2f }, { 0x5f1b7e19ca9e06ab, 0xed571320b667354c }, { 0xd81ac5f37dfbf8b3, 0x98fa3888513648e0 },
+ { 0x22a517fea7bdeda3, 0x7f8d0af9ebe91e28 }, { 0xb417466ba267840b, 0xd48724cc982d6c90 }, { 0x260e8d65c533bd90, 0xd349617f23e8a347 }, { 0xddeb983ee6b7bcfc, 0x1f0f39ceaba64be4 },
+ { 0x3cc61a157bd6b6c2, 0xebf60caeb20f1430 }, { 0xdcb15f681f75a880, 0x343e530e9937f58f }, { 0x93430c589e962de7, 0x2cff2f73895471bc }, { 0x90ad86a256131163, 0x51ac91f0df247001 },
+ { 0xcd02b517adca3f30, 0xea9956930da2fa9b }, { 0xb973ec53fdf46022, 0xc839f34531bfd64a }, { 0x2e9b7a9001ec1df6, 0x4802b7b070ea1a99 }, { 0x96b2519505da69a8, 0xab0a2e3573c472b8 },
+ { 0x82f0e6272c29ba57, 0xf2582aee1dc17ea8 }, { 0xf09e68542fde9d8e, 0x2a5e30fd8d3c50c0 }, { 0x7ba1bed03eea93c3, 0x687ca61cf16e29dd }, { 0xe399cf87ac2622c6, 0xa29be1237d48e002 },
+ { 0x94061c39349d4150, 0xfd68fa761725cd6e }, { 0x3b830a74d1ddda75, 0x3a61d9ab2c7ea8e2 }, { 0xdaae885f4cbcd04b, 0xce98eccb35d7f736 }, { 0xfbe5155b2384016c, 0xcc4658b1884ee8a3 },
+ { 0xba9d66a935715ca6, 0xb56a4dc667cfd7f7 }, { 0x3453ede0bf0916a4, 0x70bdda61e10dadee }, { 0xe732551ccea872f5, 0x0e5f8aa5b5495d6d }, { 0x02b44dac314728f8, 0x5662d44364e1bfd6 },
+ { 0x84ef31107fe0c29c, 0x08fe952bb1217c11 }, { 0xc679c818a190a3d2, 0x0c813edf08d042f8 }, { 0x578e89ec0e41a6cd, 0x761cc5efe5658c92 }, { 0xea56ff24913b96dc, 0x12e15d2c1cdbe7b7 },
+ { 0x1f39cabd25a94f1d, 0xbf4a6c976b77b473 }, { 0x151870e4d031c783, 0x72636e1b5c94b27b }, { 0x1b92502647271f2e, 0x138e0711a376091c }, { 0x386d808e1958e6f1, 0x473267287a0ea95f },
+ { 0x9a8c3cfba38b99fd, 0x9c85937ce8c77609 }, { 0x9bd6fbad5a498d81, 0xb7b4f9bcda56c862 }, { 0x56d44ebaf783b2b1, 0x5d2daf2fd7f432f9 }, { 0x05f15dcd9b4c444f, 0x87f50146fa900304 },
+ { 0x784f342af66faf47, 0x152f189fa71e2860 }, { 0x3316fd8115027a13, 0xa12a0f647f7c113c }, { 0x3f2890efb3538a46, 0x96a5b22de47f158d }, { 0x20115a5296fac55b, 0x29efdeba8f08a1fe },
+ { 0xcb1d6220fe0347fb, 0x103fe956a142f822 }, { 0x6033eef679cd8ced, 0x7bf2a10d521820c1 }, { 0xf95158f712c32994, 0x9a248cf2ecaf5775 }, { 0xaf85164de5409b25, 0xc70923dd3b5b658c },
+ { 0x73344925fa3533a5, 0xf33770d3a26c9003 }, { 0xad315be1d407b3dd, 0x916bf79e5fbada5a }, { 0xb0bcdcf0c0e9d438, 0x78434f4a502cd1ff }, { 0xe9b875de59beaa58, 0x6fb2e3af4aabe60a },
+ { 0x6b4893f97597100f, 0x9deac941576a98a2 }, { 0xbbc7a1ffccb348da, 0x9e5b2706555e699c }, { 0x2884ada75225653d, 0xb2a40875dc0a1820 }, { 0xf80b9fa1eb013de8, 0xb115e632de3ee91e },
+ { 0xbf6c3b64ae3d18e9, 0x329f4c809d5fd4f3 }, { 0x8701bbeab765fe18, 0x75ad2ba8e7517dac }, { 0xbe36fc3257ff0c95, 0x19ae2640afce6a98 }, { 0xa99ac17ab689e3ee, 0x3daf9c1897bb6735 },
+ { 0xb54d813d5ba59077, 0xffb64e0caabcd2fb }, { 0x2d75f06ac9692172, 0x35510933269a1b24 }, { 0x324c3ad7ecc06e6f, 0x8a1b65a44dedaf57 }, { 0xd361b8fc71a16451, 0x7ee250c45444f083 },
+ { 0xc8f3e8da36867b7f, 0x6d6c57d5f732f99f }, { 0x23ffd0a85e7ff9df, 0x54bc6039d978a043 }, { 0x5e41b94f335c12d7, 0xc66679e084f68b27 }, { 0x97e896c3fc187dd4, 0x803b44f54155ccd3 },
+ { 0xed13ef453b30fa6b, 0xc376882982aa5b65 }, { 0x3e7257b94a919e3a, 0xbd94d8edd6eeabe6 }, { 0x37bd671a778c2a20, 0x0dee64e2b77dac53 }, { 0xf370e2aee75ba10a, 0x570d8e7edb4c517d },
+ { 0xe077457d64a31e42, 0xdfc85fa02b38e1bf }, { 0x10e92d294b7d83cc, 0xf5966f5da604b17f }, { 0x17ac3d48e176ef7b, 0x2401ba5838750dad }, { 0xb7f9cc916ae2b88f, 0xa9d49a4fce5d6d2d },
+ { 0x7915f37c0fadbb3b, 0x3e1e725f958f960b }, { 0x463d6393bcfe317d, 0xa8bbc07271f08386 }, { 0x7afb7986c72887bf, 0x434dccdcc3ff97b6 }, { 0x48b743512be8e9d0, 0xc956a9788e1238e1 },
+ { 0x6498746d1b43dcde, 0xd736ca8b9a199dae }, { 0x417873f216f55dca, 0x792c1577ef813f54 }, { 0x955cdb6fcd5f552c, 0xd65990b625b47305 }, { 0xc0661f2ff259db19, 0xf627811aa4304041 },
+ { 0xf22a25f81e99b576, 0x7c3ce4bee9ddef16 }, { 0x74715944503e5f12, 0x22a0a5d63c1d2cd1 }, { 0x7ce4aeb194e1ff74, 0xb9eb73196f1f950f }, { 0xd08f3206b92458d5, 0x03b1ee470234f13e },
+ { 0x68a61903bd122c8b, 0xe0b977c2011a991f }, { 0x16f6fa1e18b4fb07, 0x0f30d0980ae4b3c6 }, { 0xaedfd11b1c828f59, 0xec38491d09cadbe7 }, { 0x11b3ea7fb2bf97b0, 0xdea7059d94950f14 },
+ { 0x91f741f4afd1051f, 0x7a9dfb30edb5ce6a }, { 0x1e630debdc6b5b61, 0x947b065759e60a18 }, { 0x09cf30a33d1db41a, 0xb07abc0f619307b5 }, { 0xcfb6f8bb9c8d17c8, 0xbcfb82d06943454d },
+ { 0x30f8777bdd874697, 0xdc79b1e7290c1081 }, { 0xec492813c2f2ee17, 0xe847e2e9b03be50e }, { 0xd1d5f55040e64ca9, 0x2880848730a54f55 }, { 0x616929a0800f9891, 0x50c3cbcd60899eaa },
+ { 0x4d461e9cb0a4ad9f, 0x4ea3a83e74823be5 }, { 0x4ea894667821911b, 0x33f016bd22f23a58 }, { 0xa5a4ac1410d813bb, 0x0a2021510cb86384 }, { 0x0fd0e7946ed4ccd1, 0x4adc03cacd73050c },
+ { 0x50cb998da44aca7a, 0xa78b10ea7b143040 }, { 0xceec3fed654f03b4, 0x97cae8105bd2fb26 }, { 0xff4e8fc0410a515f, 0x60823337404f55cc }, { 0xe4dcdfe6062d4e71, 0x730c3426e3395cd0 },
+ { 0x2c2f373c30ab350e, 0x1e6063f3140ba54f }, { 0x0000000000000000, 0x0000000000000000 }, { 0xde0512c42e328078, 0x625c874dfdd64a59 }, { 0xe8e2b288a07cbe24, 0x4483896f783a5861 },
+ { 0x6eb9ce34eedb5440, 0x1a1fc807adfa9ba6 }, { 0x8d2001b342fd7686, 0xb8842924d0b27ba4 }, { 0x1ac89770bee50b52, 0x38bf6dd191e7b777 }, { 0xb6a30bc79320acf3, 0x82e5f08ffcccd346 },
+ { 0xbdd876c89f7a3011, 0x64fd98c3f9be6b25 }, { 0x4a030efd1aafc128, 0x9f347d3beaf38737 }, { 0x36e7a04c8e4e3e5c, 0x26df0e2285ec1238 }, { 0x5bb0e482a8105698, 0x419378a67e668823 },
+ { 0xf56f3599b492d9c1, 0xadab31bb77ac53c4 }, { 0x19261d8a766037d6, 0x45ecd352c797b6ca }, { 0xc9a92f8ccf446f03, 0x465d3d15c5a347f4 }, { 0x7dbe69e76d23eb08, 0x92da19d95d8e2b64 },
+ { 0xc7230f4e5852b7ae, 0x27b0541f3a41fc93 }, { 0x865b7cbc4ea7ea64, 0x5e9c4168d5c0c3c7 }, { 0xd23b7faa8863702d, 0x55d33a0466d54ee8 }, { 0x43cc3e5e27b27532, 0x2f4ec1348b608082 },
+ { 0x51915edb5d88de06, 0x8cba7a2a49858e2b }, { 0x125d60857a3aab34, 0xa3f4bb1ec2e50ea9 }, { 0x71800489cb721b5d, 0xa555a490c68d2fd5 }, { 0x03ee8afac8853c84, 0x7d53be83567001bd },
+ { 0x8a6511d2e8f61a31, 0x6913fc214ec3c776 }, { 0x45d3e969747b0df9, 0xd5e87ef12780823b }, { 0xefa7a2e90a77d293, 0x95145c6ae64be4b3 }, { 0xca47a57607c15387, 0x3b0e839693d34649 },
+ { 0x9219cb0e6754399b, 0x07ce45b3bbc5cfd7 }, { 0xe58618b0ffef5a0d, 0x583d5ee6d1a8e2bb }, { 0xd94002a58439eccf, 0xb3cb524863a7f68b }, { 0xaa744b807e0cdf6a, 0x40fc229bc1cb6688 },
+ { 0xf435f2cf4d50cdbd, 0x869a5b7b453dedaf }, { 0x04ab9a9b628e5033, 0xacc46b86c801bd6f }, { 0xfca0053a898f6ddb, 0x1dd18db4163f5471 }, { 0x31a2b02d244552eb, 0xf748db271b9daeea },
+ { 0x9e27a660c105c9ce, 0x3041f8fa20c6cb66 }, { 0x0c3e6d6ea651f055, 0x378fbd499b0304b1 }, { 0xab2e8cd687cecb16, 0x6bcd485bf35ad8e3 }, { 0x2a30e00b63624dc5, 0xe4c6dc36b8eba7f6 },
+ { 0x1307a7d383f8bf48, 0x88c5d1def074b0c2 }, { 0x83aa2171d5ebae2b, 0xd969402e2f50c0c3 }, { 0xfabfd20dda461510, 0xe7773271badf56c8 }, { 0xe2c308d155e436ba, 0x89aa8be34fd95e69 },
+ { 0x9962b6016b0ea579, 0xe1d62dffbeb777b4 }, { 0x9f7d613638c7ddb2, 0x1b70923a1257750d }, { 0x4767a4c5453c2501, 0x838aaab243613ded }, { 0xdf5fd592d7f09404, 0x496ded8dcf47f432 },
+ { 0x6c0d8398df9c7cb8, 0x4c7d1c44c91b2470 }, { 0x88d15c7ed9b132c9, 0x3f7128622a2278a0 }, { 0x27544a333cf1a9ec, 0xf8780bbf11791d2c }, { 0x44892e3f8db91985, 0xfed9143115113c50 },
+ { 0xa055f1d98b9457f4, 0x8dd52017f6286080 }, { 0xb1e61ba6392bc044, 0x5372258a62bd6f94 }, { 0x6776fe97d3c6e05a, 0xaa657408cc699c13 }, { 0x5cf5f4e3021b3a2f, 0x9004ada3e01734f1 },
+ { 0x9838715792ccb105, 0xcae7473f8c26c9df }, { 0x726e8e7303f727d9, 0xd8061a1390fd2e68 }, { 0x24bac0c9f4749568, 0x852bb53c47091c91 }, { 0x0e8a20c29716d8ad, 0x61ed690affe2bb67 },
+ { 0x553ac4403f068e35, 0x207e11ac81843344 }, { 0xc59742e269159f56, 0x71d2805c5ea04345 }, { 0x6d5744ce265e68c4, 0x674c7684fb8a9a1b }, { 0x8044ab8b1d6e92af, 0xa43afead7920c17e },
+ { 0x6287a35a488aa415, 0x2d90754e36f99f17 }, { 0x015ac756f9c2147c, 0x2b316ac03291be6b }, { 0x752b9e12a9fc4b6e, 0x0991cf160e8c92ba }, { 0x35092ab646cb02d8, 0x5b8cb0a1d39c1385 },
+ { 0x69fcde5544d038f7, 0xcb881d02338b2774 }, { 0x0895f7f5c4dfa066, 0x9b4bd6cf5302b9de }, { 0xe668924a376a6689, 0x256ee06587d8e306 }, { 0xf681bf637c17e545, 0xd0f88f3821dc5279 },
+ { 0xeefd65bff3b5c6ef, 0xbe2536aad4da5ad8 }, { 0xdbf44f09b57ec437, 0xe5a9860b0746495d }, { 0x393747d8e09af28d, 0x6c030de8489f1734 }, { 0x4022b4a4ef3749b6, 0x521d7fb7dd10813f },
+ { 0x1442b7b229f3d3ff, 0x595204db6e050c10 }, { 0xa10f368f72564388, 0xa6e44ad7c4b9deeb }, { 0x76c514e8617977ea, 0x74c2719558fc9307 }, { 0xd7ca2267132f3462, 0xd2263b429c454dec },
+ { 0x0b7b7d0f0c5a9ce2, 0xe618684c0572b863 }, { 0xe12d822b9d610a3e, 0xf4f9356019a95fd4 }, { 0x4b59c9abe36dd554, 0xb40517fbd862395c }, { 0x3d9cdd438214a2be, 0xc0c7666e809eaa5b },
+ { 0x07451061aa0b6cb7, 0xd197d5059e71bcd2 }, { 0x9c93ebccf042e136, 0x66232cb9442774b0 }, { 0xd424a89ddbaa08e6, 0xaf7585c1ca354c51 }, { 0x1cd74047ed2c7399, 0xc219d2143d07b5ce },
+ { 0xeb0c387268f982a0, 0x39d037ec2e4a59dc }, { 0xfe144896b8c84523, 0x4bb359f772deeba7 }, { 0x2fc1bdc6f82e098a, 0x6333dd70427ba4f2 }, { 0x6a1254af8c550473, 0xb6dba38165fb26c9 }
+ }, {
+ { 0x5433fb988d1d595e, 0xb20e82b31ba4d47c }, { 0x5a5608c136be7690, 0xec0f994cf83840f4 }, { 0x4b04cb5b391faeb8, 0x9f2c52d84e349701 }, { 0x0f8f417605de4818, 0x90a0f8cdd3044d53 },
+ { 0x4561380282bc8176, 0xc12d4927ada80389 }, { 0x9b90b39ec81a19c4, 0x327959da2f9fd124 }, { 0xae5f1f11dbf7230d, 0x465cc809965df867 }, { 0xb37f888cd00f1a84, 0x34ff1d06a33eca6f },
+ { 0xe8c3326258cc0bc2, 0x165167786b9e5340 }, { 0xfdbf7c44ea5a8c34, 0xdbb3a6241db7665f }, { 0x56245cc632e79731, 0xed8f87d77b57a509 }, { 0xf7f402a1eccefc24, 0x3b73b7133e0e103d },
+ { 0xa03aec4860540cc3, 0x185dd3f675c16cef }, { 0x435812e0807110c7, 0x206d468b0d7e9016 }, { 0xbd1a7bd56bac354a, 0x6afe06f940a25ee7 }, { 0x3baa5fd6a84e1507, 0x2a248a2c5a5ebdcb },
+ { 0xe6a6c13be36f240c, 0x48507c878802c7c8 }, { 0x2d2b04811b5f3b48, 0x76e6ad267c1c207a }, { 0x501d7624302a0680, 0x0ccf887bdb813696 }, { 0x49136c0586e560d7, 0xc0ad57bc2ec7e674 },
+ { 0x714426a22f2cdc69, 0x7ba93bc624f2f311 }, { 0x1af30f50b748cfee, 0x5d423991a52d784c }, { 0x777d0c402de14dd8, 0x9ae9346a8424608e }, { 0xd747e0084db5411b, 0x82b4e79cf1e50c61 },
+ { 0x0d98e628ba248677, 0xcf21fda9b3f73c26 }, { 0x12afd6eb0e267191, 0xe2032dc2e6677f5b }, { 0xeefa18805a019a73, 0xf71168d4cb48c0df }, { 0x69a08eac279edde8, 0x796a0733e12cfa28 },
+ { 0x0c7254070459e1a1, 0x01801e9b836fe5fd }, { 0xfa6ce48956ea7a53, 0xf4524aba8df92c1b }, { 0x35cfac8f13ed3ac9, 0x742591d3b9c22943 }, { 0xfe426935ebdd258d, 0x4a9340724ddccef1 },
+ { 0x57ceeee98c9af0e7, 0x232e64e54bcf7cd2 }, { 0x085cd9bbb96ebe7f, 0xbf411453434a0717 }, { 0x234ef7d8a0fc1486, 0x28e7b6d99f80b4f2 }, { 0x3632b9fe126a9370, 0xe5057785e9a981ed },
+ { 0x5e78857d8b89294e, 0x52ce9384381da21e }, { 0x34251ea0ad905d1f, 0xba8472e1895af098 }, { 0xe4b166655c95ea63, 0x17d179e3e8f1b6bd }, { 0x1f3730c3b402f7e6, 0x2d22d06b5590437d },
+ { 0x7f21d5fb948ff3a7, 0x25a82039c76e6799 }, { 0xb546a26ed2c28b35, 0xd5bf12aa03e859f0 }, { 0x1496fc090cebe020, 0x0343226e46b1ecc4 }, { 0x3e6e6045ab042d0f, 0x5a4463d6aae386fa },
+ { 0x7918ff1996426216, 0xc4e82f9567b8f406 }, { 0xbee76ea46a2b9cf3, 0xfbdee0af10c9f649 }, { 0x7ae5ea6897c5cbaf, 0x55c8c9c337d35ca8 }, { 0x84a7835d7c18ee22, 0x1f5b89b17a0f9259 },
+ { 0x03fd15710187a9b9, 0x9120e656506ba8ae }, { 0x7cdcc08a95085a1e, 0xb488c66f9705cf37 }, { 0xbf0ddc8bd456fb25, 0x357f039d20512f92 }, { 0xdb35b40f49eca0ba, 0x8334f907728ae99c },
+ { 0xe09febd9e1a2b5bd, 0xa910732b28d45457 }, { 0x268ac84ba3b62c8e, 0x58875f236f3d8fc3 }, { 0xc40284ccfdee575c, 0xae16296c271aaae1 }, { 0x6016e538208d0441, 0x088af05292fe24e4 },
+ { 0x0217a75ebfface6f, 0x5f81056460f37175 }, { 0xb8de444668e60d42, 0x1a9eef03b01f65d6 }, { 0x5bbcbaee88c31146, 0x22ae7a7ec8a0992f }, { 0xc99a62e447cad12b, 0x6137d4c594ed96c7 },
+ { 0x941ff2e8cdc451dc, 0xa2d9a117fc9b9c77 }, { 0x4cd7539685af58df, 0xb0cdbe46de7add45 }, { 0xf0279a6c507e0a43, 0x14925b8dae405a79 }, { 0xb4ac10416cbfece3, 0x1b1ef1983370802b },
+ { 0x59ab1db03739df29, 0x7d2f7f1aa853e85a }, { 0xada20a60da708ab4, 0xd77c2e5fc63650c9 }, { 0xa5fed3db631e34cb, 0x683d3a0c857c57de }, { 0x8eecfdb87a8c9e32, 0xff9b988659b6e43b },
+ { 0xe74c73145d1243da, 0x86f19fb5b89a1e13 }, { 0xf991f1f8576dd3ea, 0x6572acecdd9284b5 }, { 0x38574aa7a9c9bcbe, 0xbb046c7a0a351565 }, { 0xd8c8a17e486b0903, 0x12141f5122e14132 },
+ { 0xef10aaafe47cfda5, 0x39b08be6fbd01904 }, { 0xa7e97485dce4faa4, 0x37bc3f68e58f26ab }, { 0x998714c077e0d7ab, 0x6df85cbe4f6ca051 }, { 0xdf1b39b3f4dbff64, 0x3df5f3cfb2af0b76 },
+ { 0xead4953ce736c5ad, 0x49d0621c0b6d2235 }, { 0x16815b57b3112e4f, 0x5cc2270a26429db1 }, { 0xfb8656a6e8971d85, 0x3af3a988bd61f5c0 }, { 0x448b8a2d3cc1e6a0, 0x0f8caa159d30da52 },
+ { 0xd283df9b4eff7913, 0xf2d40e6601583750 }, { 0x91dbcd7bce8e69d4, 0xd2b948ed0c26a746 }, { 0xbb2351376961a4fb, 0x8bbe0955e074cd78 }, { 0x321c3442af5dccae, 0x5bc47d4d298c6307 },
+ { 0xb934f669d69b6a94, 0xd43f0c318087bc0d }, { 0x042e8dbcbd375fde, 0xbec10ac8c025e2ea }, { 0x93cc6a257174a7bb, 0x8d384d896cd5d633 }, { 0x0e65f359bba32fce, 0x5e011bffe39c9488 },
+ { 0xd4baf5794c32e8a2, 0x139401caa18ea4cf }, { 0x2ed611f01ad892f1, 0xe7c64b702c7788d4 }, { 0xb0829dfdd188b33d, 0xa5dffb50f35562c1 }, { 0x3d937534aa8384b6, 0xcb648580fa882e54 },
+ { 0x748019312c66e461, 0x0bc9d23cd44fc820 }, { 0x6d8e03109aa98236, 0xc7ab0dfb210918c2 }, { 0x8ac27004c7bbc1ec, 0x415a924e999306d1 }, { 0x7d3672a52b753dc8, 0x7a29255da79d16ec },
+ { 0xb2953aa36e727d52, 0xfa5efe3493a613b4 }, { 0xdef18b9c4aa698b2, 0xf35410fd8237d2ad }, { 0x72b933d32eab75d0, 0xea89dd9074995bbf }, { 0xa603c6aa62999d72, 0xf91ddc5ad517ff70 },
+ { 0xb1682fd26ff5d4eb, 0x6b7e1862c3cdbb1a }, { 0x2905893da6686496, 0xc827a7eebc39c290 }, { 0x7697be6f939c2a0e, 0x5448d758b4bcb955 }, { 0xfc55ce6b5427ebe2, 0x151245162d2fbf84 },
+ { 0x51f7c40b8e576156, 0xc26e6b49eb19ef4d }, { 0xce49fa29fb7a274c, 0x4ed6385b04a3dc83 }, { 0x28ef3b1218150340, 0x068644dc8ca11b4b }, { 0x2577dd3aa2318537, 0xc9a7b9753f56276d },
+ { 0xca677795464d7892, 0xf0173293c4863e69 }, { 0xcb8dc5baf8301f44, 0x3eb6d1a1f41ee7b2 }, { 0x6e7316619b2e2b8f, 0x568bebad7162b06c }, { 0x6f99a44e25534c59, 0x982a089f41fa69b7 },
+ { 0xafb5ad3e658a44db, 0x88fd2b3ba6c521bc }, { 0x9226d80acf09c06d, 0x4399aebb5c4d0fe8 }, { 0xb6bbb71fd345228c, 0x449ff4fc5383f15e }, { 0xaa7192ad66c07cd3, 0xf89dc2c156781a8d },
+ { 0x55d949b733603e88, 0x7caf61812b3c0da7 }, { 0x134564c4b05b1647, 0x2ca2cef0d6ffa680 }, { 0xc7ff91bdfc69fee5, 0x3f36cf3a7771024f }, { 0x2af89c4ca7efcd2f, 0x590741b8ec526a3e },
+ { 0x9a7a01b176677e12, 0xfcd8bae81f0708ff }, { 0x8d11e8c97b0b378b, 0x6ebb7ed009dd4c95 }, { 0x42b2a0cf3e0c7711, 0xeecca5b93de649cd }, { 0xc1c6bb5ffea46f54, 0xde76c096d7a791d0 },
+ { 0x414fb5be3f8bdea8, 0x7fec43ef6d8de163 }, { 0x6bb729f298641387, 0x26eb025781df8b5d }, { 0xbac9e318d71cc32d, 0x451fea67d0ec14a3 }, { 0x8cfb5ae6c576505d, 0xa01a9de23945954e },
+ { 0xf40917d0ed49559d, 0xaa5351456e65b893 }, { 0x53e0635531adaf39, 0x9def6e2d8bea9e38 }, { 0x1cca25b2b5855e5f, 0xbc02363d05fbebd3 }, { 0x67c57df59c3df226, 0x276b1ccc02b06ea0 },
+ { 0xab9b2082d8bd1b05, 0x363c21f366e0c356 }, { 0xd9221351f6166ed5, 0xdcb5fc63127998e9 }, { 0x80890ee1c12fb1fc, 0xa19a8379ba2a70b3 }, { 0x47769f5c3d464f19, 0x9eac4c43cd5b72fc },
+ { 0x4d3de1b93bd23f09, 0x7e6c5d74eee2049e }, { 0x960855b6723e9fb3, 0xfd58a4739c68ed02 }, { 0xf3da8f1d51f9a3fa, 0x85b2bddbfe2bf2d7 }, { 0x520ad17a8fd0c8ef, 0x534e8d1fbb7247e3 },
+ { 0x95f540c773b9360a, 0x6c784225cc0345ac }, { 0x1edd82ec0a7f9030, 0xe383335965089aa6 }, { 0xd6ad5227f3c826cd, 0x4c1504aec17dd5ba }, { 0x01eab22fbe7d67d6, 0xcea1e3323098d9db },
+ { 0xe17559f65fdfd26b, 0x67b19019184c8d8c }, { 0x05c43f93034a3808, 0x7060e9faf0bd3b31 }, { 0xe55bd44ae2e88db5, 0xd9709ad1d8696f66 }, { 0x4aee79748762c96e, 0x518db1ea7eac4eda },
+ { 0x97e2e799cc43f865, 0x33f94741acf034d9 }, { 0xcdb4ef58fafd8ef5, 0xdff6de0d54c8742d }, { 0xd17ecaea4f78d0aa, 0x63f4e83051339ffe }, { 0xd5504756f24f8f74, 0xdd35e2f891167d14 },
+ { 0xf5e3a5ff5334324b, 0x64f2b2775efd6148 }, { 0x5841af9f8944b8ff, 0xb38e9c2898cb3181 }, { 0x18e4a80e08b20181, 0x02c33cf5c5de0939 }, { 0x300b931c10a702c1, 0x04457829497f1272 },
+ { 0x3a40edf9163372d1, 0xe485691e6ac66410 }, { 0x1152c39a0fa1d828, 0x7323cb94b60cd7f5 }, { 0x06392ae202cd91b1, 0xe1400faca0d6939f }, { 0x875a962c7d9f479b, 0x8e7b6fe72a643af7 },
+ { 0xdce62cc2f55c56dd, 0xacd51599e2c4a3d8 }, { 0xcc5e5d774480e923, 0x11573d3f6450adf6 }, { 0x20b3e2a9a17bbd3f, 0xb9c7508fcfeb1c5c }, { 0x90317f5470f30e02, 0x1c18abdf3cbe7e9d },
+ { 0x0a4b7ee506947010, 0xe0c0113723b97662 }, { 0x0000000000000000, 0x0000000000000000 }, { 0x9fbe3e22752d461a, 0x8cb85312efba33ce }, { 0x3c79c71b14fee360, 0x05c566b2ca10f78f },
+ { 0xb75105306d38455a, 0x8a3e17ce631b2885 }, { 0x684a3c8399e3ba3e, 0xb7cbe401d1b423f3 }, { 0xa98c87dc6747d56a, 0x69bd24970613b223 }, { 0x7ecb67d42af29471, 0xeb09c30bf7f6be42 },
+ { 0x9da9997ccad78875, 0xd33956768f4942bb }, { 0x756aab1e921b83b7, 0xc568310ee4d711fb }, { 0xa3c7f93961d3a57a, 0x897d35a025aac441 }, { 0x3f84d26a15794ad9, 0x94e580e49a7b5f21 },
+ { 0xdadf0620f791c76c, 0x4d951a3542123047 }, { 0x829ea9bf7ed57f93, 0xfe1b861ddad901c6 }, { 0x83741b90c0a81845, 0x30ba652fea41d81d }, { 0xcfa348064507409a, 0x8077db69343b0558 },
+ { 0x1d20979d0bf83989, 0x72a3d50f35633208 }, { 0x8b28c22b79c6a63a, 0x8ffb717ca90bdf0a }, { 0x33f6866d1120ab78, 0x95659e7f1914badc }, { 0xa41461f4dd63531d, 0xa69cd93eb5e48e05 },
+ { 0xc5e836e34393308a, 0x60b7ca5e1782733a }, { 0x61fc57179ef06397, 0xc62b1360a266fd3f }, { 0x63ebf049210aadf8, 0x99aa1604c2958c4a }, { 0x2b122e631992aaf9, 0x97a6a28adccab3e5 },
+ { 0x27607a641dcb4b58, 0x9626bc115fa55618 }, { 0xf2303d32ef84c42c, 0x4b135ee9ceb32b0c }, { 0x735381fc90d61206, 0x24283ea244018264 }, { 0xa86635f3d93ab2bc, 0xa71cc7a5368b6bf8 },
+ { 0xbcf0c9fad5d1529c, 0xa45fe5cb703a873c }, { 0x893f6575c63c6855, 0xd07a7418c9f8ae7f }, { 0xd09478c5f105b77c, 0xad550b0261ab4625 }, { 0x8163bcce7f52d62a, 0x6f3b604b8ab2a968 },
+ { 0xc3d11c01415ea13b, 0x81f7c5f2b754e0a5 }, { 0x643868849dba5b9f, 0xb64bfa9a52dbc60e }, { 0x0ba1cccab8e917c6, 0x2e61f2051321afb9 }, { 0xecedbfdee5fb541c, 0xa8906db0abbbb1aa },
+ { 0x10b871b5b1dcbffe, 0xbd8228a686940e2e }, { 0xac48b84f640ded62, 0x19ddcd6df6ae8912 }, { 0x986da6efc99db07d, 0xa359bf8c7ff4798a }, { 0x5c6f22233473e721, 0x0d4f96e058eed36b },
+ { 0x78f24d36283f05c0, 0x0a49cca757202ddd }, { 0xf61eb08e52b39bf2, 0xf5d254210e96c9e6 }, { 0x5d85900c8a0e80f7, 0xc3ee75d268760ab0 }, { 0xc615239242149933, 0xf1972c0847e9db94 },
+ { 0x5f92375235f44e98, 0x9c6f70b608857bc5 }, { 0x09b66b940713d9a9, 0x71e0f76173d2decc }, { 0xc02c097040d90882, 0x10d723a4e73f480b }, { 0x86b02403c3e2204d, 0x40da8cd51afce32c },
+ { 0x854d3172c26589f4, 0xd1fa6a834a974b82 }, { 0x157c4e26b29687f6, 0xcde2c15c7629351f }, { 0xe929804de6b16c14, 0xd8f0844a5b068a9b }, { 0xeb3e2713594ba27b, 0x8771812e3bf5fbee },
+ { 0x7b0f584729b8ac79, 0x9b692af1074b8573 }, { 0x31e12133aeda6517, 0xcae49b1b79e7cba9 }, { 0x662fcfda224095f0, 0xe9cafffe3228b77b }, { 0x70ae948d9151bbbf, 0xb508d8f4146a2aca },
+ { 0x469c2d73833b28cf, 0x500daf71fdc3ab27 }, { 0x48f9de2a38980701, 0x0e0cb48e1e5f3faf }, { 0xc23bae2eff23c6ed, 0x4f5626c087cc397e }, { 0x9e548c0dcb5021cc, 0x4219b020df22ea15 },
+ { 0xa1d05e67de296b15, 0xd6fc30c44559b534 }, { 0x2f3ca3dfa4a5f527, 0x2967a8421cef510f }, { 0x9c432b5374aaefa3, 0x1d98b544bfd19b60 }, { 0xdd0c9eed4b21310b, 0x6274f6abd25c7a03 },
+ { 0x1b19bd7f0935a838, 0x93e3daa395b5a197 }, { 0x190e1a21b6cf6657, 0xcc62dfc7f546d0e2 }, { 0x07d398cdbcb0f667, 0x2fe1ec9e904e4a44 }, { 0x88d5d75a78410f83, 0x1edb972af96077a4 },
+ { 0xf87b43d7e910b43c, 0xabd34fdeed0a5d6e }, { 0xc870d0cbf9b7b6fd, 0xaf9637f7a4754f1c }, { 0xa22d4b16dfaec2ac, 0x47dcd69215321d9a }, { 0xf1cd2843ee036d95, 0xda33b8bf9ed883a2 },
+ { 0x6a5d9bdd26197451, 0xe84ae165b1475286 }, { 0xe2884c875e587bd2, 0xf691764f48272522 }, { 0x249d6f151c4ce2e1, 0x07065a470fcefeb6 }, { 0x8f064f97c4f1f9e4, 0x313a7bb4692e3de0 },
+ { 0x37d80bd1ac17f4a6, 0x2ba494b7d9315836 }, { 0x620142669f77ca2e, 0x570bf536f20d5591 }, { 0x2cc1b6aea5225c9e, 0xb8474e144c84f9a1 }, { 0x4ec0f4c83a5596b0, 0xef4cbb22be89ac30 },
+ { 0xe362fea8e0251c04, 0x3830957d78bffcf9 }, { 0xed070df15b8633ca, 0x66318e829b236871 }, { 0x6c64b13f24d4e5e0, 0x090aeec91191c119 }, { 0x40a5079181f6b97e, 0xb14da0dd5d1538b8 },
+ { 0x4f2a46e78428f166, 0x21ed58108e1175eb }, { 0x22a445f71e817350, 0xe64655ebaf186d29 }, { 0x65d2daab23c73c49, 0x78ea19a862431fd5 }, { 0xffa8db1a55a0425b, 0x8432a3407d44172a },
+ { 0x176be9780d6c4999, 0x9263c43816da446a }, { 0x39bdf88817b4db68, 0x75a58f483aadccbe }, { 0x215950861f06dae9, 0x7766b3bdff73c587 }, { 0xd3696db4f0821ec5, 0x3c75ed5431c0ee8b }
+ }, {
+ { 0xd92529bea31248d7, 0xfc012d6adfaeec10 }, { 0x6c820e60de114463, 0xeea0cb202af27c92 }, { 0x72af0d3d2274135e, 0xdd47d2aa23c727fa }, { 0x0a1b018a54238caa, 0x115db6c707138899 },
+ { 0xc7082ae35f771fea, 0xcfe634e0d69bb778 }, { 0x533d5758428b692a, 0x6ee8718966c0f698 }, { 0x7544868473e41629, 0x314f797c14fe4b7a }, { 0x6375eeafa0c28e9c, 0x16322665cf09b0a6 },
+ { 0xb04bc69b57f34ae1, 0xfb6ebdc817b4d42f }, { 0x17d35d550f1658a4, 0xc4ff2733507eef2b }, { 0x649e6516f1528beb, 0xfa3a8db3f830dc26 }, { 0x1bc1e218d6951168, 0xda284208ebdd1fc5 },
+ { 0xc0e3a15a0ee71a9d, 0x23ee9f36e1a2dbf8 }, { 0xc306fed8a9b799ae, 0xc5ab1748bffae722 }, { 0xd6d2c971ddc18228, 0x0493c02f3a552024 }, { 0x93def6024c6c73b7, 0x4d06eebf87622d60 },
+ { 0x05ece1452af04655, 0xe9cf5b82e2e844ad }, { 0x364107306fe922d0, 0x7750841015793e49 }, { 0x6090b12d07920daf, 0xf077ae1b91518c7c }, { 0xcf1441957034d062, 0xdb7c7273045917cc },
+ { 0x5ecddd6b4738e0f7, 0x93bd6c9856ea1281 }, { 0xad839a440cc69eef, 0x2ecc2c3c40d9b39d }, { 0x5ac30950b1f866b3, 0x99f04f303f8b42db }, { 0x9a20a80abf1f7c2e, 0xba1ed006de299923 },
+ { 0xb7a04d2206634f96, 0x1766161e208db8af }, { 0x1c2a69a18705141f, 0x3620e9dedce47345 }, { 0xb44512a0a133cca5, 0xf1239e607ed58475 }, { 0x4ef50b8719bebd24, 0xbb4ae07d31ad912a },
+ { 0x081c6b762f43cf88, 0x149a4693d2c2a0b4 }, { 0xac61af3ad0f65efe, 0xcd4e5416cb50a76a }, { 0x2679d1dc316f7f03, 0x5fa708f5723ebde2 }, { 0x15d437a974761b86, 0xc138d76785afc706 },
+ { 0xdb224342d8720bf5, 0xf9c6dd3e0a7fc43d }, { 0xb1a9f3e58bc38af0, 0x18ecc5e29c3dc0d8 }, { 0x83e620ee12ea2e64, 0x65f1625ae025aecb }, { 0x247ebb204a0f3c21, 0x5a60f8a1a7ef95cf },
+ { 0xd53796f37a91011b, 0xe2d64851640d1cfe }, { 0x99c5f788184fff1d, 0x5c5b58788071a5f9 }, { 0xb857aded78b08569, 0xeff4fb5bc576749b }, { 0xab8a248381665b89, 0x2146ffc0fc69cbea },
+ { 0xeb6afab53a3bec43, 0x811c8ad2a3b68203 }, { 0x677b3a94560208d8, 0x1c7f05cda668e0fc }, { 0x1824bd9a71c5925b, 0x3c6dca76b585231f }, { 0x95d748c5c1ccb6d1, 0x428c3d433bd25517 },
+ { 0xef642e8eccfb6a07, 0x8b51a97acad7d259 }, { 0xd4d5a38da6a1c10a, 0x0154307bef840809 }, { 0xed634472b79b2925, 0x8e96592e1f06fa74 }, { 0xf8b773dbc3ed32a3, 0x4fae8e499aa93d72 },
+ { 0x02076afc7b604322, 0x05c7f054d5d1282d }, { 0xe96d9049415baf61, 0x84db7a867667aa2e }, { 0x6b6985d98f814114, 0x02a860f61dcb1012 }, { 0x923cc37c905cb3a6, 0xae8496950ceb3997 },
+ { 0x01e2357edc30c011, 0xe382782a8b8914f7 }, { 0x85ef9e299f4aeb02, 0x6a7bb1a65c95d6bc }, { 0x39b6e7ff113ae82f, 0x8fc26955f082f27d }, { 0x40e0de36bb5db7ca, 0xa05a75125fdf49e9 },
+ { 0xbdbb4ca85240c33c, 0x063ba0d9279e3036 }, { 0xd0db77b65061474e, 0x0b1913d386e55853 }, { 0xd33e2834f731c47d, 0xed5c9badd8bd6489 }, { 0x8e16aadd1759a7b9, 0x98a47f4bd00f4ad2 },
+ { 0x592656d216a8e580, 0x7fb5c74e61d37e01 }, { 0xc91dff52fd941504, 0xd4f6a18fb8e96fbb }, { 0xa073107709751732, 0xd399312d70f35784 }, { 0xd8c71cc07f2288c6, 0x1f8355405427f8e7 },
+ { 0x6e85649ca5710741, 0xeb673b74ff2354bf }, { 0x7743ec780884550b, 0x34888928c12f6357 }, { 0xc6ea1f9d8347dffb, 0x2c644cca5d12a38f }, { 0xf4a5cc961a6e7b6f, 0x5179eb72210acd9c },
+ { 0xba50c71103d0c64b, 0xea330b0f10a75cb6 }, { 0xae66c5c6ab961ddc, 0xc889a4421e818f47 }, { 0x91d99cfe370c3095, 0x48c11eeb52b3054d }, { 0x903ba980eb3cf084, 0xab4366c1d93a11ba },
+ { 0x0bf934f488134cbb, 0xf2dfceed8c9a9c6e }, { 0x7b515335d1071cc7, 0x2a5fec137a8c93b9 }, { 0xee861bf010cbaa16, 0x68d3d150415ec6ae }, { 0x2b895bef34dcf6de, 0xa2f215e4421459fb },
+ { 0x0df08a3305b389dd, 0xfd551d11302ae419 }, { 0xa59ff13223855167, 0x3a566aaf921b1329 }, { 0x13dd896ef9d6dee0, 0xceb2049b391fbf71 }, { 0x78b40cb776579ff4, 0xcc1a646d24d4af63 },
+ { 0x9c2916cd32bfb948, 0xb59403fa6299e154 }, { 0x5f2fe8159b0820e6, 0x703f14b2dd630676 }, { 0xd2dc1d4a2b01046c, 0x0edee3875334707e }, { 0x9dcb23b3ee8f7959, 0x56167bd0e910f5a3 },
+ { 0x6f6751e27941c750, 0x08e5435e74aa4048 }, { 0xb9b59893a4804578, 0x0c7683714eff606c }, { 0xe294a4bdc948e3da, 0x7604b46bfafd3640 }, { 0xb5a727de7d030cb4, 0x12a1e64af55c9082 },
+ { 0x9827c2f6c47f3f0c, 0xbfd920520bf8b10e }, { 0x34466dcc148961f2, 0x72977444c0a81664 }, { 0x61728453dba2cdbe, 0x13f5d6311ad8988b }, { 0x97d02239baacf5f3, 0x474bcd17ee037d3a },
+ { 0x58c463acca982591, 0x9c37bf64ea5a6af6 }, { 0xf7409314bd3ef85c, 0xb73c630c7f52f146 }, { 0x4d105405beee3e17, 0x5d0f68036ff5adf0 }, { 0x56d1b61d687b2f7f, 0x87272a0b8428b235 },
+ { 0xdcc9c8fb89e20e82, 0x15ce76e83d46a8bd }, { 0x94357dbb1dfc76c0, 0xa10e4569b05b41e0 }, { 0x5ccab7973c58a3d5, 0x967a9ccc833b3aac }, { 0xc4ed7561f8279cd9, 0x29a3bc9e88c38ba2 },
+ { 0xdecea207f2824da0, 0x100986bce8978090 }, { 0x8ff49fa3cb6967a8, 0x7b2607615b865e25 }, { 0xe57f2f0498d8e6ad, 0x9a0c1fbdcdc45ac0 }, { 0xa86f7b012636d8ba, 0xc70377bea231f730 },
+ { 0xdf2c97792eb28db1, 0xf38bfe96631e9467 }, { 0x35a458b2c8b9a1e3, 0x91150c6e4b210293 }, { 0x3048b9f7e249e7b6, 0x78da57eca9c9463e }, { 0x87e8f4d5e42aa820, 0x6fbc41f28944fe91 },
+ { 0x8c11c0216c39e49b, 0x9d638f1f05de62ff }, { 0x33ade67545196485, 0x9e9fdf92f7917ae4 }, { 0xf547f9e8c65ebb7e, 0xb2fb9358aa83d96b }, { 0x4afbdfbcef7e3b60, 0xb107c3d558ccc170 },
+ { 0xcaf8a0d05ac49637, 0x32b329f1e6b15361 }, { 0x5d2882e9e06863c4, 0x75f8e4e608b22e5b }, { 0x657c50682d624bfa, 0x19b8f59973b9c8d1 }, { 0xccf11e17d7645351, 0x3d39fa0d5a012b16 },
+ { 0x66990fea8a32c8c9, 0xfffd7de72de1f40b }, { 0xa3964ff5ae259401, 0x35dcb9532eab6b5e }, { 0x3bb18d036a5aab0d, 0x8a0599012553da50 }, { 0x8df3f55fb009248a, 0x7ee1f7358e577608 },
+ { 0xec81710c6babe934, 0x6d142104948fee83 }, { 0xf6a2a66a610e384d, 0x54be1b26f4dbe5b1 }, { 0x7cbad88c809719b0, 0xc65747c54db5ff39 }, { 0x3fbf59389c9a2d49, 0x8048baa94c328a0a },
+ { 0x7ebdb270fbf75a92, 0xc390b7919864d714 }, { 0xf34e472f4bfe7e18, 0xbd7140a41633a11c }, { 0x6d603b1e02218472, 0x0d22b30aa17b6865 }, { 0x491e803e482eb853, 0x57424bab0694fdaa },
+ { 0x19c688e4adf5524a, 0xdfefb25c3e0c37e8 }, { 0x6297dbd17cf24e8d, 0xf5b05e4f4480a451 }, { 0xa98d4e7ffa0618ab, 0x24810f9429b8e3c7 }, { 0xfb522c5964bdb190, 0xa9eb0637c4f101a8 },
+ { 0x734d3843fe44d34f, 0x3ec5aa80a84e330d }, { 0x2f878fd4c21c709a, 0xa8bf364c2b7509a1 }, { 0x4102eb48676d77db, 0x43d80d38d4565d1e }, { 0x7ab3664b0d37dcd6, 0xc9dd9439f105874e },
+ { 0x76a1d906d4b4951a, 0xd70af1024aa677a0 }, { 0xe49d1a7a44e826bc, 0x798e6797464d4e37 }, { 0xa2747a8b72155410, 0xd65ec179a5227fa9 }, { 0xdd2bfd8555d2ce93, 0xf64c0ec2b6cfbc4a },
+ { 0xe69a70863f88659e, 0x7c4997c3939c661a }, { 0x143602d7a846db97, 0x22baaf4d0e26d3f1 }, { 0x259c8e5e963ffc30, 0xb9e2808b2c668138 }, { 0xbfbc26542920801e, 0x03fc508df24f181b },
+ { 0xbe5e132af510400f, 0xe07e28a779c60cec }, { 0x0609bec78da0c566, 0x0f8ad3fcbcb07877 }, { 0x07eb8bb951900577, 0xec08abd637396c80 }, { 0xcd132b690b549340, 0xdebb8227d1883fe1 },
+ { 0x5b213c2e6dc8a6a2, 0x7a72371ab402562c }, { 0x37a3324eb3d9e2c1, 0x94d2fc3a9ef02abe }, { 0x9e2e7c3149dffa6a, 0xb053f3aeb748c979 }, { 0x279be4a2ed5fbf12, 0xbc2570dff9b7a915 },
+ { 0xa67aaeb084d5d254, 0xdc13e2d1cc432ff3 }, { 0xd13942c88c51875f, 0xe89b6bf90d6c4ca4 }, { 0x1038d6ec5e865dd3, 0x28f78ce5674783ab }, { 0x20706f1bbccfba65, 0x502ddb09ce8ec595 },
+ { 0x2c62d056654cf3a9, 0x4efabe32752d357b }, { 0x1e2d035dfc65573d, 0x33e7198a09355b68 }, { 0x040ed43bf6c08644, 0x0a4d23a86961505a }, { 0xfab01927b88d7181, 0x4a697e1d4f78155f },
+ { 0x298e31134fbcb5fc, 0xa735e5b097c571d6 }, { 0x881f141a9af962df, 0x972eacb76cbf32a5 }, { 0x81e14a12698a6d46, 0x6036920e35f486e6 }, { 0xe093ce41b228a0f8, 0x73c3443f2f2c1e6d },
+ { 0x0c12bf4dd98349cc, 0x1ed7653bbba3f0ee }, { 0x0000000000000000, 0x0000000000000000 }, { 0xea88cfcbe60b2c52, 0x629ef2f8283f96f4 }, { 0x286c046d938c75ed, 0x44b79d9a1c4c6521 },
+ { 0xdac0763c0442cbe4, 0x1a44a51481f6d0ca }, { 0xf1492dd3309e3d3a, 0xb8b6b0f0c3e28931 }, { 0xcef674ebac041073, 0x38fe0a598fd0033b }, { 0x54d6dce1131b6c5d, 0x82e0da5f51f99a18 },
+ { 0x57338363b44bef6e, 0x64a552210fa1a6c2 }, { 0xe77845f8e3b8a58f, 0x9fcbefe9181572ed }, { 0xc2e4cba6758759bf, 0x26296f623473f3d5 }, { 0x2a6b6e91e8ec36cf, 0x41706dcec99d4d0c },
+ { 0x2d80e528b97c33b8, 0xad78c618fea4218c }, { 0xfcb9a7e0352db4e7, 0x45e3ade1f3c86d28 }, { 0x430581b41c0d34f9, 0x461ffd6c01877533 }, { 0x8a187ee6e19921fd, 0x92e95ce3b96e1a88 },
+ { 0x1631682bd32698b5, 0x277d5f19dbf7fbdc }, { 0xf2ac725197cebe09, 0x5ef3388e9dbab5eb }, { 0x227705e7c7aff947, 0x55ea2b5d1b5fedb8 }, { 0x795639c9aa675fe5, 0x2f981c47af5dbb94 },
+ { 0x860ac1ab381a6831, 0x8c3e39d802cdea66 }, { 0xff5cf862927d37d4, 0xa3a6259fad9051f2 }, { 0x42e7b4cac03df4e8, 0xa59d85468a0e61c4 }, { 0x324fd30b9929a494, 0x7d1da7b87c186e13 },
+ { 0x3a53b87db66a6b1c, 0x6987e12baedacea7 }, { 0x1dc85cdf5b35d40e, 0xd5a291f4576d67b2 }, { 0xe37691c3157823cb, 0x9586cc41717422b7 }, { 0x714a52bf8524906d, 0x3b025ad47d9f1b20 },
+ { 0x696eef25f4e10236, 0x076f90a2c81a383f }, { 0x4f173ef9c58e7d35, 0x58c89857ba2485dd }, { 0x21925a6560ff7a74, 0xb3afa3234507d162 }, { 0xfebecd1c4e4df7c5, 0x40245db526194505 },
+ { 0x82041590cedaee75, 0x86731a706bacba3c }, { 0xf95546a51fddf2b2, 0xac2cf66311202985 }, { 0xb3ae9919f0a3c9d2, 0x1d2b35b649ece8f5 }, { 0x09fe5e08f3730f99, 0xf7183eb9594bb443 },
+ { 0xa1912509d545d723, 0x301b4907fb7a4373 }, { 0xc8ffca2c21a4d515, 0x3774d9a533607b4c }, { 0x513a3da439eb2a08, 0x6b2f81ddb311deb5 }, { 0x688cda5b28d1c227, 0xe4ede88843932cc8 },
+ { 0x50d808dae5dbea19, 0x88adf9f73898ca42 }, { 0xa47dc44cffb59176, 0xd9d41285199207de }, { 0xd730fc0f01f14239, 0xe711b805b1dc34d3 }, { 0x840dab57437a2b13, 0x89f9c98cd71cc24b },
+ { 0x6a8bb0a753b18105, 0xe12a18dc964204e5 }, { 0x0e15d5b1a2e30aee, 0x1b10956f6e72d8c3 }, { 0x80037f6cb5baad57, 0x83b4ea24be7d9211 }, { 0x450c3f7391adf19f, 0x49952e90bd370d44 },
+ { 0x470b558feacdb2bd, 0x4c52dec468e62569 }, { 0xa7989bce58e51245, 0x3f919afb47ca3b04 }, { 0x0ff7e0cf7ed3caff, 0xf892ed45e5fbcc34 }, { 0xb24cac672c9309c3, 0xfea94d9cc265fc02 },
+ { 0x52df62269ebba93b, 0x8d6a09a3ed49e26f }, { 0x9fcc494f95ef3a7b, 0x53d18b843cc1dd8e }, { 0x44ee0a0d4d9d318e, 0xaa1756ba36be19b3 }, { 0xe171fb3f6e1860e9, 0x90413c15a4a50a9a },
+ { 0xc50f401f24175cc8, 0xca21c4b4034a9f55 }, { 0x70a867c15914507c, 0xd88022fef6160fd7 }, { 0x3db833c4e7fa6e6b, 0x858f4afd99e3a227 }, { 0x5534e99fcf2bac4c, 0x6162a275da708eef },
+ { 0x7f5f870e27c79a83, 0x2012cfbb13edc3e3 }, { 0x8bfa4b983da9e1ec, 0x716b24c932e70e7f }, { 0xe88fa5379d6b6f70, 0x675902acfdeebed9 }, { 0x96321747669c35e2, 0xa4c9b53d658a69cd },
+ { 0x123fbc1025e61ef1, 0x2d307cb1b296ab86 }, { 0xaf84f0b877a6ddcd, 0x2b0bdc6895089bb0 }, { 0xbbb2f26fdfe0065a, 0x09b173259b2e4841 }, { 0xf0ab18adecaefd2b, 0x5b34c8da486b9dc6 },
+ { 0x11dae39282b69dc2, 0xcb75f4cfecce975c }, { 0x31aa8c893e7927a7, 0x9b582fc6224052c9 }, { 0x7d58edf25ca7d9a1, 0x25d53fefc63cebce }, { 0x1fcf36232055972c, 0xd06561a082bc4f9f },
+ { 0x4cf2617b62defe06, 0xbe8d1029e47cb907 }, { 0xbc5979d68e70032d, 0xe5b9d8f3ac1724c1 }, { 0x3854d281cd0a283e, 0x6c40117f7b0be68a }, { 0x4b19eac2334efb71, 0x5285bbffd345d587 },
+ { 0x9bc29d74632fbc3f, 0x599ca82c55a08dd4 }, { 0xfd5b929ee91d74f6, 0xa661d5cb784179df }, { 0x89fd216446c9a2ce, 0x74acd49de7362652 }, { 0x74a6b3faafd4d638, 0xd2cd01569f775f8d },
+ { 0x03e55f82a7508333, 0xe645887e5e583cda }, { 0xb642785cda538f87, 0xf4e46e34ab04ac58 }, { 0x48fcb540941e7842, 0xb4c033818d1de95d }, { 0xc1019424d2d7da8c, 0xc06ce71c6a2bcf0f },
+ { 0xcb1a95ae86f45626, 0xd13151db6d384796 }, { 0x3c5a06ba3bcaae7a, 0x660d32d7126ab6d0 }, { 0x46e960f136fd72ac, 0xafd0a6eee36f319e }, { 0xaa6811fd5d569b98, 0xc2c487ea77e0df1d },
+ { 0x1a23d7660aa5d179, 0x39aa3a2260540b32 }, { 0x2e65baaa1e2cb08b, 0x4b3d4e66a0fc1d56 }, { 0x3e5d6c4640aaed58, 0x63cac283c7bb9efd }, { 0x239530991b9f3956, 0xb668537790d6f94f }
+ }, {
+ { 0xb3a97ed91e9d2ca8, 0xb483a3c43d6b01c0 }, { 0x4c14776c9da46bb4, 0xaa39ded25980a017 }, { 0xd8d18f72d6c39596, 0xce15226d28ed47b2 }, { 0xcd43e90a399ceb1e, 0x9da554d42f9a5d63 },
+ { 0x276c86c755fad28a, 0xd0af5f7b4c06e665 }, { 0xda1d3753e15099f5, 0x07b14249e961e86f }, { 0x09d0f97526a1369f, 0x2787738203334f7d }, { 0x06970b63597614a5, 0x982fa06c805732a4 },
+ { 0x787d9cb07e77d313, 0xb109577c92a66e07 }, { 0x24c6621798c1d839, 0x9c590f4d0cccff37 }, { 0xd7967d64a914b7ac, 0x71bdf183ab893a6b }, { 0x13056d1bb6296a2d, 0xcb9fd6d587202875 },
+ { 0xf66df0c0a5987183, 0x393d0e9467d8eeaa }, { 0x8b2d83c34fa2bc86, 0x5ceda9b235e3ab5b }, { 0xf92a02d6da4f53b9, 0x8695dd7ae4bc9373 }, { 0x2c70c79344c8e876, 0x3e8c4cdd8eb906c5 },
+ { 0x87c09505fd4e940f, 0xafb32a6af64dcfd0 }, { 0x260ada36af52d45a, 0x55fd6f69cd4050ea }, { 0x7bd77860b34cd9a0, 0xfdff074ad26c7755 }, { 0xbcee8ccf614a0e92, 0x0b2b702abe0f7c19 },
+ { 0xc65fa85e28aed1e2, 0x73864772ed25bdc3 }, { 0x91f817addf2ae034, 0xb0f50ce5b1f0cc53 }, { 0x6a1ead5a32f6bfee, 0xffc4b1bb94c0f0fd }, { 0x9c735d9a976ece6d, 0xc6f9bf2ff3181e57 },
+ { 0xa97ceab78e15701a, 0x589b0693b97866c8 }, { 0xc2041b1c464bc924, 0x220d873aacfe20ba }, { 0xd43c99b4642fbd1f, 0x3d4ba1b5eb432339 }, { 0x3398bc4e400daad2, 0x064d19d0ca374a3b },
+ { 0x9b820a0834b0dc18, 0xdb842f51f2099a7c }, { 0xba7987ac383c1a37, 0x9304d0463e584ebd }, { 0xd3cdce26c7f1af6a, 0x203631cbea52a712 }, { 0x7207811595edef3f, 0xda7874c8d15f3828 },
+ { 0xe5689ddb13b11bae, 0xf2a2d841e0f8c6df }, { 0x53fc0cb199612910, 0x92f88bdf1d0eece9 }, { 0xd9b7d3832c6b9346, 0x4b47127fa9abf13d }, { 0x850c2d24cadd986c, 0x66174a4e37c1600d },
+ { 0x846a71d530759ebc, 0xe3457a5cb687d682 }, { 0xe1332e997d540368, 0xa3291809a1235ba6 }, { 0xe3ff96b84ac70f0b, 0x6a8d782d60aff47b }, { 0x6b78f1abc85eb93e, 0x7a9681a915864672 },
+ { 0x39e2a1ebab9796fe, 0x6d3c3a6489ce1c14 }, { 0xaad60e67432e7aa9, 0x146d56a5f9b27f9a }, { 0x6e451e185c13a728, 0xae4f71f3d51b6d84 }, { 0xd6f0219553bcb17c, 0xf4efc1912acf8ce4 },
+ { 0x95a3a4efb1cff8f2, 0xe17eccadf02b512a }, { 0xafebe1d4d76364bf, 0xc0b4a6ff392f546c }, { 0xc36247edbce3cff4, 0xa75fb7282db89635 }, { 0xb165c6f8290e20cb, 0x7d27c3e0fce7ae1d },
+ { 0x56c1e3020d2c3706, 0x46217b85dd93c71f }, { 0x6f2342e9a6bba1f8, 0x2b1d41e1545ddb0b }, { 0x9d15016b6dc6c8bd, 0x43ab8f3d725ea8d8 }, { 0x07f15792a3de1275, 0x1d7d907e0111842b },
+ { 0x2b819001e716fa03, 0x23f1dca38fa882ee }, { 0x233735853b1fca4c, 0x81249f330ddd7b1c }, { 0x6c89a6396b80ab4b, 0x67eb11d71497c259 }, { 0x529a504063c92fc0, 0x17aabbcd9c485a66 },
+ { 0x643f03bdb7899b04, 0xc53e524796e23bab }, { 0x03aae4d0cd3b0ab3, 0x4cf6503640ca1952 }, { 0x7eea97d32701c7b6, 0x2926f71012f15ca3 }, { 0xc5f54c8ee595db51, 0x3f701744adefa491 },
+ { 0x175ede59d8cc72eb, 0x9a14169dc6fbb50c }, { 0x466e6ac9763e5798, 0xc148fd661a79f638 }, { 0x8dba88a016d4a823, 0xc4c209deb5b499ff }, { 0x9828eed8f98bd6ab, 0x97727f67b2c3832e },
+ { 0x1ad5946e90885cb2, 0xec18a55784136708 }, { 0x5f111a772b8d0199, 0x61a60807dea08862 }, { 0x0ced16c6b2ec2889, 0xf35e83d8c3ae648b }, { 0x86a6c9f407e692df, 0x2ae11a78770b795f },
+ { 0xb53e75ba47eb380d, 0x2cac03a8bd3c3364 }, { 0xecb864ae35102d31, 0xd525abc3e3cb89a2 }, { 0x7ab1249149e4df70, 0x78ad3758532ac1da }, { 0x5130b490aef22573, 0x5b5cebfbdc824334 },
+ { 0xe6c2790bde8a111d, 0xbe548877a032df8d }, { 0x68d2157b0565b38d, 0x3660d19f554c5f20 }, { 0xbe2234ee56d902f1, 0xc28f100e7f83d3c4 }, { 0xcf8f512b0e0fe77d, 0x540134f0ee16f2be },
+ { 0x1c429f0dc9fe4817, 0x7437053b044455ac }, { 0x0a7a1da5eb9a3c2c, 0x6b7123b443f9562f }, { 0x888767138299b635, 0x101bf9847529b209 }, { 0x15926678ef5f7e88, 0x53b076b907771ad1 },
+ { 0x66f3bb9c801a9767, 0x0c9a3263576e9476 }, { 0xedde385fcfb82be1, 0x50779bd1628d3f2d }, { 0x556b07d2c0173db5, 0x0ad72bb39d59de4d }, { 0x4d722b9d670c6d64, 0x2f6beec0d8c61698 },
+ { 0x3154046f779ea6b1, 0xcfe979f40bbbe5e6 }, { 0xc87e06b9add1f508, 0x497ca48eef077695 }, { 0x89e13be27831b0e5, 0x9549c996f46f0486 }, { 0xffbd09b58339471c, 0x1eba7d1664eba1d7 },
+ { 0xcab2be989a42f96b, 0x80d8c4aa2e8bd948 }, { 0x70cb3934a27ee35c, 0x13dc14ec10d397f5 }, { 0x5056e861545a23a3, 0xde0edbe95dc4f5bb }, { 0x8031c2975e90867a, 0xb2ceba14f75c4bfb },
+ { 0x3cdf4e583fda88e8, 0xb9e5ca3e495337e2 }, { 0xfbe6baf7eddc5fda, 0x4f31bd5e25303cae }, { 0x4ed8cf4daa3767d7, 0x639dbef6980c0fca }, { 0x5ddda2561c1e0dfa, 0xa80268231f2c27bf },
+ { 0x3469ebdce3d3b8a7, 0x1b3089aecb26ce10 }, { 0xfd71b194b4aa4b7f, 0xd71e1d32a5670e0a }, { 0x909e4b5c2582e6e4, 0x35a73cf730b67adc }, { 0x5a2cf5c4bfc01f8f, 0xb57ff85d1e3da394 },
+ { 0x62a808deeeff8fa1, 0x5d11f22b16b5090f }, { 0xee74dc8f02832152, 0x1c81cbe72247267f }, { 0x58e04de5885313ec, 0x7cdb9879dfb10c49 }, { 0x163882a82264743b, 0x1f46268f47bd0383 },
+ { 0x492998df09e975a2, 0x7ee02e88991d8be1 }, { 0x5b4aa9354568195f, 0x302dc84f9f7b151b }, { 0xdc8a3c30b8268d50, 0x9f9ee2256936dacb }, { 0x75f6d6873633fd4a, 0xc705e4b6d04ebc03 },
+ { 0x9334af8ce8b9ec57, 0x79516cc1707c638e }, { 0xa1ca4f33521c4055, 0xfa4e45033b0d9f3a }, { 0xad2759f5e0f068dc, 0x0910c6dbf8a3fbb1 }, { 0x9fd9b94a5a55c4de, 0x8a0fef19b3d20705 },
+ { 0x3b2e19ca9c049a9d, 0xa4985a404842b3c9 }, { 0xbb1fdb5dc2941ce7, 0x1656e054bf1ef832 }, { 0xfc17ed654e024daf, 0x524c2d202421b885 }, { 0xc1aeffcc8b70c397, 0x6efbd70cec3439e8 },
+ { 0x81579e66a43880aa, 0x379c8a06761afd74 }, { 0xf0fafba3fcee6526, 0xa112aef8e78fdc0e }, { 0x3a48453b66ac9c4d, 0x21ca6a52c9040546 }, { 0xb8b53f8d0faf1654, 0x5aa0b062ffd4e160 },
+ { 0xe8e3d7ec5bf535f7, 0x84ae6b8ba21014db }, { 0xd0672af60acaa5d9, 0x6cc061fdaa98be40 }, { 0xb9d3637cf5071084, 0xdff280707e9257ef }, { 0x9609403f7cf4f241, 0xad889c9bb0e14878 },
+ { 0xef12807ef82b2782, 0x99d3fbf5a30190f0 }, { 0x57a7bff3f78431d6, 0xc3734b975cd57190 }, { 0x6795e76d7ab291b7, 0x89c80271d62822f9 }, { 0xe299ca49b06f09db, 0xefdf483fe1e942f4 },
+ { 0x45c48e19bb055d2b, 0x8dbead505ab3ef6a }, { 0x2d169b62be60eea6, 0xbbde7ccf0fffb04a }, { 0x3db912a9c5728e38, 0x3cb7fa2cc815816d }, { 0xcc25b5fbc334edce, 0x18f764c6aedcebec },
+ { 0xf3501f7331d56f95, 0xede4fecea745c55c }, { 0x63ce542f14578971, 0xd843c23997f3bf80 }, { 0x791bc04184dfd5c3, 0x345b676e13e0d888 }, { 0x4353857ae273498e, 0x15910d3cdae4ddce },
+ { 0x74908a76cc9bfb9a, 0x4257d4a451080a8c }, { 0x7361dde46f45e9ef, 0x5f2a44da50198ea7 }, { 0xdb7b6ba21bf89f25, 0x82e3725b68275ee0 }, { 0x1fe87bdd04c542a4, 0x38c1550d448e4cfe },
+ { 0x25a03ee66269dee9, 0x190b3f5f8d8a49b8 }, { 0x5986111472fb153c, 0xf989a86b5ef7bac6 }, { 0xae8dbd252dcb626f, 0x45e696edb869e2e3 }, { 0x32fee0bfbaa5ac02, 0x831f29c24b71fcb4 },
+ { 0x197f70be5db35601, 0xa0eef561c4d97e5a }, { 0xfa80e6061774590a, 0xca638d4ca4768a21 }, { 0xd1017607f062a309, 0xe99251ef2bde08cf }, { 0xea2f6fcd6c663994, 0x4d0a0baf639cbb06 },
+ { 0x419f3d5bd5e045ed, 0xdc356d181b687213 }, { 0x0d8b4a3748442e59, 0x760cb3ca42e8d204 }, { 0x3032589e8d36a061, 0x4abb49e68afd5369 }, { 0xf84c5e2720e75569, 0x03c7ed6865fa25fc },
+ { 0x773a6ea601a0f129, 0x0ea1849211c213de }, { 0x282b74d12a2df0b0, 0x6f078c95cf629bbc }, { 0xf5c7141068a37b30, 0x75cb5ea22712f7f8 }, { 0x294d2820d085f660, 0xea55bc874e242d33 },
+ { 0x1e8e272cfe6d4474, 0xbd93651fc5c8fa71 }, { 0x94c5f81e4b67fe22, 0x642cfcbf716de7a5 }, { 0xac4105041a586e0c, 0x8c42f6c979e54d3e }, { 0xe7a425fa242217cd, 0x3b06b86521746902 },
+ { 0x994eb2290323d07b, 0x12204f75338535a1 }, { 0x3f75aa88f2e1825b, 0xf5139a0809992eb0 }, { 0x8f7630812147a440, 0x0d6669fa74383622 }, { 0xdf20d8e0751d87e3, 0xd368b21329fcc399 },
+ { 0x37c30f0c2ee8b214, 0x57c6d9988becd742 }, { 0x0000000000000000, 0x0000000000000000 }, { 0x126331ea4c816cfd, 0x4ecde6c706669efa }, { 0xb2cf2228e4352a78, 0x31d193d6bc2db74f },
+ { 0xcee90ddaf4a7e1ad, 0xd15304e26f504431 }, { 0x01665cf1faa806d0, 0x855230128146b68f }, { 0x976f1cce865cf491, 0x28daac8931a7fef7 }, { 0x0b1c415411323afc, 0xee2313a6c2bfe0a0 },
+ { 0x765c3257fb08f7f9, 0x8bf3b4809084a551 }, { 0x0e21aee7857f24ea, 0x3afae3fc0222cb56 }, { 0xa0ac13c2a8b44685, 0x7f1c7511ba4b29b5 }, { 0xe40ec12ae9191d7e, 0x77f0e85361be7050 },
+ { 0x350fb72d197bbe77, 0x9e62b9bc4a60789f }, { 0x1d24c3fc33564ec7, 0xf16535298502e323 }, { 0x2fda234389f3e2c5, 0x727a1cebce731f97 }, { 0x69b4498affcdb55d, 0xb332e18dd40ae9af },
+ { 0x0f47f2167fd7223a, 0xbfa8d3ee83647dd9 }, { 0x7c262ff21092cbd5, 0xe0829734d37df37e }, { 0x7f8ccb22dda9c166, 0xac74c70293b7ea2c }, { 0x3e13f6790849848b, 0x7041aa1a88df983f },
+ { 0x5e774686d1250749, 0xe4f438155fe63eed }, { 0x6064b0ffd96c83c2, 0x94b5920fd739a6d2 }, { 0x045bb3426ee518c6, 0x518bc04841db9d79 }, { 0x8a4bdf32b50aba56, 0xd9bf99a0b4a51dd4 },
+ { 0x11c9d53a81ba664e, 0x023bb6f146ac87a8 }, { 0xe9858b1da15d3327, 0x01fc5b992356a254 }, { 0xa260abe39f274ae6, 0xb6b815357bc78668 }, { 0xa591fc713cf95893, 0xabc5854b7ad60243 },
+ { 0xcbd4e26960eaffbb, 0x058af4b8afcd6fc7 }, { 0x18192c4fa71b50d1, 0x25bcc573459fc8d5 }, { 0x02ccb82137930c63, 0xc9a46024c18cafdd }, { 0x4be520fe3e7a79c1, 0xb7444eac5891243c },
+ { 0xf2364382cb7d6945, 0x68b6cedc260373d3 }, { 0x9ae456f9ce18dac8, 0x5ed61f43734f2cf3 }, { 0x053defb3944d1e16, 0xd4d9f05ac09d2bf6 }, { 0xb0039a09d3a6261b, 0xf875f3f27da11892 },
+ { 0xa63b18a1f1c25220, 0xe733d57d3a1c1b11 }, { 0x6deffac89128ad9b, 0xe2b921c595d174d6 }, { 0x8cdcd451ec7caef3, 0x419039cc34f22f70 }, { 0xe055726887fc05b8, 0x267b281b2065ed29 },
+ { 0xa75d44500b6a54f0, 0x6261e56fbb5aad9e }, { 0x21fb8da40c8cc62f, 0x4880ff17cc51d4c1 }, { 0xd2ab92d73d59a9ba, 0xa56401d96b14119d }, { 0x08b6a584dc09304f, 0xa2d543908275f9f2 },
+ { 0xb694916a8ad032be, 0x605a539efdf62a36 }, { 0x6102ec0e23c48512, 0x11e7a21d567f105d }, { 0xa4f7a080c6515e43, 0x2e97b559fb90b4cc }, { 0xd55ac5459e87bbcf, 0xb81991a76a0595b6 },
+ { 0x839b264793ab8cc9, 0xfe38ea22b79652a9 }, { 0x5cbbfea7e6b60b2a, 0x2d5058319e6a9130 }, { 0x4a837c0fc4d27f11, 0x32167ebed9d792b3 }, { 0x2ebc7fb2735be415, 0xf7282cf94f35a918 },
+ { 0xf19ca752064663f6, 0x24409eea66c96a81 }, { 0x1bb3c89f6a205a62, 0x694a95450555d187 }, { 0xfedb5544799141cc, 0x9be84d04e5ad1758 }, { 0xf4a148e1920b7de0, 0xf0996eb0a6544177 },
+ { 0x71ad65c558d6e58c, 0x968e24fe9195217a }, { 0x8e106c70dbefa290, 0x883459e8f57e80ad }, { 0xc0c8a33d71d8c547, 0xeba9e71e6d728f67 }, { 0x209dd155f624c0ff, 0xcdd2cf054d17624e },
+ { 0xc493107f1f3ddd81, 0xba2227562ca9121e }, { 0x4235d98b18db4f5e, 0x90c33d2e5ba26b41 }, { 0x44a2d2e841ad5bfb, 0x08ec9d42dbf559e5 }, { 0xabb05296b9867c79, 0x913f66b778f4c915 },
+ { 0xa306f712658f4c36, 0x33ea2527fa8130e7 }, { 0xc739f4afd206d732, 0xf6d477606c630b4c }, { 0x9ebfe5bba0fdc20e, 0x0f5ddf0b3294b18a }, { 0x2ae7ccf01dbefcd3, 0xa6a3ecb10eee3461 },
+ { 0xde4684118fb58133, 0x563a8201a8ba7516 }, { 0xf70bac315f307753, 0xbc6f3e86e69e5825 }, { 0x9252f37d1211ea87, 0xfc035cd3f13ad501 }, { 0xbf44681fac710421, 0x47dd201cfec5654b },
+ { 0x65595f4c4d219dd4, 0x406c625517a48d24 }, { 0x4fbe93bc509f6107, 0xe6cf8ee4194ab945 }, { 0x470836388c965148, 0x441acd749b3f40b7 }, { 0xb458294bbd433edd, 0xa9fe33ba3c7a85eb },
+ { 0xb7f2cd9b7078346e, 0xe508638c7cb09cb9 }, { 0x36a553fdd440b4c4, 0xd294e98a0aaa61cd }, { 0x14f43a8915f77858, 0xd6e246ab8631ac5e }, { 0x22516974c1b7cc9c, 0x0476af218c9bcd93 },
+ { 0x7d407303ea3acd05, 0x65d0a726523b45f1 }, { 0x82fd7ab669038a19, 0x7b6ada3036d0e426 }, { 0xc9185a485779f3d8, 0xcc2e949c6e41c01a }, { 0xddec60c1428e8b80, 0x1accd237e8706c44 },
+ { 0x10af89cb7b12609e, 0x876986e3c7ea3127 }, { 0xeb49333c96ce3f44, 0xc8583bbde2da0d89 }, { 0xa81ab64674bd76ca, 0xddc93681383ed047 }, { 0x40f961aa2f48433d, 0x59675d0a9a2ec49c },
+ { 0x3884fd1a513f902e, 0xe86e0a760888aa9b }, { 0x484fc42ef3417372, 0xfbb21e9a185b3d6e }, { 0xbd88d03e9be20842, 0x8e7940383f49ca96 }, { 0x540d5b233abf3b65, 0x8f851ba11c1f68c2 }
+ }, {
+ { 0x9cd3c3c2d42d19d4, 0x8fbed12c18a95de1 }, { 0x04a6349440cb7b40, 0xb560256bdb14b350 }, { 0x84817b3c97d2c097, 0xb73d0f9587d171c2 }, { 0xc11d84d94db6694d, 0xbf8aa7eb3443ffcf },
+ { 0x1cf48c6a0334a203, 0x8de3fbd2446c9f73 }, { 0xb80c947cd1713cd1, 0xdb581f99d41d3f74 }, { 0xeed6ace3f87908f8, 0x4584483647d0dcc6 }, { 0x4454f2c0ca26c7ca, 0xb4af3014f597d219 },
+ { 0x199ab5db53bdb753, 0x849b46d3d97d7037 }, { 0x3edef50a66272066, 0xd755e3d8dfc6f69e }, { 0x2e03251fa58d0fa5, 0x461677b735967f1d }, { 0x01c80d2510426e10, 0xbc18986a46055c14 },
+ { 0x76a35bb56c9f6a6c, 0x7f5abc71846d3277 }, { 0x094765ce90179890, 0x15d8d2bc332df9b4 }, { 0xdc2105965ec0a55e, 0x8e71c453362a3ca8 }, { 0xceafcfc9bdee56bd, 0xa402a3e850700d03 },
+ { 0x81ef428dc75bd5c7, 0xbe45b2941ac09e86 }, { 0x02531a4a2084dc20, 0xbb30f3d48c0ab828 }, { 0x3bb0ccbb36ae3536, 0xde2d5ed942d719da }, { 0x36519de1e672d6e6, 0x7e95a90eaaee533e },
+ { 0x1346c77af36c9df3, 0x966bffd1205f6dbf }, { 0xe659c408782cfe78, 0xec4402e032f87966 }, { 0x06f52ede604fa760, 0x0e50d6bf571e0b78 }, { 0x7056756b0cd0cd0c, 0x710a6aced373390f },
+ { 0x73cd62043c167f3c, 0x76220170197cdd33 }, { 0x6b9fdafa7fe9a67f, 0x4ea1dfc98604f110 }, { 0x0c295c7fc09e8dc0, 0x1ca06fbdae3c16f0 }, { 0x47cfe5affae075fa, 0xb3875baa3f983625 },
+ { 0x2aa5118be54674e5, 0xf37652dcee82cc4d }, { 0x72056f212c54112c, 0xca3a991a5f798127 }, { 0x56da389f29083429, 0x9edc57af93cde3b2 }, { 0xd5666058ced73dce, 0x9ba916ef0507c51c },
+ { 0x776b56907cdd047c, 0xc342241bc2686e63 }, { 0x8dc61ef207c55807, 0xa2e5dd29b4fc8876 }, { 0x9a26ed1cb462beb4, 0x81ee07934fb75699 }, { 0xbd62adcd81f82981, 0xd220a298490cd030 },
+ { 0xa3c53beda24857a2, 0xe4f3aa9e816af76b }, { 0x0fb24b10f0583ff0, 0x1b8804036433f2cc }, { 0x333fa450b6fbc3b6, 0x77ed140f37ffbc7a }, { 0x1852b8fe43ffd943, 0x3883deb99f782c23 },
+ { 0x8b33302c678aff67, 0xacb50b96e3e2830e }, { 0x51e71b645905fd59, 0x2c94197a82d6b4de }, { 0x7e2c335eecca9cec, 0xd69af6a7f14597d7 }, { 0x30a4b33f863d7186, 0x70c57fb1fdf05846 },
+ { 0x9e80d988f4a9c5f4, 0x348e22f894a3e5c9 }, { 0x379990c4f630b8f6, 0xc28d3164eceb0f2a }, { 0x75384cda5c59d85c, 0x7872d7cf4e62d64b }, { 0xa05e2c82928ee592, 0xe3dbc1204b651357 },
+ { 0xebb89552a8f01da8, 0x4cfcf537dac13382 }, { 0x608ba57ecf7ae2cf, 0xe049fea13923b08c }, { 0x6ef1e34b2f60b32f, 0x47d962c81b151e54 }, { 0x5af364e0e996b9e9, 0x827c38123df1f542 },
+ { 0x945cab295478ef54, 0x267e9bfa6d81f841 }, { 0x642d91ea8fb1998f, 0x5529dbcae23703dc }, { 0x42a1dc1eaa6960aa, 0xbaffe6aba289d961 }, { 0x936188d224752624, 0x9436d52f7c9aaf2d },
+ { 0xb2d0e6dd71a01671, 0xc9a8a69b2d3f22fc }, { 0x222a796065138265, 0x5ab6180a9baa69ed }, { 0x5dce471b999b7099, 0x303476c72ceaa22e }, { 0x316cbe1a967f1f96, 0xccdde7dbbbf50452 },
+ { 0x791110a59cc7559c, 0x64d2b872e05ec0bb }, { 0xc85ae117dda1f1dd, 0xaa527557076e067b }, { 0x4d13970e5a315f5a, 0xa177e2a8c6ba2bad }, { 0x088f68eb8055f680, 0xa9c04ad67528a5a0 },
+ { 0xef1ea1c6e83b66e8, 0xf99cd05c01d580d2 }, { 0x056e39b150891550, 0x0978bd019d11ef44 }, { 0x88a82743574c4d57, 0xab9d602829ed6732 }, { 0x9f48d4ade4ebabe4, 0x8896ba92d2a6b9dd },
+ { 0xd88731021e0bde1e, 0x3b11e138ed3e8ff8 }, { 0x99bdfa7384a40c84, 0x86c66c2d85b8b2a5 }, { 0x25175a9b151e4b15, 0xe8fe56df8ab13e81 }, { 0xb14bf1b24166a441, 0xce80cd25e730c6c0 },
+ { 0x55412ff019ce8619, 0x99f43c1159c2078e }, { 0x3a78c19e26ec5b26, 0x6235c6b304d245ce }, { 0x0adc72a1a0d12aa0, 0x12f0b902f9221d88 }, { 0xfd906b990b15950b, 0xd3efb7e7678fb179 },
+ { 0xab4a5306221da122, 0x4d33e048f44252cb }, { 0xccfcd5839d6a8a9d, 0x1f32503cdc7ab52b }, { 0x2b6d1caef5041af5, 0x4f6ecab6a8879059 }, { 0x459cffe5da64a9da, 0x08b7a87eb3928e0d },
+ { 0x8e5d099d3703ea37, 0xa5cdb6977ef36c4a }, { 0x871a6c53a71472a7, 0xb015642b4dde95fe }, { 0xc992ec32cde39fcd, 0x164aed3d416b5a6f }, { 0x1a01a2b4637b0563, 0x83b32d6d1372940b },
+ { 0x7b420aefbc4389bc, 0xdfe24ba66c547893 }, { 0xa7630f79e2832ce2, 0x51938ff55a7e443b }, { 0x35ca8a8ed6b464d6, 0x79bdc2b060e1b702 }, { 0x9875f75694e66294, 0x3adef447c3bdeeb1 },
+ { 0x9beee039a420d0a4, 0x3df69ff909b20a8d }, { 0xe9eb8f188874c188, 0xf7cc06e356cb8baa }, { 0xafec679262d6da62, 0xf853c5232f56e19b }, { 0xdb1c266d2ecd6c2e, 0x3c398a8627316bc4 },
+ { 0xed4dbb8cc8bfbac8, 0x42ac23888ddf38fa }, { 0xe0acead618635918, 0xe214d45f65e6721e }, { 0x382bdbd406688706, 0xd905356788d8fde6 }, { 0x39e3d6f1162ae916, 0x651dad0dcedda1f2 },
+ { 0x1d3c814f1376cc13, 0x31fb63b80269c367 }, { 0xa4f81816d2459ed2, 0x56bbe44b9071a007 }, { 0xf8fe52285b9c805b, 0xda970ae6fa9e5e3d }, { 0x6310b211ffbc50ff, 0xe761951ff32c54b0 },
+ { 0xf684141dbb86d1bb, 0x7d07968fd8a8f0e5 }, { 0xa5301533c207f0c2, 0xeaa37c21d674fc13 }, { 0x5f9d5d51b91facb9, 0x8b048513a0e01a06 }, { 0x67b68685bf772bbf, 0x5201b0742838e7e0 },
+ { 0x62d8bf34effe3eef, 0x5b790d75b52908a4 }, { 0x7db72431dc0c2edc, 0xd1b29d193b4a73eb }, { 0xfc5866bc1b57fb1b, 0x6ff72f8d218aed6d }, { 0x8f9504b827418427, 0x19d52efd38f6305e },
+ { 0xdad42b483e8f023e, 0x802112ec613437d0 }, { 0x83bc58c7e7df09e7, 0x0575414096ca26ae }, { 0x0b147f84b09344b0, 0xaee82168bf27419c }, { 0x527c0c0b69c34f69, 0x2bbc72c448d950e2 },
+ { 0xb7bedf6c21290321, 0xc0d01b9ab02ecdb8 }, { 0x6ca2f9010fe46f0f, 0xfce9911c971fa67c }, { 0xba5f8e36f1f5e0f1, 0x6068ec4d5817875c }, { 0x49b5a39a1afa241a, 0x1417c7c31dae98fd },
+ { 0xc5bbb04d0d7d120d, 0x0aea8280ef574c9f }, { 0x32f7a975a6b9ada6, 0xcbf58c6571fae06e }, { 0xa919494c02997d02, 0xf603139c7848eae3 }, { 0x4e8880616af7ed6a, 0xa65f89160cb5cf91 },
+ { 0xe164e7f308213708, 0x5e0c4c3523e32e0a }, { 0x74f041ff4c1bb64c, 0xc46a4fa508678a5f }, { 0x502f164149479349, 0x908c8110c4d3e8ca }, { 0xbcaaa0e891ba4791, 0x6e383af20f098c24 },
+ { 0xbb978313e1b78ee1, 0xdc7074271e12db48 }, { 0xf51f03728b40638b, 0x7a2ffd3112a714d9 }, { 0x90fa9fbd14b39414, 0x931ebe91b6954b11 }, { 0x2d983270954bbd95, 0x413e1c09ff999b21 },
+ { 0xea709877b8b273b8, 0xf0e46d5d9cc46f96 }, { 0xd00859e99e5e289e, 0x92d1abee98162a58 }, { 0xf3ea2daceb0fc4eb, 0x747f2b8e45b91fa1 }, { 0xdfba12f96e06176e, 0x8959afedfc25d894 },
+ { 0x10ddd015c3aa2fc3, 0x9143946fea508983 }, { 0xe823823d9836af98, 0x4bd49e8910ced7be }, { 0x073d23fb700dc970, 0xb2484ed5111b576c }, { 0xae246ab77294b472, 0x444b5d496953bd8f },
+ { 0x9132929804f1fa04, 0x2f0626fbf0901705 }, { 0xcbc1f678ed6743ed, 0xad7a1ee9cd61e247 }, { 0xa6ab025cf2c142f2, 0xed8b179f1c7b182f }, { 0x89602a66470e2347, 0x1785f8426fe83b26 },
+ { 0x2079632a45975e45, 0xe186ebde17a0d1c5 }, { 0x413acb719aafd29a, 0xbdd78d1568863d5d }, { 0x293e06e4d580c6d5, 0xf45e3962248d2871 }, { 0x5968738fd9500bd9, 0x855453acf7fe117e },
+ { 0xcd34d8a68d28e48d, 0xa32ac8569a7fe93f }, { 0xfe0b7cf63bd3273b, 0xd4c7dc59ad805545 }, { 0x6a57d7df6fabc86f, 0xf2b947a3c001ad04 }, { 0xdde908b34e82cb4e, 0x32695c39702f60bc },
+ { 0x92a985f734374834, 0x282e4d453a9ff339 }, { 0x960fb16374fc3374, 0x9d4e682ee18b4069 }, { 0x65e59ccf9ff3f79f, 0xe93143a0a4325fc8 }, { 0xc28693b67d70db7d, 0xb8a2cc55fe4c1bf3 },
+ { 0xb318ebf861e27861, 0x75b03ef16b3a7ee8 }, { 0xb676d249316b6d31, 0x7cc883f0f62b91ac }, { 0x548922d5098ce809, 0x25eca47b1fc75b9a }, { 0xa8d1446912db1312, 0x4a1b8bf63e4db6f7 },
+ { 0x97c7bc4664be5d64, 0x2156f044a78e1c7d }, { 0x80274fa8d719bbd7, 0x025d2afe5cc5c292 }, { 0x15b3e9a493233a93, 0x983b296e774166c7 }, { 0x4be6b9d03a7ef83a, 0xaf27341791a420d5 },
+ { 0x1628fecba3e588a3, 0x9f1342d0bd4e82fb }, { 0xcf67c2ecadac38ad, 0x181a3b8216755117 }, { 0x719e784e1c92a31c, 0xcd12f2a49576651b }, { 0xde721fdc7e44797e, 0x35413787ba208480 },
+ { 0x3f16f82f76654e76, 0x6b4d7bb299c3aa8a }, { 0x0000000000000000, 0x0000000000000000 }, { 0x1f6f9b0533f21033, 0x8acb906c8e637b4f }, { 0x827455e2f79d67f7, 0xb96dd92ad0cf7aba },
+ { 0xe337fdb928a5eb28, 0xe53cbfe1afe99622 }, { 0x1ea7962023b07e23, 0x36d30806c866275b }, { 0xa20d36c8b20a39b2, 0x58eb32f4c76fab7f }, { 0xd25b43a3bedaf4be, 0x29e1583a141c9270 },
+ { 0xadbf7dd842520642, 0x436336f7a35c59b3 }, { 0xb425c80311efb111, 0xc7f870247a212984 }, { 0x9d1bcee7c46f77c4, 0x33a649465eac01f5 }, { 0x69ccc0b05f6d7a5f, 0xf5912c1d0a0e4938 },
+ { 0x039b176f30c6b230, 0x07286bbeca0fe43c }, { 0xb5edc52601addf01, 0x7be0e84e3c247590 }, { 0xec85b6a9d8fdd4d8, 0xfeb4bbe2cbda64ee }, { 0x24df57be055c2505, 0x54e6ceb5ccb46295 },
+ { 0xaa825e23325fcf32, 0xf12b7822b2470edf }, { 0x6143a85bdf388cdf, 0x5c5166cb7f26ec98 }, { 0x4369d13bba2b0eba, 0x06e77ec1e48c8575 }, { 0xd1c054cc8e1c468e, 0x2ec93384de13764c },
+ { 0x1bc9af9173396b73, 0x3fabb5075577c81f }, { 0xca09fb5dfd252dfd, 0x116286838b64be53 }, { 0x78d91d808c853b8c, 0xd8ca2018a65b9caf }, { 0x17e0f3eeb3a7e6b3, 0x230bdabafb4bdeef },
+ { 0x3d45e26556e19256, 0xd07d886615c912a2 }, { 0xffc371d32b91492b, 0x68df4433eb850951 }, { 0xa19621a782cc8b82, 0x5fc3594a0d604f43 }, { 0xfb6545476b5a326b, 0xddbf61583091ba01 },
+ { 0x854976198790ae87, 0x0b2597ffc1d42dd6 }, { 0xd3934e86ae989aae, 0x95f9c0505219ce64 }, { 0x3c8def4046a3fc46, 0x6c65100c53cc4eb6 }, { 0x5e555074a95dc2a9, 0x371c1d79e6e54612 },
+ { 0x0e7a4635e01a51e0, 0xa7909c692236aed8 }, { 0x340287abc6f60ac6, 0xc5a55ada26e4eb16 }, { 0x667e8ba0af3545af, 0xee19281e6e3dbbf4 }, { 0xbef9baa2b13e9bb1, 0xd508c9268303340c },
+ { 0xd94f3c270e49b00e, 0x87097952ab3bd3ec }, { 0x5c064a3e89d91e89, 0x8c2ceead6aeffe3a }, { 0x53b4012e79812179, 0x97a4eaae0edc0cf6 }, { 0x1115dd30d3e841d3, 0x2d5b0c05ac55d597 },
+ { 0xc7e8aa072df9ce2d, 0xb1da7154635df4b7 }, { 0x58a07eaac91265c9, 0x394ccbc6b1fb4d6a }, { 0x487daebf0ab84a0a, 0xa80f5fa95babc4e9 }, { 0xf0713ac3dbc976db, 0x735740308fb6fb9d },
+ { 0xfaad48627b185c7b, 0x61a7f9327694e615 }, { 0xd4ae6d7dde9553de, 0x27b18e8543029908 }, { 0xe5c2d36748ea4c48, 0xeb6c695ef8f79d5a }, { 0x128eca5fe32ef3e3, 0x2a7367bb665a31ab },
+ { 0xf9365f0d4bdeee4b, 0x668f928cbc9b0229 }, { 0x274440d1359a9735, 0x53cea50b06bb86a9 }, { 0x40f2c6548aedbc8a, 0x01cf157f2e836149 }, { 0xf2222089fb4daafb, 0xc867b3e403bc43b5 },
+ { 0x2c503f558509d385, 0xfd268463b99cc735 }, { 0xf1b937e6cb8b18cb, 0xcf4fd85ac9b3a789 }, { 0x86d26176b7561cb7, 0x0c0dfc410bdbc9ea }, { 0x4a2eb4f52a3c962a, 0x133fac7dd7a17cc1 },
+ { 0xf74c1938abc4bfab, 0xc11f0ee59eadacf1 }, { 0x6f39ee6e3f22dd3f, 0xfbc1faa25d104240 }, { 0x571235ba394a5a39, 0x22c4cfc5d5c8bfa6 }, { 0x4607e88aeaa21bea, 0x0f9fc3c0799d6a31 },
+ { 0x2fcb283ab5cf61b5, 0xfa0eefdd73932309 }, { 0xb083fc975124ca51, 0x7298554fa1359ad4 }, { 0xf4d70e579b020d9b, 0xc637655b54a248cd }, { 0x4f408d447ab5837a, 0x1a47117c4ab09385 },
+ { 0xbf31b787a17cf5a1, 0x6910514cc5066818 }, { 0x0de1515ad0dce3d0, 0xa0b8f7d7e8394ae4 }, { 0x4cdb9a2b4a73314a, 0x1d6f7ac280bf77b9 }, { 0x8afb3d0977c89177, 0x10ad93fca5e7df1a },
+ { 0xc0d589fc5df4075d, 0x03923f817246a3db }, { 0x6804cd954f2f144f, 0x4989b4774c0b152c }, { 0xc473bd681d3f7c1d, 0xb6f21aeaa952108b }, { 0x147be48183615483, 0x2423b10431443ad3 },
+ { 0xac7770fd52106852, 0xff7bae9de55905a7 }, { 0x268c4df425d8f925, 0xefd63d6140bedabd }, { 0xd6fd7737fe118ffe, 0x9c817d51cf082120 }, { 0xc620a7223dbba03d, 0x0dc2e93e2558a8a3 },
+ { 0xe40ade4258a82258, 0x5774f134bef2c14e }, { 0x21b16e0f55d53055, 0x5d9e73b451a58dd1 }, { 0x5b3b69c5f9d4d7f9, 0x3e64a0787bf4a956 }, { 0x7a8a07caac01e7ac, 0x63fad3cc2a512487 },
+ { 0x7fe43e7bfc88f2fc, 0x6a826ecdb740cbc3 }, { 0xe791c92d686e9068, 0x505c9a8a74fd2572 }, { 0xb9c49959c13352c1, 0x674087f392186360 }, { 0xe2fff09c38e78538, 0x5924278be9ecca36 },
+ { 0x23e274457551ec75, 0xe6ae8060ddaf35f9 }, { 0xc34e9e936d32b56d, 0x04ba543fb84947e7 }, { 0x6d6af4241fa6011f, 0x40f10976d11afa68 }, { 0x8c0e13d717873617, 0x1efd4543f2f9d462 },
+ { 0x9594a60c443a8144, 0x9a6603902b84a455 }, { 0x7c7f2914cc4e40cc, 0x6daa05737d4f2fff }, { 0x28f60bc1c5c2a8c5, 0x4846a10862887465 }, { 0xd7357a12ee53e1ee, 0x2099e53b890d7d34 }
+ }, {
+ { 0x09ad9bfc7c7150fe, 0x1b53683f3f385efc }, { 0xe9d1e2eef4d89f6d, 0xf8bca3dada3c90ee }, { 0x3a0e92dd01e49453, 0x4e5d24a6a6b0b8dd }, { 0xf0f491115314b8ab, 0xd35f7d9595c51811 },
+ { 0xda72ebcf894d5bc0, 0xadb2ef4343b476cf }, { 0xa43b656e24a6bd7d, 0x2f469afafa27c46e }, { 0x722fc03167ea51af, 0x9680e29d9db30d31 }, { 0x615fda166fc67b72, 0xa32d01e4e47a8416 },
+ { 0x9806d0fb40a39327, 0x6b21144e4e87c2fb }, { 0x0bbc86c45f2e87f9, 0x1d450e31318934c4 }, { 0x297e88fa09c8be8e, 0x7bf0c7dfdf7931fa }, { 0xaba5d9da3d36578a, 0x3e2f58d7d70f24da },
+ { 0x9253b923ef439e3c, 0x756f297878b7c323 }, { 0xbac4dec51645aa50, 0x0d94dda0a077c7c5 }, { 0x8123a304e76fb4e1, 0x40c2ca01017e4a04 }, { 0x3668dc4dcbe52341, 0x5a29b3828290074d },
+ { 0x787aa9e9c80a5cb4, 0x88cedfabab830ce9 }, { 0x958971777a6caed7, 0x7c5eb06d6d1e4877 }, { 0x49c8bdf096c04f1e, 0xdbd6f53c3cba80f0 }, { 0x1add81db745d7a23, 0x2efe8b4646f1d7db },
+ { 0x1ceea69311bcc02a, 0x24c4215454e16993 }, { 0x634ec72e4c99ac75, 0xa53b67eaeacbee2e }, { 0x7c5893998eb431ba, 0x84e213b7b722d899 }, { 0xee0b2aba61f7af86, 0xf18d3acfcf951bba },
+ { 0xd027821726ad56db, 0xb3fcd27575847717 }, { 0xe3848b365b389276, 0xe6f29eecec0c9136 }, { 0xf8b0e5f1dfab62b7, 0xcb0726adad4473f1 }, { 0x5f7372bb289c822f, 0xe15ce95e5e6be8bb },
+ { 0xc0af6a14fd1021e3, 0x834c64050545a114 }, { 0x7b825bcd1b9b0151, 0x8dd38aa2a28b53cd }, { 0xd614a55f434cecd2, 0xb9c678676794c95f }, { 0x3be77dc1f12a1eb1, 0x4d5617a1a1098dc1 },
+ { 0x39f660f9d275c9b6, 0x4b4071afafb8e7f9 }, { 0x80ca4c1817a13e03, 0x43c9f90606c77f18 }, { 0x75f50865f2c56144, 0x9fb17b88881a8665 }, { 0xe64f5e5aed48759a, 0xe9d561f7f714705a },
+ { 0xa9b4c4e21e69808d, 0x38393ed9d9be4ee2 }, { 0xc69c4d5c98f19bea, 0x8976ce1717551f5c }, { 0x58a9baefbdb3b2c4, 0xe86d704b4bc263ef }, { 0x33a309217d95c4ad, 0x550e4c999988e621 },
+ { 0xfc92df8199150fb9, 0xc72beab1b1e5a781 }, { 0x01e9ef1cf0ce8ae2, 0x030b330707b9351c }, { 0x8332be3cc43063e6, 0x46d4ac0f0fcf203c }, { 0x66851242fae94b99, 0xaa1c98f1f1d30f42 },
+ { 0x9c24ea8b061dfe29, 0x670dd8525226168b }, { 0xb1785801496b2da9, 0x10d1d39191fef301 }, { 0xac7f118ea8196761, 0x371ec1c2c2a6af8e }, { 0x97986c4f593379d0, 0x7a48d66363af224f },
+ { 0x305bfb05ae049948, 0x501319909080b905 }, { 0xccc92484371196f1, 0x9738f32121651e84 }, { 0xa1f0b00292d65a91, 0x206165e1e13f2502 }, { 0x2ea440ae9ce78e65, 0x72c15ecacad0baae },
+ { 0x18cc9ce35702ad24, 0x28e8ed484840bde3 }, { 0x2518c66ac3c9099c, 0x6f8450fbfb598e6a }, { 0x1d07498fe1724ac8, 0x27cf125353585c8f }, { 0xcf31d6a0e480cb14, 0x9225a628286d41a0 },
+ { 0x20d3130675b9ee70, 0x60a3afe0e0416f06 }, { 0xd1ce6d0bd663dc39, 0xb0f7e172723d420b }, { 0xf9590aed2f65e855, 0xc80c15aaaafd46ed }, { 0xcd20cb98c7df1c13, 0x9433c02626dc2b98 },
+ { 0x54cff47f77b205d6, 0xfc19e76f6fe2dc7f }, { 0x4a304fd4455112fb, 0xdecba03535b2dfd4 }, { 0xdb9b04d37983d122, 0xaeb9dc44440d43d3 }, { 0x1161071f2b73fdda, 0x33bb85777778e31f },
+ { 0xd98a19eb5adc0625, 0xa8afba4a4abc29eb }, { 0x42743b34c9eec8e7, 0xc693fb0d0d33b434 }, { 0xc2be772cde4ff6e4, 0x855a020b0bf4cb2c }, { 0x378133513b2ba9a3, 0x5922808585293251 },
+ { 0x68f241ea13b72b8c, 0xb87e69dbdb42daea }, { 0x4bd9a0c8b59f9819, 0xddc09332320beac8 }, { 0x0633274865e1ba09, 0x0a3aaa121210be48 }, { 0x1effbbab32e3172d, 0x22d2475a5a5003ab },
+ { 0xe8380df20416158f, 0xfbb790dddd85a5f2 }, { 0xe26d642aabf61894, 0xe5f9adebebb5a42a }, { 0x84e87668511f530d, 0x4fe5351a1a66ab68 }, { 0x6ec166a276569185, 0xb244c3c9c95264a2 },
+ { 0xb8d5c3fd351a7d57, 0x0b82bbaeaec6adfd }, { 0xa3e1ad3ab1898d96, 0x267703efef8e4f3a }, { 0x6b0ab3cec0267669, 0xbd633cd2d24a85ce }, { 0xcafa03cc52f02cf8, 0x9d0259333375a0cc },
+ { 0xbee6e4b550fbc75e, 0x01b811bcbcd613b5 }, { 0x04223a7046be6d0e, 0x0c2ccc1c1ca1d470 }, { 0xe195960e78674571, 0xe0e4f8e2e2bdfb0e }, { 0xa62a785607f96a7a, 0x2950fcf4f496ae56 },
+ { 0xc14685080ddeab01, 0x8047570202fc9408 }, { 0x4065260ceab11fe0, 0xc0859d030382de0c }, { 0x24f129763307837e, 0x6c8f63fcfce0bb76 }, { 0xe07c791288a9cf93, 0xe3efcbe5e504ce12 },
+ { 0xde50d1bfcff336ce, 0xa19e235f5f15a2bf }, { 0xa5d28a72d468379f, 0x2c4da9fdfd9ef172 }, { 0x51042113c1c2e23a, 0xf33e187474fa3d13 }, { 0x56dee94754edd2d1, 0xfa0f81616153b647 },
+ { 0x4c03689c20b0a8f2, 0xd4f10a2727a2619c }, { 0x1f1654b7c22d9dcf, 0x21d9745d5de936b7 }, { 0x77e4155dd19ab643, 0x99a71d8686abec5d }, { 0xdc41cc87ecace1c9, 0xa788455151a4c887 },
+ { 0x71d73215b47b0c4a, 0x939db79494bb5215 }, { 0x7e498ea1adebe6bd, 0x82f475b9b993b2a1 }, { 0x2cb55d96bfb85962, 0x74d738c4c461d096 }, { 0xf2e58c29704b6fac, 0xd5491b9b9b747229 },
+ { 0x418cc9101a7f9502, 0xc38eae04043beb10 }, { 0xd5ec577b90ddb137, 0xbcdb2d6e6e9c967b }, { 0x6cd07b9a55094682, 0xb452a5c7c7e30e9a }, { 0x1b346ec78493f0c1, 0x2df5b8414148e2c7 },
+ { 0x594055f34d7d3826, 0xeb66434c4c7b56f3 }, { 0xbd1e1691836a9abb, 0x04a544b5b5de4c91 }, { 0xc564bf784b60c60f, 0x8c6b9b1e1e5d4078 }, { 0x15433d6f6dcd90d4, 0x3f97496b6bd9376f },
+ { 0xfd7b309d69db855b, 0xc420d9b6b65c929d }, { 0xedf3d89eb266f263, 0xf4906fc6c69d449e }, { 0x2f4dafb26c290487, 0x71ca6dcdcd698fb2 }, { 0x3fc547b1b79473bf, 0x417adbbdbda859b1 },
+ { 0x62a72832bc572697, 0xa63054eded72db32 }, { 0x3479c175e8baf446, 0x5c3fd58c8c216d75 }, { 0x31b214195eca13aa, 0x53182a9797398c19 }, { 0x324ae63d8d5b4e4f, 0x56057f9e9e31d33d },
+ { 0x192573ffa7cc27c6, 0x2be3de4f4ff988ff }, { 0xf30c63358085e54e, 0xd642289c9ccd4735 }, { 0x2d5cb28a4f76d380, 0x77dc0bc3c3d8e58a }, { 0xe5b7ac7e3ed9287f, 0xecc834fefe1c2f7e },
+ { 0xb4b38d6dff1bca45, 0x1ff62c8a8ae6126d }, { 0x07dac854952f30eb, 0x0931991515a98b54 }, { 0xaa4c36c6cdf8dd68, 0x3d246bd0d0b611c6 }, { 0x4dea8780d07e2210, 0xd7fa3920201b5480 },
+ { 0x9a17cdc363fc4420, 0x6d3772404036a8c3 }, { 0x7fa061bd5d256c5f, 0x81ff46bebe2a87bd }, { 0xf11d7e0da3da3249, 0xd0544e92927c2d0d }, { 0x175220574e9247d3, 0x39812f6565685d57 },
+ { 0x9bfe22df9332cec2, 0x6e3c4147478f9ddf }, { 0x799346f538c4d656, 0x8bc5ecacac3a39f5 }, { 0x03f8f224d3915de5, 0x051d550909085f24 }, { 0xbf0f0ba9a0354dbc, 0x02b322bbbb6f26a9 },
+ { 0x22c20e3e56e63977, 0x66b5c9eeeef0053e }, { 0x0e7753a8e95e6015, 0x1262f12a2a91d5a8 }, { 0xd7fd4a43b3826630, 0xbacd4b60602dfc43 }, { 0xfaa1f8c9fcf4b5b0, 0xcd1140a3a3f519c9 },
+ { 0x5ab8a7d79eec65c3, 0xee7b1645457309d7 }, { 0x741ce779020beba6, 0x9cba488f8fa3b379 }, { 0xebc0ffd6d787486a, 0xfeaac5d4d48dfad6 }, { 0x691baef6e379a16e, 0xbb755adcdcfbeff6 },
+ { 0x44471c7cac0f72ee, 0xcca9511f1f230a7c }, { 0x232be122a628b395, 0x65befae9e9493022 }, { 0xfe83c2b9ba4ad8be, 0xc13d8cbfbf54cdb9 }, { 0x1088e803dbbd7738, 0x30b0b67070c1d603 },
+ { 0x084474e08cbfda1c, 0x18585b3838816be0 }, { 0x50edce0f310c68d8, 0xf0352b737343080f }, { 0x482152ec660ec5fc, 0xd8ddc63b3b03b5ec }, { 0x2a867adeda59e36b, 0x7eed92d6d6716ede },
+ { 0x64940f7ad9b69c9e, 0xac0afeffff62657a }, { 0x8d45ed942d6e03f3, 0x54b65d25255ef594 }, { 0x8ebd1fb0feff5e16, 0x51ab082c2c56aab0 }, { 0xced839bc144e41f6, 0x912e952f2fd474bc },
+ { 0x8b76cadc488fb9fa, 0x5e8cf737374e4bdc }, { 0xc902f1e88161711d, 0x981f0c3a3a7dffe8 }, { 0x439dd42839204205, 0xc598c80a0a8a8128 }, { 0x86f96b507240840a, 0x49f3531414d7c150 },
+ { 0x26e0344e10585479, 0x6a9905f2f251d14e }, { 0xd3df7033f53c0b3e, 0xb6e1877c7c8c2833 }, { 0x60b6350a9f08f190, 0xa02632e3e3c3b10a }, { 0xa7c3974af737e098, 0x2a5bcff3f32f9b4a },
+ { 0x5e9a9da7d85208cd, 0xe257da5959d2dda7 }, { 0x9dcd0597f6d374cb, 0x6406eb55559f2397 }, { 0x45aef3605cc1f80c, 0xcfa26218189a3f60 }, { 0x14aad2739d031a36, 0x3c9c7a6c6c600273 },
+ { 0xa0195f1e6218d073, 0x236a56e6e686101e }, { 0x0000000000000000, 0x0000000000000000 }, { 0xe45e4362ce17a29d, 0xefc307f9f9a51a62 }, { 0x465601448f50a5e9, 0xcabf371111926044 },
+ { 0x213afc1a85776492, 0x63a89ce7e7f85a1a }, { 0x4ffb9ab8f321f517, 0xd1ec5f2e2eaa3eb8 }, { 0x02111d38235fd707, 0x0616660e0eb16a38 }, { 0xec1a378242a87881, 0xf79b5cc1c1247182 },
+ { 0xc48d5064bbae4ced, 0x8f60a81919e47564 }, { 0x5c8b809ffb0ddfca, 0xe441bc575763b79f }, { 0xa208422641470774, 0x257c30e8e8377a26 }, { 0x760dfa4121543ca1, 0x9aac2e818112d941 },
+ { 0x3e2ca8ad475af95d, 0x4271e8baba116cad }, { 0xf72e5945c63b8840, 0xda6ee480806c9345 }, { 0xe7a6b1461d86ff78, 0xeade52f0f0ad4546 }, { 0xad96fe9258d7ed83, 0x3415f2c5c51f9a92 },
+ { 0x13701a27082c2add, 0x35ade37979c98927 }, { 0x676cfd5e0a27c17b, 0xa917abf6f66a3a5e }, { 0xb6a29055dc441d42, 0x19e04a8484577855 }, { 0xd2369f2f05f281dc, 0xb5eab47b7b351d2f },
+ { 0x0d8fa18c3acf3df0, 0x177fa42323998a8c }, { 0xdfb93ea33f3dbc2c, 0xa295105858ac97a3 }, { 0xff6a2da54a84525c, 0xc236bfb8b8edf8a5 }, { 0xf53f447de5645f47, 0xdc78828e8eddf97d },
+ { 0x35902e6918747ea4, 0x5f34e68b8b985869 }, { 0xfb4817d50c3a3f52, 0xce1a73a4a44c2cd5 }, { 0x3c3db59564052e5a, 0x44678eb4b4a00695 }, { 0x1299f53bf8e2a03f, 0x36a6d07e7e70bc3b },
+ { 0x91ab4b073cd2c3d9, 0x70727c7171bf9c07 }, { 0x47bfee587f9e2f0b, 0xc9b40416162b5558 }, { 0x9e35f7b32542292e, 0x611bbe5c5c977cb3 }, { 0xc775a240683f1108, 0x8a7dfd1010ec2a40 },
+ { 0x6d399486a5c7cc60, 0xb75996c0c05a3b86 }, { 0x8f54f0ac0e31d4f4, 0x52a03b2b2bef9fac }, { 0xb091b71db9a5a74b, 0x13dae0969647c61d }, { 0xd863f6f7aa128cc7, 0xaba4894d4d051cf7 },
+ { 0xc35798302e817c06, 0x8651310c0c4dfe30 }, { 0x52fcd3371253bfdf, 0xf6234d7d7df26237 }, { 0x94609e6b8aa22435, 0x7f55836a6aa77d6b }, { 0x8967d7e46bd06efd, 0x589a913939ff21e4 },
+ { 0x8cac0288dda08911, 0x57bd6e2222e7c088 }, { 0xbb2d31d9e68b20b2, 0x0e9feea7a7cef2d9 }, { 0x99ef3fe7b06d19c5, 0x682a2749493ef7e7 }, { 0x3dd45a8994cba4b8, 0x476cbdb3b3193389 },
+ { 0xb93c2ce1c5d4f7b5, 0x088988a9a97f98e1 }, { 0x9042a41bcc1c493b, 0x73794f767606a91b }, { 0x5d626f830bc35528, 0xe74a8f5050da8283 }, { 0xb74b7f492c8a97a0, 0x1aeb798383ee4d49 },
+ { 0x8710844c828e0ee8, 0x4af86013136ef44c }, { 0x93ba563f1f8d14de, 0x76641a7f7f0ef63f }, { 0x888e38f89b1ee41f, 0x5b91a23e3e4614f8 }, { 0xa85d2bfeeea70a6f, 0x3b320ddede077bfe },
+ { 0xbcf7f98d73a41059, 0x07ae77b2b267798d }, { 0x96718353a9fdf332, 0x7943e56464161753 }, { 0xaf87e3aa7b883a84, 0x320394cbcbaef0aa }, { 0x0c664e90ca01b712, 0x147497242420bf90 },
+ { 0xea2910ca2749c288, 0xfda1f6d3d334cfca }, { 0x0a5569d8afe00d1b, 0x1e4e3d36363001d8 }, { 0x7db17c857e7abb58, 0x87e920b0b09bed85 }, { 0xf4d6ab6115aad5a5, 0xdf73b1898964cc61 },
+ { 0x82db512034fee904, 0x45df9f0808761520 }, { 0xb55a62710fd540a7, 0x1cfd1f8d8d5f2771 }, { 0xd405b86760133bd5, 0xbfd01e696925a367 }, { 0x4e1275a403ef7ff5, 0xd2e76c2929130ba4 },
+ { 0x73c62f2d9724db4d, 0x958bd19a9a0a382d }, { 0x53153c2be29d353d, 0xf5287e7a7a4b572b }, { 0x703edd0944b586a8, 0x9096849393026709 }, { 0x5737065ba4235833, 0xf904b26666ea835b },
+ { 0x5b5148cb6e22ef21, 0xed70254242ca3ccb }, { 0xdda8239b1c626b2b, 0xa4837656561dfd9b }, { 0xb280aa259afa704c, 0x15cc869898f6ac25 }, { 0xcb13ecd0a23ea61a, 0x9e096a3434cc95d0 },
+ { 0x6f2889be86981b67, 0xb14ff0ceceeb51be }, { 0x381f8fe522bb4354, 0x484b42a8a801d2e5 }, { 0x05cbd56cb670e7ec, 0x0f27ff1b1b18e16c }, { 0x2709db52e096de9b, 0x699236f5f5e8e452 },
+ { 0xf6c7b65936f502a2, 0xd965d78787d5a659 }, { 0xefe2c5a691392564, 0xf28609c8c82c2ea6 }, { 0x85019974a1d1d9ef, 0x4cee061d1ddf9e74 }, { 0x6ae35cd230e8fc8b, 0xbe680fd5d5f3b0d2 },
+ { 0x289767e6f906346c, 0x78fbf4d8d8c004e6 }, { 0xc8eb1ef471affbff, 0x9b143f3d3dc4caf4 }, { 0x0f9ebcb41990eaf7, 0x1169c22d2d28e0b4 }, { 0x8a9f25c0b8413318, 0x5d87c43030f77ec0 },
+ { 0x7a6bb4d1eb558bb3, 0x8ed8b9a5a53266d1 }, { 0x657de0662978167c, 0xaf01cdf8f8db5066 }, { 0x9fdc18afd58ca3cc, 0x62108d5b5b2e49af }, { 0x2b6f95c22a976989, 0x7de6a1d1d1c85bc2 },
+ { 0xb36945396a34faae, 0x16c7b59f9f4f9939 }, { 0x16bbcf4bbe5ccd31, 0x3a8a1c6262d1684b }, { 0x55261b63877c8f34, 0xff12d468685be963 }, { 0xae6e0cb68b46b066, 0x3108a7cccc17c5b6 }
+ }, {
+ { 0xd94ca1d0b19e9555, 0x521af24c1cf92f5a }, { 0x6c815d85cf87edfa, 0x1c58e1811e8b4855 }, { 0x72ccac48560abe0c, 0x1a09f1cc58455c67 }, { 0x0a3beefa777b3152, 0x028eb13b83fb0caf },
+ { 0xc701501d2813c6a3, 0x544be2015a373b68 }, { 0x534f51f7c9ab1c73, 0xaec7174ff2a062e2 }, { 0x75e9ed0797709ce1, 0xcfd96de9b881e7f2 }, { 0x6346c40262202581, 0x1f91e9463dec424c },
+ { 0xb0318b28a4c58186, 0x4f05aa31a2ee61b9 }, { 0x1722321c19033502, 0xbae27722a5411a4e }, { 0x6463854da35a076c, 0xca417563dd28f9d9 }, { 0x1bb186b04351aadf, 0x0716a9b1e6521284 },
+ { 0xc0241152e969e44e, 0x819b7e24baf380fd }, { 0xc3703c791e9cb3e8, 0x3fa6a870da87822e }, { 0xd68b38571c395d2e, 0x51d3fa8b3f9e2543 }, { 0x936b40a520c2f83d, 0x2f5c696b4853e21f },
+ { 0x05fc777ddadcf929, 0x0147b9fca09c06b6 }, { 0x36a1cfa386a2977d, 0x0e2c91a10fa424cb }, { 0x6012e92995d57227, 0xa1ac3f125d98409f }, { 0xcfe388d544ce2c35, 0x825276e399948ae4 },
+ { 0x5e51fe427faa0fcc, 0x79993a51919fd5d8 }, { 0xad2857cecabd85d6, 0xf7696c2884547758 }, { 0x5a20922649257a87, 0x12747020112f6c9e }, { 0x9a048374a04c9ec9, 0x93ef0e04abdcec63 },
+ { 0xb714ca6765bfa36b, 0x9ad53614422ada2c }, { 0x1c94c7ff822b8832, 0xd2c635940696a911 }, { 0xb440e74c924af4cd, 0x24e8e040225ed8ff }, { 0x4e568d11a7d31823, 0x16abd156d41a7403 },
+ { 0x08e2d8c86cddea96, 0xd61994e2c3a3b18c }, { 0xaca54cd726ee09b4, 0x9dc39fa5a478c8a8 }, { 0x26a6bcf05edb8092, 0x611e7aa64a218510 }, { 0x15fb042e02a5eec6, 0x6e7552fbe519a76d },
+ { 0xdb9597e2aa384e91, 0x868dd7955ca19279 }, { 0xb1bc903148960de4, 0x25af59bc82c2de49 }, { 0x836c33f6f8bbefd2, 0x406e826c0dd643c4 }, { 0x247f8ac2457d5b56, 0xb5895f7f0a793833 },
+ { 0xd5df157cebcc0a88, 0xefee2cdf5fea2790 }, { 0x9950ae5f57b9c96f, 0x2dd2d850cba8eeb0 }, { 0xb8d353e0c8186b10, 0x991c3ed3614dd035 }, { 0xab800d98e7942b59, 0x4813038044bc733d },
+ { 0xeb9c021701b37763, 0x37db299c93edb2d7 }, { 0x6737a86654af50ca, 0x747ca337bd5cfb0a }, { 0x18e5ab9bb4a4fd79, 0xb92b7fe586261057 }, { 0x95c31af30deb56b2, 0x902606c388bbe67a },
+ { 0xefed6e73373c0228, 0x5c3663ed135d0b91 }, { 0xd4520e65079f86ea, 0x8544df527fc69860 }, { 0xed3458412c9ad9ec, 0x88a146345305b6b2 }, { 0xf8cf5c6f2e3f372a, 0xe6d414cfb61c11df },
+ { 0x02d936321ba6dbc4, 0xd49725d94058bd23 }, { 0xe94534251a15aca7, 0xe34c0c45d3b50ff4 }, { 0x6ba41cca0efdcf17, 0xc9887da4fe4ff3c0 }, { 0x92e65bbccc91745f, 0x45f69ae6687f5def },
+ { 0x018d1b19ec538c62, 0x6aaaf38d202cbff0 }, { 0x85c469a0d592415d, 0xff14edc4cd3e47a1 }, { 0x396656242b055f06, 0x0de599662cc32ed2 }, { 0x401c0f8fe6275c3a, 0x7fc82a1cd751c1ea },
+ { 0xbd2f249d12c49239, 0x985b872fc1d1d683 }, { 0xd02362013110f3a1, 0xeea99523ff762126 }, { 0xd3774f2ac6e5a407, 0x509443779f0223f5 }, { 0x8e729c434ebafc6d, 0x9730af726ee9f4fe },
+ { 0x5974bf0dbed02d21, 0xac49a674715b6e4d }, { 0xc94bd28369e782ba, 0x3d28194b597c8e81 }, { 0xa036f87b7cbc9669, 0x20374136e76bc062 }, { 0xd8c1bac95dcd1937, 0x38b001c13cd590aa },
+ { 0x6e586bb7d421363e, 0xc8cfc4585ed3f576 }, { 0x7730db358cd64725, 0x1b4e4830f8d95ad1 }, { 0xc68c4b04c4404ac1, 0x3ee1118c7a1b8498 }, { 0xf45ce8c3746da8f7, 0x5b20ca5cf50f1915 },
+ { 0xba0a65d2d3beb0d4, 0x4d8b1b0a21156d16 }, { 0xae7c7ae53d48d270, 0x4954ba7ce420758b }, { 0x91b276973b6423f9, 0xfbcb4cb2080b5f3c }, { 0x903f6d8ed737af9b, 0x9161bf3f2827e0cc },
+ { 0x0bb6f5e39b28bd30, 0x682442b6a3d7b35f }, { 0x7ba36f99d684d8f8, 0xa6ba96a3bbca521b }, { 0xee60756adb6f8e4a, 0x369c90603371b461 }, { 0x2bb81345e8da932d, 0xb64057b8291e322a },
+ { 0x0d1eafb5b60113bf, 0xd75e2d1e633fb73a }, { 0xa5ca8f06a6606f40, 0x2170f8ca47f7c6d4 }, { 0x13535e782f8c4049, 0xd10f3d5325f1a308 }, { 0x78f742b221718f5e, 0x188740f7dbbe50c8 },
+ { 0x9cacd9228d653046, 0x2c9561ac6b34e806 }, { 0x5fdce55b93f983ae, 0x1333c9dcb1b36a28 }, { 0xd2fa54332ab62865, 0x3a3eb0fabf2e9c05 }, { 0x9d21c23b6136bc24, 0x463f92214b1857f6 },
+ { 0x6fd570ae3872ba5c, 0xa26537d57eff4a86 }, { 0xb95e48f9244be772, 0xf3b6cd5e41616fc5 }, { 0xe2f3c1c6813d1197, 0x8b684ef37062bcab }, { 0xb5cdfc557e1978af, 0x4e4213cd0272670f },
+ { 0x98ddb546bbea450d, 0x47782bddeb845140 }, { 0x3478f9919d044cb9, 0xdabbb4784ffc99e8 }, { 0x619ff2307986fe45, 0xcb06cc9f7db4ff6f }, { 0x971a2cc1164d8d76, 0x44b1231ac8e35b59 },
+ { 0x58f9a4145283a143, 0xc6e355f95177d1bd }, { 0xf708c5e88398ff51, 0xe51d1c08957b1bc6 }, { 0x4d02a03a50264f85, 0xa8960702b46e76d0 }, { 0x56b3268a1377e55a, 0xaf80aeb3523c6454 },
+ { 0xdcb0d6ad6b426c7c, 0x535d4bb0bc6529ec }, { 0x944e01eae1b8dad0, 0xfa8cf54ea897598a }, { 0x5c88c870640cd408, 0xad0e1f88d1c768fb }, { 0xc4557d36dfe69105, 0xea7634553a4339bb },
+ { 0xde69e09f70e4b7b8, 0x87ca6e69fc3d94cf }, { 0x8fff875aa2e9700f, 0xfd9a5cff4ec54b0e }, { 0xe5d680894047337a, 0x5eb8d2d690a6073e }, { 0xa8d420b310617cff, 0xf62ed5d424c871ee },
+ { 0xdfe4fb869cb73bda, 0xed609de4dc112b3f }, { 0x35f5e2887157c0db, 0xb01147f56fd02618 }, { 0x300995f5ab8b39f2, 0xb156fe09cf4c20ae }, { 0x871d5f92ce349a99, 0x2b83c81d8d66fa82 },
+ { 0x8cabaa71551c27a9, 0x43a78aab2eb149dd }, { 0x335db8de5c7e6e54, 0x0f6b285daf38227d }, { 0xf5d1f3da983e2495, 0x318a39d1d523a6e5 }, { 0x4a27e175915c6d68, 0x7d469b2754aacd45 },
+ { 0xca1fffa89e12d51c, 0x8315cf1f39088c52 }, { 0x5d05d369885f586a, 0xc7a4ec05f1ebd70b }, { 0x65ee9e544f098b0e, 0xa0eb86eefd044629 }, { 0xccb7a5feb33b7b93, 0x3c6fa0b7f9e08837 },
+ { 0x66bab37fb8fcdca8, 0x1ed650ba9d7044fa }, { 0xa362d5508b49c1cf, 0x9e0a9762871fc2b1 }, { 0x3bbf601630a384c2, 0xd972bcbf6c9b93f1 }, { 0x8d26b168b94fabcb, 0x290d79260e9df62d },
+ { 0xecb94358c0c9558e, 0xe20bb5b973290942 }, { 0xf685def16fcb7333, 0x8fb7ef85b557a436 }, { 0x7c862ed617fefa15, 0x736a0a865b0ee98e }, { 0x3fce0c72062cf189, 0xb29ff6ceec2b2ab7 },
+ { 0x7e5f18e40c5821d1, 0xa7fd2f5f1b5654ad }, { 0xf379a98cb5178a1a, 0x8ef0567915cba280 }, { 0x6d0c469c23d46198, 0x76f2120c3ea7f7a5 }, { 0x4973cc5e66a93ace, 0xc37b4d7334decf96 },
+ { 0x1968b08258f7711b, 0xd3818c68a60aafa7 }, { 0x62cbdf1b8e73a9e3, 0x753b1acb1dc0fdbc }, { 0xa9593baafc32f09d, 0x9c84265904e4ce1e }, { 0xfb9b7144d9ca608c, 0x58e9c29bd668130c },
+ { 0x7341b751ba59326e, 0x70a302417869e397 }, { 0x2fc97f21de55e666, 0xddad1dc9a9ae8b6c }, { 0x419114960a74d058, 0x1562d991f77d7e1a }, { 0x7a2e74803ad7549a, 0xcc10652e9be6edeb },
+ { 0x76bdc02c6085cb47, 0x71e4bbbdd8f5e521 }, { 0xe45b9b90ac14bf18, 0x3412215bb08ab8ce }, { 0xa2efce49671a4dad, 0xf4a064efa7337d41 }, { 0xdd3dcdb48711e01e, 0x39f7b83d9c49961c },
+ { 0xe682ada2b7b264dc, 0xe0850482f0d205ed }, { 0x14761f37eef662a4, 0x04dfa176c535189d }, { 0x25f291dba92ed734, 0xdf23acf22a5587c3 }, { 0xbff612af096249fd, 0x4ccca2f681896ba0 },
+ { 0xbe7b09b6e531c59f, 0x2666517ba1a5d450 }, { 0x06a85a562d29ae8f, 0xbf7a6fa8c0e80465 }, { 0x0725414fc17a22ed, 0xd5d09c25e0c4bb95 }, { 0xcd3abee75f68f7f1, 0x56c5533ad9cc37c7 },
+ { 0x5bad893fa576f6e5, 0x78de83ad3103d36e }, { 0x372cd4ba6af11b1f, 0x6486622c2f889b3b }, { 0x9e75ef1096c3eb82, 0xf80244752b6c5525 }, { 0x272ba7e9b2880cf0, 0x0bb4892b6a0d3ae0 },
+ { 0xa69ea22d519538e6, 0x9f4d2e9e2783c407 }, { 0xd1ae7918dd437fc3, 0x840366aedf5a9ed6 }, { 0x10077353d87917ef, 0x6f32eb074585a1db }, { 0x200ee6a673f22e1d, 0xde64150e8ac98175 },
+ { 0x2c9d520a29a0b1c0, 0x6390cb9dc9da89bf }, { 0x1e4df1cd998d53f6, 0x0651104d46ce1432 }, { 0x04716c64368f754b, 0x6bed4a7180b0b946 }, { 0xfa166a5d3599ecee, 0x32433116f644acfc },
+ { 0x29612577f37c48e9, 0x62d7726169468f09 }, { 0x88dac615639352e2, 0x284ac0daae01f09b }, { 0x81b505c4e31d3416, 0x94f9a7b54d8efee7 }, { 0xe02af7f49a9bca53, 0x5fff6b2a303a0188 },
+ { 0x0c93b4ac5a529fdd, 0xbdf4de93431308ca }, { 0x0000000000000000, 0x0000000000000000 }, { 0xea11190eede0fb01, 0x5d71da11b3c10d27 }, { 0x28ec3e6e1f2fc48b, 0x087d81ec496a30f9 },
+ { 0xda188cfb466bc2f3, 0xec2724187c8d2d89 }, { 0xf1a09fbeaeb151de, 0x5a6773a055931fa3 }, { 0xce6e93cca89da057, 0xe8f8856eb9b83514 }, { 0x546a10b808d13e9e, 0x7b178b6a1264d977 },
+ { 0x573e3d93ff246938, 0xc52a5d3e7210dba4 }, { 0xe70fb6bb5be1e8be, 0x8a2ff70fd0feba1d }, { 0xc2fd2760f2cf3f8a, 0x550c5bfdfaab3dde }, { 0x2a35085c04891f4f, 0xdceaa43509328dda },
+ { 0x2d104913c5f33da2, 0x093a3810e9f6364f }, { 0xfcbe300b18b04261, 0x8d395ebe36aca899 }, { 0x434822a411d20b9c, 0xc1f5fc48b725c339 }, { 0x8a03f02778358926, 0xfcdde503ee594db8 },
+ { 0x16af2905f550b960, 0xd04884af856da5be }, { 0xf2f4b29559440678, 0xe45aa5f435e71d70 }, { 0x22d7d0946854f5d9, 0x0af330d7ca913c56 }, { 0x797a59abcd22033c, 0x722db37afb92ef38 },
+ { 0x8690448b226716fb, 0x41293b90ad4a4572 }, { 0xffea1d20ef4515c7, 0x330488ea56d8aa4a }, { 0x42c539bdfd8187fe, 0xab5f0fc597097cc9 }, { 0x32d0a3c7b02de236, 0x65c1dbd08f149d8d },
+ { 0x3a327b0fdcf008a0, 0xb3d84f324cb72c01 }, { 0x1d19dce66e780450, 0xb86cc61926ba16e1 }, { 0xe37edadf6d6e9df5, 0xe1c2bd7e504e035b }, { 0x71988163a1ffe9aa, 0xa434279838315eb4 },
+ { 0x697d2af8155b14d3, 0x1d1f587dbe174ee3 }, { 0x4fdb96084b809441, 0x7c0122dbf436cbf3 }, { 0x2183fdbf9fa1a27f, 0xb4cee683aae53e85 }, { 0xfe670639031699a5, 0x59ae7b6776f415ba },
+ { 0x82e128ef14e863b0, 0x2ac471e12dfafc34 }, { 0xf9424776c26cbb48, 0x8c7ee7429630ae2f }, { 0xb365a6035330d620, 0xf1387c65c29a636a }, { 0x096fc3d1808e66f4, 0xbcb3676fe38f0e7c },
+ { 0xa1bbe36290ef1a0b, 0x4a9db2bbc7477f92 }, { 0xc8c6c99a85b40ed8, 0x5782eac679503171 }, { 0x519667c5d20dc7b7, 0x7a503296b2f8dfc1 }, { 0x68f031e1f90898b1, 0x77b5abf09e3bf113 },
+ { 0x501b7cdc3e5e4bd5, 0x10fac11b92d46031 }, { 0xa447941f4a33e322, 0x4bda0b4767db7924 }, { 0xd706234ef06ad14c, 0x3b7909061fb29ab3 }, { 0x844972b939c1cd3f, 0x95be1e49ed12f851 },
+ { 0x6a2907d3e2ae4375, 0xa3228e29de634c30 }, { 0x0e4a829e41f44419, 0x6963fb4a034bb5e9 }, { 0x80381edd0f4eb874, 0xfe5354386da24117 }, { 0x45e078f23cfba513, 0x7e8f93e077cdc75c },
+ { 0x47394ec0275d7ed7, 0xaa18b63937957a7f }, { 0xa713b934bdc6b484, 0xf5e7dd1307af7bf7 }, { 0x0fc79987ada7c87b, 0x03c908c723670a19 }, { 0xb2e8bd1abf635a42, 0x9b928fe8e2b6dc9a },
+ { 0x52c24aee25f89011, 0xc46de4c2d28cdd12 }, { 0x9ff8f4097a9067e0, 0x92a8b7f80b40ead5 }, { 0x446d63ebd0a82971, 0x1425606d57e178ac }, { 0xe1a7eced76c84631, 0x355598a71016be78 },
+ { 0xc5d8662f33b51d67, 0x80dcc7d81a6f864b }, { 0x70159a7a4dac65c8, 0xce9ed415181de144 }, { 0x3d173a401d8a2a4d, 0x6608d317ac739794 }, { 0x55e70ba1e482b2fc, 0x11bd78e732486687 },
+ { 0x7fd203fde00badb3, 0xcd57dcd23b7aeb5d }, { 0x8b8eeb3e94660544, 0x9677168ece75f248 }, { 0xe8c82f3cf64620c5, 0x89e6ffc8f399b004 }, { 0x969737d8fa1e0114, 0x2e1bd097e8cfe4a9 },
+ { 0x12de4561c3dfcc2b, 0xbba5cede05dd1cf8 }, { 0xaff161fcd11b5e12, 0x23fe49f1c40cca7b }, { 0xbb877ecb3fed3cb6, 0x2721e8870139d2e6 }, { 0xf02d84a742e2ddbc, 0x30cd802d75bfa053 },
+ { 0x118a684a342a9b8d, 0x0598188a65a91e2b }, { 0x31848eec47d8b590, 0xdbfc0d84ef609f5e }, { 0x7d0b35cffbad7677, 0x19c0f90b7b22567e }, { 0x1fc0ead475dedf94, 0x6cfbe3c066e2abc2 },
+ { 0x4c8fbb23bc75c3e7, 0xc23cf48f9442c920 }, { 0xbca23f84fe971e5b, 0xf2f174a2e1fd6973 }, { 0x38eb4d3dc756d364, 0x674f6aeb0cef9122 }, { 0x4baafa6c7d0fe10a, 0x17ec68aa748672b5 },
+ { 0x9b89986d4c1f12ab, 0xf945fd898bf05393 }, { 0xfd332b12f4e3ce03, 0xe793ad3316801769 }, { 0x8957dd0c8fc0de80, 0x42e033578e2d4f6b }, { 0x7464f61e7b231083, 0xa5739e6498ad5802 },
+ { 0x03542d2bf7f557a6, 0xbe3dd654607402d3 }, { 0xb699d17e89ec2f09, 0xf07fc599620665dc }, { 0x48fed7478afab6ac, 0xa9d1befe14f27066 }, { 0xc1a90a4b053a682c, 0xeb318da99adf3f0d },
+ { 0xcb92e4b17241597e, 0xe9bf3c92192433a2 }, { 0x3c9a2159f1d9a62f, 0x0ca2209a8c5f2864 }, { 0x46b455d9cb0ef2b5, 0xc0b245b417b9c58f }, { 0xaa0d16810bc7a73b, 0x22b9f00d6490cccd },
+ { 0x1a3c9da9af0226bd, 0x6dbc5a3cc67ead74 }, { 0x2e44643832066a04, 0xb707ee448982349c }, { 0x3e43176bea7f7deb, 0xd8350543cc079547 }, { 0x235acb8d840779bb, 0x6059c35aeabd83a6 }
+ }, {
+ { 0xe1133bc96d2d1a79, 0x36b7807580805879 }, { 0x50b11ffec6cb5891, 0x33891a1d1a1ad691 }, { 0xc2337988bcd20999, 0x9c07dc3bdcdce999 }, { 0xcf7e229397b68eb9, 0x657a42a3424215b9 },
+ { 0x73915dbf17344b71, 0x9939465346466771 }, { 0x7463dccb5471c7ea, 0x5efc4a804a4af1ea }, { 0xc6ab620f5279d9d7, 0xeff6561556566cd7 }, { 0x19f02cc5fb269195, 0x85ce790e79792895 },
+ { 0x379d359f01bd0555, 0xd603bbd8bbbb6555 }, { 0x9ee94b3c8b27e2da, 0x3a5e9b549b9b73da }, { 0x1d683742158d41db, 0xf63ff320f3f3addb }, { 0x14bd77ded04216b5, 0x7cb3e796e7e7d4b5 },
+ { 0x77094638f99f9b3f, 0xeac8cc7dcccce23f }, { 0xb41c49e19f17a654, 0x1a62d3acd3d3bb54 }, { 0xa85208f250c0d37d, 0x80f0e366e3e3a67d }, { 0x036a9af3adee5cd5, 0xb43486fd868613d5 },
+ { 0x863f11a8aa5b47bd, 0xd33d21b02121ebbd }, { 0x28b9ee7f63842ca9, 0xf8a50def0d0d6ba9 }, { 0xdae5231c9daeacfe, 0x756466df666671fe }, { 0x3e487503c472523b, 0x5c8faf6eafaf1c3b },
+ { 0xbf85e5df2d6c991d, 0x4877820d8282611d }, { 0x660a5c301d2c6936, 0x8927622f62620336 }, { 0x7808f181a54f7438, 0xcb2c17f21717bd38 }, { 0x0f01b7b95cd0ef07, 0x21e4db8fdbdb5f07 },
+ { 0x33052e18ef16d51b, 0xa5f231f63131e01b }, { 0x10256c593ee9c6fb, 0x0f426db86d6d51fb }, { 0xf01021c1899ee870, 0x55582e272e2eb970 }, { 0x25f4b56448e0ab89, 0x01d8937793939789 },
+ { 0x4dd928bcd346194a, 0xc5b6e93de9e97b4a }, { 0x27b859c63f54c3ae, 0xd941d660d6d634ae }, { 0xb2c8bec406081e3d, 0xb10a1c951c1c9d3d }, { 0x1c4e4113cfd77529, 0x9a9230ca30301d29 },
+ { 0x63b431e629dd8d8a, 0x967b2beb2b2b368a }, { 0x762f306923c5afcd, 0x86650f970f0f52cd }, { 0x991bca48c8626e41, 0xfd9b97879797e541 }, { 0x306fb4eb42f889ce, 0x11c6b70bb7b7f3ce },
+ { 0x6b47072b3648ee16, 0x705afcb7fcfcff16 }, { 0xcc14b8603a58d26c, 0xd14ec45ec4c4066c }, { 0x7a441d23d2fb1c1f, 0x13b552e552521e1f }, { 0x23204241d1ff13e0, 0xaab05c4e5c5cb1e0 },
+ { 0x0e27c1e8868adbf5, 0x4d4918651818eff5 }, { 0xde7d389b73057cb0, 0x0695ecf1ececf4b0 }, { 0xd7a87807b6ca2bde, 0x8c19f847f8f88dde }, { 0x46408482613d2603, 0x97a3b89cb8b8a103 },
+ { 0xc9aad5b60ea936d0, 0xce128d9a8d8d33d0 }, { 0x2af502dd1430448e, 0x203c48f84848c88e }, { 0x4b0ddf994a59a123, 0x6ede260426265d23 }, { 0x57439e8a858ed40a, 0xf44c16ce1616400a },
+ { 0x82a70a2f44f097f3, 0xa0ccab9eabab6ef3 }, { 0x8c80cbc7c27a4c06, 0xed85b3fbb3b38106 }, { 0x54290479286088df, 0x40789033909053df }, { 0x42d89f058f96f64d, 0xe45232b23232244d },
+ { 0x41b205f62278aa98, 0x5066b44fb4b43798 }, { 0xdc31d43904b11497, 0xde0ca9e6a9a95797 }, { 0x61f8dd445e69e5ad, 0x4ee26efc6e6e95ad }, { 0x2d0783a95775c815, 0xe7f9442b44445e15 },
+ { 0xfc7b0c8b78a05ba2, 0xc08873557373f5a2 }, { 0xed7816839c13a9ab, 0xa367dd07dddd14ab }, { 0x2e6d195afa9b94c0, 0x53cdc2d6c2c24dc0 }, { 0x52fdf35cb17f30b6, 0xeb105f0a5f5f75b6 },
+ { 0xbb1dfe58c3c74953, 0x3b8608230808e453 }, { 0x7b626b7208a128ed, 0x7f18910f9191aeed }, { 0xadec6524643137c1, 0x9facaaa2aaaa93c1 }, { 0xa0a13e3f4f55b0e1, 0x66d1343a34346fe1 },
+ { 0xd21615d1823bcf62, 0x9345b183b1b1b862 }, { 0x440c682016894e24, 0x4f3afd8bfdfd0224 }, { 0x32235849354ce1e9, 0xc95ff21cf2f250e9 }, { 0xdd17a268deeb2065, 0xb2a16a0c6a6ae765 },
+ { 0xf8e3170c960b8bec, 0xb379f97bf9f970ec }, { 0xa51f53e97ba4545d, 0x798d7dfe7d7d5a5d }, { 0x81cd90dce91ecb26, 0x14f82d632d2d7d26 }, { 0xc07f952acb6661be, 0x449e992c99994abe },
+ { 0x8ecc2765b5ce2421, 0x351cf6ecf6f62221 }, { 0xce5854c24decba4b, 0x09d781498181a54b }, { 0x8818d0402cd19c48, 0x9e7439d539390448 }, { 0x792e87d07f1540ca, 0xa781d418d4d40dca },
+ { 0xcbe63914791d5ef7, 0x168bc88dc8c890f7 }, { 0x2bd3748cce6a707c, 0x4c918b128b8b787c }, { 0x59645f6203040fff, 0xb9050eab0e0eafff }, { 0x0d4d5b1b2b648720, 0xf97d9e989e9efc20 },
+ { 0x4a2ba9c8900395d1, 0x0273e5eee5e5edd1 }, { 0xfe37e0290f143385, 0x1811364236365685 }, { 0x6fdf1cacd8e33e58, 0x03ab769976767a58 }, { 0x0b99ac3eb27b3f49, 0x521551a15151da49 },
+ { 0x93a41027a04365fa, 0xc32305cc05058ffa }, { 0x3bf618d5f083b687, 0x43d3e6aae6e62987 }, { 0x024ceca277b46827, 0xd89945174545a327 }, { 0xb1a22437abe642e8, 0x053e9a689a9a8ee8 },
+ { 0x8da6bd96182078f4, 0x81287011707031f4 }, { 0xaa1ee4502774bb5a, 0x5869a671a6a6055a }, { 0x9b5726eabfd60666, 0x2502d290d2d24666 }, { 0xc4e78ead25cdb1f0, 0x376f13021313cff0 },
+ { 0xfaaffbaee1bfe3cb, 0x6be0bc6cbcbcd3cb }, { 0x1e02adb1b8631d0e, 0x420b75dd7575be0e }, { 0xe6e1babd2e6896e2, 0xf1728ca68c8ccee2 }, { 0xf25ccd63fe2a8057, 0x8dc16b306b6b1a57 },
+ { 0x672c2a61c7765dc4, 0xe58aa1c5a1a1b3c4 }, { 0x07f2817443458c9b, 0xc7c50cd30c0c969b }, { 0x3d22eff0699c0eee, 0xe8bb299329290fee }, { 0xb084526671bc761a, 0x6993598259593e1a },
+ { 0xe58b204e8386ca37, 0x45460a5b0a0add37 }, { 0x134ff6aa93079a2e, 0xbb76eb45ebeb422e }, { 0x06d4f725991fb869, 0xab68cf39cfcf2669 }, { 0xe0354d98b7772e8b, 0x5a1a439f4343e88b },
+ { 0xa43925b8a1fe60af, 0x1520be14bebeeaaf }, { 0xebace1a6050c11c2, 0x080f123e121232c2 }, { 0x6d93f00eaf57567f, 0xdb32338e3333d97f }, { 0x5e96de1640418364, 0x7ec0027802023964 },
+ { 0xd05af973f58fa745, 0x4bdcf494f4f41b45 }, { 0xae86ffd7c9df6b14, 0x2b982c5f2c2c8014 }, { 0x9ca5a79efc938afd, 0xe2c7de43deded0fd }, { 0xe279a13ac0c346ac, 0x8283068806064bac },
+ { 0xb87764ab6e291586, 0x8fb28ede8e8ef786 }, { 0x7c90ea064be4a476, 0xb8dd9ddc9d9d3876 }, { 0x5cda32b437f5eb43, 0xa659476f47479a43 }, { 0xfd5d7adaa2fa6f50, 0xac25b0bfb0b04550 },
+ { 0x9fcf3d6d517dd628, 0x56f358be5858c328 }, { 0x6ef96afd02b90aaa, 0x6f06b573b5b5caaa }, { 0xe35fd76b1a99725e, 0xee2ec562c5c5fb5e }, { 0x91e8fc85d7f70ddd, 0x1bba40db40402cdd },
+ { 0x0abfda6f68210bbb, 0x3eb8924b92926abb }, { 0x5fb0a8479a1bb796, 0x126dc192c1c18996 }, { 0xcac04f45a3476a05, 0x7a260b670b0b2005 }, { 0x24d2c33592ba9f7b, 0x6d75509d5050277b },
+ { 0x4867456ae7b7fdf6, 0xdaeaa0f9a0a04ef6 }, { 0xd98fb9ef3040f02b, 0xc150e022e0e0622b }, { 0x11031a08e4b3f209, 0x63efae52aeaee109 }, { 0x216caee3a64b7bc7, 0x72291959191912c7 },
+ { 0x961a7df194b28146, 0xdc7f4c084c4cba46 }, { 0x58422933d95e3b0d, 0xd5a8cd41cdcd1f0d }, { 0xa187486e950f8413, 0x0a7cf7d0f7f7df13 }, { 0x94569153e306e961, 0x04e6091f09091961 },
+ { 0x83817c7e9eaaa301, 0xcc6168746868de01 }, { 0xbea3938ef736adef, 0x24da41e74141d1ef }, { 0x6cb5865f750d628d, 0xb79ff064f0f0698d }, { 0x8fea51346f9410d3, 0x59b13506353592d3 },
+ { 0x05be6dd634f1e4bc, 0x1f5c49c4494935bc }, { 0x4766f2d3bb6712f1, 0xfb0e7b767b7b11f1 }, { 0x2f4b6f0b20c1a032, 0x3f60013c0101fd32 }, { 0x269e2f97e50ef75c, 0xb5ec158a1515845c },
+ { 0xc5c1f8fcff978502, 0x5bc2d0e8d0d07f02 }, { 0x5dfc44e5edafdfb1, 0xcaf4848584842ab1 }, { 0x71ddb11d60802356, 0x41a003440303c456 }, { 0x7edc06a43c50cc51, 0x6044d8cbd8d89b51 },
+ { 0x3f6e03521e2866c9, 0x30226c846c6cacc9 }, { 0x452a1e71ccd37ad6, 0x23973e613e3eb2d6 }, { 0x04981b87eeabd04e, 0x73f18a2e8a8a854e }, { 0xbcef7f2c8082c5c8, 0xfc4304f0040472c8 },
+ { 0x39baf4778737dea0, 0x9b4aa3bda3a38aa0 }, { 0x690beb8941fc8631, 0xa8c3b9a0b9b95c31 }, { 0xc88ca3e7d4f30222, 0xa2bf4e704e4e8322 }, { 0xf37abb322470b4a5, 0xe16ca8daa8a8aaa5 },
+ { 0xe8c67b55a8e24d17, 0xbc3b94c394942117 }, { 0xacca1375be6b0333, 0xf301694869692333 }, { 0x9a7150bb658c3294, 0x49af117a1111f694 }, { 0xf7e2a0b5cadb64eb, 0x929d22f422222feb },
+ { 0x7db69c5791be9084, 0xd4705e365e5e8884 }, { 0x928266767a195108, 0xaf8ec626c6c63f08 }, { 0xc78d145e8823ed25, 0x835b95ff9595dc25 }, { 0xd5e494a5c17e43f9, 0x5480bd50bdbd2ef9 },
+ { 0xfb898dff3be5d739, 0x074d7f867f7f6339 }, { 0x17d7ed2d7dac4a60, 0xc887616b6161c760 }, { 0x1bbcc0678c92f9b2, 0x5d573c193c3c8bb2 }, { 0x80ebe68d3344ffd4, 0x7855ee89eeeecdd4 },
+ { 0x8a543ce25b65f46f, 0x46ed7cc27c7ca76f }, { 0x0000000000000000, 0x0000000000000000 }, { 0x4f95c41ea4f2716d, 0x1d2fac2aacacd86d }, { 0xba3b8809199d7da1, 0x572bcbc9cbcb54a1 },
+ { 0x220634100ba52712, 0xc61d9fa49f9f0112 }, { 0x5b28b3c074b067d8, 0x619c4bbc4b4b0cd8 }, { 0x7ffa70f5e60af8a3, 0x0ce91b211b1b2ba3 }, { 0x70fbc74cbada17a4, 0x2d0dc0aec0c074a4 },
+ { 0xb3eec895dc522acf, 0xdda7df7fdfdf2dcf }, { 0x8473fd0addef2f9a, 0x0ba464a76464489a }, { 0xf5ae4c17bd6f0ccc, 0x4a0467e367678ccc }, { 0x389c82265d6dea52, 0xf7e7605760603a52 },
+ { 0x3c0499a1b3c63a1c, 0x8416ea79eaeabf1c }, { 0x90ce8ad40dad392f, 0x7717833183839c2f }, { 0xee128c7031fdf57e, 0x17535bfa5b5b077e }, { 0x9570e702395cdd93, 0x684bcaf5cacaa993 },
+ { 0xdf5b4ecaa95f4842, 0x6a382f1b2f2f4442 }, { 0x983dbc1912385ab3, 0x9136546d545455b3 }, { 0x7545aa9a8e2bf318, 0x3251896a89894118 }, { 0x4cff5eed091c2db8, 0xa91b2ad72a2acbb8 },
+ { 0x1f24dbe0623929fc, 0x2ea6b637b6b60efc }, { 0x53db850d6b250444, 0x87bd9ce09c9cc544 }, { 0xafa0898613855fe6, 0x4735efb5efef30e6 }, { 0xef34fa21eba7c18c, 0x7bfe98109898b78c },
+ { 0xa2edd29d38e1d8c6, 0xbe48712d7171ccc6 }, { 0x519769af1c916c63, 0x5f24d9f7d9d96663 }, { 0x43fee95455ccc2bf, 0x88fff158f1f194bf }, { 0x01267651da5a34f2, 0x6cadc3eac3c3b0f2 },
+ { 0xd68e0e566c901f2c, 0xe0b43bad3b3b3d2c }, { 0x6446b0926a980111, 0x51be27382727a011 }, { 0xb650a543e8a3ce73, 0xc2fb96bb96961873 }, { 0x126980fb495daedc, 0xd7db28af2828f2dc },
+ { 0xd8a9cfbeea1ac4d9, 0xadfd23c82323d2d9 }, { 0x16f19b7ca7f67e92, 0xa42aa281a2a27792 }, { 0xf4883a466735383e, 0x26a9a409a4a43c3e }, { 0x0c6b2d4af13eb3d2, 0x95d05d725d5d4cd2 },
+ { 0xec5e60d246499d59, 0xcfca1eed1e1ea459 }, { 0x3ad06e842ad98275, 0x2f7e254025259975 }, { 0xf6c4d6e410815019, 0xfe30e11ee1e19f19 }, { 0x973c0ba04ee8b5b4, 0xb0d28fe28f8f0ab4 },
+ { 0xb776d31232f9fa81, 0xae5655515555a881 }, { 0x6a61717aec12dae4, 0x1cf73f5d3f3f4fe4 }, { 0xe9e00d0472b879e5, 0xd0965729575791e5 }, { 0x9d83d1cf26c9be0f, 0x8e6a1da91d1d600f },
+ { 0x159b018f0a182247, 0x101e247c24246447 }, { 0x08f336cd1f95639c, 0xe621d75cd7d7c99c }, { 0x5a0ec591aeea532a, 0x0d3188568888bc2a }, { 0xab389201fd2e8fa8, 0x34c4659b6565b5a8 },
+ { 0x299f982eb9de185b, 0x9408ce05cecedb5b }, { 0xa9747ea38a9ae78f, 0xec5d208c2020168f }, { 0x4941333b3dedc904, 0xb64763136363fe04 }, { 0xb53a3fb0454d92a6, 0x76cf104610100ba6 },
+ { 0x35d1d93d76096d72, 0x0e9afecffefec672 }, { 0x893ea611f68ba8ba, 0xf2d9fa3ffafab4ba }, { 0xea8a97f7df562530, 0x64a2d1d4d1d18230 }, { 0xc159e37b113c554c, 0x28335ac65a5afa4c },
+ { 0xf136579053c4dc82, 0x39f5edcdeded0982 }, { 0x409473a7f8229e6a, 0x3ccb77a57777876a }, { 0xa675c91ad64a0888, 0xcdb9fb03fbfb4988 }, { 0x3149c2ba98a2bd3c, 0x7d6b74e17474433c },
+ { 0x09d5409cc5cf576e, 0x8a8c14b61414796e }, { 0xd4c2e2f41b24770b, 0x382d7eba7e7e9e0b }, { 0xcd32ce31e002e69e, 0xbde307b40707b69e }, { 0x85558b5b07b51b68, 0x6709a74da7a7f868 },
+ { 0x18d65a94217ca567, 0xe963bae4baba9867 }, { 0xe4ad561f59dcfec5, 0x29ebc9b1c9c96dc5 }, { 0xb95112fab4732174, 0xe31f4d344d4d4774 }, { 0x1a9ab63656c8cd40, 0x31fafff3ffff3b40 },
+ { 0xdbc3554d47f4980c, 0x19c9a535a5a5c10c }, { 0x2c21f5f88d2ffce7, 0x8b5487c18787eee7 }, { 0x8b724ab3813fc09d, 0x2a40bf28bfbf179d }, { 0xd33063805861fb90, 0xffe8726972720890 },
+ { 0xa753bf4b0c103c7a, 0xa11438e93838f97a }, { 0xbdc9097d5ad8f13a, 0x90eec71ac7c7c23a }, { 0x204ad8b27c114f35, 0x1e84dab3dadaa235 }, { 0xa3cba4cce2bbec34, 0xd2e5b2c7b2b27c34 },
+ { 0x4eb3b24f7ea8459f, 0x71826fc06f6f689f }, { 0xd17c8f222fd593b7, 0x2771377e3737abb7 }, { 0x5665e8db5fd4e0f8, 0x98e1d524d5d5f0f8 }, { 0x871967f97001734f, 0xbf90e25ae2e25b4f },
+ { 0xc3150fd966883d6b, 0xf0aa1fd11f1f596b }, { 0x72b72beecd6e7f83, 0xf59485b98585d783 }, { 0x60deab158433d15f, 0x224fad16adad255f }, { 0x36bb43cedbe731a7, 0xbaae78327878d5a7 },
+ { 0xf9c5615d4c51bf1e, 0xdfd43a913a3ac01e }, { 0xe7c7ccecf432a210, 0x9ddf4f4c4f4f7e10 }, { 0x682d9dd89ba6b2c3, 0xc46e7a4a7a7aecc3 }, { 0x629247b7f387b978, 0xfad6e801e8e88678 },
+ { 0x550f7228f23abc2d, 0x2cd553d95353e32d }, { 0xff119678d54e0777, 0x74bcf5a8f5f5e677 }, { 0x6560c6c3b0c235e3, 0x3d13e4d2e4e410e3 }, { 0x34f7af6cac535980, 0x62373d253d3d7680 }
+ }, {
+ { 0xfb5673f66e45af0a, 0xb5642c66c8d51c47 }, { 0x08d95b24e56852ca, 0x0a2f6bac5ee01eeb }, { 0xcbc56a2e75f680f3, 0x89869508cfd05878 }, { 0x41b5ae0670cb4e17, 0xc067ebddce108371 },
+ { 0x384a42fcfedb7d33, 0x36cdd2c259e55ad4 }, { 0xb388b531afeb285f, 0xeff099e32339f2f8 }, { 0x1f307492839bb1a3, 0x682036be40b7b805 }, { 0x88d7a221ad273b37, 0xaa9a14fef7f83d43 },
+ { 0x32347fd1b3a9da2a, 0xdf99d345f13da275 }, { 0x7cc0130d492981c9, 0x6380d8bdc399a514 }, { 0x5c22bc9d5b4a0a67, 0x4b3cb748789fdd3e }, { 0x02a76609a81af5d3, 0xe37b6a2bf638e64a },
+ { 0xecbf5c4008b64c63, 0xd76b7174d682baa9 }, { 0x12d6d041a1ca5184, 0xf725bcb04a3bda5f }, { 0x7b588af3260ac6f7, 0x15d1533461cd3fef }, { 0x5f37e971a75d643c, 0x389be897f5bb4851 },
+ { 0xc1bb5703388427ea, 0x60d2948f6708a0d9 }, { 0x048dcc1293342965, 0x05f6d4562f700f94 }, { 0x76be2e20045b26d0, 0x8ad4d93a6b415db5 }, { 0x6cb1a54540f9259e, 0x77de0e267f9a9901 },
+ { 0x26c8058b294d5718, 0xce31d188624e91f4 }, { 0x0f41c2da8a4b15f4, 0x7c7ee025fcb48410 }, { 0x0c549736765c7baf, 0x0fd9bffa7190117f }, { 0xe0ebcb767eea37cc, 0xd8b2ce8ea712abd6 },
+ { 0xe6c1616d45c4eb7a, 0x3e3f70f37e5a4208 }, { 0xd65278b55e77c483, 0x02ddc99d795f0637 }, { 0x18a8ed6cecb8f69d, 0x1e71bd37e2e322fe }, { 0x8efd083a9609e781, 0x4c17aa832eb0d49d },
+ { 0x54fbe7b9be2258ad, 0x4113dce4267fc3d5 }, { 0xe4660764edde1ea9, 0xdd441ad88862a442 }, { 0xacb8c1a32c7099fc, 0x87d0af5d638e4afd }, { 0x698e5ab287c09773, 0xe2f4ef842bf6e5b0 },
+ { 0xee183a49a0acb9b0, 0x34101b5f20ba5ce3 }, { 0xd913ba6fd43cd177, 0x7ea329b885eb8227 }, { 0xf702e4c01819d4a5, 0xbabd939cb9450d38 }, { 0xb9f6881ce2998f46, 0x06a498648be10a59 },
+ { 0x853106f28f76db10, 0x359f9ef0fd745f19 }, { 0x1e824777d7962a2b, 0xf8fc034a3babcb20 }, { 0x66cf98680d8b8287, 0x9e8a0fa1d74261a0 }, { 0x309319d81bb32ff9, 0x3ce2b96e0705443f },
+ { 0xd5472d59a260aad8, 0x717a9642f47b9358 }, { 0xa24b309cf2361780, 0x6b727a8ce426bdc8 }, { 0xfcceea080166e834, 0xc335a7ef6a8186bc }, { 0x60e5327336a55e31, 0x7807b1dc0e0a887e },
+ { 0xffdbbfe4fd71866f, 0xb092f830e7a513d3 }, { 0x6e16c34ce8e3d04d, 0x94a5640d89a27f4b }, { 0xea95f65b339890d5, 0x31e6cf090fca5377 }, { 0x831bace9b45807a6, 0xd312208d243cb6c7 },
+ { 0x154e49bfcee916ba, 0x81743739e86f40a4 }, { 0xc00964e66c89bc62, 0xf00ea17b1c14d3fc }, { 0xdc2c45981305639a, 0xeb89c81ad187fe96 }, { 0xb4102ccfc0c86f61, 0x99a1126a816d6803 },
+ { 0xeb27c5be67950b5d, 0xa13afafd74d62052 }, { 0xc8d03fc289e1eea8, 0xfa21cad742f4cd17 }, { 0x84833517db7b4098, 0xa543ab0486682c3c }, { 0xe5d43481b9d38521, 0x4d982f2cf37ed767 },
+ { 0xa774cf6b350fa56d, 0xfe589b2eb04ac179 }, { 0x448a51f1b7f2fcfa, 0x554d0a7f9a7cffc0 }, { 0xbae3ddf01e8ee11d, 0x7503c7bb06c59f36 }, { 0x6242547a9ebfabe2, 0x9b7cdbf7f8326e34 },
+ { 0xf23d1b37df206648, 0x2f97723eed297189 }, { 0x53637e47d1011f93, 0x3742576d842b592e }, { 0x9a0172600ced6ab3, 0x5dbfa84ebdc3e71c }, { 0x1071b64809d0a457, 0x145ed69bbc033c15 },
+ { 0x1d97129b2b814470, 0x8b5b5c95b68f5e4f }, { 0x0a7e3d2d4d72a719, 0xe9540187a8d8f8a1 }, { 0xd36d8742994e766e, 0x97f7283f2d337a86 }, { 0xfd7cd9ed556b73bc, 0x53e9921b119df599 },
+ { 0x7381d1d7c362943d, 0x1ffe38983f2d2104 }, { 0xf1284edb23370813, 0x5c302de1600de4e6 }, { 0x4a79a0ce69b47286, 0xb9efdfae1dd408f5 }, { 0xa15e65700e2179db, 0x18d52553690228a7 },
+ { 0xaa926bb8175e454a, 0x615d1120bac6a323 }, { 0x74194829ac41d303, 0x69afb3119d79bbff }, { 0x14fc7a5a9ae48d32, 0x11a802cd93733381 }, { 0x39f87119aad6e6bb, 0xa611e73622f929f1 },
+ { 0x9540b0ba86a67f47, 0x21c1486b4177630c }, { 0x5bba256334694d59, 0x3d6d3cc1dacb47c5 }, { 0x565c81b01638ad7e, 0xa268b6cfd047259f }, { 0x8a70c428053dcee4, 0x49e17ed501c0db09 },
+ { 0xdf391074ef120dc1, 0x982e97c55ca36bf9 }, { 0xcdefc0354ed85c45, 0x6f0b2b751698b1a6 }, { 0x51c4184e791bea40, 0xd4393d467213bf64 }, { 0x341ed5ca8887069c, 0x39146d3828754bab },
+ { 0xf6b0d7254c144f2d, 0x2a61a668c2597e1d }, { 0x8de85dd66a1e89da, 0x3fb0f55ca39441f2 }, { 0x6a9b0f5e7bd7f928, 0x9153b05ba6d270df }, { 0xf38f28d28b2dfdc0, 0xbf4b47ca963502ac },
+ { 0xf5a582c9b0032176, 0x59c6f9b74f7deb72 }, { 0x11c385ad5ddd3fdf, 0x8482e36fc71f4f30 }, { 0x9d99eb9e63ce2d8d, 0x2bee23c71f977de7 }, { 0x75ab7bccf84c488b, 0xf97386e5e665c8da },
+ { 0x191ade89b8b56d15, 0x8ead88c399ff51db }, { 0x031555ecfc176e5b, 0x73a75fdf8d24956f }, { 0x7094843b3f75fa66, 0x6c596747b209b46b }, { 0x7233e232976f0fb5, 0x8f220d6c44315221 },
+ { 0x3aed24f556c188e0, 0xd5b6b8e9afddbc9e }, { 0x8bc2f7cd5130556c, 0xd93d4b217adca82c }, { 0x33864c34e7a441a2, 0x4f45e6b18a21d150 }, { 0xc623cefd57a760d4, 0x16831f06c55c3a22 },
+ { 0x2fa36d4a98289e5a, 0x54c28fd047b2fc3a }, { 0x896591c4f92aa0bf, 0x3a46210a8ce44e66 }, { 0xbe6e11e28dbac878, 0x70f513ed29b590a2 }, { 0xcefa95d9b2cf321e, 0x1cac74aa9bbc24c9 },
+ { 0xc484a8f4ffbd9507, 0xf5f8752d3364dc68 }, { 0xfae440133a483482, 0x25b81992b3c96f62 }, { 0x3b5f171002cc1368, 0x456a8d1dd4c1cfbb }, { 0xdd9e767d4708f812, 0x7b55fdeeaa9b8db3 },
+ { 0x770c1dc55056bd58, 0x1a08ecce105d2e90 }, { 0xc5369b11abb00e8f, 0x652440d94878af4d }, { 0x165b1c5332fe78e1, 0xf2d368e6654bd5cb }, { 0xa4619a87c918cb36, 0x8dffc4f13d6e5416 },
+ { 0xad0af246787d0274, 0x170c9aa9189239d8 }, { 0xd8a1898a80314aff, 0xee7f1c4cfef7f102 }, { 0xb70579233cdf013a, 0xea064db50c49fd6c }, { 0x92d82944e9853879, 0x5790c3e2e323f9f7 },
+ { 0x496cf52295a31cdd, 0xca48807190f09d9a }, { 0x6468fe61a5917754, 0x7df1658a217a87ea }, { 0x91cd7ca815925622, 0x24379c3d6e076c98 }, { 0x9c2bd87b37c3b605, 0xbb321633648b0ec2 },
+ { 0x01b233e5540d9b88, 0x90dc35f47b1c7325 }, { 0xe83290529b826506, 0xd29da522f9f2b53d }, { 0xa0ec56955a2ce253, 0x880910a7121e5b82 }, { 0xbb51ee154a837a95, 0xe5dff24f7dd9ec13 },
+ { 0xb5a21f2a94c5f4e9, 0x097d279efa711b26 }, { 0x2989c751a30642ec, 0xb24f31ad9efa15e4 }, { 0xe3fe9e9a82fd5997, 0xab1591512a363eb9 }, { 0x5a0816866064d6d1, 0xadb10935a1d734e0 },
+ { 0x17e92fb666f3e369, 0x620f5d121e57a6ee }, { 0x63f0679fcab2306a, 0x0ba0ee03832e1d11 }, { 0x25dd5067d55a3943, 0xbd968e57ef6a049b }, { 0x7d7220e81d241a41, 0xf35ced49b885d631 },
+ { 0x20e2af9012638bae, 0x28bc6ff5bb06782a }, { 0x1364e3a4f5c7ca0c, 0x67f989443127a97a }, { 0x0ef3f13fde468e7c, 0xeca2d5d187a8f735 }, { 0x9f3e8d97cbd4d85e, 0xc89549ece9af9bad },
+ { 0xe159f8932ae7ac44, 0x486efb7adc0ed8f3 }, { 0x5549d45cea2fc325, 0xd1cfe9105d63b0f0 }, { 0x8f4f3bdfc2047c09, 0xdccb9f7755aca7b8 }, { 0xd1cae14b315483bd, 0x748c4214db0b9ccc },
+ { 0x40079de324c6d59f, 0x50bbde29b50cf054 }, { 0x82a99f0ce0559c2e, 0x43ce15795f20c5e2 }, { 0x52d14da2850c841b, 0xa79e6299ff372a0b }, { 0xb23a86d4fbe6b3d7, 0x7f2cac17582581dd },
+ { 0x591d436a9c73b88a, 0xde1656ea2cf3a18f }, { 0x3fd2db0291f83a0d, 0x409c594bfbb1c02f }, { 0xd4f51ebcf66d3150, 0xe1a6a3b68f67e07d }, { 0x79ffecfa8e103324, 0xf6aa391f97f5d9a5 },
+ { 0xe773528811c970f2, 0xaee345070546312d }, { 0xefaa09acf4a12238, 0xa4cc2eab5ba62fc6 }, { 0xca7759cb21fb1b7b, 0x195aa0fcb4cc2b5d }, { 0x479f041d4be592a1, 0x26ea55a017586aaf },
+ { 0xa5d3a9629d1550be, 0x1d23f10546722733 }, { 0xafad944fd067f7a7, 0xf477f082eeaadf92 }, { 0xa8350db1bf44b099, 0x82267b0b4cfe4569 }, { 0x936a1aa1bd88a3f1, 0xc74cf616983f8ad2 },
+ { 0xed0d6fa55cbbd7eb, 0x47b74480ad9ec98c }, { 0xc31c310a909ed239, 0x83a9fea491304693 }, { 0x2a9c92bd5f112cb7, 0xc1e86e7213de808b }, { 0x9655e5567ab1111c, 0x526617b4cc53f663 },
+ { 0x2cb638a6643ff001, 0x2765d00fca966955 }, { 0x5d908f780f4791ef, 0xdbe082bc0383ae1b }, { 0xe24cad7fd6f0c21f, 0x3bc9a4a5512a4d9c }, { 0x7fd546e1b53eef92, 0x102787624ebd307b },
+ { 0x7e677504e133741a, 0x80fbb29635a1435e }, { 0x0000000000000000, 0x0000000000000000 }, { 0x3e60e8e7c5f5a185, 0xd0406cbf80adb30a }, { 0xc791fd1803aafb5c, 0x865f2af2be404907 },
+ { 0x053ffff7c739b2ed, 0x952ae1a2546c7cb1 }, { 0x3cc78eee6def5456, 0x333b069476955540 }, { 0x879660fb276c2ec3, 0xd6e4f4db0b4cb953 }, { 0x677dab8d5986190f, 0x0e563a55ac5e1285 },
+ { 0x9914278cf0fa04e8, 0x2e18f79130e77273 }, { 0xab20585d4353dec2, 0xf18124d4c1dad006 }, { 0xf9f115ffc65f5ad9, 0x561f464d3eedfa0d }, { 0xd2dfb4a7cd43ede6, 0x072b1dcb562f09a3 },
+ { 0x062aaa1b3b2edcb6, 0xe68dbe7dd948e9de }, { 0xa9873e54eb492b11, 0x12fa4eff37e2364c }, { 0x1bbdb88010af98c6, 0x6dd6e2e86fc7b791 }, { 0x48dec6c7c1ae8755, 0x5a94b585ebeceebf },
+ { 0x97e7d6b32ebc8a94, 0xc2ba2240b74f8546 }, { 0xc2ae02efc49349b1, 0x1375cb50ea2c35b6 }, { 0x8624531e7361b54b, 0x4638c12f7050ca76 }, { 0x6157019662a8c5b9, 0xe8db84287516fb5b },
+ { 0x36b9b3c3209df34f, 0xda6f0713de4dade1 }, { 0x57eeb255423536f6, 0x32b4833bab5b56ba }, { 0xf09a7d3e773a939b, 0xccec18151b1197c3 }, { 0x2e115eafcc2505d2, 0xc41eba243cae8f1f },
+ { 0x7aeab91672075d7f, 0x850d66c01ad14cca }, { 0x3d75bd0b39e2cfde, 0xa3e733600d892665 }, { 0x81bccae01c42f275, 0x30694aa6d204508d }, { 0x35ace62fdc8a9d14, 0xa9c858cc5369388e },
+ { 0xc9620c27ddec7520, 0x6afdff2339e8be32 }, { 0x65dacd84f19cecdc, 0xed2d507e5a66f4cf }, { 0x784ddf1fda1da8ac, 0x66760cebece9aa80 }, { 0xbcc977eb25a03dab, 0x938e79c6df8d76e8 },
+ { 0x1c25217e7f8cdff8, 0x1b876961cd932d6a }, { 0x683c6957d3cd0cfb, 0x7228da7050ea9695 }, { 0xcc5df3d01ad5c7cd, 0xffd71e816d84c283 }, { 0xbfdc2207d9b753f0, 0xe029261952a9e387 },
+ { 0x7126b7de6b7861ee, 0xfc8552b3c915c74e }, { 0xb844bbf9b69414ce, 0x9678ad90f0fd797c }, { 0xa6c6fc8e61023ee5, 0x6e84aedacb56b25c }, { 0x2245c999ba797e7d, 0xcbc705de4d3e9e60 },
+ { 0x4de13930069735b8, 0xcfbe5427bf80920e }, { 0xb09de0dd53fc4604, 0x9c57c63cae1d6797 }, { 0x907f4f4d419fcdaa, 0xb4eba9c9151b1fbd }, { 0x23f7fa7cee74e5f5, 0x5b1b302a3622ed45 },
+ { 0x370b8026749068c7, 0x4ab332e7a551dec4 }, { 0x6b293cbb2fda62a0, 0x018f85afddce03fa }, { 0x096b68c1b165c942, 0x9af35e5825fc6dce }, { 0x246f63828157a2cb, 0x2d4abba3947677be },
+ { 0x31212a3d4fbeb471, 0xac3e8c9a7c19371a }, { 0x4ef46cdcfa805be3, 0xbc190bf832a40761 }, { 0x800ef905484f69fd, 0xa0b57f52a91823a8 }, { 0x277a366e7d40cc90, 0x5eede47c1952e2d1 },
+ { 0x58af708fc87e2302, 0x4eca631e57efd2aa }, { 0x21509c75466e1026, 0xb8605a01c01a0b0f }, { 0xcf48a63ce6c2a996, 0x8c70415ee0a057ec }, { 0x94f2835fd2abe4cf, 0xb11d7d9f3a6b1029 },
+ { 0x2d040b4330326b89, 0xb7b9e5fbb18a1a70 }, { 0xde8b2391bb1f9649, 0x08f2a23127bf18dc }, { 0xae1fa7aa846a6c2f, 0x64abc57695b6acb7 }, { 0x8c5a6e333e131252, 0xaf6cc0a8d88832d7 },
+ { 0x5e85da94f350ffb4, 0xa847dd638ea73b74 }, { 0xa3f90379a63b8c08, 0xfbae4f789f3aceed }, { 0x2b2ea1580b1cb73f, 0x51345b8668c2f3ae }, { 0x9e8cbe729fd943d6, 0x58497c1892b3e888 },
+ { 0xbd7b440e71ada623, 0x03524c32a49105cd }, { 0x1a0f8b6544a2034e, 0xfd0ad71c14dbc4b4 }, { 0x98a61469a4f79f60, 0xbec4c2654bfb0156 }, { 0xd7e04b500a7a5f0b, 0x9201fc6902437512 },
+ { 0x4312c80fd8d1bbc4, 0x231c81f63828653b }, { 0xd078d2ae65591835, 0xe45077e0a017efe9 }, { 0x4bcb932b3db9e90e, 0x2933ea5a66c87bd0 }, { 0x283bf4b4f70bd964, 0x22930459e5e666c1 },
+ { 0x9bb3418558e0f13b, 0xcd639dbac6df9439 }, { 0x4c530ad5529aae30, 0x5f6261d3c49ce12b }, { 0x6fa4f0a9bcee4bc5, 0x047951f9f2be0c6e }, { 0x4f465f39ae8dc06b, 0x2cc53e0c49b87444 },
+ { 0x0bcc0ec8197f3c91, 0x79883473d3c48b84 }, { 0x42a0fbea8cdc204c, 0xb3c0b4024334161e }, { 0xb6b74ac668d29ab2, 0x7ada784177558e49 }, { 0xf417b12ce40ebafe, 0xc91acc4334619857 },
+ { 0xfe698c01a97c1de7, 0x204ecdc49cb960f6 }, { 0x0de6a4d32251e027, 0x9f058a0e0a8c625a }, { 0xb12fd33807f1dd8c, 0x0c8bf3c8d50114b2 }, { 0x079899fe6f23473e, 0x76518b89a2549afb },
+ { 0x462d37f81fe80929, 0xb63660546c44198a }, { 0x45386214e3ff6772, 0xc5913f8be1608ce5 }, { 0xda06ef83282bbf2c, 0x0d04766708cf1748 }, { 0xdbb4dc667c2624a4, 0x9dd8439373d3646d },
+ { 0xe980a3b7cf8ffe8e, 0x424190d682eec618 }, { 0xf843261a9252c151, 0xc6c373b945f18928 }, { 0x50762bab2d1671c8, 0x44e508b2090fcc41 }, { 0x6d0396a014f4be16, 0xe7023bd20486ea24 }
+ }, {
+ { 0x199680c07a0cd5fb, 0xfcb5aec91b938711 }, { 0x7bce1a17b28ce008, 0xee0af2fef8abfc32 }, { 0xc077dcb250a2d0cb, 0xdd89c7884eefcabd }, { 0x69d642635e1a1041, 0x11c01393d33c12c4 },
+ { 0xa22f46659822e538, 0xcf369bbfadd7b19e }, { 0x3ce74a6f116a39b3, 0x6eefc0cb2f299770 }, { 0x084d567d06c2b71f, 0x3168fe0f96fd7835 }, { 0xc77379a4c39bf888, 0x16aa09c5a389e794 },
+ { 0xb733bb07e78d3d32, 0xfbdfb49f6b267241 }, { 0x20f79b37188e997c, 0xc4637e3c1d7223d4 }, { 0x0f49f36b95fb9f5c, 0xfa4b30427b9b551c }, { 0x6ed2e775cd233802, 0xdae3ddde3e5a3fed },
+ { 0x6a15ccaace4282ec, 0x23d7a23875c50316 }, { 0x988dd35b6af83b12, 0xc5f7fae10dcf0489 }, { 0xa52be3730b1bcd7b, 0x041555f240b19cb7 }, { 0x56f286c5df28bb5f, 0x4d3862f35aec9466 },
+ { 0xd56b21d02f0d08c1, 0xe960e8a8881e0962 }, { 0xdc670dea59467004, 0x7705797f7cb47e19 }, { 0x35eb665567214176, 0xf08a511cdb83e00b }, { 0xd6a8af19bf559a6c, 0xdb7759032ee718b0 },
+ { 0x9d0b82c319104e26, 0x93ceeadf2407373c }, { 0xfe126253a119b40f, 0x2e7cd930a5684351 }, { 0xa7a917fdebca900c, 0x990f8b81841f822b }, { 0xcdbcdb57258812e0, 0xbad829b9f1da813d },
+ { 0x7f0931c8b1ed5ae6, 0x173e8d18b334c0c9 }, { 0xa6e86dba9b435fd6, 0x3602e459e6488d65 }, { 0x8d912e391557e318, 0xf11ed5c1cb3ec756 }, { 0x75c6933b57feb08e, 0xbb4cad64e167a660 },
+ { 0x7487e97c27777f54, 0x1441c2bc8330a92e }, { 0x11dbd6bd7cce62e4, 0xcddd50c68d6eff24 }, { 0x34aa1c1217a88eac, 0x5f873ec4b9d4ef45 }, { 0x3da6302861e3f669, 0xc1e2af134d7e983e },
+ { 0x04c72bdf0361baee, 0xf9347fe64b9f3cfb }, { 0x58fa0fe93a5aebd9, 0x187e3d694320ce34 }, { 0xbe3f973d91c645f7, 0x65ba25489f8c053a }, { 0x29fbb70d6ec5e1b9, 0x5a06efebe9d854af },
+ { 0x57b3fc82afa17485, 0xe2350d2b38bb9b28 }, { 0x3f24c4a68132ab1e, 0x5cf8716089d086a2 }, { 0xc3b4527bc0fa4266, 0xef9e7623e816db6f }, { 0xd9e15c722aae0530, 0x213c6941557c4dac },
+ { 0xff531814d1907bd5, 0x8171b6e8c73f4c1f }, { 0xfdd1ec9a314126a2, 0x1c6b689b03915283 }, { 0x9c4af884699981fc, 0x3cc3850746503872 }, { 0x7101b8e4549f0a60, 0x4278d282aaf89a9b },
+ { 0xc5f18d2a234aa5ff, 0x8bb0d7b66727f908 }, { 0xb87a486c7276a26e, 0x019484dd10bd275d }, { 0xd8a026355a27caea, 0x8e310699372b42e2 }, { 0xe506161d3bc43c83, 0x4fd3a98a7a55dadc },
+ { 0x1d51ab1f796d6f15, 0x0581d12f500cbbea }, { 0xe202b30ba8fd14c0, 0x84f067c79733f7f5 }, { 0xb3f490d8e4ec87dc, 0x02ebcb7920b94eba }, { 0xb93b322b02ff6db4, 0xae99eb0572ea2813 },
+ { 0xefc9b4eeddd7d6eb, 0xe3a189f62806bc75 }, { 0x99cca91c1a71f4c8, 0x6afa95396f980bc7 }, { 0x60da6e5928516884, 0x8fa58244279665bf }, { 0x26b24466fb3e7ee5, 0xa04ddfa9924301b3 },
+ { 0x16df73abeff74aa7, 0x06fe9e8b6008d20d }, { 0x82d8dd5280ac7c44, 0x0b55e583b0a5924a }, { 0x7040c2a32416c5ba, 0xed75bd5ac8af95d5 }, { 0x1fd35f9199bc3262, 0x989b0f5c94a2a576 },
+ { 0x5531080c4f7029f2, 0x7f2fd358fc1585b4 }, { 0xf15b913834e22b53, 0xd437e972def3164d }, { 0x5ffeaaffa963c39a, 0xd35df324ae46e31d }, { 0xf65f342ea7db0310, 0x1f14273f33953b64 },
+ { 0x669fb108cbe18f1d, 0xeb8b23d1a8a747d8 }, { 0x151cfd627fafd80a, 0x34e92f20c6f1c3df }, { 0x4de6f28b45f533d3, 0x2c97124985d10deb }, { 0xab236a5fee699dfd, 0x51530a68597dc6e5 },
+ { 0xdee5f964b9972d73, 0xea1fa70cb81a6085 }, { 0x0c8a7da205a30df1, 0xc85c81e9dd6244ce }, { 0x4ba32ddaa645d44a, 0x48b9b3dc0ae02f8c }, { 0xa46a99347b9202a1, 0xab183a2a22e693f9 },
+ { 0x861ff68d83cdc6aa, 0xf2619a65fb3aaeb1 }, { 0x5b398120aa027974, 0x2a698cc2e5d9dfe6 }, { 0x2a3839c4fe9d7314, 0x68115e404f21457d }, { 0x9546d4be1fd2f939, 0xa2a614d0b2fa4f09 },
+ { 0xa1ecc8ac087a7795, 0xfd212a140b2ea04c }, { 0x8a958b2f866ecb5b, 0x3a3d1b8c2658ea7f }, { 0x1a550e09ea544756, 0xcea21f62bd6a96c3 }, { 0xa9a19ed10eb8c08a, 0xcc49d41b9dd3d879 },
+ { 0xea4fe576ae3fa3df, 0xb59899c801ce8fc0 }, { 0x72c2362dc4c798cd, 0x706f63290c018b49 }, { 0x9f89764df9c11351, 0x0ed434ace0a929a0 }, { 0x0586519873e87534, 0x5639103e29c833b5 },
+ { 0x895605e6163659f6, 0x082aaa2780a1fbad }, { 0x2c7de6951d2d948d, 0x0c3fffd5c010671a }, { 0x641d45862b30d26a, 0x7691fda26c095944 }, { 0x62589ad7c88035f3, 0x12bf5c37e3387b23 },
+ { 0xd0ed70485ce57df5, 0xbf59f896a1d63ad7 }, { 0xc136a6f5202b1f11, 0x7284a8502cb8c5f3 }, { 0xda22d2bbbaf6979d, 0x132bd8eaf3855c7e }, { 0x6c5013fb2df26575, 0x47f903adfaf42171 },
+ { 0xbaf8bce292a7ff19, 0x9c8e5aaed41339c1 }, { 0x59bb75ae4ad32403, 0xb77352b12177c17a }, { 0x875e8ccaf3440970, 0x5d6cf5bd996da1ff }, { 0xe98c6bbf3e673172, 0x878f2863a7379e12 },
+ { 0xccfda1105501dd3a, 0x15d54661938d8e73 }, { 0x9ec80c0a8948dc8b, 0xa1d95b7482fe26ee }, { 0x805a29dc607d2133, 0x964f3bf0740b8cd6 }, { 0x50b759943c985cc6, 0x2916c366d5ddb601 },
+ { 0xd1ac0a0f2c6cb22f, 0x1054974ec3813599 }, { 0xf01aeb7f446be489, 0x7b3a86aabca41903 }, { 0xac27cf497d50b5be, 0x9a70c425b41bebcc }, { 0x2b7943838e14bcce, 0xc71c31982d764a33 },
+ { 0x3e65bee1f1bb64c4, 0xf3f51eb8eb8789ec }, { 0x2eff121bfdfcc9fa, 0x912521a604be7986 }, { 0xfb9433cbd2f1c13b, 0x7845c90e8ca070e4 }, { 0x849d0203631c9bdd, 0x6f7b44163f94b02d },
+ { 0x0282f48ee0d15d77, 0x9d1ade73c4ae1e9c }, { 0x090c2c3a764b78c5, 0x9e6591d7f4aa777b }, { 0x44eadeb133be4b16, 0xb2f2839e717b7a90 }, { 0x4f640605a5246ea4, 0xb18dcc3a417f1377 },
+ { 0x03c38ec9905892ad, 0x3217b1aba6f911d2 }, { 0x6f939d32bdaaf7d8, 0x75eeb2065c0d30a3 }, { 0xe0804785482c49b7, 0x19eab9b4539de969 }, { 0x2430b0e81bef2392, 0x3d5701da56ed1f2f },
+ { 0x12185874ec96f049, 0xffcae16d2b97eef6 }, { 0xad66b50e0dd97a64, 0x357dabfdd64ce482 }, { 0x7d8bc546513c0791, 0x8a24536b779ade55 }, { 0xed4b40603d068b9c, 0x7ebb5785eca8a2e9 },
+ { 0x376992db87f01c01, 0x6d908f6f1f2dfe97 }, { 0xb672c1409704f2e8, 0x54d2db4709717d0f }, { 0x93030beffc621ea0, 0xc688b5453dcb6d6e }, { 0x47295078a3e6d9bb, 0x80e53235d7826b42 },
+ { 0x8e52a0f0850f71b5, 0xc309646a6dc7d684 }, { 0x6319e090b809fa29, 0xbdb233ef816f746d }, { 0x9407aef96f5b36e3, 0x0dab7b08d0ad4047 }, { 0xbdfc19f4019ed75a, 0x57ad94e3397514e8 },
+ { 0x73834c6ab44e5717, 0xdf620cf16e568407 }, { 0x28bacd4a1e4c2e63, 0xf50b80338b8f5be1 }, { 0xc4b0f76d53c36a25, 0x24bdb86e0570f646 }, { 0x179e09ec9f7e857d, 0xa9f3f153025fdd43 },
+ { 0x2fbe685c8d750620, 0x3e284e7e66e976c8 }, { 0xafe44180ed082713, 0xa867758e12e2fa1e }, { 0xc97bf08826e9a80e, 0x43ec565fba45bdc6 }, { 0xb4f035ce77d5af9f, 0xc9c80534cddf6393 },
+ { 0xfad5498ca2780ee1, 0xd748a6d6eef77faa }, { 0x43ee7ba7a0876355, 0x79d14dd39c1d57b9 }, { 0x42af01e0d00eac8f, 0xd6dc220bfe4a58f7 }, { 0x233415fe88d60bd1, 0xf674cf97bb8b3206 },
+ { 0x5ebfd0b8d9ea0c40, 0x7c509cfccc11ec53 }, { 0xd26f84c6bc342082, 0x224326e56578244b }, { 0xc63203e3b3123752, 0xb9a7661dc1dee8da }, { 0x0b8ed8b4969a25b2, 0x037f4fa4300469e7 },
+ { 0xe4476c5a4b4df359, 0xe0dec6521802d592 }, { 0x27f33e218bb7b13f, 0x0f40b071f0140efd }, { 0xc83a8acf566067d4, 0xece13987d812b288 }, { 0xcbf90406c638f579, 0xdef6882c7eeba35a },
+ { 0x4860a313361d46e7, 0x7aae0277ac193e5e }, { 0x33aeb9048491a6ef, 0x94a4f08954b2c26c }, { 0xf71e4e69d752ccca, 0xb01948e751c2342a }, { 0xdb63a8fcca7f5847, 0xbc26b73291d25330 },
+ { 0x780d94de22d472a5, 0xdc1d43555e52ede0 }, { 0x6d1169bc5d7baaaf, 0xe8f46c7598a32e3f }, { 0xe8cd11f84eeefea8, 0x288247bbc560915c }, { 0x135922339c1f3f93, 0x50c78eb549c0e1b8 },
+ { 0x5d7c5e7149b29eed, 0x4e472d576ae8fd81 }, { 0xbbb9c6a5e22e30c3, 0x33833576b644368f }, { 0x3aa2953ef2dade2a, 0x0ac1615ea018b517 }, { 0xf857bd0242a95396, 0x4a5278a52a596136 },
+ { 0x88177fa166bf962c, 0xa727c5ffe2f6f4e3 }, { 0x382061b0120b835d, 0x97dbbf2d64b6ab8b }, { 0xa36e3c22e8ab2ae2, 0x603bf467cf80bed0 }, { 0x794cee99525dbd7f, 0x73102c8d3c05e2ae },
+ { 0x4e257c42d5ada17e, 0x1e80a3e223281c39 }, { 0x0000000000000000, 0x0000000000000000 }, { 0x109aacfa0c47ad3e, 0x62d03f1eef39f06a }, { 0x67decb4fbb6840c7, 0x44864c09caf04896 },
+ { 0xeb0e9f31deb66c05, 0x1a95f6106399808e }, { 0x7e484b8fc164953c, 0xb833e2c0d163cf87 }, { 0x39611bf762824c87, 0x38d6d0f506e1a4c5 }, { 0xf4ddc0a0470a5e67, 0x820ef94cf73b25f8 },
+ { 0x0645df51e3b0e799, 0x642ea1958f312267 }, { 0xb1766456043ddaab, 0x9ff1150ae4175026 }, { 0x774467b5b72fedf9, 0x2656731725c9b8fc }, { 0x7a8f6050c2052fd2, 0x41079d269afcf37c },
+ { 0xb2b5ea9f94654806, 0xade6a4a142ee41f4 }, { 0xdfa48323c91ee2a9, 0x4512c8d4da4d6fcb }, { 0xd42a5b975f84c71b, 0x466d8770ea49062c }, { 0x2571caaf6b66ec48, 0x925a6e0234ba1061 },
+ { 0xcf3e2fd9c5594f97, 0x27c2f7ca35749fa1 }, { 0x8cd0547e65de2cc2, 0x5e13ba19a969c818 }, { 0x0e08892ce5725086, 0x55465f9a19cc5a52 }, { 0x46682a3fd36f1661, 0x2fe85dedb5d5640c },
+ { 0x6b54b6edbecb4d36, 0x8cdacde017920c58 }, { 0x2d3c9cd26da45b57, 0xa332900da2476854 }, { 0x3be3ef79825311f0, 0xa5cc0e86c24fba59 }, { 0xe6c598d4ab9cae2e, 0x7dc41821dcaccb0e },
+ { 0x924271a88cebd17a, 0x6985da9d5f9c6220 }, { 0x4921d9544694893d, 0xd5a36dafce4e3110 }, { 0x8bd4f168f6e70481, 0x95307454440fe531 }, { 0x32efc343f4186935, 0x3ba99f5136e5cd22 },
+ { 0xaea53bc79d81e8c9, 0x076a1a5670b5f550 }, { 0x9a0f27d58a296665, 0x58ed2492c9611a15 }, { 0xfc9096dd41c8e978, 0xb366074361c65dcd }, { 0xc2f5283cb0738dbc, 0x409319fb8a41d421 },
+ { 0x51f623d34c11931c, 0x861bacbeb78ab94f }, { 0x0acfa2f3e613ea68, 0xac72207c525366a9 }, { 0x45aba4f6433784cc, 0x1dffec46132c75de }, { 0x9b4e5d92faa0a9bf, 0xf7e04b4aab36155b },
+ { 0xb0371e1174b41571, 0x30fc7ad286405f68 }, { 0x1e9225d6e935fdb8, 0x37966084f6f5aa38 }, { 0x21b6e170680756a6, 0x6b6e11e47f252c9a }, { 0x416c8f2940563e22, 0xe4cb93a058b34925 },
+ { 0xce7f559eb5d0804d, 0x88cf9812572390ef }, { 0x655c3fc15bb91db0, 0xd99c927a0e5e560a }, { 0x4ae2579dd6cc1b90, 0xe7b4dc0468b720c2 }, { 0x76051df2c7a62223, 0x895b1ccf479eb7b2 },
+ { 0x5c3d2436393b5137, 0xe14a428f08bff2cf }, { 0x5374d75dacc0ce6b, 0x1b0172cd7324a7d3 }, { 0x4ca788cc357cfc09, 0x839a7d91e78602a5 }, { 0xf3d965b6d4337624, 0x492d37011a5d08d1 },
+ { 0xee88cea9ad5e1931, 0x4cace62e4a51b33b }, { 0x97c42030ff03a44e, 0x3fbccaa376545195 }, { 0xbcbd63b371171880, 0xf8a0fb3b5b221ba6 }, { 0xaa6210189ee05227, 0xfe5e65b03b2ac9ab },
+ { 0xd32efe81ccbdef58, 0x8d4e493d072f2b05 }, { 0x18d7fa870a851a21, 0x53b8c11179c4885f }, { 0x1c10d15809e4a0cf, 0xaa8cbef7325bb4a4 }, { 0x96855a778f8a6b94, 0x90b1a57b14035edb },
+ { 0xbf7eed7ae14f8a2d, 0xcab74a90fddb0a74 }, { 0xdd2677ad29cfbfde, 0xd80816a71ee37157 }, { 0x5a78fb67da8bb6ae, 0x8564e31a878ed0a8 }, { 0x1b14744e9add888c, 0x61af70badf3d998d },
+ { 0x619b141e58d8a75e, 0x20a8ed9c45c16af1 }, { 0xcab87e41b6b13aa3, 0x71fbe7f41cbcac14 }, { 0x0dcb07e5752ac22b, 0x6751ee31bf354b80 }, { 0x8399a715f025b39e, 0xa4588a5bd2f29d04 },
+ { 0xf59cbae7378391bd, 0x2d039694956c2ab6 }, { 0xe343c94cd874db1a, 0x2bfd081ff564f8bb }, { 0x312c4d8a6440fb98, 0x09be2efa901cdcf0 }, { 0x9181ff611cb343d7, 0x5b926b36f96573f2 },
+ { 0x0704a51693392843, 0xcb23ce4ded662d29 }, { 0x145d87250f2617d0, 0x9be440f8a4a6cc91 }, { 0x7ccabf0121b5c84b, 0x25293cb315cdd11b }, { 0x5470724b3ff9e628, 0xd022bc809e428afa },
+ { 0x689738242e93df9b, 0xbecd7c4bb16b1d8a }, { 0xf916c74532209c4c, 0xe55f177d480e6e78 }, { 0x8f13dab7f586be6f, 0x6c040bb20f90d9ca }, { 0xa0adb2eb78f3b84f, 0x522c45cc6979af02 },
+ { 0x22756fb9f85fc40b, 0x5979a04fd9dc3d48 }, { 0x306d37cd14c93442, 0xa6b34122f24bd3be }, { 0xd7e9d55ecfdc55b6, 0x747a36db4cb017fe }, { 0xe784e293db1561f4, 0xd2c977f9befbc440 },
+ { 0xf2981ff1a4bab9fe, 0xe62058d9780a079f }, { 0x90c085266c3a8c0d, 0xf49f04ee9b327cbc }, { 0x5235ad1adc4901b1, 0xb40c1d151173a89d }, { 0x85dc784413955407, 0xc0762bce5dc3bf63 },
+ { 0xec0a3a274d8f4446, 0xd1b6385d8effada7 }, { 0xb5b14f89075c6045, 0x66c56aecaf886cdd }, { 0x01417a477089cfda, 0xaf0d6fd862570f4e }, { 0x3628e89cf779d3db, 0xc29de0b77d7af1d9 },
+ { 0x811b539b10f4eee9, 0x39425428165c8398 }, { 0x402df56e30dff1f8, 0x4bc6fc783ae4466b }, { 0xa8e0e4967e310f50, 0x6344bbc3ff84d737 }, { 0xe1c13dc238a5866d, 0xb6e7d66c31cae627 }
+ }
+ };
+
+ static const uint64 IT[16][256][2] = {
+ {
+ { 0x59ba4fc2860ecca5, 0xf011538279efe33b }, { 0xb62a6c959496032d, 0xbd918337e7ba9cf5 }, { 0xd211f9a6abb11732, 0xad925890c98ec303 }, { 0xbf6596274482a58f, 0x84685128596eda60 },
+ { 0xa029a9e0ac34d40e, 0x5113c1f94d76899f }, { 0x685f4086d27afc30, 0x7115b474111e37b0 }, { 0xc5a4e106f5d0d638, 0x874c8262f71b6139 }, { 0x63bfc35dce2b76c0, 0x075495134478dc85 },
+ { 0x0f7d710947dbd254, 0xe8f2049740c172b6 }, { 0x9f070a78d95820e6, 0xfeb9baa4f11f98f2 }, { 0x7b77aaf4d791659e, 0xc5784b763a2c0c09 }, { 0x98835c1628544239, 0xe9eef4109b531b81 },
+ { 0x525acc199a5f4655, 0x865072e52c89080e }, { 0xe9a2a8ec8557bb7e, 0x9c8b063d60404bed }, { 0x02af7969cc452c52, 0x4fb8f378ebb2ada0 }, { 0x8679be04a6212591, 0xfac9fcfd1b12ff2e },
+ { 0x6722318f95a12e64, 0x99e7b0e351df4506 }, { 0xe7690430a44f7f03, 0xb2259a96b4d88e0b }, { 0xe8147539e394ad57, 0x5ad79e01f419fcbd }, { 0xaf54d8e9ebef065a, 0xb9e1c56e0db7fb29 },
+ { 0x835291039b686b1c, 0xa22641319aecd1fd }, { 0xd0be80cf67f43b60, 0xe22aabe8223c6ea3 }, { 0x50f5b570561a6a07, 0xc9e8819dc73ba5ae }, { 0x34ce2043693d7e18, 0xd9eb5a3ae90ffa58 },
+ { 0xac4d7c5541693c21, 0x3005ae2a725ce1d9 }, { 0xf3c5b82c50a88472, 0x111f2b20f5a636c1 }, { 0x1efae2128e7567a8, 0x132708ed8041e4af }, { 0xa7adff8e5d38b6d1, 0x46448f4d273a0aec },
+ { 0x01b6ddd566c31629, 0xc65c983c9459b750 }, { 0x6e6dcb3d45b588c6, 0xa01e62fcef0b0393 }, { 0x049df2d25b8a58a4, 0x9eb325f015a79983 }, { 0x95515476a3cabc3f, 0x4ea403ff3020c497 },
+ { 0x92d5021852c6dee0, 0x59f34d4b5a6c47e4 }, { 0xa19f7435caf7c227, 0x974f59c5d92f3ecf }, { 0x052b2f073d494e8d, 0x58efbdcc81fe2ed3 }, { 0x1a6710c0d5ff3f0c, 0x8d942d1d95e67d2c },
+ { 0xf8253bf74cf90e82, 0x675e0a47a0c0ddf4 }, { 0x85601ab80ca71fea, 0x732d97b964f9e5de }, { 0x1328ea7205eb99ae, 0xb46dff022b323bb9 }, { 0x9da87311151d0cb4, 0xb10149dc1aad3552 },
+ { 0xcceb1bb425c4709a, 0xbeb5507d49cf27ac }, { 0x37d784ffc3bb4463, 0x500f317e96e4e0a8 }, { 0xd1085d1a01372d49, 0x247633d4b665d9f3 }, { 0x786e0e487d175fe5, 0x4c9c203245c716f9 },
+ { 0x9b9af8aa82d27842, 0x600a9f54e4b80171 }, { 0x2549b358a093cbe4, 0x223e5640298f6c41 }, { 0x738e8d936146d515, 0x3add015510a1fdcc }, { 0x7ac17721b15273b7, 0x0324d34aae75bb59 },
+ { 0xce4462dde9815cc8, 0xf10da305a27d8a0c }, { 0x0dd208608b9efe06, 0xa74af7efab73df16 }, { 0x498b010c29636f70, 0xcd98c7c42d36c272 }, { 0x9c1eaec473de1a9d, 0x775dd1e08ef48202 },
+ { 0x7cf3fc9a269d0741, 0xd22f05c250608f7a }, { 0xa3300d5c06b2ee75, 0xd8f7aabd329d936f }, { 0x69e99d53b4b9ea19, 0xb7492c48854780e0 }, { 0x9363dfcd3405c8c9, 0x9fafd577ce35f0b4 },
+ { 0xa4b45b32f7be8caa, 0xcfa0e40958d1101c }, { 0x1187931bc9aeb5fc, 0xfbd50c7ac0809619 }, { 0x6694ec5af362384d, 0x5fbb28dfc586f256 }, { 0xd73ad6a196f859bf, 0xf57de55c4870edd0 },
+ { 0xe6dfd9e5c28c692a, 0x747902aa2081395b }, { 0xaee2053c8d2c1073, 0x7fbd5d5299ee4c79 }, { 0xf5f73397c767f084, 0xc014fda80bb302e2 }, { 0x10314eceaf6da3d5, 0x3d89944654d92149 },
+ { 0x84d6c76d6a6409c3, 0xb5710f85f0a0528e }, { 0x4e0f5762d86f0daf, 0xdacf8970477a4101 }, { 0xbbf864f51f08fd2b, 0x1adb74d84cc943e3 }, { 0x4fb98ab7beac1b86, 0x1c93114cd323f651 },
+ { 0xe3f4f6e2ffc527a7, 0x2c96bf66a17f1788 }, { 0x77137f413acc8db1, 0xa46e24a50506644f }, { 0x907a7b719e83f2b2, 0x164bbe33b1deea44 }, { 0xf27365f9366b925b, 0xd743b31c61ff8191 },
+ { 0x2c0649ea70876d46, 0x1bc7845f975b2ad4 }, { 0x1de346ae24f35dd3, 0x9ac363a9ffaafe5f }, { 0x265017e40a15f19f, 0xabda3d04566476b1 }, { 0x4ca02e0b142a21fd, 0x95777a08acc8eca1 },
+ { 0x4d16f3de72e937d4, 0x532be23438915bf1 }, { 0xfd0e14f071b0400f, 0x3fb1b78b213ef327 }, { 0xc13913d4ae5a8e9c, 0x19ffa792e2bcf8ba }, { 0x0c64d5b5ed5de82f, 0x61166fd33f2a6846 },
+ { 0x91cca6a4f840e49b, 0xd017260f25875d14 }, { 0xc6bd45ba5f56ec43, 0x0ea8e92688f07bc9 }, { 0x6fdb16e823769eef, 0x6642fac07b52b4c3 }, { 0x0a565e0e7a929cd9, 0xb01db95bc13f5c65 },
+ { 0xb9571d9cd34dd179, 0x556387a0a77bee43 }, { 0x27e6ca316cd6e7b6, 0x6d86a538c23dc1e1 }, { 0x5f88c47911c1b853, 0x211a850a87fad718 }, { 0xb48515fc58d32f7f, 0xf229704f0c083155 },
+ { 0x3e987e4d13afe2c1, 0x69f6e3612830a63d }, { 0x0be083db1c518af0, 0x764121675566eb35 }, { 0x1603c57538a2d723, 0xec8242ceaacc156a }, { 0xc220b76804dcb4e7, 0x901bccd69d57e24a },
+ { 0x1bd1cd15b33c2925, 0x4bc8b52101bfca7c }, { 0x18c869a919ba135e, 0xc22cde657e54d08c }, { 0xc08fce01c89998b5, 0xdfa33fae76e54fea }, { 0x391c2823e2a3801e, 0x7ea1add5427c254e },
+ { 0x094ffab2d014a6a2, 0x39f9d21fbed44695 }, { 0x0784566ef10c62df, 0x17574eb46a4c8373 }, { 0xbed34bf22241b3a6, 0x4234c914cd376d30 }, { 0xabc92a3bb0655efe, 0x2752e09e181062aa },
+ { 0xa96653527c2072ac, 0x68ea13e6f3a2cf0a }, { 0x4b247865e5264322, 0x822034bcc6846fd2 }, { 0xfb3c9f4be67f34f9, 0xeeba6103df2bc704 }, { 0x289bbb382b0d35e2, 0x8574a1af82fcb357 },
+ { 0x3661592aa578524a, 0x9653a94202bd57f8 }, { 0x3053d29132b726bc, 0x47587fcafca863db }, { 0x82e44cd6fdab7d35, 0x647ad90d0eb566ad }, { 0x740adbfd904ab7ca, 0x2d8a4fe17aed7ebf },
+ { 0x32fcabf8fef20aee, 0x08e08cb2171ace7b }, { 0xe470a08c0ec94578, 0x3bc1f1d2cb3394fb }, { 0xeabb0c502fd18105, 0x156f6d791fab511d }, { 0x9a2c257fe4116e6b, 0xa656076870e1b621 },
+ { 0xe5c67d59680a5351, 0xfd9d69ee5f6a23ab }, { 0xcff2bf088f424ae1, 0x37513b3936243d5c }, { 0x483ddcd94fa07959, 0x0bc45ff8b96f7522 }, { 0x546847a20d9032a3, 0x575ba46dd29c3c2d },
+ { 0xb1ae3afb659a61f2, 0xaac6cd838df61f86 }, { 0x14acbc1cf4e7fb71, 0xa33ab1b6417eb8ca }, { 0xb533c8293e103956, 0x3475e87398518605 }, { 0xc4123cd39313c011, 0x41101a5e6342d669 },
+ { 0xc70b986f3995fa6a, 0xc8f4711a1ca9cc99 }, { 0xb2b79e47cf1c5b89, 0x2322a6c7f21d0576 }, { 0x6cc2b25489f0a494, 0xefa6918404b9ae33 }, { 0x3a058c9f4825ba65, 0xf745c6913d973fbe },
+ { 0x580c9217e0cdda8c, 0x364dcbbeedb6546b }, { 0x60a667e164ad4cbb, 0x8eb0fe573b93c675 }, { 0x197eb47c7f790577, 0x04704659ea0d67dc }, { 0x723850460785c33c, 0xfc81996984f84a9c },
+ { 0x0319a4bcaa863a7b, 0x89e46b447feb1af0 }, { 0x5c9160c5bb478228, 0xa8feee4ef811cde8 }, { 0xf993e6222a3a18ab, 0xa102927b34996aa4 }, { 0x40c4fbbef977c9d2, 0xf46115db93e284e7 },
+ { 0x3578fd960ffe6831, 0x1fb7c2067d564d08 }, { 0x5aa3eb7e2c88f6de, 0x79f538c60604f9cb }, { 0xd423721d3c7e63c4, 0x7c998e18379bf720 }, { 0x45efd4b9c43e875f, 0xac8ea817121caa34 },
+ { 0x79d8d39d1bd449cc, 0x8ac0b80ed19ea1a9 }, { 0x9eb1d7adbf9b36cf, 0x38e5229865462fa2 }, { 0x4459096ca2fd9176, 0x6ad2302b86451d64 }, { 0xeb0dd1854912972c, 0xd333f5458bf2e64d },
+ { 0x87cf63d1c0e233b8, 0x3c9564c18f4b487e }, { 0x5771e31ea71608d8, 0xdebfcf29ad7726dd }, { 0x514368a530d97c2e, 0x0fb419a1536212fe }, { 0x658d48e659e40236, 0xd65f439bba6de8a6 },
+ { 0xb018e72e035977db, 0x6c9a55bf19afa8d6 }, { 0x20629c5f9dda8569, 0x7ad1eb8ca8714292 }, { 0xcd5dc661430766b3, 0x78e9c841dd9690fc }, { 0x2ea93083bcc24114, 0x547f77277ce98774 },
+ { 0x31e50f4454743095, 0x8104e7f668f1d48b }, { 0x8a1d6bb14b7ccdbe, 0x9bdf932e24389768 }, { 0x6af039ef1e3fd062, 0x3ead470cfaac9a10 }, { 0xee26fe82745bd9a1, 0x8bdc48890a0cc89e },
+ { 0x22cde536519fa93b, 0x356918f443c3ef32 }, { 0x94e789a3c509aa16, 0x88f89bc3a47973c7 }, { 0xdd6c88afec6ac566, 0x45605c07894fb1b5 }, { 0x62091e88a8e860e9, 0xc1080d2fd0216bd5 },
+ { 0xa286d0896071f85c, 0x1eab3281a6c4243f }, { 0xcad9900fb20b046c, 0x6fbe86f5b7da138f }, { 0x97fe2d1f6f8f906d, 0x011cf087db926937 }, { 0xf441ee42a1a4e6ad, 0x064865949feab5b2 },
+ { 0x38aaf5f684609637, 0xb8fd35e9d625921e }, { 0x8d993ddfba70af61, 0x8c88dd9a4e74141b }, { 0x6b46e43a78fcc64b, 0xf8f1df306ef52d40 }, { 0xdae8dec11d66a7b9, 0x523712b3e30332c6 },
+ { 0x75bc0628f689a1e3, 0xebd6d7ddeeb4c9ef }, { 0x3d81daf1b929d8ba, 0xe012882557dbbccd }, { 0x56c73ecbc1d51ef1, 0x18e35715392e918d }, { 0xb3014392a9df4da0, 0xe57e3efb6644b226 },
+ { 0xa8d08e871ae36485, 0xaeb68bda67fb785a }, { 0xa50286e7917d9a83, 0x09fc7c35cc88a74c }, { 0xed3f5a3ededde3da, 0x023823cd75e7d26e }, { 0x7121f4faad03f947, 0x7565f22dfb13506c },
+ { 0x8904cf0de1faf7c5, 0x123bf86a5bd38d98 }, { 0x2a34c251e74819b0, 0xcacc52d7694e1ef7 }, { 0x8f3644b676358333, 0xc3302ee2a5c6b9bb }, { 0x1c559b7b42304bfa, 0x5c9ffb956bf3490f },
+ { 0xd68c0b74f03b4f96, 0x33217d60dc295a80 }, { 0x2db0943f16447b6f, 0xdd9b1c6303029d84 }, { 0x7097292fcbc0ef6e, 0xb3396a116f4ae73c }, { 0xd9f17a7db7e09dc2, 0xdbd379f79ce82836 },
+ { 0x06328bbb97cf74f6, 0xd10bd688fe153423 }, { 0xb8e1c049b58ec750, 0x933f1f9c33225913 }, { 0xf6ee972b6de1caff, 0x49f096ec74581812 }, { 0xffa16d99bdf56c5d, 0x700944f3ca8c5e87 },
+ { 0x43dd5f0253f1f3a9, 0x7d857e9fec099e17 }, { 0xe2422b379906318e, 0xeaca275a3526a0d8 }, { 0xc9c034b3188d3e17, 0xe65aedb1c831097f }, { 0xd3a72473cd72011b, 0x6bcec0ac5dd77453 },
+ { 0x8babb6642dbfdb97, 0x5d830b12b0612038 }, { 0x0ecbacdc2118c47d, 0x2eae9cabd498c5e6 }, { 0x88b212d88739e1ec, 0xd4676056cf8a3ac8 }, { 0x151a61c99224ed58, 0x6566298ad5270f9a },
+ { 0x5b1536ab4a4be0f7, 0xbfa9a0fa925d4e9b }, { 0x643b95333f27141f, 0x1003dba72e345ff6 }, { 0x4172266b9fb4dffb, 0x323d8de707bb33b7 }, { 0x53ec11ccfc9c507c, 0x400cead9b8d0bf5e },
+ { 0xf0dc1c90fa2ebe09, 0x98fb40648a4d2c31 }, { 0x4740add0087bab0d, 0xe3365b6ff9ae0794 }, { 0x5e3e19ac7702ae7a, 0xe7461d3613a36048 }, { 0x804b35bf31ee5167, 0x2bc22a75e507cb0d },
+ { 0xcb6f4ddad4c81245, 0xa9e21ec92383a4df }, { 0x129e37a763288f87, 0x7231673ebf6b8ce9 }, { 0xe0ed525e55431ddc, 0xa572d422de940d78 }, { 0x3f2ea398756cf4e8, 0xafaa7b5dbc69116d },
+ { 0xdcda557a8aa9d34f, 0x833cc43b1d1606e5 }, { 0xde752c1346ecff1d, 0xcc843743f6a4ab45 }, { 0x81fde86a572d474e, 0xed9eb249715e7c5d }, { 0xb79cb140f2551504, 0x7bcd1b0b73e32ba5 },
+ { 0xd847a7a8d1238beb, 0x1d8fe1cb08b19f66 }, { 0xa61b225b3bfba0f8, 0x80181771b363bdbc }, { 0xec8987ebb81ef5f3, 0xc464bbf1e1be653e }, { 0xc876e9667e4e283e, 0x2006758d5c68be2f },
+ { 0x2f1fed56da01573d, 0x9223ef1be8b03024 }, { 0x6d746f81ef33b2bd, 0x29fa09b890e01963 }, { 0x55de9a776b53248a, 0x91073c5146c58b7d }, { 0xef9023571298cf88, 0x4d80d0b59e557fce },
+ { 0xbdcaef4e88c789dd, 0xcbd0a250b2dc77c0 }, { 0x24ff6e8dc650ddcd, 0xe462ce7cbdd6db11 }, { 0x4a92a5b083e5550b, 0x447cac8052ddd882 }, { 0x7e5c85f3ead82b13, 0x9d97f6babbd222da },
+ { 0x76a5a2945c0f9b98, 0x6232bc99915fd31f }, { 0xba4eb92079cbeb02, 0xdc87ece4d890f4b3 }, { 0x3c370724dfeace93, 0x264e1019c3820b9d }, { 0x426b82d73532e580, 0xbbd9e6a378502947 },
+ { 0xdb5e03147ba5b190, 0x946b8a8f775a8596 }, { 0xfa8a429e80bc22d0, 0x28e6f93f4b727054 }, { 0x46f670056eb8bd24, 0x256ac3536df7b0c4 }, { 0xdfc3f1c6202fe934, 0x0ad8af7f62fd1c15 },
+ { 0x292d66ed4dce23cb, 0x4328399316a50407 }, { 0xd595afc85abd75ed, 0xbac51624a3c24070 }, { 0xbc7c329bee049ff4, 0x0d8c3a6c2685c090 }, { 0xc3966abd621fa2ce, 0x564754ea090e551a },
+ { 0x2b821f84818b0f99, 0x0c90caebfd17a9a7 }, { 0x993581c34e975410, 0x2fb26c2c0f0aacd1 }, { 0x9648f0ca094c8644, 0xc74068bb4fcbde67 }, { 0x21d4418afb199340, 0xbc8d73b03c28f5c2 },
+ { 0x6110ba34026e5a92, 0x48ec666bafca7125 }, { 0x7fea58268c1b3d3a, 0x5bcb6e862f8b958a }, { 0x5d27bd10dd849401, 0x6ea276726c487ab8 }, { 0xfcb8c92517735626, 0xf9ed2fb7b5674477 },
+ { 0x237b38e3375cbf12, 0xf33580c8d79a5862 }, { 0x8e80996310f6951a, 0x056cb6de319f0eeb }, { 0x8c2fe00adcb3b948, 0x4ad445a6da2da34b }, { 0x7d45214f405e1168, 0x14739dfec439382a },
+ { 0xe15b8f8b33800bf5, 0x632e4c1e4acdba28 }, { 0x1f4c3fc7e8b67181, 0xd57b90d1141853ff }, { 0x08f92767b6d7b08b, 0xffa54a232a8df1c5 }, { 0x334a762d98311cc7, 0xcebc148e8343792b },
+ { 0xf7584afe0b22dcd6, 0x8fac0ed0e001af42 }, { 0xf16ac1459ceda820, 0x5ea7d8581e149b61 }, { 0x17b518a05e61c10a, 0x2adedaf23e95a23a }, { 0xadfba18027aa2a08, 0xf6593616e6055689 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x3bb3514a2ee6ac4c, 0x31195eada9ce88ee }, { 0xaa7ff7eed6a648d7, 0xe10e78a28c49d5fa }, { 0xfe17b04cdb367a74, 0xb655dccf5ed5e9d7 }
+ }, {
+ { 0xc397111b1518eccc, 0x9b933a773e7d9af0 }, { 0xcd0591a4324c5203, 0x23a6ad710e447bbd }, { 0xd8399218a99a0c17, 0x74027d7846f20aad }, { 0x3c2c688604ab43a5, 0x98407bdb17358384 },
+ { 0x64bf1372463d39d4, 0x40ea1b794e18c451 }, { 0x4ec715c9b35285fc, 0xee61786bdeb72671 }, { 0x53b94c0bdbf4e4d6, 0xc32e6c27fb609687 }, { 0xfb9a54a2898b5176, 0x3e47236ffe999807 },
+ { 0x3db5f2f922a59dd2, 0x0665829b529032e8 }, { 0xf660b99cc4cd4e20, 0xe71d7ca9018c69fe }, { 0x4daf7848d9402465, 0x8f0eb0ab119b36c5 }, { 0x18c6ee82d6904142, 0x8efe8fcfb7a380e9 },
+ { 0x76ca50702fc13846, 0x4bb561731e532486 }, { 0xc20e8b64331632bb, 0x05b6c3377bd82b9c }, { 0x4474b8490c3ec52c, 0x6bc08dae395f464f }, { 0x626fc9b39219b825, 0x8234483a1340e4fa },
+ { 0x7372e73091f7182e, 0xe804faf08c271499 }, { 0xdd81255817ac2c7f, 0xd7b3e6fbd4863ab2 }, { 0xe034d7a13509b1ad, 0xd1d664608616085a }, { 0x590ae18b6498a406, 0x468f99e21c88f6b9 },
+ { 0xc8bd26e48c7a726b, 0x801736f29c304ba2 }, { 0x9c4d2a51a5a4c93b, 0x1fc2f0d67fad4ce2 }, { 0x32bee83923fffd6a, 0x2075ecdd270c62c9 }, { 0x2782eb85b829a37e, 0x77d13cd46fba13d9 },
+ { 0x3f4405076eb9e23c, 0xf92fb31bd8199330 }, { 0x304f1fc76fe38284, 0xdf3fdd5dad85c311 }, { 0x7aa927314489f967, 0x0ccac7f5a4e36413 }, { 0x8a19446c546036b6, 0x2909e81ff8372d46 },
+ { 0x223a5cc5061f8316, 0xd460a757fdce23c6 }, { 0x825b1e12a7100988, 0x53e22c5a9556eca0 }, { 0x88e8b392187c4958, 0xd643d99f72be8c9e }, { 0x6107a432f80b19bc, 0xe35b80fadc6cf44e },
+ { 0x8fa1f32cea5616de, 0x8ab8739c6a431d59 }, { 0x46854fb74022bac2, 0x948abc2eb3d6e797 }, { 0xaad2ef571e63ca4e, 0x02237ec88f70af58 }, { 0xf24194a35cf5b03f, 0xda891e6ad65de88d },
+ { 0x85125eac553a560e, 0x0f1986598dab7d67 }, { 0x04212d3f9838fe1f, 0x3d9462c3d7d18173 }, { 0x03686d816a12a199, 0x616fc8c0cf2c10b4 }, { 0xb21401d5c8f38b0c, 0x8cddf10738d32fb1 },
+ { 0xa290b529ed13f570, 0x78c8ba8de2116ebe }, { 0x41cc0f09b208e544, 0xc871162dab2b7650 }, { 0xbe777694a3bb4a2d, 0xcba2578182636f24 }, { 0x2be19cc4d361625f, 0x30ae9a52d50a534c },
+ { 0x7e880a0edcb10778, 0x315ea5367332e560 }, { 0x609e3e4dde05c7cb, 0x7d7e79ba99c94522 }, { 0x9ebcddafe9b8b6d5, 0xe088c156f524ed3a }, { 0x6f95248ddf5fa773, 0x5b6e17fcec551503 },
+ { 0xe6e40d60e12d305c, 0x13083723db4e28f1 }, { 0x79c14ab02e9b58fe, 0x6da50f356bcf74a7 }, { 0xa6b19816752b0b6f, 0x455cd84e35c0efcd }, { 0x902e5d10ceec081a, 0x58bd5650c51d0c77 },
+ { 0xa3092f56cb1d2b07, 0xe6ed43cda7b4dfd2 }, { 0x02f1f7fe4c1c7fee, 0xff4a31808a89a1d8 }, { 0x6cfd490cb54d06ea, 0x3a01df3c237905b7 }, { 0xad9bafe9ec4995c8, 0x5ed8d4cb978d3e9f },
+ { 0xec57a0e05e41708c, 0x96a9c2e63ca648cf }, { 0x471cd5c8662c64b5, 0x0aaf456ef67356fb }, { 0x5148bbf597e89b38, 0x3c645da771e9375f }, { 0x72eb7d4fb7f9c659, 0x762103b0c982a5f5 },
+ { 0xffbb799d11b3af69, 0x03d341ac29481974 }, { 0x7b30bd4e62872710, 0x92ef3eb5e146d57f }, { 0xfcd3141c7ba10ef0, 0x62bc896ce66409c0 }, { 0x6526890d6033e7a3, 0xdecfe2390bbd753d },
+ { 0x261b71fa9e277d09, 0xe9f4c5942a1fa2b5 }, { 0x4817cf086776040d, 0x2cbf2b2883ef06da }, { 0xb4c4db141cd70afd, 0x4e03a244658b0f1a }, { 0x6a2d93cd6169871b, 0xf8df8c7f7e21251c },
+ { 0x556996ca0fd06527, 0x01f03f64a638b62c }, { 0x16546e3df1c4ff8d, 0x36cb18c9879a61a4 }, { 0xcbd54b65e668d3f2, 0xe178fe32531c5b16 }, { 0x1275430269fc0192, 0x0b5f7a0a504be0d7 },
+ { 0x91b7c76fe8e2d66d, 0xc698af1080b8bd1b }, { 0x1ce7c3bd4ea8bf5d, 0xb36aed0c6072019a }, { 0x06d0dac1d42481f1, 0xc2de53435d5820ab }, { 0x0c6377416b48c121, 0x477fa686bab04095 },
+ { 0x2e592b846d574237, 0x931f01d1477e6353 }, { 0x2fc0b1fb4b599c40, 0x0d3af89102dbd23f }, { 0xdb51ff99c388ad8e, 0x156db5b889de1a19 }, { 0x5bfb16752884dbe8, 0xb9c5a86296015761 },
+ { 0xe9ef17a0e07750e4, 0x35185965aed278d0 }, { 0x35f7a887d1d5a2ec, 0x7c8e46de3ff1f30e }, { 0xa06142d7a10f8a9e, 0x87828b0d6898cf66 }, { 0x97671dae3cc6579c, 0x0446fc53dde09db0 },
+ { 0xf0b0635d10e9cfd1, 0x25c32fea5cd44955 }, { 0x24ea8604d23b02e7, 0x16bef414a096036d }, { 0x0f0b1ac0015a60b8, 0x26106e46759c5021 }, { 0x897129ed3e72972f, 0x486620df371b3df2 },
+ { 0xb0e5f62b84eff4e2, 0x7397c087b25a8e69 }, { 0xb55d416b3ad9d48a, 0xd0265b04202ebe76 }, { 0xa9ba82d674716bd7, 0x634cb608405cbfec }, { 0xbd1f1b15c9a9ebb4, 0xaacd9f414d4f7f90 },
+ { 0xd07bc8665aea3329, 0x0ee9b93d2b93cb4b }, { 0xb6352cea50cb7513, 0xb14993c4ef02aec2 }, { 0xf96ba35cc5972e98, 0xc10d12ef741039df }, { 0x5e43a13596b2fb80, 0x1a7433e10475677e },
+ { 0xf129f92236e711a6, 0xbbe6d6aa1971f839 }, { 0xeea6571e125d0f62, 0x69e3f366b62fe917 }, { 0x1e16344302b4c0b3, 0x4c20dc8ceafba042 }, { 0xd1e252197ce4ed5e, 0x90cc407d6e367a27 },
+ { 0x9596ea5070da2872, 0xfb0ccdd357693c68 }, { 0xe2c5205f7915ce43, 0x2e9c55e00c9fa982 }, { 0xe35cba205f1b1034, 0xb0b9aca0493a18ee }, { 0x195f74fdf09e9f35, 0x10db768ff2063185 },
+ { 0x63f653ccb4176652, 0x1c11b17a56e55596 }, { 0xaf6a5817a055ea26, 0xa192e54b1d049f47 }, { 0xea877a218a65f17d, 0x547791a561fe6864 }, { 0x701a8ab1fbe5b9b7, 0x896b3230430b042d },
+ { 0xeb1ee05eac6b2f0a, 0xca5268e5245bd908 }, { 0xbbcfc1d41d8d6a45, 0x6813cc0210175f3b }, { 0xa4406fe839377481, 0xba16e9cebf494e15 }, { 0x5cb256cbdaae846e, 0xe53e02618efcc6a6 },
+ { 0x99f59d111b92e953, 0xbc736b55edd97cfd }, { 0xc4de51a5e732b34a, 0xc768907426800b37 }, { 0x848bc4d373348879, 0x913c7f19c80ecc0b }, { 0xba565bab3b83b432, 0xf636354255b2ee57 },
+ { 0x23a3c6ba20115d61, 0x4a455e17b86b92aa }, { 0xedce3a9f784faefb, 0x088c3ba67903f9a3 }, { 0xab4b7528386d1439, 0x9c068788cad51e34 }, { 0x718310ceddeb67c0, 0x174ecb7006aeb541 },
+ { 0x17cdf442d7ca21fa, 0xa8eee189c23fd0c8 }, { 0x45ed22362a301b5b, 0xf5e574ee7cfaf723 }, { 0xc62fa65bab2ecca4, 0x3822a1f4ac09aaef }, { 0x380d45b99c93bdba, 0xa5d41918c0e402f7 },
+ { 0xe1ad4dde13076fda, 0x4ff39d20c3b3b936 }, { 0x9dd4b02e83aa174c, 0x81e709963a08fd8e }, { 0x940f702f56d4f605, 0x6529349312cc8d04 }, { 0xbc86816aefa735c3, 0x34e8660108eacefc },
+ { 0x664ee48c0a21463a, 0xbfa02af9c4916589 }, { 0x6945fe4c0b7b2682, 0x99b044bfb10d35a8 }, { 0xa72802695325d518, 0xdb79210e70655ea1 }, { 0x5798613443cc1ac9, 0xfeba0ee42cb117f4 },
+ { 0x05b8b740be362068, 0xa3b19b839274301f }, { 0xa5d9f5971f39aaf6, 0x2433108efaecff79 }, { 0x14a599c3bdd88063, 0xc98129490d13c07c }, { 0xfd4a8e635dafd087, 0xfc99702ca3c1b8ac },
+ { 0x09dbc001d57ee149, 0xe4ce3d0528c4708a }, { 0xd45ae559c2d2cd36, 0x337ddbfefc424a38 }, { 0xdf70d2a65bb05391, 0x28f9d77b5e0f9b6a }, { 0x867a332d3f28f797, 0x6e764e9942876dd3 },
+ { 0x4055957694063b33, 0x5654ef6dee8ec73c }, { 0xdc18bf2731a2f208, 0x49961fbb91238bde }, { 0x1084b4fc25e07e7c, 0xf4154b8adac2410f }, { 0x37065f799dc9dd02, 0x83c4775eb57852d6 },
+ { 0x01999a7f260ede77, 0x9e25f94045a5b16c }, { 0xca4cd11ac0660d85, 0x7f5d077216b9ea7a }, { 0x80aae9eceb0c7666, 0xaca81dda1fdf4d78 }, { 0xd5c37f26e4dc1341, 0xad5822beb9e7fb54 },
+ { 0x8d5004d2a64a6930, 0x75f2421ce0cabc81 }, { 0x3994dfc6ba9d63cd, 0x3bf1e0588541b39b }, { 0x0ab3ad80bf6c40d0, 0x85a1f5c5e7e8603e }, { 0x2ca8dc7a214b3dd9, 0x6c553051cdf7c28b },
+ { 0x8e386953cc58c8a9, 0x149d8adc2fe6ac35 }, { 0x433df8f7fe149aaa, 0x373b27ad21a2d788 }, { 0xe58c60e18b3f91c5, 0x7267ffe314623845 }, { 0xd9a008678f94d260, 0xea2784380357bbc1 },
+ { 0x20cbab3b4a03fcf8, 0x2b2a96d77747821e }, { 0x6e0cbef2f9517904, 0xc54beebca9f0a46f }, { 0x25731c7bf435dc90, 0x889b0d54e533b201 }, { 0xdee948d97dbe8de6, 0xb6dc2e3b1baa2a06 },
+ { 0x7c79fdf090ad7896, 0xce1494b6f9bb44b8 }, { 0xd73288d8a8c06caf, 0x5212133e336e5a8c }, { 0x2889f145b973c3c6, 0x51c152921a2643f8 }, { 0x0b2a37ff99629ea7, 0x1b840c85a24dd152 },
+ { 0x5220d674fdfa3aa1, 0x5d0b9567bec527eb }, { 0xd6ab12a78eceb2d8, 0xcc37ea7e76cbebe0 }, { 0xfe22e3e237bd711e, 0x9df6b8ec6ceda818 }, { 0x67d77ef32c2f984d, 0x2185d3b98134d4e5 },
+ { 0xb7acb69576c5ab64, 0x2f6c6a84aaa71fae }, { 0xce6dfc25585ef39a, 0x42c965b1c1686b09 }, { 0x4ae638f62b6a7be3, 0xd3f51aa80966a702 }, { 0xdac865e6e58673f9, 0x8b484cf8cc7bab75 },
+ { 0x5fda3b4ab0bc25f7, 0x8451caa141d0d612 }, { 0x5d2bccb4fca05a19, 0x7b1bfb21cb5977ca }, { 0x93463091a4fea983, 0x39d29e900a311cc3 }, { 0x3edd9f7848b73c4b, 0x670a4a5b9dbc225c },
+ { 0x50d1218ab1e6454f, 0xa241a4e7344c8633 }, { 0xb38d9baaeefd557b, 0x12f808477d769edd }, { 0xf8f23923e399f0ef, 0x5f28ebaf31b588b3 }, { 0x6d64d3739343d89d, 0xa424267c66dcb4db },
+ { 0xcc9c0bdb14428c74, 0xbd8354314be1cad1 }, { 0xd28a3f9816f64cc7, 0xf1a388bda11a6a93 }, { 0x9a9df090718048ca, 0xdd1ca39522f56c49 }, { 0x6bb409b24767596c, 0x66fa753f3b849470 },
+ { 0x31d685b849ed5cf3, 0x411a241de820727d }, { 0x7753ca0f09cfe631, 0xd59098335bf695ea }, { 0x08425a7ef3703f3e, 0x7aebc4456d61c1e6 }, { 0xfa03ceddaf858f01, 0xa062da2fbb3c296b },
+ { 0x1bae8303bc82e0db, 0xef91470f788f905d }, { 0x1f8fae3c24ba1ec4, 0xd20525ccaf5e112e }, { 0x7de0678fb6a3a6e1, 0x50316df6bc1ef5d4 }, { 0xcff4665a7e502ded, 0xdcec9cf184cdda65 },
+ { 0x87e3a952192629e0, 0xf053b7d90722dcbf }, { 0x153c03bc9bd65e14, 0x57a4d00948b67110 }, { 0x75a23df145d399df, 0x2adaa9b3d17f3432 }, { 0x54f00cb529debb50, 0x9fd5c624e39d0740 },
+ { 0x5601fb4b65c2c4be, 0x609ff7a46914a698 }, { 0xb93e362a519115ab, 0x9759fd829a9efee3 }, { 0x2d3146050745e3ae, 0xf270c911885273e7 }, { 0xaef3c268865b3451, 0x3fb71c0b58a12e2b },
+ { 0x4c36e237ff4efa12, 0x112b49eb543e87a9 }, { 0x215231446c0d228f, 0xb50f6f9732e23372 }, { 0x3327724605f1231d, 0xbe50159d62a9d3a5 }, { 0x92dfaaee82f077f4, 0xa7f767d04f94adaf },
+ { 0xc7b63c248d2012d3, 0xa60758b4e9ac1b83 }, { 0x83c2846d811ed7ff, 0xcdc7d51ad0f35dcc }, { 0x8cc99ead8044b747, 0xebd7bb5ca56f0ded }, { 0xef3fcd613453d115, 0xf7c60a26f38a587b },
+ { 0x4f5e8fb6955c5b8b, 0x7044812b9b12971d }, { 0xa82318a9527fb5a0, 0xfd694f4805f90e80 }, { 0x68dc64332d75f8f5, 0x0795bdfff4a884c4 }, { 0x2a7806bbf56fbc28, 0xae8b631290afe220 },
+ { 0xf7f923e3e2c39057, 0x793885e94429d892 }, { 0xe415fa9ead314fb2, 0xec4206a351c78929 }, { 0x986c076e3d9c3724, 0x22569215a87ccd91 }, { 0x0e9280bf2754becf, 0xb83597063039e14d },
+ { 0x7858d0cf08958689, 0xf380f6752e6ac5cb }, { 0x42a46288d81a44dd, 0xa91edeed640766e4 }, { 0xc0ff7c9a7f0a4d55, 0xfafcf2b7f1518a44 }, { 0xe77d971fc723ee2b, 0x8d2dce639eeb999d },
+ { 0x346e32f8f7db7c9b, 0xe2abbf9e7a544262 }, { 0x96fe87d11ac889eb, 0x9a63051398452cdc }, { 0xf4914e6288d131ce, 0x18574d298b05c826 }, { 0x13ecd97d4ff2dfe5, 0x957a834a15ee51bb },
+ { 0x29106b3a9f7d1db1, 0xcfe4abd25f83f294 }, { 0xc166e6e559049322, 0x64d90bf7b4f43b28 }, { 0x9b046aef578e96bd, 0x43395ad56750dd25 }, { 0xa1f8d8a8870154e9, 0x19a7724d2d3d7e0a },
+ { 0x3b652838f6811c23, 0xc4bbd1d80fc81243 }, { 0x369fc506bbc70375, 0x1de18e1ef0dde3ba }, { 0x5a628c0a0e8a059f, 0x27e05122d3a4e60d }, { 0x9f2547d0cfb668a2, 0x7ead3816b0815c56 },
+ { 0x7f119071fabfd90f, 0xaf7b5c763697540c }, { 0x3afcb247d08fc254, 0x5a9e28984a6da32f }, { 0x074940bef22a5f86, 0x5cfbaa0318fd91c7 }, { 0xe8768ddfc6798e93, 0xab3da025eb77c9bc },
+ { 0xbfeeeceb85b5945a, 0x5587aec1c7c6de48 }, { 0xc547cbdac13c6d3d, 0x594d69346325ba5b }, { 0x4b7fa2890d64a594, 0x4dd0e3e84cc3166e }, { 0x0dfaed3e4d461f56, 0xd95a5fc6ff15f1f9 },
+ { 0xac023596ca474bbf, 0xc0fd2d8bd2288ff3 }, { 0xb17c6c54a2e12a95, 0xedb239c7f7ff3f05 }, { 0xf508d41daedfefb9, 0x8672b469cea0794a }, { 0x81337393cd02a811, 0x328de49a5a7afc14 },
+ { 0x111d2e8303eea00b, 0x6a30b2ca9f67f063 }, { 0x58937bf442967a71, 0xd8aa60a2592d47d5 }, { 0xd313a5e730f892b0, 0x6f8671fde4bfdbff }, { 0xc924bc9baa74ac1c, 0x1e32cfb2d995face },
+ { 0xb8a7ac55779fcbdc, 0x097c04c2df3b4f8f }, { 0x743ba78e63dd47a8, 0xb4ff50f394da855e }, { 0x8b80de13726ee8c1, 0xb72c115fbd929c2a }, { 0x1d7e59c268a6612a, 0x2d4f144c25d7b0f6 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x1a37197c9a8c3eac, 0x71b4be4f3d2a2131 }, { 0xf3d80edc7afb6e48, 0x44ace72a93f859e1 }, { 0x498e55774178da7a, 0xb29ad268c64ab7b6 }
+ }, {
+ { 0xe630efefb5ef3547, 0xe65f85138689a0af }, { 0x6798babae4ba63e9, 0x67a57c21945ad618 }, { 0x86f78e8ede8eb28f, 0x8615296eab6477b8 }, { 0xad956e6efc6ee24e, 0xade5695e44ddf861 },
+ { 0x587a76769976ab03, 0x583ee3d8ac1cdf6f }, { 0x59a41e1eed1ecacf, 0x599d4946d2605eec }, { 0xa32b1b1b211be90c, 0xa3f80ae6f570fa7f }, { 0xa7d578783278aeba, 0xa731e7dbce43bb36 },
+ { 0x9689c1c192c16d12, 0x96b71b9a47a8b05f }, { 0x6b591f1fd11faaf0, 0x6b3d8866d90f15c3 }, { 0x14802c2c5f2c982b, 0x146bdfc9d7ff86ae }, { 0x2de35353d953d52c, 0x2dbc3af228720f55 },
+ { 0x184189896a895132, 0x18f32b8e9aaa4575 }, { 0xdd2c4040db40ba1b, 0xdd0df7d785fce891 }, { 0x347cb2b2c7b2e5d2, 0x34ecbbe2cca4cba3 }, { 0xc23212123e120f08, 0xc2110c05a6e1aceb },
+ { 0xcf2ddfdf7fdfa7dd, 0xcf2a52dc95c8eeb3 }, { 0x519bd8d8cbd84460, 0x51cc503ca406dc7e }, { 0xc712191959192972, 0xc77b4ba6e3ae6c21 }, { 0xcef3b7b70bb7c611, 0xce89f842ebb46f30 },
+ { 0xb0f4ececf1ec9506, 0xb07c05739b387dde }, { 0xb28b3c3c193c575d, 0xb2f9928c67c0bc1b }, { 0x2c3d3b3bad3bb4e0, 0x2c1f906c560e8ed6 }, { 0xcd520f0f970f6586, 0xcdafc52369302f76 },
+ { 0xe0b15c5c4e5cb0aa, 0xe013ffd141422023 }, { 0x5a05a6a671a66958, 0x5abb742750e41eaa }, { 0xefd14141e741da24, 0xefad36f78e93a3be }, { 0x1ec03a3a913ad4df, 0x1ebf514c5d61c5f9 },
+ { 0x1a3e595982599369, 0x1a76bc71665284b0 }, { 0x05200b0b670b267a, 0x056a47a3454fc0ca }, { 0x68f8a7a74da70967, 0x681bb5075b8b5585 }, { 0x8f1620208c205dec, 0x8fe79a8aa37e74a9 },
+ { 0xc9ac6c6c846c2230, 0xc966281e52036e3f }, { 0x42442f2f1b2f386a, 0x42485fa9ca4e5bdf }, { 0x72c6fefecffe9a0e, 0x726d09763dd9d135 }, { 0x8729e6e6aae6d343, 0x87b683f0d518f63b },
+ { 0xa474c0c0aec00d2d, 0xa417daba4cc7fb70 }, { 0xec70f9f97bf979b3, 0xec8b0b960c17e3f8 }, { 0x4d243232b23252e4, 0x4df6968f059fd842 }, { 0x5f25adad16ad4f22, 0x5fd1338415abde60 },
+ { 0x6926cfcf39cf68ab, 0x69b81f9925f7d406 }, { 0xe310e4e4d2e4133d, 0xe335c2b0c3c66065 }, { 0xa8b565659b65c434, 0xa88f2efd019238ab }, { 0x3ac2c7c71ac7ee90, 0x3af1d85a7d09c9bd },
+ { 0x03a1b8b89cb8a397, 0x03263d6182844046 }, { 0xb40a8f8fe28fd2b0, 0xb4b5e84ea00b3c97 }, { 0xc4b3a1a1c5a18ae5, 0xc45d76c7612a2c67 }, { 0x0ebe7575dd750b42, 0x0e1d63b8b1ad021e },
+ { 0x5d5a7d7dfe7d8d79, 0x5d54a47be9531fa5 }, { 0xa2f57373557388c0, 0xa25ba0788b0c7bfc }, { 0x8556363642361118, 0x8533140f29e037fe }, { 0x451bf4f494f4dc4b, 0x45a78ff573f95ad0 },
+ { 0x523a60605760e7f7, 0x52ea6d5d26829c38 }, { 0x76389d9ddc9dddb8, 0x76a4e44b06ea907c }, { 0x439a47476f4759a6, 0x43ebf537b432da5c }, { 0xd39235350635b159, 0xd310946f3451ea8f },
+ { 0x3082d1d1d4d1a264, 0x302556dff7978aea }, { 0x795880807580b736, 0x791a2d6dc93b13e1 }, { 0xd5138686fd8634b4, 0xd55ceeadf39a6a03 }, { 0xf431707011702881, 0xf478201896bda68d },
+ { 0x4ba581814981d709, 0x4bbaec4dc25458ce }, { 0xd4cdeeee89ee5578, 0xd4ff44338de6eb80 }, { 0x0681b3b3fbb385ed, 0x064c7ac2c7cb808c }, { 0x6366d9d9f7d9245f, 0x636c911caf699751 },
+ { 0xf64ea0a0f9a0eada, 0xf6fdb7e76a456748 }, { 0xc3ec7a7a4a7a6ec4, 0xc3b2a69bd89d2d68 }, { 0xc56dc9c9b1c9eb29, 0xc5fedc591f56ade4 }, { 0xd9d22323c823fdad, 0xd9c41aeabecfa9d8 },
+ { 0x39637f7f867f4d07, 0x39d7e53bff8d89fb }, { 0xac4b060688068382, 0xac46c3c03aa179e2 }, { 0xfdd0dede43dec7e2, 0xfd8a93fc9ea7a59c }, { 0x403bfffff3fffa31, 0x40cdc85636b69a1a },
+ { 0x7e075b5bfa5b5317, 0x7ef5fd31708c12ee }, { 0xc193aaaaa2aaac9f, 0xc13731642465ecad }, { 0x9a486464a764a40b, 0x9a2fefdd0afd7384 }, { 0xf790c8c88dc88b16, 0xf75e1d791439e6cb },
+ { 0xedae91910f91187f, 0xed28a108726b627b }, { 0xd6b23e3e613e9723, 0xd67ad3cc711e2a45 }, { 0xcbd3bcbc6cbce06b, 0xcbe3bfe1aefbaffa }, { 0xb8cb2a2ad72a1ba9, 0xb82d1c09ed5eff4c },
+ { 0xe7ee8787c187548b, 0xe7fc2f8df8f5212c }, { 0x8d69f0f064f09fb7, 0x8d620d755f86b56c }, { 0x1f1e5252e552b513, 0x1f1cfbd2231d447a }, { 0xe44f3f3f5d3ff71c, 0xe4da12ec7a71616a },
+ { 0xf1117b7b767b0efb, 0xf11267bbd3f26647 }, { 0x80763d3d253d3762, 0x805953ac6caff734 }, { 0xbab4fafa3ffad9f2, 0xbaa88bf611a63e89 }, { 0x53e408082308863b, 0x5349c7c358fe1dbb },
+ { 0x291d3030ca30929a, 0x2975d7cf13414e1c }, { 0xfe716666df666475, 0xfeacae9d1c23e5da }, { 0x3fe2cccc7dccc8ea, 0x3f9b9ff938460977 }, { 0xe5915757295796d0, 0xe579b872040de0e9 },
+ { 0x9d17bfbf28bf402a, 0x9dc03f81b34a728b }, { 0xb35554546d543691, 0xb35a381219bc3d98 }, { 0xd1ede5e5eee57302, 0xd1950390c8a92b4a }, { 0x6fa77c7cc27ced46, 0x6ff4655be23c548a },
+ { 0xca0dd4d418d481a7, 0xca40157fd0872e79 }, { 0x46ba4c4c084c7fdc, 0x4681b294f17d1a96 }, { 0xb7ab37377e377127, 0xb793d52f228f7cd1 }, { 0xa60b10104610cf76, 0xa6924d45b03f3ab5 },
+ { 0x9277a2a281a22aa4, 0x927ef6a77c9bf116 }, { 0xb12a84848584f4ca, 0xb1dfafede544fc5d }, { 0x8a362b2beb2b7b96, 0x8a8ddd29e631b463 }, { 0x16fffcfcb7fc5a70, 0x16ee48362b07476b },
+ { 0xf92ebdbd50bd8054, 0xf9437ec1a594e4d5 }, { 0xa5aaa8a8daa86ce1, 0xa5b4702432bb7af3 }, { 0xaacab5b573b5066f, 0xaa0ab902fd6af96e }, { 0x8209ededcdedf539, 0x82dcc453905736f1 },
+ { 0x91d61a1a1d1a8933, 0x9158cbc6fe1fb150 }, { 0x7fd933338e3332db, 0x7f5657af0ef0936d }, { 0xf36eabab9eabcca0, 0xf397f0442f0aa782 }, { 0x199fe1e11ee130fe, 0x19508110e4d6c4f6 },
+ { 0x65e76a6a0c6aa1b2, 0x6520ebde68a217dd }, { 0x476424247c241e10, 0x4722180a8f019b15 }, { 0x9f686f6fc06f8271, 0x9f45a87e4fb2b34e }, { 0x44c59c9ce09cbd87, 0x4404256b0d85db53 },
+ { 0x2122f6f6ecf61c35, 0x2124ceb56527cc8e }, { 0x0b9e7e7eba7e2d38, 0x0b77241bf4e2c2d4 }, { 0x49da5151a1511552, 0x493f7bb23eac990b }, { 0xb9154242a3427a65, 0xb98eb69793227ecf },
+ { 0x9757a9a9e6a90cde, 0x9714b10439d431dc }, { 0x0f601d1da91d6a8e, 0x0fbec926cfd1839d }, { 0x315cb9b9a0b9c3a8, 0x3186fc4189eb0b69 }, { 0x41e5979787979bfd, 0x416e62c848ca1b99 },
+ { 0xfc0eb6b637b6a62e, 0xfc293962e0db241f }, { 0x899793937793d801, 0x89abe04864b5f425 }, { 0xa96b0d0def0da5f8, 0xa92c84637feeb928 }, { 0xde8df8f847f8198c, 0xde2bcab60778a8d7 },
+ { 0x2e42ebeb45eb76bb, 0x2e9a0793aaf64f13 }, { 0x94f611117a11af49, 0x94328c65bb50719a }, { 0xbe4a99992c999e44, 0xbe6166cb2a957fc0 }, { 0x4f5be2e25ae290bf, 0x4f730170f9671987 },
+ { 0xd76c56561556f6ef, 0xd7d979520f62abc6 }, { 0xc8720404f00443fc, 0xc8c582802c7fefbc }, { 0xda739b9b549b5e3a, 0xdae2278b3c4be99e }, { 0x3d9d1c1c951c0ab1, 0x3d1e0806c4bec8b2 },
+ { 0x20fc9e9e989e7df9, 0x2087642b1b5b4d0d }, { 0x7167464653463999, 0x714b3417bf5d9173 }, { 0x27a34545174599d8, 0x2768b477a2ec4c02 }, { 0xe950f2f21cf25fc9, 0xe9e14c3549582332 },
+ { 0xd80c4b4bbc4b9c61, 0xd867b074c0b3285b }, { 0x6a877777a577cb3c, 0x6a9e22f8a7739440 }, { 0x360362622f622789, 0x36692c1d305c0a66 }, { 0xfb516d6db86d420f, 0xfbc6e93e596c2510 },
+ { 0x3b1cafaf6eaf8f5c, 0x3b5272c40375483e }, { 0xc6cc71712d7148be, 0xc6d8e1389dd2eda2 }, { 0x73189696bb96fbc2, 0x73cea3e843a550b6 }, { 0x4a7be9e93de9b6c5, 0x4a1946d3bc28d94d },
+ { 0xbf94f1f158f1ff88, 0xbfc2cc5554e9fe43 }, { 0x7af93838e93814a1, 0x7a3c100c4bbf53a7 }, { 0x6dd8acac2aac2f1d, 0x6d71f2a41ec4954f }, { 0x9b960c0cd30cc5c7, 0x9b8c45437481f207 },
+ { 0xf2b0c3c3eac3ad6c, 0xf2345ada51762601 }, { 0x952879790e79ce85, 0x959126fbc52cf019 }, { 0x107e4f4f4c4fdf9d, 0x10a232f4ecccc7e7 }, { 0xbdeb2121b0213dd3, 0xbd475baaa8113f86 },
+ { 0x6c06c4c45ec44ed1, 0x6cd2583a60b814cc }, { 0x35a2dadab3da841e, 0x354f117cb2d84a20 }, { 0xbb6a92924b92b83e, 0xbb0b21686fdabf0a }, { 0x1cbfeaea79ea1684, 0x1c3ac6b3a199043c },
+ { 0x7599252540257e2f, 0x7582d92a846ed03a }, { 0x3c437474e1746b7d, 0x3cbda298bac24931 }, { 0x77e6f5f5a8f5bc74, 0x77074ed5789611ff }, { 0x56c403034403a041, 0x562380601db1dd71 },
+ { 0x9837b4b44fb46650, 0x98aa7822f605b241 }, { 0x075fdbdb8fdbe421, 0x07efd05cb9b7010f }, { 0x70b92e2e272e5855, 0x70e89e89c12110f0 }, { 0x155e44442b44f9e7, 0x15c87557a983072d },
+ { 0x8849fbfb03fbb9cd, 0x88084ad61ac975a6 }, { 0x2abc88885688310d, 0x2a53eaae91c50e5a }, { 0xb5d4e7e796e7b37c, 0xb51642d0de77bd14 }, { 0xf0cf131302136f37, 0xf0b1cd25ad8ee7c4 },
+ { 0x54bbd3d3acd3621a, 0x54a6179fe1491cb4 }, { 0x22834e4e704ebfa2, 0x2202f3d4e7a38cc8 }, { 0x083fc6c626c68eaf, 0x0851197a76668292 }, { 0xdbadf3f320f33ff6, 0xdb418d154237681d },
+ { 0xee0f29299329bbe8, 0xee0e9c69f0ef223d }, { 0x643902027802c07e, 0x6483414016de965e }, { 0xeaf14a4a804afc5e, 0xeac77154cbdc6374 }, { 0x7886e8e801e8d6fa, 0x78b987f3b7479262 },
+ { 0x5c8415158a15ecb5, 0x5cf70ee5972f9e26 }, { 0xeb2f2222f4229d92, 0xeb64dbcab5a0e2f7 }, { 0x28c35858be58f356, 0x28d67d516d3dcf9f }, { 0xe2ce8c8ca68c72f1, 0xe296682ebdbae1e6 },
+ { 0x611909091f09e604, 0x61e906e353915694 }, { 0x235d26260426de6e, 0x23a1594a99df0d4b }, { 0x1be03131f631f2a5, 0x1bd516ef182e0533 }, { 0x9cc9d7d75cd721e6, 0x9c63951fcd36f308 },
+ { 0x60c761616b6187c8, 0x604aac7d2dedd717 }, { 0x8cb798981098fe7b, 0x8cc1a7eb21fa34ef }, { 0x4e858a8a2e8af173, 0x4ed0abee871b9804 }, { 0x11a027273827be51, 0x1101986a92b04664 },
+ { 0xd24c5d5d725dd095, 0xd2b33ef14a2d6b0c }, { 0xe16f34343a34d166, 0xe1b0554f3f3ea1a0 }, { 0x5565bbbbd8bb03d6, 0x5505bd019f359d37 }, { 0x027fd0d0e8d0c25b, 0x028597fffcf8c1c5 },
+ { 0x74474d4d344d1fe3, 0x742173b4fa1251b9 }, { 0x09e1aeae52aeef63, 0x09f2b3e4081a0311 }, { 0xa08aa3a3bda34a9b, 0xa0de378777f4ba39 }, { 0x9eb60707b407e3bd, 0x9ee602e031ce32cd },
+ { 0x2f9c838331831777, 0x2f39ad0dd48ace90 }, { 0x571a6b6b306bc18d, 0x57802afe63cd5cf2 }, { 0x17219494c3943bbc, 0x174de2a8557bc6e8 }, { 0x33236969486901f3, 0x33036bbe7513caac },
+ { 0x0a401616ce164cf4, 0x0ad48e858a9e4357 }, { 0x3e3ca4a409a4a926, 0x3e383567463a88f4 }, { 0x84885e5e365e70d4, 0x8490be91579cb67d }, { 0x7da6e3e366e3f080, 0x7dd3c050f20852a8 },
+ { 0x62b8b1b183b14593, 0x62cf3b82d11516d2 }, { 0x04fe6363136347b6, 0x04c9ed3d3b334149 }, { 0xafeabebe14be2015, 0xaf60fea1b82539a4 }, { 0x01de6868746861cc, 0x01a3aa9e7e7c8183 },
+ { 0x5045b0b0bfb025ac, 0x506ffaa2da7a5dfd }, { 0x2b62e0e022e050c1, 0x2bf04030efb98fd9 }, { 0x5efbc5c562c52eee, 0x5e72991a6bd75fe3 }, { 0x81a85555515556ae, 0x81faf93212d376b7 },
+ { 0x99e9dcdc3bdc079c, 0x9909d2bc887933c2 }, { 0xae34d6d660d641d9, 0xaec3543fc659b827 }, { 0xab14dddd07dd67a3, 0xaba9139c831678ed }, { 0x6646d2d290d20225, 0x6606d6bfea26579b },
+ { 0xb6755f5f0a5f10eb, 0xb6307fb15cf3fd52 }, { 0xdf53909033907840, 0xdf88602879042954 }, { 0x1d6182820d827748, 0x1d996c2ddfe585bf }, { 0x7b2750509d50756d, 0x7b9fba9235c3d224 },
+ { 0x4cfa5a5ac65a3328, 0x4c553c117be359c1 }, { 0x900872726972e8ff, 0x90fb6158806330d3 }, { 0x13dff7f7d0f77c0a, 0x13840f956e4887a1 }, { 0x2402fdfd8bfd3a4f, 0x244e891620680c44 },
+ { 0x0cc1a5a535a5c919, 0x0c98f4474d55c3db }, { 0xc04dc2c2d6c2cd53, 0xc0949bfa5a196d2e }, { 0x83d78585b98594f5, 0x837f6ecdee2bb772 }, { 0xffaf0e0eab0e05b9, 0xff0f0403625f6459 },
+ { 0x38bd1717f2172ccb, 0x38744fa581f10878 }, { 0x37dd0a0a5b0a4645, 0x37ca86834e208be5 }, { 0xa154cbcbc9cb2b57, 0xa17d9d1909883bba }, { 0xdcf22828af28dbd7, 0xdcae5d49fb806912 },
+ { 0x93a9cacaf5ca4b68, 0x93dd5c3902e77095 }, { 0x7c788b8b128b914c, 0x7c706ace8c74d32b }, { 0x8ec84848f8483c20, 0x8e443014dd02f52a }, { 0xcc8c6767e367044a, 0xcc0c6fbd174caef5 },
+ { 0xe88e9a9a689a3e05, 0xe842e6ab3724a2b1 }, { 0x12019f9fa49f1dc6, 0x1227a50b10340622 }, { 0x267d2d2d632df814, 0x26cb1ee9dc90cd81 }, { 0x48043939d539749e, 0x489cd12c40d01888 },
+ { 0x0d1fcdcd41cda8d5, 0x0d3b5ed933294258 }, { 0xf5ef18186518494d, 0xf5db8a86e8c1270e }, { 0xd0338d8d9a8d12ce, 0xd036a90eb6d5aac9 }, { 0x8be843439f431a5a, 0x8b2e77b7984d35e0 },
+ { 0x32fd01013c01603f, 0x32a0c1200b6f4b2f }, { 0x6e791414b6148c8a, 0x6e57cfc59c40d509 }, { 0x25dc9595ff955b83, 0x25ed23885e148dc7 }, { 0xfa8f0505cc0523c3, 0xfa6543a02710a493 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x5bdbcece05ce0894, 0x5b18deb92e989f29 }, { 0xbc354949c4495c1f, 0xbce4f134d66dbe05 }, { 0xf8f0d5d524d5e198, 0xf8e0d45fdbe86556 }
+ }, {
+ { 0xc97c0997c50f5fab, 0xfe8781fdbd39c542 }, { 0xf81cdd05decea5bb, 0x2bccdfc36145de12 }, { 0x528c08391fcf1583, 0x1cd5129ea8ff1fca }, { 0xd22ec32c6699e50d, 0x065f052b24566639 },
+ { 0x059c2ebffab03e3a, 0x6528b62a3354fad2 }, { 0x927f47c7bbb29d4a, 0x0b1aef9062e3bba1 }, { 0x1435b8b96e85f8e8, 0x57a09da8cc936ece }, { 0x0d3fdf9aa98d31eb, 0x2c683a054b0aa9c1 },
+ { 0x36a457b585efb78f, 0x3373cb6ff1de85f6 }, { 0xd302746054d63dbe, 0xa657f5f72b2d5403 }, { 0x7d2238af5d286b0f, 0x546e7e5cdeb85d33 }, { 0x74ad7ec63c5abc6d, 0xbd2602afa99d3c1a },
+ { 0x563c91cad730f30a, 0xd9f5546894d0d722 }, { 0x2df69d0e26790d29, 0xcbab4fb968b1268d }, { 0xb5728674aa68ec17, 0x0ae10f7d6cfaaa4b }, { 0x1826d06ff54711b0, 0xdbc0577188e2f535 },
+ { 0xa4db10723e5d2ac5, 0x386924ff933d3e57 }, { 0xa06b8981f6a2cc4c, 0xfd496209af12f6bf }, { 0x96cfde34734d7bc3, 0xce3aa9665ecc7349 }, { 0x3338790a7f5f89b5, 0x565b7d45c28a7f24 },
+ { 0x0afb5cbd37a37c74, 0xca50af5466a83767 }, { 0xe7fe8e4db5a7f994, 0x16341de3c405b581 }, { 0xe34e17be7d581f1d, 0xd3145b15f82a7d69 }, { 0x49dec282bc59af25, 0xe40d96483190bcb1 },
+ { 0x3d73bc4480031348, 0x592b94e7980d80ab }, { 0xe899fc4f78b4bbda, 0xb94c049d91f97834 }, { 0x6c8baea9c91daddd, 0x66e655de217fc92f }, { 0xa2332419923cbfe9, 0x7e594172b1e492cb },
+ { 0xbb39433a553476ea, 0x0591e6df367d55c4 }, { 0x8ee90e5b860a6a73, 0x15fafe17d62e867c }, { 0xa9e4cfe897d01b2e, 0x14011efad8379796 }, { 0xf77baf0713dde7f5, 0x84b4c6bd34b913a7 },
+ { 0x50d4a5a17b516626, 0x9fc531e5b6097bbe }, { 0xbea56d85af8448d0, 0x60b950f50529af16 }, { 0x12dd8cd2c2e46dc4, 0x1190f825ee4ac252 }, { 0xc56f61415ecdb6f3, 0x72e74b24f9485eb9 },
+ { 0x77d964126a8b177b, 0x9e3ed108b8106a54 }, { 0x166d15210a1b8b4d, 0xd4b0bed3d2650aba }, { 0xef5d7f68e69af645, 0x5f7491ccbc5be692 }, { 0x6670f214febed1a9, 0xacb6fa8a47d7fe48 },
+ { 0x3e07a690d6d2b85e, 0x7a3347408980d6e5 }, { 0x479507cc430535d8, 0xeb7d7fea6b17433e }, { 0x5cc7cd77e0938f7e, 0x13a5fb3cf278e045 }, { 0x7369fde1a274f1f2, 0x5b1e97fe843fa2bc },
+ { 0x7ae6bb88c3062690, 0xb256eb0df31ac395 }, { 0x13f13b9ef0abb577, 0xb19808f9e131f068 }, { 0xec2965bcb04b5d53, 0x7c6c426badd6b0dc }, { 0xc61b7b95081c1de5, 0x51ff9883e8c508f7 },
+ { 0x8b7520e47cba5449, 0x70d2483de57a7cae }, { 0x83d6d1c12f875b98, 0x3992c4129d242fbd }, { 0x286ab3b1dcc93313, 0xae83f9935be5dc5f }, { 0xdd49b12eab8aa743, 0xa9271c5571aaab8c },
+ { 0xda8d320935a4eadc, 0x4f1f89045c08352a }, { 0x0bd7ebf105eca4c7, 0x6a585f8869d3055d }, { 0x294604fdee86eba0, 0x0e8b094f549eee65 }, { 0xebede69b2e6510cc, 0x9a54d73a80742e7a },
+ { 0xac78e1576d602514, 0x7129a8d0eb636d44 }, { 0x5a2ff91c4cf21a52, 0x55959eb1d0a14cd9 }, { 0x1fe253486b695c2f, 0x3df8c220a5406b93 }, { 0x405184ebdd2b7847, 0x0d45eabb46b5dd98 },
+ { 0x1b52cabba396baa6, 0xf8d884d6996fa37b }, { 0x88013a302a6bff5f, 0x53ca9b9af4f72ae0 }, { 0xf40fb5d3450c4ce3, 0xa7ac151a253445e9 }, { 0xe116ba2619c66cb8, 0x5004786ee6dc191d },
+ { 0xad54561b5f2ffda7, 0xd121580ce4185f7e }, { 0x8fc5b917b445b2c0, 0xb5f20ecbd955b446 }, { 0x7bca0cc4f149fe23, 0x125e1bd1fc61f1af }, { 0x34fcfa2de171c42a, 0xb063e814ef28e182 },
+ { 0x098f46696172d762, 0xe9487cf377256129 }, { 0x45cdaa54279b467d, 0x686d5c9175e1274a }, { 0xe5a623d5d1398a31, 0x95243e98daf3d1f5 }, { 0x53a0bf752d80cd30, 0xbcdde242a7842df0 },
+ { 0x39c325b748fcf5c1, 0x9c0bd211a4224843 }, { 0x62c06be736413720, 0x6996bc7c7bf836a0 }, { 0x1dbafed00ff72f8a, 0xbee8e15bbbb60fe7 }, { 0x3ab73f631e2d5ed7, 0xbf1301b6b5af1e0d },
+ { 0x818e7c594b19283d, 0xba82e76983d24bc9 }, { 0x6504e8c0a86f7abf, 0x8fae292d565aa806 }, { 0xbdd17751f955e3c6, 0x43a1835214a4f958 }, { 0x38ef92fb7ab32d72, 0x3c0322cdab597a79 },
+ { 0x5e9f60ef840dfcdb, 0x90b5d847ec8e8431 }, { 0x1a7e7df791d96215, 0x58d0740a96149141 }, { 0x35d04d61d33e1c99, 0x106b18c8e053d3b8 }, { 0x2479db67470bda4b, 0x22e3334a1f9447a4 },
+ { 0xceb88ab05b211234, 0x18bf14ac909b5be4 }, { 0xa683bdea5ac35960, 0xbb7907848dcb5a23 }, { 0xd5ea400bf8b7a892, 0xe067907a09f4f89f }, { 0x4d6e5b7174a649ac, 0x212dd0be0dbf7459 },
+ { 0x6da719e5fb52756e, 0xc6eea5022e04fb15 }, { 0x9f40985d123faca1, 0x2772d59529e91260 }, { 0xfd80f3ba247e9b81, 0x4ee469e9521124c0 }, { 0xb39ab21f0609793b, 0x4cd16af04e2306d7 },
+ { 0x7e56227b0bf9c019, 0x7776adfbcf350b7d }, { 0x701de735f4a55ae4, 0x7806445995b2f4f2 }, { 0x06e8346bac61952c, 0x4630658d22d9ac9c }, { 0xca08134393def4bd, 0xdd9f525aacb4930c },
+ { 0x2a321e29b85740b6, 0x2d93dae84513b82b }, { 0xa7af0aa6688c81d3, 0x1b71f75882b06819 }, { 0x6917801633ad93e7, 0x03cee3f4122b33fd }, { 0x9adcb6e2e88f929b, 0x425a63bf1abde8b2 },
+ { 0x2fae309642e77e8c, 0x48bb6cc2764742f9 }, { 0x9d1835c576a1df04, 0xa462f6ee371f7614 }, { 0x7992a15c95d78d86, 0x914e38aae29795db }, { 0x9027ea5fdf2ceeef, 0x880acceb7c15dfd5 },
+ { 0xfcac44f616314332, 0xeeec99355d6a16fa }, { 0xe03a0d6a2b89b40b, 0xf00c88b2e9a72b27 }, { 0xb1c21f8762970a9e, 0xcfc1498b50d562a3 }, { 0x4b866f1ad8c7dc80, 0x671db5332f66d8c5 },
+ { 0x55488b1e81e1581c, 0xfaed87cf855d816c }, { 0xae204ccf09fe56b1, 0xf2398babf5950930 }, { 0x23bd5840d92597d4, 0xc4dba61b3236d902 }, { 0xc1dff8b29632507a, 0xb7c70dd2c5679651 },
+ { 0x15190ff55cca205b, 0xf7a86d74c3e85cf4 }, { 0x304c63de298e22a3, 0x7543aee2d307296a }, { 0x9353f08b89fd45f9, 0xab121f4c6d98899b }, { 0x4aaad856ea880433, 0xc71545ef201deaff },
+ { 0x5fb3d7a3b6422468, 0x30bd289be3f5b60b }, { 0x48f275ce8e167796, 0x440566943eeb8e8b }, { 0xf657184b21923f46, 0x24bc36613bc2219d }, { 0xaf0cfb833bb18e02, 0x52317b77faee3b0a },
+ { 0xa1473ecdc4ed14ff, 0x5d4192d5a069c485 }, { 0x51f812ed491ebe95, 0x3fcdc139b9724984 }, { 0x3b9b882f2c628664, 0x1f1bf16abad42c37 }, { 0xc443d60d6c826e40, 0xd2efbbf8f6336c83 },
+ { 0x72454aad903b2941, 0xfb1667228b449086 }, { 0x03741ad456d1ab16, 0x2318d3a7118d564e }, { 0xcb24a40fa1912c0e, 0x7d97a286a3cfa136 }, { 0x57102686e57f2bb9, 0x79fda4b49babe518 },
+ { 0x0e4bc54eff5c9afd, 0x0f70e9a25a87ff8f }, { 0xdba1854507eb326f, 0xef1779d853730710 }, { 0xcce027283fbf6191, 0x9baf37d78e6d3f90 }, { 0x0258ad98649e73a5, 0x8310237b1ef66474 },
+ { 0xf2e781b8e96dd9cf, 0xe19c709707ede975 }, { 0xc737ccd93a53c556, 0xf1f7685fe7be3acd }, { 0x4e1a41a52277e2ba, 0x023503191c322217 }, { 0x1085214aa67a1e61, 0x9280db5ef0bca626 },
+ { 0xc850bedbf7408718, 0x5e8f7121b242f778 }, { 0x683b375a01e24b54, 0xa3c613281d5001c7 }, { 0xabbc6270f34e688b, 0x97113d81c6c1f3e2 }, { 0x98841b7a8c11e13e, 0xc14a40c4044b8cc6 },
+ { 0xa31f9355a073675a, 0xde51b1aebe9fa0f1 }, { 0x44e11d1815d49ece, 0xc865ac4d7a9a1570 }, { 0x58775484286c69f7, 0xd685bdcace5728ad }, { 0x11a996069435c6d2, 0x32882b82ffc7941c },
+ { 0xe48a9499e3765282, 0x352cce44d588e3cf }, { 0x012cb74c324fd8b3, 0xa008f0dc0f7b323a }, { 0x853ee5aa83e6ceb4, 0x7fa2a19fbffd8321 }, { 0x8cb1a3c3e29419d6, 0x96eadd6cc8d8e208 },
+ { 0x5b034e507ebdc2e1, 0xf59d6e6ddfda7ee3 }, { 0x20c942948ff43cc2, 0xe7c375bc23bb8f4c }, { 0x270dc1b311da715d, 0x01fbe0ed0e1911ea }, { 0x8a5997a84ef58cfa, 0xd0dab8e1ea014e94 },
+ { 0xb45e3138982734a4, 0xaae9ffa163819871 }, { 0x4c42ec3d46e9911f, 0x8125206202c44663 }, { 0x64285f8c9a20a20c, 0x2fa6d9f159219a3c }, { 0xb6069ca0fcb94701, 0x29f9dcda7d77fc05 },
+ { 0xb0eea8cb50d8d22d, 0x6fc9b9575fae5099 }, { 0x2291ef0ceb6a4f67, 0x64d356c73d4deb38 }, { 0x42092973b9b50be2, 0x8e55c9c05843b9ec }, { 0x4f36f6e910383a09, 0xa23df3c51349102d },
+ { 0x71315079c6ea8257, 0xd80eb4859ac9c6c8 }, { 0x87664832e778bd11, 0xfcb282e4a10be755 }, { 0x9c34828944ee07b7, 0x046a06323864442e }, { 0xc387552af2ac23df, 0x34d72ea9db91f225 },
+ { 0xf0bf2c208df3aa6a, 0x628c53ec191b8d01 }, { 0x63ecdcab040eef93, 0xc99e4ca07483049a }, { 0xffd85e2240e0e824, 0xcdf44a924ce740b4 }, { 0xeac151d71c2ac87f, 0x3a5c27e68f0f1c40 },
+ { 0x949773ac17d30866, 0x4d2a8a1d403a173d }, { 0x1741a26d385453fe, 0x74b84e0fdd1e3880 }, { 0x841252e6b1a91607, 0xdfaa5143b086b11b }, { 0x595be3c81a23b144, 0x768d4d16c12c1a97 },
+ { 0x2e8287da70a8a63f, 0xe8b39c1e793c70c3 }, { 0x25556c2b754402f8, 0x82ebc39610ef759e }, { 0x3214ce464d105106, 0xf6538d99cdf14d1e }, { 0xd9f928dd637541ca, 0x6c075aa34d856364 },
+ { 0xfb68c7d1881f0ead, 0x08d40c6470c8885c }, { 0x82fa668d1dc8832b, 0x999a34ce925f1d87 }, { 0xe262a0f24f17c7ae, 0x731cabc9f7514f53 }, { 0xcdcc90640df0b922, 0x3ba7c70b81160daa },
+ { 0x1c96499c3db8f739, 0x1ee01187b4cd3ddd }, { 0x7581c98a0e1564de, 0x1d2ef273a6e60e20 }, { 0xfa44709dba50d61e, 0xa8dcfcb87fb3ba66 }, { 0xd0766eb4020796a8, 0x854f26503aa0024d },
+ { 0x0c1368d69bc2e958, 0x8c60cad944719bfb }, { 0xb2b605533446a188, 0xecd99a2c415834ed }, { 0x2cda2a421436d59a, 0x6ba3bf6567ca14b7 }, { 0xe9b54b034afb6369, 0x1944f4419e824a0e },
+ { 0x9bf001aedac04a28, 0xe252936315c6da88 }, { 0x8d9d148fd0dbc165, 0x36e22db0c7a3d032 }, { 0x95bbc4e0259cd0d5, 0xed227ac14f412507 }, { 0xf3cb36f4db22017c, 0x4194804b0896db4f },
+ { 0x7c0e8fe36f67b3bc, 0xf4668e80d1c36f09 }, { 0xaa90d53cc101b038, 0x3719cd5dc9bac1d8 }, { 0xb961eea231aa054f, 0x8681c5a4288b31b0 }, { 0xed05d2f0820485e0, 0xdc64b2b7a2ad82e6 },
+ { 0xe6d2390187e82127, 0xb63ced3fcb7e87bb }, { 0xa5f7a73e0c12f276, 0x9861d4239c460c6d }, { 0x6ed30331ad83de78, 0xe5f676a53f89ad5b }, { 0x04b099f3c8ffe689, 0xc52046f63c2fc8e8 },
+ { 0x99a8ac36be5e398d, 0x6142b0180b30befc }, { 0x54643c52b3ae80af, 0x5ae577138a26b356 }, { 0x07c483279e2e4d9f, 0xe63895512da29ea6 }, { 0xd69e5adfae660384, 0xc37f43dd1879aed1 },
+ { 0xdf111cb6cf14d4e6, 0x2a373f2e6f5ccff8 }, { 0x6a639ac2657c38f1, 0x20d6305303a665b3 }, { 0xbf89dac99dcb9063, 0xc0b1a0290a529d2c }, { 0x43259e3f8bfad351, 0x2e5d391c57388bd6 },
+ { 0x76f5d35e58c4cfc8, 0x3e3621d4b76b586e }, { 0x190a6723c708c903, 0x7bc8a7ad8799c70f }, { 0x3f2b11dce49d60ed, 0xda3bb79c86fbe4df }, { 0x97e369784102a370, 0x6e3259ba51b74173 },
+ { 0x3788e0f9b7a06f3c, 0x937b3bb3fea5b7cc }, { 0x80a2cb157956f08e, 0x1a8a17b58ca979f3 }, { 0xf1939b6cbfbc72d9, 0xc284a3301660bf3b }, { 0x3160d4921bc1fa10, 0xd54b5e3edc7c1b50 },
+ { 0x675c4558ccf1091a, 0x0cbe0a5648accc72 }, { 0xa8c878a4a59fc39d, 0xb409ee26d74ca5ac }, { 0x262176ff2395a9ee, 0xa1f31031016223d0 }, { 0x6fffb47d9fcc06cb, 0x45fe867930f29f61 },
+ { 0xfef4e96e72af3097, 0x6dfcba4e439c728e }, { 0xc0f34ffea47d88c9, 0x17cffd0eca1ca46b }, { 0xd8d59f91513a9979, 0xcc0faa7f42fe515e }, { 0xb72a2beccef69fb2, 0x89f12c06720cce3f },
+ { 0x78be1610a7985535, 0x3146c876edeca7e1 }, { 0xc2abe266c0e3fb6c, 0x94dfde75d4eac01f }, { 0x1ecee4045926849c, 0x9df032fcaa3b59a9 }, { 0xd15ad9f830484e1b, 0x2547d68c35db3077 },
+ { 0x2b1ea9658a189805, 0x8d9b2a344a688a11 }, { 0xf523029f77439450, 0x07a4e5c62a4f77d3 }, { 0xdc65066299c57ff0, 0x092fec897ed199b6 }, { 0x08a3f125533d0fd1, 0x49408c2f785e5313 },
+ { 0x9e6c2f1120707412, 0x877a25492692205a }, { 0xcf943dfc696eca87, 0xb8b7e4709fe069de }, { 0xf9306a49ec817d08, 0x8bc42f1f6e3eec28 }, { 0xba15f476677bae59, 0xa5991603390667fe },
+ { 0xb84d59ee03e5ddfc, 0x2689357827f0038a }, { 0xd4c6f747caf87021, 0x406f60a6068fcaa5 }, { 0x6098c67f52df4485, 0xea869f07650e52d4 }, { 0xde3dabfafd5b0c55, 0x8a3fcff26027fdc2 },
+ { 0x0f677202cd13424e, 0xaf78197e55fccdb5 }, { 0x892d8d7c182427ec, 0xf3c26b46fb8c18da }, { 0x3c5f0b08b24ccbfb, 0xf923643b9776b291 }, { 0x61b4713360909c36, 0x4a8e6fdb6a7560ee },
+ { 0xbcfdc01dcb1a3b75, 0xe3a9738e1bdfcb62 }, { 0xd7b2ed939c29db37, 0x6377b30117029ceb }, { 0x910b5d13ed63365c, 0x28023c37736eedef }, { 0xee71c824d4d52ef6, 0xff7c6110b320d4a8 },
+ { 0x417d33a7ef64a0f4, 0xad4d1a6749ceefa2 }, { 0x5deb7a3bd2dc57cd, 0xb3ad0be0fd03d27f }, { 0x46b9b080714aed6b, 0x4b758f36646c7104 }, { 0x864aff7ed53765a2, 0x5cba7238ae70d56f },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x7f7a953739b618aa, 0xd77e5d27c04e3947 }, { 0x21e5f5d8bdbbe471, 0x47cb85602cc0bd76 }, { 0x6b4f2d8e5733e042, 0x80dec08f0cdd5789 }
+ }, {
+ { 0xa5f8edb8b8bf36c2, 0x5c52844aa52d6aff }, { 0x2d380a9a9ad18b95, 0x4ddb24972d2fc673 }, { 0x32db72eded5430a6, 0x972657bc3228a762 }, { 0x8f5c58535312cf27, 0xc84a72e18f49071d },
+ { 0x0efbbde2e2f8e4e0, 0x714567780e9695e1 }, { 0x30fe4d0c0c315186, 0x067c812e309857c3 }, { 0x386ab10e0e661606, 0x07d75f23381d1102 }, { 0xc07ef73030c4875d, 0x183341b8c0259f8a },
+ { 0x548ba91515993109, 0xeb302f9554c8da07 }, { 0xe604c0d8d8f4fb78, 0x6c3406f9e6679728 }, { 0x9e449dc6c66f90f4, 0x63f266b29ed8f3ed }, { 0x39994f9f9fb5c716, 0xaefa346a394569b3 },
+ { 0x55785784844ae019, 0x421d44dc5590a2b6 }, { 0x7e2f1cfefe34c8ec, 0x7f28d93e7eacb7e5 }, { 0x52e4e8f5f5369269, 0x9bde96e052db0927 }, { 0x914cdeb5b544a504, 0xbb9a6a8391161ebd },
+ { 0x6475e41919a8608f, 0xed4caebb64508dc4 }, { 0x03d6c17070b6b030, 0x3877bddb03e88810 }, { 0x575d6865652f8139, 0xd347924e57205217 }, { 0x5a7014f7f761d5e9, 0x9a7548ed5a5e4fe6 },
+ { 0x1c35b90707330b03, 0xe28acef01cefe901 }, { 0x603f9a181862a2cf, 0x0cf8c15c60f3ae45 }, { 0x079cbf71717c7270, 0xd9c3d23c074bab91 }, { 0x187fc70606f9c943, 0x033ea117184cca80 },
+ { 0x21e68899994c0e55, 0xadc4957d2109a333 }, { 0x72f19efdfda94d2c, 0x9f3768d4728ad2a5 }, { 0xa8d5912a2af16212, 0x15605ee9a853770e }, { 0xd16632a5a5b9d88e, 0xb38b55ebd1b46b7a },
+ { 0x2972749b9b1b49d5, 0xac6f4b70298ce5f2 }, { 0xc611b6d0d06b243d, 0x68ddf8cdc6364caa }, { 0xa40b1329296ce7d2, 0xf57fef03a475124e }, { 0x3ff60e7f7f1a6476, 0xde148d1f3f56ba93 },
+ { 0xe06b8138385b5818, 0x1cdabf8ce0744408 }, { 0x2789c97979e3ad35, 0xdd2a2c08271a7013 }, { 0x8d7967b2b277ae07, 0x5910a4738df9f7bc }, { 0x0cde8203039d85c0, 0xe01fb1ea0c266540 },
+ { 0x827124c1c15c9bf7, 0x8178a84282371aec }, { 0xeada42dbdb697eb8, 0x8c2bb713ea41f268 }, { 0xaebad0caca5ec172, 0x658ee79cae40a42e }, { 0xb4e0282d2dc26911, 0xf7ea9019b4bc9e0f },
+ { 0x9a0ee3c7c7a552b4, 0x824609559a7bd06c }, { 0x63e95b6868d412ff, 0x348f7c87631b2655 }, { 0x494dee838379eb1a, 0xa0978a2c497f4bb7 }, { 0xe5d201a8a8424b48, 0x5443bb22e58f1f38 },
+ { 0x420fd3f1f1981caa, 0x994be9fa42128566 }, { 0xe421ff3939919a58, 0xfd6ed06be4d76789 }, { 0x1552bb9494b79d93, 0x4a0c7bb41532d771 }, { 0xb736e95d5d74d921, 0xcf9d2dc2b754161f },
+ { 0xc8ea0b323293c0dd, 0x19989fb5c8a0d94b }, { 0x066f41e0e0afa360, 0x70eeb9750613d320 }, { 0x70d4a11c1ccc2c0c, 0x0e6dbe46703a2204 }, { 0x9d925cb6b6d920c4, 0x5b85db699d307bfd },
+ { 0x41d91281812eac9a, 0xa13c542141fa0d76 }, { 0x756d218c8cd53f5c, 0x46f4bae875c17934 }, { 0x198c3997972a1853, 0xaa13ca5e1914b231 }, { 0xc919f5a3a34011cd, 0xb0b5f4fcc9f8a1fa },
+ { 0xaaf0aecbcb940332, 0x843a887baae387af }, { 0xfc5e383f3f68531b, 0xfe50717cfc9bad09 }, { 0x4d07908282b3295a, 0x4123e5cb4ddc6836 }, { 0xbfa2155f5f239ea1, 0xce36f3cfbfd150de },
+ { 0x2aa4b5ebebadf9e5, 0x9418f6ab2a646de2 }, { 0x7302606c6c7a9c3c, 0x361a039d73d2aa14 }, { 0x841e652121f33897, 0xf19611378424c9cc }, { 0xd52c4ca4a4731ace, 0x523f3a0cd51748fb },
+ { 0xc3a836404072376d, 0x2044fc63c3cd179a }, { 0xaf492e5b5b8d1062, 0xcca38cd5af18dc9f }, { 0x2b574b7a7a7e28f5, 0x3d359de22b3c1553 }, { 0x863b5ac0c09659b7, 0x60ccc7a58694396d },
+ { 0xa7ddd25959da57e2, 0xcd0852d8a79d9a5e }, { 0xb159a8bdbddb7a41, 0xbf7394b7b147c53f }, { 0xb28f69cdcd6dca71, 0x8704296cb2af4d2f }, { 0x5b83ea6666b204f9, 0x335823a45b063757 },
+ { 0x4645adf0f052deea, 0x78ff861d46b1a6e7 }, { 0xd3430d4444dcb9ae, 0x22d18379d3049bdb }, { 0x9fb7635757bc41e4, 0xcadf0dfb9f808b5c }, { 0xfdadc6aeaebb820b, 0x577d1a35fdc3d5b8 },
+ { 0xd4dfb23535a0cbde, 0xfb125145d44f304a }, { 0x0f084373732b35f0, 0xd8680c310fceed50 }, { 0x9c61a227270af1d4, 0xf2a8b0209c68034c }, { 0x2f1d357b7bb4eab5, 0xdc81f2052f9f36d2 },
+ { 0x9bfd1d56567683a4, 0x2b6b621c9b23a8dd }, { 0x43fc2d60604bcdba, 0x306682b3434afdd7 }, { 0xef63c24b4b706de8, 0xc4b2b3bdefbaa958 }, { 0xd9f2cea7a7ee9f0e, 0xb2208be6d9312dbb },
+ { 0x79b3a38f8f48ba9c, 0xa6eb0b0279e71c74 }, { 0xb6c517cccca70831, 0x66b0468bb60c6eae }, { 0x5317166464e54379, 0x32f3fda953837196 }, { 0x7fdce26f6fe719fc, 0xd605b2777ff4cf54 },
+ { 0xc18d09a1a117564d, 0xb11e2af1c17de73b }, { 0xf080ba3c3cf5d6db, 0x1e4fc096f0bdc849 }, { 0x23c3b77878296f75, 0x3c9e43ef23b95392 }, { 0xe7f73e4949272a68, 0xc5196db0e73fef99 },
+ { 0x25acf6989886cc15, 0x4c70fa9a25aa80b2 }, { 0x5e3a6af6f6ab17a9, 0x7bc1270a5efd6c67 }, { 0xb513d6bcbc11b801, 0x5ec7fb50b5e4e6be }, { 0x1e1086e6e6566a23, 0x73d018621e5f19a0 },
+ { 0xa26452c9c9c344b2, 0x85915676a266c16e }, { 0xdf9d8f4747413c6e, 0xc2ce3293df22fe9b }, { 0xa62e2cc8c80986f2, 0x64253991a6c5e2ef }, { 0xfe7b07dede0d323b, 0x6f0aa7eefe2b5da8 },
+ { 0xac9fef2b2b3ba052, 0xf4d4310eacf0548f }, { 0x223049e9e9fabe65, 0x95b328a622e12b23 }, { 0xf9e7b8afaf71404b, 0xb6c975d2f960f639 }, { 0xe24ebed9d93e3938, 0x8d80691ee2c4b4a9 },
+ { 0x4a9b2ff3f3cf5b2a, 0x98e037f74a97c3a7 }, { 0xbc74d42f2f952e91, 0xf6414e14bc39d8ce }, { 0x3547cd9c9c2842d6, 0x4ee5858035630cf3 }, { 0xcacf34d3d3f6a1fd, 0x88c24927ca1029ea },
+ { 0xee903cdadaa3bcf8, 0x6d9fd8f4eee2d1e9 }, { 0x78405d1e1e9b6b8c, 0x0fc6604b78bf64c5 }, { 0x05b9809090191350, 0x489904ae05fb5b30 }, { 0x6b7da76a6a83557f, 0x3524a28a6b9e6094 },
+ { 0x5132298585802259, 0xa3a92b3b51338137 }, { 0xe1987fa9a9888908, 0xb5f7d4c5e12c3cb9 }, { 0x59a6d58787d765d9, 0xa202f53659b6c7f6 }, { 0xa397ac58581095a2, 0x2cbc3d3fa33eb9df },
+ { 0xf2a585dddd90b7fb, 0x8f151604f20d38e8 }, { 0x71275f8d8d1ffd1c, 0xa740d50f71625ab5 }, { 0x56ae96f4f4fc5029, 0x7a6af90756782aa6 }, { 0x1118c595957d5fd3, 0xabb814531191f4f0 },
+ { 0x6a8e59fbfb50846f, 0x9c09c9c36ac61825 }, { 0x893319b3b3bd6c47, 0xb8a4cb94895ad43d }, { 0x94f55e25255db654, 0xf3036e2d94ed458d }, { 0x65861a88887bb19f, 0x4461c5f26508f575 },
+ { 0x8c8a992323a47f17, 0xf03dcf3a8ca18f0d }, { 0xbbe86b5e5ee95ce1, 0x2f829c28bb72735f }, { 0x77481e6d6db05e7c, 0xd7ae6c7a77718995 }, { 0x3c20cf0f0facd446, 0xe66330c43cbe3283 },
+ { 0x7b969c6e6e2ddbbc, 0x37b1dd907b57ecd5 }, { 0x28818a0a0ac898c5, 0x0542203928d49d43 }, { 0xab03505a5a47d222, 0x2d17e332abbbff1e }, { 0xd2b0f3d5d50f68be, 0x8bfce830d25ce36a },
+ { 0x310db39d9de28096, 0xaf51ea6731c02f72 }, { 0xde6e71d6d692ed7e, 0x6be359dade7a862a }, { 0xc4348931310e451d, 0xf9872e5fc486bc0b }, { 0x5fc994676778c6b9, 0xd2ec4c435fa514d6 },
+ { 0xcca075333359029d, 0xf82cf052cc03faca }, { 0xcf76b44343efb2ad, 0xc05b4d89cfeb72da }, { 0x76bbe0fcfc638f6c, 0x7e8307337629f124 }, { 0x2ccbf40b0b025a85, 0xe4f64fde2c77bec2 },
+ { 0xb83eaa2e2e5fecd1, 0x17f521f3b89afb4f }, { 0xd8013036363d4e1e, 0x1b0de0afd869550a }, { 0x2eeecbeaea673ba5, 0x75ac994c2ec74e63 }, { 0x36910cecec9ef2e6, 0x7692385b368b84e3 },
+ { 0xdbd7f146468bfe2e, 0x237a5d74db81dd1a }, { 0x6958988b8be6345f, 0xa47e7418692e9035 }, { 0xb37c975c5cbe1b61, 0x2e294225b3f7359e }, { 0x14a1450505644c83, 0xe32110fd146aafc0 },
+ { 0x9506a0b4b48e6744, 0x5a2e056495b53d3c }, { 0xbe51ebcecef04fb1, 0x671b9886be89286f }, { 0x621aa5f9f907c3ef, 0x9da217ce62435ee4 }, { 0xa1b293b9b975f482, 0xbde6ebada18e497e },
+ { 0x3bbc707e7ed0a636, 0x3fa0e2f83bf59912 }, { 0x16847ae4e4012da3, 0x727bc66f16da5f61 }, { 0x6650dbf8f8cd01af, 0x7c16782966e07d65 }, { 0xe90c83ababdfce88, 0xb45c0ac8e9a97a78 },
+ { 0x5c1f551717ce7689, 0xea9bf1985c4d9cc6 }, { 0x6ce1181b1bff270f, 0xece770b66cd5cb05 }, { 0x6d12e68a8a2cf61f, 0x45ca1bff6d8db3b4 }, { 0xad6c11babae87142, 0x5df95a47ada82c3e },
+ { 0x3762f27d7d4d23f6, 0xdfbf531237d3fc52 }, { 0x61cc648989b173df, 0xa5d5aa1561abd6f4 }, { 0x4b68d162621c8a3a, 0x31cd5cbe4bcfbb16 }, { 0xb9cd54bfbf8c3dc1, 0xbed84abab9c283fe },
+ { 0xe3bd404848ede828, 0x24ad0257e39ccc18 }, { 0xba1b95cfcf3a8df1, 0x86aff761ba2a0bee }, { 0xf17344adad2607cb, 0xb762abdff1e5b0f8 }, { 0xa0416d2828a62592, 0x14cb80e4a0d631cf },
+ { 0x85ed9bb0b020e987, 0x58bb7a7e857cb17d }, { 0x8382da50508f4ae7, 0x2855c30b836f625d }, { 0xda240fd7d7582f3e, 0x8a57363ddad9a5ab }, { 0x47b6536161810ffa, 0xd1d2ed5447e9de56 },
+ { 0xc5c777a0a0dd940d, 0x50aa4516c5dec4ba }, { 0xb0aa562c2c08ab51, 0x165efffeb01fbd8e }, { 0x33288c7c7c87e1b6, 0x3e0b3cf53370dfd3 }, { 0xfa3179dfdfc7f07b, 0x8ebec809fa887e29 },
+ { 0x96d061c4c438d774, 0x6259b8bf965db52c }, { 0x6f37d96b6b49973f, 0xd490cd6d6f3d4315 }, { 0x6ec427fafa9a462f, 0x7dbda6246e653ba4 }, { 0xc25bc8d1d1a1e67d, 0x8969972ac2956f2b },
+ { 0xf6effbdcdc5a75bb, 0x6ea179e3f6ae1b69 }, { 0x50c1d7141453f349, 0x0a844072506bf986 }, { 0xff88f94f4fdee32b, 0xc627cca7ff732519 }, { 0x5decab86861da799, 0x43b69ad15d15e477 },
+ { 0xa9266fbbbb22b302, 0xbc4d35a0a90b0fbf }, { 0x8eafa6c2c2c11e37, 0x616719a88e117fac }, { 0x1777847575d2fcb3, 0xdb56ad26178227d0 }, { 0x1ba90676764f7973, 0x3b491ccc1ba44290 },
+ { 0x97239f5555eb0664, 0xcb74d3f69705cd9d }, { 0x7df9dd8e8e8278dc, 0x475f64e57d443ff5 }, { 0xecb5033b3bc6ddd8, 0xfcc50e66ec522148 }, { 0x58552b161604b4c9, 0x0b2f9e7f58eebf47 },
+ { 0xf71c054d4d89a4ab, 0xc78c12aaf7f663d8 }, { 0x1fe378777785bb33, 0xdafd732b1f076111 }, { 0xfbc2874e4e14216b, 0x2793a340fbd00698 }, { 0x7c0a231f1f51a9cc, 0xee720fac7c1c4744 },
+ { 0x0967029393849690, 0xa886b54409dd3e70 }, { 0x0d2d7c92924e54d0, 0x4932daa30d7e1df1 }, { 0x7a6562fffffe0aac, 0x9e9cb6d97a0f9464 }, { 0x67a32569691ed0bf, 0xd53b136067b805d4 },
+ { 0x45936c8080e46eda, 0x40883bc645592ef7 }, { 0x87c8a451514588a7, 0xc9e1acec87cc41dc }, { 0xdc4b4e3737f78c5e, 0xfab98f48dcca768b }, { 0xe8ff7d3a3a0c1f98, 0x1d716181e8f102c9 },
+ { 0x4f22af6363d6487a, 0xd07933594f6c9897 }, { 0x1dc6479696e0da13, 0x4ba7a5b91db791b0 }, { 0x4ed151f2f205996a, 0x795458104e34e026 }, { 0x044a7e0101cac240, 0xe1b46fe704a32381 },
+ { 0xeb29bc4a4abaafa8, 0x2506dc5aeb198ad9 }, { 0xf814463e3ea2915b, 0x1fe41e9bf8388e88 }, { 0xf3567b4c4c4366eb, 0x26387d4df3554059 }, { 0x3e05f0eeeec9b566, 0x7739e6563e0ec222 },
+ { 0x3dd3319e9e7f0556, 0x4f4e5b8d3de64a32 }, { 0xbd872abebe46ff81, 0x5f6c255dbd61a07f }, { 0x8ae5d8c3c30bdc77, 0x80d3764f8ab25c2d }, { 0x88c0e722226ebd57, 0x1189a0dd8802ac8c },
+ { 0xddb8b0a6a6245d4e, 0x5394e401dd920e3a }, { 0xcd538ba2a28ad38d, 0x51019b1bcd5b827b }, { 0x0b423d7272e1f7b0, 0x39dc63d60b6dced1 }, { 0x133dfa7474183ef3, 0x3ae2c2c113210451 },
+ { 0x982bdc2626c03394, 0x131cdfc798cb20cd }, { 0x02253fe1e1656120, 0x915ad69202b0f0a1 }, { 0x9369e1545421c424, 0x2ac0bc1193a6ee1c }, { 0x80541b202039fad7, 0x10227ed08087ea4d },
+ { 0x90bf202424977414, 0x12b701ca904e660c }, { 0xd095cc34346a099e, 0x1aa63ea2d0ec13cb }, { 0x245f080909551d05, 0xe55d91d324f2f803 }, { 0x34b4330d0dfb93c6, 0xe7c8eec9343b7442 },
+ { 0xcb3cca42422570ed, 0x21ef226ecb48515b }, { 0xed46fdaaaa150cc8, 0x55e8652fed0a59f9 }, { 0xf4cac43d3d3f149b, 0xfffbaf71f41eebc8 }, { 0xce854ad2d23c63bd, 0x697626c0ceb30a6b },
+ { 0x99d822b7b713e284, 0xba31b48e9993587c }, { 0x10eb3b0404ae8ec3, 0x02957f1a10c98c41 }, { 0x446092111137bfca, 0xe9a5508f44015646 }, { 0x402aec1010fd7d8a, 0x08113f6840a275c7 },
+ { 0x929a1fc5c5f21534, 0x83edd75892fe96ad }, { 0x3a4f8eefef037726, 0x968d89b13aade1a3 }, { 0x01f3fe9191d3d110, 0xa92d6b49015878b1 }, { 0x267a37e8e8307c25, 0x74074741264208a2 },
+ { 0x12ce04e5e5cbefe3, 0x93cfa98812797ce0 }, { 0x1a5af8e7e79ca863, 0x926477851afc3a21 }, { 0x48be101212aa3a0a, 0x09bae16548273306 }, { 0x68ab661a1a35e54f, 0x0d531f516876e884 },
+ { 0xf5393aacacecc58b, 0x56d6c438f5469379 }, { 0x81a7e5b1b1ea2bc7, 0xb90f159981df92fc }, { 0x8b16265252d80d67, 0x29fe1d068bea249c }, { 0xc7e2484141b8f52d, 0xc1f09384c76e341b },
+ { 0xd6fa8dd4d4c5aafe, 0x6a4887d7d6ffc0eb }, { 0x20157608089fdf45, 0x04e9fe342051db82 }, { 0x0ab1c3e3e33226a0, 0x90f1089f0a35b660 }, { 0x0894fc0202574780, 0x01abde0d088546c1 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x4cf46e131360f84a, 0xe80e8e824c841087 }, { 0xd709734545167bee, 0xc365ec9ed7a7b85a }, { 0x749edf1d1d06ee4c, 0xefd9d1a174990185 }
+ }, {
+ { 0xaf9c5ba61820cad8, 0x8c3b858c801dd978 }, { 0x186806c54c511069, 0xa1f57ca187b731bf }, { 0xb8cd2eb09a1bd0c0, 0x210329216cdfbeb7 }, { 0x61d989a2abe6ffba, 0xaa6069aa1edca142 },
+ { 0x6f5a6b413ded4a16, 0xcd9fe3cd32ec92c9 }, { 0xecd33bab52790987, 0x0eb0490e273c4fd9 }, { 0x7fab6fc7f432eb58, 0xb2390ab2c8360da2 }, { 0x36caece98b272459, 0x3885e7389cf0ffe2 },
+ { 0x5f8a6708a54f6ac4, 0x4cb61b4cff41f074 }, { 0xc3cb40b7cd6e826a, 0xfcf288fc7b3ee47f }, { 0xae26ca9640417505, 0xe709dfe7c758bc83 }, { 0x55a4842b9003669a, 0x44813a440ca69495 },
+ { 0x75858ce4c17ee706, 0xba0e2bba3bd16943 }, { 0x91cfb50c16895fa6, 0x6aedf76a6180884e }, { 0xa3a858253ee9c20d, 0x3da0bb3d22a720c6 }, { 0xeb734a3b199db2d1, 0xdc2e0cdc3124b77d },
+ { 0xb3595ca3f7366343, 0x42065242d87dbfad }, { 0x7e11fef7ac535485, 0xd90b50d98f736859 }, { 0x219b99ff091c3e41, 0x95bd4b957032982d }, { 0x30d00c4998a220d2, 0x8129f881cdad62bd },
+ { 0xdeb4d6827a19942c, 0x59fd0559641be751 }, { 0x1b657695a4f212cd, 0x1ca3921c4e789e71 }, { 0xd62dd4c1ff97250b, 0x87ae908719764985 }, { 0x7688fcb429dde5a2, 0x0758c507f21ec68d },
+ { 0x232c789fb9de8338, 0x43d9ff43feb85218 }, { 0xaa8bcb56e306ccf7, 0x88c17488188febe9 }, { 0xbed7ce10899ed44b, 0x98af36983d8223e8 }, { 0xf935afdd6080aee6, 0x75ec51754574e223 },
+ { 0xb0542cf31f9561e7, 0xff50bcff11b21063 }, { 0xcae8d3c410818c90, 0x4993474941162f50 }, { 0x8593b04a7c11471a, 0x7a83b57a448d404f }, { 0xa986bb060ba5ce53, 0x35979a35d1404427 },
+ { 0x3fe97f9a56c82aa3, 0x8de4288da6d834cd }, { 0xdf0e47b222782bf1, 0x32cf5f32235e82aa }, { 0x35c79cb9638426fd, 0x85d30985553f502c }, { 0x3b447e5af58f9351, 0xe22c83e2790f63a7 },
+ { 0x70921c143a58e129, 0xbef4dabea3435bd2 }, { 0xf88f3eed38e1113b, 0x1ede0b1e023187d8 }, { 0x42f5f13d12387c82, 0xe9b996e9e064f35a }, { 0x60631892f3874067, 0xc15233c15999c4b9 },
+ { 0x061ae0a01385048b, 0xb9ac1fb9515d9d5f }, { 0x6574886208a14648, 0xc5a8c2c5c10bf628 }, { 0xab315a66bb67732a, 0xe3f32ee35fca8e12 }, { 0xbddabe40613dd6ef, 0x25f9d825f44d8c26 },
+ { 0x4658f0fdb17fc570, 0x86713d863fb3a430 }, { 0x97d555ac050c5b2d, 0xd341e8d330dd1511 }, { 0x67c36902b863fb31, 0x13cc76134f813c1d }, { 0x1e72e6655fd414e2, 0x18596318d6eaace0 },
+ { 0xa5b2b8852d6cc686, 0x840ca48473fabd99 }, { 0xfc223f2d9ba6a8c9, 0x7116a071dde6d0b2 }, { 0xfe95de4d2b6415b0, 0xa77214a7536c1a87 }, { 0xd0373461ec122180, 0x3e028f3e482bd4da },
+ { 0x38490e0a1d2c91f5, 0x5f7a6d5fb0c0cc69 }, { 0x7ca61f971c91e9fc, 0x0f6fe40f01f9a26c }, { 0x5c8717584dec6860, 0xf1e0f5f1368e5fba }, { 0x8fbd5369495d4b44, 0x72b49472b76a24ae },
+ { 0xeac9db0b41fc0d0c, 0xb71c56b77661d286 }, { 0xe15da9182cd1be8f, 0xd4192dd4c2c3d39c }, { 0x030d7050e8a302a4, 0xbd56eebdc9cfafce }, { 0x8d0ab209f99ff63d, 0xa4d020a439e0ee9b },
+ { 0xce45d204b3c63562, 0x265bec269ec1783a }, { 0x808420ba87374135, 0x7e79447edc1f72de }, { 0x8cb02339a1fe49e0, 0xcfe27acf7ea58b60 }, { 0x510985eb3344df68, 0x2b49912bd371c3ff },
+ { 0x48db121e277470dc, 0xe18eb7e1138397bb }, { 0x68fa1ad17609f140, 0x1f01a61f24f46a6d }, { 0xe44a39e8d7f7b8a0, 0xd0e3dcd05a51e10d }, { 0xd8ae3622699c90a7, 0xe0511ae035467a0e },
+ { 0xfb824ebdd042139f, 0xa388e5a3cbfe2816 }, { 0xe250d948c472bc2b, 0x694fc3690b0c7c52 }, { 0x9c4127bf6821e8ae, 0xb04493b0847f140b }, { 0x1adfe7a5fc93ad10, 0x7791c877093dfb8a },
+ { 0xee64dacbe2bbb4fe, 0xd8d4fdd8a9b685ec }, { 0xad2bbac6a8e277a1, 0x5a5f315a0e97134d }, { 0x8429217a2470f8c7, 0x11b1ef1103c825b4 }, { 0xcb5242f448e0334d, 0x22a11d2206534aab },
+ { 0x7b066e07577552aa, 0xddf1a1dd17e15ac8 }, { 0x455580ad59dcc7d4, 0x3b27d33bf67c0bfe }, { 0xfa38df8d8823ac42, 0xc8babfc88cbb4ded }, { 0x4c7613de8433c92e, 0x8e461c8ecc54c0d1 },
+ { 0x2c150b4c77b48949, 0x4f142f4f95cd0468 }, { 0x6c571b11d54e48b2, 0x70c90d70fb233d07 }, { 0x7abcff370f14ed77, 0xb6c3fbb650a43f33 }, { 0x6a4dfbb1c6cb4c39, 0xc96512c9aa7ea058 },
+ { 0x47e261cde91e7aad, 0xed4367ed78f6c1cb }, { 0x347d0d893be59920, 0xeee153ee127a35d7 }, { 0x89a7b3c95ad84fcf, 0xcb188bcbe637b9f1 }, { 0xbbc05ee072b8d264, 0x9c55c79ca5101179 },
+ { 0x1cc50705ef16a99b, 0xce3dd7ce586066d5 }, { 0xda19d742d95e2dde, 0x3635ae36bbccb03b }, { 0x77326d8471bc5a7f, 0x6c6a9f6cb55ba376 }, { 0xe9c4ab5ba95f0fa8, 0x0a4ab80abfae7d48 },
+ { 0x8b1052a9ea1af2b6, 0x1d7c3f1d68bd73c4 }, { 0x98ec267fcb66515c, 0xdf8c38df5ba84361 }, { 0x4a6cf37e97b6cda5, 0x37ea03379d095d8e }, { 0x8aaac399b27b4d6b, 0x764e65762ff8163f },
+ { 0x79b18f67e7b7efd3, 0x0b95150b996b90fd }, { 0x966fc49c5d6de4f0, 0xb873b2b8779870ea }, { 0xd18da551b4739e5d, 0x5530d5550f6eb121 }, { 0xb543bc03e4b367c8, 0xfbaa4dfb892022f2 },
+ { 0x16ebe426da5aa5c5, 0xc60af6c6ab870234 }, { 0x5d3d8668158dd7bd, 0x9ad2af9a71cb3a41 }, { 0x636e68c21b2442c3, 0x7c04dd7c90566b77 }, { 0x6bf76a819eaaf3e4, 0xa25748a2ed3bc5a3 },
+ { 0xd520a491173427af, 0x3af87e3ad0b9e64b }, { 0xf31b4cfe55cca2b8, 0x7ddb707db69386c2 }, { 0x6ee0fa71658cf5cb, 0xa6adb9a675a9f732 }, { 0xf1acad9ee50e1fc1, 0xabbfc4ab38194cf7 },
+ { 0x50b314db6b2560b5, 0x407bcb409434a604 }, { 0x6ded8a218d2ff76f, 0x1bfb571bbc6658fc }, { 0x8233c1da37f5fc4c, 0xa81df0a85295b8eb }, { 0xf60cdc0eaeeaa497, 0x792181792e01b453 },
+ { 0xddb9a6d292ba9688, 0xe4abebe4add4489f }, { 0x15e6947632f9a761, 0x7b5c187b6248adfa }, { 0x4ec1f2be34f17457, 0x5822a85842de0ae4 }, { 0x53be648b83866211, 0xfd2d25fd5dfb09ca },
+ { 0x8e07c259113cf499, 0x1986ce19f02f4155 }, { 0xd49a35a14f559872, 0x51ca245197fc83b0 }, { 0x0b9472136d2db383, 0x63057b63b4a2011a }, { 0xcfff4334eba78abf, 0x4d69b64dd9841dc1 },
+ { 0xdc0337e2cadb2955, 0x8f99b18fea912d64 }, { 0x9dfbb68f30405773, 0xdb76c9dbc33a71f0 }, { 0x69408be12e684e9d, 0x7433fc7463b10f96 }, { 0x9956b74f9307ee81, 0xb4be62b41ced269a },
+ { 0x1fc8775507b5ab3f, 0x736b397391afc91b }, { 0x2536983faa5b87b3, 0xfa75e0faafe5cf47 }, { 0x28b80a8cd4f330bb, 0x20dc84204a1a5302 }, { 0xd79745f1a7f69ad6, 0xec9ccaec5e332c7e },
+ { 0x13fc74d6217ca3ea, 0xc2f007c2331530a5 }, { 0x9a5bc71f7ba4ec25, 0x09e88c09d5228954 }, { 0xc0c630e725cd80ce, 0x41a46641b2f14bb1 }, { 0x8724512accd3fa63, 0xace701acca078a7a },
+ { 0xc6dcd04736488445, 0xf80879f8e3acd6ee }, { 0xbc602f70395c6932, 0x4ecb824eb308e9dd }, { 0x9ef6c6dfd8e355d7, 0x662027660af5de3e }, { 0xb2e3cd93af57dc9e, 0x293408299f38da56 },
+ { 0x0d8e92b37ea8b708, 0xdaa964dae5ff9c45 }, { 0x739f6c44d2fbe38d, 0x03a234036a8cf41c }, { 0x02b7e160b0c2bd79, 0xd664b4d68e8aca35 }, { 0x3267ed2928609dab, 0x574d4c574327a888 },
+ { 0x5b2766c80608d336, 0x237eb0232096a71e }, { 0x4042105da2fac1fb, 0x3fdd223f6eee396f }, { 0x6679f832e00244ec, 0x78fe2c7808c459e6 }, { 0x10f10486c9dfa14e, 0x7fa6e97ffada9f6b },
+ { 0x3e53eeaa0ea9957e, 0xe6d672e6e19d5136 }, { 0xa212c91566887dd0, 0x5692e15665e2453d }, { 0xb64ecc530c10656c, 0x46fca34640ef8d3c }, { 0x4dcc82eedc5276f3, 0xe57446e58b11a52a },
+ { 0x434f600d4a59c35f, 0x828bcc82a72196a1 }, { 0xa70559e59dae7bff, 0x52681052fd7077ac }, { 0x4f7b638e6c90cb8a, 0x3310f233059b6f1f }, { 0x07a071904be4bb56, 0xd29e45d21618f8a4 },
+ { 0x01ba91305861bfdd, 0x6b325a6b474565fb }, { 0x19d297f51430afb4, 0xcac726cac0f25444 }, { 0xe74749b83f54ba04, 0x6db5326d939e4ec3 }, { 0x869ec01a94b245be, 0xc7d55bc78d42ef81 },
+ { 0xccf233640304881b, 0xf03f58f0104bb20f }, { 0x202108cf517d819c, 0xfe8f11fe3777fdd6 }, { 0x0a2ee323354c0c5e, 0x08372108f3e764e1 }, { 0x3ce40fcabe6b2807, 0x30b2c6306f179b03 },
+ { 0x3afeef6aadee2c8c, 0x891ed9893e4a065c }, { 0x316a9d79c0c39f0f, 0xea1ba2ea8ae80746 }, { 0xff2f4f7d7305aa6d, 0xcc404ecc14297f7c }, { 0x71288d2462395ef4, 0xd5c680d5e4063e29 },
+ { 0x41f8816dfa9b7e26, 0x54ef785429ab5c94 }, { 0x0f3973d3ce6a0a71, 0x0ccdd00c6b755670 }, { 0xf0163caebd6fa01c, 0xc08d9ec07f5c290c }, { 0x2daf9a7c2fd53694, 0x24267524d2886193 },
+ { 0xa6bfc8d5c5cfc422, 0x395a4a39ba351257 }, { 0x5a9df7f85e696ceb, 0x484cea4867d3c2e5 }, { 0x145c05466a9818bc, 0x106e4210250dc801 }, { 0xc46b3127868a393c, 0x2e6ccd2e6d261cdb },
+ { 0xb4f92d33bcd2d815, 0x90981790ce654709 }, { 0xc85f32a4a04331e9, 0x9ff7f39fcf9ce565 }, { 0x92c2c55cfe2a5d02, 0xd7bb19d7a84f2780 }, { 0x1d7f9635b7771646, 0xa50f8da51f25032e },
+ { 0x3d5e9efae60a97da, 0x5b809c5b2852fef8 }, { 0x5e30f638fd2ed519, 0x27844127b804958f }, { 0x743f1dd4991f58db, 0xd13c71d17c940cb8 }, { 0x62d4f9f24345fd1e, 0x17368717d7130e8c },
+ { 0x263be86f42f88517, 0x47230e47662a6089 }, { 0xf7b64d3ef68b1b4a, 0x1213db126944d1a8 }, { 0x9f4c57ef8082ea0a, 0x0d127d0d4db0bbc5 }, { 0xe6fdd888673505d9, 0x06876806d4db2b38 },
+ { 0x94d825fcedaf5989, 0x6e17066ef912badf }, { 0x4bd6624ecfd77278, 0x5cd8595cda4c3875 }, { 0x33dd7c1970012276, 0x3c7f163c0462cd73 }, { 0x08990243858eb127, 0xde5395de7d6daed4 },
+ { 0x17517516823b1a18, 0xad38acadecc267cf }, { 0xefde4bfbbada0b23, 0xb3e6a7b3eef3e017 }, { 0x04ad01c0a347b9f2, 0x6fc8ab6fdfd7576a }, { 0x64ce195250c0f995, 0xae9a98ae864e93d3 },
+ { 0x0c34038326c908d5, 0xb19b3eb1a2baf9be }, { 0xa0a52875d64ac0a9, 0x80f65580eb688f08 }, { 0x37707dd9d3469b84, 0x53b7bd53dbb59a19 }, { 0xc5d1a017deeb86e1, 0x455e97452a637920 },
+ { 0xb977bf80c27a6f1d, 0x4a31734a2b9adb4c }, { 0x114b95b691be1e93, 0x1494b314bd9ffa90 }, { 0x39f39f3a454d2e28, 0x34483734f785a992 }, { 0xcd48a2545b6537c6, 0x9b0d029b570ed7f4 },
+ { 0x9075243c4ee8e07b, 0x01dfad0126c5edb5 }, { 0xf2a1ddce0dad1d65, 0x16e92a16f1d6e339 }, { 0xe87e3a6bf13eb075, 0x6178e261f8eb18b3 }, { 0xac912bf6f083c87c, 0x316d6b3149d276b6 },
+ { 0x5713654b20c1dbe3, 0x92e58e92822c5ea0 }, { 0xf4bb3d6e1e2819ee, 0xaf4535afa08b7e66 }, { 0x7d1c8ea744f05621, 0x645dbe6446bcc797 }, { 0xa83c2a3653c4718e, 0x5ea5c05e960521dc },
+ { 0xd280d5015cd09cf9, 0xe8663be8c6a11eef }, { 0x4961832e7f15cf01, 0x8abced8a54c6f240 }, { 0xa40829b5750d795b, 0xef3efeef34bfd862 }, { 0x838950ea6f944391, 0xc32faac315d0dd10 },
+ { 0xfd98ae1dc3c71714, 0x1a24fa1a9aa3b549 }, { 0xd914a71231fd2f7a, 0x8b63408b72031ff5 }, { 0xe3ea48789c1303f6, 0x027d99024c4919a9 }, { 0xb7f45d635471dab1, 0x2dcef92d07aae8c7 },
+ { 0xc271d187950f3db7, 0x97c0d2973c7b8184 }, { 0x2781795f1a993aca, 0x2c11542c216f0572 }, { 0xed69aa9b0a18b65a, 0x6582136560792a22 }, { 0x9be1562f23c553f8, 0x62dad6629267ecaf },
+ { 0x5204f5bbdbe7ddcc, 0x961f7f961abe6c31 }, { 0x541e151bc862d947, 0x2fb3602f4be3f16e }, { 0xbf6d5f20d1ff6b96, 0xf39d6cf37ac74613 }, { 0x248c090ff23a386e, 0x9147ba91e8a0aabc },
+ { 0xc17ca1d77dac3f13, 0x2a963c2af5b42e4a }, { 0xd33a443104b12324, 0x8354618381e47b14 }, { 0xa11fb9458e2b7f74, 0xebc40febac2deaf3 }, { 0x44ef119d01bd7809, 0x50158950b1396e05 },
+ { 0xdba34672813f9203, 0x5d07f45dfc89d5c0 }, { 0x2ea2ea2cc7763430, 0x99709b991b47ce5d }, { 0x7225fd748a9a5c50, 0x68906e682dc991e7 }, { 0x599087a8b6ca6e4f, 0xf51a04f5ae1c6d2b },
+ { 0x780b1e57bfd6500e, 0x60a74f60de2ef506 }, { 0xe5f0a8d88f96077d, 0xbbd186bb1d1484f6 }, { 0xba7acfd02ad96db9, 0xf7679df7e2557482 }, { 0x1246e5e6791d1c37, 0xa9c25da97450555e },
+ { 0x9562b4ccb5cee654, 0x05255c05be57df24 }, { 0x2bb57adc3c50321f, 0x9d8a6a9d83d5fccc }, { 0x2a0febec64318dc2, 0xf6b830f6c4909937 }, { 0xf501ac5e4649a633, 0xc4776fc4e7ce1b9d },
+ { 0xb1eebdc347f4de3a, 0x9462e69456f77598 }, { 0x2296e9afe1bf3ce5, 0x28eba528b9fd37e3 }, { 0x813eb18adf56fee8, 0x154b1e159b5a1725 }, { 0x881d22f902b9f012, 0xa02ad1a0a172dc0a },
+ { 0x582a1698eeabd192, 0x9e285e9ee95908d0 }, { 0x0e83e2e3960bb5ac, 0x67ff8a672c30338b }, { 0xc9e5a394f8228e34, 0xf4c5a9f488d9809e }, { 0xe0e7382874b00152, 0xbf2b77bf8586b667 },
+ { 0x2f187b1c9f178bed, 0xf242c1f25c02aba6 }, { 0x09239373ddef0efa, 0xb561cfb53a28cb2f }, { 0xc76641776e293b98, 0x933a2393a4e9b315 }, { 0x9378546ca64be2df, 0xbc8943bcef0a427b },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x29029bbc8c928f66, 0x4beede4b0d5f36f9 }, { 0x051790f0fb26062f, 0x04faf10498923291 }, { 0x56a9f47b78a0643e, 0xf9d7d4f9c5693b5b }
+ }, {
+ { 0x799ddb4148c08b51, 0xc618e56e42b35b04 }, { 0xe73081fa2725ea33, 0x364c8f6512f706a3 }, { 0xc9b34248405a98a4, 0x9d9a049cca192e3b }, { 0x59c29714d711eb67, 0x4bab806b39a6896c },
+ { 0x4dde599db32bd70a, 0xb53d17c0d2076b55 }, { 0x111b1c3a7dd533e7, 0x2052c2f1a1183ba6 }, { 0xf7fea73189acda28, 0x91f45c86ce1c6f97 }, { 0x446c70e837d2cc1a, 0x808b8e42c160ecdd },
+ { 0x40be98aafd61c06c, 0xd9a5ca0af62a67d0 }, { 0xf1453b5226a7d065, 0x05cd3aea0373407d }, { 0x3a9f0d3b03454efa, 0x55401c52334fcaa1 }, { 0x9baa8808760a6ee8, 0x2e903f511afd8438 },
+ { 0x2ceab79302c774ac, 0x66c1a9dd22cb8c7f }, { 0x60e1d4ff62b0a05a, 0x5416af0f8d3fb5b8 }, { 0xeb857a3cba33fea9, 0xdd3e43bd4b2958b4 }, { 0x1b157b9f4fc82d30, 0x5f19684535a94a5b },
+ { 0x51a5849080b4f38b, 0xf9f708fb57325c76 }, { 0xb4fc714bc2291f83, 0x02aca5babfe0fe32 }, { 0xf442e9e13f48dfef, 0xdb096fb049ca99e2 }, { 0x0d60c1374e4a1766, 0x6c98ddca242d0c85 },
+ { 0x9a7fb2f9a5566d14, 0xa97a2e43670ed6aa }, { 0x22363874fa69660d, 0x40a447218130768f }, { 0xc76fcdafb8f48a05, 0xbbffea6069e2d4cb }, { 0xe9ec0e1ddf8bf892, 0x10296199b10cfc53 },
+ { 0x72468615a981967a, 0x3eb95ec8abf1786b }, { 0xf597d310ec14dc13, 0x5ce37ea23439cb70 }, { 0x80bff39739c243d8, 0x718957142f54ce63 }, { 0x2731eac7e3866987, 0x9e60127bcb89af10 },
+ { 0x94a33d1e5df87fb5, 0x8f1fc0bfc4f52c5a }, { 0xef57927e7080f2df, 0x841007f57c63d3b9 }, { 0x15c9f478b7663f91, 0x797c86b99652b0ab }, { 0x30916a9e3158502d, 0x2a0bb6e6a7febb5c },
+ { 0x5a7ed9c461f5eea0, 0x0156b35dbe707f19 }, { 0xd97d6483eed3a8bf, 0x3a22d77f16f2470f }, { 0x816ac966ea9e4024, 0xf663460652a79cf1 }, { 0x957607ef8ea47c49, 0x08f5d1adb9067ec8 },
+ { 0xa0e0bfc2a61323ee, 0xfc3a321154411c0b }, { 0x64333cbda803ac2c, 0x0d38eb47ba753eb5 }, { 0x2b8411017e907d1d, 0x7512dea39257f107 }, { 0x1ac0416e9c942ecc, 0xd8f37957485a18c9 },
+ { 0x490cb1df7998db7c, 0xec135388e54de058 }, { 0x96ca493f3840798e, 0x4208e29b3ed088bd }, { 0xb695056aa79119b8, 0xcfbb879e45c55ad5 }, { 0x45b94a19e48ecfe6, 0x07619f50bc93be4f },
+ { 0xe48ccf2a91c1eff4, 0x7cb1bc539521f0d6 }, { 0x29ed65201b287b26, 0xb805fc87687255e0 }, { 0x10ce26cbae89301b, 0xa7b8d3e3dceb6934 }, { 0xae3c30255ebd314f, 0xda5fdcedf7bae6fb },
+ { 0xa289cbe3c3ab25d5, 0x312d1035ae64b8ec }, { 0xab3be29647523ec5, 0x049b89b7bd033f64 }, { 0x2d3f8d62d19b7750, 0xe12bb8cf5f38deed }, { 0x8e637c70c16c5179, 0x57ecb9e88caf3493 },
+ { 0x5070be6153e8f077, 0x7e1d19e92ac10ee4 }, { 0x32f81ebf54e05616, 0xe71c94c25ddb1fbb }, { 0x85b82124202d4c52, 0xaf4d024e65ed17fc }, { 0xcedde4da3c0d9115, 0x8e4973e27a855343 },
+ { 0x5817ade5044de89b, 0xcc4191794455dbfe }, { 0xc0016b3dc4a383b4, 0xa82c9d1ed97ea9b3 }, { 0xc506b98edd4c8c3e, 0x76e8c84493c7702c }, { 0x48d98b2eaac4d880, 0x6bf9429a98beb2ca },
+ { 0x205f4c559fd16036, 0x8db365057b15d268 }, { 0x99c3fc2913b268d3, 0xe3871d75e0d820df }, { 0x0bdb5d54e1411d2b, 0xf8a1bba6e942236f }, { 0x54a25623995bfc01, 0x27335da11d8b85e9 },
+ { 0xf09001a3f5fbd399, 0x82272bf87e8012ef }, { 0x47d03e388136c9dd, 0xca76bd7446b61aa8 }, { 0x4c0b636c6077d4f6, 0x32d706d2aff439c7 }, { 0xd3730326dcceb668, 0x45697dcb824336f2 },
+ { 0xa1358533754f2012, 0x7bd0230329b24e99 }, { 0x0507d2b319ef0f8a, 0xdec4555a4ab9d99f }, { 0xb1fba3f8dbc61009, 0xdc68f0e0f55927ad }, { 0x6134ee0eb1eca3a6, 0xd3fcbe1df0cce72a },
+ { 0x971f73ceeb1c7a72, 0xc5e2f3894323da2f }, { 0xff99b4b5de09c2c4, 0x23a8d416a088ba8d }, { 0x56cb2202fce3fa3a, 0xea247f85e7ae210e }, { 0xac5544043b053774, 0x1748fec90d9f421c },
+ { 0x38f6791a66fd48c1, 0x98573e76c96a6e46 }, { 0x218a76a44c8d63ca, 0x0a59741706e680fa }, { 0xe23753493ecae5b9, 0xe888da3f584edf3c }, { 0x3f98df881aaa4170, 0x8b84490879f6133e },
+ { 0x25589ee6863e6fbc, 0x5377305f31ac0bf7 }, { 0x88d8e0136e675b34, 0xc3d5df8441c01b79 }, { 0x7bf4af602d788d6a, 0x0b0fc74ab896ffe3 }, { 0xc1d451cc17ff8048, 0x2fc68c0ca48dfb21 },
+ { 0xa78e1950da442a5f, 0xefe9456fe4dd6173 }, { 0xc2681f1ca11b858f, 0x653bbf3a235b0d54 }, { 0x87d1550545954a69, 0x625a206a9fc8b31b }, { 0x0cb5fbc69d16149a, 0xeb72ccd859de5e17 },
+ { 0x28385fd1c87478da, 0x3fefed9515810772 }, { 0x55776cd24a07fffd, 0xa0d94cb36078d77b }, { 0xaaeed867940e3d39, 0x837198a5c0f06df6 }, { 0x9d11146bd90164a5, 0xbaa9593dd792abd2 },
+ { 0x01d53af1d35c03fc, 0x87ea11127df35292 }, { 0x7ef37dd3349782e0, 0xd5cb9210f22f267c }, { 0x76946e5763329a0c, 0x67971a809cbbf366 }, { 0x42d7ec8b98d9c657, 0x14b2e82e0c0fc337 },
+ { 0xbef216eef0340154, 0x7de70f0e2b518fcf }, { 0x6aefb35a50adbe8d, 0x2b5d05bb198ec445 }, { 0xcd61aa0a8ae994d2, 0xc4b440d4fd53a536 }, { 0x18a9354ff92c28f7, 0x15e45b73b27fbc2e },
+ { 0xf32c4f73431fd65e, 0xc8da18cef956e49a }, { 0xc6baf75e6ba889f9, 0x3c15fb7214118659 }, { 0xdfc6f8e041d8a2f2, 0xae1bb113db9d68e5 }, { 0x82d687b65c7a45e3, 0xbc9e7530d5716a84 },
+ { 0x0269742165b8063b, 0xcd172224fa25a4e7 }, { 0xfc25fa6568edc703, 0x6955e720275e4cf8 }, { 0x0edc8fe7f8ae12a1, 0x2665eefca3fbfaf0 }, { 0x7a219591fe248e96, 0x8ce5d658c565ad71 },
+ { 0x17a08059d2de39aa, 0xb46ba49d6c77144c }, { 0xcbda366925e29e9f, 0x508d26b8303c8adc }, { 0x1fc793dd857b2146, 0x06372c0d02e3c156 }, { 0x702ff234cc399041, 0xf3ae7cec51d4dc8c },
+ { 0x5f790b77781ae12a, 0xdf92e607f4c9a686 }, { 0x362af6fd9e535a60, 0xbe32d08a6a9194b6 }, { 0xb99cb07c8c6308e5, 0x6e3478709bcdf2b7 }, { 0xd2a639d70f92b594, 0xc2836cd9ffb06460 },
+ { 0x8ddf32a0778854be, 0x1d118ade0b79c2e6 }, { 0x416ba25b2e3dc390, 0x5e4fdb188bd93542 }, { 0x9816c6d8c0ee6b2f, 0x646d0c679d2b724d }, { 0x635d9a2fd454a59d, 0x1eeb9c390ae943cd },
+ { 0x1c7bdd0d339f2481, 0x4cca1f3b85353723 }, { 0xf2f975829043d5a2, 0x4f3009dc84a5b608 }, { 0x04d2e842cab30c76, 0x592e4448374a8b0d }, { 0x3df1aba97f12474b, 0x46936b2c83d3b7d9 },
+ { 0xed3ee65f1538f4e4, 0x490725d18646775e }, { 0x3b4a37cad0194d06, 0xd2aa0d404ebc9833 }, { 0xea5040cd696ffd55, 0x5ad452af36da0a26 }, { 0x846d1bd5f3714fae, 0x28a7135c181e456e },
+ { 0x7f264722e7cb811c, 0x522183028fdc74ee }, { 0xf8f71227a25ecb75, 0x307ba3681014c7f5 }, { 0x344382dcfbeb5c5b, 0x7325f2ae90b43051 }, { 0x93cd9b8c21af7604, 0x9cccb7c174695122 },
+ { 0x7d4f330382738727, 0x9f36a12675f9d009 }, { 0x06bb9c63af0b0a4d, 0x9439666ccd6f2fea }, { 0x37ffcc0c4d0f599c, 0x39d8c1981762c624 }, { 0x12a752eacb313620, 0x6aaff1c726cecdd3 },
+ { 0xd11a7707b976b053, 0x887e5fef78669215 }, { 0x65e6064c7b5fafd0, 0x8ad2fa55c7866c27 }, { 0x86046ff496c94995, 0xe5b03178e23be189 }, { 0x8b64aec3d8835ef3, 0x8928ecb2c616ed0c },
+ { 0x8fb6468112305285, 0xd006a8faf15c6601 }, { 0xad807ef5e8593488, 0x90a2efdb706c108e }, { 0x53ccf0b1e50cf5b0, 0x34e02adfad17f891 }, { 0xba20feac3a870d22, 0x24c94b461c1b04c2 },
+ { 0x197c0fbe2a702b0b, 0x920e4a61cf8ceebc }, { 0xa887ac46f1b63b02, 0x4e66ba813ad5c911 }, { 0xddaf8cc12460a4c9, 0x630c933721b8cc02 }, { 0x7c9a09f2512f84db, 0x18dcb034080a829b },
+ { 0x6886c77b3515b8b6, 0xe64a279fe3ab60a2 }, { 0x248da41755626c40, 0xd49d214d4c5f5965 }, { 0xfa9e6606c7e6cd4e, 0xfd6c814cea316312 }, { 0x0a0e67a5321d1ed7, 0x7f4baab494b171fd },
+ { 0x4302d67a4b85c5ab, 0x9358f93c71fc91a5 }, { 0xa43257806ca02f98, 0xa5147659630b9706 }, { 0x890ddae2bd3b58c8, 0x443fce963c3349eb }, { 0xd0cf4df66a2ab3af, 0x0f944efd0595c087 },
+ { 0xa65b23a1091829a3, 0x6803547d992e33e1 }, { 0xb7403f9b74cd1a44, 0x4851968c38360847 }, { 0xdb1410a28b6bae84, 0xf735f55becd7e3e8 }, { 0x9f78604abcb9629e, 0x77be7b192db70f35 },
+ { 0xd674d195c521b9e2, 0x9bad2891c8faef6d }, { 0x4e62174d05cfd2cd, 0xffc024f655d19d20 }, { 0x6e3d5b189a1eb2fb, 0x727341f32ec44f48 }, { 0xe3e269b8ed96e645, 0x6f62cb2d25bd8dae },
+ { 0xee82a88fa3dcf123, 0x03fa16e70190812b }, { 0x571e18f32fbff9c6, 0x6dce6e979a5d739c }, { 0x392343ebb5a14b3d, 0x1fbd2f64b4993cd4 }, { 0x665a489ccdbbaa17, 0xc02fc96340509a52 },
+ { 0x678f726d1ee7a9eb, 0x47c5d8713da3c8c0 }, { 0xccb490fb59b5972e, 0x435e51c680a0f7a4 }, { 0x75282087d5d69fcb, 0x2d6a29b61b6d0513 }, { 0xfb4b5cf714baceb2, 0x7a86905e97c23180 },
+ { 0x5babe335b2a9ed5c, 0x86bca24fc3832d8b }, { 0x6953fd8ae649bb4a, 0x61a0368d9e583230 }, { 0xa5e76d71bffc2c64, 0x22fe674b1ef8c594 }, { 0x6b3a89ab83f1bd71, 0xacb714a9647d96d7 },
+ { 0xdc7ab630f73ca735, 0xe4e682255c4b9e90 }, { 0x03bc4ed0b6e405c7, 0x4afd333687d6f675 }, { 0x6fe861e94942b107, 0xf59950e153371dda }, { 0x9cc42e9a0a5d6759, 0x3d43482faa61f940 },
+ { 0xfe4c8e440d55c138, 0xa442c504dd7be81f }, { 0x332d244e87bc55ea, 0x60f685d020284d29 }, { 0x74fd1a76068a9c37, 0xaa8038a4669e5781 }, { 0xca0f0c98f6be9d63, 0xd76737aa4dcfd84e },
+ { 0xecebdcaec664f718, 0xceed34c3fbb525cc }, { 0x3596b82d28b75fa7, 0xf4cfe3bced4762c3 }, { 0xc86678b993069b58, 0x1a70158eb7ea7ca9 }, { 0x5d107f561da2e711, 0x1285c4230eec0261 },
+ { 0xb02e9909089a13f5, 0x5b82e1f288aa753f }, { 0xd41da5b4a099bfd9, 0x56ba0ab532df4b8a }, { 0xcf08de2bef5192e9, 0x09a362f0077601d1 }, { 0xd5c89f4573c5bc25, 0xd1501ba74f2c1918 },
+ { 0x9218a17df2f375f8, 0x1b26a6d3099a03b0 }, { 0x2e83c3b2677f7297, 0xabd68bf9d8ee2898 }, { 0x076ea6927c5709b1, 0x13d3777eb09c7d78 }, { 0xb8498a8d5f3f0b19, 0xe9de6962e63ea025 },
+ { 0x8ab194320bdf5d0f, 0x0ec2fda0bbe5bf9e }, { 0xf92228d67102c889, 0xb791b27a6de79567 }, { 0x1372681b186d35dc, 0xed45e0d55b3d9f41 }, { 0xe559f5db429dec08, 0xfb5bad41e8d2a244 },
+ { 0x23e30285293565f1, 0xc74e5633fcc3241d }, { 0xbf272c1f236802a8, 0xfa0d1e1c56a2dd5d }, { 0xde13c2119284a10e, 0x29f1a001a66e3a77 }, { 0xbc9b62cf958c076f, 0xb0f02d2ad1742b28 },
+ { 0x1daee7fce0c3277d, 0xcb200e29f8c665b1 }, { 0xf62b9dc05af0d9d4, 0x161e4d94b3ef3d05 }, { 0x71fac8c51f6593bd, 0x74446dfe2c278e1e }, { 0x7393bce47add9586, 0xb9534fdad6022af9 },
+ { 0x0867138457a518ec, 0xb25c88906e94d51a }, { 0xb392d7d9be7e1632, 0x117fd2c40f7c834a }, { 0xe18b1d99882ee07e, 0xa275e909df982949 }, { 0x5cc545a7cefee4ed, 0x956fd531731f50f3 },
+ { 0xe83934ec0cd7fb6e, 0x97c3708bccffaec1 }, { 0x9071d55c974b73c3, 0xd63184f7f3bfa757 }, { 0x460504c9526aca21, 0x4d9cac663b45483a }, { 0x9ead5abb6fe56162, 0xf0546a0b50445da7 },
+ { 0xb247ed286d2215ce, 0x9695c3d6728fd1d8 }, { 0xbd4e583e46d00493, 0x371a3c38ac8779ba }, { 0x5219ca403650f64c, 0xb30a3bcdd0e4aa03 }, { 0xbbf5c45de9db0ede, 0xa3235a5461e85650 },
+ { 0x91a4efad4417703f, 0x51db95e58e4cf5c5 }, { 0xd8a85e723d8fab43, 0xbdc8c66d6b01159d }, { 0xc3bd25ed72478673, 0xe2d1ae285ea85fc6 }, { 0x7848e1b09b9c88ad, 0x41f2f47c3f400996 },
+ { 0x774154a6b06e99f0, 0xe07d0b92e148a1f4 }, { 0x4b65c5fe1c20dd47, 0x210471ac1f6844bf }, { 0x6d8115c82cfab73c, 0x388e72c5a912b93d }, { 0x6288a0de0708a661, 0x99018d2b771a115f },
+ { 0x1675baa801823a56, 0x3381b58f118446de }, { 0xa35cf11210f72629, 0xb6c70127d397ea7e }, { 0x26e4d03630da6a7b, 0x198a0369b67afd82 }, { 0x09b2297584f91b10, 0x35b6998213678788 },
+ { 0xfdf0c094bbb1c4ff, 0xeebff6325aad1e6a }, { 0x0f09b5162bf2115d, 0xa18fffeede08a862 }, { 0x4fb72dbcd693d131, 0x782a35e42822cfb2 }, { 0x3c249158ac4e44b7, 0xc1797a3efe20e54b },
+ { 0xafe90ad48de132b3, 0x5db5cdff8a49b469 }, { 0x2f56f943b423716b, 0x2c3c9aeba51d7a0a }, { 0x6c542f39ffa6b4c0, 0xbf6463d7d4e1ebaf }, { 0xb5294bba11751c7f, 0x8546b4a8c213aca0 },
+ { 0xd7a1eb64167dba1e, 0x1c473983b509bdff }, { 0x3144506fe20453d1, 0xade1a7f4da0de9ce }, { 0xdac12a535837ad78, 0x70dfe4499124b17a }, { 0xc4d3837f0e108fc2, 0xf102d956ee3422be },
+ { 0x4ab0ff0fcf7cdebb, 0xa6ee60be629b162d }, { 0x141cce89643a3c6d, 0xfe9697abeba1e239 }, { 0x2a512bf0adcc7ee1, 0xf2f8cfb1efa4a395 }, { 0x8303bd478f26461f, 0x3b746422a8823816 },
+ { 0xe05e27685b72e382, 0x259ff81ba26b7bdb }, { 0x1e12a92c562722ba, 0x81dd3d1f7f1093c4 }, { 0x3e4de579c9f6428c, 0x0c6e581a040541ac }, { 0xe6e5bb0bf479e9cf, 0xb1a69e776f045431 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0xa95296b722ea38fe, 0xc98cab9347269b83 }, { 0x8c0a0851a4d45742, 0x9afb9bcc768a9074 }, { 0x5eac3186ab46e2d6, 0x5878f715893af414 }
+ }, {
+ { 0xc4610e8a46859da5, 0xe8f43dc0cab4e742 }, { 0x86ab96b2b17c302d, 0xf11ee62510bc3f12 }, { 0x6153b1e6f129b332, 0x3796c45ad0a0f8ca }, { 0x7df282f05569c28f, 0x2fe83a11ffe7b639 },
+ { 0x7e70345387e3de0e, 0x6c04012b4a1ddcd2 }, { 0x73437afb07491b30, 0x23d745d5092591a1 }, { 0x3b03d08f590afe38, 0x731004aceb74f6ce }, { 0x0fcf2b6a1ce76cc0, 0x8cdad7d2249401c1 },
+ { 0xb1e5dbf4261bbe54, 0x4d380e616aa6a2f6 }, { 0xda3c585e7e8845e6, 0x338350a7825fe503 }, { 0xe47a91f792df9f9e, 0x8564194575e6ad33 }, { 0x320b5460223aaa39, 0x79d1a50a66d7231a },
+ { 0xb8ed5f1b5d2bea55, 0x47f9afc7e7057722 }, { 0x0876578e35f7e17e, 0x8a2409b05ff5f38d }, { 0x87d545d3ffbb8552, 0x71fb4e33c2ea194b }, { 0x9302214b6e0c1591, 0xe3a1b9c8b258a435 },
+ { 0xc2a6a10f2152a564, 0x6eef4bb463833357 }, { 0x1b184ff28d50fc03, 0x1e8020295426bcbf }, { 0xaafd9406ab4b4257, 0x53b82e483e801e49 }, { 0xcf95efa7a1f8605a, 0x213c0f4a20bb7e24 },
+ { 0xfce068a6cd057f1c, 0xd8080256943a7b67 }, { 0xe686f4350e923660, 0x466d8a69124ae181 }, { 0x3f381ac8a2906f07, 0x3602e1f425ef6e69 }, { 0xd8c03d9ce2c5ec18, 0xf08ac38be5f3a9b1 },
+ { 0xeacb69fcc0ff4621, 0x895b668183248aab }, { 0x6416a8c044749772, 0xf2618914cc6d4634 }, { 0xa109752b4c36bfa8, 0x9a701cc2d48f872f }, { 0x9647386ddb5131d1, 0x2656f486ae951acb },
+ { 0xa28bc3889ebca329, 0xd99c27f86175edc4 }, { 0x39ffb54dc54757c6, 0xb01997808cd8ba7c }, { 0xcd698a653db5c9a4, 0xe2359c6647173296 }, { 0x043bca47fb9a913f, 0x4512e558ce9b98a7 },
+ { 0xec0cc679a7287ee0, 0x0f4010f52a135ebe }, { 0xdcfbf7db195f7d27, 0xb59826d32b683116 }, { 0x6fe249eda3096a8d, 0x3ba9bb9e2662df52 }, { 0x6c60ff4e7183760c, 0x784580a49398b5b9 },
+ { 0x189af9515fdae082, 0x5d6c1b13e1dcd654 }, { 0xb65ca7100f0b33ea, 0x4bc6d00311c750ba }, { 0x9739eb0c959684ae, 0xa6b35c907cc33c92 }, { 0x5de91d8d8133c0b4, 0x42781e9440b5fc48 },
+ { 0xc05ac4cdbd1f0c9a, 0xade6d898042f7fe5 }, { 0xfd9ebbc783c2ca63, 0x58edaa40466c5d3e }, { 0x440d37bd902e9549, 0x9ff1ad91733f0c45 }, { 0xc12417acf3d8b9e5, 0x2d03708ed67959bc },
+ { 0x1755d23b433d8c42, 0xd1b6ccc1c548d795 }, { 0xc82c934388e8ede4, 0x27c2d1285bda8c68 }, { 0xbda8463de876ce15, 0x820ee289fbc8c9dc }, { 0x46f1527f0c633cb7, 0x5cf83ebd149340f7 },
+ { 0x478f811e42a489c8, 0xdc1d96abc6c566ae }, { 0x36309e27d9a03b06, 0x3cc34052a84cbbbd }, { 0x760663ddb2143f70, 0xe620089b15e82f5f }, { 0xff62de051f8f639d, 0x9be4396c21c0118c },
+ { 0x0c4d9dc9ce6d7041, 0xcf36ece8916e6b2a }, { 0x5b2eb208e6e4f875, 0xc46368e0e982285d }, { 0xd1c8b97399f5b819, 0xfa4b622d68507c65 }, { 0x4e8705f13994ddc9, 0xd6dc370d4b66b37a },
+ { 0xb319be36ba5617aa, 0x8e319d4d0d0aee44 }, { 0x10ecaedf6a2d01fc, 0xd74812a3be2925d9 }, { 0x602d6287bfee064d, 0xb7736c4c02f6de93 }, { 0x0eb1f80b5220d9bf, 0x0c3f7fc4f6c22798 },
+ { 0xb9938c7a13ec5f2a, 0xc71c07d13553517b }, { 0x6d1e2c2f3f44c373, 0xf8a028b241ce93e0 }, { 0x2eaa6776867adb84, 0x61af5b4149906de9 }, { 0xb2676d57f491a2d5, 0x0ed4355bdf5cc81d },
+ { 0x14d7649891b790c3, 0x925af7fb70b2bd7e }, { 0x9e316fe3eea6d0af, 0xac72fd36f160e946 }, { 0xb09b089568dc0b2b, 0xcddda677b8f084af }, { 0x3cbaac6b701a7386, 0x75eedace90150482 },
+ { 0xd671c597b0e535a7, 0xfcb5bc4f13318e29 }, { 0x70c1cc58d5c307b1, 0x603b7eefbcdffb4a }, { 0x6bd983aa5893fbb2, 0x7ebb5ec6e8f947f5 }, { 0xc69d6b48dac8345b, 0x2bfdaeecad18abf0 },
+ { 0x337587016cfd1f46, 0xf9340d1cb4810543 }, { 0x8457f3702d3199d3, 0x32177509771073a0 }, { 0xed721518e9efcb9f, 0x8fa5b8e3f84578e7 }, { 0x19e42a30111d55fd, 0xdd89b305338af00d },
+ { 0xbb6fe9b88fa1f6d4, 0x041594fd52ff1dc9 }, { 0x7778b0bcfcd38a0f, 0x66c5a08dc7be0906 }, { 0xf66a5aea64bf379c, 0x912598caac63c458 }, { 0x94bb5daf471c982f, 0xe55f67aac9395679 },
+ { 0xc9524022c62f589b, 0xa727793e898caa31 }, { 0x1e5d56d4380dd843, 0xdb776d6748eb0241 }, { 0x9b7476c55bfbf4ef, 0x6985b078edad57b8 }, { 0xde0792198512d4d9, 0x7691b5ff4cc47da4 },
+ { 0x374e4d4697678e79, 0xbc26e8447a1a9de4 }, { 0x4ff9d690775368b6, 0x56399f1b99309523 }, { 0x8eddc13c848bd153, 0x7b3aef954f49cc9f }, { 0x017ed3614ec7b57f, 0x80e5a816d2562659 },
+ { 0x06c7af8567d738c1, 0x861b7674a937d415 }, { 0x7c8c51911bae77f0, 0xaf0d92072db19060 }, { 0xf8dba2e1369fee23, 0x9d1ae70e5aa1e3c0 }, { 0xd334dcb105b811e7, 0x3942f1010ffc30d7 },
+ { 0xceeb3cc6ef3fd525, 0xa1d9a75cf2ed587d }, { 0xebb5ba9d8e38f35e, 0x09bece975172acf2 }, { 0x54e19962fa0394b5, 0x48b9bf32cd16299c }, { 0xeef0a3bb3b65d71e, 0xcc4983d94dbf120c },
+ { 0xfb591442e415f2a2, 0xdef6dc34ef5b892b }, { 0xe8370c3e5cb2efdf, 0x4a52f5ade488c619 }, { 0xdf794178cbd561a6, 0xf6741de99e925bfd }, { 0x02fc65c29c4da9fe, 0xc309932c67ac4cb2 },
+ { 0x8529201163f62cac, 0xb2f2dd1fa54655f9 }, { 0xf1d3260e4dafba22, 0x97db46a8d7023614 }, { 0x3dc47f0a3eddc6f9, 0xf50b72d8424322db }, { 0xfe1c0d645148d6e2, 0x1b01917af39637d5 },
+ { 0x5f15784f1d7e694a, 0x81718db82719b0fa }, { 0x15a9b7f9df7025bc, 0x12bf5feda2e49b27 }, { 0x5e6bab2e53b9dc35, 0x019425aef54f96a3 }, { 0x559f4a03b4c421ca, 0xc85c17241f400fc5 },
+ { 0x927cf22a20cba0ee, 0x634411de600e826c }, { 0x3e46c9a9ec57da78, 0xb6e749e2f7b94830 }, { 0x2d28d1d554f0c705, 0x2243607bfc6a0702 }, { 0xb5de11b3dd812f6b, 0x082aeb39a43d3a51 },
+ { 0x9ccd0a2172eb7951, 0x6f7b6e1a96cca5f4 }, { 0xe5044296dc182ae1, 0x0581b153a7b08b6a }, { 0xd48da0552ca89c59, 0x3fbc2f63749dc29b }, { 0xf25190ad9f25a6a3, 0xd4377d9262f85cff },
+ { 0x6e9c9a8cedcedff2, 0xbb4c1388f434f90b }, { 0x7f0ee732c9246b71, 0xece1a93d984bfa8b }, { 0xa3f510e9d07b1656, 0x59798feeb323cb9d }, { 0x99881307c7b65d11, 0xaa8c23548a011b0a },
+ { 0xbcd6955ca6b17b6a, 0x02eb4a9f299eef85 }, { 0x4bc21cd78cc9f989, 0x132b7a4357ab0d84 }, { 0xbe2af09e3afcd294, 0xc1e2d9b34e32a337 }, { 0xcbae25e05a62f165, 0x642eea12ee20e683 },
+ { 0x66eacd02d8393e8c, 0x31681a38abc10a86 }, { 0x2a91ad317de04abb, 0x24bdbe19870bf54e }, { 0x493e791510845077, 0xd022e96f30074136 }, { 0x1f2385b576ca6d3c, 0x5b92c5719abd2418 },
+ { 0x255e865b6107267b, 0xa86769cba39ff48f }, { 0xab834767e58cf728, 0xd35d865eecd63810 }, { 0xba113ad9c16643ab, 0x84f03ceb80a93b90 }, { 0x8d5f779f5601cdd2, 0x38d6d4affab3a674 },
+ { 0x7a4bfe147c794f31, 0x2916e47384864475 }, { 0xe13f88d12782bbde, 0x4093540b692b13cd }, { 0x2bef7e503327ffc4, 0xa458160f555dd317 }, { 0xe2bd3e72f508a75f, 0x037f6f31dcd17926 },
+ { 0x63afd4246d641acc, 0xf49f5776b70cb478 }, { 0x78b79bd6e034e6cf, 0xea1f775fe32a08c7 }, { 0x4036fdfa6bb40476, 0xdae348c9bda494e2 }, { 0x8fa3125dca4c642c, 0xfbdf47839d1feac6 },
+ { 0x3189e2c3f0b0b6b8, 0x3a3d9e30d32d49f1 }, { 0xd70f16f6fe2280d8, 0x7c501459c167a870 }, { 0x9db3d9403c2ccc2e, 0xef9ec60c449a83ad }, { 0x4573e4dcdee92036, 0x1f140587a1692a1c },
+ { 0xcc17590473727cdb, 0x62d03470954114cf }, { 0xa7cedaae2be18769, 0x1c6b6ab67db8533a }, { 0x62d1074523a3afb3, 0x747aff60655a9221 }, { 0xb4a0c2d293469a14, 0x88cf432f766b1c08 },
+ { 0xb722747141cc8695, 0xcb237815c39176e3 }, { 0x07b97ce429108dbe, 0x06fede627b61f24c }, { 0xf4963f28f8f29e62, 0x522c0be6cbcf88ea }, { 0xe0415bb069450ea1, 0xc076fc1dbb7d3594 },
+ { 0x201b9f7dd45a023b, 0x6d902485bf524a71 }, { 0xa6b009cf65263216, 0x9c8ec2a0afee7563 }, { 0xd0b66a12d7320d66, 0x7aaeca3bba065a3c }, { 0xad44e8e2825bcfe9, 0x5546f02a45e1ec05 },
+ { 0xf9a5718078585b5c, 0x1dff4f1888f7c599 }, { 0x8ae60b7b7f11406c, 0x3e280acd81d25438 }, { 0x83ee8f940421146d, 0x34e9ab6b0c7181ec }, { 0x8c21a4fe18c678ad, 0xb8337cb928e5802d },
+ { 0x4c7b6033a5d97437, 0x15d5a4212ccaffc8 }, { 0xef8e70da75a26261, 0x4cac2bcf9fe93455 }, { 0x561dfca0664e3d4b, 0x8bb02c1eaaba652e }, { 0x3881662c8b80e2b9, 0x30fc3f965e8e9c25 },
+ { 0xf714898b2a7882e3, 0x11c030dc7e35e201 }, { 0x239929de06d01eba, 0x2e7c1fbf0aa8209a }, { 0x7584d57e609e23f1, 0xa5cc33a1a01245b4 }, { 0xe949df5f12755aa0, 0xcab75dbb36dee040 },
+ { 0x27a2e399fd4a8f85, 0x6b6efae7c433b83d }, { 0x11927dbe24eab483, 0x57adbab56c7f0380 }, { 0xc51fddeb084228da, 0x681195d618e2c11b }, { 0x3a7d03ee17cd4b47, 0xf3f5acba3922d097 },
+ { 0x22e7fabf4817abc5, 0xae99b7a9d8fe06c3 }, { 0x79c948b7aef353b0, 0x6afadf49317c2e9e }, { 0x685b35098a19e733, 0x3d5765fc5d032d1e }, { 0x26dc30f8b38d3afa, 0xeb8b52f116659e64 },
+ { 0xac3a3b83cc9c7a96, 0xd5a3583c97b7ca5c }, { 0x91fe4489f241bc6f, 0x20a82ae4d5f4e887 }, { 0x98f6c0668971e86e, 0x2a698b4258573d53 }, { 0x1ddfe077ea87c4c2, 0x989b565dfd1168aa },
+ { 0x4abccfb6c20e4cf6, 0x93ced25585fd2bdd }, { 0x95c58ece09db2d50, 0x65bacfbc1b6f7020 }, { 0x0bf4e12de77dfdff, 0xc9c8328aea0f9966 }, { 0xf0adf56f03680f5d, 0x173eeebe0554104d },
+ { 0xa801f1c43706eba9, 0x90b1bd64592c52fb }, { 0x74fa061f2e59968e, 0x25299bb7724463ed }, { 0xafb88d201e166617, 0x964f6306224da0b7 }, { 0xc3d8726e6f95101b, 0xee0ae3a2b1d5150e },
+ { 0xa532bf6cb7ac2e97, 0xdf62f99a1a141f88 }, { 0x136e187cb8a71d7d, 0x94a429990bd34f32 }, { 0x806c3937d6ab08ec, 0x77059051b98beb07 }, { 0xdd8524ba5798c858, 0x357d8ec5f93e174f },
+ { 0x43b44b59b93e18f7, 0x990f73f3085efe09 }, { 0xe7f827544055831f, 0xc688227fc01cc7d8 }, { 0x2fd4b417c8bd6efb, 0xe14af3579bc64bb0 }, { 0x1a669c93c397497c, 0x9e65883f86709ae6 },
+ { 0x41482e9b2573b109, 0x5a06e0df6ff2b2bb }, { 0x65687ba10ab3220d, 0x728421021e3b606d }, { 0x2c5602b41a37727a, 0xa2a6c86d2e3c215b }, { 0xd9beeefdac025967, 0x706f6b9d37a58fe8 },
+ { 0x286dc8f3e1ade345, 0xe7b42d35e0a7b9fc }, { 0x35b228840b2a2787, 0x7f2f7b681db6d156 }, { 0xf32f43ccd1e213dc, 0x54d2d584b0ae7aa6 }, { 0xa44c6c0df96b9be8, 0x5f87518cc84239d1 },
+ { 0x723da99a498eae4f, 0xa332edc3db73b7f8 }, { 0xf5e8ec49b6352b1d, 0xd2c9a3f01999aeb3 }, { 0x7b352d7532befa4e, 0xa9f34c6556d0622c }, { 0x2420553a2fc09304, 0x2882c1dd71c9d2d6 },
+ { 0xbf5423ff743b67eb, 0x410771a59c64856e }, { 0x34ccfbe545ed92f8, 0xffcad37ecfe0f70f }, { 0x67941e6396fe8bf3, 0xb18db22e79972cdf }, { 0x0d334ea880aac53e, 0x4fd344fe43384d73 },
+ { 0x162b015a0dfa393d, 0x515364d7171ef1cc }, { 0x1ca13316a44071bd, 0x187efe4b2f474ef3 }, { 0x50da53250199058a, 0x0dab5a6a038db13b }, { 0x42ca9838f7f9ad88, 0x19eadbe5da08d850 },
+ { 0xfa27c723aad247dd, 0x5e1374223d0daf72 }, { 0x6aa750cb16544ecd, 0xfe5ef6d03aaf61ac }, { 0x5358e586d313190b, 0x4e476150b677dbd0 }, { 0x8b98d81a31d6f513, 0xbecda2db53847261 },
+ { 0xd24a0fd04b7fa498, 0xb9a75917ddaa168e }, { 0x1210cb1df660a802, 0x1441818fd985696b }, { 0x8112ea56986cbd93, 0xf7e038476bddcd5e }, { 0x0a8a324ca9ba4880, 0x492d9a9c3859bf3f },
+ { 0x9a0aa5a4153c4190, 0xe960186e3ffb71e1 }, { 0x9f4fbc82a06165d0, 0x2c9755202336cf1f }, { 0xc7e3b829940f8124, 0xab1806fa7f4e8da9 }, { 0x57632fc128898834, 0x0b55840878ec4377 },
+ { 0x5c97ceeccff475cb, 0xc29db68292e3da11 }, { 0x8964bdd8ad9b5ced, 0x7dc431f734283ed3 }, { 0x58ac04ab346ee4f4, 0x878f53da5c7842b6 }, { 0x71bf1f399b04b2ce, 0xe0ded6f96e89dd13 },
+ { 0xdb428b3f304ff099, 0xb366f8b15009c35a }, { 0x908097e8bc860910, 0xa04d82f207a2cede }, { 0x21654c1c9a9db744, 0xed758c936d046c28 }, { 0x05451926b55d2440, 0xc5f74d4e1ccdbefe },
+ { 0x881a6eb9e35ce992, 0xfd2199e1e67e188a }, { 0x29131b92af6a563a, 0x6751852332f19fa5 }, { 0x090884ef7b305401, 0x0ac1a1a68da3d5d4 }, { 0xd5f37334626f2926, 0xbf598775a6cbe4c2 },
+ { 0x82905cf54ae6a112, 0xb40c037dde27a7b5 }, { 0xcad0f68114a5441a, 0xe4cb42043c76c0da }, { 0x4d05b352eb1ec148, 0x95300c37fe9cd991 }, { 0xaec65e4150d1d368, 0x16aacb10f01b86ee },
+ { 0x51a480444f5eb0f5, 0x8d4ef27cd1db9762 }, { 0x0382b6a3d28a1c81, 0x43ec3b3ab5fa6aeb }, { 0x59d2d7ca7aa9518b, 0x076afbcc8e2e64ef }, { 0x30f731a2be7703c7, 0xbad83626017b6fa8 },
+ { 0xa97f22a579c15ed6, 0x105415728b7a74a2 }, { 0xe3c3ed13bbcf1220, 0x839ac7270e875f7f }, { 0x5a506169a8234d0a, 0x4486c0f63bd40e04 }, { 0x4840aa745e43e508, 0x50c74179e251676f },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x6925e668c4de524c, 0xbdb2cdea8f550b47 }, { 0xa077a64a02f10ad7, 0x1a95b4d406d9a176 }, { 0x522636e79dd4ac74, 0xcea2c9466421fd89 }
+ }, {
+ { 0x4a8c95c20416aa99, 0xf8ad0a2149f0eb63 }, { 0x97a1b595a3dae393, 0x38a835097fbd191b }, { 0xbc21c5a63b2bfd88, 0xdb448a653eadb5af }, { 0xe1aa1a276c2916ae, 0x5c57eefdcc8402c4 },
+ { 0x78cd74e05509be8b, 0xfba46169375123bb }, { 0x2e0e9486a62882bd, 0xfebfdcb1b571b810 }, { 0x23b213069724bd69, 0x6ad54767dc878ca9 }, { 0xb838155ddda04db1, 0x7eb9f6819107a540 },
+ { 0x954cdd09d07ebb6e, 0x8b370b7bc9e8118d }, { 0xf9fcbf787d953038, 0x041c25e0a8fe62e3 }, { 0xb2e71ef4a1d1b63e, 0x441f30f8bac58dcb }, { 0x6a44da1638c46392, 0x99496c0d78e96b17 },
+ { 0xdcba14197f9e6595, 0x78ab20116d86f633 }, { 0x3e6a52ecb8410759, 0x2fcdefa74c9cf82a }, { 0xe03d2e69b47b3a31, 0xe4f9f1c4974f068f }, { 0x83dca3045b38d64e, 0x4c277afb29fa49ce },
+ { 0xbb42498f765639d3, 0x7588d7ca7c99a99d }, { 0xdbd9983032e3a1ce, 0xd6677dbe2fb2ea01 }, { 0x4e954539e29d1aa0, 0x5d5076c5e65afb8c }, { 0xed81a9e9857705e5, 0x70936a12feb93236 },
+ { 0xf059e803aa12bfd5, 0x358bc2d26ea246b5 }, { 0x5c1cebcf8f50c7b9, 0x3fbd7ba1a9e2b320 }, { 0x3c873a70cbe55fa4, 0x9c52d1d5fac9f0bc }, { 0x17074a43531441bf, 0x7fbe6eb9bbd95c08 },
+ { 0x7d4390556bd0222d, 0xe6f702b4c330371f }, { 0xd488772c704bc6e7, 0xf192d81af011d62e }, { 0xe998791263fcb5dc, 0xd56e16f6511322d9 }, { 0xeb75118e1058ed21, 0x66f12884e7462a4f },
+ { 0x70ff17d55adc1df9, 0x729d9962aac603a6 }, { 0xcd49e63db9a5ccee, 0x11770c3ecfa0b242 }, { 0x037a5cd2abf67462, 0x0b31214bed9e0cdd }, { 0x1f3529765cc1e2cd, 0xf68796b2264e7c15 },
+ { 0x8c8d4c181990b167, 0x6bd2df5ff65975e1 }, { 0x083263350fd5a372, 0x8939f80b9d97201d }, { 0x73854b07f12a699b, 0x79acb82947580f7b }, { 0xeae225c0c80ac1be, 0xde5f37bdbc8d2e04 },
+ { 0x42bef6f70bc309eb, 0x7194f22ad467cb7e }, { 0x131e9ab8b59ff186, 0xda43125d14734ce7 }, { 0x9ce98a7207f93483, 0xbaa0ec490fb435db }, { 0x19c19111c9ee0a09, 0xe0e5d4243fb1646c },
+ { 0x55b9bcb458d74854, 0x0e2a9c936fbe9776 }, { 0x87c573ffbdb36677, 0xe9da061f86505921 }, { 0x2ce3fc1ad58cda40, 0x4d20e2c30324b086 }, { 0x222527484f7691f6, 0xd27b585e874c88e2 },
+ { 0xfa86e3aad663445a, 0x0f2d04ab45606e3e }, { 0x6bd3ee58e0964f0d, 0x21e7733423226f5c }, { 0xb413a69334fe5efa, 0x527d726ea33a95b2 }, { 0xc2180921fb0dabc7, 0x3682a99a10038e6d },
+ { 0xb58492ddecac7265, 0xead36d57f8f191f9 }, { 0x7571f3606405815f, 0x6fcefabf5ea71702 }, { 0x46a7260ced48b9d2, 0xd4698ece7bcddb91 }, { 0x693e86c4933217f0, 0x92784d46957767ca },
+ { 0x215f7b9ae480e594, 0xd94a79156ad2843f }, { 0xe80f4d5cbbae9943, 0x6dc009cf0ad82692 }, { 0x5ef18353fcf49f44, 0x8c2245d31fb7bbb6 }, { 0xfc725bcd434cac9e, 0x194f463d5c9f7647 },
+ { 0x7bb72832feffcae9, 0xf0954022dacf2f66 }, { 0x7cd4a41bb3820eb2, 0x5e591d8d98fb3354 }, { 0xcbbd5e5a2c8a242a, 0x07154ea8d65faa3b }, { 0xcfa48ea1ca019413, 0xa2e8324c79f5bad4 },
+ { 0xab268fe5683fbc37, 0xa4fae4dc8574e9a7 }, { 0x9d7ebe3cdfab181c, 0x020ef370547f3190 }, { 0x37cf05976fc688b4, 0x1e5a08958ac0dc7c }, { 0x0c2bb3cee95e134b, 0x2cc484ef323d30f2 },
+ { 0x63e18d6def43ec7f, 0xa8de8b3fbeb54f41 }, { 0xd51f4362a819ea78, 0x493cc723abdad265 }, { 0xe2d046f5c7df62cc, 0x5766cfb6211a0e19 }, { 0xa5e054b7f2c5f781, 0x3ba15e41011cd1c3 },
+ { 0xd8a3c4e29915d5ac, 0xdd565cf5c22ce6dc }, { 0xb769fa419f082a98, 0x594c53254ea4996f }, { 0x6cb06271adeb8b56, 0x8f2b2e9b6116736e }, { 0xa47760f92a97db1e, 0x830f41785ad7d588 },
+ { 0x1dd841ea2f65ba30, 0x4518a8c0901b7483 }, { 0x795a40ae8d5b9214, 0x430a7e506c9a27f0 }, { 0xfb11d7e40e3168c5, 0xb7831b921eab6a75 }, { 0x35226d0b1c62d049, 0xadc536e73c95d4ea },
+ { 0x45dd7ade46becdb0, 0xdf58af859653d74c }, { 0x313bbdf0fae96070, 0x08384a03933fc405 }, { 0x20c84fd43cd2c90b, 0x61e4662c31198074 }, { 0x058ee4b53ed99ca6, 0x1d5363ddf46114a4 },
+ { 0x1c4f75a4f73796af, 0xfdb6b7f9cbd070c8 }, { 0xb3702aba79839aa1, 0xfcb12fc1e10e8980 }, { 0xbdb6f1e8e379d117, 0x63ea955c6566b1e4 }, { 0xe6c9960e2154d2f5, 0xf29bb3528eb01ef6 },
+ { 0x02ed689c73a458fd, 0xb39f3e72b6550896 }, { 0x8beec03154ed753c, 0xc51e82f0b46d69d3 }, { 0xa9cbe7791b9be4ca, 0x1765daae3321e131 }, { 0x779c9bfc17a1d9a2, 0xdc51c4cde8f21f94 },
+ { 0xf1cedc4d7240934a, 0x8d25ddeb356942fe }, { 0x963681db7b88cf0c, 0x80062a3024761d50 }, { 0xef6cc175f6d35d18, 0xc30c546048ec3aa0 }, { 0xb00a7668d275eec3, 0xf7800e8a0c90855d },
+ { 0x9a1d321592d6dc47, 0xacc2aedf164b2da2 }, { 0x0adf0ba97c71fb8f, 0x3aa6c6792bc2288b }, { 0x50375801660ed4f2, 0x1379ff4e9bdf83d2 }, { 0x6276b9233711c0e0, 0x10709406e57e4b0a },
+ { 0x760bafb2cff3f53d, 0x64ffdbf4b3391bdf }, { 0x93b8656e455153aa, 0x9d5549edd01709f4 }, { 0x91550df236f50b57, 0x2eca779f66420162 }, { 0xeefbf53b2e817187, 0x7ba24b5913273eeb },
+ { 0x0ec6db529afa4bb6, 0x9f5bba9d84683864 }, { 0xa69a0865593383e3, 0x30907f0aec82dd1e }, { 0xd27ccf4be5642e23, 0xe7f09a8ce9eece57 }, { 0x1ea21d388493ce52, 0x4e29898b7d85785e },
+ { 0xf73a642ae76f7b8e, 0x9b479f7d2c965a87 }, { 0x147d1691f8e235dd, 0x748f4ff2564750d5 }, { 0x80a6ffd6f0cea22c, 0x47165bb0c4644513 }, { 0x27abc3fd71af0d50, 0xcf283b83732d9c46 },
+ { 0xf44038f84c990fec, 0x9076be36c108565a }, { 0x4b1ba18cdc448606, 0x40031518123bef28 }, { 0xaea86b5056e62091, 0xb9a987017115fd03 }, { 0x8a79f47f8cbf59a3, 0x7db09dc9efa66d98 },
+ { 0x3be4b65986989bff, 0x329e8c7ab8fdec8e }, { 0xc57b8508b6706f9c, 0x984ef4355237925f }, { 0x365831d9b794a42b, 0xa6f417acd10bd837 }, { 0x3ffd66a260132bc6, 0x9763f09e1757fc61 },
+ { 0x0419d0fbe68bb039, 0xa5fd7ce4afaa10ef }, { 0x0f51ef1c42a86729, 0x27f5a5a4dfa33c2f }, { 0x07638c294d7dc45b, 0xaecc5daf42341c32 }, { 0x534d04d3cdf8a090, 0x1848de0576418f0f },
+ { 0xc38f3d6f235f8758, 0x8e2cb6a34bc88a26 }, { 0x94dbe947082c97f1, 0x33991442922315c6 }, { 0x2d74c8540ddef6df, 0xf58efdfa58efb4cd }, { 0xf2b4809fd9b6e728, 0x8614fca0d8f74e23 },
+ { 0x3a7382175ecab760, 0x8a309343e336e8c5 }, { 0x28fa2ce133076a79, 0xe8dd9e27ac8ea069 }, { 0x7a201c7c26ade676, 0x483b5f1b81042b2d }, { 0xc4ecb1466e224303, 0x20e0eb0c09fc9614 },
+ { 0x90c239bceea727c8, 0x966468a63d890529 }, { 0x3909dec5f53cc302, 0x8101b2080ea8e418 }, { 0x3241e122511f1412, 0x03096b487ea1c8d8 }, { 0x30ac89be22bb4cef, 0xb096553ac8f4c04e },
+ { 0x67f85d9609c85c46, 0x0d23f7db111f5fae }, { 0xda4eac7eeab18d51, 0x6ec962877479ee4a }, { 0x5f66b71d24a6b3db, 0x348c5aea447cbffd }, { 0x4329c2b9d3912574, 0xc93aed138faccf35 },
+ { 0x52da309d15aa8c0f, 0xa0e6c13c2d8a8b44 }, { 0x8903a8ad27492dc1, 0x7681bc8202386145 }, { 0x33d6d56c894d388d, 0xbba77471256acc93 }, { 0xde577c850c3a3d68, 0xcb341e63dbd3fea5 },
+ { 0xf323b4d101e4cbb7, 0x3ebae399833c4a68 }, { 0xaf3f5f1e8eb40c0e, 0x010798382adef948 }, { 0x4c782da59139425d, 0xeecf48b7500ff31a }, { 0x5b7f67e6c22d03e2, 0x9171260eebd6af12 },
+ { 0x74e6c72ebc57adc0, 0xd760e586056c1349 }, { 0x1856a55f11bc2696, 0x584bcb1d647a6027 }, { 0x2546ab61020b55ad, 0x7cb705f1c57894d0 }, { 0xfde56f839b1e8001, 0xa1e159040754720c },
+ { 0x64820144a23e2824, 0x0612d690fc815373 }, { 0x865247b165e14ae8, 0x51741926dd9b5d6a }, { 0xce33baef1253b88c, 0x1a462d75223ebe9f }, { 0xadd23782fd1054f3, 0xb298a64a9c8bf1de },
+ { 0xf86b8b36a5c71ca7, 0xbcb23ad9f33566a8 }, { 0x6fca3ea3061dff34, 0x841a0fd08c887fb3 }, { 0x296d18afeb5546e6, 0x5073811ef745a422 }, { 0xc8c70288877c5048, 0x0c246fe33bc1a6e6 },
+ { 0x98f05a89e17284ba, 0x1f5d90ada01e2534 }, { 0xb6fece0f475a0607, 0xe1e24c1c156f9d24 }, { 0xff08071fe8bad8fc, 0x127e6776b1017a9a }, { 0x47301242351a954d, 0x6cc791f72006dfda },
+ { 0x1289aef66dcddd19, 0x62ed0d644fb848ac }, { 0x15ea22df20b01942, 0xcc2150cb0d8c549e }, { 0xbeccad3a488fa575, 0x68dbb41788f8bd39 }, { 0xbad57dc1ae04154c, 0xcd26c8f32752add6 },
+ { 0x5754d4282b7310a9, 0xbdb5a2e1d9eb9fe0 }, { 0x610ce5f19ce7b482, 0x1b41b54d08e047d7 }, { 0xdfc048cbd46811f7, 0x739a015a8018faee }, { 0xe424fe9252f08a08, 0x41048d2038e51660 },
+ { 0x7e39cc87c026564f, 0xedc623ff2eae3bc2 }, { 0x0b483fe7a423d710, 0x8208d94070092cc0 }, { 0x3d100e3e13b7733b, 0x24fcceeca102f4f7 }, { 0x542e88fa808564cb, 0xb68483aa3475933d },
+ { 0x16907e0d8b466d20, 0xc7107180e0125843 }, { 0xfe9f335130e8f463, 0xaad0784feaca7ed1 }, { 0xf5d70cb694cb2373, 0x28d8a10f9ac35211 }, { 0x09a5577bd7878fed, 0x3197e732c65c2456 },
+ { 0xbf5b997490dd89ea, 0xd075ab2ed333b972 }, { 0x6d27563f75b9a7c9, 0x378531a23add7725 }, { 0x24d19f2fda597932, 0xc4191ac89eb3909b }, { 0x2a17447d40a33284, 0x5b42a0551adba8ff },
+ { 0xe34772bb1f8d4e53, 0xefc8d08f7ad10a52 }, { 0x72127f4929784504, 0xc102a7101c930b30 }, { 0xa70d3c2b8161af7c, 0x883e6033b749d955 }, { 0xd10693994e925a41, 0xecc1bbc70470c28a },
+ { 0xa06eb002cc1c6b27, 0x26f23d9cf57dc567 }, { 0xa85cd337c3c9c855, 0xafcbc59768eae57a }, { 0x263cf7b3a9fd21cf, 0x778624ba28e6980d }, { 0xccded27361f7e071, 0xa9d91307946bb609 },
+ { 0xf6ad50643f3d5711, 0x23e98044775d5ecc }, { 0xe5b3cadc8aa2a697, 0xf9aa9219632e122b }, { 0x666f69d8d19a70d9, 0xb58de8e24ad45be5 }, { 0x7faef8c918747ad0, 0x55683cc675653f89 },
+ { 0xaab1bbabb06d90a8, 0x1c54fbe5debfedec }, { 0x2b80703398f11e1b, 0xe3ecbf6c4110acb4 }, { 0x40539e6b78675116, 0xc20bcc586232c3e8 }, { 0xac4503cc2542786c, 0x0a36b973c740f595 },
+ { 0x444a4e909eece12f, 0x67f6b0bccd98d307 }, { 0xa314ecd067ea1f45, 0x2dc31cd718e3c9ba }, { 0xd934f0ac4147f933, 0x65f843cc99e7e297 }, { 0x609bd1bf44b5981d, 0xa3efaa74532b439c },
+ { 0xc601d9da1d861bfe, 0x937fd57ebfa99e82 }, { 0xec169da75d25297a, 0xc83d752ba572367d }, { 0x4861fd5e77b2f264, 0x4b323453ffa5e3f5 }, { 0x8131cb98289c8eb3, 0xffb844899faf4158 },
+ { 0x59920f7ab1895b1f, 0x22ee187c5d83a784 }, { 0xb9af211305f2612e, 0xc617e9b8cacca10b }, { 0x1064c66a1e6985e4, 0xd1723316f9ed403a }, { 0xe75ea240f906fe6a, 0x4a35ac6bd57b1abd },
+ { 0x5ae853a81a7f2f7d, 0x29df3937b01dab59 }, { 0x9b8a065b4a84f0d8, 0x146cb1e64d8029e9 }, { 0x4def19eb496b6ec2, 0x5661578e0bc4f751 }, { 0x56c3e066f3213c36, 0x051bbdd882209bab },
+ { 0x8d1a7856c1c29df8, 0xd37cc066ad9271aa }, { 0x5d8bdf815702eb26, 0x87136498f229b76b }, { 0x4f0271773acf363f, 0xe5fe69fcbd91ffc7 }, { 0xdd2d2057a7cc490a, 0xc0053f28364df278 },
+ { 0x0197344ed8522c9f, 0xb8ae1f395bcb044b }, { 0x1b2cf98dba4a52f4, 0x537aea5689e46cfa }, { 0xd6651fb003ef9e1a, 0x420de6684644deb8 }, { 0xc16255f350fbdfa5, 0x3db388d1fd9d82b0 },
+ { 0xc796ed94c5d43761, 0x2bd1ca47e4629ac9 }, { 0x922f51209d037f35, 0x25fb56d48bdc0dbf }, { 0x11f3f224c63ba97b, 0x69dc2c2fa2264471 }, { 0xd091a7d796c076de, 0x546fa4fe5fbbc6c1 },
+ { 0xca2a6a14f4d808b5, 0xbfbb51918d94ae70 }, { 0xa283d89ebfb833da, 0x956d03ee4328cdf1 }, { 0xd3ebfb053d3602bc, 0x5f5e85b5b225ca1c }, { 0xc95036c65f2e7cd7, 0xb48a70da600aa2ad },
+ { 0x6e5d0aedde4fd3ab, 0x3cb410e9d7437bf8 }, { 0x2f99a0c87e7aae22, 0x4611c388eebabc5b }, { 0x7168239b828e3166, 0xca33865bf10d07ed }, { 0xc0f561bd88a9f33a, 0x851d97e8a65686fb },
+ { 0x8e6024846a34e99a, 0xd84de12d400c7d77 }, { 0x1abbcdc362187e6b, 0xebd4f56fd22f68b1 }, { 0x8ff710cab266c505, 0x60e3fe141bc7793c }, { 0x68a9b28a4b603b6f, 0x2ad6527fcebc6381 },
+ { 0x58053b3469db7780, 0x9a4007450648a3cf }, { 0xb19d42260a27c25c, 0x4f2e11b3575b8116 }, { 0x49f6c910afe0defb, 0xf39c2b6aa46ee7be }, { 0x41c4aa25a0357d89, 0x7aa5d36139f9c7a3 },
+ { 0x88949ce3ff1b015e, 0xce2fa3bb59f3650e }, { 0x85281b63ce173e8a, 0x5a45386d300551b7 }, { 0x6515350a7a6c04bb, 0xbebcc9a9a74a5738 }, { 0x51a06c4fbe5cf86d, 0xabd7e077c0148799 },
+ { 0x389eea8b2d6eef9d, 0x39afad315563e053 }, { 0x99676ec73920a825, 0xa7f38f94fbd5217f }, { 0x06f4b867952fe8c4, 0x1662429619ff1879 }, { 0x84bf2f2d16451215, 0xe2eb27546bce55fc },
+ { 0xd7f22bfedbbdb285, 0xfaa3f9511d8fdaf3 }, { 0x34b55945c430fcd6, 0x156b29de675ed0a1 }, { 0x9f93d6a0ac0f40e1, 0xb191cd02e22a3906 }, { 0x0dbc8780310c3fd4, 0x946a9bd669f634b9 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x824b974a836afad1, 0xf48965c272314d85 }, { 0x9e04e2ee745d6c7e, 0x093fd23bb9e13d4d }, { 0xa1f9844c144e47b8, 0x9e5c22a5aeb6c12c }
+ }, {
+ { 0xd52f8dc690a455a5, 0x5d1b72cb89048071 }, { 0x179ff9364e75902d, 0x15a48a485aa38762 }, { 0xf3d45f9d804c9f32, 0xe9183dae643b6cbf }, { 0x157fb14b6d940b8f, 0xd386ace4dd6c1e81 },
+ { 0x6d5d49b5a58a5f0e, 0xf572a8ce1c5532e7 }, { 0x66cbc620faf84130, 0xcec905c160a6279e }, { 0x77b7e791d16dbf38, 0x520be5be7097c81a }, { 0x5baa9e806e66c7c0, 0xbea2148243dd9c3d },
+ { 0x43a078d93960bc54, 0xdff97f5ea8d0ff23 }, { 0x63b872054c6818e6, 0xe29c5a0c0f7d7b0b }, { 0x9c695e5506275b9e, 0xda48b3ccffa1c7bb }, { 0xdc594a2eec37d039, 0xa082f96872380ceb },
+ { 0xe84ed566043ad355, 0x2d706388aa7f3bd2 }, { 0x83f04454c450e27e, 0x5164a171fcb861d3 }, { 0x3f8110ddb77f1d52, 0xb64937efa4b42240 }, { 0x5adaba5f9ef76b91, 0xddb307d4e15b31ad },
+ { 0x256bbef9c398fd64, 0x11307a9fc876d8bd }, { 0x3ef1340247eeb103, 0xd55824b906328fd0 }, { 0x7d514cdb7e8e0d57, 0x0aa15be7aee270f3 }, { 0x2efd316c9ceae35a, 0x2a8bd790b485cdc4 },
+ { 0xdaba92a989d7be1c, 0x29e4935f38aa640d }, { 0xcc554f4037338260, 0x5f510a41c08f4eff }, { 0xd7cfc5bbb345ce07, 0x9b3954670ecb1992 }, { 0x338463107d7cc118, 0x6785e3813053f24f },
+ { 0xefdd293e914b1121, 0xc7071ae9426bfea4 }, { 0x7bb2945c1b6e6372, 0x83c731d0e4701815 }, { 0x8683f07172c0bba8, 0x7d31febc93633d46 }, { 0xd2bc719e05d597d1, 0xb76c0baa61104507 },
+ { 0xfea1088fbadeef29, 0x5bc5fa96525a1120 }, { 0x278bf684e07966c6, 0xd7125c334fb9415e }, { 0x7ec12079adfe3aa4, 0xaf926e1d8bab4480 }, { 0xa078222a6228713f, 0xc932b1d97e5cd188 },
+ { 0x1f991a01c277b9e0, 0x8b2c12bd0319a668 }, { 0x93fc413a1f54b027, 0xaeb752584e0f23c7 }, { 0x806028f61720d58d, 0xf457948bd9f155a0 }, { 0xf842d008df3e810c, 0xd2a390a118c879c6 },
+ { 0x46d3ccfc8ff0e582, 0xf3ac2093c70ba3b6 }, { 0x9bfaa20d935699ea, 0x303fcaad17b502cd }, { 0xfaa29875fcdf1aae, 0x1481b60d9f07e025 }, { 0x5c3962d8fb1705b4, 0x54d56de3abc9594b },
+ { 0x7557afecf28c249a, 0x9429c312f75851f9 }, { 0xf2a47b4270dd3363, 0x8a092ef8c6bdc12f }, { 0x32f447cf8ded6d49, 0x0494f0d792d55fdf }, { 0x5d4946070b86a9e5, 0x37c47eb5094ff4db },
+ { 0x1d79527ce1962242, 0x4d0e341184d63f8b }, { 0xf6a7ebb836dcc6e4, 0xc54d62630be0302a }, { 0x60281ea79f182f15, 0x47af6ff62a344f78 }, { 0x62c856dabcf9b4b7, 0x818d495aadfbd69b },
+ { 0x4ad6bf3145f339c8, 0x2260f4fd53ec73b9 }, { 0x7c2168048e1fa106, 0x69b048b10c64dd63 }, { 0xeead0de161dabd70, 0xa41609bfe0ed5334 }, { 0xa2986a5741c9ea9d, 0x0f109775f993486b },
+ { 0x2388667ea6789341, 0x985610a882e4b05b }, { 0xac7d51e7a82bad75, 0x18fe65b7eabb0187 }, { 0x986aceaf4026ae19, 0x950cff5732fc36be }, { 0xe138128e78a956c9, 0xd0e9e82b5143b748 },
+ { 0x139c69cc087465aa, 0x5ae0c6d397fe7667 }, { 0xc52388a84ba007fc, 0xa2c881e23bb3c265 }, { 0xdbcab6767946124d, 0x4af580099a2cc99d }, { 0x73b4776b976c4abf, 0x1d4fa925bdca391f },
+ { 0xc0503c8dfd305e2a, 0x8e9dde2f54689ef0 }, { 0xd05c39e326340c73, 0x714e2d06e6dfdce4 }, { 0x3af2a4f801ef4484, 0x9a1c6822cb6f7ed5 }, { 0x3b828027f17ee8d5, 0xf90d7b7469e9d345 },
+ { 0x655baa82298876c3, 0x6bfa303b45ef13ed }, { 0x514c35cac18575af, 0xe608aadb9da824d4 }, { 0x6bbe9132c06a312b, 0x7c14c2f956c75a01 }, { 0xafed3d457b5b9a86, 0xbdcd504dcff235f4 },
+ { 0x4030147bea108ba7, 0x7aca4aa48d99cb50 }, { 0x1ee93ede32e615b1, 0xe83d01eba19f0bf8 }, { 0x20180adc7508a4b2, 0x3d652552a7ad8428 }, { 0x85139cd3a1b08c5b, 0xd802cb46b62a0935 },
+ { 0xf447a3c5153d5d46, 0x036f44cf8c2fa9c9 }, { 0x47a3e8237f6149d3, 0x90bd33c5658d0e26 }, { 0x3787f3ea3b7d349f, 0x28c1af1afd0e034a }, { 0x6ecd251776fa68fd, 0x50419d34391c0694 },
+ { 0x906c2d98cc2487d4, 0x0b8467a26b4617b4 }, { 0xc6b3e40a98d0300f, 0x07fbb4181efaf616 }, { 0x0976c7e87c93859c, 0xfd998ba3fb3c8c9a }, { 0x8280608b34c14e2f, 0x3275b2275e3ecc43 },
+ { 0xdeb90253cfd64b9b, 0x66a0dfc4f5f79508 }, { 0xb697ffc3dccc4d43, 0xbf8728c78679fb7a }, { 0xd92afe0b5aa789ef, 0x8cd7a6a51de3507e }, { 0xc3c0502f2e4069d9, 0x2baeebd57121aa83 },
+ { 0x543f81ef77152c79, 0xca5df516f2737841 }, { 0xc926fb6581a3dbb6, 0x7304558caf54126a }, { 0x946fbd628a257253, 0x44c02b39a61be6b1 }, { 0x281ee9ebf90a8d7f, 0xa3edbda7fe17a522 },
+ { 0xf044333f533ca8c1, 0x4c2b0854417258cc }, { 0x3d6158a0949e86f0, 0x706b1143237bbba3 }, { 0x7ac2b083ebffcf23, 0xe0d6228646f6b585 }, { 0xc856dfba713277e7, 0x101546da0dd2bffa },
+ { 0x06e3d88765e06e25, 0x89666a374a9268e6 }, { 0xc7c3c0d568419c5e, 0x64eaa74ebc7c5b86 }, { 0xf7d7cf67c64d6ab5, 0xa65c7135a9669dba }, { 0x4fa50b14f363601e, 0x0e35ab303c372f2c },
+ { 0x02e0487d23e19ba2, 0xc62226ac87cf99e3 }, { 0xbfe1382ba05fc8df, 0x421ea3647d4577e0 }, { 0xebdeb9c4d74ae4a6, 0x884356728f360fa1 }, { 0x503c11153114d9fe, 0x8519b98d3f2e8944 },
+ { 0x6fbd01c8866bc4ac, 0x33508e629b9aab04 }, { 0xd12c1d3cd6a5a022, 0x125f3e5044597174 }, { 0x87f3d4ae825117f9, 0x1e20edea31e590d6 }, { 0x8a8683bcb8c367e2, 0xacfd2ad20784ed49 },
+ { 0x0c0573cdca03dc4a, 0xd1ccd46e94e7d00f }, { 0x4d454369d082fbbc, 0xc8178d9cbbf8b6cf }, { 0x241b9a2633095135, 0x722169c96af0752d }, { 0xdfc9268c3f47e7ca, 0x05b1cc9257713898 },
+ { 0x72c453b467fde6ee, 0x7e5eba731f4c948f }, { 0xffd12c504a4f4378, 0x38d4e9c0f0dcbcb0 }, { 0x42d05c06c9f11005, 0xbce86c080a5652b3 }, { 0xe3d85af35b48cd6b, 0x16cbce87d68c2eab },
+ { 0x017024dff091ac51, 0x63111356a286ad90 }, { 0xb477b7beff2dd6e1, 0x79a50e6b01b66299 }, { 0x100c056edb045259, 0xffd3f329b2b74214 }, { 0xa90ee5c21ebbf4a3, 0x34ab3a7a85605d12 },
+ { 0xa87ec11dee2a58f2, 0x57ba292c27e6f082 }, { 0x4543a05e5c80d271, 0x569f1569e24297c5 }, { 0xd6bfe16443d46256, 0xf8284731ac4db402 }, { 0x8916ef1e6bb35011, 0x09ce1f2822cdd93a },
+ { 0x4836f74c6612a26a, 0xe442d251d423ea5a }, { 0x695ed94fe38baa89, 0xba36e455d108c3e2 }, { 0x180ae65957067b94, 0x615b6bdceb0d631e }, { 0x8e851346fec29265, 0xe3b96649cad91c4c },
+ { 0x2b8e85492a7aba8c, 0x06de885ddb5e9151 }, { 0x9a8a86d263c735bb, 0x532ed9fbb533af5d }, { 0x3962c85ad29f7377, 0x3f2f5dd8ee264aa6 }, { 0x9e89162825c6c03c, 0x1c6a9560786e5e58 },
+ { 0xc12018520da1f27b, 0xed8ccd79f6ee3360 }, { 0x554fa53087848028, 0xa94ce64050f5d5d1 }, { 0xb872c473352e0aab, 0xa869da059551b296 }, { 0xec4d459c423b26d2, 0x62342f136722cad7 },
+ { 0xcd256b9fc7a22e31, 0x3c4019176209e36f }, { 0x140f95949d05a7de, 0xb097bfb27feab311 }, { 0xb2946f399acdb8c4, 0xf0c3645c4b240a7f }, { 0x6c2d6d6a551bf35f, 0x9663bb98bed39f77 },
+ { 0xa3e84e88b15846cc, 0x6c0184235b15e5fb }, { 0x9d197a8af6b6f7cf, 0xb959a09a5d276a2b }, { 0x928c65e5efc51c76, 0xcda6410eec898e57 }, { 0xbc715489732fff2c, 0xe72d969e580c4393 },
+ { 0xa47bb2d0242984b8, 0x8676fd42b301208d }, { 0x682efd90131a06d8, 0xd927f703738e6e72 }, { 0x296ecd34099b212e, 0xc0fcaef15c9108b2 }, { 0x1aeaae2474e7e036, 0xa7794d706cc2fafd },
+ { 0x56dfc99254f4b7db, 0x0c7fd3ba75bce1a2 }, { 0x76c7c34e21fc1369, 0x311af6e8d211658a }, { 0x8bf6a7634852cbb3, 0xcfec3984a50240d9 }, { 0xcbc6b318a2424014, 0xb5267320289b8b89 },
+ { 0xb3e44be66a5c1495, 0x93d2770ae9a2a7ef }, { 0xd85adad4aa3625be, 0xefc6b5f3bf65fdee }, { 0x594ad6fd4d875c62, 0x7880322ec41205de }, { 0x3c117c7f640f2aa1, 0x137a021581fd1633 },
+ { 0x4946d39396830e3b, 0x8753c10776a547ca }, { 0x5ed92aa5d8f69e16, 0x92f74b4f2c06c0a8 }, { 0xb0742744b92c2366, 0x36e142f0cceb939c }, { 0xa50b960fd4b828e9, 0xe567ee1411878d1d },
+ { 0x52dc596812f5425c, 0x433b9f21b8e110a7 }, { 0x34179f48e80d036c, 0x8df29ae0d8473739 }, { 0x9ff932f7d5576c6d, 0x7f7b8636dae8f3c8 }, { 0xc453ac77bb31abad, 0xc1d992b499356ff5 },
+ { 0xb104039b49bd8f37, 0x55f051a66e6d3e0c }, { 0x67bbe2ff0a69ed61, 0xadd81697c2208a0e }, { 0xa7ebde72f759b34b, 0x2345c8b8964814fe }, { 0x0f951f6f1973ebb9, 0x74ffe194b1aee47c },
+ { 0x21682e03859908e3, 0x5e743604052b29b8 }, { 0x31642b6d5e9d5aba, 0xa1a7c52db79c6bac }, { 0x968ff51fa9c4e9f1, 0x82e20d9521d47f52 }, { 0x97ffd1c0595545a0, 0xe1f31ec38352d2c2 },
+ { 0x911c09473cb52b85, 0x689574f4c9c0ba24 }, { 0xed3d6143b2aa8a83, 0x01253c45c5a46747 }, { 0xfd31642d69aed8da, 0xfef6cf6c77132553 }, { 0x5fa90e7a28673247, 0xf1e658198e806d38 },
+ { 0x197ac286a797d7c5, 0x024a788a498bce8e }, { 0xb50793610fbc7ab0, 0x1ab41d3da330cf09 }, { 0x583af222bd16f033, 0x1b9121786694a84e }, { 0xb902e0acc5bfa6fa, 0xcb78c95337d71f06 },
+ { 0x8d157fe42db2a596, 0x468a53b3ef90283f }, { 0x0ae6ab4aafe3b26f, 0x58aabe59de75b8e9 }, { 0xa10806f592b9dd6e, 0xaa23a28fdcda7c18 }, { 0xceb5073d14d219c2, 0x99732ced4740d71c },
+ { 0x414030a41a8127f6, 0x19db59f22f1f66c0 }, { 0xaa9e8960cdcbc350, 0x91980f80a0296961 }, { 0xfbd2bcaa0c4eb6ff, 0x7790a55b3d814db5 }, { 0xf932f4d72faf2d5d, 0xb1b283f7ba4ed456 },
+ { 0x2d6d5dce4f9ad4a9, 0x8fb8e26a91ccf9b7 }, { 0xbe911cf450ce648e, 0x210fb032dfc3da70 }, { 0xf537871ae5acf117, 0x607e57992ea90459 }, { 0x0d7557123a92701b, 0xb2ddc73836617d9f },
+ { 0x26fbd25b10e8ca97, 0xb4034f65ed3fecce }, { 0xbd01705683be537d, 0x843c85c8fa8aee03 }, { 0xe7dbca091d4938ec, 0x598f821c1bd1dfae }, { 0xbbe2a8d1e65e3d58, 0x0d5aefffb01886e5 },
+ { 0xeaae9d1b27db48f7, 0xeb5245242db0a231 }, { 0xe44ba6abce390f1f, 0xfcbcb7e63e98ebdd }, { 0x12ec4d13f8e5c9fb, 0x39f1d5853578dbf7 }, { 0x16efdde9bee43c7c, 0x76b5991ef8252af2 },
+ { 0xba928c0e16cf9109, 0x6e4bfca9129e2b75 }, { 0x53ac7db7e264ee0d, 0x202a8c771a67bd37 }, { 0x6aceb5ed30fb9d7a, 0x1f05d1aff441f791 }, { 0x1b9a8afb84764c67, 0xc4685e26ce44576d },
+ { 0xcab697c752d3ec45, 0xd63760768a1d2619 }, { 0x040390fa4601f587, 0x4f444c9bcd5df105 }, { 0x81100c29e7b179dc, 0x974687dd7b77f830 }, { 0x0ee53bb0e9e247e8, 0x17eef2c2132849ec },
+ { 0x4ed52fcb03f2cc4f, 0x6d24b8669eb182bc }, { 0x71543f16b48dd11d, 0xdb6d8f893a05a0fc }, { 0xe53b82743ea8a34e, 0x9fada4b09c1e464d }, { 0xe93ef1b9f4ab7f04, 0x4e6170de08f99642 },
+ { 0x30140fb2ae0cf6eb, 0xc2b6d67b151ac63c }, { 0x2c1d7911bf0b78f8, 0xeca9f13c334a5427 }, { 0x03906ca2d37037f3, 0xa53335fa25493473 }, { 0x0b968f955f721e3e, 0x3bbbad0f7cf31579 },
+ { 0x3567bb97189caf3d, 0xeee389b67ac19aa9 }, { 0xe6abeed6edd894bd, 0x3a9e914ab957723e }, { 0x57afed4da4651b8a, 0x6f6ec0ecd73a4c32 }, { 0xc2b074f0ded1c588, 0x48bff883d3a70713 },
+ { 0x2afea196daeb16dd, 0x65cf9b0b79d83cc1 }, { 0x0806e3378c0229cd, 0x9e8898f559ba210a }, { 0x2f8d15b36c7b4f0b, 0x499ac4c616036054 }, { 0x1c0976a311078e13, 0x2e1f27472650921b },
+ { 0xe04836518838fa98, 0xb3f8fb7df3c51ad8 }, { 0x951f99bd7ab4de02, 0x27d1386f049d4b21 }, { 0xcfc523e2e443b593, 0xfa623fbbe5c67a8c }, { 0xd3cc5541f5443b80, 0xd47d18fcc396e897 },
+ { 0xf13417e0a3ad0490, 0x2f3a1b02e3f4f55c }, { 0x7952dc21388ff8d0, 0x45e5177c63bf81f6 }, { 0xad0d753858ba0124, 0x7bef76e1483dac17 }, { 0x8ff537990e533e34, 0x80a8751f685fb1dc },
+ { 0x74278b33021d88cb, 0xf738d04455defc69 }, { 0x4c3567b6201357ed, 0xab069eca197e1b5f }, { 0xd45fa9196035f9f4, 0x3e0a619d2b822de1 }, { 0x36f7d735cbec98ce, 0x4bd0bc4c5f88aeda },
+ { 0x4ba69beeb5629599, 0x4171e7abf16ade29 }, { 0x22f842a156e93f10, 0xfb4703fe20621dcb }, { 0x61583a786f898344, 0x24be7ca088b2e2e8 }, { 0x8866cbc19b22fc40, 0x6adf0c7e804b74aa },
+ { 0x642b8e5dd919da92, 0x08eb236de769be7d }, { 0xe2a87e2cabd9613a, 0x75daddd1740a833b }, { 0xabeeadbf3d5a6f01, 0xf2891cd602afc4f1 }, { 0x3812ec85220edf26, 0x5c3e4e8e4ca0e736 },
+ { 0xb7e7db1c2c5de112, 0xdc963b9124ff56ea }, { 0xa69bfaad07c81f1a, 0x4054dbee34ceb96e }, { 0x991aea70b0b70248, 0xf61dec01907a9b2e }, { 0xdd296ef11ca67c68, 0xc393ea3ed0bea17b },
+ { 0x7fb104a65d6f96f5, 0xcc837d4b292de910 }, { 0x7822f8fec81e5481, 0x26f4042ac1392c66 }, { 0xfc4140f2993f748b, 0x9de7dc3ad59588c3 }, { 0x8c655b3bdd2309c7, 0x259b40e54d1685af },
+ { 0x0573b425b69059d6, 0x2c555fcd6fdb5c95 }, { 0x44338481ac117e20, 0x358e063f40c43a55 }, { 0x8463b80c5121200a, 0xbb13d81014aca4a5 }, { 0x117c21b12b95fe08, 0x9cc2e07f1031ef84 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x70241bc9441c7d4c, 0xb87c9cdf98830d6c }, { 0xae9d199a8bca36d7, 0xdedc431b6d749864 }, { 0x0793fc589571c274, 0xea777961e814c576 }
+ }, {
+ { 0xca4bbbc9cc5ff651, 0xe6efa2675bea527e }, { 0x10cf72f803a5ae33, 0x67ba66b80641dbac }, { 0xd0c26f5217156aa4, 0x868e8b942ecb2670 }, { 0xfffa7ed2a5e5de67, 0xad6ecea889194a18 },
+ { 0x4afcad05d43ecf0a, 0x587614ee6ba74557 }, { 0x09e69792fc9d84e7, 0x591e0db63b707c2c }, { 0xeb76f114d6f8ba28, 0xa31b503e6fd9d79f }, { 0x241e190d7631551a, 0xa778349dec0333b0 },
+ { 0x6aa14936d2b7506c, 0x96c1d85d672530cc }, { 0x827789d3203d5c65, 0x6b1fca9e40ec34dd }, { 0x750bce7d656bd5fa, 0x142c376aca34f293 }, { 0x66648d7442bccde8, 0x2d53132f8465fab1 },
+ { 0xe7b3355646f327ac, 0x18899b4c8c991de2 }, { 0x5f108c2dbb0d785a, 0xdd40b492b5d628aa }, { 0xc2cd82b52ceca1a9, 0x34b2913b582bde28 }, { 0xb2e51f1825116d30, 0xc21260954a2f9aea },
+ { 0x6347dea42e2ad48b, 0xcfdfd5eb5c554ce0 }, { 0x543684a07fcc9983, 0x51d8c533fe077772 }, { 0x3e97cd96ad7bc9ef, 0xc7191d6e992247be }, { 0x205de43306899f66, 0xceb7ccb30c82759b },
+ { 0x943b990a6b7c5d14, 0xb0ec281fd68d8aae }, { 0x120fede73bf9cb0d, 0xb23c1aaf76e0f858 }, { 0x257eb7e36a1f8605, 0x2c3b0a77d4b2c3ca }, { 0xe573aa497eaf4292, 0xcd0fe75bfc383e16 },
+ { 0x8317273d3c138f7a, 0xe05cf474785dc4a7 }, { 0xccc8d9e884bb5913, 0x5aa6265ecbca37a1 }, { 0xd481926c67ada0d8, 0xef4173bace4a605b }, { 0xaeefa9a2b6bf5e87, 0x1e3acd5faf2e8b3b },
+ { 0x618741bb1676b1b5, 0x1a59a9fc2cf46f14 }, { 0x8c72d28e886aa4df, 0x050b7dfbd30ddd54 }, { 0x4759c7a9581b8191, 0x68a7e176b0567f50 }, { 0xce0846f7bce73c2d, 0x8f205a49bb6b1455 },
+ { 0x2a1b4250de66ada0, 0xc96c83f87fe2da39 }, { 0x2b7becbec2487ebf, 0x422fbd1247532a43 }, { 0x26de86124e6d3024, 0x72fe488a9ca21044 }, { 0x93d855c53fb62149, 0x87e692cc7e1c1f0b },
+ { 0xe13057770e1788ee, 0xa4c01f751cb9783d }, { 0x11afdc161f8b7d2c, 0xecf958523ef02bd6 }, { 0x7ced59ef99f6511d, 0x4d323adcf1448ebf }, { 0x40ba0b660cd1fdcc, 0x5fad5ba518c7eaf5 },
+ { 0x0443fd3e70b8ca7c, 0x69cff82ee081462b }, { 0x463969474435528e, 0xe3e4df9c88e78f2a }, { 0x7388ac5c2d8f7ab8, 0xa865b3535a14974c }, { 0xd6410d735ff1c5e6, 0x3ac70fadbeeb43af },
+ { 0xc52e4e7a7826ddf4, 0x03b82be8f0ba4b8d }, { 0x5b537113cbb5b226, 0xb48f4cbc55576e81 }, { 0xfbb983ecd55d141b, 0xc4a1368669980c33 }, { 0x148c8fc6731d644f, 0x0e759e96e6c09d87 },
+ { 0xc68e7f8b5c546bd5, 0x5d7d6915b8aa9803 }, { 0xa86ccb83fe5bf1c5, 0xa27349663f0eeee4 }, { 0x15ec21286f33b750, 0x8536a07cde716dfd }, { 0x213d4add1aa74c79, 0x45f4f259343385e1 },
+ { 0x9118cada07ea4477, 0x5260eedb0ebd3cff }, { 0xe9b66e0beea4df16, 0x769d2c291f78f46b }, { 0x6861d629eaeb3552, 0x4347a44a17841338 }, { 0x4b9c03ebc8101c15, 0xd3352a045316b52d },
+ { 0x0da56aac8c254e9b, 0x30d1f598dbf13a07 }, { 0xbe20db5ab51af0b4, 0x7980abe7a96f5097 }, { 0x02c09f1f385c653e, 0xd5867c1770a123f4 }, { 0xf61ce94059785a80, 0xf470c31eb2693634 },
+ { 0x35b1c51b69ba2836, 0x4b816ccfd2f31866 }, { 0x41daa58810ff2ed3, 0xd4ee654f20761a8f }, { 0x495c9cf4f04c792b, 0x06b3561323b796d9 }, { 0xdfa79ae1a36c4101, 0x63d9021b859b3f83 },
+ { 0x70289dad09fdcc99, 0xf6a0f1ae120444c2 }, { 0xf1ff258f0db226dd, 0xc37a79cd1af8a391 }, { 0xb8a3b97bfdfe5ff6, 0xc5c92fde394f3548 }, { 0x907864341bc49768, 0xd923d031360ccc85 },
+ { 0x136f430927d71812, 0x397f24454e510822 }, { 0xbce044458d46958a, 0xac06d7f0d9ce7363 }, { 0xe8d6c0e5f28a0c09, 0xfdde12c327c90411 }, { 0xad4f985392cde8a6, 0x40ff8fa2e73e58b5 },
+ { 0xb4667d396df5c272, 0x7e5be4acda0fff35 }, { 0x77cb51625d37b0c4, 0xc1aa4b7dba95d167 }, { 0xf819b21df12fa23a, 0x9a64747b2188dfbd }, { 0x3332a73a215e8774, 0xf7c8e8f642d37db9 },
+ { 0x52b5e681372836c1, 0xed91410a6e2712ad }, { 0xc7eed165407ab8ca, 0xd63e57ff801b6879 }, { 0xac2f36bd8ee33bb9, 0xcbbcb148df8fa8cf }, { 0xc9eb8a38e82d4070, 0xb82ae09a13fa81f0 },
+ { 0x8951815ee4fcbdbc, 0xe787bb3f0b3d6b05 }, { 0x483c321aec62aa34, 0x8df068f91b0666a3 }, { 0xedf593359e1c156a, 0x1f52d407fff9b240 }, { 0x4c7fcf249cda6048, 0xe43f90d7fb872088 },
+ { 0x7a6e3bced112fe5f, 0xf17bbee56164eb60 }, { 0x999ef3a6e759138f, 0x803ddd870d7cb0a9 }, { 0x4fdffed5b8a8d669, 0xbafad22ab397f306 }, { 0xd202f04d2f490f9a, 0x5308f7835e6a0584 },
+ { 0xa90c656de27522da, 0x2930778c07bf1e9e }, { 0x2df88e9f8aacd1fd, 0xfe66392bd7734f9c }, { 0x5a33dffdd79b6139, 0x3fcc72566de69efb }, { 0x0f65f5b3b4792ba5, 0xe557898fab5019f3 },
+ { 0xf25f147e29c090fc, 0x9dbf3b3052e8701f }, { 0x5115d770135a80e0, 0xb35403f72637c123 }, { 0xcda8770698958a0c, 0xd1e518b4f37bc7db }, { 0x4d1f61ca80f4b357, 0x6f7cae3dc336d0f2 },
+ { 0xef350c2aa6407054, 0xcad4a8108f5891b4 }, { 0xe41304a76281918d, 0x464cd9b1c489ce6c }, { 0x9e7d3f69b3936fd2, 0xb7376754a5ed250c }, { 0x6704239a5e921ef7, 0xa6102dc5bcd40acb },
+ { 0xa5c9a12f727ebf5e, 0x92a2bcfee4ffd4e3 }, { 0xd721a39d43df16f9, 0xb1843147865ab3d5 }, { 0x427a9479348d98f2, 0x8a2b27b26866c901 }, { 0xf33fba9035ee43e3, 0x16fc05da6a598065 },
+ { 0x27be28fc5243e33b, 0xf9bd7660a413e03e }, { 0xa22a6de026b4c303, 0xa5a8062d4c6e4146 }, { 0xf5bcd8b17d0aeca1, 0xaab581e3fa79e5ba }, { 0x1faa874bb7dc8596, 0x82edef37ad11c25f },
+ { 0x60e7ef550a5862aa, 0x911a971614459f6e }, { 0xf77c47ae4556899f, 0x7f33fdf48ad8c64e }, { 0xfc5a4f2381976846, 0xf3ab8c55c1099996 }, { 0xa4a90fc16e506c41, 0x19e18214dc4e2499 },
+ { 0x96fb06155320382a, 0x656a5408a62ca95a }, { 0xa7093e304a22da60, 0x4724c0e9945ef717 }, { 0x746b6093794506e5, 0x9f6f0980f28502e9 }, { 0x6227704a32040794, 0x449ceb0164e4bc9a },
+ { 0xf4dc765f61243fbe, 0x21f6bf09c2c815c0 }, { 0x98fe5d48fb77c090, 0x0b7ee36d35cd40d3 }, { 0xb385b1f6393fbe2f, 0x49515e7f729e6a90 }, { 0x8af1b0afc08e0b9d, 0xb942f9c2432db88b },
+ { 0x29bb73a1fa141b81, 0x97a9c10537f209b7 }, { 0x5796b5515bbe2fa2, 0x0f1d87ceb617a4fc }, { 0x4ebf503ba4860576, 0x31b9ecc08b26037c }, { 0xee55a2c4ba6ea34b, 0x419796fab7e961ce },
+ { 0xabccfa72da2947e4, 0xfcb60b9b771e3d6a }, { 0x8754da034cab4506, 0x89930c5a98dc828c }, { 0x309296cb052c3155, 0xa90daa0b0ac3ae37 }, { 0x9a3ec257c32ba5ae, 0xdef89f7a456c6327 },
+ { 0xa34ac30e3a9a101c, 0x2eeb38c774dfb13c }, { 0xec953ddb8232c675, 0x9411eaedc748423a }, { 0x80b716cc1861395b, 0xbe99b689304d1729 }, { 0xfad92d02c973c704, 0x4fe2086c5129fc49 },
+ { 0x84f4ebf268d9f327, 0xd7564ea7d0cc5102 }, { 0x690178c7f6c5e64d, 0xc8049aa02f35e342 }, { 0x55562a4e63e24a9c, 0xda9bfbd9c6b68708 }, { 0xdc07ab10871ef720, 0x3d1c40e6cd8bec0d },
+ { 0xb7c64cc849877453, 0x209ea651921f2cbb }, { 0xe3f0c868364bedd0, 0x714663626c185bc9 }, { 0xbd80eaab91684695, 0x2745e91ae17f8319 }, { 0x9ddd0e9897e1d9f3, 0xe9f225a9edfdf682 },
+ { 0xd3625ea33367dc85, 0xd84bc96966dbf5fe }, { 0xc16db344089e1788, 0x6a77d3c6103b0da6 }, { 0x44f9f6587c6937b0, 0x3662a38bf846acde }, { 0xa18a5c1102c67522, 0xfb6d44d0047e92c8 },
+ { 0x955b37e477528e0b, 0x3baf16f5ee3c7ad4 }, { 0x7d8df70185d88202, 0xc6710436c9f57ec5 }, { 0x65c4bc8566ce7bc9, 0x739651d2cc75293f }, { 0x76abff8c411963db, 0x4ae975978224211d },
+ { 0xc3ad2c5b30c272b6, 0xbff1afd1609a2e52 }, { 0x7b0e9520cd3c2d40, 0x7a38800f59d51b1a }, { 0xcb2b1527d071254e, 0x6dac9c8d635ba204 }, { 0xbb03888ad98ce9d7, 0x9b0c6d23715fe6c6 },
+ { 0xbf4075b4a93423ab, 0xf2c3950d91dea0ed }, { 0xaf8f074caa918d98, 0x9579f3b5979f7b41 }, { 0xba632664c5a23ac8, 0x104f53c949ee16bc }, { 0x459958b66047e4af, 0xbd219d61c0f75ca4 },
+ { 0x88312fb0f8d26ea3, 0x6cc485d5338c9b7f }, { 0x81d7b822044fea44, 0x35da886308fce753 }, { 0x0cc5c442900b9d84, 0xbb92cb72e340ca7d }, { 0x28dbdd4fe63ac89e, 0x1ceaffef0f43f9cd },
+ { 0x2c982071968202e2, 0x752507c1efc2bfe6 }, { 0x9f1d9187afbdbccd, 0x3c7459be9d5cd576 }, { 0xaaac549cc60794fb, 0x77f535714fafcd10 }, { 0x5e7022c3a723ab45, 0x56038a788d67d8d0 },
+ { 0x7e2dc6f0a1aa3423, 0x98b446cb81e5ad4b }, { 0x0a46a663d8ef32c6, 0x07db4f4b7360afa2 }, { 0xa0eaf2ff1ee8a63d, 0x702e7a3a3ccf62b2 }, { 0x3611f4ea4dc89e17, 0x15442e329ae3cbe8 },
+ { 0xc44ee09464080eeb, 0x88fb1502c80bbbf7 }, { 0x6c222b179a53ff2e, 0x2a885c64f7055513 }, { 0x18494b84e316f9cb, 0xb5e755e4058057fa }, { 0x39740159f9b1b5b2, 0xf013a7bd31b3d21b },
+ { 0xd844562ef7a63d5c, 0x54d3b8c82d0aaa26 }, { 0x31f238251902e24a, 0x224e94e132725e4d }, { 0x5dd0133283511d64, 0x08c6c885c5770b5e }, { 0x164c10d94b410171, 0xdbf3e2819661be73 },
+ { 0x979ba8fb4f0eeb35, 0xee296ae29e9d5920 }, { 0xd5e13c827b8373c7, 0x64024d50f6fb9021 }, { 0x58f340e2efc70407, 0xea4a0e411d47bd0f }, { 0xfd3ae1cd9db9bb59, 0x78e8b2bff9b869ec },
+ { 0x8594451c74f72038, 0x5c15704de87da178 }, { 0x1be97a75c7644fea, 0xeb2217194d908474 }, { 0xea165ffacad66937, 0x28586ed4576827e5 }, { 0x052353d06c961963, 0xe28cc6c4d830b651 },
+ { 0x5993ee0cf3e9d718, 0x610930ab25f64d75 }, { 0x72e802b231a1a9a7, 0x23268db962a56736 }, { 0x229d7b2c3ed5fa58, 0x1b31b0a47c23566f }, { 0xb1452ee90163db11, 0x9cd72268023f4964 },
+ { 0x1a89d49bdb4a9cf5, 0x606129f37521740e }, { 0x0b26088dc4c1e1d9, 0x8c9871a14bd15fd8 }, { 0xb9c31795e1d08ce9, 0x4e8a113401fec532 }, { 0xf9791cf3ed017125, 0x11274a9119392fc7 },
+ { 0x0886397ce0b357f8, 0xd25d335c03c18c56 }, { 0xc00d1daa14b0c497, 0xe134ed2c288afddc }, { 0x9b5e6cb9df0576b1, 0x55bba1907ddd935d }, { 0x863474ed50859619, 0x02d032b0a06d72f6 },
+ { 0x6f821ae6be21490f, 0x744d1e99bf15869d }, { 0x1eca29a5abf25689, 0x09aed1dd95a03225 }, { 0x2e58bf6eaede67dc, 0xa0a37bd69f639c12 }, { 0x37715a0451e64d08, 0x9e0710d8a2523b92 },
+ { 0xe050f99912395bf1, 0x2f83219f24088847 }, { 0x1d6a18548f80e0a8, 0x576b9320ddb0e1ab }, { 0xb02580071d4d080e, 0x17941c823a8eb91e }, { 0xc88b24d6f403936f, 0x3369de702b4b718a },
+ { 0xdbe467dfd3d48b7d, 0x0a16fa35651a79a8 }, { 0x1929e56aff382ad4, 0x3ea46b0e3d31a780 }, { 0x56f61bbf4790fcbd, 0x845eb9248ea65486 }, { 0x7148334315d31f86, 0x7de3cf442ab5b4b8 },
+ { 0x9cbda0768bcf0aec, 0x62b11b43d54c06f8 }, { 0xcf68e819a0c9ef32, 0x046364a383dae42f }, { 0x79ce0a3ff560487e, 0xafbefc18297438ee }, { 0x431a3a9728a34bed, 0x0168195850d7397b },
+ { 0x172cbe37576fd26e, 0x50b0dc6baed04e09 }, { 0x2f381180b2f0b4c3, 0x2be0453ca7d26c68 }, { 0x03a031f12472b621, 0x5ec542fd4810d38e }, { 0xda84c931cffa5862, 0x8155c4df5dab89d2 },
+ { 0x3d37fc6789097fce, 0x99dc5f93d1329430 }, { 0x3ad430a8ddc30393, 0xaed6e54079a30195 }, { 0xb6a6e22655a9a74c, 0xabdd98bbaaaedcc1 }, { 0x53d5486f2b06e5de, 0x66d27fe05696e2d7 },
+ { 0xdd6705fe9b30243f, 0xb65f7e0cf53a1c77 }, { 0xd924f8c0eb88ee43, 0xdf90862215bb5a5c }, { 0x6bc1e7d8ce998373, 0x1d82e6b75f94c0b6 }, { 0x3814afb7e59f66ad, 0x7b50995709022261 },
+ { 0x3ff76378b1551af0, 0x4c5a2384a193b7c4 }, { 0x23fdd5c222fb2947, 0x90728e4e4492a615 }, { 0x7f4d681ebd84e73c, 0x13f77821b9545d31 }, { 0x78aea4d1e94e9b61, 0x24fdc2f211c5c894 },
+ { 0x92b8fb2b2398f256, 0x0ca5ac2646adef71 }, { 0x34d16bf57594fb29, 0xc0c25225ea42e81c }, { 0x5cb0bddc9f7fce7b, 0x8385f66ffdc6fb24 }, { 0x6ee2b408a20f9a10, 0xff0e207387a476e7 },
+ { 0x5075799e0f7453ff, 0x38173d1d1e863159 }, { 0x07e3cccf54ca7c5d, 0x370abad3a89195a5 }, { 0x6d4285f9867d2c31, 0xa1cb628ecfb4a569 }, { 0x1c0ab6ba93ae33b7, 0xdc28adcae50111d1 },
+ { 0xe6d39bb85addf4b3, 0x93caa5a6b428ed98 }, { 0x325209d43d70546b, 0x7c8bd61c7a628dc3 }, { 0x8d127c60944477c0, 0x8e484311ebbc2d2e }, { 0xa66990de560c097f, 0xcc67fe03acef076d },
+ { 0xdec7340fbf42921e, 0xe89a3cf1bd2acff9 }, { 0x3c5752899527acd1, 0x129f6179e983644a }, { 0xfe9ad03cb9cb0d78, 0x262df042b1a8ba62 }, { 0xf09f8b61119cf5c2, 0x48394727224953eb },
+ { 0xd1a2c1bc0b3bb9bb, 0x0dcdb57e167ad60a }, { 0xb506d3d771db116d, 0xf518da46e2be0f4f }, { 0x8eb24d91b036c1e1, 0xd08d01eca3acfea0 }, { 0x0160aeee1c2ed31f, 0x8b433eea38b1f07a },
+ { 0x8b911e41dca0d882, 0x3201c7287b9c48f1 }, { 0x0e055b5da857f8ba, 0x6e14b76593e1e989 }, { 0x3bb49e46c1edd08c, 0x2595dbaa4112f1ef }, { 0xe29066862a653ecf, 0xfa055d8854a9abb3 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x8fd2e37fac1812fe, 0x5bce3f069b1d0eda }, { 0x0683622148e4af42, 0xbc498439902065df }, { 0x64a4126b7ae0a8d6, 0xf8d56f38f4c4d945 }
+ }, {
+ { 0x1cca2ad2f8e059d8, 0x311da87247255817 }, { 0xef10645c3874b669, 0xc0b7538ae9aaee82 }, { 0xa1d0914adb41d2c0, 0x89df013d8f5eac55 }, { 0xc7ff08545cf7bfba, 0x8edc20ac4e91a432 },
+ { 0x684a8c77fbc6a016, 0xfeec75a8033c248d }, { 0xf409a55bfeac6887, 0x6c3cd105cf17a0e0 }, { 0x63eb751f6a9ec558, 0x7e3617e50cf09071 }, { 0x5624d1af7ef56359, 0x73f0c214ba5cc506 },
+ { 0x756a44cf8b2e0fc4, 0xbd41d37f12ab3b4a }, { 0xb0824b4f04c99f6a, 0xd73eef5af09d111b }, { 0xe175713544047b05, 0x395807b32b59c268 }, { 0xa8666ff69909989a, 0xeda67ff92c3596ca },
+ { 0xbee75e2678b95206, 0x2ed1bb63326e3df1 }, { 0xae5f66492f39e9a6, 0x02805ba11b1fc76f }, { 0x8ac218fce4da020d, 0x51a76037d2702f56 }, { 0x42b2e7ab4c5586d1, 0x54241a0708a0e05e },
+ { 0x8163e19475826743, 0xd17d027addbc9baa }, { 0x9e542ef8d67ae785, 0x7673b824608c0a0e }, { 0xeb3e6a375d54e841, 0xcb326b5b72273144 }, { 0x1d20c8b870e8afd2, 0x43ada6d711971fc7 },
+ { 0xd094dbee354f832c, 0x3f1bea93067848d9 }, { 0x2b1289b63f9bd0cd, 0xd878610a5d2e8303 }, { 0x342546da9c63500b, 0x7f76db54e01e12a7 }, { 0x7ae5b3cc7f5634a2, 0x361e89e386ea5070 },
+ { 0xd283dc3ae65fac38, 0xdbb8f61aaadfc6ba }, { 0x93ccde2ff112f3f7, 0x198ffe31586aef57 }, { 0xead4885dd55c1e4b, 0xb98265fe24957694 }, { 0x70aea8ce6606a7e6, 0xc474e50bdf94a35c },
+ { 0x45610c7e726d01e7, 0xc9b230fa6938f62b }, { 0xa98c8d9c11016e90, 0x9f16715c7a87d11a }, { 0xd747303b0b77041a, 0xa28dc06e67e05eac }, { 0x57ce33c5f6fd9553, 0x0140ccb1ecee82d6 },
+ { 0x4f2a177c6b3d92a3, 0x3bd85c1230460507 }, { 0x2d2b800989aba1f1, 0x375e45526a04d2a6 }, { 0x92263c45791a05fd, 0x6b3ff0940ed8a887 }, { 0x3d93b866de2b1a51, 0x1b0fa59043752838 },
+ { 0x31e1aadb714bf829, 0x0643ed202d218ab1 }, { 0x8d11f329dae2853b, 0xcc314acab3e83923 }, { 0x157cd46ebaa81382, 0x5564d6b6e44e6288 }, { 0x3a4053b3e0139d67, 0x86998f6d22ed3e4d },
+ { 0x4b0419170e1dcc8b, 0x305d64c3abcbdac1 }, { 0xb546a74ee9e13748, 0xae0bd92e3da2890d }, { 0x6e7385c84df6d12a, 0x11ca51f034167528 }, { 0x2ed665b7d2b378ef, 0xa14d577e90111b15 },
+ { 0x67c57b740fbe9b70, 0x75b32f34977d4fb7 }, { 0xe55b7f5e2124252d, 0x32dd3f62b0d41dae }, { 0x8cfb114352ea7331, 0xbe81446fe55a7ef3 }, { 0xa4147d4b36697ae2, 0xf0ea374942613443 },
+ { 0xc1c601ebeac7ce86, 0x61fa04f479bbf597 }, { 0xffa85c336ff40dc9, 0xece6b348c0db141c }, { 0xc615ea3ed4ff49b0, 0xfc6c2e091823e3e2 }, { 0x7f215fcd927e9c80, 0x4f2bbf974bd5c866 },
+ { 0xf991558cd9c47cf5, 0x03c09710f7f145b9 }, { 0xa7e998f56d71a3fc, 0x66f92565b874fdf0 }, { 0xb168a9258cc16960, 0xa58ee1ffa62f56cb }, { 0x0a4b1b0219509344, 0xf26a6ce8597ef32c },
+ { 0xbf0dbc4cf0b1a40c, 0x5c61b5c664dc7a21 }, { 0x9fbecc925e72118f, 0x04c3b681363e4dde }, { 0xc402edea07ef66a4, 0x18cf3280b4846d81 }, { 0x33f6ad0fa25bd73d, 0xe2e0f1a9818604d2 },
+ { 0xdb352286a417e662, 0xbfc188de09b4fc25 }, { 0x5841c4c60285ae35, 0x8a1f962d78afe9ec }, { 0xce49f6e81ebff5e0, 0xeaa55e68edfa9ead }, { 0xdadfc0ec2c1f1068, 0xcd71867b5f06bbf5 },
+ { 0xc870ff57a88f84dc, 0x05837a30dad0cf08 }, { 0xdef1ce87493f4e40, 0xc6f4beaac48b6433 }, { 0x10b8386f5780bba0, 0x2c51e0c22971fa9e }, { 0x9b90c2f93b524fa7, 0x0f468e50adb39218 },
+ { 0x49131ec3dd0de39f, 0xd4fe784a076c54a2 }, { 0x5bbc2178599d772b, 0x1c0c840182ba205f }, { 0xc5e80f808fe790ae, 0x6a7f3c25e2362a51 }, { 0xd6add251837ff210, 0xd03dcecb3152197c },
+ { 0xcdb4135645a72cfe, 0x7cb64c4417ef571e }, { 0x25779cdf43eb1da1, 0x219735339fddafe9 }, { 0x2af86bdcb79326c7, 0xaac86faf0b9cc4d3 }, { 0x5433d67bade54c4d, 0x9753de9d16fb4b65 },
+ { 0x1152da05df884daa, 0x5ee1ee677fc3bd4e }, { 0xa3c7969e0851fdd4, 0x6d7c1db423f92236 }, { 0xb4ac452461e9c142, 0xdcbbd78b6b10cedd }, { 0xbac9504d1d990c2e, 0x255483b2a9e3e237 },
+ { 0x808903fefd8a9149, 0xa3cd0cdf8b0edc7a }, { 0xac48619dfc29c6b2, 0xe6234728b7b8490c }, { 0xeced81e2636c6f77, 0x56a441a613bf2731 }, { 0xe74c788af2340a39, 0xd67e23eb1c7393cd },
+ { 0x9a7a2093b35ab9ad, 0x7df680f5fb01d5c8 }, { 0x6f9967a2c5fe2720, 0x637a5f5562a432f8 }, { 0x414f0215174d5fcf, 0xc237082bf2b529ed }, { 0x65d27ca0dcaeb464, 0x911033bd3bdac1d4 },
+ { 0x9da9cb468d623e9b, 0xe060aa089a99c3bd }, { 0xa22d74f480590bde, 0x1fcc1311754b65e6 }, { 0x875ae82bc3b2167f, 0x3e5b2622ea96ca0f }, { 0x7b0f51a6f75ec2a8, 0x44ae8746d05817a0 },
+ { 0x78f2b418ac461bb6, 0xd2bd956a2a4dde13 }, { 0xb751a09a3af1185c, 0x4aa8c5a79105076e }, { 0xf1cd495a1384c0a5, 0x1509e771022838f6 }, { 0x854defff10a2396b, 0xdaf83aab4631446c },
+ { 0x28ef6c08648309d3, 0x4e6b7326a73b4ab0 }, { 0x18e424b99dc007f0, 0x3a9890a3dca887d1 }, { 0x829e042a2e9abe5d, 0x476e105627a95219 }, { 0xca67f8837b9fabc8, 0xe12066b97677416b },
+ { 0x40a5e07f9f45a9c5, 0xb087068ea4076e3d }, { 0x4cd7f2c230254bbd, 0xadcb4e3eca53ccb4 }, { 0xfe42be59e7fcfbc3, 0x9e56bded966953cc }, { 0x1af3236d4ed028e4, 0xde3b8c2a700f09b2 },
+ { 0xf027ab309b8c36af, 0x67b9e9d4549a7f26 }, { 0xada283f7742130b8, 0x9493498de10a0edc }, { 0x95f5d790472282cb, 0xf6a9da696f40bef2 }, { 0x941f35facf2a74c1, 0x8419d4cc39f2f922 },
+ { 0x27609b0b90fb32b5, 0xc53429ba337a218a }, { 0x51f73a7a40cde46f, 0xee66e8e9dbc4d373 }, { 0x61fc72cbb98eea4c, 0x9a950b6ca0571e12 }, { 0x22a4770a7dd39a97, 0xbc011fcefe45b99c },
+ { 0x1496360432a0e588, 0x27d4d813b2fc2558 }, { 0x84a70d9598aacf61, 0xa848340e108303bc }, { 0x8374e640a6924857, 0x35de1ef3711b15c9 }, { 0xe36276e197145411, 0xddfb1b3a87fe4c0b },
+ { 0xf7f440e5a5b4b199, 0xfa2fc32935026953 }, { 0x0d98f0d727681472, 0x6ffc461538e6e559 }, { 0x20b370deaec3b583, 0x58a2034752e237ff }, { 0x268a796118f3c4bf, 0xb784271f65c8665a },
+ { 0xe9296de38e44c755, 0x2f9177d2de80bf27 }, { 0x385754673303b273, 0x623a93e48e4ab02e }, { 0x234e9560f5db6c9d, 0xceb1116ba8f7fe4c }, { 0x4aeefb7d86153a81, 0x42ed6a66fd799d11 },
+ { 0x59ab26ac8a8d583f, 0xf8af98882e1dae3c }, { 0x9987c52de84260b3, 0xebe592d901141c7b }, { 0xf230ace4489c19bb, 0x831af55df83df145 }, { 0xc99a1d3d208772d6, 0x773374958c6288d8 },
+ { 0xcfa3148296b703ea, 0x981550cdbb48d97d }, { 0x8eec169781fa5c25, 0x5a2258e649fdf090 }, { 0x7480a6a50326f9ce, 0xcff1ddda44197c9a }, { 0xeefa8636b07c4063, 0xb2075d2fbf18a952 },
+ { 0x3f84bfb20d3b3545, 0xffacb919efd2a65b }, { 0xd3693e506e575a32, 0xa908f8bffc6d816a }, { 0xfc55b98d34ecd4d7, 0x7af5a1643aceddaf }, { 0x7cdcba73c966459e, 0xd938adbbb1c001d5 },
+ { 0x6bb769c9a0de7908, 0x68ff6784f929ed3e }, { 0xf5e3473176a49e8d, 0x1e8cdfa099a5e730 }, { 0x39bdb60dbb0b4479, 0x108a9d41d8f8f7fe }, { 0x249d7eb5cbe3ebab, 0x53273b96c96fe839 },
+ { 0x07d3ebd53e388736, 0x9d962afd61981675 }, { 0x2cc1626301a357fb, 0x45ee4bf73cb69576 }, { 0x71444aa4ee0e51ec, 0xb6c4ebae8926e48c }, { 0x0ba1f9689158654e, 0x80da624d0fccb4fc },
+ { 0xb2954c9bd7d9b07e, 0x339df3d35c3a9f78 }, { 0x777d431b583e20d0, 0x59e2cff6be0cb529 }, { 0x0e6515697c70cd6c, 0xf9ef5439c2f32cea }, { 0x47760baaa17d2ef3, 0x2d112c73c59f7848 },
+ { 0xe8c38f89064c315f, 0x5d2179778832f8f7 }, { 0xf87bb7e651cc8aff, 0x717099b5a1430269 }, { 0x7ecbbda71a766a8a, 0x3d9bb1321d678fb6 }, { 0xb6bb42f0b2f9ee56, 0x3818cb02c7b740be },
+ { 0xfdbf5be7bce422dd, 0x0845afc16c7c9a7f }, { 0x12af3fbb849094b4, 0xc8f2fc4b85d674fd }, { 0xd4bad585506fdd04, 0x349ed2429df5971f }, { 0x1345ddd10c9862be, 0xba42f2eed364332d },
+ { 0xe288948b1f1ca21b, 0xaf4b159fd14c0bdb }, { 0x168131d0e1b0ca9c, 0xc377c49a1e5bab3b }, { 0xdd0c2b391227975e, 0x50e7ac863e9ead80 }, { 0x8b28fa966cd2f407, 0x23176e9284c26886 },
+ { 0xc02ce38162cf388c, 0x134a0a512f09b247 }, { 0xe09f935fcc0c8d0f, 0x4be809167deb85b8 }, { 0x3baab1d9681b6b6d, 0xf42981c8745f799d }, { 0xcc5ef13ccdafdaf4, 0x0e0642e1415d10ce },
+ { 0xd17e3984bd477526, 0x4dabe43650ca0f09 }, { 0x520adfc41bd53d71, 0x7875fac521d11ac0 }, { 0x69a06e1d73ce561c, 0x8c5c7b0d558e635d }, { 0x7d365819416eb394, 0xab88a31ee7724605 },
+ { 0x05c4ec01ed28a822, 0x79353674cd3f9816 }, { 0xfa6cb03282dca5eb, 0x95d3853c0de48c0a }, { 0x79185672244eedbc, 0xa00d9bcf7cff99c3 }, { 0x063909bfb630713c, 0xef262458372a51a5 },
+ { 0x37d8a364c77b8915, 0xe965c9781a0bdb14 }, { 0x90313b91aa0a2ae9, 0x8f9cec1da27f26e4 }, { 0x6a5d8ba328d68f02, 0x1a4f6921af9baaee }, { 0x601690a131861c46, 0xe82505c9f6e559c2 },
+ { 0x7697a171d036d6da, 0x2b52c153e8bef2f9 }, { 0x88d51f2837ca2d19, 0xb5047cbe7ed7a135 }, { 0x435805c1c45d70db, 0x269414a25e12a78e }, { 0x03fde5be5b18d91e, 0x9613122cfa15c9b3 },
+ { 0x5d8528c7efad0617, 0xf32aa059b59071fa }, { 0xdf1b2cedc137b84a, 0xb444b00f923923e3 }, { 0x01eae26a8808f60a, 0x72b00ea556b247d0 }, { 0x29058e62ec8bffd9, 0x3cdb7d83f1890d60 },
+ { 0x215992b426cb4389, 0x2a120de20450702f }, { 0x0c7212bdaf60e278, 0x1d4c48b06e54a289 }, { 0xd92225527707c976, 0x5b629457a5137246 }, { 0xe4b19d34a92cd327, 0x406d31c7e6665a7e },
+ { 0xbd1abb9823a18b18, 0xb8c2a94fc87bf442 }, { 0x300b48b1f9430e23, 0x74f3e3857b93cd61 }, { 0x72b9af1ab51688f2, 0x20d7f98273332d3f }, { 0x48f9fca955051595, 0xa64e76ef51de1372 },
+ { 0x9608322e1c3a5bd5, 0x60bac84595557741 }, { 0x4ec0f516e33564a9, 0x496852b766f442d7 }, { 0xab9b8a48c2114184, 0x7bb56dd5d6205f79 }, { 0xfb8652580ad453e1, 0xe7638b995b56cbda },
+ { 0x5c6fcaad67a5f01d, 0x819aaefce322362a }, { 0xf61ea28f2dbc4793, 0x889fcd8c63b02e83 }, { 0x042e0e6b65205e28, 0x0b8538d19b8ddfc6 }, { 0x1f37cf6ca3f880c6, 0xa70eba5ebd3091a4 },
+ { 0x53e03dae93ddcb7b, 0x0ac5f46077635d10 }, { 0x501dd810c8c51265, 0x9cd6e64c8d7694a3 }, { 0x86b00a414bbae075, 0x4ceb2887bc248ddf }, { 0xd8c8c738ff0f3f7c, 0x29d29af2f3a13596 },
+ { 0x91dbd9fb2202dce3, 0xfd2ce2b8f4cd6134 }, { 0x1b19c107c6d8deee, 0xac8b828f26bd4e62 }, { 0x5a56c312d1958121, 0x6ebc8aa4d408678f }, { 0xaa7168224a19b78e, 0x09056370809218a9 },
+ { 0x469ce9c02975d8f9, 0x5fa122d6932d3f98 }, { 0x35cfa4b0146ba601, 0x0dc6d5f1b6ac5577 }, { 0x3c795a0c5623ec5b, 0x69bfab3515c76fe8 }, { 0x9c43292c056ac891, 0x92d0a4adcc2b846d },
+ { 0x021707d4d3102f14, 0xe4a31c89aca78e63 }, { 0x662f991e87b66d7a, 0x07032191c1cf0867 }, { 0xa6037a9fe57955f6, 0x14492bc0eec6ba20 }, { 0xf3da4e8ec094efb1, 0xf1aafbf8ae8fb695 },
+ { 0x4d3d10a8b82dbdb7, 0xdf7b409b9ce18b64 }, { 0xa03a7320534924ca, 0xfb6f0f98d9eceb85 }, { 0x09b6febc42484a5a, 0x64797ec4a36b3a9f }, { 0x73534d703d1e7ef8, 0x5267f72725816aef },
+ { 0x1edd2d062bf076cc, 0xd5beb4fbeb82d674 }, { 0x55d9341125edba47, 0xe5e3d03840490cb5 }, { 0x176bd3ba69b83c96, 0xb1c7ca3f48e9eceb }, { 0x64389eca54a6426e, 0xe3a03d186d688604 },
+ { 0x893ffd42bfc2db13, 0xc7b4721b2865e6e5 }, { 0xbb23b2279591fa24, 0x57e48d17ff51a5e7 }, { 0xb37faef15fd14674, 0x412dfd760a88d8a8 }, { 0x5e78cd79b4b5df09, 0x6539b2754f85b849 },
+ { 0x5f922f133cbd2903, 0x1789bcd01937ff99 }, { 0xb934b5f34681d530, 0xb347919e53f62b84 }, { 0x085c1cd6ca40bc50, 0x16c97061f5d97d4f }, { 0x3e6e5dd88533c34f, 0x8d1cb7bcb960e18b },
+ { 0xd55037efd8672b0e, 0x462edce7cb47d0cf }, { 0xed076388eb64997d, 0x24144f03450d60e1 }, { 0x986d2747604a96b9, 0x99559c7c57a65bab }, { 0x321c4f652a532137, 0x9050ff0cd7344302 },
+ { 0xdce6c9539a2f6154, 0x2257a223682cea50 }, { 0x3632410e4f737f1f, 0x9bd5c7dd4cb99cc4 }, { 0xcb8d1ae9f3975dc2, 0x9390681c20c506bb }, { 0xe6a69ae07a3cfc33, 0xa4ce2d4e4ac1d41d },
+ { 0xb8de5799ce89233a, 0xc1f79f3b05446c54 }, { 0x2f3c87dd5abb8ee5, 0xd3fd59dbc6a35cc5 }, { 0xa5fe9f21be618ce8, 0x825a39ec14d37393 }, { 0xbcf059f2aba97d12, 0xca72a7ea9ec9b392 },
+ { 0xc3d1063f39d7e192, 0x8559187dd51c7bf4 }, { 0xafb58423a7311fac, 0x703055044dad80bf }, { 0x6d8e607616ee0834, 0x87d943dcce03bc9b }, { 0x62019775e2963352, 0x0c8619405a42d7a1 },
+ { 0x448bee14fa65f7ed, 0xbb023e5f3f8ab1fb }, { 0x190ec6d315c8f1fa, 0x48289e068a1ac001 }, { 0xc23be455b1df1798, 0xf7e916d883ae3c24 }, { 0x97e2d0449432addf, 0x120ac6e0c3e73091 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x0f8ff703f4783b66, 0x8b5f5a9c94416b3a }, { 0x8f06f4fd09f2aa2f, 0x289256431f4fb740 }, { 0x6c64821c9ee6fe3e, 0xf5694d7998b1fb4b }
+ }, {
+ { 0x13dba88557b945c2, 0xc67b0bb0b9b03f2a }, { 0x2181537c20c25995, 0x36576d1fc21f5664 }, { 0x6e420129639373a6, 0x9d35f49b939b3891 }, { 0x5e9720693d487827, 0x4b6ff58b488b0c08 },
+ { 0xd85975e39466c8e0, 0xb586e5486648ca8c }, { 0x461cd14912c49c86, 0x20421483c48316a5 }, { 0xe6a7170a155ba606, 0x915d12e35be3ae75 }, { 0xdb70c2e74896355d, 0x80cb5049964958d1 },
+ { 0x9a98d31bd4217a09, 0xd9283f7621766644 }, { 0x663bef88c7562f78, 0x052eab2256228f4b }, { 0xc90d07dfea7f9af4, 0x558b89477f47a871 }, { 0xf2887f3acc913016, 0x2e8762ef91efb96f },
+ { 0x8eb7bb2b0debec19, 0x66f24f7aeb7a715e }, { 0xd7d45bf7bed047ec, 0x543cc14dd04d5566 }, { 0xe27a60bb47d88869, 0xddb1dc5ed85e1418 }, { 0x057b1a0ca7d3c404, 0x5fd71c03d30375e7 },
+ { 0xdc840252c6e5e68f, 0xf96a2bf5e5f570e1 }, { 0x3c71b850a89d7930, 0x02ad90149d14392e }, { 0xa6e96b4b7cbc0339, 0xdb85af62bc625f6a }, { 0x42c1a6f84047b2e9, 0x6caeda3e473eacc8 },
+ { 0x73b2ea05ebcc5303, 0xa9cf0990cc9057db }, { 0x8c386192244bfbcf, 0x408428c54bc52c89 }, { 0x6ccddb904a336470, 0xbb43932433246546 }, { 0x230e89c509624e43, 0x10210aa062a00bb3 },
+ { 0xd186f6ffc5f37e55, 0x3ea6684ff34fb2dc }, { 0x27d3fe745be1602c, 0x5ccdc41de11db1de }, { 0xf7f365366b42f412, 0x71507eec42eccc88 }, { 0x4ceae5519fa1d78e, 0x9e2f2c85a185fca8 },
+ { 0x713d30bcc26c44d5, 0x8fb96e2f6c2f0a0c }, { 0xa3927147db6fc73d, 0x8452b3616f612a8d }, { 0x07f4c0b58e73d3d2, 0x79a17bbc73bc2830 }, { 0x8a6acc9a5f68c276, 0x2a1e81c768c7cb33 },
+ { 0x1ed95c2854afdd18, 0x01b7480aaf0afd17 }, { 0xa964455f560a8c35, 0x3a3f8b670a67c080 }, { 0x76c9f0094c1f9707, 0xf61815931f93223c }, { 0xf007a583e53127c0, 0x08f105503150e4b8 },
+ { 0xbabfedda01b3c9f7, 0xfc4480d7b3d7ffaa }, { 0x963c4a0b226708b8, 0x0ddfae7267726bf3 }, { 0x8f11d696f8bb0672, 0x75c99dc4bbc4bed4 }, { 0x84418f33808ea711, 0xd89f777c8e7c9b53 },
+ { 0x99b1641f08d187b4, 0xec658a77d177f419 }, { 0xb049d9c28cd682ff, 0x4229b8d1d6d115a7 }, { 0xfd05512ee627bf1a, 0xcf3d46ea27ea2685 }, { 0x5a4a57d86fcb5648, 0x07833b36cb36b665 },
+ { 0x61cf2f3d4925fcaa, 0x7c8fd09e259ea77b }, { 0x4e653fe8b601c058, 0xb8594b3a013aa17f }, { 0xc72644763599ff93, 0xa70a7ffc99fcf811 }, { 0xb83037632813de21, 0xda32e7681368a27d },
+ { 0x7bcb04a44f090fdd, 0x31d456290929e001 }, { 0x78e2b3a093f9f260, 0x0499e328f928725c }, { 0x0f8d2e142ab68f0c, 0xe1ba2405b6059fea }, { 0xf57cbf8f42e2e3c4, 0x57261953e253915f },
+ { 0x5dbe976de1b8859a, 0x7e22408ab88a9e55 }, { 0x4b1e25e411d2045c, 0xe78e5739d239d498 }, { 0x3721e1f5d0a8d853, 0xaffb7aaca8ac1ca9 }, { 0x6fe46c9496c399cd, 0x8e0e2625c325f71b },
+ { 0xdfadb5561a151b32, 0xcc279ef415f4e2bc }, { 0x6d6bb62dbf638e1b, 0xa878419a639aaacc }, { 0xadb932ee0489a25a, 0x76d345da89da7aed }, { 0x188bf1202f8ce4a1, 0x6b2de1088c081aad },
+ { 0x4d4c88ec6af13de5, 0x8d14fe3bf13b3322 }, { 0x33fc9644822bf63c, 0xe317b4112b11a6c4 }, { 0xc25d5e7a924a3b97, 0xf8dd63ff4aff8df6 }, { 0x1c5686917d0fcace, 0x27c12fb50fb5a0c0 },
+ { 0xe7017ab7e00b4c6d, 0x8266c05d0b5d61ff }, { 0x9b3ebea621719062, 0xca13edc871c8a9ce }, { 0x5963e0dcb33babf5, 0x32ce8e373b372438 }, { 0xea038e1ae31dd4b7, 0x45aa83e71de7a3c2 },
+ { 0x3b8578e526eeaae2, 0x7b0ceba8eea8111e }, { 0xc0d284c3bbea2c41, 0xdeab0440ea40d021 }, { 0xfca33c9313775571, 0xdc0694547754e90f }, { 0x56eecec8998d24f9, 0xd374aa328d32bbd2 },
+ { 0x31734cfdab8be1ea, 0xc561d3ae8baefb13 }, { 0x64b43531eef638ae, 0x2358cc9df69dd29c }, { 0xdd226fef33b50ce4, 0xea51f94bb54bbf6b }, { 0x7944de1d66a9180b, 0x17a23196a996bdd6 },
+ { 0x0879eea1a4c55cde, 0x981b5fb9c5b9b7da }, { 0xcc761dd34dac5ef0, 0x0a5c9544ac44dd96 }, { 0xe153d7bf9b2875d4, 0xe8fc695f285f8645 }, { 0x09df831c5195b6b5, 0x8b208d0795077850 },
+ { 0x8d9e0c2fd11b11a4, 0x53bffa7b1b7be303 }, { 0x75e0470d90ef6aba, 0xc355a092ef92b061 }, { 0xd2af41fb190383e8, 0x0bebdd4e034e2081 }, { 0xec512312983eed0e, 0x2f302ae53ee54478 },
+ { 0xbb198067f4e3239c, 0xef7f5269e3693020 }, { 0xac1f5f53f1d94831, 0x65e89764d964b567 }, { 0xf655088b9e121e79, 0x626bac5212520302 }, { 0xc3fb33c7671ad1fc, 0xebe6b1411a41427c },
+ { 0xcf5faad7915ca34d, 0x3f1120455c454fcb }, { 0x9d6c13ae5a52a9db, 0xa08944ca52ca4e74 }, { 0xf9d8269fb4a49175, 0x83d18857a4579ce8 }, { 0x721487b81e9cb968, 0xbaf4db2e9c2e9851 },
+ { 0x813a953f275d6315, 0x87486b7f5d7feeb4 }, { 0x127dc538a2e9afa9, 0xd540d90ee90ef0a0 }, { 0x906ee70359443101, 0x6745077044708c49 }, { 0x5bec3a659a9bbc23, 0x14b8e9889b8879ef },
+ { 0x7f1673151d8a21b2, 0x7d3898948a945a6c }, { 0x94b390b20bc71f6e, 0x2ba9c9cdc7cd3624 }, { 0x2faa10d5ff243cf2, 0xc4d69ba424a40604 }, { 0x4535664dce34613b, 0x150fa182348284f8 },
+ { 0xa74f06f689ece952, 0xc8be7ddcecdc90e0 }, { 0xedf74eaf6d6e0765, 0x3c0bf85b6e5b8bf2 }, { 0x29f8bddd8407054b, 0xae4c32a607a6e1be }, { 0x36878c4825f83238, 0xbcc0a812f812d323 },
+ { 0xc174e97e4ebac62a, 0xcd90d6febafe1fab }, { 0x24fa497087119d91, 0x6980711c111c2383 }, { 0x028fdab929a017d6, 0x267667bfa0bf5dd7 }, { 0x5395d4c43e5ee0fd, 0x8ca3b6315e31ce35 },
+ { 0xc68029cbc0c915f8, 0xb431ad42c942379b }, { 0xaf36e8572d29b58c, 0x50a522652965273a }, { 0x44930bf03b648b50, 0x0634733c643c4b72 }, { 0x10f21f818b49b87f, 0xf336beb149b1ad77 },
+ { 0xde0bd8ebef45f159, 0xdf1c4c4a454a2d36 }, { 0x0af634188d654b08, 0xbe6d38066506ea0d }, { 0x7eb01ea8e8dacbd9, 0x6e034a2ada2a95e6 }, { 0x6b391b25c440b7a2, 0xc2e2e89840984d76 },
+ { 0xb532c3ce2b0546fb, 0x1dfea4d205d26040 }, { 0x1ba24624f37c191c, 0x5e6054097c0988f0 }, { 0xb2c6037ba5769529, 0x645fdf6e766e4870 }, { 0x979a27b6d737e2d3, 0x1ee47ccc37cca479 },
+ { 0x04dd77b152832e6f, 0x4ceccebd83bdba6d }, { 0x267593c9aeb18a47, 0x4ff616a3b1a37e54 }, { 0x41e811fc9cb74f54, 0x59e36f3fb73f3e95 }, { 0xc8ab6a621f2f709f, 0x46b05bf92ff967fb },
+ { 0x62e6983995d50117, 0x49c2659fd59f3526 }, { 0x483792e0cd22f9e1, 0xd2c3e238223846c5 }, { 0x6340f5846085eb7c, 0x5af9b7218521faac }, { 0xb61b74caf7f5bb46, 0x28b311d3f5d3f21d },
+ { 0x9347500785b4ccbc, 0x5208b271b4711e14 }, { 0x6512588c1ba6d2c5, 0x30631e23a6231d16 }, { 0xcb82dd66c3df8d22, 0x73fdeef8dff8f5a6 }, { 0x709b5d01373caebe, 0x9c82bc913c91c586 },
+ { 0x5233b979cb0e0a96, 0x9f98648f0e8f01bf }, { 0x809cf882d20d897e, 0x9473b9c10dc1213e }, { 0x8bcca127aa38281d, 0x39255379387904b9 }, { 0x0652ad087b2339b9, 0x6a9aa9022302e7ba },
+ { 0x2b776764ada7129d, 0x883a5519a719bc69 }, { 0x1706df34053a6bad, 0x8a97c50d3a0d8547 }, { 0x776f9db4b94f7d6c, 0xe523c72d4f2dedb6 }, { 0x35ae3b4cf908cf85, 0x898d1d130813417e },
+ { 0x74462ab065bf80d1, 0xd06e722cbf2c7feb }, { 0xf87e4b2241f47b1e, 0x90ea5ae9f4e95362 }, { 0x1df0eb2c885f20a5, 0x34fafd0b5f0b6f4a }, { 0x3efe62e9813d6ee6, 0x24dbf7ab3dab64f9 },
+ { 0xc40ff372e969022e, 0x9247cafd69fd6a4c }, { 0x38accfe1fa1e575f, 0x4e415ea91ea98343 }, { 0xe88c54a3cabdc361, 0x63dce458bd58fe15 }, { 0xd3092c46ec536983, 0x18d00ff053f0ef0b },
+ { 0x55c779cc457dd944, 0xe6391f337d33298f }, { 0x0ca49910f64672b1, 0xd4f7910446040db7 }, { 0xa466b1f2551c14ef, 0xfdf3c8dd1cdd02bd }, { 0x4367cb45b5175882, 0x7f95088017806342 },
+ { 0xdad6af5abdc6df36, 0x93f082f7c6f7975b }, { 0xfb57fc269d0486a3, 0xa5a7efe804e8c13f }, { 0xf4dad232b7b209af, 0x441dcbedb2ed5ed5 }, { 0xaa4df25b8afa7188, 0x0f723e66fa6652dd },
+ { 0x3a231558d3be4089, 0x68373916be16de94 }, { 0x7c3fc411c17adc0f, 0x48752d957a95c831 }, { 0x6810ac2118b04a1f, 0xf7af5d99b099df2b }, { 0xb3606ec650267f42, 0x77640dd026d087fa },
+ { 0x2ad10ad958f7f8f6, 0x9b0187a7f7a773e3 }, { 0x981709a2fd816ddf, 0xff5e58c981c93b93 }, { 0xd55b814e9770503a, 0x724aa6f270f208b1 }, { 0x60694280bc7516c1, 0x6fb40220752068f1 },
+ { 0x22a8e478fc32a428, 0x031ad81e321ec439 }, { 0x5c18fad014e86ff1, 0x6d199234e83451df }, { 0x89437b9e83983fcb, 0x1f5334c698c6596e }, { 0x5748a3756cddce92, 0xc04f788cdd8c7458 },
+ { 0xd672364a4b80ad87, 0x470713f380f39aec }, { 0xae9085ead8795fe7, 0x439ef0db79dbe8b0 }, { 0xd0209b4230a3943e, 0x2d9dbaf1a3f17d56 }, { 0x255c24cd724177fa, 0x7abba3a241a2ec09 },
+ { 0x9fe3c91773f2be0d, 0x86ff2375f27513a3 }, { 0xd4fdecf36220ba51, 0x6171744c204cc73b }, { 0x7a6d6919ba59e5b6, 0x22ef849759972f8b }, { 0x1589058d2c9a7c7b, 0xace1a2b29ab2d890 },
+ { 0x69b6c19cede0a074, 0xe4948f27e02710a1 }, { 0x404e7c4169e7a53f, 0x4ad8bd81e781f11f }, { 0x54611471b02d332f, 0xf502cd8d2d8de605 }, { 0xf32e128739c1da7d, 0x3dbcb051c15176e5 },
+ { 0xe58ea00ec9ab5bbb, 0xa410a7e2abe23c28 }, { 0xca24b0db368f6749, 0x60c63c468f463a2c }, { 0x511a0e7d17fef72b, 0xaad5d18efe8e93e2 }, { 0x2e0c7d680a74d699, 0xd7ed491a741ac98e },
+ { 0xe3dc0d06b2886202, 0xce8a0ee088e0db92 }, { 0x4ab84859e482ee37, 0xf4b5858782871b12 }, { 0xef78941644ce10b3, 0x1a7d9fe4cee4d625 }, { 0x1f7f3195a1ff3773, 0x128c9ab4ffb4329d },
+ { 0x7d99a9ac342a3664, 0x5b4eff2b2a2b07bb }, { 0xeba5e3a7164d3edc, 0x569151594d596c48 }, { 0xeedef9abb19efad8, 0x09464d5a9e5a19af }, { 0x6a9f769831105dc9, 0xd1d93a26102682fc },
+ { 0xf1a1c83e1061cdab, 0x1bcad7ee61ee2b32 }, { 0x4fc3525543512a33, 0xab62998451846ef5 }, { 0x01a66dbdf550ea6b, 0x133bd2be50becf8a }, { 0xff8a8b97cf87a8cc, 0xe94b215587557b52 },
+ { 0xb494ae73de55ac90, 0x0ec5766c556cafca }, { 0xe428cdb33cfbb1d0, 0xb72b755cfb5cf3a2 }, { 0x876838375c7e5aac, 0xedd2c27d7e7d090e }, { 0xe0f5ba026e789fbf, 0xfbc7bbe178e149cf },
+ { 0x0d02f4ad031698da, 0xc7cc43ba16bac23d }, { 0xfe2ce62a3ad742a7, 0xfa70f3ebd7ebb4d8 }, { 0xa8c228e2a35a665e, 0x290459d95ad90f0a }, { 0xbe629a6b5330e798, 0xb0a84e6a306a45c7 },
+ { 0x85e7e28e75de4d7a, 0xcba4a5c2dec254d9 }, { 0x679d82353206c513, 0x1615799c069c40c1 }, { 0x91c88abeac14db6a, 0x747ed5ce14ce43c3 }, { 0x50bc63c0e2ae1d40, 0xb9ee0330ae305c68 },
+ { 0x8213223bfbad9ea8, 0xb205de7ead7e7ce9 }, { 0x3dd7d5ed5dcd935b, 0x119642aacdaaf6a4 }, { 0xa11dabfef2cfd0eb, 0xa224d4decfde775a }, { 0x9e45a4aa86a25466, 0x95c4f1cba2cbdc29 },
+ { 0xa2341cfa2e3f2d56, 0x976961df3fdfe507 }, { 0x30d521405edb0b81, 0xd65a0110db103499 }, { 0x1a042b99062cf377, 0x4d5b86b72cb7477a }, { 0x325afbf9777b1c57, 0xf02c66af7baf694e },
+ { 0xbced40d27a90f04e, 0x96de29d590d51810 }, { 0x3f580f54746d848d, 0x37e025156d15ab73 }, { 0x9cca7e13af0243b0, 0xb3b29674027481fe }, { 0xbfc4f7d6a6600df3, 0xa3939cd460d48a4d },
+ { 0xb1efb47f79866894, 0x51126a6f866fda2d }, { 0x285ed0607157ef20, 0xbd77e01857182e34 }, { 0x2d25ca6cd6842b24, 0xe2a0fc1b841b5bd3 }, { 0x92e13dba70e426d7, 0x413360cfe4cfd19e },
+ { 0x1154723c7e195214, 0xe00d6c0f190f62fd }, { 0x58c58d61466b419e, 0x21f55c896b89ebb2 }, { 0x9515fd0ffe97f505, 0x38921b739773f9ae }, { 0x16a0b289f06a81c6, 0x99ac17b36ab34acd },
+ { 0x47babcf4e79476ed, 0x3379c63d943dd92f }, { 0xfaf1919b68546cc8, 0xb69c3d5654560eb5 }, { 0xcdd0706eb8fcb49b, 0x196747fafcfa121c }, { 0x0329b704dcf0fdbd, 0x354db501f001925d },
+ { 0xa5c0dc4fa04cfe84, 0xeec81a634c63cd37 }, { 0x83b54f860efd74c3, 0xa13e0cc0fdc0b363 }, { 0x192d9c9ddadc0eca, 0x781633b6dcb6d527 }, { 0x4991ff5d3872138a, 0xc1f830867286894f },
+ { 0x390aa25c0f4ebd34, 0x5d7a8c174e174cc9 }, { 0xcef9c76a640c4926, 0x2c2af2fb0cfb8041 }, { 0x142f6830d9ca9610, 0xbfda700cca0c171a }, { 0xbd4b2d6f8fc01a25, 0x85e5fb6bc06bd79a },
+ { 0xabeb9fe67faa9be3, 0x1c49ecd8aad89d57 }, { 0x0b5059a57835a163, 0xad56eab835b82587 }, { 0xe92a391e3fed290a, 0x70e736e6ede6319f }, { 0x2c83a7d123d4c14f, 0xf19b2ea5d4a59459 },
+ { 0xd9ff185e6136228b, 0xa6bd37f636f60506 }, { 0x86ce558aa92eb0c7, 0xfee910c32ec3c684 }, { 0x0e2b43a9dfe66567, 0xf281f6bbe6bb5060 }, { 0xb7bd197702a5512d, 0x3b88c36da56d3d97 },
+ { 0x20273ec1d592b3fe, 0x256cbfa192a199ee }, { 0xc5a99ecf1c39e845, 0x817c18433943a5c6 }, { 0x88e5162376c8d5a0, 0x0c68e678c87896e4 }, { 0xa0bbc643079f3a80, 0xb11f06609f60b8d0 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0xb9965adedd43344a, 0xc90935d643d66df7 }, { 0x340856f10c5825ee, 0x9ab6cfad58ad8ef4 }, { 0x5f314dd4c818924c, 0x585427351835c382 }
+ }, {
+ { 0x223b6375937fdaab, 0xda0922c284a640b7 }, { 0xe1f51bc1a6f4d9bb, 0xd9dde19524c5a254 }, { 0xe703af84020e3c83, 0x3c08e7a657b03622 }, { 0xd060c4ed40038c0d, 0x8cc3d02772a20fca },
+ { 0x269fbbb2ead3dd3a, 0xdd2e26e067411952 }, { 0x2ab0103861e4d44a, 0xd4472a8681abf2be }, { 0x9839a98d2ecaf2e8, 0xf2b898065fc7648b }, { 0xa88540e04716d6eb, 0xd6dfa85d41e94ebd },
+ { 0x27b68df365f8ac8f, 0xac5727092f089efa }, { 0xb1f2e3761d53b5be, 0xb574b17806b7dc0e }, { 0xf009cb1a0e2ab40f, 0xb438f0f4669682ee }, { 0x1f8117d3febf866d, 0x867e1f16342b06c5 },
+ { 0xa00e33adb58dd80a, 0xd891a01944e4fcb4 }, { 0xd5ed2a6bb684fa29, 0xfa9dd5ecd90cd187 }, { 0xb3a08ff4c0055717, 0x5786b3699625119d }, { 0x512ecef6348c1db0, 0x1dd051046a3bf9f2 },
+ { 0x0d069dcb041c78c5, 0x78100d8faea36c44 }, { 0x4a0b01e2b39f9c4c, 0x9c894a30bdf7a6d2 }, { 0x6dbd8c11d66730c3, 0x30de6d3992ff3828 }, { 0x012936418f2b71b5, 0x717901e9484987a8 },
+ { 0x4cfdb5a717657974, 0x795c4c03ce8232a4 }, { 0x54a32070c20b6b94, 0x6b8e54cfc19527bf }, { 0x13aebc5975888f1d, 0x8f171370d2c1ed29 }, { 0x1558081cd1726a25, 0x6ac21543a1b4795f },
+ { 0x0ad91fcf2fcdec48, 0xecbc0a55959f7f9a }, { 0x3ec12e653fbdcfda, 0xcffc3e2c68560c49 }, { 0x4eafd925ca339bdd, 0x9bae4e125e10ff37 }, { 0x88ec4f17093feee9, 0xee24888e55ddc399 },
+ { 0xb850a67a60e3caea, 0xca43b8d54bf3e9af }, { 0x3c9342e7e2eb2d73, 0x2d0e3c3df8c4c1da }, { 0xa583dd2b430aae2e, 0xaecfa5d2ef4a22f9 }, { 0x8b9715d45b427df5, 0x7daf8b768d0689a2 },
+ { 0x25e4e171b8ae4e26, 0x4ea52518bf9a5369 }, { 0x9ecf1dc88a3017d0, 0x176d9e352cb2f0fd }, { 0x1dd37b5123e964c4, 0x648c1d07a4b9cb56 }, { 0xeb2c040e893935f3, 0x3561ebc0b15addce },
+ { 0xbcf47ebd194fcd7b, 0xcd64bcf7a814b04a }, { 0x5adee778946a804d, 0x80155ab8b7ed01c0 }, { 0xdab9db226fce6045, 0x607fda72e73d7050 }, { 0x02526c82dd56e2a9, 0xe2f202119092cd93 },
+ { 0xa9ac76a1c83da75e, 0xa7a6a9b409a0c915 }, { 0x1ea821927194f7d8, 0xf7071eff7c62816d }, { 0xecf3860aa2e8a17e, 0xa1cdec1a8a66ce10 }, { 0xfbf9e294aecc29f2, 0x29fdfb48bb407adc },
+ { 0x14713e5d5e591b90, 0x1bbb14aae9fdfef7 }, { 0x7c415cca7eb95d77, 0x5d3b7c58d0ac1892 }, { 0x79ccb24c883e2b53, 0x2b6579937b02c6df }, { 0x48596d606ec97ee5, 0x7e7b48212d656b41 },
+ { 0x1a0cf9550838f049, 0xf0201add9f85d888 }, { 0x94160207a5fdfb98, 0xfbd19460b92d8f67 }, { 0xf37291d95c572713, 0x27b3f30cbe4dc8d5 }, { 0xba02caf8bdb52843, 0x28b1bac4db61243c },
+ { 0x5e7a3fbfedc687dc, 0x87325e9a540a5825 }, { 0x2d6f923c4a3540c7, 0x40eb2d5cba97e160 }, { 0x92e0b64201071ea0, 0x1e049253ca581b11 }, { 0x9db4470bd84d84cc, 0x84e69dcdf469bac6 },
+ { 0x831c6699a9d97314, 0x73e18332880b3bab }, { 0x691954d6afcb3752, 0x37f9691b711861cd }, { 0xb5563bb164ffb22f, 0xb253b55ae55085eb }, { 0xfad0d4d521e75847, 0x5884faa1f309fd74 },
+ { 0xf25ba798d37c56a6, 0x56caf2e5f6044f7d }, { 0xb979903befc8bb5f, 0xbb3ab93c03ba6e07 }, { 0x28e27cbabcb236e3, 0x36b5289711393f2d }, { 0xd149f2accf28fdb8, 0xfdbad1ce3aeb8862 },
+ { 0xe28e4102f4894aa7, 0x4a56e26dfc1ee86f }, { 0x5d01657cbfbb14c0, 0x14b95d628cd1121e }, { 0x75e319c603092223, 0x220c75f59de82d33 }, { 0xe551c306df58de2a, 0xdefae5b7c722fbb1 },
+ { 0xef88dcc9f0953262, 0x3246efe252bd842b }, { 0xdc4f6f67cb34857d, 0x85aadc419448e426 }, { 0x96446e8578ab1931, 0x1923967129bf42f4 }, { 0x8691881f5f5e0530, 0x05bf86f923a5e5e6 },
+ { 0x4dd483e6984e08c1, 0x08254dea86cbb50c }, { 0x455ff0ab6ad50620, 0x066b45ae83c60705 }, { 0x77b17544de5fc08a, 0xc0fe77e40d7ae0a0 }, { 0xeea1ea887fbe43d7, 0x433fee0b1af40383 },
+ { 0x56f14cf21f5d893d, 0x897c56de5107ea2c }, { 0xa12705ec3aa6a9bf, 0xa9e8a1f00cad7b1c }, { 0x3dba74a66dc05cc6, 0x5c773dd4b08d4672 }, { 0x2c46a47dc51e3172, 0x31922cb5f2de66c8 },
+ { 0x2e14c8ff1848d3db, 0xd3602ea4624cab5b }, { 0x93c980038e2c6f15, 0x6f7d93ba82119cb9 }, { 0x84c3e49d8208e799, 0xe74d84e8b3372875 }, { 0x3a65f6a24611c84b, 0xc8db3a0e8bb155ac },
+ { 0xc6439632c30c7534, 0x758ac69c0bcd3cae }, { 0xcfe1d33ebebc0a60, 0x0abdcf314689090f }, { 0x341831aa10702392, 0x23403479fdc973d3 }, { 0x5255943566f18eac, 0x8e5b52fcb2e0b3c9 },
+ { 0x2f3dfebe9763a26e, 0xa2192f4d2a052cf3 }, { 0x823550d826f202a1, 0x029882dbc042bc03 }, { 0xc76aa0734c270481, 0x04f3c7754384bb06 }, { 0x364a5d28cd26c13b, 0xc1b236686d5bbe40 },
+ { 0x537ca274e9daff19, 0xff225315faa93461 }, { 0x588c8bfa493c62e4, 0x62e758a9277fcc53 }, { 0x85ead2dc0d23962c, 0x96348501fb7eafdd }, { 0x814e0a1b748f91bd, 0x911381231899f638 },
+ { 0x3195df2ce6f755b6, 0x551e31b25667ad9e }, { 0xae73f4a5e3ec33d3, 0x330aae6e329cdacb }, { 0x6830629720e046e7, 0x468068f23951e665 }, { 0xa4aaeb6acc21df9b, 0xdfb6a43ba703a551 },
+ { 0x170a649e0c24888c, 0x883017523126b4cc }, { 0x40d21e2d9c527004, 0x703540652868d948 }, { 0xb7045733b9a95086, 0x50a1b74b75c24878 }, { 0xe8575ecddb44a6ef, 0xa6eae838698197f5 },
+ { 0xa6f887e811773d32, 0x3d44a62a379168c2 }, { 0xb0dbd5379278c40b, 0xc40db0914efe5ba6 }, { 0xf4ad13dd7786b39e, 0xb31ff4d68571db0b }, { 0xd7bf46e96bd21880, 0x186fd7fd499e1c14 },
+ { 0x037b5ac3527d931c, 0x938b03f8d8db4a3b }, { 0x41fb286c137901b1, 0x014c418c60215ee0 }, { 0xde1d03e5166267d4, 0x6758de5004da29b5 }, { 0xac2198273ebad17a, 0xd1f8ac7fa20e1758 },
+ { 0xf9ab8e16739acb5b, 0xcb0ff9592bd2b74f }, { 0xa25c5f2f68db3aa3, 0x3a63a208d4763127 }, { 0x4b2237a33cb4edf9, 0xedf04bd9f5be217a }, { 0xb62d617236822133, 0x21d8b6a23d8bcfd0 },
+ { 0x4f86ef644518ea68, 0xead74ffb1659789f }, { 0x74ca2f878c225396, 0x5375741cd5a1aa9b }, { 0xea05324f06124446, 0x4418ea29f9135a66 }, { 0x20690ff74e293802, 0x38fb20d314348d24 },
+ { 0x2b992679eecfa5ff, 0xa53e2b6fc9e27516 }, { 0x4476c6eae5fe7795, 0x77124447cb8f80ad }, { 0x8f33cd1322ee7a64, 0x7a888f546ee1d047 }, { 0x8abe2395d4690c40, 0x0cd68a9fc54f0e0a },
+ { 0x9a6bc50ff39c1041, 0x104a9a17cf55a918 }, { 0xa375696ee7f04b16, 0x4b1aa3e19c3fb68f }, { 0xe0dc2d8029dfa80e, 0xa8a4e07c6c8c25fc }, { 0xc19c1436e8dde1b9, 0xe126c14630f12f70 },
+ { 0x0bf0298ea0e69dfd, 0x9dc50bbcddd6f832 }, { 0x3fe81824b096be6f, 0xbe853fc5201f8be1 }, { 0x04a4d8c779ac0791, 0x07270422e3e759e5 }, { 0xc2e74ef5baa072a5, 0x72adc2bee82a654b },
+ { 0xad08ae66b191a0cf, 0xa081ad96ea4790f0 }, { 0x29cb4afb33994756, 0x47cc297e5970b885 }, { 0xf120fd5b8101c5ba, 0xc541f11d2edf0546 }, { 0xdf3435a499491661, 0x1621dfb94c93ae1d },
+ { 0x43a944eece2fe318, 0xe3be439df0b39373 }, { 0x09a2450c7db07f54, 0x7f3709ad4d4435a1 }, { 0x676493def9aadc8b, 0xdc62676c076047b2 }, { 0x664da59f7681ad3e, 0xad1b66854f29c01a },
+ { 0xe97e688c546fd75a, 0xd793e9d121c8105d }, { 0xbddd48fc9664bcce, 0xbc1dbd1ee05d37e2 }, { 0xabfe1a23156b45f7, 0x4554aba599320486 }, { 0xbea6123fc4192fd2, 0x2f96bee638867dd9 },
+ { 0xf7d6491e25fb2082, 0x2094f72e5daa9130 }, { 0x6192279b5d5039b3, 0x39b7615f7415d3c4 }, { 0x11fcd0dba8de6db4, 0x6de51161425320ba }, { 0xfe740c12584b5fd6, 0x5fa3fe8310eea491 },
+ { 0x088b734df29b0ee1, 0x0e4e0844050db209 }, { 0x7d686a8bf1922cc2, 0x2c427db198e59f3a }, { 0x99109fcca1e1835d, 0x83c199ef178ee323 }, { 0x7b9edece5568c9fa, 0xc9977b82eb900b4c },
+ { 0xd232a86f9d556ea4, 0x6e31d236e230c259 }, { 0x33c7b3ae3ba1b71f, 0xb7ec33a3c6f5600d }, { 0xc0b5227767f6900c, 0x905fc0af78b8a8d8 }, { 0x10d5e69a27f51c01, 0x1c9c10880a1aa712 },
+ { 0x953f34462ad68a2d, 0x8aa89589f16408cf }, { 0xbf8f247e4b325e67, 0x5eefbf0f70cffa71 }, { 0x38379a209b472ae2, 0x2a29381f1b23983f }, { 0x90b2dac0dc51fc09, 0xfcf690425acad682 },
+ { 0x391eac61146c5b57, 0x5b5039f6536a1f97 }, { 0xd31b9e2e127e1f11, 0x1f48d3dfaa7945f1 }, { 0x214039b6c10249b7, 0x4982213a5c7d0a8c }, { 0x6ec6d6d2841aa3df, 0xa3556ec14a247213 },
+ { 0x6fefe0930b31d26a, 0xd22c6f28026df5bb }, { 0x24cdd73037853f93, 0x3fdc24f1f7d3d4c1 }, { 0x058dee86f6877624, 0x765e05cbabaede4d }, { 0xfc266090851dbd7f, 0xbd51fc92807c6902 },
+ { 0xaf5ac2e46cc74266, 0x4273af877ad55d63 }, { 0x3b4cc0e3c93ab9fe, 0xb9a23be7c3f8d204 }, { 0x706ef740f58e5407, 0x5452703e3646f37e }, { 0xca6c3db8483b7c44, 0x7ce3cafaed27d742 },
+ { 0x769843055174b13f, 0xb187760d45336708 }, { 0x5bf7d1391b41f1f8, 0xf16c5b51ffa48668 }, { 0x60bb11dad27b4806, 0x48ce60b63c5c546c }, { 0xfd0f56d10a36ccca, 0xcc28fd7bc835eeaa },
+ { 0x428072af410492ad, 0x92c74274b8fa14db }, { 0xf584259cf8adc22b, 0xc266f53fcd385ca3 }, { 0x723c9bc228d8b6ae, 0xb6a0722fa6d43eed }, { 0x6536ff5c24fc3e22, 0x3e90657d97f28a21 },
+ { 0x162352df830ff939, 0xf94916bb796f3364 }, { 0x7e133048a3efbfde, 0xbfc97e49403ed501 }, { 0x231255341c54ab1e, 0xab70232bccefc71f }, { 0x12878a18faa3fea8, 0xfe6e12999a886a81 },
+ { 0xc917677b1a46ef58, 0xef68c90235fc9d79 }, { 0x57d87ab39076f888, 0xf8055737194e6d84 }, { 0xb47f0df0ebd4c39a, 0xc32ab4b3ad190243 }, { 0x5f5309fe62edf669, 0xf64b5f731c43df8d },
+ { 0xc538ccf19171e628, 0xe601c564d3167695 }, { 0x9fe62b89051b6665, 0x66149fdc64fb7755 }, { 0xcec8e57f31977bd5, 0x7bc4ced80ec08ea7 }, { 0xcc9a89fdecc1997c, 0x9936ccc99e524334 },
+ { 0x919bec81537a8dbc, 0x8d8f91ab1283512a }, { 0x06f6b445a4fae538, 0xe5d5063373759476 }, { 0x7ab7e88fda43b84f, 0xb8ee7a6ba3d98ce4 }, { 0x185e95d7d56e12e0, 0x12d218cc0f17151b },
+ { 0x353107eb9f5b5227, 0x52393590b580f47b }, { 0x6c94ba50594c4176, 0x41a76cd0dab6bf80 }, { 0x8c4897d07093e978, 0xe9038cacb63a9a7c }, { 0x470d9c29b783e489, 0xe49947bf1354ca96 },
+ { 0x07df82042bd1948d, 0x94ac07da3b3c13de }, { 0x62e97d580f2daaaf, 0xaa3c62a7acce99ff }, { 0xe478f5475073af9f, 0xaf83e45e8f6b7c19 }, { 0x976d58c4f7806884, 0x685a979861f6c55c },
+ { 0x78e5840d07155ae6, 0x5a1c787a334b4177 }, { 0xcb450bf9c7100df1, 0x0d9acb13a56e50ea }, { 0xff5d3a53d7602e63, 0x2edaff6a58a72339 }, { 0x59a5bdbbc6171351, 0x139e59406f364bfb },
+ { 0xdd665926441ff4c8, 0xf4d3dda8dc01638e }, { 0x30bce96d69dc2403, 0x2467305b1e2e2a36 }, { 0xc83e513a956d9eed, 0x9e11c8eb7db51ad1 }, { 0x0c2fab8a8b370970, 0x09690c66e6eaebec },
+ { 0x4624aa6838a8953c, 0x95e046565b1d4d3e }, { 0x37636b69420db08e, 0xb0cb3781251239e8 }, { 0x0e7dc7085661ebd9, 0xeb9b0e777678267f }, { 0xc3ce78b4358b0310, 0x03d4c357a063e2e3 },
+ { 0x63c04b198006db1a, 0xdb45634ee4871e57 }, { 0xc411fab01e5a979d, 0x9778c48d9b5ff13d }, { 0xf882b857fcb1baee, 0xba76f8b0639b30e7 }, { 0xeddab04b2dc3d0cb, 0xd0b4edf3c22f49b8 },
+ { 0x641fc91dabd74f97, 0x4fe96494dfbb0d89 }, { 0xcdb3bfbc63eae8c9, 0xe84fcd20d61bc49c }, { 0x9c9d714a5766f579, 0xf59f9c24bc203d6e }, { 0x7147c1017aa525b2, 0x252b71d77e0f74d6 },
+ { 0xd69670a8e4f96935, 0x6916d61401d79bbc }, { 0x0f54f149d94a9a6c, 0x9ae20f9e3e31a1d7 }, { 0xd4c41c2a39af8b9c, 0x8be4d4059145562f }, { 0x7315ad83a7f3c71b, 0xc7d973c6ee9db945 },
+ { 0x5007f8b7bba76c05, 0x6ca950ed22727e5a }, { 0x49705b21e1e20f50, 0x0f0249c8652cece9 }, { 0xdb90ed63e0e511f0, 0x1106db9baf74f7f8 }, { 0x8e1afb52adc50bd1, 0x0bf18ebd26a857ef },
+ { 0xe3a777437ba23b12, 0x3b2fe384b4576fc7 }, { 0xa7d1b1a99e5c4c87, 0x4c3da7c37fd8ef6a }, { 0x80673c5afba4e008, 0xe06a80ca50d07190 }, { 0xd9c281e13db3f359, 0xf3f4d98a3fe63a6b },
+ { 0x1b25cf14871381fc, 0x81591b34d7cc5f20 }, { 0x558a16314d201a21, 0x1af7552689dca017 }, { 0x87b8be5ed0757485, 0x74c687106bec624e }, { 0x1977a3965a456355, 0x63ab1925475e92b3 },
+ { 0x6a620e15fdb6a44e, 0xa4726ae3a9c32bf6 }, { 0xd8ebb7a0b29882ec, 0x828dd86377afbdc3 }, { 0x6b4b3854729dd5fb, 0xd50b6b0ae18aac5e }, { 0xe62a99c58d254d36, 0x4d71e64f1ff9b18a },
+ { 0x5c28533d30906575, 0x65c05c8bc49895b6 }, { 0xf6ff7f5faad05137, 0x51edf6c715e31698 }, { 0x89c5795686149f5c, 0x9f5d89671d944431 }, { 0xbb2bfcb9329e59f6, 0x59c8bb2d9328a394 },
+ { 0x9b42f34e7cb761f4, 0x61339bfe871c2eb0 }, { 0x8d61a191ffb898cd, 0x987a8d45fe731dd4 }, { 0x7f3a06092cc4ce6b, 0xceb07fa0087752a9 }, { 0xb289b9b54f2e26a2, 0x26ffb280de6c9635 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x32ee85efb48ac6aa, 0xc695324a8ebce7a5 }, { 0x1cfa4d10acc21571, 0x15f51ceeecf04cfe }, { 0xaad72c629a403442, 0x342daa4cd17b832e }
+ }, {
+ { 0x4a428169d2d95247, 0x7c4730a95d53e74e }, { 0x9712df2e5c31dbe9, 0x1ce9980b15833f34 }, { 0xbcca12254abe268f, 0x8c8ff77fe958f887 }, { 0xe139052a54a14a4e, 0x2e4e953bd351b68d },
+ { 0x78d2b6da77924503, 0x9c037af1f5c1dc2d }, { 0x2ea1efcc5b4f7ccf, 0x7fcfa419ceb49188 }, { 0x23ce9dee1f0dd70c, 0x350c2b425282f6b4 }, { 0xb8c13ab6afff33ba, 0x3fbad564be950165 },
+ { 0x95f6cb86cff03012, 0xa41289e7df04a245 }, { 0xf903f5c64fe434f0, 0x02f05961e2bae584 }, { 0xb2337efb35bcf22b, 0x222b80beda4bad13 }, { 0x6a1a027bf694fa2c, 0xad2ce371a0f42352 },
+ { 0xdc22541326691d32, 0x3c3241d42d7277a3 }, { 0x3e8d4fc54988281b, 0xf61b2c755106f386 }, { 0xe04b0f7efc20ded2, 0x72d27c4db6f31954 }, { 0x833557b4abb79a08, 0x2608327cddfca4d8 },
+ { 0xbb57244a94bf4cdd, 0xdbdd2dfe11b033cd }, { 0xdbbf627cf8687760, 0x6b609b55d59abce9 }, { 0x4e49a9fa37984772, 0xcf7212b20a9e1eac }, { 0xed247d5cb8627511, 0x3811f3162ac57e68 },
+ { 0xf067af77eee78a06, 0xfb06f42129417b5a }, { 0x5c811d5bb69ef85d, 0xfe5d8b325fabe1d3 }, { 0x3c695b6dda49c3e0, 0x4ee03d999b816ef7 }, { 0x17b19666ccc63e86, 0xde8652ed675aa944 },
+ { 0x7dab941d3a52c4aa, 0x73aab19cc7ae8a16 }, { 0xd43404f62feb3758, 0x995805e2832b46a4 }, { 0xe92f55cf5d236024, 0x8b24d10d7d08878a }, { 0xebcb4167cee28bdf, 0x33dfc0e1b78f1afb },
+ { 0x70c4e63f7e106f69, 0x39693ec75b98ed2a }, { 0xcd7cfe4e9c2fdd7a, 0xe97a20ced762ba74 }, { 0x03961efc3b407f67, 0xe467f89aaf2532a8 }, { 0x1fa7c683c54414ec, 0x7bec16dbc9039843 },
+ { 0x8cbe313e7c34da30, 0xd430accb8b4d5e95 }, { 0x081650e509822a6a, 0xa56a4436ae593107 }, { 0x7352f8c34550100e, 0xdd0ec65df4bddf82 }, { 0xeab94b3366631f43, 0x6f432997d22db522 },
+ { 0x4254d18cdb5b782d, 0xd92d749ff30ad649 }, { 0x13babef529872bb3, 0x6db370f6309750a6 }, { 0x9c9291376ef38ee4, 0x5de424a714ff3c9b }, { 0x1948fab8b3c4ea22, 0x7022252c5449fcd0 },
+ { 0x55e547ea179d46ab, 0x07ab267294507f0d }, { 0x873e7f274ef68f3d, 0x953d10678a315d3a }, { 0x2c45fb64c88e9734, 0xc734b5f504330cf9 }, { 0x22bc97bab78c4390, 0x6990c2343720596d },
+ { 0xfa95eb3a74a44b97, 0xe697a1fb4d9fd72c }, { 0x6b68082f5e156eb0, 0xf1b00a07c5568c8b }, { 0xb4dc42c0433c0ce5, 0x29e5b3494701c980 }, { 0xc2f798c44bac9d42, 0x1b42be7981d34039 },
+ { 0xb5ae4894ebbd9879, 0x75795a3f22a36659 }, { 0x75bdc4f833d0eec0, 0xd6c0f5aa69f7bb11 }, { 0x465ff91f3e1a6d18, 0x6a185684a4c72fab }, { 0x698c1c87cdd4854b, 0x494b1beb0fd111fa },
+ { 0x212a89468ccc3cf7, 0x8df73aae98056bc5 }, { 0xe85d5f9bf5a2f4b8, 0xd7b8387b18aa2853 }, { 0x5e6509f3255f13a6, 0x46a69ade952c7ca2 }, { 0xfc7ad7010224b559, 0xed59920cd0d5b3bf },
+ { 0x7b44a8264cd23a64, 0x7864826b5ae4ee85 }, { 0x7cd99e4992d35036, 0x2f3658eaa20c25cf }, { 0xcb93c275eaaf23b4, 0xe2b413394a28dee7 }, { 0xcf98eae60fee3681, 0x518131221de52705 },
+ { 0xab7b844386781809, 0x5209a5928e0251c3 }, { 0x9de09b63c6721a78, 0x0178cdd1715d9342 }, { 0x37e91574e88b96ed, 0x0fed81359afd6d58 }, { 0x0c1d7876ecc33f5f, 0x165f662df994c8e5 },
+ { 0x637e58ca579744da, 0x54da4e316b0fbd8c }, { 0xd5460ea2876aa3c4, 0xc5c4ec94e689e97d }, { 0xe2af1bd66fe13529, 0xca296da17c748425 }, { 0xa582e89df97accad, 0xfcadd253bd110457 },
+ { 0xd8297c80c3280807, 0x8f0763cf7abf8e41 }, { 0xb74a5c3c787c7382, 0xcd824bd3e824fb28 }, { 0x6cf53e40801404e2, 0xa6e2d0863dbe47c1 }, { 0xa4f0e2c951fb5831, 0xa0313b25d8b3ab8e },
+ { 0x1d43d22b5685ff17, 0xc317073703840532 }, { 0x79a0bc8edf13d19f, 0xc09f9387906373f4 }, { 0xfbe7e16edc25df0b, 0xba0b488d283d78f5 }, { 0x350d01dc7b4a7d16, 0xb71690d9507af029 },
+ { 0x45c9e7e3055a127f, 0x8e7fae1e0be21d03 }, { 0x3106294f9e0b6823, 0x0423b2c207b709cb }, { 0x20588312244da86b, 0xd16bd3d8fda7c41c }, { 0x057922c74dc081a9, 0xefa9cb6d326f563b },
+ { 0x1c31d87ffe046b8b, 0x9f8bee416626aaeb }, { 0xb34174af9d3d66b7, 0x7eb769c8bfe902ca }, { 0xbdb81871e23fb213, 0xd0131e098cfa575e }, { 0xe6a433458aa0201c, 0x791c4fba2bb97dc7 },
+ { 0x02e414a893c1ebfb, 0xb8fb11ecca879d71 }, { 0x8b230751a235b062, 0x8362764a73a595df }, { 0xa99f90eb15b9f3f2, 0xeaf2b47e4485ccb2 }, { 0x7759d050a011053b, 0x6e3be446a3702660 },
+ { 0xf115a52346661e9a, 0xa79a1d574ce3d483 }, { 0x9660d57af4b04f75, 0x4075717d702190ed }, { 0xefc069f42ba39eea, 0x80eae2fae042e319 }, { 0xb0d76a53a67d19d0, 0x9ad0915210cc3062 },
+ { 0x9a7dad0c1873702a, 0x562a175089b55808 }, { 0x0af2444d9a43c191, 0x1d9155da64deac76 }, { 0x509c652d5a5dc702, 0xe802ed1fa63f2936 }, { 0x620c529eff16d046, 0x0846a7470ead1255 },
+ { 0x762bda04089091a7, 0x32a70d30c6d289b9 }, { 0x9319f7bdb970cedc, 0xafdcba10424ec6d6 }, { 0x91fde3152ab12527, 0x1727abfc88c95ba7 }, { 0xeeb263a083220a76, 0xdc760b8c85e04cc0 },
+ { 0x0ef96cde7f02d4a4, 0xaea477c133135594 }, { 0xa614f661c23ab3ca, 0x18ca2ac9123436ff }, { 0xd2db38cd596bc996, 0x929636151e612237 }, { 0x1ed5ccd76dc58070, 0x2770ffadaca1379a },
+ { 0xf7fa991830e6e054, 0xac542ea0d1a9b010 }, { 0x1427889af78641e1, 0x3ae1aa77c87f9bec }, { 0x80a3494890f7e56f, 0xc26fcae672d99670 }, { 0x27c5b57dfa4cc239, 0x86390959054f0f56 },
+ { 0xf46c87e40ba69f33, 0x4833d63a7e8c82b8 }, { 0x4b308b3d7a58c6db, 0x20dbd9df38f14897 }, { 0xae02a684cbb899a0, 0xbda06effbc6d07f8 }, { 0x8a510d050ab424fe, 0xdffe9f3c16073a06 },
+ { 0x3bf46d020448a9b2, 0x19b2e7186369a5bd }, { 0xc56aaeab95adf710, 0x4c1064f8793b8b73 }, { 0x369b1f20400a0271, 0x53716843ff5fc281 }, { 0x3fff4591e109bc87, 0xaa87c50334a45c5f },
+ { 0x040b2893e5411535, 0xb335221b57cdf9e2 }, { 0x0f8b668ad7834038, 0xf2389eb756b1fa4d }, { 0x079d366fde016a52, 0x5752da81f8e8cb4a }, { 0x530a7bd1611db865, 0x0c651585091a1b9e },
+ { 0xc3859290e32d09de, 0x47de570fe471efe0 }, { 0x9484c1d26771a48e, 0xf88e6091baa60d9c }, { 0x2d37f130600f03a8, 0x9ba85c836191a320 }, { 0xf283bbdf7d2661fd, 0x43fde5cde3c6e62b },
+ { 0x3a866756acc93d2e, 0x452e0e6e06cb0a64 }, { 0x284ed3f72dcf8201, 0x740197ee53fef51b }, { 0x7a36a272e453aef8, 0x24f86b1d3f46415c }, { 0xc418a4ff3d2c638c, 0x108c8d8e1c9924aa },
+ { 0x908fe9418230b1bb, 0x4bbb428aed6bf47e }, { 0x391079aa97894249, 0xa149f6f4a9ee38cc }, { 0x329037b3a54b1744, 0xe0444a58a8923b63 }, { 0x3074231b368afcbf, 0x58bf5bb46215a612 },
+ { 0x67757059b2d651ef, 0xe7ef6c2a3cc2446e }, { 0xdacd682850e9e3fc, 0x37fc7223b0381330 }, { 0x5f1703a78dde873a, 0x1a3a73a8f08ed37b }, { 0x4326dbd873daecb1, 0x85b19de996a87990 },
+ { 0x52787185c99c2cf9, 0x50f9fcf36cb8b447 }, { 0x89c713f931f45b99, 0x3b9967a6b92208ae }, { 0x33e23de70dca83d8, 0xbcd8a32ecd3094ba }, { 0xdec640bbb5a8f6c9, 0x84c95038e7f5ead2 },
+ { 0xf3f1b18bd5a7f561, 0x1f610cbb866449f2 }, { 0xaf70acd063390d3c, 0xe13c8789d9cfa821 }, { 0x4cadbd52a459ac89, 0x7789035ec01983dd }, { 0x5b1c2b34689f920f, 0xa90f51b3a7432a99 },
+ { 0x74cfceac9b517a5c, 0x8a5c1cdc0c5514c8 }, { 0x183af0ec1b457ebe, 0x2cbecc5a31eb5309 }, { 0x2521a1d5698d29c2, 0x3ec218b5cfc89227 }, { 0xfd08dd55aaa521c5, 0xb1c57b7ab5771c66 },
+ { 0x64e36ea589962e88, 0x038894b093e776c6 }, { 0x864c7573e6771ba1, 0xc9a1f911ef93f2e3 }, { 0xceeae0b2a76fa21d, 0x0d1dd854784788dc }, { 0xad94b878f0f8e6c7, 0x59c7966513483550 },
+ { 0xf871ff92e765a06c, 0x5e6cb01787184a5d }, { 0x6f6320bcbb547b85, 0x4285281c929b7569 }, { 0x293cd9a3854e169d, 0x289d7e98365c5ac2 }, { 0xc805dc89d1ef5cd3, 0x06d3eba3e50dec4f },
+ { 0x9899b9a48bb29bd1, 0xeed106bc4332c579 }, { 0xb6385668d0fde71e, 0x911ea2a58d8654f1 }, { 0xffecc9fd3964ca3e, 0x093e6a967ff08117 }, { 0x472df34b969bf984, 0x3684bff2c1658072 },
+ { 0x12c8b4a18106bf2f, 0x312f99805535ff7f }, { 0x155582ce5f07d57d, 0x667d4301addd3435 }, { 0xbe2e068dd97fcd74, 0x3474e69323df65f6 }, { 0xba252e1e3c3ed841, 0x8741c48874129c14 },
+ { 0x57015342845cad50, 0xbf50379e5ed7e27c }, { 0x619a4c62c456af21, 0xec215fdda18820fd }, { 0xdfb44aef1d296255, 0xd855b94e8257450b }, { 0xe44027ed1961cbe7, 0xc1e75e56e13ee0b6 },
+ { 0x7e3d8ae10112bbcd, 0x97cd4906688bb8be }, { 0x0b804e1932c2550d, 0x410dbcac017c03af }, { 0x3d1b513972c8577c, 0x127cd4effe23c12e }, { 0x54974dbebf1cd237, 0x5b37cf04f1f2d0d4 },
+ { 0x16c39c326447aa1a, 0x821abb9b02f8069d }, { 0xfe9ec3a991e55ea2, 0x55a283e01a522ece }, { 0xf51e8db0a3270baf, 0x14af3f4c1b2e2d61 }, { 0x09645ab1a103bef6, 0xf9f6ad40cbfb9ede },
+ { 0xbf5c0cd971fe59e8, 0x68e80fe5467dca2f }, { 0x6d8734142895907e, 0xfa7e39f0581ce818 }, { 0x2453ab81c10cbd5e, 0x625ef1c3aa6a3dfe }, { 0x2aaac75fbe0e69fa, 0xccfa86029979686a },
+ { 0xe3dd1182c760a1b5, 0x96b584d719d62bfc }, { 0x7220f297edd18492, 0x81922f2b911f705b }, { 0xa766fc356abb2756, 0x4456c3bf77969926 }, { 0xd14d2631622bb6f1, 0x76f1ce8fb144109f },
+ { 0xa0fbca5ab4ba4d04, 0x1304193e8f7e526c }, { 0xa8ed9abfbd38676e, 0xb66e5d082127636b }, { 0x26b7bf2952cd56a5, 0xdaa5e02f60eda08f }, { 0xcc0ef41a34ae49e6, 0xb5e6c9b8b2c015ad },
+ { 0xf688934c986774c8, 0xf0c8c7d6b40b1fc9 }, { 0xe5322db9b1e05f7b, 0x9d7bb720849c4f6f }, { 0x66077a0d1a57c573, 0xbb73855c5960ebb7 }, { 0x7f4f80b5a9932f51, 0xcb51a0700d291767 },
+ { 0xaa098e172ef98c95, 0x0e954ce4eba0fe1a }, { 0x2bd8cd0b168ffd66, 0x90666f74fcdbc7b3 }, { 0x40b0c524489a93d6, 0x61d66573398d4b38 }, { 0xace6b22c5879725b, 0x055b7f1376ea9a89 },
+ { 0x44bbedb7addb86e3, 0xd2e347686e40b2da }, { 0xa36dd4a68ffa3263, 0xf763e1a4205b60c4 }, { 0xd95b76d46ba99c9b, 0xd39b8ab91f1d2198 }, { 0x60e846366cd73bbd, 0xb0bdb6abc42a8f24 },
+ { 0xc6fcb057aeed8877, 0xa8779c62d61eb9db }, { 0xec56770810e3e18d, 0x648d1a604f67d1b1 }, { 0x48a695c14118b9bc, 0xc4bc214597d47a3f }, { 0x81d1431c387671f3, 0x9ef32390177b39a9 },
+ { 0x59f83f9cfb5e79f4, 0x11f4405f6dc4b7e8 }, { 0xb9b330e2077ea726, 0x63263c12db37aebc }, { 0x102ca00912c754d4, 0x89d4886c9fb2620e }, { 0xe7d639112221b480, 0x2580a6cc4e1bd21e },
+ { 0x5a6e2160c01e0693, 0xf593b8c5c2e18540 }, { 0x9b0fa758b0f2e4b6, 0x0ab6fe26ec17f7d1 }, { 0x4ddfb7060cd83815, 0x2b15ea28a5bb2c04 }, { 0x567359162cdd39cc, 0xe3ccdee83b754da5 },
+ { 0x8dcc3b6ad4b54eac, 0x88ac45bdeeeff14c }, { 0x5df3170f1e1f6cc1, 0xa2c162443a094e0a }, { 0x4f3ba3ae9f19d3ee, 0x93eefbc46f3cb175 }, { 0xdd505e478ee889ae, 0x60aea8a248d0d87a },
+ { 0x01720a54a881949c, 0x5c9ce97665a2afd9 }, { 0x1bacee10200501d9, 0xc8d934c09ece61a1 }, { 0xd6d0105ebc2adca3, 0x21a3140e49acdbd5 }, { 0xc161863870ece225, 0xff2546e32ef67291 },
+ { 0xc78eba03066c1ceb, 0xf4eb7514b3bc1602 }, { 0x926bfde911f15a40, 0xf340536627ec690f }, { 0x115eaa5dba46c048, 0xd548611afa10cdd7 }, { 0xd03f2c65caaa226d, 0x2a6d27f9d4e6bf46 },
+ { 0xcae1c821422eb728, 0xbe28fa4f2f8a713e }, { 0xa21fdef2277ba6ff, 0xabff08d245f9cf1d }, { 0xd3a93299f1ea5d0a, 0xce0adf637bc38dee }, { 0xc977d6dd796ec84f, 0x5a4f02d580af4396 },
+ { 0x6e112ae813d5ef19, 0x1e19c16af739dab0 }, { 0x2fd3e598f3cee853, 0x23534d6fab163e51 }, { 0x71b6ec6bd691fbf5, 0x65f5d7b13e3a42f3 }, { 0xc0138c6cd86d76b9, 0xa3b9af954b54dd48 },
+ { 0x8e5a2596eff531cb, 0x6ccbbd2741cac3e4 }, { 0x1adee44488849545, 0x9445ddb6fb6cce78 }, { 0x8f282fc24774a557, 0x3057545124686c3d }, { 0x68fe16d3655511d7, 0x15d7f29d6a73be23 },
+ { 0x588a35c853dfed68, 0x4d68a92908661831 }, { 0xb1a560070efc8d4c, 0xc64c7824756e9fbb }, { 0x49d49f95e9992d20, 0x9820c833f276d5e6 }, { 0x41c2cf70e01b074a, 0x3d4a8c055c2fe4e1 },
+ { 0x88b519ad9975cf05, 0x67058ed0dc80a777 }, { 0x85da6b8fdd3764c6, 0x2dc6018b40b6c04b }, { 0x659164f12117ba14, 0x5f147dc6f645d91f }, { 0x51ee6f79f2dc539e, 0xb49e0469c39d86ef },
+ { 0x386273fe3f08d6d5, 0xfdd51f82cc4c9715 }, { 0x99ebb3f023330f4d, 0xb24defca26906aa0 }, { 0x06ef3c3b7680fece, 0x0bce33f79d4a6493 }, { 0x84a861db75b6f05a, 0x715ae8fd25146f92 },
+ { 0xd7a21a0a14ab483f, 0x7d3ffd782c0e740c }, { 0x347f0b88d3cbe98a, 0xeb8a79af35d85ff0 }, { 0x9f048fcb55b3f183, 0xb983dc3dbbda0e33 }, { 0x0d6f72224442abc3, 0x4ac38f5b9c36673c },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0x82475de003360e94, 0x7a94db0ab85e0b01 }, { 0x9e76859ffd32651f, 0xe51f354bde78a1ea }, { 0xa189c00e1c3bd998, 0x4f98f048eadcfdb5 }
+ }, {
+ { 0x3b59ba4fc2860ecc, 0xcdf011538279efe3 }, { 0xf5b62a6c95949603, 0x5bbd918337e7ba9c }, { 0x03d211f9a6abb117, 0x69ad925890c98ec3 }, { 0x60bf6596274482a5, 0xbe84685128596eda },
+ { 0x9fa029a9e0ac34d4, 0x505113c1f94d7689 }, { 0xb0685f4086d27afc, 0x347115b474111e37 }, { 0x39c5a4e106f5d0d6, 0x83874c8262f71b61 }, { 0x8563bfc35dce2b76, 0xd0075495134478dc },
+ { 0xb60f7d710947dbd2, 0xe6e8f2049740c172 }, { 0xf29f070a78d95820, 0xaefeb9baa4f11f98 }, { 0x097b77aaf4d79165, 0xdcc5784b763a2c0c }, { 0x8198835c16285442, 0x4ce9eef4109b531b },
+ { 0x0e525acc199a5f46, 0x29865072e52c8908 }, { 0xede9a2a8ec8557bb, 0x959c8b063d60404b }, { 0xa002af7969cc452c, 0x014fb8f378ebb2ad }, { 0x2e8679be04a62125, 0x43fac9fcfd1b12ff },
+ { 0x066722318f95a12e, 0xd299e7b0e351df45 }, { 0x0be7690430a44f7f, 0x92b2259a96b4d88e }, { 0xbde8147539e394ad, 0x745ad79e01f419fc }, { 0x29af54d8e9ebef06, 0xb6b9e1c56e0db7fb },
+ { 0xfd835291039b686b, 0xa0a22641319aecd1 }, { 0xa3d0be80cf67f43b, 0x68e22aabe8223c6e }, { 0xae50f5b570561a6a, 0x28c9e8819dc73ba5 }, { 0x5834ce2043693d7e, 0x1ad9eb5a3ae90ffa },
+ { 0xd9ac4d7c5541693c, 0x563005ae2a725ce1 }, { 0xc1f3c5b82c50a884, 0x98111f2b20f5a636 }, { 0xaf1efae2128e7567, 0x0f132708ed8041e4 }, { 0xeca7adff8e5d38b6, 0xb246448f4d273a0a },
+ { 0x5001b6ddd566c316, 0xe1c65c983c9459b7 }, { 0x936e6dcb3d45b588, 0x37a01e62fcef0b03 }, { 0x83049df2d25b8a58, 0x029eb325f015a799 }, { 0x9795515476a3cabc, 0xab4ea403ff3020c4 },
+ { 0xe492d5021852c6de, 0x4959f34d4b5a6c47 }, { 0xcfa19f7435caf7c2, 0xb1974f59c5d92f3e }, { 0xd3052b2f073d494e, 0xe358efbdcc81fe2e }, { 0x2c1a6710c0d5ff3f, 0x0d8d942d1d95e67d },
+ { 0xf4f8253bf74cf90e, 0x7c675e0a47a0c0dd }, { 0xde85601ab80ca71f, 0xa3732d97b964f9e5 }, { 0xb91328ea7205eb99, 0xe8b46dff022b323b }, { 0x529da87311151d0c, 0xafb10149dc1aad35 },
+ { 0xaccceb1bb425c470, 0x66beb5507d49cf27 }, { 0xa837d784ffc3bb44, 0xfa500f317e96e4e0 }, { 0xf3d1085d1a01372d, 0x89247633d4b665d9 }, { 0xf9786e0e487d175f, 0x3c4c9c203245c716 },
+ { 0x719b9af8aa82d278, 0xac600a9f54e4b801 }, { 0x412549b358a093cb, 0xf3223e5640298f6c }, { 0xcc738e8d936146d5, 0xd83add015510a1fd }, { 0x597ac17721b15273, 0x3d0324d34aae75bb },
+ { 0x0cce4462dde9815c, 0x67f10da305a27d8a }, { 0x160dd208608b9efe, 0xe7a74af7efab73df }, { 0x72498b010c29636f, 0xc5cd98c7c42d36c2 }, { 0x029c1eaec473de1a, 0x4e775dd1e08ef482 },
+ { 0x7a7cf3fc9a269d07, 0x3ed22f05c250608f }, { 0x6fa3300d5c06b2ee, 0xb0d8f7aabd329d93 }, { 0xe069e99d53b4b9ea, 0xd5b7492c48854780 }, { 0xb49363dfcd3405c8, 0xa89fafd577ce35f0 },
+ { 0x1ca4b45b32f7be8c, 0x52cfa0e40958d110 }, { 0x191187931bc9aeb5, 0xe9fbd50c7ac08096 }, { 0x566694ec5af36238, 0x335fbb28dfc586f2 }, { 0xd0d73ad6a196f859, 0x8af57de55c4870ed },
+ { 0x5be6dfd9e5c28c69, 0x73747902aa208139 }, { 0x79aee2053c8d2c10, 0x577fbd5d5299ee4c }, { 0xe2f5f73397c767f0, 0x9bc014fda80bb302 }, { 0x4910314eceaf6da3, 0x083d89944654d921 },
+ { 0x8e84d6c76d6a6409, 0x42b5710f85f0a052 }, { 0x014e0f5762d86f0d, 0x27dacf8970477a41 }, { 0xe3bbf864f51f08fd, 0xbc1adb74d84cc943 }, { 0x514fb98ab7beac1b, 0xc61c93114cd323f6 },
+ { 0x88e3f4f6e2ffc527, 0x902c96bf66a17f17 }, { 0x4f77137f413acc8d, 0xdaa46e24a5050664 }, { 0x44907a7b719e83f2, 0x48164bbe33b1deea }, { 0x91f27365f9366b92, 0x79d743b31c61ff81 },
+ { 0xd42c0649ea70876d, 0x161bc7845f975b2a }, { 0x5f1de346ae24f35d, 0xef9ac363a9ffaafe }, { 0xb1265017e40a15f1, 0x13abda3d04566476 }, { 0xa14ca02e0b142a21, 0x2695777a08acc8ec },
+ { 0xf14d16f3de72e937, 0xc7532be23438915b }, { 0x27fd0e14f071b040, 0x9f3fb1b78b213ef3 }, { 0xbac13913d4ae5a8e, 0x8119ffa792e2bcf8 }, { 0x460c64d5b5ed5de8, 0x0661166fd33f2a68 },
+ { 0x1491cca6a4f840e4, 0xa9d017260f25875d }, { 0xc9c6bd45ba5f56ec, 0x630ea8e92688f07b }, { 0xc36fdb16e823769e, 0xd66642fac07b52b4 }, { 0x650a565e0e7a929c, 0x05b01db95bc13f5c },
+ { 0x43b9571d9cd34dd1, 0xbd556387a0a77bee }, { 0xe127e6ca316cd6e7, 0xf26d86a538c23dc1 }, { 0x185f88c47911c1b8, 0xce211a850a87fad7 }, { 0x55b48515fc58d32f, 0x5af229704f0c0831 },
+ { 0x3d3e987e4d13afe2, 0x1f69f6e3612830a6 }, { 0x350be083db1c518a, 0xe4764121675566eb }, { 0x6a1603c57538a2d7, 0x0bec8242ceaacc15 }, { 0x4ac220b76804dcb4, 0x61901bccd69d57e2 },
+ { 0x7c1bd1cd15b33c29, 0xec4bc8b52101bfca }, { 0x8c18c869a919ba13, 0x0cc22cde657e54d0 }, { 0xeac08fce01c89998, 0x60dfa33fae76e54f }, { 0x4e391c2823e2a380, 0xfd7ea1add5427c25 },
+ { 0x95094ffab2d014a6, 0xe539f9d21fbed446 }, { 0x730784566ef10c62, 0xe217574eb46a4c83 }, { 0x30bed34bf22241b3, 0x5f4234c914cd376d }, { 0xaaabc92a3bb0655e, 0xb42752e09e181062 },
+ { 0x0aa96653527c2072, 0xb568ea13e6f3a2cf }, { 0xd24b247865e52643, 0xc4822034bcc6846f }, { 0x04fb3c9f4be67f34, 0x9ceeba6103df2bc7 }, { 0x57289bbb382b0d35, 0x148574a1af82fcb3 },
+ { 0xf83661592aa57852, 0x1b9653a94202bd57 }, { 0xdb3053d29132b726, 0x1847587fcafca863 }, { 0xad82e44cd6fdab7d, 0x41647ad90d0eb566 }, { 0xbf740adbfd904ab7, 0x3a2d8a4fe17aed7e },
+ { 0x7b32fcabf8fef20a, 0x1908e08cb2171ace }, { 0xfbe470a08c0ec945, 0x723bc1f1d2cb3394 }, { 0x1deabb0c502fd181, 0x75156f6d791fab51 }, { 0x219a2c257fe4116e, 0x4da656076870e1b6 },
+ { 0xabe5c67d59680a53, 0x93fd9d69ee5f6a23 }, { 0x5ccff2bf088f424a, 0x8637513b3936243d }, { 0x22483ddcd94fa079, 0x240bc45ff8b96f75 }, { 0x2d546847a20d9032, 0x2a575ba46dd29c3c },
+ { 0x86b1ae3afb659a61, 0xb9aac6cd838df61f }, { 0xca14acbc1cf4e7fb, 0x0aa33ab1b6417eb8 }, { 0x05b533c8293e1039, 0xbb3475e873985186 }, { 0x69c4123cd39313c0, 0x6241101a5e6342d6 },
+ { 0x99c70b986f3995fa, 0x82c8f4711a1ca9cc }, { 0x76b2b79e47cf1c5b, 0x592322a6c7f21d05 }, { 0x336cc2b25489f0a4, 0x36efa6918404b9ae }, { 0xbe3a058c9f4825ba, 0x1df745c6913d973f },
+ { 0x6b580c9217e0cdda, 0x2c364dcbbeedb654 }, { 0x7560a667e164ad4c, 0x308eb0fe573b93c6 }, { 0xdc197eb47c7f7905, 0xed04704659ea0d67 }, { 0x9c723850460785c3, 0x39fc81996984f84a },
+ { 0xf00319a4bcaa863a, 0xe089e46b447feb1a }, { 0xe85c9160c5bb4782, 0x2ea8feee4ef811cd }, { 0xa4f993e6222a3a18, 0x9da102927b34996a }, { 0xe740c4fbbef977c9, 0x20f46115db93e284 },
+ { 0x083578fd960ffe68, 0xfb1fb7c2067d564d }, { 0xcb5aa3eb7e2c88f6, 0x2d79f538c60604f9 }, { 0x20d423721d3c7e63, 0x6a7c998e18379bf7 }, { 0x3445efd4b9c43e87, 0xc3ac8ea817121caa },
+ { 0xa979d8d39d1bd449, 0xdd8ac0b80ed19ea1 }, { 0xa29eb1d7adbf9b36, 0x4f38e5229865462f }, { 0x644459096ca2fd91, 0x226ad2302b86451d }, { 0x4deb0dd185491297, 0x94d333f5458bf2e6 },
+ { 0x7e87cf63d1c0e233, 0xa23c9564c18f4b48 }, { 0xdd5771e31ea71608, 0xcadebfcf29ad7726 }, { 0xfe514368a530d97c, 0xc90fb419a1536212 }, { 0xa6658d48e659e402, 0xd3d65f439bba6de8 },
+ { 0xd6b018e72e035977, 0x586c9a55bf19afa8 }, { 0x9220629c5f9dda85, 0x107ad1eb8ca87142 }, { 0xfccd5dc661430766, 0x8778e9c841dd9690 }, { 0x742ea93083bcc241, 0x17547f77277ce987 },
+ { 0x8b31e50f44547430, 0xf98104e7f668f1d4 }, { 0x688a1d6bb14b7ccd, 0x459bdf932e243897 }, { 0x106af039ef1e3fd0, 0x353ead470cfaac9a }, { 0x9eee26fe82745bd9, 0x778bdc48890a0cc8 },
+ { 0x3222cde536519fa9, 0x11356918f443c3ef }, { 0xc794e789a3c509aa, 0x4a88f89bc3a47973 }, { 0xb5dd6c88afec6ac5, 0x8f45605c07894fb1 }, { 0xd562091e88a8e860, 0x31c1080d2fd0216b },
+ { 0x3fa286d0896071f8, 0x511eab3281a6c424 }, { 0x8fcad9900fb20b04, 0x656fbe86f5b7da13 }, { 0x3797fe2d1f6f8f90, 0xaa011cf087db9269 }, { 0xb2f441ee42a1a4e6, 0x7a064865949feab5 },
+ { 0x1e38aaf5f6846096, 0x1cb8fd35e9d62592 }, { 0x1b8d993ddfba70af, 0xa78c88dd9a4e7414 }, { 0x406b46e43a78fcc6, 0xd4f8f1df306ef52d }, { 0xc6dae8dec11d66a7, 0x6d523712b3e30332 },
+ { 0xef75bc0628f689a1, 0xdbebd6d7ddeeb4c9 }, { 0xcd3d81daf1b929d8, 0xffe012882557dbbc }, { 0x8d56c73ecbc1d51e, 0x2b18e35715392e91 }, { 0x26b3014392a9df4d, 0xb8e57e3efb6644b2 },
+ { 0x5aa8d08e871ae364, 0x54aeb68bda67fb78 }, { 0x4ca50286e7917d9a, 0xb309fc7c35cc88a7 }, { 0x6eed3f5a3ededde3, 0x97023823cd75e7d2 }, { 0x6c7121f4faad03f9, 0xd97565f22dfb1350 },
+ { 0x988904cf0de1faf7, 0xa5123bf86a5bd38d }, { 0xf72a34c251e74819, 0x15cacc52d7694e1e }, { 0xbb8f3644b6763583, 0xa6c3302ee2a5c6b9 }, { 0x0f1c559b7b42304b, 0x0e5c9ffb956bf349 },
+ { 0x80d68c0b74f03b4f, 0x6b33217d60dc295a }, { 0x842db0943f16447b, 0xf7dd9b1c6303029d }, { 0x3c7097292fcbc0ef, 0x38b3396a116f4ae7 }, { 0x36d9f17a7db7e09d, 0x8ddbd379f79ce828 },
+ { 0x2306328bbb97cf74, 0x03d10bd688fe1534 }, { 0x13b8e1c049b58ec7, 0x5c933f1f9c332259 }, { 0x12f6ee972b6de1ca, 0x7b49f096ec745818 }, { 0x87ffa16d99bdf56c, 0x9e700944f3ca8c5e },
+ { 0x1743dd5f0253f1f3, 0xc07d857e9fec099e }, { 0xd8e2422b37990631, 0x71eaca275a3526a0 }, { 0x7fc9c034b3188d3e, 0x85e65aedb1c83109 }, { 0x53d3a72473cd7201, 0x886bcec0ac5dd774 },
+ { 0x388babb6642dbfdb, 0xa45d830b12b06120 }, { 0xe60ecbacdc2118c4, 0x072eae9cabd498c5 }, { 0xc888b212d88739e1, 0x44d4676056cf8a3a }, { 0x9a151a61c99224ed, 0xeb6566298ad5270f },
+ { 0x9b5b1536ab4a4be0, 0xccbfa9a0fa925d4e }, { 0xf6643b95333f2714, 0x321003dba72e345f }, { 0xb74172266b9fb4df, 0xc1323d8de707bb33 }, { 0x5e53ec11ccfc9c50, 0xc8400cead9b8d0bf },
+ { 0x31f0dc1c90fa2ebe, 0x7898fb40648a4d2c }, { 0x944740add0087bab, 0xc2e3365b6ff9ae07 }, { 0x485e3e19ac7702ae, 0x2fe7461d3613a360 }, { 0x0d804b35bf31ee51, 0x402bc22a75e507cb },
+ { 0xdfcb6f4ddad4c812, 0x84a9e21ec92383a4 }, { 0xe9129e37a763288f, 0x097231673ebf6b8c }, { 0x78e0ed525e55431d, 0x70a572d422de940d }, { 0x6d3f2ea398756cf4, 0xfeafaa7b5dbc6911 },
+ { 0xe5dcda557a8aa9d3, 0x6e833cc43b1d1606 }, { 0x45de752c1346ecff, 0x6fcc843743f6a4ab }, { 0x5d81fde86a572d47, 0xa1ed9eb249715e7c }, { 0xa5b79cb140f25515, 0xba7bcd1b0b73e32b },
+ { 0x66d847a7a8d1238b, 0x6c1d8fe1cb08b19f }, { 0xbca61b225b3bfba0, 0x5380181771b363bd }, { 0x3eec8987ebb81ef5, 0x76c464bbf1e1be65 }, { 0x2fc876e9667e4e28, 0x642006758d5c68be },
+ { 0x242f1fed56da0157, 0xf69223ef1be8b030 }, { 0x636d746f81ef33b2, 0xd729fa09b890e019 }, { 0x7d55de9a776b5324, 0xcb91073c5146c58b }, { 0xceef9023571298cf, 0x964d80d0b59e557f },
+ { 0xc0bdcaef4e88c789, 0xbfcbd0a250b2dc77 }, { 0x1124ff6e8dc650dd, 0x12e462ce7cbdd6db }, { 0x824a92a5b083e555, 0x25447cac8052ddd8 }, { 0xda7e5c85f3ead82b, 0x3f9d97f6babbd222 },
+ { 0x1f76a5a2945c0f9b, 0x3b6232bc99915fd3 }, { 0xb3ba4eb92079cbeb, 0x5ddc87ece4d890f4 }, { 0x9d3c370724dfeace, 0x1e264e1019c3820b }, { 0x47426b82d73532e5, 0x21bbd9e6a3785029 },
+ { 0x96db5e03147ba5b1, 0x8c946b8a8f775a85 }, { 0x54fa8a429e80bc22, 0x7d28e6f93f4b7270 }, { 0xc446f670056eb8bd, 0x23256ac3536df7b0 }, { 0x15dfc3f1c6202fe9, 0x8e0ad8af7f62fd1c },
+ { 0x07292d66ed4dce23, 0xf54328399316a504 }, { 0x70d595afc85abd75, 0x8bbac51624a3c240 }, { 0x90bc7c329bee049f, 0x5e0d8c3a6c2685c0 }, { 0x1ac3966abd621fa2, 0x80564754ea090e55 },
+ { 0xa72b821f84818b0f, 0xf40c90caebfd17a9 }, { 0xd1993581c34e9754, 0xad2fb26c2c0f0aac }, { 0x679648f0ca094c86, 0x4bc74068bb4fcbde }, { 0xc221d4418afb1993, 0xf1bc8d73b03c28f5 },
+ { 0x256110ba34026e5a, 0xd148ec666bafca71 }, { 0x8a7fea58268c1b3d, 0xde5bcb6e862f8b95 }, { 0xb85d27bd10dd8494, 0xcf6ea276726c487a }, { 0x77fcb8c925177356, 0x7ef9ed2fb7b56744 },
+ { 0x62237b38e3375cbf, 0xf0f33580c8d79a58 }, { 0xeb8e80996310f695, 0x47056cb6de319f0e }, { 0x4b8c2fe00adcb3b9, 0x464ad445a6da2da3 }, { 0x2a7d45214f405e11, 0xdf14739dfec43938 },
+ { 0x28e15b8f8b33800b, 0x91632e4c1e4acdba }, { 0xff1f4c3fc7e8b671, 0xeed57b90d1141853 }, { 0xc508f92767b6d7b0, 0x04ffa54a232a8df1 }, { 0x2b334a762d98311c, 0xf8cebc148e834379 },
+ { 0x42f7584afe0b22dc, 0x9a8fac0ed0e001af }, { 0x61f16ac1459ceda8, 0x995ea7d8581e149b }, { 0x3a17b518a05e61c1, 0xea2adedaf23e95a2 }, { 0x89adfba18027aa2a, 0xb7f6593616e60556 },
+ { 0x0000000000000000, 0x0000000000000000 }, { 0xee3bb3514a2ee6ac, 0xfc31195eada9ce88 }, { 0xfaaa7ff7eed6a648, 0x55e10e78a28c49d5 }, { 0xd7fe17b04cdb367a, 0x7fb655dccf5ed5e9 }
+ }
+ };
+
+ static const uint64 C[32][2] = {
+ { 0xb87a486c7276a26e, 0x019484dd10bd275d }, { 0xb3f490d8e4ec87dc, 0x02ebcb7920b94eba }, { 0x0b8ed8b4969a25b2, 0x037f4fa4300469e7 }, { 0xa52be3730b1bcd7b, 0x041555f240b19cb7 },
+ { 0x1d51ab1f796d6f15, 0x0581d12f500cbbea }, { 0x16df73abeff74aa7, 0x06fe9e8b6008d20d }, { 0xaea53bc79d81e8c9, 0x076a1a5670b5f550 }, { 0x895605e6163659f6, 0x082aaa2780a1fbad },
+ { 0x312c4d8a6440fb98, 0x09be2efa901cdcf0 }, { 0x3aa2953ef2dade2a, 0x0ac1615ea018b517 }, { 0x82d8dd5280ac7c44, 0x0b55e583b0a5924a }, { 0x2c7de6951d2d948d, 0x0c3fffd5c010671a },
+ { 0x9407aef96f5b36e3, 0x0dab7b08d0ad4047 }, { 0x9f89764df9c11351, 0x0ed434ace0a929a0 }, { 0x27f33e218bb7b13f, 0x0f40b071f0140efd }, { 0xd1ac0a0f2c6cb22f, 0x1054974ec3813599 },
+ { 0x69d642635e1a1041, 0x11c01393d33c12c4 }, { 0x62589ad7c88035f3, 0x12bf5c37e3387b23 }, { 0xda22d2bbbaf6979d, 0x132bd8eaf3855c7e }, { 0x7487e97c27777f54, 0x1441c2bc8330a92e },
+ { 0xccfda1105501dd3a, 0x15d54661938d8e73 }, { 0xc77379a4c39bf888, 0x16aa09c5a389e794 }, { 0x7f0931c8b1ed5ae6, 0x173e8d18b334c0c9 }, { 0x58fa0fe93a5aebd9, 0x187e3d694320ce34 },
+ { 0xe0804785482c49b7, 0x19eab9b4539de969 }, { 0xeb0e9f31deb66c05, 0x1a95f6106399808e }, { 0x5374d75dacc0ce6b, 0x1b0172cd7324a7d3 }, { 0xfdd1ec9a314126a2, 0x1c6b689b03915283 },
+ { 0x45aba4f6433784cc, 0x1dffec46132c75de }, { 0x4e257c42d5ada17e, 0x1e80a3e223281c39 }, { 0xf65f342ea7db0310, 0x1f14273f33953b64 }, { 0x619b141e58d8a75e, 0x20a8ed9c45c16af1 }
+ };
+
+ static inline void LS(uint64 x1, uint64 x2, uint64* t1, uint64* t2)
+ {
+ *t1 = T[0][(byte)(x1)][0] ^ T[1][(byte)(x1 >> 8)][0] ^ T[2][(byte)(x1 >> 16)][0] ^ T[3][(byte)(x1 >> 24)][0] ^ T[4][(byte)(x1 >> 32)][0] ^ T[5][(byte)(x1 >> 40)][0] ^
+ T[6][(byte)(x1 >> 48)][0] ^ T[7][(byte)(x1 >> 56)][0] ^ T[8][(byte)(x2)][0] ^ T[9][(byte)(x2 >> 8)][0] ^ T[10][(byte)(x2 >> 16)][0] ^ T[11][(byte)(x2 >> 24)][0] ^
+ T[12][(byte)(x2 >> 32)][0] ^ T[13][(byte)(x2 >> 40)][0] ^ T[14][(byte)(x2 >> 48)][0] ^ T[15][(byte)(x2 >> 56)][0];
+ *t2 = T[0][(byte)(x1)][1] ^ T[1][(byte)(x1 >> 8)][1] ^ T[2][(byte)(x1 >> 16)][1] ^ T[3][(byte)(x1 >> 24)][1] ^ T[4][(byte)(x1 >> 32)][1] ^ T[5][(byte)(x1 >> 40)][1] ^
+ T[6][(byte)(x1 >> 48)][1] ^ T[7][(byte)(x1 >> 56)][1] ^ T[8][(byte)(x2)][1] ^ T[9][(byte)(x2 >> 8)][1] ^ T[10][(byte)(x2 >> 16)][1] ^ T[11][(byte)(x2 >> 24)][1] ^
+ T[12][(byte)(x2 >> 32)][1] ^ T[13][(byte)(x2 >> 40)][1] ^ T[14][(byte)(x2 >> 48)][1] ^ T[15][(byte)(x2 >> 56)][1];
+ }
+
+ static inline void ILS(uint64 x1, uint64 x2, uint64* t1, uint64* t2)
+ {
+ *t1 = IT[0][(byte)(x1)][0] ^ IT[1][(byte)(x1 >> 8)][0] ^ IT[2][(byte)(x1 >> 16)][0] ^ IT[3][(byte)(x1 >> 24)][0] ^ IT[4][(byte)(x1 >> 32)][0] ^ IT[5][(byte)(x1 >> 40)][0] ^
+ IT[6][(byte)(x1 >> 48)][0] ^ IT[7][(byte)(x1 >> 56)][0] ^ IT[8][(byte)(x2)][0] ^ IT[9][(byte)(x2 >> 8)][0] ^ IT[10][(byte)(x2 >> 16)][0] ^ IT[11][(byte)(x2 >> 24)][0] ^
+ IT[12][(byte)(x2 >> 32)][0] ^ IT[13][(byte)(x2 >> 40)][0] ^ IT[14][(byte)(x2 >> 48)][0] ^ IT[15][(byte)(x2 >> 56)][0];
+ *t2 = IT[0][(byte)(x1)][1] ^ IT[1][(byte)(x1 >> 8)][1] ^ IT[2][(byte)(x1 >> 16)][1] ^ IT[3][(byte)(x1 >> 24)][1] ^ IT[4][(byte)(x1 >> 32)][1] ^ IT[5][(byte)(x1 >> 40)][1] ^
+ IT[6][(byte)(x1 >> 48)][1] ^ IT[7][(byte)(x1 >> 56)][1] ^ IT[8][(byte)(x2)][1] ^ IT[9][(byte)(x2 >> 8)][1] ^ IT[10][(byte)(x2 >> 16)][1] ^ IT[11][(byte)(x2 >> 24)][1] ^
+ IT[12][(byte)(x2 >> 32)][1] ^ IT[13][(byte)(x2 >> 40)][1] ^ IT[14][(byte)(x2 >> 48)][1] ^ IT[15][(byte)(x2 >> 56)][1];
+ }
+
+ static inline void ILSS(uint64 x1, uint64 x2, uint64* t1, uint64* t2)
+ {
+ *t1 = IT[0][S[(byte)(x1)]][0] ^ IT[1][S[(byte)(x1 >> 8)]][0] ^ IT[2][S[(byte)(x1 >> 16)]][0] ^ IT[3][S[(byte)(x1 >> 24)]][0] ^ IT[4][S[(byte)(x1 >> 32)]][0] ^ IT[5][S[(byte)(x1 >> 40)]][0] ^
+ IT[6][S[(byte)(x1 >> 48)]][0] ^ IT[7][S[(byte)(x1 >> 56)]][0] ^ IT[8][S[(byte)(x2)]][0] ^ IT[9][S[(byte)(x2 >> 8)]][0] ^ IT[10][S[(byte)(x2 >> 16)]][0] ^ IT[11][S[(byte)(x2 >> 24)]][0] ^
+ IT[12][S[(byte)(x2 >> 32)]][0] ^ IT[13][S[(byte)(x2 >> 40)]][0] ^ IT[14][S[(byte)(x2 >> 48)]][0] ^ IT[15][S[(byte)(x2 >> 56)]][0];
+ *t2 = IT[0][S[(byte)(x1)]][1] ^ IT[1][S[(byte)(x1 >> 8)]][1] ^ IT[2][S[(byte)(x1 >> 16)]][1] ^ IT[3][S[(byte)(x1 >> 24)]][1] ^ IT[4][S[(byte)(x1 >> 32)]][1] ^ IT[5][S[(byte)(x1 >> 40)]][1] ^
+ IT[6][S[(byte)(x1 >> 48)]][1] ^ IT[7][S[(byte)(x1 >> 56)]][1] ^ IT[8][S[(byte)(x2)]][1] ^ IT[9][S[(byte)(x2 >> 8)]][1] ^ IT[10][S[(byte)(x2 >> 16)]][1] ^ IT[11][S[(byte)(x2 >> 24)]][1] ^
+ IT[12][S[(byte)(x2 >> 32)]][1] ^ IT[13][S[(byte)(x2 >> 40)]][1] ^ IT[14][S[(byte)(x2 >> 48)]][1] ^ IT[15][S[(byte)(x2 >> 56)]][1];
+ }
+
+ static inline void ISI(byte* val)
+ {
+ val[0] = IS[val[0]];
+ val[1] = IS[val[1]];
+ val[2] = IS[val[2]];
+ val[3] = IS[val[3]];
+ val[4] = IS[val[4]];
+ val[5] = IS[val[5]];
+ val[6] = IS[val[6]];
+ val[7] = IS[val[7]];
+ }
+
+ static inline void F(uint64 k00, uint64 k01, uint64 k10, uint64 k11, int i, uint64* o00, uint64* o01, uint64* o10, uint64* o11)
+ {
+ *o10 = k00;
+ *o11 = k01;
+ k00 ^= C[i][0];
+ k01 ^= C[i][1];
+ LS(k00, k01, o00, o01);
+ *o00 ^= k10;
+ *o01 ^= k11;
+ }
+
+ static inline void FK(uint64* k00, uint64* k01, uint64* k10, uint64* k11, int ist)
+ {
+ uint64 t00, t01, t10, t11;
+ int i;
+ for (i = 0; i < 8; i += 2)
+ {
+ F(*k00, *k01, *k10, *k11, i + ist, &t00, &t01, &t10, &t11);
+ F(t00, t01, t10, t11, i + 1 + ist, k00, k01, k10, k11);
+ }
+ }
+
+ void kuznyechik_set_key(const byte* key, kuznyechik_kds* kds)
+ {
+ int i;
+ uint64 k00 = *(const uint64*)key;
+ uint64 k01 = *(((const uint64*)key) + 1);
+ uint64 k10 = *(((const uint64*)key) + 2);
+ uint64 k11 = *(((const uint64*)key) + 3);
+
+ kds->rke[0][0] = k00;
+ kds->rke[0][1] = k01;
+ kds->rke[1][0] = k10;
+ kds->rke[1][1] = k11;
+ FK(&k00, &k01, &k10, &k11, 0);
+ kds->rke[2][0] = k00;
+ kds->rke[2][1] = k01;
+ kds->rke[3][0] = k10;
+ kds->rke[3][1] = k11;
+ FK(&k00, &k01, &k10, &k11, 8);
+ kds->rke[4][0] = k00;
+ kds->rke[4][1] = k01;
+ kds->rke[5][0] = k10;
+ kds->rke[5][1] = k11;
+ FK(&k00, &k01, &k10, &k11, 16);
+ kds->rke[6][0] = k00;
+ kds->rke[6][1] = k01;
+ kds->rke[7][0] = k10;
+ kds->rke[7][1] = k11;
+ FK(&k00, &k01, &k10, &k11, 24);
+ kds->rke[8][0] = k00;
+ kds->rke[8][1] = k01;
+ kds->rke[9][0] = k10;
+ kds->rke[9][1] = k11;
+
+ kds->rkd[0][0] = kds->rke[0][0];
+ kds->rkd[0][1] = kds->rke[0][1];
+
+ for (i = 1; i < 10; i++)
+ {
+ uint64 t1 = kds->rke[i][0], t2 = kds->rke[i][1];
+ kds->rkd[i][0] = t1; kds->rkd[i][1] = t2;
+ ILSS(t1, t2, &kds->rkd[i][0], &kds->rkd[i][1]);
+ }
+
+#ifdef CPPCRYPTO_DEBUG
+ for(int i = 0; i < 10; i++)
+ printf("key[%d]: { 0x%016I64X, 0x%016I64X }\n", i, kds->rke[i][0], kds->rke[i][1]);
+#endif
+
+ }
+
+ void kuznyechik_encrypt_block(byte* out, const byte* in, kuznyechik_kds* kds)
+ {
+ uint64 x1 = *(const uint64*)in;
+ uint64 x2 = *(((const uint64*)in)+1);
+ uint64 t1, t2;
+ x1 ^= kds->rke[0][0];
+ x2 ^= kds->rke[0][1];
+ LS(x1, x2, &t1, &t2);
+ t1 ^= kds->rke[1][0];
+ t2 ^= kds->rke[1][1];
+ LS(t1, t2, &x1, &x2);
+ x1 ^= kds->rke[2][0];
+ x2 ^= kds->rke[2][1];
+ LS(x1, x2, &t1, &t2);
+ t1 ^= kds->rke[3][0];
+ t2 ^= kds->rke[3][1];
+ LS(t1, t2, &x1, &x2);
+ x1 ^= kds->rke[4][0];
+ x2 ^= kds->rke[4][1];
+ LS(x1, x2, &t1, &t2);
+ t1 ^= kds->rke[5][0];
+ t2 ^= kds->rke[5][1];
+ LS(t1, t2, &x1, &x2);
+ x1 ^= kds->rke[6][0];
+ x2 ^= kds->rke[6][1];
+ LS(x1, x2, &t1, &t2);
+ t1 ^= kds->rke[7][0];
+ t2 ^= kds->rke[7][1];
+ LS(t1, t2, &x1, &x2);
+ x1 ^= kds->rke[8][0];
+ x2 ^= kds->rke[8][1];
+ LS(x1, x2, &t1, &t2);
+ t1 ^= kds->rke[9][0];
+ t2 ^= kds->rke[9][1];
+ *(uint64*)out = t1;
+ *(((uint64*)out) + 1) = t2;
+ }
+
+ void kuznyechik_decrypt_block(byte* out, const byte* in, kuznyechik_kds* kds)
+ {
+ uint64 x1 = *(const uint64*)in;
+ uint64 x2 = *(((const uint64*)in) + 1);
+ uint64 t1, t2;
+
+ ILSS(x1, x2, &t1, &t2);
+ t1 ^= kds->rkd[9][0];
+ t2 ^= kds->rkd[9][1];
+ ILS(t1, t2, &x1, &x2);
+ x1 ^= kds->rkd[8][0];
+ x2 ^= kds->rkd[8][1];
+ ILS(x1, x2, &t1, &t2);
+ t1 ^= kds->rkd[7][0];
+ t2 ^= kds->rkd[7][1];
+ ILS(t1, t2, &x1, &x2);
+ x1 ^= kds->rkd[6][0];
+ x2 ^= kds->rkd[6][1];
+ ILS(x1, x2, &t1, &t2);
+ t1 ^= kds->rkd[5][0];
+ t2 ^= kds->rkd[5][1];
+ ILS(t1, t2, &x1, &x2);
+ x1 ^= kds->rkd[4][0];
+ x2 ^= kds->rkd[4][1];
+ ILS(x1, x2, &t1, &t2);
+ t1 ^= kds->rkd[3][0];
+ t2 ^= kds->rkd[3][1];
+ ILS(t1, t2, &x1, &x2);
+ x1 ^= kds->rkd[2][0];
+ x2 ^= kds->rkd[2][1];
+ ILS(x1, x2, &t1, &t2);
+ t1 ^= kds->rkd[1][0];
+ t2 ^= kds->rkd[1][1];
+ ISI((byte*)&t1);
+ ISI((byte*)&t2);
+ t1 ^= kds->rkd[0][0];
+ t2 ^= kds->rkd[0][1];
+ *(uint64*)out = t1;
+ *(((uint64*)out) + 1) = t2;
+ }
+
+
+#if 0
+ static inline uint8_t mul_gf(uint8_t x, uint8_t y, uint16_t p) {
+ uint8_t r = 0;
+ uint8_t hbit = 0;
+ while (y) {
+ if (y & 1)
+ r ^= x;
+ hbit = x & 0x80;
+ x <<= 1;
+ if (hbit == 0x80)
+ x ^= p;
+ y >>= 1;
+ }
+ return r;
+ }
+
+ static inline uint8_t l(uint8_t* a)
+ {
+ return a[15] ^ mul_gf(a[14], 148, 0x1c3) ^ mul_gf(a[13], 32, 0x1c3) ^ mul_gf(a[12], 133, 0x1c3) ^ mul_gf(a[11], 16, 0x1c3)
+ ^ mul_gf(a[10], 194, 0x1c3) ^ mul_gf(a[9], 192, 0x1c3) ^ a[8] ^ mul_gf(a[7], 251, 0x1c3) ^ a[6] ^ mul_gf(a[5], 192, 0x1c3)
+ ^ mul_gf(a[4], 194, 0x1c3) ^ mul_gf(a[3], 16, 0x1c3) ^ mul_gf(a[2], 133, 0x1c3) ^ mul_gf(a[1], 32, 0x1c3) ^ mul_gf(a[0], 148, 0x1c3);
+ }
+
+ static inline void R(uint8_t* val)
+ {
+ uint8_t x = l(val);
+ memmove(val + 1, val, 15);
+ val[0] = x;
+ }
+
+ static inline void L(uint8_t* val)
+ {
+ for (int i = 0; i < 16; i++)
+ R(val);
+ }
+
+ static inline void IR(uint8_t* val)
+ {
+ uint8_t x = val[0];
+ memmove(val, val + 1, 15);
+ val[15] = x;
+ x = l(val);
+ val[15] = x;
+ }
+
+ static inline void IL(uint8_t* val)
+ {
+ for (int i = 0; i < 16; i++)
+ IR(val);
+ }
+
+ void generate_tables()
+ {
+ printf("static const uint64_t T[16][256][2] = {\n");
+ union
+ {
+ uint64_t ll[2];
+ uint8_t cc[16];
+ } v;
+ for (int i = 0; i < 16; i++)
+ {
+ printf("\t{\n\t\t");
+ for (int j = 0; j < 256; j++)
+ {
+ uint8_t s = S[j];
+ v.ll[0] = v.ll[1] = 0;
+ v.cc[i] = s;
+ L(v.cc);
+ printf("{ 0x%016I64x, 0x%016I64x }", v.ll[0], v.ll[1]);
+ if (j == 255)
+ printf("\n\t}");
+ else
+ {
+ printf(", ");
+ if ((j + 1) % 4 == 0)
+ {
+ printf("\n\t\t");
+ }
+ }
+ }
+ if (i != 15)
+ printf(",");
+ }
+ printf("\n};");
+ printf("static const uint64_t IT[16][256][2] = {\n");
+ for (int i = 0; i < 16; i++)
+ {
+ printf("\t{\n\t\t");
+ for (int j = 0; j < 256; j++)
+ {
+ uint8_t s = IS[j];
+ v.ll[0] = v.ll[1] = 0;
+ v.cc[i] = s;
+ IL(v.cc);
+ printf("{ 0x%016I64x, 0x%016I64x }", v.ll[0], v.ll[1]);
+ if (j == 255)
+ printf("\n\t}");
+ else
+ {
+ printf(", ");
+ if ((j + 1) % 4 == 0)
+ {
+ printf("\n\t\t");
+ }
+ }
+ }
+ if (i != 15)
+ printf(",");
+ }
+ printf("\n};");
+ printf("static const uint64_t C[32][2] = {\n");
+ for (int i = 0; i <= 32; i++)
+ {
+ v.ll[0] = v.ll[1] = 0;
+ v.cc[15] = i;
+ L(v.cc);
+ printf("{ 0x%016I64x, 0x%016I64x },\n", v.ll[0], v.ll[1]);
+ }
+ printf("};");
+ }
+#endif
+
diff --git a/src/Crypto/kuznyechik.h b/src/Crypto/kuznyechik.h
new file mode 100644
index 00000000..ad67f957
--- /dev/null
+++ b/src/Crypto/kuznyechik.h
@@ -0,0 +1,26 @@
+/*
+This code is written by kerukuro for cppcrypto library (http://cppcrypto.sourceforge.net/)
+and released into public domain.
+*/
+
+/* Adapted to VeraCrypt */
+
+#ifndef CPPCRYPTO_KUZNYECHIK_H
+#define CPPCRYPTO_KUZNYECHIK_H
+
+#include "Common/Tcdefs.h"
+
+typedef struct _kuznyechik_kds
+{
+ uint64 rke[10][2];
+ uint64 rkd[10][2];
+} kuznyechik_kds;
+
+#define KUZNYECHIK_KS (sizeof(kuznyechik_kds))
+
+void kuznyechik_encrypt_block(byte* out, const byte* in, kuznyechik_kds* kds);
+void kuznyechik_decrypt_block(byte* out, const byte* in, kuznyechik_kds* kds);
+void kuznyechik_set_key(const byte* key, kuznyechik_kds *kds);
+
+
+#endif
diff --git a/src/Crypto/misc.h b/src/Crypto/misc.h
index 37d40243..e7391764 100644
--- a/src/Crypto/misc.h
+++ b/src/Crypto/misc.h
@@ -2,11 +2,19 @@
#define CRYPTOPP_MISC_H
#include "config.h"
+#if !defined(_UEFI)
#include <string.h> // for memcpy and memmove
+#ifndef _WIN32
+#include <strings.h> // for strcasecmp
+#define _stricmp strcasecmp
+#endif
+#else
+#include "Tcdefs.h"
+#endif // !defined(_UEFI)
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(_UEFI)
#if _MSC_VER >= 1400
- #ifndef TC_WINDOWS_DRIVER
+ #if !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI)
// VC2005 workaround: disable declarations that conflict with winnt.h
#define _interlockedbittestandset CRYPTOPP_DISABLED_INTRINSIC_1
#define _interlockedbittestandreset CRYPTOPP_DISABLED_INTRINSIC_2
@@ -19,7 +27,7 @@
#undef _interlockedbittestandreset64
#endif
#define CRYPTOPP_FAST_ROTATE(x) 1
- #elif _MSC_VER >= 1300
+ #elif !defined(_UEFI) && _MSC_VER >= 1300
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32 | (x) == 64)
#else
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32)
@@ -33,7 +41,7 @@
#define CRYPTOPP_FAST_ROTATE(x) 0
#endif
-#if defined( _MSC_VER ) && ( _MSC_VER > 800 )
+#if defined( _MSC_VER ) && ( _MSC_VER > 800 ) && !defined(_UEFI)
#pragma intrinsic(memcpy,memset)
#endif
@@ -55,10 +63,28 @@
#endif
+#if _MSC_VER >= 1400 && !defined(__INTEL_COMPILER)
+// Intel C++ Compiler 10.0 calls a function instead of using the rotate instruction when using these instructions
+#pragma intrinsic(_rotr8,_rotl8,_rotr16,_rotl16)
+
+#define rotr8(x,n) _rotr8(x, n)
+#define rotl8(x,n) _rotl8(x, n)
+#define rotr16(x,n) _rotr16(x, n)
+#define rotl16(x,n) _rotl16(x, n)
+
+#else
+
+#define rotr8(x,n) (((x) >> n) | ((x) << (8 - n)))
+#define rotl8(x,n) (((x) << n) | ((x) >> (8 - n)))
+#define rotr16(x,n) (((x) >> n) | ((x) << (16 - n)))
+#define rotl16(x,n) (((x) << n) | ((x) >> (16 - n)))
+
+#endif
+
#if defined(__GNUC__) && defined(__linux__)
#define CRYPTOPP_BYTESWAP_AVAILABLE
#include <byteswap.h>
-#elif defined(_MSC_VER) && _MSC_VER >= 1300
+#elif defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(_UEFI)
#define CRYPTOPP_BYTESWAP_AVAILABLE
#define bswap_32(x) _byteswap_ulong(x)
#define bswap_64(x) _byteswap_uint64(x)
@@ -69,10 +95,12 @@
#define bswap_32 OSSwapInt32
#define bswap_64 OSSwapInt64
#else
-#ifdef CRYPTOPP_FAST_ROTATE(32)
+#if CRYPTOPP_FAST_ROTATE(32)
#define bswap_32(x) (rotr32((x), 8U) & 0xff00ff00) | (rotl32((x), 8U) & 0x00ff00ff)
#else
+#define CRYPTOPP_BYTESWAP_AVAILABLE
#define bswap_32(x) (rotl32((((x) & 0xFF00FF00) >> 8) | (((x) & 0x00FF00FF) << 8), 16U))
+#define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U)
#endif
#ifndef TC_NO_COMPILER_INT64
#define bswap_64(x) rotl64(((((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0xFFFF0000FFFF0000)) >> 16) | (((((x & LL(0xFF00FF00FF00FF00)) >> 8) | ((x & LL(0x00FF00FF00FF00FF)) << 8)) & LL(0x0000FFFF0000FFFF)) << 16)), 32U)
diff --git a/src/Driver/BuildDriver.cmd b/src/Driver/BuildDriver.cmd
index 42f715dc..197e41ca 100644
--- a/src/Driver/BuildDriver.cmd
+++ b/src/Driver/BuildDriver.cmd
@@ -103,6 +103,24 @@ pushd .
call %TC_WINDDK_ROOT%\bin\setenv %TC_WINDDK_ROOT% %TC_BUILD_TYPE% %TC_BUILD_ARCH% no_oacr || exit /B %errorlevel%
popd
+:: set path to VC++ 2010
+IF EXIST "%programfiles(x86)%" (GOTO 64-Bit) ELSE (GOTO 32-Bit)
+
+:32-Bit
+@set "VCPATH=%programfiles%\Microsoft Visual Studio 10.0\"
+GOTO CONTINUE
+
+:64-Bit
+@set "VCPATH=%programfiles(x86)%\Microsoft Visual Studio 10.0\"
+GOTO CONTINUE
+
+:CONTINUE
+
+if "%TC_ARG_ARCH%"=="-x64" (
+ @set "PATH=%VCPATH%Common7\IDE;%VCPATH%VC\bin\amd64;%PATH%"
+) else (
+ @set "PATH=%VCPATH%Common7\IDE;%VCPATH%VC\bin;%PATH%"
+)
:: Build
diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c
index 49563592..a3d76b3a 100644
--- a/src/Driver/DriveFilter.c
+++ b/src/Driver/DriveFilter.c
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -27,12 +27,13 @@
#include "Wipe.h"
#include "DriveFilter.h"
#include "Boot/Windows/BootCommon.h"
+#include "cpu.h"
static BOOL DeviceFilterActive = FALSE;
BOOL BootArgsValid = FALSE;
BootArguments BootArgs;
-static uint16 BootLoaderSegment;
+static uint64 BootLoaderArgsPtr;
static BOOL BootDriveSignatureValid = FALSE;
static KMUTEX MountMutex;
@@ -68,21 +69,22 @@ static int64 DecoySystemWipedAreaEnd;
PKTHREAD DecoySystemWipeThread = NULL;
static NTSTATUS DecoySystemWipeResult;
+uint64 BootArgsRegions[] = { EFI_BOOTARGS_REGIONS };
NTSTATUS LoadBootArguments ()
{
NTSTATUS status = STATUS_UNSUCCESSFUL;
PHYSICAL_ADDRESS bootArgsAddr;
byte *mappedBootArgs;
- uint16 bootLoaderSegment;
+ uint16 bootLoaderArgsIndex;
KeInitializeMutex (&MountMutex, 0);
- for (bootLoaderSegment = TC_BOOT_LOADER_SEGMENT;
- bootLoaderSegment >= TC_BOOT_LOADER_SEGMENT - 64 * 1024 / 16 && status != STATUS_SUCCESS;
- bootLoaderSegment -= 32 * 1024 / 16)
+ for (bootLoaderArgsIndex = 0;
+ bootLoaderArgsIndex < sizeof(BootArgsRegions)/ sizeof(BootArgsRegions[1]) && status != STATUS_SUCCESS;
+ ++bootLoaderArgsIndex)
{
- bootArgsAddr.QuadPart = (bootLoaderSegment << 4) + TC_BOOT_LOADER_ARGS_OFFSET;
+ bootArgsAddr.QuadPart = BootArgsRegions[bootLoaderArgsIndex] + TC_BOOT_LOADER_ARGS_OFFSET;
Dump ("Checking BootArguments at 0x%x\n", bootArgsAddr.LowPart);
mappedBootArgs = MmMapIoSpace (bootArgsAddr, sizeof (BootArguments), MmCached);
@@ -106,7 +108,7 @@ NTSTATUS LoadBootArguments ()
// Sanity check: for valid boot argument, the password is less than 64 bytes long
if (bootArguments->BootPassword.Length <= MAX_PASSWORD)
{
- BootLoaderSegment = bootLoaderSegment;
+ BootLoaderArgsPtr = BootArgsRegions[bootLoaderArgsIndex];
BootArgs = *bootArguments;
BootArgsValid = TRUE;
@@ -167,7 +169,7 @@ NTSTATUS DriveFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
Extension = (DriveFilterExtension *) filterDeviceObject->DeviceExtension;
memset (Extension, 0, sizeof (DriveFilterExtension));
- status = IoAttachDeviceToDeviceStackSafe (filterDeviceObject, pdo, &(Extension->LowerDeviceObject));
+ status = IoAttachDeviceToDeviceStackSafe (filterDeviceObject, pdo, &(Extension->LowerDeviceObject));
if (!NT_SUCCESS (status))
{
goto err;
@@ -182,7 +184,7 @@ NTSTATUS DriveFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
Extension->IsDriveFilterDevice = Extension->Queue.IsFilterDevice = TRUE;
Extension->DeviceObject = Extension->Queue.DeviceObject = filterDeviceObject;
Extension->Pdo = pdo;
-
+
Extension->Queue.LowerDeviceObject = Extension->LowerDeviceObject;
IoInitializeRemoveLock (&Extension->Queue.RemoveLock, 'LRCV', 0, 0);
@@ -215,7 +217,7 @@ static void DismountDrive (DriveFilterExtension *Extension, BOOL stopIoQueue)
{
Dump ("Dismounting drive\n");
ASSERT (Extension->DriveMounted);
-
+
if (stopIoQueue && EncryptedIoQueueIsRunning (&Extension->Queue))
EncryptedIoQueueStop (&Extension->Queue);
@@ -249,7 +251,7 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
// TC_BOOT_SECTOR_USER_CONFIG_OFFSET = 438
//
// we have: TC_BOOT_SECTOR_USER_MESSAGE_OFFSET = TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE
-
+
WHIRLPOOL_init (&whirlpool);
sha512_begin (&sha2);
// read the first 512 bytes
@@ -258,9 +260,15 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
status = TCReadDevice (LowerDeviceObject, ioBuffer, offset, TC_SECTOR_SIZE_BIOS);
if (NT_SUCCESS (status))
{
- WHIRLPOOL_add (ioBuffer, TC_BOOT_SECTOR_PIM_VALUE_OFFSET * 8, &whirlpool);
- WHIRLPOOL_add (ioBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, (TC_BOOT_SECTOR_USER_CONFIG_OFFSET - (TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)) * 8, &whirlpool);
- WHIRLPOOL_add (ioBuffer + TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1, (TC_MAX_MBR_BOOT_CODE_SIZE - (TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1)) * 8, &whirlpool);
+#if !defined (_WIN64)
+ KFLOATING_SAVE floatingPointState;
+ NTSTATUS saveStatus = STATUS_SUCCESS;
+ if (HasISSE())
+ saveStatus = KeSaveFloatingPointState (&floatingPointState);
+#endif
+ WHIRLPOOL_add (ioBuffer, TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &whirlpool);
+ WHIRLPOOL_add (ioBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, (TC_BOOT_SECTOR_USER_CONFIG_OFFSET - (TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)), &whirlpool);
+ WHIRLPOOL_add (ioBuffer + TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1, (TC_MAX_MBR_BOOT_CODE_SIZE - (TC_BOOT_SECTOR_USER_CONFIG_OFFSET + 1)), &whirlpool);
sha512_hash (ioBuffer, TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &sha2);
sha512_hash (ioBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, (TC_BOOT_SECTOR_USER_CONFIG_OFFSET - (TC_BOOT_SECTOR_USER_MESSAGE_OFFSET + TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)), &sha2);
@@ -278,7 +286,7 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
{
remainingBytes -= bytesToRead;
offset.QuadPart += bytesToRead;
- WHIRLPOOL_add (ioBuffer, bytesToRead * 8, &whirlpool);
+ WHIRLPOOL_add (ioBuffer, bytesToRead, &whirlpool);
sha512_hash (ioBuffer, bytesToRead, &sha2);
}
else
@@ -293,6 +301,11 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
WHIRLPOOL_finalize (&whirlpool, BootLoaderFingerprint);
sha512_end (&BootLoaderFingerprint [WHIRLPOOL_DIGESTSIZE], &sha2);
}
+
+#if !defined (_WIN64)
+ if (NT_SUCCESS (saveStatus) && HasISSE())
+ KeRestoreFloatingPointState (&floatingPointState);
+#endif
}
else
{
@@ -310,6 +323,8 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
char *header;
int pkcs5_prf = 0, pim = 0;
byte *mappedCryptoInfo = NULL;
+ PARTITION_INFORMATION_EX pi;
+ BOOL bIsGPT = FALSE;
Dump ("MountDrive pdo=%p\n", Extension->Pdo);
ASSERT (KeGetCurrentIrql() == PASSIVE_LEVEL);
@@ -360,11 +375,16 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
goto ret;
}
- if (BootArgs.CryptoInfoLength > 0)
+ if (NT_SUCCESS(SendDeviceIoControlRequest (Extension->LowerDeviceObject, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, &pi, sizeof (pi))))
{
- PHYSICAL_ADDRESS cryptoInfoAddress;
+ bIsGPT = (pi.PartitionStyle == PARTITION_STYLE_GPT)? TRUE : FALSE;
+ }
- cryptoInfoAddress.QuadPart = (BootLoaderSegment << 4) + BootArgs.CryptoInfoOffset;
+ if (BootArgs.CryptoInfoLength > 0)
+ {
+ PHYSICAL_ADDRESS cryptoInfoAddress;
+
+ cryptoInfoAddress.QuadPart = BootLoaderArgsPtr + BootArgs.CryptoInfoOffset;
#ifdef DEBUG
Dump ("Wiping memory %x %d\n", cryptoInfoAddress.LowPart, BootArgs.CryptoInfoLength);
#endif
@@ -374,7 +394,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
/* Get the parameters used for booting to speed up driver startup and avoid testing irrelevant PRFs */
BOOT_CRYPTO_HEADER* pBootCryptoInfo = (BOOT_CRYPTO_HEADER*) mappedCryptoInfo;
Hash* pHash = HashGet(pBootCryptoInfo->pkcs5);
- if (pHash && pHash->SystemEncryption)
+ if (pHash && (bIsGPT || pHash->SystemEncryption))
pkcs5_prf = pBootCryptoInfo->pkcs5;
}
}
@@ -389,20 +409,20 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
// calculate Fingerprint
ComputeBootLoaderFingerprint (Extension->LowerDeviceObject, header);
-
+
if (Extension->Queue.CryptoInfo->hiddenVolume)
{
int64 hiddenPartitionOffset = BootArgs.HiddenSystemPartitionStart;
Dump ("Hidden volume start offset = %I64d\n", Extension->Queue.CryptoInfo->EncryptedAreaStart.Value + hiddenPartitionOffset);
-
+
Extension->HiddenSystem = TRUE;
Extension->Queue.RemapEncryptedArea = TRUE;
Extension->Queue.RemappedAreaOffset = hiddenPartitionOffset + Extension->Queue.CryptoInfo->EncryptedAreaStart.Value - BootArgs.DecoySystemPartitionStart;
Extension->Queue.RemappedAreaDataUnitOffset = Extension->Queue.CryptoInfo->EncryptedAreaStart.Value / ENCRYPTION_DATA_UNIT_SIZE - BootArgs.DecoySystemPartitionStart / ENCRYPTION_DATA_UNIT_SIZE;
-
+
Extension->Queue.CryptoInfo->EncryptedAreaStart.Value = BootArgs.DecoySystemPartitionStart;
-
+
if (Extension->Queue.CryptoInfo->VolumeSize.Value > hiddenPartitionOffset - BootArgs.DecoySystemPartitionStart)
TC_THROW_FATAL_EXCEPTION;
@@ -461,7 +481,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
}
status = SendDeviceIoControlRequest (Extension->LowerDeviceObject, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &BootDriveLength, sizeof (BootDriveLength));
-
+
if (!NT_SUCCESS (status))
{
Dump ("Failed to get drive length - error %x\n", status);
@@ -470,7 +490,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
}
else
Extension->Queue.MaxReadAheadOffset = BootDriveLength;
-
+
status = EncryptedIoQueueStart (&Extension->Queue);
if (!NT_SUCCESS (status))
TC_BUG_CHECK (status);
@@ -526,7 +546,7 @@ static NTSTATUS SaveDriveVolumeHeader (DriveFilterExtension *Extension)
Dump ("Saving: ConfiguredEncryptedAreaStart=%I64d (%I64d) ConfiguredEncryptedAreaEnd=%I64d (%I64d)\n", Extension->ConfiguredEncryptedAreaStart / 1024 / 1024, Extension->ConfiguredEncryptedAreaStart, Extension->ConfiguredEncryptedAreaEnd / 1024 / 1024, Extension->ConfiguredEncryptedAreaEnd);
Dump ("Saving: EncryptedAreaStart=%I64d (%I64d) EncryptedAreaEnd=%I64d (%I64d)\n", Extension->Queue.EncryptedAreaStart / 1024 / 1024, Extension->Queue.EncryptedAreaStart, Extension->Queue.EncryptedAreaEnd / 1024 / 1024, Extension->Queue.EncryptedAreaEnd);
-
+
if (Extension->Queue.EncryptedAreaStart == -1 || Extension->Queue.EncryptedAreaEnd == -1
|| Extension->Queue.EncryptedAreaEnd <= Extension->Queue.EncryptedAreaStart)
{
@@ -678,7 +698,7 @@ static NTSTATUS OnStartDeviceCompleted (PDEVICE_OBJECT filterDeviceObject, PIRP
}
KeInitializeEvent (&Extension->MountWorkItemCompletedEvent, SynchronizationEvent, FALSE);
- IoQueueWorkItem (workItem, MountDriveWorkItemRoutine, DelayedWorkQueue, Extension);
+ IoQueueWorkItem (workItem, MountDriveWorkItemRoutine, DelayedWorkQueue, Extension);
KeWaitForSingleObject (&Extension->MountWorkItemCompletedEvent, Executive, KernelMode, FALSE, NULL);
IoFreeWorkItem (workItem);
@@ -817,7 +837,7 @@ NTSTATUS DriveFilterDispatchIrp (PDEVICE_OBJECT DeviceObject, PIRP Irp)
if (Extension->BootDrive)
{
status = EncryptedIoQueueAddIrp (&Extension->Queue, Irp);
-
+
if (status != STATUS_PENDING)
TCCompleteDiskIrp (Irp, status, 0);
@@ -895,7 +915,7 @@ void ReopenBootVolumeHeader (PIRP irp, PIO_STACK_LOCATION irpSp)
{
Dump ("Header reopened\n");
ComputeBootLoaderFingerprint (BootDriveFilterExtension->LowerDeviceObject, header);
-
+
BootDriveFilterExtension->Queue.CryptoInfo->header_creation_time = BootDriveFilterExtension->HeaderCryptoInfo->header_creation_time;
BootDriveFilterExtension->Queue.CryptoInfo->pkcs5 = BootDriveFilterExtension->HeaderCryptoInfo->pkcs5;
BootDriveFilterExtension->Queue.CryptoInfo->noIterations = BootDriveFilterExtension->HeaderCryptoInfo->noIterations;
@@ -1025,7 +1045,7 @@ static NTSTATUS HiberDriverWriteFunctionFilter (int filterNumber, PLARGE_INTEGER
if (writeB)
return (*OriginalHiberDriverWriteFunctionsB[filterNumber]) (writeOffset, encryptedDataMdl);
-
+
return (*OriginalHiberDriverWriteFunctionsA[filterNumber]) (arg0WriteA, writeOffset, encryptedDataMdl, arg3WriteA);
}
@@ -1269,11 +1289,11 @@ static VOID SetupThreadProc (PVOID threadArg)
byte *wipeBuffer = NULL;
byte wipeRandChars[TC_WIPE_RAND_CHAR_COUNT];
byte wipeRandCharsUpdate[TC_WIPE_RAND_CHAR_COUNT];
-
+
KIRQL irql;
NTSTATUS status;
- // generate real random values for wipeRandChars and
+ // generate real random values for wipeRandChars and
// wipeRandCharsUpdate instead of relying on uninitialized stack memory
LARGE_INTEGER iSeed;
KeQuerySystemTime( &iSeed );
@@ -1300,7 +1320,7 @@ static VOID SetupThreadProc (PVOID threadArg)
burn (digest, SHA512_DIGESTSIZE);
burn (&tctx, sizeof (tctx));
}
-
+
burn (&iSeed, sizeof(iSeed));
SetupResult = STATUS_UNSUCCESSFUL;
@@ -1376,7 +1396,7 @@ static VOID SetupThreadProc (PVOID threadArg)
}
EncryptedIoQueueResumeFromHold (&Extension->Queue);
-
+
Dump ("EncryptedAreaStart=%I64d\n", Extension->Queue.EncryptedAreaStart);
Dump ("EncryptedAreaEnd=%I64d\n", Extension->Queue.EncryptedAreaEnd);
Dump ("ConfiguredEncryptedAreaStart=%I64d\n", Extension->ConfiguredEncryptedAreaStart);
@@ -1485,7 +1505,7 @@ static VOID SetupThreadProc (PVOID threadArg)
}
EncryptDataUnits (wipeBuffer, &dataUnit, setupBlockSize / ENCRYPTION_DATA_UNIT_SIZE, Extension->Queue.CryptoInfo);
- memcpy (wipeRandCharsUpdate, wipeBuffer, sizeof (wipeRandCharsUpdate));
+ memcpy (wipeRandCharsUpdate, wipeBuffer, sizeof (wipeRandCharsUpdate));
}
status = TCWriteDevice (BootDriveFilterExtension->LowerDeviceObject, wipeBuffer, offset, setupBlockSize);
@@ -1500,7 +1520,7 @@ static VOID SetupThreadProc (PVOID threadArg)
}
}
- memcpy (wipeRandChars, wipeRandCharsUpdate, sizeof (wipeRandCharsUpdate));
+ memcpy (wipeRandChars, wipeRandCharsUpdate, sizeof (wipeRandCharsUpdate));
}
}
else
@@ -1646,7 +1666,7 @@ NTSTATUS StartBootEncryptionSetup (PDEVICE_OBJECT DeviceObject, PIRP irp, PIO_ST
SetupInProgress = TRUE;
status = TCStartThread (SetupThreadProc, DeviceObject, &EncryptionSetupThread);
-
+
if (!NT_SUCCESS (status))
SetupInProgress = FALSE;
@@ -1742,7 +1762,7 @@ void GetBootEncryptionStatus (PIRP irp, PIO_STACK_LOCATION irpSp)
bootEncStatus->HiddenSysLeakProtectionCount = HiddenSysLeakProtectionCount;
bootEncStatus->HiddenSystem = Extension->HiddenSystem;
-
+
if (Extension->HiddenSystem)
bootEncStatus->HiddenSystemPartitionStart = BootArgs.HiddenSystemPartitionStart;
}
@@ -1778,7 +1798,7 @@ void GetBootLoaderFingerprint (PIRP irp, PIO_STACK_LOCATION irpSp)
irp->IoStatus.Information = 0;
if (BootArgsValid && BootDriveFound && BootDriveFilterExtension && BootDriveFilterExtension->DriveMounted && BootDriveFilterExtension->HeaderCryptoInfo)
{
- BootLoaderFingerprintRequest *bootLoaderFingerprint = (BootLoaderFingerprintRequest *) irp->AssociatedIrp.SystemBuffer;
+ BootLoaderFingerprintRequest *bootLoaderFingerprint = (BootLoaderFingerprintRequest *) irp->AssociatedIrp.SystemBuffer;
/* compute the fingerprint again and check if it is the same as the one retrieved during boot */
char *header = TCalloc (TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
@@ -1808,7 +1828,7 @@ void GetBootLoaderFingerprint (PIRP irp, PIO_STACK_LOCATION irpSp)
}
else
{
- irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
+ irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
}
}
}
@@ -1919,7 +1939,7 @@ static VOID DecoySystemWipeThreadProc (PVOID threadArg)
DecoySystemWipeResult = STATUS_INSUFFICIENT_RESOURCES;
goto ret;
}
-
+
wipeRandBuffer = TCalloc (TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE);
if (!wipeRandBuffer)
{
@@ -1944,7 +1964,7 @@ static VOID DecoySystemWipeThreadProc (PVOID threadArg)
}
memcpy (wipeCryptoInfo->k2, WipeDecoyRequest.WipeKey + EAGetKeySize (ea), EAGetKeySize (ea));
-
+
if (!EAInitMode (wipeCryptoInfo))
{
DecoySystemWipeResult = STATUS_INVALID_PARAMETER;
@@ -1957,7 +1977,7 @@ static VOID DecoySystemWipeThreadProc (PVOID threadArg)
burn (WipeDecoyRequest.WipeKey, sizeof (WipeDecoyRequest.WipeKey));
offset.QuadPart = Extension->ConfiguredEncryptedAreaStart;
-
+
Dump ("Wiping decoy system: start offset = %I64d\n", offset.QuadPart);
while (!DecoySystemWipeThreadAbortRequested)
@@ -2061,7 +2081,7 @@ NTSTATUS StartDecoySystemWipe (PDEVICE_OBJECT DeviceObject, PIRP irp, PIO_STACK_
DecoySystemWipeInProgress = TRUE;
status = TCStartThread (DecoySystemWipeThreadProc, DeviceObject, &DecoySystemWipeThread);
-
+
if (!NT_SUCCESS (status))
DecoySystemWipeInProgress = FALSE;
@@ -2100,7 +2120,7 @@ void GetDecoySystemWipeStatus (PIRP irp, PIO_STACK_LOCATION irpSp)
}
else
wipeStatus->WipedAreaEnd = DecoySystemWipedAreaEnd;
-
+
irp->IoStatus.Information = sizeof (DecoySystemWipeStatus);
irp->IoStatus.Status = STATUS_SUCCESS;
}
diff --git a/src/Driver/Driver.vcxproj b/src/Driver/Driver.vcxproj
new file mode 100644
index 00000000..bc95ffe1
--- /dev/null
+++ b/src/Driver/Driver.vcxproj
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug x64|Win32">
+ <Configuration>Debug x64</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug x86|Win32">
+ <Configuration>Debug x86</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release x64|Win32">
+ <Configuration>Release x64</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release x86|Win32">
+ <Configuration>Release x86</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{EF5EF444-18D0-40D7-8DFA-775EC4448602}</ProjectGuid>
+ <RootNamespace>Driver</RootNamespace>
+ <Keyword>MakeFileProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo ------ Building veracrypt.sys: Debug x86 ------
+cmd.exe /c BuildDriver.cmd -build -debug -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"
+if errorlevel 1 exit %errorlevel%
+echo.
+echo ------ Building veracrypt.sys: Debug x64 ------
+BuildDriver.cmd -build -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo ------ Rebuilding veracrypt.sys: Debug x86 ------
+cmd.exe /c BuildDriver.cmd -rebuild -debug -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"
+if errorlevel 1 exit %errorlevel%
+echo.
+echo ------ Rebuilding veracrypt.sys: Debug x64 ------
+BuildDriver.cmd -rebuild -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo ------ Cleaning veracrypt.sys: Debug x86 ------
+cmd.exe /c BuildDriver.cmd -clean -debug -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"
+if errorlevel 1 exit %errorlevel%
+echo.
+echo ------ Cleaning veracrypt.sys: Debug x64 ------
+BuildDriver.cmd -clean -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">DEBUG;_DEBUG;TC_WINDOWS_DRIVER;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir);$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(WINDDK_ROOT)\inc\ddk;$(WINDDK_ROOT)\inc\api;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo ------ Building veracrypt.sys: Release x86 ------
+cmd.exe /c BuildDriver.cmd -build -release -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"
+if errorlevel 1 exit %errorlevel%
+echo.
+echo ------ Building veracrypt.sys: Release x64 ------
+BuildDriver.cmd -build -release -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo ------ Rebuilding veracrypt.sys: Release x86 ------
+cmd.exe /c BuildDriver.cmd -rebuild -release -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"
+if errorlevel 1 exit %errorlevel%
+echo.
+echo ------ Rebuilding veracrypt.sys: Release x64 ------
+BuildDriver.cmd -rebuild -release -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo ------ Cleaning veracrypt.sys: Release x86 ------
+cmd.exe /c BuildDriver.cmd -clean -release -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"
+if errorlevel 1 exit %errorlevel%
+echo.
+echo ------ Cleaning veracrypt.sys: Release x64 ------
+BuildDriver.cmd -clean -release -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">TC_WINDOWS_DRIVER;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir);$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(WINDDK_ROOT)\inc\ddk;$(WINDDK_ROOT)\inc\api;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">BuildDriver.cmd -build -release -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">BuildDriver.cmd -rebuild -release -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">BuildDriver.cmd -clean -release -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">TC_WINDOWS_DRIVER;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">$(ProjectDir);$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(WINDDK_ROOT)\inc\ddk;$(WINDDK_ROOT)\inc\api;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release x86|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">if exist $(SolutionDir)\Mount\Debug\VeraCrypt.exe ( copy $(SolutionDir)\Mount\Debug\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\i386\VeraCrypt.exe &gt;NUL:
+) else ( copy $(SolutionDir)\Mount\Release\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\i386\VeraCrypt.exe &gt;NUL: )
+
+BuildDriver.cmd -build -debug -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">if exist $(SolutionDir)\Mount\Debug\VeraCrypt.exe ( copy $(SolutionDir)\Mount\Debug\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\i386\VeraCrypt.exe &gt;NUL:
+) else ( copy $(SolutionDir)\Mount\Release\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\i386\VeraCrypt.exe &gt;NUL: )
+
+BuildDriver.cmd -rebuild -debug -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">BuildDriver.cmd -clean -debug -x86 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">$(ProjectDir)\obj_driver_debug\i386\VeraCrypt.exe</NMakeOutput>
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">DEBUG;_DEBUG;TC_WINDOWS_DRIVER;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">$(ProjectDir);$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(WINDDK_ROOT)\inc\ddk;$(WINDDK_ROOT)\inc\api;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug x86|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">BuildDriver.cmd -build -release -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">BuildDriver.cmd -rebuild -release -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">BuildDriver.cmd -clean -release -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">TC_WINDOWS_DRIVER;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">$(ProjectDir);$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(WINDDK_ROOT)\inc\ddk;$(WINDDK_ROOT)\inc\api;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release x64|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">if exist $(SolutionDir)\Mount\Debug\VeraCrypt.exe ( copy $(SolutionDir)\Mount\Debug\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\amd64\VeraCrypt.exe &gt;NUL:
+) else ( copy $(SolutionDir)\Mount\Release\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\amd64\VeraCrypt.exe &gt;NUL: )
+
+BuildDriver.cmd -build -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">if exist $(SolutionDir)\Mount\Debug\VeraCrypt.exe ( copy $(SolutionDir)\Mount\Debug\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\amd64\VeraCrypt.exe &gt;NUL:
+) else ( copy $(SolutionDir)\Mount\Release\VeraCrypt.exe $(ProjectDir)\obj_driver_debug\amd64\VeraCrypt.exe &gt;NUL: )
+
+BuildDriver.cmd -rebuild -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">BuildDriver.cmd -clean -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Crypto" "$(ProjectDir)"</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">$(ProjectDir)\obj_driver_debug\amd64\VeraCrypt.exe</NMakeOutput>
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">DEBUG;_DEBUG;TC_WINDOWS_DRIVER;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">$(ProjectDir);$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(WINDDK_ROOT)\inc\ddk;$(WINDDK_ROOT)\inc\api;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug x64|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Crypto\Camellia.c" />
+ <ClCompile Include="DriveFilter.c" />
+ <ClCompile Include="DumpFilter.c" />
+ <ClCompile Include="EncryptedIoQueue.c" />
+ <ClCompile Include="Ntdriver.c" />
+ <ClCompile Include="Ntvol.c" />
+ <ClCompile Include="VolumeFilter.c" />
+ <ClCompile Include="..\Common\Cache.c" />
+ <ClCompile Include="..\Common\Crc.c" />
+ <ClCompile Include="..\Common\Crypto.c" />
+ <ClCompile Include="..\Common\EncryptionThreadPool.c" />
+ <ClCompile Include="..\Common\Endian.c" />
+ <ClCompile Include="..\Common\GfMul.c" />
+ <ClCompile Include="..\Common\Pkcs5.c" />
+ <ClCompile Include="..\Common\Tests.c" />
+ <ClCompile Include="..\Common\Volumes.c" />
+ <ClCompile Include="..\Common\Wipe.c" />
+ <ClCompile Include="..\Common\Xts.c" />
+ <ClCompile Include="..\Crypto\Aeskey.c" />
+ <ClCompile Include="..\Crypto\Aestab.c" />
+ <ClCompile Include="..\Crypto\Rmd160.c" />
+ <ClCompile Include="..\Crypto\Serpent.c" />
+ <ClCompile Include="..\Crypto\Sha2.c" />
+ <ClCompile Include="..\Crypto\Twofish.c" />
+ <ClCompile Include="..\Crypto\Whirlpool.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\Crypto\Aes_hw_cpu.asm" />
+ <None Include="..\Crypto\Aes_x64.asm" />
+ <None Include="..\Crypto\Aes_x86.asm" />
+ <None Include="BuildDriver.cmd" />
+ <None Include="Makefile" />
+ <None Include="Sources" />
+ <None Include="..\Common\Makefile" />
+ <None Include="..\Common\Sources" />
+ <None Include="..\Crypto\Makefile" />
+ <None Include="..\Crypto\Makefile.inc" />
+ <None Include="..\Crypto\Sources" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Apidrvr.h" />
+ <ClInclude Include="..\Common\Cache.h" />
+ <ClInclude Include="..\Common\Common.h" />
+ <ClInclude Include="DriveFilter.h" />
+ <ClInclude Include="DumpFilter.h" />
+ <ClInclude Include="EncryptedIoQueue.h" />
+ <ClInclude Include="..\Common\EncryptionThreadPool.h" />
+ <ClInclude Include="..\Common\GfMul.h" />
+ <ClInclude Include="Ntdriver.h" />
+ <ClInclude Include="Ntvol.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="..\Common\Tcdefs.h" />
+ <ClInclude Include="VolumeFilter.h" />
+ <ClInclude Include="..\Common\Volumes.h" />
+ <ClInclude Include="..\Common\Wipe.h" />
+ <ClInclude Include="..\Common\Xts.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Driver.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Boot\Windows\Boot.vcxproj">
+ <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/Driver/Driver.vcxproj.filters b/src/Driver/Driver.vcxproj.filters
new file mode 100644
index 00000000..73f45952
--- /dev/null
+++ b/src/Driver/Driver.vcxproj.filters
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Source Files\Common">
+ <UniqueIdentifier>{d1f5a533-0da8-4ea8-a749-2fd9725c3666}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\Crypto">
+ <UniqueIdentifier>{93a4143b-9d2d-4bab-9532-3f00fe0ae55a}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
+ </Filter>
+ <Filter Include="Build Files">
+ <UniqueIdentifier>{0e1fab74-bfc9-4968-87d7-a46cde3b4fb6}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Build Files\Common">
+ <UniqueIdentifier>{0385fc55-db3b-4dde-aa34-8396d25af075}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Build Files\Crypto">
+ <UniqueIdentifier>{6d92b0d0-a99e-46f0-a1d0-9297ae3795f5}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="DriveFilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DumpFilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="EncryptedIoQueue.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Ntdriver.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Ntvol.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="VolumeFilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Cache.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crc.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crypto.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Endian.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\GfMul.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Pkcs5.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Tests.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Volumes.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Wipe.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xts.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Aeskey.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Aestab.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Rmd160.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Serpent.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Sha2.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Twofish.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Whirlpool.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Camellia.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\Crypto\Aes_hw_cpu.asm">
+ <Filter>Source Files\Crypto</Filter>
+ </None>
+ <None Include="..\Crypto\Aes_x64.asm">
+ <Filter>Source Files\Crypto</Filter>
+ </None>
+ <None Include="..\Crypto\Aes_x86.asm">
+ <Filter>Source Files\Crypto</Filter>
+ </None>
+ <None Include="BuildDriver.cmd">
+ <Filter>Build Files</Filter>
+ </None>
+ <None Include="Makefile">
+ <Filter>Build Files</Filter>
+ </None>
+ <None Include="Sources">
+ <Filter>Build Files</Filter>
+ </None>
+ <None Include="..\Common\Makefile">
+ <Filter>Build Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Sources">
+ <Filter>Build Files\Common</Filter>
+ </None>
+ <None Include="..\Crypto\Makefile">
+ <Filter>Build Files\Crypto</Filter>
+ </None>
+ <None Include="..\Crypto\Makefile.inc">
+ <Filter>Build Files\Crypto</Filter>
+ </None>
+ <None Include="..\Crypto\Sources">
+ <Filter>Build Files\Crypto</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Apidrvr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Cache.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="DriveFilter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="DumpFilter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="EncryptedIoQueue.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\EncryptionThreadPool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\GfMul.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Ntdriver.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Ntvol.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tcdefs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="VolumeFilter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Volumes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Wipe.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Xts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Driver.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/Driver/Driver.vcxproj.user b/src/Driver/Driver.vcxproj.user
new file mode 100644
index 00000000..ace9a86a
--- /dev/null
+++ b/src/Driver/Driver.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project> \ No newline at end of file
diff --git a/src/Driver/DumpFilter.c b/src/Driver/DumpFilter.c
index ce3365d5..ff570b1e 100644
--- a/src/Driver/DumpFilter.c
+++ b/src/Driver/DumpFilter.c
@@ -94,7 +94,17 @@ NTSTATUS DumpFilterEntry (PFILTER_EXTENSION filterExtension, PFILTER_INITIALIZAT
// Check dump volume is located within the scope of system encryption
status = SendDeviceIoControlRequest (filterExtension->DeviceObject, IOCTL_DISK_GET_PARTITION_INFO, NULL, 0, &partitionInfo, sizeof (partitionInfo));
if (!NT_SUCCESS (status))
- goto err;
+ {
+ PARTITION_INFORMATION_EX partitionInfoEx;
+ status = SendDeviceIoControlRequest (filterExtension->DeviceObject, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, &partitionInfoEx, sizeof (partitionInfoEx));
+ if (!NT_SUCCESS (status))
+ {
+ goto err;
+ }
+
+ // we only need starting offset
+ partitionInfo.StartingOffset = partitionInfoEx.StartingOffset;
+ }
DumpPartitionOffset = partitionInfo.StartingOffset;
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 9b683f9b..384fca99 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -77,6 +77,8 @@ NTSTATUS DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
PsGetVersion (&OsMajorVersion, &OsMinorVersion, NULL, NULL);
+ Dump ("OsMajorVersion=%d OsMinorVersion=%d\n", OsMajorVersion, OsMinorVersion);
+
// Load dump filter if the main driver is already loaded
if (NT_SUCCESS (TCDeviceIoControl (NT_ROOT_PREFIX, TC_IOCTL_GET_DRIVER_VERSION, NULL, 0, &version, sizeof (version))))
return DumpFilterEntry ((PFILTER_EXTENSION) DriverObject, (PFILTER_INITIALIZATION_DATA) RegistryPath);
@@ -118,7 +120,7 @@ NTSTATUS DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
NTSTATUS DriverAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
{
-#ifdef DEBUG
+#if defined(DEBUG) || defined (DEBUG_TRACE)
char nameInfoBuffer[128];
POBJECT_NAME_INFORMATION nameInfo = (POBJECT_NAME_INFORMATION) nameInfoBuffer;
ULONG nameInfoSize;
@@ -425,7 +427,7 @@ NTSTATUS TCCreateDeviceObject (PDRIVER_OBJECT DriverObject,
PEXTENSION Extension;
NTSTATUS ntStatus;
ULONG devChars = 0;
-#if defined (DEBUG)
+#if defined (DEBUG) || defined (DEBUG_TRACE)
WCHAR dosname[32];
#endif
@@ -434,7 +436,7 @@ NTSTATUS TCCreateDeviceObject (PDRIVER_OBJECT DriverObject,
TCGetNTNameFromNumber (ntname, sizeof(ntname),mount->nDosDriveNo);
RtlInitUnicodeString (&ntUnicodeString, ntname);
-#if defined (DEBUG)
+#if defined (DEBUG) || defined (DEBUG_TRACE)
TCGetDosNameFromNumber (dosname, sizeof(dosname),mount->nDosDriveNo, DeviceNamespaceDefault);
#endif
@@ -442,7 +444,9 @@ NTSTATUS TCCreateDeviceObject (PDRIVER_OBJECT DriverObject,
devChars |= mount->bMountReadOnly ? FILE_READ_ONLY_DEVICE : 0;
devChars |= mount->bMountRemovable ? FILE_REMOVABLE_MEDIA : 0;
+#if defined (DEBUG) || defined (DEBUG_TRACE)
Dump ("Creating device nt=%ls dos=%ls\n", ntname, dosname);
+#endif
ntStatus = IoCreateDevice (
DriverObject, /* Our Driver Object */
@@ -503,6 +507,11 @@ void RootDeviceControlMutexRelease ()
KeReleaseMutex (&RootDeviceControlMutex, FALSE);
}
+/*
+IOCTL_STORAGE_GET_DEVICE_NUMBER 0x002D1080
+IOCTL_STORAGE_GET_HOTPLUG_INFO 0x002D0C14
+IOCTL_STORAGE_QUERY_PROPERTY 0x002D1400
+*/
NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Extension, PIRP Irp)
{
@@ -512,6 +521,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
{
case IOCTL_MOUNTDEV_QUERY_DEVICE_NAME:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_MOUNTDEV_QUERY_DEVICE_NAME)\n");
if (!ValidateIOBufferSize (Irp, sizeof (MOUNTDEV_NAME), ValidateOutput))
{
Irp->IoStatus.Information = sizeof (MOUNTDEV_NAME);
@@ -548,6 +558,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_MOUNTDEV_QUERY_UNIQUE_ID:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_MOUNTDEV_QUERY_UNIQUE_ID)\n");
if (!ValidateIOBufferSize (Irp, sizeof (MOUNTDEV_UNIQUE_ID), ValidateOutput))
{
Irp->IoStatus.Information = sizeof (MOUNTDEV_UNIQUE_ID);
@@ -583,6 +594,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME)\n");
{
ULONG outLength;
UNICODE_STRING ntUnicodeString;
@@ -622,6 +634,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
case IOCTL_DISK_GET_MEDIA_TYPES:
case IOCTL_DISK_GET_DRIVE_GEOMETRY:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_DISK_GET_DRIVE_GEOMETRY)\n");
/* Return the drive geometry for the disk. Note that we
return values which were made up to suit the disk size. */
if (ValidateIOBufferSize (Irp, sizeof (DISK_GEOMETRY), ValidateOutput))
@@ -640,6 +653,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_STORAGE_QUERY_PROPERTY:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_STORAGE_QUERY_PROPERTY)\n");
if (EnableExtendedIoctlSupport)
{
if (ValidateIOBufferSize (Irp, sizeof (STORAGE_PROPERTY_QUERY), ValidateInput))
@@ -706,6 +720,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_DISK_GET_PARTITION_INFO:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_DISK_GET_PARTITION_INFO)\n");
if (ValidateIOBufferSize (Irp, sizeof (PARTITION_INFORMATION), ValidateOutput))
{
PPARTITION_INFORMATION outputBuffer = (PPARTITION_INFORMATION)
@@ -724,6 +739,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_DISK_GET_PARTITION_INFO_EX:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_DISK_GET_PARTITION_INFO_EX)\n");
if (ValidateIOBufferSize (Irp, sizeof (PARTITION_INFORMATION_EX), ValidateOutput))
{
PPARTITION_INFORMATION_EX outputBuffer = (PPARTITION_INFORMATION_EX) Irp->AssociatedIrp.SystemBuffer;
@@ -742,6 +758,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_DISK_GET_DRIVE_LAYOUT:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_DISK_GET_DRIVE_LAYOUT)\n");
if (ValidateIOBufferSize (Irp, sizeof (DRIVE_LAYOUT_INFORMATION), ValidateOutput))
{
PDRIVE_LAYOUT_INFORMATION outputBuffer = (PDRIVE_LAYOUT_INFORMATION)
@@ -764,6 +781,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_DISK_GET_LENGTH_INFO:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_DISK_GET_LENGTH_INFO)\n");
if (!ValidateIOBufferSize (Irp, sizeof (GET_LENGTH_INFORMATION), ValidateOutput))
{
Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW;
@@ -780,6 +798,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_DISK_VERIFY:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_DISK_VERIFY)\n");
if (ValidateIOBufferSize (Irp, sizeof (VERIFY_INFORMATION), ValidateInput))
{
HRESULT hResult;
@@ -825,6 +844,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
case IOCTL_DISK_CHECK_VERIFY:
case IOCTL_STORAGE_CHECK_VERIFY:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_STORAGE_CHECK_VERIFY)\n");
{
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
@@ -838,6 +858,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_DISK_IS_WRITABLE:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_DISK_IS_WRITABLE)\n");
{
if (Extension->bReadOnly)
Irp->IoStatus.Status = STATUS_MEDIA_WRITE_PROTECTED;
@@ -849,12 +870,13 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
case IOCTL_VOLUME_ONLINE:
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_VOLUME_ONLINE)\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
break;
case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS:
-
+ Dump ("ProcessVolumeDeviceControlIrp (IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS)\n");
// Vista's filesystem defragmenter fails if IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS does not succeed.
if (!(OsMajorVersion == 6 && OsMinorVersion == 0))
{
@@ -875,10 +897,11 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
break;
default:
+ Dump ("ProcessVolumeDeviceControlIrp (unknown code 0x%.8X)\n", irpSp->Parameters.DeviceIoControl.IoControlCode);
return TCCompleteIrp (Irp, STATUS_INVALID_DEVICE_REQUEST, 0);
}
-#ifdef DEBUG
+#if defined(DEBUG) || defined (DEBG_TRACE)
if (!NT_SUCCESS (Irp->IoStatus.Status))
{
Dump ("IOCTL error 0x%08x (0x%x %d)\n",
@@ -1691,7 +1714,7 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
}
-#ifdef DEBUG
+#if defined(DEBUG) || defined(DEBUG_TRACE)
if (!NT_SUCCESS (Irp->IoStatus.Status))
{
switch (irpSp->Parameters.DeviceIoControl.IoControlCode)
diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c
index abe09557..2235af1a 100644
--- a/src/ExpandVolume/ExpandVolume.c
+++ b/src/ExpandVolume/ExpandVolume.c
@@ -804,7 +804,7 @@ static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePas
cryptoInfo->RequiredProgramVersion,
cryptoInfo->HeaderFlags,
cryptoInfo->SectorSize,
- TRUE ); // use slow poll
+ FALSE ); // use slow poll
if (ci != NULL)
crypto_close (ci);
@@ -818,8 +818,7 @@ static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePas
goto error;
}
- nStatus = _lwrite ((HFILE) dev, buffer, TC_VOLUME_HEADER_EFFECTIVE_SIZE);
- if (nStatus != TC_VOLUME_HEADER_EFFECTIVE_SIZE)
+ if (!WriteEffectiveVolumeHeader (bDevice, dev, buffer))
{
nStatus = ERR_OS_ERROR;
goto error;
@@ -835,9 +834,51 @@ static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePas
)
{
//DebugAddProgressDlgStatus(hwndDlg, L"WriteRandomDataToReservedHeaderAreas() ...\r\n");
- nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, newDataAreaSize, !backupHeader, backupHeader);
+ PCRYPTO_INFO dummyInfo = NULL;
+ LARGE_INTEGER hiddenOffset;
+
+ nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, newDataAreaSize, !backupHeader, backupHeader, FALSE);
if (nStatus != ERR_SUCCESS)
goto error;
+
+ // write fake hidden volume header to protect against attacks that use statistical entropy
+ // analysis to detect presence of hidden volumes
+ hiddenOffset.QuadPart = headerOffset.QuadPart + TC_HIDDEN_VOLUME_HEADER_OFFSET;
+
+ nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE,
+ buffer,
+ cryptoInfo->ea,
+ cryptoInfo->mode,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ &dummyInfo,
+ newDataAreaSize,
+ newDataAreaSize, // hiddenVolumeSize
+ cryptoInfo->EncryptedAreaStart.Value,
+ newDataAreaSize,
+ cryptoInfo->RequiredProgramVersion,
+ cryptoInfo->HeaderFlags,
+ cryptoInfo->SectorSize,
+ FALSE ); // use slow poll
+
+ if (nStatus != ERR_SUCCESS)
+ goto error;
+
+ crypto_close (dummyInfo);
+
+ if (!SetFilePointerEx ((HANDLE) dev, hiddenOffset, NULL, FILE_BEGIN))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto error;
+ }
+
+ if (!WriteEffectiveVolumeHeader (bDevice, dev, buffer))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto error;
+ }
}
FlushFileBuffers (dev);
diff --git a/src/ExpandVolume/ExpandVolume.vcxproj b/src/ExpandVolume/ExpandVolume.vcxproj
new file mode 100644
index 00000000..de8f63b5
--- /dev/null
+++ b/src/ExpandVolume/ExpandVolume.vcxproj
@@ -0,0 +1,448 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9715FF1D-599B-4BBC-AD96-BEF6E08FF827}</ProjectGuid>
+ <RootNamespace>ExpandVolume</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">VeraCryptExpander</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">VeraCryptExpander</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">VeraCryptExpander</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">VeraCryptExpander</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <CustomBuildStep>
+ <Command>
+ </Command>
+ </CustomBuildStep>
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\pkcs11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VCEXPANDER;TCMOUNT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <BrowseInformation>
+ </BrowseInformation>
+ <BrowseInformationFile>
+ </BrowseInformationFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4311;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptExpander.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)ExpandVolume.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>VeraCryptExpander.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>md "..\Debug\Setup Files" 2&gt;NUL:
+copy Debug\VeraCryptExpander.exe "..\Debug\Setup Files" &gt;NUL:
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <CustomBuildStep>
+ <Command>
+ </Command>
+ </CustomBuildStep>
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\pkcs11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VCEXPANDER;TCMOUNT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <BrowseInformation>
+ </BrowseInformation>
+ <BrowseInformationFile>
+ </BrowseInformationFile>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4311;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\x64\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptExpander.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)ExpandVolume.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX64</TargetMachine>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>VeraCryptExpander.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>md "..\Debug\Setup Files" 2&gt;NUL:
+copy $(TargetPath) "..\Debug\Setup Files\VeraCryptExpander-x64.exe" &gt;NUL:
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TypeLibraryName>$(SolutionDir)/Mount/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\pkcs11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VCEXPANDER;TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4311;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptExpander.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>VeraCryptExpander.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>copy Release\VeraCryptExpander.exe "..\Release\Setup Files\"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(SolutionDir)/Mount/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\pkcs11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VCEXPANDER;TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4311;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptExpander.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX64</TargetMachine>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>VeraCryptExpander.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCryptExpander-x64.exe"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Boot\Windows\Boot.vcxproj">
+ <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Crypto\Crypto.vcxproj">
+ <Project>{993245cf-6b70-47ee-91bb-39f8fc6dc0e7}</Project>
+ <CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
+ <ReferenceOutputAssembly>true</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Driver\Driver.vcxproj">
+ <Project>{ef5ef444-18d0-40d7-8dfa-775ec4448602}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Format\Format.vcxproj">
+ <Project>{9dc1abe2-d18b-48fb-81d2-8c50adc57bcf}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Mount\Mount.vcxproj">
+ <Project>{e4c40f94-e7f9-4981-86e4-186b46f993f3}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Common\XUnzip.cpp" />
+ <ClCompile Include="..\Common\XZip.cpp" />
+ <ClCompile Include="DlgExpandVolume.cpp" />
+ <ClCompile Include="ExpandVolume.c" />
+ <ClCompile Include="InitDataArea.c" />
+ <ClCompile Include="WinMain.cpp">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\BaseCom.cpp" />
+ <ClCompile Include="..\Common\BootEncryption.cpp" />
+ <ClCompile Include="..\Common\Cmdline.c" />
+ <ClCompile Include="..\Common\Combo.c" />
+ <ClCompile Include="..\Common\Crc.c" />
+ <ClCompile Include="..\Common\Crypto.c" />
+ <ClCompile Include="..\Common\Dictionary.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c" />
+ <ClCompile Include="..\Common\Endian.c" />
+ <ClCompile Include="..\Common\GfMul.c" />
+ <ClCompile Include="..\Common\Keyfiles.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Language.c" />
+ <ClCompile Include="..\Common\Password.c" />
+ <ClCompile Include="..\Common\Pkcs5.c" />
+ <ClCompile Include="..\Common\Progress.c" />
+ <ClCompile Include="..\Common\Random.c" />
+ <ClCompile Include="..\Common\Registry.c" />
+ <ClCompile Include="..\Common\SecurityToken.cpp" />
+ <ClCompile Include="..\Common\Tests.c" />
+ <ClCompile Include="..\Common\Volumes.c" />
+ <ClCompile Include="..\Common\Wipe.c" />
+ <ClCompile Include="..\Common\Xml.c" />
+ <ClCompile Include="..\Common\Xts.c" />
+ <ClCompile Include="..\Mount\Favorites.cpp" />
+ <ClCompile Include="..\Mount\Hotkeys.c" />
+ <ClCompile Include="..\Mount\MainCom.cpp" />
+ <ClCompile Include="..\Mount\Mount.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Wipe.h" />
+ <ClInclude Include="..\Common\Apidrvr.h" />
+ <ClInclude Include="..\Common\BaseCom.h" />
+ <ClInclude Include="..\Common\BootEncryption.h" />
+ <ClInclude Include="..\Common\Cmdline.h" />
+ <ClInclude Include="..\Common\Combo.h" />
+ <ClInclude Include="..\Common\Common.h" />
+ <ClInclude Include="..\Common\Crc.h" />
+ <ClInclude Include="..\Common\Crypto.h" />
+ <ClInclude Include="..\Common\Dictionary.h" />
+ <ClInclude Include="..\Common\Dlgcode.h" />
+ <ClInclude Include="..\Common\EncryptionThreadPool.h" />
+ <ClInclude Include="..\Common\Exception.h" />
+ <ClInclude Include="..\Common\XUnzip.h" />
+ <ClInclude Include="..\Common\XZip.h" />
+ <ClInclude Include="ExpandVolume.h" />
+ <ClInclude Include="..\Common\GfMul.h" />
+ <ClInclude Include="Hotkeys.h" />
+ <ClInclude Include="InitDataArea.h" />
+ <ClInclude Include="..\Common\Keyfiles.h" />
+ <ClInclude Include="..\Common\Language.h" />
+ <ClInclude Include="..\Mount\MainCom.h" />
+ <ClInclude Include="..\Mount\Mount.h" />
+ <ClInclude Include="..\Common\Password.h" />
+ <ClInclude Include="..\Common\Pkcs5.h" />
+ <ClInclude Include="..\Common\Progress.h" />
+ <ClInclude Include="..\Common\Random.h" />
+ <ClInclude Include="..\Common\Registry.h" />
+ <ClInclude Include="..\Common\Resource.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="..\Common\SecurityToken.h" />
+ <ClInclude Include="..\Common\Tcdefs.h" />
+ <ClInclude Include="..\Common\Tests.h" />
+ <ClInclude Include="..\Common\Volumes.h" />
+ <ClInclude Include="..\Common\Xml.h" />
+ <ClInclude Include="..\Common\Xts.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <Midl Include="..\Mount\MainCom.idl">
+ <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)/Mount</OutputDirectory>
+ <HeaderFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)/Mount/%(Filename)_h.h</HeaderFileName>
+ <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)/Mount</OutputDirectory>
+ <HeaderFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)/Mount/%(Filename)_h.h</HeaderFileName>
+ <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)/Mount</OutputDirectory>
+ <HeaderFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)/Mount/%(Filename)_h.h</HeaderFileName>
+ <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)/Mount</OutputDirectory>
+ <HeaderFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)/Mount/%(Filename)_h.h</HeaderFileName>
+ </Midl>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExpandVolume.rc" />
+ <ResourceCompile Include="..\Common\Common.rc">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Logo_288dpi.bmp" />
+ <None Include="Logo_96dpi.bmp" />
+ <None Include="..\Common\Textual_logo_288dpi.bmp" />
+ <None Include="..\Common\Textual_logo_96dpi.bmp" />
+ <None Include="..\Common\Textual_logo_background.bmp" />
+ <None Include="..\Common\VeraCrypt.ico" />
+ <None Include="..\Common\VeraCrypt_mounted.ico" />
+ <None Include="..\Common\VeraCrypt_Volume.ico" />
+ <None Include="..\Common\Language.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="VeraCryptExpander.manifest" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/ExpandVolume/ExpandVolume.vcxproj.filters b/src/ExpandVolume/ExpandVolume.vcxproj.filters
new file mode 100644
index 00000000..9bd570a1
--- /dev/null
+++ b/src/ExpandVolume/ExpandVolume.vcxproj.filters
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Source Files\Common">
+ <UniqueIdentifier>{72ac1543-f2dc-4c01-8803-65822dc01862}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\Mount">
+ <UniqueIdentifier>{1d0126bc-b4d1-4ed2-a244-52cb9dc1e516}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
+ </Filter>
+ <Filter Include="Resource Files\Common">
+ <UniqueIdentifier>{ece6c790-f488-400d-b92d-64f73ce9f990}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="DlgExpandVolume.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ExpandVolume.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="InitDataArea.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="WinMain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\BaseCom.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\BootEncryption.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Cmdline.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Combo.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crc.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crypto.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dictionary.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Endian.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\GfMul.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Keyfiles.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Language.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Password.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Pkcs5.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Progress.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Random.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Registry.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\SecurityToken.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Tests.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Volumes.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Wipe.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xml.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xts.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Mount\Favorites.cpp">
+ <Filter>Source Files\Mount</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Mount\Hotkeys.c">
+ <Filter>Source Files\Mount</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Mount\MainCom.cpp">
+ <Filter>Source Files\Mount</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Mount\Mount.c">
+ <Filter>Source Files\Mount</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XZip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XUnzip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Wipe.h">
+ <Filter>Source Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Apidrvr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\BaseCom.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\BootEncryption.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Cmdline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Combo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Crc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Crypto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Dictionary.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Dlgcode.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\EncryptionThreadPool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Exception.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ExpandVolume.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\GfMul.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Hotkeys.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="InitDataArea.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Keyfiles.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Language.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Mount\MainCom.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Mount\Mount.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Password.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Pkcs5.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Progress.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Random.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Registry.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\SecurityToken.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tcdefs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tests.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Volumes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Xml.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Xts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XZip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XUnzip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <Midl Include="..\Mount\MainCom.idl">
+ <Filter>Source Files\Mount</Filter>
+ </Midl>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExpandVolume.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="..\Common\Common.rc">
+ <Filter>Resource Files\Common</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Logo_288dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Logo_96dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_288dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_96dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_background.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt_mounted.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt_Volume.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\Language.xml">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="VeraCryptExpander.manifest">
+ <Filter>Resource Files</Filter>
+ </Manifest>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/ExpandVolume/ExpandVolume.vcxproj.user b/src/ExpandVolume/ExpandVolume.vcxproj.user
new file mode 100644
index 00000000..ace9a86a
--- /dev/null
+++ b/src/ExpandVolume/ExpandVolume.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project> \ No newline at end of file
diff --git a/src/ExpandVolume/InitDataArea.c b/src/ExpandVolume/InitDataArea.c
index 3e2bf494..a687f3e0 100644
--- a/src/ExpandVolume/InitDataArea.c
+++ b/src/ExpandVolume/InitDataArea.c
@@ -51,8 +51,8 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
unsigned __int64 nSecNo = startSector;
int retVal = 0;
DWORD err;
- char temporaryKey[MASTER_KEYDATA_SIZE];
- char originalK2[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) char temporaryKey[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) char originalK2[MASTER_KEYDATA_SIZE];
LARGE_INTEGER startOffset;
LARGE_INTEGER newOffset;
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp
index ad0d2f50..42aa6a70 100644
--- a/src/ExpandVolume/WinMain.cpp
+++ b/src/ExpandVolume/WinMain.cpp
@@ -504,9 +504,17 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
int i, nIndex = SendMessageW (hComboBox, CB_ADDSTRING, 0, (LPARAM) GetString ("AUTODETECTION"));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) 0);
+ BOOL bIsGPT = FALSE;
+ try
+ {
+ BootEncryption BootEncObj (hwndDlg);
+ bIsGPT = BootEncObj.GetSystemDriveConfiguration().SystemPartition.IsGPT;
+ }
+ catch (...) {}
+
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
- if (HashForSystemEncryption(i))
+ if (bIsGPT || HashForSystemEncryption(i))
{
nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
diff --git a/src/Format/Format.vcxproj b/src/Format/Format.vcxproj
new file mode 100644
index 00000000..0b4a8312
--- /dev/null
+++ b/src/Format/Format.vcxproj
@@ -0,0 +1,420 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF}</ProjectGuid>
+ <RootNamespace>Format</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">VeraCryptFormat</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">VeraCryptFormat</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">VeraCryptFormat</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">VeraCryptFormat</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VOLFORMAT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)Format.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>md "..\Debug\Setup Files" 2&gt;NUL:
+copy Debug\VeraCryptFormat.exe "..\Debug\Setup Files\VeraCrypt Format.exe" &gt;NUL:
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VOLFORMAT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\x64\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)Format.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>md "..\Debug\Setup Files" 2&gt;NUL:
+copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt Format-x64.exe" &gt;NUL:
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VOLFORMAT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>copy Release\VeraCryptFormat.exe "..\Release\Setup Files\VeraCrypt Format.exe"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>VOLFORMAT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4204;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptFormat.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Format.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCrypt Format-x64.exe"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Common\XUnzip.cpp" />
+ <ClCompile Include="..\Common\XZip.cpp" />
+ <ClCompile Include="FormatCom.cpp" />
+ <ClCompile Include="InPlace.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="Tcformat.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\BaseCom.cpp" />
+ <ClCompile Include="..\Common\BootEncryption.cpp" />
+ <ClCompile Include="..\Common\Cmdline.c" />
+ <ClCompile Include="..\Common\Combo.c" />
+ <ClCompile Include="..\Common\Crc.c" />
+ <ClCompile Include="..\Common\Crypto.c" />
+ <ClCompile Include="..\Common\Dictionary.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c" />
+ <ClCompile Include="..\Common\Endian.c" />
+ <ClCompile Include="..\Common\Fat.c" />
+ <ClCompile Include="..\Common\Format.c" />
+ <ClCompile Include="..\Common\GfMul.c" />
+ <ClCompile Include="..\Common\Keyfiles.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Language.c" />
+ <ClCompile Include="..\Common\Password.c" />
+ <ClCompile Include="..\Common\Pkcs5.c" />
+ <ClCompile Include="..\Common\Progress.c" />
+ <ClCompile Include="..\Common\Random.c" />
+ <ClCompile Include="..\Common\Registry.c" />
+ <ClCompile Include="..\Common\SecurityToken.cpp" />
+ <ClCompile Include="..\Common\Tests.c" />
+ <ClCompile Include="..\Common\Volumes.c" />
+ <ClCompile Include="..\Common\Wipe.c" />
+ <ClCompile Include="..\Common\Xml.c" />
+ <ClCompile Include="..\Common\Xts.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <Midl Include="FormatCom.idl" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\BaseCom.h" />
+ <ClInclude Include="..\Common\Common.h" />
+ <ClInclude Include="..\Common\Crc.h" />
+ <ClInclude Include="..\Common\Crypto.h" />
+ <ClInclude Include="..\Common\Dictionary.h" />
+ <ClInclude Include="..\Common\Dlgcode.h" />
+ <ClInclude Include="..\Common\EncryptionThreadPool.h" />
+ <ClInclude Include="..\Common\Endian.h" />
+ <ClInclude Include="..\Common\Exception.h" />
+ <ClInclude Include="..\Common\Fat.h" />
+ <ClInclude Include="..\Common\Format.h" />
+ <ClInclude Include="..\Common\XUnzip.h" />
+ <ClInclude Include="..\Common\XZip.h" />
+ <ClInclude Include="FormatCom.h" />
+ <ClInclude Include="..\Common\GfMul.h" />
+ <ClInclude Include="InPlace.h" />
+ <ClInclude Include="..\Common\Keyfiles.h" />
+ <ClInclude Include="..\Common\Language.h" />
+ <ClInclude Include="..\Mount\Mount.h" />
+ <ClInclude Include="..\Common\Pkcs5.h" />
+ <ClInclude Include="..\Common\Progress.h" />
+ <ClInclude Include="..\Common\Random.h" />
+ <ClInclude Include="..\Common\Registry.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="..\Common\Resource.h" />
+ <ClInclude Include="..\Common\SecurityToken.h" />
+ <ClInclude Include="..\Common\Tcdefs.h" />
+ <ClInclude Include="Tcformat.h" />
+ <ClInclude Include="..\Common\Tests.h" />
+ <ClInclude Include="..\Common\Volumes.h" />
+ <ClInclude Include="..\Common\Wipe.h" />
+ <ClInclude Include="..\Common\Xml.h" />
+ <ClInclude Include="..\Common\Xts.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\Boot\Windows\Release_Camellia\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Camellia_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Camellia\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Camellia_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_AES_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin" />
+ <None Include="Format.tlb">
+ <SubType>Designer</SubType>
+ </None>
+ <None Include="..\Common\VeraCrypt_mounted.ico" />
+ <None Include="..\Common\VeraCrypt_Volume.ico" />
+ <None Include="VeraCrypt_wizard.bmp" />
+ <None Include="..\Boot\Windows\Release_AES\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Release\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Release_Twofish\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue_AES\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Release_Serpent\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue_AES\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Serpent\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Twofish\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_AES\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release\Decompressor.com" />
+ <None Include="..\Common\Language.xml" />
+ <None Include="..\Resources\Texts\License.rtf" />
+ <None Include="..\Common\Textual_logo_288dpi.bmp" />
+ <None Include="..\Common\Textual_logo_96dpi.bmp" />
+ <None Include="..\Common\Textual_logo_background.bmp" />
+ <None Include="..\Common\VeraCrypt.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="Format.manifest" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Format.rc" />
+ <ResourceCompile Include="..\Common\Common.rc">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Boot\Windows\Boot.vcxproj">
+ <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Crypto\Crypto.vcxproj">
+ <Project>{993245cf-6b70-47ee-91bb-39f8fc6dc0e7}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Driver\Driver.vcxproj">
+ <Project>{ef5ef444-18d0-40d7-8dfa-775ec4448602}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/Format/Format.vcxproj.filters b/src/Format/Format.vcxproj.filters
new file mode 100644
index 00000000..03d22739
--- /dev/null
+++ b/src/Format/Format.vcxproj.filters
@@ -0,0 +1,356 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Source Files\Common">
+ <UniqueIdentifier>{c45e7f30-87b6-4c8e-9035-9a00f8b2ecb7}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
+ </Filter>
+ <Filter Include="Resource Files\Common">
+ <UniqueIdentifier>{881fda51-0ca5-4603-9de7-c618932554b4}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="FormatCom.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="InPlace.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Tcformat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\BaseCom.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\BootEncryption.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Cmdline.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Combo.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crc.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crypto.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dictionary.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Endian.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Fat.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Format.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\GfMul.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Keyfiles.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Language.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Password.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Pkcs5.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Progress.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Random.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Registry.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\SecurityToken.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Tests.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Volumes.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Wipe.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xml.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xts.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XZip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XUnzip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Midl Include="FormatCom.idl">
+ <Filter>Source Files</Filter>
+ </Midl>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\BaseCom.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Crc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Crypto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Dictionary.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Dlgcode.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\EncryptionThreadPool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Endian.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Exception.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Fat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Format.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="FormatCom.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\GfMul.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="InPlace.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Keyfiles.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Language.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Mount\Mount.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Pkcs5.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Progress.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Random.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Registry.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\SecurityToken.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tcdefs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Tcformat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tests.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Volumes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Wipe.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Xml.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Xts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XZip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XUnzip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_AES_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Format.tlb">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt_mounted.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt_Volume.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="VeraCrypt_wizard.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_AES\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Twofish\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_AES\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Serpent\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_AES\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Serpent\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Twofish\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_AES\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release\Decompressor.com">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Language.xml">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Resources\Texts\License.rtf">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_288dpi.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_96dpi.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_background.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt.ico">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Camellia\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Camellia_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Camellia\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Camellia_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="Format.manifest">
+ <Filter>Resource Files</Filter>
+ </Manifest>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Format.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="..\Common\Common.rc">
+ <Filter>Resource Files\Common</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/Format/Format.vcxproj.user b/src/Format/Format.vcxproj.user
new file mode 100644
index 00000000..ace9a86a
--- /dev/null
+++ b/src/Format/Format.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project> \ No newline at end of file
diff --git a/src/Format/FormatCom.cpp b/src/Format/FormatCom.cpp
index 96e3e3cd..2aa5cea9 100644
--- a/src/Format/FormatCom.cpp
+++ b/src/Format/FormatCom.cpp
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -74,7 +74,7 @@ public:
AddRef ();
return S_OK;
}
-
+
virtual DWORD STDMETHODCALLTYPE CallDriver (DWORD ioctl, BSTR input, BSTR *output)
{
return BaseCom::CallDriver (ioctl, input, output);
@@ -137,6 +137,46 @@ public:
return ::FormatFs (driveNo, clusterSize, fsType);
}
+ virtual DWORD STDMETHODCALLTYPE GetFileSize (BSTR filePath, unsigned __int64 *pSize)
+ {
+ return BaseCom::GetFileSize (filePath, pSize);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output)
+ {
+ return BaseCom::DeviceIoControl (readOnly, device, filePath, dwIoControlCode, input, output);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg)
+ {
+ return BaseCom::InstallEfiBootLoader (preserveUserConfig, hiddenOSCreation, pim, hashAlg);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE BackupEfiSystemLoader ()
+ {
+ return BaseCom::BackupEfiSystemLoader ();
+ }
+
+ virtual DWORD STDMETHODCALLTYPE RestoreEfiSystemLoader ()
+ {
+ return BaseCom::RestoreEfiSystemLoader ();
+ }
+
+ virtual DWORD STDMETHODCALLTYPE GetEfiBootDeviceNumber (BSTR* pSdn)
+ {
+ return BaseCom::GetEfiBootDeviceNumber (pSdn);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE ReadEfiConfig (BSTR* pContent, DWORD *pcbRead)
+ {
+ return BaseCom::ReadEfiConfig (pContent, pcbRead);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg)
+ {
+ return BaseCom::WriteEfiBootSectorUserConfig (userConfig, customUserMessage,pim, hashAlg);
+ }
+
protected:
DWORD MessageThreadId;
LONG RefCount;
diff --git a/src/Format/FormatCom.idl b/src/Format/FormatCom.idl
index 23d987a7..1eb09b43 100644
--- a/src/Format/FormatCom.idl
+++ b/src/Format/FormatCom.idl
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -16,7 +16,7 @@ import "..\Common\Password.h";
[
uuid(56327DDA-F1A7-4e13-B128-520D129BDEF6),
helpstring("VeraCrypt Format UAC Support Library"),
- version(2.5) // Update ComSetup.cpp when changing version number
+ version(2.6) // Update ComSetup.cpp when changing version number
]
library TrueCryptFormatCom
{
@@ -40,6 +40,14 @@ library TrueCryptFormatCom
DWORD SetDriverServiceStartType (DWORD startType);
DWORD WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName, DWORD value);
BOOL FormatFs (int driveNo, int clusterSize, int fsType);
+ DWORD GetFileSize (BSTR filePath, unsigned __int64* pSize);
+ DWORD DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output);
+ DWORD InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg);
+ DWORD BackupEfiSystemLoader ();
+ DWORD RestoreEfiSystemLoader ();
+ DWORD GetEfiBootDeviceNumber (BSTR* pSdn);
+ DWORD ReadEfiConfig (BSTR* pContent, DWORD *pcbRead);
+ DWORD WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg);
};
[
diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c
index d3b3212b..cfae573f 100644
--- a/src/Format/InPlace.c
+++ b/src/Format/InPlace.c
@@ -566,6 +566,8 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
// Prepare the backup header
for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_HEADER_WIPE_PASSES); wipePass++)
{
+ PCRYPTO_INFO dummyInfo = NULL;
+
nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE,
header,
volParams->ea,
@@ -603,10 +605,51 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol
}
// Fill the reserved sectors of the backup header area with random data
- nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, dataAreaSize, FALSE, TRUE);
+ nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, cryptoInfo, dataAreaSize, FALSE, TRUE, TRUE);
+
+ if (nStatus != ERR_SUCCESS)
+ goto closing_seq;
+
+ // write fake hidden volume header to protect against attacks that use statistical entropy
+ // analysis to detect presence of hidden volumes
+ nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE,
+ header,
+ volParams->ea,
+ FIRST_MODE_OF_OPERATION_ID,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ &dummyInfo,
+ dataAreaSize,
+ dataAreaSize,
+ TC_VOLUME_DATA_OFFSET + dataAreaSize, // Start of the encrypted area = the first byte of the backup heeader (encrypting from the end)
+ dataAreaSize, // No data is encrypted yet
+ 0,
+ volParams->headerFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC,
+ volParams->sectorSize,
+ wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_HEADER_WIPE_PASSES - 1));
if (nStatus != ERR_SUCCESS)
goto closing_seq;
+
+ crypto_close (dummyInfo);
+
+ offset.QuadPart += TC_HIDDEN_VOLUME_HEADER_OFFSET;
+
+ if (!SetFilePointerEx (dev, offset, NULL, FILE_BEGIN))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto closing_seq;
+ }
+
+ // Write the fake hidden backup header to the partition
+ if (!WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto closing_seq;
+ }
+
}
@@ -1045,6 +1088,8 @@ inplace_enc_read:
for (int wipePass = 0; wipePass < (wipeAlgorithm == TC_WIPE_NONE ? 1 : PRAND_HEADER_WIPE_PASSES); wipePass++)
{
+ PCRYPTO_INFO dummyInfo = NULL;
+
nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE,
header,
headerCryptoInfo->ea,
@@ -1077,10 +1122,44 @@ inplace_enc_read:
}
// Fill the reserved sectors of the header area with random data
- nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, headerCryptoInfo, masterCryptoInfo->VolumeSize.Value, TRUE, FALSE);
+ nStatus = WriteRandomDataToReservedHeaderAreas (hwndDlg, dev, headerCryptoInfo, masterCryptoInfo->VolumeSize.Value, TRUE, FALSE, TRUE);
if (nStatus != ERR_SUCCESS)
goto closing_seq;
+
+ // write fake hidden volume header to protect against attacks that use statistical entropy
+ // analysis to detect presence of hidden volumes
+ nStatus = CreateVolumeHeaderInMemory (hwndDlg, FALSE,
+ header,
+ headerCryptoInfo->ea,
+ headerCryptoInfo->mode,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ &dummyInfo,
+ masterCryptoInfo->VolumeSize.Value,
+ masterCryptoInfo->VolumeSize.Value,
+ masterCryptoInfo->EncryptedAreaStart.Value,
+ masterCryptoInfo->EncryptedAreaLength.Value,
+ masterCryptoInfo->RequiredProgramVersion,
+ masterCryptoInfo->HeaderFlags | TC_HEADER_FLAG_NONSYS_INPLACE_ENC,
+ masterCryptoInfo->SectorSize,
+ wipeAlgorithm == TC_WIPE_NONE ? FALSE : (wipePass < PRAND_HEADER_WIPE_PASSES - 1));
+
+ if (nStatus != ERR_SUCCESS)
+ goto closing_seq;
+
+ crypto_close (dummyInfo);
+
+ offset.QuadPart += TC_HIDDEN_VOLUME_HEADER_OFFSET;
+
+ if (SetFilePointerEx (dev, offset, NULL, FILE_BEGIN) == 0
+ || !WriteEffectiveVolumeHeader (TRUE, dev, (byte *) header))
+ {
+ nStatus = ERR_OS_ERROR;
+ goto closing_seq;
+ }
}
// Update the configuration files
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 40c17d66..31140fd7 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -51,6 +51,7 @@
#include "Volumes.h"
#include "Wipe.h"
#include "Xml.h"
+#include "SecurityToken.h"
#include <Strsafe.h>
@@ -254,6 +255,8 @@ BOOL bOperationSuccess = FALSE;
BOOL bGuiMode = TRUE;
+BOOL bSystemIsGPT = FALSE;
+
int nPbar = 0; /* Control ID of progress bar:- for format code */
wchar_t HeaderKeyGUIView [KEY_GUI_VIEW_SIZE];
@@ -930,11 +933,13 @@ static BOOL SysDriveOrPartitionFullyEncrypted (BOOL bSilent)
BOOL SwitchWizardToSysEncMode (void)
{
WaitCursor ();
+ SystemDriveConfiguration config;
try
{
BootEncStatus = BootEncObj->GetStatus();
bWholeSysDrive = BootEncObj->SystemPartitionCoversWholeDrive();
+ config = BootEncObj->GetSystemDriveConfiguration ();
}
catch (Exception &e)
{
@@ -1412,6 +1417,24 @@ void ComboSelChangeEA (HWND hwndDlg)
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("TWOFISH_HELP"));
}
+ else if (wcsncmp (name, L"GOST89", 6) == 0)
+ {
+ StringCbPrintfW (hyperLink, sizeof(hyperLink) / 2, GetString ("MORE_INFO_ABOUT"), L"GOST89");
+
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("GOST89_HELP"));
+ }
+ else if (wcscmp (name, L"Kuznyechik") == 0)
+ {
+ StringCbPrintfW (hyperLink, sizeof(hyperLink) / 2, GetString ("MORE_INFO_ABOUT"), name);
+
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("KUZNYECHIK_HELP"));
+ }
+ else if (wcscmp (name, L"Camellia") == 0)
+ {
+ StringCbPrintfW (hyperLink, sizeof(hyperLink) / 2, GetString ("MORE_INFO_ABOUT"), name);
+
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("CAMELLIA_HELP"));
+ }
else if (EAGetCipherCount (nIndex) > 1)
{
// Cascade
@@ -1582,6 +1605,10 @@ static void RefreshMultiBootControls (HWND hwndDlg)
nMultiBoot = 1;
#endif
+ // For now, we force single configuration in wizard
+ if (bSystemIsGPT && nMultiBoot == 0)
+ nMultiBoot = 1;
+
SendMessage (GetDlgItem (hwndDlg, IDC_SINGLE_BOOT),
BM_SETCHECK,
nMultiBoot == 1 ? BST_CHECKED : BST_UNCHECKED,
@@ -3605,6 +3632,13 @@ static BOOL FileSize4GBLimitQuestionNeeded (void)
}
+void DisableIfGpt(HWND control)
+{
+ if (bSystemIsGPT) {
+ EnableWindow(control, FALSE);
+ }
+}
+
/* Except in response to the WM_INITDIALOG message, the dialog box procedure
should return nonzero if it processes the message, and zero if it does
not. - see DialogProc */
@@ -3662,6 +3696,8 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SendMessage (GetDlgItem (hwndDlg, IDC_SYSENC_HIDDEN), WM_SETFONT, (WPARAM) hUserBoldFont, (LPARAM) TRUE);
SendMessage (GetDlgItem (hwndDlg, IDC_SYSENC_NORMAL), WM_SETFONT, (WPARAM) hUserBoldFont, (LPARAM) TRUE);
+ DisableIfGpt(GetDlgItem(hwndDlg, IDC_SYSENC_HIDDEN));
+
CheckButton (GetDlgItem (hwndDlg, bHiddenOS ? IDC_SYSENC_HIDDEN : IDC_SYSENC_NORMAL));
SetWindowTextW (GetDlgItem (hwndDlg, IDC_BOX_HELP), GetString ("SYSENC_HIDDEN_TYPE_HELP"));
@@ -3701,6 +3737,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (hwndDlg, IDT_WHOLE_SYS_DRIVE), GetString ("SYS_ENCRYPTION_SPAN_WHOLE_SYS_DRIVE_HELP"));
CheckButton (GetDlgItem (hwndDlg, bWholeSysDrive ? IDC_WHOLE_SYS_DRIVE : IDC_SYS_PARTITION));
+ DisableIfGpt(GetDlgItem(hwndDlg, IDC_WHOLE_SYS_DRIVE));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
@@ -3778,7 +3815,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDCANCEL), GetString ("CANCEL"));
RefreshMultiBootControls (hwndDlg);
-
+ DisableIfGpt(GetDlgItem(hwndDlg, IDC_MULTI_BOOT));
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), nMultiBoot > 0);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDCANCEL), TRUE);
@@ -4040,7 +4077,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for (ea = EAGetFirst (); ea != 0; ea = EAGetNext (ea))
{
- if (EAIsFormatEnabled (ea))
+ if (EAIsFormatEnabled (ea) && (!SysEncInEffect () || bSystemIsGPT || EAIsMbrSysEncEnabled (ea)))
AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ea, 1), ea);
}
@@ -4054,13 +4091,13 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (SysEncInEffect ())
{
- hash_algo = DEFAULT_HASH_ALGORITHM_BOOT;
+ hash_algo = bSystemIsGPT? SHA512 : DEFAULT_HASH_ALGORITHM_BOOT;
RandSetHashFunction (hash_algo);
for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
{
// For now, we keep RIPEMD160 for system encryption
- if (((hid == RIPEMD160) || !HashIsDeprecated (hid)) && HashForSystemEncryption (hid))
+ if (((hid == RIPEMD160) || !HashIsDeprecated (hid)) && (bSystemIsGPT || HashForSystemEncryption (hid)))
AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO), HashGetName(hid), hid);
}
}
@@ -4450,11 +4487,10 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_BOX_TITLE), GetString ("RESCUE_DISK"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
- SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_INFO), GetString ("RESCUE_DISK_INFO"));
+ SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_INFO), bSystemIsGPT? GetString ("RESCUE_DISK_EFI_INFO"): GetString ("RESCUE_DISK_INFO"));
SetDlgItemText (hwndDlg, IDC_RESCUE_DISK_ISO_PATH, szRescueDiskISO);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), (GetWindowTextLength (GetDlgItem (hwndDlg, IDC_RESCUE_DISK_ISO_PATH)) > 1));
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), TRUE);
- SetCheckBox (hCurPage, IDC_SKIP_RESCUE_VERIFICATION, bDontVerifyRescueDisk);
break;
@@ -4466,10 +4502,19 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), GetString ("NEXT"));
SetWindowTextW (GetDlgItem (GetParent (hwndDlg), IDC_PREV), GetString ("PREV"));
- StringCbPrintfW (szTmp, sizeof szTmp,
- GetString (bDontVerifyRescueDisk ? "RESCUE_DISK_BURN_INFO_NO_CHECK" : "RESCUE_DISK_BURN_INFO"),
- szRescueDiskISO, IsWindowsIsoBurnerAvailable() ? L"" : GetString ("RESCUE_DISK_BURN_INFO_NONWIN_ISO_BURNER"));
+ if (bSystemIsGPT)
+ {
+ StringCbPrintfW (szTmp, sizeof szTmp,
+ GetString (bDontVerifyRescueDisk ? "RESCUE_DISK_EFI_EXTRACT_INFO_NO_CHECK" : "RESCUE_DISK_EFI_EXTRACT_INFO"),
+ szRescueDiskISO, GetString ("RESCUE_DISK_EFI_EXTRACT_INFO_NOTE"));
+ }
+ else
+ {
+ StringCbPrintfW (szTmp, sizeof szTmp,
+ GetString (bDontVerifyRescueDisk ? "RESCUE_DISK_BURN_INFO_NO_CHECK" : "RESCUE_DISK_BURN_INFO"),
+ szRescueDiskISO, IsWindowsIsoBurnerAvailable() ? L"" : GetString ("RESCUE_DISK_BURN_INFO_NONWIN_ISO_BURNER"));
+ }
SetWindowTextW (GetDlgItem (hwndDlg, IDT_RESCUE_DISK_BURN_INFO), szTmp);
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_NEXT), TRUE);
@@ -4478,14 +4523,21 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
would be confusion and bug reports). */
EnableWindow (GetDlgItem (GetParent (hwndDlg), IDC_PREV), FALSE);
- if (IsWindowsIsoBurnerAvailable())
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE), GetString ("LAUNCH_WIN_ISOBURN"));
+ if (bSystemIsGPT)
+ {
+ ShowWindow (GetDlgItem (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE), SW_HIDE);
+ }
+ else
+ {
+ if (IsWindowsIsoBurnerAvailable())
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE), GetString ("LAUNCH_WIN_ISOBURN"));
- ToHyperlink (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE);
+ ToHyperlink (hwndDlg, IDC_DOWNLOAD_CD_BURN_SOFTWARE);
- if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk)
- LaunchWindowsIsoBurner (hwndDlg, szRescueDiskISO);
- }
+ if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk)
+ LaunchWindowsIsoBurner (hwndDlg, szRescueDiskISO);
+ }
+ }
break;
case SYSENC_RESCUE_DISK_VERIFIED_PAGE:
@@ -5442,7 +5494,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_BENCHMARK_DLG), hwndDlg,
- (DLGPROC) BenchmarkDlgProc, (LPARAM) NULL);
+ (DLGPROC) BenchmarkDlgProc, (LPARAM) bSystemIsGPT);
bFastPollEnabled = TRUE;
bRandmixEnabled = TRUE;
@@ -5464,6 +5516,12 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
Applink ("serpent", FALSE, "");
else if (wcscmp (name, L"Twofish") == 0)
Applink ("twofish", FALSE, "");
+ else if (wcscmp (name, L"GOST89") == 0)
+ Applink ("gost89", FALSE, "");
+ else if (wcscmp (name, L"Kuznyechik") == 0)
+ Applink ("kuznyechik", FALSE, "");
+ else if (wcscmp (name, L"Camellia") == 0)
+ Applink ("camellia", FALSE, "");
else if (EAGetCipherCount (nIndex) > 1)
Applink ("cascades", TRUE, "");
@@ -5784,7 +5842,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
HWND hHashAlgoItem = GetDlgItem (hwndDlg, IDC_COMBO_BOX_HASH_ALGO);
int selectedAlgo = (int) SendMessage (hHashAlgoItem, CB_GETITEMDATA, SendMessage (hHashAlgoItem, CB_GETCURSEL, 0, 0), 0);
- if (!HashForSystemEncryption(selectedAlgo))
+ if (!bSystemIsGPT && !HashForSystemEncryption(selectedAlgo))
{
hash_algo = DEFAULT_HASH_ALGORITHM_BOOT;
RandSetHashFunction (DEFAULT_HASH_ALGORITHM_BOOT);
@@ -5972,6 +6030,14 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 0;
}
+ try
+ {
+ bSystemIsGPT = BootEncObj->GetSystemDriveConfiguration().SystemPartition.IsGPT;
+ }
+ catch (...)
+ {
+ }
+
SendMessageW (GetDlgItem (hwndDlg, IDC_BOX_TITLE), WM_SETFONT, (WPARAM) hTitleFont, (LPARAM) TRUE);
SetWindowTextW (hwndDlg, lpszTitle);
@@ -6153,7 +6219,10 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, 0, szRescueDiskISO);
- StringCbCatW (szRescueDiskISO, sizeof(szRescueDiskISO), L"\\VeraCrypt Rescue Disk.iso");
+ if (bSystemIsGPT)
+ StringCbCatW (szRescueDiskISO, sizeof(szRescueDiskISO), L"\\VeraCrypt Rescue Disk.zip");
+ else
+ StringCbCatW (szRescueDiskISO, sizeof(szRescueDiskISO), L"\\VeraCrypt Rescue Disk.iso");
if (IsOSAtLeast (WIN_VISTA))
{
@@ -7326,7 +7395,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
nIndex = SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0);
nVolumeEA = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0);
- if (SysEncInEffect ()
+ if (!bSystemIsGPT && SysEncInEffect ()
&& EAGetCipherCount (nVolumeEA) > 1) // Cascade?
{
if (AskWarnNoYes ("CONFIRM_CASCADE_FOR_SYS_ENCRYPTION", hwndDlg) == IDNO)
@@ -7910,40 +7979,43 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
return 1;
}
-retryCDDriveCheck:
- if (!bDontVerifyRescueDisk && !BootEncObj->IsCDRecorderPresent())
+ if (!bSystemIsGPT)
{
- char *multiChoiceStr[] = { 0, "CD_BURNER_NOT_PRESENT",
- "CD_BURNER_NOT_PRESENT_WILL_STORE_ISO",
- "CD_BURNER_NOT_PRESENT_WILL_CONNECT_LATER",
- "CD_BURNER_NOT_PRESENT_CONNECTED_NOW",
- 0 };
-
- switch (AskMultiChoice ((void **) multiChoiceStr, FALSE, hwndDlg))
+retryCDDriveCheck:
+ if (!bDontVerifyRescueDisk && !BootEncObj->IsCDRecorderPresent())
{
- case 1:
- wchar_t msg[8192];
- StringCchPrintfW (msg, array_capacity (msg), GetString ("CD_BURNER_NOT_PRESENT_WILL_STORE_ISO_INFO"), szRescueDiskISO);
- WarningDirect (msg, hwndDlg);
+ char *multiChoiceStr[] = { 0, "CD_BURNER_NOT_PRESENT",
+ "CD_BURNER_NOT_PRESENT_WILL_STORE_ISO",
+ "CD_BURNER_NOT_PRESENT_WILL_CONNECT_LATER",
+ "CD_BURNER_NOT_PRESENT_CONNECTED_NOW",
+ 0 };
- Warning ("RESCUE_DISK_BURN_NO_CHECK_WARN", hwndDlg);
- bDontVerifyRescueDisk = TRUE;
- nNewPageNo = SYSENC_RESCUE_DISK_VERIFIED_PAGE;
- break;
+ switch (AskMultiChoice ((void **) multiChoiceStr, FALSE, hwndDlg))
+ {
+ case 1:
+ wchar_t msg[8192];
+ StringCchPrintfW (msg, array_capacity (msg), GetString ("CD_BURNER_NOT_PRESENT_WILL_STORE_ISO_INFO"), szRescueDiskISO);
+ WarningDirect (msg, hwndDlg);
- case 2:
- AbortProcessSilent();
+ Warning ("RESCUE_DISK_BURN_NO_CHECK_WARN", hwndDlg);
+ bDontVerifyRescueDisk = TRUE;
+ nNewPageNo = SYSENC_RESCUE_DISK_VERIFIED_PAGE;
+ break;
- case 3:
- break;
+ case 2:
+ AbortProcessSilent();
- default:
- goto retryCDDriveCheck;
+ case 3:
+ break;
+
+ default:
+ goto retryCDDriveCheck;
+ }
}
- }
- if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk)
- Info ("RESCUE_DISK_WIN_ISOBURN_PRELAUNCH_NOTE", hwndDlg);
+ if (IsWindowsIsoBurnerAvailable() && !bDontVerifyRescueDisk)
+ Info ("RESCUE_DISK_WIN_ISOBURN_PRELAUNCH_NOTE", hwndDlg);
+ }
NormalCursor ();
}
@@ -7961,8 +8033,15 @@ retryCDDriveCheck:
{
wchar_t szTmp[8000];
- StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("RESCUE_DISK_CHECK_FAILED"),
- IsWindowsIsoBurnerAvailable () ? L"" : GetString ("RESCUE_DISK_CHECK_FAILED_SENTENCE_APPENDIX"));
+ if (bSystemIsGPT)
+ {
+ StringCbCopyW (szTmp, sizeof(szTmp), GetString ("RESCUE_DISK_EFI_CHECK_FAILED"));
+ }
+ else
+ {
+ StringCbPrintfW (szTmp, sizeof(szTmp), GetString ("RESCUE_DISK_CHECK_FAILED"),
+ IsWindowsIsoBurnerAvailable () ? L"" : GetString ("RESCUE_DISK_CHECK_FAILED_SENTENCE_APPENDIX"));
+ }
ErrorDirect (szTmp, hwndDlg);
@@ -8024,7 +8103,7 @@ retryCDDriveCheck:
}
#endif
- BootEncObj->Install (bHiddenOS ? true : false);
+ BootEncObj->Install (bHiddenOS ? true : false, hash_algo);
}
catch (Exception &e)
{
@@ -8777,6 +8856,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
OptionNoIsoCheck,
OptionQuit,
OptionTokenLib,
+ OptionTokenPin,
CommandResumeSysEncLogOn,
CommandResumeSysEnc,
CommandDecryptSysEnc,
@@ -8806,6 +8886,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
{ OptionHistory, L"/history", L"/h", FALSE },
{ OptionNoIsoCheck, L"/noisocheck", L"/n", FALSE },
{ OptionTokenLib, L"/tokenlib", NULL, FALSE },
+ { OptionTokenPin, L"/tokenpin", NULL, FALSE },
{ OptionQuit, L"/quit", L"/q", FALSE },
{ OptionEncryption, L"/encryption", NULL , FALSE },
{ OptionFilesystem, L"/filesystem", NULL , FALSE },
@@ -9190,6 +9271,20 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
break;
+ case OptionTokenPin:
+ {
+ wchar_t szTmp[SecurityToken::MaxPasswordLength + 1] = {0};
+ if (GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp)) == HAS_ARGUMENT)
+ {
+ if (0 == WideCharToMultiByte (CP_UTF8, 0, szTmp, -1, CmdTokenPin, TC_MAX_PATH, nullptr, nullptr))
+ AbortProcess ("COMMAND_LINE_ERROR");
+ }
+ else
+ AbortProcess ("COMMAND_LINE_ERROR");
+ }
+
+ break;
+
case OptionQuit:
{
// Used to indicate non-install elevation
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index 0a4f41b3..4d2f1387 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -89,6 +89,7 @@ namespace VeraCrypt
parser.AddSwitch (L"", L"test", _("Test internal algorithms"));
parser.AddSwitch (L"t", L"text", _("Use text user interface"));
parser.AddOption (L"", L"token-lib", _("Security token library"));
+ parser.AddOption (L"", L"token-pin", _("Security token PIN"));
parser.AddSwitch (L"v", L"verbose", _("Enable verbose output"));
parser.AddSwitch (L"", L"version", _("Display version information"));
parser.AddSwitch (L"", L"volume-properties", _("Display volume properties"));
@@ -593,6 +594,11 @@ namespace VeraCrypt
if (parser.Found (L"token-lib", &str))
Preferences.SecurityTokenModule = wstring (str);
+ if (parser.Found (L"token-pin", &str) && !str.IsEmpty ())
+ {
+ ArgTokenPin = ToUTF8Buffer (str.c_str(), str.Len ());
+ }
+
if (parser.Found (L"verbose"))
Preferences.Verbose = true;
diff --git a/src/Main/CommandLineInterface.h b/src/Main/CommandLineInterface.h
index 9bca2614..d7a18818 100644
--- a/src/Main/CommandLineInterface.h
+++ b/src/Main/CommandLineInterface.h
@@ -82,6 +82,7 @@ namespace VeraCrypt
VolumeInfoList ArgVolumes;
VolumeType::Enum ArgVolumeType;
bool ArgTrueCryptMode;
+ shared_ptr<SecureBuffer> ArgTokenPin;
bool StartBackgroundTask;
UserPreferences Preferences;
diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.cpp b/src/Main/Forms/EncryptionOptionsWizardPage.cpp
index 5af01d02..f7216b80 100644
--- a/src/Main/Forms/EncryptionOptionsWizardPage.cpp
+++ b/src/Main/Forms/EncryptionOptionsWizardPage.cpp
@@ -78,6 +78,12 @@ namespace VeraCrypt
EncryptionAlgorithmStaticText->SetLabel (LangString["SERPENT_HELP"]);
else if (typeid (*ea) == typeid (Twofish))
EncryptionAlgorithmStaticText->SetLabel (LangString["TWOFISH_HELP"]);
+ else if (typeid (*ea) == typeid (Camellia))
+ EncryptionAlgorithmStaticText->SetLabel (LangString["CAMELLIA_HELP"]);
+ else if (typeid (*ea) == typeid (GOST89))
+ EncryptionAlgorithmStaticText->SetLabel (LangString["GOST89_HELP"]);
+ else if (typeid (*ea) == typeid (Kuznyechik))
+ EncryptionAlgorithmStaticText->SetLabel (LangString["KUZNYECHIK_HELP"]);
else
EncryptionAlgorithmStaticText->SetLabel (L"");
}
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index d15e7375..77a9524d 100644
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -537,6 +537,13 @@ namespace VeraCrypt
{
virtual void operator() (string &passwordStr)
{
+ if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ())
+ {
+ passwordStr.clear();
+ passwordStr.insert (0, (char*) CmdLine->ArgTokenPin->Ptr (), CmdLine->ArgTokenPin->Size());
+ return;
+ }
+
if (Gui->GetPreferences().NonInteractive)
throw MissingArgument (SRC_POS);
@@ -563,6 +570,14 @@ namespace VeraCrypt
StringConverter::ToSingle (wPassword, passwordStr);
}
+
+ virtual void notifyIncorrectPin ()
+ {
+ if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ())
+ {
+ CmdLine->ArgTokenPin->Free ();
+ }
+ }
};
struct WarningHandler : public SendExceptionFunctor
@@ -1144,6 +1159,18 @@ namespace VeraCrypt
{
url = L"https://veracrypt.codeplex.com/wikipage?title=Twofish";
}
+ else if (linkId == L"camellia")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Camellia";
+ }
+ else if (linkId == L"GOST89")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=GOST89";
+ }
+ else if (linkId == L"Kuznyechik")
+ {
+ url = L"https://veracrypt.codeplex.com/wikipage?title=Kuznyechik";
+ }
else if (linkId == L"cascades")
{
url = L"https://veracrypt.codeplex.com/wikipage?title=Cascades";
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 7e791035..32c34fd3 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -1058,6 +1058,13 @@ namespace VeraCrypt
virtual void operator() (string &passwordStr)
{
+ if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ())
+ {
+ passwordStr.clear();
+ passwordStr.insert (0, (char*) CmdLine->ArgTokenPin->Ptr (), CmdLine->ArgTokenPin->Size());
+ return;
+ }
+
if (UI->GetPreferences().NonInteractive)
throw MissingArgument (SRC_POS);
@@ -1074,6 +1081,14 @@ namespace VeraCrypt
StringConverter::ToSingle (wPassword, passwordStr);
}
+ virtual void notifyIncorrectPin ()
+ {
+ if (CmdLine->ArgTokenPin && CmdLine->ArgTokenPin->IsAllocated ())
+ {
+ CmdLine->ArgTokenPin->Free ();
+ }
+ }
+
const TextUserInterface *UI;
};
diff --git a/src/Makefile b/src/Makefile
index 70fb26da..4f0a6559 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -160,6 +160,12 @@ ifeq "$(shell uname -s)" "Linux"
PLATFORM := Linux
C_CXX_FLAGS += -DTC_UNIX -DTC_LINUX
+
+ GCC_GTEQ_440 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40400)
+ ifeq "$(GCC_GTEQ_440)" "1"
+ CFLAGS += -maes
+ CXXFLAGS += -maes
+ endif
ifeq "$(TC_BUILD_CONFIG)" "Release"
C_CXX_FLAGS += -fdata-sections -ffunction-sections
diff --git a/src/Mount/MainCom.cpp b/src/Mount/MainCom.cpp
index 8f3927ad..6056697c 100644
--- a/src/Mount/MainCom.cpp
+++ b/src/Mount/MainCom.cpp
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -158,6 +158,46 @@ public:
return ::ChangePwd (volumePath, oldPassword, old_pkcs5, old_pim, truecryptMode, newPassword, pkcs5, pim, wipePassCount, (HWND) hWnd);
}
+ virtual DWORD STDMETHODCALLTYPE GetFileSize (BSTR filePath, unsigned __int64 *pSize)
+ {
+ return BaseCom::GetFileSize (filePath, pSize);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output)
+ {
+ return BaseCom::DeviceIoControl (readOnly, device, filePath, dwIoControlCode, input, output);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg)
+ {
+ return BaseCom::InstallEfiBootLoader (preserveUserConfig, hiddenOSCreation, pim, hashAlg);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE BackupEfiSystemLoader ()
+ {
+ return BaseCom::BackupEfiSystemLoader ();
+ }
+
+ virtual DWORD STDMETHODCALLTYPE RestoreEfiSystemLoader ()
+ {
+ return BaseCom::RestoreEfiSystemLoader ();
+ }
+
+ virtual DWORD STDMETHODCALLTYPE GetEfiBootDeviceNumber (BSTR* pSdn)
+ {
+ return BaseCom::GetEfiBootDeviceNumber (pSdn);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE ReadEfiConfig (BSTR* pContent, DWORD *pcbRead)
+ {
+ return BaseCom::ReadEfiConfig (pContent, pcbRead);
+ }
+
+ virtual DWORD STDMETHODCALLTYPE WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg)
+ {
+ return BaseCom::WriteEfiBootSectorUserConfig (userConfig, customUserMessage,pim, hashAlg);
+ }
+
protected:
DWORD MessageThreadId;
LONG RefCount;
diff --git a/src/Mount/MainCom.idl b/src/Mount/MainCom.idl
index 9362fd42..9c3ef372 100644
--- a/src/Mount/MainCom.idl
+++ b/src/Mount/MainCom.idl
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -16,7 +16,7 @@ import "..\Common\Password.h";
[
uuid(9ACF6176-5FC4-4690-A025-B3306A50EB6A),
helpstring("VeraCrypt Main UAC Support Library"),
- version(2.7) // Update ComSetup.cpp when changing version number
+ version(2.8) // Update ComSetup.cpp when changing version number
]
library TrueCryptMainCom
{
@@ -44,6 +44,14 @@ library TrueCryptMainCom
int ChangePasswordEx (BSTR volumePath, Password *oldPassword, int old_pkcs5, Password *newPassword, int pkcs5, int wipePassCount, LONG_PTR hWnd);
int ChangePasswordEx2 (BSTR volumePath, Password *oldPassword, int old_pkcs5, BOOL truecryptMode, Password *newPassword, int pkcs5, int wipePassCount, LONG_PTR hWnd);
int ChangePasswordEx3 (BSTR volumePath, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, LONG_PTR hWnd);
+ DWORD GetFileSize (BSTR filePath, unsigned __int64* pSize);
+ DWORD DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output);
+ DWORD InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg);
+ DWORD BackupEfiSystemLoader ();
+ DWORD RestoreEfiSystemLoader ();
+ DWORD GetEfiBootDeviceNumber (BSTR* pSdn);
+ DWORD ReadEfiConfig (BSTR* pContent, DWORD *pcbRead);
+ DWORD WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg);
};
[
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 62ac5e0f..f725d32b 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -121,6 +121,10 @@ BOOL ComServerMode = FALSE;
BOOL ServiceMode = FALSE;
BOOL UsePreferences = TRUE;
+BOOL bSystemIsGPT = FALSE;
+wchar_t szDefaultRescueDiskName[TC_MAX_PATH+1];
+wchar_t szRescueDiskExtension[4];
+
int HiddenSysLeakProtectionNotificationStatus = TC_HIDDEN_OS_READ_ONLY_NOTIF_MODE_NONE;
int MaxVolumeIdleTime = -120;
int nCurrentShowType = 0; /* current display mode, mount, unmount etc */
@@ -129,7 +133,6 @@ int nSelectedDriveIndex = -1; /* Item number of selected drive */
int cmdUnmountDrive = -2; /* Volume drive letter to unmount (-1 = all) */
Password VolumePassword; /* Password used for mounting volumes */
Password CmdVolumePassword; /* Password passed from command line */
-char CmdTokenPin [SecurityToken::MaxPasswordLength + 1] = {0};
int VolumePkcs5 = 0;
int CmdVolumePkcs5 = 0;
int VolumePim = -1;
@@ -238,7 +241,6 @@ static void localcleanup (void)
burn (&mountOptions, sizeof (mountOptions));
burn (&defaultMountOptions, sizeof (defaultMountOptions));
burn (szFileName, sizeof(szFileName));
- burn (&CmdTokenPin, sizeof (CmdTokenPin));
/* Cleanup common code resources */
cleanup ();
@@ -348,6 +350,14 @@ static void InitMainDialog (HWND hwndDlg)
SetMenuItemInfoW (GetMenu (hwndDlg), i, TRUE, &info);
}
+ {
+ // disable hidden OS creation for GPT system encryption
+ if (bSystemIsGPT)
+ {
+ EnableMenuItem (GetMenu (hwndDlg), IDM_CREATE_HIDDEN_OS, MF_GRAYED);
+ }
+ }
+
// Disable menu item for changing system header key derivation algorithm until it's implemented
EnableMenuItem (GetMenu (hwndDlg), IDM_CHANGE_SYS_HEADER_KEY_DERIV_ALGO, MF_GRAYED);
@@ -1083,9 +1093,11 @@ unsigned __int64 GetSysEncDeviceEncryptedPartSize (BOOL bSilent)
static void PopulateSysEncContextMenu (HMENU popup, BOOL bToolsOnly)
{
+ SystemDriveConfiguration config;
try
{
BootEncStatus = BootEncObj->GetStatus();
+ config = BootEncObj->GetSystemDriveConfiguration();
}
catch (Exception &e)
{
@@ -1316,7 +1328,7 @@ BOOL SelectItem (HWND hTree, wchar_t nLetter)
}
-static void LaunchVolCreationWizard (HWND hwndDlg, const wchar_t *arg)
+static void LaunchVolCreationWizard (HWND hwndDlg, const wchar_t *arg, BOOL bElevation)
{
wchar_t t[TC_MAX_PATH + 1024] = {L'"',0};
wchar_t *tmp;
@@ -1350,21 +1362,30 @@ static void LaunchVolCreationWizard (HWND hwndDlg, const wchar_t *arg)
if (!FileExists(t))
Error ("VOL_CREATION_WIZARD_NOT_FOUND", hwndDlg); // Display a user-friendly error message and advise what to do
-
- if (wcslen (arg) > 0)
- {
- StringCbCatW (t, sizeof(t), L" ");
- StringCbCatW (t, sizeof(t), arg);
- }
-
- if (!CreateProcess (NULL, (LPWSTR) t, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi))
- {
- handleWin32Error (hwndDlg, SRC_POS);
- }
else
{
- CloseHandle (pi.hProcess);
- CloseHandle (pi.hThread);
+
+ if (bElevation && !IsAdmin() && IsUacSupported())
+ {
+ LaunchElevatedProcess (hwndDlg, t, arg);
+ }
+ else
+ {
+ if (wcslen (arg) > 0)
+ {
+ StringCbCatW (t, sizeof(t), L" ");
+ StringCbCatW (t, sizeof(t), arg);
+ }
+ if (!CreateProcess (NULL, (LPWSTR) t, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi))
+ {
+ handleWin32Error (hwndDlg, SRC_POS);
+ }
+ else
+ {
+ CloseHandle (pi.hProcess);
+ CloseHandle (pi.hThread);
+ }
+ }
}
}
}
@@ -2428,10 +2449,10 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case IDC_PKCS5_PRF_ID:
if (bSysEncPwdChangeDlgMode)
{
- int new_hash_algo_id = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA,
+ int new_hash_algo_id = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA,
SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
- if (new_hash_algo_id != 0 && !HashForSystemEncryption(new_hash_algo_id))
+ if (new_hash_algo_id != 0 && !bSystemIsGPT && !HashForSystemEncryption(new_hash_algo_id))
{
int new_hash_algo_id = DEFAULT_HASH_ALGORITHM_BOOT;
Info ("ALGO_NOT_SUPPORTED_FOR_SYS_ENCRYPTION", hwndDlg);
@@ -2765,7 +2786,7 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++)
{
- if (HashForSystemEncryption(i))
+ if (bSystemIsGPT || HashForSystemEncryption(i))
{
nIndex = (int) SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i));
SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i);
@@ -5471,16 +5492,18 @@ static void ChangeSysEncPassword (HWND hwndDlg, BOOL bOnlyChangeKDF)
// Initiates or resumes encryption of the system partition/drive
static void EncryptSystemDevice (HWND hwndDlg)
{
+ SystemDriveConfiguration config;
try
{
BootEncStatus = BootEncObj->GetStatus();
+ config = BootEncObj->GetSystemDriveConfiguration ();
}
catch (Exception &e)
{
e.Show (MainDlg);
}
- if (!BootEncStatus.DriveEncrypted
+ if (!BootEncStatus.DriveEncrypted
&& !BootEncStatus.DriveMounted
&& !SysEncryptionOrDecryptionRequired ())
{
@@ -5488,7 +5511,7 @@ static void EncryptSystemDevice (HWND hwndDlg)
if (!MutexExistsOnSystem (TC_MUTEX_NAME_SYSENC)) // If no instance of the wizard is currently taking care of system encryption
{
- LaunchVolCreationWizard (hwndDlg, L"/sysenc");
+ LaunchVolCreationWizard (hwndDlg, L"/sysenc", FALSE);
}
else
Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg);
@@ -5502,7 +5525,7 @@ static void EncryptSystemDevice (HWND hwndDlg)
if (!MutexExistsOnSystem (TC_MUTEX_NAME_SYSENC)) // If no instance of the wizard is currently taking care of system encryption
{
- LaunchVolCreationWizard (hwndDlg, L"/sysenc");
+ LaunchVolCreationWizard (hwndDlg, L"/sysenc",FALSE);
}
else
Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg);
@@ -5518,9 +5541,11 @@ static void EncryptSystemDevice (HWND hwndDlg)
// Initiates decryption of the system partition/drive
static void DecryptSystemDevice (HWND hwndDlg)
{
+ SystemDriveConfiguration config;
try
{
BootEncStatus = BootEncObj->GetStatus();
+ config = BootEncObj->GetSystemDriveConfiguration ();
}
catch (Exception &e)
{
@@ -5581,8 +5606,8 @@ static void DecryptSystemDevice (HWND hwndDlg)
return;
}
- CloseSysEncMutex ();
- LaunchVolCreationWizard (hwndDlg, L"/dsysenc");
+ CloseSysEncMutex ();
+ LaunchVolCreationWizard (hwndDlg, L"/dsysenc", FALSE);
}
else
Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg);
@@ -5597,7 +5622,7 @@ static void CreateHiddenOS (HWND hwndDlg)
// such information, but will exit (displaying only an error meessage).
Info("HIDDEN_OS_PREINFO", hwndDlg);
- LaunchVolCreationWizard (hwndDlg, L"/isysenc");
+ LaunchVolCreationWizard (hwndDlg, L"/isysenc", FALSE);
}
static void DecryptNonSysDevice (HWND hwndDlg, BOOL bResolveAmbiguousSelection, BOOL bUseDriveListSel)
@@ -5708,7 +5733,7 @@ static void DecryptNonSysDevice (HWND hwndDlg, BOOL bResolveAmbiguousSelection,
if (AskWarnNoYes ("CONFIRM_DECRYPT_NON_SYS_DEVICE_CAUTION", hwndDlg) == IDNO)
return;
- LaunchVolCreationWizard (hwndDlg, (wstring (L"/inplacedec \"") + scPath + L"\"").c_str ());
+ LaunchVolCreationWizard (hwndDlg, (wstring (L"/inplacedec \"") + scPath + L"\"").c_str (), FALSE);
}
// Blindly attempts (without any checks) to instruct the wizard to resume whatever system encryption process
@@ -5717,7 +5742,17 @@ static void ResumeInterruptedSysEncProcess (HWND hwndDlg)
{
if (!MutexExistsOnSystem (TC_MUTEX_NAME_SYSENC)) // If no instance of the wizard is currently taking care of system encryption
{
- LaunchVolCreationWizard (MainDlg, L"/csysenc");
+ SystemDriveConfiguration config;
+ try
+ {
+ config = BootEncObj->GetSystemDriveConfiguration ();
+ }
+ catch (Exception &e)
+ {
+ e.Show (MainDlg);
+ }
+
+ LaunchVolCreationWizard (MainDlg, L"/csysenc", FALSE);
}
else
Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg);
@@ -5772,7 +5807,7 @@ void CreateRescueDisk (HWND hwndDlg)
wchar_t initialDir[MAX_PATH];
SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, 0, initialDir);
- if (!BrowseFilesInDir (hwndDlg, "OPEN_TITLE", initialDir, szRescueDiskISO, FALSE, TRUE, NULL, L"VeraCrypt Rescue Disk.iso", L"iso"))
+ if (!BrowseFilesInDir (hwndDlg, "OPEN_TITLE", initialDir, szRescueDiskISO, FALSE, TRUE, NULL, szDefaultRescueDiskName, szRescueDiskExtension))
{
CloseSysEncMutex ();
return;
@@ -5781,17 +5816,25 @@ void CreateRescueDisk (HWND hwndDlg)
WaitCursor();
BootEncObj->CreateRescueIsoImage (false, szRescueDiskISO);
- StringCbPrintfW (szTmp, sizeof szTmp,
- GetString (IsWindowsIsoBurnerAvailable() ? "RESCUE_DISK_NON_WIZARD_CREATION_WIN_ISOBURN" : "RESCUE_DISK_NON_WIZARD_CREATION_BURN"),
- szRescueDiskISO);
-
- if (IsWindowsIsoBurnerAvailable())
+ if (bSystemIsGPT)
{
- if (AskYesNoString (szTmp, hwndDlg) == IDYES)
- LaunchWindowsIsoBurner (MainDlg, szRescueDiskISO);
+ StringCbPrintfW (szTmp, sizeof szTmp, GetString ("RESCUE_DISK_EFI_NON_WIZARD_CREATION"), szRescueDiskISO);
+ InfoDirect (szTmp, hwndDlg);
}
else
- InfoDirect (szTmp, hwndDlg);
+ {
+ StringCbPrintfW (szTmp, sizeof szTmp,
+ GetString (IsWindowsIsoBurnerAvailable() ? "RESCUE_DISK_NON_WIZARD_CREATION_WIN_ISOBURN" : "RESCUE_DISK_NON_WIZARD_CREATION_BURN"),
+ szRescueDiskISO);
+
+ if (IsWindowsIsoBurnerAvailable())
+ {
+ if (AskYesNoString (szTmp, hwndDlg) == IDYES)
+ LaunchWindowsIsoBurner (MainDlg, szRescueDiskISO);
+ }
+ else
+ InfoDirect (szTmp, hwndDlg);
+ }
}
catch (Exception &e)
{
@@ -5806,7 +5849,7 @@ void CreateRescueDisk (HWND hwndDlg)
Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg);
}
-static void VerifyRescueDisk (HWND hwndDlg, bool checkIsoFile)
+static void VerifyRescueDisk (HWND hwndDlg, bool checkImageFile)
{
try
{
@@ -5837,7 +5880,7 @@ static void VerifyRescueDisk (HWND hwndDlg, bool checkIsoFile)
{
try
{
- if (!checkIsoFile && (AskOkCancel ("RESCUE_DISK_NON_WIZARD_CHECK_INSERT", hwndDlg) != IDOK))
+ if (!checkImageFile && (AskOkCancel ("RESCUE_DISK_NON_WIZARD_CHECK_INSERT", hwndDlg) != IDOK))
{
CloseSysEncMutex ();
return;
@@ -5847,20 +5890,20 @@ static void VerifyRescueDisk (HWND hwndDlg, bool checkIsoFile)
BootEncObj->CreateRescueIsoImage (false, L"");
- if (checkIsoFile)
+ if (checkImageFile)
{
- wchar_t szRescueDiskISO [TC_MAX_PATH+1];
+ wchar_t szRescueDiskImage [TC_MAX_PATH+1];
wchar_t initialDir[MAX_PATH];
SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, 0, initialDir);
- if (!BrowseFilesInDir (hwndDlg, "OPEN_TITLE", initialDir, szRescueDiskISO, FALSE, FALSE, NULL, L"VeraCrypt Rescue Disk.iso", L"iso"))
+ if (!BrowseFilesInDir (hwndDlg, "OPEN_TITLE", initialDir, szRescueDiskImage, FALSE, FALSE, NULL,szDefaultRescueDiskName, szRescueDiskExtension))
{
CloseSysEncMutex ();
return;
}
WaitCursor();
- if (!BootEncObj->VerifyRescueDiskIsoImage (szRescueDiskISO))
+ if (!BootEncObj->VerifyRescueDiskImage (szRescueDiskImage))
Error ("RESCUE_DISK_ISO_IMAGE_CHECK_FAILED", hwndDlg);
else
Info ("RESCUE_DISK_ISO_IMAGE_CHECK_PASSED", hwndDlg);
@@ -5869,7 +5912,7 @@ static void VerifyRescueDisk (HWND hwndDlg, bool checkIsoFile)
{
WaitCursor();
if (!BootEncObj->VerifyRescueDisk ())
- Error ("RESCUE_DISK_NON_WIZARD_CHECK_FAILED", hwndDlg);
+ Error (bSystemIsGPT? "RESCUE_DISK_EFI_NON_WIZARD_CHECK_FAILED" : "RESCUE_DISK_NON_WIZARD_CHECK_FAILED", hwndDlg);
else
Info ("RESCUE_DISK_NON_WIZARD_CHECK_PASSED", hwndDlg);
}
@@ -5877,7 +5920,7 @@ static void VerifyRescueDisk (HWND hwndDlg, bool checkIsoFile)
catch (Exception &e)
{
e.Show (MainDlg);
- Error ("RESCUE_DISK_NON_WIZARD_CHECK_FAILED", hwndDlg);
+ Error (bSystemIsGPT? "RESCUE_DISK_EFI_NON_WIZARD_CHECK_FAILED" : "RESCUE_DISK_NON_WIZARD_CHECK_FAILED", hwndDlg);
}
CloseSysEncMutex ();
@@ -5938,7 +5981,7 @@ static void ResumeInterruptedNonSysInplaceEncProcess (BOOL bDecrypt)
// IMPORTANT: This function must not check any config files! Otherwise, if a config file was lost or corrupt,
// the user would not be able resume encryption and the data on the volume would be inaccessible.
- LaunchVolCreationWizard (MainDlg, bDecrypt? L"/resumeinplacedec" : L"/zinplace");
+ LaunchVolCreationWizard (MainDlg, bDecrypt? L"/resumeinplacedec" : L"/zinplace", FALSE);
}
BOOL SelectContainer (HWND hwndDlg)
@@ -5991,8 +6034,9 @@ static void WipeCache (HWND hwndDlg, BOOL silent)
static void Benchmark (HWND hwndDlg)
{
+
DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_BENCHMARK_DLG), hwndDlg,
- (DLGPROC) BenchmarkDlgProc, (LPARAM) NULL);
+ (DLGPROC) BenchmarkDlgProc, (LPARAM) bSystemIsGPT);
}
@@ -6389,12 +6433,21 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
BootEncObj->SetParentWindow (hwndDlg);
BootEncStatus = BootEncObj->GetStatus();
RecentBootEncStatus = BootEncStatus;
+ bSystemIsGPT = BootEncObj->GetSystemDriveConfiguration().SystemPartition.IsGPT;
}
catch (...)
{
// NOP
}
+ if (bSystemIsGPT)
+ StringCbCopyW (szRescueDiskExtension, sizeof (szRescueDiskExtension), L"zip");
+ else
+ StringCbCopyW (szRescueDiskExtension, sizeof (szRescueDiskExtension), L"iso");
+
+ StringCbCopyW (szDefaultRescueDiskName, sizeof (szDefaultRescueDiskName), L"VeraCrypt Rescue Disk.");
+ StringCbCatW (szDefaultRescueDiskName, sizeof (szDefaultRescueDiskName), szRescueDiskExtension);
+
if (UsePreferences)
{
// General preferences
@@ -6513,7 +6566,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
BOOL reportBadPasswd = CmdVolumePassword.Length > 0;
if (FirstCmdKeyFile)
- KeyFilesApplyWithPin (hwndDlg, &CmdVolumePassword, CmdTokenPin, FirstCmdKeyFile, szFileName);
+ KeyFilesApply (hwndDlg, &CmdVolumePassword, FirstCmdKeyFile, szFileName);
mounted = MountVolume (hwndDlg, szDriveLetter[0] - L'A',
szFileName, &CmdVolumePassword, EffectiveVolumePkcs5, CmdVolumePim, EffectiveVolumeTrueCryptMode, bCacheInDriver, bIncludePimInCache, bForceMount,
@@ -6558,7 +6611,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
WaitCursor ();
if (KeyFilesEnable && FirstKeyFile)
- KeyFilesApplyWithPin (hwndDlg, &VolumePassword, CmdTokenPin, FirstKeyFile, szFileName);
+ KeyFilesApply (hwndDlg, &VolumePassword, FirstKeyFile, szFileName);
mounted = MountVolume (hwndDlg, szDriveLetter[0] - L'A', szFileName, &VolumePassword, VolumePkcs5, VolumePim, VolumeTrueCryptMode, bCacheInDriver, bIncludePimInCache, bForceMount, &mountOptions, FALSE, TRUE);
@@ -6743,9 +6796,17 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
// The wizard was not launched during the system startup seq, or the user may have forgotten
// to resume the encryption/decryption process.
+ SystemDriveConfiguration config;
+ try
+ {
+ config = BootEncObj->GetSystemDriveConfiguration ();
+ }
+ catch (Exception &e)
+ {
+ e.Show (MainDlg);
+ }
-
- LaunchVolCreationWizard (hwndDlg, L"/csysenc");
+ LaunchVolCreationWizard (hwndDlg, L"/csysenc", FALSE);
}
}
}
@@ -7725,7 +7786,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (lw == IDC_CREATE_VOLUME || lw == IDM_CREATE_VOLUME || lw == IDM_VOLUME_WIZARD)
{
- LaunchVolCreationWizard (hwndDlg, L"");
+ LaunchVolCreationWizard (hwndDlg, L"", FALSE);
return 1;
}
@@ -8015,7 +8076,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (lw == IDM_SYSENC_SETTINGS || lw == IDM_SYS_ENC_SETTINGS)
{
- DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_SYSENC_SETTINGS), hwndDlg, (DLGPROC) BootLoaderPreferencesDlgProc, 0);
+ DialogBoxParamW (hInst, MAKEINTRESOURCEW (bSystemIsGPT? IDD_EFI_SYSENC_SETTINGS : IDD_SYSENC_SETTINGS), hwndDlg, (DLGPROC) BootLoaderPreferencesDlgProc, 0);
return 1;
}
@@ -8695,7 +8756,7 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
wchar_t szTmp[SecurityToken::MaxPasswordLength + 1] = {0};
if (GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp)) == HAS_ARGUMENT)
{
- if (0 == WideCharToMultiByte (CP_UTF8, 0, szTmp, -1, CmdTokenPin, array_capacity (CmdTokenPin), nullptr, nullptr))
+ if (0 == WideCharToMultiByte (CP_UTF8, 0, szTmp, -1, CmdTokenPin, TC_MAX_PATH, nullptr, nullptr))
AbortProcess ("COMMAND_LINE_ERROR");
}
else
@@ -8924,7 +8985,6 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz
VirtualLock (&mountOptions, sizeof (mountOptions));
VirtualLock (&defaultMountOptions, sizeof (defaultMountOptions));
VirtualLock (&szFileName, sizeof(szFileName));
- VirtualLock (&CmdTokenPin, sizeof (CmdTokenPin));
DetectX86Features ();
@@ -9649,8 +9709,8 @@ int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, const wchar_t *
OpenVolumeContext hiddenVolume;
Password hiddenVolPassword;
int hiddenVolPkcs5 = 0, hiddenVolPim = 0;
- byte temporaryKey[MASTER_KEYDATA_SIZE];
- byte originalK2[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) byte temporaryKey[MASTER_KEYDATA_SIZE];
+ CRYPTOPP_ALIGN_DATA(16) byte originalK2[MASTER_KEYDATA_SIZE];
int EffectiveVolumePkcs5 = CmdVolumePkcs5;
int EffectiveVolumePim = CmdVolumePim;
@@ -10433,16 +10493,17 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM
}
catch (...)
{
- BootEncStatus.DriveMounted = false;
+ BootEncStatus.DriveMounted = false;
}
- if (BootEncStatus.DriveMounted)
+ if (BootEncStatus.DriveMounted && !bSystemIsGPT)
{
byte userConfig;
string customUserMessage;
uint16 bootLoaderVersion;
- BootEncObj->ReadBootSectorConfig (nullptr, 0, &userConfig, &customUserMessage, &bootLoaderVersion);
+ if (!BootEncObj->ReadBootSectorConfig (nullptr, 0, &userConfig, &customUserMessage, &bootLoaderVersion))
+ return 1;
if (bootLoaderVersion != VERSION_NUM)
Warning ("BOOT_LOADER_VERSION_INCORRECT_PREFERENCES", hwndDlg);
@@ -10452,7 +10513,7 @@ static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM
else
userConfig &= ~TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION;
- BootEncObj->WriteBootSectorUserConfig (userConfig, customUserMessage, prop.volumePim);
+ BootEncObj->WriteBootSectorUserConfig (userConfig, customUserMessage, prop.volumePim, prop.pkcs5);
}
SetDriverConfigurationFlag (TC_DRIVER_CONFIG_DISABLE_HARDWARE_ENCRYPTION, disableHW);
@@ -10766,7 +10827,8 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
{
case WM_INITDIALOG:
{
- if (!BootEncObj->GetStatus().DriveMounted)
+ BootEncryptionStatus BootEncStatus = BootEncObj->GetStatus();
+ if (!BootEncStatus.DriveMounted)
{
Warning ("SYS_DRIVE_NOT_ENCRYPTED", hwndDlg);
EndDialog (hwndDlg, IDCANCEL);
@@ -10780,27 +10842,38 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
uint32 driverConfig = ReadDriverConfigurationFlags();
byte userConfig;
string customUserMessage;
- uint16 bootLoaderVersion;
+ uint16 bootLoaderVersion = 0;
BOOL bPasswordCacheEnabled = (driverConfig & TC_DRIVER_CONFIG_CACHE_BOOT_PASSWORD)? TRUE : FALSE;
BOOL bPimCacheEnabled = (driverConfig & TC_DRIVER_CONFIG_CACHE_BOOT_PIM)? TRUE : FALSE;
- BootEncObj->ReadBootSectorConfig (nullptr, 0, &userConfig, &customUserMessage, &bootLoaderVersion);
+ if (!BootEncObj->ReadBootSectorConfig (nullptr, 0, &userConfig, &customUserMessage, &bootLoaderVersion))
+ {
+ // operations canceled
+ EndDialog (hwndDlg, IDCANCEL);
+ return 1;
+ }
if (bootLoaderVersion != VERSION_NUM)
Warning ("BOOT_LOADER_VERSION_INCORRECT_PREFERENCES", hwndDlg);
- SendMessage (GetDlgItem (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE), EM_LIMITTEXT, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, 0);
- SetDlgItemTextA (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE, customUserMessage.c_str());
+ if (bSystemIsGPT)
+ {
+ CheckDlgButton (hwndDlg, IDC_DISABLE_BOOT_LOADER_HASH_PROMPT, (userConfig & TC_BOOT_USER_CFG_FLAG_STORE_HASH) ? BST_CHECKED : BST_UNCHECKED);
+ }
+ else
+ {
+ SendMessage (GetDlgItem (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE), EM_LIMITTEXT, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH, 0);
+ SetDlgItemTextA (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE, customUserMessage.c_str());
+ CheckDlgButton (hwndDlg, IDC_DISABLE_BOOT_LOADER_OUTPUT, (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton (hwndDlg, IDC_ALLOW_ESC_PBA_BYPASS, (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton (hwndDlg, IDC_DISABLE_EVIL_MAID_ATTACK_DETECTION, (driverConfig & TC_DRIVER_CONFIG_DISABLE_EVIL_MAID_ATTACK_DETECTION) ? BST_CHECKED : BST_UNCHECKED);
+ SetWindowTextW (GetDlgItem (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP), GetString("CUSTOM_BOOT_LOADER_MESSAGE_HELP"));
+ }
CheckDlgButton (hwndDlg, IDC_DISABLE_BOOT_LOADER_PIM_PROMPT, (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton (hwndDlg, IDC_DISABLE_BOOT_LOADER_OUTPUT, (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton (hwndDlg, IDC_ALLOW_ESC_PBA_BYPASS, (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC) ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton (hwndDlg, IDC_BOOT_LOADER_CACHE_PASSWORD, bPasswordCacheEnabled ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton (hwndDlg, IDC_DISABLE_EVIL_MAID_ATTACK_DETECTION, (driverConfig & TC_DRIVER_CONFIG_DISABLE_EVIL_MAID_ATTACK_DETECTION) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow (GetDlgItem (hwndDlg, IDC_BOOT_LOADER_CACHE_PIM), bPasswordCacheEnabled);
CheckDlgButton (hwndDlg, IDC_BOOT_LOADER_CACHE_PIM, (bPasswordCacheEnabled && bPimCacheEnabled)? BST_CHECKED : BST_UNCHECKED);
-
- SetWindowTextW (GetDlgItem (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP), GetString("CUSTOM_BOOT_LOADER_MESSAGE_HELP"));
}
catch (Exception &e)
{
@@ -10840,13 +10913,15 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
return 1;
}
- char customUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1];
- GetDlgItemTextA (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE, customUserMessage, sizeof (customUserMessage));
+ char customUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1] = {0};
+ if (!bSystemIsGPT)
+ GetDlgItemTextA (hwndDlg, IDC_CUSTOM_BOOT_LOADER_MESSAGE, customUserMessage, sizeof (customUserMessage));
byte userConfig;
try
{
- BootEncObj->ReadBootSectorConfig (nullptr, 0, &userConfig);
+ if (!BootEncObj->ReadBootSectorConfig (nullptr, 0, &userConfig))
+ return 1;
}
catch (Exception &e)
{
@@ -10859,7 +10934,16 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
else
userConfig &= ~TC_BOOT_USER_CFG_FLAG_DISABLE_PIM;
- if (IsDlgButtonChecked (hwndDlg, IDC_DISABLE_BOOT_LOADER_OUTPUT))
+ if (bSystemIsGPT)
+ {
+ if (IsDlgButtonChecked (hwndDlg, IDC_DISABLE_BOOT_LOADER_HASH_PROMPT))
+ userConfig |= TC_BOOT_USER_CFG_FLAG_STORE_HASH;
+ else
+ userConfig &= ~TC_BOOT_USER_CFG_FLAG_STORE_HASH;
+ }
+ else
+ {
+ if (IsDlgButtonChecked (hwndDlg, IDC_DISABLE_BOOT_LOADER_OUTPUT))
userConfig |= TC_BOOT_USER_CFG_FLAG_SILENT_MODE;
else
userConfig &= ~TC_BOOT_USER_CFG_FLAG_SILENT_MODE;
@@ -10868,12 +10952,13 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
userConfig |= TC_BOOT_USER_CFG_FLAG_DISABLE_ESC;
else
userConfig &= ~TC_BOOT_USER_CFG_FLAG_DISABLE_ESC;
+ }
try
{
BOOL bPasswordCacheEnabled = IsDlgButtonChecked (hwndDlg, IDC_BOOT_LOADER_CACHE_PASSWORD);
BOOL bPimCacheEnabled = IsDlgButtonChecked (hwndDlg, IDC_BOOT_LOADER_CACHE_PIM);
- BootEncObj->WriteBootSectorUserConfig (userConfig, customUserMessage, prop.volumePim);
+ BootEncObj->WriteBootSectorUserConfig (userConfig, customUserMessage, prop.volumePim, prop.pkcs5);
SetDriverConfigurationFlag (TC_DRIVER_CONFIG_CACHE_BOOT_PASSWORD, bPasswordCacheEnabled);
SetDriverConfigurationFlag (TC_DRIVER_CONFIG_CACHE_BOOT_PIM, (bPasswordCacheEnabled && bPimCacheEnabled)? TRUE : FALSE);
SetDriverConfigurationFlag (TC_DRIVER_CONFIG_DISABLE_EVIL_MAID_ATTACK_DETECTION, IsDlgButtonChecked (hwndDlg, IDC_DISABLE_EVIL_MAID_ATTACK_DETECTION));
diff --git a/src/Mount/Mount.h b/src/Mount/Mount.h
index 3a2a4056..4a50ef3c 100644
--- a/src/Mount/Mount.h
+++ b/src/Mount/Mount.h
@@ -1,11 +1,11 @@
/*
Legal Notice: Some portions of the source code contained in this file were
- derived from the source code of TrueCrypt 7.1a, which is
- Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
+ derived from the source code of TrueCrypt 7.1a, which is
+ Copyright (c) 2003-2012 TrueCrypt Developers Association and which is
governed by the TrueCrypt License 3.0, also from the source code of
Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
- and which is governed by the 'License Agreement for Encryption for the Masses'
- Modifications and additions to the original source code (contained in this file)
+ and which is governed by the 'License Agreement for Encryption for the Masses'
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -99,7 +99,6 @@ static BOOL CheckMountList (HWND hwndDlg, BOOL bForceTaskBarUpdate);
int GetCipherBlockSizeByDriveNo (int nDosDriveNo);
int GetModeOfOperationByDriveNo (int nDosDriveNo);
void ChangeMainWindowVisibility ();
-void LaunchVolCreationWizard (HWND hwndDlg);
BOOL WholeSysDriveEncryption (BOOL bSilent);
BOOL CheckSysEncMountWithoutPBA (HWND hwndDlg, const wchar_t *devicePath, BOOL quiet);
BOOL TCBootLoaderOnInactiveSysEncDrive (wchar_t *szDevicePath);
diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc
index 6aa544fa..e5d90214 100644
--- a/src/Mount/Mount.rc
+++ b/src/Mount/Mount.rc
@@ -283,30 +283,23 @@ BEGIN
LTEXT "",IDT_PKCS11_LIB_HELP,16,63,286,65
END
-IDD_SYSENC_SETTINGS DIALOGEX 0, 0, 370, 286
+IDD_EFI_SYSENC_SETTINGS DIALOGEX 0, 0, 370, 139
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt - System Encryption Settings"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
- CONTROL "Do not &show any texts in the pre-boot authentication screen (except the below custom message)",IDC_DISABLE_BOOT_LOADER_OUTPUT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,37,339,9
- EDITTEXT IDC_CUSTOM_BOOT_LOADER_MESSAGE,18,67,216,14,ES_AUTOHSCROLL
CONTROL "&Cache pre-boot authentication password in driver memory (for mounting of non-system volumes)",IDC_BOOT_LOADER_CACHE_PASSWORD,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,192,339,10
- CONTROL "Allow pre-boot &authentication to be bypassed by pressing the Esc key (enables boot manager)",IDC_ALLOW_ESC_PBA_BYPASS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,222,340,10
- DEFPUSHBUTTON "OK",IDOK,257,262,50,14
- PUSHBUTTON "Cancel",IDCANCEL,313,262,50,14
- LTEXT "Display this custom message in the pre-boot authentication screen (24 characters maximum):",IDT_CUSTOM_BOOT_LOADER_MESSAGE,18,56,337,8
- GROUPBOX "Boot Loader Screen Options",IDT_BOOT_LOADER_SCREEN_OPTIONS,8,7,355,165
- GROUPBOX "Security Options",IDT_SECURITY_OPTIONS,8,177,355,75
- LTEXT "",IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP,18,89,337,73
- CONTROL "Disable ""Evil Maid"" attack detection",IDC_DISABLE_EVIL_MAID_ATTACK_DETECTION,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,237,340,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,79,339,10
+ DEFPUSHBUTTON "OK",IDOK,257,115,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,313,115,50,14
+ GROUPBOX "Boot Loader Screen Options",IDT_BOOT_LOADER_SCREEN_OPTIONS,8,7,355,53
+ GROUPBOX "Security Options",IDT_SECURITY_OPTIONS,8,64,355,44
CONTROL "Include PIM when caching pre-boot authentication password",IDC_BOOT_LOADER_CACHE_PIM,
- "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,18,207,340,10
+ "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,18,94,340,10
CONTROL "Do not request PIM in the pre-boot authentication screen (PIM value is stored unencrypted on disk)",IDC_DISABLE_BOOT_LOADER_PIM_PROMPT,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,20,339,9
+ CONTROL "Do not request Hash algorithm in the pre-boot authentication screen",IDC_DISABLE_BOOT_LOADER_HASH_PROMPT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,35,339,9
END
IDD_PERFORMANCE_SETTINGS DIALOGEX 0, 0, 370, 248
@@ -386,6 +379,31 @@ BEGIN
CONTROL "TrueCrypt Mode",IDC_TRUECRYPT_MODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,76,10
END
+IDD_SYSENC_SETTINGS DIALOGEX 0, 0, 370, 286
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "VeraCrypt - System Encryption Settings"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "Do not &show any texts in the pre-boot authentication screen (except the below custom message)",IDC_DISABLE_BOOT_LOADER_OUTPUT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,37,339,9
+ EDITTEXT IDC_CUSTOM_BOOT_LOADER_MESSAGE,18,67,216,14,ES_AUTOHSCROLL
+ CONTROL "&Cache pre-boot authentication password in driver memory (for mounting of non-system volumes)",IDC_BOOT_LOADER_CACHE_PASSWORD,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,192,339,10
+ CONTROL "Allow pre-boot &authentication to be bypassed by pressing the Esc key (enables boot manager)",IDC_ALLOW_ESC_PBA_BYPASS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,222,340,10
+ DEFPUSHBUTTON "OK",IDOK,257,262,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,313,262,50,14
+ LTEXT "Display this custom message in the pre-boot authentication screen (24 characters maximum):",IDT_CUSTOM_BOOT_LOADER_MESSAGE,18,56,337,8
+ GROUPBOX "Boot Loader Screen Options",IDT_BOOT_LOADER_SCREEN_OPTIONS,8,7,355,165
+ GROUPBOX "Security Options",IDT_SECURITY_OPTIONS,8,177,355,75
+ LTEXT "",IDC_CUSTOM_BOOT_LOADER_MESSAGE_HELP,18,89,337,73
+ CONTROL "Disable ""Evil Maid"" attack detection",IDC_DISABLE_EVIL_MAID_ATTACK_DETECTION,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,237,340,10
+ CONTROL "Include PIM when caching pre-boot authentication password",IDC_BOOT_LOADER_CACHE_PIM,
+ "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,18,207,340,10
+ CONTROL "Do not request PIM in the pre-boot authentication screen (PIM value is stored unencrypted on disk)",IDC_DISABLE_BOOT_LOADER_PIM_PROMPT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,20,339,9
+END
/////////////////////////////////////////////////////////////////////////////
//
@@ -393,7 +411,7 @@ END
//
#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
+GUIDELINES DESIGNINFO
BEGIN
IDD_PREFERENCES_DLG, DIALOG
BEGIN
@@ -455,12 +473,12 @@ BEGIN
BOTTOMMARGIN, 192
END
- IDD_SYSENC_SETTINGS, DIALOG
+ IDD_EFI_SYSENC_SETTINGS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 363
TOPMARGIN, 7
- BOTTOMMARGIN, 276
+ BOTTOMMARGIN, 129
END
IDD_PERFORMANCE_SETTINGS, DIALOG
@@ -486,6 +504,14 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 58
END
+
+ IDD_SYSENC_SETTINGS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 363
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 276
+ END
END
#endif // APSTUDIO_INVOKED
@@ -534,19 +560,19 @@ END
// TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"#include ""..\\\\common\\\\resource.h""\r\n"
"\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"#include ""..\\\\common\\\\common.rc""\r\n"
"\0"
@@ -572,7 +598,7 @@ IDB_SYS_DRIVEICON_MASK BITMAP "System_drive_icon_mask_96dpi.bm
// Menu
//
-IDR_MENU MENU
+IDR_MENU MENU
BEGIN
POPUP "&Volumes"
BEGIN
@@ -607,7 +633,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "Create Rescue Disk...", IDM_CREATE_RESCUE_DISK
MENUITEM "Verify Rescue Disk", IDM_VERIFY_RESCUE_DISK
- MENUITEM "Verify Rescue Disk ISO Image", IDM_VERIFY_RESCUE_DISK_ISO
+ MENUITEM "Verify Rescue Disk Image", IDM_VERIFY_RESCUE_DISK_ISO
MENUITEM SEPARATOR
MENUITEM "Mount Without Pre-Boot &Authentication...", IDM_MOUNT_SYSENC_PART_WITHOUT_PBA
MENUITEM SEPARATOR
@@ -691,7 +717,7 @@ END
// String Table
//
-STRINGTABLE
+STRINGTABLE
BEGIN
IDS_UACSTRING "VeraCrypt"
END
diff --git a/src/Mount/Mount.vcxproj b/src/Mount/Mount.vcxproj
new file mode 100644
index 00000000..8e7d894d
--- /dev/null
+++ b/src/Mount/Mount.vcxproj
@@ -0,0 +1,445 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{E4C40F94-E7F9-4981-86E4-186B46F993F3}</ProjectGuid>
+ <RootNamespace>Mount</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">VeraCrypt</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">VeraCrypt</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">VeraCrypt</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">VeraCrypt</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TCMOUNT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <BrowseInformation>
+ </BrowseInformation>
+ <BrowseInformationFile>
+ </BrowseInformationFile>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)Mount.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Mount.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>md "..\Debug\Setup Files" 2&gt;NUL:
+copy Debug\VeraCrypt.exe "..\Debug\Setup Files" &gt;NUL:
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TCMOUNT;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <BrowseInformation>
+ </BrowseInformation>
+ <BrowseInformationFile>
+ </BrowseInformationFile>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\x64\Debug\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)Mount.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Mount.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>md "..\Debug\Setup Files" 2&gt;NUL:
+copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-x64.exe" &gt;NUL:
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Mount.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>copy Release\VeraCrypt.exe "..\Release\Setup Files"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(SolutionDir)/$(ProjectName)/$(ProjectName).tlb</TypeLibraryName>
+ <OutputDirectory>
+ </OutputDirectory>
+ </Midl>
+ <ClCompile>
+ <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TCMOUNT;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>..\Crypto\x64\Release\crypto.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCrypt.exe</OutputFile>
+ <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
+ <DelayLoadDLLs>mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Mount.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCrypt-x64.exe"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Common\XUnzip.cpp" />
+ <ClCompile Include="..\Common\XZip.cpp" />
+ <ClCompile Include="Favorites.cpp" />
+ <ClCompile Include="Hotkeys.c" />
+ <ClCompile Include="MainCom.cpp" />
+ <ClCompile Include="Mount.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\BaseCom.cpp" />
+ <ClCompile Include="..\Common\BootEncryption.cpp" />
+ <ClCompile Include="..\Common\Cmdline.c" />
+ <ClCompile Include="..\Common\Combo.c" />
+ <ClCompile Include="..\Common\Crc.c" />
+ <ClCompile Include="..\Common\Crypto.c" />
+ <ClCompile Include="..\Common\Dictionary.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c" />
+ <ClCompile Include="..\Common\Endian.c" />
+ <ClCompile Include="..\Common\GfMul.c" />
+ <ClCompile Include="..\Common\Keyfiles.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Language.c" />
+ <ClCompile Include="..\Common\Password.c" />
+ <ClCompile Include="..\Common\Pkcs5.c" />
+ <ClCompile Include="..\Common\Random.c" />
+ <ClCompile Include="..\Common\Registry.c" />
+ <ClCompile Include="..\Common\SecurityToken.cpp" />
+ <ClCompile Include="..\Common\Tests.c" />
+ <ClCompile Include="..\Common\Volumes.c" />
+ <ClCompile Include="..\Common\Wipe.c" />
+ <ClCompile Include="..\Common\Xml.c" />
+ <ClCompile Include="..\Common\Xts.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <Midl Include="MainCom.idl" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Wipe.h" />
+ <ClInclude Include="..\Common\Apidrvr.h" />
+ <ClInclude Include="..\Common\BaseCom.h" />
+ <ClInclude Include="..\Common\BootEncryption.h" />
+ <ClInclude Include="..\Common\Cmdline.h" />
+ <ClInclude Include="..\Common\Combo.h" />
+ <ClInclude Include="..\Common\Common.h" />
+ <ClInclude Include="..\Common\Crc.h" />
+ <ClInclude Include="..\Common\Crypto.h" />
+ <ClInclude Include="..\Common\Dictionary.h" />
+ <ClInclude Include="..\Common\Dlgcode.h" />
+ <ClInclude Include="..\Common\EncryptionThreadPool.h" />
+ <ClInclude Include="..\Common\Exception.h" />
+ <ClInclude Include="..\Common\XUnzip.h" />
+ <ClInclude Include="..\Common\XZip.h" />
+ <ClInclude Include="Favorites.h" />
+ <ClInclude Include="..\Common\GfMul.h" />
+ <ClInclude Include="Hotkeys.h" />
+ <ClInclude Include="..\Common\Keyfiles.h" />
+ <ClInclude Include="..\Common\Language.h" />
+ <ClInclude Include="MainCom.h" />
+ <ClInclude Include="Mount.h" />
+ <ClInclude Include="..\Common\Password.h" />
+ <ClInclude Include="..\Common\Pkcs5.h" />
+ <ClInclude Include="..\Common\Random.h" />
+ <ClInclude Include="..\Common\Registry.h" />
+ <ClInclude Include="..\Common\Resource.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="..\Common\SecurityToken.h" />
+ <ClInclude Include="..\Common\Tcdefs.h" />
+ <ClInclude Include="..\Common\Tests.h" />
+ <ClInclude Include="..\Common\Volumes.h" />
+ <ClInclude Include="..\Common\Xml.h" />
+ <ClInclude Include="..\Common\Xts.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\Boot\Windows\Release_Camellia\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Camellia_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Camellia\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Camellia_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_AES_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_SHA2\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin" />
+ <None Include="Drive_icon_96dpi.bmp" />
+ <None Include="Drive_icon_mask_96dpi.bmp" />
+ <None Include="Logo_288dpi.bmp" />
+ <None Include="Logo_96dpi.bmp" />
+ <None Include="Mount.tlb" />
+ <None Include="System_drive_icon_96dpi.bmp" />
+ <None Include="System_drive_icon_mask_96dpi.bmp" />
+ <None Include="..\Common\VeraCrypt_mounted.ico" />
+ <None Include="..\Common\VeraCrypt_volume.ico" />
+ <None Include="..\Boot\Windows\Release_Serpent\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Release_AES\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Release\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Release_Twofish\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue_AES\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz" />
+ <None Include="..\Boot\Windows\Rescue\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Twofish\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_Serpent\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_AES\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release\BootSector.bin" />
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release_AES\BootSector.bin" />
+ <None Include="..\Boot\Windows\Release\Decompressor.com" />
+ <None Include="..\Common\Language.xml" />
+ <None Include="..\Resources\Texts\License.rtf" />
+ <None Include="..\Common\Textual_logo_288dpi.bmp" />
+ <None Include="..\Common\Textual_logo_96dpi.bmp" />
+ <None Include="..\Common\Textual_logo_background.bmp" />
+ <None Include="..\Common\VeraCrypt.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="Mount.manifest" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Mount.rc" />
+ <ResourceCompile Include="..\Common\Common.rc">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Boot\Windows\Boot.vcxproj">
+ <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Crypto\Crypto.vcxproj">
+ <Project>{993245cf-6b70-47ee-91bb-39f8fc6dc0e7}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Driver\Driver.vcxproj">
+ <Project>{ef5ef444-18d0-40d7-8dfa-775ec4448602}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Format\Format.vcxproj">
+ <Project>{9dc1abe2-d18b-48fb-81d2-8c50adc57bcf}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/Mount/Mount.vcxproj.filters b/src/Mount/Mount.vcxproj.filters
new file mode 100644
index 00000000..fcc9445e
--- /dev/null
+++ b/src/Mount/Mount.vcxproj.filters
@@ -0,0 +1,368 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Source Files\Common">
+ <UniqueIdentifier>{8f7b640f-31e5-4198-be7c-09501ffebedf}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
+ </Filter>
+ <Filter Include="Resource Files\Common">
+ <UniqueIdentifier>{f805ede6-c210-4210-95ce-e33edb12bc27}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="Favorites.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Hotkeys.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MainCom.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Mount.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\BaseCom.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\BootEncryption.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Cmdline.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Combo.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crc.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crypto.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dictionary.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Endian.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\GfMul.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Keyfiles.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Language.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Password.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Pkcs5.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Random.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Registry.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\SecurityToken.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Tests.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Volumes.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Wipe.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xml.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xts.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XZip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XUnzip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <Midl Include="MainCom.idl">
+ <Filter>Source Files</Filter>
+ </Midl>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Wipe.h">
+ <Filter>Source Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Apidrvr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\BaseCom.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\BootEncryption.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Cmdline.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Combo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Common.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Crc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Crypto.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Dictionary.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Dlgcode.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\EncryptionThreadPool.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Exception.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Favorites.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\GfMul.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Hotkeys.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Keyfiles.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Language.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MainCom.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Mount.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Password.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Pkcs5.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Random.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Registry.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\SecurityToken.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tcdefs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tests.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Volumes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Xml.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Xts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XZip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XUnzip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\Boot\Windows\Rescue_Serpent_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_AES_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Twofish_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Serpent_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_AES_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Twofish_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Drive_icon_96dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Drive_icon_mask_96dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Logo_288dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Logo_96dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Mount.tlb">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="System_drive_icon_96dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="System_drive_icon_mask_96dpi.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt_mounted.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt_volume.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Serpent\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_AES\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Twofish\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_AES\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootLoader.com.gz">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Twofish\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Serpent\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Serpent\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_AES\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Twofish\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_AES\BootSector.bin">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release\Decompressor.com">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Language.xml">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Resources\Texts\License.rtf">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_288dpi.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_96dpi.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_background.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt.ico">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Camellia\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Release_Camellia_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Camellia\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Boot\Windows\Rescue_Camellia_SHA2\BootSector.bin">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="Mount.manifest">
+ <Filter>Resource Files</Filter>
+ </Manifest>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Mount.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="..\Common\Common.rc">
+ <Filter>Resource Files\Common</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/Mount/Mount.vcxproj.user b/src/Mount/Mount.vcxproj.user
new file mode 100644
index 00000000..ace9a86a
--- /dev/null
+++ b/src/Mount/Mount.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project> \ No newline at end of file
diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h
index 3d93d81f..12860915 100644
--- a/src/Mount/Resource.h
+++ b/src/Mount/Resource.h
@@ -21,6 +21,7 @@
#define IDD_SYSENC_SETTINGS 116
#define IDD_FAVORITE_VOLUMES 117
#define IDD_DEFAULT_MOUNT_PARAMETERS 118
+#define IDD_EFI_SYSENC_SETTINGS 119
#define IDC_PREF_MOUNT_READONLY 1000
#define IDC_PREF_MOUNT_REMOVABLE 1001
#define IDC_VERIFY 1002
@@ -179,8 +180,9 @@
#define IDT_VOLUME_ID 1157
#define IDC_FAVORITE_VOLUME_ID 1158
#define IDC_FAVORITE_USE_VOLUME_ID 1159
-#define IDC_DISABLE_BOOT_LOADER_PIM_PROMPT 1160
+#define IDC_DISABLE_BOOT_LOADER_PIM_PROMPT 1160
#define IDC_HIDE_WAITING_DIALOG 1161
+#define IDC_DISABLE_BOOT_LOADER_HASH_PROMPT 1162
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
@@ -251,13 +253,13 @@
#define IDM_VERIFY_RESCUE_DISK_ISO 40068
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 119
+#define _APS_NEXT_RESOURCE_VALUE 120
#define _APS_NEXT_COMMAND_VALUE 40069
-#define _APS_NEXT_CONTROL_VALUE 1162
+#define _APS_NEXT_CONTROL_VALUE 1163
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/src/Readme.txt b/src/Readme.txt
index 97678b5d..017cc966 100644
--- a/src/Readme.txt
+++ b/src/Readme.txt
@@ -43,9 +43,9 @@ I. Windows
Requirements for Building VeraCrypt for Windows:
------------------------------------------------
-- Microsoft Visual C++ 2008 SP1 (Professional Edition or compatible)
+- Microsoft Visual C++ 2010 SP1 (Professional Edition or compatible)
- Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads)
-- Microsoft Windows SDK for Windows 7 (configured for Visual C++)
+- Microsoft Windows SDK for Windows 7.1 (configured for Visual C++ 2010)
- Microsoft Windows SDK for Windows 8.1 (needed for SHA-256 code signing)
- Microsoft Windows Driver Kit 7.1.0 (build 7600.16385.1)
- RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20
@@ -94,7 +94,7 @@ Instructions for Building VeraCrypt for Windows:
environment variable 'PKCS11_INC' pointing to the directory where
the PKCS #11 header files are installed.
-4) Open the solution file 'VeraCrypt.sln' in Microsoft Visual Studio 2008.
+4) Open the solution file 'VeraCrypt.sln' in Microsoft Visual Studio 2010.
5) Select 'All' as the active solution configuration.
@@ -199,7 +199,7 @@ The script build_veracrypt_macosx.sh available under "src/Build" performs the
full build of VeraCrypt including the creation of the installer pkg. It expects
to find the wxWidgets 3.0.2 sources at the same level as where you put
VeraCrypt sources (i.e. if "src" path is "/Users/joe/Projects/VeraCrypt/src"
-then wxWidgets should be at "/Users/joe/Projects/wxWidgets-wxWidgets-3.0.2")
+then wxWidgets should be at "/Users/joe/Projects/wxWidgets-3.0.2")
The build process uses Code Signing certificates whose ID is specified in
src/Main/Main.make (lines 167 & 169). You'll have to modify these lines to put
@@ -262,4 +262,3 @@ VI. Further Information
=======================
http://www.veracrypt.fr
-
diff --git a/src/Setup/ComSetup.cpp b/src/Setup/ComSetup.cpp
index 1b3220d9..7fe3ef49 100644
--- a/src/Setup/ComSetup.cpp
+++ b/src/Setup/ComSetup.cpp
@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
- Modifications and additions to the original source code (contained in this file)
+ Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -11,10 +11,10 @@
*/
#define TC_MAIN_COM_VERSION_MAJOR 2
-#define TC_MAIN_COM_VERSION_MINOR 7
+#define TC_MAIN_COM_VERSION_MINOR 8
#define TC_FORMAT_COM_VERSION_MAJOR 2
-#define TC_FORMAT_COM_VERSION_MINOR 5
+#define TC_FORMAT_COM_VERSION_MINOR 6
#include <atlbase.h>
#include <comdef.h>
@@ -39,9 +39,11 @@ extern "C" BOOL RegisterComServers (wchar_t *modulePath)
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR, 0, SYS_WIN32);
// unregister older versions that may still exist
+ UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-4, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-3, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-2, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-1, 0, SYS_WIN32);
+ UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-2, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-1, 0, SYS_WIN32);
wchar_t setupModule[MAX_PATH];
@@ -78,9 +80,12 @@ extern "C" BOOL UnregisterComServers (wchar_t *modulePath)
return FALSE;
// unregister older versions that may still exist
+ UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-4, 0, SYS_WIN32);
+ UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-3, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-3, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-2, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptMainCom, TC_MAIN_COM_VERSION_MAJOR, TC_MAIN_COM_VERSION_MINOR-1, 0, SYS_WIN32);
+ UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-2, 0, SYS_WIN32);
UnRegisterTypeLib (LIBID_TrueCryptFormatCom, TC_FORMAT_COM_VERSION_MAJOR, TC_FORMAT_COM_VERSION_MINOR-1, 0, SYS_WIN32);
wchar_t module[1024];
diff --git a/src/Setup/Setup.vcxproj b/src/Setup/Setup.vcxproj
new file mode 100644
index 00000000..c319dc1f
--- /dev/null
+++ b/src/Setup/Setup.vcxproj
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{DF5F654D-BD44-4E31-B92E-B68074DC37A8}</ProjectGuid>
+ <RootNamespace>Setup</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+ <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</EmbedManifest>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">VeraCryptSetup</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">VeraCryptSetup</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SETUP;WIN32;DEBUG;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4505;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/NODEFAULTLIB:LIBCMTD %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>libcmtd.lib;atlsd.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptSetup.exe</OutputFile>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)Setup.pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>md "..\Debug\Setup Files" 2&gt;NUL:
+copy Debug\VeraCryptSetup.exe "..\Debug\Setup Files\VeraCrypt Setup.exe" &gt;NUL:
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalOptions>/w34189 %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <AdditionalIncludeDirectories>..\Common;..\Crypto;..\;..\PKCS11;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>SETUP;WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NON_CONFORMING_SWPRINTFS;_ATL_NO_DEFAULT_LIBS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerOutput>All</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>
+ </DebugInformationFormat>
+ <DisableSpecificWarnings>4057;4100;4127;4201;4505;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)VeraCryptSetup.exe</OutputFile>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ <DelayLoadDLLs>user32.dll;gdi32.dll;advapi32.dll;shell32.dll;ole32.dll;oleaut32.dll;mpr.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <GenerateMapFile>true</GenerateMapFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>true</DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>Setup.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>copy Release\VeraCryptSetup.exe "..\Release\Setup Files\VeraCrypt Setup.exe"</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Common\XUnzip.cpp" />
+ <ClCompile Include="..\Common\XZip.cpp" />
+ <ClCompile Include="ComSetup.cpp" />
+ <ClCompile Include="Dir.c" />
+ <ClCompile Include="SelfExtract.c" />
+ <ClCompile Include="Setup.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="Wizard.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xml.c" />
+ <ClCompile Include="..\Common\BootEncryption.cpp" />
+ <ClCompile Include="..\Common\Crc.c" />
+ <ClCompile Include="..\Common\Dictionary.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CompileAsCpp</CompileAs>
+ <CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
+ </ClCompile>
+ <ClCompile Include="..\Common\Endian.c" />
+ <ClCompile Include="..\Common\Inflate.c" />
+ <ClCompile Include="..\Common\Language.c" />
+ <ClCompile Include="..\Common\Registry.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ComSetup.rgs" />
+ <None Include="Setup.ico" />
+ <None Include="..\Common\VeraCrypt.ico" />
+ <None Include="VeraCrypt_setup.bmp" />
+ <None Include="VeraCrypt_setup_background.bmp" />
+ <None Include="..\Common\VeraCrypt_Volume.ico" />
+ <None Include="..\Common\Language.xml" />
+ <None Include="..\Resources\Texts\License.rtf" />
+ <None Include="..\Common\Textual_logo_288dpi.bmp" />
+ <None Include="..\Common\Textual_logo_96dpi.bmp" />
+ <None Include="..\Common\Textual_logo_background.bmp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Apidrvr.h" />
+ <ClInclude Include="..\Common\Combo.h" />
+ <ClInclude Include="..\Common\XUnzip.h" />
+ <ClInclude Include="..\Common\XZip.h" />
+ <ClInclude Include="ComSetup.h" />
+ <ClInclude Include="..\Common\Crc.h" />
+ <ClInclude Include="Dir.h" />
+ <ClInclude Include="..\Common\Dlgcode.h" />
+ <ClInclude Include="..\Common\Exception.h" />
+ <ClInclude Include="..\Common\Inflate.h" />
+ <ClInclude Include="..\Common\Language.h" />
+ <ClInclude Include="..\Common\Registry.h" />
+ <ClInclude Include="..\Common\Resource.h" />
+ <ClInclude Include="Resource.h" />
+ <ClInclude Include="SelfExtract.h" />
+ <ClInclude Include="Setup.h" />
+ <ClInclude Include="..\Common\Tcdefs.h" />
+ <ClInclude Include="Wizard.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="Setup.manifest" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Setup.rc" />
+ <ResourceCompile Include="..\Common\Common.rc">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Boot\Windows\Boot.vcxproj">
+ <Project>{8b7f059f-e4c7-4e11-88f5-ee8b8433072e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\ExpandVolume\ExpandVolume.vcxproj">
+ <Project>{9715ff1d-599b-4bbc-ad96-bef6e08ff827}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Format\Format.vcxproj">
+ <Project>{9dc1abe2-d18b-48fb-81d2-8c50adc57bcf}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\Mount\Mount.vcxproj">
+ <Project>{e4c40f94-e7f9-4981-86e4-186b46f993f3}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/Setup/Setup.vcxproj.filters b/src/Setup/Setup.vcxproj.filters
new file mode 100644
index 00000000..6f288370
--- /dev/null
+++ b/src/Setup/Setup.vcxproj.filters
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Source Files\Common">
+ <UniqueIdentifier>{6073052c-2d95-47a0-95d8-5960d4c1d1c0}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
+ </Filter>
+ <Filter Include="Resource Files\Common">
+ <UniqueIdentifier>{a540fb0a-850b-4cb9-85f9-ade0112ebb50}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="ComSetup.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Dir.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SelfExtract.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Setup.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Wizard.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xml.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\BootEncryption.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crc.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dictionary.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Dlgcode.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Endian.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Inflate.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Language.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Registry.c">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XZip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\XUnzip.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ComSetup.rgs">
+ <Filter>Source Files</Filter>
+ </None>
+ <None Include="Setup.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="VeraCrypt_setup.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="VeraCrypt_setup_background.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\VeraCrypt_Volume.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="..\Common\Language.xml">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Resources\Texts\License.rtf">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_288dpi.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_96dpi.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ <None Include="..\Common\Textual_logo_background.bmp">
+ <Filter>Resource Files\Common</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Common\Apidrvr.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Combo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ComSetup.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Crc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Dir.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Dlgcode.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Exception.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Inflate.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Language.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Registry.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SelfExtract.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Setup.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\Tcdefs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Wizard.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XZip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Common\XUnzip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <Manifest Include="Setup.manifest">
+ <Filter>Resource Files</Filter>
+ </Manifest>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Setup.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="..\Common\Common.rc">
+ <Filter>Resource Files\Common</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/Setup/Setup.vcxproj.user b/src/Setup/Setup.vcxproj.user
new file mode 100644
index 00000000..ace9a86a
--- /dev/null
+++ b/src/Setup/Setup.vcxproj.user
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project> \ No newline at end of file
diff --git a/src/VeraCrypt.sln b/src/VeraCrypt.sln
index c5b77d86..69731bd8 100644
--- a/src/VeraCrypt.sln
+++ b/src/VeraCrypt.sln
@@ -1,47 +1,18 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Crypto", "Crypto\Crypto.vcproj", "{993245CF-6B70-47EE-91BB-39F8FC6DC0E7}"
- ProjectSection(ProjectDependencies) = postProject
- {8B7F059F-E4C7-4E11-88F5-EE8B8433072E} = {8B7F059F-E4C7-4E11-88F5-EE8B8433072E}
- EndProjectSection
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Crypto", "Crypto\Crypto.vcxproj", "{993245CF-6B70-47EE-91BB-39F8FC6DC0E7}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Driver", "Driver\Driver.vcproj", "{EF5EF444-18D0-40D7-8DFA-775EC4448602}"
- ProjectSection(ProjectDependencies) = postProject
- {8B7F059F-E4C7-4E11-88F5-EE8B8433072E} = {8B7F059F-E4C7-4E11-88F5-EE8B8433072E}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Driver", "Driver\Driver.vcxproj", "{EF5EF444-18D0-40D7-8DFA-775EC4448602}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Format", "Format\Format.vcproj", "{9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF}"
- ProjectSection(ProjectDependencies) = postProject
- {EF5EF444-18D0-40D7-8DFA-775EC4448602} = {EF5EF444-18D0-40D7-8DFA-775EC4448602}
- {8B7F059F-E4C7-4E11-88F5-EE8B8433072E} = {8B7F059F-E4C7-4E11-88F5-EE8B8433072E}
- {993245CF-6B70-47EE-91BB-39F8FC6DC0E7} = {993245CF-6B70-47EE-91BB-39F8FC6DC0E7}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Format", "Format\Format.vcxproj", "{9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mount", "Mount\Mount.vcproj", "{E4C40F94-E7F9-4981-86E4-186B46F993F3}"
- ProjectSection(ProjectDependencies) = postProject
- {EF5EF444-18D0-40D7-8DFA-775EC4448602} = {EF5EF444-18D0-40D7-8DFA-775EC4448602}
- {8B7F059F-E4C7-4E11-88F5-EE8B8433072E} = {8B7F059F-E4C7-4E11-88F5-EE8B8433072E}
- {993245CF-6B70-47EE-91BB-39F8FC6DC0E7} = {993245CF-6B70-47EE-91BB-39F8FC6DC0E7}
- {9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF} = {9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mount", "Mount\Mount.vcxproj", "{E4C40F94-E7F9-4981-86E4-186B46F993F3}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Setup", "Setup\Setup.vcproj", "{DF5F654D-BD44-4E31-B92E-B68074DC37A8}"
- ProjectSection(ProjectDependencies) = postProject
- {9715FF1D-599B-4BBC-AD96-BEF6E08FF827} = {9715FF1D-599B-4BBC-AD96-BEF6E08FF827}
- {E4C40F94-E7F9-4981-86E4-186B46F993F3} = {E4C40F94-E7F9-4981-86E4-186B46F993F3}
- {8B7F059F-E4C7-4E11-88F5-EE8B8433072E} = {8B7F059F-E4C7-4E11-88F5-EE8B8433072E}
- {9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF} = {9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Setup", "Setup\Setup.vcxproj", "{DF5F654D-BD44-4E31-B92E-B68074DC37A8}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Boot", "Boot\Windows\Boot.vcproj", "{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Boot", "Boot\Windows\Boot.vcxproj", "{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExpandVolume", "ExpandVolume\ExpandVolume.vcproj", "{9715FF1D-599B-4BBC-AD96-BEF6E08FF827}"
- ProjectSection(ProjectDependencies) = postProject
- {EF5EF444-18D0-40D7-8DFA-775EC4448602} = {EF5EF444-18D0-40D7-8DFA-775EC4448602}
- {E4C40F94-E7F9-4981-86E4-186B46F993F3} = {E4C40F94-E7F9-4981-86E4-186B46F993F3}
- {8B7F059F-E4C7-4E11-88F5-EE8B8433072E} = {8B7F059F-E4C7-4E11-88F5-EE8B8433072E}
- {9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF} = {9DC1ABE2-D18B-48FB-81D2-8C50ADC57BCF}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExpandVolume", "ExpandVolume\ExpandVolume.vcxproj", "{9715FF1D-599B-4BBC-AD96-BEF6E08FF827}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/Volume/Cipher.cpp b/src/Volume/Cipher.cpp
index 4acea91e..69449088 100644
--- a/src/Volume/Cipher.cpp
+++ b/src/Volume/Cipher.cpp
@@ -15,9 +15,13 @@
#include "Crypto/Aes.h"
#include "Crypto/Serpent.h"
#include "Crypto/Twofish.h"
+#include "Crypto/Camellia.h"
+#include "Crypto/GostCipher.h"
+#include "Crypto/kuznyechik.h"
#ifdef TC_AES_HW_CPU
# include "Crypto/Aes_hw_cpu.h"
+# include "Crypto/cpu.h"
#endif
namespace VeraCrypt
@@ -77,6 +81,9 @@ namespace VeraCrypt
l.push_back (shared_ptr <Cipher> (new CipherAES ()));
l.push_back (shared_ptr <Cipher> (new CipherSerpent ()));
l.push_back (shared_ptr <Cipher> (new CipherTwofish ()));
+ l.push_back (shared_ptr <Cipher> (new CipherCamellia ()));
+ l.push_back (shared_ptr <Cipher> (new CipherGost89 ()));
+ l.push_back (shared_ptr <Cipher> (new CipherKuznyechik ()));
return l;
}
@@ -179,7 +186,7 @@ namespace VeraCrypt
if (!stateValid)
{
- state = is_aes_hw_cpu_supported() ? true : false;
+ state = g_hasAESNI ? true : false;
stateValid = true;
}
return state && HwSupportEnabled;
@@ -239,7 +246,68 @@ namespace VeraCrypt
{
twofish_set_key ((TwofishInstance *) ScheduledKey.Ptr(), (unsigned int *) key);
}
+
+ // Camellia
+ void CipherCamellia::Decrypt (byte *data) const
+ {
+ camellia_decrypt (data, data, ScheduledKey.Ptr());
+ }
+ void CipherCamellia::Encrypt (byte *data) const
+ {
+ camellia_encrypt (data, data, ScheduledKey.Ptr());
+ }
+ size_t CipherCamellia::GetScheduledKeySize () const
+ {
+ return CAMELLIA_KS;
+ }
+
+ void CipherCamellia::SetCipherKey (const byte *key)
+ {
+ camellia_set_key (key, ScheduledKey.Ptr());
+ }
+
+ // GOST89
+ void CipherGost89::Decrypt (byte *data) const
+ {
+ gost_decrypt (data, data, (gost_kds *) ScheduledKey.Ptr(), 1);
+ }
+
+ void CipherGost89::Encrypt (byte *data) const
+ {
+ gost_encrypt (data, data, (gost_kds *) ScheduledKey.Ptr(), 1);
+ }
+
+ size_t CipherGost89::GetScheduledKeySize () const
+ {
+ return GOST_KS;
+ }
+
+ void CipherGost89::SetCipherKey (const byte *key)
+ {
+ gost_set_key (key, (gost_kds *) ScheduledKey.Ptr());
+ }
+
+ // Kuznyechik
+ void CipherKuznyechik::Decrypt (byte *data) const
+ {
+ kuznyechik_decrypt_block (data, data, (kuznyechik_kds *) ScheduledKey.Ptr());
+ }
+
+ void CipherKuznyechik::Encrypt (byte *data) const
+ {
+ kuznyechik_encrypt_block (data, data, (kuznyechik_kds *) ScheduledKey.Ptr());
+ }
+
+ size_t CipherKuznyechik::GetScheduledKeySize () const
+ {
+ return KUZNYECHIK_KS;
+ }
+
+ void CipherKuznyechik::SetCipherKey (const byte *key)
+ {
+ kuznyechik_set_key (key, (kuznyechik_kds *) ScheduledKey.Ptr());
+ }
bool Cipher::HwSupportEnabled = true;
}
diff --git a/src/Volume/Cipher.h b/src/Volume/Cipher.h
index 866a2c2c..28e0bd7f 100644
--- a/src/Volume/Cipher.h
+++ b/src/Volume/Cipher.h
@@ -106,6 +106,9 @@ namespace VeraCrypt
TC_CIPHER (Serpent, 16, 32);
TC_CIPHER (Twofish, 16, 32);
+ TC_CIPHER (Camellia, 16, 32);
+ TC_CIPHER (Gost89, 16, 32);
+ TC_CIPHER (Kuznyechik, 16, 32);
#undef TC_CIPHER
diff --git a/src/Volume/EncryptionAlgorithm.cpp b/src/Volume/EncryptionAlgorithm.cpp
index 77ed8807..119b5539 100644
--- a/src/Volume/EncryptionAlgorithm.cpp
+++ b/src/Volume/EncryptionAlgorithm.cpp
@@ -64,6 +64,9 @@ namespace VeraCrypt
l.push_back (shared_ptr <EncryptionAlgorithm> (new AES ()));
l.push_back (shared_ptr <EncryptionAlgorithm> (new Serpent ()));
l.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
+ l.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
+ l.push_back (shared_ptr <EncryptionAlgorithm> (new GOST89 ()));
+ l.push_back (shared_ptr <EncryptionAlgorithm> (new Kuznyechik ()));
l.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
l.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
l.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
@@ -284,4 +287,29 @@ namespace VeraCrypt
SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
}
+
+ // Camellia
+ Camellia::Camellia ()
+ {
+ Ciphers.push_back (shared_ptr <Cipher> (new CipherCamellia()));
+
+ SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
+ }
+
+
+ // GOST89
+ GOST89::GOST89 ()
+ {
+ Ciphers.push_back (shared_ptr <Cipher> (new CipherGost89()));
+
+ SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
+ }
+
+ // Kuznyechik
+ Kuznyechik::Kuznyechik ()
+ {
+ Ciphers.push_back (shared_ptr <Cipher> (new CipherKuznyechik()));
+
+ SupportedModes.push_back (shared_ptr <EncryptionMode> (new EncryptionModeXTS ()));
+ }
}
diff --git a/src/Volume/EncryptionAlgorithm.h b/src/Volume/EncryptionAlgorithm.h
index f61358a2..ff1b128f 100644
--- a/src/Volume/EncryptionAlgorithm.h
+++ b/src/Volume/EncryptionAlgorithm.h
@@ -85,6 +85,9 @@ namespace VeraCrypt
TC_ENCRYPTION_ALGORITHM (Twofish);
TC_ENCRYPTION_ALGORITHM (TwofishSerpent);
TC_ENCRYPTION_ALGORITHM (SerpentTwofishAES);
+ TC_ENCRYPTION_ALGORITHM (Camellia);
+ TC_ENCRYPTION_ALGORITHM (GOST89);
+ TC_ENCRYPTION_ALGORITHM (Kuznyechik);
#undef TC_ENCRYPTION_ALGORITHM
}
diff --git a/src/Volume/EncryptionTest.cpp b/src/Volume/EncryptionTest.cpp
index 26b5deab..eed8bd15 100644
--- a/src/Volume/EncryptionTest.cpp
+++ b/src/Volume/EncryptionTest.cpp
@@ -95,6 +95,34 @@ namespace VeraCrypt
}
}
};
+
+ static const CipherTestVector CamelliaTestVectors[] =
+ {
+ {
+ {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
+ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
+ },
+ {
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10
+ },
+ {
+ 0x9A, 0xCC, 0x23, 0x7D, 0xFF, 0x16, 0xD7, 0x6C, 0x20, 0xEF, 0x7C, 0x91, 0x9E, 0x3A, 0x75, 0x09
+ }
+ },
+ {
+ {
+ 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, 0xFF, 0x48,
+ 0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00, 0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, 0xFF, 0x48
+ },
+ {
+ 0xE6, 0x84, 0x42, 0x17, 0x16, 0xFC, 0x0B, 0x01, 0xAE, 0xB5, 0xC6, 0x76, 0x51, 0x20, 0xF9, 0x5F
+ },
+ {
+ 0xEA, 0x02, 0x47, 0x14, 0xAD, 0x5C, 0x4D, 0x84, 0xEA, 0x02, 0x47, 0x14, 0xAD, 0x5C, 0x4D, 0x84
+ }
+ }
+ };
static void TestCipher (Cipher &cipher, const CipherTestVector *testVector, size_t testVectorCount)
{
@@ -139,6 +167,9 @@ namespace VeraCrypt
CipherTwofish twofish;
TestCipher (twofish, TwofishTestVectors, array_capacity (TwofishTestVectors));
+
+ CipherCamellia camellia;
+ TestCipher (camellia, CamelliaTestVectors, array_capacity (CamelliaTestVectors));
}
const EncryptionTest::XtsTestVector EncryptionTest::XtsTestVectors[] =
@@ -546,6 +577,32 @@ namespace VeraCrypt
break;
}
}
+ else if (typeid (ea) == typeid (Camellia))
+ {
+ switch (testCase)
+ {
+ case 0:
+ if (crc != 0x2436badb)
+ throw TestFailed (SRC_POS);
+ nTestsPerformed++;
+ break;
+ case 1:
+ if (crc != 0x247d2272)
+ throw TestFailed (SRC_POS);
+ nTestsPerformed++;
+ break;
+ case 2:
+ if (crc != 0x72b49cde)
+ throw TestFailed (SRC_POS);
+ nTestsPerformed++;
+ break;
+ case 3:
+ if (crc != 0xb838d2c1)
+ throw TestFailed (SRC_POS);
+ nTestsPerformed++;
+ break;
+ }
+ }
else if (typeid (ea) == typeid (AESTwofish))
{
switch (testCase)
@@ -742,6 +799,12 @@ namespace VeraCrypt
throw TestFailed (SRC_POS);
nTestsPerformed++;
}
+ else if (typeid (ea) == typeid (Camellia))
+ {
+ if (crc != 0x8176b223)
+ throw TestFailed (SRC_POS);
+ nTestsPerformed++;
+ }
else if (typeid (ea) == typeid (AESTwofish))
{
if (crc != 0x14ce7385)
@@ -784,7 +847,7 @@ namespace VeraCrypt
nTestsPerformed++;
}
- if (nTestsPerformed != 80)
+ if (nTestsPerformed != 100)
throw TestFailed (SRC_POS);
}
@@ -809,5 +872,15 @@ namespace VeraCrypt
pkcs5HmacWhirlpool.DeriveKey (derivedKey, password, salt, 5);
if (memcmp (derivedKey.Ptr(), "\x50\x7c\x36\x6f", 4) != 0)
throw TestFailed (SRC_POS);
+
+ Pkcs5HmacSha256 pkcs5HmacSha256;
+ pkcs5HmacSha256.DeriveKey (derivedKey, password, salt, 5);
+ if (memcmp (derivedKey.Ptr(), "\xf2\xa0\x4f\xb2", 4) != 0)
+ throw TestFailed (SRC_POS);
+
+ Pkcs5HmacStreebog pkcs5HmacStreebog;
+ pkcs5HmacStreebog.DeriveKey (derivedKey, password, salt, 5);
+ if (memcmp (derivedKey.Ptr(), "\xd0\x53\xa2\x30", 4) != 0)
+ throw TestFailed (SRC_POS);
}
}
diff --git a/src/Volume/Hash.cpp b/src/Volume/Hash.cpp
index c1baa9a3..ea3517e5 100644
--- a/src/Volume/Hash.cpp
+++ b/src/Volume/Hash.cpp
@@ -15,6 +15,7 @@
#include "Crypto/Rmd160.h"
#include "Crypto/Sha2.h"
#include "Crypto/Whirlpool.h"
+#include "Crypto/Streebog.h"
namespace VeraCrypt
{
@@ -136,6 +137,30 @@ namespace VeraCrypt
void Whirlpool::ProcessData (const ConstBufferPtr &data)
{
if_debug (ValidateDataParameters (data));
- WHIRLPOOL_add (data.Get(), (int) data.Size() * 8, (WHIRLPOOL_CTX *) Context.Ptr());
+ WHIRLPOOL_add (data.Get(), (int) data.Size(), (WHIRLPOOL_CTX *) Context.Ptr());
+ }
+
+ // Streebog
+ Streebog::Streebog ()
+ {
+ Context.Allocate (sizeof (STREEBOG_CTX));
+ Init();
+ }
+
+ void Streebog::GetDigest (const BufferPtr &buffer)
+ {
+ if_debug (ValidateDigestParameters (buffer));
+ STREEBOG_finalize ((STREEBOG_CTX *) Context.Ptr(), buffer);
+ }
+
+ void Streebog::Init ()
+ {
+ STREEBOG_init ((STREEBOG_CTX *) Context.Ptr());
+ }
+
+ void Streebog::ProcessData (const ConstBufferPtr &data)
+ {
+ if_debug (ValidateDataParameters (data));
+ STREEBOG_add (data.Get(), (int) data.Size(), (STREEBOG_CTX *) Context.Ptr());
}
}
diff --git a/src/Volume/Hash.h b/src/Volume/Hash.h
index 139924c0..9cef9de7 100644
--- a/src/Volume/Hash.h
+++ b/src/Volume/Hash.h
@@ -139,6 +139,29 @@ namespace VeraCrypt
Whirlpool (const Whirlpool &);
Whirlpool &operator= (const Whirlpool &);
};
+
+ // Streebog
+ class Streebog : public Hash
+ {
+ public:
+ Streebog ();
+ virtual ~Streebog () { }
+
+ virtual void GetDigest (const BufferPtr &buffer);
+ virtual size_t GetBlockSize () const { return 64; }
+ virtual size_t GetDigestSize () const { return 512 / 8; }
+ virtual wstring GetName () const { return L"Streebog"; }
+ virtual wstring GetAltName () const { return L"Streebog"; }
+ virtual shared_ptr <Hash> GetNew () const { return shared_ptr <Hash> (new Streebog); }
+ virtual void Init ();
+ virtual void ProcessData (const ConstBufferPtr &data);
+
+ protected:
+
+ private:
+ Streebog (const Streebog &);
+ Streebog &operator= (const Streebog &);
+ };
}
#endif // TC_HEADER_Encryption_Hash
diff --git a/src/Volume/Pkcs5Kdf.cpp b/src/Volume/Pkcs5Kdf.cpp
index d56fe029..1e229d10 100644
--- a/src/Volume/Pkcs5Kdf.cpp
+++ b/src/Volume/Pkcs5Kdf.cpp
@@ -66,6 +66,7 @@ namespace VeraCrypt
l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacWhirlpool (false)));
l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacSha256 ()));
l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacRipemd160 (false)));
+ l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacStreebog ()));
}
return l;
@@ -112,4 +113,16 @@ namespace VeraCrypt
ValidateParameters (key, password, salt, iterationCount);
derive_key_whirlpool ((char *) password.DataPtr(), (int) password.Size(), (char *) salt.Get(), (int) salt.Size(), iterationCount, (char *) key.Get(), (int) key.Size());
}
+
+ void Pkcs5HmacStreebog::DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const
+ {
+ ValidateParameters (key, password, salt, iterationCount);
+ derive_key_streebog ((char *) password.DataPtr(), (int) password.Size(), (char *) salt.Get(), (int) salt.Size(), iterationCount, (char *) key.Get(), (int) key.Size());
+ }
+
+ void Pkcs5HmacStreebog_Boot::DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const
+ {
+ ValidateParameters (key, password, salt, iterationCount);
+ derive_key_streebog ((char *) password.DataPtr(), (int) password.Size(), (char *) salt.Get(), (int) salt.Size(), iterationCount, (char *) key.Get(), (int) key.Size());
+ }
}
diff --git a/src/Volume/Pkcs5Kdf.h b/src/Volume/Pkcs5Kdf.h
index d92a3301..c10efaf3 100644
--- a/src/Volume/Pkcs5Kdf.h
+++ b/src/Volume/Pkcs5Kdf.h
@@ -152,6 +152,40 @@ namespace VeraCrypt
Pkcs5HmacWhirlpool (const Pkcs5HmacWhirlpool &);
Pkcs5HmacWhirlpool &operator= (const Pkcs5HmacWhirlpool &);
};
+
+ class Pkcs5HmacStreebog : public Pkcs5Kdf
+ {
+ public:
+ Pkcs5HmacStreebog () : Pkcs5Kdf(false) { }
+ virtual ~Pkcs5HmacStreebog () { }
+
+ virtual void DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const;
+ virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Streebog); }
+ virtual int GetIterationCount (int pim) const { return pim <= 0 ? 500000 : (15000 + (pim * 1000)); }
+ virtual wstring GetName () const { return L"HMAC-Streebog"; }
+ virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacStreebog(m_truecryptMode); }
+
+ private:
+ Pkcs5HmacStreebog (const Pkcs5HmacStreebog &);
+ Pkcs5HmacStreebog &operator= (const Pkcs5HmacStreebog &);
+ };
+
+ class Pkcs5HmacStreebog_Boot : public Pkcs5Kdf
+ {
+ public:
+ Pkcs5HmacStreebog_Boot () : Pkcs5Kdf(false) { }
+ virtual ~Pkcs5HmacStreebog_Boot () { }
+
+ virtual void DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const;
+ virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Streebog); }
+ virtual int GetIterationCount (int pim) const { return pim <= 0 ? 200000 : pim * 2048; }
+ virtual wstring GetName () const { return L"HMAC-Streebog"; }
+ virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacStreebog_Boot(m_truecryptMode); }
+
+ private:
+ Pkcs5HmacStreebog_Boot (const Pkcs5HmacStreebog_Boot &);
+ Pkcs5HmacStreebog_Boot &operator= (const Pkcs5HmacStreebog_Boot &);
+ };
}
#endif // TC_HEADER_Encryption_Pkcs5
diff --git a/src/Volume/Volume.make b/src/Volume/Volume.make
index 0ef42ac7..855e5f60 100644
--- a/src/Volume/Volume.make
+++ b/src/Volume/Volume.make
@@ -51,6 +51,10 @@ OBJS += ../Crypto/Serpent.o
OBJS += ../Crypto/Sha2.o
OBJS += ../Crypto/Twofish.o
OBJS += ../Crypto/Whirlpool.o
+OBJS += ../Crypto/Camellia.o
+OBJS += ../Crypto/GostCipher.o
+OBJS += ../Crypto/Streebog.o
+OBJS += ../Crypto/kuznyechik.o
OBJS += ../Common/Crc.o
OBJS += ../Common/Endian.o
diff --git a/src/Volume/VolumeLayout.cpp b/src/Volume/VolumeLayout.cpp
index 065045b9..69981a09 100644
--- a/src/Volume/VolumeLayout.cpp
+++ b/src/Volume/VolumeLayout.cpp
@@ -68,6 +68,7 @@ namespace VeraCrypt
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AES ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Serpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
@@ -98,6 +99,9 @@ namespace VeraCrypt
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AES ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Serpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST89 ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Kuznyechik ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
@@ -136,6 +140,9 @@ namespace VeraCrypt
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AES ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Serpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST89 ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Kuznyechik ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
@@ -181,6 +188,9 @@ namespace VeraCrypt
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AES ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Serpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Twofish ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Camellia ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new GOST89 ()));
+ SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new Kuznyechik ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofish ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new AESTwofishSerpent ()));
SupportedEncryptionAlgorithms.push_back (shared_ptr <EncryptionAlgorithm> (new SerpentAES ()));
@@ -206,6 +216,12 @@ namespace VeraCrypt
if (!truecryptMode)
l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacSha256_Boot ()));
l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacRipemd160_1000 (truecryptMode)));
+ if (!truecryptMode)
+ {
+ l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacSha512 (false)));
+ l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacWhirlpool (false)));
+ l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacStreebog ()));
+ }
return l;
}
}