INNER CODE UNIT · Python

create_init

BlockstreamResearch/secp256k1-zkp · tools/test_vectors_musig2_generate.py:21

def create_init(name):
    return """
static const struct musig_%s_vector musig_%s_vector = {
""" % (
        name,
        name,
    )


def init_array(key):
    return textwrap.indent("{ %s },\n" % hexstr_to_intarray(data[key]), 4 * " ")


def init_arrays(key):
    s = textwrap.indent("{\n", 4 * " ")
    s += textwrap.indent(
        ",\n".join(["{ %s }" % hexstr_to_intarray(x) for x in data[key]]), 8 * " "
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…