implemented frontend including separate message system; started to implement backend

This commit is contained in:
User
2026-03-10 14:48:48 +01:00
committed by Jannik Luboeinski
parent 4275cbd795
commit 78d5352a48
1058 changed files with 101527 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
/**
* This is a GF2 Polynomial abstraction that is not meant for production!
*
* It is easy to understand and it's correctness is as obvious as possible. It can be used to verify
* efficient implementations of algorithms on GF2.
*/
export class GF2Polynomial {
/**
* @type {Set<number>}
*/
degrees: Set<number>;
}
export function createFromBytes(bytes: Uint8Array): GF2Polynomial;
export function toUint8Array(p: GF2Polynomial, byteLength?: number): Uint8Array<ArrayBuffer>;
export function createFromUint(uint: number): GF2Polynomial;
export function createRandom(degree: number): GF2Polynomial;
export function getHighestDegree(p: GF2Polynomial): number;
export function addInto(p1: GF2Polynomial, p2: GF2Polynomial): void;
export function orInto(p1: GF2Polynomial, p2: GF2Polynomial): void;
export function add(p1: GF2Polynomial, p2: GF2Polynomial): GF2Polynomial;
export function clone(p: GF2Polynomial): GF2Polynomial;
export function addDegreeInto(p: GF2Polynomial, degree: number): void;
export function multiply(p1: GF2Polynomial, p2: GF2Polynomial): GF2Polynomial;
export function shiftLeft(p: GF2Polynomial, shift: number): GF2Polynomial;
export function mod(p1: GF2Polynomial, p2: GF2Polynomial): GF2Polynomial;
export function modPow(p: GF2Polynomial, e: number, m: GF2Polynomial): GF2Polynomial;
export function gcd(p1: GF2Polynomial, p2: GF2Polynomial): GF2Polynomial;
export function equals(p1: GF2Polynomial, p2: GF2Polynomial): boolean;
export function isIrreducibleBenOr(p: GF2Polynomial): boolean;
export function createIrreducible(degree: number): GF2Polynomial;
export function fingerprint(buf: Uint8Array, m: GF2Polynomial): Uint8Array<ArrayBuffer>;
export class RabinPolynomialEncoder {
/**
* @param {GF2Polynomial} m The irreducible polynomial
*/
constructor(m: GF2Polynomial);
fingerprint: GF2Polynomial;
m: GF2Polynomial;
/**
* @param {number} b
*/
write(b: number): void;
getFingerprint(): Uint8Array<ArrayBuffer>;
}
//# sourceMappingURL=rabin-gf2-polynomial.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rabin-gf2-polynomial.d.ts","sourceRoot":"","sources":["../../hash/rabin-gf2-polynomial.js"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH;IAEI;;QAEI;IACJ,SAFW,GAAG,CAAC,MAAM,CAAC,CAEE;CAE3B;AAOM,uCAFI,UAAU,iBAcpB;AAQM,gCAHI,aAAa,eACb,MAAM,2BAahB;AAOM,qCAFI,MAAM,iBAQhB;AAOM,qCAFI,MAAM,iBAYhB;AAMM,oCAHI,aAAa,UAG2D;AAU5E,4BAHI,aAAa,MACb,aAAa,QAUvB;AAUM,2BAHI,aAAa,MACb,aAAa,QAMvB;AAUM,wBAHI,aAAa,MACb,aAAa,iBAevB;AASM,yBAFI,aAAa,iBAMvB;AAUM,iCAHI,aAAa,UACb,MAAM,QAQhB;AAQM,6BAHI,aAAa,MACb,aAAa,iBAUvB;AAQM,6BAHI,aAAa,SACb,MAAM,iBAShB;AAQM,wBAHI,aAAa,MACb,aAAa,iBAavB;AAWM,0BAJI,aAAa,KACb,MAAM,KACN,aAAa,iBAcvB;AAQM,wBAHI,aAAa,MACb,aAAa,iBASvB;AAQM,2BAHI,aAAa,MACb,aAAa,WAQvB;AAgCM,sCAFI,aAAa,WAYvB;AAKM,0CAFI,MAAM,iBAOhB;AAQM,iCAHI,UAAU,KACV,aAAa,2BAE0G;AAElI;IACE;;OAEG;IACH,eAFW,aAAa,EAKvB;IAFC,2BAAsC;IACtC,iBAAU;IAGZ;;OAEG;IACH,SAFW,MAAM,QAOhB;IAED,0CAEC;CACF"}

View File

@@ -0,0 +1,29 @@
export class RabinUncachedEncoder {
/**
* @param {Uint8Array} m assert(m[0] === 1)
*/
constructor(m: Uint8Array);
m: Uint8Array<ArrayBufferLike>;
blen: number;
bs: Uint8Array<ArrayBuffer>;
/**
* This describes the position of the most significant byte (starts with 0 and increases with
* shift)
*/
bpos: number;
/**
* Add/Xor/Substract bytes.
*
* Discards bytes that are out of range.
* @todo put this in function or inline
*
* @param {Uint8Array} cs
*/
add(cs: Uint8Array): void;
/**
* @param {number} byte
*/
write(byte: number): void;
getFingerprint(): Uint8Array<ArrayBuffer>;
}
//# sourceMappingURL=rabin-uncached.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rabin-uncached.d.ts","sourceRoot":"","sources":["../../hash/rabin-uncached.js"],"names":[],"mappings":"AAUA;IACE;;OAEG;IACH,eAFW,UAAU,EAWpB;IARC,+BAAU;IACV,aAAwB;IACxB,4BAAmC;IACnC;;;OAGG;IACH,aAAa;IAGf;;;;;;;OAOG;IACH,QAFW,UAAU,QAQpB;IAED;;OAEG;IACH,YAFW,MAAM,QAgBhB;IAED,0CAMC;CACF"}

