aboutsummaryrefslogtreecommitdiff
path: root/generate_parameters.py
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-11-03 13:08:41 -0400
committerGravatar Jason Gross <jgross@mit.edu>2017-11-03 13:09:15 -0400
commit2e370d1d3288b3dca6c7b20cdd81a376724276a7 (patch)
treed102e9caa2a7cbd7ae33f0794c091152f154e83c /generate_parameters.py
parent91e46cca8d43c35a52b23056c8b55c1abd110b92 (diff)
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.
Diffstat (limited to 'generate_parameters.py')
-rw-r--r--generate_parameters.py4
1 files changed, 1 insertions, 3 deletions
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
}