This pull request introduces a significant refactor to replace direct function calls with the rosenpass_to::To trait for improved readability and consistency across the codebase. It also includes minor adjustments to improve error messages and variable naming. Below are the most important changes grouped by theme:

Refactor to Use rosenpass_to::To Trait:

  • Updated b64_decode function to return a To-compatible object, enabling cleaner syntax for decoding operations. This change affects multiple files, including util/src/b64.rs, secret-memory/src/public.rs, secret-memory/src/secret.rs, and wireguard-broker/src/brokers/native_unix.rs. [1] [2] [3] [4]
  • Replaced direct calls to b64_decode with the .to() method across the codebase for consistency. [1] [2] [3]

Improvements to Error Messages:

  • Enhanced error messages for base64 encoding and decoding operations to provide more specific context. For example, updated the error message in StoreValueB64 implementations to clarify the operation. [1] [2]

Code Simplification:

  • Simplified the from_slice method in Public by using a lambda function to call Self::zero().
  • Replaced unused variable host_identification with _host_identification to suppress warnings.

Dependency Updates:

  • Added rosenpass-to as a dependency in Cargo.toml to support the new To trait functionality.

Fuzz Targets Adjustments:

  • Refactored fuzz targets (blake2b.rs, kyber_encaps.rs, mceliece_encaps.rs) to use the rosenpass_to::to function for output handling, improving code clarity. [1] [2] [3]

Tests are all green🟢

/claim #164

@koraa

Claim

Total prize pool $40
Total paid $0
Status Pending
Submitted July 15, 2025
Last updated July 15, 2025

Contributors

SA

Sambit Chakraborty

@Sambit003

100%

Sponsors

RO

Rosenpass

@rosenpass

$40