org.clazzes.optional.sec
Class Pack

java.lang.Object
  extended by org.clazzes.optional.sec.Pack

public abstract class Pack
extends java.lang.Object

Helper methods for packing/unpacking data.


Constructor Summary
Pack()
           
 
Method Summary
static int bigEndianToInt(byte[] bs, int off)
           
static byte[] clone(byte[] data)
           
static boolean constantTimeAreEqual(byte[] a, byte[] b)
          A constant time equals comparison - does not terminate early if test will fail.
static byte[] getSubArray(byte[] data, int off, int len)
           
static void intToBigEndian(int n, byte[] bs, int off)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pack

public Pack()
Method Detail

getSubArray

public static byte[] getSubArray(byte[] data,
                                 int off,
                                 int len)

constantTimeAreEqual

public static boolean constantTimeAreEqual(byte[] a,
                                           byte[] b)
A constant time equals comparison - does not terminate early if test will fail.

Parameters:
a - first array
b - second array
Returns:
true if arrays equal, false otherwise.

bigEndianToInt

public static int bigEndianToInt(byte[] bs,
                                 int off)

intToBigEndian

public static void intToBigEndian(int n,
                                  byte[] bs,
                                  int off)

clone

public static byte[] clone(byte[] data)


Copyright © 2010. All Rights Reserved.