Ejemplo n.º 1
0
 def test_nonTransitiveConvert(self):
     self.addMember()
     sig1 = groupsig.sign(b"Hello, World1!", self.memkeys[0], self.grpkey)
     sig2 = groupsig.sign(b"Hello, World2!", self.memkeys[0], self.grpkey)
     b = groupsig.verify(sig1, b"Hello, World1!", self.grpkey)
     self.assertTrue(b)
     b = groupsig.verify(sig2, b"Hello, World2!", self.grpkey)
     self.assertTrue(b)
     bkey = bldkey.bldkey_random(self.code, self.grpkey)
     out = groupsig.blind(self.grpkey, sig1, "Hello, World1!", bkey)
     bsig1 = out["bsig"]
     out = groupsig.blind(self.grpkey, sig2, "Hello, World2!", bkey)
     bsig2 = out["bsig"]
     bkey_pub = bldkey.bldkey_import(constants.GL19_CODE,
                                     bldkey.bldkey_export_pub(bkey))
     csigs1 = groupsig.convert([bsig1],
                               self.grpkey,
                               bkey_pub,
                               mgrkey=self.cnvkey)
     csigs2 = groupsig.convert([bsig2],
                               self.grpkey,
                               bkey_pub,
                               mgrkey=self.cnvkey)
     nym1 = groupsig.unblind(csigs1[0], bkey)
     nym2 = groupsig.unblind(csigs2[0], bkey)
     self.assertNotEqual(nym1['nym'], nym2['nym'])
Ejemplo n.º 2
0
 def setUp(self):
     groupsig.init(constants.GL19_CODE, 0)
     group1 = groupsig.setup(constants.GL19_CODE)
     self.code = constants.GL19_CODE
     grpkey1 = group1['grpkey']
     self.isskey = group1['mgrkey']
     group2 = groupsig.setup(constants.GL19_CODE, grpkey1)
     self.cnvkey = group2['mgrkey']
     self.grpkey = group2['grpkey']
     self.bldkey = bldkey.bldkey_random(self.code, self.grpkey)
Ejemplo n.º 3
0
 def setUp(self):
     groupsig.init(constants.GL19_CODE, 0)
     group1 = groupsig.setup(constants.GL19_CODE)
     self.code = constants.GL19_CODE
     grpkey1 = group1['grpkey']
     self.isskey = group1['mgrkey']
     group2 = groupsig.setup(constants.GL19_CODE, grpkey1)
     self.cnvkey = group2['mgrkey']
     self.grpkey = group2['grpkey']
     self.memkeys = []
     self.addMember()
     self.sig = groupsig.sign("Hello, World!", self.memkeys[0], self.grpkey)
     bkey = bldkey.bldkey_random(self.code, self.grpkey)
     out = groupsig.blind(self.grpkey, self.sig, "Hello, World!", bkey)
     self.bsig = out["bsig"]
Ejemplo n.º 4
0
    print(
        "Usage: $python blind.py <grpkey str> <sig1 str> <msg1 str> <sig2 str> <msg2 str>"
    )
    sys.exit()

groupsig.init(constants.GL19_CODE, 0)

# Import grpkey
gpk = grpkey.grpkey_import(constants.GL19_CODE, sys.argv[1])

# Import signatures
sig1 = signature.signature_import(constants.GL19_CODE, sys.argv[2])
sig2 = signature.signature_import(constants.GL19_CODE, sys.argv[4])

# Blind
bdk = bldkey.bldkey_random(constants.GL19_CODE, gpk)
out = groupsig.blind(gpk, sig1, sys.argv[3], bdk)
bsig1 = out['bsig']

out2 = groupsig.blind(gpk, sig2, sys.argv[5], bdk)
bsig2 = out2['bsig']

## Export Blinded sigs
sbsig1 = blindsig.blindsig_export(bsig1)
sbsig2 = blindsig.blindsig_export(bsig2)

## Export blinding key
sbdk_pub = bldkey.bldkey_export_pub(bdk)
sbdk = bldkey.bldkey_export(bdk)

## Output