Sequence.GetAttestation()
This commit is contained in:
11
ots.go
11
ots.go
@@ -71,6 +71,17 @@ type Instruction struct {
|
|||||||
|
|
||||||
type Sequence []Instruction
|
type Sequence []Instruction
|
||||||
|
|
||||||
|
func (seq Sequence) GetAttestation() Attestation {
|
||||||
|
if len(seq) == 0 {
|
||||||
|
return Attestation{}
|
||||||
|
}
|
||||||
|
att := seq[len(seq)-1]
|
||||||
|
if att.Attestation == nil {
|
||||||
|
return Attestation{}
|
||||||
|
}
|
||||||
|
return *att.Attestation
|
||||||
|
}
|
||||||
|
|
||||||
func (seq Sequence) Compute(initial []byte) []byte {
|
func (seq Sequence) Compute(initial []byte) []byte {
|
||||||
current := initial
|
current := initial
|
||||||
for _, inst := range seq {
|
for _, inst := range seq {
|
||||||
|
|||||||
Reference in New Issue
Block a user