How can I implement Bluetooth Low Energy CRC in 24 bits?
You will always have CRC 1 bit less than width of polynomial. CRC is remainder of long division operation. This long division is performed using polynomial arithmetic where subtraction is simply XORing corresponding bits. You start using first 25 bits of message as dividend polynomial. Condition that says divisor polynomial "goes" into this 25-bit dividend polynomial is only when order of this polynomial is same as CRC polynomial, that is bit 24 is 1. When that happens, you simply XOR these 25-bits with each other. This ensures that bit 24 always goes to zero after each partial division resulting in 24-bit remainder. If bit 24 from dividend polynomial is not 1, you simply skip that bit and go to next one till you find 1. For each bit skipped, a bit is pulled from the message. This repeats all the way to the end of the message. So in the end you always have remainder of 24 bits.