Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aztec/foundation

Package Overview
Dependencies
Maintainers
6
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aztec/foundation - npm Package Compare versions

Comparing version 0.42.0 to 0.43.0

13

dest/collection/array.d.ts

@@ -0,1 +1,2 @@

/// <reference types="node" resolution-mode="require"/>
import { type Tuple } from '../serialize/types.js';

@@ -39,2 +40,14 @@ /**

export declare function times<T>(n: number, fn: (i: number) => T): T[];
/**
* Returns the serialized size of all non-empty items in an array.
* @param arr - Array
* @returns The serialized size in bytes.
*/
export declare function arraySerializedSizeOfNonEmpty(arr: (({
isZero: () => boolean;
} | {
isEmpty: () => boolean;
}) & {
toBuffer: () => Buffer;
})[]): number;
//# sourceMappingURL=array.d.ts.map

13

dest/collection/array.js

@@ -64,2 +64,13 @@ /**

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJyYXkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29sbGVjdGlvbi9hcnJheS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQTs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsV0FBVyxDQUFzQixHQUFRLEVBQUUsSUFBTyxFQUFFLE1BQVM7SUFDM0UsSUFBSSxHQUFHLENBQUMsTUFBTSxHQUFHLE1BQU0sRUFBRSxDQUFDO1FBQ3hCLE1BQU0sSUFBSSxLQUFLLENBQUMsa0NBQWtDLENBQUMsQ0FBQztJQUN0RCxDQUFDO0lBQ0QsMkVBQTJFO0lBQzNFLE9BQU8sQ0FBQyxHQUFHLEdBQUcsRUFBRSxHQUFHLEtBQUssQ0FBQyxNQUFNLEdBQUcsR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBZ0I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DQUFDO1FBQ3ZCLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQztZQUNuQixPQUFPLEtBQUssQ0FBQztRQUNmLENBQUM7SUFDSCxDQUFDO0lBQ0QsT0FBTyxJQUFJLENBQUM7QUFDZCxDQUFDO0FBRUQ7Ozs7R0FJRztBQUNILE1BQU0sVUFBVSxtQkFBbUIsQ0FBSSxHQUFRLEVBQUUsT0FBNkI7SUFDNUUsT0FBTyxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxFQUFFLENBQUMsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsR0FBRyxHQUFHLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ3ZFLENBQUM7QUFFRDs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxLQUFLLENBQUksQ0FBUyxFQUFFLEVBQW9CO0lBQ3RELE9BQU8sQ0FBQyxHQUFHLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzlDLENBQUMifQ==
/**
* Returns the serialized size of all non-empty items in an array.
* @param arr - Array
* @returns The serialized size in bytes.
*/
export function arraySerializedSizeOfNonEmpty(arr) {
return arr
.filter(x => x && ('isZero' in x ? !x.isZero() : !x.isEmpty()))
.map(x => x.toBuffer().length)
.reduce((a, b) => a + b, 0);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJyYXkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29sbGVjdGlvbi9hcnJheS50cyJdLCJuYW1lcyI6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FDLEdBQUcsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzlDLENBQUM7QUFFRDs7OztHQUlHO0FBQ0gsTUFBTSxVQUFVLDZCQUE2QixDQUMzQyxHQUE4RjtJQUU5RixPQUFPLEdBQUc7U0FDUCxNQUFNLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxRQUFRLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQztTQUM5RCxHQUFHLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFFLENBQUMsUUFBUSxFQUFFLENBQUMsTUFBTSxDQUFDO1NBQzlCLE1BQU0sQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDaEMsQ0FBQyJ9

2

dest/error/index.d.ts

@@ -16,4 +16,4 @@ /**

*/
export declare class AbortedError extends Error {
export declare class AbortError extends Error {
}
//# sourceMappingURL=index.d.ts.map

@@ -16,4 +16,4 @@ /**

*/
export class AbortedError extends Error {
export class AbortError extends Error {
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZXJyb3IvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUNILE1BQU0sT0FBTyxjQUFlLFNBQVEsS0FBSztDQUFHO0FBRTVDOztHQUVHO0FBQ0gsTUFBTSxPQUFPLFlBQWEsU0FBUSxLQUFLO0NBQUc7QUFFMUM7O0dBRUc7QUFDSCxNQUFNLE9BQU8sWUFBYSxTQUFRLEtBQUs7Q0FBRyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZXJyb3IvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUNILE1BQU0sT0FBTyxjQUFlLFNBQVEsS0FBSztDQUFHO0FBRTVDOztHQUVHO0FBQ0gsTUFBTSxPQUFPLFlBQWEsU0FBUSxLQUFLO0NBQUc7QUFFMUM7O0dBRUc7QUFDSCxNQUFNLE9BQU8sVUFBVyxTQUFRLEtBQUs7Q0FBRyJ9

@@ -20,5 +20,2 @@ /// <reference types="node" resolution-mode="require"/>

* We only check we are within the field modulus when initializing with bigint.
* If NODE_ENV === 'test', we will always initialize both types to check the modulus.
* This is also necessary in test environment as a lot of tests just use deep equality to check equality.
* WARNING: This could lead to a bugs in production that don't reveal in tests, but it's low risk.
*/

@@ -34,2 +31,4 @@ declare abstract class BaseField {

get value(): bigint;
/** Returns the size in bytes. */
get size(): number;
protected constructor(value: number | bigint | boolean | BaseField | Buffer);

@@ -84,2 +83,4 @@ protected abstract modulus(): bigint;

add(rhs: Fr): Fr;
square(): Fr;
negate(): Fr;
sub(rhs: Fr): Fr;

@@ -86,0 +87,0 @@ mul(rhs: Fr): Fr;

@@ -12,5 +12,2 @@ import { inspect } from 'util';

* We only check we are within the field modulus when initializing with bigint.
* If NODE_ENV === 'test', we will always initialize both types to check the modulus.
* This is also necessary in test environment as a lot of tests just use deep equality to check equality.
* WARNING: This could lead to a bugs in production that don't reveal in tests, but it's low risk.
*/

@@ -25,2 +22,6 @@ class BaseField {

}
/** Returns the size in bytes. */
get size() {
return BaseField.SIZE_IN_BYTES;
}
constructor(value) {

@@ -49,9 +50,2 @@ if (value instanceof Buffer) {

}
// Loads of our tests are just doing deep equality rather than calling e.g. toBigInt() first.
// This ensures the deep equality passes regardless of the internal representation.
// It also ensures the value range is checked even when initializing as a buffer.
if (process.env.NODE_ENV === 'test') {
this.toBuffer();
this.toBigInt();
}
}

@@ -186,2 +180,8 @@ /**

}
square() {
return new Fr((this.toBigInt() * this.toBigInt()) % Fr.MODULUS);
}
negate() {
return new Fr(Fr.MODULUS - this.toBigInt());
}
sub(rhs) {

@@ -300,2 +300,20 @@ const result = this.toBigInt() - rhs.toBigInt();

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpZWxkcy9maWVsZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUUvQixPQUFPLEVBQUUsVUFBVSxFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ25FLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDN0QsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRTdELE1BQU0sV0FBVyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLENBQUM7QUFlckM7Ozs7Ozs7O0dBUUc7QUFDSCxNQUFlLFNBQVM7SUFLdEI7OztTQUdLO0lBQ0wsSUFBSSxLQUFLO1FBQ1AsT0FBTyxJQUFJLENBQUMsUUFBUSxFQUFFLENBQUM7SUFDekIsQ0FBQztJQUVELFlBQXNCLEtBQXFEO1FBQ3pFLElBQUksS0FBSyxZQUFZLE1BQU0sRUFBRSxDQUFDO1lBQzVCLElBQUksS0FBS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DN0csTUFBTSxVQUFVLFFBQVEsQ0FBbUMsRUFBNkIsRUFBRSxLQUEyQjtJQUNuSCxPQUFPLENBQUMsS0FBYSxFQUFFLEVBQUUsQ0FBQyxnQkFBZ0IsQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDLEVBQUUsS0FBSyxDQUFDLENBQUM7QUFDL0QsQ0FBQyJ9
/** If we are in test mode, we register a special equality for fields. */
if (process.env.NODE_ENV === 'test') {
const areFieldsEqual = (a, b) => {
const isAField = a instanceof BaseField;
const isBField = b instanceof BaseField;
if (isAField && isBField) {
return a.equals(b);
}
else if (isAField === isBField) {
return undefined;
}
else {
return false;
}
};
// `addEqualityTesters` doesn't seem to be in the types yet.
expect.addEqualityTesters([areFieldsEqual]);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpZWxkcy9maWVsZHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUUvQixPQUFPLEVBQUUsVUFBVSxFQUFFLFVBQVUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ25FLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDN0QsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRTdELE1BQU0sV0FBVyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsRUFBRSxDQUFDLENBQUM7QUFlckM7Ozs7O0dBS0c7QUFDSCxNQUFlLFNBQVM7SUFLdEI7OztTQUdLO0lBQ0wsSUFBSSxLQUFLO1FBQ1AsT0FBTyxJQUFJLENBQUMsUUFBUS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xNQUFjLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDO0FBQ3ZELENBQUMifQ==

@@ -101,2 +101,9 @@ /// <reference types="node" resolution-mode="require"/>

hash(): Fr;
/**
* Check if this is point at infinity.
* Check this is consistent with how bb is encoding the point at infinity
*/
get inf(): boolean;
toFieldsWithInf(): Fr[];
isOnGrumpkin(): boolean;
}

@@ -103,0 +110,0 @@ /**

@@ -23,2 +23,3 @@ import { poseidon2Hash } from '../crypto/index.js';

this.kind = 'point';
// TODO: Do we want to check if the point is on the curve here?
}

@@ -43,3 +44,3 @@ /**

const reader = BufferReader.asReader(buffer);
return new this(Fr.fromBuffer(reader.readBytes(32)), Fr.fromBuffer(reader.readBytes(32)));
return new this(Fr.fromBuffer(reader), Fr.fromBuffer(reader));
}

@@ -124,2 +125,23 @@ /**

}
/**
* Check if this is point at infinity.
* Check this is consistent with how bb is encoding the point at infinity
*/
get inf() {
return this.x == Fr.ZERO;
}
toFieldsWithInf() {
return [this.x, this.y, new Fr(this.inf)];
}
isOnGrumpkin() {
// TODO: Check this against how bb handles curve check and infinity point check
if (this.inf) {
return true;
}
// p.y * p.y == p.x * p.x * p.x - 17
const A = new Fr(17);
const lhs = this.y.square();
const rhs = this.x.square().mul(this.x).sub(A);
return lhs.equals(rhs);
}
}

@@ -140,2 +162,2 @@ Point.ZERO = new Point(Fr.ZERO, Fr.ZERO);

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9pbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZmllbGRzL3BvaW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNuRCxPQUFPLEVBQUUsWUFBWSxFQUFFLFdBQVcsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHV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SyxTQUFTLENBQUM7QUFDbEYsQ0FBQyJ9

@@ -1,2 +0,2 @@

export declare function runInDirectory<T>(workingDirBase: string, fn: (dir: string) => Promise<T>): Promise<T>;
export declare function runInDirectory<T>(workingDirBase: string, fn: (dir: string) => Promise<T>, cleanup?: boolean): Promise<T>;
//# sourceMappingURL=run_in_dir.d.ts.map

@@ -1,9 +0,8 @@

import { randomBytes } from 'crypto';
import * as fs from 'fs/promises';
import * as path from 'path';
// Create a random directory underneath a 'base' directory
// Calls a provided method, ensures the random directory is cleaned up afterwards
export async function runInDirectory(workingDirBase, fn) {
export async function runInDirectory(workingDirBase, fn, cleanup = true) {
// Create random directory to be used for temp files
const workingDirectory = `${workingDirBase}/${randomBytes(8).toString('hex')}`;
await fs.mkdir(workingDirectory, { recursive: true });
const workingDirectory = await fs.mkdtemp(path.join(workingDirBase, 'tmp-'));
await fs.access(workingDirectory);

@@ -14,5 +13,7 @@ try {

finally {
await fs.rm(workingDirectory, { recursive: true, force: true });
if (cleanup) {
await fs.rm(workingDirectory, { recursive: true, force: true });
}
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVuX2luX2Rpci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mcy9ydW5faW5fZGlyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFDckMsT0FBTyxLQUFLLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFFbEMsMERBQTBEO0FBQzFELGlGQUFpRjtBQUNqRixNQUFNLENBQUMsS0FBSyxVQUFVLGNBQWMsQ0FBSSxjQUFzQixFQUFFLEVBQStCO0lBQzdGLG9EQUFvRDtJQUNwRCxNQUFNLGdCQUFnQixHQUFHLEdBQUcsY0FBYyxJQUFJLFdBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxR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FQUFFLENBQUMsTUFBTSxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFFbEMsSUFBSSxDQUFDO1FBQ0gsT0FBTyxNQUFNLEVBQUUsQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO0lBQ3BDLENBQUM7WUFBUyxDQUFDO1FBQ1QsSUFBSSxPQUFPLEVBQUUsQ0FBQztZQUNaLE1BQU0sRUFBRSxDQUFDLEVBQUUsQ0FBQyxnQkFBZ0IsRUFBRSxFQUFFLFNBQVMsRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBRSxDQUFDLENBQUM7UUFDbEUsQ0FBQztJQUNILENBQUM7QUFDSCxDQUFDIn0=

@@ -12,3 +12,3 @@ /**

private interruptibleSleep;
constructor(fn: () => Promise<void>, pollingIntervalMS?: number);
constructor(fn: () => void | Promise<void>, pollingIntervalMS?: number);
/**

@@ -15,0 +15,0 @@ * Starts the running promise.

@@ -45,2 +45,2 @@ import { InterruptibleSleep } from '../sleep/index.js';

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVubmluZy1wcm9taXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Byb21pc2UvcnVubmluZy1wcm9taXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRXZEOzs7O0dBSUc7QUFDSCxNQUFNLE9BQU8sY0FBYztJQUt6QixZQUFvQixFQUF1QixFQUFVLG9CQUFvQixLQUFLO1FBQTFELE9BQUUsR0FBRixFQUFFLENBQXFCO1FBQVUsc0JBQWlCLEdBQWpCLGlCQUFpQixDQUFRO1FBSnRFLFlBQU8sR0FBRyxLQUFLLENBQUM7UUFDaEIsbUJBQWMsR0FBRyxPQUFPLENBQUMsT0FBTyxFQUFFLENBQUM7UUFDbkMsdUJBQ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/>

export declare function fromFieldsTuple(fields: Tuple<Fr, 2>): Buffer;
export declare function toHumanReadable(buf: Buffer, maxLen?: number): string;
//# sourceMappingURL=free_funcs.d.ts.map

@@ -179,2 +179,9 @@ import { Fr } from '../fields/fields.js';

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJlZV9mdW5jcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJpYWxpemUvZnJlZV9mdW5jcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFHekM7Ozs7Ozs7R0FPRztBQUNILE1BQU0sVUFBVSxVQUFVLENBQUMsQ0FBVTtJQUNuQyxNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzVCLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzFCLE9BQU8sR0FBRyxDQUFDO0FBQ2IsQ0FBQztBQUVEOzs7O0dBSUc7QUFDSCxNQUFNLFVBQVUsYUFBYSxDQUFDLENBQVMsRUFBRSxVQUFVLEdBQUcsQ0FBQztJQUNyRCxNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQ3JDLEdBQUcsQ0FBQyxhQUFhLENBQUMsQ0FBQyxFQUFFLFVBQVUsR0FBRyxDQUFDLENBQUMsQ0FBQztJQUNyQyxPQUFPLEdBQUcsQ0FBQztBQUNiLENBQUM7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFNLFVBQVUsYUFBYSxDQUFDLENBQVMsRUFBRSxVQUFVLEdBQUcsQ0FBQzt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0FBRyxLQUFLLENBQUMsUUFBUSxFQUFFLENBQUM7SUFDaEMsSUFBSSxNQUFNLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUM7UUFDbkIsTUFBTSxJQUFJLEtBQUssQ0FBQyxVQUFVLEtBQUssMkNBQTJDLENBQUMsQ0FBQztJQUM5RSxDQUFDO0lBQ0QsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQUVELE1BQU0sVUFBVSxlQUFlLENBQUMsTUFBb0I7SUFDbEQsT0FBTyxXQUFXLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzNDLENBQUMifQ==
export function toHumanReadable(buf, maxLen) {
const result = buf.every(byte => byte >= 32 && byte <= 126) ? buf.toString('ascii') : `0x${buf.toString('hex')}`;
if (maxLen && result.length > maxLen) {
return result.slice(0, maxLen) + '...';
}
return result;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJlZV9mdW5jcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJpYWxpemUvZnJlZV9mdW5jcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFHekM7Ozs7Ozs7R0FPRztBQUNILE1BQU0sVUFBVSxVQUFVLENBQUMsQ0FBVTtJQUNuQyxNQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzVCLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzFCLE9BQU8sR0FBRyxDQUFDO0FBQ2IsQ0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BSyxHQUFHLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUM7SUFDakgsSUFBSSxNQUFNLElBQUksTUFBTSxDQUFDLE1BQU0sR0FBRyxNQUFNLEVBQUUsQ0FBQztRQUNyQyxPQUFPLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLE1BQU0sQ0FBQyxHQUFHLEtBQUssQ0FBQztJQUN6QyxDQUFDO0lBQ0QsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQyJ9
{
"name": "@aztec/foundation",
"version": "0.42.0",
"version": "0.43.0",
"packageManager": "yarn@3.4.1",

@@ -83,3 +83,3 @@ "type": "module",

"dependencies": {
"@aztec/bb.js": "0.42.0",
"@aztec/bb.js": "0.43.0",
"@koa/cors": "^5.0.0",

@@ -86,0 +86,0 @@ "@noble/curves": "^1.2.0",

@@ -71,1 +71,15 @@ import { type Tuple } from '../serialize/types.js';

}
/**
* Returns the serialized size of all non-empty items in an array.
* @param arr - Array
* @returns The serialized size in bytes.
*/
export function arraySerializedSizeOfNonEmpty(
arr: (({ isZero: () => boolean } | { isEmpty: () => boolean }) & { toBuffer: () => Buffer })[],
) {
return arr
.filter(x => x && ('isZero' in x ? !x.isZero() : !x.isEmpty()))
.map(x => x!.toBuffer().length)
.reduce((a, b) => a + b, 0);
}

@@ -16,2 +16,2 @@ /**

*/
export class AbortedError extends Error {}
export class AbortError extends Error {}

@@ -28,5 +28,2 @@ import { inspect } from 'util';

* We only check we are within the field modulus when initializing with bigint.
* If NODE_ENV === 'test', we will always initialize both types to check the modulus.
* This is also necessary in test environment as a lot of tests just use deep equality to check equality.
* WARNING: This could lead to a bugs in production that don't reveal in tests, but it's low risk.
*/

@@ -46,2 +43,7 @@ abstract class BaseField {

/** Returns the size in bytes. */
get size(): number {
return BaseField.SIZE_IN_BYTES;
}
protected constructor(value: number | bigint | boolean | BaseField | Buffer) {

@@ -67,10 +69,2 @@ if (value instanceof Buffer) {

}
// Loads of our tests are just doing deep equality rather than calling e.g. toBigInt() first.
// This ensures the deep equality passes regardless of the internal representation.
// It also ensures the value range is checked even when initializing as a buffer.
if (process.env.NODE_ENV === 'test') {
this.toBuffer();
this.toBigInt();
}
}

@@ -249,2 +243,10 @@

square() {
return new Fr((this.toBigInt() * this.toBigInt()) % Fr.MODULUS);
}
negate() {
return new Fr(Fr.MODULUS - this.toBigInt());
}
sub(rhs: Fr) {

@@ -399,1 +401,20 @@ const result = this.toBigInt() - rhs.toBigInt();

}
/** If we are in test mode, we register a special equality for fields. */
if (process.env.NODE_ENV === 'test') {
const areFieldsEqual = (a: unknown, b: unknown): boolean | undefined => {
const isAField = a instanceof BaseField;
const isBField = b instanceof BaseField;
if (isAField && isBField) {
return a.equals(b);
} else if (isAField === isBField) {
return undefined;
} else {
return false;
}
};
// `addEqualityTesters` doesn't seem to be in the types yet.
(expect as any).addEqualityTesters([areFieldsEqual]);
}

@@ -26,3 +26,5 @@ import { poseidon2Hash } from '../crypto/index.js';

public readonly y: Fr,
) {}
) {
// TODO: Do we want to check if the point is on the curve here?
}

@@ -48,3 +50,3 @@ /**

const reader = BufferReader.asReader(buffer);
return new this(Fr.fromBuffer(reader.readBytes(32)), Fr.fromBuffer(reader.readBytes(32)));
return new this(Fr.fromBuffer(reader), Fr.fromBuffer(reader));
}

@@ -139,2 +141,26 @@

}
/**
* Check if this is point at infinity.
* Check this is consistent with how bb is encoding the point at infinity
*/
public get inf() {
return this.x == Fr.ZERO;
}
public toFieldsWithInf() {
return [this.x, this.y, new Fr(this.inf)];
}
isOnGrumpkin() {
// TODO: Check this against how bb handles curve check and infinity point check
if (this.inf) {
return true;
}
// p.y * p.y == p.x * p.x * p.x - 17
const A = new Fr(17);
const lhs = this.y.square();
const rhs = this.x.square().mul(this.x).sub(A);
return lhs.equals(rhs);
}
}

@@ -141,0 +167,0 @@

@@ -1,10 +0,13 @@

import { randomBytes } from 'crypto';
import * as fs from 'fs/promises';
import * as path from 'path';
// Create a random directory underneath a 'base' directory
// Calls a provided method, ensures the random directory is cleaned up afterwards
export async function runInDirectory<T>(workingDirBase: string, fn: (dir: string) => Promise<T>): Promise<T> {
export async function runInDirectory<T>(
workingDirBase: string,
fn: (dir: string) => Promise<T>,
cleanup: boolean = true,
): Promise<T> {
// Create random directory to be used for temp files
const workingDirectory = `${workingDirBase}/${randomBytes(8).toString('hex')}`;
await fs.mkdir(workingDirectory, { recursive: true });
const workingDirectory = await fs.mkdtemp(path.join(workingDirBase, 'tmp-'));

@@ -16,4 +19,6 @@ await fs.access(workingDirectory);

} finally {
await fs.rm(workingDirectory, { recursive: true, force: true });
if (cleanup) {
await fs.rm(workingDirectory, { recursive: true, force: true });
}
}
}

@@ -13,3 +13,3 @@ import { InterruptibleSleep } from '../sleep/index.js';

constructor(private fn: () => Promise<void>, private pollingIntervalMS = 10000) {}
constructor(private fn: () => void | Promise<void>, private pollingIntervalMS = 10000) {}

@@ -16,0 +16,0 @@ /**

@@ -197,1 +197,9 @@ import { Fr } from '../fields/fields.js';

}
export function toHumanReadable(buf: Buffer, maxLen?: number): string {
const result = buf.every(byte => byte >= 32 && byte <= 126) ? buf.toString('ascii') : `0x${buf.toString('hex')}`;
if (maxLen && result.length > maxLen) {
return result.slice(0, maxLen) + '...';
}
return result;
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc