lucadentella / TOTP-Arduino

152 stars 33 forks source link

issue with function sha1.write(uint8_t) #19

Closed AkshaySQT closed 2 years ago

AkshaySQT commented 2 years ago

in SHA1.cpp the function write(uint8_t) has only one argument but in TOTP.cpp two arguments are passed in this function like sha1.write(bytearray,8);

lucadentella commented 2 years ago

Hi

do you have any specific errors when compiling?

AkshaySQT commented 2 years ago

i was porting this library into c when i encountered this. after taking a closer look i found out that this write function is using another write function defined in Print.h. i get it now. is there anyway to port this into c?

AkshaySQT commented 2 years ago

I hope that the write function inside the if statement below is referring to the write function in SHA1.cpp, is it?!

size_t Print::write(const uint8_t buffer, size_t size) { size_t n = 0; while (size--) { if (write(buffer++)) n++; else break; } return n; }

lucadentella commented 2 years ago

Sorry, sha functions come from this library: https://github.com/maniacbug/Cryptosuite

you'd better ask to the author of the code