2021-07-09 05:49:54

by Steve French

[permalink] [raw]
Subject: how to request crypto_alloc_shash for GMAC

I was trying to add support for GMAC packet signing in the kernel
client (support for it, as an alternative to CMAC, has recently been
added to some SMB3.1.1 servers)

Presumably due to https://www.ietf.org/rfc/rfc4543.txt it is already
supported in the kernel ... but what is the name that it is exposed as
in the kernel crypto libraries?

When calling crypto_alloc_shash, I tried the obvious name:
"gmac(aes)"
(similar to what was previously used "cmac(aes)" and "hmac(sha256")
but that didn't work.

Any idea what the algorithm name that is needed to be used for GMAC here?

In looking at drivers/crypto/ccp (not sure if that is the right
subdir) - the closest I see is ccp-crypto-aes-galois.c but using that
name I also got the same error (rc=-2) trying to request that as:
"galois(aes)"

What is the correct name to use to request GMAC in crypto_alloc_shash?

Doing "git grep crypto_alloc_shash" there are no matches on:
- "gcm" or "gmac" or "galois"
How is it named?
--
Thanks,

Steve


2021-07-09 06:50:59

by Herbert Xu

[permalink] [raw]
Subject: Re: how to request crypto_alloc_shash for GMAC

On Fri, Jul 09, 2021 at 12:48:00AM -0500, Steve French wrote:
>
> Presumably due to https://www.ietf.org/rfc/rfc4543.txt it is already
> supported in the kernel ... but what is the name that it is exposed as
> in the kernel crypto libraries?

We don't have standalone gmac in the kernel, it only exists as
part of the AEAD algorithm gcm. You're more than welcome to add
it of course.

Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt