This chapter walks through how one might implement the
Boneh-Lynn-Shacham (BLS) signature scheme using the PBC
library. It is based on the file example/bls.c.
Recall the scheme works as follows. We have three groups G1, G2, GT of prime order r, and have some bilinear map e that takes two elements as input, one from G1 and one from G2, and outputs an element of GT.
First we publish the system parameter g which is a randomly chosen element of G2.
Now suppose Alice wishes to use the system. We generate her public and private keys as follows. A private key is a random element x of Zr, and the corresponding public key is g^x.
To sign a message, Alice hashes the message to some element h of G1, and then outputs the signature h^x.
To verify a signature sigma, one checks that e(h,g^x) = e(sigma, g).