diff options
author | Andy Polyakov <appro@openssl.org> | 2012-12-19 17:24:46 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2012-12-19 17:24:46 +0000 |
commit | 3a3f964edaf69f50bcb659a5486bbd30c0afb630 (patch) | |
tree | c776a5fc0b55835972ea17537f55f79e83f0a025 /engines/ccgost | |
parent | b7d1a1af760fdbde0159eb4111b04dd4113a64e2 (diff) | |
download | openssl-3a3f964edaf69f50bcb659a5486bbd30c0afb630.tar.gz |
gost_crypt.c: more intuitive ceiling.
Diffstat (limited to 'engines/ccgost')
-rw-r--r-- | engines/ccgost/gost_crypt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/ccgost/gost_crypt.c b/engines/ccgost/gost_crypt.c index d227ba25db..0d62286f41 100644 --- a/engines/ccgost/gost_crypt.c +++ b/engines/ccgost/gost_crypt.c @@ -211,7 +211,7 @@ static void gost_crypt_mesh (void *ctx,unsigned char *iv,unsigned char *buf) cryptopro_key_meshing(&(c->cctx),iv); } gostcrypt(&(c->cctx),iv,buf); - c->count = (c->count+8)%1024 + 1024; + c->count = c->count%1024 + 8; } static void gost_cnt_next (void *ctx, unsigned char *iv, unsigned char *buf) @@ -248,7 +248,7 @@ static void gost_cnt_next (void *ctx, unsigned char *iv, unsigned char *buf) buf1[7]=(unsigned char)((g>>24)&0xff); memcpy(iv,buf1,8); gostcrypt(&(c->cctx),buf1,buf); - c->count = (c->count+8)%1024 + 1024; + c->count = c->count%1024 + 8; } /* GOST encryption in CFB mode */ @@ -516,7 +516,7 @@ static void mac_block_mesh(struct ossl_gost_imit_ctx *c,const unsigned char *dat cryptopro_key_meshing(&(c->cctx),buffer); } mac_block(&(c->cctx),c->buffer,data); - c->count = (c->count+8)%1024 + 1024; + c->count = c->count%1024 + 8; } int gost_imit_update(EVP_MD_CTX *ctx, const void *data, size_t count) |