def ED_CERT(self): if self.ed_id_sk is None: self.ed_id_sk = ed25519_exts_ref.expandSK(os.urandom(32)) self.ed_signing_sk = ed25519_exts_ref.expandSK(os.urandom(32)) self.ed_id_pk = ed25519_exts_ref.publickeyFromESK(self.ed_id_sk) self.ed_signing_pk = ed25519_exts_ref.publickeyFromESK(self.ed_signing_sk) self.ed_cert = makeEdSigningKeyCert(self.ed_id_sk, self.ed_id_pk, self.ed_signing_pk, self.certDate, includeSigning=True, certType=4) return objwrap('ED25519 CERT', b64(self.ed_cert))
def NTOR_CROSSCERT(self): if self.ntor_crosscert is None: self.ED_CERT self.NTOR_ONION_KEY ed_privkey = self.ntor_sk.serialize() + os.urandom(32) ed_pub0 = ed25519_exts_ref.publickeyFromESK(ed_privkey) sign = (ord(ed_pub0[31]) & 255) >> 7 self.ntor_crosscert = makeEdSigningKeyCert(self.ntor_sk.serialize() + os.urandom(32), ed_pub0, self.ed_id_pk, self.certDate, certType=10) self.ntor_crosscert_sign = sign return objwrap('ED25519 CERT', b64(self.ntor_crosscert))