[Webfunds-commits] java/webfunds/token/algorithm AbstractPrivateTokenParameters.java AbstractPublicTokenParameters.java AbstractToken.java AbstractTokenUtil.java ChaumPrivateTokenParameters.java ChaumProtoToken.java ChaumPublicTokenParameters.java ChaumToken.java EncodeDecodeUtil.java RandomToken.java

Edwin Woudt edwin@cypherpunks.ai
Fri, 5 Jan 2001 03:39:31 -0400 (AST)


edwin       01/01/05 03:39:31

  Modified:    webfunds/token/algorithm AbstractPrivateTokenParameters.java
                        AbstractPublicTokenParameters.java
                        AbstractToken.java AbstractTokenUtil.java
                        ChaumPrivateTokenParameters.java
                        ChaumProtoToken.java
                        ChaumPublicTokenParameters.java ChaumToken.java
                        EncodeDecodeUtil.java RandomToken.java
  Log:
  Fixin' bugs

Revision  Changes    Path
1.4       +26 -10    java/webfunds/token/algorithm/AbstractPrivateTokenParameters.java

Index: AbstractPrivateTokenParameters.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/AbstractPrivateTokenParameters.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractPrivateTokenParameters.java	2001/01/04 01:16:10	1.3
+++ AbstractPrivateTokenParameters.java	2001/01/05 07:39:29	1.4
@@ -1,4 +1,4 @@
-/* $Id: AbstractPrivateTokenParameters.java,v 1.3 2001/01/04 01:16:10 edwin Exp $
+/* $Id: AbstractPrivateTokenParameters.java,v 1.4 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -22,7 +22,7 @@
 /**
  * Abstraction for private (key) data.
  *
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public abstract class AbstractPrivateTokenParameters 
@@ -155,28 +155,44 @@
                         AbstractTokenUtil.PKT_PRIVATEPARAMS, this);
         start += delta; len -= delta;
         
-        int privlen = EncodeDecodeUtil.decodeInt(data, start, len);
-        start += 4; len -= 4;
-        
-        decodePrivateImpl(data, start, privlen);
-        start += privlen; len -= privlen;
-        
         int publen = EncodeDecodeUtil.decodeInt(data, start, len);
         start += 4; len -= 4;
         
+        pubdata = new byte[publen];
+        System.arraycopy(data, start, pubdata, 0, publen);
+        
         decodePublicImpl(data, start, publen);
         start += publen; len -= publen;
+
+
+        int siglen = EncodeDecodeUtil.decodeInt(data, start, len);
+        start += 4; len -= 4;
+        
+        sigdata = new byte[siglen];
+        System.arraycopy(data, start, sigdata, 0, siglen);
+        
+        start += siglen; len -= siglen;
+
+
+        int privlen = EncodeDecodeUtil.decodeInt(data, start, len);
+        start += 4; len -= 4;
+        
+        privdata = new byte[privlen];
+        System.arraycopy(data, start, privdata, 0, privlen);
+        
+        decodePrivateImpl(data, start, privlen);
+        start += privlen; len -= privlen;
     }
 
     public final byte[] encodePublicData() {
 
-        return AbstractTokenUtil.encodeParams(pubdata, null,
+        return AbstractTokenUtil.encodeParams(pubdata, null, sigdata,
                    AbstractTokenUtil.PKT_PUBLICPARAMS, this);
     }
     
     public final byte[] encodePrivateData() {
 
-        return AbstractTokenUtil.encodeParams(pubdata, privdata,
+        return AbstractTokenUtil.encodeParams(pubdata, privdata, sigdata,
                    AbstractTokenUtil.PKT_PRIVATEPARAMS, this);
     }
 



1.5       +17 -4     java/webfunds/token/algorithm/AbstractPublicTokenParameters.java

Index: AbstractPublicTokenParameters.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/AbstractPublicTokenParameters.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AbstractPublicTokenParameters.java	2001/01/04 02:08:14	1.4
+++ AbstractPublicTokenParameters.java	2001/01/05 07:39:29	1.5
@@ -1,4 +1,4 @@
-/* $Id: AbstractPublicTokenParameters.java,v 1.4 2001/01/04 02:08:14 edwin Exp $
+/* $Id: AbstractPublicTokenParameters.java,v 1.5 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -21,7 +21,7 @@
 /**
  * Class description
  *
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public abstract class AbstractPublicTokenParameters
@@ -80,14 +80,27 @@
     throws DataFormatException, UnsupportedVersionException
     {
         int delta = AbstractTokenUtil.decodeParams(data, start, len, 
-                        AbstractTokenUtil.PKT_PRIVATEPARAMS, this);
+                        AbstractTokenUtil.PKT_PUBLICPARAMS, this);
         start += delta; len -= delta;
-        
+
+
         int publen = EncodeDecodeUtil.decodeInt(data, start, len);
         start += 4; len -= 4;
         
+        pubdata = new byte[publen];
+        System.arraycopy(data, start, pubdata, 0, publen);
+        
         decodeImpl(data, start, publen);
         start += publen; len -= publen;
+
+
+        int siglen = EncodeDecodeUtil.decodeInt(data, start, len);
+        start += 4; len -= 4;
+        
+        sigdata = new byte[siglen];
+        System.arraycopy(data, start, sigdata, 0, siglen);
+        
+        start += siglen; len -= siglen;
     }
 
 



1.5       +4 -2      java/webfunds/token/algorithm/AbstractToken.java

Index: AbstractToken.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/AbstractToken.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AbstractToken.java	2001/01/04 01:16:10	1.4
+++ AbstractToken.java	2001/01/05 07:39:29	1.5
@@ -1,4 +1,4 @@
-/* $Id: AbstractToken.java,v 1.4 2001/01/04 01:16:10 edwin Exp $
+/* $Id: AbstractToken.java,v 1.5 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -13,7 +13,7 @@
 /**
  * Class description
  *
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public abstract class AbstractToken implements AbstractTokenInterface {
@@ -66,6 +66,8 @@
     
 // Processing methods
 //.............................................................................
+
+    public abstract byte[] getUniqueID();
 
     public abstract boolean verifyPublic(
                                   AbstractPublicTokenParameters pubparams);



1.3       +12 -6     java/webfunds/token/algorithm/AbstractTokenUtil.java

Index: AbstractTokenUtil.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/AbstractTokenUtil.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AbstractTokenUtil.java	2001/01/04 01:16:10	1.2
+++ AbstractTokenUtil.java	2001/01/05 07:39:29	1.3
@@ -1,4 +1,4 @@
-/* $Id: AbstractTokenUtil.java,v 1.2 2001/01/04 01:16:10 edwin Exp $
+/* $Id: AbstractTokenUtil.java,v 1.3 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -11,7 +11,7 @@
 /**
  * Constants for the token library
  *
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public final class AbstractTokenUtil {
@@ -113,7 +113,7 @@
     
     
     public static final byte[] encodeParams(byte[] pubdata, byte[] privdata,
-                                            byte identifier, 
+                                            byte[] sigdata, byte identifier, 
                                             AbstractParamInterface tok) 
     {
         int len = 0;
@@ -125,6 +125,7 @@
         len += 4; // number of denominations
         len += 8 * tok.getDenominations().length;
         len += EncodeDecodeUtil.getByteArrayLength(pubdata);
+        len += EncodeDecodeUtil.getByteArrayLength(sigdata);
         if (privdata != null)
             len += EncodeDecodeUtil.getByteArrayLength(privdata);
         
@@ -155,18 +156,23 @@
         
         long[] denoms = tok.getDenominations();
         EncodeDecodeUtil.encodeInt(denoms.length, output, start);
+        start +=4; len -= 4;
         for (int i=0; i<denoms.length; i++) {
             EncodeDecodeUtil.encodeLong(denoms[i], output, start);
-            start += 4; len -= 4;
+            start += 8; len -= 8;
         }
         
         EncodeDecodeUtil.encodeByteArray(pubdata, output, start);
         delta = EncodeDecodeUtil.getByteArrayLength(pubdata);
         start += delta; len -= delta;
 
+        EncodeDecodeUtil.encodeByteArray(sigdata, output, start);
+        delta = EncodeDecodeUtil.getByteArrayLength(sigdata);
+        start += delta; len -= delta;
+
         if (privdata != null) {
-            EncodeDecodeUtil.encodeByteArray(pubdata, output, start);
-            delta = EncodeDecodeUtil.getByteArrayLength(pubdata);
+            EncodeDecodeUtil.encodeByteArray(privdata, output, start);
+            delta = EncodeDecodeUtil.getByteArrayLength(privdata);
             start += delta; len -= delta;
         }
 



1.5       +6 -6      java/webfunds/token/algorithm/ChaumPrivateTokenParameters.java

Index: ChaumPrivateTokenParameters.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/ChaumPrivateTokenParameters.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ChaumPrivateTokenParameters.java	2001/01/04 02:10:11	1.4
+++ ChaumPrivateTokenParameters.java	2001/01/05 07:39:29	1.5
@@ -1,4 +1,4 @@
-/* $Id: ChaumPrivateTokenParameters.java,v 1.4 2001/01/04 02:10:11 edwin Exp $
+/* $Id: ChaumPrivateTokenParameters.java,v 1.5 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -26,7 +26,7 @@
 /**
  * Class description
  *
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
  * @author Edwin Woudt <edwin@webfunds.org>
  * @author Jeroen van Gelderen <gelderen@cryptix.org>
  */
