S15qkd/error_correction.py
def start_error_correction(cmd_pipe: str = PipesQKD.ECCMD, send_pipe: str = PipesQKD.ECS,
                           receive_pipe: str = PipesQKD.ECR, raw_keys_folder: str = FoldersQKD.RAWKEYS,
                           final_keys_folder: str = FoldersQKD.FINALKEYS, notification_pipe: str = PipesQKD.ECNOTE,
                           query_pipe: str = PipesQKD.ECQUERY, query_resp_pipe: str = PipesQKD.ECR):
    '''Starts the error correction process.
    '''
    global proc_error_correction
    initialize()
    # create erroroptions from settings
    erropt = ''
    if privacy_amplification is False:
        erropt = '-p'
        logger.info(f'Privacy amplification off.')
    if errcd_killfile_option is True:
        erropt += ' -k'
        logger.info(f'Deleting raw key files after error correction.')
    erropt += f' -B {target_bit_error}'
    
    args = f'-c {cmd_pipe} \
             -s {send_pipe} \
             -r {receive_pipe} \
             -d {raw_keys_folder} \
             -f {final_keys_folder} \
             -l {notification_pipe} \
             -Q {query_pipe} \
             -q {query_resp_pipe} \
             -V 2 {erropt} -T 1'
    logger.info(f'Starting error correction with: {args}')
    with open(f'{FoldersQKD.DATAROOT}/errcd_err', 'a+') as f_err:
        with open(f'{FoldersQKD.DATAROOT}/errcd_log', 'a+') as f_stdout:
            proc_error_correction = subprocess.Popen((program_error_correction,
                                                      *args.split()),
                                                     stdout=f_stdout,
                                                     stderr=f_err)
    # start pipe digests
    ecnotepipe_thread = threading.Thread(
        target=_ecnotepipe_digest, args=(), daemon=True)
    ecnotepipe_thread.start()
    do_ec_thread = threading.Thread(
        target=_do_error_correction, args=(), daemon=True)
    do_ec_thread.start()
    logger.info(f'Started error correction.')
    controller.qkd_engine_state = QKDEngineState.KEY_GENERATION
Starts the error correction process.
    
Starts the error correction process.
Starts the error correction process .
def start_error_correction(cmd_pipe: str = PipesQKD.ECCMD, send_pipe: str = PipesQKD.ECS,
                           receive_pipe: str = PipesQKD.ECR, raw_keys_folder: str = FoldersQKD.RAWKEYS,
                           final_keys_folder: str = FoldersQKD.FINALKEYS, notification_pipe: str = PipesQKD.ECNOTE,
                           query_pipe: str = PipesQKD.ECQUERY, query_resp_pipe: str = PipesQKD.ECR):
    global proc_error_correction
    initialize()
    erropt = ''
    if privacy_amplification is False:
        erropt = '-p'
        logger.info(f'Privacy amplification off.')
    if errcd_killfile_option is True:
        erropt += ' -k'
        logger.info(f'Deleting raw key files after error correction.')
    erropt += f' -B {target_bit_error}'
    args = f'-c {cmd_pipe} \
             -s {send_pipe} \
             -r {receive_pipe} \
             -d {raw_keys_folder} \
             -f {final_keys_folder} \
             -l {notification_pipe} \
             -Q {query_pipe} \
             -q {query_resp_pipe} \
             -V 2 {erropt} -T 1'
    logger.info(f'Starting error correction with: {args}')
    with open(f'{FoldersQKD.DATAROOT}/errcd_err', 'a+') as f_err:
        with open(f'{FoldersQKD.DATAROOT}/errcd_log', 'a+') as f_stdout:
            proc_error_correction = subprocess.Popen((program_error_correction,
                                                      *args.split()),
                                                     stdout=f_stdout,
                                                     stderr=f_err)
    ecnotepipe_thread = threading.Thread(
        target=_ecnotepipe_digest, args=(), daemon=True)
    ecnotepipe_thread.start()
    do_ec_thread = threading.Thread(
        target=_do_error_correction, args=(), daemon=True)
    do_ec_thread.start()
    logger.info(f'Started error correction.')
    controller.qkd_engine_state = QKDEngineState.KEY_GENERATION
def start_error_correction ( cmd_pipe : str = PipesQKD . ECCMD , send_pipe : str = PipesQKD . ECS , receive_pipe : str = PipesQKD . ECR , raw_keys_folder : str = FoldersQKD . RAWKEYS , final_keys_folder : str = FoldersQKD . FINALKEYS , notification_pipe : str = PipesQKD . ECNOTE , query_pipe : str = PipesQKD . ECQUERY , query_resp_pipe : str = PipesQKD . ECR ) : global proc_error_correction initialize ( ) erropt = '' if privacy_amplification is False : erropt = '-p' logger . info ( f'Privacy amplification off.' ) if errcd_killfile_option is True : erropt += ' -k' logger . info ( f'Deleting raw key files after error correction.' ) erropt += f' -B {target_bit_error}' args = f'-c {cmd_pipe} \
             -s {send_pipe} \
             -r {receive_pipe} \
             -d {raw_keys_folder} \
             -f {final_keys_folder} \
             -l {notification_pipe} \
             -Q {query_pipe} \
             -q {query_resp_pipe} \
             -V 2 {erropt} -T 1' logger . info ( f'Starting error correction with: {args}' ) with open ( f'{FoldersQKD.DATAROOT}/errcd_err' , 'a+' ) as f_err : with open ( f'{FoldersQKD.DATAROOT}/errcd_log' , 'a+' ) as f_stdout : proc_error_correction = subprocess . Popen ( ( program_error_correction , * args . split ( ) ) , stdout = f_stdout , stderr = f_err ) ecnotepipe_thread = threading . Thread ( target = _ecnotepipe_digest , args = ( ) , daemon = True ) ecnotepipe_thread . start ( ) do_ec_thread = threading . Thread ( target = _do_error_correction , args = ( ) , daemon = True ) do_ec_thread . start ( ) logger . info ( f'Started error correction.' ) controller . qkd_engine_state = QKDEngineState . KEY_GENERATION
Starts the error correction process.
Starts the error correction process .
'''Starts the error correction process.
    ''' # create erroroptions from settings # start pipe digests
cmd_pipe
str
send_pipe
str
receive_pipe
str
raw_keys_folder
str
final_keys_folder
str
notification_pipe
str
query_pipe
str
query_resp_pipe
str