summaryrefslogtreecommitdiff
path: root/meta-arm/meta-arm-bsp/recipes-security/trusted-services/corstone1000/0025-TF-Mv1.7-alignment-Align-crypto-iovec-definition.patch
blob: ecea23640369c2384b320627e3c44a85d8544139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
From a3e203136e7c552069ae582273e0540a219c105f Mon Sep 17 00:00:00 2001
From: Mohamed Omar Asaker <mohamed.omarasaker@arm.com>
Date: Thu, 9 Feb 2023 00:01:06 +0000
Subject: [PATCH 2/3] TF-Mv1.7 alignment: Align crypto iovec definition

This patch is to align psa_ipc_crypto_pack_iovec with TF-M v1.7
And propagate changes accross psa_ipc functions
More accuratly change sfn_id to function_id

Signed-off-by: Mohamed Omar Asaker <mohamed.omarasaker@arm.com>
Upstream-Status: Pending [Not submitted yet]
---
 .../backend/psa_ipc/crypto_ipc_backend.h      | 34 +++++++++----------
 .../caller/psa_ipc/crypto_caller_aead.h       | 24 ++++++-------
 .../crypto_caller_asymmetric_decrypt.h        |  2 +-
 .../crypto_caller_asymmetric_encrypt.h        |  2 +-
 .../caller/psa_ipc/crypto_caller_cipher.h     | 14 ++++----
 .../caller/psa_ipc/crypto_caller_copy_key.h   |  2 +-
 .../psa_ipc/crypto_caller_destroy_key.h       |  2 +-
 .../caller/psa_ipc/crypto_caller_export_key.h |  2 +-
 .../psa_ipc/crypto_caller_export_public_key.h |  2 +-
 .../psa_ipc/crypto_caller_generate_key.h      |  2 +-
 .../psa_ipc/crypto_caller_generate_random.h   |  2 +-
 .../crypto_caller_get_key_attributes.h        |  2 +-
 .../caller/psa_ipc/crypto_caller_hash.h       | 12 +++----
 .../caller/psa_ipc/crypto_caller_import_key.h |  2 +-
 .../psa_ipc/crypto_caller_key_derivation.h    | 20 +++++------
 .../client/caller/psa_ipc/crypto_caller_mac.h | 12 +++----
 .../caller/psa_ipc/crypto_caller_purge_key.h  |  2 +-
 .../caller/psa_ipc/crypto_caller_sign_hash.h  |  4 +--
 .../psa_ipc/crypto_caller_verify_hash.h       |  4 +--
 19 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/components/service/crypto/backend/psa_ipc/crypto_ipc_backend.h b/components/service/crypto/backend/psa_ipc/crypto_ipc_backend.h