@@ -95,7 +95,7 @@
         
         n = EncodeDecodeUtil.decodeMPI(data, start, len);
         int delta = EncodeDecodeUtil.getMPILength(data, start, len);
-        start += delta; start -= len;
+        start += delta; len -= delta;
         
         this.denominations = getDenominations();
         e = new BigInteger[denominations.length];
@@ -103,7 +103,7 @@
         for (int i=0; i<denominations.length; i++) {
             e[i] = EncodeDecodeUtil.decodeMPI(data, start, len);
             delta = EncodeDecodeUtil.getMPILength(data, start, len);
-            start += delta; start -= len;
+            start += delta; len -= delta;
         }
     }
 
@@ -117,7 +117,7 @@
         for (int i=0; i<denominations.length; i++) {
             d[i] = EncodeDecodeUtil.decodeMPI(data, start, len);
             int delta = EncodeDecodeUtil.getMPILength(data, start, len);
-            start += delta; start -= len;
+            start += delta; len -= delta;
         }
     }
     
@@ -150,7 +150,7 @@
 
         int len = 0;
         for (int i=0; i<denominations.length; i++) {
-            len += EncodeDecodeUtil.getMPILength(e[i]);
+            len += EncodeDecodeUtil.getMPILength(d[i]);
         }
         
         byte[] output = new byte[len];



