diff --git a/src/crc.c b/src/crc.c index 0db4ea8..dbac034 100644 --- a/src/crc.c +++ b/src/crc.c @@ -25,6 +25,7 @@ #include #include #include "../libcryptoauth.h" +#include const uint16_t crc_tab_8005_normal[256] = { @@ -114,7 +115,7 @@ lca_calculate_crc16(const uint8_t *p, unsigned int length) hibyte = lca_reverse_bits_in_byte(hibyte); lobyte = lca_reverse_bits_in_byte(lobyte); - return lobyte << 8 | hibyte; + return ntohs(hibyte << 8 | lobyte); } bool diff --git a/src/ecdsa.c b/src/ecdsa.c index fa7f5bf..9125a6f 100644 --- a/src/ecdsa.c +++ b/src/ecdsa.c @@ -68,7 +68,7 @@ lca_ecdsa_p256_verify (struct lca_octet_buffer pub_key, " (ecdsa\n" " (curve \"NIST P-256\")\n" " (q %b)" - "))", pub_key.len, pub_key); + "))", pub_key.len, pub_key.ptr); lca_print_sexp (g_pub_key);