-
Notifications
You must be signed in to change notification settings - Fork 140
dsa: reduce Box<[u8]>
allocation in SignatureEncoding::to_vec
#969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
dsa: reduce Box<[u8]>
allocation in SignatureEncoding::to_vec
#969
Conversation
|
||
use crate::Signature; | ||
|
||
pub(crate) struct SignatureBoxed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is essentially what dsa::Signature
is (dsa::Signature is composed of NonZero<BoxedUint>
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be possible to get an iterator over the inner limbs? and get big endian from there? without allocating a new box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
der
checks for leading zeros when encoding UIntRef, so it would be too tricky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well that's just up to the consumer of the said iterator to strip leading zeroes? I don't know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah nevermind, you have to have a buffer for SignatureRef
, that can't be an iterator of limbs.
The Perhaps support could be added there so there's not need for complex encoding logic in the |
dsa: refactor: move `SignatureRef` to `signature_ref.rs`
864c3b6
to
0d62c1f
Compare
Rewritten as
SignatureRef