Cipher.update() and zero length data

Bernard Leach (leachbj@aba.net.au)
Wed, 14 Oct 1998 15:01:59 +1000

Hello!

At ABA we have been working on a clean room implementation of
the JCE API, and have come across a situation where a cipher
class has been asked to encrypt a zero length array. Specifically
Cipher.update() has been called with a zero length array. The
documentation is a little unclear as to how the Cipher class
will behave here and I'm expecting that it will just pass the
call onto the CipherSpi class to deal with. Unfortunately that
means that each SPI class has to include code to deal with all
the pathalogical cases.

So my question do the various Cipher.update() methods check for
things like in.length == 0 or just pass the arguments along
unchecked?

-- 
Bernard Leach                    Australian Business Access Pty Ltd.
leachbj@aba.net.au               http://www.aba.net.au/people/leachbj/