From bb00fee9702155586e674b9d6a3b838bd54baac2 Mon Sep 17 00:00:00 2001 From: J08nY Date: Tue, 26 Nov 2019 20:37:19 +0100 Subject: Add ASN.1 parsing and more utility functions, + commands sketch. --- pyecsca/codegen/bn.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pyecsca/codegen/bn.h') 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); -- cgit v1.3.1