Skip to content

Use hexadecimal format for opcode values #86

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 1 commit into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ jobs:
name: Build and check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Execute all tests
run: ./tests/ci.sh

links:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Link Checker
uses: peter-evans/link-checker@v1
with:
args: -v -r *.md
- name: Fail if there were link errors
run: exit ${{ steps.lc.outputs.exit_code }}
40 changes: 20 additions & 20 deletions src/requests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,45 +74,45 @@ pub enum BodyType {
#[repr(u32)]
pub enum Opcode {
/// Ping operation
Ping = 1,
Ping = 0x0001,
/// PsaGenerateKey operation
PsaGenerateKey = 2,
PsaGenerateKey = 0x0002,
/// PsaDestroyKey operation
PsaDestroyKey = 3,
PsaDestroyKey = 0x0003,
/// PsaSignHash operation
PsaSignHash = 4,
PsaSignHash = 0x0004,
/// PsaVerifyHash operation
PsaVerifyHash = 5,
PsaVerifyHash = 0x0005,
/// PsaImportKey operation
PsaImportKey = 6,
PsaImportKey = 0x0006,
/// PsaExportPublicKey operation
PsaExportPublicKey = 7,
PsaExportPublicKey = 0x0007,
/// ListProviders operation
ListProviders = 8,
ListProviders = 0x0008,
/// ListOpcodes operation
ListOpcodes = 9,
ListOpcodes = 0x0009,
/// PsaAsymmetricEncrypt operation
PsaAsymmetricEncrypt = 10,
PsaAsymmetricEncrypt = 0x000A,
/// PsaAsymmetricDecrypt operation
PsaAsymmetricDecrypt = 11,
PsaAsymmetricDecrypt = 0x000B,
/// PsaExportKey operation
PsaExportKey = 12,
PsaExportKey = 0x000C,
/// PsaGenerateRandom operation
PsaGenerateRandom = 13,
PsaGenerateRandom = 0x000D,
/// ListAuthenticators operation
ListAuthenticators = 14,
ListAuthenticators = 0x000E,
/// PsaHashCompute operation
PsaHashCompute = 15,
PsaHashCompute = 0x000F,
/// PsaHashCompare operation
PsaHashCompare = 16,
PsaHashCompare = 0x0010,
/// PsaAeadEncrypt
PsaAeadEncrypt = 17,
PsaAeadEncrypt = 0x0011,
/// PsaAeadDecrypt
PsaAeadDecrypt = 18,
PsaAeadDecrypt = 0x0012,
/// PsaRawKeyAgreement operation
PsaRawKeyAgreement = 19,
PsaRawKeyAgreement = 0x0013,
/// ListKeys operations
ListKeys = 26,
ListKeys = 0x001A,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why there's a sudden discontiguous jump from 19 to 26 here? Are we anticipating some missing PSA Crypto operations in the gap?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem as if some of the operations that are in the book aren't added here yet: https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_verify_message.html this is 0x19

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The book contains documentation for all operations (and there are protobuf contracts too), including ones not yet present in Parsec but I had to pick op codes, which is why there is a gap. e.g.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! This looks fine to me, in that case.

}

/// Listing of available authentication methods.
Expand Down