| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Scalar AES core transform |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2017 Linaro Ltd <ard.biesheuvel@linaro.org> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | |
|---|
| 11 | 8 | #include <crypto/aes.h> |
|---|
| .. | .. |
|---|
| 13 | 10 | #include <linux/module.h> |
|---|
| 14 | 11 | |
|---|
| 15 | 12 | asmlinkage void __aes_arm64_encrypt(u32 *rk, u8 *out, const u8 *in, int rounds); |
|---|
| 16 | | -EXPORT_SYMBOL(__aes_arm64_encrypt); |
|---|
| 17 | | - |
|---|
| 18 | 13 | asmlinkage void __aes_arm64_decrypt(u32 *rk, u8 *out, const u8 *in, int rounds); |
|---|
| 19 | | -EXPORT_SYMBOL(__aes_arm64_decrypt); |
|---|
| 20 | 14 | |
|---|
| 21 | | -static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) |
|---|
| 15 | +static void aes_arm64_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) |
|---|
| 22 | 16 | { |
|---|
| 23 | 17 | struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); |
|---|
| 24 | 18 | int rounds = 6 + ctx->key_length / 4; |
|---|
| .. | .. |
|---|
| 26 | 20 | __aes_arm64_encrypt(ctx->key_enc, out, in, rounds); |
|---|
| 27 | 21 | } |
|---|
| 28 | 22 | |
|---|
| 29 | | -static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) |
|---|
| 23 | +static void aes_arm64_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) |
|---|
| 30 | 24 | { |
|---|
| 31 | 25 | struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm); |
|---|
| 32 | 26 | int rounds = 6 + ctx->key_length / 4; |
|---|
| .. | .. |
|---|
| 46 | 40 | .cra_cipher.cia_min_keysize = AES_MIN_KEY_SIZE, |
|---|
| 47 | 41 | .cra_cipher.cia_max_keysize = AES_MAX_KEY_SIZE, |
|---|
| 48 | 42 | .cra_cipher.cia_setkey = crypto_aes_set_key, |
|---|
| 49 | | - .cra_cipher.cia_encrypt = aes_encrypt, |
|---|
| 50 | | - .cra_cipher.cia_decrypt = aes_decrypt |
|---|
| 43 | + .cra_cipher.cia_encrypt = aes_arm64_encrypt, |
|---|
| 44 | + .cra_cipher.cia_decrypt = aes_arm64_decrypt |
|---|
| 51 | 45 | }; |
|---|
| 52 | 46 | |
|---|
| 53 | 47 | static int __init aes_init(void) |
|---|