cangrepp

Some cryptographic attacks
Log | Files | Refs | README

commit 8b02b1da6f3e0c7949295aeaae9addd68e1d6125
parent cf3d9a58f2b52162dde608077543f54fab81da48
Author: olikru <olikru@tkruger.se>
Date:   Wed,  8 May 2024 11:58:45 +0200

removed old asset bs

Diffstat:
MMakefile | 4----
Dassets/primorial16b.bin | 0
Mcontext.c | 5+++++
Mcontext.h | 3+--
Dprecomputers/primorial16bit.c | 25-------------------------
5 files changed, 6 insertions(+), 31 deletions(-)

diff --git a/Makefile b/Makefile @@ -38,7 +38,6 @@ tools/pierre\ tools/varmkorv\ tools/small PRECOMPUTERS=\ -precomputers/primorial16bit\ precomputers/header TEST=test SHARED=angrepp.so @@ -85,9 +84,6 @@ tools/dbtool: $(OBJ) $(@:S/$/.c/) # -- precomputers -precomputers/primorial16bit: $(OBJ) $(@:S/$/.c/) - $(CC) -I. $(CFLAGS) -o precomputers/primorial16bit $(PRECOMPUTERS_DIR)/primorial16bit.c $(BUILD_OBJS) $(LDFLAGS) - precomputers/header: $(@:S/$/.c/) $(CC) -I. $(CFLAGS) -o precomputers/header $(PRECOMPUTERS_DIR)/header.c $(LDFLAGS) diff --git a/assets/primorial16b.bin b/assets/primorial16b.bin Binary files differ. diff --git a/context.c b/context.c @@ -15,6 +15,11 @@ ctx_init(ctx_t *ctx) } void +ctx_require(ctx_t *ctx, const slong nzs, const slong nqs) +{ +} + +void ctx_clear(ctx_t *ctx) { _fmpz_vec_clear(ctx->zs, ctx->zs_alloc); diff --git a/context.h b/context.h @@ -17,11 +17,9 @@ extern const ulong pc_smallprimes[PC_SMALLPRIMES_LEN]; typedef struct _context_t { fmpz *zs; - // slong nzs; slong zs_alloc; fmpq *qs; - // slong nqs; slong qs_alloc; int has_primorial; @@ -33,6 +31,7 @@ typedef struct _context_t { void ctx_init(ctx_t *ctx); void ctx_clear(ctx_t *ctx); +void ctx_require(ctx_t *ctx, const slong nzs, const slong nqs); void ctx_set_precomputed_primorial(ctx_t *ctx); void ctx_set_precomputed_smallprimes(ctx_t *ctx); diff --git a/precomputers/primorial16bit.c b/precomputers/primorial16bit.c @@ -1,25 +0,0 @@ -/** - * Precomputes the primorial of 2^16 (i.e. the product of all primes < - * 2^16). The result is printed to stdout. This is used to create the - * assets/primorial16b.bin file. - */ -#include <flint.h> -#include <fmpz.h> -#include <stdio.h> -#include <stdlib.h> - -int -main(void) -{ - fmpz_t primorial; - fmpz_init(primorial); - - fmpz_primorial(primorial, 1 << 16); - - if (fmpz_out_raw(stdout, primorial) == 0) { - fprintf(stderr, "Error! Writing to stdout failed.\n"); - exit(1); - } - - return 0; -}