Comments (2)
I looked at some more variants here. Specifically I considered BearSSL and its bignumber implementations that seem to be quite portable and offer a lot of the functionality necessary.
The issue with using BearSSL (or for that matter any constant-time bignumber implementation, or other implementations instead of libtommath) is that the bignumber API required by pyecsca is very extensive and not directly present in BearSSL. pyecsca wants to be able to choose the bignumber multiplication and squaring implementations, modular reduction technique (Montgomery/Barrett/Basic) as well as the modular inversion technique. BearSSL obviously does not implement all of those, as some are inherently not constant-time. I think no matter what single implementation is chosen there is going to only be support for a part of the bignum implementations that pyecsca requires.
There are some ways of getting around this:
- Pick just one bignum library (e.g. libtommath) and patch/extend it to make it constant-time and cover as many implementation possibilities as possible.
- Add support for more bignum libraries and let them support only a part of the implementation choices/bignum functions. There would also need to be some functionality to be able to tell whether the implementation choices in a given configuration are satisfiable by a given library and whether the functions are enough to implement keygen/scalarmult/ECDH/ECDSA.
Option 1 sounds like a lot of work, especially the constant-time part (as libtommath currently implements quite a lot of the implementation choices in some way the functionality part would be somewhat ok). Option 2 adds complexity to the tool and the need to support multiple libraries, but also adds some flexibility. A combination of options 1 and 2 is the strongest, but also the most work. A slightly different option is to merge options 1 and 2 into one bignum library that has it all, but that is also a huge amount of work.
All-in-all the current choice of libtommath (provided that the montgomery reduction used in it is fixed) is probably the best bang for the buck for some time. Maybe its non-constant-timeness can be investigated and improved with just a patch or two (or some specific alignment technique can be devised).
from pyecsca.
Important note:
- Montgomery multiplication is much faster than base and also introduces much less variability into the runtime.
-DBN_NON_CONST
might help.
from pyecsca.
Related Issues (20)
- Implement DPA
- Implement CPA
- Implement MIA
- Create import guard for LEIA
- Investigate using JAX
- Investigate trace data streaming on CPU/GPU HOT 1
- Investigate use of CW-DesignStartTrace HOT 1
- Fix broken Montgomery reduction in codegen HOT 1
- Investigate using codon/Cython to speed up
- Implement correlation on GPU
- Implement DTW on a GPU
- Make Point, DomainParameters objects picklable
- Figure out what copy/deepcopy should do
- Ditch "Optional" where possible
- Unify TraceSet API and user experience
- Improve trace processing experience
- Consider adding ASAP smoothing
- Decide on dtype conventions
- Assumption on half not handled properly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyecsca.