@aztec/protocol-contracts 5.0.0-nightly.20260407 → 5.0.0-nightly.20260409

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "transpiled": true,
3
- "noir_version": "1.0.0-beta.19+f4ead98d92f514ef4d30a625d7c54709b02b08d1",
3
+ "noir_version": "1.0.0-beta.19+c09ce9a7dbec1708a8b167fad7411ece61d8b9ea",
4
4
  "name": "AuthRegistry",
5
5
  "functions": [
6
6
  {
@@ -56,7 +56,7 @@
56
56
  }
57
57
  },
58
58
  "bytecode": "JwACBAEoAAABBIBHJwAABEclAAAATicCBQQDJwIGBAAfCgAFAAYARBwARkYBLQhEAi0IRQMtCEYEJQAAAHQnAgIERycCAwQAOw4AAwACLAAAQwAwZE5y4TGgKbhQRbaBgVhdKDPoSHm5cJFD4fWT8AAAACYeAgAFAB4CAAUAHgIABgEKIgZDBxYKBwgcCggJAAQqCQYIJwIGAQAKKgcGCSQCAAkAAACxJwIKBAA8BgoBCioIBQckAgAHAAAAwyUAAAH4JwIFAAIpAgAHAO9SU00rAgAIAAAAAAAAAAADAAAAAAAAAAAtCAEJJwIKBAUACAEKAScDCQQBACIJAgotCgoLLQ4HCwAiCwILLQ4FCwAiCwILLQ4CCwAiCwILLQ4ICy0IAQInAgUEBQAIAQUBJwMCBAEAIgkCBQAiAgIKPw8ABQAKJwIFBAEAKgIFCS0LCQknAgIAAAoqCQIKCioKBgskAgALAAABbiUAAAIKLQgBCicCCwQFAAgBCwEnAwoEAQAiCgILLQoLDC0OBwwAIgwCDC0OCQwAIgwCDC0OAwwAIgwCDC0OCAwtCAEDJwIHBAUACAEHAScDAwQBACIKAgcAIgMCCD8PAAcACAAqAwUHLQsHBwoqBwIDCioDBgIkAgACAAAB7CUAAAIKHAoEAgAwCgACAAcmKgEAAQXBUDSsJUi8UTwEAgEmKgEAAQW6uyHXgjMYZDwEAgEm",
59
- "debug_symb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 +112,7 @@
112
112
  }
113
113
  },
114
114
  "bytecode": "JwACBAEoAAABBIBIJwAABEglAAAASScCBAQCJwIFBAAfCgAEAAUARS0IRQItCEYDJQAAAHgtAgJHJwIDBEcnAgQEATsOAAQAAykAAEMAR9rNcywAAEQAMGROcuExoCm4UEW2gYFYXSgz6Eh5uXCRQ+H1k/AAAAAmHgIABAAeAgAEACcCBAABKQIABQDvUlNNKwIABgAAAAAAAAAAAwAAAAAAAAAALQgBBycCCAQFAAgBCAEnAwcEAQAiBwIILQoICS0OBQkAIgkCCS0OBAkAIgkCCS0OAgkAIgkCCS0OBgktCAEEJwIIBAUACAEIAScDBAQBACIHAggAIgQCCT8PAAgACScCBwQBACoEBwgtCwgIJwIEAAAKKggECScCCgEACioJCgskAgALAAABMiUAAAQjHgIACQAvKgAIAAkACxwKCwkCHAoJCAAcCggJAhwKCQsBHAoLCAIcCggJAQoqCQoIJAIACAAAAW8lAAAENR4CAAgBCiIIRAkWCgkLHAoLDAAEKgwICwoqCQoIJAIACAAAAZ0nAgwEADwGDAEeAgAIAx4CAAkEKQIADADDt7IGKwIADQAAAAAAAAAABQAAAAAAAAAALQgBDicCDwQFAAgBDwEnAw4EAQAiDgIPLQoPEC0ODBAAIhACEC0OCxAAIhACEC0OCBAAIhACEC0ODRAtCAEIJwILBAUACAELAScDCAQBACIOAgsAIggCDD8PAAsADAAqCAcLLQsLCwAqCwkMLQIIAycABAQFJQAABEctCAUJACoJBwstDgwLJwILBAIAKggLDC0LDAwAKgwDCC0CCQMnAAQEBSUAAARHLQgFAwAqAwsMLQ4IDC0IAQgnAgkEBQAIAQkBJwMIBAEAIgMCCQAiCAILPw8ACQALACoIBwMtCwMDJwIIAAItCAEJJwILBAUACAELAScDCQQBACIJAgstCgsMLQ4FDAAiDAIMLQ4IDAAiDAIMLQ4CDAAiDAIMLQ4GDC0IAQInAggEBQAIAQgBJwMCBAEAIgkCCAAiAgILPw8ACAALACoCBwgtCwgICioIBAsKKgsKDCQCAAwAAA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oOTjZxHTzb6bdl4slHC+MnGH0Zm28lGgQ882cDAZbZpvuZkA+N8pIARmwqFbnDSzaMVoch4RSh5vCKUMnzUHcINzrq7IlsPuwMMF4Wt/mJo+Utf540bLAYaf5lyg119DDfY1seQx01WbmGyG+zsY4z/m8ly22S9tzJSgmtIgXa5jrG7bwphLrW6wm6e0MbeO6akx07zwaIONbRVeqWSBZdXmHRZ5b7o1/uHx9PFP3W9mdjp8f7bYV+//ng9Pqyuvvz77Ff8n8KeT08P+++vp70pLf8Zpn8+gzoYgL/oy/poX0H0a/nyZk//Dw=="
116
116
  },
117
117
  {
118
118
  "name": "is_consumable",
@@ -165,7 +165,7 @@
165
165
  }
166
166
  },
167
167
  "bytecode": "JwACBAEoAAABBIBGJwAABEYnAgQEAicCBQQAHwoABAAFAEMtCEMCLQhEAyUAAABELQICRScCAwRFJwIEBAE7DgAEAAMeAgAEAB4CAAQAHgIABAknAgUBASQCAAQAAABlJQAAAnYnAgQAASkCAAUA71JTTSsCAAYAAAAAAAAAAAMAAAAAAAAAAC0IAQcnAggEBQAIAQgBJwMHBAEAIgcCCC0KCAktDgUJACIJAgktDgQJACIJAgktDgIJACIJAgktDgYJLQgBBCcCCAQFAAgBCAEnAwQEAQAiBwIIACIEAgk/DwAIAAknAgcEAQAqBAcILQsICCcCBAAACioIBAknAgoBAAoqCQoLJAIACwAAARUlAAACiB4CAAkALyoACAAJAAscCgsJAhwKCQgAHAoICQIcCgkLARwKCwgCHAoICQEWCgkIJwIJAAItCAELJwIMBAUACAEMAScDCwQBACILAgwtCgwNLQ4FDQAiDQINLQ4JDQAiDQINLQ4CDQAiDQINLQ4GDS0IAQInAgkEBQAIAQkBJwMCBAEAIgsCCQAiAgIMPw8ACQAMACoCBwktCwkJCioJBAIKKgIKCyQCAAsAAAHHJQAAAogtCAECJwILBAUACAELAScDAgQBACICAgstCgsMLQ4FDAAiDAIMLQ4JDAAiDAIMLQ4DDAAiDAIMLQ4GDC0IAQMnAgUEBQAIAQUBJw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xpeo4sC4BiDYVgDxPxZci6A4zwd84EwAxTsNwWJ2J1JBwOXvTkFdIqI0j1zW8S1gkvHexfyRcHUlDgtJkb0owrwfdBsQ3rCmdxgZCfrEkwflbDWgsarKIQp69CYlvFRrmzHNOM+C8IPLmuNVo2DM7bemjhsuursGtkJgELFImL9ZbhdiYCx+zOdyn+HcaAaa0h4h1jdxaV57WVddycldaXYYs5jQbkph6GS17uZzmMqhqr9DQQFmLooG41PD4V0EhVwtKaFiU/ZR4ls1ctYrQsCgE1skapzQwQPVd0vKol4hM7StT/YUU7/FWS73NvD2WlPI8lsVr6UsZ0GqkNKeWWoW0V8YtVgZTtZDQsohNKcOih+U/sCnHyaY512wK2N/PgXr7OXB/P4fY388h9fZzyP39vKmxsp+j7+7nrTLW9vOmvVb2c2zuRPPkL1rsnb5qrAxK9lwLCnJ/UDD2BgVTf1Aw9weFXG9QyPcHpamxMigE3UFplbE2KE17rQwK8TdvfBZBAaoFhVL/xofyHTY+7O6w8eF7/DvP3f/Pt8eycuPD2L/x+Z+VWbfxYf7WjY/D2abxxqY/5df2eX+6+Vp8Va3Tfvt02JWfr5fj8+Ls+d93O2Nfm99Pb8+7l8tpp0rzJ2cvX71+eNml+pB+XvV5/wE="
169
169
  },
170
170
  {
171
171
  "name": "is_reject_all",
@@ -211,7 +211,7 @@
211
211
  }
212
212
  },
213
213
  "bytecode": "JwACBAEoAAABBIBFJwAABEUnAgMEAScCBAQAHwoAAwAEAEMtCEMCJQAAAEAtAgJEJwIDBEQnAgQEATsOAAQAAx4CAAMAHgIAAwAeAgADCScCBAEBJAIAAwAAAGElAAABQSkCAAMA71JTTScCBAABKwIABQAAAAAAAAAAAwAAAAAAAAAALQgBBicCBwQFAAgBBwEnAwYEAQAiBgIHLQoHCC0OAwgAIggCCC0OBAgAIggCCC0OAggAIggCCC0OBQgtCAECJwIDBAUACAEDAScDAgQBACIGAgMAIgICBD8PAAMABCcCAwQBACoCAwQtCwQEJwICAAAKKgQCAycCAgEACioDAg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2bX88farN203thrbr2o9td9rXl/bUs/WmdPpyRm2oUi6qja+U5yvQvPIlQKWCea4Rx9XzGioF2o0CYBSEImTLyJYRixWLFYvTIoyIOApPIsIogvxFEDciA1EnYZ8CtRYhFhALiAXFguwGclhIIEIsJv2GkrCjsGKxYnFicWEUyWeMSbCFEicwkNJWcvUpRgtpECEWeFju90pJobaXoWlSnRaV43qe66HpL2rTX7uuUn/q7vr40ee57h/rpR54l0Ns+gOvDDy2XZPUvZrv1vlbkbQd70ZCOwEA7AoBBYQ22gtDG4QJ4sKKgQWGD0KIZnbC45fjcMEJwYeQjcPkEWSMpIKMm1Px4oT9hUy4/5gJIu+nMLTJZiIUEDpGEAZowFwcMc8AHcyIAND+55G4bCQFhLVpSh8Iy58JYdcDAoXWtGAkEAuLkqCGNYMKRQ0yohTn3qTg1oRCc8Z5TiOZuSBkac0otGfUhoSho84zXGlIBEGLKUNn1gRfyAV4KQnyAf89Bp/fwkBv8oxYqqub6ppqOXVX+LIbXMwpGzwxeTdK7aVjmN2w2fbCAsNwLUaGMUsGmG8NyiKjL4OChRZ1ME28Qx2zXmChRQldStYzpej4GZl7lpR6FHhEpuMr2vwDyf/GUy389DAvxxJCnGNZPJZe3KDSQWrnqbUlR8qV0YvKmJB1BEstIil1tDjD2KX7O1/W+3ZYvbreE2po613XjJfHa79f7F7+nmVHXn3Pw2nfHK5Dk0jz+2965XpzVDn7fk//9g8="
215
215
  },
216
216
  {
217
217
  "name": "set_authorized",
@@ -245,7 +245,7 @@
245
245
  }
246
246
  },
247
247
  "bytecode": "JwACBAEoAAABBIBGJwAABEYlAAAASicCBAQCJwIFBAAfCgAEAAUARBwARUUBLQhEAi0IRQMlAAAAcCcCAgRGJwIDBAA7DgADAAIsAABDADBkTnLhMaApuFBFtoGBWF0oM+hIeblwkUPh9ZPwAAAAJh4CAAQAHgIABAAeAgAEAQoiBEMFFgoFBhwKBgcABCoHBAYnAgQBAAoqBQQHJAIABwAAAK0nAggEADwGCAEnAgUAAikCA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meLEVTWwmUyToNlSgzq7C4XWmglRxmSm+D0NpHHJw8h1DWrNaxjnNc/l2GXpbhs6mWM1RKBqoxkvJ2my4avxwtBcLsZ8eRerGvc2ymxmvzQKpscbBeXRRiH3eKMQPN4ohI82CtHjjdLUuLNRyD/cKC0b9zZKM153Ngq13kg6F/ZG4rkG8HcahV21UbghEcVZNaKgVF1wa+lhN77gFfvq9xZja2b9WNFZt8lf2XA82ah/7XDr65N0J2Mi2jdYFWmkVD/9RiMR/PKj6af+3bxsh8Um+JLFhu3medeXv2/n/cts9PT7aCO2iT4Oh5f+9Tz0WWm+k9Yti0ZL3M9Lvtsf"
249
249
  },
250
250
  {
251
251
  "name": "set_authorized_private",
@@ -2068,7 +2068,7 @@
2068
2068
  }
2069
2069
  },
2070
2070
  "bytecode": "H4sIAAAAAAAA/+2dd2BURdfGc86EFkApKnYiSFGxgL0DSYCoFMHe4possBKSuNkgYI29mwRQEBGVKooVUewFQWUeQQGVoth7wd71uyFlN2WT2WSf1/Lx/vNed+/9nblzZ+bOnNn8MCXFN6/pkZHhGx/yZ2bkBDMCOSF/MMeXnZ+Rke8PZfgKQiNzg4Hx/qyMvGBgjC/kh9mw3iwpvL9vti9zVN/csf0KcjJTfNnZhbOG9hnUP62kcM6JgVCOPz9fkx1OMuJwUlsXUvveDidtYy92OKuD01k7upRqJ5eTdnY5qaPLSclOJd/F6axOTmd1djprV5fCd5PCu/sGA9nZgRGl309MKCqaUFS0ODmh7v9J4bw++fn+YOgUfzB3QlFxyeLkfbIGBd/teftujw5JW1hYeNLp3ff9ZMC4RXnFKe/+MGGjdwnMDXVjV+/5/qiGYG+Mik2sOKilIhYMyc33B7Jyc3oN8QdHF4R8oUBuTsnEyorxilt53KXyqGvE9zdOhCmCKYYpgZlQteQTSuqvwm4O53gRnOpgYr2ohtVB5HFxxHFJxPEErx4mwdwEczPM5Kr1UOJwj7s63eEUhzZZf3P3OMmxl7C9UwlvqQckx17sVMJbelftklJcOHtYIGdEtr+sR9RXW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P/fx5PfdLGFW7bphfwjUQvo7TENF1V55W9UeRlE5PB5N1JgDQGwpoUChWVjgUI2QS4zYc2OCwThg8FxEWvz0P44wwWOeq8+A6BTGLFcSmWPFFhP4PTpjfdMJC7qilEgm9zYSrMzCgeMmgq0b4hgbQcRu5iQgbhakZAarVDy/tMHUn2ioYigpPVRWNZDKq4oUvbt5l5moeX6YBjWD63FCPJdkMP1gbOVMWuJYIaKRSA3Oi0LDKJaqtCrANGU6cJF+mQc5sGRpe+rJZeWIsHJq2HI1QeMWSTK+8qnJgM5lCQautBg1vGVp7Jlifk+nsfRzhYygcaLnOQa2+mtzX2Mu8yty3ZYRmZje8h6qMZryUd0WGrsYLGxxMOeXMaw7guxYK+dpCwUZErVfihvXoqyrQt+Kl8r4VsK5+Rki1Oquzo6vV5n8kQ3GRUd/EqbF9EpGVlFJYN1glaaSUjM1Cwtdt+y14DLf9YVw2J95rJFvG/nka0u3rZT6sRs9/TzIiJ+bTcjwML5dliEyrY3M4aD4Y2Bl6vMa3/QM="
2100
2100
  },
2101
2101
  {
2102
2102
  "name": "utility_is_consumable",
@@ -2152,7 +2152,7 @@
2152
2152
  }
2153
2153
  },
2154
2154
  "bytecode": "H4sIAAAAAAAA/+1bTWwbRRS298e7ttP/NpuSNIkToEic0iLotU0aktK0VX+4mm2yBAvHDmu7ajhhTkhwsNNW3EkaitoihOBCJQ4IOEAjcUFQqRckbiD1ghBCHFg3tvftzL7ZnfW4P2p62vrNfO/Nm2/evHkzkZfrH955Pps13y5bs9mCnc0VypZdMPOlbLZSzuVz5aVsrpSdLRZKlQXzfN6S6tXrR+xcPp+bHzfz+cux5eramVxhPm9dqtWXvx2Osf/FY4FNYnyA8WDAegNxYdEx/lKtFoy4HIvX6pKjnMsxdyW1enXc+W/5UnVtImdbs2Wp+vG002veslfOHTwQrJjsH+fq/84Jsn+MT/+J6mpjSutb2zjXTlt5s5y7YCl8SBKNoPIhxKo3GrbMmWVzvLi41B7SK9AmAL4yU7yw7P4gue0Jid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lH5m3e9o+gxscbSz3ewjjr3XQpM5mgt5xpY8uZbJPS0ckSulj/Omg2ZrIGFL6U9NzgzxA7O0rLOUeXOW0mSWSvI7Kv3Bxeae8h+O5A650rFzf6R6fH+kdnR/nK4+gvVLcttcfXg2Q/3IVeK2YdqH6jez5O0+zLbGJsm3xrjuBiSXd4Jn83M9d/UD51nGh8vDH/PsbgYf0rxtmKyhxbe1GuqmYb6rhXVXO8vVd1sS19n+jLWvnC1b72/mbINP64rTH9tubfAsx4/BORw9B+d4PNFzOp7omY4meubjB+GpY+dBOJfDB+FZN/YehKfTa+dJOMtsUDzde91YNx17E+Vs0XmXKCUeT5SSjiZKoeOJUvh4opR8NFFKOZ4oU8fORCntcKLMurE3UabTa2ei1Ph7S8bzRKmy+VyFjpeMlQ+XjDUfLhlrOVoy1nq8ZKzteMlY5XiJ1MLx8qbFo+XN/I7uK28aHS9v/sOxq7xp/8Ni3srxxbzVo4v5NFN2lTdNjpY30z7sKm8kHi9vJB0vb4SOljfCR8ub+Qq8q7yR8jvLm8jNN6OzPM27v7DJkrFaZDkbDdovaNUFZ6e+Dwh8WnbXFYIS1swIqV4jWJ8Ch3xVD7IPQyjX9SCtPcgfF/RFH4L+NRdtLlGzGjXk5PvG2frwEUWm7LsXX9eLzNUVRa5SFD8O9E/F6xTsF1LqVQqStB55y7Yizr5p2Xn0DsdP3tOJ0fxmBLluVMcv1lgpE6/shdRVka7rxXq4itSuU/iCm843r48p0qq47l7srAynivV29lt7pSK6Il53L/Z+oZmu/EbzU3919/Xh+eJPJt7U9fxw9+Xx3l5+f336evbTl39+4if4k4ufzz++3n97fb5X0/p3F/2fP1jyTY70SX/pvL/sj0H6y/LpTaP/Cw=="
2156
2156
  },
2157
2157
  {
2158
2158
  "name": "offchain_receive",
@@ -2290,7 +2290,7 @@
2290
2290
  }
2291
2291
  },
2292
2292
  "bytecode": "H4sIAAAAAAAA/+2dd3xUxRbHk9300El200xBwV6QYlcggIIgSoioqLgmS1gJSUg2SECEFb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e/FZVwXcbabU+0KPtlBJNSPjll9pn5DTtqeEJ0fBfftWGKgcRST6iSucFAkGscxccSS4Yh2Uh3HkWf1Gar2AqXT2XxaJ3FSHFH6hph0PJfz4+AwjkNnvUfCsflIiGPLNJYo1GOJqQwtMqmSmI8nRxnmZGo4K6sy6aNSezsX+1wwnsfEwRHz4MQXRcG1d9GaL6qOcytdJjVqD976nmIreJyL+gfyWa/OZ/2b+Tw3F4mvz8XMcV4upoarc2HBlz6PEi7qGGfnovxdx5n5LFfnc7Y7xv7pSOJkrWb6A7vj7LRREEaSMD5PT7PZTxss4bJTk1A/T6eTw/AnRU7XnpryrHtqwGqPyjysrDyrzlBwmpagdKEjp+4o410167UVPs3nWXUxfYzRzxg50fiTc5m0LfuiBXfVvmGJg4/vU0Pl/jDFnhheZCjHD0jlkkcISWJPhIw/e//PiY2Oj8eE06XnvlOLjGu81Ot3xaLXd/FydY1PDeMu/s1+Xd9vDx++An1z1WG7/rHbtF8fXvb3J/99/vcJ/8FXqE+Hx/vNz5fDxk3H71Htx121J+VV+dvNyp4l32VrkJmL/eZfBdxV1RtrSN/ePJb/AA=="
2294
2294
  },
2295
2295
  {
2296
2296
  "name": "public_dispatch",
@@ -2346,7 +2346,7 @@
2346
2346
  }
2347
2347
  },
2348
2348
  "bytecode": "JwACBAEoAAABBIBHJwAABEclAAAAQScCAwQBJwIEBAAfCgADAAQARi0IRgIlAAAAdScCAgRHJwIDBAA7DgADAAIpAABDAEfazXMsAABEADBkTnLhMaApuFBFtoGBWF0oM+hIeblwkUPh9ZPwAAAAJwBFBAMmKQIAAwC4Od6RCioCAwQnAgUEACcCBwQDACoFBwYtCAEDAAgBBgEnAwMEAQAiAwIGLQ4FBgAiBgIGLQ4FBicCBgQDACoDBgUnAgUEAScCBgQCJwIHBAAnAggAACcCCQEAJwIKAAIpAgALAO9SU00rAgAMAAAAAAAAAAADAAAAAAAAAAAkAgAEAAABBSMAAAKqLQgBBCcCDQQDAAgBDQEnAwQEAQAiBAINH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WvDv53F1dvj4ViGx2YoiL7iwMNgaLbMYY2g3dqa9zrwrMDamUchqxgnzHi6j5+puo+YaIFZQbIlZQLkesoNwQsVoXsntSlOsRq2VDtk+KfMMbqbBKXd1yUhwXTTt9PhpWyZ7d1Aas3v3ZTm1AjTekNqDe8dcnoF7+8xMvdGcztSHn/dXUxkvzs5fagFWCZC+1sYoX+ajmo2fzt3jRKnXV7Gk6jPUQDXj+BwtWe2ubg0GH/MrzIpYrD22LL5ji6cprd0QD2vVoQLsjGtDuiAa069GAdkc0oN0RDWg3RAPaHdGAdkc0YJVzuuW4Oi6a8yc/AfMNx9XyJavt42qVuto/rpa5q+3javmu1d5xte7O7nG1zF7tHlcvzM/mcUXwlpn4gvY3kwrS6UuSQHeEr+h6+IruCF/RHeEruh6+ojvCV3RD+CqFG8JXdEf4im4IX6Xle0p3xHwPi4bi6fNWKdzwVEAKl58KSOGGpwJSuOGpgBQvPxWQ4g1PBawL2V008fpTASne8BD62s52F80qh3WPa3RYNOdvw6WI112jtMphbbtGafX39bZdo7R8+2rXNUqrPNaea/RCdzZdo7RKMOy6Ri/Nz55rlKC+rWtkEflusKfp8NWr0ynZ2kutnAYD0jIFFXxLO/zd1j6gP/ZPH375+OXJ/1D7nUv68vHDz58e9eNv3z7/cvjp1//9MX8y/4fbP778/svjr9++PHJJ/t/c9n9+wO4ZYKQf3z0k/pTgHWbon/jvav+A3aIQ4Mfv3Jb/Aw=="
2350
2350
  },
2351
2351
  {
2352
2352
  "name": "sync_state",
@@ -2483,7 +2483,7 @@
2483
2483
  }
2484
2484
  },
2485
2485
  "bytecode": "H4sIAAAAAAAA/+09aYAdRZkz75h33+fMe3Mn4TJAAoSAqIRwS0JMghAUkyGZHBBmMkcgASUnISaTzExOLkWBQFwFXQXFGy90leei6y6KsCviep94LN47gff6VXfV91VXv+qZbqbzqzP96quvv7u++uor977Rw/8ysLFn+dKBwa7B7rrRLR88r3/N2rVrVs3tWrv2wNj/H1y0pmfV2u79I6P7vtxWh/+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2487
  }
2488
2488
  ],
2489
2489
  "outputs": {
@@ -3003,59 +3003,7 @@
3003
3003
  "path": "std/aes128.nr",
3004
3004
  "source": "// docs:start:aes128\n/// Given a plaintext as an array of bytes, returns the corresponding aes128 ciphertext (CBC mode). Input padding is performed using PKCS#7, so that the output length is `input.len() + (16 - input.len() % 16)`.\npub fn aes128_encrypt<let N: u32>(\n input: [u8; N],\n iv: [u8; 16],\n key: [u8; 16],\n) -> [u8; N + 16 - N % 16] {\n let padding_length = (16 - N % 16) as u8;\n let mut padded_input: [u8; N + 16 - N % 16] = [0; N + 16 - N % 16];\n for i in 0..N {\n padded_input[i] = input[i];\n }\n for i in N..N + 16 - N % 16 {\n padded_input[i] = padding_length;\n }\n let output = aes128_encrypt_padded_input(padded_input, iv, key);\n output\n}\n\n#[foreign(aes128_encrypt)]\nfn aes128_encrypt_padded_input<let N: u32>(input: [u8; N], iv: [u8; 16], key: [u8; 16]) -> [u8; N] {}\n\n// docs:end:aes128\n"
3005
3005
  },
3006
- "100": {
3007
- "function_locations": [
3008
- {
3009
- "name": "generate_contract_library_methods_compute_note_hash_and_nullifier",
3010
- "start": 534
3011
- },
3012
- {
3013
- "name": "generate_contract_library_method_compute_note_hash",
3014
- "start": 2449
3015
- },
3016
- {
3017
- "name": "generate_contract_library_method_compute_note_nullifier",
3018
- "start": 7674
3019
- }
3020
- ],
3021
- "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec/compute_note_hash_and_nullifier.nr",
3022
- "source": "use crate::logging;\nuse crate::macros::{notes::NOTES, utils::get_trait_impl_method};\n\n/// Generates two contract library methods called `_compute_note_hash` and `_compute_note_nullifier`, plus a\n/// (deprecated) wrapper called `_compute_note_hash_and_nullifier`, which are used for note discovery (i.e. these are\n/// of the `aztec::messages::discovery::ComputeNoteHash` and `aztec::messages::discovery::ComputeNoteNullifier` types).\npub(crate) comptime fn generate_contract_library_methods_compute_note_hash_and_nullifier() -> Quoted {\n let compute_note_hash = generate_contract_library_method_compute_note_hash();\n let compute_note_nullifier = generate_contract_library_method_compute_note_nullifier();\n\n quote {\n $compute_note_hash\n $compute_note_nullifier\n\n /// Unpacks an array into a note corresponding to `note_type_id` and then computes its note hash (non-siloed) and inner nullifier (non-siloed) assuming the note has been inserted into the note hash tree with `note_nonce`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n #[allow(dead_code)]\n unconstrained fn _compute_note_hash_and_nullifier(\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n contract_address: aztec::protocol::address::AztecAddress,\n randomness: Field,\n note_nonce: Field,\n ) -> Option<aztec::messages::discovery::NoteHashAndNullifier> {\n _compute_note_hash(packed_note, owner, storage_slot, note_type_id, contract_address, randomness).map(|note_hash| {\n\n let siloed_note_hash = aztec::protocol::hash::compute_siloed_note_hash(contract_address, note_hash);\n let unique_note_hash = aztec::protocol::hash::compute_unique_note_hash(note_nonce, siloed_note_hash);\n \n let inner_nullifier = _compute_note_nullifier(unique_note_hash, packed_note, owner, storage_slot, note_type_id, contract_address, randomness);\n\n aztec::messages::discovery::NoteHashAndNullifier {\n note_hash,\n inner_nullifier,\n }\n })\n }\n }\n}\n\ncomptime fn generate_contract_library_method_compute_note_hash() -> Quoted {\n if NOTES.len() == 0 {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n /// This contract does not use private notes, so this function should never be called as it will unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash(\n _packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n _owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n panic(f\"This contract does not use private notes\")\n }\n }\n } else {\n // Contracts that do define notes produce an if-else chain where `note_type_id` is matched against the\n // `get_note_type_id()` function of each note type that we know of, in order to identify the note type. Once we\n // know it we call the correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the note hash (non-siloed).\n\n // We resolve the log format calls here so that the resulting Quoted values can be spliced into the quote\n // block below.\n let warn_length_mismatch = logging::aztecnr_warn_log_format(\n \"Packed note length mismatch for note type id {0}: expected {1} fields, got {2}. Skipping note.\",\n );\n let warn_unknown_note_type = logging::aztecnr_warn_log_format(\"Unknown note type id {0}. Skipping note.\");\n\n let mut if_note_type_id_match_statements_list = @[];\n for i in 0..NOTES.len() {\n let typ = NOTES.get(i);\n\n let get_note_type_id = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteType },\n quote { get_id },\n );\n let unpack = get_trait_impl_method(\n typ,\n quote { crate::protocol::traits::Packable },\n quote { unpack },\n );\n\n let compute_note_hash = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_note_hash },\n );\n\n let if_or_else_if = if i == 0 {\n quote { if }\n } else {\n quote { else if }\n };\n\n if_note_type_id_match_statements_list = if_note_type_id_match_statements_list.push_back(\n quote {\n $if_or_else_if note_type_id == $get_note_type_id() {\n // As an extra safety check we make sure that the packed_note BoundedVec has the expected\n // length, since we're about to interpret its raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = <$typ as $crate::protocol::traits::Packable>::N;\n let actual_len = packed_note.len();\n if actual_len != expected_len {\n $warn_length_mismatch([note_type_id, expected_len as Field, actual_len as Field]);\n Option::none()\n } else {\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n Option::some($compute_note_hash(note, owner, storage_slot, randomness))\n }\n }\n },\n );\n }\n\n let if_note_type_id_match_statements = if_note_type_id_match_statements_list.join(quote {});\n\n quote {\n /// Unpacks an array into a note corresponding to `note_type_id` and then computes its note hash (non-siloed).\n ///\n /// The signature of this function notably matches the `aztec::messages::discovery::ComputeNoteHash` type, and so it can be used to call functions from that module such as `do_sync_state` and `attempt_note_discovery`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash(\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n randomness: Field,\n ) -> Option<Field> {\n $if_note_type_id_match_statements\n else {\n $warn_unknown_note_type([note_type_id]);\n Option::none()\n }\n }\n }\n }\n}\n\ncomptime fn generate_contract_library_method_compute_note_nullifier() -> Quoted {\n if NOTES.len() == 0 {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n /// This contract does not use private notes, so this function should never be called as it will unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_nullifier(\n _unique_note_hash: Field,\n _packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n _owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n panic(f\"This contract does not use private notes\")\n }\n }\n } else {\n // Contracts that do define notes produce an if-else chain where `note_type_id` is matched against the\n // `get_note_type_id()` function of each note type that we know of, in order to identify the note type. Once we\n // know it we call the correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the inner nullifier (non-siloed).\n\n // We resolve the log format calls here so that the resulting Quoted values can be spliced into the quote\n // block below.\n let warn_length_mismatch = logging::aztecnr_warn_log_format(\n \"Packed note length mismatch for note type id {0}: expected {1} fields, got {2}. Skipping note.\",\n );\n let warn_unknown_note_type = logging::aztecnr_warn_log_format(\"Unknown note type id {0}. Skipping note.\");\n\n let mut if_note_type_id_match_statements_list = @[];\n for i in 0..NOTES.len() {\n let typ = NOTES.get(i);\n\n let get_note_type_id = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteType },\n quote { get_id },\n );\n let unpack = get_trait_impl_method(\n typ,\n quote { crate::protocol::traits::Packable },\n quote { unpack },\n );\n\n let compute_nullifier_unconstrained = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_nullifier_unconstrained },\n );\n\n let if_or_else_if = if i == 0 {\n quote { if }\n } else {\n quote { else if }\n };\n\n if_note_type_id_match_statements_list = if_note_type_id_match_statements_list.push_back(\n quote {\n $if_or_else_if note_type_id == $get_note_type_id() {\n // As an extra safety check we make sure that the packed_note BoundedVec has the expected\n // length, since we're about to interpret its raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = <$typ as $crate::protocol::traits::Packable>::N;\n let actual_len = packed_note.len();\n if actual_len != expected_len {\n $warn_length_mismatch([note_type_id, expected_len as Field, actual_len as Field]);\n Option::none()\n } else {\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n // The message discovery process finds settled notes, that is, notes that were created in\n // prior transactions and are therefore already part of the note hash tree. The note hash\n // for nullification is hence the unique note hash.\n $compute_nullifier_unconstrained(note, owner, unique_note_hash)\n }\n }\n },\n );\n }\n\n let if_note_type_id_match_statements = if_note_type_id_match_statements_list.join(quote {});\n\n quote {\n /// Computes a note's inner nullifier (non-siloed) given its unique note hash, preimage and extra data.\n ///\n /// The signature of this function notably matches the `aztec::messages::discovery::ComputeNoteNullifier` type, and so it can be used to call functions from that module such as `do_sync_state` and `attempt_note_discovery`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_nullifier(\n unique_note_hash: Field,\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n $if_note_type_id_match_statements\n else {\n $warn_unknown_note_type([note_type_id]);\n Option::none()\n }\n }\n }\n }\n}\n"
3023
- },
3024
3006
  "101": {
3025
- "function_locations": [
3026
- {
3027
- "name": "AztecConfig::new",
3028
- "start": 1648
3029
- },
3030
- {
3031
- "name": "AztecConfig::custom_message_handler",
3032
- "start": 2156
3033
- },
3034
- {
3035
- "name": "aztec",
3036
- "start": 3050
3037
- },
3038
- {
3039
- "name": "generate_contract_interface",
3040
- "start": 6527
3041
- },
3042
- {
3043
- "name": "generate_sync_state",
3044
- "start": 8389
3045
- },
3046
- {
3047
- "name": "generate_offchain_receive",
3048
- "start": 9443
3049
- },
3050
- {
3051
- "name": "check_each_fn_macroified",
3052
- "start": 11087
3053
- }
3054
- ],
3055
- "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec.nr",
3056
- "source": "mod compute_note_hash_and_nullifier;\n\nuse crate::{\n macros::{\n calls_generation::{\n external_functions::{generate_external_function_calls, generate_external_function_self_calls_structs},\n internal_functions::generate_call_internal_struct,\n },\n dispatch::generate_public_dispatch,\n emit_public_init_nullifier::generate_emit_public_init_nullifier,\n internals_functions_generation::{create_fn_abi_exports, process_functions},\n storage::STORAGE_LAYOUT_NAME,\n utils::{is_fn_contract_library_method, is_fn_external, is_fn_internal, is_fn_test, module_has_storage},\n },\n messages::discovery::CustomMessageHandler,\n};\n\nuse compute_note_hash_and_nullifier::generate_contract_library_methods_compute_note_hash_and_nullifier;\n\n/// Configuration for the [`aztec`] macro.\n///\n/// This type lets users override different parts of the default aztec-nr contract behavior, such\n/// as message handling. These are advanced features that require careful understanding of\n/// the behavior of these systems.\n///\n/// ## Examples\n///\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyContract { ... }\n/// ```\npub struct AztecConfig {\n custom_message_handler: Option<CustomMessageHandler<()>>,\n}\n\nimpl AztecConfig {\n /// Creates a new `AztecConfig` with default values.\n ///\n /// Calling `new` is equivalent to invoking the [`aztec`] macro with no parameters. The different methods\n /// (e.g. [`AztecConfig::custom_message_handler`]) can then be used to change the default behavior.\n pub comptime fn new() -> Self {\n Self { custom_message_handler: Option::none() }\n }\n\n /// Sets a handler for custom messages.\n ///\n /// This enables contracts to process non-standard messages (i.e. any with a message type that is not in\n /// [`crate::messages::msg_type`]).\n ///\n /// `handler` must be a function that conforms to the\n /// [`crate::messages::discovery::CustomMessageHandler`] type signature.\n pub comptime fn custom_message_handler(_self: Self, handler: CustomMessageHandler<()>) -> Self {\n Self { custom_message_handler: Option::some(handler) }\n }\n}\n\n/// Enables aztec-nr features on a `contract`.\n///\n/// All aztec-nr contracts should have this macro invoked on them, as it is the one that processes all contract\n/// functions, notes, storage, generates interfaces for external calls, and creates the message processing\n/// boilerplate.\n///\n/// ## Examples\n///\n/// Most contracts can simply invoke the macro with no parameters, resulting in default aztec-nr behavior:\n/// ```noir\n/// #[aztec]\n/// contract MyContract { ... }\n/// ```\n///\n/// Advanced contracts can use [`AztecConfig`] to customize parts of its behavior, such as message\n/// processing.\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyAdvancedContract { ... }\n/// ```\n#[varargs]\npub comptime fn aztec(m: Module, args: [AztecConfig]) -> Quoted {\n let num_args = args.len();\n let config = if num_args == 0 {\n AztecConfig::new()\n } else if num_args == 1 {\n args[0]\n } else {\n panic(f\"#[aztec] expects 0 or 1 arguments, got {num_args}\")\n };\n\n // Functions that don't have #[external(...)], #[contract_library_method], or #[test] are not allowed in contracts.\n check_each_fn_macroified(m);\n\n // We generate new functions prefixed with `__aztec_nr_internals__` and we replace the original functions' bodies\n // with `static_assert(false, ...)` to prevent them from being called directly from within the contract.\n let functions = process_functions(m);\n\n // We generate structs and their implementations necessary for convenient functions calls.\n let interface = generate_contract_interface(m);\n let self_call_structs = generate_external_function_self_calls_structs(m);\n let call_internal_struct = generate_call_internal_struct(m);\n\n // We generate ABI exports for all the external functions in the contract.\n let fn_abi_exports = create_fn_abi_exports(m);\n\n // We generate `_compute_note_hash`, `_compute_note_nullifier` (and the deprecated\n // `_compute_note_hash_and_nullifier` wrapper) and `sync_state` functions only if they are not already implemented.\n // If they are implemented we just insert empty quotes.\n let contract_library_method_compute_note_hash_and_nullifier = if !m.functions().any(|f| {\n // Note that we don't test for `_compute_note_hash` or `_compute_note_nullifier` in order to make this simpler\n // - users must either implement all three or none.\n // Down the line we'll remove this check and use `AztecConfig`.\n f.name() == quote { _compute_note_hash_and_nullifier }\n }) {\n generate_contract_library_methods_compute_note_hash_and_nullifier()\n } else {\n quote {}\n };\n let process_custom_message_option = if config.custom_message_handler.is_some() {\n let handler = config.custom_message_handler.unwrap();\n quote { Option::some($handler) }\n } else {\n quote { Option::<aztec::messages::discovery::CustomMessageHandler<()>>::none() }\n };\n\n let offchain_inbox_sync_option = quote {\n Option::some(aztec::messages::processing::offchain::sync_inbox)\n };\n\n let sync_state_fn_and_abi_export = if !m.functions().any(|f| f.name() == quote { sync_state }) {\n generate_sync_state(process_custom_message_option, offchain_inbox_sync_option)\n } else {\n quote {}\n };\n\n if m.functions().any(|f| f.name() == quote { offchain_receive }) {\n panic(\n \"User-defined 'offchain_receive' is not allowed. The function is auto-injected by the #[aztec] macro. See https://docs.aztec.network/errors/7\",\n );\n }\n let offchain_receive_fn_and_abi_export = generate_offchain_receive();\n\n let (has_public_init_nullifier_fn, emit_public_init_nullifier_fn_body) = generate_emit_public_init_nullifier(m);\n let public_dispatch = generate_public_dispatch(m, has_public_init_nullifier_fn);\n\n quote {\n $interface\n $self_call_structs\n $call_internal_struct\n $functions\n $fn_abi_exports\n $contract_library_method_compute_note_hash_and_nullifier\n $public_dispatch\n $sync_state_fn_and_abi_export\n $emit_public_init_nullifier_fn_body\n $offchain_receive_fn_and_abi_export\n }\n}\n\ncomptime fn generate_contract_interface(m: Module) -> Quoted {\n let calls = generate_external_function_calls(m);\n\n let module_name = m.name();\n\n let has_storage_layout = module_has_storage(m) & STORAGE_LAYOUT_NAME.get(m).is_some();\n let storage_layout_getter = if has_storage_layout {\n let storage_layout_name = STORAGE_LAYOUT_NAME.get(m).unwrap();\n quote {\n pub fn storage_layout() -> StorageLayoutFields {\n $storage_layout_name.fields\n }\n }\n } else {\n quote {}\n };\n\n let library_storage_layout_getter = if has_storage_layout {\n quote {\n #[contract_library_method]\n $storage_layout_getter\n }\n } else {\n quote {}\n };\n\n quote {\n pub struct $module_name {\n pub target_contract: aztec::protocol::address::AztecAddress\n }\n\n impl $module_name {\n $calls\n\n pub fn at(\n addr: aztec::protocol::address::AztecAddress\n ) -> Self {\n Self { target_contract: addr }\n }\n\n pub fn interface() -> Self {\n Self { target_contract: aztec::protocol::address::AztecAddress::zero() }\n }\n\n $storage_layout_getter\n }\n\n #[contract_library_method]\n pub fn at(\n addr: aztec::protocol::address::AztecAddress\n ) -> $module_name {\n $module_name { target_contract: addr }\n }\n\n #[contract_library_method]\n pub fn interface() -> $module_name {\n $module_name { target_contract: aztec::protocol::address::AztecAddress::zero() }\n }\n\n $library_storage_layout_getter\n\n }\n}\n\n/// Generates the `sync_state` utility function that performs message discovery.\ncomptime fn generate_sync_state(process_custom_message_option: Quoted, offchain_inbox_sync_option: Quoted) -> Quoted {\n quote {\n pub struct sync_state_parameters {\n pub scope: aztec::protocol::address::AztecAddress,\n }\n\n #[abi(functions)]\n pub struct sync_state_abi {\n parameters: sync_state_parameters,\n }\n\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn sync_state(scope: aztec::protocol::address::AztecAddress) {\n let address = aztec::context::UtilityContext::new().this_address();\n aztec::messages::discovery::do_sync_state(\n address,\n _compute_note_hash,\n _compute_note_nullifier,\n $process_custom_message_option,\n $offchain_inbox_sync_option,\n scope,\n );\n }\n }\n}\n\n/// Generates an `offchain_receive` utility function that lets callers add messages to the offchain message inbox.\n///\n/// For more details, see `aztec::messages::processing::offchain::receive`.\ncomptime fn generate_offchain_receive() -> Quoted {\n quote {\n pub struct offchain_receive_parameters {\n pub messages: BoundedVec<\n aztec::messages::processing::offchain::OffchainMessage,\n aztec::messages::processing::offchain::MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL,\n >,\n }\n\n #[abi(functions)]\n pub struct offchain_receive_abi {\n parameters: offchain_receive_parameters,\n }\n\n /// Receives offchain messages into this contract's offchain inbox for subsequent processing.\n ///\n /// Each message is routed to the inbox scoped to its `recipient` field.\n ///\n /// For more details, see `aztec::messages::processing::offchain::receive`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn offchain_receive(\n messages: BoundedVec<\n aztec::messages::processing::offchain::OffchainMessage,\n aztec::messages::processing::offchain::MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL,\n >,\n ) {\n let address = aztec::context::UtilityContext::new().this_address();\n aztec::messages::processing::offchain::receive(address, messages);\n }\n }\n}\n\n/// Checks that all functions in the module have a context macro applied.\n///\n/// Non-macroified functions are not allowed in contracts. They must all be one of\n/// [`crate::macros::functions::external`], [`crate::macros::functions::internal`] or `test`.\ncomptime fn check_each_fn_macroified(m: Module) {\n for f in m.functions() {\n let name = f.name();\n if !is_fn_external(f) & !is_fn_contract_library_method(f) & !is_fn_internal(f) & !is_fn_test(f) {\n // We don't suggest that #[contract_library_method] is allowed because we don't want to introduce another\n // concept\n panic(\n f\"Function {name} must be marked as either #[external(...)], #[internal(...)], or #[test]\",\n );\n }\n }\n}\n"
3057
- },
3058
- "103": {
3059
3007
  "function_locations": [
3060
3008
  {
3061
3009
  "name": "create_stub_base",
@@ -3105,7 +3053,7 @@
3105
3053
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/calls_generation/external_functions_stubs.nr",
3106
3054
  "source": "//! Stubs are auto-generated wrapper functions that provide an ergonomic interface for cross-contract calls. ! Instead\n// of manually serializing arguments and creating call interfaces, stubs allow natural syntax, e.g. for ! enqueuing\n// calls to public functions: ! ! ExternalContract.at(address).some_method(arg1, arg2).enqueue()\n\nuse crate::macros::utils::compute_fn_selector;\nuse crate::protocol::meta::utils::derive_serialization_quotes;\nuse std::meta::unquote;\n\ncomptime global FROM_FIELD: TypedExpr = {\n let from_field_trait = quote { crate::protocol::traits::FromField }.as_trait_constraint();\n let function_selector_typ = quote { crate::protocol::abis::function_selector::FunctionSelector }.as_type();\n function_selector_typ.get_trait_impl(from_field_trait).unwrap().methods().filter(|m| {\n m.name() == quote { from_field }\n })[0]\n .as_typed_expr()\n};\n\n/// Utility function creating stubs used by all the stub functions in this file.\ncomptime fn create_stub_base(f: FunctionDefinition) -> (Quoted, Quoted, Quoted, Quoted, u32, Quoted, u32, Field) {\n // Dear privacy adventurer, chances are, you've command+clicked on the name of an external function call -- seeking\n // to view that function -- only to end up here. Here's an explanation: The external contract that you're calling\n // was likely annotated with the `#[aztec]` annotation -- as all good aztec contracts are. This triggers a macro\n // which generates a \"contract interface\" for that contract, which is effectively a pretty interface that gives\n // natural contract calling semantics:\n //\n // `MyImportedContract.at(some_address).my_method(arg1, arg2).enqueue();\n //\n // Unfortunately, the usage of macros makes it a bit of a black box. To actually view the target function, you\n // could instead command+click on `MyImportedContract`, or you can just manually search it. If you want to view the\n // noir code that gets generated by this macro, you can use `nargo expand` on your contract.\n let fn_name = f.name();\n let fn_parameters = f.parameters();\n let fn_parameters_list = fn_parameters.map(|(name, typ): (Quoted, Type)| quote { $name: $typ }).join(quote {,});\n\n let (serialized_args_array_construction, serialized_args_array_len_quote, serialized_args_array_name) =\n derive_serialization_quotes(fn_parameters, false);\n let serialized_args_array_len: u32 = unquote!(quote { ($serialized_args_array_len_quote) as u32 });\n\n let fn_name_str = f\"\\\"{fn_name}\\\"\".quoted_contents();\n let fn_name_len: u32 = unquote!(quote { $fn_name_str.as_bytes().len()});\n let fn_selector: Field = compute_fn_selector(f.name(), f.parameters());\n\n (\n fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name,\n serialized_args_array_len, fn_name_str, fn_name_len, fn_selector,\n )\n}\n\npub(crate) comptime fn create_private_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, serialized_args_array_len, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> aztec::context::calls::PrivateCall<$fn_name_len, $serialized_args_array_len, $fn_return_type> {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n aztec::context::calls::PrivateCall::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $serialized_args_array_name,\n )\n }\n }\n}\n\npub(crate) comptime fn create_private_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, serialized_args_array_len, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> aztec::context::calls::PrivateStaticCall<$fn_name_len, $serialized_args_array_len, $fn_return_type> {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n aztec::context::calls::PrivateStaticCall::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $serialized_args_array_name,\n )\n }\n }\n}\n\npub(crate) comptime fn create_public_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, serialized_args_array_len, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> aztec::context::calls::PublicCall<$fn_name_len, $serialized_args_array_len, $fn_return_type> {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n aztec::context::calls::PublicCall::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $serialized_args_array_name,\n )\n }\n }\n}\n\npub(crate) comptime fn create_public_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, serialized_args_array_len, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> aztec::context::calls::PublicStaticCall<$fn_name_len, $serialized_args_array_len, $fn_return_type> {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n aztec::context::calls::PublicStaticCall::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $serialized_args_array_name,\n )\n }\n }\n}\n\npub(crate) comptime fn create_utility_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, serialized_args_array_len, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> aztec::context::calls::UtilityCall<$fn_name_len, $serialized_args_array_len, $fn_return_type> {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n aztec::context::calls::UtilityCall::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $serialized_args_array_name,\n )\n }\n }\n}\n\n// Self-call stub generation functions for CallSelf, CallSelfStatic, EnqueueSelf, and EnqueueSelfStatic structs. Unlike\n// the stubs above, the self-call stubs directly perform the call instead of returning a struct that can be later used\n// to perform the call.\n\n/// Creates a stub for calling a private function (or static private function if `is_static` is true) from private\n/// context (for CallSelf<&mut PrivateContext> and CallSelfStatic<&mut PrivateContext>).\npub comptime fn create_private_self_call_stub(f: FunctionDefinition, is_static: bool) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, _, _, _, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> $fn_return_type {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n let args_hash = aztec::hash::hash_args($serialized_args_array_name);\n aztec::oracle::execution_cache::store($serialized_args_array_name, args_hash);\n let returns_hash = self.context.call_private_function_with_args_hash(\n self.address,\n selector,\n args_hash,\n $is_static\n );\n returns_hash.get_preimage()\n }\n }\n}\n\n/// Creates a stub for calling a public function from public context (for CallSelf<PublicContext>)\npub comptime fn create_public_self_call_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, _, fn_name_str, _, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n // TODO: It makes sense to drop the use of PublicStaticCall struct here and just perform the call directly but\n // before doing that we need to drop the use of slices from return values because we cannot return slices from an\n // unconstrained function. This is not a priority right now.\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> $fn_return_type {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n unsafe {\n aztec::context::calls::PublicCall::new(\n self.address,\n selector,\n $fn_name_str,\n $serialized_args_array_name,\n ).call(self.context)\n }\n }\n }\n}\n\n/// Creates a static stub for calling a public view function from public context (for CallSelfStatic<PublicContext>)\npub comptime fn create_public_self_call_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, _, fn_name_str, _, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n // TODO: It makes sense to drop the use of PublicStaticCall struct here and just perform the call directly but\n // before doing that we need to drop the use of slices from return values because we cannot return slices from an\n // unconstrained function. This is not a priority right now.\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> $fn_return_type {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n unsafe {\n aztec::context::calls::PublicStaticCall::new(\n self.address,\n selector,\n $fn_name_str,\n $serialized_args_array_name,\n ).view(self.context)\n }\n }\n }\n}\n\n/// Creates a static stub for enqueuing a public view function from private context (for EnqueueSelfStatic<&mut\n/// PrivateContext>)\npub comptime fn create_public_self_enqueue_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, _serialized_args_array_len, _fn_name_str, _fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n let calldata = [aztec::protocol::traits::ToField::to_field(selector)].concat($serialized_args_array_name);\n let calldata_hash = aztec::hash::hash_calldata_array(calldata);\n aztec::oracle::execution_cache::store(calldata, calldata_hash);\n self.context.call_public_function_with_calldata_hash(\n self.address,\n calldata_hash,\n /*is_static_call=*/ true,\n /*hide_msg_sender=*/ false,\n );\n }\n }\n}\n\n/// Creates a stub for enqueuing a public function from private context (for EnqueueSelf<&mut PrivateContext>)\npub comptime fn create_public_self_enqueue_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_array_construction, serialized_args_array_name, _serialized_args_array_len, _fn_name_str, _fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) {\n $serialized_args_array_construction\n let selector = $FROM_FIELD($fn_selector);\n let calldata = [aztec::protocol::traits::ToField::to_field(selector)].concat($serialized_args_array_name);\n let calldata_hash = aztec::hash::hash_calldata_array(calldata);\n aztec::oracle::execution_cache::store(calldata, calldata_hash);\n self.context.call_public_function_with_calldata_hash(\n self.address,\n calldata_hash,\n /*is_static_call=*/ false,\n /*hide_msg_sender=*/ false,\n );\n }\n }\n}\n"
3107
3055
  },
3108
- "106": {
3056
+ "104": {
3109
3057
  "function_locations": [
3110
3058
  {
3111
3059
  "name": "generate_public_dispatch",
@@ -3119,7 +3067,7 @@
3119
3067
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/dispatch.nr",
3120
3068
  "source": "use crate::macros::internals_functions_generation::external_functions_registry::get_public_functions;\nuse crate::protocol::meta::utils::get_params_len_quote;\nuse crate::utils::cmap::CHashMap;\nuse super::functions::initialization_utils::EMIT_PUBLIC_INIT_NULLIFIER_FN_NAME;\nuse super::utils::compute_fn_selector;\nuse std::panic;\n\n/// Generates a `public_dispatch` function for an Aztec contract module `m`.\n///\n/// The generated function dispatches public calls based on selector to the appropriate contract function. If\n/// `generate_emit_public_init_nullifier` is true, it also handles dispatch to the macro-generated\n/// `__emit_public_init_nullifier` function.\npub comptime fn generate_public_dispatch(m: Module, generate_emit_public_init_nullifier: bool) -> Quoted {\n let functions = get_public_functions(m);\n\n let unit = get_type::<()>();\n\n let seen_selectors = &mut CHashMap::<Field, Quoted>::new();\n\n let mut ifs = functions.map(|function: FunctionDefinition| {\n let parameters = function.parameters();\n let return_type = function.return_type();\n\n let fn_name = function.name();\n let selector: Field = compute_fn_selector(fn_name, parameters);\n\n // Since function selectors are computed as the first 4 bytes of the hash of the function signature, it's\n // possible to have collisions. With the following check, we ensure it doesn't happen within the same contract.\n let existing_fn = seen_selectors.get(selector);\n if existing_fn.is_some() {\n let existing_fn = existing_fn.unwrap();\n panic(\n f\"Public function selector collision detected between functions '{fn_name}' and '{existing_fn}'\",\n );\n }\n seen_selectors.insert(selector, fn_name);\n\n let params_len_quote = get_params_len_quote(parameters);\n\n let initial_read = if parameters.len() == 0 {\n quote {}\n } else {\n // The initial calldata_copy offset is 1 to skip the Field selector The expected calldata is the\n // serialization of\n // - FunctionSelector: the selector of the function intended to dispatch\n // - Parameters: the parameters of the function intended to dispatch That is, exactly what is expected for\n // a call to the target function, but with a selector added at the beginning.\n quote {\n let input_calldata: [Field; $params_len_quote] = aztec::oracle::avm::calldata_copy(1, $params_len_quote);\n let mut reader = aztec::protocol::utils::reader::Reader::new(input_calldata);\n }\n };\n\n let parameter_index: &mut u32 = &mut 0;\n let reads = parameters.map(|param: (Quoted, Type)| {\n let parameter_index_value = *parameter_index;\n let param_name = f\"arg{parameter_index_value}\".quoted_contents();\n let param_type = param.1;\n let read = quote {\n let $param_name: $param_type = aztec::protocol::traits::Deserialize::stream_deserialize(&mut reader);\n };\n *parameter_index += 1;\n quote { $read }\n });\n let read = reads.join(quote { });\n\n let mut args = @[];\n for parameter_index in 0..parameters.len() {\n let param_name = f\"arg{parameter_index}\".quoted_contents();\n args = args.push_back(quote { $param_name });\n }\n\n // We call a function whose name is prefixed with `__aztec_nr_internals__`. This is necessary because the\n // original function is intentionally made uncallable, preventing direct invocation within the contract.\n // Instead, a new function with the same name, but prefixed by `__aztec_nr_internals__`, has been generated to\n // be called here. For more details see the `process_functions` function.\n let name = f\"__aztec_nr_internals__{fn_name}\".quoted_contents();\n let args = args.join(quote { , });\n let call = quote { $name($args) };\n\n let return_code = if return_type == unit {\n quote {\n $call;\n // Force early return.\n aztec::oracle::avm::avm_return([]);\n }\n } else {\n quote {\n let return_value = aztec::protocol::traits::Serialize::serialize($call);\n aztec::oracle::avm::avm_return(return_value.as_vector());\n }\n };\n\n let if_ = quote {\n if selector == $selector {\n $initial_read\n $read\n $return_code\n }\n };\n if_\n });\n\n // If we injected the auto-generated public function to emit the public initialization nullifier, then\n // we'll also need to handle its dispatch.\n if generate_emit_public_init_nullifier {\n let name = EMIT_PUBLIC_INIT_NULLIFIER_FN_NAME;\n let init_nullifier_selector: Field = compute_fn_selector(name, @[]);\n\n ifs = ifs.push_back(\n quote {\n if selector == $init_nullifier_selector {\n $name();\n aztec::oracle::avm::avm_return([]);\n }\n },\n );\n }\n\n if ifs.len() == 0 {\n // No dispatch function if there are no public functions\n quote {}\n } else {\n let ifs = ifs.push_back(quote { panic(f\"Unknown selector {selector}\") });\n let dispatch = ifs.join(quote { });\n\n let body = quote {\n // We mark this as public because our whole system depends on public functions having this attribute.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n pub unconstrained fn public_dispatch(selector: Field) {\n $dispatch\n }\n };\n\n body\n }\n}\n\ncomptime fn get_type<T>() -> Type {\n let t: T = std::mem::zeroed();\n std::meta::type_of(t)\n}\n"
3121
3069
  },
3122
- "116": {
3070
+ "114": {
3123
3071
  "function_locations": [
3124
3072
  {
3125
3073
  "name": "generate_private_external",
@@ -3129,7 +3077,7 @@
3129
3077
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/internals_functions_generation/external/private.nr",
3130
3078
  "source": "use crate::macros::{\n functions::initialization_utils::has_public_init_checked_functions,\n internals_functions_generation::external::helpers::{create_authorize_once_check, get_abi_relevant_attributes},\n utils::{\n fn_has_allow_phase_change, fn_has_authorize_once, fn_has_noinitcheck, is_fn_initializer, is_fn_only_self,\n is_fn_view, module_has_initializer, module_has_storage,\n },\n};\nuse crate::protocol::meta::utils::derive_serialization_quotes;\nuse std::meta::type_of;\n\npub(crate) comptime fn generate_private_external(f: FunctionDefinition) -> Quoted {\n let module_has_initializer = module_has_initializer(f.module());\n let module_has_storage = module_has_storage(f.module());\n\n // Private functions undergo a lot of transformations from their Aztec.nr form into a circuit that can be fed to\n // the Private Kernel Circuit. First we change the function signature so that it also receives\n // `PrivateContextInputs`, which contain information about the execution context (e.g. the caller).\n let original_params = f.parameters();\n\n let original_params_quotes =\n original_params.map(|(param_name, param_type)| quote { $param_name: $param_type }).join(quote {, });\n\n let params = quote { inputs: aztec::context::inputs::PrivateContextInputs, $original_params_quotes };\n\n let mut body = f.body().as_block().unwrap();\n\n // The original params are hashed and passed to the `context` object, so that the kernel can verify we've received\n // the correct values.\n let (args_serialization, _, serialized_args_name) = derive_serialization_quotes(original_params, false);\n\n let storage_init = if module_has_storage {\n // Contract has Storage defined so we initialize it.\n quote {\n let storage = Storage::init(&mut context);\n }\n } else {\n // Contract does not have Storage defined, so we set storage to the unit type `()`. ContractSelfPrivate\n // requires a storage struct in its constructor. Using an Option type would lead to worse developer experience\n // and higher constraint counts so we use the unit type `()` instead.\n quote {\n let storage = ();\n }\n };\n\n let contract_self_creation = quote {\n #[allow(unused_variables)]\n let mut self = {\n $args_serialization\n let args_hash = aztec::hash::hash_args($serialized_args_name);\n let mut context = aztec::context::PrivateContext::new(inputs, args_hash);\n $storage_init\n let self_address = context.this_address();\n let call_self: CallSelf<&mut aztec::context::PrivateContext> = CallSelf { address: self_address, context: &mut context };\n let enqueue_self: EnqueueSelf<&mut aztec::context::PrivateContext> = EnqueueSelf { address: self_address, context: &mut context };\n let call_self_static: CallSelfStatic<&mut aztec::context::PrivateContext> = CallSelfStatic { address: self_address, context: &mut context };\n let enqueue_self_static: EnqueueSelfStatic<&mut aztec::context::PrivateContext> = EnqueueSelfStatic { address: self_address, context: &mut context };\n let internal: CallInternal<&mut aztec::context::PrivateContext> = CallInternal { context: &mut context };\n aztec::contract_self::ContractSelfPrivate::new(&mut context, storage, call_self, enqueue_self, call_self_static, enqueue_self_static, internal)\n };\n };\n\n let original_function_name = f.name();\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_only_self(f) {\n let assertion_message = f\"Function {original_function_name} can only be called by the same contract\";\n quote { assert(self.msg_sender() == self.address, $assertion_message); }\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n let assertion_message = f\"Function {original_function_name} can only be called statically\".as_quoted_str();\n quote { assert(self.context.inputs.call_context.is_static_call, $assertion_message); }\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n let has_public_fns_with_init_check = has_public_init_checked_functions(f.module());\n (\n quote { aztec::macros::functions::initialization_utils::assert_initialization_matches_address_preimage_private(*self.context); },\n quote { aztec::macros::functions::initialization_utils::mark_as_initialized_from_private_initializer(self.context, $has_public_fns_with_init_check); },\n )\n } else {\n (quote {}, quote {})\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !is_fn_initializer(f) & !fn_has_noinitcheck(f) {\n quote { aztec::macros::functions::initialization_utils::assert_is_initialized_private(self.context); }\n } else {\n quote {}\n };\n\n // Phase checks are skipped in functions that request to manually handle phases\n let initial_phase_store = if fn_has_allow_phase_change(f) {\n quote {}\n } else {\n quote { let within_revertible_phase: bool = self.context.in_revertible_phase(); }\n };\n\n let no_phase_change_check = if fn_has_allow_phase_change(f) {\n quote {}\n } else {\n quote { \n assert_eq(\n within_revertible_phase,\n self.context.in_revertible_phase(),\n f\"Phase change detected on function with phase check. If this is expected, use #[allow_phase_change]\",\n ); \n }\n };\n\n // Inject the authwit check if the function is marked with #[authorize_once].\n let authorize_once_check = if fn_has_authorize_once(f) {\n create_authorize_once_check(f, true)\n } else {\n quote {}\n };\n\n // Finally, we need to change the return type to be `PrivateCircuitPublicInputs`, which is what the Private Kernel\n // circuit expects.\n let return_value_var_name = quote { macro__returned__values };\n\n let return_value_type = f.return_type();\n let return_value = if body.len() == 0 {\n quote {}\n } else if return_value_type != type_of(()) {\n // The original return value is serialized and hashed before being passed to the context.\n let (body_without_return, last_body_expr) = body.pop_back();\n let return_value = last_body_expr.quoted();\n let return_value_assignment = quote { let $return_value_var_name: $return_value_type = $return_value; };\n\n let (return_serialization, _, serialized_return_name) =\n derive_serialization_quotes([(return_value_var_name, return_value_type)], false);\n\n body = body_without_return;\n\n quote {\n $return_value_assignment\n $return_serialization\n self.context.set_return_hash($serialized_return_name);\n }\n } else {\n let (body_without_return, last_body_expr) = body.pop_back();\n if !last_body_expr.has_semicolon()\n & last_body_expr.as_for().is_none()\n & last_body_expr.as_assert().is_none()\n & last_body_expr.as_for_range().is_none()\n & last_body_expr.as_assert_eq().is_none()\n & last_body_expr.as_let().is_none() {\n let unused_return_value_name = f\"_{return_value_var_name}\".quoted_contents();\n body = body_without_return.push_back(quote { let $unused_return_value_name = $last_body_expr; }\n .as_expr()\n .unwrap());\n }\n quote {}\n };\n\n let context_finish = quote { self.context.finish() };\n\n // Preserve all attributes that are relevant to the function's ABI.\n let abi_relevant_attributes = get_abi_relevant_attributes(f);\n\n let fn_name = f\"__aztec_nr_internals__{original_function_name}\".quoted_contents();\n\n let to_prepend = quote {\n aztec::oracle::version::assert_compatible_oracle_version();\n $contract_self_creation\n $initial_phase_store\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $authorize_once_check\n };\n\n let body_quote = body.map(|expr| expr.quoted()).join(quote { });\n\n // `mark_as_initialized` is placed after the user's function body. If it ran at the beginning, the contract\n // would appear initialized while the initializer is still running, allowing contracts called by the initializer\n // to re-enter into a half-initialized contract.\n let to_append = quote {\n $return_value\n $mark_as_initialized\n $no_phase_change_check\n $context_finish\n };\n\n quote {\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_private]\n $abi_relevant_attributes\n fn $fn_name($params) -> return_data aztec::protocol::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs {\n $to_prepend\n $body_quote\n $to_append\n }\n }\n}\n"
3131
3079
  },
3132
- "117": {
3080
+ "115": {
3133
3081
  "function_locations": [
3134
3082
  {
3135
3083
  "name": "generate_public_external",
@@ -3139,7 +3087,7 @@
3139
3087
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/internals_functions_generation/external/public.nr",
3140
3088
  "source": "use crate::macros::{\n internals_functions_generation::external::helpers::{create_authorize_once_check, get_abi_relevant_attributes},\n utils::{\n fn_has_authorize_once, fn_has_noinitcheck, is_fn_initializer, is_fn_only_self, is_fn_view,\n module_has_initializer, module_has_storage,\n },\n};\n\npub(crate) comptime fn generate_public_external(f: FunctionDefinition) -> Quoted {\n let module_has_initializer = module_has_initializer(f.module());\n let module_has_storage = module_has_storage(f.module());\n\n // Public functions undergo a lot of transformations from their Aztec.nr form.\n let original_params = f.parameters();\n\n let args_len_quote = if original_params.len() == 0 {\n // If the function has no parameters, we set the args_len to 0.\n quote { 0 }\n } else {\n // The following will give us <type_of_struct_member_1 as Serialize>::N + <type_of_struct_member_2 as\n // Serialize>::N + ...\n original_params\n .map(|(_, param_type): (Quoted, Type)| {\n quote {\n <$param_type as $crate::protocol::traits::Serialize>::N\n }\n })\n .join(quote {+})\n };\n\n let storage_init = if module_has_storage {\n quote {\n let storage = Storage::init(context);\n }\n } else {\n // Contract does not have Storage defined, so we set storage to the unit type `()`. ContractSelfPublic requires\n // a storage struct in its constructor. Using an Option type would lead to worse developer experience and\n // higher constraint counts so we use the unit type `()` instead.\n quote {\n let storage = ();\n }\n };\n\n // Unlike in the private case, in public the `context` does not need to receive the hash of the original params.\n let contract_self_creation = quote {\n #[allow(unused_variables)]\n let mut self = {\n let context = aztec::context::PublicContext::new(|| {\n // We start from 1 because we skip the selector for the dispatch function.\n let serialized_args : [Field; $args_len_quote] = aztec::oracle::avm::calldata_copy(1, $args_len_quote);\n aztec::hash::hash_args(serialized_args)\n });\n $storage_init\n let self_address = context.this_address();\n let call_self: CallSelf<aztec::context::PublicContext> = CallSelf { address: self_address, context };\n let call_self_static: CallSelfStatic<aztec::context::PublicContext> = CallSelfStatic { address: self_address, context };\n let internal: CallInternal<aztec::context::PublicContext> = CallInternal { context };\n aztec::contract_self::ContractSelfPublic::new(context, storage, call_self, call_self_static, internal)\n };\n };\n\n let original_function_name = f.name();\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_only_self(f) {\n let assertion_message = f\"Function {original_function_name} can only be called by the same contract\";\n quote { assert(self.msg_sender() == self.address, $assertion_message); }\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n let assertion_message = f\"Function {original_function_name} can only be called statically\".as_quoted_str();\n quote { assert(self.context.is_static_call(), $assertion_message); }\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n (\n quote { aztec::macros::functions::initialization_utils::assert_initialization_matches_address_preimage_public(self.context); },\n quote { aztec::macros::functions::initialization_utils::mark_as_initialized_from_public_initializer(self.context); },\n )\n } else {\n (quote {}, quote {})\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !fn_has_noinitcheck(f) & !is_fn_initializer(f) {\n quote { aztec::macros::functions::initialization_utils::assert_is_initialized_public(self.context); }\n } else {\n quote {}\n };\n\n // Inject the authwit check if the function is marked with #[authorize_once].\n let authorize_once_check = if fn_has_authorize_once(f) {\n create_authorize_once_check(f, false)\n } else {\n quote {}\n };\n\n let to_prepend = quote {\n $contract_self_creation\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $authorize_once_check\n };\n\n // `mark_as_initialized` is placed after the user's function body. If it ran at the beginning, the contract\n // would appear initialized while the initializer is still running, allowing contracts called by the initializer\n // to re-enter into a half-initialized contract.\n let to_append = quote {\n $mark_as_initialized\n };\n\n let fn_name = f\"__aztec_nr_internals__{original_function_name}\".quoted_contents();\n let body = f.body();\n let return_type = f.return_type();\n\n // New function parameters are the same as the original function's ones.\n let params = original_params.map(|(param_name, param_type)| quote { $param_name: $param_type }).join(quote {, });\n\n // Preserve all attributes that are relevant to the function's ABI.\n let abi_relevant_attributes = get_abi_relevant_attributes(f);\n\n // All public functions are automatically made unconstrained, even if they were not marked as such. This is because\n // instead of compiling into a circuit, they will compile to bytecode that will be later transpiled into AVM\n // bytecode.\n quote {\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n $abi_relevant_attributes\n unconstrained fn $fn_name($params) -> pub $return_type {\n $to_prepend\n $body\n $to_append\n }\n }\n}\n"
3141
3089
  },
3142
- "118": {
3090
+ "116": {
3143
3091
  "function_locations": [
3144
3092
  {
3145
3093
  "name": "generate_utility_external",
@@ -3149,7 +3097,7 @@
3149
3097
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/internals_functions_generation/external/utility.nr",
3150
3098
  "source": "use crate::macros::utils::{fn_has_noinitcheck, module_has_initializer, module_has_storage};\n\npub(crate) comptime fn generate_utility_external(f: FunctionDefinition) -> Quoted {\n let module_has_initializer = module_has_initializer(f.module());\n\n // Initialize Storage if module has storage\n let storage_init = if module_has_storage(f.module()) {\n quote {\n let storage = Storage::init(context);\n }\n } else {\n // Contract does not have Storage defined, so we set storage to the unit type `()`. ContractSelfUtility\n // requires a\n // storage struct in its constructor. Using an Option type would lead to worse developer experience and higher\n // constraint counts so we use the unit type `()` instead.\n quote {\n let storage = ();\n }\n };\n\n // Create utility context\n let contract_self_creation = quote {\n #[allow(unused_variables)]\n let mut self = {\n let context = aztec::context::UtilityContext::new();\n $storage_init\n aztec::contract_self::ContractSelfUtility::new(context, storage)\n };\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !fn_has_noinitcheck(f) {\n quote {\n aztec::macros::functions::initialization_utils::assert_is_initialized_utility(\n self.context,\n );\n }\n } else {\n quote {}\n };\n\n // A quote to be injected at the beginning of the function body.\n let to_prepend = quote {\n aztec::oracle::version::assert_compatible_oracle_version();\n $contract_self_creation\n $init_check\n };\n\n let original_function_name = f.name();\n let fn_name = f\"__aztec_nr_internals__{original_function_name}\".quoted_contents();\n let body = f.body();\n let params = f.parameters().map(|(param_name, param_type)| quote { $param_name: $param_type }).join(quote {, });\n let return_type = f.return_type();\n\n quote {\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn $fn_name($params) -> pub $return_type {\n $to_prepend\n $body\n }\n }\n}\n"
3151
3099
  },
3152
- "127": {
3100
+ "125": {
3153
3101
  "function_locations": [
3154
3102
  {
3155
3103
  "name": "do_sync_state",
@@ -3171,7 +3119,7 @@
3171
3119
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/mod.nr",
3172
3120
  "source": "use crate::logging::{aztecnr_debug_log, aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::address::AztecAddress;\n\npub(crate) mod nonce_discovery;\npub(crate) mod partial_notes;\npub(crate) mod private_events;\npub mod private_notes;\npub mod process_message;\n\nuse crate::{\n capsules::CapsuleArray,\n messages::{\n discovery::process_message::process_message_ciphertext,\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::note::MAX_NOTE_PACKED_LEN,\n processing::{\n get_private_logs, MessageContext, offchain::OffchainInboxSync, OffchainMessageWithContext,\n pending_tagged_log::PendingTaggedLog, validate_and_store_enqueued_notes_and_events,\n },\n },\n utils::array,\n};\n\npub struct NoteHashAndNullifier {\n /// The result of [`crate::note::note_interface::NoteHash::compute_note_hash`].\n pub note_hash: Field,\n /// The result of [`crate::note::note_interface::NoteHash::compute_nullifier_unconstrained`].\n ///\n /// This value is unconstrained, as all of message discovery is unconstrained. It is `None` if the nullifier\n /// cannot be computed (e.g. because the nullifier hiding key is not available).\n pub inner_nullifier: Option<Field>,\n}\n\n/// A contract's way of computing note hashes.\n///\n/// Each contract in the network is free to compute their note's hash as they see fit - the hash function itself is not\n/// enshrined or standardized. Some aztec-nr functions however do need to know the details of this computation (e.g.\n/// when finding new notes), which is what this type represents.\n///\n/// This function takes a note's packed content, storage slot, note type ID, address of the emitting contract and\n/// randomness, and attempts to compute its inner note hash (not siloed by address nor uniqued by nonce).\n///\n/// ## Transient Notes\n///\n/// This function is meant to always be used on **settled** notes, i.e. those that have been inserted into the trees\n/// and for which the nonce is known. It is never invoked in the context of a transient note, as those are not involved\n/// in message processing.\n///\n/// ## Automatic Implementation\n///\n/// The [`[#aztec]`](crate::macros::aztec::aztec) macro automatically creates a correct implementation of this function\n/// for each contract by inspecting all note types in use and the storage layout. This injected function is a\n/// `#[contract_library_method]` called `_compute_note_hash`, and it looks something like this:\n///\n/// ```noir\n/// |packed_note, owner, storage_slot, note_type_id, _contract_address, randomness| {\n/// if note_type_id == MyNoteType::get_id() {\n/// if packed_note.len() != MY_NOTE_TYPE_SERIALIZATION_LENGTH {\n/// Option::none()\n/// } else {\n/// let note = MyNoteType::unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n/// Option::some(note.compute_note_hash(owner, storage_slot, randomness))\n/// }\n/// } else if note_type_id == MyOtherNoteType::get_id() {\n/// ... // Similar to above but calling MyOtherNoteType::unpack\n/// } else {\n/// Option::none() // Unknown note type ID\n/// };\n/// }\n/// ```\npub type ComputeNoteHash = unconstrained fn(/* packed_note */BoundedVec<Field, MAX_NOTE_PACKED_LEN>, /*\n owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress, /*\nrandomness */ Field) -> Option<Field>;\n\n/// A contract's way of computing note nullifiers.\n///\n/// Like [`ComputeNoteHash`], each contract is free to derive nullifiers as they see fit. This function takes the\n/// unique note hash (used as the note hash for nullification for settled notes), plus the note's packed content and\n/// metadata, and attempts to compute the inner nullifier (not siloed by address).\n///\n/// ## Automatic Implementation\n///\n/// The [`[#aztec]`](crate::macros::aztec::aztec) macro automatically creates a correct implementation of this function\n/// for each contract called `_compute_note_nullifier`. It dispatches on `note_type_id` similarly to\n/// [`ComputeNoteHash`], then calls the note's\n/// [`compute_nullifier_unconstrained`](crate::note::note_interface::NoteHash::compute_nullifier_unconstrained) method.\npub type ComputeNoteNullifier = unconstrained fn(/* unique_note_hash */Field, /* packed_note */ BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n/* owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress,\n/* randomness */ Field) -> Option<Field>;\n\n/// Deprecated: use [`ComputeNoteHash`] and [`ComputeNoteNullifier`] instead.\npub type ComputeNoteHashAndNullifier<Env> = unconstrained fn[Env](/* packed_note */BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n/* owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress,\n/*randomness */ Field, /* note nonce */ Field) -> Option<NoteHashAndNullifier>;\n\n/// A handler for custom messages.\n///\n/// Contracts that emit custom messages (i.e. any with a message type that is not in [`crate::messages::msg_type`])\n/// need to use [`crate::macros::AztecConfig::custom_message_handler`] with a function of this type in order to\n/// process them. They will otherwise be **silently ignored**.\npub type CustomMessageHandler<Env> = unconstrained fn[Env](\n/* contract_address */AztecAddress,\n/* msg_type_id */ u64,\n/* msg_metadata */ u64,\n/* msg_content */ BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n/* message_context */ MessageContext,\n/* scope */ AztecAddress);\n\n/// Synchronizes the contract's private state with the network.\n///\n/// As blocks are mined, it is possible for a contract's private state to change (e.g. with new notes being created),\n/// but because these changes are private they will be invisible to most actors. This is the function that processes\n/// new transactions in order to discover new notes, events, and other kinds of private state changes.\n///\n/// The private state will be synchronized up to the block that will be used for private transactions (i.e. the anchor\n/// block. This will typically be close to the tip of the chain.\npub unconstrained fn do_sync_state<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n offchain_inbox_sync: Option<OffchainInboxSync<()>>,\n scope: AztecAddress,\n) {\n aztecnr_debug_log!(\"Performing state synchronization\");\n\n // First we process all private logs, which can contain different kinds of messages e.g. private notes, partial\n // notes, private events, etc.\n let logs = get_private_logs(contract_address, scope);\n logs.for_each(|i, pending_tagged_log: PendingTaggedLog| {\n if pending_tagged_log.log.len() == 0 {\n aztecnr_warn_log_format!(\"Skipping empty log from tx {0}\")([pending_tagged_log.context.tx_hash]);\n } else {\n aztecnr_debug_log_format!(\"Processing log with tag {0}\")([pending_tagged_log.log.get(0)]);\n\n // We remove the tag from the pending tagged log and process the message ciphertext contained in it.\n let message_ciphertext = array::subbvec(pending_tagged_log.log, 1);\n\n process_message_ciphertext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n message_ciphertext,\n pending_tagged_log.context,\n scope,\n );\n }\n\n // We need to delete each log from the array so that we won't process them again. `CapsuleArray::for_each`\n // allows deletion of the current element during iteration, so this is safe.\n // Note that this (and all other database changes) will only be committed if contract execution succeeds,\n // including any enqueued validation requests.\n logs.remove(i);\n });\n\n if offchain_inbox_sync.is_some() {\n let msgs: CapsuleArray<OffchainMessageWithContext> = offchain_inbox_sync.unwrap()(contract_address, scope);\n msgs.for_each(|i, msg| {\n process_message_ciphertext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n msg.message_ciphertext,\n msg.message_context,\n scope,\n );\n // The inbox sync returns _a copy_ of messages to process, so we clear them as we do so. This is a\n // volatile array with the to-process message, not the actual persistent storage of them.\n msgs.remove(i);\n });\n }\n\n // Then we process all pending partial notes, regardless of whether they were found in the current or previous\n // executions.\n partial_notes::fetch_and_process_partial_note_completion_logs(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n scope,\n );\n\n // Finally we validate all notes and events that were found as part of the previous processes, resulting in them\n // being added to PXE's database and retrievable via oracles (get_notes) and our TS API (PXE::getPrivateEvents).\n validate_and_store_enqueued_notes_and_events(contract_address, scope);\n}\n\nmod test {\n use crate::{\n capsules::CapsuleArray,\n messages::{\n discovery::{CustomMessageHandler, do_sync_state},\n logs::note::MAX_NOTE_PACKED_LEN,\n processing::{\n offchain::OffchainInboxSync, pending_tagged_log::PendingTaggedLog, PENDING_TAGGED_LOG_ARRAY_BASE_SLOT,\n },\n },\n test::helpers::test_environment::TestEnvironment,\n };\n use crate::protocol::address::AztecAddress;\n\n #[test]\n unconstrained fn do_sync_state_does_not_panic_on_empty_logs() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n\n let contract_address = AztecAddress { inner: 0xdeadbeef };\n\n env.utility_context_at(contract_address, |_| {\n let base_slot = PENDING_TAGGED_LOG_ARRAY_BASE_SLOT;\n\n let logs: CapsuleArray<PendingTaggedLog> = CapsuleArray::at(contract_address, base_slot, scope);\n logs.push(PendingTaggedLog { log: BoundedVec::new(), context: std::mem::zeroed() });\n assert_eq(logs.len(), 1);\n\n let no_handler: Option<CustomMessageHandler<()>> = Option::none();\n let no_inbox_sync: Option<OffchainInboxSync<()>> = Option::none();\n do_sync_state(\n contract_address,\n dummy_compute_note_hash,\n dummy_compute_note_nullifier,\n no_handler,\n no_inbox_sync,\n scope,\n );\n\n assert_eq(logs.len(), 0);\n });\n }\n\n unconstrained fn dummy_compute_note_hash(\n _packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n _owner: AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n Option::none()\n }\n\n unconstrained fn dummy_compute_note_nullifier(\n _unique_note_hash: Field,\n _packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n _owner: AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n Option::none()\n }\n}\n"
3173
3121
  },
3174
- "128": {
3122
+ "126": {
3175
3123
  "function_locations": [
3176
3124
  {
3177
3125
  "name": "attempt_note_nonce_discovery",
@@ -3229,7 +3177,7 @@
3229
3177
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/nonce_discovery.nr",
3230
3178
  "source": "use crate::messages::{discovery::{ComputeNoteHash, ComputeNoteNullifier}, logs::note::MAX_NOTE_PACKED_LEN};\n\nuse crate::logging::{aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::{\n address::AztecAddress,\n constants::MAX_NOTE_HASHES_PER_TX,\n hash::{compute_note_hash_nonce, compute_siloed_note_hash, compute_unique_note_hash},\n traits::ToField,\n};\n\n/// A struct with the discovered information of a complete note, required for delivery to PXE. Note that this is *not*\n/// the complete note information, since it does not include content, storage slot, etc.\npub(crate) struct DiscoveredNoteInfo {\n pub(crate) note_nonce: Field,\n pub(crate) note_hash: Field,\n pub(crate) inner_nullifier: Field,\n}\n\n/// Searches for note nonces that will result in a note that was emitted in a transaction. While rare, it is possible\n/// for multiple notes to have the exact same packed content and storage slot but different nonces, resulting in\n/// different unique note hashes. Because of this this function returns a *vector* of discovered notes, though in most\n/// cases it will contain a single element.\n///\n/// Due to how nonces are computed, this function requires knowledge of the transaction in which the note was created,\n/// more specifically the list of all unique note hashes in it plus the value of its first nullifier.\npub(crate) unconstrained fn attempt_note_nonce_discovery(\n unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n contract_address: AztecAddress,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: Field,\n note_type_id: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n) -> BoundedVec<DiscoveredNoteInfo, MAX_NOTE_HASHES_PER_TX> {\n let discovered_notes = &mut BoundedVec::new();\n\n aztecnr_debug_log_format!(\n \"Attempting nonce discovery on {0} potential notes on contract {1} for storage slot {2}\",\n )(\n [unique_note_hashes_in_tx.len() as Field, contract_address.to_field(), storage_slot],\n );\n\n let maybe_note_hash = compute_note_hash(\n packed_note,\n owner,\n storage_slot,\n note_type_id,\n contract_address,\n randomness,\n );\n\n if maybe_note_hash.is_none() {\n aztecnr_warn_log_format!(\n \"Unable to compute note hash for note of id {0} with packed length {1}, skipping nonce discovery\",\n )(\n [note_type_id, packed_note.len() as Field],\n );\n } else {\n let note_hash = maybe_note_hash.unwrap();\n let siloed_note_hash = compute_siloed_note_hash(contract_address, note_hash);\n\n // We need to find nonces (typically just one) that result in the siloed note hash that being uniqued into one\n // of the transaction's effects.\n // The nonce is meant to be derived from the index of the note hash in the transaction effects array. However,\n // due to an issue in the kernels the nonce might actually use any of the possible note hash indices - not\n // necessarily the one that corresponds to the note hash. Hence, we need to try them all.\n for i in 0..MAX_NOTE_HASHES_PER_TX {\n let nonce_for_i = compute_note_hash_nonce(first_nullifier_in_tx, i);\n let unique_note_hash_for_i = compute_unique_note_hash(nonce_for_i, siloed_note_hash);\n\n let matching_notes = bvec_filter(\n unique_note_hashes_in_tx,\n |unique_note_hash_in_tx| unique_note_hash_in_tx == unique_note_hash_for_i,\n );\n if matching_notes.len() > 1 {\n let identical_note_hashes = matching_notes.len();\n // Note that we don't actually check that the note hashes array contains unique values, only that the\n // note we found is unique. We don't expect for this to ever happen (it'd indicate a malicious node or\n // PXE, which are both assumed to be cooperative) so testing for it just in case is unnecessary, but we\n // _do_ need to handle it if we find a duplicate.\n panic(\n f\"Received {identical_note_hashes} identical note hashes for a transaction - these should all be unique\",\n )\n } else if matching_notes.len() == 1 {\n let maybe_inner_nullifier_for_i = compute_note_nullifier(\n unique_note_hash_for_i,\n packed_note,\n owner,\n storage_slot,\n note_type_id,\n contract_address,\n randomness,\n );\n\n if maybe_inner_nullifier_for_i.is_none() {\n // TODO: down the line we want to be able to store notes for which we don't know their nullifier,\n // e.g. notes that belong to someone that is not us (and for which we therefore don't know their\n // associated app-siloed nullifer hiding secret key).\n // https://linear.app/aztec-labs/issue/F-265/store-external-notes\n aztecnr_warn_log_format!(\n \"Unable to compute nullifier of unique note {0} with note type id {1} and owner {2}, skipping PXE insertion\",\n )(\n [unique_note_hash_for_i, note_type_id, owner.to_field()],\n );\n } else {\n // Note that while we did check that the note hash is the preimage of a unique note hash, we\n // perform no validations on the nullifier - we fundamentally cannot, since only the application\n // knows how to compute nullifiers. We simply trust it to have provided the correct one: if it\n // hasn't, then PXE may fail to realize that a given note has been nullified already, and calls to\n // the application could result in invalid transactions (with duplicate nullifiers). This is not a\n // concern because an application already has more direct means of making a call to it fail the\n // transaction.\n discovered_notes.push(\n DiscoveredNoteInfo {\n note_nonce: nonce_for_i,\n note_hash,\n inner_nullifier: maybe_inner_nullifier_for_i.unwrap(),\n },\n );\n }\n // We don't exit the loop - it is possible (though rare) for the exact same note content to be present\n // multiple times in the same transaction with different nonces. This typically doesn't happen due to\n // notes containing random values in order to hide their contents.\n }\n }\n }\n\n *discovered_notes\n}\n\n// There is no BoundedVec::filter in the stdlib, so we use this until that is implemented.\nunconstrained fn bvec_filter<Env, T, let MAX_LEN: u32>(\n bvec: BoundedVec<T, MAX_LEN>,\n filter: fn[Env](T) -> bool,\n) -> BoundedVec<T, MAX_LEN> {\n let filtered = &mut BoundedVec::new();\n\n bvec.for_each(|value| {\n if filter(value) {\n filtered.push(value);\n }\n });\n\n *filtered\n}\n\nmod test {\n use crate::{\n messages::logs::note::MAX_NOTE_PACKED_LEN,\n note::{\n note_interface::{NoteHash, NoteType},\n note_metadata::SettledNoteMetadata,\n utils::compute_note_hash_for_nullification,\n },\n oracle::random::random,\n test::mocks::mock_note::MockNote,\n utils::array,\n };\n\n use crate::protocol::{\n address::AztecAddress,\n hash::{compute_note_hash_nonce, compute_siloed_note_hash, compute_unique_note_hash},\n traits::{FromField, Packable},\n };\n\n use super::attempt_note_nonce_discovery;\n\n // This implementation could be simpler, but this serves as a nice example of the expected flow in a real\n // implementation, and as a sanity check that the interface is sufficient.\n\n unconstrained fn compute_note_hash(\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n owner: AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n _contract_address: AztecAddress,\n randomness: Field,\n ) -> Option<Field> {\n if (note_type_id == MockNote::get_id()) & (packed_note.len() == <MockNote as Packable>::N) {\n let note = MockNote::unpack(array::subarray(packed_note.storage(), 0));\n Option::some(note.compute_note_hash(owner, storage_slot, randomness))\n } else {\n Option::none()\n }\n }\n\n unconstrained fn compute_note_nullifier(\n unique_note_hash: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n owner: AztecAddress,\n _storage_slot: Field,\n note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n if (note_type_id == MockNote::get_id()) & (packed_note.len() == <MockNote as Packable>::N) {\n let note = MockNote::unpack(array::subarray(packed_note.storage(), 0));\n note.compute_nullifier_unconstrained(owner, unique_note_hash)\n } else {\n Option::none()\n }\n }\n\n global VALUE: Field = 7;\n global FIRST_NULLIFIER_IN_TX: Field = 47;\n global CONTRACT_ADDRESS: AztecAddress = AztecAddress::from_field(13);\n global OWNER: AztecAddress = AztecAddress::from_field(14);\n global STORAGE_SLOT: Field = 99;\n global RANDOMNESS: Field = 99;\n\n #[test]\n unconstrained fn no_note_hashes() {\n let unique_note_hashes_in_tx = BoundedVec::new();\n let packed_note = BoundedVec::new();\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n packed_note,\n );\n\n assert_eq(discovered_notes.len(), 0);\n }\n\n #[test]\n unconstrained fn failed_hash_computation_is_ignored() {\n let unique_note_hashes_in_tx = BoundedVec::from_array([random()]);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n |_, _, _, _, _, _| Option::none(),\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::new(),\n );\n\n assert_eq(discovered_notes.len(), 0);\n }\n\n #[test]\n unconstrained fn failed_nullifier_computation_is_ignored() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n unique_note_hashes_in_tx.set(note_index_in_tx, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n |_, _, _, _, _, _, _| Option::none(),\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 0);\n }\n\n struct NoteAndData {\n note: MockNote,\n note_nonce: Field,\n note_hash: Field,\n unique_note_hash: Field,\n inner_nullifier: Field,\n }\n\n unconstrained fn construct_note(value: Field, note_index_in_tx: u32) -> NoteAndData {\n let note_nonce = compute_note_hash_nonce(FIRST_NULLIFIER_IN_TX, note_index_in_tx);\n\n let hinted_note = MockNote::new(value)\n .contract_address(CONTRACT_ADDRESS)\n .owner(OWNER)\n .randomness(RANDOMNESS)\n .storage_slot(STORAGE_SLOT)\n .note_metadata(SettledNoteMetadata::new(note_nonce).into())\n .build_hinted_note();\n let note = hinted_note.note;\n\n let note_hash = note.compute_note_hash(OWNER, STORAGE_SLOT, RANDOMNESS);\n let unique_note_hash = compute_unique_note_hash(\n note_nonce,\n compute_siloed_note_hash(CONTRACT_ADDRESS, note_hash),\n );\n let inner_nullifier = note\n .compute_nullifier_unconstrained(OWNER, compute_note_hash_for_nullification(hinted_note))\n .expect(f\"Could not compute nullifier for note owned by {OWNER}\");\n\n NoteAndData { note, note_nonce, note_hash, unique_note_hash, inner_nullifier }\n }\n\n #[test]\n unconstrained fn single_note() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n unique_note_hashes_in_tx.set(note_index_in_tx, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 1);\n let discovered_note = discovered_notes.get(0);\n\n assert_eq(discovered_note.note_nonce, note_and_data.note_nonce);\n assert_eq(discovered_note.note_hash, note_and_data.note_hash);\n assert_eq(discovered_note.inner_nullifier, note_and_data.inner_nullifier);\n }\n\n #[test]\n unconstrained fn multiple_notes_same_preimage() {\n let first_note_index_in_tx = 3;\n let first_note_and_data = construct_note(VALUE, first_note_index_in_tx);\n\n let second_note_index_in_tx = 5;\n let second_note_and_data = construct_note(VALUE, second_note_index_in_tx);\n\n // Both notes have the same preimage (and therefore packed representation), so both should be found in the same\n // call.\n assert_eq(first_note_and_data.note, second_note_and_data.note);\n let packed_note = first_note_and_data.note.pack();\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n unique_note_hashes_in_tx.set(first_note_index_in_tx, first_note_and_data.unique_note_hash);\n unique_note_hashes_in_tx.set(second_note_index_in_tx, second_note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(packed_note),\n );\n\n assert_eq(discovered_notes.len(), 2);\n\n assert(discovered_notes.any(|discovered_note| {\n (discovered_note.note_nonce == first_note_and_data.note_nonce)\n & (discovered_note.note_hash == first_note_and_data.note_hash)\n & (discovered_note.inner_nullifier == first_note_and_data.inner_nullifier)\n }));\n\n assert(discovered_notes.any(|discovered_note| {\n (discovered_note.note_nonce == second_note_and_data.note_nonce)\n & (discovered_note.note_hash == second_note_and_data.note_hash)\n & (discovered_note.inner_nullifier == second_note_and_data.inner_nullifier)\n }));\n }\n\n #[test]\n unconstrained fn single_note_misaligned_nonce() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n\n // The note is not at the correct index\n unique_note_hashes_in_tx.set(note_index_in_tx + 1, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 1);\n let discovered_note = discovered_notes.get(0);\n\n assert_eq(discovered_note.note_nonce, note_and_data.note_nonce);\n assert_eq(discovered_note.note_hash, note_and_data.note_hash);\n assert_eq(discovered_note.inner_nullifier, note_and_data.inner_nullifier);\n }\n\n #[test]\n unconstrained fn single_note_nonce_with_index_past_note_hashes_in_tx() {\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n\n // The nonce is computed with an index that does not exist in the tx\n let note_index_in_tx = unique_note_hashes_in_tx.len() + 5;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n // The note is inserted at an arbitrary index - its true index is out of the array's bounds\n unique_note_hashes_in_tx.set(2, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 1);\n let discovered_note = discovered_notes.get(0);\n\n assert_eq(discovered_note.note_nonce, note_and_data.note_nonce);\n assert_eq(discovered_note.note_hash, note_and_data.note_hash);\n assert_eq(discovered_note.inner_nullifier, note_and_data.inner_nullifier);\n }\n\n #[test(should_fail_with = \"identical note hashes for a transaction\")]\n unconstrained fn duplicate_unique_note_hashes() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n\n // The same unique note hash is present in two indices in the array, which is not allowed. Note that we don't\n // test all note hashes for uniqueness, only those that we actually find.\n unique_note_hashes_in_tx.set(note_index_in_tx, note_and_data.unique_note_hash);\n unique_note_hashes_in_tx.set(note_index_in_tx + 1, note_and_data.unique_note_hash);\n\n let _ = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n }\n}\n"
3231
3179
  },
3232
- "129": {
3180
+ "127": {
3233
3181
  "function_locations": [
3234
3182
  {
3235
3183
  "name": "process_partial_note_private_msg",
@@ -3243,7 +3191,7 @@
3243
3191
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/partial_notes.nr",
3244
3192
  "source": "use crate::{\n capsules::CapsuleArray,\n messages::{\n discovery::{ComputeNoteHash, ComputeNoteNullifier, nonce_discovery::attempt_note_nonce_discovery},\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::partial_note::{decode_partial_note_private_message, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN},\n processing::{\n enqueue_note_for_validation,\n get_pending_partial_notes_completion_logs,\n log_retrieval_response::{LogRetrievalResponse, MAX_LOG_CONTENT_LEN},\n },\n },\n utils::array,\n};\n\nuse crate::logging::{aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::{address::AztecAddress, hash::sha256_to_field, traits::{Deserialize, Serialize}};\n\n/// The slot in the PXE capsules where we store a `CapsuleArray` of `DeliveredPendingPartialNote`.\npub(crate) global DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT\".as_bytes(),\n);\n\n/// A partial note that was delivered but is still pending completion. Contains the information necessary to find the\n/// log that will complete it and lead to a note being discovered and delivered.\n#[derive(Serialize, Deserialize)]\npub(crate) struct DeliveredPendingPartialNote {\n pub(crate) owner: AztecAddress,\n pub(crate) randomness: Field,\n pub(crate) note_completion_log_tag: Field,\n pub(crate) note_type_id: Field,\n pub(crate) packed_private_note_content: BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN>,\n}\n\npub(crate) unconstrained fn process_partial_note_private_msg(\n contract_address: AztecAddress,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n tx_hash: Field,\n scope: AztecAddress,\n) {\n let decoded = decode_partial_note_private_message(msg_metadata, msg_content);\n\n if decoded.is_some() {\n // We store the information of the partial note we found in a persistent capsule in PXE, so that we can later\n // search for the public log that will complete it.\n let (owner, randomness, note_completion_log_tag, note_type_id, packed_private_note_content) = decoded.unwrap();\n\n let pending = DeliveredPendingPartialNote {\n owner,\n randomness,\n note_completion_log_tag,\n note_type_id,\n packed_private_note_content,\n };\n\n CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n scope,\n )\n .push(pending);\n } else {\n aztecnr_warn_log_format!(\n \"Could not decode partial note private message from tx {0}, ignoring\",\n )(\n [tx_hash],\n );\n }\n}\n\n/// Searches for logs that would result in the completion of pending partial notes, ultimately resulting in the notes\n/// being delivered to PXE if completed.\npub(crate) unconstrained fn fetch_and_process_partial_note_completion_logs(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n scope: AztecAddress,\n) {\n let pending_partial_notes = CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n scope,\n );\n\n aztecnr_debug_log_format!(\"{} pending partial notes\")([pending_partial_notes.len() as Field]);\n\n // Each of the pending partial notes might get completed by a log containing its public values. For performance\n // reasons, we fetch all of these logs concurrently and then process them one by one, minimizing the amount of time\n // waiting for the node roundtrip.\n let maybe_completion_logs =\n get_pending_partial_notes_completion_logs(contract_address, pending_partial_notes, scope);\n\n // Each entry in the maybe completion logs array corresponds to the entry in the pending partial notes array at the\n // same index. This means we can use the same index as we iterate through the responses to get both the partial\n // note and the log that might complete it.\n assert_eq(maybe_completion_logs.len(), pending_partial_notes.len());\n\n maybe_completion_logs.for_each(|i, maybe_log: Option<LogRetrievalResponse>| {\n // We clear the completion logs as we read them so that the array is empty by the time we next query it.\n // TODO(#14943): use volatile arrays to avoid having to manually clear this.\n maybe_completion_logs.remove(i);\n\n let pending_partial_note = pending_partial_notes.get(i);\n\n if maybe_log.is_none() {\n aztecnr_debug_log_format!(\"Found no completion logs for partial note with tag {}\")(\n [pending_partial_note.note_completion_log_tag],\n );\n\n // Note that we're not removing the pending partial note from the capsule array, so we will continue\n // searching for this tagged log when performing message discovery in the future until we either find it or\n // the entry is somehow removed from the array.\n } else {\n aztecnr_debug_log_format!(\"Completion log found for partial note with tag {}\")([\n pending_partial_note.note_completion_log_tag,\n ]);\n let log = maybe_log.unwrap();\n\n // The first field in the completion log payload is the storage slot, followed by the public note\n // content fields.\n let storage_slot = log.log_payload.get(0);\n let public_note_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN - 1> = array::subbvec(log.log_payload, 1);\n\n // Public fields are assumed to all be placed at the end of the packed representation, so we combine\n // the private and public packed fields (i.e. the contents of the private message and public log\n // plaintext) to get the complete packed content.\n let complete_packed_note = array::append(\n pending_partial_note.packed_private_note_content,\n public_note_content,\n );\n\n let discovered_notes = attempt_note_nonce_discovery(\n log.unique_note_hashes_in_tx,\n log.first_nullifier_in_tx,\n compute_note_hash,\n compute_note_nullifier,\n contract_address,\n pending_partial_note.owner,\n storage_slot,\n pending_partial_note.randomness,\n pending_partial_note.note_type_id,\n complete_packed_note,\n );\n\n // TODO(#11627): is there anything reasonable we can do if we get a log but it doesn't result in a note\n // being found?\n if discovered_notes.len() == 0 {\n panic(\n f\"A partial note's completion log did not result in any notes being found - this should never happen\",\n );\n }\n\n aztecnr_debug_log_format!(\"Discovered {0} notes for partial note with tag {1}\")([\n discovered_notes.len() as Field,\n pending_partial_note.note_completion_log_tag,\n ]);\n\n discovered_notes.for_each(|discovered_note| {\n enqueue_note_for_validation(\n contract_address,\n pending_partial_note.owner,\n storage_slot,\n pending_partial_note.randomness,\n discovered_note.note_nonce,\n complete_packed_note,\n discovered_note.note_hash,\n discovered_note.inner_nullifier,\n log.tx_hash,\n scope,\n );\n });\n\n // Because there is only a single log for a given tag, once we've processed the tagged log then we simply\n // delete the pending work entry, regardless of whether it was actually completed or not.\n pending_partial_notes.remove(i);\n }\n });\n}\n"
3245
3193
  },
3246
- "130": {
3194
+ "128": {
3247
3195
  "function_locations": [
3248
3196
  {
3249
3197
  "name": "process_private_event_msg",
@@ -3253,7 +3201,7 @@
3253
3201
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/private_events.nr",
3254
3202
  "source": "use crate::{\n event::event_interface::compute_private_serialized_event_commitment,\n logging::aztecnr_warn_log_format,\n messages::{\n encoding::MAX_MESSAGE_CONTENT_LEN, logs::event::decode_private_event_message,\n processing::enqueue_event_for_validation,\n },\n};\nuse crate::protocol::{address::AztecAddress, traits::ToField};\n\npub(crate) unconstrained fn process_private_event_msg(\n contract_address: AztecAddress,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n tx_hash: Field,\n recipient: AztecAddress,\n) {\n let decoded = decode_private_event_message(msg_metadata, msg_content);\n\n if decoded.is_some() {\n let (event_type_id, randomness, serialized_event) = decoded.unwrap();\n\n let event_commitment =\n compute_private_serialized_event_commitment(serialized_event, randomness, event_type_id.to_field());\n\n enqueue_event_for_validation(\n contract_address,\n event_type_id,\n randomness,\n serialized_event,\n event_commitment,\n tx_hash,\n recipient,\n );\n } else {\n aztecnr_warn_log_format!(\n \"Could not decode private event message from tx {0}, ignoring\",\n )(\n [tx_hash],\n );\n }\n}\n"
3255
3203
  },
3256
- "131": {
3204
+ "129": {
3257
3205
  "function_locations": [
3258
3206
  {
3259
3207
  "name": "process_private_note_msg",
@@ -3267,7 +3215,7 @@
3267
3215
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/private_notes.nr",
3268
3216
  "source": "use crate::{\n logging::{aztecnr_debug_log_format, aztecnr_warn_log_format},\n messages::{\n discovery::{ComputeNoteHash, ComputeNoteNullifier, nonce_discovery::attempt_note_nonce_discovery},\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::note::{decode_private_note_message, MAX_NOTE_PACKED_LEN},\n processing::enqueue_note_for_validation,\n },\n protocol::{address::AztecAddress, constants::MAX_NOTE_HASHES_PER_TX, traits::ToField},\n};\n\npub(crate) unconstrained fn process_private_note_msg(\n contract_address: AztecAddress,\n tx_hash: Field,\n unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n recipient: AztecAddress,\n) {\n let decoded = decode_private_note_message(msg_metadata, msg_content);\n\n if decoded.is_some() {\n let (note_type_id, owner, storage_slot, randomness, packed_note) = decoded.unwrap();\n\n attempt_note_discovery(\n contract_address,\n tx_hash,\n unique_note_hashes_in_tx,\n first_nullifier_in_tx,\n compute_note_hash,\n compute_note_nullifier,\n owner,\n storage_slot,\n randomness,\n note_type_id,\n packed_note,\n recipient,\n );\n } else {\n aztecnr_warn_log_format!(\n \"Could not decode private note message from tx {0}, ignoring\",\n )(\n [tx_hash],\n );\n }\n}\n\n/// Attempts discovery of a note given information about its contents and the transaction in which it is suspected the\n/// note was created.\npub unconstrained fn attempt_note_discovery(\n contract_address: AztecAddress,\n tx_hash: Field,\n unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: Field,\n note_type_id: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n recipient: AztecAddress,\n) {\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n first_nullifier_in_tx,\n compute_note_hash,\n compute_note_nullifier,\n contract_address,\n owner,\n storage_slot,\n randomness,\n note_type_id,\n packed_note,\n );\n\n if discovered_notes.len() == 0 {\n // A private note message that results in no discovered notes means none of the computed note hashes matched\n // any unique note hash in the transaction. This could indicate a malformed or malicious message (e.g. a sender\n // providing bogus note content).\n aztecnr_warn_log_format!(\n \"Discarding private note message from tx {0} for contract {1}: no matching note hash found in the tx\",\n )(\n [tx_hash, contract_address.to_field()],\n );\n } else {\n aztecnr_debug_log_format!(\n \"Discovered {0} notes from a private message for contract {1}\",\n )(\n [discovered_notes.len() as Field, contract_address.to_field()],\n );\n }\n\n discovered_notes.for_each(|discovered_note| {\n enqueue_note_for_validation(\n contract_address,\n owner,\n storage_slot,\n randomness,\n discovered_note.note_nonce,\n packed_note,\n discovered_note.note_hash,\n discovered_note.inner_nullifier,\n tx_hash,\n recipient,\n );\n });\n}\n"
3269
3217
  },
3270
- "132": {
3218
+ "130": {
3271
3219
  "function_locations": [
3272
3220
  {
3273
3221
  "name": "process_message_ciphertext",
@@ -3281,7 +3229,7 @@
3281
3229
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/process_message.nr",
3282
3230
  "source": "use crate::messages::{\n discovery::{\n ComputeNoteHash, ComputeNoteNullifier, CustomMessageHandler, partial_notes::process_partial_note_private_msg,\n private_events::process_private_event_msg, private_notes::process_private_note_msg,\n },\n encoding::{decode_message, MESSAGE_CIPHERTEXT_LEN, MESSAGE_PLAINTEXT_LEN},\n encryption::{aes128::AES128, message_encryption::MessageEncryption},\n msg_type::{\n MIN_CUSTOM_MSG_TYPE_ID, PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID, PRIVATE_EVENT_MSG_TYPE_ID, PRIVATE_NOTE_MSG_TYPE_ID,\n },\n processing::MessageContext,\n};\n\nuse crate::logging::{aztecnr_debug_log, aztecnr_warn_log_format};\nuse crate::protocol::address::AztecAddress;\n\n/// Processes a message that can contain notes, partial notes, or events.\n///\n/// Notes result in nonce discovery being performed prior to delivery, which requires knowledge of the transaction hash\n/// in which the notes would've been created (typically the same transaction in which the log was emitted), along with\n/// the list of unique note hashes in said transaction and the `compute_note_hash` and `compute_note_nullifier`\n/// functions. Once discovered, the notes are enqueued for validation.\n///\n/// Partial notes result in a pending partial note entry being stored in a PXE capsule, which will later be retrieved\n/// to search for the note's completion public log.\n///\n/// Events are processed by computing an event commitment from the serialized event data and its randomness field, then\n/// enqueueing the event data and commitment for validation.\npub unconstrained fn process_message_ciphertext<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n message_ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n message_context: MessageContext,\n recipient: AztecAddress,\n) {\n let message_plaintext_option = AES128::decrypt(message_ciphertext, recipient, contract_address);\n\n if message_plaintext_option.is_some() {\n process_message_plaintext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n message_plaintext_option.unwrap(),\n message_context,\n recipient,\n );\n } else {\n aztecnr_warn_log_format!(\"Could not decrypt message ciphertext from tx {0}, ignoring\")([message_context.tx_hash]);\n }\n}\n\npub(crate) unconstrained fn process_message_plaintext<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n message_plaintext: BoundedVec<Field, MESSAGE_PLAINTEXT_LEN>,\n message_context: MessageContext,\n recipient: AztecAddress,\n) {\n // The first thing to do after decrypting the message is to determine what type of message we're processing. We\n // have 3 message types: private notes, partial notes and events.\n\n // We decode the message to obtain the message type id, metadata and content.\n let decoded = decode_message(message_plaintext);\n\n if decoded.is_some() {\n let (msg_type_id, msg_metadata, msg_content) = decoded.unwrap();\n\n if msg_type_id == PRIVATE_NOTE_MSG_TYPE_ID {\n aztecnr_debug_log!(\"Processing private note msg\");\n\n process_private_note_msg(\n contract_address,\n message_context.tx_hash,\n message_context.unique_note_hashes_in_tx,\n message_context.first_nullifier_in_tx,\n compute_note_hash,\n compute_note_nullifier,\n msg_metadata,\n msg_content,\n recipient,\n );\n } else if msg_type_id == PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID {\n aztecnr_debug_log!(\"Processing partial note private msg\");\n\n process_partial_note_private_msg(\n contract_address,\n msg_metadata,\n msg_content,\n message_context.tx_hash,\n recipient,\n );\n } else if msg_type_id == PRIVATE_EVENT_MSG_TYPE_ID {\n aztecnr_debug_log!(\"Processing private event msg\");\n\n process_private_event_msg(\n contract_address,\n msg_metadata,\n msg_content,\n message_context.tx_hash,\n recipient,\n );\n } else if msg_type_id < MIN_CUSTOM_MSG_TYPE_ID {\n // The message type ID falls in the range reserved for aztec.nr built-in types but wasn't matched above.\n // This most likely means the message is malformed or a custom message was incorrectly assigned a reserved\n // ID. Custom message types must use IDs allocated via `custom_msg_type_id`.\n aztecnr_warn_log_format!(\n \"Message type ID {0} is in the reserved range but is not recognized, ignoring. See https://docs.aztec.network/errors/3\",\n )(\n [msg_type_id as Field],\n );\n } else if process_custom_message.is_some() {\n process_custom_message.unwrap()(\n contract_address,\n msg_type_id,\n msg_metadata,\n msg_content,\n message_context,\n recipient,\n );\n } else {\n // A custom message was received but no handler is configured. This likely means the contract emits custom\n // messages but forgot to register a handler via `AztecConfig::custom_message_handler`.\n aztecnr_warn_log_format!(\n \"Received custom message with type id {0} but no handler is configured, ignoring. See https://docs.aztec.network/errors/2\",\n )(\n [msg_type_id as Field],\n );\n }\n } else {\n aztecnr_warn_log_format!(\"Could not decode message plaintext from tx {0}, ignoring\")([message_context.tx_hash]);\n }\n}\n"
3283
3231
  },
3284
- "133": {
3232
+ "131": {
3285
3233
  "function_locations": [
3286
3234
  {
3287
3235
  "name": "encode_message",
@@ -3343,7 +3291,7 @@
3343
3291
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/encoding.nr",
3344
3292
  "source": "// TODO(#12750): don't make these values assume we're using AES.\nuse crate::protocol::constants::PRIVATE_LOG_CIPHERTEXT_LEN;\nuse crate::utils::array;\n\n// We reassign to the constant here to communicate the distinction between a log and a message. In Aztec.nr, unlike in\n// protocol circuits, we have a concept of a message that can be emitted either as a private log or as an offchain\n// message. Message is a piece of data that is to be eventually delivered to a contract via the `process_message(...)`\n// utility function function that is injected by the #[aztec] macro. Note: PRIVATE_LOG_CIPHERTEXT_LEN is an amount of\n// fields, so MESSAGE_CIPHERTEXT_LEN is the size of the message in fields.\npub global MESSAGE_CIPHERTEXT_LEN: u32 = PRIVATE_LOG_CIPHERTEXT_LEN;\n\n// TODO(#12750): The global variables below should not be here as they are AES128 specific.\n// The header plaintext is 2 bytes (ciphertext length), padded to the 16-byte AES block size by PKCS#7.\npub(crate) global HEADER_CIPHERTEXT_SIZE_IN_BYTES: u32 = 16;\n// AES PKCS#7 always adds at least one byte of padding. Since each plaintext field is 32 bytes (a multiple of the\n// 16-byte AES block size), a full 16-byte padding block is always appended.\npub(crate) global AES128_PKCS7_EXPANSION_IN_BYTES: u32 = 16;\n\npub global EPH_PK_X_SIZE_IN_FIELDS: u32 = 1;\n\n// (15 - 1) * 31 - 16 - 16 = 402. Note: We multiply by 31 because ciphertext bytes are stored in fields using\n// bytes_to_fields, which packs 31 bytes per field (since a Field is ~254 bits and can safely store 31 whole bytes).\npub(crate) global MESSAGE_PLAINTEXT_SIZE_IN_BYTES: u32 = (MESSAGE_CIPHERTEXT_LEN - EPH_PK_X_SIZE_IN_FIELDS) * 31\n - HEADER_CIPHERTEXT_SIZE_IN_BYTES\n - AES128_PKCS7_EXPANSION_IN_BYTES;\n// The plaintext bytes represent Field values that were originally serialized using fields_to_bytes, which converts\n// each Field to 32 bytes. To convert the plaintext bytes back to fields, we divide by 32. 402 / 32 = 12\npub global MESSAGE_PLAINTEXT_LEN: u32 = MESSAGE_PLAINTEXT_SIZE_IN_BYTES / 32;\n\npub global MESSAGE_EXPANDED_METADATA_LEN: u32 = 1;\n\n// The standard message layout is composed of:\n// - an initial field called the 'expanded metadata'\n// - an arbitrary number of fields following that called the 'message content'\n//\n// ```\n// message: [ msg_expanded_metadata, ...msg_content ]\n// ```\n//\n// The expanded metadata itself is interpreted as a u128, of which:\n// - the upper 64 bits are the message type id\n// - the lower 64 bits are called the 'message metadata'\n//\n// ```\n// msg_expanded_metadata: [ msg_type_id | msg_metadata ]\n// <--- 64 bits --->|<--- 64 bits --->\n// ```\n//\n// The meaning of the message metadata and message content depend on the value of the message type id. Note that there\n// is nothing special about the message metadata, it _can_ be considered part of the content. It just has a different\n// name to make it distinct from the message content given that it is not a full field.\n\n/// The maximum length of a message's content, i.e. not including the expanded message metadata.\npub global MAX_MESSAGE_CONTENT_LEN: u32 = MESSAGE_PLAINTEXT_LEN - MESSAGE_EXPANDED_METADATA_LEN;\n\n/// Encodes a message following aztec-nr's standard message encoding. This message can later be decoded with\n/// `decode_message` to retrieve the original values.\n///\n/// - The `msg_type` is an identifier that groups types of messages that are all processed the same way, e.g. private\n/// notes or events. Possible values are defined in `aztec::messages::msg_type`.\n/// - The `msg_metadata` and `msg_content` are the values stored in the message, whose meaning depends on the\n/// `msg_type`. The only special thing about `msg_metadata` that separates it from `msg_content` is that it is a u64\n/// instead of a full Field (due to details of how messages are encoded), allowing applications that can fit values\n/// into this smaller variable to achieve higher data efficiency.\npub fn encode_message<let N: u32>(\n msg_type: u64,\n msg_metadata: u64,\n msg_content: [Field; N],\n) -> [Field; (N + MESSAGE_EXPANDED_METADATA_LEN)] {\n std::static_assert(\n msg_content.len() <= MAX_MESSAGE_CONTENT_LEN,\n \"Invalid message content: it must have a length of at most MAX_MESSAGE_CONTENT_LEN\",\n );\n\n // If MESSAGE_EXPANDED_METADATA_LEN is changed, causing the assertion below to fail, then the destructuring of the\n // message encoding below must be updated as well.\n std::static_assert(\n MESSAGE_EXPANDED_METADATA_LEN == 1,\n \"unexpected value for MESSAGE_EXPANDED_METADATA_LEN\",\n );\n let mut message: [Field; (N + MESSAGE_EXPANDED_METADATA_LEN)] = std::mem::zeroed();\n\n message[0] = to_expanded_metadata(msg_type, msg_metadata);\n for i in 0..msg_content.len() {\n message[MESSAGE_EXPANDED_METADATA_LEN + i] = msg_content[i];\n }\n\n message\n}\n\n/// Decodes a standard aztec-nr message, i.e. one created via `encode_message`, returning the original encoded values.\n///\n/// Returns `None` if the message is empty or has invalid (>128 bit) expanded metadata.\n///\n/// Note that `encode_message` returns a fixed size array while this function takes a `BoundedVec`: this is because\n/// prior to decoding the message type is unknown, and consequentially not known at compile time. If working with\n/// fixed-size messages, consider using `BoundedVec::from_array` to convert them.\npub unconstrained fn decode_message(\n message: BoundedVec<Field, MESSAGE_PLAINTEXT_LEN>,\n) -> Option<(u64, u64, BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>)> {\n Option::some(message)\n .and_then(|message| {\n // If MESSAGE_EXPANDED_METADATA_LEN is changed, causing the assertion below to fail, then the destructuring\n // of the\n // message encoding below must be updated as well.\n std::static_assert(\n MESSAGE_EXPANDED_METADATA_LEN == 1,\n \"unexpected value for MESSAGE_EXPANDED_METADATA_LEN\",\n );\n if message.len() < MESSAGE_EXPANDED_METADATA_LEN {\n Option::none()\n } else {\n Option::some(message.get(0))\n }\n })\n .and_then(|msg_expanded_metadata| from_expanded_metadata(msg_expanded_metadata))\n .map(|(msg_type_id, msg_metadata)| {\n let msg_content = array::subbvec(message, MESSAGE_EXPANDED_METADATA_LEN);\n (msg_type_id, msg_metadata, msg_content)\n })\n}\n\nglobal U64_SHIFT_MULTIPLIER: Field = 2.pow_32(64);\n\nfn to_expanded_metadata(msg_type: u64, msg_metadata: u64) -> Field {\n // We use multiplication instead of bit shifting operations to shift the type bits as bit shift operations are\n // expensive in circuits.\n let type_field: Field = (msg_type as Field) * U64_SHIFT_MULTIPLIER;\n let msg_metadata_field = msg_metadata as Field;\n\n type_field + msg_metadata_field\n}\n\nglobal TWO_POW_128: Field = 2.pow_32(128);\n\n/// Unpacks expanded metadata into (msg_type, msg_metadata). Returns `None` if `input >= 2^128`.\nfn from_expanded_metadata(input: Field) -> Option<(u64, u64)> {\n if input.lt(TWO_POW_128) {\n let msg_metadata = (input as u64);\n let msg_type = ((input - (msg_metadata as Field)) / U64_SHIFT_MULTIPLIER) as u64;\n // Use division instead of bit shift since bit shifts are expensive in circuits\n Option::some((msg_type, msg_metadata))\n } else {\n Option::none()\n }\n}\n\nmod tests {\n use crate::utils::array::subarray::subarray;\n use super::{\n decode_message, encode_message, from_expanded_metadata, MAX_MESSAGE_CONTENT_LEN, to_expanded_metadata,\n TWO_POW_128,\n };\n\n global U64_MAX: u64 = (2.pow_32(64) - 1) as u64;\n global U128_MAX: Field = (2.pow_32(128) - 1);\n\n #[test]\n unconstrained fn encode_decode_empty_message(msg_type: u64, msg_metadata: u64) {\n let encoded = encode_message(msg_type, msg_metadata, []);\n let (decoded_msg_type, decoded_msg_metadata, decoded_msg_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_msg_type, msg_type);\n assert_eq(decoded_msg_metadata, msg_metadata);\n assert_eq(decoded_msg_content.len(), 0);\n }\n\n #[test]\n unconstrained fn encode_decode_short_message(\n msg_type: u64,\n msg_metadata: u64,\n msg_content: [Field; MAX_MESSAGE_CONTENT_LEN / 2],\n ) {\n let encoded = encode_message(msg_type, msg_metadata, msg_content);\n let (decoded_msg_type, decoded_msg_metadata, decoded_msg_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_msg_type, msg_type);\n assert_eq(decoded_msg_metadata, msg_metadata);\n assert_eq(decoded_msg_content.len(), msg_content.len());\n assert_eq(subarray(decoded_msg_content.storage(), 0), msg_content);\n }\n\n #[test]\n unconstrained fn encode_decode_full_message(\n msg_type: u64,\n msg_metadata: u64,\n msg_content: [Field; MAX_MESSAGE_CONTENT_LEN],\n ) {\n let encoded = encode_message(msg_type, msg_metadata, msg_content);\n let (decoded_msg_type, decoded_msg_metadata, decoded_msg_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_msg_type, msg_type);\n assert_eq(decoded_msg_metadata, msg_metadata);\n assert_eq(decoded_msg_content.len(), msg_content.len());\n assert_eq(subarray(decoded_msg_content.storage(), 0), msg_content);\n }\n\n #[test]\n unconstrained fn to_expanded_metadata_packing() {\n // Test case 1: All bits set\n let packed = to_expanded_metadata(U64_MAX, U64_MAX);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 2: Only log type bits set\n let packed = to_expanded_metadata(U64_MAX, 0);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, 0);\n\n // Test case 3: Only msg_metadata bits set\n let packed = to_expanded_metadata(0, U64_MAX);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 4: No bits set\n let packed = to_expanded_metadata(0, 0);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, 0);\n }\n\n #[test]\n unconstrained fn from_expanded_metadata_packing() {\n // Test case 1: All bits set\n let input = U128_MAX as Field;\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 2: Only log type bits set\n let input = (U128_MAX - U64_MAX as Field);\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, 0);\n\n // Test case 3: Only msg_metadata bits set\n let input = U64_MAX as Field;\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 4: No bits set\n let input = 0;\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, 0);\n }\n\n #[test]\n unconstrained fn to_from_expanded_metadata(original_msg_type: u64, original_msg_metadata: u64) {\n let packed = to_expanded_metadata(original_msg_type, original_msg_metadata);\n let (unpacked_msg_type, unpacked_msg_metadata) = from_expanded_metadata(packed).unwrap();\n\n assert_eq(original_msg_type, unpacked_msg_type);\n assert_eq(original_msg_metadata, unpacked_msg_metadata);\n }\n\n #[test]\n unconstrained fn encode_decode_max_size_message() {\n let msg_type_id: u64 = 42;\n let msg_metadata: u64 = 99;\n let mut msg_content = [0; MAX_MESSAGE_CONTENT_LEN];\n for i in 0..MAX_MESSAGE_CONTENT_LEN {\n msg_content[i] = i as Field;\n }\n\n let encoded = encode_message(msg_type_id, msg_metadata, msg_content);\n let (decoded_type_id, decoded_metadata, decoded_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_type_id, msg_type_id);\n assert_eq(decoded_metadata, msg_metadata);\n assert_eq(decoded_content, BoundedVec::from_array(msg_content));\n }\n\n #[test(should_fail_with = \"Invalid message content: it must have a length of at most MAX_MESSAGE_CONTENT_LEN\")]\n fn encode_oversized_message_fails() {\n let msg_content = [0; MAX_MESSAGE_CONTENT_LEN + 1];\n let _ = encode_message(0, 0, msg_content);\n }\n\n #[test]\n unconstrained fn decode_empty_message_returns_none() {\n assert(decode_message(BoundedVec::new()).is_none());\n }\n\n #[test]\n unconstrained fn decode_message_with_oversized_metadata_returns_none() {\n let message = BoundedVec::from_array([TWO_POW_128]);\n assert(decode_message(message).is_none());\n }\n}\n"
3345
3293
  },
3346
- "134": {
3294
+ "132": {
3347
3295
  "function_locations": [
3348
3296
  {
3349
3297
  "name": "extract_many_close_to_uniformly_random_256_bits_using_poseidon2",
@@ -3429,7 +3377,7 @@
3429
3377
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/encryption/aes128.nr",
3430
3378
  "source": "use crate::protocol::{address::AztecAddress, public_keys::AddressPoint, traits::ToField};\n\nuse crate::{\n keys::{\n ecdh_shared_secret::{\n compute_app_siloed_shared_secret, derive_ecdh_shared_secret, derive_shared_secret_field_mask,\n derive_shared_secret_subkey,\n },\n ephemeral::generate_positive_ephemeral_key_pair,\n },\n logging::aztecnr_warn_log_format,\n messages::{\n encoding::{\n EPH_PK_X_SIZE_IN_FIELDS, HEADER_CIPHERTEXT_SIZE_IN_BYTES, MESSAGE_CIPHERTEXT_LEN, MESSAGE_PLAINTEXT_LEN,\n MESSAGE_PLAINTEXT_SIZE_IN_BYTES,\n },\n encryption::message_encryption::MessageEncryption,\n logs::arithmetic_generics_utils::{\n get_arr_of_size__message_bytes__from_PT, get_arr_of_size__message_bytes_padding__from_PT,\n },\n },\n oracle::{aes128_decrypt::try_aes128_decrypt, random::random, shared_secret::get_shared_secret},\n utils::{\n array,\n conversion::{\n bytes_to_fields::{bytes_from_fields, bytes_to_fields},\n fields_to_bytes::{fields_to_bytes, try_fields_from_bytes},\n },\n point::point_from_x_coord_and_sign,\n },\n};\n\nuse std::aes128::aes128_encrypt;\n\n/// Computes N close-to-uniformly-random 256 bits from a given app-siloed shared secret.\n///\n/// NEVER re-use the same iv and sym_key. DO NOT call this function more than once with the same s_app.\n///\n/// This function is only known to be safe if s_app is derived from combining a random ephemeral key with an\n/// address point and a contract address. See big comment within the body of the function.\nfn extract_many_close_to_uniformly_random_256_bits_using_poseidon2<let N: u32>(s_app: Field) -> [[u8; 32]; N] {\n /*\n * Unsafe because of https://eprint.iacr.org/2010/264.pdf Page 13, Lemma 2 (and the two paragraphs below it).\n *\n * If you call this function, you need to be careful and aware of how the arg `s_app` has been derived.\n *\n * The paper says that the way you derive aes keys and IVs should be fine with poseidon2 (modelled as a RO),\n * as long as you _don't_ use Poseidon2 as a PRG to generate the two exponents x & y which multiply to the\n * shared secret S:\n *\n * S = [x*y]*G.\n *\n * (Otherwise, you would have to \"key\" poseidon2, i.e. generate a uniformly string K which can be public and\n * compute Hash(x) as poseidon(K,x)).\n * In that lemma, k would be 2*254=508, and m would be the number of points on the grumpkin curve (which is\n * close to r according to the Hasse bound).\n *\n * Our shared secret S is [esk * address_sk] * G, and the question is: Can we compute hash(S) using poseidon2\n * instead of sha256?\n *\n * Well, esk is random and not generated with poseidon2, so that's good.\n * What about address_sk?\n * Well, address_sk = poseidon2(stuff) + ivsk, so there was some discussion about whether address_sk is\n * independent of poseidon2. Given that ivsk is random and independent of poseidon2, the address_sk is also\n * independent of poseidon2.\n *\n * Tl;dr: we believe it's safe to hash S = [esk * address_sk] * G using poseidon2, in order to derive a\n * symmetric key.\n *\n * If you're calling this function for a differently-derived `s_app`, be careful.\n */\n \n\n /* The output of this function needs to be 32 random bytes.\n * A single field won't give us 32 bytes of entropy. So we compute two \"random\" fields, by poseidon-hashing\n * with two different indices. We then extract the last 16 (big endian) bytes of each \"random\" field.\n * Note: we use to_be_bytes because it's slightly more efficient. But we have to be careful not to take bytes\n * from the \"big end\", because the \"big\" byte is not uniformly random over the byte: it only has < 6 bits of\n * randomness, because it's the big end of a 254-bit field element.\n */\n\n let mut all_bytes: [[u8; 32]; N] = std::mem::zeroed();\n std::static_assert(N < 256, \"N too large\");\n for k in 0..N {\n let rand1: Field = derive_shared_secret_subkey(s_app, 2 * k);\n let rand2: Field = derive_shared_secret_subkey(s_app, 2 * k + 1);\n\n let rand1_bytes: [u8; 32] = rand1.to_be_bytes();\n let rand2_bytes: [u8; 32] = rand2.to_be_bytes();\n\n let mut bytes: [u8; 32] = [0; 32];\n for i in 0..16 {\n // We take bytes from the \"little end\" of the be-bytes arrays:\n let j = 32 - i - 1;\n bytes[i] = rand1_bytes[j];\n bytes[16 + i] = rand2_bytes[j];\n }\n\n all_bytes[k] = bytes;\n }\n\n all_bytes\n}\n\nfn derive_aes_symmetric_key_and_iv_from_uniformly_random_256_bits<let N: u32>(\n many_random_256_bits: [[u8; 32]; N],\n) -> [([u8; 16], [u8; 16]); N] {\n // Many (sym_key, iv) pairs:\n let mut many_pairs: [([u8; 16], [u8; 16]); N] = std::mem::zeroed();\n for k in 0..N {\n let random_256_bits = many_random_256_bits[k];\n let mut sym_key = [0; 16];\n let mut iv = [0; 16];\n for i in 0..16 {\n sym_key[i] = random_256_bits[i];\n iv[i] = random_256_bits[i + 16];\n }\n many_pairs[k] = (sym_key, iv);\n }\n\n many_pairs\n}\n\npub fn derive_aes_symmetric_key_and_iv_from_shared_secret<let N: u32>(s_app: Field) -> [([u8; 16], [u8; 16]); N] {\n let many_random_256_bits: [[u8; 32]; N] = extract_many_close_to_uniformly_random_256_bits_using_poseidon2(s_app);\n\n derive_aes_symmetric_key_and_iv_from_uniformly_random_256_bits(many_random_256_bits)\n}\n\npub struct AES128 {}\n\nimpl MessageEncryption for AES128 {\n\n /// AES128-CBC encryption for Aztec protocol messages.\n ///\n /// ## Overview\n ///\n /// The plaintext is an array of up to `MESSAGE_PLAINTEXT_LEN` (12) fields. The output is always exactly\n /// `MESSAGE_CIPHERTEXT_LEN` (15) fields, regardless of plaintext size. All output fields except the\n /// ephemeral public key are uniformly random `Field` values to any observer without knowledge of the\n /// shared secret, making all encrypted messages indistinguishable by size or content.\n ///\n /// ## PKCS#7 Padding\n ///\n /// AES operates on 16-byte blocks, so the plaintext must be padded to a multiple of 16. PKCS#7 padding always\n /// adds at least 1 byte (so the receiver can always detect and strip it), which means:\n /// - 1 B plaintext -> 15 B padding -> 16 B total\n /// - 15 B plaintext -> 1 B padding -> 16 B total\n /// - 16 B plaintext -> 16 B padding -> 32 B total (full extra block)\n ///\n /// In general: if the plaintext is already a multiple of 16, a full 16-byte padding block is appended.\n ///\n /// ## Encryption Steps\n ///\n /// **1. Body encryption.** The plaintext fields are serialized to bytes (32 bytes per field) and AES-128-CBC\n /// encrypted. Since 32 is a multiple of 16, PKCS#7 always adds a full 16-byte padding block (see above):\n ///\n /// ```text\n /// +---------------------------------------------+\n /// | body ct |\n /// | PlaintextLen*32 + 16 B |\n /// +-------------------------------+--------------+\n /// | encrypted plaintext fields | PKCS#7 (16B) |\n /// | (serialized at 32 B each) | |\n /// +-------------------------------+--------------+\n /// ```\n ///\n /// **2. Header encryption.** The byte length of `body_ct` is stored as a 2-byte big-endian integer. This 2-byte\n /// header plaintext is then AES-encrypted; PKCS#7 pads the remaining 14 bytes to fill one 16-byte AES block,\n /// producing a 16-byte header ciphertext:\n ///\n /// ```text\n /// +---------------------------+\n /// | header ct |\n /// | 16 B |\n /// +--------+------------------+\n /// | body ct| PKCS#7 (14B) |\n /// | length | |\n /// | (2 B) | |\n /// +--------+------------------+\n /// ```\n ///\n /// ## Wire Format\n ///\n /// Messages are transmitted as fields, not bytes. A field is ~254 bits and can safely store 31 whole bytes, so\n /// we need to pack our byte data into 31-byte chunks. This packing drives the wire format.\n ///\n /// **Step 1 -- Assemble bytes.** The ciphertexts are laid out in a byte array, padded with zero bytes to a\n /// multiple of 31 so it divides evenly into fields:\n ///\n /// ```text\n /// +------------+-------------------------+---------+\n /// | header ct | body ct | byte pad|\n /// | 16 B | PlaintextLen*32 + 16 B | (zeros) |\n /// +------------+-------------------------+---------+\n /// |<-------- padded to a multiple of 31 B -------->|\n /// ```\n ///\n /// **Step 2 -- Pack and mask.** The byte array is split into 31-byte chunks, each stored in one field. A\n /// Poseidon2-derived mask (see `derive_shared_secret_field_mask`) is added to each so that the resulting\n /// fields appear as uniformly random `Field` values to any observer without knowledge of the shared secret,\n /// hiding the fact that the underlying ciphertext consists of 128-bit AES blocks.\n ///\n /// **Step 3 -- Assemble ciphertext.** The ephemeral public key x-coordinate is prepended and random field padding\n /// is appended to fill to 15 fields:\n ///\n /// ```text\n /// +----------+-------------------------+-------------------+\n /// | eph_pk.x | masked message fields | random field pad |\n /// | | (packed 31 B per field) | (fills to 15) |\n /// +----------+-------------------------+-------------------+\n /// |<---------- MESSAGE_CIPHERTEXT_LEN = 15 fields -------->|\n /// ```\n ///\n /// ## Key Derivation\n ///\n /// The raw ECDH shared secret point is first app-siloed into a scalar `s_app` by hashing with the contract\n /// address (see\n /// [`compute_app_siloed_shared_secret`](crate::keys::ecdh_shared_secret::compute_app_siloed_shared_secret)).\n /// Two (key, IV) pairs are then derived from `s_app` via indexed Poseidon2 hashing: one pair for the body\n /// ciphertext and one for the header ciphertext.\n fn encrypt<let PlaintextLen: u32>(\n plaintext: [Field; PlaintextLen],\n recipient: AztecAddress,\n contract_address: AztecAddress,\n ) -> [Field; MESSAGE_CIPHERTEXT_LEN] {\n std::static_assert(\n PlaintextLen <= MESSAGE_PLAINTEXT_LEN,\n \"Plaintext length exceeds MESSAGE_PLAINTEXT_LEN\",\n );\n\n // AES 128 operates on bytes, not fields, so we need to convert the fields to bytes. (This process is then\n // reversed when processing the message in `process_message_ciphertext`)\n let plaintext_bytes = fields_to_bytes(plaintext);\n\n // Derive ECDH shared secret with recipient using a fresh ephemeral keypair.\n let (eph_sk, eph_pk) = generate_positive_ephemeral_key_pair();\n\n let raw_shared_secret = derive_ecdh_shared_secret(\n eph_sk,\n recipient\n .to_address_point()\n .unwrap_or_else(|| {\n aztecnr_warn_log_format!(\n \"Attempted to encrypt message for an invalid recipient ({0})\",\n )(\n [recipient.to_field()],\n );\n\n // Safety: if the recipient is an invalid address, then it is not possible to encrypt a message for\n // them because we cannot establish a shared secret. This is never expected to occur during normal\n // operation. However, it is technically possible for us to receive an invalid address, and we must\n // therefore handle it. We could simply fail, but that'd introduce a potential security issue in\n // which an attacker forces a contract to encrypt a message for an invalid address, resulting in an\n // impossible transaction - this is sometimes called a 'king of the hill' attack. We choose instead\n // to not fail and encrypt the plaintext regardless using the shared secret that results from a\n // random valid address. The sender is free to choose this address and hence shared secret, but\n // this has no security implications as they already know not only the full plaintext but also the\n // ephemeral private key anyway.\n unsafe {\n random_address_point()\n }\n })\n .inner,\n );\n\n let s_app = compute_app_siloed_shared_secret(raw_shared_secret, contract_address);\n\n // It is safe to derive AES keys from `s_app` using Poseidon2 because `s_app` was derived from an ECDH shared\n // secret using an AztecAddress (the recipient). See the block comment in\n // `extract_many_close_to_uniformly_random_256_bits_using_poseidon2` for more info.\n let pairs = derive_aes_symmetric_key_and_iv_from_shared_secret::<2>(s_app);\n let (body_sym_key, body_iv) = pairs[0];\n let (header_sym_key, header_iv) = pairs[1];\n\n let ciphertext_bytes = aes128_encrypt(plaintext_bytes, body_iv, body_sym_key);\n\n // Each plaintext field is 32 bytes (a multiple of the 16-byte AES block\n // size), so PKCS#7 always appends a full 16-byte padding block:\n // |ciphertext| = PlaintextLen*32 + 16 = 16 * (1 + PlaintextLen*32 / 16)\n std::static_assert(\n ciphertext_bytes.len() == 16 * (1 + (PlaintextLen * 32) / 16),\n \"unexpected ciphertext length\",\n );\n\n // Encrypt a 2-byte header containing the body ciphertext length.\n let header_plaintext = encode_header(ciphertext_bytes.len());\n\n // Note: the aes128_encrypt builtin fn automatically appends bytes to the input, according to pkcs#7; hence why\n // the output `header_ciphertext_bytes` is 16 bytes larger than the input in this case.\n let header_ciphertext_bytes = aes128_encrypt(header_plaintext, header_iv, header_sym_key);\n // Verify expected header ciphertext size at compile time.\n std::static_assert(\n header_ciphertext_bytes.len() == HEADER_CIPHERTEXT_SIZE_IN_BYTES,\n \"unexpected ciphertext header length\",\n );\n\n // Assemble the message byte array:\n // [header_ct (16B)] [body_ct] [padding to mult of 31]\n let message_bytes_padding_to_mult_31 = get_arr_of_size__message_bytes_padding__from_PT::<PlaintextLen * 32>();\n\n let mut message_bytes = get_arr_of_size__message_bytes__from_PT::<PlaintextLen * 32>();\n\n std::static_assert(\n message_bytes.len() % 31 == 0,\n \"Unexpected error: message_bytes.len() should be divisible by 31, by construction.\",\n );\n\n let mut offset = 0;\n for i in 0..header_ciphertext_bytes.len() {\n message_bytes[offset + i] = header_ciphertext_bytes[i];\n }\n offset += header_ciphertext_bytes.len();\n\n for i in 0..ciphertext_bytes.len() {\n message_bytes[offset + i] = ciphertext_bytes[i];\n }\n offset += ciphertext_bytes.len();\n\n for i in 0..message_bytes_padding_to_mult_31.len() {\n message_bytes[offset + i] = message_bytes_padding_to_mult_31[i];\n }\n offset += message_bytes_padding_to_mult_31.len();\n\n // Ideally we would be able to have a static assert where we check that the offset would be such that we've\n // written to the entire log_bytes array, but we cannot since Noir does not treat the offset as a comptime\n // value (despite the values that it goes through being known at each stage). We instead check that the\n // computation used to obtain the offset computes the expected value (which we _can_ do in a static check), and\n // then add a cheap runtime check to also validate that the offset matches this.\n std::static_assert(\n header_ciphertext_bytes.len() + ciphertext_bytes.len() + message_bytes_padding_to_mult_31.len()\n == message_bytes.len(),\n \"unexpected message length\",\n );\n assert(offset == message_bytes.len(), \"unexpected encrypted message length\");\n\n // Pack message bytes into fields (31 bytes per field) and prepend eph_pk.x.\n let message_bytes_as_fields = bytes_to_fields(message_bytes);\n\n let mut ciphertext: [Field; MESSAGE_CIPHERTEXT_LEN] = [0; MESSAGE_CIPHERTEXT_LEN];\n\n ciphertext[0] = eph_pk.x;\n\n // Mask each content field with a Poseidon2-derived value, so that they appear as uniformly random `Field`\n // values\n let mut offset = 1;\n for i in 0..message_bytes_as_fields.len() {\n let mask = derive_shared_secret_field_mask(s_app, i as u32);\n ciphertext[offset + i] = message_bytes_as_fields[i] + mask;\n }\n offset += message_bytes_as_fields.len();\n\n // Pad with random fields so that padding is indistinguishable from masked data fields.\n for i in offset..MESSAGE_CIPHERTEXT_LEN {\n // Safety: we assume that the sender wants for the message to be private - a malicious one could simply\n // reveal its contents publicly. It is therefore fine to trust the sender to provide random padding.\n ciphertext[i] = unsafe { random() };\n }\n\n ciphertext\n }\n\n unconstrained fn decrypt(\n ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n recipient: AztecAddress,\n contract_address: AztecAddress,\n ) -> Option<BoundedVec<Field, MESSAGE_PLAINTEXT_LEN>> {\n // Extract the ephemeral public key x-coordinate and masked fields, returning None for empty ciphertext.\n if ciphertext.len() > 0 {\n let masked_fields: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN - EPH_PK_X_SIZE_IN_FIELDS> =\n array::subbvec(ciphertext, EPH_PK_X_SIZE_IN_FIELDS);\n Option::some((ciphertext.get(0), masked_fields))\n } else {\n Option::none()\n }\n .and_then(|(eph_pk_x, masked_fields)| {\n // With the x-coordinate of the ephemeral public key we can reconstruct the point as we know that the\n // y-coordinate must be positive. This may fail however, as not all x-coordinates are on the curve. In\n // that case, we simply return `Option::none`.\n point_from_x_coord_and_sign(eph_pk_x, true).and_then(|eph_pk| {\n let s_app = get_shared_secret(recipient, eph_pk, contract_address);\n\n let unmasked_fields = masked_fields.mapi(|i, field| {\n let unmasked = unmask_field(s_app, i, field);\n // If we failed to unmask the field, we are dealing with the random padding. We'll ignore it\n // later, so we can simply set it to 0\n unmasked.unwrap_or(0)\n });\n let ciphertext_without_eph_pk_x = bytes_from_fields(unmasked_fields);\n\n // Derive symmetric keys:\n let pairs = derive_aes_symmetric_key_and_iv_from_shared_secret::<2>(s_app);\n let (body_sym_key, body_iv) = pairs[0];\n let (header_sym_key, header_iv) = pairs[1];\n\n // Extract the header ciphertext\n let header_start = 0;\n let header_ciphertext: [u8; HEADER_CIPHERTEXT_SIZE_IN_BYTES] =\n array::subarray(ciphertext_without_eph_pk_x.storage(), header_start);\n // We need to convert the array to a BoundedVec because the oracle expects a BoundedVec as it's\n // designed to work with messages with unknown length at compile time. This would not be necessary\n // here as the header ciphertext length is fixed. But we do it anyway to not have to have duplicate\n // oracles.\n let header_ciphertext_bvec =\n BoundedVec::<u8, HEADER_CIPHERTEXT_SIZE_IN_BYTES>::from_array(header_ciphertext);\n\n try_aes128_decrypt(header_ciphertext_bvec, header_iv, header_sym_key)\n // Extract ciphertext length from header (2 bytes, big-endian)\n .and_then(|header_plaintext| extract_ciphertext_length(header_plaintext))\n .filter(|ciphertext_length| ciphertext_length <= MESSAGE_PLAINTEXT_SIZE_IN_BYTES)\n .map(|ciphertext_length| {\n // Extract and decrypt main ciphertext\n let ciphertext_start = header_start + HEADER_CIPHERTEXT_SIZE_IN_BYTES;\n let ciphertext_with_padding: [u8; MESSAGE_PLAINTEXT_SIZE_IN_BYTES] =\n array::subarray(ciphertext_without_eph_pk_x.storage(), ciphertext_start);\n BoundedVec::from_parts(ciphertext_with_padding, ciphertext_length)\n })\n // Decrypt main ciphertext and return it\n .and_then(|ciphertext| try_aes128_decrypt(ciphertext, body_iv, body_sym_key))\n // Convert bytes back to fields (32 bytes per field). Returns None if the actual bytes are\n // not valid.\n .and_then(|plaintext_bytes| try_fields_from_bytes(plaintext_bytes))\n })\n })\n }\n}\n\n/// Encodes the body ciphertext length into a 2-byte big-endian header.\nfn encode_header(ciphertext_length: u32) -> [u8; 2] {\n [(ciphertext_length >> 8) as u8, ciphertext_length as u8]\n}\n\n/// Extracts the body ciphertext length from a decrypted header as a 2-byte big-endian integer.\n///\n/// Returns `Option::none()` if the header has fewer than 2 bytes.\nunconstrained fn extract_ciphertext_length<let N: u32>(header: BoundedVec<u8, N>) -> Option<u32> {\n if header.len() >= 2 {\n Option::some(((header.get(0) as u32) << 8) | (header.get(1) as u32))\n } else {\n Option::none()\n }\n}\n\n/// 2^248: upper bound for values that fit in 31 bytes\nglobal TWO_POW_248: Field = 2.pow_32(248);\n\n/// Removes the Poseidon2-derived mask from a ciphertext field. Returns the unmasked value if it fits in 31 bytes\n/// (a content field), or `None` if it doesn't (random padding). Unconstrained to prevent accidental use in\n/// constrained context.\nunconstrained fn unmask_field(s_app: Field, index: u32, masked: Field) -> Option<Field> {\n let unmasked = masked - derive_shared_secret_field_mask(s_app, index);\n if unmasked.lt(TWO_POW_248) {\n Option::some(unmasked)\n } else {\n Option::none()\n }\n}\n\n/// Produces a random valid address point, i.e. one that is on the curve. This is equivalent to calling\n/// [`AztecAddress::to_address_point`] on a random valid address.\nunconstrained fn random_address_point() -> AddressPoint {\n let mut result = std::mem::zeroed();\n\n loop {\n // We simply produce random x coordinates until we find one that is on the curve. About half of the x\n // coordinates fulfill this condition, so this should only take a few iterations at most.\n let x_coord = random();\n let point = point_from_x_coord_and_sign(x_coord, true);\n if point.is_some() {\n result = AddressPoint { inner: point.unwrap() };\n break;\n }\n }\n\n result\n}\n\nmod test {\n use crate::{\n keys::ecdh_shared_secret::{compute_app_siloed_shared_secret, derive_ecdh_shared_secret},\n messages::{\n encoding::{HEADER_CIPHERTEXT_SIZE_IN_BYTES, MESSAGE_PLAINTEXT_LEN, MESSAGE_PLAINTEXT_SIZE_IN_BYTES},\n encryption::message_encryption::MessageEncryption,\n },\n test::helpers::test_environment::TestEnvironment,\n };\n use crate::protocol::{address::AztecAddress, traits::FromField};\n use super::{AES128, encode_header, random_address_point};\n use std::{embedded_curve_ops::EmbeddedCurveScalar, test::OracleMock};\n\n #[test]\n unconstrained fn encrypt_decrypt_deterministic() {\n let env = TestEnvironment::new();\n\n // Message decryption requires oracles that are only available during private execution\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3];\n\n let recipient = AztecAddress::from_field(\n 0x25afb798ea6d0b8c1618e50fdeafa463059415013d3b7c75d46abf5e242be70c,\n );\n\n // Mock random values for deterministic test\n let eph_sk = 0x1358d15019d4639393d62b97e1588c095957ce74a1c32d6ec7d62fe6705d9538;\n let _ = OracleMock::mock(\"aztec_utl_getRandomField\").returns(eph_sk).times(1);\n\n let randomness = 0x0101010101010101010101010101010101010101010101010101010101010101;\n let _ = OracleMock::mock(\"aztec_utl_getRandomField\").returns(randomness).times(1000000);\n\n let _ = OracleMock::mock(\"aztec_prv_getNextAppTagAsSender\").returns(42);\n\n // Encrypt the message\n let encrypted_message = BoundedVec::from_array(AES128::encrypt(plaintext, recipient, contract_address));\n\n // Compute the same app-siloed shared secret that the oracle would return\n let raw_shared_secret = derive_ecdh_shared_secret(\n EmbeddedCurveScalar::from_field(eph_sk),\n recipient.to_address_point().unwrap().inner,\n );\n let s_app = compute_app_siloed_shared_secret(raw_shared_secret, contract_address);\n\n let _ = OracleMock::mock(\"aztec_utl_getSharedSecret\").returns(s_app);\n\n // Decrypt the message\n let decrypted = AES128::decrypt(encrypted_message, recipient, contract_address).unwrap();\n\n // The decryption function spits out a BoundedVec because it's designed to work with messages with unknown\n // length at compile time. For this reason we need to convert the original input to a BoundedVec.\n let plaintext_bvec = BoundedVec::<Field, MESSAGE_PLAINTEXT_LEN>::from_array(plaintext);\n\n // Verify decryption matches original plaintext\n assert_eq(decrypted, plaintext_bvec, \"Decrypted bytes should match original plaintext\");\n\n // The following is a workaround of \"struct is never constructed\" Noir compilation error (we only ever use\n // static methods of the struct).\n let _ = AES128 {};\n });\n }\n\n #[test]\n unconstrained fn encrypt_decrypt_random() {\n // Same as `encrypt_decrypt_deterministic`, except we don't mock any of the oracles and rely on\n // `TestEnvironment` instead.\n let mut env = TestEnvironment::new();\n\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3];\n let ciphertext = AES128::encrypt(plaintext, recipient, contract_address);\n\n assert_eq(\n AES128::decrypt(\n BoundedVec::from_array(ciphertext),\n recipient,\n contract_address,\n )\n .unwrap(),\n BoundedVec::from_array(plaintext),\n );\n });\n }\n\n #[test]\n unconstrained fn encrypt_to_invalid_address() {\n // x = 3 is a non-residue for this curve, resulting in an invalid address\n let invalid_address = AztecAddress { inner: 3 };\n let contract_address = AztecAddress { inner: 42 };\n\n let _ = AES128::encrypt([1, 2, 3, 4], invalid_address, contract_address);\n }\n\n // Documents the PKCS#7 padding behavior that `encrypt` relies on (see its static_assert).\n #[test]\n fn pkcs7_padding_always_adds_at_least_one_byte() {\n let key = [0 as u8; 16];\n let iv = [0 as u8; 16];\n\n // 1 byte input + 15 bytes padding = 16 bytes\n assert_eq(std::aes128::aes128_encrypt([0; 1], iv, key).len(), 16);\n\n // 15 bytes input + 1 byte padding = 16 bytes\n assert_eq(std::aes128::aes128_encrypt([0; 15], iv, key).len(), 16);\n\n // 16 bytes input (block-aligned) + full 16-byte padding block = 32 bytes\n assert_eq(std::aes128::aes128_encrypt([0; 16], iv, key).len(), 32);\n }\n\n #[test]\n unconstrained fn encrypt_decrypt_max_size_plaintext() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let mut plaintext = [0; MESSAGE_PLAINTEXT_LEN];\n for i in 0..MESSAGE_PLAINTEXT_LEN {\n plaintext[i] = i as Field;\n }\n let ciphertext = AES128::encrypt(plaintext, recipient, contract_address);\n\n assert_eq(\n AES128::decrypt(\n BoundedVec::from_array(ciphertext),\n recipient,\n contract_address,\n )\n .unwrap(),\n BoundedVec::from_array(plaintext),\n );\n });\n }\n\n #[test(should_fail_with = \"Plaintext length exceeds MESSAGE_PLAINTEXT_LEN\")]\n unconstrained fn encrypt_oversized_plaintext() {\n let address = AztecAddress { inner: 3 };\n let contract_address = AztecAddress { inner: 42 };\n let plaintext: [Field; MESSAGE_PLAINTEXT_LEN + 1] = [0; MESSAGE_PLAINTEXT_LEN + 1];\n let _ = AES128::encrypt(plaintext, address, contract_address);\n }\n\n #[test]\n unconstrained fn random_address_point_produces_valid_points() {\n // About half of random addresses are invalid, so testing just a couple gives us high confidence that\n // `random_address_point` is indeed producing valid addresses.\n for _ in 0..10 {\n let random_address = AztecAddress { inner: random_address_point().inner.x };\n assert(random_address.to_address_point().is_some());\n }\n }\n\n #[test]\n unconstrained fn decrypt_invalid_ephemeral_public_key() {\n let mut env = TestEnvironment::new();\n\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3, 4];\n let ciphertext = AES128::encrypt(plaintext, recipient, contract_address);\n\n // The first field of the ciphertext is the x-coordinate of the ephemeral public key. We set it to a known\n // non-residue (3), causing `decrypt` to fail to produce a decryption shared secret.\n let mut bad_ciphertext = BoundedVec::from_array(ciphertext);\n bad_ciphertext.set(0, 3);\n\n assert(AES128::decrypt(bad_ciphertext, recipient, contract_address).is_none());\n });\n }\n\n #[test]\n unconstrained fn decrypt_returns_none_on_empty_ciphertext() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n assert(AES128::decrypt(BoundedVec::new(), recipient, contract_address).is_none());\n });\n }\n\n // Mocks the header AES decrypt oracle to return an empty result. The TS oracle never throws on invalid\n // input: it decrypts to garbage bytes or returns empty\n #[test]\n unconstrained fn decrypt_returns_none_on_empty_header() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3];\n let ciphertext = BoundedVec::from_array(AES128::encrypt(plaintext, recipient, contract_address));\n\n let empty_header = BoundedVec::<u8, HEADER_CIPHERTEXT_SIZE_IN_BYTES>::new();\n let _ = OracleMock::mock(\"aztec_utl_decryptAes128\").returns(Option::some(empty_header)).times(1);\n\n assert(AES128::decrypt(ciphertext, recipient, contract_address).is_none());\n });\n }\n\n // Mocks the header oracle to return a 2-byte header that decodes to a ciphertext_length one past the maximum\n // allowed value, verifying the edge case is handled correctly.\n #[test]\n unconstrained fn decrypt_returns_none_on_oversized_ciphertext_length() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3];\n let ciphertext = BoundedVec::from_array(AES128::encrypt(plaintext, recipient, contract_address));\n\n let bad_header = BoundedVec::<u8, HEADER_CIPHERTEXT_SIZE_IN_BYTES>::from_array(encode_header(\n MESSAGE_PLAINTEXT_SIZE_IN_BYTES + 1,\n ));\n let _ = OracleMock::mock(\"aztec_utl_decryptAes128\").returns(Option::some(bad_header)).times(1);\n\n assert(AES128::decrypt(ciphertext, recipient, contract_address).is_none());\n });\n }\n\n}\n"
3431
3379
  },
3432
- "139": {
3380
+ "137": {
3433
3381
  "function_locations": [
3434
3382
  {
3435
3383
  "name": "encode_private_event_message",
@@ -3455,7 +3403,7 @@
3455
3403
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/logs/event.nr",
3456
3404
  "source": "use crate::{\n event::{event_interface::EventInterface, EventSelector},\n messages::{\n encoding::{encode_message, MAX_MESSAGE_CONTENT_LEN, MESSAGE_EXPANDED_METADATA_LEN},\n msg_type::PRIVATE_EVENT_MSG_TYPE_ID,\n },\n utils::array,\n};\nuse crate::protocol::traits::{FromField, Serialize, ToField};\n\n/// The number of fields in a private event message content that are not the event's serialized representation (1 field\n/// for randomness).\npub(crate) global PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN: u32 = 1;\npub(crate) global PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX: u32 = 0;\n\n/// The maximum length of the packed representation of an event's contents. This is limited by private log size,\n/// encryption overhead and extra fields in the message (e.g. message type id, randomness, etc.).\npub global MAX_EVENT_SERIALIZED_LEN: u32 = MAX_MESSAGE_CONTENT_LEN - PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN;\n\n/// Creates the plaintext for a private event message (i.e. one of type [`PRIVATE_EVENT_MSG_TYPE_ID`]).\n///\n/// This plaintext is meant to be decoded via [`decode_private_event_message`].\npub fn encode_private_event_message<Event>(\n event: Event,\n randomness: Field,\n) -> [Field; PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Event as Serialize>::N + MESSAGE_EXPANDED_METADATA_LEN]\nwhere\n Event: EventInterface + Serialize,\n{\n std::static_assert(\n <Event as Serialize>::N <= MAX_EVENT_SERIALIZED_LEN,\n \"event's serialized length exceeds the maximum allowed for private events\",\n );\n\n // We use `Serialize` because we want for events to be processable by off-chain actors, e.g. block explorers,\n // wallets and apps, without having to rely on contract invocation. If we used `Packable` we'd need to call utility\n // functions in order to unpack events, which would introduce a level of complexity we don't currently think is\n // worth the savings in DA (for public events) and proving time (when encrypting private event messages).\n let serialized_event = event.serialize();\n\n // If PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // encoding below must be updated as well.\n std::static_assert(\n PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 1,\n \"unexpected value for PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let mut msg_plaintext = [0; PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Event as Serialize>::N];\n msg_plaintext[PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX] = randomness;\n\n for i in 0..serialized_event.len() {\n msg_plaintext[PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + i] = serialized_event[i];\n }\n\n // The event type id is stored in the message metadata\n encode_message(\n PRIVATE_EVENT_MSG_TYPE_ID,\n Event::get_event_type_id().to_field() as u64,\n msg_plaintext,\n )\n}\n\n/// Decodes the plaintext from a private event message (i.e. one of type [`PRIVATE_EVENT_MSG_TYPE_ID`]).\n///\n/// Returns `None` if `msg_content` has too few fields. This plaintext is meant to have originated\n/// from [`encode_private_event_message`].\n///\n/// Note that while [`encode_private_event_message`] returns a fixed-size array, this function takes a [`BoundedVec`]\n/// instead. This is because when decoding we're typically processing runtime-sized plaintexts, more specifically,\n/// those that originate from [`crate::messages::encryption::message_encryption::MessageEncryption::decrypt`].\npub(crate) unconstrained fn decode_private_event_message(\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) -> Option<(EventSelector, Field, BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>)> {\n if msg_content.len() <= PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN {\n Option::none()\n } else {\n let event_type_id = EventSelector::from_field(msg_metadata as Field);\n\n // If PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // destructuring of the private event message encoding below must be updated as well.\n std::static_assert(\n PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 1,\n \"unexpected value for PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let randomness = msg_content.get(PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX);\n let serialized_event = array::subbvec(msg_content, PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN);\n\n Option::some((event_type_id, randomness, serialized_event))\n }\n}\n\nmod test {\n use crate::{\n event::event_interface::EventInterface,\n messages::{\n encoding::decode_message,\n logs::event::{decode_private_event_message, encode_private_event_message},\n msg_type::PRIVATE_EVENT_MSG_TYPE_ID,\n },\n };\n use crate::protocol::traits::Serialize;\n use crate::test::mocks::mock_event::MockEvent;\n\n global VALUE: Field = 7;\n global RANDOMNESS: Field = 10;\n\n #[test]\n unconstrained fn encode_decode() {\n let event = MockEvent::new(VALUE).build_event();\n\n let message_plaintext = encode_private_event_message(event, RANDOMNESS);\n\n let (msg_type_id, msg_metadata, msg_content) =\n decode_message(BoundedVec::from_array(message_plaintext)).unwrap();\n\n assert_eq(msg_type_id, PRIVATE_EVENT_MSG_TYPE_ID);\n\n let (event_type_id, randomness, serialized_event) =\n decode_private_event_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(event_type_id, MockEvent::get_event_type_id());\n assert_eq(randomness, RANDOMNESS);\n assert_eq(serialized_event, BoundedVec::from_array(event.serialize()));\n }\n\n #[test]\n unconstrained fn decode_empty_content_returns_none() {\n let empty = BoundedVec::new();\n assert(decode_private_event_message(0, empty).is_none());\n }\n\n #[test]\n unconstrained fn decode_with_only_reserved_fields_returns_none() {\n let content = BoundedVec::from_array([0]);\n assert(decode_private_event_message(0, content).is_none());\n }\n}\n"
3457
3405
  },
3458
- "141": {
3406
+ "139": {
3459
3407
  "function_locations": [
3460
3408
  {
3461
3409
  "name": "encode_private_note_message",
@@ -3497,7 +3445,7 @@
3497
3445
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/logs/note.nr",
3498
3446
  "source": "use crate::{\n messages::{\n encoding::{encode_message, MAX_MESSAGE_CONTENT_LEN, MESSAGE_EXPANDED_METADATA_LEN},\n msg_type::PRIVATE_NOTE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n utils::array,\n};\nuse crate::protocol::{address::AztecAddress, traits::{FromField, Packable, ToField}};\n\n/// The number of fields in a private note message content that are not the note's packed representation.\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN: u32 = 3;\n\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_OWNER_INDEX: u32 = 0;\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_STORAGE_SLOT_INDEX: u32 = 1;\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_RANDOMNESS_INDEX: u32 = 2;\n\n/// The maximum length of the packed representation of a note's contents. This is limited by private log size,\n/// encryption overhead and extra fields in the message (e.g. message type id, storage slot, randomness, etc.).\npub global MAX_NOTE_PACKED_LEN: u32 = MAX_MESSAGE_CONTENT_LEN - PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN;\n\n/// Creates the plaintext for a private note message (i.e. one of type [`PRIVATE_NOTE_MSG_TYPE_ID`]).\n///\n/// This plaintext is meant to be decoded via [`decode_private_note_message`].\npub fn encode_private_note_message<Note>(\n note: Note,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: Field,\n) -> [Field; PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Note as Packable>::N + MESSAGE_EXPANDED_METADATA_LEN]\nwhere\n Note: NoteType + Packable,\n{\n let packed_note = note.pack();\n\n // If PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // encoding below must be updated as well.\n std::static_assert(\n PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let mut msg_content = [0; PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Note as Packable>::N];\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_OWNER_INDEX] = owner.to_field();\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_STORAGE_SLOT_INDEX] = storage_slot;\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_RANDOMNESS_INDEX] = randomness;\n for i in 0..packed_note.len() {\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + i] = packed_note[i];\n }\n\n // Notes use the note type id for metadata\n encode_message(PRIVATE_NOTE_MSG_TYPE_ID, Note::get_id() as u64, msg_content)\n}\n\n/// Decodes the plaintext from a private note message (i.e. one of type [`PRIVATE_NOTE_MSG_TYPE_ID`]).\n///\n/// Returns `None` if `msg_content` has too few fields. This plaintext is meant to have originated\n/// from [`encode_private_note_message`].\n///\n/// Note that while [`encode_private_note_message`] returns a fixed-size array, this function takes a [`BoundedVec`]\n/// instead. This is because when decoding we're typically processing runtime-sized plaintexts, more specifically,\n/// those that originate from [`crate::messages::encryption::message_encryption::MessageEncryption::decrypt`].\npub(crate) unconstrained fn decode_private_note_message(\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) -> Option<(Field, AztecAddress, Field, Field, BoundedVec<Field, MAX_NOTE_PACKED_LEN>)> {\n if msg_content.len() <= PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN {\n Option::none()\n } else {\n let note_type_id = msg_metadata as Field; // TODO: make note type id not be a full field\n\n // If PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // decoding below must be updated as well.\n std::static_assert(\n PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let owner = AztecAddress::from_field(msg_content.get(PRIVATE_NOTE_MSG_PLAINTEXT_OWNER_INDEX));\n let storage_slot = msg_content.get(PRIVATE_NOTE_MSG_PLAINTEXT_STORAGE_SLOT_INDEX);\n let randomness = msg_content.get(PRIVATE_NOTE_MSG_PLAINTEXT_RANDOMNESS_INDEX);\n let packed_note = array::subbvec(msg_content, PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN);\n\n Option::some((note_type_id, owner, storage_slot, randomness, packed_note))\n }\n}\n\nmod test {\n use crate::{\n messages::{\n encoding::decode_message,\n logs::note::{decode_private_note_message, encode_private_note_message, MAX_NOTE_PACKED_LEN},\n msg_type::PRIVATE_NOTE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, Packable}};\n use crate::test::mocks::mock_note::MockNote;\n\n global VALUE: Field = 7;\n global OWNER: AztecAddress = AztecAddress::from_field(8);\n global STORAGE_SLOT: Field = 9;\n global RANDOMNESS: Field = 10;\n\n #[test]\n unconstrained fn encode_decode() {\n let note = MockNote::new(VALUE).build_note();\n\n let message_plaintext = encode_private_note_message(note, OWNER, STORAGE_SLOT, RANDOMNESS);\n\n let (msg_type_id, msg_metadata, msg_content) =\n decode_message(BoundedVec::from_array(message_plaintext)).unwrap();\n\n assert_eq(msg_type_id, PRIVATE_NOTE_MSG_TYPE_ID);\n\n let (note_type_id, owner, storage_slot, randomness, packed_note) =\n decode_private_note_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(note_type_id, MockNote::get_id());\n assert_eq(owner, OWNER);\n assert_eq(storage_slot, STORAGE_SLOT);\n assert_eq(randomness, RANDOMNESS);\n assert_eq(packed_note, BoundedVec::from_array(note.pack()));\n }\n\n #[derive(Packable)]\n struct MaxSizeNote {\n data: [Field; MAX_NOTE_PACKED_LEN],\n }\n\n impl NoteType for MaxSizeNote {\n fn get_id() -> Field {\n 0\n }\n }\n\n #[test]\n unconstrained fn encode_decode_max_size_note() {\n let mut data = [0; MAX_NOTE_PACKED_LEN];\n for i in 0..MAX_NOTE_PACKED_LEN {\n data[i] = i as Field;\n }\n let note = MaxSizeNote { data };\n\n let encoded = encode_private_note_message(note, OWNER, STORAGE_SLOT, RANDOMNESS);\n let (msg_type_id, msg_metadata, msg_content) = decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(msg_type_id, PRIVATE_NOTE_MSG_TYPE_ID);\n\n let (note_type_id, owner, storage_slot, randomness, packed_note) =\n decode_private_note_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(note_type_id, MaxSizeNote::get_id());\n assert_eq(owner, OWNER);\n assert_eq(storage_slot, STORAGE_SLOT);\n assert_eq(randomness, RANDOMNESS);\n assert_eq(packed_note, BoundedVec::from_array(data));\n }\n\n #[derive(Packable)]\n struct OversizedNote {\n data: [Field; MAX_NOTE_PACKED_LEN + 1],\n }\n\n impl NoteType for OversizedNote {\n fn get_id() -> Field {\n 0\n }\n }\n\n #[test(should_fail_with = \"Invalid message content: it must have a length of at most MAX_MESSAGE_CONTENT_LEN\")]\n fn encode_oversized_note_fails() {\n let note = OversizedNote { data: [0; MAX_NOTE_PACKED_LEN + 1] };\n let _ = encode_private_note_message(note, OWNER, STORAGE_SLOT, RANDOMNESS);\n }\n\n #[test]\n unconstrained fn decode_empty_content_returns_none() {\n let empty = BoundedVec::new();\n assert(decode_private_note_message(0, empty).is_none());\n }\n\n #[test]\n unconstrained fn decode_with_only_reserved_fields_returns_none() {\n let content = BoundedVec::from_array([0, 0, 0]);\n assert(decode_private_note_message(0, content).is_none());\n }\n}\n"
3499
3447
  },
3500
- "142": {
3448
+ "140": {
3501
3449
  "function_locations": [
3502
3450
  {
3503
3451
  "name": "encode_partial_note_private_message",
@@ -3523,7 +3471,7 @@
3523
3471
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/logs/partial_note.nr",
3524
3472
  "source": "use crate::{\n messages::{\n encoding::{encode_message, MAX_MESSAGE_CONTENT_LEN, MESSAGE_EXPANDED_METADATA_LEN},\n msg_type::PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n utils::array,\n};\nuse crate::protocol::{address::AztecAddress, traits::{FromField, Packable, ToField}};\n\n/// The number of fields in a private note message content that are not the note's packed representation.\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN: u32 = 3;\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_OWNER_INDEX: u32 = 0;\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RANDOMNESS_INDEX: u32 = 1;\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NOTE_COMPLETION_LOG_TAG_INDEX: u32 = 2;\n\n/// Partial notes have a maximum packed length of their private fields bound by extra content in their private message\n/// (e.g. the storage slot, note completion log tag, etc.).\npub global MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN: u32 =\n MAX_MESSAGE_CONTENT_LEN - PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN;\n\n/// Creates the plaintext for a partial note private message (i.e. one of type [`PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID`]).\n///\n/// This plaintext is meant to be decoded via [`decode_partial_note_private_message`].\npub fn encode_partial_note_private_message<PartialNotePrivateContent>(\n partial_note_private_content: PartialNotePrivateContent,\n owner: AztecAddress,\n randomness: Field,\n note_completion_log_tag: Field,\n ) -> [Field; PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <PartialNotePrivateContent as Packable>::N + MESSAGE_EXPANDED_METADATA_LEN]\nwhere\n PartialNotePrivateContent: NoteType + Packable,\n{\n let packed_private_content = partial_note_private_content.pack();\n\n // If PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN is changed, causing the assertion below to fail, then\n // the encoding below must be updated as well.\n std::static_assert(\n PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN\",\n );\n\n let mut msg_content =\n [0; PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <PartialNotePrivateContent as Packable>::N];\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_OWNER_INDEX] = owner.to_field();\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RANDOMNESS_INDEX] = randomness;\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NOTE_COMPLETION_LOG_TAG_INDEX] = note_completion_log_tag;\n\n for i in 0..packed_private_content.len() {\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + i] = packed_private_content[i];\n }\n\n encode_message(\n PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID,\n // Notes use the note type id for metadata\n PartialNotePrivateContent::get_id() as u64,\n msg_content,\n )\n}\n\n/// Decodes the plaintext from a partial note private message (i.e. one of type\n/// [`PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID`]).\n///\n/// Returns `None` if `msg_content` has too few fields. This plaintext is meant to have originated\n/// from [`encode_partial_note_private_message`].\n///\n/// Note that while [`encode_partial_note_private_message`] returns a fixed-size array, this function takes a\n/// [`BoundedVec`] instead. This is because when decoding we're typically processing runtime-sized plaintexts, more\n/// specifically, those that originate from\n/// [`crate::messages::encryption::message_encryption::MessageEncryption::decrypt`].\npub(crate) unconstrained fn decode_partial_note_private_message(\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) -> Option<(AztecAddress, Field, Field, Field, BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN>)> {\n if msg_content.len() < PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN {\n Option::none()\n } else {\n let note_type_id: Field = msg_metadata as Field; // TODO: make note type id not be a full field\n\n // If PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN is changed, causing the assertion below to fail,\n // then the destructuring of the partial note private message encoding below must be updated as well.\n std::static_assert(\n PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN\",\n );\n\n // We currently have three fields that are not the partial note's packed representation, which are the owner,\n // the randomness, and the note completion log tag.\n let owner = AztecAddress::from_field(\n msg_content.get(PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_OWNER_INDEX),\n );\n let randomness = msg_content.get(PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RANDOMNESS_INDEX);\n let note_completion_log_tag = msg_content.get(PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NOTE_COMPLETION_LOG_TAG_INDEX);\n\n let packed_private_note_content: BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN> = array::subbvec(\n msg_content,\n PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN,\n );\n\n Option::some(\n (owner, randomness, note_completion_log_tag, note_type_id, packed_private_note_content),\n )\n }\n}\n\nmod test {\n use crate::{\n messages::{\n encoding::decode_message,\n logs::partial_note::{decode_partial_note_private_message, encode_partial_note_private_message},\n msg_type::PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, Packable}};\n use crate::test::mocks::mock_note::MockNote;\n\n global VALUE: Field = 7;\n global OWNER: AztecAddress = AztecAddress::from_field(8);\n global RANDOMNESS: Field = 10;\n global NOTE_COMPLETION_LOG_TAG: Field = 11;\n\n #[test]\n unconstrained fn encode_decode() {\n // Note that here we use MockNote as the private fields of a partial note\n let note = MockNote::new(VALUE).build_note();\n\n let message_plaintext = encode_partial_note_private_message(note, OWNER, RANDOMNESS, NOTE_COMPLETION_LOG_TAG);\n\n let (msg_type_id, msg_metadata, msg_content) =\n decode_message(BoundedVec::from_array(message_plaintext)).unwrap();\n\n assert_eq(msg_type_id, PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID);\n\n let (owner, randomness, note_completion_log_tag, note_type_id, packed_note) =\n decode_partial_note_private_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(note_type_id, MockNote::get_id());\n assert_eq(owner, OWNER);\n assert_eq(randomness, RANDOMNESS);\n assert_eq(note_completion_log_tag, NOTE_COMPLETION_LOG_TAG);\n assert_eq(packed_note, BoundedVec::from_array(note.pack()));\n }\n\n #[test]\n unconstrained fn decode_empty_content_returns_none() {\n let empty = BoundedVec::new();\n assert(decode_partial_note_private_message(0, empty).is_none());\n }\n\n #[test]\n unconstrained fn decode_succeeds_with_only_reserved_fields() {\n let content = BoundedVec::from_array([0, 0, 0]);\n let (_, _, _, _, packed_note) = decode_partial_note_private_message(0, content).unwrap();\n assert_eq(packed_note.len(), 0);\n }\n}\n"
3525
3473
  },
3526
- "152": {
3474
+ "150": {
3527
3475
  "function_locations": [
3528
3476
  {
3529
3477
  "name": "get_private_logs",
@@ -3553,7 +3501,7 @@
3553
3501
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/processing/mod.nr",
3554
3502
  "source": "pub(crate) mod event_validation_request;\npub mod offchain;\n\nmod message_context;\npub use message_context::MessageContext;\n\npub(crate) mod note_validation_request;\npub(crate) mod log_retrieval_request;\npub(crate) mod log_retrieval_response;\npub(crate) mod pending_tagged_log;\n\nuse crate::{\n capsules::CapsuleArray,\n event::EventSelector,\n messages::{\n discovery::partial_notes::DeliveredPendingPartialNote,\n encoding::MESSAGE_CIPHERTEXT_LEN,\n logs::{event::MAX_EVENT_SERIALIZED_LEN, note::MAX_NOTE_PACKED_LEN},\n processing::{\n log_retrieval_request::LogRetrievalRequest, log_retrieval_response::LogRetrievalResponse,\n note_validation_request::NoteValidationRequest, pending_tagged_log::PendingTaggedLog,\n },\n },\n oracle,\n};\nuse crate::protocol::{\n address::AztecAddress,\n constants::DOM_SEP__NOTE_COMPLETION_LOG_TAG,\n hash::{compute_log_tag, sha256_to_field},\n traits::{Deserialize, Serialize},\n};\nuse event_validation_request::EventValidationRequest;\n\n// Base slot for the pending tagged log array to which the fetch_tagged_logs oracle inserts found private logs.\npub(crate) global PENDING_TAGGED_LOG_ARRAY_BASE_SLOT: Field =\n sha256_to_field(\"AZTEC_NR::PENDING_TAGGED_LOG_ARRAY_BASE_SLOT\".as_bytes());\n\nglobal NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\n/// An offchain-delivered message with resolved context, ready for processing during sync.\n#[derive(Serialize, Deserialize)]\npub struct OffchainMessageWithContext {\n pub message_ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n pub message_context: MessageContext,\n}\n\n/// Searches for private logs emitted by `contract_address` that might contain messages for the given `scope`.\npub(crate) unconstrained fn get_private_logs(\n contract_address: AztecAddress,\n scope: AztecAddress,\n) -> CapsuleArray<PendingTaggedLog> {\n // We will eventually perform log discovery via tagging here, but for now we simply call the `fetchTaggedLogs`\n // oracle. This makes PXE synchronize tags, download logs and store the pending tagged logs in a capsule array.\n oracle::message_processing::fetch_tagged_logs(PENDING_TAGGED_LOG_ARRAY_BASE_SLOT, scope);\n\n CapsuleArray::at(contract_address, PENDING_TAGGED_LOG_ARRAY_BASE_SLOT, scope)\n}\n\n/// Enqueues a note for validation and storage by PXE.\n///\n/// Once validated, the note becomes retrievable via the `get_notes` oracle. The note will be scoped to\n/// `contract_address`, meaning other contracts will not be able to access it unless authorized.\n///\n/// In order for the note validation and insertion to occur, `validate_and_store_enqueued_notes_and_events` must be\n/// later called. For optimal performance, accumulate as many note validation requests as possible and then validate\n/// them all at the end (which results in PXE minimizing the number of network round-trips).\n///\n/// The `packed_note` is what `getNotes` will later return. PXE indexes notes by `storage_slot`, so this value is\n/// typically used to filter notes that correspond to different state variables. `note_hash` and `nullifier` are the\n/// inner hashes, i.e. the raw hashes returned by `NoteHash::compute_note_hash` and `NoteHash::compute_nullifier`. PXE\n/// will verify that the siloed unique note hash was inserted into the tree at `tx_hash`, and will store the nullifier\n/// to later check for nullification.\n///\n/// `owner` is the address used in note hash and nullifier computation, often requiring knowledge of their nullifier\n/// secret key.\n///\n/// `scope` is the account to which the note message was delivered (i.e. the address the message was encrypted to).\n/// This determines which PXE account can see the note - other accounts will not be able to access it (e.g. other\n/// accounts will not be able to see one another's token balance notes, even in the same PXE) unless authorized. In\n/// most cases `recipient` equals `owner`, but they can differ in scenarios like delegated discovery.\npub unconstrained fn enqueue_note_for_validation(\n contract_address: AztecAddress,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: Field,\n note_nonce: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n note_hash: Field,\n nullifier: Field,\n tx_hash: Field,\n scope: AztecAddress,\n) {\n // We store requests in a `CapsuleArray`, which PXE will later read from and deserialize into its version of the\n // Noir `NoteValidationRequest`\n CapsuleArray::at(\n contract_address,\n NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n scope,\n )\n .push(\n NoteValidationRequest {\n contract_address,\n owner,\n storage_slot,\n randomness,\n note_nonce,\n packed_note,\n note_hash,\n nullifier,\n tx_hash,\n },\n )\n}\n\n/// Enqueues an event for validation and storage by PXE.\n///\n/// This is the primary way for custom message handlers (registered via\n/// [`crate::macros::AztecConfig::custom_message_handler`]) to deliver reassembled events back to PXE after processing\n/// application-specific message formats.\n///\n/// In order for the event validation and insertion to occur, `validate_and_store_enqueued_notes_and_events` must be\n/// later called. For optimal performance, accumulate as many event validation requests as possible and then validate\n/// them all at the end (which results in PXE minimizing the number of network round-trips).\n///\n/// Note that `validate_and_store_enqueued_notes_and_events` is called by Aztec.nr after processing messages, so custom\n/// message processors do not need to be concerned with this.\npub unconstrained fn enqueue_event_for_validation(\n contract_address: AztecAddress,\n event_type_id: EventSelector,\n randomness: Field,\n serialized_event: BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>,\n event_commitment: Field,\n tx_hash: Field,\n scope: AztecAddress,\n) {\n // We store requests in a `CapsuleArray`, which PXE will later read from and deserialize into its version of the\n // Noir `EventValidationRequest`\n CapsuleArray::at(\n contract_address,\n EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n scope,\n )\n .push(\n EventValidationRequest {\n contract_address,\n event_type_id,\n randomness,\n serialized_event,\n event_commitment,\n tx_hash,\n },\n )\n}\n\n/// Validates and stores all enqueued notes and events.\n///\n/// Processes all requests enqueued via [`enqueue_note_for_validation`] and [`enqueue_event_for_validation`], inserting\n/// them into the note database and event store respectively, making them queryable via `get_notes` oracle and our TS\n/// API (PXE::getPrivateEvents).\n///\n/// This automatically clears both validation request queues, so no further work needs to be done by the caller.\npub unconstrained fn validate_and_store_enqueued_notes_and_events(contract_address: AztecAddress, scope: AztecAddress) {\n oracle::message_processing::validate_and_store_enqueued_notes_and_events(\n contract_address,\n NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n MAX_NOTE_PACKED_LEN as Field,\n MAX_EVENT_SERIALIZED_LEN as Field,\n scope,\n );\n}\n\n/// Resolves message contexts for a list of tx hashes stored in a CapsuleArray.\n///\n/// The `message_context_requests_array_base_slot` must point to a CapsuleArray<Field> containing tx hashes.\n/// PXE will store `Option<MessageContextResponse>` values into the responses array at\n/// `message_context_responses_array_base_slot`.\npub unconstrained fn get_message_contexts_by_tx_hash(\n contract_address: AztecAddress,\n message_context_requests_array_base_slot: Field,\n message_context_responses_array_base_slot: Field,\n scope: AztecAddress,\n) {\n oracle::message_processing::get_message_contexts_by_tx_hash(\n contract_address,\n message_context_requests_array_base_slot,\n message_context_responses_array_base_slot,\n scope,\n );\n}\n\n/// Efficiently queries the node for logs that result in the completion of all `DeliveredPendingPartialNote`s stored in\n/// a `CapsuleArray` by performing all node communication concurrently. Returns a second `CapsuleArray` with Options\n/// for the responses that correspond to the pending partial notes at the same index.\n///\n/// For example, given an array with pending partial notes `[ p1, p2, p3 ]`, where `p1` and `p3` have corresponding\n/// completion logs but `p2` does not, the returned `CapsuleArray` will have contents `[some(p1_log), none(),\n/// some(p3_log)]`.\npub(crate) unconstrained fn get_pending_partial_notes_completion_logs(\n contract_address: AztecAddress,\n pending_partial_notes: CapsuleArray<DeliveredPendingPartialNote>,\n scope: AztecAddress,\n) -> CapsuleArray<Option<LogRetrievalResponse>> {\n let log_retrieval_requests = CapsuleArray::at(\n contract_address,\n LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT,\n scope,\n );\n\n // We create a LogRetrievalRequest for each PendingPartialNote in the CapsuleArray. Because we need the indices in\n // the request array to match the indices in the partial note array, we can't use CapsuleArray::for_each, as that\n // function has arbitrary iteration order. Instead, we manually iterate the array from the beginning and push into\n // the requests array, which we expect to be empty.\n let mut i = 0;\n let pending_partial_notes_count = pending_partial_notes.len();\n while i < pending_partial_notes_count {\n let pending_partial_note = pending_partial_notes.get(i);\n // Partial note completion logs are emitted with a domain-separated tag. To find matching logs, we apply the\n // same domain separation to the stored raw tag.\n let log_tag = compute_log_tag(\n pending_partial_note.note_completion_log_tag,\n DOM_SEP__NOTE_COMPLETION_LOG_TAG,\n );\n log_retrieval_requests.push(LogRetrievalRequest { contract_address, unsiloed_tag: log_tag });\n i += 1;\n }\n\n oracle::message_processing::get_logs_by_tag(\n contract_address,\n LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT,\n LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT,\n scope,\n );\n\n CapsuleArray::at(\n contract_address,\n LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT,\n scope,\n )\n}\n"
3555
3503
  },
3556
- "154": {
3504
+ "152": {
3557
3505
  "function_locations": [
3558
3506
  {
3559
3507
  "name": "receive",
@@ -3895,7 +3843,7 @@
3895
3843
  "path": "std/field/mod.nr",
3896
3844
  "source": "pub mod bn254;\nuse crate::{runtime::is_unconstrained, static_assert};\nuse bn254::lt as bn254_lt;\n\nimpl Field {\n /// Asserts that `self` can be represented in `bit_size` bits.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^{bit_size}`.\n // docs:start:assert_max_bit_size\n pub fn assert_max_bit_size<let BIT_SIZE: u32>(self) {\n // docs:end:assert_max_bit_size\n static_assert(\n BIT_SIZE < modulus_num_bits() as u32,\n \"BIT_SIZE must be less than modulus_num_bits\",\n );\n __assert_max_bit_size(self, BIT_SIZE);\n }\n\n /// Decomposes `self` into its little endian bit decomposition as a `[u1; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_le_bits\n pub fn to_le_bits<let N: u32>(self: Self) -> [u1; N] {\n // docs:end:to_le_bits\n let bits = __to_le_bits(self);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[N - 1 - i] != p[N - 1 - i]) {\n assert(p[N - 1 - i] == 1);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its big endian bit decomposition as a `[u1; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_be_bits\n pub fn to_be_bits<let N: u32>(self: Self) -> [u1; N] {\n // docs:end:to_be_bits\n let bits = __to_be_bits(self);\n\n if !is_unconstrained() {\n // Ensure that the decomposition does not overflow the modulus\n let p = modulus_be_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[i] != p[i]) {\n assert(p[i] == 1);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its little endian byte decomposition as a `[u8;N]` array\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_le_bytes\n pub fn to_le_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_le_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_le_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[N - 1 - i] != p[N - 1 - i]) {\n assert(bytes[N - 1 - i] < p[N - 1 - i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n /// Decomposes `self` into its big endian byte decomposition as a `[u8;N]` array of length required to represent the field modulus\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_be_bytes\n pub fn to_be_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_be_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_be_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_be_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[i] != p[i]) {\n assert(bytes[i] < p[i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n fn to_le_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n static_assert(1 < radix, \"radix must be greater than 1\");\n static_assert(radix <= 256, \"radix must be less than or equal to 256\");\n static_assert(radix & (radix - 1) == 0, \"radix must be a power of 2\");\n }\n __to_le_radix(self, radix)\n }\n\n fn to_be_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n static_assert(1 < radix, \"radix must be greater than 1\");\n static_assert(radix <= 256, \"radix must be less than or equal to 256\");\n static_assert(radix & (radix - 1) == 0, \"radix must be a power of 2\");\n }\n __to_be_radix(self, radix)\n }\n\n // Returns self to the power of the given exponent value.\n // Caution: we assume the exponent fits into 32 bits\n // using a bigger bit size impacts negatively the performance and should be done only if the exponent does not fit in 32 bits\n pub fn pow_32(self, exponent: Field) -> Field {\n let mut r: Field = 1;\n let b: [u1; 32] = exponent.to_le_bits();\n\n for i in 1..33 {\n r *= r;\n r = (b[32 - i] as Field) * (r * self) + (1 - b[32 - i] as Field) * r;\n }\n r\n }\n\n // Parity of (prime) Field element, i.e. sgn0(x mod p) = 0 if x `elem` {0, ..., p-1} is even, otherwise sgn0(x mod p) = 1.\n pub fn sgn0(self) -> u1 {\n self as u1\n }\n\n pub fn lt(self, another: Field) -> bool {\n if crate::compat::is_bn254() {\n bn254_lt(self, another)\n } else {\n lt_fallback(self, another)\n }\n }\n\n /// Convert a little endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n pub fn from_le_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[i] as Field) * v;\n v = v * 256;\n }\n result\n }\n\n /// Convert a big endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n pub fn from_be_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[N - 1 - i] as Field) * v;\n v = v * 256;\n }\n result\n }\n}\n\n#[builtin(apply_range_constraint)]\nfn __assert_max_bit_size(value: Field, bit_size: u32) {}\n\n// `_radix` must be less than 256\n#[builtin(to_le_radix)]\nfn __to_le_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n// `_radix` must be less than 256\n#[builtin(to_be_radix)]\nfn __to_be_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n/// Decomposes `self` into its little endian bit decomposition as a `[u1; N]` array.\n/// This array will be zero padded should not all bits be necessary to represent `self`.\n///\n/// # Failures\n/// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n/// be able to represent the original `Field`.\n///\n/// # Safety\n/// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n/// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n/// wrap around due to overflow when verifying the decomposition.\n#[builtin(to_le_bits)]\nfn __to_le_bits<let N: u32>(value: Field) -> [u1; N] {}\n\n/// Decomposes `self` into its big endian bit decomposition as a `[u1; N]` array.\n/// This array will be zero padded should not all bits be necessary to represent `self`.\n///\n/// # Failures\n/// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n/// be able to represent the original `Field`.\n///\n/// # Safety\n/// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n/// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n/// wrap around due to overflow when verifying the decomposition.\n#[builtin(to_be_bits)]\nfn __to_be_bits<let N: u32>(value: Field) -> [u1; N] {}\n\n#[builtin(modulus_num_bits)]\npub comptime fn modulus_num_bits() -> u64 {}\n\n#[builtin(modulus_be_bits)]\npub comptime fn modulus_be_bits() -> [u1] {}\n\n#[builtin(modulus_le_bits)]\npub comptime fn modulus_le_bits() -> [u1] {}\n\n#[builtin(modulus_be_bytes)]\npub comptime fn modulus_be_bytes() -> [u8] {}\n\n#[builtin(modulus_le_bytes)]\npub comptime fn modulus_le_bytes() -> [u8] {}\n\n/// An unconstrained only built in to efficiently compare fields.\n#[builtin(field_less_than)]\nunconstrained fn __field_less_than(x: Field, y: Field) -> bool {}\n\npub(crate) unconstrained fn field_less_than(x: Field, y: Field) -> bool {\n __field_less_than(x, y)\n}\n\n// Convert a 32 byte array to a field element by modding\npub fn bytes32_to_field(bytes32: [u8; 32]) -> Field {\n // Convert it to a field element\n let mut v = 1;\n let mut high = 0 as Field;\n let mut low = 0 as Field;\n\n for i in 0..16 {\n high = high + (bytes32[15 - i] as Field) * v;\n low = low + (bytes32[16 + 15 - i] as Field) * v;\n v = v * 256;\n }\n // Abuse that a % p + b % p = (a + b) % p and that low < p\n low + high * v\n}\n\nfn lt_fallback(x: Field, y: Field) -> bool {\n if is_unconstrained() {\n // Safety: unconstrained context\n unsafe {\n field_less_than(x, y)\n }\n } else {\n let x_bytes: [u8; 32] = x.to_le_bytes();\n let y_bytes: [u8; 32] = y.to_le_bytes();\n let mut x_is_lt = false;\n let mut done = false;\n for i in 0..32 {\n if (!done) {\n let x_byte = x_bytes[32 - 1 - i] as u8;\n let y_byte = y_bytes[32 - 1 - i] as u8;\n let bytes_match = x_byte == y_byte;\n if !bytes_match {\n x_is_lt = x_byte < y_byte;\n done = true;\n }\n }\n }\n x_is_lt\n }\n}\n\nmod tests {\n use crate::{panic::panic, runtime, static_assert};\n use super::{\n field_less_than, modulus_be_bits, modulus_be_bytes, modulus_le_bits, modulus_le_bytes,\n };\n\n #[test]\n // docs:start:to_be_bits_example\n fn test_to_be_bits() {\n let field = 2;\n let bits: [u1; 8] = field.to_be_bits();\n assert_eq(bits, [0, 0, 0, 0, 0, 0, 1, 0]);\n }\n // docs:end:to_be_bits_example\n\n #[test]\n // docs:start:to_le_bits_example\n fn test_to_le_bits() {\n let field = 2;\n let bits: [u1; 8] = field.to_le_bits();\n assert_eq(bits, [0, 1, 0, 0, 0, 0, 0, 0]);\n }\n // docs:end:to_le_bits_example\n\n #[test]\n // docs:start:to_be_bytes_example\n fn test_to_be_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_be_bytes();\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_bytes_example\n\n #[test]\n // docs:start:to_le_bytes_example\n fn test_to_le_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_le_bytes();\n assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_bytes_example\n\n #[test]\n // docs:start:to_be_radix_example\n fn test_to_be_radix() {\n // 259, in base 256, big endian, is [1, 3].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_be_radix(256);\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 1, 3]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_radix_example\n\n #[test]\n // docs:start:to_le_radix_example\n fn test_to_le_radix() {\n // 259, in base 256, little endian, is [3, 1].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_le_radix(256);\n assert_eq(bytes, [3, 1, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_radix_example\n\n #[test(should_fail_with = \"radix must be greater than 1\")]\n fn test_to_le_radix_1() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(\"radix must be greater than 1\");\n }\n }\n\n // Updated test to account for Brillig restriction that radix must be greater than 2\n #[test(should_fail_with = \"radix must be greater than 1\")]\n fn test_to_le_radix_brillig_1() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 1;\n let _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(\"radix must be greater than 1\");\n }\n }\n\n #[test(should_fail_with = \"radix must be a power of 2\")]\n fn test_to_le_radix_3() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(3);\n } else {\n panic(\"radix must be a power of 2\");\n }\n }\n\n #[test]\n fn test_to_le_radix_brillig_3() {\n // this test should only fail in constrained mode\n if runtime::is_unconstrained() {\n let field = 1;\n let out: [u8; 8] = field.to_le_radix(3);\n let mut expected = [0; 8];\n expected[0] = 1;\n assert(out == expected, \"unexpected result\");\n }\n }\n\n #[test(should_fail_with = \"radix must be less than or equal to 256\")]\n fn test_to_le_radix_512() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(512);\n } else {\n panic(\"radix must be less than or equal to 256\")\n }\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n unconstrained fn not_enough_limbs_brillig() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n fn not_enough_limbs() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\n }\n\n #[test]\n unconstrained fn test_field_less_than() {\n assert(field_less_than(0, 1));\n assert(field_less_than(0, 0x100));\n assert(field_less_than(0x100, 0 - 1));\n assert(!field_less_than(0 - 1, 0));\n }\n\n #[test]\n unconstrained fn test_large_field_values_unconstrained() {\n let large_field = 0xffffffffffffffff;\n\n let bits: [u1; 64] = large_field.to_le_bits();\n assert_eq(bits[0], 1);\n\n let bytes: [u8; 8] = large_field.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_field);\n\n let radix_bytes: [u8; 8] = large_field.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_field);\n }\n\n #[test]\n fn test_large_field_values() {\n let large_val = 0xffffffffffffffff;\n\n let bits: [u1; 64] = large_val.to_le_bits();\n assert_eq(bits[0], 1);\n\n let bytes: [u8; 8] = large_val.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_val);\n\n let radix_bytes: [u8; 8] = large_val.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_val);\n }\n\n #[test]\n fn test_decomposition_edge_cases() {\n let zero_bits: [u1; 8] = 0.to_le_bits();\n assert_eq(zero_bits, [0; 8]);\n\n let zero_bytes: [u8; 8] = 0.to_le_bytes();\n assert_eq(zero_bytes, [0; 8]);\n\n let one_bits: [u1; 8] = 1.to_le_bits();\n let expected: [u1; 8] = [1, 0, 0, 0, 0, 0, 0, 0];\n assert_eq(one_bits, expected);\n\n let pow2_bits: [u1; 8] = 4.to_le_bits();\n let expected: [u1; 8] = [0, 0, 1, 0, 0, 0, 0, 0];\n assert_eq(pow2_bits, expected);\n }\n\n #[test]\n fn test_pow_32() {\n assert_eq(2.pow_32(3), 8);\n assert_eq(3.pow_32(2), 9);\n assert_eq(5.pow_32(0), 1);\n assert_eq(7.pow_32(1), 7);\n\n assert_eq(2.pow_32(10), 1024);\n\n assert_eq(0.pow_32(5), 0);\n assert_eq(0.pow_32(0), 1);\n\n assert_eq(1.pow_32(100), 1);\n }\n\n #[test]\n fn test_sgn0() {\n assert_eq(0.sgn0(), 0);\n assert_eq(2.sgn0(), 0);\n assert_eq(4.sgn0(), 0);\n assert_eq(100.sgn0(), 0);\n\n assert_eq(1.sgn0(), 1);\n assert_eq(3.sgn0(), 1);\n assert_eq(5.sgn0(), 1);\n assert_eq(101.sgn0(), 1);\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 8 limbs\")]\n fn test_bit_decomposition_overflow() {\n // 8 bits can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [u1; 8] = large_val.to_le_bits();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 4 limbs\")]\n fn test_byte_decomposition_overflow() {\n // 4 bytes can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [u8; 4] = large_val.to_le_bytes();\n }\n\n #[test]\n fn test_to_from_be_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 BE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_minus_1_bytes[32 - 1] > 0);\n p_minus_1_bytes[32 - 1] -= 1;\n\n let p_minus_1 = Field::from_be_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_be_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 BE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_plus_1_bytes[32 - 1] < 255);\n p_plus_1_bytes[32 - 1] += 1;\n\n let p_plus_1 = Field::from_be_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 BE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_be_bytes();\n assert_eq(p_plus_1_converted_bytes[32 - 1], 1);\n p_plus_1_converted_bytes[32 - 1] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_be_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_be_bytes().len(), 32);\n let p = Field::from_be_bytes::<32>(modulus_be_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 BE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_be_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n #[test]\n fn test_to_from_le_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 LE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_minus_1_bytes[0] > 0);\n p_minus_1_bytes[0] -= 1;\n\n let p_minus_1 = Field::from_le_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_le_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 LE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_plus_1_bytes[0] < 255);\n p_plus_1_bytes[0] += 1;\n\n let p_plus_1 = Field::from_le_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 LE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_le_bytes();\n assert_eq(p_plus_1_converted_bytes[0], 1);\n p_plus_1_converted_bytes[0] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_le_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_le_bytes().len(), 32);\n let p = Field::from_le_bytes::<32>(modulus_le_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 LE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_le_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n /// Convert a little endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_le_bits<let N: u32>(bits: [u1; N]) -> Field {\n static_assert(\n N <= modulus_le_bits().len(),\n \"N must be less than or equal to modulus_le_bits().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n /// Convert a big endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_be_bits<let N: u32>(bits: [u1; N]) -> Field {\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[N - 1 - i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n #[test]\n fn test_to_from_be_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 BE bits for (modulus - 1)\n let mut p_minus_1_bits: [u1; 254] = modulus_be_bits().as_array();\n assert(p_minus_1_bits[254 - 1] > 0);\n p_minus_1_bits[254 - 1] -= 1;\n\n let p_minus_1 = from_be_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [u1; 254] = p_minus_1.to_be_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 BE bits for (modulus + 4)\n let mut p_plus_4_bits: [u1; 254] = modulus_be_bits().as_array();\n assert(p_plus_4_bits[254 - 3] < 1);\n p_plus_4_bits[254 - 3] += 1;\n\n let p_plus_4 = from_be_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 BE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [u1; 254] = p_plus_4.to_be_bits();\n assert_eq(p_plus_4_converted_bits[254 - 3], 1);\n p_plus_4_converted_bits[254 - 3] = 0;\n assert_eq(p_plus_4_converted_bits, [0; 254]);\n\n // checking that Field::from_be_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_be_bits().len(), 254);\n let p = from_be_bits::<254>(modulus_be_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 BE bytes produces 254 zeroes\n let p_bits: [u1; 254] = 0.to_be_bits();\n assert_eq(p_bits, [0; 254]);\n }\n }\n\n #[test]\n fn test_to_from_le_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 LE bits for (modulus - 1)\n let mut p_minus_1_bits: [u1; 254] = modulus_le_bits().as_array();\n assert(p_minus_1_bits[0] > 0);\n p_minus_1_bits[0] -= 1;\n\n let p_minus_1 = from_le_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [u1; 254] = p_minus_1.to_le_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 LE bits for (modulus + 4)\n let mut p_plus_4_bits: [u1; 254] = modulus_le_bits().as_array();\n assert(p_plus_4_bits[2] < 1);\n p_plus_4_bits[2] += 1;\n\n let p_plus_4 = from_le_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 LE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [u1; 254] = p_plus_4.to_le_bits();\n assert_eq(p_plus_4_converted_bits[2], 1);\n p_plus_4_converted_bits[2] = 0;\n assert_eq(p_plus_4_converted_bits, [0; 254]);\n\n // checking that Field::from_le_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_le_bits().len(), 254);\n let p = from_le_bits::<254>(modulus_le_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 LE bytes produces 254 zeroes\n let p_bits: [u1; 254] = 0.to_le_bits();\n assert_eq(p_bits, [0; 254]);\n }\n }\n}\n"
3897
3845
  },
3898
- "172": {
3846
+ "170": {
3899
3847
  "function_locations": [
3900
3848
  {
3901
3849
  "name": "aes128_decrypt_oracle",
@@ -3917,7 +3865,7 @@
3917
3865
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/aes128_decrypt.nr",
3918
3866
  "source": "#[oracle(aztec_utl_decryptAes128)]\nunconstrained fn aes128_decrypt_oracle<let N: u32>(\n ciphertext: BoundedVec<u8, N>,\n iv: [u8; 16],\n sym_key: [u8; 16],\n) -> Option<BoundedVec<u8, N>> {}\n\n/// Attempts to decrypt a ciphertext using AES128.\n///\n/// Returns `Option::some(plaintext)` on success, or `Option::none()` if decryption fails (e.g. due to malformed\n/// ciphertext or invalid PKCS#7 padding). Note that decryption with the wrong key will almost always return `None`\n/// because the decrypted garbage data will have invalid PKCS#7 padding.\n///\n/// Note that we accept ciphertext as a BoundedVec, not as an array. This is because this function is typically used\n/// when processing logs and at that point we don't have comptime information about the length of the ciphertext as\n/// the log is not specific to any individual note.\n// TODO(F-498): review naming consistency\npub unconstrained fn try_aes128_decrypt<let N: u32>(\n ciphertext: BoundedVec<u8, N>,\n iv: [u8; 16],\n sym_key: [u8; 16],\n) -> Option<BoundedVec<u8, N>> {\n aes128_decrypt_oracle(ciphertext, iv, sym_key)\n}\n\nmod test {\n use crate::{\n keys::ecdh_shared_secret::compute_app_siloed_shared_secret,\n messages::encryption::aes128::derive_aes_symmetric_key_and_iv_from_shared_secret,\n utils::{array::subarray::subarray, point::point_from_x_coord},\n };\n use crate::protocol::address::AztecAddress;\n use crate::test::helpers::test_environment::TestEnvironment;\n use super::try_aes128_decrypt;\n use std::aes128::aes128_encrypt;\n\n global CONTRACT_ADDRESS: AztecAddress = AztecAddress { inner: 42 };\n global TEST_PLAINTEXT_LENGTH: u32 = 10;\n global TEST_CIPHERTEXT_LENGTH: u32 = 16;\n global TEST_PADDING_LENGTH: u32 = TEST_CIPHERTEXT_LENGTH - TEST_PLAINTEXT_LENGTH;\n\n #[test]\n unconstrained fn aes_encrypt_then_decrypt() {\n let env = TestEnvironment::new();\n\n env.utility_context(|_| {\n let shared_secret_point = point_from_x_coord(1).unwrap();\n let s_app = compute_app_siloed_shared_secret(shared_secret_point, CONTRACT_ADDRESS);\n\n let (sym_key, iv) = derive_aes_symmetric_key_and_iv_from_shared_secret::<1>(s_app)[0];\n\n let plaintext: [u8; TEST_PLAINTEXT_LENGTH] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n\n let ciphertext: [u8; TEST_CIPHERTEXT_LENGTH] = aes128_encrypt(plaintext, iv, sym_key);\n\n let ciphertext_bvec = BoundedVec::<u8, TEST_CIPHERTEXT_LENGTH>::from_array(ciphertext);\n\n let received_plaintext = try_aes128_decrypt(ciphertext_bvec, iv, sym_key).unwrap();\n assert_eq(received_plaintext.len(), TEST_PLAINTEXT_LENGTH);\n assert_eq(received_plaintext.max_len(), TEST_CIPHERTEXT_LENGTH);\n assert_eq(subarray::<_, _, TEST_PLAINTEXT_LENGTH>(received_plaintext.storage(), 0), plaintext);\n assert_eq(\n subarray::<_, _, TEST_PADDING_LENGTH>(received_plaintext.storage(), TEST_PLAINTEXT_LENGTH),\n [0 as u8; TEST_PADDING_LENGTH],\n );\n })\n }\n\n #[test]\n unconstrained fn aes_encrypt_then_decrypt_with_bad_sym_key_is_caught() {\n let env = TestEnvironment::new();\n\n env.utility_context(|_| {\n // Decrypting with the wrong key results in garbage data with invalid PKCS#7 padding,\n // so the oracle returns None.\n let shared_secret_point = point_from_x_coord(1).unwrap();\n let s_app = compute_app_siloed_shared_secret(shared_secret_point, CONTRACT_ADDRESS);\n\n let (sym_key, iv) = derive_aes_symmetric_key_and_iv_from_shared_secret::<1>(s_app)[0];\n\n let plaintext: [u8; TEST_PLAINTEXT_LENGTH] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n let ciphertext: [u8; TEST_CIPHERTEXT_LENGTH] = aes128_encrypt(plaintext, iv, sym_key);\n\n let mut bad_sym_key = sym_key;\n bad_sym_key[0] = 0;\n\n let ciphertext_bvec = BoundedVec::<u8, TEST_CIPHERTEXT_LENGTH>::from_array(ciphertext);\n // Decryption with wrong key returns None because the garbage output has invalid PKCS#7 padding.\n let result = try_aes128_decrypt(ciphertext_bvec, iv, bad_sym_key);\n assert(result.is_none(), \"decryption with bad key should return None\");\n });\n }\n}\n"
3919
3867
  },
3920
- "174": {
3868
+ "172": {
3921
3869
  "function_locations": [
3922
3870
  {
3923
3871
  "name": "address",
@@ -4155,7 +4103,7 @@
4155
4103
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/avm.nr",
4156
4104
  "source": "//! AVM oracles.\n//!\n//! There are only available during public execution. Calling any of them from a private or utility function will\n//! result in runtime errors.\n\nuse crate::protocol::address::{AztecAddress, EthAddress};\n\npub unconstrained fn address() -> AztecAddress {\n address_opcode()\n}\npub unconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\npub unconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\npub unconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\npub unconstrained fn version() -> Field {\n version_opcode()\n}\npub unconstrained fn block_number() -> u32 {\n block_number_opcode()\n}\npub unconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\npub unconstrained fn min_fee_per_l2_gas() -> u128 {\n min_fee_per_l2_gas_opcode()\n}\npub unconstrained fn min_fee_per_da_gas() -> u128 {\n min_fee_per_da_gas_opcode()\n}\npub unconstrained fn l2_gas_left() -> u32 {\n l2_gas_left_opcode()\n}\npub unconstrained fn da_gas_left() -> u32 {\n da_gas_left_opcode()\n}\npub unconstrained fn is_static_call() -> u1 {\n is_static_call_opcode()\n}\npub unconstrained fn note_hash_exists(note_hash: Field, leaf_index: u64) -> u1 {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\npub unconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\npub unconstrained fn nullifier_exists(siloed_nullifier: Field) -> u1 {\n nullifier_exists_opcode(siloed_nullifier)\n}\npub unconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\npub unconstrained fn emit_public_log(message: [Field]) {\n emit_public_log_opcode(message)\n}\npub unconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: u64) -> u1 {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\npub unconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\n\npub unconstrained fn call<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n args: [Field; N],\n) {\n call_opcode(l2_gas_allocation, da_gas_allocation, address, N, args)\n}\n\npub unconstrained fn call_static<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n args: [Field; N],\n) {\n call_static_opcode(l2_gas_allocation, da_gas_allocation, address, N, args)\n}\n\npub unconstrained fn calldata_copy<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {\n calldata_copy_opcode(cdoffset, copy_size)\n}\n\n/// `success_copy` is placed immediately after the CALL opcode to get the success value\npub unconstrained fn success_copy() -> bool {\n success_copy_opcode()\n}\n\npub unconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\npub unconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\n/// The additional prefix is to avoid clashing with the `return` Noir keyword.\npub unconstrained fn avm_return(returndata: [Field]) {\n return_opcode(returndata)\n}\n\n/// This opcode reverts using the exact data given. In general it should only be used to do rethrows, where the revert\n/// data is the same as the original revert data. For normal reverts, use Noir's `assert` which, on top of reverting,\n/// will also add an error selector to the revert data.\npub unconstrained fn revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\npub unconstrained fn storage_read(storage_slot: Field, contract_address: Field) -> Field {\n storage_read_opcode(storage_slot, contract_address)\n}\n\npub unconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\n#[oracle(aztec_avm_address)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(aztec_avm_sender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(aztec_avm_transactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(aztec_avm_chainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(aztec_avm_version)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(aztec_avm_blockNumber)]\nunconstrained fn block_number_opcode() -> u32 {}\n\n#[oracle(aztec_avm_timestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(aztec_avm_minFeePerL2Gas)]\nunconstrained fn min_fee_per_l2_gas_opcode() -> u128 {}\n\n#[oracle(aztec_avm_minFeePerDaGas)]\nunconstrained fn min_fee_per_da_gas_opcode() -> u128 {}\n\n#[oracle(aztec_avm_l2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> u32 {}\n\n#[oracle(aztec_avm_daGasLeft)]\nunconstrained fn da_gas_left_opcode() -> u32 {}\n\n#[oracle(aztec_avm_isStaticCall)]\nunconstrained fn is_static_call_opcode() -> u1 {}\n\n#[oracle(aztec_avm_noteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: u64) -> u1 {}\n\n#[oracle(aztec_avm_emitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(aztec_avm_nullifierExists)]\nunconstrained fn nullifier_exists_opcode(siloed_nullifier: Field) -> u1 {}\n\n#[oracle(aztec_avm_emitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n#[oracle(aztec_avm_emitPublicLog)]\nunconstrained fn emit_public_log_opcode(message: [Field]) {}\n\n#[oracle(aztec_avm_l1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: u64) -> u1 {}\n\n#[oracle(aztec_avm_sendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(aztec_avm_calldataCopy)]\nunconstrained fn calldata_copy_opcode<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(aztec_avm_returndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(aztec_avm_returndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(aztec_avm_return)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n#[oracle(aztec_avm_revert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n// While the length parameter might seem unnecessary given that we have N we keep it around because at the AVM bytecode\n// level, we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally take\n// that route.\n#[oracle(aztec_avm_call)]\nunconstrained fn call_opcode<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n length: u32,\n args: [Field; N],\n) {}\n\n// While the length parameter might seem unnecessary given that we have N we keep it around because at the AVM bytecode\n// level, we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally take\n// that route.\n#[oracle(aztec_avm_staticCall)]\nunconstrained fn call_static_opcode<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n length: u32,\n args: [Field; N],\n) {}\n\n#[oracle(aztec_avm_successCopy)]\nunconstrained fn success_copy_opcode() -> bool {}\n\n#[oracle(aztec_avm_storageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field, contract_address: Field) -> Field {}\n\n#[oracle(aztec_avm_storageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n"
4157
4105
  },
4158
- "176": {
4106
+ "174": {
4159
4107
  "function_locations": [
4160
4108
  {
4161
4109
  "name": "call_private_function_oracle",
@@ -4169,7 +4117,7 @@
4169
4117
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/call_private_function.nr",
4170
4118
  "source": "use crate::protocol::{abis::function_selector::FunctionSelector, address::AztecAddress, utils::reader::Reader};\n\n#[oracle(aztec_prv_callPrivateFunction)]\nunconstrained fn call_private_function_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _start_side_effect_counter: u32,\n _is_static_call: bool,\n) -> [Field; 2] {}\n\npub unconstrained fn call_private_function_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n start_side_effect_counter: u32,\n is_static_call: bool,\n) -> (u32, Field) {\n let fields = call_private_function_oracle(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n );\n\n let mut reader = Reader::new(fields);\n let end_side_effect_counter = reader.read_u32();\n let returns_hash = reader.read();\n\n (end_side_effect_counter, returns_hash)\n}\n"
4171
4119
  },
4172
- "177": {
4120
+ "175": {
4173
4121
  "function_locations": [
4174
4122
  {
4175
4123
  "name": "store",
@@ -4263,7 +4211,7 @@
4263
4211
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/capsules.nr",
4264
4212
  "source": "use crate::protocol::{address::AztecAddress, traits::{Deserialize, Serialize}};\n\n/// Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `load`. If\n/// data was already stored at this slot, it is overwritten.\n// TODO(F-498): review naming consistency\npub unconstrained fn store<T>(contract_address: AztecAddress, slot: Field, value: T, scope: AztecAddress)\nwhere\n T: Serialize,\n{\n let serialized = value.serialize();\n set_capsule_oracle(contract_address, slot, serialized, scope);\n}\n\n/// Returns data previously stored via `storeCapsule` in the per-contract non-volatile database. Returns\n/// Option::none() if nothing was stored at the given slot.\n// TODO(F-498): review naming consistency\npub unconstrained fn load<T>(contract_address: AztecAddress, slot: Field, scope: AztecAddress) -> Option<T>\nwhere\n T: Deserialize,\n{\n let serialized_option = get_capsule_oracle(contract_address, slot, <T as Deserialize>::N, scope);\n serialized_option.map(|arr| Deserialize::deserialize(arr))\n}\n\n/// Deletes data in the per-contract non-volatile database. Does nothing if no data was present.\npub unconstrained fn delete(contract_address: AztecAddress, slot: Field, scope: AztecAddress) {\n delete_oracle(contract_address, slot, scope);\n}\n\n/// Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data\n/// structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`. Supports overlapping source and\n/// destination regions (which will result in the overlapped source values being overwritten). All copied slots must\n/// exist in the database (i.e. have been stored and not deleted)\npub unconstrained fn copy(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n scope: AztecAddress,\n) {\n copy_oracle(contract_address, src_slot, dst_slot, num_entries, scope);\n}\n\n#[oracle(aztec_utl_setCapsule)]\nunconstrained fn set_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n values: [Field; N],\n scope: AztecAddress,\n) {}\n\n/// We need to pass in `array_len` (the value of N) as a parameter to tell the oracle how many fields the response must\n/// have.\n///\n/// Note that the oracle returns an Option<[Field; N]> because we cannot return an Option<T> directly. That would\n/// require for the oracle resolver to know the shape of T (e.g. if T were a struct of 3 u32 values then the expected\n/// response shape would be 3 single items, whereas it were a struct containing `u32, [Field;10], u32` then the\n/// expected shape would be single, array, single.). Instead, we return the serialization and deserialize in Noir.\n#[oracle(aztec_utl_getCapsule)]\nunconstrained fn get_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n array_len: u32,\n scope: AztecAddress,\n) -> Option<[Field; N]> {}\n\n#[oracle(aztec_utl_deleteCapsule)]\nunconstrained fn delete_oracle(contract_address: AztecAddress, slot: Field, scope: AztecAddress) {}\n\n#[oracle(aztec_utl_copyCapsule)]\nunconstrained fn copy_oracle(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n scope: AztecAddress,\n) {}\n\nmod test {\n // These tests are sort of redundant since we already test the oracle implementation directly in TypeScript, but\n // they are cheap regardless and help ensure both that the TXE implementation works accordingly and that the Noir\n // oracles are hooked up correctly.\n\n use crate::{\n oracle::capsules::{copy, delete, load, store},\n test::{helpers::test_environment::TestEnvironment, mocks::MockStruct},\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, ToField}};\n\n global SLOT: Field = 1;\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n #[test]\n unconstrained fn stores_and_loads() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n\n assert_eq(load(contract_address, SLOT, scope).unwrap(), value);\n });\n }\n\n #[test]\n unconstrained fn store_overwrites() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n\n let new_value = MockStruct::new(7, 8);\n store(contract_address, SLOT, new_value, scope);\n\n assert_eq(load(contract_address, SLOT, scope).unwrap(), new_value);\n });\n }\n\n #[test]\n unconstrained fn loads_empty_slot() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_stored_value() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n delete(contract_address, SLOT, scope);\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_empty_slot() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n delete(contract_address, SLOT, scope);\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn copies_non_overlapping_values() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let src = 5;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 10;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).unwrap(), values[2]);\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_src_ahead() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let src = 1;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 2;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).unwrap(), values[2]);\n\n // src[1] and src[2] should have been overwritten since they are also dst[0] and dst[1]\n assert_eq(load(contract_address, src, scope).unwrap(), values[0]); // src[0] (unchanged)\n assert_eq(load(contract_address, src + 1, scope).unwrap(), values[0]); // dst[0]\n assert_eq(load(contract_address, src + 2, scope).unwrap(), values[1]); // dst[1]\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_dst_ahead() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let src = 2;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 1;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).unwrap(), values[2]);\n\n // src[0] and src[1] should have been overwritten since they are also dst[1] and dst[2]\n assert_eq(load(contract_address, src, scope).unwrap(), values[1]); // dst[1]\n assert_eq(load(contract_address, src + 1, scope).unwrap(), values[2]); // dst[2]\n assert_eq(load(contract_address, src + 2, scope).unwrap(), values[2]); // src[2] (unchanged)\n });\n }\n\n #[test(should_fail_with = \"copy empty slot\")]\n unconstrained fn cannot_copy_empty_values() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n copy(contract_address, SLOT, SLOT, 1, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_store_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let value = MockStruct::new(5, 6);\n store(other_contract_address, SLOT, value, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_load_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let _: Option<MockStruct> = load(other_contract_address, SLOT, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_delete_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n delete(other_contract_address, SLOT, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_copy_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n copy(other_contract_address, SLOT, SLOT, 0, scope);\n });\n }\n}\n"
4265
4213
  },
4266
- "178": {
4214
+ "176": {
4267
4215
  "function_locations": [
4268
4216
  {
4269
4217
  "name": "set_contract_sync_cache_invalid_oracle",
@@ -4277,7 +4225,7 @@
4277
4225
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/contract_sync.nr",
4278
4226
  "source": "use crate::protocol::address::AztecAddress;\n\n#[oracle(aztec_utl_setContractSyncCacheInvalid)]\nunconstrained fn set_contract_sync_cache_invalid_oracle<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {}\n\n/// Forces the PXE to re-sync the given contract for a set of scopes on the next query.\n///\n/// Call this after writing data (e.g. offchain messages) that the contract's `sync_state` function needs to discover.\n/// Without invalidation, the sync cache would skip re-running `sync_state` until the next block.\npub unconstrained fn set_contract_sync_cache_invalid<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {\n set_contract_sync_cache_invalid_oracle(contract_address, scopes);\n}\n"
4279
4227
  },
4280
- "179": {
4228
+ "177": {
4281
4229
  "function_locations": [
4282
4230
  {
4283
4231
  "name": "get_utility_context_oracle",
@@ -4291,6 +4239,32 @@
4291
4239
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution.nr",
4292
4240
  "source": "use crate::context::UtilityContext;\n\n#[oracle(aztec_utl_getUtilityContext)]\nunconstrained fn get_utility_context_oracle() -> UtilityContext {}\n\n/// Returns a utility context built from the global variables of anchor block and the contract address of the function\n/// being executed.\npub unconstrained fn get_utility_context() -> UtilityContext {\n get_utility_context_oracle()\n}\n"
4293
4241
  },
4242
+ "178": {
4243
+ "function_locations": [
4244
+ {
4245
+ "name": "store",
4246
+ "start": 192
4247
+ },
4248
+ {
4249
+ "name": "set_hash_preimage_oracle_wrapper",
4250
+ "start": 583
4251
+ },
4252
+ {
4253
+ "name": "load",
4254
+ "start": 739
4255
+ },
4256
+ {
4257
+ "name": "set_hash_preimage_oracle",
4258
+ "start": 905
4259
+ },
4260
+ {
4261
+ "name": "get_hash_preimage_oracle",
4262
+ "start": 1028
4263
+ }
4264
+ ],
4265
+ "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution_cache.nr",
4266
+ "source": "/// Stores values represented as slice in execution cache to be later obtained by its hash.\n// TODO(F-498): review naming consistency\npub fn store<let N: u32>(values: [Field; N], hash: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call. When loading the values, however, the caller must check that the values are indeed the preimage.\n unsafe { set_hash_preimage_oracle_wrapper(values, hash) };\n}\n\nunconstrained fn set_hash_preimage_oracle_wrapper<let N: u32>(values: [Field; N], hash: Field) {\n set_hash_preimage_oracle(values, hash);\n}\n\n// TODO(F-498): review naming consistency\npub unconstrained fn load<let N: u32>(hash: Field) -> [Field; N] {\n get_hash_preimage_oracle(hash)\n}\n\n#[oracle(aztec_prv_setHashPreimage)]\nunconstrained fn set_hash_preimage_oracle<let N: u32>(_values: [Field; N], _hash: Field) {}\n\n#[oracle(aztec_prv_getHashPreimage)]\nunconstrained fn get_hash_preimage_oracle<let N: u32>(_hash: Field) -> [Field; N] {}\n"
4267
+ },
4294
4268
  "18": {
4295
4269
  "function_locations": [
4296
4270
  {
@@ -4453,33 +4427,7 @@
4453
4427
  "path": "std/hash/mod.nr",
4454
4428
  "source": "// Exposed only for usage in `std::meta`\npub(crate) mod poseidon2;\n\nuse crate::default::Default;\nuse crate::embedded_curve_ops::{\n EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul, multi_scalar_mul_array_return,\n};\nuse crate::meta::derive_via;\nuse crate::static_assert;\n\n/// The size of the state accepted by the backend in `poseidon2_permutation`.\nglobal POSEIDON2_CONFIG_STATE_SIZE: u32 = poseidon2_config_state_size();\n\n#[foreign(sha256_compression)]\n// docs:start:sha256_compression\npub fn sha256_compression(input: [u32; 16], state: [u32; 8]) -> [u32; 8] {}\n// docs:end:sha256_compression\n\n#[foreign(keccakf1600)]\n// docs:start:keccakf1600\npub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {}\n// docs:end:keccakf1600\n\npub mod keccak {\n #[deprecated(\"This function has been moved to std::hash::keccakf1600\")]\n pub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {\n super::keccakf1600(input)\n }\n}\n\n#[foreign(blake2s)]\n// docs:start:blake2s\npub fn blake2s<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake2s\n{}\n\n// docs:start:blake3\npub fn blake3<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake3\n{\n if crate::runtime::is_unconstrained() {\n // Temporary measure while Barretenberg is main proving system.\n // Please open an issue if you're working on another proving system and running into problems due to this.\n crate::static_assert(\n N <= 1024,\n \"Barretenberg cannot prove blake3 hashes with inputs larger than 1024 bytes\",\n );\n }\n __blake3(input)\n}\n\n#[foreign(blake3)]\nfn __blake3<let N: u32>(input: [u8; N]) -> [u8; 32] {}\n\n// docs:start:pedersen_commitment\npub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint {\n // docs:end:pedersen_commitment\n pedersen_commitment_with_separator(input, 0)\n}\n\n#[inline_always]\npub fn pedersen_commitment_with_separator<let N: u32>(\n input: [Field; N],\n separator: u32,\n) -> EmbeddedCurvePoint {\n let mut points = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N];\n for i in 0..N {\n // we use the unsafe version because the multi_scalar_mul will constrain the scalars.\n points[i] = from_field_unsafe(input[i]);\n }\n let generators = derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n multi_scalar_mul(generators, points)\n}\n\n// docs:start:pedersen_hash\npub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field\n// docs:end:pedersen_hash\n{\n pedersen_hash_with_separator(input, 0)\n}\n\n#[no_predicates]\npub fn pedersen_hash_with_separator<let N: u32>(input: [Field; N], separator: u32) -> Field {\n let mut scalars: [EmbeddedCurveScalar; N + 1] = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N + 1];\n let mut generators: [EmbeddedCurvePoint; N + 1] =\n [EmbeddedCurvePoint::point_at_infinity(); N + 1];\n crate::assert_constant(separator);\n let domain_generators: [EmbeddedCurvePoint; N] =\n derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n\n for i in 0..N {\n scalars[i] = from_field_unsafe(input[i]);\n generators[i] = domain_generators[i];\n }\n scalars[N] = EmbeddedCurveScalar { lo: N as Field, hi: 0 as Field };\n\n let length_generator: [EmbeddedCurvePoint; 1] =\n derive_generators(\"pedersen_hash_length\".as_bytes(), 0);\n generators[N] = length_generator[0];\n multi_scalar_mul_array_return(generators, scalars)[0].x\n}\n\n#[field(bn254)]\n#[inline_always]\npub fn derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {\n crate::assert_constant(domain_separator_bytes);\n crate::assert_constant(starting_index);\n __derive_generators(domain_separator_bytes, starting_index)\n}\n\n#[builtin(derive_pedersen_generators)]\n#[field(bn254)]\nfn __derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {}\n\n#[field(bn254)]\n// Decompose the input 'bn254 scalar' into two 128 bits limbs.\n// It is called 'unsafe' because it does not assert the limbs are 128 bits\n// Assuming the limbs are 128 bits:\n// Assert the decomposition does not overflow the field size.\nfn from_field_unsafe(scalar: Field) -> EmbeddedCurveScalar {\n // Safety: xlo and xhi decomposition is checked below\n let (xlo, xhi) = unsafe { crate::field::bn254::decompose_hint(scalar) };\n // Check that the decomposition is correct\n assert_eq(scalar, xlo + crate::field::bn254::TWO_POW_128 * xhi);\n // Check that the decomposition does not overflow the field size\n let (a, b) = if xhi == crate::field::bn254::PHI {\n (xlo, crate::field::bn254::PLO)\n } else {\n (xhi, crate::field::bn254::PHI)\n };\n crate::field::bn254::assert_lt(a, b);\n\n EmbeddedCurveScalar { lo: xlo, hi: xhi }\n}\n\npub fn poseidon2_permutation<let N: u32>(input: [Field; N], state_len: u32) -> [Field; N] {\n assert_eq(input.len(), state_len);\n\n static_assert(\n N == POSEIDON2_CONFIG_STATE_SIZE,\n f\"the input length must equal the state size in the Poseidon2 config; expected {POSEIDON2_CONFIG_STATE_SIZE}, got {N}\",\n );\n poseidon2_permutation_internal(input)\n}\n\n#[foreign(poseidon2_permutation)]\nfn poseidon2_permutation_internal<let N: u32>(input: [Field; N]) -> [Field; N] {}\n\n#[foreign(poseidon2_config_state_size)]\ncomptime fn poseidon2_config_state_size() -> u32 {}\n\n// Generic hashing support.\n// Partially ported and impacted by rust.\n\n// Hash trait shall be implemented per type.\n#[derive_via(derive_hash)]\npub trait Hash {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher;\n}\n\n// docs:start:derive_hash\ncomptime fn derive_hash(s: TypeDefinition) -> Quoted {\n let name = quote { $crate::hash::Hash };\n let signature = quote { fn hash<H>(_self: Self, _state: &mut H) where H: $crate::hash::Hasher };\n let for_each_field = |name| quote { _self.$name.hash(_state); };\n crate::meta::make_trait_impl(\n s,\n name,\n signature,\n for_each_field,\n quote {},\n |fields| fields,\n )\n}\n// docs:end:derive_hash\n\n// Hasher trait shall be implemented by algorithms to provide hash-agnostic means.\n// TODO: consider making the types generic here ([u8], [Field], etc.)\npub trait Hasher {\n fn finish(self) -> Field;\n\n /// Returns the hash value without consuming the hasher.\n /// Override this for more efficient implementations that avoid copying.\n /// TODO: deprecate finish() and replace it\n fn finish_ref(&self) -> Field {\n (*self).finish()\n }\n\n fn write(&mut self, input: Field);\n}\n\n// BuildHasher is a factory trait, responsible for production of specific Hasher.\npub trait BuildHasher {\n type H: Hasher;\n\n fn build_hasher(self) -> H;\n}\n\npub struct BuildHasherDefault<H>;\n\nimpl<H> BuildHasher for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n type H = H;\n\n fn build_hasher(_self: Self) -> H {\n H::default()\n }\n}\n\nimpl<H> Default for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n fn default() -> Self {\n BuildHasherDefault {}\n }\n}\n\nimpl Hash for Field {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self);\n }\n}\n\nimpl Hash for u1 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u128 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for i8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u8 as Field);\n }\n}\n\nimpl Hash for i16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u16 as Field);\n }\n}\n\nimpl Hash for i32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u32 as Field);\n }\n}\n\nimpl Hash for i64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u64 as Field);\n }\n}\n\nimpl Hash for bool {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for () {\n fn hash<H>(_self: Self, _state: &mut H)\n where\n H: Hasher,\n {}\n}\n\nimpl<T, let N: u32> Hash for [T; N]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<T> Hash for [T]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.len().hash(state);\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<A, B> Hash for (A, B)\nwhere\n A: Hash,\n B: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n }\n}\n\nimpl<A, B, C> Hash for (A, B, C)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n }\n}\n\nimpl<A, B, C, D> Hash for (A, B, C, D)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n }\n}\n\nimpl<A, B, C, D, E> Hash for (A, B, C, D, E)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n }\n}\n\n// Some test vectors for Pedersen hash and Pedersen Commitment.\n// They have been generated using the same functions so the tests are for now useless\n// but they will be useful when we switch to Noir implementation.\n#[test]\nfn assert_pedersen() {\n assert_eq(\n pedersen_hash_with_separator([1], 1),\n 0x1b3f4b1a83092a13d8d1a59f7acb62aba15e7002f4440f2275edb99ebbc2305f,\n );\n assert_eq(\n pedersen_commitment_with_separator([1], 1),\n EmbeddedCurvePoint {\n x: 0x054aa86a73cb8a34525e5bbed6e43ba1198e860f5f3950268f71df4591bde402,\n y: 0x209dcfbf2cfb57f9f6046f44d71ac6faf87254afc7407c04eb621a6287cac126,\n is_infinite: false,\n },\n );\n\n assert_eq(\n pedersen_hash_with_separator([1, 2], 2),\n 0x26691c129448e9ace0c66d11f0a16d9014a9e8498ee78f4d69f0083168188255,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2], 2),\n EmbeddedCurvePoint {\n x: 0x2e2b3b191e49541fe468ec6877721d445dcaffe41728df0a0eafeb15e87b0753,\n y: 0x2ff4482400ad3a6228be17a2af33e2bcdf41be04795f9782bd96efe7e24f8778,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3], 3),\n 0x0bc694b7a1f8d10d2d8987d07433f26bd616a2d351bc79a3c540d85b6206dbe4,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3], 3),\n EmbeddedCurvePoint {\n x: 0x1fee4e8cf8d2f527caa2684236b07c4b1bad7342c01b0f75e9a877a71827dc85,\n y: 0x2f9fedb9a090697ab69bf04c8bc15f7385b3e4b68c849c1536e5ae15ff138fd1,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4], 4),\n 0xdae10fb32a8408521803905981a2b300d6a35e40e798743e9322b223a5eddc,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4], 4),\n EmbeddedCurvePoint {\n x: 0x07ae3e202811e1fca39c2d81eabe6f79183978e6f12be0d3b8eda095b79bdbc9,\n y: 0x0afc6f892593db6fbba60f2da558517e279e0ae04f95758587760ba193145014,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5], 5),\n 0xfc375b062c4f4f0150f7100dfb8d9b72a6d28582dd9512390b0497cdad9c22,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5], 5),\n EmbeddedCurvePoint {\n x: 0x1754b12bd475a6984a1094b5109eeca9838f4f81ac89c5f0a41dbce53189bb29,\n y: 0x2da030e3cfcdc7ddad80eaf2599df6692cae0717d4e9f7bfbee8d073d5d278f7,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6], 6),\n 0x1696ed13dc2730062a98ac9d8f9de0661bb98829c7582f699d0273b18c86a572,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6], 6),\n EmbeddedCurvePoint {\n x: 0x190f6c0e97ad83e1e28da22a98aae156da083c5a4100e929b77e750d3106a697,\n y: 0x1f4b60f34ef91221a0b49756fa0705da93311a61af73d37a0c458877706616fb,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n 0x128c0ff144fc66b6cb60eeac8a38e23da52992fc427b92397a7dffd71c45ede3,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n EmbeddedCurvePoint {\n x: 0x015441e9d29491b06563fac16fc76abf7a9534c715421d0de85d20dbe2965939,\n y: 0x1d2575b0276f4e9087e6e07c2cb75aa1baafad127af4be5918ef8a2ef2fea8fc,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n 0x2f960e117482044dfc99d12fece2ef6862fba9242be4846c7c9a3e854325a55c,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n EmbeddedCurvePoint {\n x: 0x1657737676968887fceb6dd516382ea13b3a2c557f509811cd86d5d1199bc443,\n y: 0x1f39f0cb569040105fa1e2f156521e8b8e08261e635a2b210bdc94e8d6d65f77,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n 0x0c96db0790602dcb166cc4699e2d306c479a76926b81c2cb2aaa92d249ec7be7,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n EmbeddedCurvePoint {\n x: 0x0a3ceae42d14914a432aa60ec7fded4af7dad7dd4acdbf2908452675ec67e06d,\n y: 0xfc19761eaaf621ad4aec9a8b2e84a4eceffdba78f60f8b9391b0bd9345a2f2,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n 0x2cd37505871bc460a62ea1e63c7fe51149df5d0801302cf1cbc48beb8dff7e94,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n EmbeddedCurvePoint {\n x: 0x2fb3f8b3d41ddde007c8c3c62550f9a9380ee546fcc639ffbb3fd30c8d8de30c,\n y: 0x300783be23c446b11a4c0fabf6c91af148937cea15fcf5fb054abf7f752ee245,\n is_infinite: false,\n },\n );\n}\n"
4455
4429
  },
4456
- "180": {
4457
- "function_locations": [
4458
- {
4459
- "name": "store",
4460
- "start": 192
4461
- },
4462
- {
4463
- "name": "set_hash_preimage_oracle_wrapper",
4464
- "start": 583
4465
- },
4466
- {
4467
- "name": "load",
4468
- "start": 739
4469
- },
4470
- {
4471
- "name": "set_hash_preimage_oracle",
4472
- "start": 905
4473
- },
4474
- {
4475
- "name": "get_hash_preimage_oracle",
4476
- "start": 1028
4477
- }
4478
- ],
4479
- "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution_cache.nr",
4480
- "source": "/// Stores values represented as slice in execution cache to be later obtained by its hash.\n// TODO(F-498): review naming consistency\npub fn store<let N: u32>(values: [Field; N], hash: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call. When loading the values, however, the caller must check that the values are indeed the preimage.\n unsafe { set_hash_preimage_oracle_wrapper(values, hash) };\n}\n\nunconstrained fn set_hash_preimage_oracle_wrapper<let N: u32>(values: [Field; N], hash: Field) {\n set_hash_preimage_oracle(values, hash);\n}\n\n// TODO(F-498): review naming consistency\npub unconstrained fn load<let N: u32>(hash: Field) -> [Field; N] {\n get_hash_preimage_oracle(hash)\n}\n\n#[oracle(aztec_prv_setHashPreimage)]\nunconstrained fn set_hash_preimage_oracle<let N: u32>(_values: [Field; N], _hash: Field) {}\n\n#[oracle(aztec_prv_getHashPreimage)]\nunconstrained fn get_hash_preimage_oracle<let N: u32>(_hash: Field) -> [Field; N] {}\n"
4481
- },
4482
- "189": {
4430
+ "187": {
4483
4431
  "function_locations": [
4484
4432
  {
4485
4433
  "name": "fetch_tagged_logs",
@@ -4517,7 +4465,7 @@
4517
4465
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/message_processing.nr",
4518
4466
  "source": "use crate::protocol::address::AztecAddress;\n\n/// Finds new private logs that may have been sent to all registered accounts in PXE in the current contract and makes\n/// them available for later processing in Noir by storing them in a capsule array.\n// TODO(F-498): review naming consistency\npub unconstrained fn fetch_tagged_logs(pending_tagged_log_array_base_slot: Field, scope: AztecAddress) {\n get_pending_tagged_logs_oracle(pending_tagged_log_array_base_slot, scope);\n}\n\n#[oracle(aztec_utl_getPendingTaggedLogs)]\nunconstrained fn get_pending_tagged_logs_oracle(pending_tagged_log_array_base_slot: Field, scope: AztecAddress) {}\n\n// This must be a single oracle and not one for notes and one for events because the entire point is to validate all\n// notes and events in one go, minimizing node round-trips.\npub(crate) unconstrained fn validate_and_store_enqueued_notes_and_events(\n contract_address: AztecAddress,\n note_validation_requests_array_base_slot: Field,\n event_validation_requests_array_base_slot: Field,\n max_note_packed_len: Field,\n max_event_serialized_len: Field,\n scope: AztecAddress,\n) {\n validate_and_store_enqueued_notes_and_events_oracle(\n contract_address,\n note_validation_requests_array_base_slot,\n event_validation_requests_array_base_slot,\n max_note_packed_len,\n max_event_serialized_len,\n scope,\n );\n}\n\n#[oracle(aztec_utl_validateAndStoreEnqueuedNotesAndEvents)]\nunconstrained fn validate_and_store_enqueued_notes_and_events_oracle(\n contract_address: AztecAddress,\n note_validation_requests_array_base_slot: Field,\n event_validation_requests_array_base_slot: Field,\n max_note_packed_len: Field,\n max_event_serialized_len: Field,\n scope: AztecAddress,\n) {}\n\npub(crate) unconstrained fn get_logs_by_tag(\n contract_address: AztecAddress,\n log_retrieval_requests_array_base_slot: Field,\n log_retrieval_responses_array_base_slot: Field,\n scope: AztecAddress,\n) {\n get_logs_by_tag_oracle(\n contract_address,\n log_retrieval_requests_array_base_slot,\n log_retrieval_responses_array_base_slot,\n scope,\n );\n}\n\n#[oracle(aztec_utl_getLogsByTag)]\nunconstrained fn get_logs_by_tag_oracle(\n contract_address: AztecAddress,\n log_retrieval_requests_array_base_slot: Field,\n log_retrieval_responses_array_base_slot: Field,\n scope: AztecAddress,\n) {}\n\npub(crate) unconstrained fn get_message_contexts_by_tx_hash(\n contract_address: AztecAddress,\n message_context_requests_array_base_slot: Field,\n message_context_responses_array_base_slot: Field,\n scope: AztecAddress,\n) {\n get_message_contexts_by_tx_hash_oracle(\n contract_address,\n message_context_requests_array_base_slot,\n message_context_responses_array_base_slot,\n scope,\n );\n}\n\n#[oracle(aztec_utl_getMessageContextsByTxHash)]\nunconstrained fn get_message_contexts_by_tx_hash_oracle(\n contract_address: AztecAddress,\n message_context_requests_array_base_slot: Field,\n message_context_responses_array_base_slot: Field,\n scope: AztecAddress,\n) {}\n"
4519
4467
  },
4520
- "192": {
4468
+ "190": {
4521
4469
  "function_locations": [
4522
4470
  {
4523
4471
  "name": "notify_created_nullifier",
@@ -4547,7 +4495,7 @@
4547
4495
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/nullifiers.nr",
4548
4496
  "source": "//! Nullifier creation, existence checks, etc.\n\nuse crate::protocol::address::aztec_address::AztecAddress;\n\n/// Notifies the simulator that a nullifier has been created, so that its correct status (pending or settled) can be\n/// determined when reading nullifiers in subsequent private function calls. The first non-revertible nullifier emitted\n/// is also used to compute note nonces.\npub fn notify_created_nullifier(inner_nullifier: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call.\n unsafe { notify_created_nullifier_oracle(inner_nullifier) };\n}\n\n#[oracle(aztec_prv_notifyCreatedNullifier)]\nunconstrained fn notify_created_nullifier_oracle(_inner_nullifier: Field) {}\n\n/// Returns `true` if the nullifier has been emitted in the same transaction, i.e. if [`notify_created_nullifier`] has\n/// been\n/// called for this inner nullifier from the contract with the specified address.\n///\n/// Note that despite sharing pending transaction information with the app, this is not a privacy leak: anyone in the\n/// network can always determine in which transaction a inner nullifier was emitted by a given contract by simply\n/// inspecting transaction effects. What _would_ constitute a leak would be to share the list of inner pending\n/// nullifiers, as that would reveal their preimages.\npub unconstrained fn is_nullifier_pending(inner_nullifier: Field, contract_address: AztecAddress) -> bool {\n is_nullifier_pending_oracle(inner_nullifier, contract_address)\n}\n\n#[oracle(aztec_prv_isNullifierPending)]\nunconstrained fn is_nullifier_pending_oracle(_inner_nullifier: Field, _contract_address: AztecAddress) -> bool {}\n\n/// Returns `true` if the nullifier exists. Note that a `true` value can be constrained by proving existence of the\n/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before\n/// the current transaction is included in a block. While this might seem of little use at first, certain design\n/// patterns benefit from this abstraction (see e.g. `PrivateMutable`).\n// TODO(F-498): review naming consistency\npub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {\n does_nullifier_exist_oracle(inner_nullifier)\n}\n\n#[oracle(aztec_utl_doesNullifierExist)]\nunconstrained fn does_nullifier_exist_oracle(_inner_nullifier: Field) -> bool {}\n"
4549
4497
  },
4550
- "193": {
4498
+ "191": {
4551
4499
  "function_locations": [
4552
4500
  {
4553
4501
  "name": "emit_offchain_effect",
@@ -4561,7 +4509,7 @@
4561
4509
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/offchain_effect.nr",
4562
4510
  "source": "use crate::protocol::traits::Serialize;\n\n/// Emits data that will be delivered to PXE unaltered. This data can be interpreted freely by a downstream consumer\n/// (such as a wallet).\n///\n/// # Arguments\n///\n/// * `data` - The data to emit.\npub unconstrained fn emit_offchain_effect<T>(data: T)\nwhere\n T: Serialize,\n{\n emit_offchain_effect_oracle(data.serialize());\n}\n\n#[oracle(aztec_utl_emitOffchainEffect)]\nunconstrained fn emit_offchain_effect_oracle<let N: u32>(data: [Field; N]) {}\n"
4563
4511
  },
4564
- "194": {
4512
+ "192": {
4565
4513
  "function_locations": [
4566
4514
  {
4567
4515
  "name": "assert_valid_public_call_data",
@@ -4579,7 +4527,7 @@
4579
4527
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/public_call.nr",
4580
4528
  "source": "/// Validates public calldata by checking that the preimage exists and the cumulative size is within limits.\n///\n/// The check is unconstrained and the only purpose of it is to fail early in case of calldata overflow or a bug in\n/// calldata hashing.\npub(crate) fn assert_valid_public_call_data(calldata_hash: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects (validating the calldata).\n // It is therefore always safe to call.\n unsafe {\n assert_valid_public_call_data_oracle_wrapper(calldata_hash)\n }\n}\n\nunconstrained fn assert_valid_public_call_data_oracle_wrapper(calldata_hash: Field) {\n assert_valid_public_call_data_oracle(calldata_hash)\n}\n\n#[oracle(aztec_prv_assertValidPublicCalldata)]\nunconstrained fn assert_valid_public_call_data_oracle(_calldata_hash: Field) {}\n"
4581
4529
  },
4582
- "196": {
4530
+ "194": {
4583
4531
  "function_locations": [
4584
4532
  {
4585
4533
  "name": "get_shared_secret_oracle",
@@ -4593,7 +4541,7 @@
4593
4541
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/shared_secret.nr",
4594
4542
  "source": "use crate::protocol::address::aztec_address::AztecAddress;\nuse crate::protocol::point::Point;\n\n#[oracle(aztec_utl_getSharedSecret)]\nunconstrained fn get_shared_secret_oracle(\n address: AztecAddress,\n ephPk: Point,\n contract_address: AztecAddress,\n) -> Field {}\n\n/// Returns an app-siloed shared secret between `address` and someone who knows the secret key behind an ephemeral\n/// public key `ephPk`.\n///\n/// The returned value is a Field `s_app`, computed as:\n///\n/// ```text\n/// S = address_secret * ephPk (raw ECDH point)\n/// s_app = h(DOM_SEP, S.x, S.y, contract) (app-siloed scalar)\n/// ```\n///\n/// where `contract` is the address of the calling contract. The oracle host validates this matches its execution\n/// context.\n///\n/// Without app-siloing, a malicious contract could call this oracle with public information (address, ephPk) and\n/// obtain the same raw secret as the legitimate contract, enabling cross-contract decryption. By including the\n/// contract address in the hash, each contract receives a different `s_app`, preventing this attack.\n///\n/// Callers derive indexed subkeys from `s_app` via\n/// [`derive_shared_secret_subkey`](crate::keys::ecdh_shared_secret::derive_shared_secret_subkey).\npub unconstrained fn get_shared_secret(address: AztecAddress, ephPk: Point, contract_address: AztecAddress) -> Field {\n get_shared_secret_oracle(address, ephPk, contract_address)\n}\n"
4595
4543
  },
4596
- "197": {
4544
+ "195": {
4597
4545
  "function_locations": [
4598
4546
  {
4599
4547
  "name": "get_from_public_storage_oracle",
@@ -4611,7 +4559,7 @@
4611
4559
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/storage.nr",
4612
4560
  "source": "use crate::protocol::{abis::block_header::BlockHeader, address::AztecAddress, traits::{Hash, Packable, ToField}};\n\n#[oracle(aztec_utl_getFromPublicStorage)]\nunconstrained fn get_from_public_storage_oracle<let N: u32>(\n block_hash: Field,\n address: Field,\n storage_slot: Field,\n length: u32,\n) -> [Field; N] {}\n\n// TODO(F-498): review naming consistency\npub unconstrained fn raw_storage_read<let N: u32>(\n block_hash_to_read_from: Field,\n address: AztecAddress,\n storage_slot: Field,\n) -> [Field; N] {\n get_from_public_storage_oracle(block_hash_to_read_from, address.to_field(), storage_slot, N)\n}\n\n// TODO(F-498): review naming consistency\npub unconstrained fn storage_read<T>(header_to_read_from: BlockHeader, address: AztecAddress, storage_slot: Field) -> T\nwhere\n T: Packable,\n{\n let block_hash_to_read_from = header_to_read_from.hash();\n T::unpack(\n raw_storage_read(block_hash_to_read_from, address, storage_slot),\n )\n}\n"
4613
4561
  },
4614
- "198": {
4562
+ "196": {
4615
4563
  "function_locations": [
4616
4564
  {
4617
4565
  "name": "notify_revertible_phase_start",
@@ -4637,7 +4585,7 @@
4637
4585
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/tx_phase.nr",
4638
4586
  "source": "/// Notifies PXE of the side effect counter at which the revertible phase begins.\n///\n/// PXE uses it to classify notes and nullifiers as revertible or non-revertible in its note cache. This information is\n/// then fed to kernels as hints.\npub(crate) fn notify_revertible_phase_start(counter: u32) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call.\n unsafe { notify_revertible_phase_start_oracle_wrapper(counter) };\n}\n\n/// Returns whether a side effect counter falls in the revertible phase of the transaction.\npub(crate) unconstrained fn is_execution_in_revertible_phase(current_counter: u32) -> bool {\n is_execution_in_revertible_phase_oracle(current_counter)\n}\n\nunconstrained fn notify_revertible_phase_start_oracle_wrapper(counter: u32) {\n notify_revertible_phase_start_oracle(counter);\n}\n\n#[oracle(aztec_prv_notifyRevertiblePhaseStart)]\nunconstrained fn notify_revertible_phase_start_oracle(_counter: u32) {}\n\n#[oracle(aztec_prv_isExecutionInRevertiblePhase)]\nunconstrained fn is_execution_in_revertible_phase_oracle(current_counter: u32) -> bool {}\n"
4639
4587
  },
4640
- "199": {
4588
+ "197": {
4641
4589
  "function_locations": [
4642
4590
  {
4643
4591
  "name": "assert_compatible_oracle_version",
@@ -4663,7 +4611,7 @@
4663
4611
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/version.nr",
4664
4612
  "source": "/// The ORACLE_VERSION constant is used to check that the oracle interface is in sync between PXE and Aztec.nr. We need\n/// to version the oracle interface to ensure that developers get a reasonable error message if they use incompatible\n/// versions of Aztec.nr and PXE. The TypeScript counterpart is in `oracle_version.ts`.\n///\n/// @dev Whenever a contract function or Noir test is run, the `aztec_utl_assertCompatibleOracleVersion` oracle is\n/// called and if the oracle version is incompatible an error is thrown.\npub global ORACLE_VERSION: Field = 22;\n\n/// Asserts that the version of the oracle is compatible with the version expected by the contract.\npub fn assert_compatible_oracle_version() {\n // Safety: This oracle call returns nothing: we only call it to check Aztec.nr and Oracle interface versions are\n // compatible. It is therefore always safe to call.\n unsafe {\n assert_compatible_oracle_version_wrapper();\n }\n}\n\nunconstrained fn assert_compatible_oracle_version_wrapper() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION);\n}\n\n#[oracle(aztec_utl_assertCompatibleOracleVersion)]\nunconstrained fn assert_compatible_oracle_version_oracle(version: Field) {}\n\nmod test {\n use super::{assert_compatible_oracle_version_oracle, ORACLE_VERSION};\n\n #[test]\n unconstrained fn compatible_oracle_version() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION);\n }\n\n #[test(should_fail_with = \"Incompatible aztec cli version:\")]\n unconstrained fn incompatible_oracle_version() {\n let arbitrary_incorrect_version = 318183437;\n assert_compatible_oracle_version_oracle(arbitrary_incorrect_version);\n }\n}\n"
4665
4613
  },
4666
- "203": {
4614
+ "201": {
4667
4615
  "function_locations": [
4668
4616
  {
4669
4617
  "name": "<impl StateVariable<1, Context> for Map<K, V, Context>>::new",
@@ -4681,7 +4629,7 @@
4681
4629
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/map.nr",
4682
4630
  "source": "use crate::protocol::{storage::map::derive_storage_slot_in_map, traits::ToField};\nuse crate::state_vars::StateVariable;\n\n/// A key-value container for state variables.\n///\n/// A key-value storage container that maps keys to state variables, similar to Solidity mappings.\n///\n/// `Map` enables you to associate keys (like addresses or other identifiers) with state variables in your Aztec smart\n/// contract. This is conceptually similar to Solidity's `mapping(K => V)` syntax, where you can store and retrieve\n/// values by their associated keys.\n///\n/// You can declare a state variable contained within a Map in your contract's\n/// [`storage`](crate::macros::storage::storage) struct.\n///\n/// For example, you might use `Map<AztecAddress, PublicMutable<FieldNote, Context>, Context>` to track token balances\n/// for different users, similar to how you'd use `mapping(address => uint256)` in Solidity.\n///\n/// > Aside: the verbose `Context` in the declaration is a consequence of > leveraging Noir's regular syntax for\n/// generics to ensure that certain > state variable methods can only be called in some contexts (private, > public,\n/// utility).\n///\n/// The methods of Map are:\n/// - `at` (access state variable for a given key) (see the method's own doc comments for more info).\n///\n/// ## Generic Parameters\n/// - `K`: The key type (must implement `ToField` trait for hashing)\n/// - `V`: The value type:\n/// - any Aztec state variable (variable that implements the StateVariable trait):\n/// - `PublicMutable`\n/// - `PublicImmutable`\n/// - `DelayedPublicMutable`\n/// - `Map`\n/// - `Context`: The execution context (handles private/public function contexts)\n///\n/// ## Usage Maps are typically declared in your contract's [`storage`](crate::macros::storage::storage) struct and accessed using the `at(key)` method to get the state variable for a specific key. The resulting state variable can then be read from or written to using its own methods.\n///\n/// Note that maps cannot be used with owned state variables (variables that implement the OwnedStateVariable trait) -\n/// those need to be wrapped in an `Owned` state variable instead.\n///\n/// ## Advanced Internally, `Map` uses a single base storage slot to represent the mapping itself, similar to Solidity's approach. Individual key-value pairs are stored at derived storage slots computed by hashing the base storage slot with the key using Poseidon2. This ensures:\n/// - No storage slot collisions between different keys\n/// - Uniform distribution of storage slots across the storage space\n/// - Compatibility with Aztec's storage tree structure\n/// - Gas-efficient storage access patterns similar to Solidity mappings\n///\n/// The storage slot derivation uses `derive_storage_slot_in_map(base_slot, key)` which computes\n/// `poseidon2_hash([base_slot, key.to_field()])`, ensuring cryptographically secure slot separation.\n///\n/// docs:start:map\npub struct Map<K, V, Context> {\n pub context: Context,\n storage_slot: Field,\n}\n\n// Map reserves a single storage slot regardless of what it stores because nothing is stored at said slot: it is only\n// used to derive the storage slots of nested state variables, which is expected to never result in collisions or slots\n// being close to one another due to these being hashes. This mirrors the strategy adopted by Solidity mappings.\nimpl<K, V, Context> StateVariable<1, Context> for Map<K, V, Context> {\n fn new(context: Context, storage_slot: Field) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Map { context, storage_slot }\n }\n\n fn get_storage_slot(self) -> Field {\n self.storage_slot\n }\n}\n\nimpl<K, V, Context> Map<K, V, Context> {\n /// Returns the state variable associated with the given key.\n ///\n /// This is equivalent to accessing `mapping[`key`]` in Solidity. It returns the state variable instance for the\n /// specified key, which can then be used to read or write the value at that key.\n ///\n /// Unlike Solidity mappings which return the value directly, this returns the state variable wrapper (like\n /// PublicMutable, nested Map etc.) that you then call methods on to interact with the actual value.\n ///\n /// # Arguments\n ///\n /// * `key` - The key to look up in the map. Must implement the ToField trait (which most basic Noir & Aztec types\n /// do).\n ///\n /// # Returns\n ///\n /// * `V` - The state variable instance for this key. You can then call methods like `.read()`, `.write()`,\n /// `.get_note()`, etc. on this depending on the specific state variable type.\n ///\n /// # Example\n ///\n /// ```noir\n /// // Get a user's balance (assuming PrivateMutable<FieldNote>)\n /// let user_balance = self.storage.balances.at(user_address);\n /// let current_note = user_balance.get_note();\n ///\n /// // Update the balance\n /// user_balance.replace(new_note);\n /// ```\n ///\n pub fn at<let N: u32>(self, key: K) -> V\n where\n K: ToField,\n V: StateVariable<N, Context>,\n {\n V::new(\n self.context,\n derive_storage_slot_in_map(self.storage_slot, key),\n )\n }\n}\n"
4683
4631
  },
4684
- "216": {
4632
+ "214": {
4685
4633
  "function_locations": [
4686
4634
  {
4687
4635
  "name": "<impl StateVariable<M, Context> for PublicMutable<T, Context>>::new",
@@ -4707,7 +4655,7 @@
4707
4655
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/public_mutable.nr",
4708
4656
  "source": "use crate::context::{PublicContext, UtilityContext};\nuse crate::protocol::traits::Packable;\nuse crate::state_vars::StateVariable;\n\nmod test;\n\n/// Mutable public values.\n///\n/// This is one of the most basic public state variables. It is equivalent to a non-`immutable` non-`constant` Solidity\n/// state variable.\n///\n/// It represents a public value of type `T` that can be written to repeatedly over the lifetime of the contract,\n/// allowing the last value that was written to be read.\n///\n/// ## Access Patterns\n///\n/// A value stored in a `PublicMutable` can be read and written from public contract functions.\n///\n/// It is not possible to read or write a `PublicMutable` from private contract functions. A common pattern is to have\n/// these functions [enqueue a public self\n/// calls](crate::contract_self::ContractSelfPrivate::enqueue) in which the\n/// required operation is performed.\n///\n/// For an immutable variant which can be read from private functions, see\n/// [`PublicImmutable`](crate::state_vars::PublicImmutable).\n///\n/// For a mutable (with restrictions) variant which can be read from private functions see\n/// [`DelayedPublicMutable`](crate::state_vars::DelayedPublicMutable).\n///\n/// ## Privacy\n///\n/// `PublicMutable` provides zero privacy. All write and read operations are public: the entire network can see these\n/// accesses and the data involved.\n///\n/// ## Use Cases\n///\n/// This is suitable for any kind of global state that needs to be accessible by everyone. For example, a token may\n/// have a public total supply, or a voting contract may have public vote tallies.\n///\n/// Note that contracts having public values does not necessarily mean the actions that update these values must\n/// themselves be wholly public. For example, the token could allow for private minting and burning, and casting a vote\n/// could be kept private: these private functions would enqueue a public function that writes to the `PublicMutable`.\n///\n/// Similarly, private functions can enqueue a public call in which the `PublicMutable` is checked to meet some\n/// condition. For example, a private action might be executable only if the vote count has exceeded some threshold, in\n/// which case the private function would enqueue a public function that reads from the `PublicMutable`.\n///\n/// Such patterns preserve the privacy of the account that executed the action, as well as details related to the\n/// private execution itself, but they _do_ reveal that the transaction interacted with the `PublicMutable` value (and\n/// hence that the contract was called), as all accesses to it are public. The\n/// [`only_self`](crate::macros::functions::only_self) attribute is very useful when implementing this.\n///\n/// ## Examples\n///\n/// Declaring a `PublicMutable` in the contract's [`storage`](crate::macros::storage::storage) struct requires\n/// specifying the type `T` that is stored in the variable:\n///\n/// ```noir\n/// #[storage]\n/// struct Storage<C> {\n/// total_supply: PublicMutable<u128, C>,\n/// public_balances: Map<AztecAddress, PublicMutable<u128, C>, C>,\n///\n/// vote_tallies: Map<ElectionId, PublicMutable<u128, C>, C>,\n/// }\n/// ```\n///\n/// ## Requirements\n///\n/// The type `T` stored in the `PublicMutable` must implement the [`Packable`](crate::protocol::traits::Packable)\n/// trait.\n///\n/// ## Implementation Details\n///\n/// Values are packed and stored directly in the public storage tree, with no overhead. A `PublicMutable` therefore\n/// takes up as many storage slots as the packing length of the stored type `T`.\n///\n/// Private reads are not possible because private functions do not have access to the current network state, only the\n/// _past_ state at the anchor block. They _can_ perform historical reads of `PublicMutable` values at past times, but\n/// they have no way to guarantee that the value has not changed since then.\n/// [`PublicImmutable`](crate::state_vars::PublicImmutable) and\n/// [`DelayedPublicMutable`](crate::state_vars::DelayedPublicMutable) are examples of public state variables that _can_\n/// be read privately by restricting mutation.\npub struct PublicMutable<T, Context> {\n context: Context,\n storage_slot: Field,\n}\n\nimpl<T, Context, let M: u32> StateVariable<M, Context> for PublicMutable<T, Context>\nwhere\n T: Packable<N = M>,\n{\n fn new(context: Context, storage_slot: Field) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n PublicMutable { context, storage_slot }\n }\n\n fn get_storage_slot(self) -> Field {\n self.storage_slot\n }\n}\n\nimpl<T> PublicMutable<T, PublicContext> {\n /// Returns the current value.\n ///\n /// If [`write`](PublicMutable::write) has never been called, then this returns the default empty public storage\n /// value, which is all zeroes - equivalent to `let t = T::unpack(std::mem::zeroed());`.\n ///\n /// It is not possible to detect if a `PublicMutable` has ever been initialized or not other than by testing for\n /// the zero sentinel value. For a more robust solution, store an `Option<T>` in the `PublicMutable`.\n ///\n /// ## Examples\n ///\n /// A public getter that returns the current value:\n /// ```noir\n /// #[external(\"public\")]\n /// fn get_total_supply() -> u128 {\n /// self.storage.total_supply.read()\n /// }\n /// ```\n ///\n /// An [`only_self`](crate::macros::functions::only_self) helper that asserts a condition a private function\n /// requires:\n /// ```noir\n /// #[external(\"private\")]\n /// fn execute_proposal(election_id: ElectionId) {\n /// self.enqueue_self._assert_vote_passed(election_id);\n ///\n /// // execute the proposal - this remains private\n /// }\n ///\n /// #[external(\"public\")]\n /// #[only_self]\n /// fn _assert_vote_passed(election_id: ElectionId) {\n /// assert(self.storage.vote_tallies.at(election_id).read() >= VOTE_PASSED_THRESHOLD);\n /// }\n /// ```\n ///\n /// ## Cost\n ///\n /// The `SLOAD` AVM opcode is invoked a number of times equal to `T`'s packed length.\n pub fn read(self) -> T\n where\n T: Packable,\n {\n self.context.storage_read(self.storage_slot)\n }\n\n /// Stores a new value.\n ///\n /// The old value is overridden and cannot be recovered. The new value can be immediately retrieved by\n /// [`read`](PublicMutable::read).\n ///\n /// ## Examples\n ///\n /// A public setter that updates the current value:\n /// ```noir\n /// #[external(\"public\")]\n /// fn mint_tokens(recipient: AztecAddress, amount: u128) {\n /// let current_recipient_balance = self.storage.public_balances.at(recipient).read();\n /// self.storage.public_balances.at(recipient).write(current_recipient_balance + amount);\n ///\n /// let current_supply = self.storage.total_supply.read();\n /// self.storage.total_supply.write(current_supply + amount);\n /// }\n /// ```\n ///\n /// An [`only_self`](crate::macros::functions::only_self) helper that updates public state triggered by a private\n /// function:\n /// ```noir\n /// #[external(\"private\")]\n /// fn vote_for_proposal(election_id: ElectionId, votes: u128) {\n /// // validate the sender can cast this many votes - this remains private\n ///\n /// self.enqueue_self._tally_vote(election_id, votes);\n /// }\n ///\n /// #[external(\"public\")]\n /// #[only_self]\n /// fn _tally_vote(election_id: ElectionId, votes: u128) {\n /// let current = self.storage.vote_tallies.at(election_id).read();\n /// self.storage.vote_tallies.at(election_id).write(current + votes);\n /// }\n /// ```\n ///\n /// ## Cost\n ///\n /// The `SSTORE` AVM opcode is invoked a number of times equal to `T`'s packed length.\n pub fn write(self, value: T)\n where\n T: Packable,\n {\n self.context.storage_write(self.storage_slot, value);\n }\n}\n\nimpl<T> PublicMutable<T, UtilityContext> {\n /// Returns the value at the anchor block.\n ///\n /// If [`write`](PublicMutable::write) has never been called, then this returns the default empty public storage\n /// value, which is all zeroes - equivalent to `let t = T::unpack(std::mem::zeroed());`.\n ///\n /// It is not possible to detect if a `PublicMutable` has ever been initialized or not other than by testing for\n /// the zero sentinel value. For a more robust solution, store an `Option<T>` in the `PublicMutable`.\n ///\n /// ## Examples\n ///\n /// ```noir\n /// #[external(\"utility\")]\n /// fn get_total_supply() -> u128 {\n /// self.storage.total_supply.read()\n /// }\n /// ```\n pub unconstrained fn read(self) -> T\n where\n T: Packable,\n {\n self.context.storage_read(self.storage_slot)\n }\n}\n"
4709
4657
  },
4710
- "245": {
4658
+ "243": {
4711
4659
  "function_locations": [
4712
4660
  {
4713
4661
  "name": "append",
@@ -4729,7 +4677,7 @@
4729
4677
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/append.nr",
4730
4678
  "source": "/// Appends the elements of the second `BoundedVec` to the end of the first one. The resulting `BoundedVec` can have\n/// any arbitrary maximum length, but it must be large enough to fit all of the elements of both the first and second\n/// vectors.\npub fn append<T, let ALen: u32, let BLen: u32, let DstLen: u32>(\n a: BoundedVec<T, ALen>,\n b: BoundedVec<T, BLen>,\n) -> BoundedVec<T, DstLen> {\n let mut dst = BoundedVec::new();\n\n dst.extend_from_bounded_vec(a);\n dst.extend_from_bounded_vec(b);\n\n dst\n}\n\nmod test {\n use super::append;\n\n #[test]\n unconstrained fn append_empty_vecs() {\n let a: BoundedVec<_, 3> = BoundedVec::new();\n let b: BoundedVec<_, 14> = BoundedVec::new();\n\n let result: BoundedVec<Field, 5> = append(a, b);\n\n assert_eq(result.len(), 0);\n assert_eq(result.storage(), std::mem::zeroed());\n }\n\n #[test]\n unconstrained fn append_non_empty_vecs() {\n let a: BoundedVec<_, 3> = BoundedVec::from_array([1, 2, 3]);\n let b: BoundedVec<_, 14> = BoundedVec::from_array([4, 5, 6]);\n\n let result: BoundedVec<Field, 8> = append(a, b);\n\n assert_eq(result.len(), 6);\n assert_eq(result.storage(), [1, 2, 3, 4, 5, 6, std::mem::zeroed(), std::mem::zeroed()]);\n }\n\n #[test(should_fail_with = \"out of bounds\")]\n unconstrained fn append_non_empty_vecs_insufficient_max_len() {\n let a: BoundedVec<_, 3> = BoundedVec::from_array([1, 2, 3]);\n let b: BoundedVec<_, 14> = BoundedVec::from_array([4, 5, 6]);\n\n let _: BoundedVec<Field, 5> = append(a, b);\n }\n}\n"
4731
4679
  },
4732
- "248": {
4680
+ "246": {
4733
4681
  "function_locations": [
4734
4682
  {
4735
4683
  "name": "subarray",
@@ -4759,7 +4707,7 @@
4759
4707
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/subarray.nr",
4760
4708
  "source": "/// Returns `DstLen` elements from a source array, starting at `offset`. `DstLen` must not be larger than the number of\n/// elements past `offset`.\n///\n/// Examples:\n/// ```\n/// let foo: [Field; 2] = subarray([1, 2, 3, 4, 5], 2);\n/// assert_eq(foo, [3, 4]);\n///\n/// let bar: [Field; 5] = subarray([1, 2, 3, 4, 5], 2); // fails - we can't return 5 elements since only 3 remain\n/// ```\npub fn subarray<T, let SrcLen: u32, let DstLen: u32>(src: [T; SrcLen], offset: u32) -> [T; DstLen] {\n assert(offset + DstLen <= SrcLen, \"DstLen too large for offset\");\n\n let mut dst: [T; DstLen] = std::mem::zeroed();\n for i in 0..DstLen {\n dst[i] = src[i + offset];\n }\n\n dst\n}\n\nmod test {\n use super::subarray;\n\n #[test]\n unconstrained fn subarray_into_empty() {\n // In all of these cases we're setting DstLen to be 0, so we always get back an empty array.\n assert_eq(subarray::<Field, _, _>([], 0), []);\n assert_eq(subarray([1, 2, 3, 4, 5], 0), []);\n assert_eq(subarray([1, 2, 3, 4, 5], 2), []);\n }\n\n #[test]\n unconstrained fn subarray_complete() {\n assert_eq(subarray::<Field, _, _>([], 0), []);\n assert_eq(subarray([1, 2, 3, 4, 5], 0), [1, 2, 3, 4, 5]);\n }\n\n #[test]\n unconstrained fn subarray_different_end_sizes() {\n // We implicitly select how many values to read in the size of the return array\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2, 3, 4, 5]);\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2, 3, 4]);\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2, 3]);\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2]);\n }\n\n #[test(should_fail_with = \"DstLen too large for offset\")]\n unconstrained fn subarray_offset_too_large() {\n // With an offset of 1 we can only request up to 4 elements\n let _: [_; 5] = subarray([1, 2, 3, 4, 5], 1);\n }\n\n #[test(should_fail)]\n unconstrained fn subarray_bad_return_value() {\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [3, 3, 4, 5]);\n }\n}\n"
4761
4709
  },
4762
- "249": {
4710
+ "247": {
4763
4711
  "function_locations": [
4764
4712
  {
4765
4713
  "name": "subbvec",
@@ -4801,7 +4749,7 @@
4801
4749
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/subbvec.nr",
4802
4750
  "source": "use crate::utils::array;\n\n/// Returns `DstMaxLen` elements from a source BoundedVec, starting at `offset`. `offset` must not be larger than the\n/// original length, and `DstLen` must not be larger than the total number of elements past `offset` (including the\n/// zeroed elements past `len()`).\n///\n/// Only elements at the beginning of the vector can be removed: it is not possible to also remove elements at the end\n/// of the vector by passing a value for `DstLen` that is smaller than `len() - offset`.\n///\n/// Examples:\n/// ```\n/// let foo = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n/// assert_eq(subbvec(foo, 2), BoundedVec::<_, 8>::from_array([3, 4, 5]));\n///\n/// let bar: BoundedVec<_, 1> = subbvec(foo, 2); // fails - we can't return just 1 element since 3 remain\n/// let baz: BoundedVec<_, 10> = subbvec(foo, 3); // fails - we can't return 10 elements since only 7 remain\n/// ```\npub fn subbvec<T, let SrcMaxLen: u32, let DstMaxLen: u32>(\n bvec: BoundedVec<T, SrcMaxLen>,\n offset: u32,\n) -> BoundedVec<T, DstMaxLen> {\n // from_parts_unchecked does not verify that the elements past len are zeroed, but that is not an issue in our case\n // because we're constructing the new storage array as a subarray of the original one (which should have zeroed\n // storage past len), guaranteeing correctness. This is because `subarray` does not allow extending arrays past\n // their original length.\n BoundedVec::from_parts_unchecked(array::subarray(bvec.storage(), offset), bvec.len() - offset)\n}\n\nmod test {\n use super::subbvec;\n\n #[test]\n unconstrained fn subbvec_empty() {\n let bvec = BoundedVec::<Field, 0>::from_array([]);\n assert_eq(subbvec(bvec, 0), bvec);\n }\n\n #[test]\n unconstrained fn subbvec_complete() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n assert_eq(subbvec(bvec, 0), bvec);\n\n let smaller_capacity = BoundedVec::<_, 5>::from_array([1, 2, 3, 4, 5]);\n assert_eq(subbvec(bvec, 0), smaller_capacity);\n }\n\n #[test]\n unconstrained fn subbvec_partial() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n assert_eq(subbvec(bvec, 2), BoundedVec::<_, 8>::from_array([3, 4, 5]));\n assert_eq(subbvec(bvec, 2), BoundedVec::<_, 3>::from_array([3, 4, 5]));\n }\n\n #[test]\n unconstrained fn subbvec_into_empty() {\n let bvec: BoundedVec<_, 10> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(subbvec(bvec, 5), BoundedVec::<_, 5>::from_array([]));\n }\n\n #[test(should_fail)]\n unconstrained fn subbvec_offset_past_len() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n let _: BoundedVec<_, 1> = subbvec(bvec, 6);\n }\n\n #[test(should_fail)]\n unconstrained fn subbvec_insufficient_dst_len() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n // We're not providing enough space to hold all of the items inside the original BoundedVec. subbvec can cause\n // for the capacity to reduce, but not the length (other than by len - offset).\n let _: BoundedVec<_, 1> = subbvec(bvec, 2);\n }\n\n #[test(should_fail_with = \"DstLen too large for offset\")]\n unconstrained fn subbvec_dst_len_causes_enlarge() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n // subbvec does not support capacity increases\n let _: BoundedVec<_, 11> = subbvec(bvec, 0);\n }\n\n #[test(should_fail_with = \"DstLen too large for offset\")]\n unconstrained fn subbvec_dst_len_too_large_for_offset() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n // This effectively requests a capacity increase, since there'd be just one element plus the 5 empty slots,\n // which is less than 7.\n let _: BoundedVec<_, 7> = subbvec(bvec, 4);\n }\n}\n"
4803
4751
  },
4804
- "252": {
4752
+ "250": {
4805
4753
  "function_locations": [
4806
4754
  {
4807
4755
  "name": "bytes_to_fields",
@@ -4823,7 +4771,7 @@
4823
4771
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/conversion/bytes_to_fields.nr",
4824
4772
  "source": "use std::static_assert;\n\n// These functions are used to facilitate the conversion of log ciphertext between byte and field representations.\n//\n// `bytes_to_fields` uses fixed-size arrays since encryption contexts have compile-time size information.\n// `bytes_from_fields` uses BoundedVec for flexibility in unconstrained contexts where sizes are dynamic.\n//\n// Together they provide bidirectional conversion between bytes and fields when processing encrypted logs.\n\n/// Converts the input bytes into an array of fields. A Field is ~254 bits meaning that each field can store 31 whole\n/// bytes. Use `bytes_from_fields` to obtain the original bytes array.\n///\n/// The input bytes are chunked into chunks of 31 bytes. Each 31-byte chunk is viewed as big-endian, and is converted\n/// into a Field. For example, [1, 10, 3, ..., 0] (31 bytes) is encoded as [1 * 256^30 + 10 * 256^29 + 3 * 256^28 + ...\n/// + 0] Note: N must be a multiple of 31 bytes\npub fn bytes_to_fields<let N: u32>(bytes: [u8; N]) -> [Field; N / 31] {\n // Assert that N is a multiple of 31\n static_assert(N % 31 == 0, \"N must be a multiple of 31\");\n\n let mut fields = [0; N / 31];\n\n // Since N is a multiple of 31, we can simply process all chunks fully\n for i in 0..N / 31 {\n let mut field = 0;\n for j in 0..31 {\n // Shift the existing value left by 8 bits and add the new byte\n field = field * 256 + bytes[i * 31 + j] as Field;\n }\n fields[i] = field;\n }\n\n fields\n}\n\n/// Converts an input BoundedVec of fields into a BoundedVec of bytes in big-endian order. Arbitrary Field arrays are\n/// not allowed: this is assumed to be an array obtained via `bytes_to_fields`, i.e. one that actually represents\n/// bytes. To convert a Field array into bytes, use `fields_to_bytes`.\n///\n/// Each input field must contain at most 31 bytes (this is constrained to be so). Each field is converted into 31\n/// big-endian bytes, and the resulting 31-byte chunks are concatenated back together in the order of the original\n/// fields.\npub fn bytes_from_fields<let N: u32>(fields: BoundedVec<Field, N>) -> BoundedVec<u8, N * 31> {\n let mut bytes = BoundedVec::new();\n\n for i in 0..fields.len() {\n let field = fields.get(i);\n\n // We expect that the field contains at most 31 bytes of information.\n field.assert_max_bit_size::<248>();\n\n // Now we can safely convert the field to 31 bytes.\n let field_as_bytes: [u8; 31] = field.to_be_bytes();\n\n for j in 0..31 {\n bytes.push(field_as_bytes[j]);\n }\n }\n\n bytes\n}\n\nmod tests {\n use crate::utils::array::subarray;\n use super::{bytes_from_fields, bytes_to_fields};\n\n #[test]\n unconstrained fn random_bytes_to_fields_and_back(input: [u8; 93]) {\n let fields = bytes_to_fields(input);\n\n // At this point in production, the log flies through the system and we get a BoundedVec on the other end. So\n // we need to convert the field array to a BoundedVec to be able to feed it to the `bytes_from_fields`\n // function.\n let fields_as_bounded_vec = BoundedVec::<_, 6>::from_array(fields);\n\n let bytes_back = bytes_from_fields(fields_as_bounded_vec);\n\n // Compare the original input with the round-tripped result\n assert_eq(bytes_back.len(), input.len());\n assert_eq(subarray(bytes_back.storage(), 0), input);\n }\n\n #[test(should_fail_with = \"N must be a multiple of 31\")]\n unconstrained fn bytes_to_fields_input_length_not_multiple_of_31() {\n // Try to convert 32 bytes (not a multiple of 31) to fields\n let _fields = bytes_to_fields([0; 32]);\n }\n\n}\n"
4825
4773
  },
4826
- "253": {
4774
+ "251": {
4827
4775
  "function_locations": [
4828
4776
  {
4829
4777
  "name": "fields_to_bytes",
@@ -4873,7 +4821,7 @@
4873
4821
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/conversion/fields_to_bytes.nr",
4874
4822
  "source": "// These functions are used to facilitate the conversion of log plaintext represented as fields into bytes and back.\n//\n// `fields_to_bytes` uses fixed-size arrays since encryption contexts have compile-time size information.\n// `fields_from_bytes` uses BoundedVec for flexibility in unconstrained contexts where sizes are dynamic.\n//\n// Together they provide bidirectional conversion between fields and bytes.\n\n/// Converts an input array of fields into a single array of bytes. Use `fields_from_bytes` to obtain the original\n/// field array. Each field is converted to a 32-byte big-endian array.\n///\n/// For example, if you have a field array [123, 456], it will be converted to a 64-byte array:\n/// [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123, // First field (32 bytes)\n/// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,200] // Second field (32 bytes)\n///\n/// Since a field is ~254 bits, you'll end up with a subtle 2-bit \"gap\" at the big end, every 32 bytes. Be careful that\n/// such a gap doesn't leak information! This could happen if you for example expected the output to be\n/// indistinguishable from random bytes.\npub fn fields_to_bytes<let N: u32>(fields: [Field; N]) -> [u8; 32 * N] {\n let mut bytes = [0; 32 * N];\n\n for i in 0..N {\n let field_as_bytes: [u8; 32] = fields[i].to_be_bytes();\n\n for j in 0..32 {\n bytes[i * 32 + j] = field_as_bytes[j];\n }\n }\n\n bytes\n}\n\n/// Converts an input BoundedVec of bytes into a BoundedVec of fields. Arbitrary byte arrays are not allowed: this is\n/// assumed to be an array obtained via `fields_to_bytes`, i.e. one that actually represents fields. To convert a byte\n/// array into Fields, use `bytes_to_fields`.\n///\n/// The input bytes are chunked into chunks of 32 bytes. Each 32-byte chunk is viewed as big-endian, and is converted\n/// into a Field. For example, [1, 10, 3, ..., 0] (32 bytes) is encoded as [1 * 256^31 + 10 * 256^30 + 3 * 256^29 + ...\n/// + 0] Note 1: N must be a multiple of 32 bytes Note 2: The max value check code was taken from\n/// std::field::to_be_bytes function.\npub fn fields_from_bytes<let N: u32>(bytes: BoundedVec<u8, N>) -> BoundedVec<Field, N / 32> {\n // Assert that input length is a multiple of 32\n assert(bytes.len() % 32 == 0, \"Input length must be a multiple of 32\");\n\n try_fields_from_bytes(bytes).expect(f\"Value does not fit in field\")\n}\n\n/// Converts a single 32-byte big-endian chunk (starting at `offset`) into a Field, returning\n/// `Option::none()` if the chunk's value is >= the field modulus.\nfn try_field_from_be_bytes<let N: u32>(bytes: BoundedVec<u8, N>, offset: u32) -> Option<Field> {\n let p = std::field::modulus_be_bytes();\n let mut field = 0;\n // Field arithmetic silently wraps values >= the modulus, so we compare each 32-byte chunk against\n // the modulus byte-by-byte (big-endian, most significant first). The first byte that differs\n // determines the result: if our byte is smaller we're valid, if larger we've overflowed.\n // cmp tracks the result: 0 = equal so far, 1 = less than modulus, 2 = exceeds modulus.\n let mut cmp: u8 = 0;\n for j in 0..32 {\n let byte = bytes.get(offset + j);\n field = field * 256 + byte as Field;\n\n if cmp == 0 {\n if byte < p[j] {\n cmp = 1;\n } else if byte > p[j] {\n cmp = 2;\n }\n }\n }\n if cmp == 1 {\n Option::some(field)\n } else {\n Option::none()\n }\n}\n\n/// Non-panicking version of `fields_from_bytes`. Returns `Option::none()` if the input\n/// length is not a multiple of 32 or if any 32-byte chunk exceeds the field modulus.\npub(crate) fn try_fields_from_bytes<let N: u32>(bytes: BoundedVec<u8, N>) -> Option<BoundedVec<Field, N / 32>> {\n if bytes.len() % 32 == 0 {\n let mut fields = BoundedVec::new();\n let num_chunks = bytes.len() / 32;\n for i in 0..num_chunks {\n let field = try_field_from_be_bytes(bytes, i * 32);\n if field.is_some() {\n fields.push(field.unwrap());\n }\n }\n if fields.len() as u32 == num_chunks {\n Option::some(fields)\n } else {\n Option::none()\n }\n } else {\n Option::none()\n }\n}\n\nmod tests {\n use crate::utils::array::subarray;\n use super::{fields_from_bytes, fields_to_bytes, try_fields_from_bytes};\n\n #[test]\n unconstrained fn random_fields_to_bytes_and_back(input: [Field; 3]) {\n // Convert to bytes\n let bytes = fields_to_bytes(input);\n\n // At this point in production, the log flies through the system and we get a BoundedVec on the other end. So\n // we need to convert the field array to a BoundedVec to be able to feed it to the `fields_from_bytes`\n // function. 113 is an arbitrary max length that is larger than the input length of 96.\n let bytes_as_bounded_vec = BoundedVec::<_, 113>::from_array(bytes);\n\n // Convert back to fields\n let fields_back = fields_from_bytes(bytes_as_bounded_vec);\n\n // Compare the original input with the round-tripped result\n assert_eq(fields_back.len(), input.len());\n assert_eq(subarray(fields_back.storage(), 0), input);\n }\n\n #[test(should_fail_with = \"Input length must be a multiple of 32\")]\n unconstrained fn to_fields_assert() {\n // 143 is an arbitrary max length that is larger than 33\n let input = BoundedVec::<_, 143>::from_array([\n 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,\n 30, 31, 32, 33,\n ]);\n\n // This should fail since 33 is not a multiple of 32\n let _fields = fields_from_bytes(input);\n }\n\n #[test]\n unconstrained fn fields_from_bytes_max_value() {\n let max_field_as_bytes: [u8; 32] = (-1).to_be_bytes();\n let input = BoundedVec::<_, 32>::from_array(max_field_as_bytes);\n\n let fields = fields_from_bytes(input);\n\n // The result should be a largest value storable in a field (-1 since we are modulo-ing)\n assert_eq(fields.get(0), -1);\n }\n\n // In this test we verify that overflow check works by taking the max allowed value, bumping a random byte and then\n // feeding it to `fields_from_bytes` as input.\n #[test(should_fail_with = \"Value does not fit in field\")]\n unconstrained fn fields_from_bytes_overflow(random_value: u8) {\n let index_of_byte_to_bump = random_value % 32;\n\n // Obtain the byte representation of the maximum field value\n let max_field_value_as_bytes: [u8; 32] = (-1).to_be_bytes();\n\n let byte_to_bump = max_field_value_as_bytes[index_of_byte_to_bump as u32];\n\n // Skip test execution if the selected byte is already at maximum value (255). This is acceptable since we are\n // using fuzz testing to generate many test cases.\n if byte_to_bump != 255 {\n let mut input = BoundedVec::<_, 32>::from_array(max_field_value_as_bytes);\n\n // Increment the selected byte to exceed the field's maximum value\n input.set(index_of_byte_to_bump as u32, byte_to_bump + 1);\n\n // Attempt the conversion, which should fail due to the value exceeding the field's capacity\n let _fields = fields_from_bytes(input);\n }\n }\n\n #[test]\n unconstrained fn try_fields_from_bytes_returns_none_on_unaligned_length() {\n let input = BoundedVec::<_, 64>::from_parts([0 as u8; 64], 33);\n assert(try_fields_from_bytes(input).is_none());\n }\n\n #[test]\n unconstrained fn try_fields_from_bytes_returns_none_on_field_modulus() {\n // The field modulus itself is not a valid field value (it wraps to 0).\n let p: [u8; 32] = std::field::modulus_be_bytes().as_array();\n let input = BoundedVec::<u8, 32>::from_array(p);\n assert(try_fields_from_bytes(input).is_none());\n }\n\n #[test]\n unconstrained fn try_fields_from_bytes_round_trips(input: [Field; 3]) {\n let bytes = BoundedVec::<_, 113>::from_array(fields_to_bytes(input));\n let fields = try_fields_from_bytes(bytes).unwrap();\n\n assert_eq(fields.len(), input.len());\n assert_eq(subarray(fields.storage(), 0), input);\n }\n}\n"
4875
4823
  },
4876
- "256": {
4824
+ "254": {
4877
4825
  "function_locations": [
4878
4826
  {
4879
4827
  "name": "get_sign_of_point",
@@ -4923,7 +4871,7 @@
4923
4871
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/point.nr",
4924
4872
  "source": "use crate::protocol::{point::Point, utils::field::sqrt};\n\n// I am storing the modulus minus 1 divided by 2 here because full modulus would throw \"String literal too large\" error\n// Full modulus is 21888242871839275222246405745257275088548364400416034343698204186575808495617\nglobal BN254_FR_MODULUS_DIV_2: Field = 10944121435919637611123202872628637544274182200208017171849102093287904247808;\n\n/// Returns: true if p.y <= MOD_DIV_2, else false.\npub fn get_sign_of_point(p: Point) -> bool {\n // We store only a \"sign\" of the y coordinate because the rest can be derived from the x coordinate. To get the\n // sign we check if the y coordinate is less or equal than the field's modulus minus 1 divided by 2. Ideally we'd\n // do `y <= MOD_DIV_2`, but there's no `lte` function, so instead we do `!(y > MOD_DIV_2)`, which is equivalent,\n // and then rewrite that as `!(MOD_DIV_2 < y)`, since we also have no `gt` function.\n !BN254_FR_MODULUS_DIV_2.lt(p.y)\n}\n\n/// Returns a `Point` in the Grumpkin curve given its x coordinate.\n///\n/// Because not all values in the field are valid x coordinates of points in the curve (i.e. there is no corresponding\n/// y value in the field that satisfies the curve equation), it may not be possible to reconstruct a `Point`.\n/// `Option::none()` is returned in such cases.\npub fn point_from_x_coord(x: Field) -> Option<Point> {\n // y ^ 2 = x ^ 3 - 17\n let rhs = x * x * x - 17;\n sqrt(rhs).map(|y| Point { x, y, is_infinite: false })\n}\n\n/// Returns a `Point` in the Grumpkin curve given its x coordinate and sign for the y coordinate.\n///\n/// Because not all values in the field are valid x coordinates of points in the curve (i.e. there is no corresponding\n/// y value in the field that satisfies the curve equation), it may not be possible to reconstruct a `Point`.\n/// `Option::none()` is returned in such cases.\n///\n/// @param x - The x coordinate of the point @param sign - The \"sign\" of the y coordinate - determines whether y <=\n/// (Fr.MODULUS - 1) / 2\npub fn point_from_x_coord_and_sign(x: Field, sign: bool) -> Option<Point> {\n // y ^ 2 = x ^ 3 - 17\n let rhs = x * x * x - 17;\n\n sqrt(rhs).map(|y| {\n // If there is a square root, we need to ensure it has the correct \"sign\"\n let y_is_positive = !BN254_FR_MODULUS_DIV_2.lt(y);\n let final_y = if y_is_positive == sign { y } else { -y };\n Point { x, y: final_y, is_infinite: false }\n })\n}\n\nmod test {\n use crate::protocol::point::Point;\n use crate::utils::point::{\n BN254_FR_MODULUS_DIV_2, get_sign_of_point, point_from_x_coord, point_from_x_coord_and_sign,\n };\n\n #[test]\n unconstrained fn test_point_from_x_coord_and_sign() {\n // Test positive y coordinate\n let x = 0x1af41f5de96446dc3776a1eb2d98bb956b7acd9979a67854bec6fa7c2973bd73;\n let sign = true;\n let p = point_from_x_coord_and_sign(x, sign).unwrap();\n\n assert_eq(p.x, x);\n assert_eq(p.y, 0x07fc22c7f2c7057571f137fe46ea9c95114282bc95d37d71ec4bfb88de457d4a);\n assert_eq(p.is_infinite, false);\n\n // Test negative y coordinate\n let x2 = 0x247371652e55dd74c9af8dbe9fb44931ba29a9229994384bd7077796c14ee2b5;\n let sign2 = false;\n let p2 = point_from_x_coord_and_sign(x2, sign2).unwrap();\n\n assert_eq(p2.x, x2);\n assert_eq(p2.y, 0x26441aec112e1ae4cee374f42556932001507ad46e255ffb27369c7e3766e5c0);\n assert_eq(p2.is_infinite, false);\n }\n\n #[test]\n unconstrained fn test_point_from_x_coord_valid() {\n // x = 8 is a known quadratic residue - should give a valid point\n let result = point_from_x_coord(Field::from(8));\n assert(result.is_some());\n\n let point = result.unwrap();\n assert_eq(point.x, Field::from(8));\n // Check curve equation y^2 = x^3 - 17\n assert_eq(point.y * point.y, point.x * point.x * point.x - 17);\n }\n\n #[test]\n unconstrained fn test_point_from_x_coord_invalid() {\n // x = 3 is a non-residue for this curve - should give None\n let x = Field::from(3);\n let maybe_point = point_from_x_coord(x);\n assert(maybe_point.is_none());\n }\n\n #[test]\n unconstrained fn test_both_roots_satisfy_curve() {\n // Derive a point from x = 8 (known to be valid from test_point_from_x_coord_valid)\n let x: Field = 8;\n let point = point_from_x_coord(x).unwrap();\n\n // Check y satisfies curve equation\n assert_eq(point.y * point.y, x * x * x - 17);\n\n // Check -y also satisfies curve equation\n let neg_y = 0 - point.y;\n assert_eq(neg_y * neg_y, x * x * x - 17);\n\n // Verify they are different (unless y = 0)\n assert(point.y != neg_y);\n }\n\n #[test]\n unconstrained fn test_point_from_x_coord_and_sign_invalid() {\n // x = 3 has no valid point on the curve (from test_point_from_x_coord_invalid)\n let x = Field::from(3);\n let result_positive = point_from_x_coord_and_sign(x, true);\n let result_negative = point_from_x_coord_and_sign(x, false);\n\n assert(result_positive.is_none());\n assert(result_negative.is_none());\n }\n\n #[test]\n unconstrained fn test_get_sign_of_point() {\n // Derive a point from x = 8, then test both possible y values\n let point = point_from_x_coord(8).unwrap();\n let neg_point = Point { x: point.x, y: 0 - point.y, is_infinite: false };\n\n // One should be \"positive\" (y <= MOD_DIV_2) and one \"negative\"\n let sign1 = get_sign_of_point(point);\n let sign2 = get_sign_of_point(neg_point);\n assert(sign1 != sign2);\n\n // y = 0 should return true (0 <= MOD_DIV_2)\n let zero_y_point = Point { x: 0, y: 0, is_infinite: false };\n assert(get_sign_of_point(zero_y_point) == true);\n\n // y = MOD_DIV_2 should return true (exactly at boundary)\n let boundary_point = Point { x: 0, y: BN254_FR_MODULUS_DIV_2, is_infinite: false };\n assert(get_sign_of_point(boundary_point) == true);\n\n // y = MOD_DIV_2 + 1 should return false (just over boundary)\n let over_boundary_point = Point { x: 0, y: BN254_FR_MODULUS_DIV_2 + 1, is_infinite: false };\n assert(get_sign_of_point(over_boundary_point) == false);\n }\n\n #[test]\n unconstrained fn test_point_from_x_coord_zero() {\n // x = 0: y^2 = 0^3 - 17 = -17, which is not a quadratic residue in BN254 scalar field\n let result = point_from_x_coord(0);\n assert(result.is_none());\n }\n\n #[test]\n unconstrained fn test_bn254_fr_modulus_div_2() {\n // Verify that BN254_FR_MODULUS_DIV_2 == (p - 1) / 2 This means: 2 * BN254_FR_MODULUS_DIV_2 + 1 == p == 0 (in\n // the field)\n assert_eq(2 * BN254_FR_MODULUS_DIV_2 + 1, 0);\n }\n\n}\n"
4925
4873
  },
4926
- "266": {
4874
+ "264": {
4927
4875
  "function_locations": [
4928
4876
  {
4929
4877
  "name": "Poseidon2::hash",
@@ -4965,7 +4913,7 @@
4965
4913
  "path": "/home/aztec-dev/nargo/github.com/noir-lang/poseidon/v0.2.6/src/poseidon2.nr",
4966
4914
  "source": "use std::default::Default;\nuse std::hash::Hasher;\n\nglobal RATE: u32 = 3;\n\npub struct Poseidon2 {\n cache: [Field; 3],\n state: [Field; 4],\n cache_size: u32,\n squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2 {\n #[no_predicates]\n pub fn hash<let N: u32>(input: [Field; N], message_size: u32) -> Field {\n Poseidon2::hash_internal(input, message_size)\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2 {\n let mut result =\n Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n self.state[0] += self.cache[0];\n self.state[1] += self.cache[1];\n self.state[2] += self.cache[2];\n self.state = crate::poseidon2_permutation(self.state, 4);\n }\n\n fn absorb(&mut self, input: Field) {\n assert(!self.squeeze_mode);\n if self.cache_size == RATE {\n // If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache\n self.perform_duplex();\n self.cache[0] = input;\n self.cache_size = 1;\n } else {\n // If we're absorbing, and the cache is not full, add the input into the cache\n self.cache[self.cache_size] = input;\n self.cache_size += 1;\n }\n }\n\n fn squeeze(&mut self) -> Field {\n assert(!self.squeeze_mode);\n // If we're in absorb mode, apply sponge permutation to compress the cache.\n self.perform_duplex();\n self.squeeze_mode = true;\n\n // Pop one item off the top of the permutation and return it.\n self.state[0]\n }\n\n fn hash_internal<let N: u32>(input: [Field; N], in_len: u32) -> Field {\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut state = [0; 4];\n state[RATE] = iv;\n\n if std::runtime::is_unconstrained() {\n for i in 0..(in_len / RATE) {\n state[0] += input[i * RATE];\n state[1] += input[i * RATE + 1];\n state[2] += input[i * RATE + 2];\n state = crate::poseidon2_permutation(state, 4);\n }\n\n // handle remaining elements after last full RATE-sized chunk\n let num_extra_fields = in_len % RATE;\n if num_extra_fields != 0 {\n let remainder_start = in_len - num_extra_fields;\n state[0] += input[remainder_start];\n if num_extra_fields > 1 {\n state[1] += input[remainder_start + 1];\n }\n }\n } else {\n let mut states: [[Field; 4]; N / RATE + 1] = [[0; 4]; N / RATE + 1];\n states[0] = state;\n\n // process all full RATE-sized chunks, storing state after each permutation\n for chunk_idx in 0..(N / RATE) {\n for i in 0..RATE {\n state[i] += input[chunk_idx * RATE + i];\n }\n state = crate::poseidon2_permutation(state, 4);\n states[chunk_idx + 1] = state;\n }\n\n // get state at the last full block before in_len\n let first_partially_filled_chunk = in_len / RATE;\n state = states[first_partially_filled_chunk];\n\n // handle remaining elements after last full RATE-sized chunk\n let remainder_start = (in_len / RATE) * RATE;\n for j in 0..RATE {\n let idx = remainder_start + j;\n if idx < in_len {\n state[j] += input[idx];\n }\n }\n }\n\n // always run final permutation unless we just completed a full chunk\n // still need to permute once if in_len is 0\n if (in_len == 0) | (in_len % RATE != 0) {\n state = crate::poseidon2_permutation(state, 4);\n };\n\n state[0]\n }\n}\n\npub struct Poseidon2Hasher {\n _state: [Field],\n}\n\nimpl Hasher for Poseidon2Hasher {\n fn finish(self) -> Field {\n let iv: Field = (self._state.len() as Field) * 18446744073709551616; // iv = (self._state.len() << 64)\n let mut sponge = Poseidon2::new(iv);\n for i in 0..self._state.len() {\n sponge.absorb(self._state[i]);\n }\n sponge.squeeze()\n }\n\n fn write(&mut self, input: Field) {\n self._state = self._state.push_back(input);\n }\n}\n\nimpl Default for Poseidon2Hasher {\n fn default() -> Self {\n Poseidon2Hasher { _state: &[] }\n }\n}\n"
4967
4915
  },
4968
- "277": {
4916
+ "275": {
4969
4917
  "function_locations": [
4970
4918
  {
4971
4919
  "name": "BlockHeader::chain_id",
@@ -5059,97 +5007,97 @@
5059
5007
  },
5060
5008
  {
5061
5009
  "name": "[T; N]::sort",
5062
- "start": 6777
5010
+ "start": 6778
5063
5011
  },
5064
5012
  {
5065
5013
  "name": "[T; N]::sort_via",
5066
- "start": 7792
5014
+ "start": 7794
5067
5015
  },
5068
5016
  {
5069
5017
  "name": "[u8; N]::as_str_unchecked",
5070
- "start": 8820
5018
+ "start": 8823
5071
5019
  },
5072
5020
  {
5073
5021
  "name": "<impl From<str<N>> for [u8; N]>::from",
5074
- "start": 8947
5022
+ "start": 8950
5075
5023
  },
5076
5024
  {
5077
5025
  "name": "test::map_empty",
5078
- "start": 9021
5026
+ "start": 9024
5079
5027
  },
5080
5028
  {
5081
5029
  "name": "test::sort_u32",
5082
- "start": 10131
5030
+ "start": 10134
5083
5031
  },
5084
5032
  {
5085
5033
  "name": "test::test_sort",
5086
- "start": 10186
5034
+ "start": 10189
5087
5035
  },
5088
5036
  {
5089
5037
  "name": "test::test_sort_100_values",
5090
- "start": 10417
5038
+ "start": 10420
5091
5039
  },
5092
5040
  {
5093
5041
  "name": "test::test_sort_100_values_comptime",
5094
- "start": 11585
5042
+ "start": 11588
5095
5043
  },
5096
5044
  {
5097
5045
  "name": "test::test_sort_via",
5098
- "start": 11730
5046
+ "start": 11733
5099
5047
  },
5100
5048
  {
5101
5049
  "name": "test::test_sort_via_100_values",
5102
- "start": 11977
5050
+ "start": 11980
5103
5051
  },
5104
5052
  {
5105
5053
  "name": "test::mapi_empty",
5106
- "start": 13138
5054
+ "start": 13141
5107
5055
  },
5108
5056
  {
5109
5057
  "name": "test::for_each_empty",
5110
- "start": 13233
5058
+ "start": 13236
5111
5059
  },
5112
5060
  {
5113
5061
  "name": "test::for_eachi_empty",
5114
- "start": 13371
5062
+ "start": 13374
5115
5063
  },
5116
5064
  {
5117
5065
  "name": "test::map_example",
5118
- "start": 13510
5066
+ "start": 13513
5119
5067
  },
5120
5068
  {
5121
5069
  "name": "test::mapi_example",
5122
- "start": 13647
5070
+ "start": 13650
5123
5071
  },
5124
5072
  {
5125
5073
  "name": "test::for_each_example",
5126
- "start": 13796
5074
+ "start": 13799
5127
5075
  },
5128
5076
  {
5129
5077
  "name": "test::for_eachi_example",
5130
- "start": 14136
5078
+ "start": 14139
5131
5079
  },
5132
5080
  {
5133
5081
  "name": "test::concat",
5134
- "start": 14347
5082
+ "start": 14350
5135
5083
  },
5136
5084
  {
5137
5085
  "name": "test::concat_zero_length_with_something",
5138
- "start": 14606
5086
+ "start": 14609
5139
5087
  },
5140
5088
  {
5141
5089
  "name": "test::concat_something_with_zero_length",
5142
- "start": 14809
5090
+ "start": 14812
5143
5091
  },
5144
5092
  {
5145
5093
  "name": "test::concat_zero_lengths",
5146
- "start": 14998
5094
+ "start": 15001
5147
5095
  }
5148
5096
  ],
5149
5097
  "path": "std/array/mod.nr",
5150
- "source": "use crate::cmp::{Eq, Ord};\nuse crate::convert::From;\nuse crate::runtime::is_unconstrained;\n\nmod check_shuffle;\nmod quicksort;\n\nimpl<T, let N: u32> [T; N] {\n /// Returns the length of this array.\n ///\n /// ```noir\n /// fn len(self) -> Field\n /// ```\n ///\n /// example\n ///\n /// ```noir\n /// fn main() {\n /// let array = [42, 42];\n /// assert(array.len() == 2);\n /// }\n /// ```\n #[builtin(array_len)]\n pub fn len(self) -> u32 {}\n\n /// Returns this array as a vector.\n ///\n /// ```noir\n /// let array = [1, 2];\n /// let vector = array.as_vector();\n /// assert_eq(vector, [1, 2].as_vector());\n /// ```\n #[builtin(as_vector)]\n pub fn as_vector(self) -> [T] {}\n\n /// Returns this array as a vector.\n /// This method is deprecated in favor of `as_vector`.\n ///\n /// ```noir\n /// let array = [1, 2];\n /// let vector = array.as_slice();\n /// assert_eq(vector, [1, 2].as_vector());\n /// ```\n #[builtin(as_vector)]\n #[deprecated(\"This method has been renamed to `as_vector`\")]\n pub fn as_slice(self) -> [T] {}\n\n /// Applies a function to each element of this array, returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.map(|a| a * 2);\n /// assert_eq(b, [2, 4, 6]);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array along with its index,\n /// returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.mapi(|i, a| i + a * 2);\n /// assert_eq(b, [2, 5, 8]);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(i, self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// let mut i = 0;\n /// a.for_each(|x| {\n /// b[i] = x;\n /// i += 1;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n for i in 0..self.len() {\n f(self[i]);\n }\n }\n\n /// Applies a function to each element of this array along with its index.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// a.for_eachi(|i, x| {\n /// b[i] = x;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n for i in 0..self.len() {\n f(i, self[i]);\n }\n }\n\n /// Applies a function to each element of the array, returning the final accumulated value. The first\n /// parameter is the initial value.\n ///\n /// This is a left fold, so the given function will be applied to the accumulator and first element of\n /// the array, then the second, and so on. For a given call the expected result would be equivalent to:\n ///\n /// ```rust\n /// let a1 = [1];\n /// let a2 = [1, 2];\n /// let a3 = [1, 2, 3];\n ///\n /// let f = |a, b| a - b;\n /// a1.fold(10, f); //=> f(10, 1)\n /// a2.fold(10, f); //=> f(f(10, 1), 2)\n /// a3.fold(10, f); //=> f(f(f(10, 1), 2), 3)\n ///\n /// assert_eq(a3.fold(10, f), 10 - 1 - 2 - 3);\n /// ```\n pub fn fold<U, Env>(&self, mut accumulator: U, f: fn[Env](U, T) -> U) -> U {\n for elem in self {\n accumulator = f(accumulator, elem);\n }\n accumulator\n }\n\n /// Same as fold, but uses the first element as the starting element.\n ///\n /// Requires the input array to be non-empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [1, 2, 3, 4];\n /// let reduced = arr.reduce(|a, b| a + b);\n /// assert(reduced == 10);\n /// }\n /// ```\n pub fn reduce<Env>(&self, f: fn[Env](T, T) -> T) -> T {\n let mut accumulator = self[0];\n for i in 1..self.len() {\n accumulator = f(accumulator, self[i]);\n }\n accumulator\n }\n\n /// Returns true if all the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 2];\n /// let all = arr.all(|a| a == 2);\n /// assert(all);\n /// }\n /// ```\n pub fn all<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = true;\n for elem in self {\n ret &= predicate(elem);\n }\n ret\n }\n\n /// Returns true if any of the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 5];\n /// let any = arr.any(|a| a == 5);\n /// assert(any);\n /// }\n /// ```\n pub fn any<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n for elem in self {\n ret |= predicate(elem);\n }\n ret\n }\n\n /// Concatenates this array with another array.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr1 = [1, 2, 3, 4];\n /// let arr2 = [6, 7, 8, 9, 10, 11];\n /// let concatenated_arr = arr1.concat(arr2);\n /// assert(concatenated_arr == [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n /// }\n /// ```\n pub fn concat<let M: u32>(&self, array2: [T; M]) -> [T; N + M] {\n let mut result = [crate::mem::zeroed(); N + M];\n for i in 0..N {\n result[i] = self[i];\n }\n for i in 0..M {\n result[i + N] = array2[i];\n }\n result\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Ord + Eq,\n{\n /// Returns a new sorted array. The original array remains untouched. Notice that this function will\n /// only work for arrays of fields or integers, not for any arbitrary type. This is because the sorting\n /// logic it uses internally is optimized specifically for these values. If you need a sort function to\n /// sort any type, you should use the [`Self::sort_via`] function.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32];\n /// let sorted = arr.sort();\n /// assert(sorted == [32, 42]);\n /// }\n /// ```\n pub fn sort(self) -> Self {\n self.sort_via(|a, b| a <= b)\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Eq,\n{\n /// Returns a new sorted array by sorting it with a custom comparison function.\n /// The original array remains untouched.\n /// The ordering function must return true if the first argument should be sorted to be before the second argument or is equal to the second argument.\n ///\n /// Using this method with an operator like `<` that does not return `true` for equal values will result in an assertion failure for arrays with equal elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32]\n /// let sorted_ascending = arr.sort_via(|a, b| a <= b);\n /// assert(sorted_ascending == [32, 42]); // verifies\n ///\n /// let sorted_descending = arr.sort_via(|a, b| a >= b);\n /// assert(sorted_descending == [32, 42]); // does not verify\n /// }\n /// ```\n pub fn sort_via<Env>(self, ordering: fn[Env](T, T) -> bool) -> Self {\n // Safety: `sorted` array is checked to be:\n // a. a permutation of `input`'s elements\n // b. satisfying the predicate `ordering`\n let sorted = unsafe { quicksort::quicksort(self, ordering) };\n\n if !is_unconstrained() {\n for i in 0..N - 1 {\n assert(\n ordering(sorted[i], sorted[i + 1]),\n \"Array has not been sorted correctly according to `ordering`.\",\n );\n }\n check_shuffle::check_shuffle(self, sorted);\n }\n sorted\n }\n}\n\nimpl<let N: u32> [u8; N] {\n /// Converts a byte array of type `[u8; N]` to a string. Note that this performs no UTF-8 validation -\n /// the given array is interpreted as-is as a string.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let hi = [104, 105].as_str_unchecked();\n /// assert_eq(hi, \"hi\");\n /// }\n /// ```\n #[builtin(array_as_str_unchecked)]\n pub fn as_str_unchecked(self) -> str<N> {}\n}\n\nimpl<let N: u32> From<str<N>> for [u8; N] {\n /// Returns an array of the string bytes.\n fn from(s: str<N>) -> Self {\n s.as_bytes()\n }\n}\n\nmod test {\n #[test]\n fn map_empty() {\n assert_eq([].map(|x| x + 1), []);\n }\n\n global arr_with_100_values: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2, 54,\n 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41, 19, 98,\n 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21, 43, 86, 35,\n 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15, 127, 81, 30, 8,\n 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n global expected_with_100_values: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30, 32,\n 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58, 61, 62,\n 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82, 84, 84, 86,\n 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114, 114, 116, 118,\n 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n fn sort_u32(a: u32, b: u32) -> bool {\n a <= b\n }\n\n #[test]\n fn test_sort() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort();\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort();\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_100_values_comptime() {\n let sorted = arr_with_100_values.sort();\n assert(sorted == expected_with_100_values);\n }\n\n #[test]\n fn test_sort_via() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_via_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn mapi_empty() {\n assert_eq([].mapi(|i, x| i * x + 1), []);\n }\n\n #[test]\n fn for_each_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_each(|_x| assert(false));\n }\n\n #[test]\n fn for_eachi_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_eachi(|_i, _x| assert(false));\n }\n\n #[test]\n fn map_example() {\n let a = [1, 2, 3];\n let b = a.map(|a| a * 2);\n assert_eq(b, [2, 4, 6]);\n }\n\n #[test]\n fn mapi_example() {\n let a = [1, 2, 3];\n let b = a.mapi(|i, a| i + a * 2);\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn for_each_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n let mut i = 0;\n let i_ref = &mut i;\n a.for_each(|x| {\n b_ref[*i_ref] = x * 2;\n *i_ref += 1;\n });\n assert_eq(b, [2, 4, 6]);\n assert_eq(i, 3);\n }\n\n #[test]\n fn for_eachi_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n a.for_eachi(|i, a| { b_ref[i] = i + a * 2; });\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn concat() {\n let arr1 = [1, 2, 3, 4];\n let arr2 = [6, 7, 8, 9, 10, 11];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n }\n\n #[test]\n fn concat_zero_length_with_something() {\n let arr1 = [];\n let arr2 = [1];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_something_with_zero_length() {\n let arr1 = [1];\n let arr2 = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_zero_lengths() {\n let arr1: [Field; 0] = [];\n let arr2: [Field; 0] = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, []);\n }\n}\n"
5098
+ "source": "use crate::cmp::{Eq, Ord};\nuse crate::convert::From;\nuse crate::runtime::is_unconstrained;\n\nmod check_shuffle;\nmod quicksort;\n\nimpl<T, let N: u32> [T; N] {\n /// Returns the length of this array.\n ///\n /// ```noir\n /// fn len(self) -> Field\n /// ```\n ///\n /// example\n ///\n /// ```noir\n /// fn main() {\n /// let array = [42, 42];\n /// assert(array.len() == 2);\n /// }\n /// ```\n #[builtin(array_len)]\n pub fn len(self) -> u32 {}\n\n /// Returns this array as a vector.\n ///\n /// ```noir\n /// let array = [1, 2];\n /// let vector = array.as_vector();\n /// assert_eq(vector, [1, 2].as_vector());\n /// ```\n #[builtin(as_vector)]\n pub fn as_vector(self) -> [T] {}\n\n /// Returns this array as a vector.\n /// This method is deprecated in favor of `as_vector`.\n ///\n /// ```noir\n /// let array = [1, 2];\n /// let vector = array.as_slice();\n /// assert_eq(vector, [1, 2].as_vector());\n /// ```\n #[builtin(as_vector)]\n #[deprecated(\"This method has been renamed to `as_vector`\")]\n pub fn as_slice(self) -> [T] {}\n\n /// Applies a function to each element of this array, returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.map(|a| a * 2);\n /// assert_eq(b, [2, 4, 6]);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array along with its index,\n /// returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.mapi(|i, a| i + a * 2);\n /// assert_eq(b, [2, 5, 8]);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(i, self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// let mut i = 0;\n /// a.for_each(|x| {\n /// b[i] = x;\n /// i += 1;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n for i in 0..self.len() {\n f(self[i]);\n }\n }\n\n /// Applies a function to each element of this array along with its index.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// a.for_eachi(|i, x| {\n /// b[i] = x;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n for i in 0..self.len() {\n f(i, self[i]);\n }\n }\n\n /// Applies a function to each element of the array, returning the final accumulated value. The first\n /// parameter is the initial value.\n ///\n /// This is a left fold, so the given function will be applied to the accumulator and first element of\n /// the array, then the second, and so on. For a given call the expected result would be equivalent to:\n ///\n /// ```rust\n /// let a1 = [1];\n /// let a2 = [1, 2];\n /// let a3 = [1, 2, 3];\n ///\n /// let f = |a, b| a - b;\n /// a1.fold(10, f); //=> f(10, 1)\n /// a2.fold(10, f); //=> f(f(10, 1), 2)\n /// a3.fold(10, f); //=> f(f(f(10, 1), 2), 3)\n ///\n /// assert_eq(a3.fold(10, f), 10 - 1 - 2 - 3);\n /// ```\n pub fn fold<U, Env>(&self, mut accumulator: U, f: fn[Env](U, T) -> U) -> U {\n for elem in self {\n accumulator = f(accumulator, elem);\n }\n accumulator\n }\n\n /// Same as fold, but uses the first element as the starting element.\n ///\n /// Requires the input array to be non-empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [1, 2, 3, 4];\n /// let reduced = arr.reduce(|a, b| a + b);\n /// assert(reduced == 10);\n /// }\n /// ```\n pub fn reduce<Env>(&self, f: fn[Env](T, T) -> T) -> T {\n let mut accumulator = self[0];\n for i in 1..self.len() {\n accumulator = f(accumulator, self[i]);\n }\n accumulator\n }\n\n /// Returns true if all the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 2];\n /// let all = arr.all(|a| a == 2);\n /// assert(all);\n /// }\n /// ```\n pub fn all<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = true;\n for elem in self {\n ret &= predicate(elem);\n }\n ret\n }\n\n /// Returns true if any of the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 5];\n /// let any = arr.any(|a| a == 5);\n /// assert(any);\n /// }\n /// ```\n pub fn any<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n for elem in self {\n ret |= predicate(elem);\n }\n ret\n }\n\n /// Concatenates this array with another array.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr1 = [1, 2, 3, 4];\n /// let arr2 = [6, 7, 8, 9, 10, 11];\n /// let concatenated_arr = arr1.concat(arr2);\n /// assert(concatenated_arr == [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n /// }\n /// ```\n pub fn concat<let M: u32>(&self, array2: [T; M]) -> [T; N + M] {\n let mut result = [crate::mem::zeroed(); N + M];\n for i in 0..N {\n result[i] = self[i];\n }\n for i in 0..M {\n result[i + N] = array2[i];\n }\n result\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Ord + Eq,\n{\n /// Returns a new sorted array. The original array remains untouched. Notice that this function will\n /// only work for arrays of fields or integers, not for any arbitrary type. This is because the sorting\n /// logic it uses internally is optimized specifically for these values. If you need a sort function to\n /// sort any type, you should use the [`Self::sort_via`] function.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32];\n /// let sorted = arr.sort();\n /// assert(sorted == [32, 42]);\n /// }\n /// ```\n pub fn sort(&self) -> Self {\n self.sort_via(|a, b| a <= b)\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Eq,\n{\n /// Returns a new sorted array by sorting it with a custom comparison function.\n /// The original array remains untouched.\n /// The ordering function must return true if the first argument should be sorted to be before the second argument or is equal to the second argument.\n ///\n /// Using this method with an operator like `<` that does not return `true` for equal values will result in an assertion failure for arrays with equal elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32]\n /// let sorted_ascending = arr.sort_via(|a, b| a <= b);\n /// assert(sorted_ascending == [32, 42]); // verifies\n ///\n /// let sorted_descending = arr.sort_via(|a, b| a >= b);\n /// assert(sorted_descending == [32, 42]); // does not verify\n /// }\n /// ```\n pub fn sort_via<Env>(&self, ordering: fn[Env](T, T) -> bool) -> Self {\n // Safety: `sorted` array is checked to be:\n // a. a permutation of `input`'s elements\n // b. satisfying the predicate `ordering`\n let sorted = unsafe { quicksort::quicksort(self, ordering) };\n\n if !is_unconstrained() {\n for i in 0..N - 1 {\n assert(\n ordering(sorted[i], sorted[i + 1]),\n \"Array has not been sorted correctly according to `ordering`.\",\n );\n }\n check_shuffle::check_shuffle(self, &sorted);\n }\n sorted\n }\n}\n\nimpl<let N: u32> [u8; N] {\n /// Converts a byte array of type `[u8; N]` to a string. Note that this performs no UTF-8 validation -\n /// the given array is interpreted as-is as a string.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let hi = [104, 105].as_str_unchecked();\n /// assert_eq(hi, \"hi\");\n /// }\n /// ```\n #[builtin(array_as_str_unchecked)]\n pub fn as_str_unchecked(self) -> str<N> {}\n}\n\nimpl<let N: u32> From<str<N>> for [u8; N] {\n /// Returns an array of the string bytes.\n fn from(s: str<N>) -> Self {\n s.as_bytes()\n }\n}\n\nmod test {\n #[test]\n fn map_empty() {\n assert_eq([].map(|x| x + 1), []);\n }\n\n global arr_with_100_values: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2, 54,\n 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41, 19, 98,\n 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21, 43, 86, 35,\n 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15, 127, 81, 30, 8,\n 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n global expected_with_100_values: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30, 32,\n 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58, 61, 62,\n 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82, 84, 84, 86,\n 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114, 114, 116, 118,\n 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n fn sort_u32(a: u32, b: u32) -> bool {\n a <= b\n }\n\n #[test]\n fn test_sort() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort();\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort();\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_100_values_comptime() {\n let sorted = arr_with_100_values.sort();\n assert(sorted == expected_with_100_values);\n }\n\n #[test]\n fn test_sort_via() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_via_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn mapi_empty() {\n assert_eq([].mapi(|i, x| i * x + 1), []);\n }\n\n #[test]\n fn for_each_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_each(|_x| assert(false));\n }\n\n #[test]\n fn for_eachi_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_eachi(|_i, _x| assert(false));\n }\n\n #[test]\n fn map_example() {\n let a = [1, 2, 3];\n let b = a.map(|a| a * 2);\n assert_eq(b, [2, 4, 6]);\n }\n\n #[test]\n fn mapi_example() {\n let a = [1, 2, 3];\n let b = a.mapi(|i, a| i + a * 2);\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn for_each_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n let mut i = 0;\n let i_ref = &mut i;\n a.for_each(|x| {\n b_ref[*i_ref] = x * 2;\n *i_ref += 1;\n });\n assert_eq(b, [2, 4, 6]);\n assert_eq(i, 3);\n }\n\n #[test]\n fn for_eachi_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n a.for_eachi(|i, a| { b_ref[i] = i + a * 2; });\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn concat() {\n let arr1 = [1, 2, 3, 4];\n let arr2 = [6, 7, 8, 9, 10, 11];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n }\n\n #[test]\n fn concat_zero_length_with_something() {\n let arr1 = [];\n let arr2 = [1];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_something_with_zero_length() {\n let arr1 = [1];\n let arr2 = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_zero_lengths() {\n let arr1: [Field; 0] = [];\n let arr2: [Field; 0] = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, []);\n }\n}\n"
5151
5099
  },
5152
- "355": {
5100
+ "353": {
5153
5101
  "function_locations": [
5154
5102
  {
5155
5103
  "name": "sha256_to_field",
@@ -5271,7 +5219,7 @@
5271
5219
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr",
5272
5220
  "source": "mod poseidon2_chunks;\n\nuse crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n function_selector::FunctionSelector, nullifier::Nullifier, private_log::PrivateLog,\n transaction::tx_request::TxRequest,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, DOM_SEP__NOTE_HASH_NONCE,\n DOM_SEP__PRIVATE_LOG_FIRST_FIELD, DOM_SEP__SILOED_NOTE_HASH, DOM_SEP__SILOED_NULLIFIER,\n DOM_SEP__UNIQUE_NOTE_HASH, FUNCTION_TREE_HEIGHT, NULL_MSG_SENDER_CONTRACT_ADDRESS,\n TWO_POW_64,\n },\n merkle_tree::root_from_sibling_path,\n messaging::l2_to_l1_message::L2ToL1Message,\n poseidon2::Poseidon2Sponge,\n side_effect::{Counted, Scoped},\n traits::{FromField, Hash, ToField},\n utils::field::{field_from_bytes, field_from_bytes_32_trunc},\n};\n\npub use poseidon2_chunks::poseidon2_absorb_in_chunks_existing_sponge;\nuse poseidon2_chunks::poseidon2_absorb_in_chunks;\nuse std::embedded_curve_ops::EmbeddedCurveScalar;\n\n// TODO: refactor these into their own files: sha256, poseidon2, some protocol-specific hash computations, some merkle computations.\n\npub fn sha256_to_field<let N: u32>(bytes_to_hash: [u8; N]) -> Field {\n let sha256_hashed = sha256::digest(bytes_to_hash);\n let hash_in_a_field = field_from_bytes_32_trunc(sha256_hashed);\n\n hash_in_a_field\n}\n\npub fn private_functions_root_from_siblings(\n selector: FunctionSelector,\n vk_hash: Field,\n function_leaf_index: Field,\n function_leaf_sibling_path: [Field; FUNCTION_TREE_HEIGHT],\n) -> Field {\n let function_leaf_preimage = ContractClassFunctionLeafPreimage { selector, vk_hash };\n let function_leaf = function_leaf_preimage.hash();\n root_from_sibling_path(\n function_leaf,\n function_leaf_index,\n function_leaf_sibling_path,\n )\n}\n\n/// Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way\n/// the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.\npub fn compute_siloed_note_hash(contract_address: AztecAddress, note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), note_hash],\n DOM_SEP__SILOED_NOTE_HASH,\n )\n}\n\n/// Computes unique, siloed note hashes from siloed note hashes.\n///\n/// The protocol injects uniqueness into every note_hash, so that every single note_hash in the\n/// tree is unique. This prevents faerie gold attacks, where a malicious sender could create\n/// two identical note_hashes for a recipient (meaning only one would be nullifiable in future).\n///\n/// Most privacy protocols will inject the note's leaf_index (its position in the Note Hashes Tree)\n/// into the note, but this requires the creator of a note to wait until their tx is included in\n/// a block to know the note's final note hash (the unique, siloed note hash), because inserting\n/// leaves into trees is the job of a block producer.\n///\n/// We took a different approach so that the creator of a note will know each note's unique, siloed\n/// note hash before broadcasting their tx to the network.\n/// (There was also a historical requirement relating to \"chained transactions\" -- a feature that\n/// Aztec Connect had to enable notes to be spent from distinct txs earlier in the same block,\n/// and hence before an archive block root had been established for that block -- but that feature\n/// was abandoned for the Aztec Network for having too many bad tradeoffs).\n///\n/// (\n/// Edit: it is no longer true that all final note_hashes will be known by the creator of a tx\n/// before they send it to the network. If a tx makes public function calls, then _revertible_\n/// note_hashes that are created in private will not be made unique in private by the Reset circuit,\n/// but will instead be made unique by the AVM, because the `note_index_in_tx` will not be known\n/// until the AVM has executed the public functions of the tx. (See an explanation in\n/// reset_output_composer.nr for why).\n/// For some such txs, the `note_index_in_tx` might still be predictable through simulation, but\n/// for txs whose public functions create a varying number of non-revertible notes (determined at\n/// runtime), the `note_index_in_tx` will not be deterministically derivable before submitting the\n/// tx to the network.\n/// )\n///\n/// We use the `first_nullifier` of a tx as a seed of uniqueness. We have a guarantee that there will\n/// always be at least one nullifier per tx, because the init circuit will create one if one isn't\n/// created naturally by any functions of the tx. (Search \"protocol_nullifier\").\n/// We combine the `first_nullifier` with the note's index (its position within this tx's new\n/// note_hashes array) (`note_index_in_tx`) to get a truly unique value to inject into a note, which\n/// we call a `note_nonce`.\npub fn compute_unique_note_hash(note_nonce: Field, siloed_note_hash: Field) -> Field {\n let inputs = [note_nonce, siloed_note_hash];\n poseidon2_hash_with_separator(inputs, DOM_SEP__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_note_hash_nonce(first_nullifier_in_tx: Field, note_index_in_tx: u32) -> Field {\n // Hashing the first nullifier with note index in tx is guaranteed to be unique (because all nullifiers are also\n // unique).\n poseidon2_hash_with_separator(\n [first_nullifier_in_tx, note_index_in_tx as Field],\n DOM_SEP__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_note_nonce_and_unique_note_hash(\n siloed_note_hash: Field,\n first_nullifier: Field,\n note_index_in_tx: u32,\n) -> Field {\n let note_nonce = compute_note_hash_nonce(first_nullifier, note_index_in_tx);\n compute_unique_note_hash(note_nonce, siloed_note_hash)\n}\n\npub fn compute_siloed_nullifier(contract_address: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), nullifier],\n DOM_SEP__SILOED_NULLIFIER,\n )\n}\n\npub fn create_protocol_nullifier(tx_request: TxRequest) -> Scoped<Counted<Nullifier>> {\n // The protocol nullifier is ascribed a special side-effect counter of 1. No other side-effect\n // can have counter 1 (see `validate_as_first_call` for that assertion).\n Nullifier { value: tx_request.hash(), note_hash: 0 }.count(1).scope(\n NULL_MSG_SENDER_CONTRACT_ADDRESS,\n )\n}\n\npub fn compute_log_tag(raw_tag: Field, dom_sep: u32) -> Field {\n poseidon2_hash_with_separator([raw_tag], dom_sep)\n}\n\npub fn compute_siloed_private_log_first_field(\n contract_address: AztecAddress,\n field: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), field],\n DOM_SEP__PRIVATE_LOG_FIRST_FIELD,\n )\n}\n\npub fn compute_siloed_private_log(contract_address: AztecAddress, log: PrivateLog) -> PrivateLog {\n let mut fields = log.fields;\n fields[0] = compute_siloed_private_log_first_field(contract_address, fields[0]);\n PrivateLog::new(fields, log.length)\n}\n\npub fn compute_contract_class_log_hash(log: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS]) -> Field {\n poseidon2_hash(log)\n}\n\npub fn compute_app_siloed_secret_key(\n master_secret_key: EmbeddedCurveScalar,\n app_address: AztecAddress,\n key_type_domain_separator: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [master_secret_key.hi, master_secret_key.lo, app_address.to_field()],\n key_type_domain_separator,\n )\n}\n\npub fn compute_l2_to_l1_message_hash(\n message: Scoped<L2ToL1Message>,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let contract_address_bytes: [u8; 32] = message.contract_address.to_field().to_be_bytes();\n let recipient_bytes: [u8; 20] = message.inner.recipient.to_be_bytes();\n let content_bytes: [u8; 32] = message.inner.content.to_be_bytes();\n let rollup_version_id_bytes: [u8; 32] = rollup_version_id.to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n\n let mut bytes: [u8; 148] = std::mem::zeroed();\n for i in 0..32 {\n bytes[i] = contract_address_bytes[i];\n bytes[i + 32] = rollup_version_id_bytes[i];\n // 64 - 84 are for recipient.\n bytes[i + 84] = chain_id_bytes[i];\n bytes[i + 116] = content_bytes[i];\n }\n\n for i in 0..20 {\n bytes[64 + i] = recipient_bytes[i];\n }\n\n sha256_to_field(bytes)\n}\n\n// TODO: consider a variant that enables domain separation with a u32 (we seem to have standardised u32s for domain separators)\n/// Computes sha256 hash of 2 input fields.\n///\n/// @returns A truncated field (i.e., the first byte is always 0).\npub fn accumulate_sha256(v0: Field, v1: Field) -> Field {\n // Concatenate two fields into 32 x 2 = 64 bytes\n let v0_as_bytes: [u8; 32] = v0.to_be_bytes();\n let v1_as_bytes: [u8; 32] = v1.to_be_bytes();\n let hash_input_flattened = v0_as_bytes.concat(v1_as_bytes);\n\n sha256_to_field(hash_input_flattened)\n}\n\npub fn poseidon2_hash<let N: u32>(inputs: [Field; N]) -> Field {\n poseidon::poseidon2::Poseidon2::hash(inputs, N)\n}\n\n#[no_predicates]\npub fn poseidon2_hash_with_separator<let N: u32, T>(inputs: [Field; N], separator: T) -> Field\nwhere\n T: ToField,\n{\n let inputs_with_separator = [separator.to_field()].concat(inputs);\n poseidon2_hash(inputs_with_separator)\n}\n\n/// Computes a Poseidon2 hash over a dynamic-length subarray of the given input.\n/// Only the first `in_len` fields of `input` are absorbed; any remaining fields are ignored.\n/// The caller is responsible for ensuring that the input is padded with zeros if required.\n#[no_predicates]\npub fn poseidon2_hash_subarray<let N: u32>(input: [Field; N], in_len: u32) -> Field {\n let mut sponge = poseidon2_absorb_in_chunks(input, in_len);\n sponge.squeeze()\n}\n\n// This function is unconstrained because it is intended to be used in unconstrained context only as\n// in constrained contexts it would be too inefficient.\npub unconstrained fn poseidon2_hash_with_separator_bounded_vec<let N: u32, T>(\n inputs: BoundedVec<Field, N>,\n separator: T,\n) -> Field\nwhere\n T: ToField,\n{\n let in_len = inputs.len() + 1;\n let iv: Field = (in_len as Field) * TWO_POW_64;\n let mut sponge = Poseidon2Sponge::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs.get(i));\n }\n\n sponge.squeeze()\n}\n\n#[no_predicates]\npub fn poseidon2_hash_bytes<let N: u32>(inputs: [u8; N]) -> Field {\n let mut fields = [0; (N + 30) / 31];\n let mut field_index = 0;\n let mut current_field = [0; 31];\n for i in 0..inputs.len() {\n let index = i % 31;\n current_field[index] = inputs[i];\n if index == 30 {\n fields[field_index] = field_from_bytes(current_field, false);\n current_field = [0; 31];\n field_index += 1;\n }\n }\n if field_index != fields.len() {\n fields[field_index] = field_from_bytes(current_field, false);\n }\n poseidon2_hash(fields)\n}\n\n#[test]\nfn subarray_hash_matches_fixed() {\n let values_to_hash = [3; 17];\n let padded = values_to_hash.concat([0; 11]);\n let subarray_hash = poseidon2_hash_subarray(padded, values_to_hash.len());\n\n // Hash the entire values_to_hash.\n let fixed_len_hash = poseidon::poseidon2::Poseidon2::hash(values_to_hash, values_to_hash.len());\n\n assert_eq(subarray_hash, fixed_len_hash);\n}\n\n#[test]\nfn subarray_hash_matches_variable() {\n let values_to_hash = [3; 17];\n let padded = values_to_hash.concat([0; 11]);\n let subarray_hash = poseidon2_hash_subarray(padded, values_to_hash.len());\n\n // Hash up to values_to_hash.len() fields of the padded array.\n let variable_len_hash = poseidon::poseidon2::Poseidon2::hash(padded, values_to_hash.len());\n\n assert_eq(subarray_hash, variable_len_hash);\n}\n\n#[test]\nfn smoke_sha256_to_field() {\n let full_buffer = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,\n 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,\n 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,\n 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,\n 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,\n 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\n ];\n let result = sha256_to_field(full_buffer);\n\n assert(result == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184c7);\n\n // to show correctness of the current ver (truncate one byte) vs old ver (mod full bytes):\n let result_bytes = sha256::digest(full_buffer);\n let truncated_field = crate::utils::field::field_from_bytes_32_trunc(result_bytes);\n assert(truncated_field == result);\n let mod_res = result + (result_bytes[31] as Field);\n assert(mod_res == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184e0);\n}\n\n#[test]\nfn unique_siloed_note_hash_matches_typescript() {\n let inner_note_hash = 1;\n let contract_address = AztecAddress::from_field(2);\n let first_nullifier = 3;\n let note_index_in_tx = 4;\n\n let siloed_note_hash = compute_siloed_note_hash(contract_address, inner_note_hash);\n let siloed_note_hash_from_ts =\n 0x1986a4bea3eddb1fff917d629a13e10f63f514f401bdd61838c6b475db949169;\n assert_eq(siloed_note_hash, siloed_note_hash_from_ts);\n\n let nonce: Field = compute_note_hash_nonce(first_nullifier, note_index_in_tx);\n let note_hash_nonce_from_ts =\n 0x28e7799791bf066a57bb51fdd0fbcaf3f0926414314c7db515ea343f44f5d58b;\n assert_eq(nonce, note_hash_nonce_from_ts);\n\n let unique_siloed_note_hash_from_nonce = compute_unique_note_hash(nonce, siloed_note_hash);\n let unique_siloed_note_hash = compute_note_nonce_and_unique_note_hash(\n siloed_note_hash,\n first_nullifier,\n note_index_in_tx,\n );\n assert_eq(unique_siloed_note_hash_from_nonce, unique_siloed_note_hash);\n\n let unique_siloed_note_hash_from_ts =\n 0x29949aef207b715303b24639737c17fbfeb375c1d965ecfa85c7e4f0febb7d16;\n assert_eq(unique_siloed_note_hash, unique_siloed_note_hash_from_ts);\n}\n\n#[test]\nfn siloed_nullifier_matches_typescript() {\n let contract_address = AztecAddress::from_field(123);\n let nullifier = 456;\n\n let res = compute_siloed_nullifier(contract_address, nullifier);\n\n let siloed_nullifier_from_ts =\n 0x169b50336c1f29afdb8a03d955a81e485f5ac7d5f0b8065673d1e407e5877813;\n\n assert_eq(res, siloed_nullifier_from_ts);\n}\n\n#[test]\nfn siloed_private_log_first_field_matches_typescript() {\n let contract_address = AztecAddress::from_field(123);\n let field = 456;\n let res = compute_siloed_private_log_first_field(contract_address, field);\n\n let siloed_private_log_first_field_from_ts =\n 0x29480984f7b9257fded523d50addbcfc8d1d33adcf2db73ef3390a8fd5cdffaa;\n\n assert_eq(res, siloed_private_log_first_field_from_ts);\n}\n\n#[test]\nfn empty_l2_to_l1_message_hash_matches_typescript() {\n // All zeroes\n let res = compute_l2_to_l1_message_hash(\n L2ToL1Message { recipient: EthAddress::zero(), content: 0 }.scope(AztecAddress::from_field(\n 0,\n )),\n 0,\n 0,\n );\n\n let empty_l2_to_l1_msg_hash_from_ts =\n 0x003b18c58c739716e76429634a61375c45b3b5cd470c22ab6d3e14cee23dd992;\n\n assert_eq(res, empty_l2_to_l1_msg_hash_from_ts);\n}\n\n#[test]\nfn l2_to_l1_message_hash_matches_typescript() {\n let message = L2ToL1Message { recipient: EthAddress::from_field(1), content: 2 }.scope(\n AztecAddress::from_field(3),\n );\n let version = 4;\n let chainId = 5;\n\n let hash = compute_l2_to_l1_message_hash(message, version, chainId);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let l2_to_l1_message_hash_from_ts =\n 0x0081edf209e087ad31b3fd24263698723d57190bd1d6e9fe056fc0c0a68ee661;\n\n assert_eq(hash, l2_to_l1_message_hash_from_ts);\n}\n\n#[test]\nunconstrained fn poseidon2_hash_with_separator_bounded_vec_matches_non_bounded_vec_version() {\n let inputs = BoundedVec::<Field, 4>::from_array([1, 2, 3]);\n let separator = 42;\n\n // Hash using bounded vec version\n let bounded_result = poseidon2_hash_with_separator_bounded_vec(inputs, separator);\n\n // Hash using regular version\n let regular_result = poseidon2_hash_with_separator([1, 2, 3], separator);\n\n // Results should match\n assert_eq(bounded_result, regular_result);\n}\n"
5273
5221
  },
5274
- "357": {
5222
+ "355": {
5275
5223
  "function_locations": [
5276
5224
  {
5277
5225
  "name": "fatal_log",
@@ -5345,7 +5293,7 @@
5345
5293
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/logging.nr",
5346
5294
  "source": "// Log levels matching the JS logger:\n\n// global SILENT_LOG_LEVEL: u8 = 0;\nglobal FATAL_LOG_LEVEL: u8 = 1;\nglobal ERROR_LOG_LEVEL: u8 = 2;\nglobal WARN_LOG_LEVEL: u8 = 3;\nglobal INFO_LOG_LEVEL: u8 = 4;\nglobal VERBOSE_LOG_LEVEL: u8 = 5;\nglobal DEBUG_LOG_LEVEL: u8 = 6;\nglobal TRACE_LOG_LEVEL: u8 = 7;\n\n// --- Per-level log functions (no format args) ---\n\npub fn fatal_log<let N: u32>(msg: str<N>) {\n fatal_log_format(msg, []);\n}\n\npub fn error_log<let N: u32>(msg: str<N>) {\n error_log_format(msg, []);\n}\n\npub fn warn_log<let N: u32>(msg: str<N>) {\n warn_log_format(msg, []);\n}\n\npub fn info_log<let N: u32>(msg: str<N>) {\n info_log_format(msg, []);\n}\n\npub fn verbose_log<let N: u32>(msg: str<N>) {\n verbose_log_format(msg, []);\n}\n\npub fn debug_log<let N: u32>(msg: str<N>) {\n debug_log_format(msg, []);\n}\n\npub fn trace_log<let N: u32>(msg: str<N>) {\n trace_log_format(msg, []);\n}\n\n// --- Per-level log functions (with format args) ---\n\npub fn fatal_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(FATAL_LOG_LEVEL, msg, args);\n}\n\npub fn error_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(ERROR_LOG_LEVEL, msg, args);\n}\n\npub fn warn_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(WARN_LOG_LEVEL, msg, args);\n}\n\npub fn info_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(INFO_LOG_LEVEL, msg, args);\n}\n\npub fn verbose_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(VERBOSE_LOG_LEVEL, msg, args);\n}\n\npub fn debug_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(DEBUG_LOG_LEVEL, msg, args);\n}\n\npub fn trace_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(TRACE_LOG_LEVEL, msg, args);\n}\n\nfn log_format<let M: u32, let N: u32>(log_level: u8, msg: str<M>, args: [Field; N]) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe\n // to call.\n unsafe { log_oracle_wrapper(log_level, msg, args) };\n}\n\nunconstrained fn log_oracle_wrapper<let M: u32, let N: u32>(\n log_level: u8,\n msg: str<M>,\n args: [Field; N],\n) {\n log_oracle(log_level, msg, N, args);\n}\n\n// While the length parameter might seem unnecessary given that we have N, we keep it around because at the AVM\n// bytecode level we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally\n// take that route. The AVM transpiler maps this oracle to the DEBUGLOG opcode, which reads the fields size from memory.\n#[oracle(aztec_utl_log)]\nunconstrained fn log_oracle<let M: u32, let N: u32>(\n log_level: u8,\n msg: str<M>,\n length: u32,\n args: [Field; N],\n) {}\n"
5347
5295
  },
5348
- "376": {
5296
+ "374": {
5349
5297
  "function_locations": [
5350
5298
  {
5351
5299
  "name": "Poseidon2Sponge::hash",
@@ -5375,7 +5323,7 @@
5375
5323
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/poseidon2.nr",
5376
5324
  "source": "use crate::constants::TWO_POW_64;\nuse crate::traits::{Deserialize, Serialize};\nuse std::meta::derive;\n// NB: This is a clone of noir/noir-repo/noir_stdlib/src/hash/poseidon2.nr\n// It exists as we sometimes need to perform custom absorption, but the stdlib version\n// has a private absorb() method (it's also designed to just be a hasher)\n// Can be removed when standalone noir poseidon lib exists: See noir#6679\n// TODO: Poseidon is stand-alone now\n\nglobal RATE: u32 = 3;\n\n#[derive(Deserialize, Eq, Serialize)]\npub struct Poseidon2Sponge {\n pub cache: [Field; 3],\n pub state: [Field; 4],\n pub cache_size: u32,\n pub squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2Sponge {\n #[no_predicates]\n pub fn hash<let N: u32>(input: [Field; N], message_size: u32) -> Field {\n Poseidon2Sponge::hash_internal(input, message_size, message_size != N)\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2Sponge {\n let mut result =\n Poseidon2Sponge { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n for i in 0..RATE {\n // We effectively zero-pad the cache by only adding to the state\n // cache that is less than the specified `cache_size`\n if i < self.cache_size {\n self.state[i] += self.cache[i];\n }\n }\n self.state = std::hash::poseidon2_permutation(self.state, 4);\n }\n\n pub fn absorb(&mut self, input: Field) {\n assert(!self.squeeze_mode);\n if self.cache_size == RATE {\n // If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache\n self.perform_duplex();\n self.cache[0] = input;\n self.cache_size = 1;\n } else {\n // If we're absorbing, and the cache is not full, add the input into the cache\n self.cache[self.cache_size] = input;\n self.cache_size += 1;\n }\n }\n\n pub fn squeeze(&mut self) -> Field {\n assert(!self.squeeze_mode);\n // If we're in absorb mode, apply sponge permutation to compress the cache.\n self.perform_duplex();\n self.squeeze_mode = true;\n\n // Pop one item off the top of the permutation and return it.\n self.state[0]\n }\n\n fn hash_internal<let N: u32>(\n input: [Field; N],\n in_len: u32,\n is_variable_length: bool,\n ) -> Field {\n let iv: Field = (in_len as Field) * TWO_POW_64;\n let mut sponge = Poseidon2Sponge::new(iv);\n for i in 0..input.len() {\n if i < in_len {\n sponge.absorb(input[i]);\n }\n }\n\n sponge.squeeze()\n }\n}\n"
5377
5325
  },
5378
- "388": {
5326
+ "386": {
5379
5327
  "function_locations": [
5380
5328
  {
5381
5329
  "name": "derive_storage_slot_in_map",
@@ -5389,7 +5337,7 @@
5389
5337
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr",
5390
5338
  "source": "use crate::{\n constants::DOM_SEP__PUBLIC_STORAGE_MAP_SLOT, hash::poseidon2_hash_with_separator,\n traits::ToField,\n};\n\n// TODO: Move this to src/public_data/storage/map.nr\npub fn derive_storage_slot_in_map<K>(storage_slot: Field, key: K) -> Field\nwhere\n K: ToField,\n{\n poseidon2_hash_with_separator(\n [storage_slot, key.to_field()],\n DOM_SEP__PUBLIC_STORAGE_MAP_SLOT,\n )\n}\n\nmod test {\n use crate::{address::AztecAddress, storage::map::derive_storage_slot_in_map, traits::FromField};\n\n #[test]\n fn test_derive_storage_slot_in_map_matches_typescript() {\n let map_slot = 0x132258fb6962c4387ba659d9556521102d227549a386d39f0b22d1890d59c2b5;\n let key = AztecAddress::from_field(\n 0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f,\n );\n\n let slot = derive_storage_slot_in_map(map_slot, key);\n\n // The following value was generated by `map_slot.test.ts`\n let slot_from_typescript =\n 0x2d225f361108379adc2da91378b9702675c5546b57e78bafc1e74ec7fec55967;\n\n assert_eq(slot, slot_from_typescript);\n }\n}\n"
5391
5339
  },
5392
- "395": {
5340
+ "393": {
5393
5341
  "function_locations": [
5394
5342
  {
5395
5343
  "name": "<impl ToField for Field>::to_field",
@@ -5431,7 +5379,7 @@
5431
5379
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/traits/to_field.nr",
5432
5380
  "source": "use crate::utils::field::field_from_bytes;\n\npub trait ToField {\n fn to_field(self) -> Field;\n}\n\nimpl ToField for Field {\n #[inline_always]\n fn to_field(self) -> Field {\n self\n }\n}\n\nimpl ToField for bool {\n #[inline_always]\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u1 {\n #[inline_always]\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u8 {\n #[inline_always]\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u16 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u32 {\n #[inline_always]\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u64 {\n #[inline_always]\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u128 {\n #[inline_always]\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl<let N: u32> ToField for str<N> {\n #[inline_always]\n fn to_field(self) -> Field {\n assert(N < 32, \"String doesn't fit in a field, consider using Serialize instead\");\n field_from_bytes(self.as_bytes(), true)\n }\n}\n"
5433
5381
  },
5434
- "396": {
5382
+ "394": {
5435
5383
  "function_locations": [
5436
5384
  {
5437
5385
  "name": "<impl Packable for bool>::pack",
@@ -5553,7 +5501,7 @@
5553
5501
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/type_packing.nr",
5554
5502
  "source": "use crate::traits::Packable;\n\nglobal BOOL_PACKED_LEN: u32 = 1;\nglobal U8_PACKED_LEN: u32 = 1;\nglobal U16_PACKED_LEN: u32 = 1;\nglobal U32_PACKED_LEN: u32 = 1;\nglobal U64_PACKED_LEN: u32 = 1;\nglobal U128_PACKED_LEN: u32 = 1;\nglobal FIELD_PACKED_LEN: u32 = 1;\nglobal I8_PACKED_LEN: u32 = 1;\nglobal I16_PACKED_LEN: u32 = 1;\nglobal I32_PACKED_LEN: u32 = 1;\nglobal I64_PACKED_LEN: u32 = 1;\n\nimpl Packable for bool {\n let N: u32 = BOOL_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> bool {\n (fields[0] as u1) != 0\n }\n}\n\nimpl Packable for u8 {\n let N: u32 = U8_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u8\n }\n}\n\nimpl Packable for u16 {\n let N: u32 = U16_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u16\n }\n}\n\nimpl Packable for u32 {\n let N: u32 = U32_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u32\n }\n}\n\nimpl Packable for u64 {\n let N: u32 = U64_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u64\n }\n}\n\nimpl Packable for u128 {\n let N: u32 = U128_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u128\n }\n}\n\nimpl Packable for Field {\n let N: u32 = FIELD_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0]\n }\n}\n\nimpl Packable for i8 {\n let N: u32 = I8_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as u8 as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u8 as i8\n }\n}\n\nimpl Packable for i16 {\n let N: u32 = I16_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as u16 as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u16 as i16\n }\n}\n\nimpl Packable for i32 {\n let N: u32 = I32_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as u32 as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u32 as i32\n }\n}\n\nimpl Packable for i64 {\n let N: u32 = I64_PACKED_LEN;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n [self as u64 as Field]\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n fields[0] as u64 as i64\n }\n}\n\nimpl<T, let M: u32> Packable for [T; M]\nwhere\n T: Packable,\n{\n let N: u32 = M * <T as Packable>::N;\n\n #[inline_always]\n fn pack(self) -> [Field; Self::N] {\n let mut result: [Field; Self::N] = std::mem::zeroed();\n for i in 0..M {\n let serialized = self[i].pack();\n for j in 0..<T as Packable>::N {\n result[i * <T as Packable>::N + j] = serialized[j];\n }\n }\n result\n }\n\n #[inline_always]\n fn unpack(fields: [Field; Self::N]) -> Self {\n let mut reader = crate::utils::reader::Reader::new(fields);\n let result: [T; M] = std::mem::zeroed();\n reader.read_struct_array::<T, <T as Packable>::N, M>(Packable::unpack, result)\n }\n}\n\n#[test]\nfn test_u16_packing() {\n let a: u16 = 10;\n assert_eq(a, u16::unpack(a.pack()));\n}\n\n#[test]\nfn test_i8_packing() {\n let a: i8 = -10;\n assert_eq(a, i8::unpack(a.pack()));\n}\n\n#[test]\nfn test_i16_packing() {\n let a: i16 = -10;\n assert_eq(a, i16::unpack(a.pack()));\n}\n\n#[test]\nfn test_i32_packing() {\n let a: i32 = -10;\n assert_eq(a, i32::unpack(a.pack()));\n}\n\n#[test]\nfn test_i64_packing() {\n let a: i64 = -10;\n assert_eq(a, i64::unpack(a.pack()));\n}\n"
5555
5503
  },
5556
- "403": {
5504
+ "401": {
5557
5505
  "function_locations": [
5558
5506
  {
5559
5507
  "name": "field_from_bytes",
@@ -5563,123 +5511,111 @@
5563
5511
  "name": "field_from_bytes_32_trunc",
5564
5512
  "start": 553
5565
5513
  },
5566
- {
5567
- "name": "full_field_less_than",
5568
- "start": 1218
5569
- },
5570
- {
5571
- "name": "full_field_greater_than",
5572
- "start": 1302
5573
- },
5574
5514
  {
5575
5515
  "name": "min",
5576
- "start": 1365
5516
+ "start": 1054
5577
5517
  },
5578
5518
  {
5579
5519
  "name": "pow",
5580
- "start": 2210
5520
+ "start": 1899
5581
5521
  },
5582
5522
  {
5583
5523
  "name": "sqrt",
5584
- "start": 2542
5524
+ "start": 2231
5585
5525
  },
5586
5526
  {
5587
5527
  "name": "is_square",
5588
- "start": 3224
5528
+ "start": 2913
5589
5529
  },
5590
5530
  {
5591
5531
  "name": "tonelli_shanks_sqrt",
5592
- "start": 3652
5532
+ "start": 3341
5593
5533
  },
5594
5534
  {
5595
5535
  "name": "__sqrt",
5596
- "start": 4260
5536
+ "start": 3949
5597
5537
  },
5598
5538
  {
5599
5539
  "name": "validate_sqrt_hint",
5600
- "start": 5104
5540
+ "start": 4793
5601
5541
  },
5602
5542
  {
5603
5543
  "name": "validate_not_sqrt_hint",
5604
- "start": 5241
5544
+ "start": 4930
5605
5545
  },
5606
5546
  {
5607
5547
  "name": "bytes_field_test",
5608
- "start": 6879
5548
+ "start": 6568
5609
5549
  },
5610
5550
  {
5611
5551
  "name": "max_field_test",
5612
- "start": 7862
5552
+ "start": 7551
5613
5553
  },
5614
5554
  {
5615
5555
  "name": "sqrt_valid_test",
5616
- "start": 8486
5556
+ "start": 8175
5617
5557
  },
5618
5558
  {
5619
5559
  "name": "sqrt_invalid_test",
5620
- "start": 8688
5560
+ "start": 8377
5621
5561
  },
5622
5562
  {
5623
5563
  "name": "sqrt_zero_test",
5624
- "start": 8857
5564
+ "start": 8546
5625
5565
  },
5626
5566
  {
5627
5567
  "name": "sqrt_one_test",
5628
- "start": 8994
5568
+ "start": 8683
5629
5569
  },
5630
5570
  {
5631
5571
  "name": "field_from_bytes_empty_test",
5632
- "start": 9163
5572
+ "start": 8852
5633
5573
  },
5634
5574
  {
5635
5575
  "name": "field_from_bytes_little_endian_test",
5636
- "start": 9416
5576
+ "start": 9105
5637
5577
  },
5638
5578
  {
5639
5579
  "name": "pow_test",
5640
- "start": 9801
5580
+ "start": 9490
5641
5581
  },
5642
5582
  {
5643
5583
  "name": "min_test",
5644
- "start": 10024
5645
- },
5646
- {
5647
- "name": "full_field_comparison_test",
5648
- "start": 10201
5584
+ "start": 9713
5649
5585
  },
5650
5586
  {
5651
5587
  "name": "sqrt_has_two_roots_test",
5652
- "start": 10515
5588
+ "start": 9887
5653
5589
  },
5654
5590
  {
5655
5591
  "name": "sqrt_negative_one_test",
5656
- "start": 11188
5592
+ "start": 10560
5657
5593
  },
5658
5594
  {
5659
5595
  "name": "validate_sqrt_hint_valid_test",
5660
- "start": 11394
5596
+ "start": 10766
5661
5597
  },
5662
5598
  {
5663
5599
  "name": "validate_sqrt_hint_invalid_test",
5664
- "start": 11825
5600
+ "start": 11197
5665
5601
  },
5666
5602
  {
5667
5603
  "name": "validate_not_sqrt_hint_valid_test",
5668
- "start": 11957
5604
+ "start": 11329
5669
5605
  },
5670
5606
  {
5671
5607
  "name": "validate_not_sqrt_hint_zero_test",
5672
- "start": 12237
5608
+ "start": 11609
5673
5609
  },
5674
5610
  {
5675
5611
  "name": "validate_not_sqrt_hint_wrong_hint_test",
5676
- "start": 12454
5612
+ "start": 11826
5677
5613
  }
5678
5614
  ],
5679
5615
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/utils/field.nr",
5680
- "source": "pub fn field_from_bytes<let N: u32>(bytes: [u8; N], big_endian: bool) -> Field {\n assert(bytes.len() < 32, \"field_from_bytes: N must be less than 32\");\n let mut as_field = 0;\n let mut offset = 1;\n for i in 0..N {\n let mut index = i;\n if big_endian {\n index = N - i - 1;\n }\n as_field += (bytes[index] as Field) * offset;\n offset *= 256;\n }\n\n as_field\n}\n\n// Convert a 32 byte array to a field element by truncating the final byte\npub fn field_from_bytes_32_trunc(bytes32: [u8; 32]) -> Field {\n // Convert it to a field element\n let mut v = 1;\n let mut high = 0 as Field;\n let mut low = 0 as Field;\n\n for i in 0..15 {\n // covers bytes 16..30 (31 is truncated and ignored)\n low = low + (bytes32[15 + 15 - i] as Field) * v;\n v = v * 256;\n // covers bytes 0..14\n high = high + (bytes32[14 - i] as Field) * v;\n }\n // covers byte 15\n low = low + (bytes32[15] as Field) * v;\n\n low + high * v\n}\n\n// TODO to radix returns u8, so we cannot use bigger radixes. It'd be ideal to use a radix of the maximum range-constrained integer noir supports\npub fn full_field_less_than(lhs: Field, rhs: Field) -> bool {\n lhs.lt(rhs)\n}\n\npub fn full_field_greater_than(lhs: Field, rhs: Field) -> bool {\n rhs.lt(lhs)\n}\n\npub fn min(f1: Field, f2: Field) -> Field {\n if f1.lt(f2) {\n f1\n } else {\n f2\n }\n}\n\n// TODO: write doc-comments and tests for these magic constants.\n\nglobal KNOWN_NON_RESIDUE: Field = 5; // This is a non-residue in Noir's native Field.\nglobal C1: u32 = 28;\nglobal C3: Field = 40770029410420498293352137776570907027550720424234931066070132305055;\nglobal C5: Field = 19103219067921713944291392827692070036145651957329286315305642004821462161904;\n\n// @dev: only use this for _huge_ exponents y, when writing a constrained function.\n// If you're only exponentiating by a small value, first consider writing-out the multiplications by hand.\n// Only after you've measured the gates of that approach, consider using the native Field::pow_32 function.\n// Only if your exponent is larger than 32 bits, resort to using this function.\npub fn pow(x: Field, y: Field) -> Field {\n let mut r = 1 as Field;\n let b: [u1; 254] = y.to_le_bits();\n\n for i in 0..254 {\n r *= r;\n r *= (b[254 - 1 - i] as Field) * x + (1 - b[254 - 1 - i] as Field);\n }\n\n r\n}\n\n/// Returns Option::some(sqrt) if there is a square root, and Option::none() if there isn't.\npub fn sqrt(x: Field) -> Option<Field> {\n // Safety: if the hint returns the square root of x, then we simply square it\n // check the result equals x. If x is not square, we return a value that\n // enables us to prove that fact (see the `else` clause below).\n let (is_sq, maybe_sqrt) = unsafe { __sqrt(x) };\n\n if is_sq {\n let sqrt = maybe_sqrt;\n validate_sqrt_hint(x, sqrt);\n Option::some(sqrt)\n } else {\n let not_sqrt_hint = maybe_sqrt;\n validate_not_sqrt_hint(x, not_sqrt_hint);\n Option::none()\n }\n}\n\n// Boolean indicating whether Field element is a square, i.e. whether there exists a y in Field s.t. x = y*y.\nunconstrained fn is_square(x: Field) -> bool {\n let v = pow(x, -1 / 2);\n v * (v - 1) == 0\n}\n\n// Tonelli-Shanks algorithm for computing the square root of a Field element.\n// Requires C1 = max{c: 2^c divides (p-1)}, where p is the order of Field\n// as well as C3 = (C2 - 1)/2, where C2 = (p-1)/(2^c1),\n// and C5 = ZETA^C2, where ZETA is a non-square element of Field.\n// These are pre-computed above as globals.\nunconstrained fn tonelli_shanks_sqrt(x: Field) -> Field {\n let mut z = pow(x, C3);\n let mut t = z * z * x;\n z *= x;\n let mut b = t;\n let mut c = C5;\n\n for i in 0..(C1 - 1) {\n for _j in 1..(C1 - i - 1) {\n b *= b;\n }\n\n z *= if b == 1 { 1 } else { c };\n\n c *= c;\n\n t *= if b == 1 { 1 } else { c };\n\n b = t;\n }\n\n z\n}\n\n// NB: this doesn't return an option, because in the case of there _not_ being a square root, we still want to return a field element that allows us to then assert in the _constrained_ sqrt function that there is no sqrt.\nunconstrained fn __sqrt(x: Field) -> (bool, Field) {\n let is_sq = is_square(x);\n if is_sq {\n let sqrt = tonelli_shanks_sqrt(x);\n (true, sqrt)\n } else {\n // Demonstrate that x is not a square (a.k.a. a \"quadratic non-residue\").\n // Facts:\n // The Legendre symbol (\"LS\") of x, is x^((p-1)/2) (mod p).\n // - If x is a square, LS(x) = 1\n // - If x is not a square, LS(x) = -1\n // - If x = 0, LS(x) = 0.\n //\n // Hence:\n // sq * sq = sq // 1 * 1 = 1\n // non-sq * non-sq = sq // -1 * -1 = 1\n // sq * non-sq = non-sq // -1 * 1 = -1\n //\n // See: https://en.wikipedia.org/wiki/Legendre_symbol\n let demo_x_not_square = x * KNOWN_NON_RESIDUE;\n let not_sqrt = tonelli_shanks_sqrt(demo_x_not_square);\n (false, not_sqrt)\n }\n}\n\nfn validate_sqrt_hint(x: Field, hint: Field) {\n assert(hint * hint == x, f\"The claimed_sqrt {hint} is not the sqrt of x {x}\");\n}\n\nfn validate_not_sqrt_hint(x: Field, hint: Field) {\n // We need this assertion, because x = 0 would pass the other assertions in this\n // function, and we don't want people to be able to prove that 0 is not square!\n assert(x != 0, \"0 has a square root; you cannot claim it is not square\");\n // Demonstrate that x is not a square (a.k.a. a \"quadratic non-residue\").\n //\n // Facts:\n // The Legendre symbol (\"LS\") of x, is x^((p-1)/2) (mod p).\n // - If x is a square, LS(x) = 1\n // - If x is not a square, LS(x) = -1\n // - If x = 0, LS(x) = 0.\n //\n // Hence:\n // 1. sq * sq = sq // 1 * 1 = 1\n // 2. non-sq * non-sq = sq // -1 * -1 = 1\n // 3. sq * non-sq = non-sq // -1 * 1 = -1\n //\n // See: https://en.wikipedia.org/wiki/Legendre_symbol\n //\n // We want to demonstrate that this below multiplication falls under bullet-point (2):\n let demo_x_not_square = x * KNOWN_NON_RESIDUE;\n // I.e. we want to demonstrate that `demo_x_not_square` has Legendre symbol 1\n // (i.e. that it is a square), so we prove that it is square below.\n // Why do we want to prove that it has LS 1?\n // Well, since it was computed with a known-non-residue, its squareness implies we're\n // in case 2 (something multiplied by a known-non-residue yielding a result which\n // has a LS of 1), which implies that x must be a non-square. The unconstrained\n // function gave us the sqrt of demo_x_not_square, so all we need to do is\n // assert its squareness:\n assert(\n hint * hint == demo_x_not_square,\n f\"The hint {hint} does not demonstrate that {x} is not a square\",\n );\n}\n\n#[test]\nunconstrained fn bytes_field_test() {\n // Tests correctness of field_from_bytes_32_trunc against existing methods\n // Bytes representing 0x543e0a6642ffeb8039296861765a53407bba62bd1c97ca43374de950bbe0a7\n let inputs = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167,\n ];\n let field = field_from_bytes(inputs, true);\n let return_bytes: [u8; 31] = field.to_be_bytes();\n assert_eq(inputs, return_bytes);\n // 32 bytes - we remove the final byte, and check it matches the field\n let inputs2 = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167, 158,\n ];\n let field2 = field_from_bytes_32_trunc(inputs2);\n let return_bytes2: [u8; 31] = field2.to_be_bytes();\n\n assert_eq(return_bytes2, return_bytes);\n assert_eq(field2, field);\n}\n\n#[test]\nunconstrained fn max_field_test() {\n // Tests the hardcoded value in constants.nr vs underlying modulus\n // NB: We can't use 0-1 in constants.nr as it will be transpiled incorrectly to ts and sol constants files\n let max_value = crate::constants::MAX_FIELD_VALUE;\n assert_eq(max_value, 0 - 1);\n // modulus == 0 is tested elsewhere, so below is more of a sanity check\n let max_bytes: [u8; 32] = max_value.to_be_bytes();\n let mod_bytes = std::field::modulus_be_bytes();\n for i in 0..31 {\n assert_eq(max_bytes[i], mod_bytes[i]);\n }\n assert_eq(max_bytes[31], mod_bytes[31] - 1);\n}\n\n#[test]\nunconstrained fn sqrt_valid_test() {\n let x = 16; // examples: 16, 9, 25, 81\n let result = sqrt(x);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), x);\n}\n\n#[test]\nunconstrained fn sqrt_invalid_test() {\n let x = KNOWN_NON_RESIDUE; // has no square root in the field\n let result = sqrt(x);\n assert(result.is_none());\n}\n\n#[test]\nunconstrained fn sqrt_zero_test() {\n let result = sqrt(0);\n assert(result.is_some());\n assert_eq(result.unwrap(), 0);\n}\n\n#[test]\nunconstrained fn sqrt_one_test() {\n let result = sqrt(1);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), 1);\n}\n\n#[test]\nunconstrained fn field_from_bytes_empty_test() {\n let empty: [u8; 0] = [];\n let result = field_from_bytes(empty, true);\n assert_eq(result, 0);\n\n let result_le = field_from_bytes(empty, false);\n assert_eq(result_le, 0);\n}\n\n#[test]\nunconstrained fn field_from_bytes_little_endian_test() {\n // Test little-endian conversion: [0x01, 0x02] should be 0x0201 = 513\n let bytes = [0x01, 0x02];\n let result_le = field_from_bytes(bytes, false);\n assert_eq(result_le, 0x0201);\n\n // Compare with big-endian: [0x01, 0x02] should be 0x0102 = 258\n let result_be = field_from_bytes(bytes, true);\n assert_eq(result_be, 0x0102);\n}\n\n#[test]\nunconstrained fn pow_test() {\n assert_eq(pow(2, 0), 1);\n assert_eq(pow(2, 1), 2);\n assert_eq(pow(2, 10), 1024);\n assert_eq(pow(3, 5), 243);\n assert_eq(pow(0, 5), 0);\n assert_eq(pow(1, 100), 1);\n}\n\n#[test]\nunconstrained fn min_test() {\n assert_eq(min(5, 10), 5);\n assert_eq(min(10, 5), 5);\n assert_eq(min(7, 7), 7);\n assert_eq(min(0, 1), 0);\n}\n\n#[test]\nunconstrained fn full_field_comparison_test() {\n assert(full_field_less_than(5, 10));\n assert(!full_field_less_than(10, 5));\n assert(!full_field_less_than(5, 5));\n\n assert(full_field_greater_than(10, 5));\n assert(!full_field_greater_than(5, 10));\n assert(!full_field_greater_than(5, 5));\n}\n\n#[test]\nunconstrained fn sqrt_has_two_roots_test() {\n // Every square has two roots: r and -r (i.e., p - r)\n // sqrt(16) can return 4 or -4\n let x = 16;\n let result = sqrt(x).unwrap();\n assert(result * result == x);\n // The other root is -result\n let other_root = 0 - result;\n assert(other_root * other_root == x);\n // Verify they are different (unless x = 0)\n assert(result != other_root);\n\n // Same for 9: roots are 3 and -3\n let y = 9;\n let result_y = sqrt(y).unwrap();\n assert(result_y * result_y == y);\n let other_root_y = 0 - result_y;\n assert(other_root_y * other_root_y == y);\n assert(result_y != other_root_y);\n}\n\n#[test]\nunconstrained fn sqrt_negative_one_test() {\n let x = 0 - 1;\n let result = sqrt(x);\n assert(result.unwrap() == 0x30644e72e131a029048b6e193fd841045cea24f6fd736bec231204708f703636);\n}\n\n#[test]\nunconstrained fn validate_sqrt_hint_valid_test() {\n // 4 is a valid sqrt of 16\n validate_sqrt_hint(16, 4);\n // -4 is also a valid sqrt of 16\n validate_sqrt_hint(16, 0 - 4);\n // 0 is a valid sqrt of 0\n validate_sqrt_hint(0, 0);\n // 1 is a valid sqrt of 1\n validate_sqrt_hint(1, 1);\n // -1 is also a valid sqrt of 1\n validate_sqrt_hint(1, 0 - 1);\n}\n\n#[test(should_fail_with = \"is not the sqrt of x\")]\nunconstrained fn validate_sqrt_hint_invalid_test() {\n // 5 is not a valid sqrt of 16\n validate_sqrt_hint(16, 5);\n}\n\n#[test]\nunconstrained fn validate_not_sqrt_hint_valid_test() {\n // 5 (KNOWN_NON_RESIDUE) is not a square.\n let x = KNOWN_NON_RESIDUE;\n let hint = tonelli_shanks_sqrt(x * KNOWN_NON_RESIDUE);\n validate_not_sqrt_hint(x, hint);\n}\n\n#[test(should_fail_with = \"0 has a square root\")]\nunconstrained fn validate_not_sqrt_hint_zero_test() {\n // 0 has a square root, so we cannot claim it is not square\n validate_not_sqrt_hint(0, 0);\n}\n\n#[test(should_fail_with = \"does not demonstrate that\")]\nunconstrained fn validate_not_sqrt_hint_wrong_hint_test() {\n // Provide a wrong hint for a non-square\n let x = KNOWN_NON_RESIDUE;\n validate_not_sqrt_hint(x, 123);\n}\n"
5616
+ "source": "pub fn field_from_bytes<let N: u32>(bytes: [u8; N], big_endian: bool) -> Field {\n assert(bytes.len() < 32, \"field_from_bytes: N must be less than 32\");\n let mut as_field = 0;\n let mut offset = 1;\n for i in 0..N {\n let mut index = i;\n if big_endian {\n index = N - i - 1;\n }\n as_field += (bytes[index] as Field) * offset;\n offset *= 256;\n }\n\n as_field\n}\n\n// Convert a 32 byte array to a field element by truncating the final byte\npub fn field_from_bytes_32_trunc(bytes32: [u8; 32]) -> Field {\n // Convert it to a field element\n let mut v = 1;\n let mut high = 0 as Field;\n let mut low = 0 as Field;\n\n for i in 0..15 {\n // covers bytes 16..30 (31 is truncated and ignored)\n low = low + (bytes32[15 + 15 - i] as Field) * v;\n v = v * 256;\n // covers bytes 0..14\n high = high + (bytes32[14 - i] as Field) * v;\n }\n // covers byte 15\n low = low + (bytes32[15] as Field) * v;\n\n low + high * v\n}\n\npub fn min(f1: Field, f2: Field) -> Field {\n if f1.lt(f2) {\n f1\n } else {\n f2\n }\n}\n\n// TODO: write doc-comments and tests for these magic constants.\n\nglobal KNOWN_NON_RESIDUE: Field = 5; // This is a non-residue in Noir's native Field.\nglobal C1: u32 = 28;\nglobal C3: Field = 40770029410420498293352137776570907027550720424234931066070132305055;\nglobal C5: Field = 19103219067921713944291392827692070036145651957329286315305642004821462161904;\n\n// @dev: only use this for _huge_ exponents y, when writing a constrained function.\n// If you're only exponentiating by a small value, first consider writing-out the multiplications by hand.\n// Only after you've measured the gates of that approach, consider using the native Field::pow_32 function.\n// Only if your exponent is larger than 32 bits, resort to using this function.\npub fn pow(x: Field, y: Field) -> Field {\n let mut r = 1 as Field;\n let b: [u1; 254] = y.to_le_bits();\n\n for i in 0..254 {\n r *= r;\n r *= (b[254 - 1 - i] as Field) * x + (1 - b[254 - 1 - i] as Field);\n }\n\n r\n}\n\n/// Returns Option::some(sqrt) if there is a square root, and Option::none() if there isn't.\npub fn sqrt(x: Field) -> Option<Field> {\n // Safety: if the hint returns the square root of x, then we simply square it\n // check the result equals x. If x is not square, we return a value that\n // enables us to prove that fact (see the `else` clause below).\n let (is_sq, maybe_sqrt) = unsafe { __sqrt(x) };\n\n if is_sq {\n let sqrt = maybe_sqrt;\n validate_sqrt_hint(x, sqrt);\n Option::some(sqrt)\n } else {\n let not_sqrt_hint = maybe_sqrt;\n validate_not_sqrt_hint(x, not_sqrt_hint);\n Option::none()\n }\n}\n\n// Boolean indicating whether Field element is a square, i.e. whether there exists a y in Field s.t. x = y*y.\nunconstrained fn is_square(x: Field) -> bool {\n let v = pow(x, -1 / 2);\n v * (v - 1) == 0\n}\n\n// Tonelli-Shanks algorithm for computing the square root of a Field element.\n// Requires C1 = max{c: 2^c divides (p-1)}, where p is the order of Field\n// as well as C3 = (C2 - 1)/2, where C2 = (p-1)/(2^c1),\n// and C5 = ZETA^C2, where ZETA is a non-square element of Field.\n// These are pre-computed above as globals.\nunconstrained fn tonelli_shanks_sqrt(x: Field) -> Field {\n let mut z = pow(x, C3);\n let mut t = z * z * x;\n z *= x;\n let mut b = t;\n let mut c = C5;\n\n for i in 0..(C1 - 1) {\n for _j in 1..(C1 - i - 1) {\n b *= b;\n }\n\n z *= if b == 1 { 1 } else { c };\n\n c *= c;\n\n t *= if b == 1 { 1 } else { c };\n\n b = t;\n }\n\n z\n}\n\n// NB: this doesn't return an option, because in the case of there _not_ being a square root, we still want to return a field element that allows us to then assert in the _constrained_ sqrt function that there is no sqrt.\nunconstrained fn __sqrt(x: Field) -> (bool, Field) {\n let is_sq = is_square(x);\n if is_sq {\n let sqrt = tonelli_shanks_sqrt(x);\n (true, sqrt)\n } else {\n // Demonstrate that x is not a square (a.k.a. a \"quadratic non-residue\").\n // Facts:\n // The Legendre symbol (\"LS\") of x, is x^((p-1)/2) (mod p).\n // - If x is a square, LS(x) = 1\n // - If x is not a square, LS(x) = -1\n // - If x = 0, LS(x) = 0.\n //\n // Hence:\n // sq * sq = sq // 1 * 1 = 1\n // non-sq * non-sq = sq // -1 * -1 = 1\n // sq * non-sq = non-sq // -1 * 1 = -1\n //\n // See: https://en.wikipedia.org/wiki/Legendre_symbol\n let demo_x_not_square = x * KNOWN_NON_RESIDUE;\n let not_sqrt = tonelli_shanks_sqrt(demo_x_not_square);\n (false, not_sqrt)\n }\n}\n\nfn validate_sqrt_hint(x: Field, hint: Field) {\n assert(hint * hint == x, f\"The claimed_sqrt {hint} is not the sqrt of x {x}\");\n}\n\nfn validate_not_sqrt_hint(x: Field, hint: Field) {\n // We need this assertion, because x = 0 would pass the other assertions in this\n // function, and we don't want people to be able to prove that 0 is not square!\n assert(x != 0, \"0 has a square root; you cannot claim it is not square\");\n // Demonstrate that x is not a square (a.k.a. a \"quadratic non-residue\").\n //\n // Facts:\n // The Legendre symbol (\"LS\") of x, is x^((p-1)/2) (mod p).\n // - If x is a square, LS(x) = 1\n // - If x is not a square, LS(x) = -1\n // - If x = 0, LS(x) = 0.\n //\n // Hence:\n // 1. sq * sq = sq // 1 * 1 = 1\n // 2. non-sq * non-sq = sq // -1 * -1 = 1\n // 3. sq * non-sq = non-sq // -1 * 1 = -1\n //\n // See: https://en.wikipedia.org/wiki/Legendre_symbol\n //\n // We want to demonstrate that this below multiplication falls under bullet-point (2):\n let demo_x_not_square = x * KNOWN_NON_RESIDUE;\n // I.e. we want to demonstrate that `demo_x_not_square` has Legendre symbol 1\n // (i.e. that it is a square), so we prove that it is square below.\n // Why do we want to prove that it has LS 1?\n // Well, since it was computed with a known-non-residue, its squareness implies we're\n // in case 2 (something multiplied by a known-non-residue yielding a result which\n // has a LS of 1), which implies that x must be a non-square. The unconstrained\n // function gave us the sqrt of demo_x_not_square, so all we need to do is\n // assert its squareness:\n assert(\n hint * hint == demo_x_not_square,\n f\"The hint {hint} does not demonstrate that {x} is not a square\",\n );\n}\n\n#[test]\nunconstrained fn bytes_field_test() {\n // Tests correctness of field_from_bytes_32_trunc against existing methods\n // Bytes representing 0x543e0a6642ffeb8039296861765a53407bba62bd1c97ca43374de950bbe0a7\n let inputs = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167,\n ];\n let field = field_from_bytes(inputs, true);\n let return_bytes: [u8; 31] = field.to_be_bytes();\n assert_eq(inputs, return_bytes);\n // 32 bytes - we remove the final byte, and check it matches the field\n let inputs2 = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167, 158,\n ];\n let field2 = field_from_bytes_32_trunc(inputs2);\n let return_bytes2: [u8; 31] = field2.to_be_bytes();\n\n assert_eq(return_bytes2, return_bytes);\n assert_eq(field2, field);\n}\n\n#[test]\nunconstrained fn max_field_test() {\n // Tests the hardcoded value in constants.nr vs underlying modulus\n // NB: We can't use 0-1 in constants.nr as it will be transpiled incorrectly to ts and sol constants files\n let max_value = crate::constants::MAX_FIELD_VALUE;\n assert_eq(max_value, 0 - 1);\n // modulus == 0 is tested elsewhere, so below is more of a sanity check\n let max_bytes: [u8; 32] = max_value.to_be_bytes();\n let mod_bytes = std::field::modulus_be_bytes();\n for i in 0..31 {\n assert_eq(max_bytes[i], mod_bytes[i]);\n }\n assert_eq(max_bytes[31], mod_bytes[31] - 1);\n}\n\n#[test]\nunconstrained fn sqrt_valid_test() {\n let x = 16; // examples: 16, 9, 25, 81\n let result = sqrt(x);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), x);\n}\n\n#[test]\nunconstrained fn sqrt_invalid_test() {\n let x = KNOWN_NON_RESIDUE; // has no square root in the field\n let result = sqrt(x);\n assert(result.is_none());\n}\n\n#[test]\nunconstrained fn sqrt_zero_test() {\n let result = sqrt(0);\n assert(result.is_some());\n assert_eq(result.unwrap(), 0);\n}\n\n#[test]\nunconstrained fn sqrt_one_test() {\n let result = sqrt(1);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), 1);\n}\n\n#[test]\nunconstrained fn field_from_bytes_empty_test() {\n let empty: [u8; 0] = [];\n let result = field_from_bytes(empty, true);\n assert_eq(result, 0);\n\n let result_le = field_from_bytes(empty, false);\n assert_eq(result_le, 0);\n}\n\n#[test]\nunconstrained fn field_from_bytes_little_endian_test() {\n // Test little-endian conversion: [0x01, 0x02] should be 0x0201 = 513\n let bytes = [0x01, 0x02];\n let result_le = field_from_bytes(bytes, false);\n assert_eq(result_le, 0x0201);\n\n // Compare with big-endian: [0x01, 0x02] should be 0x0102 = 258\n let result_be = field_from_bytes(bytes, true);\n assert_eq(result_be, 0x0102);\n}\n\n#[test]\nunconstrained fn pow_test() {\n assert_eq(pow(2, 0), 1);\n assert_eq(pow(2, 1), 2);\n assert_eq(pow(2, 10), 1024);\n assert_eq(pow(3, 5), 243);\n assert_eq(pow(0, 5), 0);\n assert_eq(pow(1, 100), 1);\n}\n\n#[test]\nunconstrained fn min_test() {\n assert_eq(min(5, 10), 5);\n assert_eq(min(10, 5), 5);\n assert_eq(min(7, 7), 7);\n assert_eq(min(0, 1), 0);\n}\n\n#[test]\nunconstrained fn sqrt_has_two_roots_test() {\n // Every square has two roots: r and -r (i.e., p - r)\n // sqrt(16) can return 4 or -4\n let x = 16;\n let result = sqrt(x).unwrap();\n assert(result * result == x);\n // The other root is -result\n let other_root = 0 - result;\n assert(other_root * other_root == x);\n // Verify they are different (unless x = 0)\n assert(result != other_root);\n\n // Same for 9: roots are 3 and -3\n let y = 9;\n let result_y = sqrt(y).unwrap();\n assert(result_y * result_y == y);\n let other_root_y = 0 - result_y;\n assert(other_root_y * other_root_y == y);\n assert(result_y != other_root_y);\n}\n\n#[test]\nunconstrained fn sqrt_negative_one_test() {\n let x = 0 - 1;\n let result = sqrt(x);\n assert(result.unwrap() == 0x30644e72e131a029048b6e193fd841045cea24f6fd736bec231204708f703636);\n}\n\n#[test]\nunconstrained fn validate_sqrt_hint_valid_test() {\n // 4 is a valid sqrt of 16\n validate_sqrt_hint(16, 4);\n // -4 is also a valid sqrt of 16\n validate_sqrt_hint(16, 0 - 4);\n // 0 is a valid sqrt of 0\n validate_sqrt_hint(0, 0);\n // 1 is a valid sqrt of 1\n validate_sqrt_hint(1, 1);\n // -1 is also a valid sqrt of 1\n validate_sqrt_hint(1, 0 - 1);\n}\n\n#[test(should_fail_with = \"is not the sqrt of x\")]\nunconstrained fn validate_sqrt_hint_invalid_test() {\n // 5 is not a valid sqrt of 16\n validate_sqrt_hint(16, 5);\n}\n\n#[test]\nunconstrained fn validate_not_sqrt_hint_valid_test() {\n // 5 (KNOWN_NON_RESIDUE) is not a square.\n let x = KNOWN_NON_RESIDUE;\n let hint = tonelli_shanks_sqrt(x * KNOWN_NON_RESIDUE);\n validate_not_sqrt_hint(x, hint);\n}\n\n#[test(should_fail_with = \"0 has a square root\")]\nunconstrained fn validate_not_sqrt_hint_zero_test() {\n // 0 has a square root, so we cannot claim it is not square\n validate_not_sqrt_hint(0, 0);\n}\n\n#[test(should_fail_with = \"does not demonstrate that\")]\nunconstrained fn validate_not_sqrt_hint_wrong_hint_test() {\n // Provide a wrong hint for a non-square\n let x = KNOWN_NON_RESIDUE;\n validate_not_sqrt_hint(x, 123);\n}\n"
5681
5617
  },
5682
- "409": {
5618
+ "407": {
5683
5619
  "function_locations": [
5684
5620
  {
5685
5621
  "name": "Reader<N>::new",
@@ -5729,6 +5665,32 @@
5729
5665
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/reader.nr",
5730
5666
  "source": "pub struct Reader<let N: u32> {\n data: [Field; N],\n offset: u32,\n}\n\nimpl<let N: u32> Reader<N> {\n pub fn new(data: [Field; N]) -> Self {\n Self { data, offset: 0 }\n }\n\n pub fn read(&mut self) -> Field {\n let result = self.data[self.offset];\n self.offset += 1;\n result\n }\n\n pub fn read_u32(&mut self) -> u32 {\n self.read() as u32\n }\n\n pub fn read_u64(&mut self) -> u64 {\n self.read() as u64\n }\n\n pub fn read_bool(&mut self) -> bool {\n self.read() != 0\n }\n\n pub fn read_array<let K: u32>(&mut self) -> [Field; K] {\n let mut result = [0; K];\n for i in 0..K {\n result[i] = self.data[self.offset + i];\n }\n self.offset += K;\n result\n }\n\n pub fn read_struct<T, let K: u32>(&mut self, deserialise: fn([Field; K]) -> T) -> T {\n let result = deserialise(self.read_array());\n result\n }\n\n pub fn read_struct_array<T, let K: u32, let C: u32>(\n &mut self,\n deserialise: fn([Field; K]) -> T,\n mut result: [T; C],\n ) -> [T; C] {\n for i in 0..C {\n result[i] = self.read_struct(deserialise);\n }\n result\n }\n\n pub fn peek_offset(&mut self, offset: u32) -> Field {\n self.data[self.offset + offset]\n }\n\n pub fn advance_offset(&mut self, offset: u32) {\n self.offset += offset;\n }\n\n pub fn finish(self) {\n assert_eq(self.offset, self.data.len(), \"Reader did not read all data\");\n }\n}\n"
5731
5667
  },
5668
+ "408": {
5669
+ "function_locations": [
5670
+ {
5671
+ "name": "derive_serialize",
5672
+ "start": 3042
5673
+ },
5674
+ {
5675
+ "name": "derive_deserialize",
5676
+ "start": 7256
5677
+ },
5678
+ {
5679
+ "name": "get_params_len_quote",
5680
+ "start": 10978
5681
+ },
5682
+ {
5683
+ "name": "get_generics_declarations",
5684
+ "start": 11437
5685
+ },
5686
+ {
5687
+ "name": "get_where_trait_clause",
5688
+ "start": 12519
5689
+ }
5690
+ ],
5691
+ "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/serialization.nr",
5692
+ "source": "use crate::{reader::Reader, writer::Writer};\n\n// docs:start:serialize\n/// Trait for serializing Noir types into arrays of Fields.\n///\n/// An implementation of the Serialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait (and Deserialize) are\n/// typically used to communicate between Noir and TypeScript (via oracles and function arguments).\n///\n/// # On Following Noir's Intrinsic Serialization\n/// When calling a Noir function from TypeScript (TS), first the function arguments are serialized into an array\n/// of fields. This array is then included in the initial witness. Noir's intrinsic serialization is then used\n/// to deserialize the arguments from the witness. When the same Noir function is called from Noir this Serialize trait\n/// is used instead of the serialization in TS. For this reason we need to have a match between TS serialization,\n/// Noir's intrinsic serialization and the implementation of this trait. If there is a mismatch, the function calls\n/// fail with an arguments hash mismatch error message.\n///\n/// # Associated Constants\n/// * `N` - The length of the output Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let N: u32> Serialize for str<N> {\n/// let N: u32 = N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// let bytes = self.as_bytes();\n/// for i in 0..bytes.len() {\n/// writer.write(bytes[i] as Field);\n/// }\n/// }\n/// }\n/// ```\n#[derive_via(derive_serialize)]\npub trait Serialize {\n let N: u32;\n\n fn serialize(self) -> [Field; Self::N];\n\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>);\n}\n\n/// Generates a `Serialize` trait implementation for a struct type.\n///\n/// # Parameters\n/// - `s`: The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A quoted code block containing the trait implementation\n///\n/// # Example\n/// For a struct defined as:\n/// ```\n/// struct Log<N> {\n/// fields: [Field; N],\n/// length: u32\n/// }\n/// ```\n///\n/// This function generates code equivalent to:\n/// ```\n/// impl<let N: u32> Serialize for Log<N> {\n/// let N: u32 = <[Field; N] as Serialize>::N + <u32 as Serialize>::N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// #[inline_always]\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// Serialize::stream_serialize(self.fields, writer);\n/// Serialize::stream_serialize(self.length, writer);\n/// }\n/// }\n/// ```\npub comptime fn derive_serialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n\n // We care only about the name and type so we drop the last item of the tuple\n let params = nested_struct.0.fields(nested_struct.1).map(|(name, typ, _)| (name, typ));\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Serialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_serialize_clause = get_where_trait_clause(s, quote {Serialize});\n\n let params_len_quote = get_params_len_quote(params);\n\n let function_body = params\n .map(|(name, _typ): (Quoted, Type)| {\n quote {\n $crate::serialization::Serialize::stream_serialize(self.$name, writer);\n }\n })\n .join(quote {});\n\n quote {\n impl$generics_declarations $crate::serialization::Serialize for $typ\n $where_serialize_clause\n {\n let N: u32 = $params_len_quote;\n\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: $crate::writer::Writer<Self::N> = $crate::writer::Writer::new();\n $crate::serialization::Serialize::stream_serialize(self, &mut writer);\n writer.finish()\n }\n\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut $crate::writer::Writer<K>) {\n $function_body\n }\n }\n }\n}\n\n// docs:start:deserialize\n/// Trait for deserializing Noir types from arrays of Fields.\n///\n/// An implementation of the Deserialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait is typically used when\n/// deserializing return values from function calls in Noir. Since the same function could be called from TypeScript\n/// (TS), in which case the TS deserialization would get used, we need to have a match between the 2.\n///\n/// # Associated Constants\n/// * `N` - The length of the input Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let M: u32> Deserialize for str<M> {\n/// let N: u32 = M;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let mut bytes = [0 as u8; M];\n/// for i in 0..M {\n/// bytes[i] = reader.read() as u8;\n/// }\n/// str::<M>::from(bytes)\n/// }\n/// }\n/// ```\n#[derive_via(derive_deserialize)]\npub trait Deserialize {\n let N: u32;\n\n fn deserialize(fields: [Field; Self::N]) -> Self;\n\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self;\n}\n\n/// Generates a `Deserialize` trait implementation for a given struct `s`.\n///\n/// # Arguments\n/// * `s` - The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A `Quoted` block containing the generated trait implementation\n///\n/// # Requirements\n/// Each struct member type must implement the `Deserialize` trait (it gets used in the generated code).\n///\n/// # Example\n/// For a struct like:\n/// ```\n/// struct MyStruct {\n/// x: AztecAddress,\n/// y: Field,\n/// }\n/// ```\n///\n/// This generates:\n/// ```\n/// impl Deserialize for MyStruct {\n/// let N: u32 = <AztecAddress as Deserialize>::N + <Field as Deserialize>::N;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// #[inline_always]\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let x = <AztecAddress as Deserialize>::stream_deserialize(reader);\n/// let y = <Field as Deserialize>::stream_deserialize(reader);\n/// Self { x, y }\n/// }\n/// }\n/// ```\npub comptime fn derive_deserialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n let params = nested_struct.0.fields(nested_struct.1);\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Deserialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_deserialize_clause = get_where_trait_clause(s, quote {Deserialize});\n\n // The following will give us:\n // <type_of_struct_member_1 as Deserialize>::N + <type_of_struct_member_2 as Deserialize>::N + ...\n // (or 0 if the struct has no members)\n let right_hand_side_of_definition_of_n = if params.len() > 0 {\n params\n .map(|(_, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n <$param_type as $crate::serialization::Deserialize>::N\n }\n })\n .join(quote {+})\n } else {\n quote {0}\n };\n\n // For structs containing a single member, we can enhance performance by directly deserializing the input array,\n // bypassing the need for loop-based array construction. While this optimization yields significant benefits in\n // Brillig where the loops are expected to not be optimized, it is not relevant in ACIR where the loops are\n // expected to be optimized away.\n let function_body = if params.len() > 1 {\n // This generates deserialization code for each struct member and concatenates them together.\n let deserialization_of_struct_members = params\n .map(|(param_name, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n let $param_name = <$param_type as Deserialize>::stream_deserialize(reader);\n }\n })\n .join(quote {});\n\n // We join the struct member names with a comma to be used in the `Self { ... }` syntax\n // This will give us e.g. `a, b, c` for a struct with three fields named `a`, `b`, and `c`.\n let struct_members = params\n .map(|(param_name, _, _): (Quoted, Type, Quoted)| quote { $param_name })\n .join(quote {,});\n\n quote {\n $deserialization_of_struct_members\n\n Self { $struct_members }\n }\n } else if params.len() == 1 {\n let param_name = params[0].0;\n quote {\n Self { $param_name: $crate::serialization::Deserialize::stream_deserialize(reader) }\n }\n } else {\n quote {\n Self {}\n }\n };\n\n quote {\n impl$generics_declarations $crate::serialization::Deserialize for $typ\n $where_deserialize_clause\n {\n let N: u32 = $right_hand_side_of_definition_of_n;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = $crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut $crate::reader::Reader<K>) -> Self {\n $function_body\n }\n }\n }\n}\n\n/// Generates a quoted expression that computes the total serialized length of function parameters.\n///\n/// # Parameters\n/// * `params` - An array of tuples where each tuple contains a quoted parameter name and its Type. The type needs\n/// to implement the Serialize trait.\n///\n/// # Returns\n/// A quoted expression that evaluates to:\n/// * `0` if there are no parameters\n/// * `(<type1 as Serialize>::N + <type2 as Serialize>::N + ...)` for one or more parameters\ncomptime fn get_params_len_quote(params: [(Quoted, Type)]) -> Quoted {\n if params.len() == 0 {\n quote { 0 }\n } else {\n let params_quote_without_parentheses = params\n .map(|(_, param_type): (Quoted, Type)| {\n quote {\n <$param_type as $crate::serialization::Serialize>::N\n }\n })\n .join(quote {+});\n quote { ($params_quote_without_parentheses) }\n }\n}\n\ncomptime fn get_generics_declarations(s: TypeDefinition) -> Quoted {\n let generics = s.generics();\n\n if generics.len() > 0 {\n let generics_declarations_items = generics\n .map(|(name, maybe_integer_typ)| {\n // The second item in the generics tuple is an Option of an integer type that is Some only if\n // the generic is numeric.\n if maybe_integer_typ.is_some() {\n // The generic is numeric, so we return a quote defined as e.g. \"let N: u32\"\n let integer_type = maybe_integer_typ.unwrap();\n quote {let $name: $integer_type}\n } else {\n // The generic is not numeric, so we return a quote containing the name of the generic (e.g. \"T\")\n quote {$name}\n }\n })\n .join(quote {,});\n quote {<$generics_declarations_items>}\n } else {\n // The struct doesn't have any generics defined, so we just return an empty quote.\n quote {}\n }\n}\n\ncomptime fn get_where_trait_clause(s: TypeDefinition, trait_name: Quoted) -> Quoted {\n let generics = s.generics();\n\n // The second item in the generics tuple is an Option of an integer type that is Some only if the generic is\n // numeric.\n let non_numeric_generics =\n generics.filter(|(_, maybe_integer_typ)| maybe_integer_typ.is_none());\n\n if non_numeric_generics.len() > 0 {\n let non_numeric_generics_declarations =\n non_numeric_generics.map(|(name, _)| quote {$name: $trait_name}).join(quote {,});\n quote {where $non_numeric_generics_declarations}\n } else {\n // There are no non-numeric generics, so we return an empty quote.\n quote {}\n }\n}\n"
5693
+ },
5732
5694
  "41": {
5733
5695
  "function_locations": [
5734
5696
  {
@@ -5828,32 +5790,6 @@
5828
5790
  "source": "use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\n/// Represents a value of type T or its absence.\n/// Use `Option::some(value)` to construct a value or `Option::none()` to record the absence of one.\npub struct Option<T> {\n _is_some: bool,\n _value: T,\n}\n\nimpl<T> Option<T> {\n /// Constructs a None value\n pub fn none() -> Self {\n Self { _is_some: false, _value: crate::mem::zeroed() }\n }\n\n /// Constructs a Some wrapper around the given value\n pub fn some(_value: T) -> Self {\n Self { _is_some: true, _value }\n }\n\n /// True if this Option is None\n pub fn is_none(&self) -> bool {\n !self._is_some\n }\n\n /// True if this Option is Some\n pub fn is_some(&self) -> bool {\n self._is_some\n }\n\n /// Asserts `self.is_some()` and returns the wrapped value.\n pub fn unwrap(self) -> T {\n assert(self._is_some);\n self._value\n }\n\n /// Returns the inner value without asserting `self.is_some()`\n /// Note that if `self` is `None`, there is no guarantee what value will be returned,\n /// only that it will be of type `T`.\n pub fn unwrap_unchecked(self) -> T {\n self._value\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, returns the given default value.\n pub fn unwrap_or(self, default: T) -> T {\n if self._is_some {\n self._value\n } else {\n default\n }\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, calls the given function to return\n /// a default value.\n pub fn unwrap_or_else<Env>(self, default: fn[Env]() -> T) -> T {\n if self._is_some {\n self._value\n } else {\n default()\n }\n }\n\n /// Asserts `self.is_some()` with a provided custom message and returns the contained `Some` value\n pub fn expect<let N: u32, MessageTypes>(self, message: fmtstr<N, MessageTypes>) -> T {\n assert(self.is_some(), message);\n self._value\n }\n\n /// If self is `Some(x)`, this returns `Some(f(x))`. Otherwise, this returns `None`.\n pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> Option<U> {\n if self._is_some {\n Option::some(f(self._value))\n } else {\n Option::none()\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns the given default value.\n pub fn map_or<U, Env>(self, default: U, f: fn[Env](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns `default()`.\n pub fn map_or_else<U, Env1, Env2>(self, default: fn[Env1]() -> U, f: fn[Env2](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default()\n }\n }\n\n /// Returns None if self is None. Otherwise, this returns `other`.\n pub fn and(self, other: Self) -> Self {\n if self.is_none() {\n Option::none()\n } else {\n other\n }\n }\n\n /// If self is None, this returns None. Otherwise, this calls the given function\n /// with the Some value contained within self, and returns the result of that call.\n ///\n /// In some languages this function is called `flat_map` or `bind`.\n pub fn and_then<U, Env>(self, f: fn[Env](T) -> Option<U>) -> Option<U> {\n if self._is_some {\n f(self._value)\n } else {\n Option::none()\n }\n }\n\n /// If self is Some, return self. Otherwise, return `other`.\n pub fn or(self, other: Self) -> Self {\n if self._is_some {\n self\n } else {\n other\n }\n }\n\n /// If self is Some, return self. Otherwise, return `default()`.\n pub fn or_else<Env>(self, default: fn[Env]() -> Self) -> Self {\n if self._is_some {\n self\n } else {\n default()\n }\n }\n\n // If only one of the two Options is Some, return that option.\n // Otherwise, if both options are Some or both are None, None is returned.\n pub fn xor(self, other: Self) -> Self {\n if self._is_some {\n if other._is_some {\n Option::none()\n } else {\n self\n }\n } else if other._is_some {\n other\n } else {\n Option::none()\n }\n }\n\n /// Returns `Some(x)` if self is `Some(x)` and `predicate(x)` is true.\n /// Otherwise, this returns `None`\n pub fn filter<Env>(self, predicate: fn[Env](T) -> bool) -> Self {\n if self._is_some {\n if predicate(self._value) {\n self\n } else {\n Option::none()\n }\n } else {\n Option::none()\n }\n }\n\n /// Flattens an Option<Option<T>> into a Option<T>.\n /// This returns None if the outer Option is None. Otherwise, this returns the inner Option.\n pub fn flatten(option: Option<Option<T>>) -> Option<T> {\n if option._is_some {\n option._value\n } else {\n Option::none()\n }\n }\n}\n\nimpl<T> Default for Option<T> {\n fn default() -> Self {\n Option::none()\n }\n}\n\nimpl<T> Eq for Option<T>\nwhere\n T: Eq,\n{\n fn eq(self, other: Self) -> bool {\n if self._is_some == other._is_some {\n if self._is_some {\n self._value == other._value\n } else {\n true\n }\n } else {\n false\n }\n }\n}\n\nimpl<T> Hash for Option<T>\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self._is_some.hash(state);\n if self._is_some {\n self._value.hash(state);\n }\n }\n}\n\n// For this impl we're declaring Option::none < Option::some\nimpl<T> Ord for Option<T>\nwhere\n T: Ord,\n{\n fn cmp(self, other: Self) -> Ordering {\n if self._is_some {\n if other._is_some {\n self._value.cmp(other._value)\n } else {\n Ordering::greater()\n }\n } else if other._is_some {\n Ordering::less()\n } else {\n Ordering::equal()\n }\n }\n}\n"
5829
5791
  },
5830
5792
  "410": {
5831
- "function_locations": [
5832
- {
5833
- "name": "derive_serialize",
5834
- "start": 3042
5835
- },
5836
- {
5837
- "name": "derive_deserialize",
5838
- "start": 7256
5839
- },
5840
- {
5841
- "name": "get_params_len_quote",
5842
- "start": 10978
5843
- },
5844
- {
5845
- "name": "get_generics_declarations",
5846
- "start": 11437
5847
- },
5848
- {
5849
- "name": "get_where_trait_clause",
5850
- "start": 12519
5851
- }
5852
- ],
5853
- "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/serialization.nr",
5854
- "source": "use crate::{reader::Reader, writer::Writer};\n\n// docs:start:serialize\n/// Trait for serializing Noir types into arrays of Fields.\n///\n/// An implementation of the Serialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait (and Deserialize) are\n/// typically used to communicate between Noir and TypeScript (via oracles and function arguments).\n///\n/// # On Following Noir's Intrinsic Serialization\n/// When calling a Noir function from TypeScript (TS), first the function arguments are serialized into an array\n/// of fields. This array is then included in the initial witness. Noir's intrinsic serialization is then used\n/// to deserialize the arguments from the witness. When the same Noir function is called from Noir this Serialize trait\n/// is used instead of the serialization in TS. For this reason we need to have a match between TS serialization,\n/// Noir's intrinsic serialization and the implementation of this trait. If there is a mismatch, the function calls\n/// fail with an arguments hash mismatch error message.\n///\n/// # Associated Constants\n/// * `N` - The length of the output Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let N: u32> Serialize for str<N> {\n/// let N: u32 = N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// let bytes = self.as_bytes();\n/// for i in 0..bytes.len() {\n/// writer.write(bytes[i] as Field);\n/// }\n/// }\n/// }\n/// ```\n#[derive_via(derive_serialize)]\npub trait Serialize {\n let N: u32;\n\n fn serialize(self) -> [Field; Self::N];\n\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>);\n}\n\n/// Generates a `Serialize` trait implementation for a struct type.\n///\n/// # Parameters\n/// - `s`: The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A quoted code block containing the trait implementation\n///\n/// # Example\n/// For a struct defined as:\n/// ```\n/// struct Log<N> {\n/// fields: [Field; N],\n/// length: u32\n/// }\n/// ```\n///\n/// This function generates code equivalent to:\n/// ```\n/// impl<let N: u32> Serialize for Log<N> {\n/// let N: u32 = <[Field; N] as Serialize>::N + <u32 as Serialize>::N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// #[inline_always]\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// Serialize::stream_serialize(self.fields, writer);\n/// Serialize::stream_serialize(self.length, writer);\n/// }\n/// }\n/// ```\npub comptime fn derive_serialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n\n // We care only about the name and type so we drop the last item of the tuple\n let params = nested_struct.0.fields(nested_struct.1).map(|(name, typ, _)| (name, typ));\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Serialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_serialize_clause = get_where_trait_clause(s, quote {Serialize});\n\n let params_len_quote = get_params_len_quote(params);\n\n let function_body = params\n .map(|(name, _typ): (Quoted, Type)| {\n quote {\n $crate::serialization::Serialize::stream_serialize(self.$name, writer);\n }\n })\n .join(quote {});\n\n quote {\n impl$generics_declarations $crate::serialization::Serialize for $typ\n $where_serialize_clause\n {\n let N: u32 = $params_len_quote;\n\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: $crate::writer::Writer<Self::N> = $crate::writer::Writer::new();\n $crate::serialization::Serialize::stream_serialize(self, &mut writer);\n writer.finish()\n }\n\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut $crate::writer::Writer<K>) {\n $function_body\n }\n }\n }\n}\n\n// docs:start:deserialize\n/// Trait for deserializing Noir types from arrays of Fields.\n///\n/// An implementation of the Deserialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait is typically used when\n/// deserializing return values from function calls in Noir. Since the same function could be called from TypeScript\n/// (TS), in which case the TS deserialization would get used, we need to have a match between the 2.\n///\n/// # Associated Constants\n/// * `N` - The length of the input Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let M: u32> Deserialize for str<M> {\n/// let N: u32 = M;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let mut bytes = [0 as u8; M];\n/// for i in 0..M {\n/// bytes[i] = reader.read() as u8;\n/// }\n/// str::<M>::from(bytes)\n/// }\n/// }\n/// ```\n#[derive_via(derive_deserialize)]\npub trait Deserialize {\n let N: u32;\n\n fn deserialize(fields: [Field; Self::N]) -> Self;\n\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self;\n}\n\n/// Generates a `Deserialize` trait implementation for a given struct `s`.\n///\n/// # Arguments\n/// * `s` - The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A `Quoted` block containing the generated trait implementation\n///\n/// # Requirements\n/// Each struct member type must implement the `Deserialize` trait (it gets used in the generated code).\n///\n/// # Example\n/// For a struct like:\n/// ```\n/// struct MyStruct {\n/// x: AztecAddress,\n/// y: Field,\n/// }\n/// ```\n///\n/// This generates:\n/// ```\n/// impl Deserialize for MyStruct {\n/// let N: u32 = <AztecAddress as Deserialize>::N + <Field as Deserialize>::N;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// #[inline_always]\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let x = <AztecAddress as Deserialize>::stream_deserialize(reader);\n/// let y = <Field as Deserialize>::stream_deserialize(reader);\n/// Self { x, y }\n/// }\n/// }\n/// ```\npub comptime fn derive_deserialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n let params = nested_struct.0.fields(nested_struct.1);\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Deserialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_deserialize_clause = get_where_trait_clause(s, quote {Deserialize});\n\n // The following will give us:\n // <type_of_struct_member_1 as Deserialize>::N + <type_of_struct_member_2 as Deserialize>::N + ...\n // (or 0 if the struct has no members)\n let right_hand_side_of_definition_of_n = if params.len() > 0 {\n params\n .map(|(_, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n <$param_type as $crate::serialization::Deserialize>::N\n }\n })\n .join(quote {+})\n } else {\n quote {0}\n };\n\n // For structs containing a single member, we can enhance performance by directly deserializing the input array,\n // bypassing the need for loop-based array construction. While this optimization yields significant benefits in\n // Brillig where the loops are expected to not be optimized, it is not relevant in ACIR where the loops are\n // expected to be optimized away.\n let function_body = if params.len() > 1 {\n // This generates deserialization code for each struct member and concatenates them together.\n let deserialization_of_struct_members = params\n .map(|(param_name, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n let $param_name = <$param_type as Deserialize>::stream_deserialize(reader);\n }\n })\n .join(quote {});\n\n // We join the struct member names with a comma to be used in the `Self { ... }` syntax\n // This will give us e.g. `a, b, c` for a struct with three fields named `a`, `b`, and `c`.\n let struct_members = params\n .map(|(param_name, _, _): (Quoted, Type, Quoted)| quote { $param_name })\n .join(quote {,});\n\n quote {\n $deserialization_of_struct_members\n\n Self { $struct_members }\n }\n } else if params.len() == 1 {\n let param_name = params[0].0;\n quote {\n Self { $param_name: $crate::serialization::Deserialize::stream_deserialize(reader) }\n }\n } else {\n quote {\n Self {}\n }\n };\n\n quote {\n impl$generics_declarations $crate::serialization::Deserialize for $typ\n $where_deserialize_clause\n {\n let N: u32 = $right_hand_side_of_definition_of_n;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = $crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut $crate::reader::Reader<K>) -> Self {\n $function_body\n }\n }\n }\n}\n\n/// Generates a quoted expression that computes the total serialized length of function parameters.\n///\n/// # Parameters\n/// * `params` - An array of tuples where each tuple contains a quoted parameter name and its Type. The type needs\n/// to implement the Serialize trait.\n///\n/// # Returns\n/// A quoted expression that evaluates to:\n/// * `0` if there are no parameters\n/// * `(<type1 as Serialize>::N + <type2 as Serialize>::N + ...)` for one or more parameters\ncomptime fn get_params_len_quote(params: [(Quoted, Type)]) -> Quoted {\n if params.len() == 0 {\n quote { 0 }\n } else {\n let params_quote_without_parentheses = params\n .map(|(_, param_type): (Quoted, Type)| {\n quote {\n <$param_type as $crate::serialization::Serialize>::N\n }\n })\n .join(quote {+});\n quote { ($params_quote_without_parentheses) }\n }\n}\n\ncomptime fn get_generics_declarations(s: TypeDefinition) -> Quoted {\n let generics = s.generics();\n\n if generics.len() > 0 {\n let generics_declarations_items = generics\n .map(|(name, maybe_integer_typ)| {\n // The second item in the generics tuple is an Option of an integer type that is Some only if\n // the generic is numeric.\n if maybe_integer_typ.is_some() {\n // The generic is numeric, so we return a quote defined as e.g. \"let N: u32\"\n let integer_type = maybe_integer_typ.unwrap();\n quote {let $name: $integer_type}\n } else {\n // The generic is not numeric, so we return a quote containing the name of the generic (e.g. \"T\")\n quote {$name}\n }\n })\n .join(quote {,});\n quote {<$generics_declarations_items>}\n } else {\n // The struct doesn't have any generics defined, so we just return an empty quote.\n quote {}\n }\n}\n\ncomptime fn get_where_trait_clause(s: TypeDefinition, trait_name: Quoted) -> Quoted {\n let generics = s.generics();\n\n // The second item in the generics tuple is an Option of an integer type that is Some only if the generic is\n // numeric.\n let non_numeric_generics =\n generics.filter(|(_, maybe_integer_typ)| maybe_integer_typ.is_none());\n\n if non_numeric_generics.len() > 0 {\n let non_numeric_generics_declarations =\n non_numeric_generics.map(|(name, _)| quote {$name: $trait_name}).join(quote {,});\n quote {where $non_numeric_generics_declarations}\n } else {\n // There are no non-numeric generics, so we return an empty quote.\n quote {}\n }\n}\n"
5855
- },
5856
- "412": {
5857
5793
  "function_locations": [
5858
5794
  {
5859
5795
  "name": "<impl Serialize for bool>::serialize",
@@ -6183,7 +6119,7 @@
6183
6119
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/type_impls.nr",
6184
6120
  "source": "use crate::{reader::Reader, serialization::{Deserialize, Serialize}, writer::Writer};\nuse std::embedded_curve_ops::EmbeddedCurvePoint;\nuse std::embedded_curve_ops::EmbeddedCurveScalar;\n\nglobal U1_SERIALIZED_LEN: u32 = 1;\nglobal BOOL_SERIALIZED_LEN: u32 = 1;\nglobal U8_SERIALIZED_LEN: u32 = 1;\nglobal U16_SERIALIZED_LEN: u32 = 1;\nglobal U32_SERIALIZED_LEN: u32 = 1;\nglobal U64_SERIALIZED_LEN: u32 = 1;\nglobal U128_SERIALIZED_LEN: u32 = 1;\nglobal FIELD_SERIALIZED_LEN: u32 = 1;\nglobal I8_SERIALIZED_LEN: u32 = 1;\nglobal I16_SERIALIZED_LEN: u32 = 1;\nglobal I32_SERIALIZED_LEN: u32 = 1;\nglobal I64_SERIALIZED_LEN: u32 = 1;\n\nimpl Serialize for bool {\n let N: u32 = BOOL_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for bool {\n let N: u32 = BOOL_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> bool {\n reader.read() != 0\n }\n}\n\nimpl Serialize for u1 {\n let N: u32 = U1_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u1 {\n let N: u32 = U1_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u1\n }\n}\n\nimpl Serialize for u8 {\n let N: u32 = U8_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u8 {\n let N: u32 = U8_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u8\n }\n}\n\nimpl Serialize for u16 {\n let N: u32 = U16_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u16 {\n let N: u32 = U16_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u16\n }\n}\n\nimpl Serialize for u32 {\n let N: u32 = U32_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u32 {\n let N: u32 = U32_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u32\n }\n}\n\nimpl Serialize for u64 {\n let N: u32 = U64_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u64 {\n let N: u32 = U64_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u64\n }\n}\n\nimpl Serialize for u128 {\n let N: u32 = U128_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u128 {\n let N: u32 = U128_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u128\n }\n}\n\nimpl Serialize for Field {\n let N: u32 = FIELD_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self);\n }\n}\n\nimpl Deserialize for Field {\n let N: u32 = FIELD_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read()\n }\n}\n\nimpl Serialize for i8 {\n let N: u32 = I8_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u8 as Field);\n }\n}\n\nimpl Deserialize for i8 {\n let N: u32 = I8_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u8 as i8\n }\n}\n\nimpl Serialize for i16 {\n let N: u32 = I16_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u16 as Field);\n }\n}\n\nimpl Deserialize for i16 {\n let N: u32 = I16_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u16 as i16\n }\n}\n\nimpl Serialize for i32 {\n let N: u32 = I32_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u32 as Field);\n }\n}\n\nimpl Deserialize for i32 {\n let N: u32 = I32_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u32 as i32\n }\n}\n\nimpl Serialize for i64 {\n let N: u32 = I64_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u64 as Field);\n }\n}\n\nimpl Deserialize for i64 {\n let N: u32 = I64_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u64 as i64\n }\n}\n\nimpl<T, let M: u32> Serialize for [T; M]\nwhere\n T: Serialize,\n{\n let N: u32 = <T as Serialize>::N * M;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n for i in 0..M {\n self[i].stream_serialize(writer);\n }\n }\n}\n\nimpl<T, let M: u32> Deserialize for [T; M]\nwhere\n T: Deserialize,\n{\n let N: u32 = <T as Deserialize>::N * M;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n let mut result: [T; M] = std::mem::zeroed();\n for i in 0..M {\n result[i] = T::stream_deserialize(reader);\n }\n result\n }\n}\n\nimpl<T> Serialize for Option<T>\nwhere\n T: Serialize,\n{\n let N: u32 = <T as Serialize>::N + 1;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write_bool(self.is_some());\n if self.is_some() {\n self.unwrap_unchecked().stream_serialize(writer);\n } else {\n writer.advance_offset(<T as Serialize>::N);\n }\n }\n}\n\nimpl<T> Deserialize for Option<T>\nwhere\n T: Deserialize,\n{\n let N: u32 = <T as Deserialize>::N + 1;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n if reader.read_bool() {\n Option::some(<T as Deserialize>::stream_deserialize(reader))\n } else {\n reader.advance_offset(<T as Deserialize>::N);\n Option::none()\n }\n }\n}\n\nglobal SCALAR_SIZE: u32 = 2;\n\nimpl Serialize for EmbeddedCurveScalar {\n\n let N: u32 = SCALAR_SIZE;\n\n fn serialize(self) -> [Field; SCALAR_SIZE] {\n [self.lo, self.hi]\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self.lo);\n writer.write(self.hi);\n }\n}\n\nimpl Deserialize for EmbeddedCurveScalar {\n let N: u32 = SCALAR_SIZE;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n Self { lo: fields[0], hi: fields[1] }\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n Self { lo: reader.read(), hi: reader.read() }\n }\n}\n\nglobal POINT_SIZE: u32 = 3;\n\nimpl Serialize for EmbeddedCurvePoint {\n let N: u32 = POINT_SIZE;\n\n fn serialize(self) -> [Field; Self::N] {\n [self.x, self.y, self.is_infinite as Field]\n }\n\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self.x);\n writer.write(self.y);\n writer.write(self.is_infinite as Field);\n }\n}\n\nimpl Deserialize for EmbeddedCurvePoint {\n let N: u32 = POINT_SIZE;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n Self { x: fields[0], y: fields[1], is_infinite: fields[2] != 0 }\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n Self { x: reader.read(), y: reader.read(), is_infinite: reader.read_bool() }\n }\n}\n\nimpl<let M: u32> Deserialize for str<M> {\n let N: u32 = M;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n let u8_arr = <[u8; Self::N] as Deserialize>::stream_deserialize(reader);\n str::<Self::N>::from(u8_arr)\n }\n}\n\nimpl<let M: u32> Serialize for str<M> {\n let N: u32 = M;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n self.as_bytes().stream_serialize(writer);\n }\n}\n\n// Note: Not deriving this because it's not supported to call derive_serialize on a \"remote\" struct (and it will never\n// be supported).\nimpl<T, let M: u32> Deserialize for BoundedVec<T, M>\nwhere\n T: Deserialize,\n{\n let N: u32 = <T as Deserialize>::N * M + 1;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n let mut new_bounded_vec: BoundedVec<T, M> = BoundedVec::new();\n let payload_len = Self::N - 1;\n\n // Length is stored in the last field as we need to match intrinsic Noir serialization and the `len` struct\n // field is after `storage` struct field (see `bounded_vec.nr` in noir-stdlib)\n let len = reader.peek_offset(payload_len) as u32;\n\n for i in 0..M {\n if i < len {\n new_bounded_vec.push(<T as Deserialize>::stream_deserialize(reader));\n }\n }\n\n // +1 for the length of the BoundedVec\n reader.advance_offset((M - len) * <T as Deserialize>::N + 1);\n\n new_bounded_vec\n }\n}\n\n// This may cause issues if used as program input, because noir disallows empty arrays for program input.\n// I think this is okay because I don't foresee a unit type being used as input. But leaving this comment as a hint\n// if someone does run into this in the future.\nimpl Deserialize for () {\n let N: u32 = 0;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(_reader: &mut Reader<K>) -> Self {\n ()\n }\n}\n\n// Note: Not deriving this because it's not supported to call derive_serialize on a \"remote\" struct (and it will never\n// be supported).\nimpl<T, let M: u32> Serialize for BoundedVec<T, M>\nwhere\n T: Serialize,\n{\n let N: u32 = <T as Serialize>::N * M + 1; // +1 for the length of the BoundedVec\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n self.storage().stream_serialize(writer);\n // Length is stored in the last field as we need to match intrinsic Noir serialization and the `len` struct\n // field is after `storage` struct field (see `bounded_vec.nr` in noir-stdlib)\n writer.write_u32(self.len() as u32);\n }\n}\n\n// Create a slice of the given length with each element made from `f(i)` where `i` is the current index\ncomptime fn make_slice<Env, T>(length: u32, f: fn[Env](u32) -> T) -> [T] {\n let mut slice = @[];\n for i in 0..length {\n slice = slice.push_back(f(i));\n }\n slice\n}\n\n// Implements Serialize and Deserialize for an arbitrary tuple type\ncomptime fn impl_serialize_for_tuple(_m: Module, length: u32) -> Quoted {\n // `T0`, `T1`, `T2`\n let type_names = make_slice(length, |i| f\"T{i}\".quoted_contents());\n\n // `result0`, `result1`, `result2`\n let result_names = make_slice(length, |i| f\"result{i}\".quoted_contents());\n\n // `T0, T1, T2`\n let field_generics = type_names.join(quote [,]);\n\n // `<T0 as Serialize>::N + <T1 as Serialize>::N + <T2 as Serialize>::N`\n let full_size_serialize = type_names\n .map(|type_name| quote {\n <$type_name as Serialize>::N\n })\n .join(quote [+]);\n\n // `<T0 as Deserialize>::N + <T1 as Deserialize>::N + <T2 as Deserialize>::N`\n let full_size_deserialize = type_names\n .map(|type_name| quote {\n <$type_name as Deserialize>::N\n })\n .join(quote [+]);\n\n // `T0: Serialize, T1: Serialize, T2: Serialize,`\n let serialize_constraints = type_names\n .map(|field_name| quote {\n $field_name: Serialize,\n })\n .join(quote []);\n\n // `T0: Deserialize, T1: Deserialize, T2: Deserialize,`\n let deserialize_constraints = type_names\n .map(|field_name| quote {\n $field_name: Deserialize,\n })\n .join(quote []);\n\n // Statements to serialize each field\n let serialized_fields = type_names\n .mapi(|i, _type_name| quote {\n $crate::serialization::Serialize::stream_serialize(self.$i, writer);\n })\n .join(quote []);\n\n // Statements to deserialize each field\n let deserialized_fields = type_names\n .mapi(|i, type_name| {\n let result_name = result_names[i];\n quote {\n let $result_name = <$type_name as $crate::serialization::Deserialize>::stream_deserialize(reader);\n }\n })\n .join(quote []);\n let deserialize_results = result_names.join(quote [,]);\n\n quote {\n impl<$field_generics> Serialize for ($field_generics) where $serialize_constraints {\n let N: u32 = $full_size_serialize;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: $crate::writer::Writer<Self::N> = $crate::writer::Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut $crate::writer::Writer<K>) {\n\n $serialized_fields\n }\n }\n\n impl<$field_generics> Deserialize for ($field_generics) where $deserialize_constraints {\n let N: u32 = $full_size_deserialize;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = $crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n \n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut $crate::reader::Reader<K>) -> Self {\n $deserialized_fields\n ($deserialize_results)\n }\n }\n }\n}\n\n// Keeping these manual impls. They are more efficient since they do not\n// require copying sub-arrays from any serialized arrays.\nimpl<T1> Serialize for (T1,)\nwhere\n T1: Serialize,\n{\n let N: u32 = <T1 as Serialize>::N;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: crate::writer::Writer<Self::N> = crate::writer::Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n self.0.stream_serialize(writer);\n }\n}\n\nimpl<T1> Deserialize for (T1,)\nwhere\n T1: Deserialize,\n{\n let N: u32 = <T1 as Deserialize>::N;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n (<T1 as Deserialize>::stream_deserialize(reader),)\n }\n}\n\n#[impl_serialize_for_tuple(2)]\n#[impl_serialize_for_tuple(3)]\n#[impl_serialize_for_tuple(4)]\n#[impl_serialize_for_tuple(5)]\n#[impl_serialize_for_tuple(6)]\nmod impls {\n use crate::serialization::{Deserialize, Serialize};\n}\n\n#[test]\nunconstrained fn bounded_vec_serialization() {\n // Test empty BoundedVec\n let empty_vec: BoundedVec<Field, 3> = BoundedVec::from_array([]);\n let serialized = empty_vec.serialize();\n let deserialized = BoundedVec::<Field, 3>::deserialize(serialized);\n assert_eq(empty_vec, deserialized);\n assert_eq(deserialized.len(), 0);\n\n // Test partially filled BoundedVec\n let partial_vec: BoundedVec<[u32; 2], 3> = BoundedVec::from_array([[1, 2]]);\n let serialized = partial_vec.serialize();\n let deserialized = BoundedVec::<[u32; 2], 3>::deserialize(serialized);\n assert_eq(partial_vec, deserialized);\n assert_eq(deserialized.len(), 1);\n assert_eq(deserialized.get(0), [1, 2]);\n\n // Test full BoundedVec\n let full_vec: BoundedVec<[u32; 2], 3> = BoundedVec::from_array([[1, 2], [3, 4], [5, 6]]);\n let serialized = full_vec.serialize();\n let deserialized = BoundedVec::<[u32; 2], 3>::deserialize(serialized);\n assert_eq(full_vec, deserialized);\n assert_eq(deserialized.len(), 3);\n assert_eq(deserialized.get(0), [1, 2]);\n assert_eq(deserialized.get(1), [3, 4]);\n assert_eq(deserialized.get(2), [5, 6]);\n}\n"
6185
6121
  },
6186
- "413": {
6122
+ "411": {
6187
6123
  "function_locations": [
6188
6124
  {
6189
6125
  "name": "Writer<N>::new",
@@ -6727,491 +6663,515 @@
6727
6663
  },
6728
6664
  {
6729
6665
  "name": "BoundedVec<T, MaxLen>::from_array",
6730
- "start": 11594
6666
+ "start": 13074
6731
6667
  },
6732
6668
  {
6733
6669
  "name": "BoundedVec<T, MaxLen>::pop",
6734
- "start": 12337
6670
+ "start": 13817
6735
6671
  },
6736
6672
  {
6737
6673
  "name": "BoundedVec<T, MaxLen>::any",
6738
- "start": 12960
6674
+ "start": 14440
6739
6675
  },
6740
6676
  {
6741
6677
  "name": "BoundedVec<T, MaxLen>::map",
6742
- "start": 13876
6678
+ "start": 15356
6743
6679
  },
6744
6680
  {
6745
6681
  "name": "BoundedVec<T, MaxLen>::mapi",
6746
- "start": 14811
6682
+ "start": 16356
6747
6683
  },
6748
6684
  {
6749
6685
  "name": "BoundedVec<T, MaxLen>::for_each",
6750
- "start": 15704
6686
+ "start": 17314
6751
6687
  },
6752
6688
  {
6753
6689
  "name": "BoundedVec<T, MaxLen>::for_eachi",
6754
- "start": 16509
6690
+ "start": 18119
6755
6691
  },
6756
6692
  {
6757
6693
  "name": "BoundedVec<T, MaxLen>::from_parts",
6758
- "start": 17508
6694
+ "start": 19118
6759
6695
  },
6760
6696
  {
6761
6697
  "name": "BoundedVec<T, MaxLen>::from_parts_unchecked",
6762
- "start": 19157
6698
+ "start": 20767
6763
6699
  },
6764
6700
  {
6765
6701
  "name": "<impl Eq for BoundedVec<T, MaxLen>>::eq",
6766
- "start": 19369
6702
+ "start": 20979
6767
6703
  },
6768
6704
  {
6769
6705
  "name": "<impl From<[T; Len]> for BoundedVec<T, MaxLen>>::from",
6770
- "start": 19940
6706
+ "start": 21550
6771
6707
  },
6772
6708
  {
6773
6709
  "name": "bounded_vec_tests::get::panics_when_reading_elements_past_end_of_vec",
6774
- "start": 20223
6710
+ "start": 21833
6775
6711
  },
6776
6712
  {
6777
6713
  "name": "bounded_vec_tests::get::panics_when_reading_beyond_length",
6778
- "start": 20458
6714
+ "start": 22068
6779
6715
  },
6780
6716
  {
6781
6717
  "name": "bounded_vec_tests::get::get_works_within_bounds",
6782
- "start": 20633
6718
+ "start": 22243
6783
6719
  },
6784
6720
  {
6785
6721
  "name": "bounded_vec_tests::get::get_unchecked_works",
6786
- "start": 20892
6722
+ "start": 22502
6787
6723
  },
6788
6724
  {
6789
6725
  "name": "bounded_vec_tests::get::get_unchecked_works_past_len",
6790
- "start": 21136
6726
+ "start": 22746
6791
6727
  },
6792
6728
  {
6793
6729
  "name": "bounded_vec_tests::set::set_updates_values_properly",
6794
- "start": 21409
6730
+ "start": 23019
6795
6731
  },
6796
6732
  {
6797
6733
  "name": "bounded_vec_tests::set::panics_when_writing_elements_past_end_of_vec",
6798
- "start": 22047
6734
+ "start": 23657
6799
6735
  },
6800
6736
  {
6801
6737
  "name": "bounded_vec_tests::set::panics_when_setting_beyond_length",
6802
- "start": 22282
6738
+ "start": 23892
6803
6739
  },
6804
6740
  {
6805
6741
  "name": "bounded_vec_tests::set::set_unchecked_operations",
6806
- "start": 22457
6742
+ "start": 24067
6807
6743
  },
6808
6744
  {
6809
6745
  "name": "bounded_vec_tests::set::set_unchecked_operations_past_len",
6810
- "start": 22789
6746
+ "start": 24399
6811
6747
  },
6812
6748
  {
6813
6749
  "name": "bounded_vec_tests::set::set_preserves_other_elements",
6814
- "start": 23053
6750
+ "start": 24663
6815
6751
  },
6816
6752
  {
6817
6753
  "name": "bounded_vec_tests::any::returns_false_if_predicate_not_satisfied",
6818
- "start": 23521
6754
+ "start": 25131
6819
6755
  },
6820
6756
  {
6821
6757
  "name": "bounded_vec_tests::any::returns_true_if_predicate_satisfied",
6822
- "start": 23775
6758
+ "start": 25385
6823
6759
  },
6824
6760
  {
6825
6761
  "name": "bounded_vec_tests::any::returns_false_on_empty_boundedvec",
6826
- "start": 24024
6762
+ "start": 25634
6827
6763
  },
6828
6764
  {
6829
6765
  "name": "bounded_vec_tests::any::any_with_complex_predicates",
6830
- "start": 24235
6766
+ "start": 25845
6831
6767
  },
6832
6768
  {
6833
6769
  "name": "bounded_vec_tests::any::any_with_partial_vector",
6834
- "start": 24598
6770
+ "start": 26208
6835
6771
  },
6836
6772
  {
6837
6773
  "name": "bounded_vec_tests::map::applies_function_correctly",
6838
- "start": 24985
6774
+ "start": 26595
6839
6775
  },
6840
6776
  {
6841
6777
  "name": "bounded_vec_tests::map::applies_function_that_changes_return_type",
6842
- "start": 25407
6778
+ "start": 27017
6843
6779
  },
6844
6780
  {
6845
6781
  "name": "bounded_vec_tests::map::does_not_apply_function_past_len",
6846
- "start": 25755
6782
+ "start": 27365
6847
6783
  },
6848
6784
  {
6849
6785
  "name": "bounded_vec_tests::map::map_with_conditional_logic",
6850
- "start": 26128
6786
+ "start": 27738
6851
6787
  },
6852
6788
  {
6853
6789
  "name": "bounded_vec_tests::map::map_preserves_length",
6854
- "start": 26452
6790
+ "start": 28062
6855
6791
  },
6856
6792
  {
6857
6793
  "name": "bounded_vec_tests::map::map_on_empty_vector",
6858
- "start": 26744
6794
+ "start": 28354
6859
6795
  },
6860
6796
  {
6861
6797
  "name": "bounded_vec_tests::mapi::applies_function_correctly",
6862
- "start": 27118
6798
+ "start": 28728
6863
6799
  },
6864
6800
  {
6865
6801
  "name": "bounded_vec_tests::mapi::applies_function_that_changes_return_type",
6866
- "start": 27551
6802
+ "start": 29161
6867
6803
  },
6868
6804
  {
6869
6805
  "name": "bounded_vec_tests::mapi::does_not_apply_function_past_len",
6870
- "start": 27908
6806
+ "start": 29518
6871
6807
  },
6872
6808
  {
6873
6809
  "name": "bounded_vec_tests::mapi::mapi_with_index_branching_logic",
6874
- "start": 28290
6810
+ "start": 29900
6875
6811
  },
6876
6812
  {
6877
6813
  "name": "bounded_vec_tests::for_each::for_each_map",
6878
- "start": 28849
6814
+ "start": 30459
6879
6815
  },
6880
6816
  {
6881
6817
  "name": "bounded_vec_tests::for_each::smoke_test",
6882
- "start": 29079
6818
+ "start": 30689
6883
6819
  },
6884
6820
  {
6885
6821
  "name": "bounded_vec_tests::for_each::applies_function_correctly",
6886
- "start": 29487
6822
+ "start": 31097
6887
6823
  },
6888
6824
  {
6889
6825
  "name": "bounded_vec_tests::for_each::applies_function_that_changes_return_type",
6890
- "start": 29821
6826
+ "start": 31431
6891
6827
  },
6892
6828
  {
6893
6829
  "name": "bounded_vec_tests::for_each::does_not_apply_function_past_len",
6894
- "start": 30179
6830
+ "start": 31789
6895
6831
  },
6896
6832
  {
6897
6833
  "name": "bounded_vec_tests::for_each::for_each_on_empty_vector",
6898
- "start": 30560
6834
+ "start": 32170
6899
6835
  },
6900
6836
  {
6901
6837
  "name": "bounded_vec_tests::for_each::for_each_with_side_effects",
6902
- "start": 30846
6838
+ "start": 32456
6903
6839
  },
6904
6840
  {
6905
6841
  "name": "bounded_vec_tests::for_eachi::for_eachi_mapi",
6906
- "start": 31403
6842
+ "start": 33013
6907
6843
  },
6908
6844
  {
6909
6845
  "name": "bounded_vec_tests::for_eachi::smoke_test",
6910
- "start": 31640
6846
+ "start": 33250
6911
6847
  },
6912
6848
  {
6913
6849
  "name": "bounded_vec_tests::for_eachi::applies_function_correctly",
6914
- "start": 32096
6850
+ "start": 33706
6915
6851
  },
6916
6852
  {
6917
6853
  "name": "bounded_vec_tests::for_eachi::applies_function_that_changes_return_type",
6918
- "start": 32440
6854
+ "start": 34050
6919
6855
  },
6920
6856
  {
6921
6857
  "name": "bounded_vec_tests::for_eachi::does_not_apply_function_past_len",
6922
- "start": 32808
6858
+ "start": 34418
6923
6859
  },
6924
6860
  {
6925
6861
  "name": "bounded_vec_tests::for_eachi::for_eachi_on_empty_vector",
6926
- "start": 33195
6862
+ "start": 34805
6927
6863
  },
6928
6864
  {
6929
6865
  "name": "bounded_vec_tests::for_eachi::for_eachi_with_index_tracking",
6930
- "start": 33488
6866
+ "start": 35098
6931
6867
  },
6932
6868
  {
6933
6869
  "name": "bounded_vec_tests::from_array::empty",
6934
- "start": 33965
6870
+ "start": 35575
6935
6871
  },
6936
6872
  {
6937
6873
  "name": "bounded_vec_tests::from_array::equal_len",
6938
- "start": 34275
6874
+ "start": 35885
6939
6875
  },
6940
6876
  {
6941
6877
  "name": "bounded_vec_tests::from_array::max_len_greater_then_array_len",
6942
- "start": 34592
6878
+ "start": 36202
6943
6879
  },
6944
6880
  {
6945
6881
  "name": "bounded_vec_tests::from_array::max_len_lower_then_array_len",
6946
- "start": 35063
6882
+ "start": 36673
6947
6883
  },
6948
6884
  {
6949
6885
  "name": "bounded_vec_tests::from_array::from_array_preserves_order",
6950
- "start": 35206
6886
+ "start": 36816
6951
6887
  },
6952
6888
  {
6953
6889
  "name": "bounded_vec_tests::from_array::from_array_with_different_types",
6954
- "start": 35495
6890
+ "start": 37105
6955
6891
  },
6956
6892
  {
6957
6893
  "name": "bounded_vec_tests::trait_from::simple",
6958
- "start": 35932
6894
+ "start": 37542
6959
6895
  },
6960
6896
  {
6961
6897
  "name": "bounded_vec_tests::trait_eq::empty_equality",
6962
- "start": 36370
6898
+ "start": 37980
6963
6899
  },
6964
6900
  {
6965
6901
  "name": "bounded_vec_tests::trait_eq::inequality",
6966
- "start": 36619
6902
+ "start": 38229
6967
6903
  },
6968
6904
  {
6969
6905
  "name": "bounded_vec_tests::from_parts::from_parts",
6970
- "start": 37028
6906
+ "start": 38638
6971
6907
  },
6972
6908
  {
6973
6909
  "name": "bounded_vec_tests::from_parts::from_parts_unchecked",
6974
- "start": 37618
6910
+ "start": 39228
6975
6911
  },
6976
6912
  {
6977
6913
  "name": "bounded_vec_tests::push_pop::push_and_pop_operations",
6978
- "start": 38400
6914
+ "start": 40010
6979
6915
  },
6980
6916
  {
6981
6917
  "name": "bounded_vec_tests::push_pop::push_to_full_vector",
6982
- "start": 39026
6918
+ "start": 40636
6983
6919
  },
6984
6920
  {
6985
6921
  "name": "bounded_vec_tests::push_pop::pop_from_empty_vector",
6986
- "start": 39300
6922
+ "start": 40910
6987
6923
  },
6988
6924
  {
6989
6925
  "name": "bounded_vec_tests::push_pop::push_pop_cycle",
6990
- "start": 39469
6926
+ "start": 41079
6991
6927
  },
6992
6928
  {
6993
6929
  "name": "bounded_vec_tests::extend::extend_from_array",
6994
- "start": 40115
6930
+ "start": 41725
6995
6931
  },
6996
6932
  {
6997
6933
  "name": "bounded_vec_tests::extend::extend_from_vector",
6998
- "start": 40461
6934
+ "start": 42071
6999
6935
  },
7000
6936
  {
7001
6937
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec",
7002
- "start": 40825
6938
+ "start": 42435
6939
+ },
6940
+ {
6941
+ "name": "bounded_vec_tests::extend::extend_from_bounded_vec_limit",
6942
+ "start": 43056
6943
+ },
6944
+ {
6945
+ "name": "bounded_vec_tests::extend::extend_from_bounded_vec_full_and_empty",
6946
+ "start": 43570
6947
+ },
6948
+ {
6949
+ "name": "bounded_vec_tests::extend::extend_from_bounded_vec_zero_len",
6950
+ "start": 44074
6951
+ },
6952
+ {
6953
+ "name": "bounded_vec_tests::extend::extend_from_bounded_vec_last_zeroed",
6954
+ "start": 44368
6955
+ },
6956
+ {
6957
+ "name": "bounded_vec_tests::extend::extend_from_bounded_vec_empty_self",
6958
+ "start": 44793
6959
+ },
6960
+ {
6961
+ "name": "bounded_vec_tests::extend::extend_from_bounded_vec_equal_capacity",
6962
+ "start": 45360
7003
6963
  },
7004
6964
  {
7005
6965
  "name": "bounded_vec_tests::extend::extend_array_beyond_max_len",
7006
- "start": 41365
6966
+ "start": 45947
7007
6967
  },
7008
6968
  {
7009
6969
  "name": "bounded_vec_tests::extend::extend_vector_beyond_max_len",
7010
- "start": 41643
6970
+ "start": 46225
7011
6971
  },
7012
6972
  {
7013
6973
  "name": "bounded_vec_tests::extend::extend_bounded_vec_beyond_max_len",
7014
- "start": 41946
6974
+ "start": 46528
7015
6975
  },
7016
6976
  {
7017
6977
  "name": "bounded_vec_tests::extend::extend_with_empty_collections",
7018
- "start": 42232
6978
+ "start": 46814
7019
6979
  },
7020
6980
  {
7021
6981
  "name": "bounded_vec_tests::storage::storage_consistency",
7022
- "start": 42832
6982
+ "start": 47414
7023
6983
  },
7024
6984
  {
7025
6985
  "name": "bounded_vec_tests::storage::storage_after_pop",
7026
- "start": 43334
6986
+ "start": 47916
7027
6987
  },
7028
6988
  {
7029
6989
  "name": "bounded_vec_tests::storage::vector_immutable",
7030
- "start": 43652
6990
+ "start": 48234
7031
6991
  }
7032
6992
  ],
7033
6993
  "path": "std/collections/bounded_vec.nr",
7034
- "source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over vectors when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should always be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n ///\n /// This defaulting of `MaxLen` (and numeric generics in general) to zero may change in future noir versions\n /// but for now make sure to use type annotations when using bounded vectors. Otherwise, you will receive a\n /// constraint failure at runtime when the vec is pushed to.\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(&self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(&self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(&self) -> u32 {\n self.len\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: &BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(&self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given vector to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n for i in 0..Len {\n if i < append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0, \"cannot pop from an empty vector\");\n self.len -= 1;\n\n let elem = self.storage[self.len];\n self.storage[self.len] = crate::mem::zeroed();\n elem\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function will zero out any elements at or past index `len` of `array`.\n /// This incurs an extra runtime cost of O(MaxLen). If you are sure your array is\n /// zeroed after that index, you can use [`from_parts_unchecked`][Self::from_parts_unchecked] to remove the extra loop.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n let zeroed = crate::mem::zeroed();\n\n if is_unconstrained() {\n for i in len..MaxLen {\n array[i] = zeroed;\n }\n } else {\n for i in 0..MaxLen {\n if i >= len {\n array[i] = zeroed;\n }\n }\n }\n\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n // TODO: https://github.com/noir-lang/noir/issues/4837\n //\n // We make the assumption that the user has used the proper interface for working with `BoundedVec`s\n // rather than directly manipulating the internal fields as this can result in an inconsistent internal state.\n if self.len == other.len {\n self.storage == other.storage\n } else {\n false\n }\n }\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 0);\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\n\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n\n #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n bounded_vec1.push(1);\n bounded_vec2.push(2);\n\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are zeroed out, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n\n #[test]\n fn from_parts_unchecked() {\n // docs:start:from-parts-unchecked\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // invalid use!\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n\n // both vecs have length 3 so we'd expect them to be equal, but this\n // fails because elements past the length are still checked in eq\n assert(vec1 != vec2);\n // docs:end:from-parts-unchecked\n }\n }\n\n mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec() {\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 3> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be zeroed\n assert_eq(vec.storage(), [1, 2, 0]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n"
6994
+ "source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over vectors when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should always be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n ///\n /// This defaulting of `MaxLen` (and numeric generics in general) to zero may change in future noir versions\n /// but for now make sure to use type annotations when using bounded vectors. Otherwise, you will receive a\n /// constraint failure at runtime when the vec is pushed to.\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(&self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(&self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(&self) -> u32 {\n self.len\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: &BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(&self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given vector to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n // The source vector can be longer than the destination, or vice versa;\n // regardless we will only ever be able to read or write whichever is\n // the shorter max length of the two. We asserted that the actual content fits,\n // but the capacity of the source vector could be higher.\n let max = crate::cmp::min(Len, MaxLen);\n\n // Save the last item in case we have to do a fixup on an already full array.\n let last = if MaxLen > 0 {\n self.storage[MaxLen - 1]\n } else {\n crate::mem::zeroed()\n };\n\n for src in 0..max {\n // Since we are iterating to the static capacity of the arrays,\n // the destination could be out of bounds. If that's the case,\n // overwrite the last item, which we'll fixup in the end.\n // NB using cmp::min resulted in more opcodes here.\n let mut dst = self.len + src;\n if dst >= MaxLen { dst = MaxLen - 1; };\n // Assigning the source or zeroed to avoid having to merge arrays in SSA.\n self.storage[dst] = if src < append_len {\n vec.get_unchecked(src)\n } else {\n last\n }\n }\n\n // Fixup the last item if we have to.\n if MaxLen > 0 {\n self.storage[MaxLen - 1] = if (self.len + append_len == MaxLen) & (append_len > 0) {\n vec.get_unchecked(append_len - 1)\n } else {\n last\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0, \"cannot pop from an empty vector\");\n self.len -= 1;\n\n let elem = self.storage[self.len];\n self.storage[self.len] = crate::mem::zeroed();\n elem\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(i, self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function will zero out any elements at or past index `len` of `array`.\n /// This incurs an extra runtime cost of O(MaxLen). If you are sure your array is\n /// zeroed after that index, you can use [`from_parts_unchecked`][Self::from_parts_unchecked] to remove the extra loop.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n let zeroed = crate::mem::zeroed();\n\n if is_unconstrained() {\n for i in len..MaxLen {\n array[i] = zeroed;\n }\n } else {\n for i in 0..MaxLen {\n if i >= len {\n array[i] = zeroed;\n }\n }\n }\n\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n // TODO: https://github.com/noir-lang/noir/issues/4837\n //\n // We make the assumption that the user has used the proper interface for working with `BoundedVec`s\n // rather than directly manipulating the internal fields as this can result in an inconsistent internal state.\n if self.len == other.len {\n self.storage == other.storage\n } else {\n false\n }\n }\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 0);\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\n\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n\n #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n bounded_vec1.push(1);\n bounded_vec2.push(2);\n\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are zeroed out, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n\n #[test]\n fn from_parts_unchecked() {\n // docs:start:from-parts-unchecked\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // invalid use!\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n\n // both vecs have length 3 so we'd expect them to be equal, but this\n // fails because elements past the length are still checked in eq\n assert(vec1 != vec2);\n // docs:end:from-parts-unchecked\n }\n }\n\n mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec() {\n // The source deliberately has a higher capacity,\n // to make sure we are not trying to assign out-of-bounds.\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 9> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_limit() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_full_and_empty() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_zero_len() {\n let mut vec1: BoundedVec<u32, 0> = BoundedVec::new();\n let vec2: BoundedVec<u32, 0> = BoundedVec::new();\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_last_zeroed() {\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 4> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get_unchecked(3), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_empty_self() {\n // self.len == 0 with Len > MaxLen: the loop doesn't reach\n // the last storage slot, so the fixup must write it.\n let mut vec1: BoundedVec<u32, 3> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_equal_capacity() {\n // Len == MaxLen, fills to capacity.\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n vec1.push(1);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_array([2, 3, 4]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 4);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n assert_eq(vec1.get(3), 4);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be zeroed\n assert_eq(vec.storage(), [1, 2, 0]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n"
7035
6995
  },
7036
- "69": {
6996
+ "67": {
7037
6997
  "function_locations": [
7038
6998
  {
7039
6999
  "name": "PrivateContext::new",
7040
- "start": 10161
7000
+ "start": 10178
7041
7001
  },
7042
7002
  {
7043
7003
  "name": "PrivateContext::maybe_msg_sender",
7044
- "start": 12345
7004
+ "start": 12362
7045
7005
  },
7046
7006
  {
7047
7007
  "name": "PrivateContext::this_address",
7048
- "start": 13052
7008
+ "start": 13069
7049
7009
  },
7050
7010
  {
7051
7011
  "name": "PrivateContext::chain_id",
7052
- "start": 13557
7012
+ "start": 13574
7053
7013
  },
7054
7014
  {
7055
7015
  "name": "PrivateContext::version",
7056
- "start": 14140
7016
+ "start": 14157
7057
7017
  },
7058
7018
  {
7059
7019
  "name": "PrivateContext::gas_settings",
7060
- "start": 14693
7020
+ "start": 14710
7061
7021
  },
7062
7022
  {
7063
7023
  "name": "PrivateContext::selector",
7064
- "start": 15736
7024
+ "start": 15753
7065
7025
  },
7066
7026
  {
7067
7027
  "name": "PrivateContext::get_args_hash",
7068
- "start": 16458
7028
+ "start": 16475
7069
7029
  },
7070
7030
  {
7071
7031
  "name": "PrivateContext::push_note_hash",
7072
- "start": 18126
7032
+ "start": 18143
7073
7033
  },
7074
7034
  {
7075
7035
  "name": "PrivateContext::push_nullifier",
7076
- "start": 19302
7036
+ "start": 19319
7077
7037
  },
7078
7038
  {
7079
7039
  "name": "PrivateContext::push_nullifier_for_note_hash",
7080
- "start": 21071
7040
+ "start": 21088
7081
7041
  },
7082
7042
  {
7083
7043
  "name": "PrivateContext::get_anchor_block_header",
7084
- "start": 22367
7044
+ "start": 22384
7085
7045
  },
7086
7046
  {
7087
7047
  "name": "PrivateContext::get_block_header_at",
7088
- "start": 24428
7048
+ "start": 24445
7089
7049
  },
7090
7050
  {
7091
7051
  "name": "PrivateContext::set_return_hash",
7092
- "start": 24857
7052
+ "start": 24874
7093
7053
  },
7094
7054
  {
7095
7055
  "name": "PrivateContext::finish",
7096
- "start": 25352
7056
+ "start": 25369
7097
7057
  },
7098
7058
  {
7099
7059
  "name": "PrivateContext::set_as_fee_payer",
7100
- "start": 27971
7060
+ "start": 27988
7101
7061
  },
7102
7062
  {
7103
7063
  "name": "PrivateContext::in_revertible_phase",
7104
- "start": 28161
7064
+ "start": 28178
7105
7065
  },
7106
7066
  {
7107
7067
  "name": "PrivateContext::end_setup",
7108
- "start": 30473
7068
+ "start": 30490
7109
7069
  },
7110
7070
  {
7111
7071
  "name": "PrivateContext::set_expiration_timestamp",
7112
- "start": 33202
7072
+ "start": 33219
7113
7073
  },
7114
7074
  {
7115
7075
  "name": "PrivateContext::assert_note_exists",
7116
- "start": 34597
7076
+ "start": 34614
7117
7077
  },
7118
7078
  {
7119
7079
  "name": "PrivateContext::assert_nullifier_exists",
7120
- "start": 37233
7080
+ "start": 37250
7121
7081
  },
7122
7082
  {
7123
7083
  "name": "PrivateContext::request_nhk_app",
7124
- "start": 39330
7084
+ "start": 39347
7125
7085
  },
7126
7086
  {
7127
7087
  "name": "PrivateContext::request_ovsk_app",
7128
- "start": 40976
7088
+ "start": 40993
7129
7089
  },
7130
7090
  {
7131
7091
  "name": "PrivateContext::request_sk_app",
7132
- "start": 42390
7092
+ "start": 42407
7133
7093
  },
7134
7094
  {
7135
7095
  "name": "PrivateContext::message_portal",
7136
- "start": 45608
7096
+ "start": 45625
7137
7097
  },
7138
7098
  {
7139
7099
  "name": "PrivateContext::consume_l1_to_l2_message",
7140
- "start": 47490
7100
+ "start": 47507
7141
7101
  },
7142
7102
  {
7143
7103
  "name": "PrivateContext::emit_private_log_unsafe",
7144
- "start": 51902
7104
+ "start": 51919
7145
7105
  },
7146
7106
  {
7147
7107
  "name": "PrivateContext::emit_raw_note_log_unsafe",
7148
- "start": 53491
7108
+ "start": 53508
7149
7109
  },
7150
7110
  {
7151
7111
  "name": "PrivateContext::emit_contract_class_log",
7152
- "start": 53828
7112
+ "start": 54103
7153
7113
  },
7154
7114
  {
7155
7115
  "name": "PrivateContext::call_private_function",
7156
- "start": 58378
7116
+ "start": 58662
7157
7117
  },
7158
7118
  {
7159
7119
  "name": "PrivateContext::static_call_private_function",
7160
- "start": 59580
7120
+ "start": 59864
7161
7121
  },
7162
7122
  {
7163
7123
  "name": "PrivateContext::call_private_function_no_args",
7164
- "start": 60595
7124
+ "start": 60879
7165
7125
  },
7166
7126
  {
7167
7127
  "name": "PrivateContext::static_call_private_function_no_args",
7168
- "start": 61448
7128
+ "start": 61732
7169
7129
  },
7170
7130
  {
7171
7131
  "name": "PrivateContext::call_private_function_with_args_hash",
7172
- "start": 62426
7132
+ "start": 62710
7173
7133
  },
7174
7134
  {
7175
7135
  "name": "PrivateContext::call_public_function",
7176
- "start": 66586
7136
+ "start": 66870
7177
7137
  },
7178
7138
  {
7179
7139
  "name": "PrivateContext::static_call_public_function",
7180
- "start": 67853
7140
+ "start": 68137
7181
7141
  },
7182
7142
  {
7183
7143
  "name": "PrivateContext::call_public_function_no_args",
7184
- "start": 68872
7144
+ "start": 69156
7185
7145
  },
7186
7146
  {
7187
7147
  "name": "PrivateContext::static_call_public_function_no_args",
7188
- "start": 69771
7148
+ "start": 70055
7189
7149
  },
7190
7150
  {
7191
7151
  "name": "PrivateContext::call_public_function_with_calldata_hash",
7192
- "start": 70960
7152
+ "start": 71244
7193
7153
  },
7194
7154
  {
7195
7155
  "name": "PrivateContext::set_public_teardown_function",
7196
- "start": 73488
7156
+ "start": 73772
7197
7157
  },
7198
7158
  {
7199
7159
  "name": "PrivateContext::set_public_teardown_function_with_calldata_hash",
7200
- "start": 74759
7160
+ "start": 75043
7201
7161
  },
7202
7162
  {
7203
7163
  "name": "PrivateContext::next_counter",
7204
- "start": 80163
7164
+ "start": 80447
7205
7165
  },
7206
7166
  {
7207
7167
  "name": "<impl Empty for PrivateContext>::empty",
7208
- "start": 80332
7168
+ "start": 80616
7209
7169
  }
7210
7170
  ],
7211
7171
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/private_context.nr",
7212
- "source": "use crate::{\n context::{inputs::PrivateContextInputs, NoteExistenceRequest, NullifierExistenceRequest, ReturnsHash},\n hash::{hash_args, hash_calldata_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, public_key_domain_separators},\n messaging::process_l1_to_l2_message,\n oracle::{\n block_header::get_block_header_at,\n call_private_function::call_private_function_internal,\n execution_cache,\n key_validation_request::get_key_validation_request,\n logs::notify_created_contract_class_log,\n notes::notify_nullified_note,\n nullifiers::notify_created_nullifier,\n public_call::assert_valid_public_call_data,\n tx_phase::{is_execution_in_revertible_phase, notify_revertible_phase_start},\n },\n};\nuse crate::logging::aztecnr_trace_log_format;\nuse crate::protocol::{\n abis::{\n block_header::BlockHeader,\n call_context::CallContext,\n function_selector::FunctionSelector,\n gas_settings::GasSettings,\n log_hash::LogHash,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::{PrivateLog, PrivateLogData},\n public_call_request::PublicCallRequest,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndSeparator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, MAX_TX_LIFETIME,\n NULL_MSG_SENDER_CONTRACT_ADDRESS, PRIVATE_LOG_CIPHERTEXT_LEN,\n },\n hash::poseidon2_hash,\n messaging::l2_to_l1_message::L2ToL1Message,\n side_effect::{Counted, scoped::Scoped},\n traits::{Empty, Hash, ToField},\n utils::arrays::{ClaimedLengthArray, trimmed_array_length_hint},\n};\n\n/// # PrivateContext\n///\n/// The **main interface** between an #[external(\"private\")] function and the Aztec blockchain.\n///\n/// An instance of the PrivateContext is initialized automatically at the outset of every private function, within the\n/// #[external(\"private\")] macro, so you'll never need to consciously instantiate this yourself.\n///\n/// The instance is always named `context`, and it is always be available within the body of every\n/// #[external(\"private\")] function in your smart contract.\n///\n/// > For those used to \"vanilla\" Noir, it might be jarring to have access to > `context` without seeing a declaration\n/// `let context = PrivateContext::new(...)` > within the body of your function. This is just a consequence of using >\n/// macros to tidy-up verbose boilerplate. You can use `nargo expand` to > expand all macros, if you dare.\n///\n/// Typical usage for a smart contract developer will be to call getter methods of the PrivateContext.\n///\n/// _Pushing_ data and requests to the context is mostly handled within aztec-nr's own functions, so typically a smart\n/// contract developer won't need to call any setter methods directly.\n///\n/// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n/// find yourself doing this, please > open an issue on GitHub to describe your use case: it might be that > new\n/// functionality should be added to aztec-nr.\n///\n/// ## Responsibilities\n/// - Exposes contextual data to a private function:\n/// - Data relating to how this private function was called.\n/// - msg_sender\n/// - this_address - (the contract address of the private function being executed)\n/// - See `CallContext` for more data.\n/// - Data relating to the transaction in which this private function is being executed.\n/// - chain_id\n/// - version\n/// - gas_settings\n/// - Provides state access:\n/// - Access to the \"Anchor block\" header. Recall, a private function cannot read from the \"current\" block header, but\n/// must read from some historical block header, because as soon as private function execution begins (asynchronously,\n/// on a user's device), the public state of the chain (the \"current state\") will have progressed forward. We call this\n/// reference the \"Anchor block\". See `BlockHeader`.\n/// - Enables consumption of L1->L2 messages.\n/// - Enables calls to functions of other smart contracts:\n/// - Private function calls\n/// - Enqueueing of public function call requests (Since public functions are executed at a later time, by a block\n/// proposer, we say they are \"enqueued\").\n/// - Writes data to the blockchain:\n/// - New notes\n/// - New nullifiers\n/// - Private logs (for sending encrypted note contents or encrypted events)\n/// - New L2->L1 messages.\n/// - Provides args to the private function (handled by the #[external(\"private\")] macro).\n/// - Returns the return values of this private function (handled by the\n/// #[external(\"private\")] macro).\n/// - Makes Key Validation Requests.\n/// - Private functions are not allowed to see master secret keys, because we do not trust them. They are instead given\n/// \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then request validation of\n/// this claim, by making a \"key validation request\" to the protocol's kernel circuits (which _are_ allowed to see\n/// certain master secret keys).\n///\n/// ## Advanced Responsibilities\n///\n/// - Ultimately, the PrivateContext is responsible for constructing the PrivateCircuitPublicInputs of the private\n/// function being executed. All private functions on Aztec must have public inputs which adhere to the rigid layout of\n/// the PrivateCircuitPublicInputs, in order to be compatible with the protocol's kernel circuits. A well-known\n/// misnomer:\n/// - \"public inputs\" contain both inputs and outputs of this function.\n/// - By \"outputs\" we mean a lot more side-effects than just the \"return values\" of the function.\n/// - Most of the so-called \"public inputs\" are kept _private_, and never leak to the outside world, because they are\n/// 'swallowed' by the protocol's kernel circuits before the tx is sent to the network. Only the following are exposed\n/// to the outside world:\n/// - New note_hashes\n/// - New nullifiers\n/// - New private logs\n/// - New L2->L1 messages\n/// - New enqueued public function call requests All the above-listed arrays of side-effects can be padded by the\n/// user's wallet (through instructions to the kernel circuits, via the PXE) to obscure their true lengths.\n///\n/// ## Syntax Justification\n///\n/// Both user-defined functions _and_ most functions in aztec-nr need access to the PrivateContext instance to\n/// read/write data. This is why you'll see the arguably-ugly pervasiveness of the \"context\" throughout your smart\n/// contract and the aztec-nr library. For example, `&mut context` is prevalent. In some languages, you can access and\n/// mutate a global variable (such as a PrivateContext instance) from a function without polluting the function's\n/// parameters. With Noir, a function must explicitly pass control of a mutable variable to another function, by\n/// reference. Since many functions in aztec-nr need to be able to push new data to the PrivateContext, they need to be\n/// handed a mutable reference _to_ the context as a parameter. For example, `Context` is prevalent as a generic\n/// parameter, to give better type safety at compile time. Many `aztec-nr` functions don't make sense if they're called\n/// in a particular runtime (private, public or utility), and so are intentionally only implemented over certain\n/// [Private|Public|Utility]Context structs. This gives smart contract developers a much faster feedback loop if\n/// they're making a mistake, as an error will be thrown by the LSP or when they compile their contract.\n///\n#[derive(Eq)]\npub struct PrivateContext {\n // docs:start:private-context\n pub inputs: PrivateContextInputs,\n pub side_effect_counter: u32,\n\n pub min_revertible_side_effect_counter: u32,\n pub is_fee_payer: bool,\n\n pub args_hash: Field,\n pub return_hash: Field,\n\n pub expiration_timestamp: u64,\n\n pub(crate) note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,\n pub(crate) nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,\n key_validation_requests_and_separators: BoundedVec<KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL>,\n\n pub note_hashes: BoundedVec<Counted<NoteHash>, MAX_NOTE_HASHES_PER_CALL>,\n pub nullifiers: BoundedVec<Counted<Nullifier>, MAX_NULLIFIERS_PER_CALL>,\n\n pub private_call_requests: BoundedVec<PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>,\n pub public_call_requests: BoundedVec<Counted<PublicCallRequest>, MAX_ENQUEUED_CALLS_PER_CALL>,\n pub public_teardown_call_request: PublicCallRequest,\n pub l2_to_l1_msgs: BoundedVec<Counted<L2ToL1Message>, MAX_L2_TO_L1_MSGS_PER_CALL>,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub anchor_block_header: BlockHeader,\n\n pub private_logs: BoundedVec<Counted<PrivateLogData>, MAX_PRIVATE_LOGS_PER_CALL>,\n pub contract_class_logs_hashes: BoundedVec<Counted<LogHash>, MAX_CONTRACT_CLASS_LOGS_PER_CALL>,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times. The index of the array corresponds to the key type (0 nullifier, 1\n // incoming, 2 outgoing, 3 tagging).\n pub last_key_validation_requests: [Option<KeyValidationRequest>; NUM_KEY_TYPES],\n\n pub expected_non_revertible_side_effect_counter: u32,\n pub expected_revertible_side_effect_counter: u32,\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n expiration_timestamp: inputs.anchor_block_header.timestamp() + MAX_TX_LIFETIME,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n anchor_block_header: inputs.anchor_block_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n\n /// Returns the contract address that initiated this function call.\n ///\n /// This is similar to `msg.sender` in Solidity (hence the name).\n ///\n /// Important Note: Since Aztec doesn't have a concept of an EoA (Externally-owned Account), the msg_sender is\n /// \"none\" for the first function call of every transaction. The first function call of a tx is likely to be a call\n /// to the user's account contract, so this quirk will most often be handled by account contract developers.\n ///\n /// # Returns\n /// * `Option<AztecAddress>` - The address of the smart contract that called this function (be it an app contract\n /// or a user's account contract). Returns `Option<AztecAddress>::none` for the first function call of the tx. No\n /// other _private_ function calls in the tx will have a `none` msg_sender, but _public_ function calls might (see\n /// the PublicContext).\n pub fn maybe_msg_sender(self) -> Option<AztecAddress> {\n let maybe_msg_sender = self.inputs.call_context.msg_sender;\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the contract address of the current function being executed.\n ///\n /// This is equivalent to `address(this)` in Solidity (hence the name). Use this to identify the current contract's\n /// address, commonly needed for access control or when interacting with other contracts.\n ///\n /// # Returns\n /// * `AztecAddress` - The contract address of the current function being executed.\n ///\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n /// Returns the chain ID of the current network.\n ///\n /// This is similar to `block.chainid` in Solidity. Returns the unique identifier for the blockchain network this\n /// transaction is executing on.\n ///\n /// Helps prevent cross-chain replay attacks. Useful if implementing multi-chain contract logic.\n ///\n /// # Returns\n /// * `Field` - The chain ID as a field element\n ///\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n /// Returns the Aztec protocol version that this transaction is executing under. Different versions may have\n /// different rules, opcodes, or cryptographic primitives.\n ///\n /// This is similar to how Ethereum has different EVM versions.\n ///\n /// Useful for forward/backward compatibility checks\n ///\n /// Not to be confused with contract versions; this is the protocol version.\n ///\n /// # Returns\n /// * `Field` - The protocol version as a field element\n ///\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n /// Returns the gas settings for the current transaction.\n ///\n /// This provides information about gas limits and pricing for the transaction, similar to `tx.gasprice` and gas\n /// limits in Ethereum. However, Aztec has a more sophisticated gas model with separate accounting for L2\n /// computation and data availability (DA) costs.\n ///\n /// # Returns\n /// * `GasSettings` - Struct containing gas limits and fee information\n ///\n pub fn gas_settings(self) -> GasSettings {\n self.inputs.tx_context.gas_settings\n }\n\n /// Returns the function selector of the currently executing function.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to access this.\n ///\n /// This is similar to `msg.sig` in Solidity, which returns the first 4 bytes of the function signature. In Aztec,\n /// the selector uniquely identifies which function within the contract is being called.\n ///\n /// # Returns\n /// * `FunctionSelector` - The 4-byte function identifier\n ///\n /// # Advanced\n /// Only #[external(\"private\")] functions have a function selector as a protocol- enshrined concept. The function\n /// selectors of private functions are baked into the preimage of the contract address, and are used by the\n /// protocol's kernel circuits to identify each private function and ensure the correct one is being executed.\n ///\n /// Used internally for function dispatch and call verification.\n ///\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n /// Returns the hash of the arguments passed to the current function.\n ///\n /// Very low-level function: You shouldn't need to call this. The #[external(\"private\")] macro calls this, and it\n /// makes the arguments neatly available to the body of your private function.\n ///\n /// # Returns\n /// * `Field` - Hash of the function arguments\n ///\n /// # Advanced\n /// * Arguments are hashed to reduce proof size and verification time\n /// * Enables efficient argument passing in recursive function calls\n /// * The hash can be used to retrieve the original arguments from the PXE.\n ///\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n /// Pushes a new note_hash to the Aztec blockchain's global Note Hash Tree (a state tree).\n ///\n /// A note_hash is a commitment to a piece of private state.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to manually call this. Aztec-nr's state\n /// variables (see `../state_vars/`) are designed to understand when to create and push new note hashes.\n ///\n /// # Arguments\n /// * `note_hash` - The new note_hash.\n ///\n /// # Advanced\n /// From here, the protocol's kernel circuits will take over and insert the note_hash into the protocol's \"note\n /// hash tree\" (in the Base Rollup circuit). Before insertion, the protocol will:\n /// - \"Silo\" the `note_hash` with the contract address of this function, to yield a `siloed_note_hash`. This\n /// prevents state collisions between different smart contracts.\n /// - Ensure uniqueness of the `siloed_note_hash`, to prevent Faerie-Gold attacks, by hashing the\n /// `siloed_note_hash` with a unique value, to yield a `unique_siloed_note_hash` (see the protocol spec for more).\n ///\n /// In addition to calling this function, aztec-nr provides the contents of the newly-created note to the PXE, via\n /// the `notify_created_note` oracle.\n ///\n /// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n /// find yourself doing this, > please open an issue on GitHub to describe your use case: it might be > that new\n /// functionality should be added to aztec-nr.\n ///\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(Counted::new(note_hash, self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::state_vars::SingleUseClaim`].\n ///\n /// In particular, callers must ensure all nullifiers created by a contract are properly domain-separated, so that\n /// unrelated components don't interfere with one another (e.g. a transaction nullifier accidentally marking a\n /// variable as initialized). Only [`PrivateContext::push_nullifier_for_note_hash`] should be used for note\n /// nullifiers, never this one.\n ///\n /// ## Advanced\n ///\n /// The raw `nullifier` is not what is inserted into the Aztec state tree: it will be first siloed by contract\n /// address via [`crate::protocol::hash::compute_siloed_nullifier`] in order to prevent accidental or malicious\n /// interference of nullifiers from different contracts.\n pub fn push_nullifier(&mut self, nullifier: Field) {\n notify_created_nullifier(nullifier);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: 0 }.count(self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier) associated with a note.\n ///\n /// This is a variant of [`PrivateContext::push_nullifier`] that is used for note nullifiers, i.e. nullifiers that\n /// correspond to a note. If a note and its nullifier are created in the same transaction, then the private kernels\n /// will 'squash' these values, deleting them both as if they never existed and reducing transaction fees.\n ///\n /// The `nullification_note_hash` must be the result of calling\n /// [`crate::note::utils::compute_confirmed_note_hash_for_nullification`] for pending notes, and `0` for settled\n /// notes (which cannot be squashed).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::note::lifecycle::destroy_note`].\n ///\n /// The precautions listed for [`PrivateContext::push_nullifier`] apply here as well, and callers should\n /// additionally ensure `nullification_note_hash` corresponds to a note emitted by this contract, with its hash\n /// computed in the same transaction execution phase as the call to this function. Finally, only this function\n /// should be used for note nullifiers, never [`PrivateContext::push_nullifier`].\n ///\n /// Failure to do these things can result in unprovable contexts, accidental deletion of notes, or double-spend\n /// attacks.\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullification_note_hash: Field) {\n let nullifier_counter = self.next_counter();\n notify_nullified_note(nullifier, nullification_note_hash, nullifier_counter);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: nullification_note_hash }.count(\n nullifier_counter,\n ));\n }\n\n /// Returns the anchor block header - the historical block header that this private function is reading from.\n ///\n /// A private function CANNOT read from the \"current\" block header, but must read from some older block header,\n /// because as soon as private function execution begins (asynchronously, on a user's device), the public state of\n /// the chain (the \"current state\") will have progressed forward.\n ///\n /// # Returns\n /// * `BlockHeader` - The anchor block header.\n ///\n /// # Advanced\n /// * All private functions of a tx read from the same anchor block header.\n /// * The protocol asserts that the `expiration_timestamp` of every tx is at most 24 hours beyond the timestamp of\n /// the tx's chosen anchor block header. This enables the network's nodes to safely prune old txs from the mempool.\n /// Therefore, the chosen block header _must_ be one from within the last 24 hours.\n ///\n pub fn get_anchor_block_header(self) -> BlockHeader {\n self.anchor_block_header\n }\n\n /// Returns the header of any historical block at or before the anchor block.\n ///\n /// This enables private contracts to access information from even older blocks than the anchor block header.\n ///\n /// Useful for time-based contract logic that needs to compare against multiple historical points.\n ///\n /// # Arguments\n /// * `block_number` - The block number to retrieve (must be <= anchor block number)\n ///\n /// # Returns\n /// * `BlockHeader` - The header of the requested historical block\n ///\n /// # Advanced\n /// This function uses an oracle to fetch block header data from the user's PXE. Depending on how much blockchain\n /// data the user's PXE has been set up to store, this might require a query from the PXE to another Aztec node to\n /// get the data. > This is generally true of all oracle getters (see `../oracle`).\n ///\n /// Each block header gets hashed and stored as a leaf in the protocol's Archive Tree. In fact, the i-th block\n /// header gets stored at the i-th leaf index of the Archive Tree. Behind the scenes, this `get_block_header_at`\n /// function will add Archive Tree merkle-membership constraints (~3k) to your smart contract function's circuit,\n /// to prove existence of the block header in the Archive Tree.\n ///\n /// Note: we don't do any caching, so avoid making duplicate calls for the same block header, because each call\n /// will add duplicate constraints.\n ///\n /// Calling this function is more expensive (constraint-wise) than getting the anchor block header (via\n /// `get_block_header`). This is because the anchor block's merkle membership proof is handled by Aztec's protocol\n /// circuits, and is only performed once for the entire tx because all private functions of a tx share a common\n /// anchor block header. Therefore, the cost (constraint-wise) of calling `get_block_header` is effectively free.\n ///\n pub fn get_block_header_at(self, block_number: u32) -> BlockHeader {\n get_block_header_at(block_number, self)\n }\n\n /// Sets the hash of the return values for this private function.\n ///\n /// Very low-level function: this is called by the #[external(\"private\")] macro.\n ///\n /// # Arguments\n /// * `serialized_return_values` - The serialized return values as a field array\n ///\n pub fn set_return_hash<let N: u32>(&mut self, serialized_return_values: [Field; N]) {\n let return_hash = hash_args(serialized_return_values);\n self.return_hash = return_hash;\n execution_cache::store(serialized_return_values, return_hash);\n }\n\n /// Builds the PrivateCircuitPublicInputs for this private function, to ensure compatibility with the protocol's\n /// kernel circuits.\n ///\n /// Very low-level function: This function is automatically called by the #[external(\"private\")] macro.\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n expiration_timestamp: self.expiration_timestamp,\n note_hash_read_requests: ClaimedLengthArray::from_bounded_vec(self.note_hash_read_requests),\n nullifier_read_requests: ClaimedLengthArray::from_bounded_vec(self.nullifier_read_requests),\n key_validation_requests_and_separators: ClaimedLengthArray::from_bounded_vec(\n self.key_validation_requests_and_separators,\n ),\n note_hashes: ClaimedLengthArray::from_bounded_vec(self.note_hashes),\n nullifiers: ClaimedLengthArray::from_bounded_vec(self.nullifiers),\n private_call_requests: ClaimedLengthArray::from_bounded_vec(self.private_call_requests),\n public_call_requests: ClaimedLengthArray::from_bounded_vec(self.public_call_requests),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: ClaimedLengthArray::from_bounded_vec(self.l2_to_l1_msgs),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: ClaimedLengthArray::from_bounded_vec(self.private_logs),\n contract_class_logs_hashes: ClaimedLengthArray::from_bounded_vec(self.contract_class_logs_hashes),\n anchor_block_header: self.anchor_block_header,\n tx_context: self.inputs.tx_context,\n expected_non_revertible_side_effect_counter: self.expected_non_revertible_side_effect_counter,\n expected_revertible_side_effect_counter: self.expected_revertible_side_effect_counter,\n }\n }\n\n /// Designates this contract as the fee payer for the transaction.\n ///\n /// Unlike Ethereum, where the transaction sender always pays fees, Aztec allows any contract to voluntarily pay\n /// transaction fees. This enables patterns like sponsored transactions or fee abstraction where users don't need\n /// to hold fee-juice themselves. (Fee juice is a fee-paying asset for Aztec).\n ///\n /// Only one contract per transaction can declare itself as the fee payer, and it must have sufficient fee-juice\n /// balance (>= the gas limits specified in the TxContext) by the time we reach the public setup phase of the tx.\n ///\n pub fn set_as_fee_payer(&mut self) {\n aztecnr_trace_log_format!(\"Setting {0} as fee payer\")([self.this_address().to_field()]);\n self.is_fee_payer = true;\n }\n\n pub fn in_revertible_phase(&mut self) -> bool {\n let current_counter = self.side_effect_counter;\n\n // Safety: Kernel will validate that the claim is correct by validating the expected counters.\n let is_revertible = unsafe { is_execution_in_revertible_phase(current_counter) };\n\n if is_revertible {\n if (self.expected_revertible_side_effect_counter == 0)\n | (current_counter < self.expected_revertible_side_effect_counter) {\n self.expected_revertible_side_effect_counter = current_counter;\n }\n } else if current_counter > self.expected_non_revertible_side_effect_counter {\n self.expected_non_revertible_side_effect_counter = current_counter;\n }\n\n is_revertible\n }\n\n /// Declares the end of the \"setup phase\" of this tx.\n ///\n /// Only one function per tx can declare the end of the setup phase.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase enables such a payment to be made, because the setup phase _cannot revert_: a reverting function within\n /// the setup phase would result in an invalid block which cannot be proven. Any side-effects generated during that\n /// phase are guaranteed to be inserted into Aztec's state trees (except for squashed notes & nullifiers, of\n /// course).\n ///\n /// Even though the end of the setup phase is declared within a private function, you might have noticed that\n /// _public_ functions can also execute within the setup phase. This is because any public function calls which\n /// were enqueued _within the setup phase_ by a private function are considered part of the setup phase.\n ///\n /// # Advanced\n /// * Sets the minimum revertible side effect counter of this tx to be the PrivateContext's _current_ side effect\n /// counter.\n ///\n pub fn end_setup(&mut self) {\n // Incrementing the side effect counter when ending setup ensures non ambiguity for the counter where we change\n // phases.\n self.side_effect_counter += 1;\n aztecnr_trace_log_format!(\"Ending setup at counter {0}\")([self.side_effect_counter as Field]);\n self.min_revertible_side_effect_counter = self.next_counter();\n notify_revertible_phase_start(self.min_revertible_side_effect_counter);\n }\n\n /// Sets a deadline (an \"include-by timestamp\") for when this transaction must be included in a block.\n ///\n /// Other functions in this tx might call this setter with differing values for the include-by timestamp. To ensure\n /// that all functions' deadlines are met, the _minimum_ of all these include-by timestamps will be exposed when\n /// this tx is submitted to the network.\n ///\n /// If the transaction is not included in a block by its include-by timestamp, it becomes invalid and it will never\n /// be included.\n ///\n /// This expiry timestamp is publicly visible. See the \"Advanced\" section for privacy concerns.\n ///\n /// # Arguments\n /// * `expiration_timestamp` - Unix timestamp (seconds) deadline for inclusion. The include-by timestamp of this tx\n /// will be _at most_ the timestamp specified.\n ///\n /// # Advanced\n /// * If multiple functions set differing `expiration_timestamp`s, the kernel circuits will set it to be the\n /// _minimum_ of the two. This ensures the tx expiry requirements of all functions in the tx are met.\n /// * Rollup circuits will reject expired txs.\n /// * The protocol enforces that all transactions must be included within 24 hours of their chosen anchor block's\n /// timestamp, to enable safe mempool pruning.\n /// * The DelayedPublicMutable design makes heavy use of this functionality, to enable private functions to read\n /// public state.\n /// * A sophisticated Wallet should cleverly set an include-by timestamp to improve the privacy of the user and the\n /// network as a whole. For example, if a contract interaction sets include-by to some publicly-known value (e.g.\n /// the time when a contract upgrades), then the wallet might wish to set an even lower one to avoid revealing that\n /// this tx is interacting with said contract. Ideally, all wallets should standardize on an approach in order to\n /// provide users with a large privacy set -- although the exact approach\n /// will need to be discussed. Wallets that deviate from a standard might accidentally reveal which wallet each\n /// transaction originates from.\n ///\n // docs:start:expiration-timestamp\n pub fn set_expiration_timestamp(&mut self, expiration_timestamp: u64) {\n // docs:end:expiration-timestamp\n self.expiration_timestamp = std::cmp::min(self.expiration_timestamp, expiration_timestamp);\n }\n\n /// Asserts that a note has been created.\n ///\n /// This function will cause the transaction to fail unless the requested note exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending notes.\n ///\n /// ## Pending Notes\n ///\n /// Both settled notes (created in prior transactions) and pending notes (created in the current transaction) will\n /// be considered by this function. Pending notes must have been created **before** this call is made for the check\n /// to pass.\n ///\n /// ## Historical Notes\n ///\n /// If you need to assert that a note existed _by some specific block in the past_, instead of simply proving that\n /// it exists by the current anchor block, use [`crate::history::note::assert_note_existed_by`] instead.\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel note hash read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_note_exists(&mut self, note_existence_request: NoteExistenceRequest) {\n // Note that the `note_hash_read_requests` array does not hold `NoteExistenceRequest` objects, but rather a\n // custom kernel type. We convert from the aztec-nr type into it.\n\n let note_hash = note_existence_request.note_hash();\n let contract_address = note_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let side_effect = Scoped::new(\n Counted::new(note_hash, self.next_counter()),\n contract_address,\n );\n\n self.note_hash_read_requests.push(side_effect);\n }\n\n /// Asserts that a nullifier has been emitted.\n ///\n /// This function will cause the transaction to fail unless the requested nullifier exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending nullifiers.\n ///\n /// ## Pending Nullifiers\n ///\n /// Both settled nullifiers (emitted in prior transactions) and pending nullifiers (emitted in the current\n /// transaction) will be considered by this function. Pending nullifiers must have been emitted **before** this\n /// call is made for the check to pass.\n ///\n /// ## Historical Nullifiers\n ///\n /// If you need to assert that a nullifier existed _by some specific block in the past_, instead of simply proving\n /// that it exists by the current anchor block, use [`crate::history::nullifier::assert_nullifier_existed_by`]\n /// instead.\n ///\n /// ## Public vs Private\n ///\n /// In general, it is unsafe to check for nullifier non-existence in private, as that will not consider the\n /// possibility of the nullifier having been emitted in any transaction between the anchor block and the inclusion\n /// block. Private functions instead prove existence via this function and 'prove' non-existence by _emitting_ the\n /// nullifer, which would cause the transaction to fail if the nullifier existed.\n ///\n /// This is not the case in public functions, which do have access to the tip of the blockchain and so can reliably\n /// prove whether a nullifier exists or not via\n /// [`crate::context::public_context::PublicContext::nullifier_exists_unsafe`].\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel nullifier read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_nullifier_exists(&mut self, nullifier_existence_request: NullifierExistenceRequest) {\n let nullifier = nullifier_existence_request.nullifier();\n let contract_address = nullifier_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let request = Scoped::new(\n Counted::new(nullifier, self.next_counter()),\n contract_address,\n );\n\n self.nullifier_read_requests.push(request);\n }\n\n /// Requests the app-siloed nullifier hiding key (nhk_app) for the given (hashed) master nullifier public key\n /// (npk_m), from the user's PXE.\n ///\n /// Advanced function: Only needed if you're designing your own notes and/or nullifiers.\n ///\n /// Contracts are not allowed to compute nullifiers for other contracts, as that would let them read parts of their\n /// private state. Because of this, a contract is only given an \"app-siloed key\", which is constructed by\n /// hashing the user's master nullifier hiding key with the contract's address. However, because contracts cannot\n /// be trusted with a user's master nullifier hiding key (because we don't know which contracts are honest or\n /// malicious), the PXE refuses to provide any master secret keys to any app smart contract function. This means\n /// app functions are unable to prove that the derivation of an app-siloed nullifier hiding key has been computed\n /// correctly. Instead, an app function can request to the kernel (via `request_nhk_app`) that it validates the\n /// siloed derivation, since the kernel has been vetted to not leak any master secret keys.\n ///\n /// A common nullification scheme is to inject a nullifier hiding key into the preimage of a nullifier, to make the\n /// nullifier deterministic but random-looking. This function enables that flow.\n ///\n /// # Arguments\n /// * `npk_m_hash` - A hash of the master nullifier public key of the user whose PXE is executing this function.\n ///\n /// # Returns\n /// * The app-siloed nullifier hiding key that corresponds to the given `npk_m_hash`.\n ///\n pub fn request_nhk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n /// Requests the app-siloed outgoing viewing secret key (ovsk_app) for the given (hashed) master outgoing\n /// viewing public key (ovpk_m), from the user's PXE.\n ///\n /// See `request_nhk_app` and `request_sk_app` for more info.\n ///\n /// The intention of the \"outgoing\" keypair is to provide a second secret key for all of a user's outgoing activity\n /// (i.e. for notes that a user creates, as opposed to notes that a user receives from others). The separation of\n /// incoming and outgoing data was a distinction made by zcash, with the intention of enabling a user to optionally\n /// share with a 3rd party a controlled view of only incoming or outgoing notes. Similar functionality of sharing\n /// select data can be achieved with offchain zero-knowledge proofs. It is up to an app developer whether they\n /// choose to make use of a user's outgoing keypair within their application logic, or instead simply use the same\n /// keypair (the address keypair (which is effectively the same as the \"incoming\" keypair)) for all incoming &\n /// outgoing messages to a user.\n ///\n /// Currently, all of the exposed encryption functions in aztec-nr ignore the outgoing viewing keys, and instead\n /// encrypt all note logs and event logs to a user's address public key.\n ///\n /// # Arguments\n /// * `ovpk_m_hash` - Hash of the outgoing viewing public key master\n ///\n /// # Returns\n /// * The application-specific outgoing viewing secret key\n ///\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n /// Pushes a Key Validation Request to the kernel.\n ///\n /// Private functions are not allowed to see a user's master secret keys, because we do not trust them. They are\n /// instead given \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then\n /// request validation of this claim, by making a \"key validation request\" to the protocol's kernel circuits (which\n /// _are_ allowed to see certain master secret keys).\n ///\n /// When a Key Validation Request tuple of (sk_app, Pk_m, app_address) is submitted to the kernel, it will perform\n /// the following derivations to validate the relationship between the claimed sk_app and the user's Pk_m:\n ///\n /// (sk_m) ----> * G ----> Pk_m\n /// | |\n /// v We use the kernel to prove this\n /// h(sk_m, app_address) | sk_app-Pk_m relationship, because app\n /// | circuits must not be trusted to see sk_m.\n /// v |\n /// sk_app - - - - - - - - -\n ///\n /// The function is named \"request_\" instead of \"get_\" to remind the user that a Key Validation Request will be\n /// emitted to the kernel.\n ///\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n let cached_request =\n self.last_key_validation_requests[key_index as u32].unwrap_or(KeyValidationRequest::empty());\n\n if cached_request.pk_m.hash() == pk_m_hash {\n // We get a match so the cached request is the latest one\n cached_request.sk_app\n } else {\n // We didn't get a match meaning the cached result is stale Typically we'd validate keys by showing that\n // they are the preimage of `pk_m_hash`, but that'd require the oracle returning the master secret keys,\n // which could cause malicious contracts to leak it or learn about secrets from other contracts. We\n // therefore silo secret keys, and rely on the private kernel to validate that we siloed secret key\n // corresponds to correct siloing of the master secret key that hashes to `pk_m_hash`.\n\n // Safety: Kernels verify that the key validation request is valid and below we verify that a request for\n // the correct public key has been received.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert(!request.pk_m.is_infinite, \"Infinite public key points are not allowed\");\n assert_eq(request.pk_m.hash(), pk_m_hash, \"Obtained invalid key validation request\");\n\n self.key_validation_requests_and_separators.push(\n KeyValidationRequestAndSeparator {\n request,\n key_type_domain_separator: public_key_domain_separators[key_index as u32],\n },\n );\n self.last_key_validation_requests[key_index as u32] = Option::some(request);\n request.sk_app\n }\n }\n\n /// Sends an \"L2 -> L1 message\" from this function (Aztec, L2) to a smart contract on Ethereum (L1). L1 contracts\n /// which are designed to send/receive messages to/from Aztec are called \"Portal Contracts\".\n ///\n /// Common use cases include withdrawals, cross-chain asset transfers, and triggering L1 actions based on L2 state\n /// changes.\n ///\n /// The message will be inserted into an Aztec \"Outbox\" contract on L1, when this transaction's block is proposed\n /// to L1. Sending the message will not result in any immediate state changes in the target portal contract. The\n /// message will need to be manually consumed from the Outbox through a separate Ethereum transaction: a user will\n /// need to call a function of the portal contract -- a function specifically designed to make a call to the Outbox\n /// to consume the message. The message will only be available for consumption once the _epoch_ proof has been\n /// submitted. Given that there are multiple Aztec blocks within an epoch, it might take some time for this epoch\n /// proof to be submitted -- especially if the block was near the start of an epoch.\n ///\n /// # Arguments\n /// * `recipient` - Ethereum address that will receive the message\n /// * `content` - Message content (32 bytes as a Field element). This content has a very\n /// specific layout. docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n let message = L2ToL1Message { recipient, content };\n self.l2_to_l1_msgs.push(message.count(self.next_counter()));\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2).\n ///\n /// Common use cases include token bridging, cross-chain governance, and triggering L2 actions based on L1 events.\n ///\n /// Use this function if you only want the message to ever be \"referred to\" once. Once consumed using this method,\n /// the message cannot be consumed again, because a nullifier is emitted. If your use case wants for the message to\n /// be read unlimited times, then you can always read any historic message from the L1-to-L2 messages tree;\n /// messages never technically get deleted from that tree.\n ///\n /// The message will first be inserted into an Aztec \"Inbox\" smart contract on L1. Sending the message will not\n /// result in any immediate state changes in the target L2 contract. The message will need to be manually consumed\n /// by the target contract through a separate Aztec transaction. The message will not be available for consumption\n /// immediately. Messages get copied over from the L1 Inbox to L2 by the next Proposer in batches. So you will need\n /// to wait until the messages are copied before you can consume them.\n ///\n /// # Arguments\n /// * `content` - The message content that was sent from L1\n /// * `secret` - Secret value used for message privacy (if needed)\n /// * `sender` - Ethereum address that sent the message\n /// * `leaf_index` - Index of the message in the L1-to-L2 message tree\n ///\n /// # Advanced\n /// Validates message existence in the L1-to-L2 message tree and nullifies the message to prevent\n /// double-consumption.\n pub fn consume_l1_to_l2_message(&mut self, content: Field, secret: Field, sender: EthAddress, leaf_index: Field) {\n let nullifier = process_l1_to_l2_message(\n self.anchor_block_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier(nullifier)\n }\n\n /// Emits a private log (an array of Fields) that will be published to an Ethereum blob.\n ///\n /// Private logs are intended for the broadcasting of ciphertexts: that is, encrypted events or encrypted note\n /// contents. Since the data in the logs is meant to be _encrypted_, private_logs are broadcast to publicly-visible\n /// Ethereum blobs. The intended recipients of such encrypted messages can then discover and decrypt these\n /// encrypted logs using their viewing secret key. (See `../messages/discovery` for more details).\n ///\n /// Important note: This function DOES NOT _do_ any encryption of the input `log` fields. This function blindly\n /// publishes whatever input `log` data is fed into it, so the caller of this function should have already\n /// performed the encryption, and the `log` should be the result of that encryption.\n ///\n /// The protocol does not dictate what encryption scheme should be used: a smart contract developer can choose\n /// whatever encryption scheme they like. Aztec-nr includes some off-the-shelf encryption libraries that developers\n /// might wish to use, for convenience. These libraries not only encrypt a plaintext (to produce a ciphertext);\n /// they also prepend the ciphertext with a `tag` and `ephemeral public key` for easier message discovery. This is\n /// a very dense topic, and we will be writing more libraries and docs soon.\n ///\n /// > Currently, AES128 CBC encryption is the main scheme included in > aztec.nr. > We are currently making\n /// significant changes to the interfaces of the > encryption library.\n ///\n /// In some niche use cases, an app might be tempted to publish _un-encrypted_ data via a private log, because\n /// _public logs_ are not available to private functions. Be warned that emitting public data via private logs is\n /// strongly discouraged, and is considered a \"privacy anti-pattern\", because it reveals identifiable information\n /// about _which_ function has been executed. A tx which leaks such information does not contribute to the privacy\n /// set of the network.\n ///\n /// * Unlike `emit_raw_note_log_unsafe`, this log is not tied to any specific note\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]` of the emitted log. Used by recipients and nodes to identify and\n /// filter for relevant logs without scanning all of them.\n /// * `log` - The log data that will be publicly broadcast (so make sure it's already been encrypted before you\n /// call this function). Private logs are bounded in size (`PRIVATE_LOG_CIPHERTEXT_LEN`), to encourage all logs\n /// from all smart contracts look identical.\n /// * `length` - The actual length of `log` (measured in number of Fields). Although the input log has a max\n /// size of `PRIVATE_LOG_CIPHERTEXT_LEN`, the latter values of the array might all be 0's for small logs. This\n /// `length` should reflect the trimmed length of the array. The protocol's kernel circuits can then append\n /// random fields as \"padding\" after the `length`, so that the logs of this smart contract look\n /// indistinguishable from (the same length as) the logs of all other applications. It's up to wallets how much\n /// padding to apply, so ideally all wallets should agree on standards for this.\n ///\n /// ## Safety\n ///\n /// The `tag` should be domain-separated (e.g. via [`crate::protocol::hash::compute_log_tag`]) to prevent\n /// collisions between logs from different sources. Without domain separation, two unrelated log types that\n /// happen to share a raw tag value become indistinguishable. Prefer the higher-level APIs\n /// ([`crate::messages::message_delivery::MessageDelivery`] for messages, `self.emit(event)` for events) which\n /// handle tagging automatically.\n pub fn emit_private_log_unsafe(&mut self, tag: Field, log: [Field; PRIVATE_LOG_CIPHERTEXT_LEN], length: u32) {\n let counter = self.next_counter();\n let full_log = [tag].concat(log);\n self.private_logs.push(PrivateLogData { log: PrivateLog::new(full_log, length + 1), note_hash_counter: 0 }\n .count(counter));\n }\n\n // TODO: rename.\n /// Emits a private log that is explicitly tied to a newly-emitted note_hash, to convey to the kernel: \"this log\n /// relates to this note\".\n ///\n /// This linkage is important in case the note gets squashed (due to being read later in this same tx), since we\n /// can then squash the log as well.\n ///\n /// See `emit_private_log_unsafe` for more info about private log emission.\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]`. See `emit_private_log_unsafe`.\n /// * `log` - The log data as an array of Field elements\n /// * `length` - The actual length of the `log` (measured in number of Fields).\n /// * `note_hash_counter` - The side-effect counter that was assigned to the new note_hash when it was pushed to\n /// this `PrivateContext`.\n ///\n /// Important: If your application logic requires the log to always be emitted regardless of note squashing,\n /// consider using `emit_private_log_unsafe` instead, or emitting additional events.\n ///\n /// ## Safety\n ///\n /// Same as [`PrivateContext::emit_private_log_unsafe`]: the `tag` should be domain-separated.\n pub fn emit_raw_note_log_unsafe(\n &mut self,\n tag: Field,\n log: [Field; PRIVATE_LOG_CIPHERTEXT_LEN],\n length: u32,\n note_hash_counter: u32,\n ) {\n let counter = self.next_counter();\n let full_log = [tag].concat(log);\n let private_log = PrivateLogData { log: PrivateLog::new(full_log, length + 1), note_hash_counter };\n self.private_logs.push(private_log.count(counter));\n }\n\n pub fn emit_contract_class_log<let N: u32>(&mut self, log: [Field; N]) {\n let contract_address = self.this_address();\n let counter = self.next_counter();\n\n let log_to_emit: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS] =\n log.concat([0; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS - N]);\n // Note: the length is not always N, it is the number of fields we want to broadcast, omitting trailing zeros\n // to save blob space.\n // Safety: The below length is constrained in the base rollup, which will make sure that all the fields beyond\n // length are zero. However, it won't be able to check that we didn't add extra padding (trailing zeroes) or\n // that we cut trailing zeroes from the end.\n let length = unsafe { trimmed_array_length_hint(log_to_emit) };\n // We hash the entire padded log to ensure a user cannot pass a shorter length and so emit incorrect shorter\n // bytecode.\n let log_hash = poseidon2_hash(log_to_emit);\n // Safety: the below only exists to broadcast the raw log, so we can provide it to the base rollup later to be\n // constrained.\n unsafe {\n notify_created_contract_class_log(contract_address, log_to_emit, length, counter);\n }\n\n self.contract_class_logs_hashes.push(LogHash { value: log_hash, length: length }.count(counter));\n }\n\n /// Calls a private function on another contract (or the same contract).\n ///\n /// Very low-level function.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n /// This enables contracts to interact with each other while maintaining privacy. This \"composability\" of private\n /// contract functions is a key feature of the Aztec network.\n ///\n /// If a user's transaction includes multiple private function calls, then by the design of Aztec, the following\n /// information will remain private[1]:\n /// - The function selectors and contract addresses of all private function calls will remain private, so an\n /// observer of the public mempool will not be able to look at a tx and deduce which private functions have been\n /// executed.\n /// - The arguments and return values of all private function calls will remain private.\n /// - The person who initiated the tx will remain private.\n /// - The notes and nullifiers and private logs that are emitted by all private function calls will (if designed\n /// well) not leak any user secrets, nor leak which functions have been executed.\n ///\n /// [1] Caveats: Some of these privacy guarantees depend on how app developers design their smart contracts. Some\n /// actions _can_ leak information, such as:\n /// - Calling an internal public function.\n /// - Calling a public function and not setting msg_sender to Option::none (feature not built yet - see github).\n /// - Calling any public function will always leak details about the nature of the transaction, so devs should be\n /// careful in their contract designs. If it can be done in a private function, then that will give the best\n /// privacy.\n /// - Not padding the side-effects of a tx to some standardized, uniform size. The kernel circuits can take hints\n /// to pad side-effects, so a wallet should be able to request for a particular amount of padding. Wallets should\n /// ideally agree on some standard.\n /// - Padding should include:\n /// - Padding the lengths of note & nullifier arrays\n /// - Padding private logs with random fields, up to some standardized size. See also:\n /// https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Advanced\n /// * The call is added to the private call stack and executed by kernel circuits after this function completes\n /// * The called function can modify its own contract's private state\n /// * Side effects from the called function are included in this transaction\n /// * The call inherits the current transaction's context and gas limits\n ///\n pub fn call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, false)\n }\n\n /// Makes a read-only call to a private function on another contract.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state, emit L2->L2 messages, nor\n /// emit events. Any nested calls are constrained to also be staticcalls.\n ///\n /// See `call_private_function` for more general info on private function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, true)\n }\n\n /// Calls a private function that takes no arguments.\n ///\n /// This is a convenience function for calling private functions that don't require any input parameters. It's\n /// equivalent to `call_private_function` but slightly more efficient to use when no arguments are needed.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, false)\n }\n\n /// Makes a read-only call to a private function which takes no arguments.\n ///\n /// This combines the optimisation of `call_private_function_no_args` with the safety of\n /// `static_call_private_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, true)\n }\n\n /// Low-level private function call.\n ///\n /// This is the underlying implementation used by all other private function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args_hash` - Pre-computed hash of the function arguments\n /// * `is_static_call` - Whether this should be a read-only call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values\n ///\n pub fn call_private_function_with_args_hash(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> ReturnsHash {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // Safety: The oracle simulates the private call and returns the value of the side effects counter after\n // execution of the call (which means that end_side_effect_counter - start_side_effect_counter is the number of\n // side effects that took place), along with the hash of the return values. We validate these by requesting a\n // private kernel iteration in which the return values are constrained to hash to `returns_hash` and the side\n // effects counter to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // TODO (fees) figure out why this crashes the prover and enable it we need this in order to pay fees inside\n // child call contexts assert(\n // (item.public_inputs.min_revertible_side_effect_counter == 0 as u32)\n // | (item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter)\n // ); if item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter { self.min_revertible_side_effect_counter =\n // item.public_inputs.min_revertible_side_effect_counter; }\n self.side_effect_counter = end_side_effect_counter + 1; // TODO: call `next_counter`\n // instead, for consistency\n ReturnsHash::new(returns_hash)\n }\n\n /// Enqueues a call to a public function to be executed later.\n ///\n /// Unlike private functions which execute immediately on the user's device, public function calls are \"enqueued\"\n /// and executed some time later by a block proposer.\n ///\n /// This means a public function cannot return any values back to a private function, because by the time the\n /// public function is being executed, the private function which called it has already completed execution. (In\n /// fact, the private function has been executed and proven, along with all other private function calls of the\n /// user's tx. A single proof of the tx has been submitted to the Aztec network, and some time later a proposer has\n /// picked the tx up from the mempool and begun executing all of the enqueued public functions).\n ///\n /// # Privacy warning Enqueueing a public function call is an inherently leaky action. Many interesting applications will require some interaction with public state, but smart contract developers should try to use public function calls sparingly, and carefully. _Internal_ public function calls are especially leaky, because they completely leak which private contract made the call. See also: https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be staticcalls.\n ///\n /// See also `call_public_function` for more important information about making private -> public function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Enqueues a call to a public function that takes no arguments.\n ///\n /// This is an optimisation for calling public functions that don't take any input parameters. It's otherwise\n /// equivalent to `call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function with no arguments.\n ///\n /// This combines the optimisation of `call_public_function_no_args` with the safety of\n /// `static_call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Low-level public function call.\n ///\n /// This is the underlying implementation used by all other public function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `call_public_function` or `static_call_public_function` instead.\n /// This function is exposed for performance optimization and advanced use cases.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let counter = self.next_counter();\n\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n let call_request = PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n /// Enqueues a public function call, and designates it to be the teardown function for this tx. Only one teardown\n /// function call can be made by a tx.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase ensures the fee payer has sufficient balance to pay the proposer their fees. The teardown phase is\n /// primarily intended to: calculate exactly how much the user owes, based on gas consumption, and refund the user\n /// any change.\n ///\n /// Note: in some cases, the cost of refunding the user (i.e. DA costs of tx side-effects) might exceed the refund\n /// amount. For app logic with fairly stable and predictable gas consumption, a material refund amount is unlikely.\n /// For app logic with unpredictable gas consumption, a refund might be important to the user (e.g. if a hefty\n /// function reverts very early). Wallet/FPC/Paymaster developers should be mindful of this.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - An array of fields to pass to the function.\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n pub fn set_public_teardown_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.set_public_teardown_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Low-level function to set the public teardown function.\n ///\n /// This is the underlying implementation for setting the teardown function call that will execute at the end of\n /// the transaction. Instead of taking raw arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `set_public_teardown_function` instead.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn set_public_teardown_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n self.public_teardown_call_request =\n PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n }\n\n /// Increments the side-effect counter.\n ///\n /// Very low-level function.\n ///\n /// # Advanced\n ///\n /// Every side-effect of a private function is given a \"side-effect counter\", based on when it is created. This\n /// PrivateContext is in charge of assigning the counters.\n ///\n /// The reason we have side-effect counters is complicated. Consider this illustrative pseudocode of inter-contract\n /// function calls:\n /// ```\n /// contract A {\n /// let x = 5; // pseudocode for storage var x.\n /// fn a1 {\n /// read x; // value: 5, counter: 1.\n /// x = x + 1;\n /// write x; // value: 6, counter: 2.\n ///\n /// B.b(); // start_counter: 2, end_counter: 4\n ///\n /// read x; // value: 36, counter: 5.\n /// x = x + 1;\n /// write x; // value: 37, counter: 6.\n /// }\n ///\n /// fn a2 {\n /// read x; // value: 6, counter: 3.\n /// x = x * x;\n /// write x; // value: 36, counter: 4.\n /// }\n /// }\n ///\n /// contract B {\n /// fn b() {\n /// A.a2();\n /// }\n /// }\n /// ```\n ///\n /// Suppose a1 is the first function called. The comments show the execution counter of each side-effect, and what\n /// the new value of `x` is.\n ///\n /// These (private) functions are processed by Aztec's kernel circuits in an order that is different from execution\n /// order: All of A.a1 is proven before B.b is proven, before A.a2 is proven. So when we're in the 2nd execution\n /// frame of A.a1 (after the call to B.b), the circuit needs to justify why x went from being `6` to `36`. But the\n /// circuit doesn't know why, and given the order of proving, the kernel hasn't _seen_ a value of 36 get written\n /// yet. The kernel needs to track big arrays of all side-effects of all private functions in a tx. Then, as it\n /// recurses and processes B.b(), it will eventually see a value of 36 get written.\n ///\n /// Suppose side-effect counters weren't exposed: The kernel would only see this ordering (in order of proof\n /// verification): [ A.a1.read, A.a1.write, A.a1.read, A.a1.write, A.a2.read, A.a2.write ]\n /// [ 5, 6, 36, 37, 6, 36 ]\n /// The kernel wouldn't know _when_ B.b() was called within A.a1(), because it can't see what's going on within an\n /// app circuit. So the kernel wouldn't know that the ordering of reads and writes should actually be: [ A.a1.read,\n /// A.a1.write, A.a2.read, A.a2.write, A.a1.read, A.a1.write ]\n /// [ 5, 6, 6, 36, 36, 37 ]\n ///\n /// And so, we introduced side-effect counters: every private function must assign side-effect counters alongside\n /// every side-effect that it emits, and also expose to the kernel the counters that it started and ended with.\n /// This gives the kernel enough information to arrange all side-effects in the correct order. It can then catch\n /// (for example) if a function tries to read state before it has been written (e.g. if A.a2() maliciously tried to\n /// read a value of x=37) (e.g. if A.a1() maliciously tried to read x=6).\n ///\n /// If a malicious app contract _lies_ and does not count correctly:\n /// - It cannot lie about its start and end counters because the kernel will catch this.\n /// - It _could_ lie about its intermediate counters:\n /// - 1. It could not increment its side-effects correctly\n /// - 2. It could label its side-effects with counters outside of its start and end counters' range. The kernel\n /// will catch 2. The kernel will not catch 1., but this would only cause corruption to the private state of the\n /// malicious contract, and not any other contracts (because a contract can only modify its own state). If a \"good\"\n /// contract is given _read access_ to a maliciously-counting contract (via an external getter function, or by\n /// reading historic state from the archive tree directly), and they then make state changes to their _own_ state\n /// accordingly, that could be dangerous. Developers should be mindful not to trust the claimed innards of external\n /// contracts unless they have audited/vetted the contracts including vetting the side-effect counter\n /// incrementation. This is a similar paradigm to Ethereum smart contract development: you must vet external\n /// contracts that your contract relies upon, and you must not make any presumptions about their claimed behaviour.\n /// (Hopefully if a contract imports a version of aztec-nr, we will get contract verification tooling that can\n /// validate the authenticity of the imported aztec-nr package, and hence infer that the side- effect counting will\n /// be correct, without having to re-audit such logic for every contract).\n ///\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n expiration_timestamp: 0,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n anchor_block_header: BlockHeader::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n}\n"
7172
+ "source": "use crate::{\n context::{inputs::PrivateContextInputs, NoteExistenceRequest, NullifierExistenceRequest, ReturnsHash},\n hash::{hash_args, hash_calldata_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, public_key_domain_separators},\n messaging::process_l1_to_l2_message,\n oracle::{\n block_header::get_block_header_at,\n call_private_function::call_private_function_internal,\n execution_cache,\n key_validation_request::get_key_validation_request,\n logs::notify_created_contract_class_log,\n notes::notify_nullified_note,\n nullifiers::notify_created_nullifier,\n public_call::assert_valid_public_call_data,\n tx_phase::{is_execution_in_revertible_phase, notify_revertible_phase_start},\n },\n};\nuse crate::logging::aztecnr_trace_log_format;\nuse crate::protocol::{\n abis::{\n block_header::BlockHeader,\n call_context::CallContext,\n function_selector::FunctionSelector,\n gas_settings::GasSettings,\n log_hash::LogHash,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::{PrivateLog, PrivateLogData},\n public_call_request::PublicCallRequest,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndSeparator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, MAX_TX_LIFETIME,\n NULL_MSG_SENDER_CONTRACT_ADDRESS, PRIVATE_LOG_CIPHERTEXT_LEN,\n },\n hash::compute_contract_class_log_hash,\n messaging::l2_to_l1_message::L2ToL1Message,\n side_effect::{Counted, scoped::Scoped},\n traits::{Empty, Hash, ToField},\n utils::arrays::{ClaimedLengthArray, trimmed_array_length_hint},\n};\n\n/// # PrivateContext\n///\n/// The **main interface** between an #[external(\"private\")] function and the Aztec blockchain.\n///\n/// An instance of the PrivateContext is initialized automatically at the outset of every private function, within the\n/// #[external(\"private\")] macro, so you'll never need to consciously instantiate this yourself.\n///\n/// The instance is always named `context`, and it is always be available within the body of every\n/// #[external(\"private\")] function in your smart contract.\n///\n/// > For those used to \"vanilla\" Noir, it might be jarring to have access to > `context` without seeing a declaration\n/// `let context = PrivateContext::new(...)` > within the body of your function. This is just a consequence of using >\n/// macros to tidy-up verbose boilerplate. You can use `nargo expand` to > expand all macros, if you dare.\n///\n/// Typical usage for a smart contract developer will be to call getter methods of the PrivateContext.\n///\n/// _Pushing_ data and requests to the context is mostly handled within aztec-nr's own functions, so typically a smart\n/// contract developer won't need to call any setter methods directly.\n///\n/// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n/// find yourself doing this, please > open an issue on GitHub to describe your use case: it might be that > new\n/// functionality should be added to aztec-nr.\n///\n/// ## Responsibilities\n/// - Exposes contextual data to a private function:\n/// - Data relating to how this private function was called.\n/// - msg_sender\n/// - this_address - (the contract address of the private function being executed)\n/// - See `CallContext` for more data.\n/// - Data relating to the transaction in which this private function is being executed.\n/// - chain_id\n/// - version\n/// - gas_settings\n/// - Provides state access:\n/// - Access to the \"Anchor block\" header. Recall, a private function cannot read from the \"current\" block header, but\n/// must read from some historical block header, because as soon as private function execution begins (asynchronously,\n/// on a user's device), the public state of the chain (the \"current state\") will have progressed forward. We call this\n/// reference the \"Anchor block\". See `BlockHeader`.\n/// - Enables consumption of L1->L2 messages.\n/// - Enables calls to functions of other smart contracts:\n/// - Private function calls\n/// - Enqueueing of public function call requests (Since public functions are executed at a later time, by a block\n/// proposer, we say they are \"enqueued\").\n/// - Writes data to the blockchain:\n/// - New notes\n/// - New nullifiers\n/// - Private logs (for sending encrypted note contents or encrypted events)\n/// - New L2->L1 messages.\n/// - Provides args to the private function (handled by the #[external(\"private\")] macro).\n/// - Returns the return values of this private function (handled by the\n/// #[external(\"private\")] macro).\n/// - Makes Key Validation Requests.\n/// - Private functions are not allowed to see master secret keys, because we do not trust them. They are instead given\n/// \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then request validation of\n/// this claim, by making a \"key validation request\" to the protocol's kernel circuits (which _are_ allowed to see\n/// certain master secret keys).\n///\n/// ## Advanced Responsibilities\n///\n/// - Ultimately, the PrivateContext is responsible for constructing the PrivateCircuitPublicInputs of the private\n/// function being executed. All private functions on Aztec must have public inputs which adhere to the rigid layout of\n/// the PrivateCircuitPublicInputs, in order to be compatible with the protocol's kernel circuits. A well-known\n/// misnomer:\n/// - \"public inputs\" contain both inputs and outputs of this function.\n/// - By \"outputs\" we mean a lot more side-effects than just the \"return values\" of the function.\n/// - Most of the so-called \"public inputs\" are kept _private_, and never leak to the outside world, because they are\n/// 'swallowed' by the protocol's kernel circuits before the tx is sent to the network. Only the following are exposed\n/// to the outside world:\n/// - New note_hashes\n/// - New nullifiers\n/// - New private logs\n/// - New L2->L1 messages\n/// - New enqueued public function call requests All the above-listed arrays of side-effects can be padded by the\n/// user's wallet (through instructions to the kernel circuits, via the PXE) to obscure their true lengths.\n///\n/// ## Syntax Justification\n///\n/// Both user-defined functions _and_ most functions in aztec-nr need access to the PrivateContext instance to\n/// read/write data. This is why you'll see the arguably-ugly pervasiveness of the \"context\" throughout your smart\n/// contract and the aztec-nr library. For example, `&mut context` is prevalent. In some languages, you can access and\n/// mutate a global variable (such as a PrivateContext instance) from a function without polluting the function's\n/// parameters. With Noir, a function must explicitly pass control of a mutable variable to another function, by\n/// reference. Since many functions in aztec-nr need to be able to push new data to the PrivateContext, they need to be\n/// handed a mutable reference _to_ the context as a parameter. For example, `Context` is prevalent as a generic\n/// parameter, to give better type safety at compile time. Many `aztec-nr` functions don't make sense if they're called\n/// in a particular runtime (private, public or utility), and so are intentionally only implemented over certain\n/// [Private|Public|Utility]Context structs. This gives smart contract developers a much faster feedback loop if\n/// they're making a mistake, as an error will be thrown by the LSP or when they compile their contract.\n///\n#[derive(Eq)]\npub struct PrivateContext {\n // docs:start:private-context\n pub inputs: PrivateContextInputs,\n pub side_effect_counter: u32,\n\n pub min_revertible_side_effect_counter: u32,\n pub is_fee_payer: bool,\n\n pub args_hash: Field,\n pub return_hash: Field,\n\n pub expiration_timestamp: u64,\n\n pub(crate) note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,\n pub(crate) nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,\n key_validation_requests_and_separators: BoundedVec<KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL>,\n\n pub note_hashes: BoundedVec<Counted<NoteHash>, MAX_NOTE_HASHES_PER_CALL>,\n pub nullifiers: BoundedVec<Counted<Nullifier>, MAX_NULLIFIERS_PER_CALL>,\n\n pub private_call_requests: BoundedVec<PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>,\n pub public_call_requests: BoundedVec<Counted<PublicCallRequest>, MAX_ENQUEUED_CALLS_PER_CALL>,\n pub public_teardown_call_request: PublicCallRequest,\n pub l2_to_l1_msgs: BoundedVec<Counted<L2ToL1Message>, MAX_L2_TO_L1_MSGS_PER_CALL>,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub anchor_block_header: BlockHeader,\n\n pub private_logs: BoundedVec<Counted<PrivateLogData>, MAX_PRIVATE_LOGS_PER_CALL>,\n pub contract_class_logs_hashes: BoundedVec<Counted<LogHash>, MAX_CONTRACT_CLASS_LOGS_PER_CALL>,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times. The index of the array corresponds to the key type (0 nullifier, 1\n // incoming, 2 outgoing, 3 tagging).\n pub last_key_validation_requests: [Option<KeyValidationRequest>; NUM_KEY_TYPES],\n\n pub expected_non_revertible_side_effect_counter: u32,\n pub expected_revertible_side_effect_counter: u32,\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n expiration_timestamp: inputs.anchor_block_header.timestamp() + MAX_TX_LIFETIME,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n anchor_block_header: inputs.anchor_block_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n\n /// Returns the contract address that initiated this function call.\n ///\n /// This is similar to `msg.sender` in Solidity (hence the name).\n ///\n /// Important Note: Since Aztec doesn't have a concept of an EoA (Externally-owned Account), the msg_sender is\n /// \"none\" for the first function call of every transaction. The first function call of a tx is likely to be a call\n /// to the user's account contract, so this quirk will most often be handled by account contract developers.\n ///\n /// # Returns\n /// * `Option<AztecAddress>` - The address of the smart contract that called this function (be it an app contract\n /// or a user's account contract). Returns `Option<AztecAddress>::none` for the first function call of the tx. No\n /// other _private_ function calls in the tx will have a `none` msg_sender, but _public_ function calls might (see\n /// the PublicContext).\n pub fn maybe_msg_sender(self) -> Option<AztecAddress> {\n let maybe_msg_sender = self.inputs.call_context.msg_sender;\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the contract address of the current function being executed.\n ///\n /// This is equivalent to `address(this)` in Solidity (hence the name). Use this to identify the current contract's\n /// address, commonly needed for access control or when interacting with other contracts.\n ///\n /// # Returns\n /// * `AztecAddress` - The contract address of the current function being executed.\n ///\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n /// Returns the chain ID of the current network.\n ///\n /// This is similar to `block.chainid` in Solidity. Returns the unique identifier for the blockchain network this\n /// transaction is executing on.\n ///\n /// Helps prevent cross-chain replay attacks. Useful if implementing multi-chain contract logic.\n ///\n /// # Returns\n /// * `Field` - The chain ID as a field element\n ///\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n /// Returns the Aztec protocol version that this transaction is executing under. Different versions may have\n /// different rules, opcodes, or cryptographic primitives.\n ///\n /// This is similar to how Ethereum has different EVM versions.\n ///\n /// Useful for forward/backward compatibility checks\n ///\n /// Not to be confused with contract versions; this is the protocol version.\n ///\n /// # Returns\n /// * `Field` - The protocol version as a field element\n ///\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n /// Returns the gas settings for the current transaction.\n ///\n /// This provides information about gas limits and pricing for the transaction, similar to `tx.gasprice` and gas\n /// limits in Ethereum. However, Aztec has a more sophisticated gas model with separate accounting for L2\n /// computation and data availability (DA) costs.\n ///\n /// # Returns\n /// * `GasSettings` - Struct containing gas limits and fee information\n ///\n pub fn gas_settings(self) -> GasSettings {\n self.inputs.tx_context.gas_settings\n }\n\n /// Returns the function selector of the currently executing function.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to access this.\n ///\n /// This is similar to `msg.sig` in Solidity, which returns the first 4 bytes of the function signature. In Aztec,\n /// the selector uniquely identifies which function within the contract is being called.\n ///\n /// # Returns\n /// * `FunctionSelector` - The 4-byte function identifier\n ///\n /// # Advanced\n /// Only #[external(\"private\")] functions have a function selector as a protocol- enshrined concept. The function\n /// selectors of private functions are baked into the preimage of the contract address, and are used by the\n /// protocol's kernel circuits to identify each private function and ensure the correct one is being executed.\n ///\n /// Used internally for function dispatch and call verification.\n ///\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n /// Returns the hash of the arguments passed to the current function.\n ///\n /// Very low-level function: You shouldn't need to call this. The #[external(\"private\")] macro calls this, and it\n /// makes the arguments neatly available to the body of your private function.\n ///\n /// # Returns\n /// * `Field` - Hash of the function arguments\n ///\n /// # Advanced\n /// * Arguments are hashed to reduce proof size and verification time\n /// * Enables efficient argument passing in recursive function calls\n /// * The hash can be used to retrieve the original arguments from the PXE.\n ///\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n /// Pushes a new note_hash to the Aztec blockchain's global Note Hash Tree (a state tree).\n ///\n /// A note_hash is a commitment to a piece of private state.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to manually call this. Aztec-nr's state\n /// variables (see `../state_vars/`) are designed to understand when to create and push new note hashes.\n ///\n /// # Arguments\n /// * `note_hash` - The new note_hash.\n ///\n /// # Advanced\n /// From here, the protocol's kernel circuits will take over and insert the note_hash into the protocol's \"note\n /// hash tree\" (in the Base Rollup circuit). Before insertion, the protocol will:\n /// - \"Silo\" the `note_hash` with the contract address of this function, to yield a `siloed_note_hash`. This\n /// prevents state collisions between different smart contracts.\n /// - Ensure uniqueness of the `siloed_note_hash`, to prevent Faerie-Gold attacks, by hashing the\n /// `siloed_note_hash` with a unique value, to yield a `unique_siloed_note_hash` (see the protocol spec for more).\n ///\n /// In addition to calling this function, aztec-nr provides the contents of the newly-created note to the PXE, via\n /// the `notify_created_note` oracle.\n ///\n /// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n /// find yourself doing this, > please open an issue on GitHub to describe your use case: it might be > that new\n /// functionality should be added to aztec-nr.\n ///\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(Counted::new(note_hash, self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::state_vars::SingleUseClaim`].\n ///\n /// In particular, callers must ensure all nullifiers created by a contract are properly domain-separated, so that\n /// unrelated components don't interfere with one another (e.g. a transaction nullifier accidentally marking a\n /// variable as initialized). Only [`PrivateContext::push_nullifier_for_note_hash`] should be used for note\n /// nullifiers, never this one.\n ///\n /// ## Advanced\n ///\n /// The raw `nullifier` is not what is inserted into the Aztec state tree: it will be first siloed by contract\n /// address via [`crate::protocol::hash::compute_siloed_nullifier`] in order to prevent accidental or malicious\n /// interference of nullifiers from different contracts.\n pub fn push_nullifier(&mut self, nullifier: Field) {\n notify_created_nullifier(nullifier);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: 0 }.count(self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier) associated with a note.\n ///\n /// This is a variant of [`PrivateContext::push_nullifier`] that is used for note nullifiers, i.e. nullifiers that\n /// correspond to a note. If a note and its nullifier are created in the same transaction, then the private kernels\n /// will 'squash' these values, deleting them both as if they never existed and reducing transaction fees.\n ///\n /// The `nullification_note_hash` must be the result of calling\n /// [`crate::note::utils::compute_confirmed_note_hash_for_nullification`] for pending notes, and `0` for settled\n /// notes (which cannot be squashed).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::note::lifecycle::destroy_note`].\n ///\n /// The precautions listed for [`PrivateContext::push_nullifier`] apply here as well, and callers should\n /// additionally ensure `nullification_note_hash` corresponds to a note emitted by this contract, with its hash\n /// computed in the same transaction execution phase as the call to this function. Finally, only this function\n /// should be used for note nullifiers, never [`PrivateContext::push_nullifier`].\n ///\n /// Failure to do these things can result in unprovable contexts, accidental deletion of notes, or double-spend\n /// attacks.\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullification_note_hash: Field) {\n let nullifier_counter = self.next_counter();\n notify_nullified_note(nullifier, nullification_note_hash, nullifier_counter);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: nullification_note_hash }.count(\n nullifier_counter,\n ));\n }\n\n /// Returns the anchor block header - the historical block header that this private function is reading from.\n ///\n /// A private function CANNOT read from the \"current\" block header, but must read from some older block header,\n /// because as soon as private function execution begins (asynchronously, on a user's device), the public state of\n /// the chain (the \"current state\") will have progressed forward.\n ///\n /// # Returns\n /// * `BlockHeader` - The anchor block header.\n ///\n /// # Advanced\n /// * All private functions of a tx read from the same anchor block header.\n /// * The protocol asserts that the `expiration_timestamp` of every tx is at most 24 hours beyond the timestamp of\n /// the tx's chosen anchor block header. This enables the network's nodes to safely prune old txs from the mempool.\n /// Therefore, the chosen block header _must_ be one from within the last 24 hours.\n ///\n pub fn get_anchor_block_header(self) -> BlockHeader {\n self.anchor_block_header\n }\n\n /// Returns the header of any historical block at or before the anchor block.\n ///\n /// This enables private contracts to access information from even older blocks than the anchor block header.\n ///\n /// Useful for time-based contract logic that needs to compare against multiple historical points.\n ///\n /// # Arguments\n /// * `block_number` - The block number to retrieve (must be <= anchor block number)\n ///\n /// # Returns\n /// * `BlockHeader` - The header of the requested historical block\n ///\n /// # Advanced\n /// This function uses an oracle to fetch block header data from the user's PXE. Depending on how much blockchain\n /// data the user's PXE has been set up to store, this might require a query from the PXE to another Aztec node to\n /// get the data. > This is generally true of all oracle getters (see `../oracle`).\n ///\n /// Each block header gets hashed and stored as a leaf in the protocol's Archive Tree. In fact, the i-th block\n /// header gets stored at the i-th leaf index of the Archive Tree. Behind the scenes, this `get_block_header_at`\n /// function will add Archive Tree merkle-membership constraints (~3k) to your smart contract function's circuit,\n /// to prove existence of the block header in the Archive Tree.\n ///\n /// Note: we don't do any caching, so avoid making duplicate calls for the same block header, because each call\n /// will add duplicate constraints.\n ///\n /// Calling this function is more expensive (constraint-wise) than getting the anchor block header (via\n /// `get_block_header`). This is because the anchor block's merkle membership proof is handled by Aztec's protocol\n /// circuits, and is only performed once for the entire tx because all private functions of a tx share a common\n /// anchor block header. Therefore, the cost (constraint-wise) of calling `get_block_header` is effectively free.\n ///\n pub fn get_block_header_at(self, block_number: u32) -> BlockHeader {\n get_block_header_at(block_number, self)\n }\n\n /// Sets the hash of the return values for this private function.\n ///\n /// Very low-level function: this is called by the #[external(\"private\")] macro.\n ///\n /// # Arguments\n /// * `serialized_return_values` - The serialized return values as a field array\n ///\n pub fn set_return_hash<let N: u32>(&mut self, serialized_return_values: [Field; N]) {\n let return_hash = hash_args(serialized_return_values);\n self.return_hash = return_hash;\n execution_cache::store(serialized_return_values, return_hash);\n }\n\n /// Builds the PrivateCircuitPublicInputs for this private function, to ensure compatibility with the protocol's\n /// kernel circuits.\n ///\n /// Very low-level function: This function is automatically called by the #[external(\"private\")] macro.\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n expiration_timestamp: self.expiration_timestamp,\n note_hash_read_requests: ClaimedLengthArray::from_bounded_vec(self.note_hash_read_requests),\n nullifier_read_requests: ClaimedLengthArray::from_bounded_vec(self.nullifier_read_requests),\n key_validation_requests_and_separators: ClaimedLengthArray::from_bounded_vec(\n self.key_validation_requests_and_separators,\n ),\n note_hashes: ClaimedLengthArray::from_bounded_vec(self.note_hashes),\n nullifiers: ClaimedLengthArray::from_bounded_vec(self.nullifiers),\n private_call_requests: ClaimedLengthArray::from_bounded_vec(self.private_call_requests),\n public_call_requests: ClaimedLengthArray::from_bounded_vec(self.public_call_requests),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: ClaimedLengthArray::from_bounded_vec(self.l2_to_l1_msgs),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: ClaimedLengthArray::from_bounded_vec(self.private_logs),\n contract_class_logs_hashes: ClaimedLengthArray::from_bounded_vec(self.contract_class_logs_hashes),\n anchor_block_header: self.anchor_block_header,\n tx_context: self.inputs.tx_context,\n expected_non_revertible_side_effect_counter: self.expected_non_revertible_side_effect_counter,\n expected_revertible_side_effect_counter: self.expected_revertible_side_effect_counter,\n }\n }\n\n /// Designates this contract as the fee payer for the transaction.\n ///\n /// Unlike Ethereum, where the transaction sender always pays fees, Aztec allows any contract to voluntarily pay\n /// transaction fees. This enables patterns like sponsored transactions or fee abstraction where users don't need\n /// to hold fee-juice themselves. (Fee juice is a fee-paying asset for Aztec).\n ///\n /// Only one contract per transaction can declare itself as the fee payer, and it must have sufficient fee-juice\n /// balance (>= the gas limits specified in the TxContext) by the time we reach the public setup phase of the tx.\n ///\n pub fn set_as_fee_payer(&mut self) {\n aztecnr_trace_log_format!(\"Setting {0} as fee payer\")([self.this_address().to_field()]);\n self.is_fee_payer = true;\n }\n\n pub fn in_revertible_phase(&mut self) -> bool {\n let current_counter = self.side_effect_counter;\n\n // Safety: Kernel will validate that the claim is correct by validating the expected counters.\n let is_revertible = unsafe { is_execution_in_revertible_phase(current_counter) };\n\n if is_revertible {\n if (self.expected_revertible_side_effect_counter == 0)\n | (current_counter < self.expected_revertible_side_effect_counter) {\n self.expected_revertible_side_effect_counter = current_counter;\n }\n } else if current_counter > self.expected_non_revertible_side_effect_counter {\n self.expected_non_revertible_side_effect_counter = current_counter;\n }\n\n is_revertible\n }\n\n /// Declares the end of the \"setup phase\" of this tx.\n ///\n /// Only one function per tx can declare the end of the setup phase.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase enables such a payment to be made, because the setup phase _cannot revert_: a reverting function within\n /// the setup phase would result in an invalid block which cannot be proven. Any side-effects generated during that\n /// phase are guaranteed to be inserted into Aztec's state trees (except for squashed notes & nullifiers, of\n /// course).\n ///\n /// Even though the end of the setup phase is declared within a private function, you might have noticed that\n /// _public_ functions can also execute within the setup phase. This is because any public function calls which\n /// were enqueued _within the setup phase_ by a private function are considered part of the setup phase.\n ///\n /// # Advanced\n /// * Sets the minimum revertible side effect counter of this tx to be the PrivateContext's _current_ side effect\n /// counter.\n ///\n pub fn end_setup(&mut self) {\n // Incrementing the side effect counter when ending setup ensures non ambiguity for the counter where we change\n // phases.\n self.side_effect_counter += 1;\n aztecnr_trace_log_format!(\"Ending setup at counter {0}\")([self.side_effect_counter as Field]);\n self.min_revertible_side_effect_counter = self.next_counter();\n notify_revertible_phase_start(self.min_revertible_side_effect_counter);\n }\n\n /// Sets a deadline (an \"include-by timestamp\") for when this transaction must be included in a block.\n ///\n /// Other functions in this tx might call this setter with differing values for the include-by timestamp. To ensure\n /// that all functions' deadlines are met, the _minimum_ of all these include-by timestamps will be exposed when\n /// this tx is submitted to the network.\n ///\n /// If the transaction is not included in a block by its include-by timestamp, it becomes invalid and it will never\n /// be included.\n ///\n /// This expiry timestamp is publicly visible. See the \"Advanced\" section for privacy concerns.\n ///\n /// # Arguments\n /// * `expiration_timestamp` - Unix timestamp (seconds) deadline for inclusion. The include-by timestamp of this tx\n /// will be _at most_ the timestamp specified.\n ///\n /// # Advanced\n /// * If multiple functions set differing `expiration_timestamp`s, the kernel circuits will set it to be the\n /// _minimum_ of the two. This ensures the tx expiry requirements of all functions in the tx are met.\n /// * Rollup circuits will reject expired txs.\n /// * The protocol enforces that all transactions must be included within 24 hours of their chosen anchor block's\n /// timestamp, to enable safe mempool pruning.\n /// * The DelayedPublicMutable design makes heavy use of this functionality, to enable private functions to read\n /// public state.\n /// * A sophisticated Wallet should cleverly set an include-by timestamp to improve the privacy of the user and the\n /// network as a whole. For example, if a contract interaction sets include-by to some publicly-known value (e.g.\n /// the time when a contract upgrades), then the wallet might wish to set an even lower one to avoid revealing that\n /// this tx is interacting with said contract. Ideally, all wallets should standardize on an approach in order to\n /// provide users with a large privacy set -- although the exact approach\n /// will need to be discussed. Wallets that deviate from a standard might accidentally reveal which wallet each\n /// transaction originates from.\n ///\n // docs:start:expiration-timestamp\n pub fn set_expiration_timestamp(&mut self, expiration_timestamp: u64) {\n // docs:end:expiration-timestamp\n self.expiration_timestamp = std::cmp::min(self.expiration_timestamp, expiration_timestamp);\n }\n\n /// Asserts that a note has been created.\n ///\n /// This function will cause the transaction to fail unless the requested note exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending notes.\n ///\n /// ## Pending Notes\n ///\n /// Both settled notes (created in prior transactions) and pending notes (created in the current transaction) will\n /// be considered by this function. Pending notes must have been created **before** this call is made for the check\n /// to pass.\n ///\n /// ## Historical Notes\n ///\n /// If you need to assert that a note existed _by some specific block in the past_, instead of simply proving that\n /// it exists by the current anchor block, use [`crate::history::note::assert_note_existed_by`] instead.\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel note hash read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_note_exists(&mut self, note_existence_request: NoteExistenceRequest) {\n // Note that the `note_hash_read_requests` array does not hold `NoteExistenceRequest` objects, but rather a\n // custom kernel type. We convert from the aztec-nr type into it.\n\n let note_hash = note_existence_request.note_hash();\n let contract_address = note_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let side_effect = Scoped::new(\n Counted::new(note_hash, self.next_counter()),\n contract_address,\n );\n\n self.note_hash_read_requests.push(side_effect);\n }\n\n /// Asserts that a nullifier has been emitted.\n ///\n /// This function will cause the transaction to fail unless the requested nullifier exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending nullifiers.\n ///\n /// ## Pending Nullifiers\n ///\n /// Both settled nullifiers (emitted in prior transactions) and pending nullifiers (emitted in the current\n /// transaction) will be considered by this function. Pending nullifiers must have been emitted **before** this\n /// call is made for the check to pass.\n ///\n /// ## Historical Nullifiers\n ///\n /// If you need to assert that a nullifier existed _by some specific block in the past_, instead of simply proving\n /// that it exists by the current anchor block, use [`crate::history::nullifier::assert_nullifier_existed_by`]\n /// instead.\n ///\n /// ## Public vs Private\n ///\n /// In general, it is unsafe to check for nullifier non-existence in private, as that will not consider the\n /// possibility of the nullifier having been emitted in any transaction between the anchor block and the inclusion\n /// block. Private functions instead prove existence via this function and 'prove' non-existence by _emitting_ the\n /// nullifer, which would cause the transaction to fail if the nullifier existed.\n ///\n /// This is not the case in public functions, which do have access to the tip of the blockchain and so can reliably\n /// prove whether a nullifier exists or not via\n /// [`crate::context::public_context::PublicContext::nullifier_exists_unsafe`].\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel nullifier read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_nullifier_exists(&mut self, nullifier_existence_request: NullifierExistenceRequest) {\n let nullifier = nullifier_existence_request.nullifier();\n let contract_address = nullifier_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let request = Scoped::new(\n Counted::new(nullifier, self.next_counter()),\n contract_address,\n );\n\n self.nullifier_read_requests.push(request);\n }\n\n /// Requests the app-siloed nullifier hiding key (nhk_app) for the given (hashed) master nullifier public key\n /// (npk_m), from the user's PXE.\n ///\n /// Advanced function: Only needed if you're designing your own notes and/or nullifiers.\n ///\n /// Contracts are not allowed to compute nullifiers for other contracts, as that would let them read parts of their\n /// private state. Because of this, a contract is only given an \"app-siloed key\", which is constructed by\n /// hashing the user's master nullifier hiding key with the contract's address. However, because contracts cannot\n /// be trusted with a user's master nullifier hiding key (because we don't know which contracts are honest or\n /// malicious), the PXE refuses to provide any master secret keys to any app smart contract function. This means\n /// app functions are unable to prove that the derivation of an app-siloed nullifier hiding key has been computed\n /// correctly. Instead, an app function can request to the kernel (via `request_nhk_app`) that it validates the\n /// siloed derivation, since the kernel has been vetted to not leak any master secret keys.\n ///\n /// A common nullification scheme is to inject a nullifier hiding key into the preimage of a nullifier, to make the\n /// nullifier deterministic but random-looking. This function enables that flow.\n ///\n /// # Arguments\n /// * `npk_m_hash` - A hash of the master nullifier public key of the user whose PXE is executing this function.\n ///\n /// # Returns\n /// * The app-siloed nullifier hiding key that corresponds to the given `npk_m_hash`.\n ///\n pub fn request_nhk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n /// Requests the app-siloed outgoing viewing secret key (ovsk_app) for the given (hashed) master outgoing\n /// viewing public key (ovpk_m), from the user's PXE.\n ///\n /// See `request_nhk_app` and `request_sk_app` for more info.\n ///\n /// The intention of the \"outgoing\" keypair is to provide a second secret key for all of a user's outgoing activity\n /// (i.e. for notes that a user creates, as opposed to notes that a user receives from others). The separation of\n /// incoming and outgoing data was a distinction made by zcash, with the intention of enabling a user to optionally\n /// share with a 3rd party a controlled view of only incoming or outgoing notes. Similar functionality of sharing\n /// select data can be achieved with offchain zero-knowledge proofs. It is up to an app developer whether they\n /// choose to make use of a user's outgoing keypair within their application logic, or instead simply use the same\n /// keypair (the address keypair (which is effectively the same as the \"incoming\" keypair)) for all incoming &\n /// outgoing messages to a user.\n ///\n /// Currently, all of the exposed encryption functions in aztec-nr ignore the outgoing viewing keys, and instead\n /// encrypt all note logs and event logs to a user's address public key.\n ///\n /// # Arguments\n /// * `ovpk_m_hash` - Hash of the outgoing viewing public key master\n ///\n /// # Returns\n /// * The application-specific outgoing viewing secret key\n ///\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n /// Pushes a Key Validation Request to the kernel.\n ///\n /// Private functions are not allowed to see a user's master secret keys, because we do not trust them. They are\n /// instead given \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then\n /// request validation of this claim, by making a \"key validation request\" to the protocol's kernel circuits (which\n /// _are_ allowed to see certain master secret keys).\n ///\n /// When a Key Validation Request tuple of (sk_app, Pk_m, app_address) is submitted to the kernel, it will perform\n /// the following derivations to validate the relationship between the claimed sk_app and the user's Pk_m:\n ///\n /// (sk_m) ----> * G ----> Pk_m\n /// | |\n /// v We use the kernel to prove this\n /// h(sk_m, app_address) | sk_app-Pk_m relationship, because app\n /// | circuits must not be trusted to see sk_m.\n /// v |\n /// sk_app - - - - - - - - -\n ///\n /// The function is named \"request_\" instead of \"get_\" to remind the user that a Key Validation Request will be\n /// emitted to the kernel.\n ///\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n let cached_request =\n self.last_key_validation_requests[key_index as u32].unwrap_or(KeyValidationRequest::empty());\n\n if cached_request.pk_m.hash() == pk_m_hash {\n // We get a match so the cached request is the latest one\n cached_request.sk_app\n } else {\n // We didn't get a match meaning the cached result is stale Typically we'd validate keys by showing that\n // they are the preimage of `pk_m_hash`, but that'd require the oracle returning the master secret keys,\n // which could cause malicious contracts to leak it or learn about secrets from other contracts. We\n // therefore silo secret keys, and rely on the private kernel to validate that we siloed secret key\n // corresponds to correct siloing of the master secret key that hashes to `pk_m_hash`.\n\n // Safety: Kernels verify that the key validation request is valid and below we verify that a request for\n // the correct public key has been received.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert(!request.pk_m.is_infinite, \"Infinite public key points are not allowed\");\n assert_eq(request.pk_m.hash(), pk_m_hash, \"Obtained invalid key validation request\");\n\n self.key_validation_requests_and_separators.push(\n KeyValidationRequestAndSeparator {\n request,\n key_type_domain_separator: public_key_domain_separators[key_index as u32],\n },\n );\n self.last_key_validation_requests[key_index as u32] = Option::some(request);\n request.sk_app\n }\n }\n\n /// Sends an \"L2 -> L1 message\" from this function (Aztec, L2) to a smart contract on Ethereum (L1). L1 contracts\n /// which are designed to send/receive messages to/from Aztec are called \"Portal Contracts\".\n ///\n /// Common use cases include withdrawals, cross-chain asset transfers, and triggering L1 actions based on L2 state\n /// changes.\n ///\n /// The message will be inserted into an Aztec \"Outbox\" contract on L1, when this transaction's block is proposed\n /// to L1. Sending the message will not result in any immediate state changes in the target portal contract. The\n /// message will need to be manually consumed from the Outbox through a separate Ethereum transaction: a user will\n /// need to call a function of the portal contract -- a function specifically designed to make a call to the Outbox\n /// to consume the message. The message will only be available for consumption once the _epoch_ proof has been\n /// submitted. Given that there are multiple Aztec blocks within an epoch, it might take some time for this epoch\n /// proof to be submitted -- especially if the block was near the start of an epoch.\n ///\n /// # Arguments\n /// * `recipient` - Ethereum address that will receive the message\n /// * `content` - Message content (32 bytes as a Field element). This content has a very\n /// specific layout. docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n let message = L2ToL1Message { recipient, content };\n self.l2_to_l1_msgs.push(message.count(self.next_counter()));\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2).\n ///\n /// Common use cases include token bridging, cross-chain governance, and triggering L2 actions based on L1 events.\n ///\n /// Use this function if you only want the message to ever be \"referred to\" once. Once consumed using this method,\n /// the message cannot be consumed again, because a nullifier is emitted. If your use case wants for the message to\n /// be read unlimited times, then you can always read any historic message from the L1-to-L2 messages tree;\n /// messages never technically get deleted from that tree.\n ///\n /// The message will first be inserted into an Aztec \"Inbox\" smart contract on L1. Sending the message will not\n /// result in any immediate state changes in the target L2 contract. The message will need to be manually consumed\n /// by the target contract through a separate Aztec transaction. The message will not be available for consumption\n /// immediately. Messages get copied over from the L1 Inbox to L2 by the next Proposer in batches. So you will need\n /// to wait until the messages are copied before you can consume them.\n ///\n /// # Arguments\n /// * `content` - The message content that was sent from L1\n /// * `secret` - Secret value used for message privacy (if needed)\n /// * `sender` - Ethereum address that sent the message\n /// * `leaf_index` - Index of the message in the L1-to-L2 message tree\n ///\n /// # Advanced\n /// Validates message existence in the L1-to-L2 message tree and nullifies the message to prevent\n /// double-consumption.\n pub fn consume_l1_to_l2_message(&mut self, content: Field, secret: Field, sender: EthAddress, leaf_index: Field) {\n let nullifier = process_l1_to_l2_message(\n self.anchor_block_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier(nullifier)\n }\n\n /// Emits a private log (an array of Fields) that will be published to an Ethereum blob.\n ///\n /// Private logs are intended for the broadcasting of ciphertexts: that is, encrypted events or encrypted note\n /// contents. Since the data in the logs is meant to be _encrypted_, private_logs are broadcast to publicly-visible\n /// Ethereum blobs. The intended recipients of such encrypted messages can then discover and decrypt these\n /// encrypted logs using their viewing secret key. (See `../messages/discovery` for more details).\n ///\n /// Important note: This function DOES NOT _do_ any encryption of the input `log` fields. This function blindly\n /// publishes whatever input `log` data is fed into it, so the caller of this function should have already\n /// performed the encryption, and the `log` should be the result of that encryption.\n ///\n /// The protocol does not dictate what encryption scheme should be used: a smart contract developer can choose\n /// whatever encryption scheme they like. Aztec-nr includes some off-the-shelf encryption libraries that developers\n /// might wish to use, for convenience. These libraries not only encrypt a plaintext (to produce a ciphertext);\n /// they also prepend the ciphertext with a `tag` and `ephemeral public key` for easier message discovery. This is\n /// a very dense topic, and we will be writing more libraries and docs soon.\n ///\n /// > Currently, AES128 CBC encryption is the main scheme included in > aztec.nr. > We are currently making\n /// significant changes to the interfaces of the > encryption library.\n ///\n /// In some niche use cases, an app might be tempted to publish _un-encrypted_ data via a private log, because\n /// _public logs_ are not available to private functions. Be warned that emitting public data via private logs is\n /// strongly discouraged, and is considered a \"privacy anti-pattern\", because it reveals identifiable information\n /// about _which_ function has been executed. A tx which leaks such information does not contribute to the privacy\n /// set of the network.\n ///\n /// * Unlike `emit_raw_note_log_unsafe`, this log is not tied to any specific note\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]` of the emitted log. Used by recipients and nodes to identify and\n /// filter for relevant logs without scanning all of them.\n /// * `log` - The log data that will be publicly broadcast (so make sure it's already been encrypted before you\n /// call this function). Private logs are bounded in size (`PRIVATE_LOG_CIPHERTEXT_LEN`), to encourage all logs\n /// from all smart contracts look identical.\n /// * `length` - The actual length of `log` (measured in number of Fields). Although the input log has a max\n /// size of `PRIVATE_LOG_CIPHERTEXT_LEN`, the latter values of the array might all be 0's for small logs. This\n /// `length` should reflect the trimmed length of the array. The protocol's kernel circuits can then append\n /// random fields as \"padding\" after the `length`, so that the logs of this smart contract look\n /// indistinguishable from (the same length as) the logs of all other applications. It's up to wallets how much\n /// padding to apply, so ideally all wallets should agree on standards for this.\n ///\n /// ## Safety\n ///\n /// The `tag` should be domain-separated (e.g. via [`crate::protocol::hash::compute_log_tag`]) to prevent\n /// collisions between logs from different sources. Without domain separation, two unrelated log types that\n /// happen to share a raw tag value become indistinguishable. Prefer the higher-level APIs\n /// ([`crate::messages::message_delivery::MessageDelivery`] for messages, `self.emit(event)` for events) which\n /// handle tagging automatically.\n pub fn emit_private_log_unsafe(&mut self, tag: Field, log: [Field; PRIVATE_LOG_CIPHERTEXT_LEN], length: u32) {\n let counter = self.next_counter();\n let full_log = [tag].concat(log);\n self.private_logs.push(PrivateLogData { log: PrivateLog::new(full_log, length + 1), note_hash_counter: 0 }\n .count(counter));\n }\n\n // TODO: rename.\n /// Emits a private log that is explicitly tied to a newly-emitted note_hash, to convey to the kernel: \"this log\n /// relates to this note\".\n ///\n /// This linkage is important in case the note gets squashed (due to being read later in this same tx), since we\n /// can then squash the log as well.\n ///\n /// See `emit_private_log_unsafe` for more info about private log emission.\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]`. See `emit_private_log_unsafe`.\n /// * `log` - The log data as an array of Field elements\n /// * `length` - The actual length of the `log` (measured in number of Fields).\n /// * `note_hash_counter` - The side-effect counter that was assigned to the new note_hash when it was pushed to\n /// this `PrivateContext`.\n ///\n /// Important: If your application logic requires the log to always be emitted regardless of note squashing,\n /// consider using `emit_private_log_unsafe` instead, or emitting additional events.\n ///\n /// ## Safety\n ///\n /// Same as [`PrivateContext::emit_private_log_unsafe`]: the `tag` should be domain-separated.\n pub fn emit_raw_note_log_unsafe(\n &mut self,\n tag: Field,\n log: [Field; PRIVATE_LOG_CIPHERTEXT_LEN],\n length: u32,\n note_hash_counter: u32,\n ) {\n let counter = self.next_counter();\n let full_log = [tag].concat(log);\n let private_log = PrivateLogData { log: PrivateLog::new(full_log, length + 1), note_hash_counter };\n self.private_logs.push(private_log.count(counter));\n }\n\n /// Emits large data blobs.\n ///\n /// This reuses the Contract Class Log channel to emit blobs of up to [`CONTRACT_CLASS_LOG_SIZE_IN_FIELDS`].\n ///\n /// ## Privacy\n ///\n /// The address of the contract emitting these blobs is revelead.\n pub fn emit_contract_class_log<let N: u32>(&mut self, log: [Field; N]) {\n let contract_address = self.this_address();\n let counter = self.next_counter();\n\n let log_to_emit: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS] =\n log.concat([0; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS - N]);\n // Note: the length is not always N, it is the number of fields we want to broadcast, omitting trailing zeros\n // to save blob space.\n // Safety: The below length is constrained in the base rollup, which will make sure that all the fields beyond\n // length are zero. However, it won't be able to check that we didn't add extra padding (trailing zeroes) or\n // that we cut trailing zeroes from the end.\n let length = unsafe { trimmed_array_length_hint(log) };\n // We hash the entire padded log to ensure a user cannot pass a shorter length and so emit incorrect shorter\n // bytecode.\n let log_hash = compute_contract_class_log_hash(log_to_emit);\n // Safety: the below only exists to broadcast the raw log, so we can provide it to the base rollup later to be\n // constrained.\n unsafe {\n notify_created_contract_class_log(contract_address, log_to_emit, length, counter);\n }\n\n self.contract_class_logs_hashes.push(LogHash { value: log_hash, length: length }.count(counter));\n }\n\n /// Calls a private function on another contract (or the same contract).\n ///\n /// Very low-level function.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n /// This enables contracts to interact with each other while maintaining privacy. This \"composability\" of private\n /// contract functions is a key feature of the Aztec network.\n ///\n /// If a user's transaction includes multiple private function calls, then by the design of Aztec, the following\n /// information will remain private[1]:\n /// - The function selectors and contract addresses of all private function calls will remain private, so an\n /// observer of the public mempool will not be able to look at a tx and deduce which private functions have been\n /// executed.\n /// - The arguments and return values of all private function calls will remain private.\n /// - The person who initiated the tx will remain private.\n /// - The notes and nullifiers and private logs that are emitted by all private function calls will (if designed\n /// well) not leak any user secrets, nor leak which functions have been executed.\n ///\n /// [1] Caveats: Some of these privacy guarantees depend on how app developers design their smart contracts. Some\n /// actions _can_ leak information, such as:\n /// - Calling an internal public function.\n /// - Calling a public function and not setting msg_sender to Option::none (feature not built yet - see github).\n /// - Calling any public function will always leak details about the nature of the transaction, so devs should be\n /// careful in their contract designs. If it can be done in a private function, then that will give the best\n /// privacy.\n /// - Not padding the side-effects of a tx to some standardized, uniform size. The kernel circuits can take hints\n /// to pad side-effects, so a wallet should be able to request for a particular amount of padding. Wallets should\n /// ideally agree on some standard.\n /// - Padding should include:\n /// - Padding the lengths of note & nullifier arrays\n /// - Padding private logs with random fields, up to some standardized size. See also:\n /// https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Advanced\n /// * The call is added to the private call stack and executed by kernel circuits after this function completes\n /// * The called function can modify its own contract's private state\n /// * Side effects from the called function are included in this transaction\n /// * The call inherits the current transaction's context and gas limits\n ///\n pub fn call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, false)\n }\n\n /// Makes a read-only call to a private function on another contract.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state, emit L2->L2 messages, nor\n /// emit events. Any nested calls are constrained to also be staticcalls.\n ///\n /// See `call_private_function` for more general info on private function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, true)\n }\n\n /// Calls a private function that takes no arguments.\n ///\n /// This is a convenience function for calling private functions that don't require any input parameters. It's\n /// equivalent to `call_private_function` but slightly more efficient to use when no arguments are needed.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, false)\n }\n\n /// Makes a read-only call to a private function which takes no arguments.\n ///\n /// This combines the optimisation of `call_private_function_no_args` with the safety of\n /// `static_call_private_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, true)\n }\n\n /// Low-level private function call.\n ///\n /// This is the underlying implementation used by all other private function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args_hash` - Pre-computed hash of the function arguments\n /// * `is_static_call` - Whether this should be a read-only call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values\n ///\n pub fn call_private_function_with_args_hash(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> ReturnsHash {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // Safety: The oracle simulates the private call and returns the value of the side effects counter after\n // execution of the call (which means that end_side_effect_counter - start_side_effect_counter is the number of\n // side effects that took place), along with the hash of the return values. We validate these by requesting a\n // private kernel iteration in which the return values are constrained to hash to `returns_hash` and the side\n // effects counter to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // TODO (fees) figure out why this crashes the prover and enable it we need this in order to pay fees inside\n // child call contexts assert(\n // (item.public_inputs.min_revertible_side_effect_counter == 0 as u32)\n // | (item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter)\n // ); if item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter { self.min_revertible_side_effect_counter =\n // item.public_inputs.min_revertible_side_effect_counter; }\n self.side_effect_counter = end_side_effect_counter + 1; // TODO: call `next_counter`\n // instead, for consistency\n ReturnsHash::new(returns_hash)\n }\n\n /// Enqueues a call to a public function to be executed later.\n ///\n /// Unlike private functions which execute immediately on the user's device, public function calls are \"enqueued\"\n /// and executed some time later by a block proposer.\n ///\n /// This means a public function cannot return any values back to a private function, because by the time the\n /// public function is being executed, the private function which called it has already completed execution. (In\n /// fact, the private function has been executed and proven, along with all other private function calls of the\n /// user's tx. A single proof of the tx has been submitted to the Aztec network, and some time later a proposer has\n /// picked the tx up from the mempool and begun executing all of the enqueued public functions).\n ///\n /// # Privacy warning Enqueueing a public function call is an inherently leaky action. Many interesting applications will require some interaction with public state, but smart contract developers should try to use public function calls sparingly, and carefully. _Internal_ public function calls are especially leaky, because they completely leak which private contract made the call. See also: https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be staticcalls.\n ///\n /// See also `call_public_function` for more important information about making private -> public function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Enqueues a call to a public function that takes no arguments.\n ///\n /// This is an optimisation for calling public functions that don't take any input parameters. It's otherwise\n /// equivalent to `call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function with no arguments.\n ///\n /// This combines the optimisation of `call_public_function_no_args` with the safety of\n /// `static_call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Low-level public function call.\n ///\n /// This is the underlying implementation used by all other public function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `call_public_function` or `static_call_public_function` instead.\n /// This function is exposed for performance optimization and advanced use cases.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let counter = self.next_counter();\n\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n let call_request = PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n /// Enqueues a public function call, and designates it to be the teardown function for this tx. Only one teardown\n /// function call can be made by a tx.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase ensures the fee payer has sufficient balance to pay the proposer their fees. The teardown phase is\n /// primarily intended to: calculate exactly how much the user owes, based on gas consumption, and refund the user\n /// any change.\n ///\n /// Note: in some cases, the cost of refunding the user (i.e. DA costs of tx side-effects) might exceed the refund\n /// amount. For app logic with fairly stable and predictable gas consumption, a material refund amount is unlikely.\n /// For app logic with unpredictable gas consumption, a refund might be important to the user (e.g. if a hefty\n /// function reverts very early). Wallet/FPC/Paymaster developers should be mindful of this.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - An array of fields to pass to the function.\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n pub fn set_public_teardown_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.set_public_teardown_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Low-level function to set the public teardown function.\n ///\n /// This is the underlying implementation for setting the teardown function call that will execute at the end of\n /// the transaction. Instead of taking raw arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `set_public_teardown_function` instead.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn set_public_teardown_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n self.public_teardown_call_request =\n PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n }\n\n /// Increments the side-effect counter.\n ///\n /// Very low-level function.\n ///\n /// # Advanced\n ///\n /// Every side-effect of a private function is given a \"side-effect counter\", based on when it is created. This\n /// PrivateContext is in charge of assigning the counters.\n ///\n /// The reason we have side-effect counters is complicated. Consider this illustrative pseudocode of inter-contract\n /// function calls:\n /// ```\n /// contract A {\n /// let x = 5; // pseudocode for storage var x.\n /// fn a1 {\n /// read x; // value: 5, counter: 1.\n /// x = x + 1;\n /// write x; // value: 6, counter: 2.\n ///\n /// B.b(); // start_counter: 2, end_counter: 4\n ///\n /// read x; // value: 36, counter: 5.\n /// x = x + 1;\n /// write x; // value: 37, counter: 6.\n /// }\n ///\n /// fn a2 {\n /// read x; // value: 6, counter: 3.\n /// x = x * x;\n /// write x; // value: 36, counter: 4.\n /// }\n /// }\n ///\n /// contract B {\n /// fn b() {\n /// A.a2();\n /// }\n /// }\n /// ```\n ///\n /// Suppose a1 is the first function called. The comments show the execution counter of each side-effect, and what\n /// the new value of `x` is.\n ///\n /// These (private) functions are processed by Aztec's kernel circuits in an order that is different from execution\n /// order: All of A.a1 is proven before B.b is proven, before A.a2 is proven. So when we're in the 2nd execution\n /// frame of A.a1 (after the call to B.b), the circuit needs to justify why x went from being `6` to `36`. But the\n /// circuit doesn't know why, and given the order of proving, the kernel hasn't _seen_ a value of 36 get written\n /// yet. The kernel needs to track big arrays of all side-effects of all private functions in a tx. Then, as it\n /// recurses and processes B.b(), it will eventually see a value of 36 get written.\n ///\n /// Suppose side-effect counters weren't exposed: The kernel would only see this ordering (in order of proof\n /// verification): [ A.a1.read, A.a1.write, A.a1.read, A.a1.write, A.a2.read, A.a2.write ]\n /// [ 5, 6, 36, 37, 6, 36 ]\n /// The kernel wouldn't know _when_ B.b() was called within A.a1(), because it can't see what's going on within an\n /// app circuit. So the kernel wouldn't know that the ordering of reads and writes should actually be: [ A.a1.read,\n /// A.a1.write, A.a2.read, A.a2.write, A.a1.read, A.a1.write ]\n /// [ 5, 6, 6, 36, 36, 37 ]\n ///\n /// And so, we introduced side-effect counters: every private function must assign side-effect counters alongside\n /// every side-effect that it emits, and also expose to the kernel the counters that it started and ended with.\n /// This gives the kernel enough information to arrange all side-effects in the correct order. It can then catch\n /// (for example) if a function tries to read state before it has been written (e.g. if A.a2() maliciously tried to\n /// read a value of x=37) (e.g. if A.a1() maliciously tried to read x=6).\n ///\n /// If a malicious app contract _lies_ and does not count correctly:\n /// - It cannot lie about its start and end counters because the kernel will catch this.\n /// - It _could_ lie about its intermediate counters:\n /// - 1. It could not increment its side-effects correctly\n /// - 2. It could label its side-effects with counters outside of its start and end counters' range. The kernel\n /// will catch 2. The kernel will not catch 1., but this would only cause corruption to the private state of the\n /// malicious contract, and not any other contracts (because a contract can only modify its own state). If a \"good\"\n /// contract is given _read access_ to a maliciously-counting contract (via an external getter function, or by\n /// reading historic state from the archive tree directly), and they then make state changes to their _own_ state\n /// accordingly, that could be dangerous. Developers should be mindful not to trust the claimed innards of external\n /// contracts unless they have audited/vetted the contracts including vetting the side-effect counter\n /// incrementation. This is a similar paradigm to Ethereum smart contract development: you must vet external\n /// contracts that your contract relies upon, and you must not make any presumptions about their claimed behaviour.\n /// (Hopefully if a contract imports a version of aztec-nr, we will get contract verification tooling that can\n /// validate the authenticity of the imported aztec-nr package, and hence infer that the side- effect counting will\n /// be correct, without having to re-audit such logic for every contract).\n ///\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n expiration_timestamp: 0,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n anchor_block_header: BlockHeader::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n}\n"
7213
7173
  },
7214
- "70": {
7174
+ "68": {
7215
7175
  "function_locations": [
7216
7176
  {
7217
7177
  "name": "<impl Eq for PublicContext>::eq",
@@ -7341,7 +7301,7 @@
7341
7301
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/public_context.nr",
7342
7302
  "source": "use crate::{\n context::gas::GasOpts,\n hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n compute_siloed_nullifier,\n },\n oracle::avm,\n};\nuse crate::protocol::{\n abis::function_selector::FunctionSelector,\n address::{AztecAddress, EthAddress},\n constants::{MAX_U32_VALUE, NULL_MSG_SENDER_CONTRACT_ADDRESS},\n traits::{Empty, FromField, Packable, Serialize, ToField},\n utils::writer::Writer,\n};\n\n/// # PublicContext\n///\n/// The **main interface** between an #[external(\"public\")] function and the Aztec blockchain.\n///\n/// An instance of the PublicContext is initialized automatically at the outset of every public function, within the\n/// #[external(\"public\")] macro, so you'll never need to consciously instantiate this yourself.\n///\n/// The instance is always named `context`, and it will always be available within the body of every\n/// #[external(\"public\")] function in your smart contract.\n///\n/// Typical usage for a smart contract developer will be to call getter methods of the PublicContext.\n///\n/// _Pushing_ data and requests to the context is mostly handled within aztec-nr's own functions, so typically a smart\n/// contract developer won't need to call any setter methods directly.\n///\n/// ## Responsibilities\n/// - Exposes contextual data to a public function:\n/// - Data relating to how this public function was called:\n/// - msg_sender, this_address\n/// - Data relating to the current blockchain state:\n/// - timestamp, block_number, chain_id, version\n/// - Gas and fee information\n/// - Provides state access:\n/// - Read/write public storage (key-value mapping)\n/// - Check existence of notes and nullifiers (Some patterns use notes & nullifiers to store public (not private)\n/// information)\n/// - Enables consumption of L1->L2 messages.\n/// - Enables calls to other public smart contract functions:\n/// - Writes data to the blockchain:\n/// - Updates to public state variables\n/// - New public logs (for events)\n/// - New L2->L1 messages\n/// - New notes & nullifiers (E.g. pushing public info to notes/nullifiers, or for completing \"partial notes\")\n///\n/// ## Key Differences from Private Execution\n///\n/// Unlike private functions -- which are executed on the user's device and which can only reference historic state --\n/// public functions are executed by a block proposer and are executed \"live\" on the _current_ tip of the chain. This\n/// means public functions can:\n/// - Read and write _current_ public state\n/// - Immediately see the effects of earlier transactions in the same block\n///\n/// Also, public functions are executed within a zkVM (the \"AVM\"), so that they can _revert_ whilst still ensuring\n/// payment to the proposer and prover. (Private functions cannot revert: they either succeed, or they cannot be\n/// included).\n///\n/// ## Optimising Public Functions\n///\n/// Using the AVM to execute public functions means they compile down to \"AVM bytecode\" instead of the ACIR that\n/// private functions (standalone circuits) compile to. Therefore the approach to optimising a public function is\n/// fundamentally different from optimising a public function.\n///\npub struct PublicContext {\n pub args_hash: Option<Field>,\n pub compute_args_hash: fn() -> Field,\n}\n\nimpl Eq for PublicContext {\n fn eq(self, other: Self) -> bool {\n (self.args_hash == other.args_hash)\n // Can't compare the function compute_args_hash\n }\n}\n\nimpl PublicContext {\n /// Creates a new PublicContext instance.\n ///\n /// Low-level function: This is called automatically by the #[external(\"public\")] macro, so you shouldn't need to\n /// be called directly by smart contract developers.\n ///\n /// # Arguments\n /// * `compute_args_hash` - Function to compute the args_hash\n ///\n /// # Returns\n /// * A new PublicContext instance\n ///\n pub fn new(compute_args_hash: fn() -> Field) -> Self {\n PublicContext { args_hash: Option::none(), compute_args_hash }\n }\n\n /// Emits a _public_ log that will be visible onchain to everyone.\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]` of the emitted log. Nodes index logs by this value, allowing\n /// clients to efficiently query for matching logs without scanning all of them.\n /// * `log` - The data to log, must implement Serialize trait.\n ///\n /// ## Safety\n ///\n /// The `tag` should be domain-separated (e.g. via [`crate::protocol::hash::compute_log_tag`]) to prevent\n /// collisions between logs from different sources. Without domain separation, two unrelated log types that\n /// happen to share a raw tag value become indistinguishable. Prefer `self.emit(event)` for events, which\n /// handles tagging automatically.\n pub fn emit_public_log_unsafe<T>(_self: Self, tag: Field, log: T)\n where\n T: Serialize,\n {\n // We use a Writer to serialize the log directly after the tag, avoiding an extra O(n) copy that would\n // result from serializing first and then prepending the tag.\n let mut writer: Writer<1 + <T as Serialize>::N> = Writer::new();\n writer.write(tag);\n Serialize::stream_serialize(log, &mut writer);\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_public_log(writer.finish().as_vector()) };\n }\n\n /// Checks if a given note hash exists in the note hash tree at a particular leaf_index.\n ///\n /// # Arguments\n /// * `note_hash` - The note hash to check for existence\n /// * `leaf_index` - The index where the note hash should be located\n ///\n /// # Returns\n /// * `bool` - True if the note hash exists at the specified index\n ///\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: u64) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::note_hash_exists(note_hash, leaf_index) } == 1\n }\n\n /// Checks if a specific L1-to-L2 message exists in the L1-to-L2 message tree at a particular leaf index.\n ///\n /// Common use cases include token bridging, cross-chain governance, and triggering L2 actions based on L1 events.\n ///\n /// This function should be called before attempting to consume an L1-to-L2 message.\n ///\n /// # Arguments\n /// * `msg_hash` - Hash of the L1-to-L2 message to check\n /// * `msg_leaf_index` - The index where the message should be located\n ///\n /// # Returns\n /// * `bool` - True if the message exists at the specified index\n ///\n /// # Advanced\n /// * Uses the AVM l1_to_l2_msg_exists opcode for tree lookup\n /// * Messages are copied from L1 Inbox to L2 by block proposers\n ///\n pub fn l1_to_l2_msg_exists(_self: Self, msg_hash: Field, msg_leaf_index: Field) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself TODO(alvaro): Make l1l2msg leaf index a u64 upstream\n unsafe { avm::l1_to_l2_msg_exists(msg_hash, msg_leaf_index as u64) } == 1\n }\n\n /// Returns `true` if an `unsiloed_nullifier` has been emitted by `contract_address`.\n ///\n /// Note that unsiloed nullifiers are not the actual values stored in the nullifier tree: they are first siloed via\n /// [`crate::hash::compute_siloed_nullifier`] with the emitting contract's address.\n ///\n /// ## Use Cases\n ///\n /// Nullifiers are typically used as a _privacy-preserving_ record of a one-time action, but they can also be used\n /// to efficiently record _public_ one-time actions as well. This is cheaper than using public storage, and has the\n /// added benefit of the nullifier being emittable from a private function.\n ///\n /// An example is to check whether a contract has been published: we emit a nullifier that is deterministic and\n /// which has a _public_ preimage.\n ///\n /// ## Public vs Private\n ///\n /// In general, one should not attempt to prove nullifier non-existence in private, as that will not consider the\n /// possibility of the nullifier having been emitted in any transaction between the anchor block and the inclusion\n /// block. Private functions instead prove existence via\n /// [`crate::context::PrivateContext::assert_nullifier_exists`]\n /// and 'prove' non-existence by _emitting_ the nullifer, which would cause the transaction to fail if the\n /// nullifier existed.\n ///\n /// This is not the case in public functions, which **do** have access to the tip of the blockchain and so can\n /// reliably prove whether a nullifier exists or not.\n ///\n /// ## Safety\n ///\n /// While it is safe to rely on this function's return value to determine if a nullifier exists or not, it is often\n /// **not** safe to infer additional information from that. In particular, it is **unsafe** to infer that the\n /// existence of a nullifier emitted from a private function implies that all other side-effects of said private\n /// execution have been completed, more concretely that any enqueued public calls have been executed.\n ///\n /// For example, if a function in contract `A` privately emits nullifier `X` and then enqueues public function `Y`,\n /// then it is **unsafe** for a contract `B` to infer that `Y` has alredy executed simply because `X` exists.\n ///\n /// This is because **all** private transaction effects are committed _before_ enqueued public functions are run\n /// (in\n /// order to not reveal detailed timing information about the transaction), so it is possible to observe a\n /// nullifier that was emitted alongside the enqueuing of a public call **before** said call has been completed.\n ///\n /// ## Cost\n ///\n /// This emits the `CHECKNULLIFIEREXISTS` opcode, which conceptually performs a merkle inclusion proof on the\n /// nullifier tree (both when the nullifier exists and when it doesn't).\n pub fn nullifier_exists_unsafe(_self: Self, unsiloed_nullifier: Field, contract_address: AztecAddress) -> bool {\n let siloed_nullifier = compute_siloed_nullifier(contract_address, unsiloed_nullifier);\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::nullifier_exists(siloed_nullifier) } == 1\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2) -- effectively marking it as \"read\".\n ///\n /// Use this function if you only want the message to ever be \"referred to\" once. Once consumed using this method,\n /// the message cannot be consumed again, because a nullifier is emitted. If your use case wants for the message to\n /// be read unlimited times, then you can always read any historic message from the L1-to-L2 messages tree, using\n /// the `l1_to_l2_msg_exists` method. Messages never technically get deleted from that tree.\n ///\n /// The message will first be inserted into an Aztec \"Inbox\" smart contract on L1. It will not be available for\n /// consumption immediately. Messages get copied-over from the L1 Inbox to L2 by the next Proposer in batches. So\n /// you will need to wait until the messages are copied before you can consume them.\n ///\n /// # Arguments\n /// * `content` - The message content that was sent from L1\n /// * `secret` - Secret value used for message privacy (if needed)\n /// * `sender` - Ethereum address that sent the message\n /// * `leaf_index` - Index of the message in the L1-to-L2 message tree\n ///\n /// # Advanced\n /// * Validates message existence in the L1-to-L2 message tree\n /// * Prevents double-consumption by emitting a nullifier\n /// * Message hash is computed from all parameters + chain context\n /// * Will revert if message doesn't exist or was already consumed\n ///\n pub fn consume_l1_to_l2_message(self: Self, content: Field, secret: Field, sender: EthAddress, leaf_index: Field) {\n let secret_hash = compute_secret_hash(secret);\n let message_hash = compute_l1_to_l2_message_hash(\n sender,\n self.chain_id(),\n /*recipient=*/\n self.this_address(),\n self.version(),\n content,\n secret_hash,\n leaf_index,\n );\n let nullifier = compute_l1_to_l2_message_nullifier(message_hash, secret);\n\n assert(!self.nullifier_exists_unsafe(nullifier, self.this_address()), \"L1-to-L2 message is already nullified\");\n assert(self.l1_to_l2_msg_exists(message_hash, leaf_index), \"Tried to consume nonexistent L1-to-L2 message\");\n\n self.push_nullifier(nullifier);\n }\n\n /// Sends an \"L2 -> L1 message\" from this function (Aztec, L2) to a smart contract on Ethereum (L1). L1 contracts\n /// which are designed to send/receive messages to/from Aztec are called \"Portal Contracts\".\n ///\n /// Common use cases include withdrawals, cross-chain asset transfers, and triggering L1 actions based on L2 state\n /// changes.\n ///\n /// The message will be inserted into an Aztec \"Outbox\" contract on L1, when this transaction's block is proposed\n /// to L1. Sending the message will not result in any immediate state changes in the target portal contract. The\n /// message will need to be manually consumed from the Outbox through a separate Ethereum transaction: a user will\n /// need to call a function of the portal contract -- a function specifically designed to make a call to the Outbox\n /// to consume the message. The message will only be available for consumption once the _epoch_ proof has been\n /// submitted. Given that there are multiple Aztec blocks within an epoch, it might take some time for this epoch\n /// proof to be submitted -- especially if the block was near the start of an epoch.\n ///\n /// # Arguments\n /// * `recipient` - Ethereum address that will receive the message\n /// * `content` - Message content (32 bytes as a Field element)\n ///\n pub fn message_portal(_self: Self, recipient: EthAddress, content: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::send_l2_to_l1_msg(recipient, content) };\n }\n\n /// Calls a public function on another contract.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - Function to call on the target contract\n /// * `args` - Arguments to pass to the function\n /// * `gas_opts` - An optional allocation of gas to the called function.\n ///\n /// # Returns\n /// * `[Field]` - Return data from the called function\n ///\n pub unconstrained fn call_public_function<let N: u32>(\n _self: Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; N],\n gas_opts: GasOpts,\n ) -> [Field] {\n let calldata = [function_selector.to_field()].concat(args);\n\n avm::call(\n gas_opts.l2_gas.unwrap_or(MAX_U32_VALUE),\n gas_opts.da_gas.unwrap_or(MAX_U32_VALUE),\n contract_address,\n calldata,\n );\n // Use success_copy to determine whether the call succeeded\n let success = avm::success_copy();\n\n let result_data = avm::returndata_copy(0, avm::returndata_size());\n if !success {\n // Rethrow the revert data.\n avm::revert(result_data);\n }\n result_data\n }\n\n /// Makes a read-only call to a public function on another contract.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be staticcalls.\n ///\n /// Useful for querying data from other contracts safely.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - Function to call on the target contract\n /// * `args` - Array of arguments to pass to the called function\n /// * `gas_opts` - An optional allocation of gas to the called function.\n ///\n /// # Returns\n /// * `[Field]` - Return data from the called function\n ///\n pub unconstrained fn static_call_public_function<let N: u32>(\n _self: Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; N],\n gas_opts: GasOpts,\n ) -> [Field] {\n let calldata = [function_selector.to_field()].concat(args);\n\n avm::call_static(\n gas_opts.l2_gas.unwrap_or(MAX_U32_VALUE),\n gas_opts.da_gas.unwrap_or(MAX_U32_VALUE),\n contract_address,\n calldata,\n );\n // Use success_copy to determine whether the call succeeded\n let success = avm::success_copy();\n\n let result_data = avm::returndata_copy(0, avm::returndata_size());\n if !success {\n // Rethrow the revert data.\n avm::revert(result_data);\n }\n result_data\n }\n\n /// Adds a new note hash to the Aztec blockchain's global Note Hash Tree.\n ///\n /// Notes are ordinarily constructed and emitted by _private_ functions, to ensure that both the content of the\n /// note, and the contract that emitted the note, stay private.\n ///\n /// There are however some useful patterns whereby a note needs to contain _public_ data. The ability to push a new\n /// note_hash from a _public_ function means that notes can be injected with public data immediately -- as soon as\n /// the public value is known. The slower alternative would be to submit a follow-up transaction so that a private\n /// function can inject the data. Both are possible on Aztec.\n ///\n /// Search \"Partial Note\" for a very common pattern which enables a note to be \"partially\" populated with some data\n /// in a _private_ function, and then later \"completed\" with some data in a public function.\n ///\n /// # Arguments\n /// * `note_hash` - The hash of the note to add to the tree\n ///\n /// # Advanced\n /// * The note hash will be siloed with the contract address by the protocol\n ///\n pub fn push_note_hash(_self: Self, note_hash: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_note_hash(note_hash) };\n }\n\n /// Creates a new [nullifier](crate::nullifier).\n ///\n /// While nullifiers are primarily intended as a _privacy-preserving_ record of a one-time action, they can also\n /// be used to efficiently record _public_ one-time actions. This function allows creating nullifiers from public\n /// contract functions, which behave just like those created from private functions.\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n ///\n /// In particular, callers must ensure all nullifiers created by a contract are properly domain-separated, so that\n /// unrelated components don't interfere with one another (e.g. a transaction nullifier accidentally marking a\n /// variable as initialized). Note nullifiers should only be created via\n /// [`crate::context::PrivateContext::push_nullifier_for_note_hash`].\n ///\n /// ## Advanced\n ///\n /// The raw `nullifier` is not what is inserted into the Aztec state tree: it will be first siloed by contract\n /// address via [`crate::protocol::hash::compute_siloed_nullifier`] in order to prevent accidental or malicious\n /// interference of nullifiers from different contracts.\n pub fn push_nullifier(_self: Self, nullifier: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_nullifier(nullifier) };\n }\n\n /// Returns the address of the current contract being executed.\n ///\n /// This is equivalent to `address(this)` in Solidity (hence the name). Use this to identify the current contract's\n /// address, commonly needed for access control or when interacting with other contracts.\n ///\n /// # Returns\n /// * `AztecAddress` - The contract address of the current function being executed.\n ///\n pub fn this_address(_self: Self) -> AztecAddress {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::address()\n }\n }\n\n /// Returns the contract address that initiated this function call.\n ///\n /// This is similar to `msg.sender` in Solidity (hence the name).\n ///\n /// Important Note: If the calling function is a _private_ function, then it had the option of hiding its address\n /// when enqueuing this public function call. In such cases, this method will return `Option<AztecAddress>::none`.\n /// If the calling function is a _public_ function, it will always return an `Option<AztecAddress>::some` (i.e. a\n /// non-null value).\n ///\n /// # Returns\n /// * `Option<AztecAddress>` - The address of the smart contract that called this function (be it an app contract\n /// or a user's account contract).\n ///\n /// # Advanced\n /// * Value is provided by the AVM sender opcode\n /// * In nested calls, this is the immediate caller, not the original transaction sender\n ///\n pub fn maybe_msg_sender(_self: Self) -> Option<AztecAddress> {\n // Safety: AVM opcodes are constrained by the AVM itself\n let maybe_msg_sender = unsafe { avm::sender() };\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the function selector of the currently-executing function.\n ///\n /// This is similar to `msg.sig` in Solidity, returning the first 4 bytes of the function signature.\n ///\n /// # Returns\n /// * `FunctionSelector` - The 4-byte function identifier\n ///\n /// # Advanced\n /// * Extracted from the first element of calldata\n /// * Used internally for function dispatch in the AVM\n ///\n pub fn selector(_self: Self) -> FunctionSelector {\n // The selector is the first element of the calldata when calling a public function through dispatch.\n // Safety: AVM opcodes are constrained by the AVM itself.\n let raw_selector: [Field; 1] = unsafe { avm::calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\n\n /// Returns the hash of the arguments passed to the current function.\n ///\n /// Very low-level function: The #[external(\"public\")] macro uses this internally. Smart contract developers\n /// typically won't need to access this directly as arguments are automatically made available.\n ///\n /// # Returns\n /// * `Field` - Hash of the function arguments\n ///\n pub fn get_args_hash(mut self) -> Field {\n if !self.args_hash.is_some() {\n self.args_hash = Option::some((self.compute_args_hash)());\n }\n\n self.args_hash.unwrap_unchecked()\n }\n\n /// Returns the \"transaction fee\" for the current transaction. This is the final tx fee that will be deducted from\n /// the fee_payer's \"fee-juice\" balance (in the protocol's Base Rollup circuit).\n ///\n /// # Returns\n /// * `Field` - The actual, final cost of the transaction, taking into account: the actual gas used during the\n /// setup and app-logic phases, and the fixed amount of gas that's been allocated by the user for the teardown\n /// phase. I.e. effectiveL2FeePerGas * l2GasUsed + effectiveDAFeePerGas * daGasUsed\n ///\n /// This will return `0` during the \"setup\" and \"app-logic\" phases of tx execution (because the final tx fee is not\n /// known at that time). This will only return a nonzero value during the \"teardown\" phase of execution, where the\n /// final tx fee can actually be computed.\n ///\n /// Regardless of _when_ this function is called during the teardown phase, it will always return the same final tx\n /// fee value. The teardown phase does not consume a variable amount of gas: it always consumes a pre-allocated\n /// amount of gas, as specified by the user when they generate their tx.\n ///\n pub fn transaction_fee(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::transaction_fee()\n }\n }\n\n /// Returns the chain ID of the current network.\n ///\n /// This is similar to `block.chainid` in Solidity. Returns the unique identifier for the blockchain network this\n /// transaction is executing on.\n ///\n /// Helps prevent cross-chain replay attacks. Useful if implementing multi-chain contract logic.\n ///\n /// # Returns\n /// * `Field` - The chain ID as a field element\n ///\n pub fn chain_id(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::chain_id()\n }\n }\n\n /// Returns the Aztec protocol version that this transaction is executing under. Different versions may have\n /// different rules, opcodes, or cryptographic primitives.\n ///\n /// This is similar to how Ethereum has different EVM versions.\n ///\n /// Useful for forward/backward compatibility checks\n ///\n /// Not to be confused with contract versions; this is the protocol version.\n ///\n /// # Returns\n /// * `Field` - The protocol version as a field element\n ///\n pub fn version(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::version()\n }\n }\n /// Returns the current block number.\n ///\n /// This is similar to `block.number` in Solidity.\n ///\n /// Note: the current block number is only available within a public function (as opposed to a private function).\n ///\n /// Note: the time intervals between blocks should not be relied upon as being consistent:\n /// - Timestamps of blocks fall within a range, rather than at exact regular intervals.\n /// - Slots can be missed.\n /// - Protocol upgrades can completely change the intervals between blocks (and indeed the current roadmap plans to\n /// reduce the time between blocks, eventually). Use `context.timestamp()` for more-reliable time-based logic.\n ///\n /// # Returns\n /// * `u32` - The current block number\n ///\n pub fn block_number(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::block_number()\n }\n }\n\n /// Returns the timestamp of the current block.\n ///\n /// This is similar to `block.timestamp` in Solidity.\n ///\n /// All functions of all transactions in a block share the exact same timestamp (even though technically each\n /// transaction is executed one-after-the-other).\n ///\n /// Important note: Timestamps of Aztec blocks are not at reliably-fixed intervals. The proposer of the block has\n /// some flexibility to choose a timestamp which is in a valid _range_: Obviously the timestamp of this block must\n /// be strictly greater than that of the previous block, and must must be less than the timestamp of whichever\n /// ethereum block the aztec block is proposed to. Furthermore, if the timestamp is not deemed close enough to the\n /// actual current time, the committee of validators will not attest to the block.\n ///\n /// # Returns\n /// * `u64` - Unix timestamp in seconds\n ///\n pub fn timestamp(_self: Self) -> u64 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::timestamp()\n }\n }\n\n /// Returns the fee per unit of L2 gas for this transaction (aka the \"L2 gas price\"), as chosen by the user.\n ///\n /// L2 gas covers the cost of executing public functions and handling side-effects within the AVM.\n ///\n /// # Returns\n /// * `u128` - Fee per unit of L2 gas\n ///\n /// Wallet developers should be mindful that the choice of gas price (which is publicly visible) can leak\n /// information about the user, e.g.:\n /// - which wallet software the user is using;\n /// - the amount of time which has elapsed from the time the user's wallet chose a gas price (at the going rate),\n /// to the time of tx submission. This can give clues about the proving time, and hence the nature of the tx.\n /// - the urgency of the transaction (which is kind of unavoidable, if the tx is indeed urgent).\n /// - the wealth of the user.\n /// - the exact user (if the gas price is explicitly chosen by the user to be some unique number like 0.123456789,\n /// or their favorite number). Wallet devs might wish to consider fuzzing the choice of gas price.\n ///\n pub fn min_fee_per_l2_gas(_self: Self) -> u128 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::min_fee_per_l2_gas()\n }\n }\n\n /// Returns the fee per unit of DA (Data Availability) gas (aka the \"DA gas price\").\n ///\n /// DA gas covers the cost of making transaction data available on L1.\n ///\n /// See the warning in `min_fee_per_l2_gas` for how gas prices can be leaky.\n ///\n /// # Returns\n /// * `u128` - Fee per unit of DA gas\n ///\n pub fn min_fee_per_da_gas(_self: Self) -> u128 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::min_fee_per_da_gas()\n }\n }\n\n /// Returns the remaining L2 gas available for this transaction.\n ///\n /// Different AVM opcodes consume different amounts of gas.\n ///\n /// # Returns\n /// * `u32` - Remaining L2 gas units\n ///\n pub fn l2_gas_left(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::l2_gas_left()\n }\n }\n\n /// Returns the remaining DA (Data Availability) gas available for this transaction.\n ///\n /// DA gas is consumed when emitting data that needs to be made available on L1, such as public logs or state\n /// updates. All of the side-effects from the private part of the tx also consume DA gas before execution of any\n /// public functions even begins.\n ///\n /// # Returns\n /// * `u32` - Remaining DA gas units\n ///\n pub fn da_gas_left(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::da_gas_left()\n }\n }\n\n /// Checks if the current execution is within a staticcall context, where no state changes or logs are allowed to\n /// be emitted (by this function or any nested function calls).\n ///\n /// # Returns\n /// * `bool` - True if in staticcall context, false otherwise\n ///\n pub fn is_static_call(_self: Self) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::is_static_call() } == 1\n }\n\n /// Reads raw field values from public storage. Reads N consecutive storage slots starting from the given slot.\n ///\n /// Very low-level function. Users should typically use the public state variable abstractions to perform reads:\n /// PublicMutable & PublicImmutable.\n ///\n /// # Arguments\n /// * `storage_slot` - The starting storage slot to read from\n ///\n /// # Returns\n /// * `[Field; N]` - Array of N field values from consecutive storage slots\n ///\n /// # Generic Parameters\n /// * `N` - the number of consecutive slots to return, starting from the `storage_slot`.\n ///\n pub fn raw_storage_read<let N: u32>(self: Self, storage_slot: Field) -> [Field; N] {\n let mut out = [0; N];\n for i in 0..N {\n // Safety: AVM opcodes are constrained by the AVM itself\n out[i] = unsafe { avm::storage_read(storage_slot + i as Field, self.this_address().to_field()) };\n }\n out\n }\n\n /// Reads a typed value from public storage.\n ///\n /// Low-level function. Users should typically use the public state variable abstractions to perform reads:\n /// PublicMutable & PublicImmutable.\n ///\n /// # Arguments\n /// * `storage_slot` - The storage slot to read from\n ///\n /// # Returns\n /// * `T` - The deserialized value from storage\n ///\n /// # Generic Parameters\n /// * `T` - The type that the caller expects to read from the `storage_slot`.\n ///\n pub fn storage_read<T>(self, storage_slot: Field) -> T\n where\n T: Packable,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n\n /// Writes raw field values to public storage. Writes to N consecutive storage slots starting from the given slot.\n ///\n /// Very low-level function. Users should typically use the public state variable abstractions to perform writes:\n /// PublicMutable & PublicImmutable.\n ///\n /// Public storage writes take effect immediately.\n ///\n /// # Arguments\n /// * `storage_slot` - The starting storage slot to write to\n /// * `values` - Array of N Fields to write to storage\n ///\n pub fn raw_storage_write<let N: u32>(_self: Self, storage_slot: Field, values: [Field; N]) {\n for i in 0..N {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n /// Writes a typed value to public storage.\n ///\n /// Low-level function. Users should typically use the public state variable abstractions to perform writes:\n /// PublicMutable & PublicImmutable.\n ///\n /// # Arguments\n /// * `storage_slot` - The storage slot to write to\n /// * `value` - The typed value to write to storage\n ///\n /// # Generic Parameters\n /// * `T` - The type to write to storage.\n ///\n pub fn storage_write<T>(self, storage_slot: Field, value: T)\n where\n T: Packable,\n {\n self.raw_storage_write(storage_slot, value.pack());\n }\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n"
7343
7303
  },
7344
- "71": {
7304
+ "69": {
7345
7305
  "function_locations": [
7346
7306
  {
7347
7307
  "name": "ReturnsHash::new",
@@ -7367,7 +7327,7 @@
7367
7327
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/returns_hash.nr",
7368
7328
  "source": "use crate::{hash::hash_args, oracle::execution_cache};\nuse crate::protocol::traits::Deserialize;\n\n/// The hash of a private contract function call's return value.\n///\n/// Use [`ReturnsHash::get_preimage`] to get the underlying value.\n///\n/// The kernels don't process the actual return values but instead their hashes, so it is up to contracts to populate\n/// oracles with the preimages of these hashes on return to make them available to their callers.\n///\n/// Public calls don't utilize this mechanism since the AVM does process the full return values.\npub struct ReturnsHash {\n hash: Field,\n}\n\nimpl ReturnsHash {\n pub fn new(hash: Field) -> Self {\n ReturnsHash { hash }\n }\n\n /// Fetches the underlying return value from an oracle, constraining that it corresponds to the return data hash.\n pub fn get_preimage<T>(self) -> T\n where\n T: Deserialize,\n {\n // Safety: We verify that the value returned by `load` is the preimage of `hash`, fully constraining it. If `T`\n // is `()`, then `preimage` must be an array of length 0 (since that is `()`'s deserialization length).\n // `hash_args` handles empty arrays following the protocol rules (i.e. an empty args array is signaled with a\n // zero hash), correctly constraining `self.hash`.\n let preimage = unsafe { execution_cache::load(self.hash) };\n assert_eq(self.hash, hash_args(preimage), \"Preimage mismatch\");\n\n Deserialize::deserialize(preimage)\n }\n}\n\nmod test {\n use crate::{\n hash::hash_args,\n oracle::execution_cache,\n test::{helpers::test_environment::TestEnvironment, mocks::MockStruct},\n };\n use crate::protocol::traits::Serialize;\n use super::ReturnsHash;\n use std::test::OracleMock;\n\n #[test]\n unconstrained fn retrieves_preimage() {\n let env = TestEnvironment::new();\n env.private_context(|_| {\n let value = MockStruct::new(4, 7);\n let serialized = value.serialize();\n\n let hash = hash_args(serialized);\n execution_cache::store(serialized, hash);\n\n assert_eq(ReturnsHash::new(hash).get_preimage(), value);\n });\n }\n\n #[test]\n unconstrained fn retrieves_empty_preimage() {\n let env = TestEnvironment::new();\n env.private_context(|_| {\n let value = ();\n let serialized = [];\n\n let hash = hash_args(serialized);\n execution_cache::store(serialized, hash);\n\n assert_eq(ReturnsHash::new(hash).get_preimage(), value);\n });\n }\n\n #[test(should_fail_with = \"Preimage mismatch\")]\n unconstrained fn rejects_bad_preimage() {\n let value = MockStruct::new(4, 7);\n let serialized = value.serialize();\n\n let mut bad_serialized = serialized;\n bad_serialized[0] += 1;\n\n let hash = hash_args(serialized);\n\n let _ = OracleMock::mock(\"aztec_prv_getHashPreimage\").returns(bad_serialized);\n assert_eq(ReturnsHash::new(hash).get_preimage(), value);\n }\n}\n"
7369
7329
  },
7370
- "72": {
7330
+ "70": {
7371
7331
  "function_locations": [
7372
7332
  {
7373
7333
  "name": "UtilityContext::new",
@@ -7413,7 +7373,7 @@
7413
7373
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/utility_context.nr",
7414
7374
  "source": "use crate::oracle::{execution::get_utility_context, storage::storage_read};\nuse crate::protocol::{abis::block_header::BlockHeader, address::AztecAddress, traits::Packable};\n\n// If you'll modify this struct don't forget to update utility_context.ts as well.\npub struct UtilityContext {\n block_header: BlockHeader,\n contract_address: AztecAddress,\n}\n\nimpl UtilityContext {\n pub unconstrained fn new() -> Self {\n get_utility_context()\n }\n\n pub unconstrained fn at(contract_address: AztecAddress) -> Self {\n // We get a context with default contract address, and then we construct the final context with the provided\n // contract address.\n let default_context = get_utility_context();\n\n Self { block_header: default_context.block_header, contract_address }\n }\n\n pub fn block_header(self) -> BlockHeader {\n self.block_header\n }\n\n pub fn block_number(self) -> u32 {\n self.block_header.block_number()\n }\n\n pub fn timestamp(self) -> u64 {\n self.block_header.timestamp()\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.contract_address\n }\n\n pub fn version(self) -> Field {\n self.block_header.version()\n }\n\n pub fn chain_id(self) -> Field {\n self.block_header.chain_id()\n }\n\n pub unconstrained fn raw_storage_read<let N: u32>(self: Self, storage_slot: Field) -> [Field; N] {\n storage_read(self.block_header, self.this_address(), storage_slot)\n }\n\n pub unconstrained fn storage_read<T>(self, storage_slot: Field) -> T\n where\n T: Packable,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n}\n"
7415
7375
  },
7416
- "74": {
7376
+ "72": {
7417
7377
  "function_locations": [
7418
7378
  {
7419
7379
  "name": "ContractSelfPublic<Storage, CallSelf, CallSelfStatic, CallInternal>::new",
@@ -7439,7 +7399,7 @@
7439
7399
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/contract_self/contract_self_public.nr",
7440
7400
  "source": "//! The `self` contract value for public execution contexts.\n\nuse crate::{\n context::{calls::{PublicCall, PublicStaticCall}, PublicContext},\n event::{event_emission::emit_event_in_public, event_interface::EventInterface},\n};\nuse crate::protocol::{address::AztecAddress, traits::{Deserialize, Serialize}};\n\n/// Core interface for interacting with aztec-nr contract features in public execution contexts.\n///\n/// This struct is automatically injected into every [`external`](crate::macros::functions::external) and\n/// [`internal`](crate::macros::functions::internal) contract function marked with `\"public\"` by the Aztec macro\n/// system and is accessible through the `self` variable.\n///\n/// ## Type Parameters\n///\n/// - `Storage`: The contract's storage struct (defined with [`storage`](crate::macros::storage::storage), or `()` if\n/// the contract has no storage\n/// - `CallSelf`: Macro-generated type for calling contract's own non-view functions\n/// - `CallSelfStatic`: Macro-generated type for calling contract's own view functions\n/// - `CallInternal`: Macro-generated type for calling internal functions\npub struct ContractSelfPublic<Storage, CallSelf, CallSelfStatic, CallInternal> {\n /// The address of this contract\n pub address: AztecAddress,\n\n /// The contract's storage instance, representing the struct to which the\n /// [`storage`](crate::macros::storage::storage) macro was applied in your contract. If the contract has no\n /// storage, the type of this will be `()`.\n ///\n /// This storage instance is specialized for the current execution context (public) and\n /// provides access to the contract's state variables.\n ///\n /// ## Developer Note\n ///\n /// If you've arrived here while trying to access your contract's storage while the `Storage` generic type is set\n /// to unit type `()`, it means you haven't yet defined a Storage struct using the\n /// [`storage`](crate::macros::storage::storage) macro in your contract. For guidance on setting this up, please\n /// refer to our docs: https://docs.aztec.network/developers/docs/guides/smart_contracts/storage\n pub storage: Storage,\n\n /// The public execution context.\n pub context: PublicContext,\n\n /// Provides type-safe methods for calling this contract's own non-view functions.\n ///\n /// Example API:\n /// ```noir\n /// self.call_self.some_public_function(args)\n /// ```\n pub call_self: CallSelf,\n\n /// Provides type-safe methods for calling this contract's own view functions.\n ///\n /// Example API:\n /// ```noir\n /// self.call_self_static.some_view_function(args)\n /// ```\n pub call_self_static: CallSelfStatic,\n\n /// Provides type-safe methods for calling internal functions.\n ///\n /// Example API:\n /// ```noir\n /// self.internal.some_internal_function(args)\n /// ```\n pub internal: CallInternal,\n}\n\nimpl<Storage, CallSelf, CallSelfStatic, CallInternal> ContractSelfPublic<Storage, CallSelf, CallSelfStatic, CallInternal> {\n /// Creates a new `ContractSelfPublic` instance for a public function.\n ///\n /// This constructor is called automatically by the macro system and should not be called directly.\n pub fn new(\n context: PublicContext,\n storage: Storage,\n call_self: CallSelf,\n call_self_static: CallSelfStatic,\n internal: CallInternal,\n ) -> Self {\n Self { context, storage, address: context.this_address(), call_self, call_self_static, internal }\n }\n\n /// The address of the contract address that made this function call.\n ///\n /// This is similar to Solidity's `msg.sender` value.\n ///\n /// ## Incognito Calls\n ///\n /// Contracts can call public functions from private ones hiding their identity (see\n ///\n /// [`ContractSelfPrivate::enqueue_incognito`](crate::contract_self::ContractSelfPrivate::enqueue_incognito)).\n /// This function reverts when executed in such a context.\n ///\n /// If you need to handle these cases, use [`PublicContext::maybe_msg_sender`].\n pub fn msg_sender(self: Self) -> AztecAddress {\n self.context.maybe_msg_sender().unwrap()\n }\n\n /// Emits an event publicly.\n ///\n /// Public events are emitted as plaintext and are therefore visible to everyone. This is is the same as Solidity\n /// events on EVM chains.\n ///\n /// Unlike private events, they don't require delivery of an event message.\n ///\n /// # Example\n /// ```noir\n /// #[event]\n /// struct Update { value: Field }\n ///\n /// #[external(\"public\")]\n /// fn publish_update(value: Field) {\n /// self.emit(Update { value });\n /// }\n /// ```\n ///\n /// # Cost\n ///\n /// Public event emission is achieved by emitting public transaction logs. A total of `N+1` fields are emitted,\n /// where `N` is the serialization length of the event.\n pub fn emit<Event>(&mut self, event: Event)\n where\n Event: EventInterface + Serialize,\n {\n emit_event_in_public(self.context, event);\n }\n\n /// Makes a public contract call.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `call` - The object representing the public function to invoke.\n ///\n /// # Returns\n /// * `T` - Whatever data the called function has returned.\n ///\n /// # Example\n /// ```noir\n /// self.call(Token::at(address).transfer_in_public(recipient, amount));\n /// ```\n ///\n pub unconstrained fn call<let M: u32, let N: u32, T>(self, call: PublicCall<M, N, T>) -> T\n where\n T: Deserialize,\n {\n call.call(self.context)\n }\n\n /// Makes a public read-only contract call.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be static calls.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `call` - The object representing the read-only public function to invoke.\n ///\n /// # Returns\n /// * `T` - Whatever data the called function has returned.\n ///\n /// # Example\n /// ```noir\n /// self.view(Token::at(address).balance_of_public(recipient));\n /// ```\n ///\n pub unconstrained fn view<let M: u32, let N: u32, T>(self, call: PublicStaticCall<M, N, T>) -> T\n where\n T: Deserialize,\n {\n call.view(self.context)\n }\n}\n"
7441
7401
  },
7442
- "78": {
7402
+ "76": {
7443
7403
  "function_locations": [
7444
7404
  {
7445
7405
  "name": "compute_private_event_commitment",
@@ -7461,37 +7421,37 @@
7461
7421
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/event/event_interface.nr",
7462
7422
  "source": "use crate::{event::EventSelector, messages::logs::event::MAX_EVENT_SERIALIZED_LEN};\nuse crate::protocol::{\n constants::DOM_SEP__EVENT_COMMITMENT,\n hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_bounded_vec},\n traits::{Serialize, ToField},\n};\n\npub trait EventInterface {\n fn get_event_type_id() -> EventSelector;\n}\n\n/// A private event's commitment is a value stored on-chain which is used to verify that the event was indeed emitted.\n///\n/// It requires a `randomness` value that must be produced alongside the event in order to perform said validation.\n/// This random value prevents attacks in which someone guesses plausible events (e.g. 'Alice transfers to Bob an\n/// amount of 10'), since they will not be able to test for existence of their guessed events without brute-forcing the\n/// entire `Field` space by guessing `randomness` values.\npub fn compute_private_event_commitment<Event>(event: Event, randomness: Field) -> Field\nwhere\n Event: EventInterface + Serialize,\n{\n poseidon2_hash_with_separator(\n [randomness, Event::get_event_type_id().to_field()].concat(event.serialize()),\n DOM_SEP__EVENT_COMMITMENT,\n )\n}\n\n/// Unconstrained variant of [`compute_private_event_commitment`] which takes the event in serialized form.\n///\n/// This function is unconstrained as the mechanism it uses to compute the commitment would be very inefficient in a\n/// constrained environment (due to the hashing of a dynamically sized array). This is not an issue as it is typically\n/// invoked when processing event messages, which is an unconstrained operation.\npub unconstrained fn compute_private_serialized_event_commitment(\n serialized_event: BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>,\n randomness: Field,\n event_type_id: Field,\n) -> Field {\n let mut commitment_preimage =\n BoundedVec::<_, 2 + MAX_EVENT_SERIALIZED_LEN>::from_array([randomness, event_type_id]);\n commitment_preimage.extend_from_bounded_vec(serialized_event);\n\n poseidon2_hash_with_separator_bounded_vec(commitment_preimage, DOM_SEP__EVENT_COMMITMENT)\n}\n\nmod test {\n use crate::event::event_interface::{\n compute_private_event_commitment, compute_private_serialized_event_commitment, EventInterface,\n };\n use crate::messages::logs::event::MAX_EVENT_SERIALIZED_LEN;\n use crate::protocol::traits::{Serialize, ToField};\n use crate::test::mocks::mock_event::MockEvent;\n\n global VALUE: Field = 7;\n global RANDOMNESS: Field = 10;\n\n #[test]\n unconstrained fn max_size_serialized_event_commitment() {\n let serialized_event = BoundedVec::from_array([0; MAX_EVENT_SERIALIZED_LEN]);\n let _ = compute_private_serialized_event_commitment(serialized_event, 0, 0);\n }\n\n #[test]\n unconstrained fn event_commitment_equivalence() {\n let event = MockEvent::new(VALUE).build_event();\n\n assert_eq(\n compute_private_event_commitment(event, RANDOMNESS),\n compute_private_serialized_event_commitment(\n BoundedVec::from_array(event.serialize()),\n RANDOMNESS,\n MockEvent::get_event_type_id().to_field(),\n ),\n );\n }\n}\n"
7463
7423
  },
7464
- "80": {
7424
+ "78": {
7465
7425
  "function_locations": [
7466
7426
  {
7467
7427
  "name": "<impl FromField for EventSelector>::from_field",
7468
- "start": 342
7428
+ "start": 337
7469
7429
  },
7470
7430
  {
7471
7431
  "name": "<impl ToField for EventSelector>::to_field",
7472
- "start": 454
7432
+ "start": 449
7473
7433
  },
7474
7434
  {
7475
7435
  "name": "<impl Empty for EventSelector>::empty",
7476
- "start": 547
7436
+ "start": 542
7477
7437
  },
7478
7438
  {
7479
7439
  "name": "EventSelector::from_u32",
7480
- "start": 652
7440
+ "start": 647
7481
7441
  },
7482
7442
  {
7483
7443
  "name": "EventSelector::from_signature",
7484
- "start": 756
7444
+ "start": 751
7485
7445
  },
7486
7446
  {
7487
7447
  "name": "EventSelector::zero",
7488
- "start": 990
7448
+ "start": 985
7489
7449
  }
7490
7450
  ],
7491
7451
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/event/event_selector.nr",
7492
- "source": "use crate::protocol::{hash::poseidon2_hash_bytes, traits::{Deserialize, Empty, FromField, Serialize, ToField}};\n\n#[derive(Deserialize, Eq, Serialize)]\npub struct EventSelector {\n // 1st 4-bytes (big-endian leftmost) of abi-encoding of an event.\n inner: u32,\n}\n\nimpl FromField for EventSelector {\n fn from_field(field: Field) -> Self {\n Self { inner: field as u32 }\n }\n}\n\nimpl ToField for EventSelector {\n fn to_field(self) -> Field {\n self.inner as Field\n }\n}\n\nimpl Empty for EventSelector {\n fn empty() -> Self {\n Self { inner: 0 as u32 }\n }\n}\n\nimpl EventSelector {\n pub fn from_u32(value: u32) -> Self {\n Self { inner: value }\n }\n\n pub fn from_signature<let N: u32>(signature: str<N>) -> Self {\n let bytes = signature.as_bytes();\n let hash = poseidon2_hash_bytes(bytes);\n\n // `hash` is automatically truncated to fit within 32 bits.\n EventSelector::from_field(hash)\n }\n\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n}\n"
7452
+ "source": "use crate::protocol::{hash::poseidon2_hash_bytes, traits::{Deserialize, Empty, FromField, Serialize, ToField}};\n\n#[derive(Deserialize, Eq, Serialize)]\npub struct EventSelector {\n // Low 32 bits of the poseidon2 hash of the event signature.\n inner: u32,\n}\n\nimpl FromField for EventSelector {\n fn from_field(field: Field) -> Self {\n Self { inner: field as u32 }\n }\n}\n\nimpl ToField for EventSelector {\n fn to_field(self) -> Field {\n self.inner as Field\n }\n}\n\nimpl Empty for EventSelector {\n fn empty() -> Self {\n Self { inner: 0 as u32 }\n }\n}\n\nimpl EventSelector {\n pub fn from_u32(value: u32) -> Self {\n Self { inner: value }\n }\n\n pub fn from_signature<let N: u32>(signature: str<N>) -> Self {\n let bytes = signature.as_bytes();\n let hash = poseidon2_hash_bytes(bytes);\n\n // `hash` is automatically truncated to fit within 32 bits.\n EventSelector::from_field(hash)\n }\n\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n}\n"
7493
7453
  },
7494
- "82": {
7454
+ "80": {
7495
7455
  "function_locations": [
7496
7456
  {
7497
7457
  "name": "compute_secret_hash",
@@ -7537,7 +7497,7 @@
7537
7497
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/hash.nr",
7538
7498
  "source": "//! Aztec hash functions.\n\nuse crate::protocol::{\n address::{AztecAddress, EthAddress},\n constants::{\n DOM_SEP__FUNCTION_ARGS, DOM_SEP__MESSAGE_NULLIFIER, DOM_SEP__PUBLIC_BYTECODE, DOM_SEP__PUBLIC_CALLDATA,\n DOM_SEP__SECRET_HASH, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS,\n },\n hash::{poseidon2_hash_subarray, poseidon2_hash_with_separator, sha256_to_field},\n traits::ToField,\n};\n\npub use crate::protocol::hash::compute_siloed_nullifier;\n\npub fn compute_secret_hash(secret: Field) -> Field {\n poseidon2_hash_with_separator([secret], DOM_SEP__SECRET_HASH)\n}\n\npub fn compute_l1_to_l2_message_hash(\n sender: EthAddress,\n chain_id: Field,\n recipient: AztecAddress,\n version: Field,\n content: Field,\n secret_hash: Field,\n leaf_index: Field,\n) -> Field {\n let mut hash_bytes = [0 as u8; 224];\n let sender_bytes: [u8; 32] = sender.to_field().to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n let recipient_bytes: [u8; 32] = recipient.to_field().to_be_bytes();\n let version_bytes: [u8; 32] = version.to_be_bytes();\n let content_bytes: [u8; 32] = content.to_be_bytes();\n let secret_hash_bytes: [u8; 32] = secret_hash.to_be_bytes();\n let leaf_index_bytes: [u8; 32] = leaf_index.to_be_bytes();\n\n for i in 0..32 {\n hash_bytes[i] = sender_bytes[i];\n hash_bytes[i + 32] = chain_id_bytes[i];\n hash_bytes[i + 64] = recipient_bytes[i];\n hash_bytes[i + 96] = version_bytes[i];\n hash_bytes[i + 128] = content_bytes[i];\n hash_bytes[i + 160] = secret_hash_bytes[i];\n hash_bytes[i + 192] = leaf_index_bytes[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\n// The nullifier of a l1 to l2 message is the hash of the message salted with the secret\npub fn compute_l1_to_l2_message_nullifier(message_hash: Field, secret: Field) -> Field {\n poseidon2_hash_with_separator([message_hash, secret], DOM_SEP__MESSAGE_NULLIFIER)\n}\n\n// Computes the hash of input arguments or return values for private functions, or for authwit creation.\npub fn hash_args<let N: u32>(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, DOM_SEP__FUNCTION_ARGS)\n }\n}\n\n// Computes the hash of calldata for public functions.\npub fn hash_calldata_array<let N: u32>(calldata: [Field; N]) -> Field {\n poseidon2_hash_with_separator(calldata, DOM_SEP__PUBLIC_CALLDATA)\n}\n\n/// Computes the public bytecode commitment for a contract class. The commitment is `hash([(length | separator),\n/// ...bytecode])`.\n///\n/// @param packed_bytecode - The packed bytecode of the contract class. 0th word is the length in bytes.\n/// packed_bytecode is mutable so that we can avoid copying the array to construct one starting with first_field\n/// instead of length. @returns The public bytecode commitment.\npub fn compute_public_bytecode_commitment(\n mut packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS],\n) -> Field {\n // First field element contains the length of the bytecode\n let bytecode_length_in_bytes: u32 = packed_public_bytecode[0] as u32;\n let bytecode_length_in_fields: u32 = (bytecode_length_in_bytes / 31) + (bytecode_length_in_bytes % 31 != 0) as u32;\n // Don't allow empty public bytecode. AVM doesn't handle execution of contracts that exist with empty bytecode.\n assert(bytecode_length_in_fields != 0);\n assert(bytecode_length_in_fields < MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);\n\n // Packed_bytecode's 0th entry is the length. Append it to the separator before hashing.\n let first_field = DOM_SEP__PUBLIC_BYTECODE.to_field() + (packed_public_bytecode[0] as u64 << 32) as Field;\n packed_public_bytecode[0] = first_field;\n\n // `fields_to_hash` is the number of fields from the start of `packed_public_bytecode` that should be included in\n // the hash. Fields after this length are ignored. +1 to account for the prepended field.\n let num_fields_to_hash = bytecode_length_in_fields + 1;\n\n poseidon2_hash_subarray(packed_public_bytecode, num_fields_to_hash)\n}\n\n#[test]\nunconstrained fn secret_hash_matches_typescript() {\n let secret = 8;\n let hash = compute_secret_hash(secret);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let secret_hash_from_ts = 0x1848b066724ab0ffb50ecb0ee3398eb839f162823d262bad959721a9c13d1e96;\n\n assert_eq(hash, secret_hash_from_ts);\n}\n\n#[test]\nunconstrained fn var_args_hash_matches_typescript() {\n let mut input = [0; 100];\n for i in 0..100 {\n input[i] = i as Field;\n }\n let hash = hash_args(input);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let var_args_hash_from_ts = 0x262e5e121a8efc0382566ab42f0ae2a78bd85db88484f83018fe07fc2552ba0c;\n\n assert_eq(hash, var_args_hash_from_ts);\n}\n\n#[test]\nunconstrained fn compute_calldata_hash() {\n let mut input = [0; 100];\n for i in 0..input.len() {\n input[i] = i as Field;\n }\n let hash = hash_calldata_array(input);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let calldata_hash_from_ts = 0x14a1539bdb1d26e03097cf4d40c87e02ca03f0bb50a3e617ace5a7bfd3943944;\n\n // Used in cpp vm2 tests:\n assert_eq(hash, calldata_hash_from_ts);\n}\n\n#[test]\nunconstrained fn public_bytecode_commitment() {\n let mut input = [0; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS];\n let len = 99;\n for i in 1..len + 1 {\n input[i] = i as Field;\n }\n input[0] = (len as Field) * 31;\n let hash = compute_public_bytecode_commitment(input);\n // Used in cpp vm2 tests:\n assert_eq(hash, 0x09348974e76c3602893d7a4b4bb52c2ec746f1ade5004ac471d0fbb4587a81a6);\n}\n"
7539
7499
  },
7540
- "93": {
7500
+ "91": {
7541
7501
  "function_locations": [
7542
7502
  {
7543
7503
  "name": "derive_ecdh_shared_secret",
@@ -7575,7 +7535,7 @@
7575
7535
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/keys/ecdh_shared_secret.nr",
7576
7536
  "source": "use crate::protocol::{\n address::aztec_address::AztecAddress,\n constants::{DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET, DOM_SEP__ECDH_FIELD_MASK, DOM_SEP__ECDH_SUBKEY},\n hash::poseidon2_hash_with_separator,\n point::Point,\n scalar::Scalar,\n traits::{FromField, ToField},\n};\nuse std::{embedded_curve_ops::multi_scalar_mul, ops::Neg};\n\n/// Computes a standard ECDH shared secret: secret * public_key = shared_secret.\n///\n/// The input secret is known only to one party. The output shared secret can be derived given knowledge of\n/// `public_key`'s key-pair and the public ephemeral secret, using this same function (with reversed inputs).\n///\n/// E.g.: Epk = esk * G // ephemeral key-pair\n/// Pk = sk * G // recipient key-pair\n/// Shared secret S = esk * Pk = sk * Epk\n///\n/// See also: https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman\npub fn derive_ecdh_shared_secret(secret: Scalar, public_key: Point) -> Point {\n multi_scalar_mul([public_key], [secret])\n}\n\n/// Computes an app-siloed shared secret from a raw ECDH shared secret point and a contract address.\n///\n/// `s_app = h(DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET, S.x, S.y, contract_address)`\npub(crate) fn compute_app_siloed_shared_secret(shared_secret: Point, contract_address: AztecAddress) -> Field {\n poseidon2_hash_with_separator(\n [shared_secret.x, shared_secret.y, contract_address.to_field()],\n DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET,\n )\n}\n\n/// Derives an indexed subkey from an app-siloed shared secret, used for AES key/IV derivation.\n///\n/// `s_i = h(DOM_SEP__ECDH_SUBKEY + i, s_app)`\npub(crate) fn derive_shared_secret_subkey(s_app: Field, index: u32) -> Field {\n poseidon2_hash_with_separator([s_app], DOM_SEP__ECDH_SUBKEY + index)\n}\n\n/// Derives an indexed field mask from an app-siloed shared secret, used for masking ciphertext fields.\n///\n/// `m_i = h(DOM_SEP__ECDH_FIELD_MASK + i, s_app)`\npub(crate) fn derive_shared_secret_field_mask(s_app: Field, index: u32) -> Field {\n poseidon2_hash_with_separator([s_app], DOM_SEP__ECDH_FIELD_MASK + index)\n}\n\n#[test]\nunconstrained fn test_consistency_with_typescript() {\n let secret = Scalar {\n lo: 0x00000000000000000000000000000000649e7ca01d9de27b21624098b897babd,\n hi: 0x0000000000000000000000000000000023b3127c127b1f29a7adff5cccf8fb06,\n };\n let point = Point {\n x: 0x2688431c705a5ff3e6c6f2573c9e3ba1c1026d2251d0dbbf2d810aa53fd1d186,\n y: 0x1e96887b117afca01c00468264f4f80b5bb16d94c1808a448595f115556e5c8e,\n is_infinite: false,\n };\n\n let shared_secret = derive_ecdh_shared_secret(secret, point);\n\n // This is just pasted from a test run. The original typescript code from which this could be generated seems to\n // have been deleted by someone, and soon the typescript code for encryption and decryption won't be needed, so\n // this will have to do.\n let hard_coded_shared_secret = Point {\n x: 0x15d55a5b3b2caa6a6207f313f05c5113deba5da9927d6421bcaa164822b911bc,\n y: 0x0974c3d0825031ae933243d653ebb1a0b08b90ee7f228f94c5c74739ea3c871e,\n is_infinite: false,\n };\n assert_eq(shared_secret, hard_coded_shared_secret);\n}\n\n#[test]\nunconstrained fn test_shared_secret_computation_in_both_directions() {\n let secret_a = Scalar { lo: 0x1234, hi: 0x2345 };\n let secret_b = Scalar { lo: 0x3456, hi: 0x4567 };\n\n let pk_a = std::embedded_curve_ops::fixed_base_scalar_mul(secret_a);\n let pk_b = std::embedded_curve_ops::fixed_base_scalar_mul(secret_b);\n\n let shared_secret = derive_ecdh_shared_secret(secret_a, pk_b);\n let shared_secret_alt = derive_ecdh_shared_secret(secret_b, pk_a);\n\n assert_eq(shared_secret, shared_secret_alt);\n}\n\n#[test]\nunconstrained fn test_shared_secret_computation_from_address_in_both_directions() {\n let secret_a = Scalar { lo: 0x1234, hi: 0x2345 };\n let secret_b = Scalar { lo: 0x3456, hi: 0x4567 };\n\n let mut pk_a = std::embedded_curve_ops::fixed_base_scalar_mul(secret_a);\n let mut pk_b = std::embedded_curve_ops::fixed_base_scalar_mul(secret_b);\n\n let address_b = AztecAddress::from_field(pk_b.x);\n\n // We were lazy in deriving the secret keys, and didn't check the resulting y-coordinates of the pk_a or pk_b to be\n // less than half the field modulus. If needed, we negate the pk's so that they yield valid address points. (We\n // could also have negated the secrets, but there's no negate method for EmbeddedCurvesScalar).\n pk_a = if (AztecAddress::from_field(pk_a.x).to_address_point().unwrap().inner == pk_a) {\n pk_a\n } else {\n pk_a.neg()\n };\n pk_b = if (address_b.to_address_point().unwrap().inner == pk_b) {\n pk_b\n } else {\n pk_b.neg()\n };\n\n let shared_secret = derive_ecdh_shared_secret(secret_a, address_b.to_address_point().unwrap().inner);\n let shared_secret_alt = derive_ecdh_shared_secret(secret_b, pk_a);\n\n assert_eq(shared_secret, shared_secret_alt);\n}\n\n#[test]\nunconstrained fn test_app_siloed_shared_secret_differs_per_contract() {\n let secret_a = Scalar { lo: 0x1234, hi: 0x2345 };\n let pk_b = std::embedded_curve_ops::fixed_base_scalar_mul(Scalar { lo: 0x3456, hi: 0x4567 });\n\n let shared_secret = derive_ecdh_shared_secret(secret_a, pk_b);\n\n let contract_a = AztecAddress::from_field(0xAAAA);\n let contract_b = AztecAddress::from_field(0xBBBB);\n\n let s_app_a = compute_app_siloed_shared_secret(shared_secret, contract_a);\n let s_app_b = compute_app_siloed_shared_secret(shared_secret, contract_b);\n\n assert(s_app_a != s_app_b, \"app-siloed secrets must differ for different contracts\");\n}\n"
7577
7537
  },
7578
- "98": {
7538
+ "96": {
7579
7539
  "function_locations": [
7580
7540
  {
7581
7541
  "name": "log_prefix",
@@ -7644,6 +7604,58 @@
7644
7604
  ],
7645
7605
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/logging.nr",
7646
7606
  "source": "// Not all log levels are currently used, but we provide the full set so that new call sites can use any level. Because\n// of that we tag all with `#[allow(dead_code)]` to prevent warnings.\n//\n// All wrappers resolve function paths at comptime via `resolve_fn` so that the emitted `Quoted` code works both inside\n// aztec-nr (where `crate::` = aztec) and inside macro-generated contract code (where `crate::` = the contract).\n\nuse std::meta::ctstring::AsCtString;\n\ncomptime fn log_prefix<let N: u32>(msg: str<N>) -> CtString {\n \"[aztec-nr] \".as_ctstring().append_str(msg)\n}\n\n// --- No-args variants (direct call) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log });\n quote { $f($msg) }\n}\n\n// --- Format variants (return lambda for runtime args) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n// See module-level comment for why this is needed.\ncomptime fn resolve_fn(path: Quoted) -> TypedExpr {\n path.as_expr().unwrap().resolve(Option::none())\n}\n"
7607
+ },
7608
+ "98": {
7609
+ "function_locations": [
7610
+ {
7611
+ "name": "generate_contract_library_methods_compute_note_hash_and_nullifier",
7612
+ "start": 534
7613
+ },
7614
+ {
7615
+ "name": "generate_contract_library_method_compute_note_hash",
7616
+ "start": 2449
7617
+ },
7618
+ {
7619
+ "name": "generate_contract_library_method_compute_note_nullifier",
7620
+ "start": 7674
7621
+ }
7622
+ ],
7623
+ "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec/compute_note_hash_and_nullifier.nr",
7624
+ "source": "use crate::logging;\nuse crate::macros::{notes::NOTES, utils::get_trait_impl_method};\n\n/// Generates two contract library methods called `_compute_note_hash` and `_compute_note_nullifier`, plus a\n/// (deprecated) wrapper called `_compute_note_hash_and_nullifier`, which are used for note discovery (i.e. these are\n/// of the `aztec::messages::discovery::ComputeNoteHash` and `aztec::messages::discovery::ComputeNoteNullifier` types).\npub(crate) comptime fn generate_contract_library_methods_compute_note_hash_and_nullifier() -> Quoted {\n let compute_note_hash = generate_contract_library_method_compute_note_hash();\n let compute_note_nullifier = generate_contract_library_method_compute_note_nullifier();\n\n quote {\n $compute_note_hash\n $compute_note_nullifier\n\n /// Unpacks an array into a note corresponding to `note_type_id` and then computes its note hash (non-siloed) and inner nullifier (non-siloed) assuming the note has been inserted into the note hash tree with `note_nonce`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n #[allow(dead_code)]\n unconstrained fn _compute_note_hash_and_nullifier(\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n contract_address: aztec::protocol::address::AztecAddress,\n randomness: Field,\n note_nonce: Field,\n ) -> Option<aztec::messages::discovery::NoteHashAndNullifier> {\n _compute_note_hash(packed_note, owner, storage_slot, note_type_id, contract_address, randomness).map(|note_hash| {\n\n let siloed_note_hash = aztec::protocol::hash::compute_siloed_note_hash(contract_address, note_hash);\n let unique_note_hash = aztec::protocol::hash::compute_unique_note_hash(note_nonce, siloed_note_hash);\n \n let inner_nullifier = _compute_note_nullifier(unique_note_hash, packed_note, owner, storage_slot, note_type_id, contract_address, randomness);\n\n aztec::messages::discovery::NoteHashAndNullifier {\n note_hash,\n inner_nullifier,\n }\n })\n }\n }\n}\n\ncomptime fn generate_contract_library_method_compute_note_hash() -> Quoted {\n if NOTES.len() == 0 {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n /// This contract does not use private notes, so this function should never be called as it will unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash(\n _packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n _owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n panic(f\"This contract does not use private notes\")\n }\n }\n } else {\n // Contracts that do define notes produce an if-else chain where `note_type_id` is matched against the\n // `get_note_type_id()` function of each note type that we know of, in order to identify the note type. Once we\n // know it we call the correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the note hash (non-siloed).\n\n // We resolve the log format calls here so that the resulting Quoted values can be spliced into the quote\n // block below.\n let warn_length_mismatch = logging::aztecnr_warn_log_format(\n \"Packed note length mismatch for note type id {0}: expected {1} fields, got {2}. Skipping note.\",\n );\n let warn_unknown_note_type = logging::aztecnr_warn_log_format(\"Unknown note type id {0}. Skipping note.\");\n\n let mut if_note_type_id_match_statements_list = @[];\n for i in 0..NOTES.len() {\n let typ = NOTES.get(i);\n\n let get_note_type_id = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteType },\n quote { get_id },\n );\n let unpack = get_trait_impl_method(\n typ,\n quote { crate::protocol::traits::Packable },\n quote { unpack },\n );\n\n let compute_note_hash = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_note_hash },\n );\n\n let if_or_else_if = if i == 0 {\n quote { if }\n } else {\n quote { else if }\n };\n\n if_note_type_id_match_statements_list = if_note_type_id_match_statements_list.push_back(\n quote {\n $if_or_else_if note_type_id == $get_note_type_id() {\n // As an extra safety check we make sure that the packed_note BoundedVec has the expected\n // length, since we're about to interpret its raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = <$typ as $crate::protocol::traits::Packable>::N;\n let actual_len = packed_note.len();\n if actual_len != expected_len {\n $warn_length_mismatch([note_type_id, expected_len as Field, actual_len as Field]);\n Option::none()\n } else {\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n Option::some($compute_note_hash(note, owner, storage_slot, randomness))\n }\n }\n },\n );\n }\n\n let if_note_type_id_match_statements = if_note_type_id_match_statements_list.join(quote {});\n\n quote {\n /// Unpacks an array into a note corresponding to `note_type_id` and then computes its note hash (non-siloed).\n ///\n /// The signature of this function notably matches the `aztec::messages::discovery::ComputeNoteHash` type, and so it can be used to call functions from that module such as `do_sync_state` and `attempt_note_discovery`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash(\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n randomness: Field,\n ) -> Option<Field> {\n $if_note_type_id_match_statements\n else {\n $warn_unknown_note_type([note_type_id]);\n Option::none()\n }\n }\n }\n }\n}\n\ncomptime fn generate_contract_library_method_compute_note_nullifier() -> Quoted {\n if NOTES.len() == 0 {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n /// This contract does not use private notes, so this function should never be called as it will unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_nullifier(\n _unique_note_hash: Field,\n _packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n _owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n panic(f\"This contract does not use private notes\")\n }\n }\n } else {\n // Contracts that do define notes produce an if-else chain where `note_type_id` is matched against the\n // `get_note_type_id()` function of each note type that we know of, in order to identify the note type. Once we\n // know it we call the correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the inner nullifier (non-siloed).\n\n // We resolve the log format calls here so that the resulting Quoted values can be spliced into the quote\n // block below.\n let warn_length_mismatch = logging::aztecnr_warn_log_format(\n \"Packed note length mismatch for note type id {0}: expected {1} fields, got {2}. Skipping note.\",\n );\n let warn_unknown_note_type = logging::aztecnr_warn_log_format(\"Unknown note type id {0}. Skipping note.\");\n\n let mut if_note_type_id_match_statements_list = @[];\n for i in 0..NOTES.len() {\n let typ = NOTES.get(i);\n\n let get_note_type_id = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteType },\n quote { get_id },\n );\n let unpack = get_trait_impl_method(\n typ,\n quote { crate::protocol::traits::Packable },\n quote { unpack },\n );\n\n let compute_nullifier_unconstrained = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_nullifier_unconstrained },\n );\n\n let if_or_else_if = if i == 0 {\n quote { if }\n } else {\n quote { else if }\n };\n\n if_note_type_id_match_statements_list = if_note_type_id_match_statements_list.push_back(\n quote {\n $if_or_else_if note_type_id == $get_note_type_id() {\n // As an extra safety check we make sure that the packed_note BoundedVec has the expected\n // length, since we're about to interpret its raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = <$typ as $crate::protocol::traits::Packable>::N;\n let actual_len = packed_note.len();\n if actual_len != expected_len {\n $warn_length_mismatch([note_type_id, expected_len as Field, actual_len as Field]);\n Option::none()\n } else {\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n // The message discovery process finds settled notes, that is, notes that were created in\n // prior transactions and are therefore already part of the note hash tree. The note hash\n // for nullification is hence the unique note hash.\n $compute_nullifier_unconstrained(note, owner, unique_note_hash)\n }\n }\n },\n );\n }\n\n let if_note_type_id_match_statements = if_note_type_id_match_statements_list.join(quote {});\n\n quote {\n /// Computes a note's inner nullifier (non-siloed) given its unique note hash, preimage and extra data.\n ///\n /// The signature of this function notably matches the `aztec::messages::discovery::ComputeNoteNullifier` type, and so it can be used to call functions from that module such as `do_sync_state` and `attempt_note_discovery`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_nullifier(\n unique_note_hash: Field,\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n $if_note_type_id_match_statements\n else {\n $warn_unknown_note_type([note_type_id]);\n Option::none()\n }\n }\n }\n }\n}\n"
7625
+ },
7626
+ "99": {
7627
+ "function_locations": [
7628
+ {
7629
+ "name": "AztecConfig::new",
7630
+ "start": 1648
7631
+ },
7632
+ {
7633
+ "name": "AztecConfig::custom_message_handler",
7634
+ "start": 2156
7635
+ },
7636
+ {
7637
+ "name": "aztec",
7638
+ "start": 3050
7639
+ },
7640
+ {
7641
+ "name": "generate_contract_interface",
7642
+ "start": 6527
7643
+ },
7644
+ {
7645
+ "name": "generate_sync_state",
7646
+ "start": 8389
7647
+ },
7648
+ {
7649
+ "name": "generate_offchain_receive",
7650
+ "start": 9443
7651
+ },
7652
+ {
7653
+ "name": "check_each_fn_macroified",
7654
+ "start": 11087
7655
+ }
7656
+ ],
7657
+ "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec.nr",
7658
+ "source": "mod compute_note_hash_and_nullifier;\n\nuse crate::{\n macros::{\n calls_generation::{\n external_functions::{generate_external_function_calls, generate_external_function_self_calls_structs},\n internal_functions::generate_call_internal_struct,\n },\n dispatch::generate_public_dispatch,\n emit_public_init_nullifier::generate_emit_public_init_nullifier,\n internals_functions_generation::{create_fn_abi_exports, process_functions},\n storage::STORAGE_LAYOUT_NAME,\n utils::{is_fn_contract_library_method, is_fn_external, is_fn_internal, is_fn_test, module_has_storage},\n },\n messages::discovery::CustomMessageHandler,\n};\n\nuse compute_note_hash_and_nullifier::generate_contract_library_methods_compute_note_hash_and_nullifier;\n\n/// Configuration for the [`aztec`] macro.\n///\n/// This type lets users override different parts of the default aztec-nr contract behavior, such\n/// as message handling. These are advanced features that require careful understanding of\n/// the behavior of these systems.\n///\n/// ## Examples\n///\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyContract { ... }\n/// ```\npub struct AztecConfig {\n custom_message_handler: Option<CustomMessageHandler<()>>,\n}\n\nimpl AztecConfig {\n /// Creates a new `AztecConfig` with default values.\n ///\n /// Calling `new` is equivalent to invoking the [`aztec`] macro with no parameters. The different methods\n /// (e.g. [`AztecConfig::custom_message_handler`]) can then be used to change the default behavior.\n pub comptime fn new() -> Self {\n Self { custom_message_handler: Option::none() }\n }\n\n /// Sets a handler for custom messages.\n ///\n /// This enables contracts to process non-standard messages (i.e. any with a message type that is not in\n /// [`crate::messages::msg_type`]).\n ///\n /// `handler` must be a function that conforms to the\n /// [`crate::messages::discovery::CustomMessageHandler`] type signature.\n pub comptime fn custom_message_handler(_self: Self, handler: CustomMessageHandler<()>) -> Self {\n Self { custom_message_handler: Option::some(handler) }\n }\n}\n\n/// Enables aztec-nr features on a `contract`.\n///\n/// All aztec-nr contracts should have this macro invoked on them, as it is the one that processes all contract\n/// functions, notes, storage, generates interfaces for external calls, and creates the message processing\n/// boilerplate.\n///\n/// ## Examples\n///\n/// Most contracts can simply invoke the macro with no parameters, resulting in default aztec-nr behavior:\n/// ```noir\n/// #[aztec]\n/// contract MyContract { ... }\n/// ```\n///\n/// Advanced contracts can use [`AztecConfig`] to customize parts of its behavior, such as message\n/// processing.\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyAdvancedContract { ... }\n/// ```\n#[varargs]\npub comptime fn aztec(m: Module, args: [AztecConfig]) -> Quoted {\n let num_args = args.len();\n let config = if num_args == 0 {\n AztecConfig::new()\n } else if num_args == 1 {\n args[0]\n } else {\n panic(f\"#[aztec] expects 0 or 1 arguments, got {num_args}\")\n };\n\n // Functions that don't have #[external(...)], #[contract_library_method], or #[test] are not allowed in contracts.\n check_each_fn_macroified(m);\n\n // We generate new functions prefixed with `__aztec_nr_internals__` and we replace the original functions' bodies\n // with `static_assert(false, ...)` to prevent them from being called directly from within the contract.\n let functions = process_functions(m);\n\n // We generate structs and their implementations necessary for convenient functions calls.\n let interface = generate_contract_interface(m);\n let self_call_structs = generate_external_function_self_calls_structs(m);\n let call_internal_struct = generate_call_internal_struct(m);\n\n // We generate ABI exports for all the external functions in the contract.\n let fn_abi_exports = create_fn_abi_exports(m);\n\n // We generate `_compute_note_hash`, `_compute_note_nullifier` (and the deprecated\n // `_compute_note_hash_and_nullifier` wrapper) and `sync_state` functions only if they are not already implemented.\n // If they are implemented we just insert empty quotes.\n let contract_library_method_compute_note_hash_and_nullifier = if !m.functions().any(|f| {\n // Note that we don't test for `_compute_note_hash` or `_compute_note_nullifier` in order to make this simpler\n // - users must either implement all three or none.\n // Down the line we'll remove this check and use `AztecConfig`.\n f.name() == quote { _compute_note_hash_and_nullifier }\n }) {\n generate_contract_library_methods_compute_note_hash_and_nullifier()\n } else {\n quote {}\n };\n let process_custom_message_option = if config.custom_message_handler.is_some() {\n let handler = config.custom_message_handler.unwrap();\n quote { Option::some($handler) }\n } else {\n quote { Option::<aztec::messages::discovery::CustomMessageHandler<()>>::none() }\n };\n\n let offchain_inbox_sync_option = quote {\n Option::some(aztec::messages::processing::offchain::sync_inbox)\n };\n\n let sync_state_fn_and_abi_export = if !m.functions().any(|f| f.name() == quote { sync_state }) {\n generate_sync_state(process_custom_message_option, offchain_inbox_sync_option)\n } else {\n quote {}\n };\n\n if m.functions().any(|f| f.name() == quote { offchain_receive }) {\n panic(\n \"User-defined 'offchain_receive' is not allowed. The function is auto-injected by the #[aztec] macro. See https://docs.aztec.network/errors/7\",\n );\n }\n let offchain_receive_fn_and_abi_export = generate_offchain_receive();\n\n let (has_public_init_nullifier_fn, emit_public_init_nullifier_fn_body) = generate_emit_public_init_nullifier(m);\n let public_dispatch = generate_public_dispatch(m, has_public_init_nullifier_fn);\n\n quote {\n $interface\n $self_call_structs\n $call_internal_struct\n $functions\n $fn_abi_exports\n $contract_library_method_compute_note_hash_and_nullifier\n $public_dispatch\n $sync_state_fn_and_abi_export\n $emit_public_init_nullifier_fn_body\n $offchain_receive_fn_and_abi_export\n }\n}\n\ncomptime fn generate_contract_interface(m: Module) -> Quoted {\n let calls = generate_external_function_calls(m);\n\n let module_name = m.name();\n\n let has_storage_layout = module_has_storage(m) & STORAGE_LAYOUT_NAME.get(m).is_some();\n let storage_layout_getter = if has_storage_layout {\n let storage_layout_name = STORAGE_LAYOUT_NAME.get(m).unwrap();\n quote {\n pub fn storage_layout() -> StorageLayoutFields {\n $storage_layout_name.fields\n }\n }\n } else {\n quote {}\n };\n\n let library_storage_layout_getter = if has_storage_layout {\n quote {\n #[contract_library_method]\n $storage_layout_getter\n }\n } else {\n quote {}\n };\n\n quote {\n pub struct $module_name {\n pub target_contract: aztec::protocol::address::AztecAddress\n }\n\n impl $module_name {\n $calls\n\n pub fn at(\n addr: aztec::protocol::address::AztecAddress\n ) -> Self {\n Self { target_contract: addr }\n }\n\n pub fn interface() -> Self {\n Self { target_contract: aztec::protocol::address::AztecAddress::zero() }\n }\n\n $storage_layout_getter\n }\n\n #[contract_library_method]\n pub fn at(\n addr: aztec::protocol::address::AztecAddress\n ) -> $module_name {\n $module_name { target_contract: addr }\n }\n\n #[contract_library_method]\n pub fn interface() -> $module_name {\n $module_name { target_contract: aztec::protocol::address::AztecAddress::zero() }\n }\n\n $library_storage_layout_getter\n\n }\n}\n\n/// Generates the `sync_state` utility function that performs message discovery.\ncomptime fn generate_sync_state(process_custom_message_option: Quoted, offchain_inbox_sync_option: Quoted) -> Quoted {\n quote {\n pub struct sync_state_parameters {\n pub scope: aztec::protocol::address::AztecAddress,\n }\n\n #[abi(functions)]\n pub struct sync_state_abi {\n parameters: sync_state_parameters,\n }\n\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn sync_state(scope: aztec::protocol::address::AztecAddress) {\n let address = aztec::context::UtilityContext::new().this_address();\n aztec::messages::discovery::do_sync_state(\n address,\n _compute_note_hash,\n _compute_note_nullifier,\n $process_custom_message_option,\n $offchain_inbox_sync_option,\n scope,\n );\n }\n }\n}\n\n/// Generates an `offchain_receive` utility function that lets callers add messages to the offchain message inbox.\n///\n/// For more details, see `aztec::messages::processing::offchain::receive`.\ncomptime fn generate_offchain_receive() -> Quoted {\n quote {\n pub struct offchain_receive_parameters {\n pub messages: BoundedVec<\n aztec::messages::processing::offchain::OffchainMessage,\n aztec::messages::processing::offchain::MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL,\n >,\n }\n\n #[abi(functions)]\n pub struct offchain_receive_abi {\n parameters: offchain_receive_parameters,\n }\n\n /// Receives offchain messages into this contract's offchain inbox for subsequent processing.\n ///\n /// Each message is routed to the inbox scoped to its `recipient` field.\n ///\n /// For more details, see `aztec::messages::processing::offchain::receive`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn offchain_receive(\n messages: BoundedVec<\n aztec::messages::processing::offchain::OffchainMessage,\n aztec::messages::processing::offchain::MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL,\n >,\n ) {\n let address = aztec::context::UtilityContext::new().this_address();\n aztec::messages::processing::offchain::receive(address, messages);\n }\n }\n}\n\n/// Checks that all functions in the module have a context macro applied.\n///\n/// Non-macroified functions are not allowed in contracts. They must all be one of\n/// [`crate::macros::functions::external`], [`crate::macros::functions::internal`] or `test`.\ncomptime fn check_each_fn_macroified(m: Module) {\n for f in m.functions() {\n let name = f.name();\n if !is_fn_external(f) & !is_fn_contract_library_method(f) & !is_fn_internal(f) & !is_fn_test(f) {\n // We don't suggest that #[contract_library_method] is allowed because we don't want to introduce another\n // concept\n panic(\n f\"Function {name} must be marked as either #[external(...)], #[internal(...)], or #[test]\",\n );\n }\n }\n}\n"
7647
7659
  }
7648
7660
  }
7649
7661
  }