summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arctwo.c18
-rw-r--r--arctwo.h10
-rw-r--r--testsuite/arctwo-test.c4
3 files changed, 16 insertions, 16 deletions
diff --git a/arctwo.c b/arctwo.c
index a84cc250..9793467b 100644
--- a/arctwo.c
+++ b/arctwo.c
@@ -175,8 +175,8 @@ arctwo_decrypt (struct arctwo_ctx *ctx,
}
void
-arctwo_set_key_ebk (struct arctwo_ctx *ctx,
- unsigned length, const uint8_t *key, unsigned ebk)
+arctwo_set_key_ekb (struct arctwo_ctx *ctx,
+ unsigned length, const uint8_t *key, unsigned ekb)
{
unsigned i;
/* Expanded key, treated as octets */
@@ -185,7 +185,7 @@ arctwo_set_key_ebk (struct arctwo_ctx *ctx,
assert (length >= ARCTWO_MIN_KEY_SIZE);
assert (length <= ARCTWO_MAX_KEY_SIZE);
- assert (ebk <= 1024);
+ assert (ekb <= 1024);
for (i = 0; i < length; i++)
S[i] = key[i];
@@ -196,12 +196,12 @@ arctwo_set_key_ebk (struct arctwo_ctx *ctx,
S[0] = arctwo_sbox[S[0]];
- /* Reduce effective key size to ebk bits, if requested by caller. */
- if (ebk > 0 && ebk < 1024)
+ /* Reduce effective key size to ekb bits, if requested by caller. */
+ if (ekb > 0 && ekb < 1024)
{
- int len = (ebk + 7) >> 3;
+ int len = (ekb + 7) >> 3;
i = 128 - len;
- x = arctwo_sbox[S[i] & (255 >> (7 & -ebk))];
+ x = arctwo_sbox[S[i] & (255 >> (7 & -ekb))];
S[i] = x;
while (i--)
@@ -219,12 +219,12 @@ arctwo_set_key_ebk (struct arctwo_ctx *ctx,
void
arctwo_set_key (struct arctwo_ctx *ctx, unsigned length, const uint8_t *key)
{
- arctwo_set_key_ebk (ctx, length, key, 8 * length);
+ arctwo_set_key_ekb (ctx, length, key, 8 * length);
}
void
arctwo_set_key_gutmann (struct arctwo_ctx *ctx,
unsigned length, const uint8_t *key)
{
- arctwo_set_key_ebk (ctx, length, key, 0);
+ arctwo_set_key_ekb (ctx, length, key, 0);
}
diff --git a/arctwo.h b/arctwo.h
index 4f2a93f4..852564ac 100644
--- a/arctwo.h
+++ b/arctwo.h
@@ -31,7 +31,7 @@
/* Name mangling */
#define arctwo_set_key nettle_arctwo_set_key
-#define arctwo_set_key_ebk nettle_arctwo_set_key_ebk
+#define arctwo_set_key_ekb nettle_arctwo_set_key_ekb
#define arctwo_encrypt nettle_arctwo_encrypt
#define arctwo_decrypt nettle_arctwo_decrypt
#define arctwo_set_key_gutmann nettle_arctwo_set_key_gutmann
@@ -52,14 +52,14 @@ struct arctwo_ctx
/* Key expansion function that takes the "effective key bits", 1-1024,
as an explicit argument. 0 means maximum key bits. */
void
-arctwo_set_key_ebk (struct arctwo_ctx *ctx,
- unsigned length, const uint8_t * key, unsigned ebk);
+arctwo_set_key_ekb (struct arctwo_ctx *ctx,
+ unsigned length, const uint8_t * key, unsigned ekb);
-/* Equvivalent to arctwo_set_key_ebk, with ebk = 8 * length */
+/* Equvivalent to arctwo_set_key_ekb, with ekb = 8 * length */
void
arctwo_set_key (struct arctwo_ctx *ctx, unsigned length, const uint8_t *key);
-/* Equvivalent to arctwo_set_key_ebk, with ebk = 1024 */
+/* Equvivalent to arctwo_set_key_ekb, with ekb = 1024 */
/* FIXME: Is this function really needed, and if so, what's the right
name for it? */
void
diff --git a/testsuite/arctwo-test.c b/testsuite/arctwo-test.c
index 6a363ed6..17c3503f 100644
--- a/testsuite/arctwo-test.c
+++ b/testsuite/arctwo-test.c
@@ -24,7 +24,7 @@
/* For tests with obscure values of ebk. */
static void
-test_arctwo(unsigned ebk,
+test_arctwo(unsigned ekb,
unsigned key_length,
const uint8_t *key,
unsigned length,
@@ -34,7 +34,7 @@ test_arctwo(unsigned ebk,
struct arctwo_ctx ctx;
uint8_t *data = xalloc(length);
- arctwo_set_key_ebk(&ctx, key_length, key, ebk);
+ arctwo_set_key_ekb(&ctx, key_length, key, ekb);
arctwo_encrypt(&ctx, length, data, cleartext);
if (!MEMEQ(length, data, ciphertext))