Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/gen_context.c
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | int main(int argc, char **argv) { | ||||
(void)argv; | (void)argv; | ||||
fp = fopen("src/ecmult_static_context.h","w"); | fp = fopen("src/ecmult_static_context.h","w"); | ||||
if (fp == NULL) { | if (fp == NULL) { | ||||
fprintf(stderr, "Could not open src/ecmult_static_context.h for writing!\n"); | fprintf(stderr, "Could not open src/ecmult_static_context.h for writing!\n"); | ||||
return -1; | return -1; | ||||
} | } | ||||
fprintf(fp, "#ifndef _SECP256K1_ECMULT_STATIC_CONTEXT_\n"); | fprintf(fp, "#ifndef SECP256K1_ECMULT_STATIC_CONTEXT_H\n"); | ||||
fprintf(fp, "#define _SECP256K1_ECMULT_STATIC_CONTEXT_\n"); | fprintf(fp, "#define SECP256K1_ECMULT_STATIC_CONTEXT_H\n"); | ||||
fprintf(fp, "#include \"src/group.h\"\n"); | fprintf(fp, "#include \"src/group.h\"\n"); | ||||
fprintf(fp, "#define SC SECP256K1_GE_STORAGE_CONST\n"); | fprintf(fp, "#define SC SECP256K1_GE_STORAGE_CONST\n"); | ||||
fprintf(fp, "#if ECMULT_GEN_PREC_N != %d || ECMULT_GEN_PREC_G != %d\n", ECMULT_GEN_PREC_N, ECMULT_GEN_PREC_G); | fprintf(fp, "#if ECMULT_GEN_PREC_N != %d || ECMULT_GEN_PREC_G != %d\n", ECMULT_GEN_PREC_N, ECMULT_GEN_PREC_G); | ||||
fprintf(fp, " #error configuration mismatch, invalid ECMULT_GEN_PREC_N, ECMULT_GEN_PREC_G. Try deleting ecmult_static_context.h before the build.\n"); | fprintf(fp, " #error configuration mismatch, invalid ECMULT_GEN_PREC_N, ECMULT_GEN_PREC_G. Try deleting ecmult_static_context.h before the build.\n"); | ||||
fprintf(fp, "#endif\n"); | fprintf(fp, "#endif\n"); | ||||
fprintf(fp, "static const secp256k1_ge_storage secp256k1_ecmult_static_context[ECMULT_GEN_PREC_N][ECMULT_GEN_PREC_G] = {\n"); | fprintf(fp, "static const secp256k1_ge_storage secp256k1_ecmult_static_context[ECMULT_GEN_PREC_N][ECMULT_GEN_PREC_G] = {\n"); | ||||
base = checked_malloc(&default_error_callback, SECP256K1_ECMULT_GEN_CONTEXT_PREALLOCATED_SIZE); | base = checked_malloc(&default_error_callback, SECP256K1_ECMULT_GEN_CONTEXT_PREALLOCATED_SIZE); | ||||
Show All 29 Lines |