@Test public void testCommitment() throws NoSuchAlgorithmException { byte[] msg = "message".getBytes(); Commitment comm = new Commitment(msg); if(comm.getValue().length != Digest.HASH_SIZE_BYTES) { fail("Computation of commitment failed - wrong length."); } assertNotNull("Computation of commitment failed - null", comm.getValue()); assertTrue("Invalid commitment", comm.verify(msg)); }
public Commitment(byte[] data) throws NoSuchAlgorithmException { this.salt = Digest.makeRand(); byte[] d = serialize(data); this.value = Digest.digest(d); }
Commitment { public Commitment(byte[] data) throws NoSuchAlgorithmException { this.salt = Digest.makeRand(); byte[] d = serialize(data); this.value = Digest.digest(d); } }
Commitment { public Commitment(byte[] data) throws NoSuchAlgorithmException { this.salt = Digest.makeRand(); byte[] d = serialize(data); this.value = Digest.digest(d); } Commitment(byte[] data); }
Commitment { public Commitment(byte[] data) throws NoSuchAlgorithmException { this.salt = Digest.makeRand(); byte[] d = serialize(data); this.value = Digest.digest(d); } Commitment(byte[] data); byte[] getSalt(); byte[] getValue(); boolean verify(byte[] opening); }
Commitment { public Commitment(byte[] data) throws NoSuchAlgorithmException { this.salt = Digest.makeRand(); byte[] d = serialize(data); this.value = Digest.digest(d); } Commitment(byte[] data); byte[] getSalt(); byte[] getValue(); boolean verify(byte[] opening);  }