def any.key

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

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

231# Does any signature sign the message under any secret? r holds the message and a copy.
232def any.key(keys: List<&2, String>, +std: Bool, +hex: Bool, +sigs: List<&2, String>, r: Bytes.Bytes & Bytes.Bytes) ->
233    IO(Result<&1, &1, Err, Bool>):
234  match keys:
235    case Nil{}:
236      IO.pure(Result<&1, &1, Err, Bool>, Done{False{}})
237    case Con{k, t}:
238      (m1, m2) = r
239      do IO<Result<&1, &1, Err, Bool>>:
240        a : Result<&1, &1, Err, Bool> <- key.check(key(std, k), hex, sigs, m2)
241        b : Result<&1, &1, Err, Bool> <- any.key(t, std, hex, sigs, Bytes.slice(m1, 0, 4294967295))
242        return both(a, b)

Uses (15)

Used by (1)