void STAR_encoding_diag2(){
  int i, j, stripe, k;
  char[] tmp;
  tmp=new char[p * block_size];
  for (stripe=0; stripe < block_nbr + 1; stripe++) {
    for (i=0; i < data_disk_nbr; i++) {
      for (j=0; j < block_size; j++) {
        k=(stripe + i + p) % p;
        if (k < block_nbr)         tmp[stripe * block_size + j]^=check_data[i][k * block_size + j];
      }
    }
  }
  for (i=0; i < block_nbr; i++) {
    for (j=0; j < block_size; j++) {
      tmp[i * block_size + j]^=tmp[block_nbr * block_size + j];
    }
  }
  System.arraycopy(tmp,0,check_data[data_disk_nbr + 2],0,stripe_unit_size);
}

void STAR_encoding_diag2 ( ) { int i , j , stripe , k ; char [ ] tmp ; tmp = new char [ p * block_size ] ; for ( stripe = 0 ; stripe < block_nbr + 1 ; stripe ++ ) { for ( i = 0 ; i < data_disk_nbr ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { k = ( stripe + i + p ) % p ; if ( k < block_nbr ) tmp [ stripe * block_size + j ] ^= check_data [ i ] [ k * block_size + j ] ; } } } for ( i = 0 ; i < block_nbr ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp [ i * block_size + j ] ^= tmp [ block_nbr * block_size + j ] ; } } System . arraycopy ( tmp , 0 , check_data [ data_disk_nbr + 2 ] , 0 , stripe_unit_size ) ; }
entry function for encoding diagonal line checksum , slope - 1 , * check_data [ p + 2 ]
