forked from theQRL/qrysm
/
key.go
39 lines (33 loc) · 909 Bytes
/
key.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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)
}
func hasBellatrixKey(enc []byte) bool {
if len(bellatrixKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(bellatrixKey)], bellatrixKey)
}
func hasBellatrixBlindKey(enc []byte) bool {
if len(bellatrixBlindKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(bellatrixBlindKey)], bellatrixBlindKey)
}
func hasCapellaKey(enc []byte) bool {
if len(capellaKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(capellaKey)], capellaKey)
}
func hasCapellaBlindKey(enc []byte) bool {
if len(capellaBlindKey) >= len(enc) {
return false
}
return bytes.Equal(enc[:len(capellaBlindKey)], capellaBlindKey)
}