Message ID | 20240326153219.2915080-1-avromanov@salutedevices.com |
---|---|
Headers | show |
Series | Support more Amlogic SoC families in crypto driver | expand |
On Tue, Mar 26, 2024 at 06:32:06PM +0300, Alexey Romanov wrote: > > /* > * struct meson_cipher_tfm_ctx - context for a skcipher TFM > - * @key: pointer to key data > + * @keyiv: key data > * @keylen: len of the key > * @keymode: The keymode(type and size of key) associated with this TFM > * @mc: pointer to the private data of driver handling this TFM > * @fallback_tfm: pointer to the fallback TFM > */ > struct meson_cipher_tfm_ctx { > - u32 *key; > - u32 keylen; > + u8 keyiv[AES_MAX_KEY_SIZE + AES_BLOCK_SIZE] ____cacheline_aligned; > + u32 keylen ____cacheline_aligned; This doesn't do anything to guarantee that tfm_ctx is aligned. You either need to align this by hand, or you could use the crypto_skcipher_ctx_dma helper if DMA alignment is what you're actually looking for. Cheers,
On Tue, Mar 26, 2024 at 06:32:07PM +0300, Alexey Romanov wrote: > Introduce support for SHA1/SHA224/SHA256 hash algos. > Tested via tcrypt and custom tests. > > Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> > --- > drivers/crypto/amlogic/Makefile | 2 +- > drivers/crypto/amlogic/amlogic-gxl-core.c | 25 +- > drivers/crypto/amlogic/amlogic-gxl-hasher.c | 460 ++++++++++++++++++++ > drivers/crypto/amlogic/amlogic-gxl.h | 51 +++ > 4 files changed, 536 insertions(+), 2 deletions(-) > create mode 100644 drivers/crypto/amlogic/amlogic-gxl-hasher.c Where are the import/export functions? Cheers,
Hello Herbert, On Fri, Apr 05, 2024 at 02:56:30PM +0800, Herbert Xu wrote: > On Tue, Mar 26, 2024 at 06:32:07PM +0300, Alexey Romanov wrote: > > Introduce support for SHA1/SHA224/SHA256 hash algos. > > Tested via tcrypt and custom tests. > > > > Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> > > --- > > drivers/crypto/amlogic/Makefile | 2 +- > > drivers/crypto/amlogic/amlogic-gxl-core.c | 25 +- > > drivers/crypto/amlogic/amlogic-gxl-hasher.c | 460 ++++++++++++++++++++ > > drivers/crypto/amlogic/amlogic-gxl.h | 51 +++ > > 4 files changed, 536 insertions(+), 2 deletions(-) > > create mode 100644 drivers/crypto/amlogic/amlogic-gxl-hasher.c > > Where are the import/export functions? Sorry, I miss understand you. What do you mean by "import/epxort functions"? > > Cheers, > -- > Email: Herbert Xu <herbert@gondor.apana.org.au> > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
On Wed, Apr 10, 2024 at 10:39:14AM +0000, Alexey Romanov wrote: > Hello Herbert, > > On Fri, Apr 05, 2024 at 02:56:30PM +0800, Herbert Xu wrote: > > On Tue, Mar 26, 2024 at 06:32:07PM +0300, Alexey Romanov wrote: > > > Introduce support for SHA1/SHA224/SHA256 hash algos. > > > Tested via tcrypt and custom tests. > > > > > > Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> > > > --- > > > drivers/crypto/amlogic/Makefile | 2 +- > > > drivers/crypto/amlogic/amlogic-gxl-core.c | 25 +- > > > drivers/crypto/amlogic/amlogic-gxl-hasher.c | 460 ++++++++++++++++++++ > > > drivers/crypto/amlogic/amlogic-gxl.h | 51 +++ > > > 4 files changed, 536 insertions(+), 2 deletions(-) > > > create mode 100644 drivers/crypto/amlogic/amlogic-gxl-hasher.c > > > > Where are the import/export functions? > > Sorry, I miss understand you. What do you mean by "import/epxort > functions"? The crypto hash API supports partial hashing, which means that you need to be able to hash part of the data, save the state, and then resume it later. If your hardware only supports full hashing then you will need to add a software fallback. Cheers,