You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getting_started: Make it clear that keys are passed in
It was not obvious before that `AES_KEY` and `RSA_KEY` were shorthand
for key material. A user copy pasting the code snippet would run into a
compilation error if they didn't realize this. Make it more obvious that
key material must come from somewhere external by making the snippets
which use global keys into functions that take a key as a parameter.
@@ -151,7 +154,7 @@ This example shows how to sign a hash that has already been calculated:
151
154
psa_set_key_bits(&attributes, 1024);
152
155
153
156
/* Import the key */
154
-
status = psa_import_key(&attributes, key, sizeof(key), &handle);
157
+
status = psa_import_key(&attributes, key, key_len, &handle);
155
158
if (status != PSA_SUCCESS) {
156
159
printf("Failed to import key\n");
157
160
return;
@@ -176,6 +179,7 @@ This example shows how to sign a hash that has already been calculated:
176
179
psa_destroy_key(handle);
177
180
178
181
mbedtls_psa_crypto_free();
182
+
}
179
183
```
180
184
181
185
### Using symmetric ciphers
@@ -196,6 +200,8 @@ Mbed Crypto supports encrypting and decrypting messages using various symmetric
196
200
197
201
This example shows how to encrypt data using an AES (Advanced Encryption Standard) key in CBC (Cipher Block Chaining) mode with no padding (assuming all prerequisites have been fulfilled):
0 commit comments