Skip to content

Conversation

@mmaker
Copy link
Collaborator

@mmaker mmaker commented Sep 8, 2025

No description provided.

@mmaker mmaker requested a review from Copilot September 9, 2025 21:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds no_std support to the codebase, enabling the library to compile and run in environments without the standard library. The key changes involve replacing standard library dependencies with their core/alloc equivalents and making standard library features optional.

Key Changes

  • Added conditional compilation for std vs no_std environments using feature flags
  • Replaced standard library imports (Vec, HashMap, String, etc.) with alloc equivalents
  • Added no_std-compatible error handling with manual Display implementations

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Added feature flags and made std dependencies optional
src/lib.rs Added no_std configuration and extern crate alloc
src/errors.rs Added no_std-compatible error handling with manual Display implementations
src/traits.rs Replaced rand imports with conditional std/no_std variants
src/schnorr_protocol.rs Added conditional rand imports and alloc::vec::Vec
src/linear_relation/*.rs Replaced std imports with alloc equivalents
src/group/*.rs Added alloc::vec::Vec imports
src/duplex_sponge/*.rs Added alloc::vec::Vec imports
src/composition.rs Updated rand trait bounds for no_std compatibility
src/codec.rs Added alloc::vec import
src/fiat_shamir.rs Added conditional rand imports
.github/workflows/rust.yml Added CI checks for no_std compilation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}

for (scalar, base) in scalars.into_iter().zip(bases) {
for (scalar, base) in scalars.iter().zip(bases) {
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

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

This change from scalars.into_iter() to scalars.iter() changes the semantic behavior. The original code consumed the scalars iterator, but now it borrows it, which may cause issues if the function signature expects to take ownership of scalars.

Copilot uses AI. Check for mistakes.
@mmaker mmaker marked this pull request as ready for review September 9, 2025 21:14
@mmaker mmaker merged commit 116eaff into main Sep 9, 2025
8 checks passed
@mmaker mmaker deleted the feat/no_std branch September 13, 2025 13:54
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.

2 participants