#define BIGINT_CEIL(x) ((((x) + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t)) * sizeof(bigint_word_t))
#define BIGINT_OFF(x) ((sizeof(bigint_word_t) - (x) % sizeof(bigint_word_t)) % sizeof(bigint_word_t))
#define BIGINT_CEIL(x) ((((x) + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t)) * sizeof(bigint_word_t))
#define BIGINT_OFF(x) ((sizeof(bigint_word_t) - (x) % sizeof(bigint_word_t)) % sizeof(bigint_word_t))
-uint8_t load_bigint_from_os(bigint_t* a, PGM_VOID_P os, uint16_t length_B){
- a->length_B = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
+uint8_t load_bigint_from_os(bigint_t *a, PGM_VOID_P os, uint16_t length_B){
+ a->length_W = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
- epriv->length_B = (sizeof(PRIV_EXPONENT) + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
- epriv->wordv = malloc(epriv->length_B * sizeof(bigint_word_t));
+ epriv->length_W = (sizeof(PRIV_EXPONENT) + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
+ epriv->wordv = malloc(epriv->length_W * sizeof(bigint_word_t));
- v[i]->length_B = (sv[i] + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
- v[i]->wordv = calloc(v[i]->length_B , sizeof(bigint_word_t));
+ v[i]->length_W = (sv[i] + sizeof(bigint_word_t) - 1) / sizeof(bigint_word_t);
+ v[i]->wordv = calloc(v[i]->length_W , sizeof(bigint_word_t));
-uint8_t load_bigint_from_os(bigint_t* a, PGM_VOID_P os, uint16_t length_B){
- a->length_B = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
+uint8_t load_bigint_from_os(bigint_t *a, PGM_VOID_P os, uint16_t length_B){
+ a->length_W = BIGINT_CEIL(length_B) / sizeof(bigint_word_t);
cli_putstr_P(PSTR("\r\n\r\nciphertext:"));
cli_hexdump_block(ciphertext, clen, 4, 16);
cli_putstr_P(PSTR("\r\n\r\nciphertext:"));
cli_hexdump_block(ciphertext, clen, 4, 16);
}else{
if(memcmp_P(ciphertext, ENCRYPTED, clen)){
cli_putstr_P(PSTR("\r\n>>FAIL (no content match)<<"));
}else{
if(memcmp_P(ciphertext, ENCRYPTED, clen)){
cli_putstr_P(PSTR("\r\n>>FAIL (no content match)<<"));