Skip to content

Commit 7841651

Browse files
committed
comments
1 parent bb44841 commit 7841651

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

modules/integration-browser/src/build_decrypt_fixtures.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ import { writeFileSync } from 'fs'
2020

2121
import { DecryptManifestList } from './types' // eslint-disable-line no-unused-vars
2222

23+
/* This function interacts with manifest information
24+
* and produces the fixtures in the `fixtures`
25+
* that the karma server will consume to run tests.
26+
* This gives us 2 useful freedoms.
27+
* 1. The code is not tied to a specific copy of the manifest information
28+
* 2. The tests can be run on a subset of tests for debugging.
29+
*/
2330
export async function buildDecryptFixtures (fixtures: string, vectorFile: string, testName: string, slice: string) {
2431
const [start = 0, end = 9999] = (slice || '').split(':').map(n => parseInt(n, 10))
2532

modules/integration-browser/src/build_encrypt_fixtures.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ import { URL } from 'url'
2727
import { readFileSync, writeFileSync } from 'fs'
2828
import got from 'got'
2929

30+
/* This function interacts with manifest information
31+
* and produces the fixtures in the `fixtures`
32+
* that the karma server will consume to run tests.
33+
* This gives us 2 useful freedoms.
34+
* 1. The code is not tied to a specific copy of the manifest information
35+
* 2. The tests can be run on a subset of tests for debugging.
36+
*/
3037
export async function buildEncryptFixtures (fixtures: string, manifestFile: string, keyFile: string, testName: string, slice: string) {
3138
const [start = 0, end = 9999] = (slice || '').split(':').map(n => parseInt(n, 10))
3239
const { tests, plaintexts }: EncryptManifestList = await getParsedJSON(manifestFile)
@@ -37,6 +44,7 @@ export async function buildEncryptFixtures (fixtures: string, manifestFile: stri
3744
Object
3845
.keys(plaintexts)
3946
.forEach(name => {
47+
/* https://github.com/awslabs/aws-crypto-tools-test-vector-framework/blob/master/features/0003-awses-message-encryption.md#plaintexts */
4048
plaintextBytes[name] = randomBytes(10).toString('base64')
4149
})
4250

0 commit comments

Comments
 (0)