Skip to contentSkip to conversation

Recent AEAD change: testmgr.c change needed?

DISCUSSION Stephan Mueller 2 participants 3 messages Aug 19, 2015 – Aug 20, 2015 Crypto API

lore
Share & tools
lore
#0 lore raw

Hi Herbert,

The recent AEAD change seems to trigger a need to change something in testmgr.c. I ran my test tool trying to invoke all possible permutations of cra_name and cra_driver_name ciphers and got the following:

[11152.816179] alg: No test for gcm_base(ctr(aes-asm),ghash-generic) 
(gcm_base(ctr(aes-asm),ghash-generic))
[11154.278466] alg: No test for ccm_base(ctr(aes-asm),aes-asm) 
(ccm_base(ctr(aes-asm),aes-asm))
[11174.819535] alg: No test for gcm(aes-asm) (gcm_base(ctr(aes-asm),ghash-
clmulni))
[11174.819610] alg: No test for rfc4106(gcm(aes-asm)) 
(rfc4106(gcm_base(ctr(aes-asm),ghash-clmulni)))
[11174.819654] alg: No test for seqiv(rfc4106(gcm(aes-asm))) 
(seqiv(rfc4106(gcm_base(ctr(aes-asm),ghash-clmulni))))
[11192.292759] alg: No test for gcm_base(ctr-aes-aesni,ghash-clmulni) 
(gcm_base(ctr-aes-aesni,ghash-clmulni))
[11193.775049] alg: No test for ccm_base(ctr-aes-aesni,aes-aesni) 
(ccm_base(ctr-aes-aesni,aes-aesni))
[11213.936196] alg: No test for gcm(aes-aesni) (gcm_base(ctr(aes-aesni),ghash-
clmulni))
[11213.936308] alg: No test for rfc4106(gcm(aes-aesni)) 
(rfc4106(gcm_base(ctr(aes-aesni),ghash-clmulni)))
[11213.936418] alg: No test for seqiv(rfc4106(gcm(aes-aesni))) 
(seqiv(rfc4106(gcm_base(ctr(aes-aesni),ghash-clmulni))))
[11252.498078] alg: No test for seqiv(rfc4106(gcm(aes))) (seqiv(rfc4106-gcm-
aesni))
[11270.222200] alg: No test for gcm_base(ctr(aes-generic),ghash-generic) 
(gcm_base(ctr(aes-generic),ghash-generic))
[11271.602667] alg: No test for ccm_base(ctr(aes-generic),aes-generic) 

(ccm_base(ctr(aes-generic),aes-generic))

Albeit this listing is a nuisance in normal operation, it becomes fatal in fips=1 mode.

I guess we have to add all the listed ciphers into the big array in testmgr.c. If you concur, I could prepare a patch.

Signature · 2 lines
Ciao
Stephan
maintainer
#1 lore raw

Hi Staphan:

Quoted 7 lines · Stephan Mueller

The recent AEAD change seems to trigger a need to change something in testmgr.c. I ran my test tool trying to invoke all possible permutations of cra_name and cra_driver_name ciphers and got the following:

[11152.816179] alg: No test for gcm_base(ctr(aes-asm),ghash-generic) 

(gcm_base(ctr(aes-asm),ghash-generic))

This is a bug in gcm_base. It should not use the driver name as its cra_name. I'll try to fix this.

Quoted 6 lines
[11154.278466] alg: No test for ccm_base(ctr(aes-asm),aes-asm) 
(ccm_base(ctr(aes-asm),aes-asm))
[11174.819535] alg: No test for gcm(aes-asm) (gcm_base(ctr(aes-asm),ghash-
clmulni))
[11174.819610] alg: No test for rfc4106(gcm(aes-asm)) 

(rfc4106(gcm_base(ctr(aes-asm),ghash-clmulni)))

Ditto. gcm should also canonicalise aes-asm in its cra_name.

Quoted 2 lines
[11174.819654] alg: No test for seqiv(rfc4106(gcm(aes-asm))) 

(seqiv(rfc4106(gcm_base(ctr(aes-asm),ghash-clmulni))))

This is different. We should definitely add tests for the IV generators. Obviously we can't test the randomness but we can certainly test for correctness. What we can do is reuse the test vectors for the underlying algorithms.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
maintainer
#2 lore raw
Quoted 9 lines · Herbert Xu
Quoted 7 lines
[11154.278466] alg: No test for ccm_base(ctr(aes-asm),aes-asm) 
(ccm_base(ctr(aes-asm),aes-asm))
[11174.819535] alg: No test for gcm(aes-asm) (gcm_base(ctr(aes-asm),ghash-
clmulni))
[11174.819610] alg: No test for rfc4106(gcm(aes-asm)) 

(rfc4106(gcm_base(ctr(aes-asm),ghash-clmulni)))

Ditto. gcm should also canonicalise aes-asm in its cra_name.

I had a look and it seems that we need to fix ctr first to get the canonicalised name. So I'll revisit this after completing the skcipher work.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt