-
Notifications
You must be signed in to change notification settings - Fork 79
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
Faster handshake #419
Faster handshake #419
Conversation
This comment has been minimized.
This comment has been minimized.
806e592
to
e32c64d
Compare
This comment has been minimized.
This comment has been minimized.
e32c64d
to
cd6a64c
Compare
This comment has been minimized.
This comment has been minimized.
cd6a64c
to
71f7e24
Compare
This comment has been minimized.
This comment has been minimized.
every time we call a HMAC_SHA256 it needs to create a new instance and calculate the i_key and o_key, even if the key used is the same use one instance of the HMAC and just copy state also use multiple update calls, don't concatenate inputs
71f7e24
to
7df73e3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a01ddfb
to
7098222
Compare
This pull request fixes 2 alerts when merging 7098222 into e8da6cf - view on LGTM.com fixed alerts:
|
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.
just minor comments. Looks good otherwise
tlslite/utils/compat.py
Outdated
else: | ||
def compat26Str(x): return x | ||
|
||
def remove_whitespace(text): | ||
"""Removes all whitespace from passed in string""" | ||
return re.sub(r"\s+", "", text, flags=re.UNICODE) | ||
|
||
def bit_length(val): | ||
"""Return number of bytes necessary to represent an integer.""" |
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.
s/bytes/bits/
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.
fixed
def skip_bytes(self, length): | ||
"""Move the internal pointer ahead length bytes.""" | ||
if self.index + length > len(self.bytes): | ||
raise DecodeError("Read past end of buffer") |
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.
Maybe different exception message like "Skipped past the end of buffer"?
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.
this method is used only to get to the point we want to read, so while "skipped past..." would make more sense on the level of the Parser class, for the classes higher up the stack I think "Read past end of buffer" is more understandable
7098222
to
a005589
Compare
This pull request fixes 2 alerts when merging a005589 into e8da6cf - view on LGTM.com fixed alerts:
|
thanks for the review! |
Optimise methods and functions used heavily in a handshake.
Speeds it up by about 25%
fixes #356
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)