|
|
@ -136,7 +136,8 @@ func (ts *TokenServer) SpendToken(token SpentToken, data []byte) error { |
|
|
|
W := new(ristretto.Element).ScalarMult(ts.k, T) |
|
|
|
key := sha3.Sum256(append(token.T, W.Encode(nil)...)) |
|
|
|
mac := hmac.New(sha3.New512, key[:]) |
|
|
|
computedMAC := mac.Sum(data) |
|
|
|
mac.Write(data) |
|
|
|
computedMAC := mac.Sum(nil) |
|
|
|
result := hmac.Equal(token.MAC, computedMAC) |
|
|
|
if result == true { |
|
|
|
if ts.persistanceService == nil { |
|
|
|