Commit 4961af0a authored by Niels Möller's avatar Niels Möller

* gcm.h (GCM_UPDATE): Renamed, from...

(GCM_AUTH): ...old name.

* gcm-aes.c (gcm_aes_update): Renamed, from...
(gcm_aes_auth): ...old name.

* gcm.c (gcm_update): Renamed, and fixed an assert. From...
(gcm_auth): ...old name.

Rev: nettle/ChangeLog:1.150
Rev: nettle/gcm-aes.c:1.3
Rev: nettle/gcm.c:1.14
Rev: nettle/gcm.h:1.11
parent ccba0ebe
2011-02-13 Niels Mller <nisse@lysator.liu.se>
* gcm.h (GCM_UPDATE): Renamed, from...
(GCM_AUTH): ...old name.
* gcm-aes.c (gcm_aes_update): Renamed, from...
(gcm_aes_auth): ...old name.
* gcm.c (gcm_update): Renamed, and fixed an assert. From...
(gcm_auth): ...old name.
* gcm.h (GCM_TABLE_BITS): Increase table size to 8 bits,
corresponding to 4 KByte of key-dependent tables.
2011-02-10 Niels Mller <nisse@lysator.liu.se> 2011-02-10 Niels Mller <nisse@lysator.liu.se>
* x86_64/memxor.asm: New file. Improves performance by 22% for the * x86_64/memxor.asm: New file. Improves performance by 22% for the
......
...@@ -39,13 +39,11 @@ gcm_aes_set_iv(struct gcm_aes_ctx *ctx, ...@@ -39,13 +39,11 @@ gcm_aes_set_iv(struct gcm_aes_ctx *ctx,
gcm_set_iv(&ctx->gcm, &ctx->key, length, iv); gcm_set_iv(&ctx->gcm, &ctx->key, length, iv);
} }
/* FIXME: Rename to gcm_aes_update, for consistency with other hash
and mac functions? */
void void
gcm_aes_auth(struct gcm_aes_ctx *ctx, unsigned length, const uint8_t *data) gcm_aes_update(struct gcm_aes_ctx *ctx, unsigned length, const uint8_t *data)
{ {
GCM_AUTH(ctx, (nettle_crypt_func *) aes_encrypt, GCM_UPDATE(ctx, (nettle_crypt_func *) aes_encrypt,
length, data); length, data);
} }
void void
......
...@@ -411,11 +411,11 @@ gcm_set_iv(struct gcm_ctx *ctx, const struct gcm_key *key, ...@@ -411,11 +411,11 @@ gcm_set_iv(struct gcm_ctx *ctx, const struct gcm_key *key,
} }
void void
gcm_auth(struct gcm_ctx *ctx, const struct gcm_key *key, gcm_update(struct gcm_ctx *ctx, const struct gcm_key *key,
unsigned length, const uint8_t *data) unsigned length, const uint8_t *data)
{ {
assert(ctx->auth_size % GCM_BLOCK_SIZE == 0); assert(ctx->auth_size % GCM_BLOCK_SIZE == 0);
assert(ctx->data_size % GCM_BLOCK_SIZE == 0); assert(ctx->data_size == 0);
gcm_hash(key, &ctx->x, length, data); gcm_hash(key, &ctx->x, length, data);
......
...@@ -43,14 +43,14 @@ extern "C" { ...@@ -43,14 +43,14 @@ extern "C" {
/* Name mangling */ /* Name mangling */
#define gcm_set_key nettle_gcm_set_key #define gcm_set_key nettle_gcm_set_key
#define gcm_set_iv nettle_gcm_set_iv #define gcm_set_iv nettle_gcm_set_iv
#define gcm_auth nettle_gcm_auth #define gcm_update nettle_gcm_update
#define gcm_encrypt nettle_gcm_encrypt #define gcm_encrypt nettle_gcm_encrypt
#define gcm_decrypt nettle_gcm_decrypt #define gcm_decrypt nettle_gcm_decrypt
#define gcm_digest nettle_gcm_digest #define gcm_digest nettle_gcm_digest
#define gcm_aes_set_key nettle_gcm_aes_set_key #define gcm_aes_set_key nettle_gcm_aes_set_key
#define gcm_aes_set_iv nettle_gcm_aes_set_iv #define gcm_aes_set_iv nettle_gcm_aes_set_iv
#define gcm_aes_auth nettle_gcm_aes_auth #define gcm_aes_update nettle_gcm_aes_update
#define gcm_aes_encrypt nettle_gcm_aes_encrypt #define gcm_aes_encrypt nettle_gcm_aes_encrypt
#define gcm_aes_decrypt nettle_gcm_aes_decrypt #define gcm_aes_decrypt nettle_gcm_aes_decrypt
#define gcm_aes_digest nettle_gcm_aes_digest #define gcm_aes_digest nettle_gcm_aes_digest
...@@ -97,8 +97,8 @@ gcm_set_iv(struct gcm_ctx *ctx, const struct gcm_key *key, ...@@ -97,8 +97,8 @@ gcm_set_iv(struct gcm_ctx *ctx, const struct gcm_key *key,
unsigned length, const uint8_t *iv); unsigned length, const uint8_t *iv);
void void
gcm_auth(struct gcm_ctx *ctx, const struct gcm_key *key, gcm_update(struct gcm_ctx *ctx, const struct gcm_key *key,
unsigned length, const uint8_t *data); unsigned length, const uint8_t *data);
void void
gcm_encrypt(struct gcm_ctx *ctx, const struct gcm_key *key, gcm_encrypt(struct gcm_ctx *ctx, const struct gcm_key *key,
...@@ -127,8 +127,8 @@ gcm_digest(struct gcm_ctx *ctx, const struct gcm_key *key, ...@@ -127,8 +127,8 @@ gcm_digest(struct gcm_ctx *ctx, const struct gcm_key *key,
gcm_set_key(&(ctx)->key, &(ctx)->cipher, (encrypt)); \ gcm_set_key(&(ctx)->key, &(ctx)->cipher, (encrypt)); \
} while (0) } while (0)
#define GCM_AUTH(ctx, encrypt, length, data) \ #define GCM_UPDATE(ctx, encrypt, length, data) \
gcm_auth(&(ctx)->gcm, &(ctx)->key, (length), (data)) gcm_update(&(ctx)->gcm, &(ctx)->key, (length), (data))
#define GCM_ENCRYPT(ctx, encrypt, length, dst, src) \ #define GCM_ENCRYPT(ctx, encrypt, length, dst, src) \
gcm_encrypt(&(ctx)->gcm, &(ctx)->key, &(ctx)->cipher, (encrypt), \ gcm_encrypt(&(ctx)->gcm, &(ctx)->key, &(ctx)->cipher, (encrypt), \
...@@ -152,11 +152,9 @@ void ...@@ -152,11 +152,9 @@ void
gcm_aes_set_iv(struct gcm_aes_ctx *ctx, gcm_aes_set_iv(struct gcm_aes_ctx *ctx,
unsigned length, const uint8_t *iv); unsigned length, const uint8_t *iv);
/* FIXME: Rename to gcm_aes_update, for consistency with other hash
and mac functions? */
void void
gcm_aes_auth(struct gcm_aes_ctx *ctx, gcm_aes_update(struct gcm_aes_ctx *ctx,
unsigned length, const uint8_t *data); unsigned length, const uint8_t *data);
void void
gcm_aes_encrypt(struct gcm_aes_ctx *ctx, gcm_aes_encrypt(struct gcm_aes_ctx *ctx,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment