Skip to content

Add serde for BoxedUInt#587

Closed
pinkforest wants to merge 11 commits into
RustCrypto:masterfrom
pinkforest:add-serde-boxeduint
Closed

Add serde for BoxedUInt#587
pinkforest wants to merge 11 commits into
RustCrypto:masterfrom
pinkforest:add-serde-boxeduint

Conversation

@pinkforest

@pinkforest pinkforest commented Apr 2, 2024

Copy link
Copy Markdown

Missing impl Serialize and Deserialize

@pinkforest pinkforest changed the title Add serde for BoxedUInt WIP: Add serde for BoxedUInt Apr 2, 2024
Comment thread src/uint/boxed.rs Outdated
Comment thread src/uint/boxed.rs Outdated
Comment thread src/uint/boxed.rs Outdated
Comment thread src/uint/boxed.rs Outdated
Comment on lines +401 to +402
#[cfg(feature = "serde")]
impl<'de> Deserialize<'de> for BoxedUint

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks done

@pinkforest pinkforest changed the title WIP: Add serde for BoxedUInt Add serde for BoxedUInt Apr 6, 2024
D: Deserializer<'de>,
{
let mut buffer = Self::zero().to_le_bytes();
serdect::array::deserialize_hex_or_bin(buffer.as_mut(), deserializer)?;

@pinkforest pinkforest Apr 6, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Doesn't work because it doesn't know the size and zero() doesn't size it for the incoming buf
Having some weird errors from the alloc variant

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You need to use serdect::slice if the size isn't known a priori

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

hmm I thought I tried (the alloc variant) that and it gave some weird runtime behaviour

@dignifiedquire

Copy link
Copy Markdown
Member

@tarcieri @pinkforest what's the state here?

@tarcieri

Copy link
Copy Markdown
Member

The feedback I left hasn't been addressed and the tests aren't yet all passing

@pinkforest

pinkforest commented Jul 22, 2024

Copy link
Copy Markdown
Author

Please anyone feel free to cherry on my commit and fix - I got stuck with the alloc version playing up weird.
I am atm too busy with personal disasters sorry 😿 . I may be able to look this in a week or two apologies 😞

@tarcieri

tarcieri commented Jan 6, 2025

Copy link
Copy Markdown
Member

Closing as stale

@tarcieri tarcieri closed this Jan 6, 2025
wawwior added a commit to wawwior/crypto-bigint that referenced this pull request Mar 9, 2025
tarcieri pushed a commit that referenced this pull request Jun 14, 2025
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.

3 participants