Linux cryptographic layer development
 help / color / mirror / Atom feed
* XTS and 64-bit block
@ 2015-05-06  8:28 jonathan.thieuleux
  0 siblings, 0 replies; only message in thread
From: jonathan.thieuleux @ 2015-05-06  8:28 UTC (permalink / raw)
  To: linux-crypto

Hi,

I'm implementing a new block cipher algorithm which is GOST 28147-89. This is a
256-bit key and 64-bit block algorithm. This algorithm works well with ECB, CBC
and CTR modes. But, when I try to use the XTS mode, the encryption fails. So I
tried to find the problem and it seems to come from the file crypto/xts.c,
function init_tfm :

	if (crypto_cipher_blocksize(cipher) != XTS_BLOCK_SIZE) {
		*flags |= CRYPTO_TFM_RES_BAD_BLOCK_LEN;
		crypto_free_cipher(cipher);
		return -EINVAL;
	}

So, I checked the value of XTS_BLOCK_SIZE which is 0x10. The snag is that the
block size of GOST is 0x8. So I changed the block value of my algorithm to 0x10,
and then I tried again with the XTS mode, and it works!

Because of what just happened, I've two questions:

Q1: Why does the GOST algorithm still work? Despite I changed the block size.
Q2: Why in the code, was the block size of XTS fixed? As far as I know,
operations modes should adapt to the size of the block cipher.


Regards,
Thanks in advance
--
Jonathan "Coldshell" Thieuleux
Mail : jonathan.thieuleux@gmail.com
IRC : coldshell [Freenode, OFTC]
Shaarli : https://links.stdcall.me/

"If you write interfaces with more than 4 or 5 function arguments, it's possible that you and I cannot be friends." -- David Miller

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-06  8:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-06  8:28 XTS and 64-bit block jonathan.thieuleux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox