Re: [PATCH] crypto: add test vectors for skein256/512/1024

2008-11-05 Thread Sebastian Andrzej Siewior
* Jeff Garzik | 2008-11-02 20:44:40 [-0500]:

> Sebastian Andrzej Siewior wrote:
>> I grabed them from http://www.schneier.com/skein.html. The last test 
>> vector
>> (3) in every category is currently deactivated because it failed always.
>> It is unlikely that I made a type because I copy+pasted the tables + vim
>> magiced them. So maybe code may missbehave on requests lengths which are
>> not a multiple of 4 or the vectors can not be used due to some other
>> limitations that I've overseen.

Okay, that was a false positive :)
The "untouched" reference implementation outputs the same hash. The
additional information (tree, ...) is part of the third argument in
Skein_XXX_InitExt() which isn't used. So we can safely drop the third
test vector.

>
>   Jeff

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: add test vectors for skein256/512/1024

2008-11-03 Thread Sebastian Andrzej Siewior
* Jeff Garzik | 2008-11-02 20:44:40 [-0500]:

> Sebastian Andrzej Siewior wrote:
>> I grabed them from http://www.schneier.com/skein.html. The last test 
>> vector
>> (3) in every category is currently deactivated because it failed always.
>> It is unlikely that I made a type because I copy+pasted the tables + vim
>> magiced them. So maybe code may missbehave on requests lengths which are
>> not a multiple of 4 or the vectors can not be used due to some other
>> limitations that I've overseen.
>
> Another thought:  did you verify that the test vectors' output sizes 
> matched the Linux kernel's?
It should. All have something like:
| :Skein-512:   512-bit hash, msgLen = 8 bits
512 algo, 512 output. 

The third one has:
| :Skein-512:   512-bit hash, msgLen =  2040 bits. Tree: leaf=02, node=02, 
maxLevels=02
So it looks like the same except that it has the "Tree: leaf node"
attribes as well. So maybe this is something special maybe not. As I
browsed the .txt files for other vectors I did not find any where msglen
wasn't a multiple of 4 bytes (except some odd ones where msgles was 7
bits). Maybe I did not look close enough.

>   Jeff

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: add test vectors for skein256/512/1024

2008-11-02 Thread Jeff Garzik

Sebastian Andrzej Siewior wrote:

I grabed them from http://www.schneier.com/skein.html. The last test vector
(3) in every category is currently deactivated because it failed always.
It is unlikely that I made a type because I copy+pasted the tables + vim
magiced them. So maybe code may missbehave on requests lengths which are
not a multiple of 4 or the vectors can not be used due to some other
limitations that I've overseen.


Another thought:  did you verify that the test vectors' output sizes 
matched the Linux kernel's?


My implementation assumed a 256-bit output size for Skein-256, for 
example, but it is quite possible that Schneier and co. ran tests where 
the output size differed from the internal state size.


Jeff


--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] crypto: add test vectors for skein256/512/1024

2008-11-02 Thread Jeff Garzik

Sebastian Andrzej Siewior wrote:

I grabed them from http://www.schneier.com/skein.html. The last test vector
(3) in every category is currently deactivated because it failed always.
It is unlikely that I made a type because I copy+pasted the tables + vim
magiced them. So maybe code may missbehave on requests lengths which are
not a multiple of 4 or the vectors can not be used due to some other
limitations that I've overseen.

Signed-off-by: Sebastian Andrzej Siewior <[EMAIL PROTECTED]>
---
 crypto/tcrypt.c  |   24 
 crypto/testmgr.c |   27 +
 crypto/testmgr.h |  166 +-
 3 files changed, 216 insertions(+), 1 deletions(-)


Nice, thanks!

I'm wondering if the failure has to do with the alignmask value in 
struct crypto_alg for each variant.


Jeff




--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html