-
Notifications
You must be signed in to change notification settings - Fork 266
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
refactor: no calls to pedersen from TS #2724
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from './client/index.js'; | ||
export * from './acvm/index.js'; | ||
export * from './public/index.js'; | ||
export { computeSlotForMapping } from './utils.js'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3208,7 +3208,7 @@ export function abisComputeGlobalsHash(wasm: IWasmModule, arg0: GlobalVariables) | |
export function abisComputePublicDataTreeValue(wasm: IWasmModule, arg0: Fr): Fr { | ||
return Fr.fromBuffer(callCbind(wasm, 'abis__compute_public_data_tree_value', [toBuffer(arg0)])); | ||
} | ||
export function abisComputePublicDataTreeIndex(wasm: IWasmModule, arg0: Fr, arg1: Fr): Fr { | ||
export function abisComputePublicDataTreeIndex(wasm: IWasmModule, arg0: Address, arg1: Fr): Fr { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct because of this alias. There is no AztecAddress on the C++ side so I guess Adam set it up like this to make it work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it |
||
return Fr.fromBuffer(callCbind(wasm, 'abis__compute_public_data_tree_index', [toBuffer(arg0), toBuffer(arg1)])); | ||
} | ||
export function privateKernelDummyPreviousKernel(wasm: IWasmModule): PreviousKernelData { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,22 +9,35 @@ import { Hasher } from '@aztec/types'; | |
|
||
/** | ||
* A helper class encapsulating Pedersen hash functionality. | ||
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same suggestion as above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in 4b722a5 |
||
*/ | ||
export class Pedersen implements Hasher { | ||
constructor(private wasm: IWasmModule) {} | ||
|
||
/* | ||
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. | ||
*/ | ||
public compress(lhs: Uint8Array, rhs: Uint8Array): Buffer { | ||
return pedersenCompress(this.wasm, lhs, rhs); | ||
} | ||
|
||
/* | ||
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. | ||
*/ | ||
public compressInputs(inputs: Buffer[]): Buffer { | ||
return pedersenHashInputs(this.wasm, inputs); | ||
} | ||
|
||
/* | ||
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. | ||
*/ | ||
public hashToField(data: Uint8Array): Buffer { | ||
return pedersenGetHash(this.wasm, Buffer.from(data)); | ||
} | ||
|
||
/* | ||
* @deprecated Don't call pedersen directly in production code. Instead, create specific nicely-called WASM functions. | ||
*/ | ||
public hashToTree(leaves: Buffer[]): Promise<Buffer[]> { | ||
return Promise.resolve(pedersenGetHashTree(this.wasm, leaves)); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from './synchronizer/index.js'; | ||
export * from './world-state-db/index.js'; | ||
export * from './utils.js'; | ||
export * from './synchronizer/config.js'; |
This file was deleted.
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.
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.
Addressed in 4b722a5