Skip to content

Commit

Permalink
More Comments for gossip processing accusations
Browse files Browse the repository at this point in the history
  • Loading branch information
jik18001 committed Apr 25, 2022
1 parent 6fdca9d commit a64f419
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CTng/gossip/accusation_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ type Accusation_POM struct {
Signature_TH crypto.ThresholdSig
}

//Written By Jie
//verification for PoM due to enough number of accusations happens during the PoM generation
//we are not sending the entire PoM generated by enough number of accusations as gossip object
//therefore, we will verify the combined parital signature at the local level

//This function will be invoked in the Process_accusation function in accusations.go when the number of accusations accumulated after receiving a new one exceeds the threshold
func generate_accusation_pom_from_accused_entity(Ea EntityAccusations, c *crypto.CryptoConfig) *Accusation_POM {
pom_sig, _ := c.ThresholdAggregate(Ea.Partial_sigs)
new_Pom02 := new(Accusation_POM)
Expand All @@ -21,6 +22,8 @@ func generate_accusation_pom_from_accused_entity(Ea EntityAccusations, c *crypto
return new_Pom02
}

//Written by Jie
//This function is invoked in Process_accusation function in accusations.go after invoking generate_accusation_pom_from_accused_entity to check the validity of the new generated PoM
func verify_accusation_pom(candidatepom Accusation_POM, c *crypto.CryptoConfig) error {
//generate the msg and verify the signature
return c.ThresholdVerify(candidatepom.Entity_URL, candidatepom.Signature_TH)
Expand Down
9 changes: 5 additions & 4 deletions CTng/gossip/accusations.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
"fmt"
)

/*This file mainly deals with Proof of Misbehavior generated after receiving threshold number of accusations (as part of the process accusations).
This file also contains the process accusations function for the gossiper to invoke.
*/

//Written by Jie, reviewed and edited by Finn
//This function is invoked when the gossiper receives an accusation
//It will store all the non-duplicate accusations
//it will deal with PoM generation due to threshold number of accusations by invoking generate_accusation_pom_from_accused_entity from accusation_validation.go
//if a PoM due to threshold number of accusations is generated, the PoM will be returned as a gossip_object to be sent to the monitor
func Process_Accusation(new_acc Gossip_object, accs *AccusationDB, c *crypto.CryptoConfig) (*Gossip_object, bool, error) {
// Convert signature string
p_sig, err := crypto.SigFragmentFromString(new_acc.Signature[0])
Expand Down

0 comments on commit a64f419

Please sign in to comment.