github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbcrypto/util.go (about)

     1  // Copyright 2018 Keybase, Inc. All rights reserved. Use of
     2  // this source code is governed by the included BSD license.
     3  
     4  package kbcrypto
     5  
     6  import (
     7  	"bytes"
     8  	"crypto/hmac"
     9  
    10  	keybase1 "github.com/keybase/client/go/protocol/keybase1"
    11  )
    12  
    13  const (
    14  	SCSigCannotVerify = int(keybase1.StatusCode_SCSigCannotVerify)
    15  )
    16  
    17  func FastByteArrayEq(a, b []byte) bool {
    18  	return bytes.Equal(a, b)
    19  }
    20  
    21  func SecureByteArrayEq(a, b []byte) bool {
    22  	return hmac.Equal(a, b)
    23  }