Closed Devnol closed 3 years ago
Never mind, I thought the second argument in TOTP() was the length of the returned key, not the input
Okay. By the way i updated Readme here. Sorry again. https://github.com/Netthaw/TOTP-MCU/commit/180d9f7aef0a454b784efb55163279cf5c17f08b#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R25
Hi, I'm getting 755224 for all 10 steps. Any idea what could be going wrong?!
Perhaps you are either not incrementing the step or not updating the variable, without seeing your code it's hard to tell.
Having made changes after your feedback in #2 I tried using the RFC4226 Test numbers to generate OTP tokens and have reasoned that your library does not work at all under the RP2040 MCU
The above code snippet uses the shared hmac key ascii string "123456789012467890" and generates 10 codes with a step from 0 to 9 using your library.
According to Appendix D of the RFC4226, the OTP codes generated from those inputs should be:
However, using the above code and your library generates the following OTP codes:
This means that either your library doesn't work on the RP2040 MCU or that it doesn't correctly implement the HOTP and TOTP algorithms specified in the respective IETF RFC documents.
Could you please verify if this happens on your tested MCU or if it's an issue that is only present on my RP2040 MCU?
Thanks in advance.