Maamoun TK <maamoun...@googlemail.com> writes: > In case extending the layout of 'poly1305_ctx' structure is not an option, > I would suggest applying that threshold of message length in an > arch-specific manner. How do you think we can do that?
Based on how thresholds are handled in gmp, I'd suggest a #define POLY1305_CORE4_THRESHOLD which can be defined as an arch-dependent constant for non-fat builds, and as an alias for a global variable in fat builds, the variable should how some sane initial value, and be updated as part of the fat setup of the function using that threshold. For thread safety, it would make some sense with memory barriers to ensure that the threshold is updated before the function pointer, but perhaps not strictly necessary. One could consider setting different values depending on processor model, but I think that's beyond an initial version. It would be good to add some size argument to nettle-benchmark to make it easier to choose right threshold. If we end up with more thresholds like this, we could consider tuning them more automatically, analogous to the gmp/tune/tuneup program. But for start, manual tuning is good enough. Regards, /Niels -- Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677. Internet email is subject to wholesale government surveillance. _______________________________________________ nettle-bugs mailing list -- nettle-bugs@lists.lysator.liu.se To unsubscribe send an email to nettle-bugs-le...@lists.lysator.liu.se