chore: update to version 14.0.11 and align website URLs

This commit is contained in:
2026-01-11 11:34:13 +03:00
parent ef74383349
commit 19c8d69bd8
1499 changed files with 53633 additions and 89 deletions
+17
View File
@@ -0,0 +1,17 @@
import { getSharedSecret } from '@scure/sr25519';
import { u8aToU8a } from '@pezkuwi/util';
/**
* @name sr25519Agreement
* @description Key agreement between other's public key and self secret key
*/
export function sr25519Agreement(secretKey, publicKey) {
const secretKeyU8a = u8aToU8a(secretKey);
const publicKeyU8a = u8aToU8a(publicKey);
if (publicKeyU8a.length !== 32) {
throw new Error(`Invalid publicKey, received ${publicKeyU8a.length} bytes, expected 32`);
}
else if (secretKeyU8a.length !== 64) {
throw new Error(`Invalid secretKey, received ${secretKeyU8a.length} bytes, expected 64`);
}
return getSharedSecret(secretKeyU8a, publicKeyU8a);
}