summaryrefslogtreecommitdiff
path: root/src/org/noreply/fancydress/type3/SURB.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/noreply/fancydress/type3/SURB.java')
-rw-r--r--src/org/noreply/fancydress/type3/SURB.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/noreply/fancydress/type3/SURB.java b/src/org/noreply/fancydress/type3/SURB.java
index 4ef8948..6733909 100644
--- a/src/org/noreply/fancydress/type3/SURB.java
+++ b/src/org/noreply/fancydress/type3/SURB.java
@@ -25,7 +25,7 @@ public class SURB extends SingleLeg {
validateHash = CryptoPrimitives.hash(seed, secret, validate);
} while (validateHash[validateHash.length-1] == 0);
- byte[] key = Util.slice(CryptoPrimitives.hash(seed, secret, Util.toOctets("Generate")), 0,CryptoPrimitives.KEY_LEN);
+ byte[] key = Util.slice(CryptoPrimitives.hash(seed, secret, Util.toOctets("Generate")), 0, CryptoPrimitives.KEY_LEN);
byte[] stream = CryptoPrimitives.prng(key, CryptoPrimitives.KEY_LEN*(hops.length + 1));
sharedSecret = Util.slice(stream, CryptoPrimitives.KEY_LEN*hops.length, CryptoPrimitives.KEY_LEN);
@@ -33,6 +33,7 @@ public class SURB extends SingleLeg {
for (int i=0; i<hops.length; i++)
sharedKeys[i] = Util.slice(stream, (hops.length-i-1)*CryptoPrimitives.KEY_LEN, CryptoPrimitives.KEY_LEN);
+ address.setDecodingHandle(seed);
makeLeg(hops, sharedKeys, address);
};
@@ -50,9 +51,10 @@ public class SURB extends SingleLeg {
public String export() {
byte[] beginMarker = Util.toOctets("SURB");
int useBy = 1068595200; //FIXME // Y2k36
- byte[] routingInformation = getRoute().getRoutingInformation();
+ RoutingForward route = getRoute().asSwap();
+ byte[] routingInformation = route.getRoutingInformation();
int routingSize = routingInformation.length;
- int routingType = getRoute().getRoutingType();
+ int routingType = route.getRoutingType();
byte[] result = new byte[4+2+4+SINGLE_HEADER_LEN+2+2+CryptoPrimitives.KEY_LEN+routingSize];