Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-04-16 22:20:07 +0300
committerDavid Benjamin <davidben@google.com>2016-04-19 20:56:25 +0300
commit0e21f41fe884bedf708d3d4d6ab2ce9f53712bb8 (patch)
tree0fc61aade419206a3fb0a796e7f11813522453db /crypto/cipher
parent1a0a8b6760a9bc21c1c14a07c88fe63d637464ea (diff)
Switch all 'num' parameters in crypto/modes to unsigned.
Also switch the EVP_CIPHER copy to cut down on how frequently we need to cast back and forth. BUG=22 Change-Id: I9af1e586ca27793a4ee6193bbb348cf2b28a126e Reviewed-on: https://boringssl-review.googlesource.com/7689 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/cipher')
-rw-r--r--crypto/cipher/e_aes.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/cipher/e_aes.c b/crypto/cipher/e_aes.c
index aa652eb3..d61d0482 100644
--- a/crypto/cipher/e_aes.c
+++ b/crypto/cipher/e_aes.c
@@ -371,17 +371,15 @@ static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
size_t len) {
- unsigned num = (unsigned)ctx->num;
EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data;
if (dat->stream.ctr) {
- CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks, ctx->iv, ctx->buf, &num,
- dat->stream.ctr);
+ CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks, ctx->iv, ctx->buf,
+ &ctx->num, dat->stream.ctr);
} else {
- CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, ctx->buf, &num,
+ CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, ctx->buf, &ctx->num,
dat->block);
}
- ctx->num = (int)num;
return 1;
}