MCPcopy Create free account
hub / github.com/BitVM/BitVM / equalverify

Function equalverify

bitvm/src/signatures/public.rs:411–427  ·  view source on GitHub ↗

Returns a Bitcoin script that compares two elements of length `n`. The script consumes its inputs. If the two elements are not equal, then the script fails immediately.

(n: usize)

Source from the content-addressed store, hash-verified

409 /// The script consumes its inputs.
410 /// If the two elements are not equal, then the script fails immediately.
411 fn equalverify(n: usize) -> Script {
412 script!(
413 for _ in 0..n {
414 OP_TOALTSTACK
415 }
416
417 for i in 1..n {
418 {i}
419 OP_ROLL
420 }
421
422 for _ in 0..n {
423 OP_FROMALTSTACK
424 OP_EQUALVERIFY
425 }
426 )
427 }
428
429 /// Convert the raw Bitcoin witness into a byte vector.
430 ///

Callers 3

equalverifyMethod · 0.50
test_affine_identityFunction · 0.50
test_affine_equalverifyFunction · 0.50

Calls

no outgoing calls

Tested by 2

test_affine_identityFunction · 0.40
test_affine_equalverifyFunction · 0.40