Nicolas Kaiser 895be15745 crypto: cast5 - simplify if-statements
I noticed that by factoring out common rounds from the
branches of the if-statements in the encryption and
decryption functions, the executable file size goes down
significantly, for crypto/cast5.ko from 26688 bytes
to 24336 bytes (amd64).

On my test system, I saw a slight speedup. This is the
first time I'm doing such a benchmark - I found a similar
one on the crypto mailing list, and I hope I did it right?

Before:
# cryptsetup create dm-test /dev/hda2 -c cast5-cbc-plain -s 128
Passsatz eingeben: 
# dd if=/dev/zero of=/dev/mapper/dm-test bs=1M count=50
52428800 Bytes (52 MB) kopiert, 2,43484 s, 21,5 MB/s
# dd if=/dev/zero of=/dev/mapper/dm-test bs=1M count=50
52428800 Bytes (52 MB) kopiert, 2,4089 s, 21,8 MB/s
# dd if=/dev/zero of=/dev/mapper/dm-test bs=1M count=50
52428800 Bytes (52 MB) kopiert, 2,41091 s, 21,7 MB/s

After:
# cryptsetup create dm-test /dev/hda2 -c cast5-cbc-plain -s 128
Passsatz eingeben: 
# dd if=/dev/zero of=/dev/mapper/dm-test bs=1M count=50
52428800 Bytes (52 MB) kopiert, 2,38128 s, 22,0 MB/s
# dd if=/dev/zero of=/dev/mapper/dm-test bs=1M count=50
52428800 Bytes (52 MB) kopiert, 2,29486 s, 22,8 MB/s
# dd if=/dev/zero of=/dev/mapper/dm-test bs=1M count=50
52428800 Bytes (52 MB) kopiert, 2,37162 s, 22,1 MB/s

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2010-11-13 21:47:55 +09:00
..
2010-02-16 20:24:07 +08:00
2010-02-16 20:26:46 +08:00
2010-05-26 10:36:51 +10:00
2010-10-26 16:52:08 -07:00
2010-11-13 21:47:55 +09:00
2010-02-16 20:29:45 +08:00
2010-02-16 20:31:19 +08:00
2010-05-26 10:36:51 +10:00
2008-06-02 15:46:51 +10:00
2010-02-16 20:33:49 +08:00
2008-08-29 15:50:02 +10:00
2009-03-04 14:43:52 +08:00
2008-04-21 10:19:34 +08:00
2009-02-17 20:00:11 +08:00
2008-04-21 10:19:34 +08:00
2008-12-25 11:02:16 +11:00
2010-03-02 21:58:16 +08:00
2008-12-25 11:02:09 +11:00
2008-12-25 11:02:10 +11:00
2008-12-25 11:02:12 +11:00
2008-12-25 11:02:13 +11:00
2007-10-10 16:55:38 -07:00
2008-04-21 10:19:34 +08:00
2008-04-21 10:19:34 +08:00
2008-12-25 11:02:21 +11:00
2010-03-18 20:22:55 +08:00
2008-12-25 11:02:22 +11:00
2010-05-26 10:36:51 +10:00