atoulme commented on a change in pull request #27: Fix bug with scuttlebutt
boxstream segments not being formed properly
URL: https://github.com/apache/incubator-tuweni/pull/27#discussion_r306330958
##########
File path:
scuttlebutt-handshake/src/main/java/org/apache/tuweni/scuttlebutt/handshake/SecureScuttlebuttStream.java
##########
@@ -136,17 +138,36 @@ private Bytes decryptMessage(Bytes message,
SecretBox.Key key, MutableBytes nonc
private Bytes encrypt(Bytes message, SecretBox.Key clientToServerKey,
MutableBytes clientToServerNonce) {
int messages = (int) Math.ceil((double) message.size() / 4096d);
Bytes[] encryptedMessages = new Bytes[messages];
- for (int i = 0; i < messages; i++) {
- Bytes encryptedMessage = encryptMessage(
- message.slice(i * 4096, Math.min((i + 1) * 4096, message.size() - i
* 4096)),
Review comment:
yeah that call here is faulty, I call slice incorrectly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]