diff options
| author | J08nY | 2019-11-28 00:49:59 +0100 |
|---|---|---|
| committer | J08nY | 2019-11-28 00:49:59 +0100 |
| commit | a17c64b710688ac697427544eaaab4aae6188c3c (patch) | |
| tree | c5da136130b35c8c1283f0215078b50636eb9013 /pyecsca/codegen/bn | |
| parent | 32a4874abfbaff8cb4ee2d31fe71bcc3499e52dc (diff) | |
| download | pyecsca-codegen-a17c64b710688ac697427544eaaab4aae6188c3c.tar.gz pyecsca-codegen-a17c64b710688ac697427544eaaab4aae6188c3c.tar.zst pyecsca-codegen-a17c64b710688ac697427544eaaab4aae6188c3c.zip | |
Working dynamic build!
Diffstat (limited to 'pyecsca/codegen/bn')
| -rw-r--r-- | pyecsca/codegen/bn/bn.c | 4 | ||||
| -rw-r--r-- | pyecsca/codegen/bn/bn.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/pyecsca/codegen/bn/bn.c b/pyecsca/codegen/bn/bn.c index 9b805d1..b34b789 100644 --- a/pyecsca/codegen/bn/bn.c +++ b/pyecsca/codegen/bn/bn.c @@ -89,6 +89,10 @@ void bn_mod_inv(const bn_t *one, const bn_t *mod, bn_t *out) { mp_invmod(one, mod, out); } +void bn_mod_pow(const bn_t *one, const bn_t *exp, const bn_t *mod, bn_t *out) { + mp_exptmod(one, exp, mod, out); +} + void bn_mod(const bn_t *one, const bn_t *mod, bn_t *out) { mp_mod(one, mod, out); } diff --git a/pyecsca/codegen/bn/bn.h b/pyecsca/codegen/bn/bn.h index 2ff723f..68ede2f 100644 --- a/pyecsca/codegen/bn/bn.h +++ b/pyecsca/codegen/bn/bn.h @@ -38,6 +38,7 @@ void bn_mod_mul(const bn_t *one, const bn_t *other, const bn_t *mod, bn_t *out); void bn_mod_sqr(const bn_t *one, const bn_t *mod, bn_t *out); void bn_mod_div(const bn_t *one, const bn_t *other, const bn_t *mod, bn_t *out); void bn_mod_inv(const bn_t *one, const bn_t *mod, bn_t *out); +void bn_mod_pow(const bn_t *one, const bn_t *exp, const bn_t *mod, bn_t *out); void bn_mod(const bn_t *one, const bn_t *mod, bn_t *out); void bn_lsh(const bn_t *one, int amount, bn_t *out); |