27
yjs-poll/node_modules/lib0/dist/hash/rabin.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
export const StandardIrreducible8: Uint8Array<ArrayBuffer>;
export const StandardIrreducible16: Uint8Array<ArrayBuffer>;
export const StandardIrreducible32: Uint8Array<ArrayBuffer>;
export const StandardIrreducible64: Uint8Array<ArrayBuffer>;
export const StandardIrreducible128: Uint8Array<ArrayBuffer>;
export class RabinEncoder {
/**
* @param {Uint8Array} m assert(m[0] === 1)
*/
constructor(m: Uint8Array);
m: Uint8Array<ArrayBufferLike>;
blen: number;
bs: Uint8Array<ArrayBuffer>;
cache: Uint8Array<ArrayBuffer>;
/**
* This describes the position of the most significant byte (starts with 0 and increases with
* shift)
*/
bpos: number;
/**
* @param {number} byte
*/
write(byte: number): void;
getFingerprint(): Uint8Array<ArrayBuffer>;
}
export function fingerprint(irreducible: Uint8Array, data: Uint8Array): Uint8Array<ArrayBuffer>;
//# sourceMappingURL=rabin.d.ts.map

1
yjs-poll/node_modules/lib0/dist/hash/rabin.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"rabin.d.ts","sourceRoot":"","sources":["../../hash/rabin.js"],"names":[],"mappings":"AAUA,2DAA4D;AAC5D,4DAAkE;AAClE,4DAA4E;AAC5E,4DAA+F;AAC/F,6DAAmI;AAmCnI;IACE;;OAEG;IACH,eAFW,UAAU,EAYpB;IATC,+BAAU;IACV,aAAwB;IACxB,4BAAmC;IACnC,+BAA2B;IAC3B;;;OAGG;IACH,aAAa;IAGf;;OAEG;IACH,YAFW,MAAM,QAYhB;IAED,0CAMC;CACF;AAMM,yCAHI,UAAU,QACV,UAAU,2BAQpB"}

8
yjs-poll/node_modules/lib0/dist/hash/rabin.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export function testPolynomialBasics(_tc: t.TestCase): void;
export function testIrreducibleInput(_tc: t.TestCase): void;
export function testIrreducibleSpread(_tc: t.TestCase): void;
export function testGenerateIrreducibles(_tc: t.TestCase): void;
export function testFingerprintCompatiblity(tc: t.TestCase): void;
export function testConflicts(tc: t.TestCase): void;
import * as t from '../testing.js';
//# sourceMappingURL=rabin.test.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rabin.test.d.ts","sourceRoot":"","sources":["../../hash/rabin.test.js"],"names":[],"mappings":"AAaO,0CAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAapB;AAKM,2CAFI,CAAC,CAAC,QAAQ,QASpB;AAwBM,8CAFI,CAAC,CAAC,QAAQ,QAyBpB;AAmGM,gDAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,kCAFI,CAAC,CAAC,QAAQ,QA4BpB;mBAvOkB,eAAe"}

2
yjs-poll/node_modules/lib0/dist/hash/sha256.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export function digest(data: Uint8Array): Uint8Array<ArrayBuffer>;
//# sourceMappingURL=sha256.d.ts.map

1
yjs-poll/node_modules/lib0/dist/hash/sha256.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../../hash/sha256.js"],"names":[],"mappings":"AA+KO,6BAFI,UAAU,2BAEkC"}

View File

@@ -0,0 +1,2 @@
export function digest(data: Uint8Array): Buffer<ArrayBufferLike>;
//# sourceMappingURL=sha256.node.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sha256.node.d.ts","sourceRoot":"","sources":["../../hash/sha256.node.js"],"names":[],"mappings":"AAKO,6BAFI,UAAU,2BAMpB"}

View File

@@ -0,0 +1,7 @@
export function testSelfReferencingHash(_tc: t.TestCase): void;
export function testSha256Basics(_tc: t.TestCase): Promise<void>;
export function testLargeValue(_tc: t.TestCase): Promise<void>;
export function testRepeatSha256Hashing(tc: t.TestCase): Promise<void>;
export function testBenchmarkSha256(_tc: t.TestCase): Promise<void>;
import * as t from '../testing.js';
//# sourceMappingURL=sha256.test.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"sha256.test.d.ts","sourceRoot":"","sources":["../../hash/sha256.test.js"],"names":[],"mappings":"AAcO,6CAFI,CAAC,CAAC,QAAQ,QAKpB;AAKM,sCAFI,CAAC,CAAC,QAAQ,iBA2BpB;AAOM,oCAFI,CAAC,CAAC,QAAQ,iBA4BpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,iBAQpB;AAKM,yCAFI,CAAC,CAAC,QAAQ,iBAmDpB;mBAjJkB,eAAe"}