| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Cryptographic API. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Support for OMAP AES HW ACCELERATOR defines |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (c) 2015 Texas Instruments Incorporated |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as published |
|---|
| 10 | | - * by the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | #ifndef __OMAP_AES_H__ |
|---|
| 14 | 10 | #define __OMAP_AES_H__ |
|---|
| 15 | 11 | |
|---|
| 12 | +#include <crypto/aes.h> |
|---|
| 16 | 13 | #include <crypto/engine.h> |
|---|
| 17 | 14 | |
|---|
| 18 | 15 | #define DST_MAXBURST 4 |
|---|
| .. | .. |
|---|
| 83 | 80 | |
|---|
| 84 | 81 | #define FLAGS_INIT BIT(5) |
|---|
| 85 | 82 | #define FLAGS_FAST BIT(6) |
|---|
| 86 | | -#define FLAGS_BUSY BIT(7) |
|---|
| 87 | 83 | |
|---|
| 88 | 84 | #define FLAGS_IN_DATA_ST_SHIFT 8 |
|---|
| 89 | 85 | #define FLAGS_OUT_DATA_ST_SHIFT 10 |
|---|
| .. | .. |
|---|
| 102 | 98 | u32 key[AES_KEYSIZE_256 / sizeof(u32)]; |
|---|
| 103 | 99 | u8 nonce[4]; |
|---|
| 104 | 100 | struct crypto_skcipher *fallback; |
|---|
| 105 | | - struct crypto_skcipher *ctr; |
|---|
| 101 | +}; |
|---|
| 102 | + |
|---|
| 103 | +struct omap_aes_gcm_ctx { |
|---|
| 104 | + struct omap_aes_ctx octx; |
|---|
| 105 | + struct crypto_aes_ctx actx; |
|---|
| 106 | 106 | }; |
|---|
| 107 | 107 | |
|---|
| 108 | 108 | struct omap_aes_reqctx { |
|---|
| .. | .. |
|---|
| 110 | 110 | unsigned long mode; |
|---|
| 111 | 111 | u8 iv[AES_BLOCK_SIZE]; |
|---|
| 112 | 112 | u32 auth_tag[AES_BLOCK_SIZE / sizeof(u32)]; |
|---|
| 113 | + struct skcipher_request fallback_req; // keep at the end |
|---|
| 113 | 114 | }; |
|---|
| 114 | 115 | |
|---|
| 115 | 116 | #define OMAP_AES_QUEUE_LENGTH 1 |
|---|
| 116 | 117 | #define OMAP_AES_CACHE_SIZE 0 |
|---|
| 117 | 118 | |
|---|
| 118 | 119 | struct omap_aes_algs_info { |
|---|
| 119 | | - struct crypto_alg *algs_list; |
|---|
| 120 | + struct skcipher_alg *algs_list; |
|---|
| 120 | 121 | unsigned int size; |
|---|
| 121 | 122 | unsigned int registered; |
|---|
| 122 | 123 | }; |
|---|
| .. | .. |
|---|
| 166 | 167 | struct aead_queue aead_queue; |
|---|
| 167 | 168 | spinlock_t lock; |
|---|
| 168 | 169 | |
|---|
| 169 | | - struct ablkcipher_request *req; |
|---|
| 170 | + struct skcipher_request *req; |
|---|
| 170 | 171 | struct aead_request *aead_req; |
|---|
| 171 | 172 | struct crypto_engine *engine; |
|---|
| 172 | 173 | |
|---|
| .. | .. |
|---|
| 206 | 207 | unsigned int keylen); |
|---|
| 207 | 208 | int omap_aes_gcm_encrypt(struct aead_request *req); |
|---|
| 208 | 209 | int omap_aes_gcm_decrypt(struct aead_request *req); |
|---|
| 210 | +int omap_aes_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize); |
|---|
| 209 | 211 | int omap_aes_4106gcm_encrypt(struct aead_request *req); |
|---|
| 210 | 212 | int omap_aes_4106gcm_decrypt(struct aead_request *req); |
|---|
| 213 | +int omap_aes_4106gcm_setauthsize(struct crypto_aead *parent, |
|---|
| 214 | + unsigned int authsize); |
|---|
| 215 | +int omap_aes_gcm_cra_init(struct crypto_aead *tfm); |
|---|
| 211 | 216 | int omap_aes_write_ctrl(struct omap_aes_dev *dd); |
|---|
| 212 | 217 | int omap_aes_crypt_dma_start(struct omap_aes_dev *dd); |
|---|
| 213 | 218 | int omap_aes_crypt_dma_stop(struct omap_aes_dev *dd); |
|---|