1.4       +3 -2      java/webfunds/token/algorithm/ChaumProtoToken.java

Index: ChaumProtoToken.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/ChaumProtoToken.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ChaumProtoToken.java	2001/01/03 02:19:19	1.3
+++ ChaumProtoToken.java	2001/01/05 07:39:29	1.4
@@ -1,4 +1,4 @@
-/* $Id: ChaumProtoToken.java,v 1.3 2001/01/03 02:19:19 edwin Exp $
+/* $Id: ChaumProtoToken.java,v 1.4 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -14,7 +14,7 @@
 /**
  * Class description
  *
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public final class ChaumProtoToken extends AbstractProtoToken {
@@ -83,6 +83,7 @@
         protoToken = new BigInteger(1, proto);
         
         byte[] blind = new byte[ChaumConstants.KEY_SIZE];
+        sr.nextBytes(blind);
         blind[0] &= 0x7f;  // zero first bit to make it smaller than N
         blindingFactor = new BigInteger(1, blind);
         



1.3       +4 -4      java/webfunds/token/algorithm/ChaumPublicTokenParameters.java

Index: ChaumPublicTokenParameters.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/ChaumPublicTokenParameters.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ChaumPublicTokenParameters.java	2001/01/04 02:08:15	1.2
+++ ChaumPublicTokenParameters.java	2001/01/05 07:39:29	1.3
@@ -1,4 +1,4 @@
-/* $Id: ChaumPublicTokenParameters.java,v 1.2 2001/01/04 02:08:15 edwin Exp $
+/* $Id: ChaumPublicTokenParameters.java,v 1.3 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -15,7 +15,7 @@
 /**
  * Class description
  *
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public final class ChaumPublicTokenParameters 
@@ -39,7 +39,7 @@
 
         n = EncodeDecodeUtil.decodeMPI(data, start, len);
         int delta = EncodeDecodeUtil.getMPILength(data, start, len);
-        start += delta; start -= len;
+        start += delta; len -= delta;
         
         this.denominations = getDenominations();
         e = new BigInteger[denominations.length];
@@ -47,7 +47,7 @@
         for (int i=0; i<denominations.length; i++) {
             e[i] = EncodeDecodeUtil.decodeMPI(data, start, len);
             delta = EncodeDecodeUtil.getMPILength(data, start, len);
-            start += delta; start -= len;
+            start += delta; len -= delta;
         }
     }
     



1.4       +13 -9     java/webfunds/token/algorithm/ChaumToken.java

Index: ChaumToken.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/ChaumToken.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ChaumToken.java	2001/01/03 02:19:19	1.3
+++ ChaumToken.java	2001/01/05 07:39:29	1.4
@@ -1,4 +1,4 @@
-/* $Id: ChaumToken.java,v 1.3 2001/01/03 02:19:19 edwin Exp $
+/* $Id: ChaumToken.java,v 1.4 2001/01/05 07:39:29 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -13,7 +13,7 @@
 /**
  * Class description
  *
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public final class ChaumToken extends AbstractToken {
@@ -33,12 +33,14 @@
     private void decodeToken() throws DataFormatException {
         
         byte[] temp = token.toByteArray();
-        if (temp.length >= ChaumConstants.KEY_SIZE) {
+        if (temp.length > ChaumConstants.KEY_SIZE) {
             throw new DataFormatException("Token too large");
         }
+
         tokenbytes = new byte[ChaumConstants.KEY_SIZE];
         System.arraycopy(temp, 0, tokenbytes, tokenbytes.length-temp.length, 
                          temp.length);
+
         tokenid = new byte[ChaumConstants.RANDOM_SIZE];
         System.arraycopy(temp, 1, tokenid, 0, tokenid.length);
         
@@ -57,15 +59,14 @@
         delta = EncodeDecodeUtil.getMPILength(blindedcoin, startb, lenb);
         startb += delta; lenb -= delta;
 
-
-        blindingFactor = EncodeDecodeUtil.decodeMPI(locallysaveddata, startl, lenl);
-        delta = EncodeDecodeUtil.getMPILength(locallysaveddata, startl, lenl);
-        startl += delta; lenl -= delta;
-
         token = EncodeDecodeUtil.decodeMPI(locallysaveddata, startl, lenl);
         delta = EncodeDecodeUtil.getMPILength(locallysaveddata, startl, lenl);
         startl += delta; lenl -= delta;
         
+        blindingFactor = EncodeDecodeUtil.decodeMPI(locallysaveddata, startl, lenl);
+        delta = EncodeDecodeUtil.getMPILength(locallysaveddata, startl, lenl);
+        startl += delta; lenl -= delta;
+
         
         BigInteger n = ((ChaumPublicTokenParameters)pubparams).getN();
 
@@ -80,7 +81,6 @@
     protected void decodeImpl(byte[] data, int start, int len)
     throws DataFormatException
     {
-
         int delta;
 
         token = EncodeDecodeUtil.decodeMPI(data, start, len);
@@ -98,6 +98,10 @@
     
 // Processing methods
 //.............................................................................
+
+    public byte[] getUniqueID() {
+        return tokenid;
+    }
 
     private boolean correctTokenFormat() {
     



1.2       +29 -29    java/webfunds/token/algorithm/EncodeDecodeUtil.java

Index: EncodeDecodeUtil.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/EncodeDecodeUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EncodeDecodeUtil.java	2000/12/31 03:54:21	1.1
+++ EncodeDecodeUtil.java	2001/01/05 07:39:30	1.2
@@ -1,4 +1,4 @@
-/* $Id: EncodeDecodeUtil.java,v 1.1 2000/12/31 03:54:21 edwin Exp $
+/* $Id: EncodeDecodeUtil.java,v 1.2 2001/01/05 07:39:30 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -16,7 +16,7 @@
  * various types and objects. For all of the methods, little-endian encoding
  * will be used.</p>
  *
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public final class EncodeDecodeUtil {
@@ -78,7 +78,7 @@
     public static BigInteger decodeMPI(byte[] data, int start, int len)
     throws DataFormatException {
 
-        int mpilen = (decodeShort(data, start, len) + 7) / 8;
+        int mpilen = (decodeUnsignedShort(data, start, len) + 7) / 8;
         if (mpilen + 2 > len) {
             throw new DataFormatException("Not enough room to decode an MPI");
         }
@@ -132,13 +132,13 @@
         
         byte[] bytes = x.toByteArray();
         if (bytes[0] == 0) {
-            encodeShort((short)(bytes.length - 1), data, start);
+            encodeShort((short)(x.bitLength()), data, start);
             System.arraycopy(bytes, 1, data, start+2, bytes.length - 1);
-            return bytes.length - 1;
+            return bytes.length + 1;
         } else {    
-            encodeShort((short)bytes.length, data, start);
+            encodeShort((short)(x.bitLength()), data, start);
             System.arraycopy(bytes, 0, data, start+2, bytes.length);
-            return bytes.length;
+            return bytes.length + 2;
         }
                 
     }
@@ -285,8 +285,8 @@
     public static int encodeByteArray(byte[] bytes, byte[] data, int start) {
         
         encodeInt(bytes.length, data, start);
-        System.arraycopy(bytes, 0, data, start+2, bytes.length);
-        return bytes.length + 2;
+        System.arraycopy(bytes, 0, data, start+4, bytes.length);
+        return bytes.length + 4;
         
     }
 
@@ -351,9 +351,9 @@
         if (len < 2) {
             throw new DataFormatException("Not enough room to decode a short");
         }
-        
-        return (short)((data[start+0] << 8) +
-                       (data[start+1] << 0));
+
+        return (short)(  (data[start+0]          <<  8) 
+                      |  (data[start+1] & 0xFF        ) );
         
     }
     
@@ -375,8 +375,8 @@
             throw new DataFormatException("Not enough room to decode a short");
         }
         
-        return (((int)(data[start+0] << 8)) +
-                ((int)(data[start+1] << 0))) & 0xffff;
+        return        ( ((data[start+0] & 0xFF ) <<  8) 
+                      |  (data[start+1] & 0xFF        ) );
         
     }
 
@@ -398,10 +398,10 @@
             throw new DataFormatException("Not enough room to decode an int");
         }
         
-        return ((int)(data[start+0] << 24)) +
-               ((int)(data[start+1] << 16)) +
-               ((int)(data[start+2] <<  8)) +
-               ((int)(data[start+3] <<  0));
+        return        (  (data[start+0]          << 24) 
+                      | ((data[start+1] & 0xFF ) << 16)
+                      | ((data[start+2] & 0xFF ) <<  8)
+                      | ((data[start+3] & 0xFF )      ) );
         
     }
     
@@ -423,10 +423,10 @@
             throw new DataFormatException("Not enough room to decode an int");
         }
         
-        return (((long)(data[start+0] << 24)) +
-                ((long)(data[start+1] << 16)) +
-                ((long)(data[start+2] <<  8)) +
-                ((long)(data[start+3] <<  0))) & 0xffffffffL;
+        return        ( ((data[start+0] & 0xFFl) << 24) 
+                      | ((data[start+1] & 0xFFl) << 16)
+                      | ((data[start+2] & 0xFFl) <<  8)
+                      | ((data[start+3] & 0xFFl)      ) );
         
     }
     
@@ -448,14 +448,14 @@
             throw new DataFormatException("Not enough room to decode a long");
         }
     
-        return ((long)(data[start+0] << 56)) +
-               ((long)(data[start+1] << 48)) +
-               ((long)(data[start+2] << 40)) +
-               ((long)(data[start+3] << 32)) +
-               ((long)(data[start+4] << 24)) +
-               ((long)(data[start+5] << 16)) +
-               ((long)(data[start+6] <<  8)) +
-               ((long)(data[start+7] <<  0));
+        return        ( (( (long)data[start+0] ) << 56) 
+                      | ((data[start+1] & 0xFFl) << 48)
+                      | ((data[start+2] & 0xFFl) << 40)
+                      | ((data[start+3] & 0xFFl) << 32)
+                      | ((data[start+4] & 0xFFl) << 24)
+                      | ((data[start+5] & 0xFFl) << 16)
+                      | ((data[start+6] & 0xFFl) <<  8)
+                      | ((data[start+7] & 0xFFl)      ) );
     
     }
 



1.4       +6 -2      java/webfunds/token/algorithm/RandomToken.java

Index: RandomToken.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/token/algorithm/RandomToken.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RandomToken.java	2001/01/03 02:19:20	1.3
+++ RandomToken.java	2001/01/05 07:39:30	1.4
@@ -1,4 +1,4 @@
-/* $Id: RandomToken.java,v 1.3 2001/01/03 02:19:20 edwin Exp $
+/* $Id: RandomToken.java,v 1.4 2001/01/05 07:39:30 edwin Exp $
  *
  * Copyright (c) Systemics Ltd 2000 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -12,7 +12,7 @@
 /**
  * Class description
  *
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
  * @author Edwin Woudt <edwin@webfunds.org>
  */
 public final class RandomToken extends AbstractToken {
@@ -39,6 +39,10 @@
     
 // Processing methods
 //.............................................................................
+
+    public byte[] getUniqueID() {
+        throw new RuntimeException("NYI");
+    }
 
     public boolean verifyPublic(AbstractPublicTokenParameters pubparams) {
         throw new RuntimeException("NYI");