From 566d17f731637df6828bdf32502a0fb123882dbe Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 9 Oct 2003 11:41:45 +0000 Subject: Initial import --- src/org/noreply/fancydress/type3/ForwardLeg.java | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/org/noreply/fancydress/type3/ForwardLeg.java (limited to 'src/org/noreply/fancydress/type3/ForwardLeg.java') 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; + } +} -- cgit v1.2.3