Skip to content

Commit

Permalink
aggregate.c: tolerate AGGR_SIGN_SET-free contexts.
Browse files Browse the repository at this point in the history
AGGR_SIGN_SET-free contexts are produced by blst_pairing_raw_aggregate.
  • Loading branch information
dot-asm committed Sep 14, 2021
1 parent a9c4223 commit f47675f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/aggregate.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ BLST_ERROR blst_pairing_merge(PAIRING *ctx, const PAIRING *ctx1)
if (ctx->nelems || ctx1->nelems)
return BLST_AGGR_TYPE_MISMATCH;

ctx->ctrl |= ctx1->ctrl & MIN_SIG_OR_PK;

switch (ctx->ctrl & MIN_SIG_OR_PK) {
case AGGR_MIN_SIG:
if (ctx->ctrl & ctx1->ctrl & AGGR_SIGN_SET) {
Expand All @@ -441,8 +443,7 @@ BLST_ERROR blst_pairing_merge(PAIRING *ctx, const PAIRING *ctx1)
}
break;
case AGGR_UNDEFINED:
vec_copy(ctx, ctx1, sizeof(*ctx));
return BLST_SUCCESS;
break;
default:
return BLST_AGGR_TYPE_MISMATCH;
}
Expand Down

0 comments on commit f47675f

Please sign in to comment.