Hi,
I have to modify DFU to support AES encrypted image.
I modified nrfutil, file package.py, After line bin_length = int(Package.calculate_file_size(bin_file_path)) (approx ilne no. 410 - 420) I encrypted contents of bin_file_path (firmware image) using AES OFB.
I also modified nrf_dfu_req_handler.c of my bootloader. Right before nrf_dfu_flash_store() call I added AES OFB decryption and I modified on_cmd_obj_select_request to set p_res.crc.offset = p_res.crc.crc = 0 (as AES OFB decryption doesn't support random access).
I try to load my encrypted firmware image using nrf connect 2.6.2 on Win 10. A few seconds after image upload start, when upload progress is 1 % or 2 % I get "DFU failed with error: Error when validating CRC. Got 3036497589, but expected 3400506704."
Something bad with CRC. What else do I have to modify?
Thanks
Martin