Open
Conversation
…nstead of eprintln! What is next: `finalize()` should keep track of the state of a block and produce a single block.
finalize() internally uses cshake and handles errors with Err() i…finalize() internally uses cshake and handles errors with Err() inestead of eprintln!. Also pulled from the main branch.
Dustin-Ray
reviewed
Mar 5, 2024
Dustin-Ray
reviewed
Mar 5, 2024
Dustin-Ray
reviewed
Mar 5, 2024
src/ops.rs
Outdated
| /// passes self.data and returns the result | ||
| fn finalize(self) -> Result<Vec<u8>, OperationError> { | ||
| if let Some(d) = self.d { | ||
| let value = d as u64; |
Owner
There was a problem hiding this comment.
Im imagining how we are going to use this in the sliding window, so I think what we want to do now that we have this framework is to make the following changes:
-
finalizeshould accept a single parameter calledoutput_length: u64 - get rid of
valuehere and pass inoutput_lengthto cshake instead, this way we can control the blocksize output - set
self.msg= the result of cshake here, and then return self.msg
2 things are happening here:
- this allows us to use the output of this hasher as a block of keystream that we can encrypt or decrypt into the message
- we can effectively control the size of the output block to encrypt a message of any size
actually 3 things
- this keeps rehashing the previous result of cshake so that the keystream doesnt repeat but continuously pumps out new pseudorandom output. if we just keep hashing
self.msgand returning the hash separately over and over again, we will keep getting the same output repeated which we def do not want
finalize() internally uses cshake and handles errors with Err() inestead of eprintln!. Also pulled from the main branch.
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is next:
finalize()should keep track of the state of a block and produce a single block.Add features before working on issue #20.