summaryrefslogtreecommitdiff
path: root/aesdata.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2004-06-08 17:26:15 +0200
committerNiels Möller <nisse@lysator.liu.se>2004-06-08 17:26:15 +0200
commit5bbf1a4daf25c6fa068cb80c74949322d6fa581f (patch)
treec591104f2f9f811264e5b0aa56584eaa90ab30ba /aesdata.c
parent8a6aff6e60830852b4c731a017692cf3a2fdc425 (diff)
downloadnettle-5bbf1a4daf25c6fa068cb80c74949322d6fa581f.tar.gz
Renamed log and ilog to gf2_log and gf2_exp.
Rev: src/nettle/aesdata.c:1.4
Diffstat (limited to 'aesdata.c')
-rw-r--r--aesdata.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/aesdata.c b/aesdata.c
index 0fc1b310..9077c549 100644
--- a/aesdata.c
+++ b/aesdata.c
@@ -23,8 +23,8 @@
uint8_t sbox[0x100];
uint8_t isbox[0x100];
-uint8_t log[0x100];
-uint8_t ilog[0x100];
+uint8_t gf2_log[0x100];
+uint8_t gf2_exp[0x100];
uint32_t dtable[4][0x100];
uint32_t itable[4][0x100];
@@ -51,30 +51,30 @@ compute_log(void)
unsigned i = 0;
unsigned x = 1;
- memset(log, 0, 0x100);
+ memset(gf2_log, 0, 0x100);
for (i = 0; i < 0x100; i++, x = x ^ xtime(x))
{
- ilog[i] = x;
- log[x] = i;
+ gf2_exp[i] = x;
+ gf2_log[x] = i;
}
/* Invalid. */
- log[0] = 0;
- /* The loop above sets log[1] = 0xff, which is correct,
- * but log[1] = 0 is nicer. */
- log[1] = 0;
+ gf2_log[0] = 0;
+ /* The loop above sets gf2_log[1] = 0xff, which is correct,
+ * but gf2_log[1] = 0 is nicer. */
+ gf2_log[1] = 0;
}
static unsigned
mult(unsigned a, unsigned b)
{
- return (a && b) ? ilog[ (log[a] + log[b]) % 255] : 0;
+ return (a && b) ? gf2_exp[ (gf2_log[a] + gf2_log[b]) % 255] : 0;
}
static unsigned
invert(unsigned x)
{
- return x ? ilog[0xff - log[x]] : 0;
+ return x ? gf2_exp[0xff - gf2_log[x]] : 0;
}
static unsigned
@@ -188,8 +188,8 @@ main(int argc, char **argv)
compute_log();
if (argc == 1)
{
- display_byte_table("log", log);
- display_byte_table("ilog", ilog);
+ display_byte_table("gf2_log", gf2_log);
+ display_byte_table("gf2_exp", gf2_exp);
compute_sbox();
display_byte_table("sbox", sbox);