mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Add early data support to Noise protocol
Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
This commit is contained in:
@ -1,8 +1,12 @@
|
||||
syntax = "proto3";
|
||||
syntax = "proto2";
|
||||
package pb;
|
||||
|
||||
message NoiseHandshakePayload {
|
||||
bytes identity_key = 1;
|
||||
bytes identity_sig = 2;
|
||||
bytes data = 3;
|
||||
message NoiseExtensions {
|
||||
repeated string stream_muxers = 2;
|
||||
}
|
||||
|
||||
message NoiseHandshakePayload {
|
||||
optional bytes identity_key = 1;
|
||||
optional bytes identity_sig = 2;
|
||||
optional bytes data = 3;
|
||||
}
|
||||
|
||||
@ -13,13 +13,15 @@ _sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$libp2p/security/noise/pb/noise.proto\x12\x02pb\"Q\n\x15NoiseHandshakePayload\x12\x14\n\x0cidentity_key\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_sig\x18\x02 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x62\x06proto3')
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$libp2p/security/noise/pb/noise.proto\x12\x02pb\"(\n\x0fNoiseExtensions\x12\x15\n\rstream_muxers\x18\x02 \x03(\t\"Q\n\x15NoiseHandshakePayload\x12\x14\n\x0cidentity_key\x18\x01 \x01(\x0c\x12\x14\n\x0cidentity_sig\x18\x02 \x01(\x0c\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c')
|
||||
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'libp2p.security.noise.pb.noise_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
_NOISEHANDSHAKEPAYLOAD._serialized_start=44
|
||||
_NOISEHANDSHAKEPAYLOAD._serialized_end=125
|
||||
_NOISEEXTENSIONS._serialized_start=44
|
||||
_NOISEEXTENSIONS._serialized_end=84
|
||||
_NOISEHANDSHAKEPAYLOAD._serialized_start=86
|
||||
_NOISEHANDSHAKEPAYLOAD._serialized_end=167
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
|
||||
@ -4,12 +4,30 @@ isort:skip_file
|
||||
"""
|
||||
|
||||
import builtins
|
||||
import collections.abc
|
||||
import google.protobuf.descriptor
|
||||
import google.protobuf.internal.containers
|
||||
import google.protobuf.message
|
||||
import typing
|
||||
|
||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||
|
||||
@typing.final
|
||||
class NoiseExtensions(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
STREAM_MUXERS_FIELD_NUMBER: builtins.int
|
||||
@property
|
||||
def stream_muxers(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
stream_muxers: collections.abc.Iterable[builtins.str] | None = ...,
|
||||
) -> None: ...
|
||||
def ClearField(self, field_name: typing.Literal["stream_muxers", b"stream_muxers"]) -> None: ...
|
||||
|
||||
global___NoiseExtensions = NoiseExtensions
|
||||
|
||||
@typing.final
|
||||
class NoiseHandshakePayload(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
@ -23,10 +41,11 @@ class NoiseHandshakePayload(google.protobuf.message.Message):
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
identity_key: builtins.bytes = ...,
|
||||
identity_sig: builtins.bytes = ...,
|
||||
data: builtins.bytes = ...,
|
||||
identity_key: builtins.bytes | None = ...,
|
||||
identity_sig: builtins.bytes | None = ...,
|
||||
data: builtins.bytes | None = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing.Literal["data", b"data", "identity_key", b"identity_key", "identity_sig", b"identity_sig"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing.Literal["data", b"data", "identity_key", b"identity_key", "identity_sig", b"identity_sig"]) -> None: ...
|
||||
|
||||
global___NoiseHandshakePayload = NoiseHandshakePayload
|
||||
|
||||
Reference in New Issue
Block a user