/** * Updates the digest using the specified array of bytes, * starting at the specified offset. * * @param input the array of bytes to use for the update. * @param offset the offset to start from in the array of bytes. * @param len the input of bytes to use, starting at * <code>offset</code>. */ protected void engineUpdate(byte[] input, int offset, int len) { for(int i = offset; i < offset+len; i ++) engineUpdate(input[i]); }
/** Creates a new instance of SHAInterleave @exception ProviderException thrown if MessageDigest.getInstance("SHA") throws a NoSuchAlgorithmException. */ public SHAInterleave() { try { sha = MessageDigest.getInstance("SHA"); } catch(NoSuchAlgorithmException e) { throw PicketBoxMessages.MESSAGES.failedToObtainSHAMessageDigest(e); } evenBytes = new ByteArrayOutputStream(); oddBytes = new ByteArrayOutputStream(); engineReset(); }
/** Creates a new instance of SHAInterleave @exception ProviderException thrown if MessageDigest.getInstance("SHA") throws a NoSuchAlgorithmException. */ public SHAInterleave() { try { sha = MessageDigest.getInstance("SHA"); } catch(NoSuchAlgorithmException e) { throw new ProviderException("Failed to obtain SHA MessageDigest"); } evenBytes = new ByteArrayOutputStream(); oddBytes = new ByteArrayOutputStream(); engineReset(); }
for(int i = 0; i < H.length; ++i) digest[2 * i + 1] = H[i]; engineReset(); return digest;
/** * Updates the digest using the specified array of bytes, * starting at the specified offset. * * @param input the array of bytes to use for the update. * @param offset the offset to start from in the array of bytes. * @param len the input of bytes to use, starting at * <code>offset</code>. */ protected void engineUpdate(byte[] input, int offset, int len) { for(int i = offset; i < offset+len; i ++) engineUpdate(input[i]); }
for(int i = 0; i < H.length; ++i) digest[2 * i + 1] = H[i]; engineReset(); return digest;