On Monday, September 14, 2015 at 1:05:23 PM UTC-4, Güngör Basa wrote: > > Hello guys, > > I need a function like "mac = HMAC(key || counter)”. What is the best way > to use counter with hashed key function? I tried to use “SetKeyWithIV” and > “SetKeyWithRounds” but I got AlgorithmParametersBase: parameter “IV" not > used or AlgorithmParametersBase: parameter "Rounds" not used exceptions. >
In addition to JPM's suggestion, you also have the upcoming HKDF located at https://github.com/weidai11/cryptopp/blob/master/hkdf.h. Its a header only implementation, so you should be able to drop it into current sources. You can add the counter as the optional 'info' parameter. From RFC 5869 (http://tools.ietf.org/html/rfc5869): info - optional context and application specific information (can be a zero-length string) The DeriveKey interface is going to be changing in 6.0. We are working on a concrete proposal for folks to bang on. The tricky part is making all the security parameters available from all the different KDFs and PBKDFs in an extensible way. Some are not obvious - like making the Expand phase optional in an Expand-then-Extract design in case you have keying material to/from a protocol like TLS. Jeff -- -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. --- You received this message because you are subscribed to the Google Groups "Crypto++ Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
