[FFmpeg-devel] libavutil: added camellia block cipher

supraja reddy supraja0493 at gmail.com
Fri Jan 2 09:33:05 CET 2015


Hello,

I have modified the LR128 function slightly to make it more compact.

Thanks,
Supraja

On Wed, Dec 31, 2014 at 9:53 PM, supraja reddy <supraja0493 at gmail.com>
wrote:

> Hello,
>
> I have made the following changes.
>
> >  create mode 100644 libavutil/camellia.h
>>
>> Missing changelog entry.
>>
> I have updated the changelog. I had earlier ignored this because i also
> had to update changelog for cast128 cbc mode and wanted to do both
> together.
>
>>
>> We don't need it in this case, but this will probably not work with
>> x=64 or x=128.
>> Also, please move this function after the sboxes.
>>
> Fixed the function , but I was wondering if we need to do this , apart
> from writing a complete function, since anyways there won't be any case at
> all with x=64 or x=128 .
>
>> > +    Zl = (F_IN >> 32) ^ (KE >> 32);
>> > +    Zr = (F_IN & MASK32) ^ (KE & MASK32);
>>
>> Use:
>>
>> KE ^= F_IN;
>> Zl = KE >> 32;
>> Zr = KE & MASK32;
>>
>> as Michael suggested.
>>
> Sorry about this. I had overlooked this change. Changed accordingly in the
> code.
>
>
>> Nit: unneeded space before i =
>>
>
>> > +
>>
>> Nit: you can delete this blank line
>>
> Fixed the above two changes.
>
> Please move camellia_decrypt() after camellia_encrypt().
>>
> Changed accordingly.
>
>
>> Why not use only one vector, rpt[32], instead of rpt and rpt2?
>>
> Fixed this and temp variable.
>
>
>> > +    av_camellia_init(cs, Key[2], 256);
>> > +    av_camellia_crypt(cs, temp2, rpt2, 2, NULL, 0);
>> > +    av_camellia_crypt(cs, temp2, temp2, 2, NULL, 1);
>> > +    for (i = 0; i < 32; i++) {
>> > +        if (rpt2[i] != temp2[i]) {
>> > +            av_log(NULL, AV_LOG_ERROR, "%d %02x %02x\n", i, rpt2[i],
>> temp2[i]);
>> > +            err = 1;
>> > +        }
>> > +    }
>>
>> You are testing ECB again with a longer pt here, is it not redundant
>> or am I missing something?
>>
> This was an extra test case which I forgot to remove. Removed it .
> Also fixed the blank lines in camellia.h
>
> Please let me know if there are any further changes with the updated patch
> .
>
> Thanks,
> Supraja
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: camellia7.patch
Type: text/x-patch
Size: 22002 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150102/0bd7149d/attachment.bin>


More information about the ffmpeg-devel mailing list