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
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)
def s2(self, s2): self.s2_ = SigConversion.modint2strlist(s2)
def s1(self, s1): self.s1_ = SigConversion.modint2strlist(s1)
def d(self, d): self.d_ = SigConversion.modint2strlist(d)
def u(self, u): self.u_ = SigConversion.modint2strlist(u)