Skip to content

Commit

Permalink
Merge pull request #69 from LedgerHQ/fbe/v2.1.0-19
Browse files Browse the repository at this point in the history
Release LNS v2.1.0-19
  • Loading branch information
fbeutin-ledger authored Apr 23, 2024
2 parents 68c5bfa + 6de3c99 commit 74ca336
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
29 changes: 29 additions & 0 deletions lib_cxng/include/lcx_crc.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,35 @@ uint16_t cx_crc16(const void *buffer, size_t len);
*/
uint16_t cx_crc16_update(uint16_t crc, const void *buffer, size_t len);

/** CRC32 initial value */
#define CX_CRC32_INIT 0xFFFFFFFF

/**
* @brief Computes a 32-bit checksum value.
*
* @details The 32-bit value is computed according to the CRC32 CCITT definition.
*
* @param[in] buffer The buffer to compute the CRC over.
*
* @param[in] len Bytes length of the buffer.
*
* @return Current CRC value.
*/
uint32_t cx_crc32(const void *buf, size_t len);

/**
* @brief Accumulates more data to CRC.
*
* @param[in] crc CRC value to be updated.
*
* @param[in] buffer The buffer to compute the CRC over.
*
* @param[in] len Bytes length of the buffer.
*
* @return Updated CRC value.
*/
uint32_t cx_crc32_update(uint32_t crc_state, const void *buf, size_t len);

#endif // HAVE_CRC

#endif // LCX_CRC_H
5 changes: 1 addition & 4 deletions lib_cxng/src/cx_crc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

#ifdef HAVE_CRC

#include <stddef.h>
#include <stdint.h>

uint32_t cx_crc32(const void *buf, size_t len);
#include "lcx_crc.h"

#endif // HAVE_CRC

Expand Down
2 changes: 1 addition & 1 deletion lib_stusb_impl/u2f_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void u2f_handle_cmd_msg(u2f_service_t *service, uint8_t *buffer, uint16_t length
uint8_t p2 = buffer[OFFSET_P2];
#endif // U2F_PROXY_MAGIC

uint32_t dataLength = u2f_get_cmd_msg_data_length(buffer, length);
int dataLength = u2f_get_cmd_msg_data_length(buffer, length);
if (dataLength < 0) {
// invalid size
u2f_message_reply(
Expand Down

0 comments on commit 74ca336

Please sign in to comment.