-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(bb.js): initial API #232
Conversation
9ea1a07
to
754781a
Compare
754781a
to
db55a4c
Compare
"solidity.compileUsingRemoteVersion": "v0.6.10+commit.00c0fcaf", | ||
"search.exclude": { | ||
"**/.yarn": true, | ||
"**/.pnp.*": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Settings for tsdk (at least if we decided to keep using PNP), prettier, eslint
$<TARGET_OBJECTS:stdlib_primitives_objects> | ||
$<TARGET_OBJECTS:stdlib_schnorr_objects> | ||
$<TARGET_OBJECTS:stdlib_pedersen_objects> | ||
$<TARGET_OBJECTS:stdlib_blake2s_objects> | ||
$<TARGET_OBJECTS:stdlib_blake3s_objects> | ||
$<TARGET_OBJECTS:stdlib_sha256_objects> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing from wasm build
#!/usr/bin/env node | ||
/* eslint-disable */ | ||
"use strict"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PNP boilerplate
// If not done already, precompute constants. | ||
wasm.call("pedersen__init"); | ||
const inputVectors = serializeBufferArrayToVector(inputs); | ||
wasm.writeMemory(inputVectors, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Should we be writing to 0 instead of using bbmalloc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For data we can't control how big it will be should be written to allocated memory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought too. I did a straight refactor for now, but some stuff has overflow risks
* @param rhs - The second hash. | ||
* @returns The new 32-byte hash. | ||
*/ | ||
export function pedersenCompress( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the function format a lot for these wasm calls
* feat(b.js): bundle yalc dependencies * doc: running instructions in README --------- Co-authored-by: Adam Domurad <adam@aztecprotocol.com>
* fix: wasm build * feat: vscode settings * feat(b.js): initial typescript bindings * doc: running instructions in README * build: fix lint * Adam/feat/typescript bindings yalc (AztecProtocol/barretenberg#241) * feat(b.js): bundle yalc dependencies * doc: running instructions in README --------- Co-authored-by: Adam Domurad <adam@aztecprotocol.com> --------- Co-authored-by: Adam Domurad <adam@aztecprotocol.com>
* fix: wasm build * feat: vscode settings * feat(b.js): initial typescript bindings * doc: running instructions in README * build: fix lint * Adam/feat/typescript bindings yalc (AztecProtocol/barretenberg#241) * feat(b.js): bundle yalc dependencies * doc: running instructions in README --------- Co-authored-by: Adam Domurad <adam@aztecprotocol.com> --------- Co-authored-by: Adam Domurad <adam@aztecprotocol.com>
Description
Barretenberg.js initial bindings. Mainly exposes pedersen. To make this work you should also merge
adam/feat/typescript-bindings-yalc
into the repo. It is not included here as it is many files that would distract the review. They should probably be merged together.Checklist:
/markdown/specs
have been updated.@brief
describing the intended functionality.