How to use the blspy.InsecureSignature.aggregate function in blspy

To help you get started, we’ve selected a few blspy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ethereum / trinity / eth2 / _utils / bls / backends / chia / api.py View on Github external
def aggregate_signatures(signatures: Sequence[BLSSignature]) -> BLSSignature:
    if len(signatures) == 0:
        return EMPTY_SIGNATURE

    signatures_chia = [
        InsecureSignature.from_bytes(signature)
        for signature in signatures
    ]
    aggregated_signature = InsecureSignature.aggregate(signatures_chia)
    aggregated_signature_bytes = aggregated_signature.serialize()
    return cast(BLSSignature, aggregated_signature_bytes)