private byte[] engineDigest(byte[] in,int pos){
  if (pos != 0)   System.arraycopy(in,0,tmp,0,pos);
  tmp[pos++]=(byte)0x80;
  if (pos > DATA_LENGTH - 8) {
    while (pos < DATA_LENGTH)     tmp[pos++]=0;
    byte2int(tmp,0,data,0,DATA_LENGTH / 4);
    transform(data);
    pos=0;
  }
  while (pos < DATA_LENGTH - 8)   tmp[pos++]=0;
  byte2int(tmp,0,data,0,(DATA_LENGTH / 4) - 2);
  long bc=count * 8;
  data[14]=(int)(bc >>> 32);
  data[15]=(int)bc;
  transform(data);
  byte buf[]=new byte[HASH_LENGTH];
  int off=0;
  for (int i=0; i < HASH_LENGTH / 4; ++i) {
    int d=digest[i];
    buf[off++]=(byte)(d >>> 24);
    buf[off++]=(byte)(d >>> 16);
    buf[off++]=(byte)(d >>> 8);
    buf[off++]=(byte)d;
  }
  engineReset();
  return buf;
}

private byte [ ] engineDigest ( byte [ ] in , int pos ) { if ( pos != 0 ) System . arraycopy ( in , 0 , tmp , 0 , pos ) ; tmp [ pos ++ ] = ( byte ) 0x80 ; if ( pos > DATA_LENGTH - 8 ) { while ( pos < DATA_LENGTH ) tmp [ pos ++ ] = 0 ; byte2int ( tmp , 0 , data , 0 , DATA_LENGTH / 4 ) ; transform ( data ) ; pos = 0 ; } while ( pos < DATA_LENGTH - 8 ) tmp [ pos ++ ] = 0 ; byte2int ( tmp , 0 , data , 0 , ( DATA_LENGTH / 4 ) - 2 ) ; long bc = count * 8 ; data [ 14 ] = ( int ) ( bc > > > 32 ) ; data [ 15 ] = ( int ) bc ; transform ( data ) ; byte buf [ ] = new byte [ HASH_LENGTH ] ; int off = 0 ; for ( int i = 0 ; i < HASH_LENGTH / 4 ; ++ i ) { int d = digest [ i ] ; buf [ off ++ ] = ( byte ) ( d > > > 24 ) ; buf [ off ++ ] = ( byte ) ( d > > > 16 ) ; buf [ off ++ ] = ( byte ) ( d > > > 8 ) ; buf [ off ++ ] = ( byte ) d ; } engineReset ( ) ; return buf ; }
returns the digest of all data added ( previous and buffered ) and resets the digest .
