2007-12-16 18:06:17

by Tan Swee Heng

[permalink] [raw]
Subject: [PATCH 2/2] Salsa20 stream cipher algorithm (x86-64 version)

This is the x86-64 version of the Salsa20 stream cipher algorithm. The
original assembly code came from
<http://cr.yp.to/snuffle/salsa20/amd64-3/salsa20.s>. It has been
reformatted for clarity.

Signed-off-by: Tan Swee Heng <[email protected]>

Hi Herbert, as mentioned some time ago, I don't have an x86-64. So
please help me test it. Thanks!
The Python script used to automate the reformatting is also attached
in case anyone is interested.


Attachments:
(No filename) (447.00 B)
0002-Salsa20-stream-cipher-algorithm-x86-64-version.txt (21.09 kB)
indent.py (926.00 B)
Download all attachments
Subject: Re: [PATCH 2/2] Salsa20 stream cipher algorithm (x86-64 version)

* Tan Swee Heng | 2007-12-17 02:06:15 [+0800]:

>Hi Herbert, as mentioned some time ago, I don't have an x86-64. So
>please help me test it. Thanks!

I tested it and it passed 5 of 5 tests :)

>diff --git a/crypto/Kconfig b/crypto/Kconfig
>index 221356b..b0481f7 100644
>--- a/crypto/Kconfig
>+++ b/crypto/Kconfig
>@@ -504,6 +504,21 @@ config CRYPTO_SALSA20_586
> The Salsa20 stream cipher algorithm is designed by Daniel J.
> Bernstein <[email protected]>. See <http://cr.yp.to/snuffle.html>
>
>+config CRYPTO_SALSA20_X86_64
>+ tristate "Salsa20 stream cipher algorithm (x86_64) (EXPERIMENTAL)"
>+ depends on (X86 || UML_X86) && 64BIT
>+ depends on EXPERIMENTAL
>+ select CRYPTO_BLKCIPHER
>+ select CRYPTO_SALSA20
>+ help

I why do you select CRYPTO_SALSA20 ? I was able to build & test it
without it.

Sebastian

2007-12-17 16:06:40

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 2/2] Salsa20 stream cipher algorithm (x86-64 version)

On Mon, Dec 17, 2007 at 02:06:15AM +0800, Tan Swee Heng wrote:
> This is the x86-64 version of the Salsa20 stream cipher algorithm. The
> original assembly code came from
> <http://cr.yp.to/snuffle/salsa20/amd64-3/salsa20.s>. It has been
> reformatted for clarity.
>
> Signed-off-by: Tan Swee Heng <[email protected]>

Patch applied. Thanks a lot!

> Hi Herbert, as mentioned some time ago, I don't have an x86-64. So
> please help me test it. Thanks!
> The Python script used to automate the reformatting is also attached
> in case anyone is interested.

Yes it works fine here.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2007-12-17 17:51:30

by Tan Swee Heng

[permalink] [raw]
Subject: Re: [PATCH 2/2] Salsa20 stream cipher algorithm (x86-64 version)

Hi Herbert and Sebastian, thanks for testing the x86-64
implementation. Much appreciated. :-)

I will remember to use "git-format-patch -M" next time. I didn't know
about the -M switch before this.

Sebastian is right about the "select CRYPTO_SALSA20". It seems
unnecessary in both i586 and x86-64 versions. Attached is a patch that
removes them.

Swee Heng


Attachments:
(No filename) (358.00 B)
0001-Removed-dependency-on-CRYPTO_SALSA20.txt (738.00 B)
Download all attachments

2007-12-18 14:58:05

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 2/2] Salsa20 stream cipher algorithm (x86-64 version)

On Tue, Dec 18, 2007 at 01:51:27AM +0800, Tan Swee Heng wrote:
>
> Subject: [PATCH] Removed dependency on CRYPTO_SALSA20
>
> Signed-off-by: Tan Swee Heng <[email protected]>


Patch applied. Thanks.
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt