diff options
| author | J08nY | 2025-10-01 13:08:22 +0200 |
|---|---|---|
| committer | J08nY | 2025-10-01 13:08:22 +0200 |
| commit | 8ae840b6d8937fc3de2a3feb932ce282c249e4cd (patch) | |
| tree | 6f05d681ba0df772dd8c11f1193d16f254952b46 | |
| parent | fd61cf7b86f2b7c61de7794b616c80c23f0ca364 (diff) | |
| download | pyecsca-codegen-8ae840b6d8937fc3de2a3feb932ce282c249e4cd.tar.gz pyecsca-codegen-8ae840b6d8937fc3de2a3feb932ce282c249e4cd.tar.zst pyecsca-codegen-8ae840b6d8937fc3de2a3feb932ce282c249e4cd.zip | |
Expose bn digit size from tommath at runtime.
| -rw-r--r-- | pyecsca/codegen/bn/bn.c | 2 | ||||
| -rw-r--r-- | pyecsca/codegen/bn/bn.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/pyecsca/codegen/bn/bn.c b/pyecsca/codegen/bn/bn.c index 148403c..f41a1d7 100644 --- a/pyecsca/codegen/bn/bn.c +++ b/pyecsca/codegen/bn/bn.c @@ -27,6 +27,8 @@ void math_init(void) { #endif //TODO: COMBA } +const int bn_digit_bits __attribute__((used)) = MP_DIGIT_BIT; + bn_err bn_init(bn_t *bn) { return mp_init(bn); } diff --git a/pyecsca/codegen/bn/bn.h b/pyecsca/codegen/bn/bn.h index 7c25c22..58bd6df 100644 --- a/pyecsca/codegen/bn/bn.h +++ b/pyecsca/codegen/bn/bn.h @@ -78,6 +78,8 @@ typedef struct { void math_init(void); +extern const int bn_digit_bits; + bn_err bn_init(bn_t *bn); #define bn_init_multi mp_init_multi bn_err bn_copy(const bn_t *from, bn_t *to); |
