-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add support for AES encryption/decryption #64
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4a8ca03
Implement AES key import
sosthene-nitrokey 07ef776
Add support for AES decipher
sosthene-nitrokey 76c4b8a
Implement PSO:ENCIPHER
sosthene-nitrokey 5a30758
Remove unimplemented error
sosthene-nitrokey 7b92f8e
Add tests and fix response formatting
sosthene-nitrokey 3da97f5
Use non zero key in tests
sosthene-nitrokey d17b1d2
Improve flexibility of command_responce tests using a serialized format
sosthene-nitrokey 305e5de
Update changelog
sosthene-nitrokey 7e88017
Fix typo
sosthene-nitrokey 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 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 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 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 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 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 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 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,40 @@ | ||
// Copyright (C) 2022 Nitrokey GmbH | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
[ | ||
IoTest( | ||
name: "GET CHALLENGE", | ||
cmd_resp: [ | ||
IoData( | ||
input: "00 84 0000 0A", | ||
output: And([NonZero, Len(0x0A)]) | ||
), | ||
IoData( | ||
input: "00 84 0000 00 0400", | ||
output: And([NonZero, Len(0x0400)]) | ||
) | ||
] | ||
), | ||
IoTest( | ||
name: "AES", | ||
cmd_resp: [ | ||
// Verify Admin Pin | ||
IoData(input: "00200083 08 3132333435363738"), | ||
// Verify User Pin | ||
IoData(input: "00200082 06 313233343536"), | ||
// Set aes key | ||
IoData(input: "0C DA 00D5 20 FFEEDDCCBBAA00998877665544332211FFEEDDCCBBAA00998877665544332211"), | ||
// Encrypt with AES | ||
IoData( | ||
input: "00 2A 86 80 10 00112233445566778899AABBCCDDEEFF 00", | ||
output: Data("02 d9d2ca17e160427aee649db6912dbfad"), | ||
), | ||
// Decrypt with AES | ||
IoData( | ||
input: "00 2A 80 86 11 02 d9d2ca17e160427aee649db6912dbfad 00", | ||
output: Data("00112233445566778899AABBCCDDEEFF"), | ||
), | ||
|
||
] | ||
) | ||
] |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ensipher/encipher/