Skip to content

Commit 25d2b43

Browse files
Declare more algorithms from Mbed TLS
No implementation or tests, just the declaration of key types and algorithms.
1 parent bf90ac8 commit 25d2b43

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

include/psa/crypto_values.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,23 @@
394394
*/
395395
#define PSA_KEY_TYPE_DES ((psa_key_type_t)0x2301)
396396

397+
/** Key for a cipher or MAC algorithm based on Blowfish.
398+
*
399+
* The size of the key can be 4 to 56 bytes.
400+
*
401+
* Note that Blowfish is weak and deprecated and should only be used in
402+
* legacy protocols.
403+
*/
404+
#define PSA_KEY_TYPE_BLOWFISH ((psa_key_type_t)0x2302)
405+
397406
/** Key for a cipher, AEAD or MAC algorithm based on the
398407
* Camellia block cipher. */
399408
#define PSA_KEY_TYPE_CAMELLIA ((psa_key_type_t)0x2403)
400409

410+
/** Key for a cipher, AEAD or MAC algorithm based on the
411+
* ARIA block cipher. */
412+
#define PSA_KEY_TYPE_ARIA ((psa_key_type_t)0x2405)
413+
401414
/** Key for the RC4 stream cipher.
402415
*
403416
* Note that RC4 is weak and deprecated and should only be used in
@@ -568,14 +581,22 @@
568581
((type) & PSA_KEY_TYPE_DH_GROUP_MASK) : \
569582
0))
570583

571-
/** Diffie-Hellman groups defined in RFC 7919 Appendix A.
584+
/** Diffie-Hellman FFDHE groups defined in RFC 7919 Appendix A.
572585
*
573586
* This family includes groups with the following key sizes (in bits):
574587
* 2048, 3072, 4096, 6144, 8192. A given implementation may support
575588
* all of these sizes or only a subet.
576589
*/
577590
#define PSA_DH_GROUP_RFC7919 ((psa_dh_group_t) 0x03)
578591

592+
/** Diffie-Hellman MODP groups defined in RFC 3526.
593+
*
594+
* This family includes groups with the following key sizes (in bits):
595+
* 2048, 3072, 4096. A given implementation may support
596+
* all of these sizes or only a subet.
597+
*/
598+
#define PSA_DH_GROUP_RFC3526 ((psa_dh_group_t) 0x05)
599+
579600
#define PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT(type) \
580601
(((type) >> 8) & 7)
581602
/** The block size of a block cipher.

tests/suites/test_suite_psa_crypto_metadata.data

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ MAC: CBC_MAC-3DES
134134
depends_on:MBEDTLS_DES_C:MBEDTLS_CIPHER_C
135135
mac_algorithm:PSA_ALG_CBC_MAC:ALG_IS_BLOCK_CIPHER_MAC:8:PSA_KEY_TYPE_DES:192
136136

137+
MAC: CBC_MAC-Blowfish
138+
depends_on:MBEDTLS_BLOWFISH_C:MBEDTLS_CIPHER_C
139+
mac_algorithm:PSA_ALG_CBC_MAC:ALG_IS_BLOCK_CIPHER_MAC:8:PSA_KEY_TYPE_BLOWFISH:128
140+
137141
MAC: CMAC-AES-128
138142
depends_on:MBEDTLS_AES_C:MBEDTLS_CMAC_C
139143
mac_algorithm:PSA_ALG_CMAC:ALG_IS_BLOCK_CIPHER_MAC:16:PSA_KEY_TYPE_AES:128
@@ -150,6 +154,10 @@ MAC: CMAC-3DES
150154
depends_on:MBEDTLS_DES_C:MBEDTLS_CMAC_C
151155
mac_algorithm:PSA_ALG_CMAC:ALG_IS_BLOCK_CIPHER_MAC:8:PSA_KEY_TYPE_DES:192
152156

157+
MAC: CMAC-Blowfish
158+
depends_on:MBEDTLS_BLOWFISH_C:MBEDTLS_CMAC_C
159+
mac_algorithm:PSA_ALG_CMAC:ALG_IS_BLOCK_CIPHER_MAC:8:PSA_KEY_TYPE_BLOWFISH:128
160+
153161
Cipher: ARC4
154162
depends_on:MBEDTLS_ARC4_C
155163
cipher_algorithm:PSA_ALG_ARC4:ALG_IS_STREAM_CIPHER
@@ -323,10 +331,18 @@ Block cipher key type: DES
323331
depends_on:MBEDTLS_DES_C
324332
block_cipher_key_type:PSA_KEY_TYPE_DES:8
325333

334+
Block cipher key type: Blowfish
335+
depends_on:MBEDTLS_BLOWFISH_C
336+
block_cipher_key_type:PSA_KEY_TYPE_BLOWFISH:8
337+
326338
Block cipher key type: Camellia
327339
depends_on:MBEDTLS_CAMELLIA_C
328340
block_cipher_key_type:PSA_KEY_TYPE_CAMELLIA:16
329341

342+
Block cipher key type: ARIA
343+
depends_on:MBEDTLS_ARIA_C
344+
block_cipher_key_type:PSA_KEY_TYPE_ARIA:16
345+
330346
Stream cipher key type: ARC4
331347
depends_on:MBEDTLS_ARC4_C
332348
stream_cipher_key_type:PSA_KEY_TYPE_ARC4
@@ -377,3 +393,6 @@ ecc_key_family:PSA_ECC_CURVE_XED
377393

378394
DH group family: RFC 7919
379395
dh_key_family:PSA_DH_GROUP_RFC7919
396+
397+
DH group family: RFC 3526
398+
dh_key_family:PSA_DH_GROUP_RFC3526

0 commit comments

Comments
 (0)