diff options
author | Brian Smith <brian@briansmith.org> | 2016-03-16 02:00:49 +0300 |
---|---|---|
committer | David Benjamin <davidben@google.com> | 2016-03-16 02:06:01 +0300 |
commit | 9aa1562843fbe63bc520c513222d0100a2085780 (patch) | |
tree | 6a9122f97222436cddf1774a4b2fc12b74c2a5ec /crypto/rsa | |
parent | 6f7374b0edf3960eeb292b4af2a4003db395e22d (diff) |
Remove unnecessary type casts in crypto/rsa.
Change-Id: I0b5c661674fbcaf6b4d5b0ce7944459cd45606b1
Reviewed-on: https://boringssl-review.googlesource.com/7466
Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/blinding.c | 2 | ||||
-rw-r--r-- | crypto/rsa/padding.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/crypto/rsa/blinding.c b/crypto/rsa/blinding.c index 9bd02636..1367ff68 100644 --- a/crypto/rsa/blinding.c +++ b/crypto/rsa/blinding.c @@ -134,7 +134,7 @@ static BN_BLINDING *bn_blinding_create_param(BN_BLINDING *b, const BIGNUM *e, BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod) { BN_BLINDING *ret = NULL; - ret = (BN_BLINDING*) OPENSSL_malloc(sizeof(BN_BLINDING)); + ret = OPENSSL_malloc(sizeof(BN_BLINDING)); if (ret == NULL) { OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); return NULL; diff --git a/crypto/rsa/padding.c b/crypto/rsa/padding.c index 35eb85a4..4d668706 100644 --- a/crypto/rsa/padding.c +++ b/crypto/rsa/padding.c @@ -74,7 +74,6 @@ int RSA_padding_add_PKCS1_type_1(uint8_t *to, unsigned to_len, const uint8_t *from, unsigned from_len) { unsigned j; - uint8_t *p; if (to_len < RSA_PKCS1_PADDING_SIZE) { OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); @@ -86,7 +85,7 @@ int RSA_padding_add_PKCS1_type_1(uint8_t *to, unsigned to_len, return 0; } - p = (uint8_t *)to; + uint8_t *p = to; *(p++) = 0; *(p++) = 1; /* Private Key BT (Block Type) */ @@ -155,7 +154,6 @@ int RSA_padding_check_PKCS1_type_1(uint8_t *to, unsigned to_len, int RSA_padding_add_PKCS1_type_2(uint8_t *to, unsigned to_len, const uint8_t *from, unsigned from_len) { unsigned i, j; - uint8_t *p; if (to_len < RSA_PKCS1_PADDING_SIZE) { OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); @@ -167,7 +165,7 @@ int RSA_padding_add_PKCS1_type_2(uint8_t *to, unsigned to_len, return 0; } - p = (unsigned char *)to; + uint8_t *p = to; *(p++) = 0; *(p++) = 2; /* Public Key BT (Block Type) */ @@ -358,7 +356,7 @@ int RSA_padding_add_PKCS1_OAEP_mgf1(uint8_t *to, unsigned to_len, seed = to + 1; db = to + mdlen + 1; - if (!EVP_Digest((void *)param, param_len, db, NULL, md, NULL)) { + if (!EVP_Digest(param, param_len, db, NULL, md, NULL)) { return 0; } memset(db + mdlen, 0, emlen - from_len - 2 * mdlen - 1); @@ -444,7 +442,7 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *to, unsigned to_len, db[i] ^= maskeddb[i]; } - if (!EVP_Digest((void *)param, param_len, phash, NULL, md, NULL)) { + if (!EVP_Digest(param, param_len, phash, NULL, md, NULL)) { goto err; } |