github.com/linuxboot/fiano@v1.2.0/pkg/intel/metadata/bg/crypto_routines_manifestcodegen.go (about)

     1  // Copyright 2017-2021 the LinuxBoot Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !manifestcodegen
     6  // +build !manifestcodegen
     7  
     8  // Code generated by "menifestcodegen". DO NOT EDIT.
     9  // To reproduce: go run github.com/linuxboot/fiano/pkg/intel/metadata/common/manifestcodegen/cmd/manifestcodegen -package bg github.com/linuxboot/fiano/pkg/intel/metadata/bg
    10  
    11  package bg
    12  
    13  import (
    14  	"encoding/binary"
    15  	"fmt"
    16  	"io"
    17  	"strings"
    18  
    19  	"github.com/linuxboot/fiano/pkg/intel/metadata/common/pretty"
    20  )
    21  
    22  var (
    23  	// Just to avoid errors in "import" above in case if it wasn't used below
    24  	_ = binary.LittleEndian
    25  	_ = (fmt.Stringer)(nil)
    26  	_ = (io.Reader)(nil)
    27  	_ = pretty.Header
    28  	_ = strings.Join
    29  )
    30  
    31  // PrettyString returns the bits of the flags in an easy-to-read format.
    32  func (v Algorithm) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string {
    33  	return v.String()
    34  }
    35  
    36  // TotalSize returns the total size measured through binary.Size.
    37  func (v Algorithm) TotalSize() uint64 {
    38  	return uint64(binary.Size(v))
    39  }
    40  
    41  // WriteTo writes the Algorithm into 'w' in binary format.
    42  func (v Algorithm) WriteTo(w io.Writer) (int64, error) {
    43  	return int64(v.TotalSize()), binary.Write(w, binary.LittleEndian, v)
    44  }
    45  
    46  // ReadFrom reads the Algorithm from 'r' in binary format.
    47  func (v Algorithm) ReadFrom(r io.Reader) (int64, error) {
    48  	return int64(v.TotalSize()), binary.Read(r, binary.LittleEndian, v)
    49  }