@@ -141,15 +141,12 @@ AC_ARG_ENABLE(external_default_callbacks,
141
141
[ use_external_default_callbacks=$enableval] ,
142
142
[ use_external_default_callbacks=no] )
143
143
144
- AC_ARG_WITH ( [ field ] , [ AS_HELP_STRING ( [ --with-field=64bit|32bit |auto] ,
145
- [ finite field implementation to use [ default=auto] ] ) ] ,[ req_field =$withval] , [ req_field =auto] )
144
+ AC_ARG_WITH ( [ wide-multiply ] , [ AS_HELP_STRING ( [ --with-wide-multiply=int64|int128 |auto] ,
145
+ [ which wide multiplication implementation to use [ default=auto] ] ) ] ,[ req_widemul =$withval] , [ req_widemul =auto] )
146
146
147
147
AC_ARG_WITH ( [ bignum] , [ AS_HELP_STRING ( [ --with-bignum=gmp|no|auto] ,
148
148
[ bignum implementation to use [ default=auto] ] ) ] ,[ req_bignum=$withval] , [ req_bignum=auto] )
149
149
150
- AC_ARG_WITH ( [ scalar] , [ AS_HELP_STRING ( [ --with-scalar=64bit|32bit|auto] ,
151
- [ scalar implementation to use [ default=auto] ] ) ] ,[ req_scalar=$withval] , [ req_scalar=auto] )
152
-
153
150
AC_ARG_WITH ( [ asm] , [ AS_HELP_STRING ( [ --with-asm=x86_64|arm|no|auto] ,
154
151
[ assembly optimizations to use (experimental: arm) [ default=auto] ] ) ] ,[ req_asm=$withval] , [ req_asm=auto] )
155
152
@@ -170,7 +167,7 @@ AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision
170
167
) ] ,
171
168
[ req_ecmult_gen_precision=$withval] , [ req_ecmult_gen_precision=auto] )
172
169
173
- AC_CHECK_TYPES ( [ __int128] )
170
+ AC_CHECK_TYPES ( [ __int128, unsigned __int128 ] )
174
171
175
172
AC_CHECK_HEADER ( [ valgrind/memcheck.h] , [ enable_valgrind=yes] , [ enable_valgrind=no] , [ ] )
176
173
AM_CONDITIONAL([ VALGRIND_ENABLED] ,[ test "$enable_valgrind" = "yes"] )
@@ -265,59 +262,27 @@ else
265
262
esac
266
263
fi
267
264
268
- if test x"$req_field" = x"auto"; then
269
- if test x"set_asm" = x"x86_64"; then
270
- set_field=64bit
271
- fi
272
- if test x"$set_field" = x; then
273
- SECP_INT128_CHECK
274
- if test x"$has_int128" = x"yes"; then
275
- set_field=64bit
276
- fi
277
- fi
278
- if test x"$set_field" = x; then
279
- set_field=32bit
280
- fi
281
- else
282
- set_field=$req_field
283
- case $set_field in
284
- 64bit)
285
- if test x"$set_asm" != x"x86_64"; then
286
- SECP_INT128_CHECK
287
- if test x"$has_int128" != x"yes"; then
288
- AC_MSG_ERROR ( [ 64bit field explicitly requested but neither __int128 support or x86_64 assembly available] )
289
- fi
290
- fi
291
- ;;
292
- 32bit)
293
- ;;
294
- *)
295
- AC_MSG_ERROR ( [ invalid field implementation selection] )
296
- ;;
297
- esac
298
- fi
299
-
300
- if test x"$req_scalar" = x"auto"; then
265
+ if test x"$req_widemul" = x"auto"; then
301
266
SECP_INT128_CHECK
302
267
if test x"$has_int128" = x"yes"; then
303
- set_scalar=64bit
268
+ set_widemul=int128
304
269
fi
305
- if test x"$set_scalar " = x; then
306
- set_scalar=32bit
270
+ if test x"$set_widemul " = x; then
271
+ set_widemul=int64
307
272
fi
308
273
else
309
- set_scalar=$req_scalar
310
- case $set_scalar in
311
- 64bit )
274
+ set_widemul=$req_widemul
275
+ case $set_widemul in
276
+ int128 )
312
277
SECP_INT128_CHECK
313
278
if test x"$has_int128" != x"yes"; then
314
- AC_MSG_ERROR ( [ 64bit scalar explicitly requested but __int128 support not available] )
279
+ AC_MSG_ERROR ( [ Wide multiplication implementation int128 explicitly requested but __int128 support not available] )
315
280
fi
316
281
;;
317
- 32bit )
282
+ int64 )
318
283
;;
319
284
*)
320
- AC_MSG_ERROR ( [ invalid scalar implementation selected] )
285
+ AC_MSG_ERROR ( [ invalid wide multiplication implementation selected] )
321
286
;;
322
287
esac
323
288
fi
@@ -365,16 +330,16 @@ no)
365
330
;;
366
331
esac
367
332
368
- # select field implementation
369
- case $set_field in
370
- 64bit )
371
- AC_DEFINE ( USE_FIELD_5X52 , 1 , [ Define this symbol to use the FIELD_5X52 implementation] )
333
+ # select wide multiplication implementation
334
+ case $set_widemul in
335
+ int128 )
336
+ AC_DEFINE ( USE_WIDEMUL_INT128 , 1 , [ Define this symbol to use (unsigned) __int128 based wide multiplication implementation] )
372
337
;;
373
- 32bit )
374
- AC_DEFINE ( USE_FIELD_10X26 , 1 , [ Define this symbol to use the FIELD_10X26 implementation] )
338
+ int64 )
339
+ AC_DEFINE ( USE_WIDEMUL_INT64 , 1 , [ Define this symbol to use (u)int64_t based wide multiplication implementation] )
375
340
;;
376
341
*)
377
- AC_MSG_ERROR ( [ invalid field implementation] )
342
+ AC_MSG_ERROR ( [ invalid wide multiplication implementation] )
378
343
;;
379
344
esac
380
345
396
361
;;
397
362
esac
398
363
399
- # select scalar implementation
400
- case $set_scalar in
401
- 64bit)
402
- AC_DEFINE ( USE_SCALAR_4X64 , 1 , [ Define this symbol to use the 4x64 scalar implementation] )
403
- ;;
404
- 32bit)
405
- AC_DEFINE ( USE_SCALAR_8X32 , 1 , [ Define this symbol to use the 8x32 scalar implementation] )
406
- ;;
407
- *)
408
- AC_MSG_ERROR ( [ invalid scalar implementation] )
409
- ;;
410
- esac
411
-
412
364
# set ecmult window size
413
365
if test x"$req_ecmult_window" = x"auto"; then
414
366
set_ecmult_window=15
@@ -553,8 +505,7 @@ echo " module recovery = $enable_module_recovery"
553
505
echo
554
506
echo " asm = $set_asm"
555
507
echo " bignum = $set_bignum"
556
- echo " field = $set_field"
557
- echo " scalar = $set_scalar"
508
+ echo " wide multiplication = $set_widemul"
558
509
echo " ecmult window size = $set_ecmult_window"
559
510
echo " ecmult gen prec. bits = $set_ecmult_gen_precision"
560
511
echo
0 commit comments