Skip to content

Commit b6537d5

Browse files
committed
New Signature Class conversion in progress
Demo not enabled Removal of old docs Removal of old design info corrected docs
1 parent ff4ddc9 commit b6537d5

17 files changed

+607
-528
lines changed

.cspell/custom-dictionary-workspace.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ Ristretto
1616
schnorr
1717
scid
1818
secp
19+
SPHINCS

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<b>UW/VIAT is a Meta-Layer Solution designed as a Sub-Layer 0 network. It serves as the foundation for both a next-generation Web and a natively supported cryptocurrency. Unlike traditional Layer 0 solutions, which focus solely on blockchain interoperability and scalability, UW/VIAT is a hybrid system that embraces both centralized and decentralized approaches. The Universal Web is centrally structured to ensure efficiency, security, and seamless integration, while the cryptocurrency (VIAT) is decentralized, enabling trustless transactions and complete transparency. This unified framework enables the development of hybrid applications, where centralized Web services and decentralized cryptocurrency natively work together, creating a seamless infrastructure for secure communications, digital ownership, transactions, and beyond.</b>
1717
</p>
1818
<p align="center">
19-
The UW/VIAT is designed to be a multiplanetary "NEXUS" or more specifically a Crypto Nexus. The defintion we use for a NEXUS is: a unified system that fully integrates a Web & a decentralized cryptocurrency. The Universal Web is similar to the network design of the Web today being the centralized Server-Client model while VIAT is like a traditional decentralized cryptocurrency making it a hybrid network. The unified system can be referred to as the Universal Web (includes VIAT) or simply put The Nexus.
19+
The UW/VIAT is designed to be a multiplanetary "NEXUS" or more specifically a Crypto Nexus. The defintion we use for a NEXUS is: a unified system that fully integrates a Web & a decentralized cryptocurrency. The Universal Web is similar to the network design of the Web today being the centralized Server-Client model while VIAT is like a traditional decentralized cryptocurrency making it a hybrid network. The unified system can be referred to as the Universal Web (which includes VIAT) or simply put The Nexus.
2020
</p>
2121

2222
<h5 align="center">| <a href="https://x.com/tommarchi">LEAD DEV</a> |</h5>
@@ -30,11 +30,11 @@ The UW/VIAT is designed to be a multiplanetary "NEXUS" or more specifically a Cr
3030
</p>
3131

3232
<h4>Perspective & Rational</h4>
33-
<p>Reimagining the Web from the ground up may seem like a radical proposition, but it is entirely logical, rational, within our ability, & necessary. At its core, the Web is a collection of software solutions. Therefore, creating a new Web doesn’t require reinventing the physical infrastructure; it simply demands innovative software designed to leverage current innovations while addressing the limitations of the old.</p>
33+
<p>Re-imagining the Web from the ground up may seem like a radical proposition, but it is entirely logical, rational, within our ability, & necessary. At its core, the Web is a collection of software solutions. Therefore, creating a new Web doesn’t require reinventing the physical infrastructure; it simply demands innovative software designed to leverage current innovations while addressing the limitations of the old.</p>
3434

3535
<p>If we critically evaluate the challenges facing the current Web from inefficiencies & vulnerabilities, to its inability to fully embrace emerging technologies it becomes selfevident that incremental updates isn't going to address fundimental design flaws. A foundational overhaul is not only viable but also more efficient and cost-effective. By building on 30 years of lessons, we can envision something that goes beyond what we call a Web something that integrates cutting-edge technologies and anticipates future advancements. This isn’t just an opportunity; it’s an imperative to build a sustainable, forward-thinking cryptographic ecosystem with cryptocurrency as a native component.</p>
3636

37-
<p>It's something beyond a Web it's a Nexus.</p>
37+
<p>It's something beyond a Web & cryptocurrency it's a Nexus.</p>
3838

3939
<h3>NEXUS?</h3>
4040
<p>What do you call a system that seamlessly integrates a Web and a native cryptocurrency? We call it a Nexus: a unified ecosystem where both elements are deeply interconnected yet function independently, enhancing each other’s capabilities without compromise. Our version of the World Wide Web is the Universal Web (Multi-planetary) & our cryptocurrency is VIAT together they form what we call a/the Nexus.</p>
Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1-
/*
2-
Algorithm 1, implementing key generation for ML-DSA, uses an RBG to generate the 256-bit random
3-
value ξ . The seed ξ shall be freshly generated using an approved RBG, as prescribed in NIST SP 800-90A,
4-
SP 800-90B, and SP 800-90C [19, 20, 21]. Moreover, the RBG used shall have a security strength of at
5-
least 192 bits for ML-DSA-65 and 256 bits for ML-DSA-87. For ML-DSA-44, the RBG should have a
6-
security strength of at least 192 bits and shall have a security strength of at least 128 bits. (If an approved
7-
RBG with at least 128 bits of security but less than 192 bits of security is used, then the claimed security
8-
strength of ML-DSA-44 is reduced from category 2 to category 1.)
9-
*/
1+
import { hash256, hash512, shake256 } from '../hash/shake256.js';
102
import {
113
randomBuffer,
124
toBase64,
135
toHex,
146
} from '#crypto';
157
import { ml_dsa44 } from '@noble/post-quantum/ml-dsa';
16-
const generateKeypair = ml_dsa44;
17-
export async function signatureKeypair(seed) {
18-
const keypair = await generateKeypair.keygen(seed);
8+
import { signatureScheme } from './signatureScheme.js';
9+
const seedSize = 64;
10+
const publicKeySize = 1312;
11+
const privateKeySize = 2560;
12+
const signatureSize = 2420;
13+
const generateKeypair = ml_dsa44.keygen;
14+
const verifyData = ml_dsa44.verify;
15+
const signData = ml_dsa44.sign;
16+
async function createKeypair(seed) {
17+
const keypair = await generateKeypair();
1918
return {
2019
publicKey: keypair.publicKey,
2120
privateKey: keypair.secretKey
2221
};
2322
}
24-
export async function sign(message, privateKey) {
25-
const signedMessage = await generateKeypair.sign(privateKey?.privateKey || privateKey, message);
26-
return signedMessage;
23+
function signMethod(message, privateKey) {
24+
return signData(privateKey?.privateKey || privateKey, message);
2725
}
28-
export async function verifySignature(signedMessage, publicKey, message) {
29-
const isValid = await generateKeypair.verify(publicKey?.publicKey || publicKey, message, signedMessage);
30-
return isValid;
26+
function verifyMethod(signature, message, publicKey) {
27+
return verifyData(publicKey?.publicKey || publicKey, message, signature);
3128
}
32-
export const dilithium44 = {
29+
export const dilithium44 = signatureScheme({
3330
name: 'dilithium44',
34-
alias: 'dilithium44',
35-
id: 2,
36-
signatureKeypair,
37-
sign,
38-
verifySignature
39-
};
31+
alias: 'ml_dsa44',
32+
id: 1,
33+
security: 1,
34+
publicKeySize,
35+
privateKeySize,
36+
signatureSize,
37+
seedSize,
38+
createKeypair,
39+
verifyMethod,
40+
signMethod,
41+
hash256,
42+
hash512,
43+
hash: shake256,
44+
preferred: false
45+
});
4046
export default dilithium44;
41-
// const kp = await signatureKeypair();
42-
// console.log(kp.publicKey, kp.publicKey.length);
47+
// const key = await dilithium44.signatureKeypair();
48+
// const msg = Buffer.from('hello world');
49+
// console.log(key);
50+
// console.log(key.publicKey.length, key.privateKey.length);
51+
// const sig = await dilithium44.sign(msg, key);
52+
// console.log(sig.length);
53+
// console.log(await dilithium44.verify(sig, key, msg));
Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1-
/*
2-
Algorithm 1, implementing key generation for ML-DSA, uses an RBG to generate the 256-bit random
3-
value ξ . The seed ξ shall be freshly generated using an approved RBG, as prescribed in NIST SP 800-90A,
4-
SP 800-90B, and SP 800-90C [19, 20, 21]. Moreover, the RBG used shall have a security strength of at
5-
least 192 bits for ML-DSA-65 and 256 bits for ML-DSA-87. For ML-DSA-44, the RBG should have a
6-
security strength of at least 192 bits and shall have a security strength of at least 128 bits. (If an approved
7-
RBG with at least 128 bits of security but less than 192 bits of security is used, then the claimed security
8-
strength of ML-DSA-44 is reduced from category 2 to category 1.)
9-
*/
1+
import { hash256, hash512, shake256 } from '../hash/shake256.js';
102
import {
113
randomBuffer,
124
toBase64,
135
toHex,
146
} from '#crypto';
157
import { ml_dsa65 } from '@noble/post-quantum/ml-dsa';
16-
const generateKeypair = ml_dsa65;
17-
export async function signatureKeypair(seed) {
18-
const keypair = await generateKeypair.keygen(seed);
8+
import { signatureScheme } from './signatureScheme.js';
9+
const seedSize = 64;
10+
const publicKeySize = 1952;
11+
const privateKeySize = 4032;
12+
const signatureSize = 3309;
13+
const generateKeypair = ml_dsa65.keygen;
14+
const verifyData = ml_dsa65.verify;
15+
const signData = ml_dsa65.sign;
16+
async function createKeypair(seed) {
17+
const keypair = await generateKeypair();
1918
return {
2019
publicKey: keypair.publicKey,
2120
privateKey: keypair.secretKey
2221
};
2322
}
24-
export async function sign(message, privateKey) {
25-
const signedMessage = await generateKeypair.sign(privateKey?.privateKey || privateKey, message);
26-
return signedMessage;
23+
function signMethod(message, privateKey) {
24+
return signData(privateKey?.privateKey || privateKey, message);
2725
}
28-
export async function verifySignature(signedMessage, publicKey, message) {
29-
const isValid = await generateKeypair.verify(publicKey?.publicKey || publicKey, message, signedMessage);
30-
return isValid;
26+
function verifyMethod(signature, message, publicKey) {
27+
return verifyData(publicKey?.publicKey || publicKey, message, signature);
3128
}
32-
export const dilithium65 = {
29+
export const dilithium65 = signatureScheme({
3330
name: 'dilithium65',
34-
alias: 'dilithium65',
35-
id: 3,
36-
signatureKeypair,
37-
sign,
38-
verifySignature
39-
};
31+
alias: 'ml_dsa65',
32+
id: 2,
33+
security: 2,
34+
publicKeySize,
35+
privateKeySize,
36+
signatureSize,
37+
seedSize,
38+
createKeypair,
39+
verifyMethod,
40+
signMethod,
41+
hash256,
42+
hash512,
43+
hash: shake256,
44+
preferred: false
45+
});
4046
export default dilithium65;
41-
// const kp = signatureKeypair();
42-
// console.log(sign(msg, kp).length);
47+
// const key = await dilithium65.signatureKeypair();
48+
// const msg = Buffer.from('hello world');
49+
// console.log(key);
50+
// console.log(key.publicKey.length, key.privateKey.length);
51+
// const sig = await dilithium65.sign(msg, key);
52+
// console.log(sig.length);
53+
// console.log(await dilithium65.verify(sig, key, msg));
Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1-
/*
2-
Algorithm 1, implementing key generation for ML-DSA, uses an RBG to generate the 256-bit random
3-
value ξ . The seed ξ shall be freshly generated using an approved RBG, as prescribed in NIST SP 800-90A,
4-
SP 800-90B, and SP 800-90C [19, 20, 21]. Moreover, the RBG used shall have a security strength of at
5-
least 192 bits for ML-DSA-65 and 256 bits for ML-DSA-87. For ML-DSA-44, the RBG should have a
6-
security strength of at least 192 bits and shall have a security strength of at least 128 bits. (If an approved
7-
RBG with at least 128 bits of security but less than 192 bits of security is used, then the claimed security
8-
strength of ML-DSA-44 is reduced from category 2 to category 1.)
9-
*/
1+
import { hash256, hash512, shake256 } from '../hash/shake256.js';
102
import {
113
randomBuffer,
124
toBase64,
135
toHex,
146
} from '#crypto';
157
import { ml_dsa87 } from '@noble/post-quantum/ml-dsa';
16-
const generateKeypair = ml_dsa87;
17-
export async function signatureKeypair(seed) {
18-
const keypair = await generateKeypair.keygen(seed);
8+
import { signatureScheme } from './signatureScheme.js';
9+
const seedSize = 64;
10+
const publicKeySize = 2592;
11+
const privateKeySize = 4896;
12+
const signatureSize = 4627;
13+
const generateKeypair = ml_dsa87.keygen;
14+
const verifyData = ml_dsa87.verify;
15+
const signData = ml_dsa87.sign;
16+
async function createKeypair(seed) {
17+
const keypair = await generateKeypair();
1918
return {
2019
publicKey: keypair.publicKey,
2120
privateKey: keypair.secretKey
2221
};
2322
}
24-
export async function sign(message, privateKey) {
25-
const signedMessage = await generateKeypair.sign(privateKey?.privateKey || privateKey, message);
26-
return signedMessage;
23+
function signMethod(message, privateKey) {
24+
return signData(privateKey?.privateKey || privateKey, message);
2725
}
28-
export async function verifySignature(signedMessage, publicKey, message) {
29-
const isValid = await generateKeypair.verify(publicKey?.publicKey || publicKey, message, signedMessage);
30-
return isValid;
26+
function verifyMethod(signature, message, publicKey) {
27+
return verifyData(publicKey?.publicKey || publicKey, message, signature);
3128
}
32-
export const dilithium87 = {
29+
export const dilithium87 = signatureScheme({
3330
name: 'dilithium87',
34-
alias: 'dilithium87',
35-
id: 4,
36-
signatureKeypair,
37-
sign,
38-
verifySignature
39-
};
31+
alias: 'ml_dsa87',
32+
id: 3,
33+
security: 3,
34+
publicKeySize,
35+
privateKeySize,
36+
signatureSize,
37+
seedSize,
38+
createKeypair,
39+
verifyMethod,
40+
signMethod,
41+
hash256,
42+
hash512,
43+
hash: shake256,
44+
preferred: false
45+
});
4046
export default dilithium87;
41-
// const kp = signatureKeypair(rseed);
42-
// console.log(sign(msg, kp).length);
47+
// const key = await dilithium87.signatureKeypair();
48+
// const msg = Buffer.from('hello world');
49+
// console.log(key);
50+
// console.log(key.publicKey.length, key.privateKey.length);
51+
// const sig = await dilithium87.sign(msg, key);
52+
// console.log(sig.length);
53+
// console.log(await dilithium87.verify(sig, key, msg));

0 commit comments

Comments
 (0)