def METHOD_NAME(self, pk, mk, policy_str):
    policy = util.createPolicy(policy_str)
    attr_list = util.getAttributeList(policy)
    s = mk['alpha1']; secret = s
    shares = util.calculateSharesDict(secret, policy)
    D = { 'policy': policy_str }
    for x in attr_list:
        y = util.strip_index(x)
        d = []; r = group.random(ZR)
        if not self.negatedAttr(x): # meaning positive
            d.append((pk['g_G1'] ** (mk['alpha2'] * shares[x])) * (group.hash(y, G1) ** r))   # compute D1 for attribute x
            d.append((pk['g_G2'] ** r))  # compute D2 for attribute x
        #else:
            #d.append((pk['g2_G1'] ** shares[x]) * (pk['g_G1_b2'] ** r)) # compute D3
            #d.append((pk['g_G1_b'] ** (r * group.hash(x))) * (pk['h_G1'] ** r)) # compute D4
            #d.append(pk['g_G1'] ** -r) # compute D5
        D[x] = d
    if debug: print("Access Policy for key: %s" % policy)
    if debug: print("Attribute list: %s" % attr_list)
    return D