예제 #1
0
파일: sigma1.py 프로젝트: mhlakhani/charm
 def verifier_state4(self, input):
     (g, H, a, c, z) = Sigma.get(self, ['g','H','a','c','z'])
     if a == (pair(g,z) * (H ** c)):
         print("SUCCESS!!!!!!!"); result = 'OK'
     else:
         print("Failed!!!"); result = 'FAIL'
     Sigma.setState(self, 6)
     Sigma.setErrorCode(self, result)
     return result
예제 #2
0
파일: sigma3.py 프로젝트: mhlakhani/charm
 def verifier_state4(self, input):
     print("VERIFIER 4: ")
     (a1, a2, c, W, z, pk) = Sigma.get(self, ['a1','a2','c','W','z','pk'])
     g, V, H = pk['g'], pk['V'], pk['H']
     if a1 == pair(g,z) * (H ** c) and a2 == pair(V,z) * (W ** c):
         print("SUCCESS!!!!!!!"); result = 'OK'
     else:
         print("Failed!!!"); result = 'FAIL'
     Sigma.setState(self, 6)
     Sigma.setErrorCode(self, result)
     return result
예제 #3
0
파일: sigma2.py 프로젝트: mhlakhani/charm
 def verifier_state4(self, input):
     print("VERIFIER 4: ")
     (a, c, z1, z2, pk) = Sigma.get(self, ['a','c','z1','z2','pk'])
     g, y, V = pk['g'], pk['y'], pk['V']
     print("get a =>", a)
     if a == (pair(V,y) ** c) * (pair(V,g) ** -z1) * (pair(g,g) ** z2):
         print("SUCCESS!!!!!!!"); result = 'OK'
     else:
         print("Failed!!!"); result = 'FAIL'
     Sigma.setState(self, 6)
     Sigma.setErrorCode(self, result)
     return result
예제 #4
0
파일: sigma2.py 프로젝트: mhlakhani/charm
 def prover_state5(self, input):
     print("PROVER 5: result =>", input)
     Sigma.setState(self, None)
     Sigma.setErrorCode(self, input)
     return None
예제 #5
0
파일: sigma1.py 프로젝트: mhlakhani/charm
 def prover_state5(self, input):
     Sigma.setState(self, None)
     Sigma.setErrorCode(self, input)
     return None