public void decoding(){
  int i, j, k, m, stripe;
  int rs_nbr=0;
  int rs_data_nbr=0;
  int rs_check_nbr=0;
  int rs_disk1=-1;
  int rs_disk2=-1;
  int rs_disk3=-1;
  if (stripe_unit_size % block_nbr != 0) {
    throw new RuntimeException(" Cannot  striping. wrong DATA_LENGTH!");
  }
  for (i=0; i < data_disk_nbr + 2; i++) {
    if (restarts[i] == 1) {
      rs_disk1=i;
      break;
    }
  }
  if (rs_disk1 != -1) {
    for (i=rs_disk1 + 1; i < data_disk_nbr + 2; i++) {
      if (restarts[i] == 1) {
        rs_disk2=i;
        break;
      }
    }
  }
  if (rs_disk2 != -1) {
    for (i=rs_disk2 + 1; i < data_disk_nbr + 2; i++) {
      if (restarts[i] == 1) {
        rs_disk3=i;
        break;
      }
    }
  }
  if (rs_disk1 != -1) {
    Arrays.fill(check_data[rs_disk1],(char)0);
  }
  if (rs_disk2 != -1) {
    Arrays.fill(check_data[rs_disk2],(char)0);
  }
  if (rs_disk3 != -1) {
    Arrays.fill(check_data[rs_disk3],(char)0);
  }
  for (i=0; i <= data_disk_nbr + 2; i++)   rs_nbr+=restarts[i];
  if (TOLERENCE < rs_nbr) {
    throw new RuntimeException(" Too many error data!");
  }
  for (i=0; i < data_disk_nbr; i++)   rs_data_nbr+=restarts[i];
  rs_check_nbr=rs_nbr - rs_data_nbr;
  if (rs_data_nbr == 0) {
    if (restarts[data_disk_nbr] == 1)     STAR_encoding_row();
    if (restarts[data_disk_nbr + 1] == 1)     STAR_encoding_diag1();
    if (restarts[data_disk_nbr + 2] == 1)     STAR_encoding_diag2();
  }
  if (rs_data_nbr == 1) {
    if (rs_check_nbr <= 1) {
      Evenodd_decoding(restarts);
      if (restarts[data_disk_nbr + 2] == 1)       STAR_encoding_diag2();
    }
    if (rs_check_nbr == 2) {
      if (restarts[data_disk_nbr] == 0) {
        for (i=0; i < stripe_unit_size; i++) {
          for (j=0; j <= data_disk_nbr; j++) {
            if (j != rs_disk1)             check_data[rs_disk1][i]^=check_data[j][i];
          }
        }
        STAR_encoding_diag1();
        STAR_encoding_diag2();
      }
      if (restarts[data_disk_nbr] == 1) {
        if (restarts[data_disk_nbr + 2] == 1) {
          Evenodd_decoding(restarts);
          STAR_encoding_diag2();
        }
        if (restarts[data_disk_nbr + 1] == 1) {
          Evenodd_decoding_1(rs_disk1,rs_disk2);
          STAR_encoding_diag1();
        }
      }
    }
  }
  if (rs_data_nbr == 2) {
    if (rs_check_nbr == 0) {
      Evenodd_decoding(restarts);
    }
 else {
      if (restarts[data_disk_nbr] == 1) {
        char[] tmp_for_s1s2;
        tmp_for_s1s2=new char[block_size];
        for (i=0; i < block_nbr; i++) {
          for (j=0; j < block_size; j++) {
            tmp_for_s1s2[j]^=check_data[data_disk_nbr + 1][i * block_size + j];
            tmp_for_s1s2[j]^=check_data[data_disk_nbr + 2][i * block_size + j];
          }
        }
        char[][] tmp;
        tmp=new char[3][p * block_size];
        for (i=0; i < stripe_unit_size; i++) {
          for (j=0; j <= data_disk_nbr; j++) {
            tmp[0][i]^=check_data[j][i];
          }
        }
        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[1][stripe * block_size + j]^=check_data[i][k * block_size + j];
              }
            }
          }
        }
        for (i=0; i < stripe_unit_size; i++) {
          tmp[1][i]^=check_data[data_disk_nbr + 1][i];
        }
        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[2][stripe * block_size + j]^=check_data[i][k * block_size + j];
              }
            }
          }
        }
        for (i=0; i < stripe_unit_size; i++) {
          tmp[2][i]^=check_data[data_disk_nbr + 2][i];
        }
        char[][] tmp_for_xor;
        tmp_for_xor=new char[p][block_size];
        for (i=0; i < block_nbr + 1; i++) {
          for (j=0; j < block_size; j++) {
            tmp_for_xor[i][j]=(char)(tmp[0][i * block_size + j] ^ tmp[0][((rs_disk2 - rs_disk1 + i) % p) * block_size + j] ^ tmp[1][((rs_disk2 + p + i) % p) * block_size + j]^ tmp[2][((p - rs_disk1 + i) % p) * block_size + j]^ tmp_for_s1s2[j]);
          }
        }
        k=p - 1 - (rs_disk2 - rs_disk1);
        for (i=0; i < block_size; i++) {
          check_data[data_disk_nbr][k * block_size + i]=tmp_for_xor[k][i];
        }
        m=block_nbr - 1;
        while (0 != m) {
          i=(k + rs_disk1 - rs_disk2 + p) % p;
          for (j=0; j < block_size; j++) {
            check_data[data_disk_nbr][i * block_size + j]=(char)(tmp_for_xor[i][j] ^ check_data[data_disk_nbr][k * block_size + j]);
          }
          k=i;
          m--;
        }
        restarts[data_disk_nbr]=0;
        Evenodd_decoding(restarts);
      }
    }
    if (restarts[data_disk_nbr + 1] == 1) {
      Evenodd_decoding_1(rs_disk1,rs_disk2);
      STAR_encoding_diag1();
    }
    if (restarts[data_disk_nbr + 2] == 1) {
      Evenodd_decoding(restarts);
      STAR_encoding_diag2();
    }
  }
  if (rs_data_nbr == 3) {
    int r, s, t, u, v;
    char[][] tmp;
    tmp=new char[3][p * block_size];
    char[] tmp_for_s1;
    tmp_for_s1=new char[block_size];
    char[] tmp_for_s2;
    tmp_for_s2=new char[block_size];
    char[][] tmp_for_xor;
    tmp_for_xor=new char[p][block_size];
    for (i=0; i < block_nbr; i++) {
      for (j=0; j < block_size; j++) {
        tmp_for_s1[j]^=check_data[data_disk_nbr][i * block_size + j];
        tmp_for_s1[j]^=check_data[data_disk_nbr + 1][i * block_size + j];
        tmp_for_s2[j]^=check_data[data_disk_nbr][i * block_size + j];
        tmp_for_s2[j]^=check_data[data_disk_nbr + 2][i * block_size + j];
      }
    }
    for (i=0; i < stripe_unit_size; i++) {
      for (j=0; j <= data_disk_nbr; j++) {
        tmp[0][i]^=check_data[j][i];
      }
    }
    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[1][stripe * block_size + j]^=check_data[i][k * block_size + j];
          }
        }
      }
    }
    for (i=0; i < block_nbr + 1; i++) {
      for (j=0; j < block_size; j++) {
        if (i < block_nbr)         tmp[1][i * block_size + j]^=(check_data[data_disk_nbr + 1][i * block_size + j] ^ tmp_for_s1[j]);
 else         tmp[1][i * block_size + j]^=tmp_for_s1[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[2][stripe * block_size + j]^=check_data[i][k * block_size + j];
          }
        }
      }
    }
    for (i=0; i < block_nbr + 1; i++) {
      for (j=0; j < block_size; j++) {
        if (i < block_nbr)         tmp[2][i * block_size + j]^=(check_data[data_disk_nbr + 2][i * block_size + j] ^ tmp_for_s2[j]);
 else         tmp[2][i * block_size + j]^=tmp_for_s2[j];
      }
    }
    r=rs_disk1;
    s=rs_disk2;
    t=rs_disk3;
    u=s - r;
    v=t - s;
    if (u == v) {
      for (i=0; i < block_nbr + 1; i++) {
        for (j=0; j < block_size; j++) {
          tmp_for_xor[i][j]=(char)(tmp[0][i * block_size + j] ^ tmp[0][((t - r + i) % p) * block_size + j] ^ tmp[1][((t + p + i) % p) * block_size + j]^ tmp[2][((p - r + i) % p) * block_size + j]);
        }
      }
      k=p - 1 - (t - r);
      for (i=0; i < block_size; i++) {
        check_data[s][k * block_size + i]=tmp_for_xor[k][i];
      }
      m=block_nbr - 1;
      while (0 != m) {
        i=(r - t + k + p) % p;
        for (j=0; j < block_size; j++) {
          check_data[s][i * block_size + j]=(char)(tmp_for_xor[i][j] ^ check_data[s][k * block_size + j]);
        }
        k=i;
        m--;
      }
    }
 else     if (u != v) {
      int d;
      char[][] flag;
      flag=new char[3][p];
      for (d=0; d <= p; d++) {
        if ((u + v * d) % p == 0) {
          break;
        }
      }
      for (i=0; i < d; i++) {
        flag[0][(0 + i * v) % p]++;
        flag[1][(s - r + i * v) % p]++;
        flag[2][(t - r + i * v) % p]++;
        flag[2][(0 + i * v) % p]++;
        flag[1][(t - s + i * v) % p]++;
        flag[0][(t - r + i * v) % p]++;
      }
      int[] count;
      count=new int[p];
      for (i=0; i < p; i++) {
        for (j=0; j < 3; j++) {
          if (flag[j][i] == 1)           count[i]++;
        }
      }
      for (m=0; m < block_nbr + 1; m++) {
        for (i=0; i < p; i++) {
          if (count[i] == 2 || count[i] == 3) {
            for (j=0; j < block_size; j++)             tmp_for_xor[m][j]^=tmp[0][((i + m) % p) * block_size + j];
          }
        }
        for (i=0; i < d; i++) {
          for (j=0; j < block_size; j++) {
            tmp_for_xor[m][j]^=tmp[1][((t + p + 0+ i * v + m) % p) * block_size + j];
            tmp_for_xor[m][j]^=tmp[2][((p - r + 0 + i * v + m) % p) * block_size + j];
          }
        }
      }
      i=u - 1;
      k=(u + i) % p;
      for (j=0; j < block_size; j++) {
        check_data[s][k * block_size + j]=tmp_for_xor[i][j];
      }
      m=block_nbr - 1;
      while (0 != m) {
        i=(k + u) % p;
        for (j=0; j < block_size; j++) {
          check_data[s][((u + i) % p) * block_size + j]=(char)(tmp_for_xor[i][j] ^ check_data[s][k * block_size + j]);
        }
        k=(u + i) % p;
        m--;
      }
    }
    restarts[s]=0;
    Evenodd_decoding(restarts);
  }
}

