Пример #1
0
 // see JCE spec
 protected byte[] engineUpdate(byte[] in, int inOfs, int inLen) {
   try {
     byte[] out = new byte[updateLength(inLen)];
     int n = engineUpdate(in, inOfs, inLen, out, 0);
     return P11Util.convert(out, 0, n);
   } catch (ShortBufferException e) {
     // convert since the output length is calculated by updateLength()
     throw new ProviderException(e);
   }
 }
Пример #2
0
 // see JCE spec
 protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen)
     throws IllegalBlockSizeException, BadPaddingException {
   try {
     byte[] out = new byte[doFinalLength(inLen)];
     int n = engineDoFinal(in, inOfs, inLen, out, 0);
     return P11Util.convert(out, 0, n);
   } catch (ShortBufferException e) {
     // convert since the output length is calculated by doFinalLength()
     throw new ProviderException(e);
   }
 }