//generates a <secret , public> / Pedersen commitment but takes bH as input tuple<ctkey, ctkey> ctskpkGen(key bH) { ctkey sk, pk; skpkGen(sk.dest, pk.dest); skpkGen(sk.mask, pk.mask); addKeys(pk.mask, pk.mask, bH); return make_tuple(sk, pk); }
//generates a <secret , public> / Pedersen commitment to the amount tuple<ctkey, ctkey> ctskpkGen(xmr_amount amount) { ctkey sk, pk; skpkGen(sk.dest, pk.dest); skpkGen(sk.mask, pk.mask); key am = d2h(amount); key bH = scalarmultH(am); addKeys(pk.mask, pk.mask, bH); return make_tuple(sk, pk); }
//Generate Signing Keys //This function is called by each participant in //A ring multisignature transaction. //The participant will send the returned parameters //to whomever is managing the transaction. //returns a, aG, aHP and I tuple<key, key, key, key> InitiateRMS(key x) { key I = scalarmultKey(hashToPoint(scalarmultBase(x)), x); key a, aG; skpkGen(a, aG); key aHP = scalarmultKey(hashToPoint(scalarmultBase(x)), a); return make_tuple(a, aG, aHP, I); }