@aztec/foundation
Advanced tools
Comparing version 0.34.0 to 0.35.0
@@ -302,6 +302,6 @@ /// <reference types="node" resolution-mode="require"/> | ||
* Returns an initializer from the contract. | ||
* @param initalizerNameOrArtifact - The name of the constructor, or the artifact of the constructor, or undefined | ||
* @param initializerNameOrArtifact - The name of the constructor, or the artifact of the constructor, or undefined | ||
* to pick the default initializer. | ||
*/ | ||
export declare function getInitializer(contract: ContractArtifact, initalizerNameOrArtifact: string | undefined | FunctionArtifact): FunctionArtifact | undefined; | ||
export declare function getInitializer(contract: ContractArtifact, initializerNameOrArtifact: string | undefined | FunctionArtifact): FunctionArtifact | undefined; | ||
//# sourceMappingURL=abi.d.ts.map |
@@ -75,26 +75,26 @@ import { inflate } from 'pako'; | ||
* Returns an initializer from the contract. | ||
* @param initalizerNameOrArtifact - The name of the constructor, or the artifact of the constructor, or undefined | ||
* @param initializerNameOrArtifact - The name of the constructor, or the artifact of the constructor, or undefined | ||
* to pick the default initializer. | ||
*/ | ||
export function getInitializer(contract, initalizerNameOrArtifact) { | ||
if (typeof initalizerNameOrArtifact === 'string') { | ||
const found = contract.functions.find(f => f.name === initalizerNameOrArtifact); | ||
export function getInitializer(contract, initializerNameOrArtifact) { | ||
if (typeof initializerNameOrArtifact === 'string') { | ||
const found = contract.functions.find(f => f.name === initializerNameOrArtifact); | ||
if (!found) { | ||
throw new Error(`Constructor method ${initalizerNameOrArtifact} not found in contract artifact`); | ||
throw new Error(`Constructor method ${initializerNameOrArtifact} not found in contract artifact`); | ||
} | ||
else if (!found.isInitializer) { | ||
throw new Error(`Method ${initalizerNameOrArtifact} is not an initializer`); | ||
throw new Error(`Method ${initializerNameOrArtifact} is not an initializer`); | ||
} | ||
return found; | ||
} | ||
else if (initalizerNameOrArtifact === undefined) { | ||
else if (initializerNameOrArtifact === undefined) { | ||
return getDefaultInitializer(contract); | ||
} | ||
else { | ||
if (!initalizerNameOrArtifact.isInitializer) { | ||
throw new Error(`Method ${initalizerNameOrArtifact.name} is not an initializer`); | ||
if (!initializerNameOrArtifact.isInitializer) { | ||
throw new Error(`Method ${initializerNameOrArtifact.name} is not an initializer`); | ||
} | ||
return initalizerNameOrArtifact; | ||
return initializerNameOrArtifact; | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FiaS9hYmkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQXdEL0I7O0dBRUc7QUFDSCxNQUFNLENBQU4sSUFBWSxzQkFHWDtBQUhELFdBQVksc0JBQXNCO0lBQ2hDLDJDQUFpQixDQUFBO0lBQ2pCLDJDQUFpQixDQUFBO0FBQ25CLENBQUMsRUFIVyxzQkFBc0IsS0FBdEIsc0JBQXNCLFFBR2pDO0FBK0VEOztHQUVHO0FBQ0gsTUFBTSxDQUFOLElBQVksWUFJWDtBQUpELFdBQVksWUFBWTtJQUN0QixpQ0FBaUIsQ0FBQTtJQUNqQiw2QkFBYSxDQUFBO0lBQ2IsK0NBQStCLENBQUE7QUFDakMsQ0FBQyxFQUpXLFlBQVksS0FBWixZQUFZLFFBSXZCO0FBbUtEOztHQUVHO0FBQ0gsTUFBTSxVQUFVLG1CQUFtQixDQUNqQyxRQUEwQixFQUMxQixzQkFBaUQ7SUFFakQsTUFBTSxnQkFBZ0IsR0FBRyxRQUFRLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUNuRCxPQUFPLHNCQUFzQixLQUFLLFFBQVE7UUFDeEMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLEtBQUssc0JBQXNCO1FBQ25DLENBQUMsQ0FBQyxzQkFBc0IsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLElBQUksRUFBRSxDQUFDLENBQU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UMsc0JBQXNCLHlCQUF5QixpQ0FBaUMsQ0FBQyxDQUFDO1FBQ3BHLENBQUM7YUFBTSxJQUFJLENBQUMsS0FBSyxDQUFDLGFBQWEsRUFBRSxDQUFDO1lBQ2hDLE1BQU0sSUFBSSxLQUFLLENBQUMsVUFBVSx5QkFBeUIsd0JBQXdCLENBQUMsQ0FBQztRQUMvRSxDQUFDO1FBQ0QsT0FBTyxLQUFLLENBQUM7SUFDZixDQUFDO1NBQU0sSUFBSSx5QkFBeUIsS0FBSyxTQUFTLEVBQUUsQ0FBQztRQUNuRCxPQUFPLHFCQUFxQixDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQ3pDLENBQUM7U0FBTSxDQUFDO1FBQ04sSUFBSSxDQUFDLHlCQUF5QixDQUFDLGFBQWEsRUFBRSxDQUFDO1lBQzdDLE1BQU0sSUFBSSxLQUFLLENBQUMsVUFBVSx5QkFBeUIsQ0FBQyxJQUFJLHdCQUF3QixDQUFDLENBQUM7UUFDcEYsQ0FBQztRQUNELE9BQU8seUJBQXlCLENBQUM7SUFDbkMsQ0FBQztBQUNILENBQUMifQ== |
import { fromHex, toBigIntBE } from '../bigint-buffer/index.js'; | ||
import { keccak, randomBytes } from '../crypto/index.js'; | ||
import { keccak256, randomBytes } from '../crypto/index.js'; | ||
import { BufferReader } from '../serialize/buffer_reader.js'; | ||
@@ -35,3 +35,3 @@ import { Selector } from './selector.js'; | ||
} | ||
return EventSelector.fromBuffer(keccak(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
return EventSelector.fromBuffer(keccak256(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
} | ||
@@ -68,2 +68,2 @@ /** | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRfc2VsZWN0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYWJpL2V2ZW50X3NlbGVjdG9yLnRzIl0sIm5h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FBQyxDQUFDO1FBQ3pELENBQUM7UUFDRCxPQUFPLGFBQWEsQ0FBQyxVQUFVLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsQ0FBQyxFQUFFLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO0lBQ2hHLENBQUM7SUFFRDs7Ozs7OztPQU9HO0lBQ0gsTUFBTSxDQUFDLFVBQVUsQ0FBQyxRQUFnQjtRQUNoQyxNQUFNLEdBQUcsR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7UUFDOUIsSUFBSSxHQUFHLENBQUMsTUFBTSxLQUFLLFFBQVEsQ0FBQyxJQUFJLEVBQUUsQ0FBQztZQUNqQyxNQUFNLElBQUksS0FBSyxDQUFDLDJCQUEyQixHQUFHLENBQUMsTUFBTSxjQUFjLFFBQVEsQ0FBQyxJQUFJLElBQUksQ0FBQyxDQUFDO1FBQ3hGLENBQUM7UUFDRCxPQUFPLGFBQWEsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDdkMsQ0FBQztJQUVEOzs7T0FHRztJQUNILE1BQU0sQ0FBQyxLQUFLO1FBQ1YsT0FBTyxJQUFJLGFBQWEsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUM5QixDQUFDO0lBRUQ7OztPQUdHO0lBQ0gsTUFBTSxDQUFDLE1BQU07UUFDWCxPQUFPLGFBQWEsQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO0lBQzlELENBQUM7Q0FDRiJ9 |
import { fromHex, toBigIntBE } from '../bigint-buffer/index.js'; | ||
import { keccak, randomBytes } from '../crypto/index.js'; | ||
import { keccak256, randomBytes } from '../crypto/index.js'; | ||
import { BufferReader } from '../serialize/buffer_reader.js'; | ||
@@ -52,3 +52,3 @@ import { FieldReader } from '../serialize/field_reader.js'; | ||
} | ||
return FunctionSelector.fromBuffer(keccak(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
return FunctionSelector.fromBuffer(keccak256(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
} | ||
@@ -92,2 +92,2 @@ /** | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnVuY3Rpb25fc2VsZWN0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYWJpL2Z1bmN0aW9uX3NlbGVjdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDaEUsT0FBTyxFQUFFLE1BQU0sRUFBRSxXQUFXLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUV6RCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDN0QsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBRTNELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUN2RCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBVXpDLG9GQUFvRjtBQUNwRixNQUFNLE9BQU8sZ0JBQWlCLFNBQVEsUUFBUTtJQVE1QyxNQUFNLENBQ0osS0FBK0UsRUFDL0UsV0FBNEI7UUFFNUIsSUFBSSxPQUFPLEtBQUssS0FBSyxRQUFRLEVBQUUsQ0FBQztZQUM5QixPQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsZ0JBQWdCLENBQUMscUJBQXFCLENBQUMsS0FBSyxFQUFFLFdBQVksQ0FBQyxDQUFDLENBQUM7UUFDbEYsQ0FBQzthQUFNLElBQUksT0FBTyxLQUFLLEtBQUssU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RixDQUFDO1FBQ0QsT0FBTyxnQkFBZ0IsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDMUMsQ0FBQztJQUVEOzs7T0FHRztJQUNILE1BQU0sQ0FBQyxLQUFLO1FBQ1YsT0FBTyxJQUFJLGdCQUFnQixDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ2pDLENBQUM7SUFVRCxNQUFNLENBQUMscUJBQXFCLENBQzFCLFVBQWlFLEVBQ2pFLGVBQWdDO1FBRWhDLE1BQU0sRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFLEdBQ3hCLE9BQU8sVUFBVSxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFLFVBQVUsRUFBRSxlQUFnQixFQUFFLENBQUMsQ0FBQyxDQUFDLFVBQVUsQ0FBQztRQUNuRyxNQUFNLFNBQVMsR0FBRyx1QkFBdUIsQ0FBQyxJQUFJLEVBQUUsVUFBVSxDQUFDLENBQUM7UUFDNUQsTUFBTSxRQUFRLEdBQUcsSUFBSSxDQUFDLGFBQWEsQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUMvQyw2R0FBNkc7UUFDN0csMkRBQTJEO1FBQzNELE9BQU8sUUFBUSxDQUFDO0lBQ2xCLENBQUM7SUFFRDs7T0FFRztJQUNILE1BQU0sQ0FBQyxNQUFNO1FBQ1gsT0FBTyxnQkFBZ0IsQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO0lBQ2pFLENBQUM7Q0FDRiJ9 |
@@ -24,3 +24,7 @@ /// <reference types="node" resolution-mode="require"/> | ||
static random(): AztecAddress; | ||
toJSON(): { | ||
type: string; | ||
value: `0x${string}`; | ||
}; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
import { inspect } from 'util'; | ||
import { Fr, fromBuffer } from '../fields/index.js'; | ||
import { FieldReader } from '../serialize/index.js'; | ||
import { TypeRegistry } from '../serialize/type_registry.js'; | ||
/** | ||
@@ -44,4 +45,12 @@ * AztecAddress represents a 32-byte address in the Aztec Protocol. | ||
} | ||
toJSON() { | ||
return { | ||
type: 'AztecAddress', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
AztecAddress.ZERO = new AztecAddress(Buffer.alloc(32)); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXp0ZWMtYWRkcmVzcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRS9CLE9BQU8sRUFBRSxFQUFFLEVBQUUsVUFBVSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDcEQsT0FBTyxFQUFxQixXQUFXLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUV2RTs7Ozs7O0dBTUc7QUFDSCxNQUFNLE9BQU8sWUFBYSxTQUFRLEVBQUU7SUFDbEMsWUFBWSxNQUFjO1FBQ3hCLElBQUksTUFBTSxDQUFDLE1BQU0sS0FBSyxFQUFFLEVBQUUsQ0FBQztZQUN6QixNQUFNLElBQUksS0FBSyxDQUFDLCtCQUErQixNQUFNLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQztRQUNuRSxDQUFDO1FBQ0QsS0FBSyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ2hCLENBQUM7SUFFRCxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUM7UUFDZCxPQUFPLGdCQUFnQixJQUFJLENBQUMsUUFBUSxFQUFFLEdBQUcsQ0FBQztJQUM1QyxDQUFDO0lBSUQsTUFBTSxDQUFDLElBQUk7UUFDVCxPQUFPLFlBQVksQ0FBQyxJQUFJLENBQUM7SUFDM0I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FO1NBQ3ZCLENBQUM7SUFDSixDQUFDOztBQXJDTSxpQkFBSSxHQUFHLElBQUksWUFBWSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztBQXdDbkQsMEJBQTBCO0FBQzFCLFlBQVksQ0FBQyxRQUFRLENBQUMsY0FBYyxFQUFFLFlBQVksQ0FBQyxDQUFDIn0= |
export * from './keccak/index.js'; | ||
export * from './random/index.js'; | ||
export * from './sha256/index.js'; | ||
export * from './sha512/index.js'; | ||
export * from './pedersen/index.js'; | ||
@@ -5,0 +6,0 @@ export * from './poseidon/index.js'; |
@@ -5,2 +5,3 @@ import { BarretenbergSync } from '@aztec/bb.js'; | ||
export * from './sha256/index.js'; | ||
export * from './sha512/index.js'; | ||
export * from './pedersen/index.js'; | ||
@@ -17,2 +18,2 @@ export * from './poseidon/index.js'; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY3J5cHRvL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUVoRCxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMscUJBQXFCLENBQUM7QUFFcEM7Ozs7O0dBS0c7QUFDSCxNQUFNLENBQUMsS0FBSyxVQUFVLElBQUk7SUFDeEIsTUFBTSxnQkFBZ0IsQ0FBQyxhQUFhLEVBQUUsQ0FBQztBQUN6QyxDQUFDIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY3J5cHRvL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUVoRCxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsY0FBYyxtQkFBbUIsQ0FBQztBQUNsQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxxQkFBcUIsQ0FBQztBQUVwQzs7Ozs7R0FLRztBQUNILE1BQU0sQ0FBQyxLQUFLLFVBQVUsSUFBSTtJQUN4QixNQUFNLGdCQUFnQixDQUFDLGFBQWEsRUFBRSxDQUFDO0FBQ3pDLENBQUMifQ== |
@@ -8,3 +8,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
*/ | ||
export declare function keccak(input: Buffer): Buffer; | ||
export declare function keccak256(input: Buffer): Buffer; | ||
/** | ||
@@ -11,0 +11,0 @@ * Computes the keccak-256 hash of a given input string and returns the result as a hexadecimal string. |
@@ -8,3 +8,3 @@ import { Keccak } from 'sha3'; | ||
*/ | ||
export function keccak(input) { | ||
export function keccak256(input) { | ||
const hash = new Keccak(256); | ||
@@ -32,2 +32,2 @@ return hash.update(input).digest(); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY3J5cHRvL2tlY2Nhay9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRTlCOzs7OztHQUtHO0FBQ0gsTUFBTSxVQUFVLE1BQU0sQ0FBQyxLQUFh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sQ0FBQyxDQUFDO0lBQzdCLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztBQUNyQyxDQUFDO0FBRUQ7O0dBRUc7QUFDSCxNQUFNLFVBQVUsZUFBZSxDQUFDLEtBQWE7SUFDM0MsTUFBTSxJQUFJLEdBQUcsSUFBSSxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDN0IsSUFBSSxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQ2IsSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUNuQixPQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDNUIsQ0FBQztBQUVEOzs7OztHQUtHO0FBQ0gsTUFBTSxVQUFVLFNBQVMsQ0FBQyxLQUFhO0lBQ3JDLE1BQU0sSUFBSSxHQUFHLElBQUksTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQzdCLE9BQU8sSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztBQUNyQyxDQUFDIn0= |
/// <reference types="node" resolution-mode="require"/> | ||
import { Fr } from '../../fields/fields.js'; | ||
import { type Bufferable } from '../../serialize/serialize.js'; | ||
import { type Fieldable } from '../../serialize/serialize.js'; | ||
/** | ||
@@ -11,5 +11,7 @@ * Create a pedersen commitment (point) from an array of input fields. | ||
* Create a pedersen hash (field) from an array of input fields. | ||
* Left pads any inputs less than 32 bytes. | ||
* @param input - The input fieldables to hash. | ||
* @param index - The separator index to use for the hash. | ||
* @returns The pedersen hash. | ||
*/ | ||
export declare function pedersenHash(input: Bufferable[], index?: number): Fr; | ||
export declare function pedersenHash(input: Fieldable[], index?: number): Fr; | ||
/** | ||
@@ -16,0 +18,0 @@ * Create a pedersen hash from an arbitrary length buffer. |
import { BarretenbergSync, Fr as FrBarretenberg } from '@aztec/bb.js'; | ||
import { Fr } from '../../fields/fields.js'; | ||
import { serializeToBufferArray } from '../../serialize/serialize.js'; | ||
import { serializeToFields } from '../../serialize/serialize.js'; | ||
/** | ||
@@ -20,12 +20,11 @@ * Create a pedersen commitment (point) from an array of input fields. | ||
* Create a pedersen hash (field) from an array of input fields. | ||
* Left pads any inputs less than 32 bytes. | ||
* @param input - The input fieldables to hash. | ||
* @param index - The separator index to use for the hash. | ||
* @returns The pedersen hash. | ||
*/ | ||
export function pedersenHash(input, index = 0) { | ||
let bufferredInput = serializeToBufferArray(input); | ||
if (!bufferredInput.every(i => i.length <= 32)) { | ||
throw new Error('All Pedersen Hash input buffers must be <= 32 bytes.'); | ||
} | ||
bufferredInput = bufferredInput.map(i => (i.length < 32 ? Buffer.concat([Buffer.alloc(32 - i.length, 0), i]) : i)); | ||
const inputFields = serializeToFields(input); | ||
return Fr.fromBuffer(Buffer.from(BarretenbergSync.getSingleton() | ||
.pedersenHash(bufferredInput.map(i => new FrBarretenberg(i)), index) | ||
.pedersenHash(inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion | ||
index) | ||
.toBuffer())); | ||
@@ -39,2 +38,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVkZXJzZW4ud2FzbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jcnlwdG8vcGVkZXJzZW4vcGVkZXJzZW4ud2FzbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsRUFBRSxJQUFJLGNBQWMsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUV0RSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDNUMsT0FBTyxFQUFtQixzQkFBc0IsRUFBRSxNQUFNLDhCQ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xLQUFLLEdBQUcsQ0FBQztJQUN6RCxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsWUFBWSxFQUFFLENBQUMsa0JBQWtCLENBQUMsS0FBSyxFQUFFLEtBQUssQ0FBQyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUM7QUFDbEcsQ0FBQyJ9 |
@@ -1,8 +0,15 @@ | ||
/// <reference types="node" resolution-mode="require"/> | ||
import { Fr } from '../../fields/fields.js'; | ||
import { type Fieldable } from '../../serialize/serialize.js'; | ||
/** | ||
* Create a poseidon hash (field) from an array of input fields. | ||
* Left pads any inputs less than 32 bytes. | ||
* @param input - The input fields to hash. | ||
* @returns The poseidon hash. | ||
*/ | ||
export declare function poseidonHash(input: Buffer[]): Fr; | ||
export declare function poseidon2Hash(input: Fieldable[]): Fr; | ||
/** | ||
* Runs a Poseidon2 permutation. | ||
* @param input the input state. Expected to be of size 4. | ||
* @returns the output state, size 4. | ||
*/ | ||
export declare function poseidon2Permutation(input: Fieldable[]): Fr[]; | ||
//# sourceMappingURL=index.d.ts.map |
import { BarretenbergSync, Fr as FrBarretenberg } from '@aztec/bb.js'; | ||
import { Fr } from '../../fields/fields.js'; | ||
import { serializeToFields } from '../../serialize/serialize.js'; | ||
/** | ||
* Create a poseidon hash (field) from an array of input fields. | ||
* Left pads any inputs less than 32 bytes. | ||
* @param input - The input fields to hash. | ||
* @returns The poseidon hash. | ||
*/ | ||
export function poseidonHash(input) { | ||
export function poseidon2Hash(input) { | ||
const inputFields = serializeToFields(input); | ||
return Fr.fromBuffer(Buffer.from(BarretenbergSync.getSingleton() | ||
.poseidonHash(input.map(i => new FrBarretenberg(i))) | ||
.poseidon2Hash(inputFields.map(i => new FrBarretenberg(i.toBuffer()))) | ||
.toBuffer())); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY3J5cHRvL3Bvc2VpZG9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxFQUFFLElBQUksY0FBYyxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRXRFLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUU1Qzs7O0dBR0c7QUFDSCxNQUFNLFVBQVUsWUFBWSxDQUFDLEtBQWU7SUFDMUMsT0FBTyxFQUFFLENBQUMsVUFBVSxDQUNsQixNQUFNLENBQUMsSUFBSSxDQUNULGdCQUFnQixDQUFDLFlBQVksRUFBRTtTQUM1QixZQUFZLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLElBQUksY0FBYyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7U0FDbkQsUUFBUSxFQUFFLENBQ2QsQ0FDRixDQUFDO0FBQ0osQ0FBQyJ9 | ||
/** | ||
* Runs a Poseidon2 permutation. | ||
* @param input the input state. Expected to be of size 4. | ||
* @returns the output state, size 4. | ||
*/ | ||
export function poseidon2Permutation(input) { | ||
const inputFields = serializeToFields(input); | ||
// We'd like this assertion but it's not possible to use it in the browser. | ||
// assert(input.length === 4, 'Input state must be of size 4'); | ||
const res = BarretenbergSync.getSingleton().poseidon2Permutation(inputFields.map(i => new FrBarretenberg(i.toBuffer()))); | ||
// We'd like this assertion but it's not possible to use it in the browser. | ||
// assert(res.length === 4, 'Output state must be of size 4'); | ||
return res.map(o => Fr.fromBuffer(Buffer.from(o.toBuffer()))); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY3J5cHRvL3Bvc2VpZG9uL2luZGV4LnRzIl0sI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ERBQThEO0lBQzlELE9BQU8sR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsUUFBUSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDaEUsQ0FBQyJ9 |
@@ -139,3 +139,7 @@ /// <reference types="node" resolution-mode="require"/> | ||
toFriendlyJSON(): `0x${string}`; | ||
toJSON(): { | ||
type: string; | ||
value: `0x${string}`; | ||
}; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,2 +6,3 @@ import { inspect } from 'util'; | ||
import { BufferReader, FieldReader } from '../serialize/index.js'; | ||
import { TypeRegistry } from '../serialize/type_registry.js'; | ||
/** | ||
@@ -211,2 +212,8 @@ * Represents an Ethereum address as a 20-byte buffer and provides various utility methods | ||
} | ||
toJSON() { | ||
return { | ||
type: 'EthAddress', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
@@ -221,2 +228,4 @@ /** | ||
EthAddress.ZERO = new EthAddress(Buffer.alloc(EthAddress.SIZE_IN_BYTES)); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZXRoLWFkZHJlc3MvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUUvQixPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDNUQsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ3hELE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUN4QyxPQUFPLEVBQUUsWUFBWSxF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QVUsQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDO0lBQ3BFLENBQUM7SUFFRDs7O09BR0c7SUFDSCxjQUFjO1FBQ1osT0FBTyxJQUFJLENBQUMsUUFBUSxFQUFFLENBQUM7SUFDekIsQ0FBQztJQUVELE1BQU07UUFDSixPQUFPO1lBQ0wsSUFBSSxFQUFFLFlBQVk7WUFDbEIsS0FBSyxFQUFFLElBQUksQ0FBQyxRQUFRLEVBQUU7U0FDdkIsQ0FBQztJQUNKLENBQUM7O0FBdE9EOztHQUVHO0FBQ1csd0JBQWEsR0FBRyxFQUFFLENBQUM7QUFDakM7O0dBRUc7QUFDVyxlQUFJLEdBQUcsSUFBSSxVQUFVLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQztBQWtPOUUsMEJBQTBCO0FBQzFCLFlBQVksQ0FBQyxRQUFRLENBQUMsWUFBWSxFQUFFLFVBQVUsQ0FBQyxDQUFDIn0= |
@@ -68,2 +68,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
static ZERO: Fr; | ||
static ONE: Fr; | ||
static MODULUS: bigint; | ||
@@ -85,2 +86,6 @@ constructor(value: number | bigint | boolean | Fr | Buffer); | ||
ediv(rhs: Fr): Fr; | ||
toJSON(): { | ||
type: string; | ||
value: `0x${string}`; | ||
}; | ||
} | ||
@@ -113,2 +118,6 @@ /** | ||
static fromHighLow(high: Fr, low: Fr): Fq; | ||
toJSON(): { | ||
type: string; | ||
value: `0x${string}`; | ||
}; | ||
} | ||
@@ -118,3 +127,3 @@ /** | ||
* @remarks Called GrumpkinScalar because it is used to represent elements in Grumpkin's scalar field as defined in | ||
* the Aztec Yellow Paper. | ||
* the Aztec Protocol Specs. | ||
*/ | ||
@@ -121,0 +130,0 @@ export type GrumpkinScalar = Fq; |
@@ -5,2 +5,3 @@ import { inspect } from 'util'; | ||
import { BufferReader } from '../serialize/buffer_reader.js'; | ||
import { TypeRegistry } from '../serialize/type_registry.js'; | ||
const ZERO_BUFFER = Buffer.alloc(32); | ||
@@ -197,5 +198,14 @@ /** | ||
} | ||
toJSON() { | ||
return { | ||
type: 'Fr', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
Fr.ZERO = new Fr(0n); | ||
Fr.ONE = new Fr(1n); | ||
Fr.MODULUS = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n; | ||
// For deserializing JSON. | ||
TypeRegistry.register('Fr', Fr); | ||
/** | ||
@@ -238,2 +248,8 @@ * Fq field class. | ||
} | ||
toJSON() { | ||
return { | ||
type: 'Fq', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
@@ -244,2 +260,4 @@ Fq.ZERO = new Fq(0n); | ||
Fq.LOW_MASK = (1n << Fq.HIGH_SHIFT) - 1n; | ||
// For deserializing JSON. | ||
TypeRegistry.register('Fq', Fq); | ||
// Beware: Performance bottleneck below | ||
@@ -275,2 +293,2 @@ /** | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpZWxkcy9maWVsZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUUvQixPQUFPLEVBQUUsVUFBVSxFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ25FLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFN0QsTUFBTSxXQUFXLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsQ0FBQztBQ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sQ0FBQyxDQUFDLENBQUM7SUFDekMsQ0FBQztBQUNILENBQUM7QUFRRCxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUcsRUFBRSxDQUFDO0FBRWpDLDZHQUE2RztBQUM3RyxNQUFNLFVBQVUsUUFBUSxDQUFtQyxFQUE2QixFQUFFLEtBQTJCO0lBQ25ILE9BQU8sQ0FBQyxLQUFhLEVBQUUsRUFBRSxDQUFDLGdCQUFnQixDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsRUFBRSxLQUFLLENBQUMsQ0FBQztBQUMvRCxDQUFDIn0= |
@@ -68,3 +68,3 @@ import debug from 'debug'; | ||
const prefix = `${debugLogger.namespace.replace(/^aztec:/, '')}${levelLabel}`; | ||
if (!isNode || !isatty(process.stderr.fd)) { | ||
if ((!isNode || !isatty(process.stderr.fd)) && !process.env.DEBUG_COLORS) { | ||
return prefix; | ||
@@ -103,2 +103,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvZy9sb2dnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sT0FBTyxDQUFDO0FBQzFCLE9BQU8sTUFBTSxNQUFNLGFBQWEsQ0FBQztBQUNqQyxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sS0FBSyxDQUFDO0FBSTdCLE1BQU0sU0FBUyxHQUFHLENBQUMsUUFBUSxFQUFFLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxPQUFPLENBQVUsQ0FBQztBQUNuRixNQUFNLGVBQWUsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLFFBQVEsS0FBSyxNQUFNLENBQUMsQ0FBQyxDQUFFLFFBQWtCLENBQUMsQ0FBQyxDQUFFL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xDQUFDO0FBQ2YsQ0FBQyJ9 |
@@ -33,4 +33,4 @@ import { z } from 'zod'; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "lib" | "contract" | "bin"; | ||
name: string; | ||
type: "lib" | "contract" | "bin"; | ||
entry?: string | undefined; | ||
@@ -73,4 +73,4 @@ description?: string | undefined; | ||
package: { | ||
type: "lib" | "contract" | "bin"; | ||
name: string; | ||
type: "lib" | "contract" | "bin"; | ||
entry?: string | undefined; | ||
@@ -77,0 +77,0 @@ description?: string | undefined; |
@@ -6,2 +6,3 @@ export * from './free_funcs.js'; | ||
export * from './serialize.js'; | ||
export * from './type_registry.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,2 +6,3 @@ export * from './free_funcs.js'; | ||
export * from './serialize.js'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VyaWFsaXplL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsZ0JBQWdCLENBQUMifQ== | ||
export * from './type_registry.js'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VyaWFsaXplL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxvQkFBb0IsQ0FBQyJ9 |
@@ -70,3 +70,9 @@ /// <reference types="node" resolution-mode="require"/> | ||
/** A type that can be converted to a Field or a Field array. */ | ||
export type Fieldeable = Fr | boolean | number | bigint | { | ||
export type Fieldable = Fr | boolean | number | bigint | Buffer | { | ||
/** | ||
* Serialize to a field. | ||
* @dev Duplicate to `toField` but left as is as it is used in AVM codebase. | ||
*/ | ||
toFr: () => Fr; | ||
} | { | ||
/** Serialize to a field. */ | ||
@@ -77,3 +83,3 @@ toField: () => Fr; | ||
toFields: () => Fr[]; | ||
} | Fieldeable[]; | ||
} | Fieldable[]; | ||
/** | ||
@@ -90,3 +96,3 @@ * Serializes a list of objects contiguously. | ||
*/ | ||
export declare function serializeToFields(...objs: Fieldeable[]): Fr[]; | ||
export declare function serializeToFields(...objs: Fieldable[]): Fr[]; | ||
/** | ||
@@ -93,0 +99,0 @@ * Serializes a list of objects contiguously. |
@@ -80,6 +80,6 @@ import { toBigIntBE, toBufferBE } from '../bigint-buffer/index.js'; | ||
export function serializeToBufferArray(...objs) { | ||
let ret = []; | ||
const ret = []; | ||
for (const obj of objs) { | ||
if (Array.isArray(obj)) { | ||
ret = [...ret, ...serializeToBufferArray(...obj)]; | ||
ret.push(...serializeToBufferArray(...obj)); | ||
} | ||
@@ -122,6 +122,6 @@ else if (Buffer.isBuffer(obj)) { | ||
export function serializeToFields(...objs) { | ||
let ret = []; | ||
const ret = []; | ||
for (const obj of objs) { | ||
if (Array.isArray(obj)) { | ||
ret = [...ret, ...serializeToFields(...obj)]; | ||
ret.push(...serializeToFields(...obj)); | ||
} | ||
@@ -135,7 +135,16 @@ else if (obj instanceof Fr) { | ||
else if ('toFields' in obj) { | ||
ret = [...ret, ...obj.toFields()]; | ||
ret.push(...obj.toFields()); | ||
} | ||
else { | ||
else if ('toFr' in obj) { | ||
ret.push(obj.toFr()); | ||
} | ||
else if ('toField' in obj) { | ||
ret.push(obj.toField()); | ||
} | ||
else if (Buffer.isBuffer(obj)) { | ||
ret.push(Fr.fromBuffer(obj)); | ||
} | ||
else { | ||
throw new Error(`Cannot serialize input to field: ${typeof obj} ${obj.constructor?.name}`); | ||
} | ||
} | ||
@@ -250,2 +259,2 @@ return ret; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VyaWFsaXplLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcmlhbGl6ZS9zZXJpYWxpemUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDekMsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRWhEOzs7OztHQUtHO0FBQ0gsTUFBTSxVQUFVLGtDQUFrQyxDQUFDLElBQWtCLEVBQUUsWUFBWSxHQUFHLENBQUM7SUFDckYsTUFBTSxHQUFHLEdBQUcsc0JBQXNCLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDekMsSUFBSSxTQUFpQixDQUFDO0lBQ3RCLElBQUksWUFBWSxLQUFLLENBQUMsRUFBRSxDQUFDO1FBQ3ZCLFNBQVMsR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzVCLFNBQVMsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQztJQUN0QyxDQUFDO1NBQU0sSUFBSSxZQUFZLEtBQUssQ0FBQyxFQUFFLENBQUM7UUFDOUIsU0FBUyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDNUIsU0FBUy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DO0FBQzlDLENBQUM7QUFFRDs7Ozs7Ozs7R0FRRztBQUNILE1BQU0sVUFBVSxpQkFBaUIsQ0FBQyxHQUFXLEVBQUUsTUFBTSxHQUFHLENBQUM7SUFDdkQsTUFBTSxHQUFHLEdBQUcsQ0FBQyxDQUFDO0lBQ2QsT0FBTyxFQUFFLElBQUksRUFBRSxHQUFHLENBQUMsWUFBWSxDQUFDLE1BQU0sQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDO0FBQ2pELENBQUM7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBVyxFQUFFLE1BQU0sR0FBRyxDQUFDO0lBQ3RELE1BQU0sR0FBRyxHQUFHLENBQUMsQ0FBQztJQUNkLE9BQU8sRUFBRSxJQUFJLEVBQUUsR0FBRyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsRUFBRSxHQUFHLEVBQUUsQ0FBQztBQUNoRCxDQUFDIn0= |
{ | ||
"name": "@aztec/foundation", | ||
"version": "0.34.0", | ||
"version": "0.35.0", | ||
"packageManager": "yarn@3.4.1", | ||
@@ -72,3 +72,3 @@ "type": "module", | ||
"dependencies": { | ||
"@aztec/bb.js": "0.34.0", | ||
"@aztec/bb.js": "0.35.0", | ||
"@koa/cors": "^5.0.0", | ||
@@ -75,0 +75,0 @@ "@noble/curves": "^1.2.0", |
@@ -386,3 +386,3 @@ import { inflate } from 'pako'; | ||
* Returns an initializer from the contract. | ||
* @param initalizerNameOrArtifact - The name of the constructor, or the artifact of the constructor, or undefined | ||
* @param initializerNameOrArtifact - The name of the constructor, or the artifact of the constructor, or undefined | ||
* to pick the default initializer. | ||
@@ -392,20 +392,20 @@ */ | ||
contract: ContractArtifact, | ||
initalizerNameOrArtifact: string | undefined | FunctionArtifact, | ||
initializerNameOrArtifact: string | undefined | FunctionArtifact, | ||
): FunctionArtifact | undefined { | ||
if (typeof initalizerNameOrArtifact === 'string') { | ||
const found = contract.functions.find(f => f.name === initalizerNameOrArtifact); | ||
if (typeof initializerNameOrArtifact === 'string') { | ||
const found = contract.functions.find(f => f.name === initializerNameOrArtifact); | ||
if (!found) { | ||
throw new Error(`Constructor method ${initalizerNameOrArtifact} not found in contract artifact`); | ||
throw new Error(`Constructor method ${initializerNameOrArtifact} not found in contract artifact`); | ||
} else if (!found.isInitializer) { | ||
throw new Error(`Method ${initalizerNameOrArtifact} is not an initializer`); | ||
throw new Error(`Method ${initializerNameOrArtifact} is not an initializer`); | ||
} | ||
return found; | ||
} else if (initalizerNameOrArtifact === undefined) { | ||
} else if (initializerNameOrArtifact === undefined) { | ||
return getDefaultInitializer(contract); | ||
} else { | ||
if (!initalizerNameOrArtifact.isInitializer) { | ||
throw new Error(`Method ${initalizerNameOrArtifact.name} is not an initializer`); | ||
if (!initializerNameOrArtifact.isInitializer) { | ||
throw new Error(`Method ${initializerNameOrArtifact.name} is not an initializer`); | ||
} | ||
return initalizerNameOrArtifact; | ||
return initializerNameOrArtifact; | ||
} | ||
} |
import { fromHex, toBigIntBE } from '../bigint-buffer/index.js'; | ||
import { keccak, randomBytes } from '../crypto/index.js'; | ||
import { keccak256, randomBytes } from '../crypto/index.js'; | ||
import { type Fr } from '../fields/fields.js'; | ||
@@ -47,3 +47,3 @@ import { BufferReader } from '../serialize/buffer_reader.js'; | ||
} | ||
return EventSelector.fromBuffer(keccak(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
return EventSelector.fromBuffer(keccak256(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
} | ||
@@ -50,0 +50,0 @@ |
import { fromHex, toBigIntBE } from '../bigint-buffer/index.js'; | ||
import { keccak, randomBytes } from '../crypto/index.js'; | ||
import { keccak256, randomBytes } from '../crypto/index.js'; | ||
import { type Fr } from '../fields/fields.js'; | ||
@@ -75,3 +75,3 @@ import { BufferReader } from '../serialize/buffer_reader.js'; | ||
} | ||
return FunctionSelector.fromBuffer(keccak(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
return FunctionSelector.fromBuffer(keccak256(Buffer.from(signature)).subarray(0, Selector.SIZE)); | ||
} | ||
@@ -78,0 +78,0 @@ |
@@ -5,2 +5,3 @@ import { inspect } from 'util'; | ||
import { type BufferReader, FieldReader } from '../serialize/index.js'; | ||
import { TypeRegistry } from '../serialize/type_registry.js'; | ||
@@ -57,2 +58,12 @@ /** | ||
} | ||
toJSON() { | ||
return { | ||
type: 'AztecAddress', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
// For deserializing JSON. | ||
TypeRegistry.register('AztecAddress', AztecAddress); |
@@ -6,2 +6,3 @@ import { BarretenbergSync } from '@aztec/bb.js'; | ||
export * from './sha256/index.js'; | ||
export * from './sha512/index.js'; | ||
export * from './pedersen/index.js'; | ||
@@ -8,0 +9,0 @@ export * from './poseidon/index.js'; |
@@ -9,3 +9,3 @@ import { Keccak } from 'sha3'; | ||
*/ | ||
export function keccak(input: Buffer) { | ||
export function keccak256(input: Buffer) { | ||
const hash = new Keccak(256); | ||
@@ -12,0 +12,0 @@ return hash.update(input).digest(); |
import { BarretenbergSync, Fr as FrBarretenberg } from '@aztec/bb.js'; | ||
import { Fr } from '../../fields/fields.js'; | ||
import { type Bufferable, serializeToBufferArray } from '../../serialize/serialize.js'; | ||
import { type Fieldable, serializeToFields } from '../../serialize/serialize.js'; | ||
@@ -23,10 +23,8 @@ /** | ||
* Create a pedersen hash (field) from an array of input fields. | ||
* Left pads any inputs less than 32 bytes. | ||
* @param input - The input fieldables to hash. | ||
* @param index - The separator index to use for the hash. | ||
* @returns The pedersen hash. | ||
*/ | ||
export function pedersenHash(input: Bufferable[], index = 0): Fr { | ||
let bufferredInput = serializeToBufferArray(input); | ||
if (!bufferredInput.every(i => i.length <= 32)) { | ||
throw new Error('All Pedersen Hash input buffers must be <= 32 bytes.'); | ||
} | ||
bufferredInput = bufferredInput.map(i => (i.length < 32 ? Buffer.concat([Buffer.alloc(32 - i.length, 0), i]) : i)); | ||
export function pedersenHash(input: Fieldable[], index = 0): Fr { | ||
const inputFields = serializeToFields(input); | ||
return Fr.fromBuffer( | ||
@@ -36,3 +34,3 @@ Buffer.from( | ||
.pedersenHash( | ||
bufferredInput.map(i => new FrBarretenberg(i)), | ||
inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion | ||
index, | ||
@@ -39,0 +37,0 @@ ) |
import { BarretenbergSync, Fr as FrBarretenberg } from '@aztec/bb.js'; | ||
import { Fr } from '../../fields/fields.js'; | ||
import { type Fieldable, serializeToFields } from '../../serialize/serialize.js'; | ||
/** | ||
* Create a poseidon hash (field) from an array of input fields. | ||
* Left pads any inputs less than 32 bytes. | ||
* @param input - The input fields to hash. | ||
* @returns The poseidon hash. | ||
*/ | ||
export function poseidonHash(input: Buffer[]): Fr { | ||
export function poseidon2Hash(input: Fieldable[]): Fr { | ||
const inputFields = serializeToFields(input); | ||
return Fr.fromBuffer( | ||
Buffer.from( | ||
BarretenbergSync.getSingleton() | ||
.poseidonHash(input.map(i => new FrBarretenberg(i))) | ||
.poseidon2Hash( | ||
inputFields.map(i => new FrBarretenberg(i.toBuffer())), // TODO(#4189): remove this stupid conversion | ||
) | ||
.toBuffer(), | ||
@@ -18,1 +23,18 @@ ), | ||
} | ||
/** | ||
* Runs a Poseidon2 permutation. | ||
* @param input the input state. Expected to be of size 4. | ||
* @returns the output state, size 4. | ||
*/ | ||
export function poseidon2Permutation(input: Fieldable[]): Fr[] { | ||
const inputFields = serializeToFields(input); | ||
// We'd like this assertion but it's not possible to use it in the browser. | ||
// assert(input.length === 4, 'Input state must be of size 4'); | ||
const res = BarretenbergSync.getSingleton().poseidon2Permutation( | ||
inputFields.map(i => new FrBarretenberg(i.toBuffer())), | ||
); | ||
// We'd like this assertion but it's not possible to use it in the browser. | ||
// assert(res.length === 4, 'Output state must be of size 4'); | ||
return res.map(o => Fr.fromBuffer(Buffer.from(o.toBuffer()))); | ||
} |
@@ -7,2 +7,3 @@ import { inspect } from 'util'; | ||
import { BufferReader, FieldReader } from '../serialize/index.js'; | ||
import { TypeRegistry } from '../serialize/type_registry.js'; | ||
@@ -240,2 +241,12 @@ /** | ||
} | ||
toJSON() { | ||
return { | ||
type: 'EthAddress', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
// For deserializing JSON. | ||
TypeRegistry.register('EthAddress', EthAddress); |
@@ -6,2 +6,3 @@ import { inspect } from 'util'; | ||
import { BufferReader } from '../serialize/buffer_reader.js'; | ||
import { TypeRegistry } from '../serialize/type_registry.js'; | ||
@@ -191,2 +192,3 @@ const ZERO_BUFFER = Buffer.alloc(32); | ||
static ZERO = new Fr(0n); | ||
static ONE = new Fr(1n); | ||
static MODULUS = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n; | ||
@@ -262,4 +264,14 @@ | ||
} | ||
toJSON() { | ||
return { | ||
type: 'Fr', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
// For deserializing JSON. | ||
TypeRegistry.register('Fr', Fr); | ||
/** | ||
@@ -325,4 +337,14 @@ * Branding to ensure fields are not interchangeable types. | ||
} | ||
toJSON() { | ||
return { | ||
type: 'Fq', | ||
value: this.toString(), | ||
}; | ||
} | ||
} | ||
// For deserializing JSON. | ||
TypeRegistry.register('Fq', Fq); | ||
// Beware: Performance bottleneck below | ||
@@ -358,3 +380,3 @@ | ||
* @remarks Called GrumpkinScalar because it is used to represent elements in Grumpkin's scalar field as defined in | ||
* the Aztec Yellow Paper. | ||
* the Aztec Protocol Specs. | ||
*/ | ||
@@ -361,0 +383,0 @@ export type GrumpkinScalar = Fq; |
@@ -100,3 +100,3 @@ import debug from 'debug'; | ||
const prefix = `${debugLogger.namespace.replace(/^aztec:/, '')}${levelLabel}`; | ||
if (!isNode || !isatty(process.stderr.fd)) { | ||
if ((!isNode || !isatty(process.stderr.fd)) && !process.env.DEBUG_COLORS) { | ||
return prefix; | ||
@@ -103,0 +103,0 @@ } |
@@ -6,1 +6,2 @@ export * from './free_funcs.js'; | ||
export * from './serialize.js'; | ||
export * from './type_registry.js'; |
@@ -124,3 +124,3 @@ import { toBigIntBE, toBufferBE } from '../bigint-buffer/index.js'; | ||
/** A type that can be converted to a Field or a Field array. */ | ||
export type Fieldeable = | ||
export type Fieldable = | ||
| Fr | ||
@@ -130,3 +130,11 @@ | boolean | ||
| bigint | ||
| Buffer | ||
| { | ||
/** | ||
* Serialize to a field. | ||
* @dev Duplicate to `toField` but left as is as it is used in AVM codebase. | ||
*/ | ||
toFr: () => Fr; | ||
} | ||
| { | ||
/** Serialize to a field. */ | ||
@@ -139,3 +147,3 @@ toField: () => Fr; | ||
} | ||
| Fieldeable[]; | ||
| Fieldable[]; | ||
@@ -148,6 +156,6 @@ /** | ||
export function serializeToBufferArray(...objs: Bufferable[]): Buffer[] { | ||
let ret: Buffer[] = []; | ||
const ret: Buffer[] = []; | ||
for (const obj of objs) { | ||
if (Array.isArray(obj)) { | ||
ret = [...ret, ...serializeToBufferArray(...obj)]; | ||
ret.push(...serializeToBufferArray(...obj)); | ||
} else if (Buffer.isBuffer(obj)) { | ||
@@ -183,7 +191,7 @@ ret.push(obj); | ||
*/ | ||
export function serializeToFields(...objs: Fieldeable[]): Fr[] { | ||
let ret: Fr[] = []; | ||
export function serializeToFields(...objs: Fieldable[]): Fr[] { | ||
const ret: Fr[] = []; | ||
for (const obj of objs) { | ||
if (Array.isArray(obj)) { | ||
ret = [...ret, ...serializeToFields(...obj)]; | ||
ret.push(...serializeToFields(...obj)); | ||
} else if (obj instanceof Fr) { | ||
@@ -194,5 +202,11 @@ ret.push(obj); | ||
} else if ('toFields' in obj) { | ||
ret = [...ret, ...obj.toFields()]; | ||
ret.push(...obj.toFields()); | ||
} else if ('toFr' in obj) { | ||
ret.push(obj.toFr()); | ||
} else if ('toField' in obj) { | ||
ret.push(obj.toField()); | ||
} else if (Buffer.isBuffer(obj)) { | ||
ret.push(Fr.fromBuffer(obj)); | ||
} else { | ||
ret.push(obj.toField()); | ||
throw new Error(`Cannot serialize input to field: ${typeof obj} ${(obj as any).constructor?.name}`); | ||
} | ||
@@ -199,0 +213,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1099745
486
20058
11
+ Added@aztec/bb.js@0.35.0(transitive)
- Removed@aztec/bb.js@0.34.0(transitive)
Updated@aztec/bb.js@0.35.0