void Evenodd_decoding_1(int rs_disk1,int rs_disk2){
  int i, j, stripe, k;
  char[] tmp;
  tmp=new char[p * block_size];
  char[] tmp_for_s;
  tmp_for_s=new char[block_size];
  if (rs_disk1 < data_disk_nbr && rs_disk2 == data_disk_nbr) {
    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];
        }
      }
    }
    stripe=(p - rs_disk1 - 1) % p;
    for (i=0; i < block_size; i++) {
      if (stripe == p - 1)       tmp_for_s[i]=tmp[stripe * block_size + i];
 else       tmp_for_s[i]=(char)(tmp[stripe * block_size + i] ^ check_data[data_disk_nbr + 2][stripe * block_size + i]);
    }
    for (i=0; i < block_nbr; i++) {
      for (j=0; j < block_size; j++) {
        tmp[i * block_size + j]^=(tmp_for_s[j] ^ check_data[data_disk_nbr + 2][i * block_size + j]);
      }
    }
    for (i=0; i < block_size; i++)     tmp[block_nbr * block_size + i]^=tmp_for_s[i];
    for (i=0; i < p; i++) {
      j=(i + p + rs_disk1) % p;
      if (j < p - 1) {
        System.arraycopy(tmp,i * block_size,check_data[rs_disk1],j * block_size,block_size);
      }
    }
    STAR_encoding_row();
  }
  if (rs_disk1 < data_disk_nbr && rs_disk2 < data_disk_nbr) {
    for (i=0; i < block_nbr; i++) {
      for (j=0; j < block_size; j++) {
        tmp_for_s[j]^=check_data[data_disk_nbr][i * block_size + j];
        tmp_for_s[j]^=check_data[data_disk_nbr + 2][i * block_size + j];
      }
    }
    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++) {
        if (i < block_nbr)         tmp[i * block_size + j]^=(check_data[data_disk_nbr + 2][i * block_size + j] ^ tmp_for_s[j]);
      }
    }
    for (j=0; j < block_size; j++)     tmp[block_nbr * block_size + j]^=tmp_for_s[j];
    stripe=(p - rs_disk1 - 1) % p;
    System.arraycopy(tmp,stripe * block_size,tmp_for_s,0,block_size);
    while (true) {
      k=(stripe + rs_disk2 + p) % p;
      if (k == block_nbr) {
        break;
      }
      System.arraycopy(tmp_for_s,0,check_data[rs_disk2],k * block_size,block_size);
      for (i=0; i < block_size; i++) {
        for (j=0; j <= data_disk_nbr; j++)         if (j != rs_disk1)         check_data[rs_disk1][k * block_size + i]^=check_data[j][k * block_size + i];
      }
      stripe=(k - rs_disk1 + p) % p;
      for (i=0; i < block_size; i++) {
        tmp_for_s[i]=(char)(check_data[rs_disk1][k * block_size + i] ^ tmp[stripe * block_size + i]);
      }
    }
  }
}

void Evenodd_decoding_1 ( int rs_disk1 , int rs_disk2 ) { int i , j , stripe , k ; char [ ] tmp ; tmp = new char [ p * block_size ] ; char [ ] tmp_for_s ; tmp_for_s = new char [ block_size ] ; if ( rs_disk1 < data_disk_nbr && rs_disk2 == data_disk_nbr ) { 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 ] ; } } } stripe = ( p - rs_disk1 - 1 ) % p ; for ( i = 0 ; i < block_size ; i ++ ) { if ( stripe == p - 1 ) tmp_for_s [ i ] = tmp [ stripe * block_size + i ] ; else tmp_for_s [ i ] = ( char ) ( tmp [ stripe * block_size + i ] ^ check_data [ data_disk_nbr + 2 ] [ stripe * block_size + i ] ) ; } for ( i = 0 ; i < block_nbr ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp [ i * block_size + j ] ^= ( tmp_for_s [ j ] ^ check_data [ data_disk_nbr + 2 ] [ i * block_size + j ] ) ; } } for ( i = 0 ; i < block_size ; i ++ ) tmp [ block_nbr * block_size + i ] ^= tmp_for_s [ i ] ; for ( i = 0 ; i < p ; i ++ ) { j = ( i + p + rs_disk1 ) % p ; if ( j < p - 1 ) { System . arraycopy ( tmp , i * block_size , check_data [ rs_disk1 ] , j * block_size , block_size ) ; } } STAR_encoding_row ( ) ; } if ( rs_disk1 < data_disk_nbr && rs_disk2 < data_disk_nbr ) { for ( i = 0 ; i < block_nbr ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp_for_s [ j ] ^= check_data [ data_disk_nbr ] [ i * block_size + j ] ; tmp_for_s [ j ] ^= check_data [ data_disk_nbr + 2 ] [ i * block_size + j ] ; } } 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 ++ ) { if ( i < block_nbr ) tmp [ i * block_size + j ] ^= ( check_data [ data_disk_nbr + 2 ] [ i * block_size + j ] ^ tmp_for_s [ j ] ) ; } } for ( j = 0 ; j < block_size ; j ++ ) tmp [ block_nbr * block_size + j ] ^= tmp_for_s [ j ] ; stripe = ( p - rs_disk1 - 1 ) % p ; System . arraycopy ( tmp , stripe * block_size , tmp_for_s , 0 , block_size ) ; while ( true ) { k = ( stripe + rs_disk2 + p ) % p ; if ( k == block_nbr ) { break ; } System . arraycopy ( tmp_for_s , 0 , check_data [ rs_disk2 ] , k * block_size , block_size ) ; for ( i = 0 ; i < block_size ; i ++ ) { for ( j = 0 ; j <= data_disk_nbr ; j ++ ) if ( j != rs_disk1 ) check_data [ rs_disk1 ] [ k * block_size + i ] ^= check_data [ j ] [ k * block_size + i ] ; } stripe = ( k - rs_disk1 + p ) % p ; for ( i = 0 ; i < block_size ; i ++ ) { tmp_for_s [ i ] = ( char ) ( check_data [ rs_disk1 ] [ k * block_size + i ] ^ tmp [ stripe * block_size + i ] ) ; } } } }
checksum data : row checksum and slope - 1 diagonal line like evenodd
