[FFmpeg-devel] libavutil: added camellia block cipher

supraja reddy supraja0493 at gmail.com
Wed Dec 31 17:23:06 CET 2014


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: camellia6.patch
Type: text/x-patch
Size: 22127 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141231/55f96686/attachment.bin>


More information about the ffmpeg-devel mailing list