-
Notifications
You must be signed in to change notification settings - Fork 27
feat(test-vectors): Test vector enumeration framework #266
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e846ff5
changes
lucasmcdonald3 d0b48cf
cleanup
lucasmcdonald3 dbb9193
cleanup
lucasmcdonald3 2e8ce82
reccmm
lucasmcdonald3 80194d5
reccmm
lucasmcdonald3 a46455f
updates
lucasmcdonald3 9f14ca2
negative hierarchy
lucasmcdonald3 da9cd40
guidance
lucasmcdonald3 167f649
fix
lucasmcdonald3 a93a6ba
fix
lucasmcdonald3 63daa0b
add
lucasmcdonald3 0f56efd
add
lucasmcdonald3 5832472
prettier
lucasmcdonald3 24ef6e1
unprettier
lucasmcdonald3 a97d482
fixes
lucasmcdonald3 4ce6d2b
cleanup
lucasmcdonald3 1e26bb8
fixes
lucasmcdonald3 4561e45
fix
lucasmcdonald3 061befc
prettier
lucasmcdonald3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved." | ||
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0" | ||
|
||
# ESDK Test Vector Enumeration | ||
|
||
This document performs the [test vector enumeration](test-vector-enumeration.md) process for the ESDK | ||
to construct the full suite of test vectors | ||
for the ESDK. | ||
|
||
The full suite of test vectors can be constructed | ||
by [enumerating all input configurations](test-vector-enumeration.md#enumerating-input-configurations) from this spec's input dimensions | ||
and [evaluating each configuration's expected result](test-vector-enumeration.md#determining-expected-results) from this spec's evaluation rules. | ||
|
||
## Input dimensions | ||
lucasmcdonald3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- Every [MPL input dimension](mpl-test-vector-enumeration.md#input-dimensions) is an input dimension for ESDK. | ||
- plaintext: Range of [representative plaintext values](#representative-plaintext-constraints) | ||
seebees marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- commitment policy: Range of allowed [commitment policies](../../client-apis/client.md#commitment-policy) | ||
- frame size: Range of [representative frame sizes](#representative-frame-sizes) | ||
- maximum encrypted data keys: Range of [representative number of maximum encrypted data keys](#representative-number-of-maximum-encrypted-data-keys-edks) | ||
|
||
## Evaluation rules | ||
|
||
- Every [MPL evaluation rule](mpl-test-vector-enumeration.md#evaluation-rules) is an evaluation rule for ESDK. | ||
|
||
## Representative values | ||
|
||
### Representative frame sizes | ||
|
||
- Non-framed data: `frame size = 0` | ||
- The representative frame size value for non-framed data | ||
MUST have frame size = 0. | ||
- Small frame: `0 < frame size < 4096` | ||
- The representative value for a small frame | ||
MUST have frame size between 0 and 4096. | ||
- Default frame: `frame size = 4096` | ||
- The representative value for the default frame size | ||
MUST have frame size = 4096. | ||
- Large frame: `frame size > 4096` | ||
- The representative value for a large frame | ||
MUST have frame size greater than 4096. | ||
|
||
### Representative plaintext constraints | ||
|
||
#### Framed data | ||
lucasmcdonald3 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
These MUST only be used if `frame size > 0`. | ||
|
||
- Empty: `length = 0` | ||
- The representative plaintext value for empty framed data | ||
MUST have length = 0. | ||
- Small: `0 < length < 10` | ||
- The representative plaintext value for small framed data | ||
MUST have length between 0 and 10. | ||
- If `frame size < 10`, omit this. | ||
- Medium: `10 ≤ length < 1000` | ||
- The representative plaintext value for medium framed data | ||
MUST have length of at least 10 and less than 1000. | ||
- If `frame size < 1000`, omit this. | ||
- Large: `1000 ≤ length <` [frame size](#representative-frame-sizes) | ||
- The representative plaintext value for large framed data | ||
MUST have length of at least 1000 and less than the configured frame size. | ||
- Largest frame: `length = frame size` | ||
- The representative plaintext value for the largest frame | ||
MUST have length equal to the configured frame size. | ||
- Largest frame + partial frame: `frame size < length < 2\*(frame size)` | ||
- The representative plaintext value for a largest frame plus partial frame | ||
MUST have length between the configured frame size | ||
and twice the configured frame size. | ||
- Two largest frames: `length = 2\*(frame size)` | ||
- The representative plaintext value for two largest frames | ||
MUST have length equal to twice the configured frame size. | ||
- Many frames: `2*(frame size) < length < (frame size)\*(maximum # of frames)` | ||
- The representative plaintext value for many frames | ||
MUST have length between twice the configured frame size | ||
and ((the configured maximum number of frames) times (the configured frame size)). | ||
- Maximum frames: `length = (frame size)\*(maximum # of frames)` | ||
- The representative plaintext value for maximum frames | ||
MUST have length equal to the configured maximum number of frames times the configured frame size. | ||
|
||
#### Non-framed data | ||
|
||
These MUST only be used if `frame length = 0`. | ||
|
||
- Empty: `length = 0` | ||
- The representative plaintext value for empty non-framed data | ||
MUST have length equal to 0. | ||
- Small: `0 < length < 10` | ||
- The representative plaintext value for small non-framed data | ||
MUST have length between 0 and 10. | ||
- Medium: `10 ≤ length < 1000` | ||
- The representative plaintext value for empty non-framed data | ||
MUST have length of at least 10 and less than 1000. | ||
- Large: `1000 < length ≤ 2^32` | ||
- The representative plaintext value for empty non-framed data | ||
MUST have length of at least 1000 and less than 2^32. | ||
|
||
### Representative number of maximum encrypted data keys (EDKs) | ||
|
||
- No configured value | ||
- The representative value for no configured maxiumum number of EDKs | ||
MUST be some unset value | ||
that is interpreted as "no maximum value" by the ESDK implementation. | ||
- Zero: `max EDKs = 0` | ||
- The representative value for zero maximum EDKs | ||
MUST have length = 0. | ||
- One: `max EDKs = 1` | ||
- The representative value for one maximum EDK | ||
MUST have length = 1. | ||
- Few: `1 < max EDKs < 10` | ||
- The representative value for few maximum EDKs | ||
MUST have length between 1 and 10. | ||
- Many: `10 ≤ max EDKs` | ||
- The representative value for many maximum EDKs | ||
MUST have length of at least 10. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved." | ||
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0" | ||
|
||
# MPL Test Vector Enumeration | ||
|
||
This document performs the [test vector enumeration](test-vector-enumeration.md) process for the MPL | ||
to construct the full suite of test vectors | ||
for the MPL. | ||
|
||
The full suite of test vectors can be constructed | ||
by [enumerating all input configurations](test-vector-enumeration.md#enumerating-input-configurations) from this spec's input dimensions | ||
and [evaluating each configuration's expected result](test-vector-enumeration.md#determining-expected-results) from this spec's evaluation rules. | ||
|
||
## Input dimensions | ||
|
||
This section enumerates the [input dimensions](../test-vectors/test-vector-enumeration.md#input-dimensions) | ||
for MPL test vectors: | ||
|
||
- algorithm suite ID: Range of supported [Algorithm IDs](../algorithm-suites.md#algorithm-suite-id) | ||
- encryption context: Range of [representative encryption context values](./complete-vectors/encryption-context.md) | ||
- required encryption context keys: Range of every [representative required encryption context key](#representative-required-encryption-context-keys) | ||
- reproduced encryption context: Range is every [representative reproduced encryption context](#representative-reproduced-encryption-context) | ||
- encrypt key description: Range of all [key descriptions](./key-description.md) used to request encrypt materials | ||
- decrypt key description: Range of all [key descriptions](./key-description.md) used to decrypt |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.