|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object auditor.Crypto
public class Crypto
Class responsible for performing cryptographic operations - mainly for checking commitments
Field Summary | |
---|---|
static javax.crypto.Cipher |
cipherNoPaddingNoKey
|
static javax.crypto.Cipher |
cipherPkcs5Padding
|
(package private) static java.security.MessageDigest |
sha
|
Constructor Summary | |
---|---|
Crypto()
|
Method Summary | |
---|---|
static boolean |
checkDrowCommitment(java.lang.String slt,
int prid,
java.lang.String perm,
java.lang.String cmt,
int partitionID,
int instanceID,
int rowID,
java.lang.String c)
Checks if commitment cmt is correct for given data |
static boolean |
checkProwCommitment(java.lang.String slt,
java.lang.String p1,
int pid,
java.lang.String cmt,
java.lang.String c)
Checks if cmt is a correct commitment to message (pi, pid) with given salt slt |
private static byte[] |
computeCommitment(byte[] slt,
byte[] c,
byte[] m)
given a salt slt, election constant c, computes commitment to the message m |
static byte[] |
computeCommitment(java.lang.String slt,
java.lang.String c,
byte[] m)
Given a message m, salt skm, commitment cmt to m and public constant C it returnes if the commitment to the message m is valid sak=Encrypt C with skm h1 = SHA256(m, sak). |
private static byte[] |
makeDMessage(byte partitionId,
byte instanceId,
byte[] rowId,
int prid,
byte[] perm)
Prepares a message for commitment |
private static byte[] |
makePMessage(byte[] serial,
byte[] p)
Returns a byte array of "message" for ballot serial and p |
protected static byte[] |
parse(java.lang.String permutation)
Changes permutation string into a byte array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static javax.crypto.Cipher cipherNoPaddingNoKey
public static javax.crypto.Cipher cipherPkcs5Padding
static java.security.MessageDigest sha
Constructor Detail |
---|
public Crypto()
Method Detail |
---|
public static byte[] computeCommitment(java.lang.String slt, java.lang.String c, byte[] m) throws java.lang.Exception
slt
- - the salt used in the commitmentm
- - the message to be commited toc
- - public constant
java.lang.Exception
private static byte[] computeCommitment(byte[] slt, byte[] c, byte[] m) throws java.lang.Exception
slt
- - salt used in commitmentc
- - public constantm
- - message
java.lang.Exception
public static boolean checkProwCommitment(java.lang.String slt, java.lang.String p1, int pid, java.lang.String cmt, java.lang.String c)
slt
- - saltp1
- - messagepid
- - p idcmt
- - commitmentc
- - public constant
java.lang.Exception
- if the commitment does not checks.private static byte[] makePMessage(byte[] serial, byte[] p)
serial
- - ballot idp
- - permutation
public static boolean checkDrowCommitment(java.lang.String slt, int prid, java.lang.String perm, java.lang.String cmt, int partitionID, int instanceID, int rowID, java.lang.String c) throws java.lang.Exception
slt
- - saltprid
- - pid or ridperm
- - permutation (d2 or d4) transformationcmt
- - commitment (cl or cr)partitionID
- - partition idinstanceID
- - instance idc
- - public constant
java.lang.Exception
- if the commitment does not checks.
The commitment is constructed using computeCommitmentprivate static byte[] makeDMessage(byte partitionId, byte instanceId, byte[] rowId, int prid, byte[] perm)
partitionId
- - id of the partitioninstanceId
- - id ot the instancerowId
- - id of the rowprid
- - id (pid or rid)perm
- - permutation (d2 or d4)
protected static byte[] parse(java.lang.String permutation)
permutation
- - string representing permutation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |