caam: Can you do zero-length seq fifo loads?

2015-06-13 Thread Herbert Xu
Hi Kim:

I'm trying to convert the caam driver to the new AEAD interface.

I've run into some weird code in the GCM implementation.  The
function gcm_set_sh_desc handles generic GCM and it does some
pretty hairy stuff with respect to zero-length AD and zero-length
cryptlen.

It appears to be avoiding doing a zero-length seq fifo load by
checking the length before each operation.  So my question is
is it forbidden to do a zero-length seq fifo load? If so what
happens when you do it? This is important because none of the
other AEAD implementations (e.g., RFC4543) check for zero lengths.
With the new AEAD user-space interface it is quite easy to give
a zero-length request to any AEAD algorithm.

Also it appears that in caamhash we don't avoid doing zero-length
seq fifo loads at all.  And they obviously work because our very
first selftest for SHA is a zero-length digest.

So could it be that zero-length seq fifo loads do work but only
work once?

Or is it that seq fifo loads stop working after a previous seq fifo
load reaches length zero? If so can you get around this by always
adding some extra pading after the end of the sequence?

Thanks,
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [cryptodev:master 73/233] drivers/crypto/nx/nx-842-pseries.c:45:14: error: 'DDE_BUFFER_LAST_MULT' undeclared here (not in a function)

2015-06-13 Thread Dan Streetman
On Sat, Jun 13, 2015 at 8:58 AM, kbuild test robot
fengguang...@intel.com wrote:
 tree:   
 git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
 head:   81781e681551ed3f56c9202e9adc7ef941cba654
 commit: 959e6659b6f74ec1fa4d391a3b88d63dc0189f36 [73/233] crypto: nx - add 
 nx842 constraints
 config: powerpc-allmodconfig (attached as .config)
 reproduce:
   wget 
 https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
  -O ~/bin/make.cross
   chmod +x ~/bin/make.cross
   git checkout 959e6659b6f74ec1fa4d391a3b88d63dc0189f36
   # save the attached .config to linux build tree
   make.cross ARCH=powerpc

 Note: the cryptodev/master HEAD 81781e681551ed3f56c9202e9adc7ef941cba654 
 builds fine.
   It only hurts bisectibility.

 All error/warnings (new ones prefixed by ):

 drivers/crypto/nx/nx-842-pseries.c:45:14: error: 'DDE_BUFFER_LAST_MULT' 
 undeclared here (not in a function)
  .multiple = DDE_BUFFER_LAST_MULT,
  ^

sorry, that is added by the next patch in the patch series, so there
should be no problem except this specific patch will have to be
skipped during bisecting.



 vim +/DDE_BUFFER_LAST_MULT +45 drivers/crypto/nx/nx-842-pseries.c

 39
 40  /* IO buffer must be 128 byte aligned */
 41  #define IO_BUFFER_ALIGN 128
 42
 43  static struct nx842_constraints nx842_pseries_constraints = {
 44  .alignment =IO_BUFFER_ALIGN,
45  .multiple = DDE_BUFFER_LAST_MULT,
 46  .minimum =  IO_BUFFER_ALIGN,
 47  .maximum =  PAGE_SIZE, /* dynamic, max_sync_size */
 48  };

 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html