Closed samsamros closed 1 year ago
nevermind! I had not updated to scram 0.2. The code works and it is implemented as uint8. In version 0.2. the template looks like:
template `^=`*[T](a, b: T) =
for x in 0..<a.len:
when T is Sha1Digest or T is Keccak512Digest or T is SHA256Digest:
a[x] = (a[x].int32 xor b[x].int32).uint8
else:
a[x] = (a[x].int32 xor b[x].int32).char
So SHA256 also ends up being uint8, and that's why my fix for the other code worked. I hope it helps other users!
I think Anonimongo needs to upgrade its dependency's version.
Using the example on site:
I get the following error running a vanilla compilation on version 1.6.10 and 1.7, no --run, just -d:ssl
I traced it back to the template in scram/private/utils.nim in the scram code:
and changed it to:
and the code finally ran without any issues in my case. I'm not sure if this error has occured to other users, or if I need to update some package, but this did the trick for me. The thing is it ends up being the same process as SHA1, so I'm not sure this is intended or if there's another solution. Please let me know if this helps, and thanks for the amazing work you have put into this code. I use this package a lot, and I think it is wonderful.