diff options
Diffstat (limited to 'src/main/java/org/bouncycastle/crypto/tls/DTLSEpoch.java')
-rw-r--r-- | src/main/java/org/bouncycastle/crypto/tls/DTLSEpoch.java | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/main/java/org/bouncycastle/crypto/tls/DTLSEpoch.java b/src/main/java/org/bouncycastle/crypto/tls/DTLSEpoch.java index 49a7f536..cbef79f6 100644 --- a/src/main/java/org/bouncycastle/crypto/tls/DTLSEpoch.java +++ b/src/main/java/org/bouncycastle/crypto/tls/DTLSEpoch.java @@ -1,6 +1,7 @@ package org.bouncycastle.crypto.tls;
-class DTLSEpoch {
+class DTLSEpoch
+{
private final DTLSReplayWindow replayWindow = new DTLSReplayWindow();
@@ -9,11 +10,14 @@ class DTLSEpoch { private long sequence_number = 0;
- DTLSEpoch(int epoch, TlsCipher cipher) {
- if (epoch < 0) {
+ DTLSEpoch(int epoch, TlsCipher cipher)
+ {
+ if (epoch < 0)
+ {
throw new IllegalArgumentException("'epoch' must be >= 0");
}
- if (cipher == null) {
+ if (cipher == null)
+ {
throw new IllegalArgumentException("'cipher' cannot be null");
}
@@ -21,24 +25,29 @@ class DTLSEpoch { this.cipher = cipher;
}
- long allocateSequenceNumber() {
+ long allocateSequenceNumber()
+ {
// TODO Check for overflow
return sequence_number++;
}
- TlsCipher getCipher() {
+ TlsCipher getCipher()
+ {
return cipher;
}
- int getEpoch() {
+ int getEpoch()
+ {
return epoch;
}
- DTLSReplayWindow getReplayWindow() {
+ DTLSReplayWindow getReplayWindow()
+ {
return replayWindow;
}
- long getSequence_number() {
+ long getSequence_number()
+ {
return sequence_number;
}
}
|