@@ -90,6 +90,22 @@ static int hmac_import(struct shash_desc *pdesc, const void *in)
90
90
return crypto_shash_import (desc , in );
91
91
}
92
92
93
+ static int hmac_export_core (struct shash_desc * pdesc , void * out )
94
+ {
95
+ struct shash_desc * desc = shash_desc_ctx (pdesc );
96
+
97
+ return crypto_shash_export_core (desc , out );
98
+ }
99
+
100
+ static int hmac_import_core (struct shash_desc * pdesc , const void * in )
101
+ {
102
+ const struct hmac_ctx * tctx = crypto_shash_ctx (pdesc -> tfm );
103
+ struct shash_desc * desc = shash_desc_ctx (pdesc );
104
+
105
+ desc -> tfm = tctx -> hash ;
106
+ return crypto_shash_import_core (desc , in );
107
+ }
108
+
93
109
static int hmac_init (struct shash_desc * pdesc )
94
110
{
95
111
const struct hmac_ctx * tctx = crypto_shash_ctx (pdesc -> tfm );
@@ -177,6 +193,7 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
177
193
return - ENOMEM ;
178
194
spawn = shash_instance_ctx (inst );
179
195
196
+ mask |= CRYPTO_AHASH_ALG_NO_EXPORT_CORE ;
180
197
err = crypto_grab_shash (spawn , shash_crypto_instance (inst ),
181
198
crypto_attr_alg_name (tb [1 ]), 0 , mask );
182
199
if (err )
@@ -211,6 +228,8 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
211
228
inst -> alg .finup = hmac_finup ;
212
229
inst -> alg .export = hmac_export ;
213
230
inst -> alg .import = hmac_import ;
231
+ inst -> alg .export_core = hmac_export_core ;
232
+ inst -> alg .import_core = hmac_import_core ;
214
233
inst -> alg .setkey = hmac_setkey ;
215
234
inst -> alg .init_tfm = hmac_init_tfm ;
216
235
inst -> alg .clone_tfm = hmac_clone_tfm ;
0 commit comments