Program: 91179
Project: 91179
Buggy source:
public static String encryptNoEcMultiply(byte[] stretcedKeyMaterial,InMemoryPrivateKey key,byte[] salt){
  int checksumLength=4;
  byte[] encoded=new byte[39 + checksumLength];
  int index=0;
  encoded[index++]=(byte)0x01;
  encoded[index++]=(byte)0x42;
  byte non_EC_multiplied=(byte)0xC0;
  byte compressedPublicKey=key.getPublicKey().isCompressed() ? (byte)0x20 : (byte)0;
  encoded[index++]=(byte)(non_EC_multiplied | compressedPublicKey);
  System.arraycopy(salt,0,encoded,index,salt.length);
  index+=salt.length;
  byte[] derivedHalf1=new byte[32];
  System.arraycopy(stretcedKeyMaterial,0,derivedHalf1,0,32);
  byte[] derivedHalf2=new byte[32];
  System.arraycopy(stretcedKeyMaterial,32,derivedHalf2,0,32);
  Rijndael aes=new Rijndael();
  aes.makeKey(derivedHalf2,256);
  byte[] complete=key.getPrivateKeyBytes();
  byte[] toEncryptPart1=new byte[16];
  for (int i=0; i < 16; i++) {
    toEncryptPart1[i]=(byte)((((int)complete[i]) & 0xFF) ^ (((int)derivedHalf1[i]) & 0xFF));
  }
  byte[] encryptedHalf1=new byte[16];
  aes.encrypt(toEncryptPart1,encryptedHalf1);
  System.arraycopy(encryptedHalf1,0,encoded,index,encryptedHalf1.length);
  index+=encryptedHalf1.length;
  byte[] toEncryptPart2=new byte[16];
  for (int i=0; i < 16; i++) {
    toEncryptPart2[i]=(byte)((((int)complete[16 + i]) & 0xFF) ^ (((int)derivedHalf1[16 + i]) & 0xFF));
  }
  byte[] encryptedHalf2=new byte[16];
  aes.encrypt(toEncryptPart2,encryptedHalf2);
  System.arraycopy(encryptedHalf2,0,encoded,index,encryptedHalf2.length);
  index+=encryptedHalf2.length;
  Sha256Hash checkSum=HashUtils.doubleSha256(encoded,0,39);
  byte[] start=checkSum.firstFourBytes();
  System.arraycopy(start,0,encoded,39,checksumLength);
  String result=Base58.encode(encoded);
  return result;
}

Fixed version (ground truth):
public static String encryptNoEcMultiply(byte[] stretcedKeyMaterial,InMemoryPrivateKey key,byte[] salt){
  int checksumLength=4;
  byte[] encoded=new byte[39 + checksumLength];
  int index=0;
  encoded[index++]=(byte)0x01;
  encoded[index++]=(byte)0x42;
  byte non_EC_multiplied=(byte)0xC0;
  byte compressedPublicKey=key.getPublicKey().isCompressed() ? (byte)0x20 : (byte)0;
  encoded[index++]=(byte)(non_EC_multiplied | compressedPublicKey);
  System.arraycopy(salt,0,encoded,index,salt.length);
  index+=salt.length;
  byte[] derivedHalf1=new byte[32];
  System.arraycopy(stretcedKeyMaterial,0,derivedHalf1,0,32);
  byte[] derivedHalf2=new byte[32];
  System.arraycopy(stretcedKeyMaterial,32,derivedHalf2,0,32);
  Rijndael aes=new Rijndael();
  aes.makeKey(derivedHalf2,256);
  byte[] complete=key.getPrivateKeyBytes();
  byte[] toEncryptPart1=new byte[16];
  for (int i=0; i < 16; i++) {
    toEncryptPart1[i]=(byte)((((int)complete[i]) & 0xFF) ^ (((int)derivedHalf1[i]) & 0xFF));
  }
  byte[] encryptedHalf1=new byte[16];
  aes.encrypt(toEncryptPart1,encryptedHalf1);
  System.arraycopy(encryptedHalf1,0,encoded,index,encryptedHalf1.length);
  index+=encryptedHalf1.length;
  byte[] toEncryptPart2=new byte[16];
  for (int i=0; i < 16; i++) {
    toEncryptPart2[i]=(byte)((((int)complete[16 + i]) & 0xFF) ^ (((int)derivedHalf1[16 + i]) & 0xFF));
  }
  byte[] encryptedHalf2=new byte[16];
  aes.encrypt(toEncryptPart2,encryptedHalf2);
  System.arraycopy(encryptedHalf2,0,encoded,index,encryptedHalf2.length);
  index+=encryptedHalf2.length;
  Sha256Hash checkSum=HashUtils.doubleSha256(encoded,0,39);
  byte[] start=checkSum.firstFourBytes();
  System.arraycopy(start,0,encoded,39,checksumLength);
  return Base58.encode(encoded);
}