For changing authentication Key and verifying authentication code. As per BQ78350-R1 Technical Reference 17.2.32 ManufacturerAccess() 0x0037 Authentication Key This command enters a new authentication key into the device. 0x0037 AuthenticationKey(): This Manufacturer Access command allows users to change the authentication key. Sending the new authentication key through ManufacturerBlockAccess() is supported. Additionally, the gauge also supports the approach of updating the authentication keys by sending the new keys to ManufacturerInput(). Verification ( As per BQ78350-R1 Technical Reference, Page no. 75) 1. Generate 160-bit message M using a random number generator that meets approved random number generators described in FIPS PUB 140–2. 2. Generate SHA-1 input block B1 of 512 bytes (total input = 128-bit authentication key KD + 160-bit message M + 1 + 159 0s + 100100000). 3. Generate SHA-1 hash HMAC1 using B1. 4. Generate SHA-1 input block B2 of 512 bytes (total input = 128-bit authentication key KD + 160-bit hash HMAC1 + 1 + 159 0s + 100100000). 5. Generate SHA-1 hash HMAC2 using B2. 6. With no active ManufacturerInput() data waiting, write 160-bit message M to ManufacturerInput() in the format 0xAABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTT, where AA is LSB. 7. Wait 250 ms, then read ManufacturerInput() for HMAC3. 8. Compare host HMAC2 with device HMAC3, and if it matches, both host and device have the same key KD and the device is authenticated. TEST 01 Our Authentication Key at write block 0x44= 37 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 TI Battery Management Studio ( bqStudio )Version : 1.3.101 Build 1 Input Challenge through bqstdio write block 0x2F= C8 2C A3 CA 10 DE C7 26 8E 07 0A 7C F0 D1 FE 82 20 AA D3 B8 Output= AD B2 D8 9D 38 F6 DF 5B 09 88 50 54 19 35 F8 4E C6 1E 0D B3 https://www.pelock.com/products/hash-calculator calculate using Hex String hash value Verificatuion M=C8 2C A3 CA 10 DE C7 26 8E 07 0A 7C F0 D1 FE 82 20 AA D3 B8 total input= 01000000000000000000000000000001C82CA3CA10DEC7268E070A7CF0D1FE8220AAD3B880000000000000000000000000000000000000000000000000000120 E9A752A18D502F52CAC4BBEBD284394B4480EE9F 01000000000000000000000000000001E9A752A18D502F52CAC4BBEBD284394B4480EE9F80000000000000000000000000000000000000000000000000000120 FEA2347299A215DB072EF4C2524BE994AF9CFFB1 Not the same... TEST 02 Our Authentication Key at write block 0x44= 37 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 TI Battery Management Studio Input Challenge through bqstdio write block 0x2F= 33 32 31 30 2F 2E 2C 2D 2B 2A 29 28 27 26 25 24 23 22 21 20 Output+ 60 2D F8 53 A8 09 BC 7F F9 DD BE 7C 7F B9 1C 2D 17 C2 61 ED https://www.pelock.com/products/hash-calculator calculate using Hex String hash value 01000000000000000000000000000001333231302f2e2c2d2b2a2928272625242322212080000000000000000000000000000000000000000000000000000120 B386C98611DA291B7E32E85901B457A90B214071 01000000000000000000000000000001B386C98611DA291B7E32E85901B457A90B21407180000000000000000000000000000000000000000000000000000120 3AE076BCB7AF91617253F83C3F22F3AC3695B835 Not the same... We follow this document also: "How to Implement SHA-1/HMAC Authentication for bq26100"