# Path: petlib/pack.py
# def encode(structure, custom_encoder=None):
#     """ Encode a structure containing petlib objects to a binary format. May define a custom encoder for user classes. """
#     encoder = make_encoder(custom_encoder)
#     packed_data = msgpack.packb(structure, default=encoder, use_bin_type=True)
#     return packed_data
# 
# def decode(packed_data, custom_decoder=None):
#     """ Decode a binary byte sequence into a structure containing pelib objects. May define a custom decoder for custom classes. """
#     decoder = make_decoder(custom_decoder)
#     structure = msgpack.unpackb(
#         packed_data,
#         ext_hook=decoder,
#         encoding='utf-8')
#     return structure


from amacscreds import cred_setup, cred_CredKeyge, cred_UserKeyge, cred_secret_issue_user, cred_secret_issue, cred_secret_issue_user_decrypt, cred_show, cred_show_check, cred_secret_issue_user_check
from genzkp import *
from petlib.pack import encode, decode

def test_openID_blind():
    ## Setup from credential issuer.
    params = cred_setup()
    (G, g, h, o) = params
    data = encode(params)

# Path: petlib/pack.py
# def encode(structure, custom_encoder=None):
#     """ Encode a structure containing petlib objects to a binary format. May define a custom encoder for user classes. """
#     encoder = make_encoder(custom_encoder)
#     packed_data = msgpack.packb(structure, default=encoder, use_bin_type=True)
#     return packed_data
# 
# def decode(packed_data, custom_decoder=None):
#     """ Decode a binary byte sequence into a structure containing pelib objects. May define a custom decoder for custom classes. """
#     decoder = make_decoder(custom_decoder)
#     structure = msgpack.unpackb(
#         packed_data,
#         ext_hook=decoder,
#         encoding='utf-8')
#     return structure


# Path: examples/openIDblind.py
from amacscreds import cred_setup, cred_CredKeyge, cred_UserKeyge, cred_secret_issue_user, cred_secret_issue, cred_secret_issue_user_decrypt, cred_show, cred_show_check, cred_secret_issue_user_check
from genzkp import *
from petlib.pack import encode, decode


def test_openID_blind():
    ## Setup from credential issuer.
    params = cred_setup()
    (G, g, h, o) = params
    data = encode(params)

    params = decode(data)