Skip to content

ConcatOther<Rhs> for cross-sizes concatenation of Uint<>s#224

Closed
ycscaly wants to merge 7 commits into
RustCrypto:masterfrom
ycscaly:concat
Closed

ConcatOther<Rhs> for cross-sizes concatenation of Uint<>s#224
ycscaly wants to merge 7 commits into
RustCrypto:masterfrom
ycscaly:concat

Conversation

@ycscaly

@ycscaly ycscaly commented May 3, 2023

Copy link
Copy Markdown
Contributor

Resolves #225

@ycscaly

ycscaly commented May 3, 2023

Copy link
Copy Markdown
Contributor Author

@tarcieri

Comment thread src/uint.rs Outdated
Comment on lines +391 to +413
#[cfg(feature = "cross-size")]
impl_concat_cross_sizes! {
(U64, 64),
(
(U128, 128),
(U256, 256),
(U384, 384),
(U512, 512),
(U640, 640),
(U768, 768),
(U896, 896),
(U1024, 1024),
(U1280, 1280),
(U1536, 1536),
(U1792, 1792),
(U2048, 2048),
(U3072, 3072),
(U3584, 3584),
(U4096, 4096),
(U6144, 6144),
(U8192, 8192)
)
}

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.

Can you move these out of uint.rs into their own submodule? It makes the uint.rs file huge, and if you move them to their own module, you can feature-gate them in one place instead of every time the macro is invoked

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I thought it is better this way anyways, but the original code had it here so I followed through.

Can I put them in concat?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Or do you want a seperate "cross-size" module

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.

concat works, although maybe put them in an inline submodule so you can gate them in a single place, e.g. mod cross_size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can't do that since some of the feature specific code is also in mul

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.

I'm confused what you can't do? Regardless this is hundreds and hundreds of lines of feature-gated macro invocations which should find a better home than the toplevel module.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can create a separate module for all of this then. Will be easier.

@ycscaly ycscaly requested a review from tarcieri May 3, 2023 14:40
Comment thread Cargo.toml Outdated
@ycscaly

ycscaly commented May 7, 2023

Copy link
Copy Markdown
Contributor Author

Replaced by #230

@ycscaly ycscaly closed this May 7, 2023
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.

Concatenation of different sizes Uint<>s

2 participants