def cred_secret_issue_proof(params, num_privs, num_pubs):
    G, _, _, _ = params
    n = num_privs + num_pubs

    # Contruct the proof
    zk = ZKProof(G)

    ## The variables
    bCx0 = zk.get(Gen, "bCx_0")
    u, g, h, Cx0,  pub = zk.get(ConstGen, ["u", "g", "h", "Cx_0", "pub"])
    b, x0, x0_bar, bx0, bx0_bar =  zk.get(Sec, ["b", "x_0", "x_0_bar", "bx_0", "bx_0_bar"])

    xis = zk.get_array(Sec, "xi", n, 1)
    bxis = zk.get_array(Sec, "bxi", n, 1)
    Xis = zk.get_array(ConstGen, "Xi", n, 1)
    bXis = zk.get_array(Gen, "bXi", n, 1)

    ## Proof of knowing the secret of MAC
    zk.add_proof(Cx0, x0 * g + x0_bar * h)
    zk.add_proof(bCx0, b * Cx0)
    zk.add_proof(bCx0, bx0 * g + bx0_bar * h)
    zk.add_proof(u, b * g)

    ## Proof of correct Xi's
    for (xi, Xi, bXi, bxi) in zip(xis, Xis, bXis, bxis):
        zk.add_proof(Xi, xi * h)        
        zk.add_proof(bXi, b * Xi)
        zk.add_proof(bXi, bxi * h)
    
    # Proof of correct Credential Ciphertext
    mis = zk.get_array(ConstPub, "mi", num_pubs)
    CredA, CredB = zk.get(ConstGen, ["CredA", "CredB"])

    EGa = zk.get_array(ConstGen, "EGai", num_privs)
    EGb = zk.get_array(ConstGen, "EGbi", num_privs)
    r_prime = zk.get(Sec, "r_prime")

    A = r_prime * g
    B = r_prime * pub + bx0 * g

    for mi, bxi in zip(mis, bxis[:num_pubs]):
        B = B + bxi * (mi * g)

    bxis_sec = bxis[num_pubs:num_pubs + num_privs]
    for eg_a, eg_b, bxi in zip(EGa, EGb, bxis_sec):
        A = A + bxi * eg_a
        B = B + bxi * eg_b

    zk.add_proof(CredA, A)
    zk.add_proof(CredB, B)

    return zk
The proof that the mixed public / private credential issuing is correct
dataset/ETHPy150Open gdanezis/petlib/examples/amacscreds.py/cred_secret_issue_proof