[FFmpeg-devel] libavutil: Added cbc mode to cast5.c

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Dec 17 10:27:05 CET 2014


supraja reddy <supraja0493 <at> gmail.com> writes:

> -- CAST128 symmetric block cipher, ECB mode
> +- CAST128 symmetric block cipher

This line is part of the "2.5" paragraph, please 
do not change this paragraph as 2.5 was already 
released.

> -void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, 
> const uint8_t *src, int count, int decrypt);
> +void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, 
> const uint8_t *src, int count, uint8_t *iv, int decrypt);

You cannot do this because cast5.h is an installed 
header. One possibility is to introduce a new 
function av_cast5_crypt2().

> -    for (j = 0; j < 3; j++){
> +    for (j = 0; j < 3; j++) {

> -    for (i = 0; i < 1000000; i++){
> +    for (i = 0; i < 1000000; i++) {

Please avoid cosmetic changes in patches that 
introduce new features: Either send another 
cosmetics-only patch or leave it as it is.

> +        } else {
> +        if (iv) {
> +            for (i = 0; i < 8; i++)
> +                dst[i] = src[i] ^ iv[i];
> +            encipher(cs, dst, dst);

Indentation in the new code is wrong.

Carl Eugen



More information about the ffmpeg-devel mailing list