def __encode_dict__(self, dict_):
     tmp = {**dict_}
     for key in tmp:
         if tmp.get(key) is not None:
             tmp[key] = SigConversion.modint2strlist(tmp.get(key))
         else:
             tmp[key] = 'null'
     return tmp
示例#2
0
 def __init__(self, timestamp, policy, u, d, s1, s2, user_id):
     """
     :param timestamp: POSIX timestamp
     :param policy: integer referencing the policy chosen
     :param u: Element.Integer mod q
     :param d: Element.Integer mod q
     :param s1: Element.Integer mod q
     :param s2: Element.Integer mod q
     :param user_id: integer representing the user in the CP's system database
     """
     self.timestamp = timestamp
     self.policy = policy
     self.user_id = user_id
     self.u_ = SigConversion.modint2strlist(u)
     self.d_ = SigConversion.modint2strlist(d)
     self.s1_ = SigConversion.modint2strlist(s1)
     self.s2_ = SigConversion.modint2strlist(s2)
示例#3
0
 def s2(self, s2):
     self.s2_ = SigConversion.modint2strlist(s2)
示例#4
0
 def s1(self, s1):
     self.s1_ = SigConversion.modint2strlist(s1)
示例#5
0
 def d(self, d):
     self.d_ = SigConversion.modint2strlist(d)
示例#6
0
 def u(self, u):
     self.u_ = SigConversion.modint2strlist(u)