Use a seperate section for each nested struct member in INIT macro
This commit is contained in:
@@ -50,7 +50,11 @@ plugin_t *hmac_plugin_create()
|
||||
private_hmac_plugin_t *this;
|
||||
|
||||
INIT(this,
|
||||
.public.plugin.destroy = _destroy,
|
||||
.public = {
|
||||
.plugin = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256,
|
||||
|
||||
@@ -108,13 +108,15 @@ hmac_prf_t *hmac_prf_create(pseudo_random_function_t algo)
|
||||
}
|
||||
|
||||
INIT(this,
|
||||
.public.prf = {
|
||||
.get_bytes = _get_bytes,
|
||||
.allocate_bytes = _allocate_bytes,
|
||||
.get_block_size = _get_block_size,
|
||||
.get_key_size = _get_key_size,
|
||||
.set_key = _set_key,
|
||||
.destroy = _destroy,
|
||||
.public = {
|
||||
.prf = {
|
||||
.get_bytes = _get_bytes,
|
||||
.allocate_bytes = _allocate_bytes,
|
||||
.get_block_size = _get_block_size,
|
||||
.get_key_size = _get_key_size,
|
||||
.set_key = _set_key,
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.hmac = hmac,
|
||||
);
|
||||
|
||||
@@ -172,14 +172,16 @@ hmac_signer_t *hmac_signer_create(integrity_algorithm_t algo)
|
||||
}
|
||||
|
||||
INIT(this,
|
||||
.public.signer = {
|
||||
.get_signature = _get_signature,
|
||||
.allocate_signature = _allocate_signature,
|
||||
.verify_signature = _verify_signature,
|
||||
.get_key_size = _get_key_size,
|
||||
.get_block_size = _get_block_size,
|
||||
.set_key = _set_key,
|
||||
.destroy = _destroy,
|
||||
.public = {
|
||||
.signer = {
|
||||
.get_signature = _get_signature,
|
||||
.allocate_signature = _allocate_signature,
|
||||
.verify_signature = _verify_signature,
|
||||
.get_key_size = _get_key_size,
|
||||
.get_block_size = _get_block_size,
|
||||
.set_key = _set_key,
|
||||
.destroy = _destroy,
|
||||
},
|
||||
},
|
||||
.block_size = min(trunc, hmac->get_block_size(hmac)),
|
||||
.hmac = hmac,
|
||||
|
||||
Reference in New Issue
Block a user