Skip to content

[bugfix] optimize array copying in engineUpdate() methods#101

Merged
yaziza merged 1 commit intomasterfrom
fix/array-copy-of-range
Jan 20, 2026
Merged

[bugfix] optimize array copying in engineUpdate() methods#101
yaziza merged 1 commit intomasterfrom
fix/array-copy-of-range

Conversation

@yaziza
Copy link
Owner

@yaziza yaziza commented Jan 19, 2026

Correct Arrays.copyOfRange bounds in BotanMessageDigest and BotanMac to copy only requested bytes instead of copying to end of input array.

Changes input.length to offset + len, eliminating unnecessary memory allocation and copying for operations with non-zero offsets.

No functional change - cryptographic outputs remain correct. Performance improvement for offset-based update operations.

Correct Arrays.copyOfRange bounds in BotanMessageDigest and BotanMac
to copy only requested bytes instead of copying to end of input array.

Changes input.length to offset + len, eliminating unnecessary
memory allocation and copying for operations with non-zero offsets.

No functional change - cryptographic outputs remain correct.
Performance improvement for offset-based update operations.

Signed-off-by: Yasser Aziza <yasser.aziza@gmail.com>
Copy link
Owner Author

@yaziza yaziza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yaziza yaziza merged commit 87f08e0 into master Jan 20, 2026
10 of 11 checks passed
@yaziza yaziza deleted the fix/array-copy-of-range branch January 20, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant