May-05-2022, 12:40 AM
Why happen the name hash_value_x_t not define
def setup(): global hash_value_x_t """ Generates public key and master secret key. :return: """ if debug: print('\nSetup algorithm:\n') params = Parameters(qbits=512, rbits=160) # type a pairing = Pairing(params) # G2 generator g g = Element.random(pairing, G2) # 1024 bytes # x y x_ran = Element.random(pairing, Zr) # 160 bits y_ran = Element.random(pairing, Zr) c1='1'+str(hash_value_x_t) c2 ='2'+ str(hash_value_x_t) hash_value_x_t = Element.from_hash(pairing, Zr,c1) print('11', hash_value_x_t) hash_value_x_t = Element.from_hash(pairing, Zr, c2) print('22', hash_value_x_t) print(hash_value_x_t)
Error:Traceback (most recent call last):
File "/home/ali/Downloads/MedShare2021-main/constant_abe.py", line 231, in <module>
(pk, msk) = setup()
File "/home/ali/Downloads/MedShare2021-main/constant_abe.py", line 26, in setup
c1='1'+str(hash_value_x_t)
NameError: name 'hash_value_x_t' is not defined