#if DEBUG
#include "cli.h"
+#include <stdio.h>
#endif
void rsa_enc(bigint_t *data, const rsa_publickey_t *key){
while(BIGINT_NEG_MASK & m1.info){
#if DEBUG
cli_putstr_P(PSTR("\r\nDBG: adding "));
- bigint_print_hex(key->components[0]);
+ bigint_print_hex(&key->components[0]);
cli_putstr_P(PSTR("\r\nDBG: to "));
bigint_print_hex(&m1);
#endif
uint8_t off;
off = (sizeof(bigint_word_t) - length_B % sizeof(bigint_word_t)) % sizeof(bigint_word_t);
#if DEBUG
- cli_putstr_P(PSTR("\r\nDBG: off = 0x"));
- cli_hexdump_byte(off);
+ printf("\r\nDBG: off = 0x%02x", off);
#endif
- if(!data){
- if(off){
+ if (!data) {
+ if (off) {
dest->wordv = realloc(dest->wordv, length_B + sizeof(bigint_word_t) - off);
- memmove((uint8_t*)dest->wordv+off, dest->wordv, length_B);
+ memmove((uint8_t*)dest->wordv + off, dest->wordv, length_B);
memset(dest->wordv, 0, off);
}
}else{
}
dest->length_W = (length_B + off) / sizeof(bigint_word_t);
#if DEBUG
- cli_putstr_P(PSTR("\r\nDBG: dest->length_W = 0x"));
- cli_hexdump_rev(&(dest->length_W), 2);
+ printf("\r\nDBG: dest->length_W = %u", dest->length_W);
#endif
#endif
dest->info = 0;