def __init__(self, conf_file):
f = open(conf_file, "r")
conf = yaml.load(f)
f.close()
cert_bin = self.__hex2bin(conf["cert_hex"])
priv = conf["priv_key"]
P_bin = self.__hex2bin(priv["P_hex"])
Q_bin = self.__hex2bin(priv["Q_hex"])
d_mod_p_1_bin = self.__hex2bin(priv["d_mod_p-1_hex"])
d_mod_q_1_bin = self.__hex2bin(priv["d_mod_q-1_hex"])
inv_q_mod_p_bin = self.__hex2bin(priv["inv_q_mod_p_hex"])
self.__cert_bin = cert_bin
self.__priv_key_P = int.from_bytes(P_bin, "big")
self.__priv_key_Q = int.from_bytes(Q_bin, "big")
self.__priv_key_d_mod_p_1 = int.from_bytes(d_mod_p_1_bin, "big")
self.__priv_key_d_mod_q_1 = int.from_bytes(d_mod_q_1_bin, "big")
self.__priv_key_inv_q_mod_p = int.from_bytes(inv_q_mod_p_bin, "big")
f = open("yaml/global.yaml", "r")
conf = yaml.load(f)
f.close()
global_constant_hex = re.sub(r'\s', "", conf["global_constant"])
self.__global_constant_bin = bytes.fromhex(global_constant_hex)
评论列表
文章目录