diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-09-17 14:24:39 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-09-17 14:24:39 +0400 |
commit | d03a1a1a45b922c970da7895878a91270b9d3567 (patch) | |
tree | 7d336574b3aa4b8926acd519809bd50dc07ec492 /core/src/main/java/org/bouncycastle/crypto/tls/TlsStreamCipher.java | |
parent | bca63325a489aea4c649ee992cc7df22d4dc9349 (diff) |
Add some TODOs related to draft-josefsson-salsa20-tls-02
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsStreamCipher.java')
-rw-r--r-- | core/src/main/java/org/bouncycastle/crypto/tls/TlsStreamCipher.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsStreamCipher.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsStreamCipher.java index effa6545..178731d3 100644 --- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsStreamCipher.java +++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsStreamCipher.java @@ -89,6 +89,13 @@ public class TlsStreamCipher public byte[] encodePlaintext(long seqNo, short type, byte[] plaintext, int offset, int len) { + /* + * TODO[draft-josefsson-salsa20-tls-02] Note that Salsa20 requires a 64-bit nonce. That + * nonce is updated on the encryption of every TLS record, and is set to be the 64-bit TLS + * record sequence number. In case of DTLS the 64-bit nonce is formed as the concatenation + * of the 16-bit epoch with the 48-bit sequence number. + */ + byte[] outBuf = new byte[len + writeMac.getSize()]; encryptCipher.processBytes(plaintext, offset, len, outBuf, 0); @@ -110,6 +117,13 @@ public class TlsStreamCipher public byte[] decodeCiphertext(long seqNo, short type, byte[] ciphertext, int offset, int len) throws IOException { + /* + * TODO[draft-josefsson-salsa20-tls-02] Note that Salsa20 requires a 64-bit nonce. That + * nonce is updated on the encryption of every TLS record, and is set to be the 64-bit TLS + * record sequence number. In case of DTLS the 64-bit nonce is formed as the concatenation + * of the 16-bit epoch with the 48-bit sequence number. + */ + int macSize = readMac.getSize(); if (len < macSize) { |