Exemplo n.º 1
0
func load(name string) (*msgs.ElectionConfig, *msgs.VoterData) {
	privateInfo := LoadVoterData("demoElection/voterPrivate/" + name)
	configBytes := config.LoadBytes()
	privateInfo.ElectionConfig = configBytes
	config := config.Unpack(privateInfo.ElectionConfig)
	return config, privateInfo
}
Exemplo n.º 2
0
func CheckKeySig(privateInfo *msgs.VoterData) SignatureStatus {
	if privateInfo.KeySignature == nil {
		return Missing
	}
	config := config.Unpack(privateInfo.ElectionConfig)
	voterListKey := keys.UnpackKey(config.VoterListServer.Key)
	publicKey := PublicKey(privateInfo)
	if sign.CheckSig(voterListKey, publicKey, privateInfo.KeySignature) {
		return Valid
	}
	return Invalid
}