software.engine
Class Commitments
java.lang.Object
software.engine.Commitments
public class Commitments
- extends java.lang.Object
Computes salts and commitments for the P and D tables.
- Author:
- stefan
|
Method Summary |
static byte[] |
commitD(byte[] salt,
byte[] c,
byte partitionId,
byte instanceId,
byte[] rowId,
int d1,
byte[] d2)
|
static byte[] |
commitP(byte[] salt,
byte[] c,
byte[] serial,
byte[] p1)
|
static javax.crypto.spec.SecretKeySpec |
saltDRowLeft(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte partitionId,
byte dNo,
byte[] rowId)
|
static javax.crypto.spec.SecretKeySpec |
saltDRowRight(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte partitionId,
byte dNo,
byte[] rowId)
|
static javax.crypto.spec.SecretKeySpec |
saltP1(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte[] serial)
|
static javax.crypto.spec.SecretKeySpec |
saltP2(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte[] serial)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
P1CONSTANT
public static byte[] P1CONSTANT
P2CONSTANT
public static byte[] P2CONSTANT
D1D2_HALF_ROW_CONSTANT
public static byte[] D1D2_HALF_ROW_CONSTANT
D4D5_HALF_ROW_CONSTANT
public static byte[] D4D5_HALF_ROW_CONSTANT
Commitments
public Commitments()
commitP
public static byte[] commitP(byte[] salt,
byte[] c,
byte[] serial,
byte[] p1)
throws java.lang.Exception
- Parameters:
salt - c - - public constantserial - - the p idp1 - - the message to be commitmed to
- Returns:
- a comitment to p1 computed using SecurityUtil.getCommitment
- Throws:
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
commitD
public static byte[] commitD(byte[] salt,
byte[] c,
byte partitionId,
byte instanceId,
byte[] rowId,
int d1,
byte[] d2)
throws java.lang.Exception
- Parameters:
salt - c - - public constantpartitionId - instanceId - rowId - d1 - - the pointer to P (or R)d2 - - the transformation to be commited to
- Returns:
- a commitment to d2 using SecurityUtil.getCommitment
- Throws:
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
saltP1
public static javax.crypto.spec.SecretKeySpec saltP1(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte[] serial)
throws java.lang.Exception
- Parameters:
mk1 - mk2 - c - serial -
- Returns:
- the salt to be used for the p1 commitment
- Throws:
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
saltP2
public static javax.crypto.spec.SecretKeySpec saltP2(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte[] serial)
throws java.lang.Exception
- Parameters:
mk1 - mk2 - c - serial -
- Returns:
- the salt to be used for the p2 commitment
- Throws:
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
saltDRowLeft
public static javax.crypto.spec.SecretKeySpec saltDRowLeft(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte partitionId,
byte dNo,
byte[] rowId)
throws java.lang.Exception
- Parameters:
mk1 - mk2 - c - partitionId - dNo - rowId -
- Returns:
- the salt to be used for the commitment to the first half of a D row
- Throws:
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
saltDRowRight
public static javax.crypto.spec.SecretKeySpec saltDRowRight(javax.crypto.spec.SecretKeySpec mk1,
javax.crypto.spec.SecretKeySpec mk2,
byte[] c,
byte partitionId,
byte dNo,
byte[] rowId)
throws java.lang.Exception
- Parameters:
mk1 - mk2 - c - partitionId - dNo - rowId -
- Returns:
- - the salt to be used for the commitment to the second half of the D row
- Throws:
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown