def any.sig

bend-kit-webhooks@0.11.0.1 · webhooks.bend:186

import bend-kit-webhooks@0.11.0.1/webhooks.bend as Webhooks
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

186# Does any signature equal the MAC? r holds the MAC and a copy; every signature is compared.
187def any.sig(sigs: List<&2, String>, +hex: Bool, r: Bytes.Bytes & Bytes.Bytes) -> IO(Bool):
188  match sigs:
189    case Nil{}:
190      IO.pure(Bool, False{})
191    case Con{s, t}:
192      (m1, m2) = r
193      do IO<Bool>:
194        ok : Bool <- ct(decode(hex, s), m2)
195        rest : Bool <- any.sig(t, hex, Bytes.slice(m1, 0, 4294967295))
196        return Bool.or(ok, rest)

Uses (13)

Used by (1)