/* Convert an integer (13-bit words, little-endian) to unsigned big-endian encoding. The total encoding length is provided; all the destination bytes will be filled.  */
static void le13_to_be8(unsigned char *dst, size_t len, const uint32_t *src)
/* Convert an integer (13-bit words, little-endian) to unsigned big-endian encoding. The total encoding length is provided; all the destination bytes will be filled.  */
static void le13_to_be8(unsigned char *dst, size_t len, const uint32_t *src)
{
	uint32_t acc;
	int acc_len;
	acc = 0;
	acc_len = 0;
	while (len -- > 0) {
		if (acc_len < 8) {
			acc |= (*src ++) << acc_len;
			acc_len += 13;
		}
		dst[len] = (unsigned char)acc;
		acc >>= 8;
		acc_len -= 8;
	}
}