Clarify some confusing casts involving |size_t|.

Change-Id: I7af2c87fe6e7513aa2603d5e845a4db87ab14fcc
Reviewed-on: https://boringssl-review.googlesource.com/7101
Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
Brian Smith 2016-02-08 10:17:39 -10:00 committed by David Benjamin
parent 11676a7399
commit 894a47df24
3 changed files with 6 additions and 6 deletions

View File

@ -138,7 +138,7 @@ static bool TestOperation(FileTest *t,
iv.size(), 0)) {
return false;
}
} else if (iv.size() != (size_t)EVP_CIPHER_CTX_iv_length(ctx.get())) {
} else if (iv.size() != EVP_CIPHER_CTX_iv_length(ctx.get())) {
t->PrintLine("Bad IV length.");
return false;
}

View File

@ -384,7 +384,7 @@ 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 int num = ctx->num;
unsigned num = (unsigned)ctx->num;
EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data;
if (dat->stream.ctr) {
@ -394,7 +394,7 @@ static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, ctx->buf, &num,
dat->block);
}
ctx->num = (size_t)num;
ctx->num = (int)num;
return 1;
}

View File

@ -95,7 +95,7 @@ int RSA_padding_add_PKCS1_type_1(uint8_t *to, unsigned to_len,
memset(p, 0xff, j);
p += j;
*(p++) = 0;
memcpy(p, from, (unsigned int)from_len);
memcpy(p, from, from_len);
return 1;
}
@ -189,7 +189,7 @@ int RSA_padding_add_PKCS1_type_2(uint8_t *to, unsigned to_len,
*(p++) = 0;
memcpy(p, from, (unsigned int)from_len);
memcpy(p, from, from_len);
return 1;
}
@ -271,7 +271,7 @@ int RSA_padding_add_none(uint8_t *to, unsigned to_len, const uint8_t *from,
return 0;
}
memcpy(to, from, (unsigned int)from_len);
memcpy(to, from, from_len);
return 1;
}