From af908415a1dbac1e805d593587fca5b449b45991 Mon Sep 17 00:00:00 2001 From: Sergey V Date: Wed, 6 Jun 2012 21:17:13 +0400 Subject: [PATCH] gost: rename gost_*() to john_gost_*() Modern openssl has it own gost_init(), gost_update(), gost_final(). Rename it to avoid multiple definition. --- src/gost.h | 8 ++++---- src/gost_fmt_plug.c | 8 ++++---- src/gost_plug.c | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gost.h b/src/gost.h index bbb4c3e..d793b1c 100644 --- a/src/gost.h +++ b/src/gost.h @@ -168,10 +168,10 @@ typedef struct gost_ctx /* hash functions */ -void gost_init(gost_ctx *ctx); -void gost_cryptopro_init(gost_ctx *ctx); -void gost_update(gost_ctx *ctx, const unsigned char* msg, size_t size); -void gost_final(gost_ctx *ctx, unsigned char result[32]); +void john_gost_init(gost_ctx *ctx); +void john_gost_cryptopro_init(gost_ctx *ctx); +void john_gost_update(gost_ctx *ctx, const unsigned char* msg, size_t size); +void john_gost_final(gost_ctx *ctx, unsigned char result[32]); void gost_init_table(void); /* initialize algorithm static data */ diff --git a/src/gost_fmt_plug.c b/src/gost_fmt_plug.c index 7097ea9..9b94a1d 100644 --- a/src/gost_fmt_plug.c +++ b/src/gost_fmt_plug.c @@ -180,12 +180,12 @@ static void crypt_all(int count) gost_ctx ctx; if (is_cryptopro) - gost_cryptopro_init(&ctx); + john_gost_cryptopro_init(&ctx); else - gost_init(&ctx); - gost_update(&ctx, (const unsigned char*)saved_key[index], + john_gost_init(&ctx); + john_gost_update(&ctx, (const unsigned char*)saved_key[index], strlen(saved_key[index])); - gost_final(&ctx, (unsigned char *)crypt_out[index]); + john_gost_final(&ctx, (unsigned char *)crypt_out[index]); } } diff --git a/src/gost_plug.c b/src/gost_plug.c index 6658104..e3e47ec 100644 --- a/src/gost_plug.c +++ b/src/gost_plug.c @@ -25,7 +25,7 @@ extern unsigned rhash_gost_sbox_cryptpro[4][256]; * * @param ctx context to initalize */ -void gost_init(gost_ctx *ctx) +void john_gost_init(gost_ctx *ctx) { memset(ctx, 0, sizeof(gost_ctx)); } @@ -35,9 +35,9 @@ void gost_init(gost_ctx *ctx) * * @param ctx context to initalize */ -void gost_cryptopro_init(gost_ctx *ctx) +void john_gost_cryptopro_init(gost_ctx *ctx) { - gost_init(ctx); + john_gost_init(ctx); ctx->cryptpro = 1; } @@ -340,7 +340,7 @@ static void rhash_gost_compute_sum_and_hash(gost_ctx * ctx, const unsigned* bloc * @param msg message chunk * @param size length of the message chunk */ -void gost_update(gost_ctx *ctx, const unsigned char* msg, size_t size) +void john_gost_update(gost_ctx *ctx, const unsigned char* msg, size_t size) { unsigned index = (unsigned)ctx->length & 31; ctx->length += size; @@ -387,7 +387,7 @@ void gost_update(gost_ctx *ctx, const unsigned char* msg, size_t size) * @param ctx the algorithm context containing current hashing state * @param result calculated hash in binary form */ -void gost_final(gost_ctx *ctx, unsigned char result[32]) +void john_gost_final(gost_ctx *ctx, unsigned char result[32]) { unsigned index = (unsigned)ctx->length & 31; unsigned* msg32 = (unsigned*)ctx->message; -- 1.7.4.4