Sha256: f2eb4b4f3c3ea6dca2a2ac26683c770ec7b83f71d1a91ed3923ddf7f6e61360a

Contents?: true

Size: 411 Bytes

Versions: 7

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

module Lightning
  module Onion
    module FailureMessages
      module InvalidOnionHmac
        def to_payload
          [type_code, sha256_of_onion.htb.bytesize].pack('nn') + sha256_of_onion.htb
        end

        def self.load(payload)
          type_code, len, rest = payload.unpack('nnH*')
          new(type_code, rest[0..len * 2])
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lightning-onion-0.2.6 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.5 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.4 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.3 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.2 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.1 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.0 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb