From: James Almer <jamrial-at-gmail.com@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 2/3] avutil/aes: remove superfluous rounds argument Date: Tue, 10 Jun 2025 22:54:14 -0300 Message-ID: <20250611015415.19575-2-jamrial@gmail.com> (raw) In-Reply-To: <20250611015415.19575-1-jamrial@gmail.com> It's set during int and never changed. Signed-off-by: James Almer <jamrial@gmail.com> --- libavutil/aes.c | 10 +++++----- libavutil/aes_internal.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavutil/aes.c b/libavutil/aes.c index 3c8ac1c349..7fe42a5548 100644 --- a/libavutil/aes.c +++ b/libavutil/aes.c @@ -137,10 +137,10 @@ static inline void aes_crypt(AVAES *a, int s, const uint8_t *sbox, } static void aes_encrypt(AVAES *a, uint8_t *dst, const uint8_t *src, - int count, uint8_t *iv, int rounds) + int count, uint8_t *iv) { while (count--) { - addkey_s(&a->state[1], src, &a->round_key[rounds]); + addkey_s(&a->state[1], src, &a->round_key[a->rounds]); if (iv) addkey_s(&a->state[1], iv, &a->state[1]); aes_crypt(a, 2, sbox, enc_multbl); @@ -153,10 +153,10 @@ static void aes_encrypt(AVAES *a, uint8_t *dst, const uint8_t *src, } static void aes_decrypt(AVAES *a, uint8_t *dst, const uint8_t *src, - int count, uint8_t *iv, int rounds) + int count, uint8_t *iv) { while (count--) { - addkey_s(&a->state[1], src, &a->round_key[rounds]); + addkey_s(&a->state[1], src, &a->round_key[a->rounds]); aes_crypt(a, 0, inv_sbox, dec_multbl); if (iv) { addkey_s(&a->state[0], iv, &a->state[0]); @@ -171,7 +171,7 @@ static void aes_decrypt(AVAES *a, uint8_t *dst, const uint8_t *src, void av_aes_crypt(AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt) { - a->crypt(a, dst, src, count, iv, a->rounds); + a->crypt(a, dst, src, count, iv); } static void init_multbl2(uint32_t tbl[][256], const int c[4], diff --git a/libavutil/aes_internal.h b/libavutil/aes_internal.h index 17f79d3ce3..e2de382f26 100644 --- a/libavutil/aes_internal.h +++ b/libavutil/aes_internal.h @@ -37,7 +37,7 @@ typedef struct AVAES { DECLARE_ALIGNED(16, av_aes_block, round_key)[15]; DECLARE_ALIGNED(16, av_aes_block, state)[2]; int rounds; - void (*crypt)(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds); + void (*crypt)(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv); } AVAES; void ff_init_aes_x86(AVAES *a, int decrypt); -- 2.49.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2025-06-11 1:54 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-06-11 1:54 [FFmpeg-devel] [PATCH 1/3] avutil/aes_ctr: rename AES_BLOCK_SIZE to FF_AES_BLOCK_SIZE James Almer 2025-06-11 1:54 ` James Almer [this message] 2025-06-11 1:54 ` [FFmpeg-devel] [PATCH 3/3] avutil/aes: add an OpenSSL-libcrypto backed implementation James Almer 2025-06-11 6:02 ` Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20250611015415.19575-2-jamrial@gmail.com \ --to=jamrial-at-gmail.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git