blob: d58f18f68db0fea13f70b771801955bfa18d2c58 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/* $Id$ */
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;
}
}
|