Use a seperate section for each nested struct member in INIT macro

This commit is contained in:
Martin Willi
2010-08-18 12:15:03 +02:00
parent 53115857ae
commit ba31fe1fd6
77 changed files with 615 additions and 448 deletions
+5 -1
View File
@@ -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,
+9 -7
View File
@@ -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,
);
+10 -8
View File
@@ -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,