Program: 52402
Project: 52402
Buggy source:
public int doFinal(byte[] out,int outOff){
  padded=pad(buf,0,bufOff);
  processBlock(padded,0);
  byte[][] temp=new byte[STATE_BYTES_SIZE_1024][];
  for (int bufferIndex=0; bufferIndex < state.length; bufferIndex++) {
    temp[bufferIndex]=new byte[ROWS];
    System.arraycopy(state[bufferIndex],0,temp[bufferIndex],0,ROWS);
  }
  for (int roundIndex=0; roundIndex < rounds; roundIndex++) {
    for (int columnIndex=0; columnIndex < columns; columnIndex++) {
      temp[columnIndex][0]^=(byte)((columnIndex * 0x10) ^ roundIndex);
    }
    for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
      for (int columnIndex=0; columnIndex < columns; columnIndex++) {
        temp[columnIndex][rowIndex]=sBoxes[rowIndex % 4][temp[columnIndex][rowIndex] & 0xFF];
      }
    }
    int shift=-1;
    for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
      if ((rowIndex == ROWS - 1) && (columns == NB_1024)) {
        shift=11;
      }
 else {
        shift++;
      }
      for (int columnIndex=0; columnIndex < columns; columnIndex++) {
        tempBuffer[(columnIndex + shift) % columns]=temp[columnIndex][rowIndex];
      }
      for (int columnIndex=0; columnIndex < columns; columnIndex++) {
        temp[columnIndex][rowIndex]=tempBuffer[columnIndex];
      }
    }
    byte multiplicationResult;
    for (int columnIndex=0; columnIndex < columns; columnIndex++) {
      Arrays.fill(mixColumnsResult,(byte)0);
      for (int rowIndex=ROWS - 1; rowIndex >= 0; rowIndex--) {
        multiplicationResult=0;
        for (int rowInternalIndex=ROWS - 1; rowInternalIndex >= 0; rowInternalIndex--) {
          multiplicationResult^=multiplyGF(temp[columnIndex][rowInternalIndex],mds_matrix[rowIndex][rowInternalIndex]);
        }
        mixColumnsResult[rowIndex]=multiplicationResult;
      }
      for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
        temp[columnIndex][rowIndex]=mixColumnsResult[rowIndex];
      }
    }
  }
  for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
    for (int columnIndex=0; columnIndex < columns; columnIndex++) {
      state[columnIndex][rowIndex]^=temp[columnIndex][rowIndex];
    }
  }
  byte[] stateBuffer=new byte[ROWS * columns];
  int stateLineIndex=0;
  for (int columnIndex=0; columnIndex < columns; columnIndex++) {
    for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
      stateBuffer[stateLineIndex]=state[columnIndex][rowIndex];
      stateLineIndex++;
    }
  }
  System.arraycopy(stateBuffer,stateBuffer.length - hashSize,out,outOff,hashSize);
  return hashSize;
}

Fixed version (ground truth):
public int doFinal(byte[] out,int outOff){
  padded=pad(buf,0,bufOff);
  processBlock(padded,0);
  byte[][] temp=new byte[STATE_BYTES_SIZE_1024][];
  for (int bufferIndex=0; bufferIndex < state.length; bufferIndex++) {
    temp[bufferIndex]=new byte[ROWS];
    System.arraycopy(state[bufferIndex],0,temp[bufferIndex],0,ROWS);
  }
  for (int roundIndex=0; roundIndex < rounds; roundIndex++) {
    for (int columnIndex=0; columnIndex < columns; columnIndex++) {
      temp[columnIndex][0]^=(byte)((columnIndex * 0x10) ^ roundIndex);
    }
    for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
      for (int columnIndex=0; columnIndex < columns; columnIndex++) {
        temp[columnIndex][rowIndex]=sBoxes[rowIndex % 4][temp[columnIndex][rowIndex] & 0xFF];
      }
    }
    int shift=-1;
    for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
      if ((rowIndex == ROWS - 1) && (columns == NB_1024)) {
        shift=11;
      }
 else {
        shift++;
      }
      for (int columnIndex=0; columnIndex < columns; columnIndex++) {
        tempBuffer[(columnIndex + shift) % columns]=temp[columnIndex][rowIndex];
      }
      for (int columnIndex=0; columnIndex < columns; columnIndex++) {
        temp[columnIndex][rowIndex]=tempBuffer[columnIndex];
      }
    }
    byte multiplicationResult;
    for (int columnIndex=0; columnIndex < columns; columnIndex++) {
      Arrays.fill(mixColumnsResult,(byte)0);
      for (int rowIndex=ROWS - 1; rowIndex >= 0; rowIndex--) {
        multiplicationResult=0;
        for (int rowInternalIndex=ROWS - 1; rowInternalIndex >= 0; rowInternalIndex--) {
          multiplicationResult^=multiplyGF(temp[columnIndex][rowInternalIndex],mds_matrix[rowIndex][rowInternalIndex]);
        }
        mixColumnsResult[rowIndex]=multiplicationResult;
      }
      for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
        temp[columnIndex][rowIndex]=mixColumnsResult[rowIndex];
      }
    }
  }
  for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
    for (int columnIndex=0; columnIndex < columns; columnIndex++) {
      state[columnIndex][rowIndex]^=temp[columnIndex][rowIndex];
    }
  }
  byte[] stateBuffer=new byte[ROWS * columns];
  int stateLineIndex=0;
  for (int columnIndex=0; columnIndex < columns; columnIndex++) {
    for (int rowIndex=0; rowIndex < ROWS; rowIndex++) {
      stateBuffer[stateLineIndex]=state[columnIndex][rowIndex];
      stateLineIndex++;
    }
  }
  System.arraycopy(stateBuffer,stateBuffer.length - hashSize,out,outOff,hashSize);
  reset();
  return hashSize;
}