-
Notifications
You must be signed in to change notification settings - Fork 73
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
Update protocol and add SendDataRequest nonce #560
Conversation
it seems like you haven't added any nanpa changeset files to this PR. if this pull request includes changes to code, make sure to add a changeset, by writing a file to
refer to the manpage for more information. |
@@ -288,6 +289,8 @@ impl RoomClient { | |||
data: Vec<u8>, | |||
options: SendDataOptions, | |||
) -> ServiceResult<()> { | |||
let mut rng = rand::rng(); | |||
let nonce: Vec<u8> = (0..16).map(|_| rng.random::<u8>()).collect(); |
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.
nit, you could easily avoid heap allocation
let mut nonce = [0u8; 16];
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.
had this initially with rnd:fill(arr)
but this required .to_vec()
which copies everything into the vec. I guess it would still do heap allocation at the time of copying it into the vec?
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.
ah yeah, seems unnecessary then
* Update protocol and add SendDataRequest nonce * changeset * typo
No description provided.