Salted Challenge Response Authentication Mechanism ( RFC 5802 ) を実装しようとしていますが、少し問題が発生しています。
Hi(str, salt, i):
U1 := HMAC(str, salt + INT(1))
U2 := HMAC(str, U1)
...
Ui-1 := HMAC(str, Ui-2)
Ui := HMAC(str, Ui-1)
Hi := U1 XOR U2 XOR ... XOR Ui
where "i" is the iteration count, "+" is the string concatenation
operator, and INT(g) is a 4-octet encoding of the integer g, most
significant octet first.
INT(1) を追加する方法がわかりません。私はソルト用のバイト配列を持っています。1 をビットシフトして配列の末尾に追加するだけでよいのでしょうか?