Skip to content

Commit 450546a

Browse files
Declare more stream ciphers
Declare ciphers from the eSTREAM portfolio and ZUC.
1 parent 3836254 commit 450546a

File tree

2 files changed

+112
-4
lines changed

2 files changed

+112
-4
lines changed

include/psa/crypto_values.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,38 @@
430430
*/
431431
#define PSA_KEY_TYPE_CHACHA20 ((psa_key_type_t)0x2004)
432432

433+
/** Key for the Salsa20/12 stream cipher.
434+
*/
435+
#define PSA_KEY_TYPE_SALSA20_12 ((psa_key_type_t)0x2007)
436+
437+
/** Key for the HC-128 or HC-256 stream cipher algorithm.
438+
*/
439+
#define PSA_KEY_TYPE_HC ((psa_key_type_t)0x2008)
440+
441+
/** Key for the Rabbit stream cipher algorithm.
442+
*/
443+
#define PSA_KEY_TYPE_RABBIT ((psa_key_type_t)0x200b)
444+
445+
/** Key for the SOSEMANUK stream cipher algorithm.
446+
*/
447+
#define PSA_KEY_TYPE_SOSEMANUK ((psa_key_type_t)0x200d)
448+
449+
/** Key for the Grain v1 stream cipher algorithm.
450+
*/
451+
#define PSA_KEY_TYPE_GRAIN ((psa_key_type_t)0x200e)
452+
453+
/** Key for the MICKEY 2.0 stream cipher algorithm.
454+
*/
455+
#define PSA_KEY_TYPE_MICKEY_2 ((psa_key_type_t)0x2010)
456+
457+
/** Key for the Trivium stream cipher algorithm.
458+
*/
459+
#define PSA_KEY_TYPE_TRIVIUM ((psa_key_type_t)0x2013)
460+
461+
/** Key for the ZUC stream cipher.
462+
*/
463+
#define PSA_KEY_TYPE_ZUC ((psa_key_type_t)0x2015)
464+
433465
/** RSA public key. */
434466
#define PSA_KEY_TYPE_RSA_PUBLIC_KEY ((psa_key_type_t)0x4001)
435467
/** RSA key pair (private and public key). */
@@ -988,6 +1020,38 @@
9881020
*/
9891021
#define PSA_ALG_CHACHA20 ((psa_algorithm_t)0x04800004)
9901022

