Hot answers tagged mac
Yes, this is secure, it is largely compatible with KDF1 and KDF2 which basically use a 4 byte big endian encoding of the counter instead of a direct ASCII conversion to a byte. However, if you want to use the latest and greatest, you could use HKDF, possibly even augmented with a salt for session keys.
Depends on what you mean by Keccak. There is actually a slight issue here that not all 256-bit Keccak variants have 256-bit preimage resistance. SHA3-256 (in the current SHA-3 draft) does have 256-bit preimage, but if you are using Keccak with 256-bit capacity it only has 128-bit preimage resistance. At least some of the earlier documents had 256-bit output ...
Only top voted, non community-wiki answers of a minimum length are eligible