Skip to content
Snippets Groups Projects
Commit bc527459 authored by Niels Möller's avatar Niels Möller
Browse files

* aes-internal.h (struct aes_table): sparc_idx[0] should now

contain index values shifted by the size of a word, and with 2
added. This saves some additions in the sparc assembler code.
Updates aes-encrypt-table.c and aes-decrypt-table.c.

* aes-internal.h (struct aes_table): Renamed the shift_idx field
to sparc_idx, as it will be tweaked to improve the sparc code.
Also reduced its size to [2][4].
(IDX_FACTOR): Deleted constant.
* aes-encrypt-table.c (_aes_encrypt_table): Adapted initializer of
sparc_idx.
* aes-decrypt-table.c (_aes_decrypt_table): Likewise.
* asm.m4: Deleted AES_SIDX2, to match struct aes_table.

Rev: src/nettle/aes-decrypt-table.c:1.3
Rev: src/nettle/aes-encrypt-table.c:1.3
Rev: src/nettle/aes-internal.h:1.8
parent 220b5454
No related branches found
No related tags found
No related merge requests found
...@@ -66,9 +66,9 @@ _aes_decrypt_table = ...@@ -66,9 +66,9 @@ _aes_decrypt_table =
{ 3, 0, 1, 2 }, { 3, 0, 1, 2 },
{ 2, 3, 0, 1 }, { 2, 3, 0, 1 },
{ 1, 2, 3, 0 } }, { 1, 2, 3, 0 } },
{ /* sparc_idx, IDX1 and IDX3 shifted by the size of a word */ { /* sparc_idx, explained in aes-internal.h */
{ 12, 0, 4, 8 }, { 14, 2, 6, 10 },
{ 4, 8, 12, 0 } }, { 4, 8, 12, 0 } },
{ /* itable */ { /* itable */
{ {
0x50a7f451,0x5365417e,0xc3a4171a,0x965e273a, 0x50a7f451,0x5365417e,0xc3a4171a,0x965e273a,
......
...@@ -77,9 +77,9 @@ _aes_encrypt_table = ...@@ -77,9 +77,9 @@ _aes_encrypt_table =
{ 1, 2, 3, 0 }, { 1, 2, 3, 0 },
{ 2, 3, 0, 1 }, { 2, 3, 0, 1 },
{ 3, 0, 1, 2 } }, { 3, 0, 1, 2 } },
{ /* sparc_idx, IDX1 and IDX3 shifted by the size of a word */ { /* sparc_idx, explained in aes-internal.h */
{ 4, 8, 12, 0 }, { 6, 10, 14, 2 },
{ 12, 0, 4, 8 } }, { 12, 0, 4, 8 } },
{ /* dtable */ { /* dtable */
{ {
0xa56363c6,0x847c7cf8,0x997777ee,0x8d7b7bf6, 0xa56363c6,0x847c7cf8,0x997777ee,0x8d7b7bf6,
......
...@@ -45,7 +45,12 @@ struct aes_table ...@@ -45,7 +45,12 @@ struct aes_table
unsigned idx[3][4]; unsigned idx[3][4];
/* Variant of the idx array suitable for the sparc /* Variant of the idx array suitable for the sparc
* assembler code. */ * assembler code.
*
* sparc_idx[0][i] = idx[0][i] * 4 + 2
* sparc_idx[1][i] = idx[2][i] * 4
*/
unsigned sparc_idx [2][4]; unsigned sparc_idx [2][4];
uint32_t table[AES_TABLE_SIZE][0x100]; uint32_t table[AES_TABLE_SIZE][0x100];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment