diff options
| author | J08nY | 2019-11-26 20:37:19 +0100 |
|---|---|---|
| committer | J08nY | 2019-11-26 20:37:19 +0100 |
| commit | bb00fee9702155586e674b9d6a3b838bd54baac2 (patch) | |
| tree | cc35efecb92ae20dbab88694737a6b7d53a62782 /pyecsca/codegen/bn.h | |
| parent | 6784477dfc8f34f8d1a262517fe83ae70a59b325 (diff) | |
| download | pyecsca-codegen-bb00fee9702155586e674b9d6a3b838bd54baac2.tar.gz pyecsca-codegen-bb00fee9702155586e674b9d6a3b838bd54baac2.tar.zst pyecsca-codegen-bb00fee9702155586e674b9d6a3b838bd54baac2.zip | |
Add ASN.1 parsing and more utility functions, + commands sketch.
Diffstat (limited to 'pyecsca/codegen/bn.h')
| -rw-r--r-- | pyecsca/codegen/bn.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pyecsca/codegen/bn.h b/pyecsca/codegen/bn.h index 2cad2a0..0690310 100644 --- a/pyecsca/codegen/bn.h +++ b/pyecsca/codegen/bn.h @@ -15,8 +15,14 @@ bn_err bn_init(bn_t *bn); void bn_copy(bn_t *from, bn_t *to); void bn_clear(bn_t *bn); +int bn_from_bin(const uint8_t *data, size_t size, bn_t *out); int bn_from_hex(const char *data, bn_t *out); int bn_from_int(uint64_t value, bn_t *out); + +void bn_to_binpad(const bn_t *one, uint8_t *data, size_t size); +void bn_to_bin(const bn_t *one, uint8_t *data); +size_t bn_to_bin_size(const bn_t *one); + void bn_mod_add(bn_t *one, bn_t *other, bn_t *mod, bn_t *out); void bn_mod_sub(bn_t *one, bn_t *other, bn_t *mod, bn_t *out); void bn_mod_mul(bn_t *one, bn_t *other, bn_t *mod, bn_t *out); |
