mirror of
https://github.com/morgan9e/noiseprotocol
synced 2026-04-14 00:14:05 +09:00
noise/builder.py - Added methods for rekeying cipherstates - Added method for getting handshake hash (for channel binding) noise/functions.py - Added default rekey behavior and set it for AESGCM and ChaCha20 noise/constants.py - Added MAX_NONCE noise/state.py - Added rekey method to CipherState - Removed writing to noise_protocol instance in SymmetricState. NoiseProtocol fills the appropriate field by taking the data from HandshakeState now.
21 lines
295 B
Python
21 lines
295 B
Python
class Empty:
|
|
pass
|
|
|
|
|
|
# Handshake pattern tokens
|
|
TOKEN_E = 'e'
|
|
TOKEN_S = 's'
|
|
TOKEN_EE = 'ee'
|
|
TOKEN_ES = 'es'
|
|
TOKEN_SE = 'se'
|
|
TOKEN_SS = 'ss'
|
|
TOKEN_PSK = 'psk'
|
|
|
|
|
|
# In bytes, as in Section 8 of specification (rev 32)
|
|
MAX_PROTOCOL_NAME_LEN = 255
|
|
|
|
MAX_MESSAGE_LEN = 65535
|
|
|
|
MAX_NONCE = 2 ** 64 - 1
|