From 2e370d1d3288b3dca6c7b20cdd81a376724276a7 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Fri, 3 Nov 2017 13:08:41 -0400 Subject: fibe: Only define bitwidth on the command line We generate the PRI macros and the limb_t type from the bitwidth in the C preprocessor My reasoning here is that generate_parameters.py and the generated *.json files are more user-facing than fibe.c, so we should optimize for cleanliness of that user-facing code. If this is the wrong direction to go in, then this commit should be reverted. --- generate_parameters.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'generate_parameters.py') diff --git a/generate_parameters.py b/generate_parameters.py index 9713f25ea..407eac67c 100644 --- a/generate_parameters.py +++ b/generate_parameters.py @@ -156,9 +156,7 @@ def get_extra_compiler_params(q, base, bitwidth, sz): 'a_minus_two_over_four_array' : repr('{%s}' % ','.join(reversed(list('0x%02x' % ((a24 >> 8*i)&0xff) for i in range(modulus_bytes))))), 'a24_val' : repr(str(a24)), 'a24_hex' : repr(hex(a24)), - 'limb_t' : 'uint%d_t' % bitwidth, - 'PRIxlimb' : 'PRIx%d' % bitwidth, - 'PRIulimb' : 'PRIu%d' % bitwidth, + 'bitwidth' : repr(str(bitwidth)), 'modulus_limbs' : repr(str(sz)), 'limb_weight_gaps_array' : limb_widths } -- cgit v1.2.3