Update comments
parent
97a1e8cae2
commit
30b304b0f1
|
|
@ -225,8 +225,11 @@ void HC128Policy::OperateKeystream(KeystreamOperation operation, byte *output, c
|
||||||
PutWord(false, LITTLE_ENDIAN_ORDER, output + 60, keystream[15]);
|
PutWord(false, LITTLE_ENDIAN_ORDER, output + 60, keystream[15]);
|
||||||
|
|
||||||
// If AdditiveCipherTemplate does not have an accumulated keystream
|
// If AdditiveCipherTemplate does not have an accumulated keystream
|
||||||
// then it will ask OperateKeystream to XOR the plaintext with
|
// then it will ask OperateKeystream to generate one. Optionally it
|
||||||
// the keystream and write it to the ciphertext buffer.
|
// will ask for an XOR of the input with the keystream while
|
||||||
|
// writing the result to the output buffer. In all cases the
|
||||||
|
// output buffer is written. The optional part is adding the
|
||||||
|
// input buffer and keystream.
|
||||||
if ((operation & INPUT_NULL) != INPUT_NULL)
|
if ((operation & INPUT_NULL) != INPUT_NULL)
|
||||||
xorbuf(output, input, 64);
|
xorbuf(output, input, 64);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,11 @@ void HC256Policy::OperateKeystream(KeystreamOperation operation, byte *output, c
|
||||||
PutWord(false, LITTLE_ENDIAN_ORDER, out, Generate());
|
PutWord(false, LITTLE_ENDIAN_ORDER, out, Generate());
|
||||||
|
|
||||||
// If AdditiveCipherTemplate does not have an accumulated keystream
|
// If AdditiveCipherTemplate does not have an accumulated keystream
|
||||||
// then it will ask OperateKeystream to XOR the plaintext with
|
// then it will ask OperateKeystream to generate one. Optionally it
|
||||||
// the keystream and write it to the ciphertext buffer.
|
// will ask for an XOR of the input with the keystream while
|
||||||
|
// writing the result to the output buffer. In all cases the
|
||||||
|
// output buffer is written. The optional part is adding the
|
||||||
|
// input buffer and keystream.
|
||||||
if ((operation & INPUT_NULL) != INPUT_NULL)
|
if ((operation & INPUT_NULL) != INPUT_NULL)
|
||||||
xorbuf(output, input, msglen);
|
xorbuf(output, input, msglen);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
rabbit.cpp
14
rabbit.cpp
|
|
@ -137,8 +137,11 @@ void RabbitPolicy::OperateKeystream(KeystreamOperation operation, byte *output,
|
||||||
}
|
}
|
||||||
|
|
||||||
// If AdditiveCipherTemplate does not have an accumulated keystream
|
// If AdditiveCipherTemplate does not have an accumulated keystream
|
||||||
// then it will ask OperateKeystream to XOR the plaintext with
|
// then it will ask OperateKeystream to generate one. Optionally it
|
||||||
// the keystream and write it to the ciphertext buffer.
|
// will ask for an XOR of the input with the keystream while
|
||||||
|
// writing the result to the output buffer. In all cases the
|
||||||
|
// output buffer is written. The optional part is adding the
|
||||||
|
// input buffer and keystream.
|
||||||
if ((operation & INPUT_NULL) != INPUT_NULL)
|
if ((operation & INPUT_NULL) != INPUT_NULL)
|
||||||
xorbuf(output, input, GetBytesPerIteration() * iterationCount);
|
xorbuf(output, input, GetBytesPerIteration() * iterationCount);
|
||||||
}
|
}
|
||||||
|
|
@ -235,8 +238,11 @@ void RabbitWithIVPolicy::OperateKeystream(KeystreamOperation operation, byte *ou
|
||||||
}
|
}
|
||||||
|
|
||||||
// If AdditiveCipherTemplate does not have an accumulated keystream
|
// If AdditiveCipherTemplate does not have an accumulated keystream
|
||||||
// then it will ask OperateKeystream to XOR the plaintext with
|
// then it will ask OperateKeystream to generate one. Optionally it
|
||||||
// the keystream and write it to the ciphertext buffer.
|
// will ask for an XOR of the input with the keystream while
|
||||||
|
// writing the result to the output buffer. In all cases the
|
||||||
|
// output buffer is written. The optional part is adding the
|
||||||
|
// input buffer and keystream.
|
||||||
if ((operation & INPUT_NULL) != INPUT_NULL)
|
if ((operation & INPUT_NULL) != INPUT_NULL)
|
||||||
xorbuf(output, input, GetBytesPerIteration() * iterationCount);
|
xorbuf(output, input, GetBytesPerIteration() * iterationCount);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue