Sha256: 8a561f36a4f9543de43dea3fc4c64e55228d59bb0829f32f879189030b89deed

Contents?: true

Size: 405 Bytes

Versions: 3

Compression:

Stored size: 405 Bytes

Contents

# frozen_string_literal: true

module Lightning
  module Onion
    module FailureMessages
      module InvalidOnionHmac
        def to_payload
          [TYPES[:invalid_onion_hmac], sha256_of_onion.htb.bytesize].pack('n2') + sha256_of_onion.htb
        end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lightning-onion-0.2.10 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.9 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb
lightning-onion-0.2.8 lib/lightning/onion/failure_messages/invalid_onion_hmac.rb