2021-08-14 15:50:49 +00:00
|
|
|
package kv
|
|
|
|
|
|
|
|
import "bytes"
|
|
|
|
|
|
|
|
// In order for an encoding to be Altair compatible, it must be prefixed with altair key.
|
|
|
|
func hasAltairKey(enc []byte) bool {
|
|
|
|
if len(altairKey) >= len(enc) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return bytes.Equal(enc[:len(altairKey)], altairKey)
|
|
|
|
}
|
2021-12-07 18:51:05 +00:00
|
|
|
|
2022-01-26 07:24:47 +00:00
|
|
|
func hasBellatrixKey(enc []byte) bool {
|
2022-01-10 16:47:30 +00:00
|
|
|
if len(bellatrixKey) >= len(enc) {
|
2021-12-07 18:51:05 +00:00
|
|
|
return false
|
|
|
|
}
|
2022-01-10 16:47:30 +00:00
|
|
|
return bytes.Equal(enc[:len(bellatrixKey)], bellatrixKey)
|
2021-12-07 18:51:05 +00:00
|
|
|
}
|
2022-05-03 16:55:59 +00:00
|
|
|
|
|
|
|
func hasBellatrixBlindKey(enc []byte) bool {
|
|
|
|
if len(bellatrixBlindKey) >= len(enc) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return bytes.Equal(enc[:len(bellatrixBlindKey)], bellatrixBlindKey)
|
|
|
|
}
|
2022-10-12 16:39:19 +00:00
|
|
|
|
|
|
|
func hasCapellaKey(enc []byte) bool {
|
|
|
|
if len(capellaKey) >= len(enc) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return bytes.Equal(enc[:len(capellaKey)], capellaKey)
|
|
|
|
}
|
2022-11-07 15:26:27 +00:00
|
|
|
|
|
|
|
func hasCapellaBlindKey(enc []byte) bool {
|
|
|
|
if len(capellaBlindKey) >= len(enc) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return bytes.Equal(enc[:len(capellaBlindKey)], capellaBlindKey)
|
|
|
|
}
|