[FFmpeg-devel] [PATCH] lavu/hmac: Add support for SHA-2

James Almer jamrial at gmail.com
Mon Jun 10 22:16:37 CEST 2013


On 10/06/13 1:31 PM, Michael Niedermayer wrote:
> On Sun, Jun 09, 2013 at 04:28:18PM -0300, James Almer wrote:
>> Includes HMAC-SHA-224, HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512.
>> Tested using test vectors from https://tools.ietf.org/html/rfc4231
> [...]
>> diff --git a/libavutil/hmac.h b/libavutil/hmac.h
>> index aef84c6..ca4da6a 100644
>> --- a/libavutil/hmac.h
>> +++ b/libavutil/hmac.h
>> @@ -32,6 +32,10 @@
>>  enum AVHMACType {
>>      AV_HMAC_MD5,
>>      AV_HMAC_SHA1,
>> +    AV_HMAC_SHA224,
>> +    AV_HMAC_SHA256,
>> +    AV_HMAC_SHA384,
>> +    AV_HMAC_SHA512,
>>  };
> 
> using enums that are a bit higher would avoid possibly future
> conflicts with the fork

Ok. Will send in a moment.

> also a fate test should be added (possibly in a seperate patch)

It currently is testing MD5 and not SHA-1, for that matter.
It seems that, if one works, they all work (as long as each hashing algorithm 
test succeeds).
I can add the test cases in a separate patch if sill you want to, nonetheless.

Regards.


More information about the ffmpeg-devel mailing list