// TestDamgardFujisaki demonstrates how a value can be committed and later opened (decommitted).
TestDamgardFujisaki demonstrates how a value can be committed and later opened (decommitted).
// TestDamgardFujisaki demonstrates how a value can be committed and later opened ( decommitted ) .
func TestDamgardFujisaki(t *testing.T) {
	receiver, err := NewDamgardFujisakiReceiver(1024, 80)
	if err != nil {
		t.Errorf("Error in NewDamgardFujisakiReceiver: %v", err)
	}
	committer := NewDamgardFujisakiCommitter(receiver.QRSpecialRSA.N, receiver.H, receiver.G,
		receiver.QRSpecialRSA.N, receiver.K)
	a := common.GetRandomInt(receiver.QRSpecialRSA.N)
	c, err := committer.GetCommitMsg(a)
	if err != nil {
		t.Errorf("Error in GetCommitMsg: %v", err)
	}
	receiver.SetCommitment(c)
	committedVal, r := committer.GetDecommitMsg()
	success := receiver.CheckDecommitment(r, committedVal)
	assert.Equal(t, true, success, "DamgardFujisaki commitment failed.")
}
func TestDamgardFujisaki ( t * testing . T ) { receiver , err := NewDamgardFujisakiReceiver ( 1024 , 80 ) if err != nil { t . Errorf ( " " , err ) } committer := NewDamgardFujisakiCommitter ( receiver . QRSpecialRSA . N , receiver . H , receiver . G , receiver . QRSpecialRSA . N , receiver . K ) a := common . GetRandomInt ( receiver . QRSpecialRSA . N ) c , err := committer . GetCommitMsg ( a ) if err != nil { t . Errorf ( " " , err ) } receiver . SetCommitment ( c ) committedVal , r := committer . GetDecommitMsg ( ) success := receiver . CheckDecommitment ( r , committedVal ) assert . Equal ( t , true , success , " " ) }
TestDamgardFujisaki demonstrates how a value can be committed and later opened (decommitted).
TestDamgardFujisaki demonstrates how a value can be committed and later opened ( decommitted ) .
// n is used for T - but any other value can be used as well