G method

void G(
  1. Register64 m1,
  2. Register64 m2,
  3. int posA,
  4. int posB,
  5. int posC,
  6. int posD,
)

Implementation

void G(Register64 m1, Register64 m2, int posA, int posB, int posC, int posD) {
  // This variable is faster as a local. The allocation is probably sunk.
  final r = Register64();

  _internalState[posA].sumReg(r
    ..set(_internalState[posB])
    ..sumReg(m1));
  _internalState[posD]
    ..xor(_internalState[posA])
    ..rotr(32);
  _internalState[posC].sumReg(_internalState[posD]);
  _internalState[posB]
    ..xor(_internalState[posC])
    ..rotr(24);
  _internalState[posA].sumReg(r
    ..set(_internalState[posB])
    ..sumReg(m2));
  _internalState[posD]
    ..xor(_internalState[posA])
    ..rotr(16);
  _internalState[posC].sumReg(_internalState[posD]);
  _internalState[posB]
    ..xor(_internalState[posC])
    ..rotr(63);
}