@@ -38,6 +38,7 @@ enum cipher_mode {
38
38
CRYPTO_CIPHER_MODE_CBC = 2 ,
39
39
CRYPTO_CIPHER_MODE_CTR = 3 ,
40
40
CRYPTO_CIPHER_MODE_CCM = 4 ,
41
+ CRYPTO_CIPHER_MODE_GCM = 5 ,
41
42
};
42
43
43
44
/* Forward declarations */
@@ -59,6 +60,9 @@ typedef int (*ctr_op_t)(struct cipher_ctx *ctx, struct cipher_pkt *pkt,
59
60
typedef int (* ccm_op_t )(struct cipher_ctx * ctx , struct cipher_aead_pkt * pkt ,
60
61
u8_t * nonce );
61
62
63
+ typedef int (* gcm_op_t )(struct cipher_ctx * ctx , struct cipher_aead_pkt * pkt ,
64
+ u8_t * nonce );
65
+
62
66
struct cipher_ops {
63
67
64
68
enum cipher_mode cipher_mode ;
@@ -68,6 +72,7 @@ struct cipher_ops {
68
72
cbc_op_t cbc_crypt_hndlr ;
69
73
ctr_op_t ctr_crypt_hndlr ;
70
74
ccm_op_t ccm_crypt_hndlr ;
75
+ gcm_op_t gcm_crypt_hndlr ;
71
76
};
72
77
};
73
78
@@ -83,6 +88,11 @@ struct ctr_params {
83
88
u32_t ctr_len ;
84
89
};
85
90
91
+ struct gcm_params {
92
+ u16_t tag_len ;
93
+ u16_t nonce_len ;
94
+ };
95
+
86
96
/* Structure encoding session parameters. Refer to comments for individual
87
97
* fields to know the contract in terms of who fills what and when w.r.t
88
98
* begin_session() call.
@@ -132,6 +142,7 @@ struct cipher_ctx {
132
142
union {
133
143
struct ccm_params ccm_info ;
134
144
struct ctr_params ctr_info ;
145
+ struct gcm_params gcm_info ;
135
146
} mode_params ;
136
147
137
148
/* Cryptographic keylength in bytes. To be populated by the app
0 commit comments