diff options
| author | J08nY | 2019-11-27 20:34:58 +0100 |
|---|---|---|
| committer | J08nY | 2019-11-27 20:34:58 +0100 |
| commit | 32a4874abfbaff8cb4ee2d31fe71bcc3499e52dc (patch) | |
| tree | 1203a322d7488ef51b4de2d34c6e0c2871ea68a5 /pyecsca/codegen/bn.h | |
| parent | bb00fee9702155586e674b9d6a3b838bd54baac2 (diff) | |
| download | pyecsca-codegen-32a4874abfbaff8cb4ee2d31fe71bcc3499e52dc.tar.gz pyecsca-codegen-32a4874abfbaff8cb4ee2d31fe71bcc3499e52dc.tar.zst pyecsca-codegen-32a4874abfbaff8cb4ee2d31fe71bcc3499e52dc.zip | |
Reorganize files, implement proper main.
Diffstat (limited to 'pyecsca/codegen/bn.h')
| -rw-r--r-- | pyecsca/codegen/bn.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/pyecsca/codegen/bn.h b/pyecsca/codegen/bn.h deleted file mode 100644 index 0690310..0000000 --- a/pyecsca/codegen/bn.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef BN_H_ -#define BN_H_ - -#include <tommath.h> - -#define bn_t mp_int -#define bn_err mp_err - -typedef struct { - char name; - bn_t value; -} named_bn_t; - -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); -void bn_mod_sqr(bn_t *one, bn_t *mod, bn_t *out); -void bn_mod_div(bn_t *one, bn_t *other, bn_t *mod, bn_t *out); -void bn_mod_inv(bn_t *one, bn_t *mod, bn_t *out); -int bn_get_bit(bn_t *bn, int which); -int bn_bit_length(bn_t *bn); - -#endif //BN_H_
\ No newline at end of file |