1023+
/** The Salsa20/12 stream cipher algorithm.
1024+
*/
1025+
#define PSA_ALG_SALSA20_12 ((psa_algorithm_t)0x04800007)
1026+
1027+
/** The HC-128 and HC-256 stream cipher algorithms.
1028+
*/
1029+
#define PSA_ALG_HC ((psa_algorithm_t)0x04800008)
1030+
1031+
/** The Rabbit stream cipher algorithm.
1032+
*/
1033+
#define PSA_ALG_RABBIT ((psa_algorithm_t)0x0480000b)
1034+
1035+
/** The SOSEMANUK stream cipher algorithm.
1036+
*/
1037+
#define PSA_ALG_SOSEMANUK ((psa_algorithm_t)0x0480000d)
1038+
1039+
/** The Grain v1 stream cipher algorithm.
1040+
*/
1041+
#define PSA_ALG_GRAIN ((psa_algorithm_t)0x0480000e)
1042+
1043+
/** The MICKEY 2.0 stream cipher algorithm.
1044+
*/
1045+
#define PSA_ALG_MICKEY_2 ((psa_algorithm_t)0x04800010)
1046+
1047+
/** The Trivium stream cipher algorithm.
1048+
*/
1049+
#define PSA_ALG_TRIVIUM ((psa_algorithm_t)0x04800013)
1050+
1051+
/** The ZUC stream cipher algorithm.
1052+
*/
1053+
#define PSA_ALG_ZUC ((psa_algorithm_t)0x04800015)
1054+
9911055
/** The CTR stream cipher mode.
9921056
*
9931057
* CTR is a stream cipher which is built from a block cipher.

tests/suites/test_suite_psa_crypto_metadata.data

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,35 @@ depends_on:MBEDTLS_BLOWFISH_C:MBEDTLS_CMAC_C
163163
mac_algorithm:PSA_ALG_CMAC:ALG_IS_BLOCK_CIPHER_MAC:8:PSA_KEY_TYPE_BLOWFISH:128
164164

165165
Cipher: ARC4
166-
depends_on:MBEDTLS_ARC4_C
167166
cipher_algorithm:PSA_ALG_ARC4:ALG_IS_STREAM_CIPHER
168167

169168
Cipher: ChaCha20
170-
depends_on:MBEDTLS_CHACHA_C
171169
cipher_algorithm:PSA_ALG_CHACHA20:ALG_IS_STREAM_CIPHER
172170

171+
Cipher: Salsa20/12
172+
cipher_algorithm:PSA_ALG_SALSA20_12:ALG_IS_STREAM_CIPHER
173+
174+
Cipher: HC-128 or HC-256
175+
cipher_algorithm:PSA_ALG_HC:ALG_IS_STREAM_CIPHER
176+
177+
Cipher: Rabbit
178+
cipher_algorithm:PSA_ALG_RABBIT:ALG_IS_STREAM_CIPHER
179+
180+
Cipher: SOSEMANUK
181+
cipher_algorithm:PSA_ALG_SOSEMANUK:ALG_IS_STREAM_CIPHER
182+
183+
Cipher: Grain v1
184+
cipher_algorithm:PSA_ALG_GRAIN:ALG_IS_STREAM_CIPHER
185+
186+
Cipher: MICKEY 2.0
187+
cipher_algorithm:PSA_ALG_MICKEY_2:ALG_IS_STREAM_CIPHER
188+
189+
Cipher: TRIVIUM
190+
cipher_algorithm:PSA_ALG_TRIVIUM:ALG_IS_STREAM_CIPHER
191+
192+
Cipher: ZUC
193+
cipher_algorithm:PSA_ALG_ZUC:ALG_IS_STREAM_CIPHER
194+
173195
Cipher: CTR
174196
depends_on:MBEDTLS_CIPHER_C:MBEDTLS_CIPHER_MODE_CTR
175197
cipher_algorithm:PSA_ALG_CTR:ALG_IS_STREAM_CIPHER
@@ -360,13 +382,35 @@ depends_on:MBEDTLS_SM4_C
360382
block_cipher_key_type:PSA_KEY_TYPE_SM4:16
361383

362384
Stream cipher key type: ARC4
363-
depends_on:MBEDTLS_ARC4_C
364385
stream_cipher_key_type:PSA_KEY_TYPE_ARC4
365386

366387
Stream cipher key type: ChaCha20
367-
depends_on:MBEDTLS_CHACHA20_C
368388
stream_cipher_key_type:PSA_KEY_TYPE_CHACHA20
369389

390+
Stream cipher key type: Salsa20/12
391+
stream_cipher_key_type:PSA_KEY_TYPE_SALSA20_12
392+
393+
Stream cipher key type: HC-128 or HC-256
394+
stream_cipher_key_type:PSA_KEY_TYPE_HC
395+
396+
Stream cipher key type: Rabbit
397+
stream_cipher_key_type:PSA_KEY_TYPE_RABBIT
398+
399+
Stream cipher key type: SOSEMANUK
400+
stream_cipher_key_type:PSA_KEY_TYPE_SOSEMANUK
401+
402+
Stream cipher key type: MICKEY 2.0
403+
stream_cipher_key_type:PSA_KEY_TYPE_MICKEY_2
404+
405+
Stream cipher key type: Grain v1
406+
stream_cipher_key_type:PSA_KEY_TYPE_GRAIN
407+
408+
Stream cipher key type: Trivium
409+
stream_cipher_key_type:PSA_KEY_TYPE_TRIVIUM
410+
411+
Stream cipher key type: ZUC
412+
stream_cipher_key_type:PSA_KEY_TYPE_ZUC
413+
370414
Key type: RSA public key
371415
depends_on:MBEDTLS_RSA_C
372416
key_type:PSA_KEY_TYPE_RSA_PUBLIC_KEY:KEY_TYPE_IS_PUBLIC_KEY | KEY_TYPE_IS_RSA

0 commit comments

Comments
 (0)