Sha256: b03128928f9adaafca23a2ab86d1e82a2ef8414ddf51df2d30a786eda380ebea

Contents?: true

Size: 418 Bytes

Versions: 10

Compression:

Stored size: 418 Bytes

Contents

# frozen_string_literal: true

require "bindata"

module TPM
  class TpmtHa < BinData::Record
    BYTE_LENGTH = 8
    DIGEST_LENGTH_SHA1 = 160
    DIGEST_LENGTH_SHA256 = 256

    endian :big

    uint16 :hash_alg

    choice :digest, selection: :hash_alg do
      string TPM::ALG_SHA1, length: DIGEST_LENGTH_SHA1 / BYTE_LENGTH
      string TPM::ALG_SHA256, length: DIGEST_LENGTH_SHA256 / BYTE_LENGTH
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tpm-key_attestation-0.14.0 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.13.1 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.13.0 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.12.1 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.12.0 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.11.0 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.10.0 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.9.0 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.8.0 lib/tpm/tpmt_ha.rb
tpm-key_attestation-0.7.0 lib/tpm/tpmt_ha.rb