2012-08-21 03:58:13 -07:00
# include < l i n u x / l i n k a g e . h >
# include < a s m / v i s a s m . h >
2012-08-31 12:11:51 -07:00
# include " o p c o d e s . h "
2012-08-21 03:58:13 -07:00
# define E N C R Y P T _ T W O _ R O U N D S ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 1 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 4 , T 0 , T 1 , I 0 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 6 , T 0 , T 1 , I 1 )
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
# define E N C R Y P T _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 1 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 0 , I 2 , I 3 , T 2 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 2 , I 2 , I 3 , T 3 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 4 , T 0 , T 1 , I 0 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 6 , T 0 , T 1 , I 1 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 4 , T 2 , T 3 , I 2 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 6 , T 2 , T 3 , I 3 )
2012-08-21 03:58:13 -07:00
# define E N C R Y P T _ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 1 ) \
AES_ E R O U N D 0 1 _ L ( K E Y _ B A S E + 4 , T 0 , T 1 , I 0 ) \
AES_ E R O U N D 2 3 _ L ( K E Y _ B A S E + 6 , T 0 , T 1 , I 1 )
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
# define E N C R Y P T _ T W O _ R O U N D S _ L A S T _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 1 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 0 , I 2 , I 3 , T 2 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 2 , I 2 , I 3 , T 3 ) \
AES_ E R O U N D 0 1 _ L ( K E Y _ B A S E + 4 , T 0 , T 1 , I 0 ) \
AES_ E R O U N D 2 3 _ L ( K E Y _ B A S E + 6 , T 0 , T 1 , I 1 ) \
AES_ E R O U N D 0 1 _ L ( K E Y _ B A S E + 4 , T 2 , T 3 , I 2 ) \
AES_ E R O U N D 2 3 _ L ( K E Y _ B A S E + 6 , T 2 , T 3 , I 3 )
2012-08-21 03:58:13 -07:00
/* 10 rounds */
# define E N C R Y P T _ 1 2 8 ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 8 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 1 6 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 2 4 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E + 3 2 , I 0 , I 1 , T 0 , T 1 )
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
# define E N C R Y P T _ 1 2 8 _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 0 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 8 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 1 6 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 2 4 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ L A S T _ 2 ( K E Y _ B A S E + 3 2 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 )
2012-08-21 03:58:13 -07:00
/* 12 rounds */
# define E N C R Y P T _ 1 9 2 ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 8 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 1 6 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 2 4 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 3 2 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E + 4 0 , I 0 , I 1 , T 0 , T 1 )
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
# define E N C R Y P T _ 1 9 2 _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 0 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 8 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 1 6 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 2 4 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 3 2 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
ENCRYPT_ T W O _ R O U N D S _ L A S T _ 2 ( K E Y _ B A S E + 4 0 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 )
2012-08-21 03:58:13 -07:00
/* 14 rounds */
# define E N C R Y P T _ 2 5 6 ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 8 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 1 6 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 2 4 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 3 2 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 4 0 , I 0 , I 1 , T 0 , T 1 ) \
ENCRYPT_ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E + 4 8 , I 0 , I 1 , T 0 , T 1 )
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
# define E N C R Y P T _ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T M P _ B A S E ) \
ENCRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , \
TMP_ B A S E + 0 , T M P _ B A S E + 2 , T M P _ B A S E + 4 , T M P _ B A S E + 6 )
# define E N C R Y P T _ 2 5 6 _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 ) \
ENCRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 0 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 4 8 ) \
ldd [ % o 0 + 0 x d0 ] , % f56 ; \
ldd [ % o 0 + 0 x d8 ] , % f58 ; \
ENCRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 8 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
ldd [ % o 0 + 0 x e 0 ] , % f60 ; \
ldd [ % o 0 + 0 x e 8 ] , % f62 ; \
ENCRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 1 6 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
ENCRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 2 4 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
ENCRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 3 2 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
ENCRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 4 0 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 4 8 , I 0 , I 1 , K E Y _ B A S E + 0 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 5 0 , I 0 , I 1 , K E Y _ B A S E + 2 ) \
AES_ E R O U N D 0 1 ( K E Y _ B A S E + 4 8 , I 2 , I 3 , K E Y _ B A S E + 4 ) \
AES_ E R O U N D 2 3 ( K E Y _ B A S E + 5 0 , I 2 , I 3 , K E Y _ B A S E + 6 ) \
AES_ E R O U N D 0 1 _ L ( K E Y _ B A S E + 5 2 , K E Y _ B A S E + 0 , K E Y _ B A S E + 2 , I 0 ) \
AES_ E R O U N D 2 3 _ L ( K E Y _ B A S E + 5 4 , K E Y _ B A S E + 0 , K E Y _ B A S E + 2 , I 1 ) \
ldd [ % o 0 + 0 x10 ] , % f8 ; \
ldd [ % o 0 + 0 x18 ] , % f10 ; \
AES_ E R O U N D 0 1 _ L ( K E Y _ B A S E + 5 2 , K E Y _ B A S E + 4 , K E Y _ B A S E + 6 , I 2 ) \
AES_ E R O U N D 2 3 _ L ( K E Y _ B A S E + 5 4 , K E Y _ B A S E + 4 , K E Y _ B A S E + 6 , I 3 ) \
ldd [ % o 0 + 0 x20 ] , % f12 ; \
ldd [ % o 0 + 0 x28 ] , % f14 ;
2012-08-29 12:50:16 -07:00
# define D E C R Y P T _ T W O _ R O U N D S ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 1 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 0 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 4 , T 0 , T 1 , I 1 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 6 , T 0 , T 1 , I 0 )
2012-08-21 03:58:13 -07:00
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
# define D E C R Y P T _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 1 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 0 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 0 , I 2 , I 3 , T 3 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 2 , I 2 , I 3 , T 2 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 4 , T 0 , T 1 , I 1 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 6 , T 0 , T 1 , I 0 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 4 , T 2 , T 3 , I 3 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 6 , T 2 , T 3 , I 2 )
2012-08-29 12:50:16 -07:00
# define D E C R Y P T _ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 1 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 0 ) \
AES_ D R O U N D 2 3 _ L ( K E Y _ B A S E + 4 , T 0 , T 1 , I 1 ) \
AES_ D R O U N D 0 1 _ L ( K E Y _ B A S E + 6 , T 0 , T 1 , I 0 )
2012-08-21 03:58:13 -07:00
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
# define D E C R Y P T _ T W O _ R O U N D S _ L A S T _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 0 , I 0 , I 1 , T 1 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 2 , I 0 , I 1 , T 0 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 0 , I 2 , I 3 , T 3 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 2 , I 2 , I 3 , T 2 ) \
AES_ D R O U N D 2 3 _ L ( K E Y _ B A S E + 4 , T 0 , T 1 , I 1 ) \
AES_ D R O U N D 0 1 _ L ( K E Y _ B A S E + 6 , T 0 , T 1 , I 0 ) \
AES_ D R O U N D 2 3 _ L ( K E Y _ B A S E + 4 , T 2 , T 3 , I 3 ) \
AES_ D R O U N D 0 1 _ L ( K E Y _ B A S E + 6 , T 2 , T 3 , I 2 )
2012-08-21 03:58:13 -07:00
/* 10 rounds */
2012-08-29 12:50:16 -07:00
# define D E C R Y P T _ 1 2 8 ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 8 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 1 6 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 2 4 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E + 3 2 , I 0 , I 1 , T 0 , T 1 )
2012-08-21 03:58:13 -07:00
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
# define D E C R Y P T _ 1 2 8 _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 0 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 8 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 1 6 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 2 4 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ L A S T _ 2 ( K E Y _ B A S E + 3 2 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 )
2012-08-21 03:58:13 -07:00
/* 12 rounds */
2012-08-29 12:50:16 -07:00
# define D E C R Y P T _ 1 9 2 ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 8 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 1 6 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 2 4 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 3 2 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E + 4 0 , I 0 , I 1 , T 0 , T 1 )
2012-08-21 03:58:13 -07:00
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
# define D E C R Y P T _ 1 9 2 _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 0 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 8 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 1 6 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 2 4 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 3 2 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 ) \
DECRYPT_ T W O _ R O U N D S _ L A S T _ 2 ( K E Y _ B A S E + 4 0 , I 0 , I 1 , I 2 , I 3 , T 0 , T 1 , T 2 , T 3 )
2012-08-21 03:58:13 -07:00
/* 14 rounds */
2012-08-29 12:50:16 -07:00
# define D E C R Y P T _ 2 5 6 ( K E Y _ B A S E , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 0 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 8 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 1 6 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 2 4 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 3 2 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S ( K E Y _ B A S E + 4 0 , I 0 , I 1 , T 0 , T 1 ) \
DECRYPT_ T W O _ R O U N D S _ L A S T ( K E Y _ B A S E + 4 8 , I 0 , I 1 , T 0 , T 1 )
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
# define D E C R Y P T _ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , T M P _ B A S E ) \
DECRYPT_ T W O _ R O U N D S _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 , \
TMP_ B A S E + 0 , T M P _ B A S E + 2 , T M P _ B A S E + 4 , T M P _ B A S E + 6 )
# define D E C R Y P T _ 2 5 6 _ 2 ( K E Y _ B A S E , I 0 , I 1 , I 2 , I 3 ) \
DECRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 0 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 4 8 ) \
ldd [ % o 0 + 0 x18 ] , % f56 ; \
ldd [ % o 0 + 0 x10 ] , % f58 ; \
DECRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 8 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
2012-09-01 23:05:43 -07:00
ldd [ % o 0 + 0 x08 ] , % f60 ; \
ldd [ % o 0 + 0 x00 ] , % f62 ; \
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
DECRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 1 6 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
DECRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 2 4 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
DECRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 3 2 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
DECRYPT_ 2 5 6 _ T W O _ R O U N D S _ 2 ( K E Y _ B A S E + 4 0 , I 0 , I 1 , I 2 , I 3 , K E Y _ B A S E + 0 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 4 8 , I 0 , I 1 , K E Y _ B A S E + 2 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 5 0 , I 0 , I 1 , K E Y _ B A S E + 0 ) \
AES_ D R O U N D 2 3 ( K E Y _ B A S E + 4 8 , I 2 , I 3 , K E Y _ B A S E + 6 ) \
AES_ D R O U N D 0 1 ( K E Y _ B A S E + 5 0 , I 2 , I 3 , K E Y _ B A S E + 4 ) \
AES_ D R O U N D 2 3 _ L ( K E Y _ B A S E + 5 2 , K E Y _ B A S E + 0 , K E Y _ B A S E + 2 , I 1 ) \
AES_ D R O U N D 0 1 _ L ( K E Y _ B A S E + 5 4 , K E Y _ B A S E + 0 , K E Y _ B A S E + 2 , I 0 ) \
ldd [ % o 0 + 0 x d8 ] , % f8 ; \
ldd [ % o 0 + 0 x d0 ] , % f10 ; \
AES_ D R O U N D 2 3 _ L ( K E Y _ B A S E + 5 2 , K E Y _ B A S E + 4 , K E Y _ B A S E + 6 , I 3 ) \
2012-09-01 23:05:43 -07:00
AES_ D R O U N D 0 1 _ L ( K E Y _ B A S E + 5 4 , K E Y _ B A S E + 4 , K E Y _ B A S E + 6 , I 2 ) \
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
ldd [ % o 0 + 0 x c8 ] , % f12 ; \
ldd [ % o 0 + 0 x c0 ] , % f14 ;
2012-08-29 12:50:16 -07:00
.align 32
2012-08-21 03:58:13 -07:00
ENTRY( a e s _ s p a r c64 _ k e y _ e x p a n d )
/* %o0=input_key, %o1=output_key, %o2=key_len */
VISEntry
ld [ % o 0 + 0 x00 ] , % f0
ld [ % o 0 + 0 x04 ] , % f1
ld [ % o 0 + 0 x08 ] , % f2
ld [ % o 0 + 0 x0 c ] , % f3
std % f0 , [ % o 1 + 0 x00 ]
std % f2 , [ % o 1 + 0 x08 ]
add % o 1 , 0 x10 , % o 1
cmp % o 2 , 2 4
bl 2 f
nop
be 1 f
nop
/* 256-bit key expansion */
ld [ % o 0 + 0 x10 ] , % f4
ld [ % o 0 + 0 x14 ] , % f5
ld [ % o 0 + 0 x18 ] , % f6
ld [ % o 0 + 0 x1 c ] , % f7
std % f4 , [ % o 1 + 0 x00 ]
std % f6 , [ % o 1 + 0 x08 ]
add % o 1 , 0 x10 , % o 1
AES_ K E X P A N D 1 ( 0 , 6 , 0 x0 , 8 )
AES_ K E X P A N D 2 ( 2 , 8 , 1 0 )
AES_ K E X P A N D 0 ( 4 , 1 0 , 1 2 )
AES_ K E X P A N D 2 ( 6 , 1 2 , 1 4 )
AES_ K E X P A N D 1 ( 8 , 1 4 , 0 x1 , 1 6 )
AES_ K E X P A N D 2 ( 1 0 , 1 6 , 1 8 )
AES_ K E X P A N D 0 ( 1 2 , 1 8 , 2 0 )
AES_ K E X P A N D 2 ( 1 4 , 2 0 , 2 2 )
AES_ K E X P A N D 1 ( 1 6 , 2 2 , 0 x2 , 2 4 )
AES_ K E X P A N D 2 ( 1 8 , 2 4 , 2 6 )
AES_ K E X P A N D 0 ( 2 0 , 2 6 , 2 8 )
AES_ K E X P A N D 2 ( 2 2 , 2 8 , 3 0 )
AES_ K E X P A N D 1 ( 2 4 , 3 0 , 0 x3 , 3 2 )
AES_ K E X P A N D 2 ( 2 6 , 3 2 , 3 4 )
AES_ K E X P A N D 0 ( 2 8 , 3 4 , 3 6 )
AES_ K E X P A N D 2 ( 3 0 , 3 6 , 3 8 )
AES_ K E X P A N D 1 ( 3 2 , 3 8 , 0 x4 , 4 0 )
AES_ K E X P A N D 2 ( 3 4 , 4 0 , 4 2 )
AES_ K E X P A N D 0 ( 3 6 , 4 2 , 4 4 )
AES_ K E X P A N D 2 ( 3 8 , 4 4 , 4 6 )
AES_ K E X P A N D 1 ( 4 0 , 4 6 , 0 x5 , 4 8 )
AES_ K E X P A N D 2 ( 4 2 , 4 8 , 5 0 )
AES_ K E X P A N D 0 ( 4 4 , 5 0 , 5 2 )
AES_ K E X P A N D 2 ( 4 6 , 5 2 , 5 4 )
AES_ K E X P A N D 1 ( 4 8 , 5 4 , 0 x6 , 5 6 )
AES_ K E X P A N D 2 ( 5 0 , 5 6 , 5 8 )
std % f8 , [ % o 1 + 0 x00 ]
std % f10 , [ % o 1 + 0 x08 ]
std % f12 , [ % o 1 + 0 x10 ]
std % f14 , [ % o 1 + 0 x18 ]
std % f16 , [ % o 1 + 0 x20 ]
std % f18 , [ % o 1 + 0 x28 ]
std % f20 , [ % o 1 + 0 x30 ]
std % f22 , [ % o 1 + 0 x38 ]
std % f24 , [ % o 1 + 0 x40 ]
std % f26 , [ % o 1 + 0 x48 ]
std % f28 , [ % o 1 + 0 x50 ]
std % f30 , [ % o 1 + 0 x58 ]
std % f32 , [ % o 1 + 0 x60 ]
std % f34 , [ % o 1 + 0 x68 ]
std % f36 , [ % o 1 + 0 x70 ]
std % f38 , [ % o 1 + 0 x78 ]
std % f40 , [ % o 1 + 0 x80 ]
std % f42 , [ % o 1 + 0 x88 ]
std % f44 , [ % o 1 + 0 x90 ]
std % f46 , [ % o 1 + 0 x98 ]
std % f48 , [ % o 1 + 0 x a0 ]
std % f50 , [ % o 1 + 0 x a8 ]
std % f52 , [ % o 1 + 0 x b0 ]
std % f54 , [ % o 1 + 0 x b8 ]
std % f56 , [ % o 1 + 0 x c0 ]
ba,p t % x c c , 8 0 f
std % f58 , [ % o 1 + 0 x c8 ]
1 :
/* 192-bit key expansion */
ld [ % o 0 + 0 x10 ] , % f4
ld [ % o 0 + 0 x14 ] , % f5
std % f4 , [ % o 1 + 0 x00 ]
add % o 1 , 0 x08 , % o 1
AES_ K E X P A N D 1 ( 0 , 4 , 0 x0 , 6 )
AES_ K E X P A N D 2 ( 2 , 6 , 8 )
AES_ K E X P A N D 2 ( 4 , 8 , 1 0 )
AES_ K E X P A N D 1 ( 6 , 1 0 , 0 x1 , 1 2 )
AES_ K E X P A N D 2 ( 8 , 1 2 , 1 4 )
AES_ K E X P A N D 2 ( 1 0 , 1 4 , 1 6 )
AES_ K E X P A N D 1 ( 1 2 , 1 6 , 0 x2 , 1 8 )
AES_ K E X P A N D 2 ( 1 4 , 1 8 , 2 0 )
AES_ K E X P A N D 2 ( 1 6 , 2 0 , 2 2 )
AES_ K E X P A N D 1 ( 1 8 , 2 2 , 0 x3 , 2 4 )
AES_ K E X P A N D 2 ( 2 0 , 2 4 , 2 6 )
AES_ K E X P A N D 2 ( 2 2 , 2 6 , 2 8 )
AES_ K E X P A N D 1 ( 2 4 , 2 8 , 0 x4 , 3 0 )
AES_ K E X P A N D 2 ( 2 6 , 3 0 , 3 2 )
AES_ K E X P A N D 2 ( 2 8 , 3 2 , 3 4 )
AES_ K E X P A N D 1 ( 3 0 , 3 4 , 0 x5 , 3 6 )
AES_ K E X P A N D 2 ( 3 2 , 3 6 , 3 8 )
AES_ K E X P A N D 2 ( 3 4 , 3 8 , 4 0 )
AES_ K E X P A N D 1 ( 3 6 , 4 0 , 0 x6 , 4 2 )
AES_ K E X P A N D 2 ( 3 8 , 4 2 , 4 4 )
AES_ K E X P A N D 2 ( 4 0 , 4 4 , 4 6 )
AES_ K E X P A N D 1 ( 4 2 , 4 6 , 0 x7 , 4 8 )
AES_ K E X P A N D 2 ( 4 4 , 4 8 , 5 0 )
std % f6 , [ % o 1 + 0 x00 ]
std % f8 , [ % o 1 + 0 x08 ]
std % f10 , [ % o 1 + 0 x10 ]
std % f12 , [ % o 1 + 0 x18 ]
std % f14 , [ % o 1 + 0 x20 ]
std % f16 , [ % o 1 + 0 x28 ]
std % f18 , [ % o 1 + 0 x30 ]
std % f20 , [ % o 1 + 0 x38 ]
std % f22 , [ % o 1 + 0 x40 ]
std % f24 , [ % o 1 + 0 x48 ]
std % f26 , [ % o 1 + 0 x50 ]
std % f28 , [ % o 1 + 0 x58 ]
std % f30 , [ % o 1 + 0 x60 ]
std % f32 , [ % o 1 + 0 x68 ]
std % f34 , [ % o 1 + 0 x70 ]
std % f36 , [ % o 1 + 0 x78 ]
std % f38 , [ % o 1 + 0 x80 ]
std % f40 , [ % o 1 + 0 x88 ]
std % f42 , [ % o 1 + 0 x90 ]
std % f44 , [ % o 1 + 0 x98 ]
std % f46 , [ % o 1 + 0 x a0 ]
std % f48 , [ % o 1 + 0 x a8 ]
ba,p t % x c c , 8 0 f
std % f50 , [ % o 1 + 0 x b0 ]
2 :
/* 128-bit key expansion */
AES_ K E X P A N D 1 ( 0 , 2 , 0 x0 , 4 )
AES_ K E X P A N D 2 ( 2 , 4 , 6 )
AES_ K E X P A N D 1 ( 4 , 6 , 0 x1 , 8 )
AES_ K E X P A N D 2 ( 6 , 8 , 1 0 )
AES_ K E X P A N D 1 ( 8 , 1 0 , 0 x2 , 1 2 )
AES_ K E X P A N D 2 ( 1 0 , 1 2 , 1 4 )
AES_ K E X P A N D 1 ( 1 2 , 1 4 , 0 x3 , 1 6 )
AES_ K E X P A N D 2 ( 1 4 , 1 6 , 1 8 )
AES_ K E X P A N D 1 ( 1 6 , 1 8 , 0 x4 , 2 0 )
AES_ K E X P A N D 2 ( 1 8 , 2 0 , 2 2 )
AES_ K E X P A N D 1 ( 2 0 , 2 2 , 0 x5 , 2 4 )
AES_ K E X P A N D 2 ( 2 2 , 2 4 , 2 6 )
AES_ K E X P A N D 1 ( 2 4 , 2 6 , 0 x6 , 2 8 )
AES_ K E X P A N D 2 ( 2 6 , 2 8 , 3 0 )
AES_ K E X P A N D 1 ( 2 8 , 3 0 , 0 x7 , 3 2 )
AES_ K E X P A N D 2 ( 3 0 , 3 2 , 3 4 )
AES_ K E X P A N D 1 ( 3 2 , 3 4 , 0 x8 , 3 6 )
AES_ K E X P A N D 2 ( 3 4 , 3 6 , 3 8 )
AES_ K E X P A N D 1 ( 3 6 , 3 8 , 0 x9 , 4 0 )
AES_ K E X P A N D 2 ( 3 8 , 4 0 , 4 2 )
std % f4 , [ % o 1 + 0 x00 ]
std % f6 , [ % o 1 + 0 x08 ]
std % f8 , [ % o 1 + 0 x10 ]
std % f10 , [ % o 1 + 0 x18 ]
std % f12 , [ % o 1 + 0 x20 ]
std % f14 , [ % o 1 + 0 x28 ]
std % f16 , [ % o 1 + 0 x30 ]
std % f18 , [ % o 1 + 0 x38 ]
std % f20 , [ % o 1 + 0 x40 ]
std % f22 , [ % o 1 + 0 x48 ]
std % f24 , [ % o 1 + 0 x50 ]
std % f26 , [ % o 1 + 0 x58 ]
std % f28 , [ % o 1 + 0 x60 ]
std % f30 , [ % o 1 + 0 x68 ]
std % f32 , [ % o 1 + 0 x70 ]
std % f34 , [ % o 1 + 0 x78 ]
std % f36 , [ % o 1 + 0 x80 ]
std % f38 , [ % o 1 + 0 x88 ]
std % f40 , [ % o 1 + 0 x90 ]
std % f42 , [ % o 1 + 0 x98 ]
80 :
retl
VISExit
ENDPROC( a e s _ s p a r c64 _ k e y _ e x p a n d )
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e n c r y p t _ 1 2 8 )
/* %o0=key, %o1=input, %o2=output */
2012-08-21 03:58:13 -07:00
VISEntry
ld [ % o 1 + 0 x00 ] , % f4
ld [ % o 1 + 0 x04 ] , % f5
ld [ % o 1 + 0 x08 ] , % f6
ld [ % o 1 + 0 x0 c ] , % f7
ldd [ % o 0 + 0 x00 ] , % f8
ldd [ % o 0 + 0 x08 ] , % f10
2012-08-29 12:50:16 -07:00
ldd [ % o 0 + 0 x10 ] , % f12
ldd [ % o 0 + 0 x18 ] , % f14
ldd [ % o 0 + 0 x20 ] , % f16
ldd [ % o 0 + 0 x28 ] , % f18
ldd [ % o 0 + 0 x30 ] , % f20
ldd [ % o 0 + 0 x38 ] , % f22
ldd [ % o 0 + 0 x40 ] , % f24
ldd [ % o 0 + 0 x48 ] , % f26
ldd [ % o 0 + 0 x50 ] , % f28
ldd [ % o 0 + 0 x58 ] , % f30
ldd [ % o 0 + 0 x60 ] , % f32
ldd [ % o 0 + 0 x68 ] , % f34
ldd [ % o 0 + 0 x70 ] , % f36
ldd [ % o 0 + 0 x78 ] , % f38
ldd [ % o 0 + 0 x80 ] , % f40
ldd [ % o 0 + 0 x88 ] , % f42
ldd [ % o 0 + 0 x90 ] , % f44
ldd [ % o 0 + 0 x98 ] , % f46
ldd [ % o 0 + 0 x a0 ] , % f48
ldd [ % o 0 + 0 x a8 ] , % f50
2012-08-21 03:58:13 -07:00
fxor % f8 , % f4 , % f4
2012-08-29 12:50:16 -07:00
fxor % f10 , % f6 , % f6
ENCRYPT_ 1 2 8 ( 1 2 , 4 , 6 , 0 , 2 )
st % f4 , [ % o 2 + 0 x00 ]
st % f5 , [ % o 2 + 0 x04 ]
st % f6 , [ % o 2 + 0 x08 ]
st % f7 , [ % o 2 + 0 x0 c ]
retl
VISExit
ENDPROC( a e s _ s p a r c64 _ e n c r y p t _ 1 2 8 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e n c r y p t _ 1 9 2 )
/* %o0=key, %o1=input, %o2=output */
VISEntry
ld [ % o 1 + 0 x00 ] , % f4
ld [ % o 1 + 0 x04 ] , % f5
ld [ % o 1 + 0 x08 ] , % f6
ld [ % o 1 + 0 x0 c ] , % f7
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
ldd [ % o 0 + 0 x00 ] , % f8
ldd [ % o 0 + 0 x08 ] , % f10
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
fxor % f8 , % f4 , % f4
fxor % f10 , % f6 , % f6
2012-08-21 03:58:13 -07:00
ldd [ % o 0 + 0 x10 ] , % f8
ldd [ % o 0 + 0 x18 ] , % f10
ldd [ % o 0 + 0 x20 ] , % f12
ldd [ % o 0 + 0 x28 ] , % f14
add % o 0 , 0 x20 , % o 0
ENCRYPT_ T W O _ R O U N D S ( 8 , 4 , 6 , 0 , 2 )
ldd [ % o 0 + 0 x10 ] , % f12
ldd [ % o 0 + 0 x18 ] , % f14
ldd [ % o 0 + 0 x20 ] , % f16
ldd [ % o 0 + 0 x28 ] , % f18
ldd [ % o 0 + 0 x30 ] , % f20
ldd [ % o 0 + 0 x38 ] , % f22
ldd [ % o 0 + 0 x40 ] , % f24
ldd [ % o 0 + 0 x48 ] , % f26
ldd [ % o 0 + 0 x50 ] , % f28
ldd [ % o 0 + 0 x58 ] , % f30
ldd [ % o 0 + 0 x60 ] , % f32
ldd [ % o 0 + 0 x68 ] , % f34
ldd [ % o 0 + 0 x70 ] , % f36
ldd [ % o 0 + 0 x78 ] , % f38
ldd [ % o 0 + 0 x80 ] , % f40
ldd [ % o 0 + 0 x88 ] , % f42
ldd [ % o 0 + 0 x90 ] , % f44
ldd [ % o 0 + 0 x98 ] , % f46
ldd [ % o 0 + 0 x a0 ] , % f48
ldd [ % o 0 + 0 x a8 ] , % f50
ENCRYPT_ 1 2 8 ( 1 2 , 4 , 6 , 0 , 2 )
st % f4 , [ % o 2 + 0 x00 ]
st % f5 , [ % o 2 + 0 x04 ]
st % f6 , [ % o 2 + 0 x08 ]
st % f7 , [ % o 2 + 0 x0 c ]
retl
VISExit
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e n c r y p t _ 1 9 2 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e n c r y p t _ 2 5 6 )
/* %o0=key, %o1=input, %o2=output */
2012-08-21 03:58:13 -07:00
VISEntry
ld [ % o 1 + 0 x00 ] , % f4
ld [ % o 1 + 0 x04 ] , % f5
ld [ % o 1 + 0 x08 ] , % f6
ld [ % o 1 + 0 x0 c ] , % f7
2012-08-29 12:50:16 -07:00
ldd [ % o 0 + 0 x00 ] , % f8
ldd [ % o 0 + 0 x08 ] , % f10
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
fxor % f8 , % f4 , % f4
fxor % f10 , % f6 , % f6
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
ldd [ % o 0 + 0 x10 ] , % f8
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
ldd [ % o 0 + 0 x18 ] , % f10
ldd [ % o 0 + 0 x20 ] , % f12
ldd [ % o 0 + 0 x28 ] , % f14
add % o 0 , 0 x20 , % o 0
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
ENCRYPT_ T W O _ R O U N D S ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
ldd [ % o 0 + 0 x10 ] , % f8
ldd [ % o 0 + 0 x18 ] , % f10
ldd [ % o 0 + 0 x20 ] , % f12
ldd [ % o 0 + 0 x28 ] , % f14
add % o 0 , 0 x20 , % o 0
ENCRYPT_ T W O _ R O U N D S ( 8 , 4 , 6 , 0 , 2 )
ldd [ % o 0 + 0 x10 ] , % f12
ldd [ % o 0 + 0 x18 ] , % f14
ldd [ % o 0 + 0 x20 ] , % f16
ldd [ % o 0 + 0 x28 ] , % f18
ldd [ % o 0 + 0 x30 ] , % f20
ldd [ % o 0 + 0 x38 ] , % f22
ldd [ % o 0 + 0 x40 ] , % f24
ldd [ % o 0 + 0 x48 ] , % f26
ldd [ % o 0 + 0 x50 ] , % f28
ldd [ % o 0 + 0 x58 ] , % f30
ldd [ % o 0 + 0 x60 ] , % f32
ldd [ % o 0 + 0 x68 ] , % f34
ldd [ % o 0 + 0 x70 ] , % f36
ldd [ % o 0 + 0 x78 ] , % f38
ldd [ % o 0 + 0 x80 ] , % f40
ldd [ % o 0 + 0 x88 ] , % f42
ldd [ % o 0 + 0 x90 ] , % f44
ldd [ % o 0 + 0 x98 ] , % f46
ldd [ % o 0 + 0 x a0 ] , % f48
ldd [ % o 0 + 0 x a8 ] , % f50
ENCRYPT_ 1 2 8 ( 1 2 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
st % f4 , [ % o 2 + 0 x00 ]
st % f5 , [ % o 2 + 0 x04 ]
st % f6 , [ % o 2 + 0 x08 ]
st % f7 , [ % o 2 + 0 x0 c ]
retl
VISExit
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e n c r y p t _ 2 5 6 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ d e c r y p t _ 1 2 8 )
/* %o0=key, %o1=input, %o2=output */
VISEntry
ld [ % o 1 + 0 x00 ] , % f4
ld [ % o 1 + 0 x04 ] , % f5
ld [ % o 1 + 0 x08 ] , % f6
ld [ % o 1 + 0 x0 c ] , % f7
ldd [ % o 0 + 0 x a0 ] , % f8
ldd [ % o 0 + 0 x a8 ] , % f10
ldd [ % o 0 + 0 x98 ] , % f12
ldd [ % o 0 + 0 x90 ] , % f14
ldd [ % o 0 + 0 x88 ] , % f16
ldd [ % o 0 + 0 x80 ] , % f18
ldd [ % o 0 + 0 x78 ] , % f20
ldd [ % o 0 + 0 x70 ] , % f22
ldd [ % o 0 + 0 x68 ] , % f24
ldd [ % o 0 + 0 x60 ] , % f26
ldd [ % o 0 + 0 x58 ] , % f28
ldd [ % o 0 + 0 x50 ] , % f30
ldd [ % o 0 + 0 x48 ] , % f32
ldd [ % o 0 + 0 x40 ] , % f34
ldd [ % o 0 + 0 x38 ] , % f36
ldd [ % o 0 + 0 x30 ] , % f38
ldd [ % o 0 + 0 x28 ] , % f40
ldd [ % o 0 + 0 x20 ] , % f42
ldd [ % o 0 + 0 x18 ] , % f44
ldd [ % o 0 + 0 x10 ] , % f46
ldd [ % o 0 + 0 x08 ] , % f48
ldd [ % o 0 + 0 x00 ] , % f50
fxor % f8 , % f4 , % f4
fxor % f10 , % f6 , % f6
DECRYPT_ 1 2 8 ( 1 2 , 4 , 6 , 0 , 2 )
st % f4 , [ % o 2 + 0 x00 ]
st % f5 , [ % o 2 + 0 x04 ]
st % f6 , [ % o 2 + 0 x08 ]
st % f7 , [ % o 2 + 0 x0 c ]
retl
VISExit
ENDPROC( a e s _ s p a r c64 _ d e c r y p t _ 1 2 8 )
.align 32
ENTRY( a e s _ s p a r c64 _ d e c r y p t _ 1 9 2 )
/* %o0=key, %o1=input, %o2=output */
VISEntry
ld [ % o 1 + 0 x00 ] , % f4
ld [ % o 1 + 0 x04 ] , % f5
ld [ % o 1 + 0 x08 ] , % f6
ld [ % o 1 + 0 x0 c ] , % f7
ldd [ % o 0 + 0 x c0 ] , % f8
ldd [ % o 0 + 0 x c8 ] , % f10
ldd [ % o 0 + 0 x b8 ] , % f12
ldd [ % o 0 + 0 x b0 ] , % f14
ldd [ % o 0 + 0 x a8 ] , % f16
ldd [ % o 0 + 0 x a0 ] , % f18
fxor % f8 , % f4 , % f4
fxor % f10 , % f6 , % f6
ldd [ % o 0 + 0 x98 ] , % f20
ldd [ % o 0 + 0 x90 ] , % f22
ldd [ % o 0 + 0 x88 ] , % f24
ldd [ % o 0 + 0 x80 ] , % f26
DECRYPT_ T W O _ R O U N D S ( 1 2 , 4 , 6 , 0 , 2 )
ldd [ % o 0 + 0 x78 ] , % f28
ldd [ % o 0 + 0 x70 ] , % f30
ldd [ % o 0 + 0 x68 ] , % f32
ldd [ % o 0 + 0 x60 ] , % f34
ldd [ % o 0 + 0 x58 ] , % f36
ldd [ % o 0 + 0 x50 ] , % f38
ldd [ % o 0 + 0 x48 ] , % f40
ldd [ % o 0 + 0 x40 ] , % f42
ldd [ % o 0 + 0 x38 ] , % f44
ldd [ % o 0 + 0 x30 ] , % f46
ldd [ % o 0 + 0 x28 ] , % f48
ldd [ % o 0 + 0 x20 ] , % f50
ldd [ % o 0 + 0 x18 ] , % f52
ldd [ % o 0 + 0 x10 ] , % f54
ldd [ % o 0 + 0 x08 ] , % f56
ldd [ % o 0 + 0 x00 ] , % f58
DECRYPT_ 1 2 8 ( 2 0 , 4 , 6 , 0 , 2 )
st % f4 , [ % o 2 + 0 x00 ]
st % f5 , [ % o 2 + 0 x04 ]
st % f6 , [ % o 2 + 0 x08 ]
st % f7 , [ % o 2 + 0 x0 c ]
retl
VISExit
ENDPROC( a e s _ s p a r c64 _ d e c r y p t _ 1 9 2 )
.align 32
ENTRY( a e s _ s p a r c64 _ d e c r y p t _ 2 5 6 )
/* %o0=key, %o1=input, %o2=output */
VISEntry
ld [ % o 1 + 0 x00 ] , % f4
ld [ % o 1 + 0 x04 ] , % f5
ld [ % o 1 + 0 x08 ] , % f6
ld [ % o 1 + 0 x0 c ] , % f7
ldd [ % o 0 + 0 x e 0 ] , % f8
ldd [ % o 0 + 0 x e 8 ] , % f10
ldd [ % o 0 + 0 x d8 ] , % f12
ldd [ % o 0 + 0 x d0 ] , % f14
ldd [ % o 0 + 0 x c8 ] , % f16
fxor % f8 , % f4 , % f4
ldd [ % o 0 + 0 x c0 ] , % f18
fxor % f10 , % f6 , % f6
ldd [ % o 0 + 0 x b8 ] , % f20
AES_ D R O U N D 2 3 ( 1 2 , 4 , 6 , 2 )
ldd [ % o 0 + 0 x b0 ] , % f22
AES_ D R O U N D 0 1 ( 1 4 , 4 , 6 , 0 )
ldd [ % o 0 + 0 x a8 ] , % f24
AES_ D R O U N D 2 3 ( 1 6 , 0 , 2 , 6 )
ldd [ % o 0 + 0 x a0 ] , % f26
AES_ D R O U N D 0 1 ( 1 8 , 0 , 2 , 4 )
ldd [ % o 0 + 0 x98 ] , % f12
AES_ D R O U N D 2 3 ( 2 0 , 4 , 6 , 2 )
ldd [ % o 0 + 0 x90 ] , % f14
AES_ D R O U N D 0 1 ( 2 2 , 4 , 6 , 0 )
ldd [ % o 0 + 0 x88 ] , % f16
AES_ D R O U N D 2 3 ( 2 4 , 0 , 2 , 6 )
ldd [ % o 0 + 0 x80 ] , % f18
AES_ D R O U N D 0 1 ( 2 6 , 0 , 2 , 4 )
ldd [ % o 0 + 0 x78 ] , % f20
AES_ D R O U N D 2 3 ( 1 2 , 4 , 6 , 2 )
ldd [ % o 0 + 0 x70 ] , % f22
AES_ D R O U N D 0 1 ( 1 4 , 4 , 6 , 0 )
ldd [ % o 0 + 0 x68 ] , % f24
AES_ D R O U N D 2 3 ( 1 6 , 0 , 2 , 6 )
ldd [ % o 0 + 0 x60 ] , % f26
AES_ D R O U N D 0 1 ( 1 8 , 0 , 2 , 4 )
ldd [ % o 0 + 0 x58 ] , % f28
AES_ D R O U N D 2 3 ( 2 0 , 4 , 6 , 2 )
ldd [ % o 0 + 0 x50 ] , % f30
AES_ D R O U N D 0 1 ( 2 2 , 4 , 6 , 0 )
ldd [ % o 0 + 0 x48 ] , % f32
AES_ D R O U N D 2 3 ( 2 4 , 0 , 2 , 6 )
ldd [ % o 0 + 0 x40 ] , % f34
AES_ D R O U N D 0 1 ( 2 6 , 0 , 2 , 4 )
ldd [ % o 0 + 0 x38 ] , % f36
AES_ D R O U N D 2 3 ( 2 8 , 4 , 6 , 2 )
ldd [ % o 0 + 0 x30 ] , % f38
AES_ D R O U N D 0 1 ( 3 0 , 4 , 6 , 0 )
ldd [ % o 0 + 0 x28 ] , % f40
AES_ D R O U N D 2 3 ( 3 2 , 0 , 2 , 6 )
ldd [ % o 0 + 0 x20 ] , % f42
AES_ D R O U N D 0 1 ( 3 4 , 0 , 2 , 4 )
ldd [ % o 0 + 0 x18 ] , % f44
AES_ D R O U N D 2 3 ( 3 6 , 4 , 6 , 2 )
ldd [ % o 0 + 0 x10 ] , % f46
AES_ D R O U N D 0 1 ( 3 8 , 4 , 6 , 0 )
ldd [ % o 0 + 0 x08 ] , % f48
AES_ D R O U N D 2 3 ( 4 0 , 0 , 2 , 6 )
ldd [ % o 0 + 0 x00 ] , % f50
AES_ D R O U N D 0 1 ( 4 2 , 0 , 2 , 4 )
AES_ D R O U N D 2 3 ( 4 4 , 4 , 6 , 2 )
AES_ D R O U N D 0 1 ( 4 6 , 4 , 6 , 0 )
AES_ D R O U N D 2 3 _ L ( 4 8 , 0 , 2 , 6 )
AES_ D R O U N D 0 1 _ L ( 5 0 , 0 , 2 , 4 )
st % f4 , [ % o 2 + 0 x00 ]
st % f5 , [ % o 2 + 0 x04 ]
st % f6 , [ % o 2 + 0 x08 ]
st % f7 , [ % o 2 + 0 x0 c ]
retl
VISExit
ENDPROC( a e s _ s p a r c64 _ d e c r y p t _ 2 5 6 )
.align 32
ENTRY( a e s _ s p a r c64 _ l o a d _ e n c r y p t _ k e y s _ 1 2 8 )
2012-08-21 03:58:13 -07:00
/* %o0=key */
2012-08-29 12:50:16 -07:00
VISEntry
ldd [ % o 0 + 0 x10 ] , % f8
ldd [ % o 0 + 0 x18 ] , % f10
ldd [ % o 0 + 0 x20 ] , % f12
ldd [ % o 0 + 0 x28 ] , % f14
ldd [ % o 0 + 0 x30 ] , % f16
ldd [ % o 0 + 0 x38 ] , % f18
ldd [ % o 0 + 0 x40 ] , % f20
ldd [ % o 0 + 0 x48 ] , % f22
ldd [ % o 0 + 0 x50 ] , % f24
ldd [ % o 0 + 0 x58 ] , % f26
ldd [ % o 0 + 0 x60 ] , % f28
ldd [ % o 0 + 0 x68 ] , % f30
ldd [ % o 0 + 0 x70 ] , % f32
ldd [ % o 0 + 0 x78 ] , % f34
ldd [ % o 0 + 0 x80 ] , % f36
ldd [ % o 0 + 0 x88 ] , % f38
ldd [ % o 0 + 0 x90 ] , % f40
ldd [ % o 0 + 0 x98 ] , % f42
ldd [ % o 0 + 0 x a0 ] , % f44
retl
ldd [ % o 0 + 0 x a8 ] , % f46
ENDPROC( a e s _ s p a r c64 _ l o a d _ e n c r y p t _ k e y s _ 1 2 8 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ l o a d _ e n c r y p t _ k e y s _ 1 9 2 )
/* %o0=key */
VISEntry
ldd [ % o 0 + 0 x10 ] , % f8
ldd [ % o 0 + 0 x18 ] , % f10
ldd [ % o 0 + 0 x20 ] , % f12
ldd [ % o 0 + 0 x28 ] , % f14
ldd [ % o 0 + 0 x30 ] , % f16
ldd [ % o 0 + 0 x38 ] , % f18
ldd [ % o 0 + 0 x40 ] , % f20
ldd [ % o 0 + 0 x48 ] , % f22
ldd [ % o 0 + 0 x50 ] , % f24
ldd [ % o 0 + 0 x58 ] , % f26
ldd [ % o 0 + 0 x60 ] , % f28
ldd [ % o 0 + 0 x68 ] , % f30
ldd [ % o 0 + 0 x70 ] , % f32
ldd [ % o 0 + 0 x78 ] , % f34
ldd [ % o 0 + 0 x80 ] , % f36
ldd [ % o 0 + 0 x88 ] , % f38
ldd [ % o 0 + 0 x90 ] , % f40
ldd [ % o 0 + 0 x98 ] , % f42
ldd [ % o 0 + 0 x a0 ] , % f44
ldd [ % o 0 + 0 x a8 ] , % f46
ldd [ % o 0 + 0 x b0 ] , % f48
ldd [ % o 0 + 0 x b8 ] , % f50
ldd [ % o 0 + 0 x c0 ] , % f52
retl
ldd [ % o 0 + 0 x c8 ] , % f54
ENDPROC( a e s _ s p a r c64 _ l o a d _ e n c r y p t _ k e y s _ 1 9 2 )
.align 32
ENTRY( a e s _ s p a r c64 _ l o a d _ e n c r y p t _ k e y s _ 2 5 6 )
2012-08-21 03:58:13 -07:00
/* %o0=key */
VISEntry
ldd [ % o 0 + 0 x10 ] , % f8
ldd [ % o 0 + 0 x18 ] , % f10
ldd [ % o 0 + 0 x20 ] , % f12
ldd [ % o 0 + 0 x28 ] , % f14
ldd [ % o 0 + 0 x30 ] , % f16
ldd [ % o 0 + 0 x38 ] , % f18
ldd [ % o 0 + 0 x40 ] , % f20
ldd [ % o 0 + 0 x48 ] , % f22
ldd [ % o 0 + 0 x50 ] , % f24
ldd [ % o 0 + 0 x58 ] , % f26
ldd [ % o 0 + 0 x60 ] , % f28
ldd [ % o 0 + 0 x68 ] , % f30
ldd [ % o 0 + 0 x70 ] , % f32
ldd [ % o 0 + 0 x78 ] , % f34
ldd [ % o 0 + 0 x80 ] , % f36
ldd [ % o 0 + 0 x88 ] , % f38
ldd [ % o 0 + 0 x90 ] , % f40
ldd [ % o 0 + 0 x98 ] , % f42
ldd [ % o 0 + 0 x a0 ] , % f44
ldd [ % o 0 + 0 x a8 ] , % f46
ldd [ % o 0 + 0 x b0 ] , % f48
ldd [ % o 0 + 0 x b8 ] , % f50
ldd [ % o 0 + 0 x c0 ] , % f52
ldd [ % o 0 + 0 x c8 ] , % f54
ldd [ % o 0 + 0 x d0 ] , % f56
ldd [ % o 0 + 0 x d8 ] , % f58
ldd [ % o 0 + 0 x e 0 ] , % f60
retl
ldd [ % o 0 + 0 x e 8 ] , % f62
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ l o a d _ e n c r y p t _ k e y s _ 2 5 6 )
.align 32
ENTRY( a e s _ s p a r c64 _ l o a d _ d e c r y p t _ k e y s _ 1 2 8 )
/* %o0=key */
VISEntry
ldd [ % o 0 + 0 x98 ] , % f8
ldd [ % o 0 + 0 x90 ] , % f10
ldd [ % o 0 + 0 x88 ] , % f12
ldd [ % o 0 + 0 x80 ] , % f14
ldd [ % o 0 + 0 x78 ] , % f16
ldd [ % o 0 + 0 x70 ] , % f18
ldd [ % o 0 + 0 x68 ] , % f20
ldd [ % o 0 + 0 x60 ] , % f22
ldd [ % o 0 + 0 x58 ] , % f24
ldd [ % o 0 + 0 x50 ] , % f26
ldd [ % o 0 + 0 x48 ] , % f28
ldd [ % o 0 + 0 x40 ] , % f30
ldd [ % o 0 + 0 x38 ] , % f32
ldd [ % o 0 + 0 x30 ] , % f34
ldd [ % o 0 + 0 x28 ] , % f36
ldd [ % o 0 + 0 x20 ] , % f38
ldd [ % o 0 + 0 x18 ] , % f40
ldd [ % o 0 + 0 x10 ] , % f42
ldd [ % o 0 + 0 x08 ] , % f44
retl
ldd [ % o 0 + 0 x00 ] , % f46
ENDPROC( a e s _ s p a r c64 _ l o a d _ d e c r y p t _ k e y s _ 1 2 8 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ l o a d _ d e c r y p t _ k e y s _ 1 9 2 )
/* %o0=key */
VISEntry
ldd [ % o 0 + 0 x b8 ] , % f8
ldd [ % o 0 + 0 x b0 ] , % f10
ldd [ % o 0 + 0 x a8 ] , % f12
ldd [ % o 0 + 0 x a0 ] , % f14
ldd [ % o 0 + 0 x98 ] , % f16
ldd [ % o 0 + 0 x90 ] , % f18
ldd [ % o 0 + 0 x88 ] , % f20
ldd [ % o 0 + 0 x80 ] , % f22
ldd [ % o 0 + 0 x78 ] , % f24
ldd [ % o 0 + 0 x70 ] , % f26
ldd [ % o 0 + 0 x68 ] , % f28
ldd [ % o 0 + 0 x60 ] , % f30
ldd [ % o 0 + 0 x58 ] , % f32
ldd [ % o 0 + 0 x50 ] , % f34
ldd [ % o 0 + 0 x48 ] , % f36
ldd [ % o 0 + 0 x40 ] , % f38
ldd [ % o 0 + 0 x38 ] , % f40
ldd [ % o 0 + 0 x30 ] , % f42
ldd [ % o 0 + 0 x28 ] , % f44
ldd [ % o 0 + 0 x20 ] , % f46
ldd [ % o 0 + 0 x18 ] , % f48
ldd [ % o 0 + 0 x10 ] , % f50
ldd [ % o 0 + 0 x08 ] , % f52
retl
ldd [ % o 0 + 0 x00 ] , % f54
ENDPROC( a e s _ s p a r c64 _ l o a d _ d e c r y p t _ k e y s _ 1 9 2 )
.align 32
ENTRY( a e s _ s p a r c64 _ l o a d _ d e c r y p t _ k e y s _ 2 5 6 )
/* %o0=key */
VISEntry
ldd [ % o 0 + 0 x d8 ] , % f8
ldd [ % o 0 + 0 x d0 ] , % f10
ldd [ % o 0 + 0 x c8 ] , % f12
ldd [ % o 0 + 0 x c0 ] , % f14
ldd [ % o 0 + 0 x b8 ] , % f16
ldd [ % o 0 + 0 x b0 ] , % f18
ldd [ % o 0 + 0 x a8 ] , % f20
ldd [ % o 0 + 0 x a0 ] , % f22
ldd [ % o 0 + 0 x98 ] , % f24
ldd [ % o 0 + 0 x90 ] , % f26
ldd [ % o 0 + 0 x88 ] , % f28
ldd [ % o 0 + 0 x80 ] , % f30
ldd [ % o 0 + 0 x78 ] , % f32
ldd [ % o 0 + 0 x70 ] , % f34
ldd [ % o 0 + 0 x68 ] , % f36
ldd [ % o 0 + 0 x60 ] , % f38
ldd [ % o 0 + 0 x58 ] , % f40
ldd [ % o 0 + 0 x50 ] , % f42
ldd [ % o 0 + 0 x48 ] , % f44
ldd [ % o 0 + 0 x40 ] , % f46
ldd [ % o 0 + 0 x38 ] , % f48
ldd [ % o 0 + 0 x30 ] , % f50
ldd [ % o 0 + 0 x28 ] , % f52
ldd [ % o 0 + 0 x20 ] , % f54
ldd [ % o 0 + 0 x18 ] , % f56
ldd [ % o 0 + 0 x10 ] , % f58
ldd [ % o 0 + 0 x08 ] , % f60
retl
ldd [ % o 0 + 0 x00 ] , % f62
ENDPROC( a e s _ s p a r c64 _ l o a d _ d e c r y p t _ k e y s _ 2 5 6 )
.align 32
ENTRY( a e s _ s p a r c64 _ e c b _ e n c r y p t _ 1 2 8 )
/* %o0=key, %o1=input, %o2=output, %o3=len */
2012-08-21 03:58:13 -07:00
ldx [ % o 0 + 0 x00 ] , % g 1
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
subcc % o 3 , 0 x10 , % o 3
be 1 0 f
ldx [ % o 0 + 0 x08 ] , % g 2
2012-08-29 12:50:16 -07:00
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
ldx [ % o 1 + 0 x10 ] , % o 4
ldx [ % o 1 + 0 x18 ] , % o 5
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
xor % g 1 , % o 4 , % g 3
xor % g 2 , % o 5 , % g 7
MOVXTOD_ G 3 _ F 6 0
MOVXTOD_ G 7 _ F 6 2
ENCRYPT_ 1 2 8 _ 2 ( 8 , 4 , 6 , 6 0 , 6 2 , 0 , 2 , 5 6 , 5 8 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
std % f60 , [ % o 2 + 0 x10 ]
std % f62 , [ % o 2 + 0 x18 ]
sub % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
10 : ldx [ % o 1 + 0 x00 ] , % g 3
ldx [ % o 1 + 0 x08 ] , % g 7
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
ENCRYPT_ 1 2 8 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
11 : retl
2012-08-21 03:58:13 -07:00
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e c b _ e n c r y p t _ 1 2 8 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e c b _ e n c r y p t _ 1 9 2 )
/* %o0=key, %o1=input, %o2=output, %o3=len */
ldx [ % o 0 + 0 x00 ] , % g 1
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
subcc % o 3 , 0 x10 , % o 3
be 1 0 f
ldx [ % o 0 + 0 x08 ] , % g 2
2012-08-29 12:50:16 -07:00
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
ldx [ % o 1 + 0 x10 ] , % o 4
ldx [ % o 1 + 0 x18 ] , % o 5
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
xor % g 1 , % o 4 , % g 3
xor % g 2 , % o 5 , % g 7
MOVXTOD_ G 3 _ F 6 0
MOVXTOD_ G 7 _ F 6 2
ENCRYPT_ 1 9 2 _ 2 ( 8 , 4 , 6 , 6 0 , 6 2 , 0 , 2 , 5 6 , 5 8 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
std % f60 , [ % o 2 + 0 x10 ]
std % f62 , [ % o 2 + 0 x18 ]
sub % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
10 : ldx [ % o 1 + 0 x00 ] , % g 3
ldx [ % o 1 + 0 x08 ] , % g 7
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
ENCRYPT_ 1 9 2 ( 8 , 4 , 6 , 0 , 2 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
11 : retl
2012-08-21 03:58:13 -07:00
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e c b _ e n c r y p t _ 1 9 2 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e c b _ e n c r y p t _ 2 5 6 )
/* %o0=key, %o1=input, %o2=output, %o3=len */
ldx [ % o 0 + 0 x00 ] , % g 1
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
subcc % o 3 , 0 x10 , % o 3
be 1 0 f
ldx [ % o 0 + 0 x08 ] , % g 2
2012-08-29 12:50:16 -07:00
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
ldx [ % o 1 + 0 x10 ] , % o 4
ldx [ % o 1 + 0 x18 ] , % o 5
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
xor % g 1 , % o 4 , % g 3
xor % g 2 , % o 5 , % g 7
MOVXTOD_ G 3 _ F 0
MOVXTOD_ G 7 _ F 2
ENCRYPT_ 2 5 6 _ 2 ( 8 , 4 , 6 , 0 , 2 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
std % f0 , [ % o 2 + 0 x10 ]
std % f2 , [ % o 2 + 0 x18 ]
sub % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
2012-12-19 15:19:11 -08:00
10 : ldd [ % o 0 + 0 x d0 ] , % f56
ldd [ % o 0 + 0 x d8 ] , % f58
ldd [ % o 0 + 0 x e 0 ] , % f60
ldd [ % o 0 + 0 x e 8 ] , % f62
ldx [ % o 1 + 0 x00 ] , % g 3
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
ENCRYPT_ 2 5 6 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll ECB encryption loops in AES driver.
The AES opcodes have a 3 cycle latency, so by doing 32-bytes at a
time we avoid a pipeline bubble in between every round.
For the 256-bit key case, it looks like we're doing more work in
order to reload the KEY registers during the loop to make space
for scarce temporaries. But the load dual issues with the AES
operations so we get the KEY reloads essentially for free.
Before:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 264 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 329 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 715 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4248 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 221 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 359 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 803 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5366 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 379 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6041 cycles (8192 bytes)
After:
testing speed of ecb(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 266 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 256 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 305 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 676 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3981 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 766 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5136 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 268 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 368 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 890 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5718 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 07:51:32 -07:00
11 : retl
2012-08-21 03:58:13 -07:00
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e c b _ e n c r y p t _ 2 5 6 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e c b _ d e c r y p t _ 1 2 8 )
/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len */
2012-08-21 03:58:13 -07:00
ldx [ % o 0 - 0 x10 ] , % g 1
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
subcc % o 3 , 0 x10 , % o 3
be 1 0 f
ldx [ % o 0 - 0 x08 ] , % g 2
2012-08-29 12:50:16 -07:00
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
ldx [ % o 1 + 0 x10 ] , % o 4
ldx [ % o 1 + 0 x18 ] , % o 5
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
xor % g 1 , % o 4 , % g 3
xor % g 2 , % o 5 , % g 7
MOVXTOD_ G 3 _ F 6 0
MOVXTOD_ G 7 _ F 6 2
DECRYPT_ 1 2 8 _ 2 ( 8 , 4 , 6 , 6 0 , 6 2 , 0 , 2 , 5 6 , 5 8 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
std % f60 , [ % o 2 + 0 x10 ]
std % f62 , [ % o 2 + 0 x18 ]
sub % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz,p t % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
10 : ldx [ % o 1 + 0 x00 ] , % g 3
ldx [ % o 1 + 0 x08 ] , % g 7
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
DECRYPT_ 1 2 8 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
11 : retl
2012-08-21 03:58:13 -07:00
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e c b _ d e c r y p t _ 1 2 8 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e c b _ d e c r y p t _ 1 9 2 )
/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len */
ldx [ % o 0 - 0 x10 ] , % g 1
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
subcc % o 3 , 0 x10 , % o 3
be 1 0 f
ldx [ % o 0 - 0 x08 ] , % g 2
2012-08-29 12:50:16 -07:00
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
ldx [ % o 1 + 0 x10 ] , % o 4
ldx [ % o 1 + 0 x18 ] , % o 5
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
xor % g 1 , % o 4 , % g 3
xor % g 2 , % o 5 , % g 7
MOVXTOD_ G 3 _ F 6 0
MOVXTOD_ G 7 _ F 6 2
DECRYPT_ 1 9 2 _ 2 ( 8 , 4 , 6 , 6 0 , 6 2 , 0 , 2 , 5 6 , 5 8 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
std % f60 , [ % o 2 + 0 x10 ]
std % f62 , [ % o 2 + 0 x18 ]
sub % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz,p t % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
10 : ldx [ % o 1 + 0 x00 ] , % g 3
ldx [ % o 1 + 0 x08 ] , % g 7
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
DECRYPT_ 1 9 2 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
11 : retl
2012-08-21 03:58:13 -07:00
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e c b _ d e c r y p t _ 1 9 2 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ e c b _ d e c r y p t _ 2 5 6 )
/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len */
ldx [ % o 0 - 0 x10 ] , % g 1
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
subcc % o 3 , 0 x10 , % o 3
2012-12-19 15:19:11 -08:00
ldx [ % o 0 - 0 x08 ] , % g 2
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
be 1 0 f
2012-12-19 15:19:11 -08:00
sub % o 0 , 0 x f0 , % o 0
2012-08-29 12:50:16 -07:00
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
ldx [ % o 1 + 0 x10 ] , % o 4
ldx [ % o 1 + 0 x18 ] , % o 5
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
xor % g 1 , % o 4 , % g 3
xor % g 2 , % o 5 , % g 7
MOVXTOD_ G 3 _ F 0
MOVXTOD_ G 7 _ F 2
DECRYPT_ 2 5 6 _ 2 ( 8 , 4 , 6 , 0 , 2 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
2012-09-01 23:05:43 -07:00
std % f0 , [ % o 2 + 0 x10 ]
std % f2 , [ % o 2 + 0 x18 ]
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
sub % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz,p t % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
2012-12-19 15:19:11 -08:00
10 : ldd [ % o 0 + 0 x18 ] , % f56
ldd [ % o 0 + 0 x10 ] , % f58
ldd [ % o 0 + 0 x08 ] , % f60
ldd [ % o 0 + 0 x00 ] , % f62
ldx [ % o 1 + 0 x00 ] , % g 3
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
DECRYPT_ 2 5 6 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll ECB decryption loops in AES driver.
Before:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 223 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 230 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 325 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 719 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4266 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 234 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 353 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 808 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5344 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 243 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 393 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6039 cycles (8192 bytes)
After:
testing speed of ecb(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 226 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 231 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 313 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 681 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 3964 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 205 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 341 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 770 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5050 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 216 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 250 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 371 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 869 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 5494 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:11:01 -07:00
11 : retl
2012-08-21 03:58:13 -07:00
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ e c b _ d e c r y p t _ 2 5 6 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ c b c _ e n c r y p t _ 1 2 8 )
/* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */
ldd [ % o 4 + 0 x00 ] , % f4
ldd [ % o 4 + 0 x08 ] , % f6
2012-08-21 03:58:13 -07:00
ldx [ % o 0 + 0 x00 ] , % g 1
ldx [ % o 0 + 0 x08 ] , % g 2
2012-08-29 12:50:16 -07:00
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
add % o 1 , 0 x10 , % o 1
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 0
MOVXTOD_ G 7 _ F 2
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
2012-08-29 12:50:16 -07:00
ENCRYPT_ 1 2 8 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
2012-08-29 12:50:16 -07:00
subcc % o 3 , 0 x10 , % o 3
bne,p t % x c c , 1 b
2012-08-21 03:58:13 -07:00
add % o 2 , 0 x10 , % o 2
2012-08-29 12:50:16 -07:00
std % f4 , [ % o 4 + 0 x00 ]
std % f6 , [ % o 4 + 0 x08 ]
2012-08-21 03:58:13 -07:00
retl
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ c b c _ e n c r y p t _ 1 2 8 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ c b c _ e n c r y p t _ 1 9 2 )
/* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */
ldd [ % o 4 + 0 x00 ] , % f4
ldd [ % o 4 + 0 x08 ] , % f6
ldx [ % o 0 + 0 x00 ] , % g 1
ldx [ % o 0 + 0 x08 ] , % g 2
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
add % o 1 , 0 x10 , % o 1
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 0
MOVXTOD_ G 7 _ F 2
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
ENCRYPT_ 1 9 2 ( 8 , 4 , 6 , 0 , 2 )
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
2012-08-29 12:50:16 -07:00
subcc % o 3 , 0 x10 , % o 3
2012-08-21 03:58:13 -07:00
bne,p t % x c c , 1 b
add % o 2 , 0 x10 , % o 2
2012-08-29 12:50:16 -07:00
std % f4 , [ % o 4 + 0 x00 ]
std % f6 , [ % o 4 + 0 x08 ]
2012-08-21 03:58:13 -07:00
retl
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ c b c _ e n c r y p t _ 1 9 2 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ c b c _ e n c r y p t _ 2 5 6 )
/* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */
ldd [ % o 4 + 0 x00 ] , % f4
ldd [ % o 4 + 0 x08 ] , % f6
ldx [ % o 0 + 0 x00 ] , % g 1
ldx [ % o 0 + 0 x08 ] , % g 2
1 : ldx [ % o 1 + 0 x00 ] , % g 3
2012-08-21 03:58:13 -07:00
ldx [ % o 1 + 0 x08 ] , % g 7
add % o 1 , 0 x10 , % o 1
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 0
MOVXTOD_ G 7 _ F 2
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
2012-08-29 12:50:16 -07:00
ENCRYPT_ 2 5 6 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
2012-08-29 12:50:16 -07:00
subcc % o 3 , 0 x10 , % o 3
bne,p t % x c c , 1 b
2012-08-21 03:58:13 -07:00
add % o 2 , 0 x10 , % o 2
2012-08-29 12:50:16 -07:00
std % f4 , [ % o 4 + 0 x00 ]
std % f6 , [ % o 4 + 0 x08 ]
2012-08-21 03:58:13 -07:00
retl
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ c b c _ e n c r y p t _ 2 5 6 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ c b c _ d e c r y p t _ 1 2 8 )
/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len, %o4=iv */
2012-08-21 03:58:13 -07:00
ldx [ % o 0 - 0 x10 ] , % g 1
ldx [ % o 0 - 0 x08 ] , % g 2
2012-08-29 12:50:16 -07:00
ldx [ % o 4 + 0 x00 ] , % o 0
ldx [ % o 4 + 0 x08 ] , % o 5
1 : ldx [ % o 1 + 0 x00 ] , % g 3
ldx [ % o 1 + 0 x08 ] , % g 7
add % o 1 , 0 x10 , % o 1
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
DECRYPT_ 1 2 8 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
MOVXTOD_ O 0 _ F 0
2012-08-29 12:50:16 -07:00
MOVXTOD_ O 5 _ F 2
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % o 0
2012-08-29 12:50:16 -07:00
xor % g 2 , % g 7 , % o 5
2012-08-21 03:58:13 -07:00
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
2012-08-29 12:50:16 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
subcc % o 3 , 0 x10 , % o 3
bne,p t % x c c , 1 b
add % o 2 , 0 x10 , % o 2
stx % o 0 , [ % o 4 + 0 x00 ]
stx % o 5 , [ % o 4 + 0 x08 ]
2012-08-21 03:58:13 -07:00
retl
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ c b c _ d e c r y p t _ 1 2 8 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ c b c _ d e c r y p t _ 1 9 2 )
/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len, %o4=iv */
ldx [ % o 0 - 0 x10 ] , % g 1
ldx [ % o 0 - 0 x08 ] , % g 2
ldx [ % o 4 + 0 x00 ] , % o 0
ldx [ % o 4 + 0 x08 ] , % o 5
1 : ldx [ % o 1 + 0 x00 ] , % g 3
ldx [ % o 1 + 0 x08 ] , % g 7
add % o 1 , 0 x10 , % o 1
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
DECRYPT_ 1 9 2 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
MOVXTOD_ O 0 _ F 0
2012-08-29 12:50:16 -07:00
MOVXTOD_ O 5 _ F 2
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % o 0
2012-08-29 12:50:16 -07:00
xor % g 2 , % g 7 , % o 5
2012-08-21 03:58:13 -07:00
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
2012-08-29 12:50:16 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
subcc % o 3 , 0 x10 , % o 3
2012-08-21 03:58:13 -07:00
bne,p t % x c c , 1 b
2012-08-29 12:50:16 -07:00
add % o 2 , 0 x10 , % o 2
stx % o 0 , [ % o 4 + 0 x00 ]
stx % o 5 , [ % o 4 + 0 x08 ]
2012-08-21 03:58:13 -07:00
retl
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ c b c _ d e c r y p t _ 1 9 2 )
2012-08-21 03:58:13 -07:00
2012-08-29 12:50:16 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ c b c _ d e c r y p t _ 2 5 6 )
/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len, %o4=iv */
ldx [ % o 0 - 0 x10 ] , % g 1
ldx [ % o 0 - 0 x08 ] , % g 2
ldx [ % o 4 + 0 x00 ] , % o 0
ldx [ % o 4 + 0 x08 ] , % o 5
1 : ldx [ % o 1 + 0 x00 ] , % g 3
ldx [ % o 1 + 0 x08 ] , % g 7
add % o 1 , 0 x10 , % o 1
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % g 3
xor % g 2 , % g 7 , % g 7
MOVXTOD_ G 3 _ F 4
MOVXTOD_ G 7 _ F 6
2012-08-29 12:50:16 -07:00
DECRYPT_ 2 5 6 ( 8 , 4 , 6 , 0 , 2 )
2012-08-21 03:58:13 -07:00
MOVXTOD_ O 0 _ F 0
2012-08-29 12:50:16 -07:00
MOVXTOD_ O 5 _ F 2
2012-08-21 03:58:13 -07:00
xor % g 1 , % g 3 , % o 0
2012-08-29 12:50:16 -07:00
xor % g 2 , % g 7 , % o 5
2012-08-21 03:58:13 -07:00
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
2012-08-29 12:50:16 -07:00
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
subcc % o 3 , 0 x10 , % o 3
bne,p t % x c c , 1 b
add % o 2 , 0 x10 , % o 2
stx % o 0 , [ % o 4 + 0 x00 ]
stx % o 5 , [ % o 4 + 0 x08 ]
2012-08-21 03:58:13 -07:00
retl
nop
2012-08-29 12:50:16 -07:00
ENDPROC( a e s _ s p a r c64 _ c b c _ d e c r y p t _ 2 5 6 )
2012-08-29 14:49:23 -07:00
.align 32
ENTRY( a e s _ s p a r c64 _ c t r _ c r y p t _ 1 2 8 )
/* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */
ldx [ % o 4 + 0 x00 ] , % g 3
ldx [ % o 4 + 0 x08 ] , % g 7
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
subcc % o 3 , 0 x10 , % o 3
2012-08-29 14:49:23 -07:00
ldx [ % o 0 + 0 x00 ] , % g 1
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
be 1 0 f
ldx [ % o 0 + 0 x08 ] , % g 2
2012-08-29 14:49:23 -07:00
1 : xor % g 1 , % g 3 , % o 5
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
MOVXTOD_ O 5 _ F 0
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 2
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
xor % g 1 , % g 3 , % o 5
MOVXTOD_ O 5 _ F 4
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 6
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
ENCRYPT_ 1 2 8 _ 2 ( 8 , 0 , 2 , 4 , 6 , 5 6 , 5 8 , 6 0 , 6 2 )
ldd [ % o 1 + 0 x00 ] , % f56
ldd [ % o 1 + 0 x08 ] , % f58
ldd [ % o 1 + 0 x10 ] , % f60
ldd [ % o 1 + 0 x18 ] , % f62
fxor % f56 , % f0 , % f56
fxor % f58 , % f2 , % f58
fxor % f60 , % f4 , % f60
fxor % f62 , % f6 , % f62
std % f56 , [ % o 2 + 0 x00 ]
std % f58 , [ % o 2 + 0 x08 ]
std % f60 , [ % o 2 + 0 x10 ]
std % f62 , [ % o 2 + 0 x18 ]
subcc % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
10 : xor % g 1 , % g 3 , % o 5
2012-08-29 14:49:23 -07:00
MOVXTOD_ O 5 _ F 0
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 2
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
ENCRYPT_ 1 2 8 ( 8 , 0 , 2 , 4 , 6 )
ldd [ % o 1 + 0 x00 ] , % f4
ldd [ % o 1 + 0 x08 ] , % f6
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
11 : stx % g 3 , [ % o 4 + 0 x00 ]
2012-08-29 14:49:23 -07:00
retl
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
stx % g 7 , [ % o 4 + 0 x08 ]
2012-08-29 14:49:23 -07:00
ENDPROC( a e s _ s p a r c64 _ c t r _ c r y p t _ 1 2 8 )
.align 32
ENTRY( a e s _ s p a r c64 _ c t r _ c r y p t _ 1 9 2 )
/* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */
ldx [ % o 4 + 0 x00 ] , % g 3
ldx [ % o 4 + 0 x08 ] , % g 7
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
subcc % o 3 , 0 x10 , % o 3
2012-08-29 14:49:23 -07:00
ldx [ % o 0 + 0 x00 ] , % g 1
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
be 1 0 f
ldx [ % o 0 + 0 x08 ] , % g 2
2012-08-29 14:49:23 -07:00
1 : xor % g 1 , % g 3 , % o 5
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
MOVXTOD_ O 5 _ F 0
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 2
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
xor % g 1 , % g 3 , % o 5
MOVXTOD_ O 5 _ F 4
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 6
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
ENCRYPT_ 1 9 2 _ 2 ( 8 , 0 , 2 , 4 , 6 , 5 6 , 5 8 , 6 0 , 6 2 )
ldd [ % o 1 + 0 x00 ] , % f56
ldd [ % o 1 + 0 x08 ] , % f58
ldd [ % o 1 + 0 x10 ] , % f60
ldd [ % o 1 + 0 x18 ] , % f62
fxor % f56 , % f0 , % f56
fxor % f58 , % f2 , % f58
fxor % f60 , % f4 , % f60
fxor % f62 , % f6 , % f62
std % f56 , [ % o 2 + 0 x00 ]
std % f58 , [ % o 2 + 0 x08 ]
std % f60 , [ % o 2 + 0 x10 ]
std % f62 , [ % o 2 + 0 x18 ]
subcc % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
10 : xor % g 1 , % g 3 , % o 5
2012-08-29 14:49:23 -07:00
MOVXTOD_ O 5 _ F 0
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 2
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
ENCRYPT_ 1 9 2 ( 8 , 0 , 2 , 4 , 6 )
ldd [ % o 1 + 0 x00 ] , % f4
ldd [ % o 1 + 0 x08 ] , % f6
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
11 : stx % g 3 , [ % o 4 + 0 x00 ]
2012-08-29 14:49:23 -07:00
retl
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
stx % g 7 , [ % o 4 + 0 x08 ]
2012-08-29 14:49:23 -07:00
ENDPROC( a e s _ s p a r c64 _ c t r _ c r y p t _ 1 9 2 )
.align 32
ENTRY( a e s _ s p a r c64 _ c t r _ c r y p t _ 2 5 6 )
/* %o0=key, %o1=input, %o2=output, %o3=len, %o4=IV */
ldx [ % o 4 + 0 x00 ] , % g 3
ldx [ % o 4 + 0 x08 ] , % g 7
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
subcc % o 3 , 0 x10 , % o 3
2012-08-29 14:49:23 -07:00
ldx [ % o 0 + 0 x00 ] , % g 1
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
be 1 0 f
ldx [ % o 0 + 0 x08 ] , % g 2
2012-08-29 14:49:23 -07:00
1 : xor % g 1 , % g 3 , % o 5
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
MOVXTOD_ O 5 _ F 0
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 2
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
xor % g 1 , % g 3 , % o 5
MOVXTOD_ O 5 _ F 4
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 6
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
ENCRYPT_ 2 5 6 _ 2 ( 8 , 0 , 2 , 4 , 6 )
ldd [ % o 1 + 0 x00 ] , % f56
ldd [ % o 1 + 0 x08 ] , % f58
ldd [ % o 1 + 0 x10 ] , % f60
ldd [ % o 1 + 0 x18 ] , % f62
fxor % f56 , % f0 , % f56
fxor % f58 , % f2 , % f58
fxor % f60 , % f4 , % f60
fxor % f62 , % f6 , % f62
std % f56 , [ % o 2 + 0 x00 ]
std % f58 , [ % o 2 + 0 x08 ]
std % f60 , [ % o 2 + 0 x10 ]
std % f62 , [ % o 2 + 0 x18 ]
subcc % o 3 , 0 x20 , % o 3
add % o 1 , 0 x20 , % o 1
brgz % o 3 , 1 b
add % o 2 , 0 x20 , % o 2
brlz,p t % o 3 , 1 1 f
nop
2012-12-19 15:19:11 -08:00
10 : ldd [ % o 0 + 0 x d0 ] , % f56
2012-09-01 23:05:43 -07:00
ldd [ % o 0 + 0 x d8 ] , % f58
ldd [ % o 0 + 0 x e 0 ] , % f60
ldd [ % o 0 + 0 x e 8 ] , % f62
2012-12-19 15:19:11 -08:00
xor % g 1 , % g 3 , % o 5
2012-08-29 14:49:23 -07:00
MOVXTOD_ O 5 _ F 0
xor % g 2 , % g 7 , % o 5
MOVXTOD_ O 5 _ F 2
add % g 7 , 1 , % g 7
add % g 3 , 1 , % o 5
movrz % g 7 , % o 5 , % g 3
ENCRYPT_ 2 5 6 ( 8 , 0 , 2 , 4 , 6 )
ldd [ % o 1 + 0 x00 ] , % f4
ldd [ % o 1 + 0 x08 ] , % f6
fxor % f4 , % f0 , % f4
fxor % f6 , % f2 , % f6
std % f4 , [ % o 2 + 0 x00 ]
std % f6 , [ % o 2 + 0 x08 ]
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
11 : stx % g 3 , [ % o 4 + 0 x00 ]
2012-08-29 14:49:23 -07:00
retl
sparc64: Unroll CTR crypt loops in AES driver.
Before:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 244 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 360 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 814 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 378 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 939 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6395 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 249 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 414 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1073 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7110 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 225 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 810 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 5021 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 240 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 376 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 938 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6380 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 251 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 411 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1070 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 7114 cycles (8192 bytes)
After:
testing speed of ctr(aes) encryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 211 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 246 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 344 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 799 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4975 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 236 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 365 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 6055 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 209 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 255 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 404 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6669 cycles (8192 bytes)
testing speed of ctr(aes) decryption
test 0 (128 bit key, 16 byte blocks): 1 operation in 210 cycles (16 bytes)
test 1 (128 bit key, 64 byte blocks): 1 operation in 233 cycles (64 bytes)
test 2 (128 bit key, 256 byte blocks): 1 operation in 340 cycles (256 bytes)
test 3 (128 bit key, 1024 byte blocks): 1 operation in 818 cycles (1024 bytes)
test 4 (128 bit key, 8192 byte blocks): 1 operation in 4956 cycles (8192 bytes)
test 5 (192 bit key, 16 byte blocks): 1 operation in 206 cycles (16 bytes)
test 6 (192 bit key, 64 byte blocks): 1 operation in 239 cycles (64 bytes)
test 7 (192 bit key, 256 byte blocks): 1 operation in 361 cycles (256 bytes)
test 8 (192 bit key, 1024 byte blocks): 1 operation in 888 cycles (1024 bytes)
test 9 (192 bit key, 8192 byte blocks): 1 operation in 5996 cycles (8192 bytes)
test 10 (256 bit key, 16 byte blocks): 1 operation in 214 cycles (16 bytes)
test 11 (256 bit key, 64 byte blocks): 1 operation in 248 cycles (64 bytes)
test 12 (256 bit key, 256 byte blocks): 1 operation in 395 cycles (256 bytes)
test 13 (256 bit key, 1024 byte blocks): 1 operation in 1010 cycles (1024 bytes)
test 14 (256 bit key, 8192 byte blocks): 1 operation in 6664 cycles (8192 bytes)
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-08-30 08:40:44 -07:00
stx % g 7 , [ % o 4 + 0 x08 ]
2012-08-29 14:49:23 -07:00
ENDPROC( a e s _ s p a r c64 _ c t r _ c r y p t _ 2 5 6 )