You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this package for the TOTP algorithm and some exchanges protocols. Both requires an HMAC functionality, so I hope this can be built into this package like Nettle.jl did.
The implementation (from wiki) can be quiet simple:
function hmac(key::Vector{UInt8}, msg::Vector{UInt8}, hash, blocksize::Int=64)
if length(key) > blocksize
key = hash(key)
end
pad = blocksize - length(key)
if pad > 0
resize!(key, blocksize)
key[end-pad+1:end] = 0
end
o_key_pad = key .⊻ 0x5c
i_key_pad = key .⊻ 0x36
hash([o_key_pad; hash([i_key_pad; msg])])
end
Hey, this is great @ylxdzsw, if you care to open a PR with this code and the tests, I will happily merge it. I wouldn't want to strip you of your authorship rights. :)
I use this package for the TOTP algorithm and some exchanges protocols. Both requires an HMAC functionality, so I hope this can be built into this package like Nettle.jl did.
The implementation (from wiki) can be quiet simple:
and here is a test suite (also from wiki):
The text was updated successfully, but these errors were encountered: