Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Crypto to use WebCrypto API and to replace RSA with ECC #446

Merged
merged 68 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
5013208
feat: introducing webcrypto to keys domain
CMCDragonkai Oct 7, 2022
be886b5
bench: restructured benchmarks and acquired results for the new
CMCDragonkai Oct 7, 2022
f72b932
feat: beginning libsodium migration
CMCDragonkai Oct 7, 2022
f9ea850
feat: benching after libsodium
CMCDragonkai Oct 9, 2022
9ebf876
fix: replacing `KeyManager` usage with `KeyRing`.
tegefaulkes Oct 10, 2022
bc83a95
fix: `CertIdEncoded` is now a lowercase base16 string
tegefaulkes Oct 11, 2022
80fe433
tests: updating tests
CMCDragonkai Oct 11, 2022
22cd35c
feat: added keyring benchmarks
CMCDragonkai Oct 11, 2022
bcd9c37
feat: added worker overhead benchmarks
CMCDragonkai Oct 11, 2022
5805d74
feat: `KeyRing` worker changes
CMCDragonkai Oct 11, 2022
b4a08f0
tests: fixing tests
tegefaulkes Oct 12, 2022
09115c6
fix: fully removing `setupGlobalKeypair`
tegefaulkes Oct 12, 2022
532e662
feat: generating certificate can be done in the worker now
CMCDragonkai Oct 12, 2022
d15e82f
fix: updated agent status tests and bin command
tegefaulkes Oct 12, 2022
8c4c5ff
tests: added more `CertManager` tests
tegefaulkes Oct 12, 2022
3dc3ff8
feat: CertManager now auto-renews on startup
CMCDragonkai Oct 12, 2022
785fc23
tests: removed all scaffolding and useless packages
CMCDragonkai Oct 12, 2022
022357a
tests: certificate manager tests and PEM tests
CMCDragonkai Oct 12, 2022
365f721
feat: CertManager now renews with existing keypair
CMCDragonkai Oct 13, 2022
ec54799
fix: re-enabling `CertManager` tests
tegefaulkes Oct 13, 2022
d466fcf
fix: Adding `KeyRing` password hashing overrides to tests
tegefaulkes Oct 13, 2022
ec087b0
feat: CertManager now locks when renewing or resetting,
CMCDragonkai Oct 13, 2022
1db1d4f
fix: small fix to network utils
tegefaulkes Oct 13, 2022
d4c859e
fix: renamed error names to be clearer
CMCDragonkai Oct 13, 2022
16fb848
fix: cleaned up polykey worker module to have only keys related funct…
CMCDragonkai Oct 13, 2022
879d919
feat: `VaultManager` constructs and maintains a separate `DB` for the…
tegefaulkes Oct 13, 2022
1c960bd
feat: all ID generators now use `keys/utils/random.ts` for the random…
CMCDragonkai Oct 13, 2022
c1a4f59
tests: cert manager fast check tests and now timing
CMCDragonkai Oct 13, 2022
3471bfc
fix: small fix to claim utils
tegefaulkes Oct 13, 2022
86e38a2
fix: removed old `KeyManager` and keys utils
tegefaulkes Oct 13, 2022
7c0b02e
fix: mem locking error for nodes domain
tegefaulkes Oct 13, 2022
84c8ce9
fix: adding `keyRingConfig` overrides to tests across the board
tegefaulkes Oct 13, 2022
b7281f9
feat: `CertManager` changes
CMCDragonkai Oct 14, 2022
10b39cb
fix: renamed `memoryLocked` to `strictMemoryLock`
tegefaulkes Oct 14, 2022
589f70d
fix: nodes domain getting `PublicKey` from `NodeId` and not through c…
tegefaulkes Oct 14, 2022
314951a
feat: `keys encrypt` and `keys verify` bin commands now take a public…
tegefaulkes Oct 14, 2022
735931e
feat: updating `keys privateKey`, `keys publicKey` and `keys keyPair`
tegefaulkes Oct 14, 2022
013f0e5
test: updating `CertManager` tests
CMCDragonkai Oct 14, 2022
73b9262
fix: split `keys root` into `keys private`, `keys public` and `keys p…
tegefaulkes Oct 17, 2022
0102c74
fix: updated client `keysKeyPair.test.ts` and added `keysPublicKey.te…
tegefaulkes Oct 17, 2022
dde2620
fix: no need to change the name of `keysKeyPairRenew` and `keysKeyPai…
tegefaulkes Oct 17, 2022
3b5a26c
fix: updated `agent start` and `bootstrap` bin commands
tegefaulkes Oct 17, 2022
f48b430
fix: removing old parameters and apply `KeyRing` config overrides for…
tegefaulkes Oct 17, 2022
fad9a6f
fix: updating `AgentChildProcessInput` type
tegefaulkes Oct 17, 2022
9b65a1d
fix: fixed up `keys private` and `keys keypair` to take a new passwor…
tegefaulkes Oct 17, 2022
997d31d
tests: general test fixes
tegefaulkes Oct 17, 2022
5137cee
feat: general rework
CMCDragonkai Oct 15, 2022
7ab3b12
Feat: updating tokens and claims
CMCDragonkai Oct 26, 2022
47bfd04
fix: fixed up buffer locking/unlocking and tests for keys
CMCDragonkai Nov 2, 2022
25bdb60
tests: expanding tests for claims
CMCDragonkai Nov 2, 2022
c4a4ff4
fix: cleaning up claims errors
CMCDragonkai Nov 2, 2022
24000ce
feat: refactoring `gestaltGraph`
CMCDragonkai Nov 3, 2022
eb08bd6
tests: updating `GestaltGraph.test.ts`
tegefaulkes Nov 14, 2022
4bc0738
feat: refactoring `Discovery`
tegefaulkes Nov 14, 2022
b6dc66e
feat: fixing up build issues
tegefaulkes Nov 15, 2022
4285a3c
feat: refactoring claim processes
tegefaulkes Nov 15, 2022
652c5de
fix: fixing sessions tokens
tegefaulkes Nov 16, 2022
a78b4de
fix: notification fixes
tegefaulkes Nov 17, 2022
c70cd08
tests: small fixes for nodeManager tests
tegefaulkes Nov 21, 2022
4af0eee
fix: TLS verification
tegefaulkes Nov 21, 2022
4af9169
fix: session tokens are working now
tegefaulkes Nov 21, 2022
b399b1a
tests: fixing up tests and clean up
tegefaulkes Nov 21, 2022
d71f690
build: update `lint` and `lintfix` script
tegefaulkes Dec 7, 2022
48cefcd
dep: updating typescript versions
tegefaulkes Dec 7, 2022
644dbc1
fix: small type fix
tegefaulkes Dec 7, 2022
b84d634
dep: updated `@matrixai/errors`
tegefaulkes Dec 7, 2022
9321f6c
tests: disabled failing `Vaultmanager` test
tegefaulkes Dec 8, 2022
c68a01d
fix: removed unneeded copy from postbuild script
tegefaulkes Dec 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 25 additions & 20 deletions benches/index.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
#!/usr/bin/env ts-node

import type { Summary } from 'benny/lib/internal/common-types';
import fs from 'fs';
import path from 'path';
import si from 'systeminformation';
import gitgc from './gitgc';
import { fsWalk, resultsPath, suitesPath } from './utils';

async function main(): Promise<void> {
await fs.promises.mkdir(path.join(__dirname, 'results'), { recursive: true });
await gitgc();
const resultFilenames = await fs.promises.readdir(
path.join(__dirname, 'results'),
);
const metricsFile = await fs.promises.open(
path.join(__dirname, 'results', 'metrics.txt'),
'w',
);
// Running all suites
for await (const suitePath of fsWalk(suitesPath)) {
// Skip over non-ts and non-js files
const ext = path.extname(suitePath);
if (ext !== '.ts' && ext !== '.js') {
continue;
}
const suite: () => Promise<Summary> = (await import(suitePath)).default;
await suite();
}
// Concatenating metrics
const metricsPath = path.join(resultsPath, 'metrics.txt');
await fs.promises.rm(metricsPath);
let concatenating = false;
for (const resultFilename of resultFilenames) {
if (/.+_metrics\.txt$/.test(resultFilename)) {
const metricsData = await fs.promises.readFile(
path.join(__dirname, 'results', resultFilename),
);
if (concatenating) {
await metricsFile.write('\n');
}
await metricsFile.write(metricsData);
concatenating = true;
for await (const metricPath of fsWalk(resultsPath)) {
// Skip over non-metrics files
if (!metricPath.endsWith('_metrics.txt')) {
continue;
}
const metricData = await fs.promises.readFile(metricPath);
if (concatenating) {
await fs.promises.appendFile(metricsPath, '\n');
}
await fs.promises.appendFile(metricsPath, metricData);
concatenating = true;
}
await metricsFile.close();
const systemData = await si.get({
cpu: '*',
osInfo: 'platform, distro, release, kernel, arch',
Expand Down
116 changes: 116 additions & 0 deletions benches/results/basic/buffer_encoding_decoding.chart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" />
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.5.1/dist/chart.min.js"></script>
<title>basic.buffer_encoding_decoding</title>
<style>
body {
margin: 0;
padding: 0;
background: #ddd;
}

.container {
box-sizing: border-box;
height: 96vh;
width: 96vw;
margin: 2vh 2vw;
resize: both;
overflow: hidden;
padding: 20px;
background: white;
box-shadow: 0 0 15px #aaa;
}
</style>
</head>
<body>
<div class="container">
<canvas id="chart1666662556031" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
const [whole, fraction] = String(num).split('.')
const chunked = []
whole
.split('')
.reverse()
.forEach((char, index) => {
if (index % 3 === 0) {
chunked.unshift([char])
} else {
chunked[0].unshift(char)
}
})

const fractionStr = fraction !== undefined ? '.' + fraction : ''

return (
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
)
}
const ctx1666662556031 = document
.getElementById('chart1666662556031')
.getContext('2d')
const chart1666662556031 = new Chart(ctx1666662556031, {
type: 'bar',
data: {
labels: ["JSON stringify and parse buffer","Base64 encode and decode buffer","Base64url encode and decode buffer"],
datasets: [
{
data: [172634,1385074,1327362],
backgroundColor: ["hsl(14.951999999999991, 85%, 55%)","hsl(120, 85%, 55%)","hsl(114.996, 85%, 55%)"],
borderColor: ["hsl(14.951999999999991, 85%, 55%)","hsl(120, 85%, 55%)","hsl(114.996, 85%, 55%)"],
borderWidth: 2,
},
],
},
options: {
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'basic.buffer_encoding_decoding',
font: { size: 20 },
padding: 20,
},
legend: {
display: false,
},
tooltip: {
callbacks: {
label: (context) => {
return format(context.parsed.y) + ' ops/s'
},
},
displayColors: false,
backgroundColor: '#222222',
padding: 10,
cornerRadius: 5,
intersect: false,
},
},
scales: {
x: {
grid: {
color: '#888888',
},
},
y: {
title: {
display: true,
text: 'Operations per second',
padding: 10,
},
grid: {
color: '#888888',
},
},
},
},
})
</script>
</body>
</html>
Loading