17 Commits

Author SHA1 Message Date
Aorimn 5895934107 Add real AES-XTS implementation
The previous implementation was only an AES-XEX one, without support for
not-divisible-by-16 sectors. We now support this through a real - if not
entirely complete in the test vectors point of vue - implementation.
Note that we don't support sectors not aligned on the byte limit, as
should be the case in a real AES-XTS implementation. But so far, I
didn't see it implemented anywhere, so I think we're good.
2016-03-05 12:37:49 +01:00
Aorimn 0f14ed5baa Change crc32 to our own implementation
Although we use the table from the previous implementation, this enables
us to use our own license.
2016-01-31 16:42:11 +01:00
Aorimn 994e2bfbd6 Add AES-XEX implementation within dislocker
This is done in case the function isn't available in the mbedTLS
library.
2016-01-31 16:04:52 +01:00
Aorimn 72a9280550 Add AES-XTS enc/decryption implementation
This adds functions which call the mbedtls_aes_crypt_xex function. This
function isn't available yet in mbedTLS, so this is of no use for common
users.
The bright side is, when it's available, it will be supported in
dislocker. A future commit will test for the maybe-existing function and
use our own implementation if it's not existing.
2016-01-31 16:04:52 +01:00
Aorimn 0b0e49cd15 Adding support for AES-XTS algorithms
This extends supported algorithms to AES-XTS ones.
2016-01-31 16:04:52 +01:00
Robert Scheck eddf520ddb Avoid "error: expected declaration specifiers or '...' before 'off_t'" build failure on RHEL 5 2016-01-06 03:27:24 +01:00
Aorimn 909f4b7592 Give the real size to decrypt the keys
When decrypting keys (VMK or FVEK mainly), we gave 256 as of the key
size. This worked until now but I suspect that was mainly by the chance
that the current keys always are 256 bits long.
With the XTS mode, it seems the keys sizes have to be doubled, so that
would also prepare for the AES-XTS-256 mode, where keys could be 512
(I'm not sure yet).
2015-11-25 23:20:06 +01:00
Aorimn 36277c0a3b Add cipher numbers for AES-XTS
Looking at Windows 10 (v1511) encrypted partitions with AES-XTS, both
128 and 256, shows that the new cipher numbers are 0x8004 and 0x8005
respectively.
2015-11-25 19:55:47 +01:00
Aorimn 455653e55f Begin to prepare for AES-XTS encryption
AES-XTS is the new encryption scheme available on Windows 10 (from the
1511 version).
Moreover, this commit remove a branching case which often happens, which
should give beter performances (not tested though).
2015-11-19 00:07:38 +01:00
Aorimn 2b708a0e59 Try to fix compilation on OSX Yosemite
Homebrew seems to have changed the polarssl/ folder into mbedtls/, so we
adapt the cmake/FindPolarSSL.cmake file to reflect this change. This
file now exports POLARSSL_INC_FOLDER, which take "polarssl" or "mbedtls"
for value according to the folder name in use on the system.
This is then used to include the correct files in dislocker.
2015-08-06 00:56:00 +02:00
Aorimn 1633b3d444 Trailing whitespaces cleaning, again
It seems like header files missed the whitespace cleaning, so fix it.
2015-04-25 18:26:14 +02:00
Aorimn 5ffa3978d4 Modify dis_crypt_new's prototype
A check had more sense to be in the encryption unit than in the
dislocker one.
2015-04-20 22:17:16 +02:00
Aorimn b3754e80aa Move the crypt structure to a private header
The crypt structure, representing an encryption object is now private.
We use the .priv.h convention for a private header. This private header
is thus named encommon.priv.h and can be used only by the encryption/
directory units.
2015-03-14 17:05:07 +01:00
Aorimn 249fa2831e Remove metadata dependency in the decrypt.c unit
This seems to make no sense to put datums specific stuff into the
decrypt.c file.
2015-03-07 01:48:45 +01:00
Aorimn 2e2ae837e8 Move the io_data structure to the sectors.c unit
The io_data structure, as stated in the previous commit, shouldn't be
known to the encryption unit. This structure is mainly used by
dislocker.c and sectors.c, so it make sense to put it in the sectors.h
file.
2015-03-07 00:56:01 +01:00
Aorimn 0715a3693b Begin to create an encryption object
The decrypt.c unit file shouldn't know the io_data structure, it doesn't
really make sense for it to need it.
2015-03-07 00:41:01 +01:00
Aorimn a5d85f6264 Move includes into separate directory
This adds an include/ directory from which includes files will be. Each
header is now moved to this directory, in the same sub-directory it was
in.
Each #include has been changed accordingly in order not to break
compilation.
2015-03-04 23:35:25 +01:00