summaryrefslogtreecommitdiff
path: root/src/org/noreply/fancydress/type3/ForwardLeg.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/noreply/fancydress/type3/ForwardLeg.java')
-rw-r--r--src/org/noreply/fancydress/type3/ForwardLeg.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/org/noreply/fancydress/type3/ForwardLeg.java b/src/org/noreply/fancydress/type3/ForwardLeg.java
new file mode 100644
index 0000000..4088d11
--- /dev/null
+++ b/src/org/noreply/fancydress/type3/ForwardLeg.java
@@ -0,0 +1,30 @@
+package org.noreply.fancydress.type3;
+
+import org.noreply.fancydress.type3.routing.*;
+import org.noreply.fancydress.status.*;
+import org.noreply.fancydress.crypto.*;
+
+public class ForwardLeg extends SingleLeg {
+ private byte[][] sharedKeys;
+
+ public ForwardLeg (HalfPath path, Routing finalRouting)
+ throws Mix3BadArgumentsChainTooLongException
+ {
+ super();
+ Hop[] hops = path.getHops();
+
+ initSharedKeys(hops.length);
+ makeLeg(hops, sharedKeys, finalRouting);
+ };
+
+ private void initSharedKeys(int n) {
+ sharedKeys = new byte[n][];
+
+ for (int i=0; i < n; i++)
+ sharedKeys[i] = CryptoPrimitives.rand(CryptoPrimitives.KEY_LEN);
+ }
+
+ public byte[][] getSharedKeys() {
+ return sharedKeys;
+ }
+}