Skip to content

Commit d2814b0

Browse files
authored
Merge pull request parallaxsecond#212 from puiterwijk/mbed-opcodes
Add Asymmetric Encrypt/Decrypt to mbed supported opcodes
2 parents 47296bb + ceb48f0 commit d2814b0

File tree

2 files changed

+8
-2
lines changed
  • e2e_tests/tests/all_providers
  • src/providers/mbed_provider

2 files changed

+8
-2
lines changed

e2e_tests/tests/all_providers/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ fn list_opcodes() {
3434
let _ = crypto_providers_opcodes.insert(Opcode::PsaImportKey);
3535
let _ = crypto_providers_opcodes.insert(Opcode::PsaExportPublicKey);
3636

37+
let mut crypto_providers_inc_encrypt_opcodes = crypto_providers_opcodes.clone();
38+
let _ = crypto_providers_inc_encrypt_opcodes.insert(Opcode::PsaAsymmetricDecrypt);
39+
let _ = crypto_providers_inc_encrypt_opcodes.insert(Opcode::PsaAsymmetricEncrypt);
40+
3741
let _ = core_provider_opcodes.insert(Opcode::Ping);
3842
let _ = core_provider_opcodes.insert(Opcode::ListProviders);
3943
let _ = core_provider_opcodes.insert(Opcode::ListOpcodes);
@@ -60,7 +64,7 @@ fn list_opcodes() {
6064
client
6165
.list_opcodes(ProviderID::MbedCrypto)
6266
.expect("list providers failed"),
63-
crypto_providers_opcodes
67+
crypto_providers_inc_encrypt_opcodes
6468
);
6569
}
6670

src/providers/mbed_provider/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ mod asym_sign;
2525
#[allow(dead_code)]
2626
mod key_management;
2727

28-
const SUPPORTED_OPCODES: [Opcode; 6] = [
28+
const SUPPORTED_OPCODES: [Opcode; 8] = [
2929
Opcode::PsaGenerateKey,
3030
Opcode::PsaDestroyKey,
3131
Opcode::PsaSignHash,
3232
Opcode::PsaVerifyHash,
3333
Opcode::PsaImportKey,
3434
Opcode::PsaExportPublicKey,
35+
Opcode::PsaAsymmetricDecrypt,
36+
Opcode::PsaAsymmetricEncrypt,
3537
];
3638

3739
#[derive(Derivative)]

0 commit comments

Comments
 (0)