Skip to content

refactor(rng): Deprecate random_vec(span) in favor of randomize()#5495

Open
KaganCanSit wants to merge 1 commit into
randombit:masterfrom
KaganCanSit:refactor/rng-depracate-random-vec-span
Open

refactor(rng): Deprecate random_vec(span) in favor of randomize()#5495
KaganCanSit wants to merge 1 commit into
randombit:masterfrom
KaganCanSit:refactor/rng-depracate-random-vec-span

Conversation

@KaganCanSit

@KaganCanSit KaganCanSit commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

The random_vec(std::span<uint8_t>) overload marked with the todo message is functionally identical to randomize(std::span<uint8_t>). It does not perform any resizing or allocation operations.

In this regard:

  • random_vec function marked as deprecated.
  • todo message updated for its removal in Botan4.
  • Internal call sites have been migrated from random_vec(std::span<uint8_t>) to randomize().

Notes
random_vec(T& v, size_t bytes) and T random_vec(size_t bytes) overloads are retained — they provide resize/allocate semantics that have no equivalent in randomize().

Notes 2
The @deprecated Doxygen tag was considered but omitted — it is not used elsewhere in the project and triggers -Wdocumentation-deprecated-sync warnings across all translation units that include this header.

Updates:
06.05.2026 - Rebase master for src/tests/test_strong_type.cpp conflict.
24.05.2026 - Rebase master branch.

@KaganCanSit KaganCanSit changed the title refactor(rng): Deprecate random_vec(span) in favor of randomize() - todo refactor(rng): Deprecate random_vec(span) in favor of randomize() Mar 29, 2026
@KaganCanSit
KaganCanSit force-pushed the refactor/rng-depracate-random-vec-span branch from bb3b84c to cd69ad6 Compare March 29, 2026 17:28
@KaganCanSit
KaganCanSit force-pushed the refactor/rng-depracate-random-vec-span branch from cd69ad6 to 28b865b Compare May 6, 2026 18:03
Replace internal random_vec(span) calls with randomize() across the codebase. Mark the overload as deprecated.
@KaganCanSit
KaganCanSit force-pushed the refactor/rng-depracate-random-vec-span branch from 28b865b to 1d9f2aa Compare May 24, 2026 08:27
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