@aztec/foundation 0.76.4 → 0.77.0-testnet-ignition.21
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.
- package/dest/array/array.d.ts +1 -1
- package/dest/array/array.d.ts.map +1 -1
- package/dest/array/array.js +19 -26
- package/dest/array/index.js +0 -1
- package/dest/async-map/index.js +2 -4
- package/dest/async-pool/index.js +6 -9
- package/dest/bigint-buffer/index.js +6 -13
- package/dest/buffer/buffer32.d.ts +1 -1
- package/dest/buffer/buffer32.d.ts.map +1 -1
- package/dest/buffer/buffer32.js +53 -66
- package/dest/buffer/index.js +0 -1
- package/dest/collection/array.d.ts +1 -1
- package/dest/collection/array.d.ts.map +1 -1
- package/dest/collection/array.js +47 -59
- package/dest/collection/index.js +0 -1
- package/dest/collection/object.js +9 -9
- package/dest/committable/committable.js +15 -20
- package/dest/committable/index.js +0 -1
- package/dest/config/env_var.d.ts +1 -1
- package/dest/config/env_var.d.ts.map +1 -1
- package/dest/config/env_var.js +1 -2
- package/dest/config/index.d.ts +1 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +31 -36
- package/dest/crypto/aes128/index.d.ts +34 -0
- package/dest/crypto/aes128/index.d.ts.map +1 -0
- package/dest/crypto/aes128/index.js +49 -0
- package/dest/crypto/ecdsa/index.d.ts +39 -0
- package/dest/crypto/ecdsa/index.d.ts.map +1 -0
- package/dest/crypto/ecdsa/index.js +88 -0
- package/dest/crypto/ecdsa/signature.d.ts +71 -0
- package/dest/crypto/ecdsa/signature.d.ts.map +1 -0
- package/dest/crypto/ecdsa/signature.js +92 -0
- package/dest/crypto/grumpkin/index.d.ts +47 -0
- package/dest/crypto/grumpkin/index.d.ts.map +1 -0
- package/dest/crypto/grumpkin/index.js +154 -0
- package/dest/crypto/index.d.ts +6 -0
- package/dest/crypto/index.d.ts.map +1 -1
- package/dest/crypto/index.js +6 -1
- package/dest/crypto/keccak/index.js +60 -69
- package/dest/crypto/keys/index.js +2 -3
- package/dest/crypto/pedersen/index.js +0 -1
- package/dest/crypto/pedersen/pedersen.elliptic.js +153 -146
- package/dest/crypto/pedersen/pedersen.noble.js +140 -142
- package/dest/crypto/pedersen/pedersen.wasm.js +17 -16
- package/dest/crypto/poseidon/index.js +15 -19
- package/dest/crypto/random/index.js +7 -12
- package/dest/crypto/random/randomness_singleton.js +12 -12
- package/dest/crypto/schnorr/index.d.ts +30 -0
- package/dest/crypto/schnorr/index.d.ts.map +1 -0
- package/dest/crypto/schnorr/index.js +68 -0
- package/dest/crypto/schnorr/signature.d.ts +70 -0
- package/dest/crypto/schnorr/signature.d.ts.map +1 -0
- package/dest/crypto/schnorr/signature.js +93 -0
- package/dest/crypto/secp256k1/index.d.ts +32 -0
- package/dest/crypto/secp256k1/index.d.ts.map +1 -0
- package/dest/crypto/secp256k1/index.js +116 -0
- package/dest/crypto/secp256k1-signer/index.js +0 -1
- package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts +2 -2
- package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts.map +1 -1
- package/dest/crypto/secp256k1-signer/secp256k1_signer.js +8 -9
- package/dest/crypto/secp256k1-signer/utils.js +11 -16
- package/dest/crypto/serialize.d.ts +53 -0
- package/dest/crypto/serialize.d.ts.map +1 -0
- package/dest/crypto/serialize.js +68 -0
- package/dest/crypto/sha256/index.js +80 -30
- package/dest/crypto/sha512/index.js +2 -4
- package/dest/crypto/signature/index.d.ts +19 -0
- package/dest/crypto/signature/index.d.ts.map +1 -0
- package/dest/crypto/signature/index.js +3 -0
- package/dest/crypto/sync/index.js +1 -2
- package/dest/crypto/sync/pedersen/index.js +14 -13
- package/dest/crypto/sync/poseidon/index.js +10 -14
- package/dest/decorators/index.js +0 -1
- package/dest/decorators/memoize.js +1 -2
- package/dest/error/index.js +6 -19
- package/dest/eth-address/index.js +92 -113
- package/dest/eth-signature/eth_signature.js +21 -27
- package/dest/eth-signature/index.js +0 -1
- package/dest/fields/coordinate.d.ts +1 -1
- package/dest/fields/coordinate.d.ts.map +1 -1
- package/dest/fields/coordinate.js +47 -46
- package/dest/fields/fields.d.ts.map +1 -1
- package/dest/fields/fields.js +112 -126
- package/dest/fields/index.js +0 -1
- package/dest/fields/point.js +119 -129
- package/dest/fs/index.js +0 -1
- package/dest/fs/run_in_dir.d.ts +1 -1
- package/dest/fs/run_in_dir.d.ts.map +1 -1
- package/dest/fs/run_in_dir.js +16 -7
- package/dest/index.d.ts +0 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -3
- package/dest/iterable/all.js +3 -4
- package/dest/iterable/filter.js +10 -11
- package/dest/iterable/index.js +0 -1
- package/dest/iterable/isAsyncIt.js +1 -3
- package/dest/iterable/map.js +10 -11
- package/dest/iterable/peek.js +14 -14
- package/dest/iterable/sort.js +4 -5
- package/dest/iterable/take.js +6 -7
- package/dest/iterable/toArray.js +1 -2
- package/dest/jest/setup.js +7 -0
- package/dest/json-rpc/client/fetch.js +25 -20
- package/dest/json-rpc/client/index.js +0 -1
- package/dest/json-rpc/client/safe_json_rpc_client.js +20 -9
- package/dest/json-rpc/client/undici.d.ts +1 -1
- package/dest/json-rpc/client/undici.d.ts.map +1 -1
- package/dest/json-rpc/client/undici.js +16 -17
- package/dest/json-rpc/convert.d.ts +1 -1
- package/dest/json-rpc/convert.d.ts.map +1 -1
- package/dest/json-rpc/convert.js +10 -20
- package/dest/json-rpc/fixtures/class_a.js +8 -5
- package/dest/json-rpc/fixtures/class_b.js +8 -5
- package/dest/json-rpc/fixtures/test_state.js +53 -40
- package/dest/json-rpc/index.js +0 -1
- package/dest/json-rpc/js_utils.js +2 -5
- package/dest/json-rpc/server/index.js +0 -1
- package/dest/json-rpc/server/safe_json_rpc_server.js +145 -101
- package/dest/json-rpc/server/telemetry.js +0 -2
- package/dest/json-rpc/test/index.js +0 -1
- package/dest/json-rpc/test/integration.d.ts +1 -1
- package/dest/json-rpc/test/integration.d.ts.map +1 -1
- package/dest/json-rpc/test/integration.js +11 -5
- package/dest/log/console.d.ts +1 -1
- package/dest/log/console.d.ts.map +1 -1
- package/dest/log/console.js +14 -16
- package/dest/log/debug.d.ts +1 -1
- package/dest/log/debug.d.ts.map +1 -1
- package/dest/log/debug.js +9 -18
- package/dest/log/gcloud-logger-config.js +17 -15
- package/dest/log/index.d.ts +1 -0
- package/dest/log/index.d.ts.map +1 -1
- package/dest/log/index.js +1 -1
- package/dest/log/libp2p_logger.d.ts +7 -0
- package/dest/log/libp2p_logger.d.ts.map +1 -0
- package/dest/log/libp2p_logger.js +55 -0
- package/dest/log/log-filters.js +14 -13
- package/dest/log/log-levels.js +10 -2
- package/dest/log/log_fn.js +1 -2
- package/dest/log/log_history.js +21 -25
- package/dest/log/pino-logger.d.ts +8 -4
- package/dest/log/pino-logger.d.ts.map +1 -1
- package/dest/log/pino-logger.js +92 -74
- package/dest/message/index.js +7 -3
- package/dest/mutex/index.d.ts +1 -1
- package/dest/mutex/index.d.ts.map +1 -1
- package/dest/mutex/index.js +34 -32
- package/dest/mutex/mutex_database.js +4 -2
- package/dest/noir/index.js +0 -1
- package/dest/noir/noir_package_config.js +13 -8
- package/dest/promise/index.js +0 -1
- package/dest/promise/running-promise.d.ts +8 -2
- package/dest/promise/running-promise.d.ts.map +1 -1
- package/dest/promise/running-promise.js +44 -31
- package/dest/promise/utils.js +3 -5
- package/dest/queue/base_memory_queue.js +51 -59
- package/dest/queue/batch_queue.js +34 -27
- package/dest/queue/bounded_serial_queue.js +41 -51
- package/dest/queue/fifo_memory_queue.d.ts +1 -1
- package/dest/queue/fifo_memory_queue.d.ts.map +1 -1
- package/dest/queue/fifo_memory_queue.js +4 -8
- package/dest/queue/index.js +0 -1
- package/dest/queue/priority_memory_queue.js +3 -4
- package/dest/queue/priority_queue.js +5 -5
- package/dest/queue/semaphore.js +15 -19
- package/dest/queue/serial_queue.js +37 -47
- package/dest/retry/index.js +21 -18
- package/dest/running-promise/index.js +0 -1
- package/dest/schemas/api.d.ts +2 -2
- package/dest/schemas/api.d.ts.map +1 -1
- package/dest/schemas/api.js +2 -7
- package/dest/schemas/index.d.ts +1 -1
- package/dest/schemas/index.d.ts.map +1 -1
- package/dest/schemas/index.js +1 -2
- package/dest/schemas/parse.js +4 -8
- package/dest/schemas/schemas.d.ts +1 -16
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +28 -56
- package/dest/schemas/types.d.ts +1 -1
- package/dest/schemas/types.d.ts.map +1 -1
- package/dest/schemas/types.js +1 -2
- package/dest/schemas/utils.d.ts +1 -1
- package/dest/schemas/utils.d.ts.map +1 -1
- package/dest/schemas/utils.js +18 -31
- package/dest/serialize/buffer_reader.d.ts +1 -1
- package/dest/serialize/buffer_reader.d.ts.map +1 -1
- package/dest/serialize/buffer_reader.js +164 -188
- package/dest/serialize/field_reader.d.ts +1 -1
- package/dest/serialize/field_reader.d.ts.map +1 -1
- package/dest/serialize/field_reader.js +70 -79
- package/dest/serialize/free_funcs.d.ts +1 -1
- package/dest/serialize/free_funcs.d.ts.map +1 -1
- package/dest/serialize/free_funcs.js +40 -37
- package/dest/serialize/index.js +0 -1
- package/dest/serialize/serialize.js +72 -83
- package/dest/serialize/type_registry.js +10 -14
- package/dest/serialize/types.js +4 -5
- package/dest/sleep/index.js +25 -29
- package/dest/string/index.js +0 -1
- package/dest/testing/files/index.js +3 -7
- package/dest/testing/index.js +0 -1
- package/dest/testing/port_allocator.js +7 -10
- package/dest/testing/snapshot_serializer.d.ts +1 -1
- package/dest/testing/snapshot_serializer.d.ts.map +1 -1
- package/dest/testing/snapshot_serializer.js +14 -9
- package/dest/testing/test_data.js +7 -8
- package/dest/timer/date.js +9 -7
- package/dest/timer/elapsed.js +10 -7
- package/dest/timer/index.js +0 -1
- package/dest/timer/timeout.js +34 -34
- package/dest/timer/timer.js +17 -21
- package/dest/transport/browser/index.js +0 -1
- package/dest/transport/browser/message_port_socket.d.ts +1 -1
- package/dest/transport/browser/message_port_socket.d.ts.map +1 -1
- package/dest/transport/browser/message_port_socket.js +26 -30
- package/dest/transport/browser/shared_worker_connector.d.ts +1 -1
- package/dest/transport/browser/shared_worker_connector.d.ts.map +1 -1
- package/dest/transport/browser/shared_worker_connector.js +8 -10
- package/dest/transport/browser/shared_worker_listener.d.ts +1 -1
- package/dest/transport/browser/shared_worker_listener.d.ts.map +1 -1
- package/dest/transport/browser/shared_worker_listener.js +13 -17
- package/dest/transport/browser/worker_connector.d.ts +1 -1
- package/dest/transport/browser/worker_connector.d.ts.map +1 -1
- package/dest/transport/browser/worker_connector.js +12 -12
- package/dest/transport/browser/worker_listener.d.ts +1 -1
- package/dest/transport/browser/worker_listener.d.ts.map +1 -1
- package/dest/transport/browser/worker_listener.js +13 -17
- package/dest/transport/dispatch/create_dispatch_fn.js +2 -4
- package/dest/transport/dispatch/create_dispatch_proxy.d.ts +2 -2
- package/dest/transport/dispatch/create_dispatch_proxy.d.ts.map +1 -1
- package/dest/transport/dispatch/create_dispatch_proxy.js +16 -13
- package/dest/transport/dispatch/messages.js +4 -3
- package/dest/transport/index.js +0 -1
- package/dest/transport/interface/connector.d.ts +1 -1
- package/dest/transport/interface/connector.d.ts.map +1 -1
- package/dest/transport/interface/connector.js +3 -2
- package/dest/transport/interface/listener.d.ts +1 -1
- package/dest/transport/interface/listener.d.ts.map +1 -1
- package/dest/transport/interface/listener.js +4 -2
- package/dest/transport/interface/socket.js +7 -2
- package/dest/transport/interface/transferable.js +7 -9
- package/dest/transport/node/index.js +0 -1
- package/dest/transport/node/node_connector.d.ts +2 -2
- package/dest/transport/node/node_connector.d.ts.map +1 -1
- package/dest/transport/node/node_connector.js +9 -11
- package/dest/transport/node/node_connector_socket.d.ts +2 -2
- package/dest/transport/node/node_connector_socket.d.ts.map +1 -1
- package/dest/transport/node/node_connector_socket.js +21 -25
- package/dest/transport/node/node_listener.d.ts +1 -1
- package/dest/transport/node/node_listener.d.ts.map +1 -1
- package/dest/transport/node/node_listener.js +11 -15
- package/dest/transport/node/node_listener_socket.d.ts +2 -2
- package/dest/transport/node/node_listener_socket.d.ts.map +1 -1
- package/dest/transport/node/node_listener_socket.js +23 -27
- package/dest/transport/transport_client.d.ts +1 -1
- package/dest/transport/transport_client.d.ts.map +1 -1
- package/dest/transport/transport_client.js +47 -46
- package/dest/transport/transport_server.d.ts +1 -1
- package/dest/transport/transport_server.d.ts.map +1 -1
- package/dest/transport/transport_server.js +68 -55
- package/dest/trees/hasher.d.ts +39 -0
- package/dest/trees/hasher.d.ts.map +1 -0
- package/dest/trees/hasher.js +5 -0
- package/dest/trees/index.d.ts +8 -56
- package/dest/trees/index.d.ts.map +1 -1
- package/dest/trees/index.js +8 -1
- package/dest/trees/indexed_merkle_tree.d.ts +13 -0
- package/dest/trees/indexed_merkle_tree.d.ts.map +1 -0
- package/dest/trees/indexed_merkle_tree.js +27 -0
- package/dest/trees/indexed_merkle_tree_calculator.d.ts +23 -0
- package/dest/trees/indexed_merkle_tree_calculator.d.ts.map +1 -0
- package/dest/trees/indexed_merkle_tree_calculator.js +83 -0
- package/dest/trees/indexed_tree_leaf.d.ts +57 -0
- package/dest/trees/indexed_tree_leaf.d.ts.map +1 -0
- package/dest/trees/indexed_tree_leaf.js +5 -0
- package/dest/trees/membership_witness.d.ts +62 -0
- package/dest/trees/membership_witness.d.ts.map +1 -0
- package/dest/trees/membership_witness.js +70 -0
- package/dest/trees/merkle_tree.d.ts +18 -0
- package/dest/trees/merkle_tree.d.ts.map +1 -0
- package/dest/trees/merkle_tree.js +58 -0
- package/dest/trees/merkle_tree_calculator.d.ts +16 -0
- package/dest/trees/merkle_tree_calculator.d.ts.map +1 -0
- package/dest/trees/merkle_tree_calculator.js +61 -0
- package/dest/trees/sibling_path.d.ts +132 -0
- package/dest/trees/sibling_path.d.ts.map +1 -0
- package/dest/trees/sibling_path.js +144 -0
- package/dest/trees/unbalanced_merkle_tree.d.ts +1 -1
- package/dest/trees/unbalanced_merkle_tree.d.ts.map +1 -1
- package/dest/trees/unbalanced_merkle_tree.js +28 -18
- package/dest/trees/unbalanced_tree_store.js +43 -29
- package/dest/types/index.js +1 -3
- package/dest/url/index.js +4 -8
- package/dest/validation/index.js +2 -5
- package/dest/wasm/empty_wasi_sdk.js +142 -160
- package/dest/wasm/index.d.ts +1 -1
- package/dest/wasm/index.d.ts.map +1 -1
- package/dest/wasm/index.js +0 -1
- package/dest/wasm/wasm_module.js +80 -90
- package/dest/worker/browser/index.js +0 -1
- package/dest/worker/browser/start_web_module.d.ts +1 -1
- package/dest/worker/browser/start_web_module.d.ts.map +1 -1
- package/dest/worker/browser/start_web_module.js +9 -5
- package/dest/worker/browser/web_data_store.d.ts +1 -1
- package/dest/worker/browser/web_data_store.d.ts.map +1 -1
- package/dest/worker/browser/web_data_store.js +12 -15
- package/dest/worker/browser/web_worker.d.ts +1 -1
- package/dest/worker/browser/web_worker.d.ts.map +1 -1
- package/dest/worker/browser/web_worker.js +6 -5
- package/dest/worker/data_store.js +3 -2
- package/dest/worker/index.d.ts +1 -1
- package/dest/worker/index.d.ts.map +1 -1
- package/dest/worker/index.js +0 -1
- package/dest/worker/node/index.js +0 -1
- package/dest/worker/node/node_data_store.d.ts +1 -1
- package/dest/worker/node/node_data_store.d.ts.map +1 -1
- package/dest/worker/node/node_data_store.js +4 -5
- package/dest/worker/node/node_worker.d.ts +1 -1
- package/dest/worker/node/node_worker.d.ts.map +1 -1
- package/dest/worker/node/node_worker.js +6 -5
- package/dest/worker/node/start_node_module.d.ts +1 -1
- package/dest/worker/node/start_node_module.d.ts.map +1 -1
- package/dest/worker/node/start_node_module.js +9 -5
- package/dest/worker/wasm_worker.d.ts +2 -2
- package/dest/worker/wasm_worker.d.ts.map +1 -1
- package/dest/worker/wasm_worker.js +3 -2
- package/dest/worker/worker_pool.d.ts +1 -1
- package/dest/worker/worker_pool.d.ts.map +1 -1
- package/dest/worker/worker_pool.js +32 -43
- package/package.json +5 -5
- package/src/array/array.ts +1 -1
- package/src/buffer/buffer32.ts +1 -1
- package/src/collection/array.ts +1 -1
- package/src/config/env_var.ts +7 -5
- package/src/config/index.ts +1 -1
- package/src/crypto/aes128/index.ts +59 -0
- package/src/crypto/ecdsa/index.ts +70 -0
- package/src/crypto/ecdsa/signature.ts +100 -0
- package/src/crypto/grumpkin/index.ts +97 -0
- package/src/crypto/index.ts +6 -0
- package/src/crypto/keys/index.ts +1 -1
- package/src/crypto/pedersen/pedersen.wasm.ts +3 -3
- package/src/crypto/poseidon/index.ts +5 -5
- package/src/crypto/schnorr/index.ts +55 -0
- package/src/crypto/schnorr/signature.ts +116 -0
- package/src/crypto/secp256k1/index.ts +57 -0
- package/src/crypto/secp256k1-signer/secp256k1_signer.ts +2 -2
- package/src/crypto/serialize.ts +85 -0
- package/src/crypto/signature/index.ts +17 -0
- package/src/crypto/sync/index.ts +1 -1
- package/src/fields/coordinate.ts +1 -1
- package/src/fields/fields.ts +2 -1
- package/src/fs/run_in_dir.ts +8 -1
- package/src/index.ts +0 -2
- package/src/json-rpc/client/undici.ts +1 -1
- package/src/json-rpc/convert.ts +1 -1
- package/src/json-rpc/server/safe_json_rpc_server.ts +1 -1
- package/src/json-rpc/test/integration.ts +1 -1
- package/src/log/console.ts +1 -1
- package/src/log/debug.ts +1 -1
- package/src/log/gcloud-logger-config.ts +1 -1
- package/src/log/index.ts +1 -0
- package/src/log/libp2p_logger.ts +67 -0
- package/src/log/pino-logger.ts +16 -16
- package/src/mutex/index.ts +1 -1
- package/src/promise/running-promise.ts +24 -5
- package/src/queue/fifo_memory_queue.ts +1 -1
- package/src/schemas/api.ts +2 -2
- package/src/schemas/index.ts +1 -1
- package/src/schemas/schemas.ts +2 -26
- package/src/schemas/types.ts +1 -1
- package/src/schemas/utils.ts +1 -1
- package/src/serialize/buffer_reader.ts +1 -1
- package/src/serialize/field_reader.ts +1 -1
- package/src/serialize/free_funcs.ts +1 -1
- package/src/testing/snapshot_serializer.ts +1 -1
- package/src/transport/browser/message_port_socket.ts +1 -1
- package/src/transport/browser/shared_worker_connector.ts +1 -1
- package/src/transport/browser/shared_worker_listener.ts +1 -1
- package/src/transport/browser/worker_connector.ts +1 -1
- package/src/transport/browser/worker_listener.ts +1 -1
- package/src/transport/dispatch/create_dispatch_proxy.ts +2 -2
- package/src/transport/interface/connector.ts +1 -1
- package/src/transport/interface/listener.ts +1 -1
- package/src/transport/node/node_connector.ts +2 -2
- package/src/transport/node/node_connector_socket.ts +2 -2
- package/src/transport/node/node_listener.ts +1 -1
- package/src/transport/node/node_listener_socket.ts +2 -2
- package/src/transport/transport_client.ts +2 -2
- package/src/transport/transport_server.ts +3 -3
- package/src/trees/hasher.ts +39 -0
- package/src/trees/index.ts +8 -57
- package/src/trees/indexed_merkle_tree.ts +36 -0
- package/src/trees/indexed_merkle_tree_calculator.ts +94 -0
- package/src/trees/indexed_tree_leaf.ts +56 -0
- package/src/trees/membership_witness.ts +99 -0
- package/src/trees/merkle_tree.ts +72 -0
- package/src/trees/merkle_tree_calculator.ts +67 -0
- package/src/trees/sibling_path.ts +183 -0
- package/src/trees/unbalanced_merkle_tree.ts +2 -2
- package/src/wasm/index.ts +1 -1
- package/src/worker/browser/start_web_module.ts +1 -1
- package/src/worker/browser/web_data_store.ts +1 -1
- package/src/worker/browser/web_worker.ts +1 -1
- package/src/worker/index.ts +1 -1
- package/src/worker/node/node_data_store.ts +1 -1
- package/src/worker/node/node_worker.ts +1 -1
- package/src/worker/node/start_node_module.ts +1 -1
- package/src/worker/wasm_worker.ts +2 -2
- package/src/worker/worker_pool.ts +1 -1
- package/dest/abi/abi.d.ts +0 -853
- package/dest/abi/abi.d.ts.map +0 -1
- package/dest/abi/abi.js +0 -214
- package/dest/abi/buffer.d.ts +0 -18
- package/dest/abi/buffer.d.ts.map +0 -1
- package/dest/abi/buffer.js +0 -34
- package/dest/abi/decoder.d.ts +0 -58
- package/dest/abi/decoder.d.ts.map +0 -1
- package/dest/abi/decoder.js +0 -180
- package/dest/abi/encoder.d.ts +0 -16
- package/dest/abi/encoder.d.ts.map +0 -1
- package/dest/abi/encoder.js +0 -174
- package/dest/abi/event_selector.d.ts +0 -52
- package/dest/abi/event_selector.d.ts.map +0 -1
- package/dest/abi/event_selector.js +0 -76
- package/dest/abi/function_selector.d.ts +0 -65
- package/dest/abi/function_selector.d.ts.map +0 -1
- package/dest/abi/function_selector.js +0 -92
- package/dest/abi/index.d.ts +0 -10
- package/dest/abi/index.d.ts.map +0 -1
- package/dest/abi/index.js +0 -10
- package/dest/abi/note_selector.d.ts +0 -42
- package/dest/abi/note_selector.d.ts.map +0 -1
- package/dest/abi/note_selector.js +0 -63
- package/dest/abi/selector.d.ts +0 -42
- package/dest/abi/selector.d.ts.map +0 -1
- package/dest/abi/selector.js +0 -57
- package/dest/abi/u128.d.ts +0 -13
- package/dest/abi/u128.d.ts.map +0 -1
- package/dest/abi/u128.js +0 -58
- package/dest/abi/utils.d.ts +0 -44
- package/dest/abi/utils.d.ts.map +0 -1
- package/dest/abi/utils.js +0 -72
- package/dest/aztec-address/index.d.ts +0 -57
- package/dest/aztec-address/index.d.ts.map +0 -1
- package/dest/aztec-address/index.js +0 -114
- package/src/abi/abi.ts +0 -504
- package/src/abi/buffer.ts +0 -36
- package/src/abi/decoder.ts +0 -195
- package/src/abi/encoder.ts +0 -170
- package/src/abi/event_selector.ts +0 -92
- package/src/abi/function_selector.ts +0 -124
- package/src/abi/index.ts +0 -9
- package/src/abi/note_selector.ts +0 -78
- package/src/abi/selector.ts +0 -64
- package/src/abi/u128.ts +0 -71
- package/src/abi/utils.ts +0 -86
- package/src/aztec-address/index.ts +0 -146
|
@@ -4,59 +4,48 @@ const log = createLogger('foundation:worker_pool');
|
|
|
4
4
|
* Allocates a pool of WasmWorker's.
|
|
5
5
|
* Worker 0 is allocated MAX_PAGES memory pages. This is because worker 0 will need to hold the proving key
|
|
6
6
|
* (i.e. Has state), whereas the others are pure compute (they hold a little crs state).
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
*/ export class WorkerPool {
|
|
8
|
+
// TODO(AD): Revisit what this means in aztec 3 context
|
|
9
|
+
// --
|
|
10
|
+
// Introduction of low mem prover work (polynomial cache) may actually increase mem usage when the backing store isn't
|
|
11
|
+
// enabled. We were seeing intermittent failings related to memory in production for some users when limiting to
|
|
12
|
+
// 6660 (416MB). It would be nice to understand why this is (the non determinism and/or the increased mem usage).
|
|
13
|
+
// For now, increasing mem usage to 512MB. This maybe preferable to backing out the low mem work, but
|
|
14
|
+
// ironically may break the chance of us using it in mobile.
|
|
15
|
+
// We *could* enable the low memory backing store, but this needs a little bit of work to actually
|
|
16
|
+
// read/write from indexeddb, performance testing, and actual further memory load testing.
|
|
17
|
+
// At this point it's hard to know what our memory savings would be relative to just fully reverting the LMP.
|
|
18
|
+
// public static MAX_PAGES = 6660;
|
|
19
|
+
/**
|
|
20
|
+
* The maximum number of memory pages to be used by the webassembly.
|
|
21
|
+
*/ static MAX_PAGES = 8192;
|
|
15
22
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
* The workers in the pool.
|
|
24
|
+
*/ workers = [];
|
|
25
|
+
/**
|
|
26
|
+
* Create an instance and initialize the workers.
|
|
27
|
+
* @param createWorker - Worker factory.
|
|
28
|
+
* @param poolSize - Pool size.
|
|
29
|
+
* @returns An initialized WorkerPool.
|
|
30
|
+
*/ static async new(createWorker, poolSize) {
|
|
22
31
|
const pool = new WorkerPool();
|
|
23
32
|
await pool.init(createWorker, poolSize);
|
|
24
33
|
return pool;
|
|
25
34
|
}
|
|
26
35
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
async init(createWorker, poolSize, maxMem = WorkerPool.MAX_PAGES) {
|
|
36
|
+
* Initialize the workers.
|
|
37
|
+
* @param createWorker - Worker factory().
|
|
38
|
+
* @param poolSize - Pool size.
|
|
39
|
+
* @param maxMem - Max memory pages.
|
|
40
|
+
*/ async init(createWorker, poolSize, maxMem = WorkerPool.MAX_PAGES) {
|
|
33
41
|
log.debug(`creating ${poolSize} workers...`);
|
|
34
42
|
const start = new Date().getTime();
|
|
35
|
-
this.workers = await Promise.all(Array(poolSize)
|
|
36
|
-
.fill(0)
|
|
37
|
-
.map((_, i) => createWorker(`${i}`, i === 0 ? Math.min(WorkerPool.MAX_PAGES, maxMem) : 768, maxMem)));
|
|
43
|
+
this.workers = await Promise.all(Array(poolSize).fill(0).map((_, i)=>createWorker(`${i}`, i === 0 ? Math.min(WorkerPool.MAX_PAGES, maxMem) : 768, maxMem)));
|
|
38
44
|
log.debug(`created workers: ${new Date().getTime() - start}ms`);
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
await Promise.all(this.workers.map(w => w.destroyWorker()));
|
|
47
|
+
* Tell all workers in the pool to stop processing.
|
|
48
|
+
*/ async destroy() {
|
|
49
|
+
await Promise.all(this.workers.map((w)=>w.destroyWorker()));
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
|
-
// TODO(AD): Revisit what this means in aztec 3 context
|
|
48
|
-
// --
|
|
49
|
-
// Introduction of low mem prover work (polynomial cache) may actually increase mem usage when the backing store isn't
|
|
50
|
-
// enabled. We were seeing intermittent failings related to memory in production for some users when limiting to
|
|
51
|
-
// 6660 (416MB). It would be nice to understand why this is (the non determinism and/or the increased mem usage).
|
|
52
|
-
// For now, increasing mem usage to 512MB. This maybe preferable to backing out the low mem work, but
|
|
53
|
-
// ironically may break the chance of us using it in mobile.
|
|
54
|
-
// We *could* enable the low memory backing store, but this needs a little bit of work to actually
|
|
55
|
-
// read/write from indexeddb, performance testing, and actual further memory load testing.
|
|
56
|
-
// At this point it's hard to know what our memory savings would be relative to just fully reverting the LMP.
|
|
57
|
-
// public static MAX_PAGES = 6660;
|
|
58
|
-
/**
|
|
59
|
-
* The maximum number of memory pages to be used by the webassembly.
|
|
60
|
-
*/
|
|
61
|
-
WorkerPool.MAX_PAGES = 8192;
|
|
62
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3Bvb2wuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvd29ya2VyL3dvcmtlcl9wb29sLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUcvQyxNQUFNLEdBQUcsR0FBRyxZQUFZLENBQUMsd0JBQXdCLENBQUMsQ0FBQztBQU9uRDs7OztHQUlHO0FBQ0gsTUFBTSxPQUFPLFVBQVU7SUFBdkI7UUFnQkU7O1dBRUc7UUFDSyxZQUFPLEdBQWlCLEVBQUUsQ0FBQztJQXNDckMsQ0FBQztJQXBDQzs7Ozs7T0FLRztJQUNILE1BQU0sQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLFlBQTBCLEVBQUUsUUFBZ0I7UUFDM0QsTUFBTSxJQUFJLEdBQUcsSUFBSSxVQUFVLEVBQUUsQ0FBQztRQUM5QixNQUFNLElBQUksQ0FBQyxJQUFJLENBQUMsWUFBWSxFQUFFLFFBQVEsQ0FBQyxDQUFDO1FBQ3hDLE9BQU8sSUFBSSxDQUFDO0lBQ2QsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0ksS0FBSyxDQUFDLElBQUksQ0FBQyxZQUEwQixFQUFFLFFBQWdCLEVBQUUsTUFBTSxHQUFHLFVBQVUsQ0FBQyxTQUFTO1FBQzNGLEdBQUcsQ0FBQyxLQUFLLENBQUMsWUFBWSxRQUFRLGFBQWEsQ0FBQyxDQUFDO1FBQzdDLE1BQU0sS0FBSyxHQUFHLElBQUksSUFBSSxFQUFFLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDbkMsSUFBSSxDQUFDLE9BQU8sR0FBRyxNQUFNLE9BQU8sQ0FBQyxHQUFHLENBQzlCLEtBQUssQ0FBQyxRQUFRLENBQUM7YUFDWixJQUFJLENBQUMsQ0FBQyxDQUFDO2FBQ1AsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUMsWUFBWSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsU0FBUyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FDdkcsQ0FBQztRQUVGLEdBQUcsQ0FBQyxLQUFLLENBQUMsb0JBQW9CLElBQUksSUFBSSxFQUFFLENBQUMsT0FBTyxFQUFFLEdBQUcsS0FBSyxJQUFJLENBQUMsQ0FBQztJQUNsRSxDQUFDO0lBRUQ7O09BRUc7SUFDSSxLQUFLLENBQUMsT0FBTztRQUNsQixNQUFNLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsYUFBYSxFQUFFLENBQUMsQ0FBQyxDQUFDO0lBQzlELENBQUM7O0FBdkRELHVEQUF1RDtBQUN2RCxLQUFLO0FBQ0wsc0hBQXNIO0FBQ3RILGdIQUFnSDtBQUNoSCxpSEFBaUg7QUFDakgscUdBQXFHO0FBQ3JHLDREQUE0RDtBQUM1RCxrR0FBa0c7QUFDbEcsMEZBQTBGO0FBQzFGLDZHQUE2RztBQUM3RyxrQ0FBa0M7QUFDbEM7O0dBRUc7QUFDVyxvQkFBUyxHQUFHLElBQUksQUFBUCxDQUFRIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0-testnet-ignition.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dest/index.js",
|
|
6
6
|
"types": "./dest/index.d.ts",
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"./abi": "./dest/abi/index.js",
|
|
12
12
|
"./async-map": "./dest/async-map/index.js",
|
|
13
13
|
"./async-pool": "./dest/async-pool/index.js",
|
|
14
|
-
"./aztec-address": "./dest/aztec-address/index.js",
|
|
15
14
|
"./collection": "./dest/collection/index.js",
|
|
16
15
|
"./config": "./dest/config/index.js",
|
|
17
16
|
"./crypto": "./dest/crypto/index.js",
|
|
@@ -62,7 +61,7 @@
|
|
|
62
61
|
"generate": "true",
|
|
63
62
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
64
63
|
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
65
|
-
"test": "
|
|
64
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
66
65
|
},
|
|
67
66
|
"inherits": [
|
|
68
67
|
"../package.common.json"
|
|
@@ -95,7 +94,7 @@
|
|
|
95
94
|
"reporters": [
|
|
96
95
|
"default"
|
|
97
96
|
],
|
|
98
|
-
"testTimeout":
|
|
97
|
+
"testTimeout": 120000,
|
|
99
98
|
"setupFilesAfterEnv": [
|
|
100
99
|
"../../foundation/src/jest/setup.mjs"
|
|
101
100
|
],
|
|
@@ -104,7 +103,7 @@
|
|
|
104
103
|
]
|
|
105
104
|
},
|
|
106
105
|
"dependencies": {
|
|
107
|
-
"@aztec/bb.js": "0.
|
|
106
|
+
"@aztec/bb.js": "0.77.0-testnet-ignition.21",
|
|
108
107
|
"@koa/cors": "^5.0.0",
|
|
109
108
|
"@noble/curves": "^1.2.0",
|
|
110
109
|
"bn.js": "^5.2.1",
|
|
@@ -132,6 +131,7 @@
|
|
|
132
131
|
},
|
|
133
132
|
"devDependencies": {
|
|
134
133
|
"@jest/globals": "^29.5.0",
|
|
134
|
+
"@libp2p/interface": "1.3.1",
|
|
135
135
|
"@types/bn.js": "^5.1.3",
|
|
136
136
|
"@types/debug": "^4.1.7",
|
|
137
137
|
"@types/detect-node": "^2.0.0",
|
package/src/array/array.ts
CHANGED
package/src/buffer/buffer32.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
2
|
-
import {
|
|
2
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { BufferReader, deserializeBigInt, serializeBigInt } from '@aztec/foundation/serialize';
|
|
4
4
|
|
|
5
5
|
import { bufferToHex } from '../string/index.js';
|
package/src/collection/array.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Tuple } from '../serialize/types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pads an array to the target length by appending an element to its end. Throws if target length exceeds the input array length. Does not modify the input array.
|
package/src/config/env_var.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type EnvVar =
|
|
|
26
26
|
| 'BOT_MAX_PENDING_TXS'
|
|
27
27
|
| 'BOT_NO_START'
|
|
28
28
|
| 'BOT_NO_WAIT_FOR_TRANSFERS'
|
|
29
|
+
| 'BOT_L1_MNEMONIC'
|
|
30
|
+
| 'BOT_L1_PRIVATE_KEY'
|
|
29
31
|
| 'BOT_PRIVATE_KEY'
|
|
30
32
|
| 'BOT_PRIVATE_TRANSFERS_PER_TX'
|
|
31
33
|
| 'BOT_PUBLIC_TRANSFERS_PER_TX'
|
|
@@ -42,12 +44,11 @@ export type EnvVar =
|
|
|
42
44
|
| 'DATA_DIRECTORY'
|
|
43
45
|
| 'DATA_STORE_MAP_SIZE_KB'
|
|
44
46
|
| 'DEBUG'
|
|
45
|
-
| 'DEBUG_P2P_DISABLE_MESSAGE_VALIDATION'
|
|
46
47
|
| 'DEBUG_P2P_DISABLE_COLOCATION_PENALTY'
|
|
47
48
|
| 'DEPLOY_AZTEC_CONTRACTS_SALT'
|
|
48
49
|
| 'DEPLOY_AZTEC_CONTRACTS'
|
|
49
50
|
| 'ENFORCE_FEES'
|
|
50
|
-
| '
|
|
51
|
+
| 'ETHEREUM_HOSTS'
|
|
51
52
|
| 'FEE_JUICE_CONTRACT_ADDRESS'
|
|
52
53
|
| 'FEE_JUICE_PORTAL_CONTRACT_ADDRESS'
|
|
53
54
|
| 'FEE_RECIPIENT'
|
|
@@ -71,11 +72,9 @@ export type EnvVar =
|
|
|
71
72
|
| 'NO_PXE'
|
|
72
73
|
| 'COIN_ISSUER_CONTRACT_ADDRESS'
|
|
73
74
|
| 'USE_GCLOUD_LOGGING'
|
|
74
|
-
| 'USE_GCLOUD_METRICS'
|
|
75
75
|
| 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT'
|
|
76
76
|
| 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT'
|
|
77
77
|
| 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT'
|
|
78
|
-
| 'OTEL_SERVICE_NAME'
|
|
79
78
|
| 'OTEL_COLLECT_INTERVAL_MS'
|
|
80
79
|
| 'OTEL_EXCLUDE_METRICS'
|
|
81
80
|
| 'OTEL_EXPORT_TIMEOUT_MS'
|
|
@@ -83,6 +82,7 @@ export type EnvVar =
|
|
|
83
82
|
| 'P2P_BLOCK_CHECK_INTERVAL_MS'
|
|
84
83
|
| 'P2P_BLOCK_REQUEST_BATCH_SIZE'
|
|
85
84
|
| 'P2P_BOOTSTRAP_NODE_ENR_VERSION_CHECK'
|
|
85
|
+
| 'P2P_BOOTSTRAP_NODES_AS_FULL_PEERS'
|
|
86
86
|
| 'P2P_ENABLED'
|
|
87
87
|
| 'P2P_GOSSIPSUB_D'
|
|
88
88
|
| 'P2P_GOSSIPSUB_DHI'
|
|
@@ -113,7 +113,6 @@ export type EnvVar =
|
|
|
113
113
|
| 'P2P_ARCHIVED_TX_LIMIT'
|
|
114
114
|
| 'PEER_ID_PRIVATE_KEY'
|
|
115
115
|
| 'PROOF_VERIFIER_L1_START_BLOCK'
|
|
116
|
-
| 'PROOF_VERIFIER_POLL_INTERVAL_MS'
|
|
117
116
|
| 'PROVER_AGENT_ENABLED'
|
|
118
117
|
| 'PROVER_AGENT_CONCURRENCY'
|
|
119
118
|
| 'PROVER_AGENT_COUNT'
|
|
@@ -126,6 +125,7 @@ export type EnvVar =
|
|
|
126
125
|
| 'PROVER_BROKER_JOB_MAX_RETRIES'
|
|
127
126
|
| 'PROVER_BROKER_BATCH_INTERVAL_MS'
|
|
128
127
|
| 'PROVER_BROKER_BATCH_SIZE'
|
|
128
|
+
| 'PROVER_BROKER_MAX_EPOCHS_TO_KEEP_RESULTS_FOR'
|
|
129
129
|
| 'PROVER_COORDINATION_NODE_URL'
|
|
130
130
|
| 'PROVER_DISABLED'
|
|
131
131
|
| 'PROVER_FAILED_PROOF_STORE'
|
|
@@ -142,7 +142,9 @@ export type EnvVar =
|
|
|
142
142
|
| 'PROVER_PUBLISHER_PRIVATE_KEY'
|
|
143
143
|
| 'PROVER_REAL_PROOFS'
|
|
144
144
|
| 'PROVER_REQUIRED_CONFIRMATIONS'
|
|
145
|
+
| 'PROVER_TEST_DELAY_FACTOR'
|
|
145
146
|
| 'PROVER_TEST_DELAY_MS'
|
|
147
|
+
| 'PROVER_TEST_DELAY_TYPE'
|
|
146
148
|
| 'PXE_L2_STARTING_BLOCK'
|
|
147
149
|
| 'PXE_PROVER_ENABLED'
|
|
148
150
|
| 'PROVER_TARGET_ESCROW_AMOUNT'
|
package/src/config/index.ts
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BarretenbergSync, RawBuffer } from '@aztec/bb.js';
|
|
2
|
+
|
|
3
|
+
import { Buffer } from 'buffer';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AES-128-CBC encryption/decryption.
|
|
7
|
+
*/
|
|
8
|
+
export class Aes128 {
|
|
9
|
+
/**
|
|
10
|
+
* Encrypt a buffer using AES-128-CBC.
|
|
11
|
+
* @param data - Data to encrypt.
|
|
12
|
+
* @param iv - AES initialization vector.
|
|
13
|
+
* @param key - Key to encrypt with.
|
|
14
|
+
* @returns Encrypted data.
|
|
15
|
+
*/
|
|
16
|
+
public async encryptBufferCBC(data: Uint8Array, iv: Uint8Array, key: Uint8Array) {
|
|
17
|
+
const rawLength = data.length;
|
|
18
|
+
const numPaddingBytes = 16 - (rawLength % 16);
|
|
19
|
+
const paddingBuffer = Buffer.alloc(numPaddingBytes);
|
|
20
|
+
// input num bytes needs to be a multiple of 16 and at least 1 byte
|
|
21
|
+
// node uses PKCS#7-Padding scheme, where padding byte value = the number of padding bytes
|
|
22
|
+
paddingBuffer.fill(numPaddingBytes);
|
|
23
|
+
const input = Buffer.concat([data, paddingBuffer]);
|
|
24
|
+
|
|
25
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
26
|
+
return Buffer.from(
|
|
27
|
+
api.aesEncryptBufferCbc(new RawBuffer(input), new RawBuffer(iv), new RawBuffer(key), input.length),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Decrypt a buffer using AES-128-CBC.
|
|
33
|
+
* We keep the padding in the returned buffer.
|
|
34
|
+
* @param data - Data to decrypt.
|
|
35
|
+
* @param iv - AES initialization vector.
|
|
36
|
+
* @param key - Key to decrypt with.
|
|
37
|
+
* @returns Decrypted data.
|
|
38
|
+
*/
|
|
39
|
+
public async decryptBufferCBCKeepPadding(data: Uint8Array, iv: Uint8Array, key: Uint8Array): Promise<Buffer> {
|
|
40
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
41
|
+
const paddedBuffer = Buffer.from(
|
|
42
|
+
api.aesDecryptBufferCbc(new RawBuffer(data), new RawBuffer(iv), new RawBuffer(key), data.length),
|
|
43
|
+
);
|
|
44
|
+
return paddedBuffer;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Decrypt a buffer using AES-128-CBC.
|
|
49
|
+
* @param data - Data to decrypt.
|
|
50
|
+
* @param iv - AES initialization vector.
|
|
51
|
+
* @param key - Key to decrypt with.
|
|
52
|
+
* @returns Decrypted data.
|
|
53
|
+
*/
|
|
54
|
+
public async decryptBufferCBC(data: Uint8Array, iv: Uint8Array, key: Uint8Array) {
|
|
55
|
+
const paddedBuffer = await this.decryptBufferCBCKeepPadding(data, iv, key);
|
|
56
|
+
const paddingToRemove = paddedBuffer[paddedBuffer.length - 1];
|
|
57
|
+
return paddedBuffer.subarray(0, paddedBuffer.length - paddingToRemove);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { BarretenbergSync } from '@aztec/bb.js';
|
|
2
|
+
import { numToInt32BE } from '@aztec/foundation/serialize';
|
|
3
|
+
|
|
4
|
+
import { concatenateUint8Arrays } from '../serialize.js';
|
|
5
|
+
import { EcdsaSignature } from './signature.js';
|
|
6
|
+
|
|
7
|
+
export * from './signature.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* ECDSA signature construction and helper operations.
|
|
11
|
+
* TODO: Replace with codegen api on bb.js.
|
|
12
|
+
*/
|
|
13
|
+
export class Ecdsa {
|
|
14
|
+
/**
|
|
15
|
+
* Computes a secp256k1 public key from a private key.
|
|
16
|
+
* @param privateKey - Secp256k1 private key.
|
|
17
|
+
* @returns A secp256k1 public key.
|
|
18
|
+
*/
|
|
19
|
+
public async computePublicKey(privateKey: Buffer): Promise<Buffer> {
|
|
20
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
21
|
+
const [result] = api.getWasm().callWasmExport('ecdsa__compute_public_key', [privateKey], [64]);
|
|
22
|
+
return Buffer.from(result);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Constructs an ECDSA signature given a msg and a private key.
|
|
27
|
+
* @param msg - Message over which the signature is constructed.
|
|
28
|
+
* @param privateKey - The secp256k1 private key of the signer.
|
|
29
|
+
* @returns An ECDSA signature of the form (r, s, v).
|
|
30
|
+
*/
|
|
31
|
+
public async constructSignature(msg: Uint8Array, privateKey: Buffer) {
|
|
32
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
33
|
+
const messageArray = concatenateUint8Arrays([numToInt32BE(msg.length), msg]);
|
|
34
|
+
const [r, s, v] = api
|
|
35
|
+
.getWasm()
|
|
36
|
+
.callWasmExport('ecdsa__construct_signature_', [messageArray, privateKey], [32, 32, 1]);
|
|
37
|
+
return new EcdsaSignature(Buffer.from(r), Buffer.from(s), Buffer.from(v));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Recovers a secp256k1 public key from an ECDSA signature (similar to ecrecover).
|
|
42
|
+
* @param msg - Message over which the signature was constructed.
|
|
43
|
+
* @param sig - The ECDSA signature.
|
|
44
|
+
* @returns The secp256k1 public key of the signer.
|
|
45
|
+
*/
|
|
46
|
+
public async recoverPublicKey(msg: Uint8Array, sig: EcdsaSignature): Promise<Buffer> {
|
|
47
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
48
|
+
const messageArray = concatenateUint8Arrays([numToInt32BE(msg.length), msg]);
|
|
49
|
+
const [result] = api
|
|
50
|
+
.getWasm()
|
|
51
|
+
.callWasmExport('ecdsa__recover_public_key_from_signature_', [messageArray, sig.r, sig.s, sig.v], [64]);
|
|
52
|
+
return Buffer.from(result);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Verifies and ECDSA signature given a secp256k1 public key.
|
|
57
|
+
* @param msg - Message over which the signature was constructed.
|
|
58
|
+
* @param pubKey - The secp256k1 public key of the signer.
|
|
59
|
+
* @param sig - The ECDSA signature.
|
|
60
|
+
* @returns True or false.
|
|
61
|
+
*/
|
|
62
|
+
public async verifySignature(msg: Uint8Array, pubKey: Buffer, sig: EcdsaSignature) {
|
|
63
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
64
|
+
const messageArray = concatenateUint8Arrays([numToInt32BE(msg.length), msg]);
|
|
65
|
+
const [result] = api
|
|
66
|
+
.getWasm()
|
|
67
|
+
.callWasmExport('ecdsa__verify_signature_', [messageArray, pubKey, sig.r, sig.s, sig.v], [1]);
|
|
68
|
+
return result[0] === 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { mapTuple } from '@aztec/foundation/serialize';
|
|
5
|
+
|
|
6
|
+
import type { Signature } from '../signature/index.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ECDSA signature used for transactions.
|
|
10
|
+
* @see cpp/barretenberg/cpp/src/barretenberg/crypto/ecdsa/ecdsa.hpp
|
|
11
|
+
*/
|
|
12
|
+
export class EcdsaSignature implements Signature {
|
|
13
|
+
constructor(
|
|
14
|
+
/**
|
|
15
|
+
* The r byte-array (32 bytes) in an ECDSA signature.
|
|
16
|
+
*/
|
|
17
|
+
public r: Buffer,
|
|
18
|
+
/**
|
|
19
|
+
* The s byte-array (32 bytes) in an ECDSA signature.
|
|
20
|
+
*/
|
|
21
|
+
public s: Buffer,
|
|
22
|
+
/**
|
|
23
|
+
* The recovery id (1 byte) in an ECDSA signature.
|
|
24
|
+
*/
|
|
25
|
+
public v: Buffer,
|
|
26
|
+
) {
|
|
27
|
+
if (r.length != 32) {
|
|
28
|
+
throw new Error(`Invalid length of 'r' in ECDSA signature. Expected 32, got ${s.length}`);
|
|
29
|
+
}
|
|
30
|
+
if (s.length != 32) {
|
|
31
|
+
throw new Error(`Invalid length of 's' in ECDSA signature. Expected 32, got ${r.length}`);
|
|
32
|
+
}
|
|
33
|
+
if (v.length != 1) {
|
|
34
|
+
throw new Error(`Invalid length of 'v' in ECDSA signature. Expected 1, got ${v.length}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Converts an ECDSA signature to a buffer.
|
|
40
|
+
* @returns A buffer.
|
|
41
|
+
*/
|
|
42
|
+
toBuffer() {
|
|
43
|
+
return Buffer.concat([this.r, this.s, this.v]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Deserializes the signature from a buffer.
|
|
48
|
+
* @param buffer - The buffer from which to deserialize the signature.
|
|
49
|
+
* @returns The ECDSA signature
|
|
50
|
+
*/
|
|
51
|
+
public static fromBuffer(buffer: Buffer) {
|
|
52
|
+
return new EcdsaSignature(buffer.subarray(0, 32), buffer.subarray(32, 64), buffer.subarray(64, 65));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new instance from bigint r and s values.
|
|
57
|
+
* @param r - r.
|
|
58
|
+
* @param s - s.
|
|
59
|
+
* @param v - v.
|
|
60
|
+
* @returns The resulting signature.
|
|
61
|
+
*/
|
|
62
|
+
public static fromBigInts(r: bigint, s: bigint, v: number) {
|
|
63
|
+
return new EcdsaSignature(toBufferBE(r, 32), toBufferBE(s, 32), Buffer.from([v]));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Generate a random ECDSA signature for testing.
|
|
68
|
+
* @returns A randomly generated ECDSA signature (not a valid one).
|
|
69
|
+
*/
|
|
70
|
+
public static random() {
|
|
71
|
+
return new EcdsaSignature(randomBytes(32), randomBytes(32), Buffer.from([27]));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Convert an ECDSA signature to a buffer.
|
|
76
|
+
* @returns A 65-character string of the form 0x<r><s><v>.
|
|
77
|
+
*/
|
|
78
|
+
toString() {
|
|
79
|
+
return `0x${this.toBuffer().toString('hex')}`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Converts the signature to an array of fields.
|
|
84
|
+
* @param includeV - Determines whether the 'v' term is included
|
|
85
|
+
* @returns The signature components as an array of fields
|
|
86
|
+
*/
|
|
87
|
+
toFields(includeV = false): Fr[] {
|
|
88
|
+
const sig = this.toBuffer();
|
|
89
|
+
|
|
90
|
+
const buf1 = Buffer.alloc(32);
|
|
91
|
+
const buf2 = Buffer.alloc(32);
|
|
92
|
+
const buf3 = Buffer.alloc(32);
|
|
93
|
+
|
|
94
|
+
sig.copy(buf1, 1, 0, 31);
|
|
95
|
+
sig.copy(buf2, 1, 31, 62);
|
|
96
|
+
sig.copy(buf3, 1, 62, includeV ? 65 : 64);
|
|
97
|
+
|
|
98
|
+
return mapTuple([buf1, buf2, buf3], Fr.fromBuffer);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BarretenbergSync } from '@aztec/bb.js';
|
|
2
|
+
import { Fr, type GrumpkinScalar, Point } from '@aztec/foundation/fields';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Grumpkin elliptic curve operations.
|
|
6
|
+
*/
|
|
7
|
+
export class Grumpkin {
|
|
8
|
+
// prettier-ignore
|
|
9
|
+
static generator = Point.fromBuffer(Buffer.from([
|
|
10
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
11
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
|
12
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xcf, 0x13, 0x5e, 0x75, 0x06, 0xa4, 0x5d, 0x63,
|
|
13
|
+
0x2d, 0x27, 0x0d, 0x45, 0xf1, 0x18, 0x12, 0x94, 0x83, 0x3f, 0xc4, 0x8d, 0x82, 0x3f, 0x27, 0x2c,
|
|
14
|
+
]));
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Point generator
|
|
18
|
+
* @returns The generator for the curve.
|
|
19
|
+
*/
|
|
20
|
+
public generator(): Point {
|
|
21
|
+
return Grumpkin.generator;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Multiplies a point by a scalar (adds the point `scalar` amount of times).
|
|
26
|
+
* @param point - Point to multiply.
|
|
27
|
+
* @param scalar - Scalar to multiply by.
|
|
28
|
+
* @returns Result of the multiplication.
|
|
29
|
+
*/
|
|
30
|
+
public async mul(point: Point, scalar: GrumpkinScalar): Promise<Point> {
|
|
31
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
32
|
+
const [result] = api.getWasm().callWasmExport('ecc_grumpkin__mul', [point.toBuffer(), scalar.toBuffer()], [64]);
|
|
33
|
+
return Point.fromBuffer(Buffer.from(result));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Add two points.
|
|
38
|
+
* @param a - Point a in the addition
|
|
39
|
+
* @param b - Point b to add to a
|
|
40
|
+
* @returns Result of the addition.
|
|
41
|
+
*/
|
|
42
|
+
public async add(a: Point, b: Point): Promise<Point> {
|
|
43
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
44
|
+
const [result] = api.getWasm().callWasmExport('ecc_grumpkin__add', [a.toBuffer(), b.toBuffer()], [64]);
|
|
45
|
+
return Point.fromBuffer(Buffer.from(result));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Multiplies a set of points by a scalar.
|
|
50
|
+
* @param points - Points to multiply.
|
|
51
|
+
* @param scalar - Scalar to multiply by.
|
|
52
|
+
* @returns Points multiplied by the scalar.
|
|
53
|
+
*/
|
|
54
|
+
public async batchMul(points: Point[], scalar: GrumpkinScalar) {
|
|
55
|
+
const concatenatedPoints: Buffer = Buffer.concat(points.map(point => point.toBuffer()));
|
|
56
|
+
|
|
57
|
+
const pointsByteLength = points.length * Point.SIZE_IN_BYTES;
|
|
58
|
+
|
|
59
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
60
|
+
const [result] = api
|
|
61
|
+
.getWasm()
|
|
62
|
+
.callWasmExport(
|
|
63
|
+
'ecc_grumpkin__batch_mul',
|
|
64
|
+
[concatenatedPoints, scalar.toBuffer(), points.length],
|
|
65
|
+
[pointsByteLength],
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const parsedResult: Point[] = [];
|
|
69
|
+
for (let i = 0; i < pointsByteLength; i += 64) {
|
|
70
|
+
parsedResult.push(Point.fromBuffer(Buffer.from(result.subarray(i, i + 64))));
|
|
71
|
+
}
|
|
72
|
+
return parsedResult;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Gets a random field element.
|
|
77
|
+
* @returns Random field element.
|
|
78
|
+
*/
|
|
79
|
+
public async getRandomFr(): Promise<Fr> {
|
|
80
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
81
|
+
const [result] = api.getWasm().callWasmExport('ecc_grumpkin__get_random_scalar_mod_circuit_modulus', [], [32]);
|
|
82
|
+
return Fr.fromBuffer(Buffer.from(result));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Converts a 512 bits long buffer to a field.
|
|
87
|
+
* @param uint512Buf - The buffer to convert.
|
|
88
|
+
* @returns Buffer representation of the field element.
|
|
89
|
+
*/
|
|
90
|
+
public async reduce512BufferToFr(uint512Buf: Buffer): Promise<Fr> {
|
|
91
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
92
|
+
const [result] = api
|
|
93
|
+
.getWasm()
|
|
94
|
+
.callWasmExport('ecc_grumpkin__reduce512_buffer_mod_circuit_modulus', [uint512Buf], [32]);
|
|
95
|
+
return Fr.fromBuffer(Buffer.from(result));
|
|
96
|
+
}
|
|
97
|
+
}
|
package/src/crypto/index.ts
CHANGED
|
@@ -6,3 +6,9 @@ export * from './pedersen/index.js';
|
|
|
6
6
|
export * from './poseidon/index.js';
|
|
7
7
|
export * from './secp256k1-signer/index.js';
|
|
8
8
|
export * from './keys/index.js';
|
|
9
|
+
export * from './aes128/index.js';
|
|
10
|
+
export * from './grumpkin/index.js';
|
|
11
|
+
export * from './ecdsa/index.js';
|
|
12
|
+
export * from './secp256k1/index.js';
|
|
13
|
+
export * from './schnorr/index.js';
|
|
14
|
+
export * from './signature/index.js';
|
package/src/crypto/keys/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BarretenbergSync, RawBuffer } from '@aztec/bb.js';
|
|
|
3
3
|
import { Fr } from '../../fields/fields.js';
|
|
4
4
|
|
|
5
5
|
export async function vkAsFieldsMegaHonk(input: Buffer): Promise<Fr[]> {
|
|
6
|
-
const api = await BarretenbergSync.initSingleton();
|
|
6
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
7
7
|
const result = api.acirVkAsFieldsMegaHonk(new RawBuffer(input));
|
|
8
8
|
|
|
9
9
|
return result.map(bbFr => Fr.fromBuffer(Buffer.from(bbFr.toBuffer()))); // TODO(#4189): remove this conversion
|
|
@@ -12,7 +12,7 @@ export async function pedersenCommit(input: Buffer[], offset = 0) {
|
|
|
12
12
|
throw new Error('All Pedersen Commit input buffers must be <= 32 bytes.');
|
|
13
13
|
}
|
|
14
14
|
input = input.map(i => (i.length < 32 ? Buffer.concat([Buffer.alloc(32 - i.length, 0), i]) : i));
|
|
15
|
-
const api = await BarretenbergSync.initSingleton();
|
|
15
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
16
16
|
const point = api.pedersenCommit(
|
|
17
17
|
input.map(i => new FrBarretenberg(i)),
|
|
18
18
|
offset,
|
|
@@ -30,7 +30,7 @@ export async function pedersenCommit(input: Buffer[], offset = 0) {
|
|
|
30
30
|
*/
|
|
31
31
|
export async function pedersenHash(input: Fieldable[], index = 0): Promise<Fr> {
|
|
32
32
|
const inputFields = serializeToFields(input);
|
|
33
|
-
const api = await BarretenbergSync.initSingleton();
|
|
33
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
34
34
|
const hash = api.pedersenHash(
|
|
35
35
|
inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion
|
|
36
36
|
index,
|
|
@@ -42,7 +42,7 @@ export async function pedersenHash(input: Fieldable[], index = 0): Promise<Fr> {
|
|
|
42
42
|
* Create a pedersen hash from an arbitrary length buffer.
|
|
43
43
|
*/
|
|
44
44
|
export async function pedersenHashBuffer(input: Buffer, index = 0) {
|
|
45
|
-
const api = await BarretenbergSync.initSingleton();
|
|
45
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
46
46
|
const result = api.pedersenHashBuffer(input, index);
|
|
47
47
|
return Buffer.from(result.toBuffer());
|
|
48
48
|
}
|
|
@@ -10,7 +10,7 @@ import { type Fieldable, serializeToFields } from '../../serialize/serialize.js'
|
|
|
10
10
|
*/
|
|
11
11
|
export async function poseidon2Hash(input: Fieldable[]): Promise<Fr> {
|
|
12
12
|
const inputFields = serializeToFields(input);
|
|
13
|
-
const api = await BarretenbergSync.initSingleton();
|
|
13
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
14
14
|
const hash = api.poseidon2Hash(
|
|
15
15
|
inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion
|
|
16
16
|
);
|
|
@@ -26,7 +26,7 @@ export async function poseidon2Hash(input: Fieldable[]): Promise<Fr> {
|
|
|
26
26
|
export async function poseidon2HashWithSeparator(input: Fieldable[], separator: number): Promise<Fr> {
|
|
27
27
|
const inputFields = serializeToFields(input);
|
|
28
28
|
inputFields.unshift(new Fr(separator));
|
|
29
|
-
const api = await BarretenbergSync.initSingleton();
|
|
29
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
30
30
|
|
|
31
31
|
const hash = api.poseidon2Hash(
|
|
32
32
|
inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion
|
|
@@ -36,7 +36,7 @@ export async function poseidon2HashWithSeparator(input: Fieldable[], separator:
|
|
|
36
36
|
|
|
37
37
|
export async function poseidon2HashAccumulate(input: Fieldable[]): Promise<Fr> {
|
|
38
38
|
const inputFields = serializeToFields(input);
|
|
39
|
-
const api = await BarretenbergSync.initSingleton();
|
|
39
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
40
40
|
const result = api.poseidon2HashAccumulate(inputFields.map(i => new FrBarretenberg(i.toBuffer())));
|
|
41
41
|
return Fr.fromBuffer(Buffer.from(result.toBuffer()));
|
|
42
42
|
}
|
|
@@ -50,7 +50,7 @@ export async function poseidon2Permutation(input: Fieldable[]): Promise<Fr[]> {
|
|
|
50
50
|
const inputFields = serializeToFields(input);
|
|
51
51
|
// We'd like this assertion but it's not possible to use it in the browser.
|
|
52
52
|
// assert(input.length === 4, 'Input state must be of size 4');
|
|
53
|
-
const api = await BarretenbergSync.initSingleton();
|
|
53
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
54
54
|
const res = api.poseidon2Permutation(inputFields.map(i => new FrBarretenberg(i.toBuffer())));
|
|
55
55
|
// We'd like this assertion but it's not possible to use it in the browser.
|
|
56
56
|
// assert(res.length === 4, 'Output state must be of size 4');
|
|
@@ -68,7 +68,7 @@ export async function poseidon2HashBytes(input: Buffer): Promise<Fr> {
|
|
|
68
68
|
inputFields.push(Fr.fromBuffer(fieldBytes));
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const api = await BarretenbergSync.initSingleton();
|
|
71
|
+
const api = await BarretenbergSync.initSingleton(process.env.BB_WASM_PATH);
|
|
72
72
|
const res = api.poseidon2Hash(
|
|
73
73
|
inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion
|
|
74
74
|
);
|