Skip to content

Fix multiple TODOs#89

Open
mertwole wants to merge 7 commits into
skalman/fix-audit-findingsfrom
mertwole-refactor
Open

Fix multiple TODOs#89
mertwole wants to merge 7 commits into
skalman/fix-audit-findingsfrom
mertwole-refactor

Conversation

@mertwole

@mertwole mertwole commented Jun 8, 2026

Copy link
Copy Markdown

Part of #88
Resolves #87

Benchmarks have shown that batching curve normalizations in verify won't give any significant performance gains (a difference was less than 1% in my tests)

@mertwole
mertwole requested a review from drskalman June 8, 2026 13:36

@drskalman drskalman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Few questions and nits mostly :-)

Also could you make it to merge into https://github.com/paritytech/bls/tree/skalman/fix-audit-findings instead of master please?

Comment thread src/experimental/bit.rs
type M = Message;
type PKG = PublicKey<E>;

type PKnM = ::core::iter::Once<(Message, PublicKey<E>)>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you explain me that how is replacing Once with ExactSizeIterator works?

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.

PKnM is removed from the trait definition and as the bound there was PKnM: Iterator<Item = (Self::M, Self::PKG)> + ExactSizeIterator we can use this bound as return type for messages_and_publickeys, while the actual return type will stay ::core::iter::Once<(Message, PublicKey<E>)> which implements both Iterator and ExactSizeIterator


type M = &'a Message;
type PKG = &'a PublicKey<Self::E>;
type PKnM = ::std::collections::hash_map::Iter<'a, Message, PublicKey<E>>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe the explicit use of hash_map was intentional to impose the hash_map's orders, do we know for sure if we remove the hash_map we get the same ordering?

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.

The type of the value returned from messages_and_publickeys will stay the same (it just won't be explicitly stated in the associated type), so the iteration order will stay the same

Comment thread src/multi_pop_aggregator.rs Outdated
Comment thread src/single.rs
@mertwole
mertwole changed the base branch from master to skalman/fix-audit-findings July 27, 2026 10:34
@mertwole
mertwole requested a review from drskalman July 27, 2026 11:02
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.

Check if batching for two elements is worth it

2 participants