index ec25eaf8..aacd3fcc 100644
--- a/components/service/crypto/backend/psa_ipc/crypto_ipc_backend.h
+++ b/components/service/crypto/backend/psa_ipc/crypto_ipc_backend.h
@@ -28,23 +28,23 @@ struct psa_ipc_crypto_aead_pack_input {
 };
 
 struct psa_ipc_crypto_pack_iovec {
-	uint32_t sfn_id;             /*!< Secure function ID used to dispatch the
-				      *   request
-				      */
-	uint16_t step;               /*!< Key derivation step */
-	psa_key_id_t key_id;         /*!< Key id */
-	psa_algorithm_t alg;         /*!< Algorithm */
-	uint32_t op_handle;          /*!< Frontend context handle associated to a
-				      *   multipart operation
-				      */
-	uint32_t capacity;             /*!< Key derivation capacity */
-	uint32_t ad_length;            /*!< Additional Data length for multipart AEAD */
-	uint32_t plaintext_length;     /*!< Plaintext length for multipart AEAD */
-	struct psa_ipc_crypto_aead_pack_input aead_in; /*!< FixMe: Temporarily used for
-							    *   AEAD until the API is
-							    *   restructured
-							    */
-};
+    psa_key_id_t key_id;     /*!< Key id */
+    psa_algorithm_t alg;     /*!< Algorithm */
+    uint32_t op_handle;      /*!< Frontend context handle associated to a
+                              *   multipart operation
+                              */
+    uint32_t capacity;         /*!< Key derivation capacity */
+    uint32_t ad_length;        /*!< Additional Data length for multipart AEAD */
+    uint32_t plaintext_length; /*!< Plaintext length for multipart AEAD */
+
+    struct psa_ipc_crypto_aead_pack_input aead_in; /*!< Packs AEAD-related inputs */
+
+    uint16_t function_id;    /*!< Used to identify the function in the
+                              *   API dispatcher to the service backend
+                              *   See tfm_crypto_func_sid for detail
+                              */
+    uint16_t step;           /*!< Key derivation step */
+}__packed;
 
 #define iov_size sizeof(struct psa_ipc_crypto_pack_iovec)
 
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h
index f6aadd8b..efdffdf7 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h
@@ -44,7 +44,7 @@ static inline psa_status_t crypto_caller_aead_encrypt(
 	size_t in_len;
 	int i;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_AEAD_ENCRYPT_SID,
+		.function_id = TFM_CRYPTO_AEAD_ENCRYPT_SID,
 		.key_id = key,
 		.alg = alg,
 		.aead_in = { .nonce = {0}, .nonce_length = nonce_length },
@@ -105,7 +105,7 @@ static inline psa_status_t crypto_caller_aead_decrypt(
 	size_t in_len;
 	int i;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_AEAD_DECRYPT_SID,
+		.function_id = TFM_CRYPTO_AEAD_DECRYPT_SID,
 		.key_id = key,
 		.alg = alg,
 		.aead_in = { .nonce = {0}, .nonce_length = nonce_length },
@@ -156,7 +156,7 @@ static inline psa_status_t crypto_caller_aead_encrypt_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_ENCRYPT_SETUP_SID,
+	    .function_id = TFM_CRYPTO_AEAD_ENCRYPT_SETUP_SID,
 	    .key_id = key,
 	    .alg = alg,
 	    .op_handle = (*op_handle),
@@ -185,7 +185,7 @@ static inline psa_status_t crypto_caller_aead_decrypt_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_DECRYPT_SETUP_SID,
+	    .function_id = TFM_CRYPTO_AEAD_DECRYPT_SETUP_SID,
 	    .key_id = key,
 	    .alg = alg,
 	    .op_handle = (*op_handle),
@@ -214,7 +214,7 @@ static inline psa_status_t crypto_caller_aead_generate_nonce(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_GENERATE_NONCE_SID,
+	    .function_id = TFM_CRYPTO_AEAD_GENERATE_NONCE_SID,
 	    .op_handle = op_handle,
 	};
 
@@ -243,7 +243,7 @@ static inline psa_status_t crypto_caller_aead_set_nonce(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_SET_NONCE_SID,
+	    .function_id = TFM_CRYPTO_AEAD_SET_NONCE_SID,
 	    .op_handle = op_handle,
 	};
 
@@ -270,7 +270,7 @@ static inline psa_status_t crypto_caller_aead_set_lengths(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_SET_LENGTHS_SID,
+	    .function_id = TFM_CRYPTO_AEAD_SET_LENGTHS_SID,
 	    .ad_length = ad_length,
 	    .plaintext_length = plaintext_length,
 	    .op_handle = op_handle,
@@ -299,7 +299,7 @@ static inline psa_status_t crypto_caller_aead_update_ad(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_UPDATE_AD_SID,
+	    .function_id = TFM_CRYPTO_AEAD_UPDATE_AD_SID,
 	    .op_handle = op_handle,
 	};
 
@@ -339,7 +339,7 @@ static inline psa_status_t crypto_caller_aead_update(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_UPDATE_SID,
+	    .function_id = TFM_CRYPTO_AEAD_UPDATE_SID,
 	    .op_handle = op_handle,
 	};
 
@@ -383,7 +383,7 @@ static inline psa_status_t crypto_caller_aead_finish(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_FINISH_SID,
+	    .function_id = TFM_CRYPTO_AEAD_FINISH_SID,
 	    .op_handle = op_handle,
 	};
 
@@ -436,7 +436,7 @@ static inline psa_status_t crypto_caller_aead_verify(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_VERIFY_SID,
+	    .function_id = TFM_CRYPTO_AEAD_VERIFY_SID,
 	    .op_handle = op_handle,
 	};
 
@@ -482,7 +482,7 @@ static inline psa_status_t crypto_caller_aead_abort(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-	    .sfn_id = TFM_CRYPTO_AEAD_ABORT_SID,
+	    .function_id = TFM_CRYPTO_AEAD_ABORT_SID,
 	    .op_handle = op_handle,
 	};
 
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h
index ff01815c..c387eb55 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h
@@ -38,7 +38,7 @@ static inline psa_status_t crypto_caller_asymmetric_decrypt(
 	psa_status_t status;
 	size_t in_len;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_ASYMMETRIC_DECRYPT_SID,
+		.function_id = TFM_CRYPTO_ASYMMETRIC_DECRYPT_SID,
 		.key_id = id,
 		.alg = alg,
 	};
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h
index 1daf1689..8eb3de45 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h
@@ -38,7 +38,7 @@ static inline psa_status_t crypto_caller_asymmetric_encrypt(
 	psa_status_t status;
 	size_t in_len;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_ASYMMETRIC_ENCRYPT_SID,
+		.function_id = TFM_CRYPTO_ASYMMETRIC_ENCRYPT_SID,
 		.key_id = id,
 		.alg = alg,
 	};
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h
index fbefb28d..20aa46a5 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h
@@ -34,7 +34,7 @@ static inline psa_status_t crypto_caller_cipher_encrypt_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_CIPHER_ENCRYPT_SETUP_SID,
+		.function_id = TFM_CRYPTO_CIPHER_ENCRYPT_SETUP_SID,
 		.key_id = key,
 		.alg = alg,
 		.op_handle = *op_handle,
@@ -62,7 +62,7 @@ static inline psa_status_t crypto_caller_cipher_decrypt_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_CIPHER_DECRYPT_SETUP_SID,
+		.function_id = TFM_CRYPTO_CIPHER_DECRYPT_SETUP_SID,
 		.key_id = key,
 		.alg = alg,
 		.op_handle = *op_handle,
@@ -91,7 +91,7 @@ static inline psa_status_t crypto_caller_cipher_generate_iv(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_CIPHER_GENERATE_IV_SID,
+		.function_id = TFM_CRYPTO_CIPHER_GENERATE_IV_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -120,7 +120,7 @@ static inline psa_status_t crypto_caller_cipher_set_iv(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_CIPHER_SET_IV_SID,
+		.function_id = TFM_CRYPTO_CIPHER_SET_IV_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -150,7 +150,7 @@ static inline psa_status_t crypto_caller_cipher_update(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_CIPHER_UPDATE_SID,
+		.function_id = TFM_CRYPTO_CIPHER_UPDATE_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -181,7 +181,7 @@ static inline psa_status_t crypto_caller_cipher_finish(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_CIPHER_FINISH_SID,
+		.function_id = TFM_CRYPTO_CIPHER_FINISH_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -208,7 +208,7 @@ static inline psa_status_t crypto_caller_cipher_abort(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_CIPHER_ABORT_SID,
+		.function_id = TFM_CRYPTO_CIPHER_ABORT_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h
index 9a988171..48157d7e 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h
@@ -33,7 +33,7 @@ static inline psa_status_t crypto_caller_copy_key(struct service_client *context
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_COPY_KEY_SID,
+		.function_id = TFM_CRYPTO_COPY_KEY_SID,
 		.key_id = source_key,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h
index d00f4faa..6d0a05e6 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h
@@ -31,7 +31,7 @@ static inline psa_status_t crypto_caller_destroy_key(struct service_client *cont
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_DESTROY_KEY_SID,
+		.function_id = TFM_CRYPTO_DESTROY_KEY_SID,
 		.key_id = id,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h
index 8ac5477f..9a6b7013 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h
@@ -34,7 +34,7 @@ static inline psa_status_t crypto_caller_export_key(struct service_client *conte
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_EXPORT_KEY_SID,
+		.function_id = TFM_CRYPTO_EXPORT_KEY_SID,
 		.key_id = id,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h
index b24c47f1..52bdd757 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h
@@ -34,7 +34,7 @@ static inline psa_status_t crypto_caller_export_public_key(struct service_client
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_EXPORT_PUBLIC_KEY_SID,
+		.function_id = TFM_CRYPTO_EXPORT_PUBLIC_KEY_SID,
 		.key_id = id,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h
index 1b66ed40..7ed1673b 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h
@@ -32,7 +32,7 @@ static inline psa_status_t crypto_caller_generate_key(struct service_client *con
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_GENERATE_KEY_SID,
+		.function_id = TFM_CRYPTO_GENERATE_KEY_SID,
 	};
 	struct psa_invec in_vec[] = {
 		{ .base = psa_ptr_to_u32(&iov), .len = sizeof(struct psa_ipc_crypto_pack_iovec) },
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h
index 7c538237..4fb87aa8 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h
@@ -32,7 +32,7 @@ static inline psa_status_t crypto_caller_generate_random(struct service_client *
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_GENERATE_RANDOM_SID,
+		.function_id = TFM_CRYPTO_GENERATE_RANDOM_SID,
 	};
 	struct psa_invec in_vec[] = {
 		{ .base = psa_ptr_to_u32(&iov), .len = sizeof(struct psa_ipc_crypto_pack_iovec) },
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h
index 22f1d18f..2caa3bd3 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h
@@ -33,7 +33,7 @@ static inline psa_status_t crypto_caller_get_key_attributes(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_GET_KEY_ATTRIBUTES_SID,
+		.function_id = TFM_CRYPTO_GET_KEY_ATTRIBUTES_SID,
 		.key_id = key,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h
index 9f37908a..4fb60d44 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h
@@ -33,7 +33,7 @@ static inline psa_status_t crypto_caller_hash_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_HASH_SETUP_SID,
+		.function_id = TFM_CRYPTO_HASH_SETUP_SID,
 		.alg = alg,
 		.op_handle = *op_handle,
 	};
@@ -60,7 +60,7 @@ static inline psa_status_t crypto_caller_hash_update(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_HASH_UPDATE_SID,
+		.function_id = TFM_CRYPTO_HASH_UPDATE_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -88,7 +88,7 @@ static inline psa_status_t crypto_caller_hash_finish(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_HASH_FINISH_SID,
+		.function_id = TFM_CRYPTO_HASH_FINISH_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -115,7 +115,7 @@ static inline psa_status_t crypto_caller_hash_abort(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_HASH_ABORT_SID,
+		.function_id = TFM_CRYPTO_HASH_ABORT_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -141,7 +141,7 @@ static inline psa_status_t crypto_caller_hash_verify(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_HASH_VERIFY_SID,
+		.function_id = TFM_CRYPTO_HASH_VERIFY_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -167,7 +167,7 @@ static inline psa_status_t crypto_caller_hash_clone(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_HASH_CLONE_SID,
+		.function_id = TFM_CRYPTO_HASH_CLONE_SID,
 		.op_handle = source_op_handle,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h
index d4703366..1458163c 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h
@@ -33,7 +33,7 @@ static inline psa_status_t crypto_caller_import_key(struct service_client *conte
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_IMPORT_KEY_SID,
+		.function_id = TFM_CRYPTO_IMPORT_KEY_SID,
 	};
 	struct psa_invec in_vec[] = {
 		{ .base = psa_ptr_to_u32(&iov), .len = sizeof(struct psa_ipc_crypto_pack_iovec) },
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h
index 5ce4fb6c..16be9916 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h
@@ -33,7 +33,7 @@ static inline psa_status_t crypto_caller_key_derivation_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_SETUP_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_SETUP_SID,
 		.alg = alg,
 		.op_handle = *op_handle,
 	};
@@ -59,7 +59,7 @@ static inline psa_status_t crypto_caller_key_derivation_get_capacity(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_GET_CAPACITY_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_GET_CAPACITY_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -84,7 +84,7 @@ static inline psa_status_t crypto_caller_key_derivation_set_capacity(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_SET_CAPACITY_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_SET_CAPACITY_SID,
 		.capacity = capacity,
 		.op_handle = op_handle,
 	};
@@ -109,7 +109,7 @@ static inline psa_status_t crypto_caller_key_derivation_input_bytes(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_INPUT_BYTES_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_INPUT_BYTES_SID,
 		.step = step,
 		.op_handle = op_handle,
 	};
@@ -134,7 +134,7 @@ static inline psa_status_t crypto_caller_key_derivation_input_key(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_INPUT_KEY_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_INPUT_KEY_SID,
 		.key_id = key,
 		.step = step,
 		.op_handle = op_handle,
@@ -159,7 +159,7 @@ static inline psa_status_t crypto_caller_key_derivation_output_bytes(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_OUTPUT_BYTES_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_OUTPUT_BYTES_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -185,7 +185,7 @@ static inline psa_status_t crypto_caller_key_derivation_output_key(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_OUTPUT_KEY_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_OUTPUT_KEY_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -211,7 +211,7 @@ static inline psa_status_t crypto_caller_key_derivation_abort(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_ABORT_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_ABORT_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -239,7 +239,7 @@ static inline psa_status_t crypto_caller_key_derivation_key_agreement(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_KEY_DERIVATION_KEY_AGREEMENT_SID,
+		.function_id = TFM_CRYPTO_KEY_DERIVATION_KEY_AGREEMENT_SID,
 		.key_id = private_key,
 		.step = step,
 		.op_handle = op_handle,
@@ -270,7 +270,7 @@ static inline psa_status_t crypto_caller_raw_key_agreement(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_RAW_KEY_AGREEMENT_SID,
+		.function_id = TFM_CRYPTO_RAW_KEY_AGREEMENT_SID,
 		.alg = alg,
 		.key_id = private_key,
 	};
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h
index 3a820192..30222800 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h
@@ -34,7 +34,7 @@ static inline psa_status_t crypto_caller_mac_sign_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_MAC_SIGN_SETUP_SID,
+		.function_id = TFM_CRYPTO_MAC_SIGN_SETUP_SID,
 		.key_id = key,
 		.alg = alg,
 		.op_handle = *op_handle,
@@ -62,7 +62,7 @@ static inline psa_status_t crypto_caller_mac_verify_setup(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_MAC_VERIFY_SETUP_SID,
+		.function_id = TFM_CRYPTO_MAC_VERIFY_SETUP_SID,
 		.key_id = key,
 		.alg = alg,
 		.op_handle = *op_handle,
@@ -90,7 +90,7 @@ static inline psa_status_t crypto_caller_mac_update(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_MAC_UPDATE_SID,
+		.function_id = TFM_CRYPTO_MAC_UPDATE_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -118,7 +118,7 @@ static inline psa_status_t crypto_caller_mac_sign_finish(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_MAC_SIGN_FINISH_SID,
+		.function_id = TFM_CRYPTO_MAC_SIGN_FINISH_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -147,7 +147,7 @@ static inline psa_status_t crypto_caller_mac_verify_finish(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_MAC_VERIFY_FINISH_SID,
+		.function_id = TFM_CRYPTO_MAC_VERIFY_FINISH_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
@@ -172,7 +172,7 @@ static inline psa_status_t crypto_caller_mac_abort(
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_MAC_ABORT_SID,
+		.function_id = TFM_CRYPTO_MAC_ABORT_SID,
 		.op_handle = op_handle,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h
index a3a796e2..f6ab0978 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h
@@ -31,7 +31,7 @@ static inline psa_status_t crypto_caller_purge_key(struct service_client *contex
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_PURGE_KEY_SID,
+		.function_id = TFM_CRYPTO_PURGE_KEY_SID,
 		.key_id = id,
 	};
 	struct psa_invec in_vec[] = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h
index 9276748d..8b53e3dc 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h
@@ -37,7 +37,7 @@ static inline psa_status_t crypto_caller_sign_hash(struct service_client *contex
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_ASYMMETRIC_SIGN_HASH_SID,
+		.function_id = TFM_CRYPTO_ASYMMETRIC_SIGN_HASH_SID,
 		.key_id = id,
 		.alg = alg,
 	};
@@ -70,7 +70,7 @@ static inline psa_status_t crypto_caller_sign_message(struct service_client *con
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = TFM_CRYPTO_ASYMMETRIC_SIGN_MESSAGE_SID,
+		.function_id = TFM_CRYPTO_ASYMMETRIC_SIGN_MESSAGE_SID,
 		.key_id = id,
 		.alg = alg,
 	};
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h
index bcd8e0e4..c9ed865b 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h
@@ -31,13 +31,13 @@ static inline psa_status_t crypto_caller_common(struct service_client *context,
 						     size_t hash_length,
 						     const uint8_t *signature,
 						     size_t signature_length,
-						     uint32_t sfn_id)
+						     uint32_t function_id)
 {
 	struct service_client *ipc = context;
 	struct rpc_caller *caller = ipc->caller;
 	psa_status_t status;
 	struct psa_ipc_crypto_pack_iovec iov = {
-		.sfn_id = sfn_id,
+		.function_id = function_id,
 		.key_id = id,
 		.alg = alg,
 	};
-- 
2.25.1