1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[30],{83392(e,i,r){r.r(i),r.d(i,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>t,metadata:()=>n,toc:()=>l});const n=JSON.parse('{"id":"libraries/standard_library/black_box_fns","title":"Black Box Functions","description":"Black box functions are functions in Noir that rely on backends implementing support for specialized constraints.","source":"@site/processed-docs/libraries/standard_library/black_box_fns.md","sourceDirName":"libraries/standard_library","slug":"/libraries/standard_library/black_box_fns","permalink":"/docs/dev/libraries/standard_library/black_box_fns","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/docs/libraries/standard_library/black_box_fns.md","tags":[],"version":"current","frontMatter":{"title":"Black Box Functions","description":"Black box functions are functions in Noir that rely on backends implementing support for specialized constraints.","keywords":["noir","black box functions"]},"sidebar":"sidebar","previous":{"title":"Compile-time Code & Metaprogramming","permalink":"/docs/dev/language/comptime"},"next":{"title":"Bn254 Field Library","permalink":"/docs/dev/libraries/standard_library/bn254"}}');var s=r(74848),a=r(28453);const t={title:"Black Box Functions",description:"Black box functions are functions in Noir that rely on backends implementing support for specialized constraints.",keywords:["noir","black box functions"]},c=void 0,o={},l=[{value:"Function list",id:"function-list",level:2}];function d(e){const i={a:"a",code:"code",h2:"h2",li:"li",p:"p",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.p,{children:"Black box functions are functions in Noir that rely on backends implementing support for specialized constraints. This makes certain zk-snark unfriendly computations cheaper than if they were implemented in Noir."}),"\n",(0,s.jsx)(i.p,{children:"The ACVM spec defines a set of blackbox functions which backends will be expected to implement. This allows backends to use optimized implementations of these constraints if they have them, however they may also fallback to less efficient naive implementations if not."}),"\n",(0,s.jsx)(i.h2,{id:"function-list",children:"Function list"}),"\n",(0,s.jsx)(i.p,{children:"Here is a list of the current black box functions:"}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/ciphers#aes128",children:"AES128"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/hashes#sha256-compression",children:"SHA256 compression"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/hashes#blake2s",children:"Blake2s"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/hashes#blake3",children:"Blake3"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/hashes#pedersen_hash",children:"Pedersen Hash"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/hashes#pedersen_commitment",children:"Pedersen Commitment"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/signatures",children:"ECDSA signature verification"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/embedded_curve_ops",children:"Embedded curve operations (MSM, addition, ...)"})}),"\n",(0,s.jsx)(i.li,{children:"AND"}),"\n",(0,s.jsx)(i.li,{children:"XOR"}),"\n",(0,s.jsx)(i.li,{children:"RANGE"}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/cryptographic_primitives/hashes#keccakf1600",children:"Keccakf1600"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"/docs/dev/libraries/standard_library/recursion",children:"Recursive proof verification"})}),"\n"]}),"\n",(0,s.jsxs)(i.p,{children:["Most black box functions are included as part of the Noir standard library, however ",(0,s.jsx)(i.co
1de,{children:"AND"}),", ",(0,s.jsx)(i.code,{children:"XOR"})," and ",(0,s.jsx)(i.code,{children:"RANGE"})," are used as part of the Noir language syntax. For instance, using the bitwise operator ",(0,s.jsx)(i.code,{children:"&"})," will invoke the ",(0,s.jsx)(i.code,{children:"AND"})," black box function."]}),"\n",(0,s.jsxs)(i.p,{children:["You can view the black box functions defined in the ACVM code ",(0,s.jsx)(i.a,{href:"https://github.com/noir-lang/noir/blob/master/acvm-repo/acir/src/circuit/black_box_functions.rs",children:"here"}),"."]})]})}function h(e={}){const{wrapper:i}={...(0,a.R)(),...e.components};return i?(0,s.jsx)(i,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},28453(e,i,r){r.d(i,{R:()=>t,x:()=>c});var n=r(96540);const s={},a=n.createContext(s);function t(e){const i=n.useContext(a);return n.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function c(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:t(e.components),n.createElement(a.Provider,{value:i},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.