public void decoding ( ) { int i , j , k , m , stripe ; int rs_nbr = 0 ; int rs_data_nbr = 0 ; int rs_check_nbr = 0 ; int rs_disk1 = - 1 ; int rs_disk2 = - 1 ; int rs_disk3 = - 1 ; if ( stripe_unit_size % block_nbr != 0 ) { throw new RuntimeException ( " Cannot  striping. wrong DATA_LENGTH!" ) ; } for ( i = 0 ; i < data_disk_nbr + 2 ; i ++ ) { if ( restarts [ i ] == 1 ) { rs_disk1 = i ; break ; } } if ( rs_disk1 != - 1 ) { for ( i = rs_disk1 + 1 ; i < data_disk_nbr + 2 ; i ++ ) { if ( restarts [ i ] == 1 ) { rs_disk2 = i ; break ; } } } if ( rs_disk2 != - 1 ) { for ( i = rs_disk2 + 1 ; i < data_disk_nbr + 2 ; i ++ ) { if ( restarts [ i ] == 1 ) { rs_disk3 = i ; break ; } } } if ( rs_disk1 != - 1 ) { Arrays . fill ( check_data [ rs_disk1 ] , ( char ) 0 ) ; } if ( rs_disk2 != - 1 ) { Arrays . fill ( check_data [ rs_disk2 ] , ( char ) 0 ) ; } if ( rs_disk3 != - 1 ) { Arrays . fill ( check_data [ rs_disk3 ] , ( char ) 0 ) ; } for ( i = 0 ; i <= data_disk_nbr + 2 ; i ++ ) rs_nbr += restarts [ i ] ; if ( TOLERENCE < rs_nbr ) { throw new RuntimeException ( " Too many error data!" ) ; } for ( i = 0 ; i < data_disk_nbr ; i ++ ) rs_data_nbr += restarts [ i ] ; rs_check_nbr = rs_nbr - rs_data_nbr ; if ( rs_data_nbr == 0 ) { if ( restarts [ data_disk_nbr ] == 1 ) STAR_encoding_row ( ) ; if ( restarts [ data_disk_nbr + 1 ] == 1 ) STAR_encoding_diag1 ( ) ; if ( restarts [ data_disk_nbr + 2 ] == 1 ) STAR_encoding_diag2 ( ) ; } if ( rs_data_nbr == 1 ) { if ( rs_check_nbr <= 1 ) { Evenodd_decoding ( restarts ) ; if ( restarts [ data_disk_nbr + 2 ] == 1 ) STAR_encoding_diag2 ( ) ; } if ( rs_check_nbr == 2 ) { if ( restarts [ data_disk_nbr ] == 0 ) { for ( i = 0 ; i < stripe_unit_size ; i ++ ) { for ( j = 0 ; j <= data_disk_nbr ; j ++ ) { if ( j != rs_disk1 ) check_data [ rs_disk1 ] [ i ] ^= check_data [ j ] [ i ] ; } } STAR_encoding_diag1 ( ) ; STAR_encoding_diag2 ( ) ; } if ( restarts [ data_disk_nbr ] == 1 ) { if ( restarts [ data_disk_nbr + 2 ] == 1 ) { Evenodd_decoding ( restarts ) ; STAR_encoding_diag2 ( ) ; } if ( restarts [ data_disk_nbr + 1 ] == 1 ) { Evenodd_decoding_1 ( rs_disk1 , rs_disk2 ) ; STAR_encoding_diag1 ( ) ; } } } } if ( rs_data_nbr == 2 ) { if ( rs_check_nbr == 0 ) { Evenodd_decoding ( restarts ) ; } else { if ( restarts [ data_disk_nbr ] == 1 ) { char [ ] tmp_for_s1s2 ; tmp_for_s1s2 = new char [ block_size ] ; for ( i = 0 ; i < block_nbr ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp_for_s1s2 [ j ] ^= check_data [ data_disk_nbr + 1 ] [ i * block_size + j ] ; tmp_for_s1s2 [ j ] ^= check_data [ data_disk_nbr + 2 ] [ i * block_size + j ] ; } } char [ ] [ ] tmp ; tmp = new char [ 3 ] [ p * block_size ] ; for ( i = 0 ; i < stripe_unit_size ; i ++ ) { for ( j = 0 ; j <= data_disk_nbr ; j ++ ) { tmp [ 0 ] [ i ] ^= check_data [ j ] [ i ] ; } } 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 [ 1 ] [ stripe * block_size + j ] ^= check_data [ i ] [ k * block_size + j ] ; } } } } for ( i = 0 ; i < stripe_unit_size ; i ++ ) { tmp [ 1 ] [ i ] ^= check_data [ data_disk_nbr + 1 ] [ i ] ; } 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 [ 2 ] [ stripe * block_size + j ] ^= check_data [ i ] [ k * block_size + j ] ; } } } } for ( i = 0 ; i < stripe_unit_size ; i ++ ) { tmp [ 2 ] [ i ] ^= check_data [ data_disk_nbr + 2 ] [ i ] ; } char [ ] [ ] tmp_for_xor ; tmp_for_xor = new char [ p ] [ block_size ] ; for ( i = 0 ; i < block_nbr + 1 ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp_for_xor [ i ] [ j ] = ( char ) ( tmp [ 0 ] [ i * block_size + j ] ^ tmp [ 0 ] [ ( ( rs_disk2 - rs_disk1 + i ) % p ) * block_size + j ] ^ tmp [ 1 ] [ ( ( rs_disk2 + p + i ) % p ) * block_size + j ] ^ tmp [ 2 ] [ ( ( p - rs_disk1 + i ) % p ) * block_size + j ] ^ tmp_for_s1s2 [ j ] ) ; } } k = p - 1 - ( rs_disk2 - rs_disk1 ) ; for ( i = 0 ; i < block_size ; i ++ ) { check_data [ data_disk_nbr ] [ k * block_size + i ] = tmp_for_xor [ k ] [ i ] ; } m = block_nbr - 1 ; while ( 0 != m ) { i = ( k + rs_disk1 - rs_disk2 + p ) % p ; for ( j = 0 ; j < block_size ; j ++ ) { check_data [ data_disk_nbr ] [ i * block_size + j ] = ( char ) ( tmp_for_xor [ i ] [ j ] ^ check_data [ data_disk_nbr ] [ k * block_size + j ] ) ; } k = i ; m -- ; } restarts [ data_disk_nbr ] = 0 ; Evenodd_decoding ( restarts ) ; } } if ( restarts [ data_disk_nbr + 1 ] == 1 ) { Evenodd_decoding_1 ( rs_disk1 , rs_disk2 ) ; STAR_encoding_diag1 ( ) ; } if ( restarts [ data_disk_nbr + 2 ] == 1 ) { Evenodd_decoding ( restarts ) ; STAR_encoding_diag2 ( ) ; } } if ( rs_data_nbr == 3 ) { int r , s , t , u , v ; char [ ] [ ] tmp ; tmp = new char [ 3 ] [ p * block_size ] ; char [ ] tmp_for_s1 ; tmp_for_s1 = new char [ block_size ] ; char [ ] tmp_for_s2 ; tmp_for_s2 = new char [ block_size ] ; char [ ] [ ] tmp_for_xor ; tmp_for_xor = new char [ p ] [ block_size ] ; for ( i = 0 ; i < block_nbr ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp_for_s1 [ j ] ^= check_data [ data_disk_nbr ] [ i * block_size + j ] ; tmp_for_s1 [ j ] ^= check_data [ data_disk_nbr + 1 ] [ i * block_size + j ] ; tmp_for_s2 [ j ] ^= check_data [ data_disk_nbr ] [ i * block_size + j ] ; tmp_for_s2 [ j ] ^= check_data [ data_disk_nbr + 2 ] [ i * block_size + j ] ; } } for ( i = 0 ; i < stripe_unit_size ; i ++ ) { for ( j = 0 ; j <= data_disk_nbr ; j ++ ) { tmp [ 0 ] [ i ] ^= check_data [ j ] [ i ] ; } } 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 [ 1 ] [ stripe * block_size + j ] ^= check_data [ i ] [ k * block_size + j ] ; } } } } for ( i = 0 ; i < block_nbr + 1 ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { if ( i < block_nbr ) tmp [ 1 ] [ i * block_size + j ] ^= ( check_data [ data_disk_nbr + 1 ] [ i * block_size + j ] ^ tmp_for_s1 [ j ] ) ; else tmp [ 1 ] [ i * block_size + j ] ^= tmp_for_s1 [ 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 [ 2 ] [ stripe * block_size + j ] ^= check_data [ i ] [ k * block_size + j ] ; } } } } for ( i = 0 ; i < block_nbr + 1 ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { if ( i < block_nbr ) tmp [ 2 ] [ i * block_size + j ] ^= ( check_data [ data_disk_nbr + 2 ] [ i * block_size + j ] ^ tmp_for_s2 [ j ] ) ; else tmp [ 2 ] [ i * block_size + j ] ^= tmp_for_s2 [ j ] ; } } r = rs_disk1 ; s = rs_disk2 ; t = rs_disk3 ; u = s - r ; v = t - s ; if ( u == v ) { for ( i = 0 ; i < block_nbr + 1 ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp_for_xor [ i ] [ j ] = ( char ) ( tmp [ 0 ] [ i * block_size + j ] ^ tmp [ 0 ] [ ( ( t - r + i ) % p ) * block_size + j ] ^ tmp [ 1 ] [ ( ( t + p + i ) % p ) * block_size + j ] ^ tmp [ 2 ] [ ( ( p - r + i ) % p ) * block_size + j ] ) ; } } k = p - 1 - ( t - r ) ; for ( i = 0 ; i < block_size ; i ++ ) { check_data [ s ] [ k * block_size + i ] = tmp_for_xor [ k ] [ i ] ; } m = block_nbr - 1 ; while ( 0 != m ) { i = ( r - t + k + p ) % p ; for ( j = 0 ; j < block_size ; j ++ ) { check_data [ s ] [ i * block_size + j ] = ( char ) ( tmp_for_xor [ i ] [ j ] ^ check_data [ s ] [ k * block_size + j ] ) ; } k = i ; m -- ; } } else if ( u != v ) { int d ; char [ ] [ ] flag ; flag = new char [ 3 ] [ p ] ; for ( d = 0 ; d <= p ; d ++ ) { if ( ( u + v * d ) % p == 0 ) { break ; } } for ( i = 0 ; i < d ; i ++ ) { flag [ 0 ] [ ( 0 + i * v ) % p ] ++ ; flag [ 1 ] [ ( s - r + i * v ) % p ] ++ ; flag [ 2 ] [ ( t - r + i * v ) % p ] ++ ; flag [ 2 ] [ ( 0 + i * v ) % p ] ++ ; flag [ 1 ] [ ( t - s + i * v ) % p ] ++ ; flag [ 0 ] [ ( t - r + i * v ) % p ] ++ ; } int [ ] count ; count = new int [ p ] ; for ( i = 0 ; i < p ; i ++ ) { for ( j = 0 ; j < 3 ; j ++ ) { if ( flag [ j ] [ i ] == 1 ) count [ i ] ++ ; } } for ( m = 0 ; m < block_nbr + 1 ; m ++ ) { for ( i = 0 ; i < p ; i ++ ) { if ( count [ i ] == 2 || count [ i ] == 3 ) { for ( j = 0 ; j < block_size ; j ++ ) tmp_for_xor [ m ] [ j ] ^= tmp [ 0 ] [ ( ( i + m ) % p ) * block_size + j ] ; } } for ( i = 0 ; i < d ; i ++ ) { for ( j = 0 ; j < block_size ; j ++ ) { tmp_for_xor [ m ] [ j ] ^= tmp [ 1 ] [ ( ( t + p + 0 + i * v + m ) % p ) * block_size + j ] ; tmp_for_xor [ m ] [ j ] ^= tmp [ 2 ] [ ( ( p - r + 0 + i * v + m ) % p ) * block_size + j ] ; } } } i = u - 1 ; k = ( u + i ) % p ; for ( j = 0 ; j < block_size ; j ++ ) { check_data [ s ] [ k * block_size + j ] = tmp_for_xor [ i ] [ j ] ; } m = block_nbr - 1 ; while ( 0 != m ) { i = ( k + u ) % p ; for ( j = 0 ; j < block_size ; j ++ ) { check_data [ s ] [ ( ( u + i ) % p ) * block_size + j ] = ( char ) ( tmp_for_xor [ i ] [ j ] ^ check_data [ s ] [ k * block_size + j ] ) ; } k = ( u + i ) % p ; m -- ; } } restarts [ s ] = 0 ; Evenodd_decoding ( restarts ) ; } }
main function for encoding
