Class: MTProto::TL::ServerDHInnerData
- Inherits:
-
Object
- Object
- MTProto::TL::ServerDHInnerData
- Defined in:
- lib/mtproto/tl/objects/server_dh_inner_data.rb
Instance Attribute Summary collapse
-
#dh_prime ⇒ Object
readonly
Returns the value of attribute dh_prime.
-
#g ⇒ Object
readonly
Returns the value of attribute g.
-
#g_a ⇒ Object
readonly
Returns the value of attribute g_a.
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
-
#server_nonce ⇒ Object
readonly
Returns the value of attribute server_nonce.
-
#server_time ⇒ Object
readonly
Returns the value of attribute server_time.
Class Method Summary collapse
Instance Attribute Details
#dh_prime ⇒ Object (readonly)
Returns the value of attribute dh_prime.
6 7 8 |
# File 'lib/mtproto/tl/objects/server_dh_inner_data.rb', line 6 def dh_prime @dh_prime end |
#g ⇒ Object (readonly)
Returns the value of attribute g.
6 7 8 |
# File 'lib/mtproto/tl/objects/server_dh_inner_data.rb', line 6 def g @g end |
#g_a ⇒ Object (readonly)
Returns the value of attribute g_a.
6 7 8 |
# File 'lib/mtproto/tl/objects/server_dh_inner_data.rb', line 6 def g_a @g_a end |
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
6 7 8 |
# File 'lib/mtproto/tl/objects/server_dh_inner_data.rb', line 6 def nonce @nonce end |
#server_nonce ⇒ Object (readonly)
Returns the value of attribute server_nonce.
6 7 8 |
# File 'lib/mtproto/tl/objects/server_dh_inner_data.rb', line 6 def server_nonce @server_nonce end |
#server_time ⇒ Object (readonly)
Returns the value of attribute server_time.
6 7 8 |
# File 'lib/mtproto/tl/objects/server_dh_inner_data.rb', line 6 def server_time @server_time end |
Class Method Details
.deserialize(bytes) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/mtproto/tl/objects/server_dh_inner_data.rb', line 8 def self.deserialize(bytes) constructor = bytes[0, 4].unpack1('L<') unless constructor == Constructors::SERVER_DH_INNER_DATA raise "Unexpected constructor: 0x#{constructor.to_s(16)}" end offset = 4 nonce = bytes[offset, 16] offset += 16 server_nonce = bytes[offset, 16] offset += 16 g = bytes[offset, 4].unpack1('L<') offset += 4 dh_prime, offset = read_tl_bytes(bytes, offset) g_a, offset = read_tl_bytes(bytes, offset) server_time = bytes[offset, 4].unpack1('L<') new( nonce: nonce, server_nonce: server_nonce, g: g, dh_prime: dh_prime, g_a: g_a, server_time: server_time ) end |