diff options
-rw-r--r-- | crypto/aria/aria.c | 28 | ||||
-rw-r--r-- | crypto/evp/e_aria.c | 32 | ||||
-rw-r--r-- | include/crypto/aria.h | 12 | ||||
-rw-r--r-- | providers/implementations/ciphers/cipher_aria_ccm_hw.c | 4 | ||||
-rw-r--r-- | providers/implementations/ciphers/cipher_aria_gcm_hw.c | 2 | ||||
-rw-r--r-- | providers/implementations/ciphers/cipher_aria_hw.c | 6 |
6 files changed, 42 insertions, 42 deletions
diff --git a/crypto/aria/aria.c b/crypto/aria/aria.c index c1b2254af7..dabc843324 100644 --- a/crypto/aria/aria.c +++ b/crypto/aria/aria.c @@ -468,8 +468,8 @@ static const uint32_t X2[256] = { (Y) = (TMP2) ^ rotr32((TMP) ^ (TMP2), 16); \ } while(0) -void aria_encrypt(const unsigned char *in, unsigned char *out, - const ARIA_KEY *key) +void ossl_aria_encrypt(const unsigned char *in, unsigned char *out, + const ARIA_KEY *key) { register uint32_t reg0, reg1, reg2, reg3; int Nr; @@ -535,8 +535,8 @@ void aria_encrypt(const unsigned char *in, unsigned char *out, PUT_U32_BE(out, 3, reg3); } -int aria_set_encrypt_key(const unsigned char *userKey, const int bits, - ARIA_KEY *key) +int ossl_aria_set_encrypt_key(const unsigned char *userKey, const int bits, + ARIA_KEY *key) { register uint32_t reg0, reg1, reg2, reg3; uint32_t w0[4], w1[4], w2[4], w3[4]; @@ -667,8 +667,8 @@ int aria_set_encrypt_key(const unsigned char *userKey, const int bits, return 0; } -int aria_set_decrypt_key(const unsigned char *userKey, const int bits, - ARIA_KEY *key) +int ossl_aria_set_decrypt_key(const unsigned char *userKey, const int bits, + ARIA_KEY *key) { ARIA_u128 *rk_head; ARIA_u128 *rk_tail; @@ -676,7 +676,7 @@ int aria_set_decrypt_key(const unsigned char *userKey, const int bits, register uint32_t reg0, reg1, reg2, reg3; uint32_t s0, s1, s2, s3; - const int r = aria_set_encrypt_key(userKey, bits, key); + const int r = ossl_aria_set_encrypt_key(userKey, bits, key); if (r != 0) { return r; @@ -1106,8 +1106,8 @@ static void do_encrypt(unsigned char *o, const unsigned char *pin, * Encrypt a single block * in and out can overlap */ -void aria_encrypt(const unsigned char *in, unsigned char *out, - const ARIA_KEY *key) +void ossl_aria_encrypt(const unsigned char *in, unsigned char *out, + const ARIA_KEY *key) { assert(in != NULL && out != NULL && key != NULL); do_encrypt(out, in, key->rounds, key->rd_key); @@ -1119,8 +1119,8 @@ void aria_encrypt(const unsigned char *in, unsigned char *out, * We short circuit execution of the last two * or four rotations based on the key size. */ -int aria_set_encrypt_key(const unsigned char *userKey, const int bits, - ARIA_KEY *key) +int ossl_aria_set_encrypt_key(const unsigned char *userKey, const int bits, + ARIA_KEY *key) { const ARIA_u128 *ck1, *ck2, *ck3; ARIA_u128 kr, w0, w1, w2, w3; @@ -1192,11 +1192,11 @@ int aria_set_encrypt_key(const unsigned char *userKey, const int bits, /* * Expand the cipher key into the decryption key schedule. */ -int aria_set_decrypt_key(const unsigned char *userKey, const int bits, - ARIA_KEY *key) +int ossl_aria_set_decrypt_key(const unsigned char *userKey, const int bits, + ARIA_KEY *key) { ARIA_KEY ek; - const int r = aria_set_encrypt_key(userKey, bits, &ek); + const int r = ossl_aria_set_encrypt_key(userKey, bits, &ek); unsigned int i, rounds = ek.rounds; if (r == 0) { diff --git a/crypto/evp/e_aria.c b/crypto/evp/e_aria.c index 7f937d98d8..f3a68eb09d 100644 --- a/crypto/evp/e_aria.c +++ b/crypto/evp/e_aria.c @@ -63,10 +63,10 @@ static int aria_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, int mode = EVP_CIPHER_CTX_mode(ctx); if (enc || (mode != EVP_CIPH_ECB_MODE && mode != EVP_CIPH_CBC_MODE)) - ret = aria_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, + ret = ossl_aria_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, EVP_CIPHER_CTX_get_cipher_data(ctx)); else - ret = aria_set_decrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, + ret = ossl_aria_set_decrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, EVP_CIPHER_CTX_get_cipher_data(ctx)); if (ret < 0) { ERR_raise(ERR_LIB_EVP,EVP_R_ARIA_KEY_SETUP_FAILED); @@ -82,10 +82,10 @@ static void aria_cbc_encrypt(const unsigned char *in, unsigned char *out, if (enc) CRYPTO_cbc128_encrypt(in, out, len, key, ivec, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); else CRYPTO_cbc128_decrypt(in, out, len, key, ivec, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); } static void aria_cfb128_encrypt(const unsigned char *in, unsigned char *out, @@ -94,7 +94,7 @@ static void aria_cfb128_encrypt(const unsigned char *in, unsigned char *out, { CRYPTO_cfb128_encrypt(in, out, length, key, ivec, num, enc, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); } static void aria_cfb1_encrypt(const unsigned char *in, unsigned char *out, @@ -102,7 +102,7 @@ static void aria_cfb1_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num, const int enc) { CRYPTO_cfb128_1_encrypt(in, out, length, key, ivec, num, enc, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); } static void aria_cfb8_encrypt(const unsigned char *in, unsigned char *out, @@ -110,13 +110,13 @@ static void aria_cfb8_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num, const int enc) { CRYPTO_cfb128_8_encrypt(in, out, length, key, ivec, num, enc, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); } static void aria_ecb_encrypt(const unsigned char *in, unsigned char *out, const ARIA_KEY *key, const int enc) { - aria_encrypt(in, out, key); + ossl_aria_encrypt(in, out, key); } static void aria_ofb128_encrypt(const unsigned char *in, unsigned char *out, @@ -124,7 +124,7 @@ static void aria_ofb128_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, int *num) { CRYPTO_ofb128_encrypt(in, out, length, key, ivec, num, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); } IMPLEMENT_BLOCK_CIPHER(aria_128, ks, aria, EVP_ARIA_KEY, @@ -175,7 +175,7 @@ static int aria_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, EVP_CIPHER_CTX_buf_noconst(ctx), &num, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); EVP_CIPHER_CTX_set_num(ctx, num); return 1; } @@ -211,10 +211,10 @@ static int aria_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, if (!iv && !key) return 1; if (key) { - ret = aria_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, - &gctx->ks.ks); + ret = ossl_aria_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, + &gctx->ks.ks); CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, - (block128_f) aria_encrypt); + (block128_f) ossl_aria_encrypt); if (ret < 0) { ERR_raise(ERR_LIB_EVP,EVP_R_ARIA_KEY_SETUP_FAILED); return 0; @@ -508,10 +508,10 @@ static int aria_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, return 1; if (key) { - ret = aria_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, - &cctx->ks.ks); + ret = ossl_aria_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, + &cctx->ks.ks); CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, - &cctx->ks, (block128_f) aria_encrypt); + &cctx->ks, (block128_f) ossl_aria_encrypt); if (ret < 0) { ERR_raise(ERR_LIB_EVP,EVP_R_ARIA_KEY_SETUP_FAILED); return 0; diff --git a/include/crypto/aria.h b/include/crypto/aria.h index 857cf4b623..21a9932e84 100644 --- a/include/crypto/aria.h +++ b/include/crypto/aria.h @@ -40,12 +40,12 @@ struct aria_key_st { typedef struct aria_key_st ARIA_KEY; -int aria_set_encrypt_key(const unsigned char *userKey, const int bits, - ARIA_KEY *key); -int aria_set_decrypt_key(const unsigned char *userKey, const int bits, - ARIA_KEY *key); +int ossl_aria_set_encrypt_key(const unsigned char *userKey, const int bits, + ARIA_KEY *key); +int ossl_aria_set_decrypt_key(const unsigned char *userKey, const int bits, + ARIA_KEY *key); -void aria_encrypt(const unsigned char *in, unsigned char *out, - const ARIA_KEY *key); +void ossl_aria_encrypt(const unsigned char *in, unsigned char *out, + const ARIA_KEY *key); #endif diff --git a/providers/implementations/ciphers/cipher_aria_ccm_hw.c b/providers/implementations/ciphers/cipher_aria_ccm_hw.c index 700958cbac..e56ec8fb08 100644 --- a/providers/implementations/ciphers/cipher_aria_ccm_hw.c +++ b/providers/implementations/ciphers/cipher_aria_ccm_hw.c @@ -18,9 +18,9 @@ static int ccm_aria_initkey(PROV_CCM_CTX *ctx, { PROV_ARIA_CCM_CTX *actx = (PROV_ARIA_CCM_CTX *)ctx; - aria_set_encrypt_key(key, keylen * 8, &actx->ks.ks); + ossl_aria_set_encrypt_key(key, keylen * 8, &actx->ks.ks); CRYPTO_ccm128_init(&ctx->ccm_ctx, ctx->m, ctx->l, &actx->ks.ks, - (block128_f)aria_encrypt); + (block128_f)ossl_aria_encrypt); ctx->str = NULL; ctx->key_set = 1; return 1; diff --git a/providers/implementations/ciphers/cipher_aria_gcm_hw.c b/providers/implementations/ciphers/cipher_aria_gcm_hw.c index d5f211a484..927327c29c 100644 --- a/providers/implementations/ciphers/cipher_aria_gcm_hw.c +++ b/providers/implementations/ciphers/cipher_aria_gcm_hw.c @@ -19,7 +19,7 @@ static int aria_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key, PROV_ARIA_GCM_CTX *actx = (PROV_ARIA_GCM_CTX *)ctx; ARIA_KEY *ks = &actx->ks.ks; - GCM_HW_SET_KEY_CTR_FN(ks, aria_set_encrypt_key, aria_encrypt, NULL); + GCM_HW_SET_KEY_CTR_FN(ks, ossl_aria_set_encrypt_key, ossl_aria_encrypt, NULL); return 1; } diff --git a/providers/implementations/ciphers/cipher_aria_hw.c b/providers/implementations/ciphers/cipher_aria_hw.c index 8e114b3ba1..425d87a65e 100644 --- a/providers/implementations/ciphers/cipher_aria_hw.c +++ b/providers/implementations/ciphers/cipher_aria_hw.c @@ -18,15 +18,15 @@ static int cipher_hw_aria_initkey(PROV_CIPHER_CTX *dat, ARIA_KEY *ks = &adat->ks.ks; if (dat->enc || (mode != EVP_CIPH_ECB_MODE && mode != EVP_CIPH_CBC_MODE)) - ret = aria_set_encrypt_key(key, keylen * 8, ks); + ret = ossl_aria_set_encrypt_key(key, keylen * 8, ks); else - ret = aria_set_decrypt_key(key, keylen * 8, ks); + ret = ossl_aria_set_decrypt_key(key, keylen * 8, ks); if (ret < 0) { ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED); return 0; } dat->ks = ks; - dat->block = (block128_f)aria_encrypt; + dat->block = (block128_f)ossl_aria_encrypt; return 1; } |