Updating AKE message format (#85)

This commit is contained in:
Kevin Lewi
2020-11-16 11:49:27 -08:00
committed by GitHub
parent f18eaea8cf
commit 51b3781e5c
7 changed files with 300 additions and 107 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ pub(crate) fn serialize(input: &[u8], max_bytes: usize) -> Vec<u8> {
// Tokenizes an input of the format I2OSP(len(input), max_bytes) || input, outputting
// (input, remainder)
pub(crate) fn tokenize(input: Vec<u8>, size_bytes: usize) -> Result<(Vec<u8>, Vec<u8>), PakeError> {
pub(crate) fn tokenize(input: &[u8], size_bytes: usize) -> Result<(Vec<u8>, Vec<u8>), PakeError> {
if size_bytes > std::mem::size_of::<usize>() || input.len() < size_bytes {
return Err(PakeError::SerializationError);
}