Tool/software:
Hello:
Project situation: Customer battery level meter project
Question: How does the built-in HMAC-SHA1 algorithm of the BQ28Z620 electricity meter match with the HMAC-SHA1 algorithm on the website?
Description: It has been found that the built-in HMAC-SHA1 conversion result of the BQ28Z620 battery meter is different from the results on the website and the standard HMAC-SHA1. For example, if the key is "aaaaaaaaaaaaaaaaaa" and the content to be encrypted is "aaaaaaaaaaaaaa", the BQ28Z620 calculates "8962469575dc1828fdc7db491839d20e211f5", while the website calculates "8962469575dc1828fdc7db491839d20e211f5" www.jyshare.com/.../ Calculated as' 095f2d615a70516390061d17616b3ef242b56902 ', the expected result is the same, why is there a difference?
Register operation steps:
1. Convert key to hexadecimal as "0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61"
2. The content to be encrypted is converted to hexadecimal as "0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61"
3. 0x3E Register Write "0x37, 0x00, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61"
4. Write checksun=0xB8 to 0x60
5. Write length from 0x14 to 0x61
6. 0x3F register writes' 0x00, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x6B '
7. Wait for 300ms to read 0x4D register
doubt:
1. Is there an error in the register operation steps? Could you please provide a detailed description of the areas where values are reversed before and after, as well as bitwise inversion
2. Why is the result calculated by BQ28Z620 different from what is on the website, and how to make them the same through calculations