/claim #164

PR Description

This PR starts the migration of destination-parameter functions to the rosenpass-to pattern as discussed in issue #164.

The scope of this change is intentionally small. The goal is to validate the migration approach on a single utility function before continuing with further refactors.


Scope

This PR converts b64_decode in util/src/b64.rs from a destination-parameter function:

rust fn b64_decode(input: &[u8], output: &mut [u8]) -> anyhow::Result<()>

to a function returning:

impl To<[u8], anyhow::Result<()>>

implemented using with_destination. All direct call sites were updated accordingly.

Changes Included

  • Convert b64_decode to return impl To<[u8], anyhow::Result<()>>
  • Preserve existing logic and error handling exactly
  • Update direct call sites in:
  • secret-memory
  • wireguard-broker
  • Update documentation examples to match the new usage pattern
  • Add rosenpass-to dependency where required
  • Remove unused import introduced during refactoring (anyhow::bail)

Behavioral Changes

None.

This is a mechanical refactor only:

  • no logic changes
  • no allocation changes
  • no performance changes
  • no cryptographic code modified

Pattern Followed

The refactor follows:

  • the rosenpass-to pattern documented in /to/README.md
  • existing usage already present in the repository
  • the intended migration direction described in issue #164

No new abstractions or extension traits were introduced.

Validation

The following checks were performed:

  • cargo check succeeds for all affected crates
  • all existing tests pass unchanged:
  • rosenpass-util
  • rosenpass-secret-memory
  • rosenpass-wireguard-broker
  • no new compiler warnings introduced by this change
  • diff intentionally kept small for ease of review

Claim

Total prize pool $40
Total paid $0
Status Pending
Submitted February 18, 2026
Last updated February 18, 2026

Contributors

RI

Rishi Jat

@rishi-jat

100%

Sponsors

RO

Rosenpass

@rosenpass

$40