QKD R10 V9.9999.8 performance tweaks

Added by Oliver Maurhart 2 months ago

The last commit into the QKD R10 V9.9999.8 (ad90a8cc) - currently develop branch - introduces a huge transition into a more fine grain control over memory operations. Before working on key data and message data had the drawback, that the develop was not aware when and how held by the key and message objects has been copied. Indeed, any I/O operation involved at least a single memory copy. This has changed.

The current QKD R10 v9.9999.8 does no memory copy anymore when it is not requested. It does this via:

  • qkd::key::key is now a smart pointer to a qkd::key::key_instance. Keys are now created on the heap.
  • qkd::module::message is now a smart pointer to a qkd::module::message_instance. Peer-to-peer messages are now created on the heap.
  • Any key received from the previous module in a pipeline is not copied as long the developer does not call the data() method.
  • To enforce a const (non-copy) access to a message or key's data the additional const_data() method has been introduced.
  • The streaming operators for qkd::utility::buffer have been dropped and the push() and pop() methods have been renamed to write() and read(). Utilizing the stream operators on qkd::utility::buffer could cause easily memory copies. They have been removed without substitution.
  • Modules now declare themselves to be key modifying or not. A lot of helper modules do not modify the key content. Therefore it is an error to access the key content in a way which could cause key modifications. This is a safety net for the developers to not accidentally provoke unwanted key data memory copy operations.

Hence, these changes do break the API. V9.9999.8 is NOT source compatible to V9.9999.7 any more. As the "Changes" read:

Changes from 9.9999.7 to 9.9999.8

* qkd::key::key and qkd::module::message are now smart pointer to instance objects


    We turned qkd::key::key and qkd::module::message into smart pointers.

    That is:

        qkd::key::key           ---> std::shared_ptr<qkd::key::key_instance>
        qkd::module::message    ---> std::shared_ptr<qkd::module::message>

    Rationale: by operating all keys and messages on the heap we try to minimize
               memcpy operations in sending and receiving keys and messages from
               paired modules.

    Yes, this breaks old implementations. However, the benefit for a more faster
    system which deeply controls each and every memcpy of key and message material
    outweights this drawback. Sorry.

    You now have to ability to fine grain memcpy on key or message data content.
    Whenever you make a call to a possible data manipulation method the containing
    data in the key and message will be detached (memcpy!) if it is not uniquely

    That is: the containing memory area of the key and the message does have an
    internal reference count. Whenever a pointer to this data is requested which
    could lead to a write access the memory is copied whenever the reference count
    is bigger than 1.

    Example:        cKey = qkd::key::key();
                    cKey->data()[0] = 42;       // <-- memcpy here!

    To avoid this automatic memcpy we've added the 


    method in the qkd::key::key and qkd::module::message classes.

    The above example then renders:

    Example:        cKey = qkd::key::key();
                    char const * p = (char *)cKey->const_data();
                    if (p[0] == 42) {

    With this, we avoid memcpy opertions when they are not needed and speed up
    the qkd key post processing.

Sorry, but we think the effort is worthwhile.

AIT goes QCrypt 2016

Added by Oliver Maurhart 11 months ago

As in the previous years we will attend the QCrypt 2016. The AIT will also hold a 3h workshop about its Open Source QKD software. We will talk about the software, its design and how one can add its own QKD software entities (e.g. error correction) into a QKD post processing stack. Check details at

But note: registration is limited. If you plan to participate please drop an email at with the subject line "QCrypt2016 AIT Workshop registration".

In any case, Christoph and Oliver will be around the QCrypt. Feel free to ask!

New key XML metadata and switch to Qt5 (develop branch)

Added by Oliver Maurhart 12 months ago

In the current develop branch (v9.9999.8) we switched from using Qt4 to Qt5 (

An even greater impact has the new key XML metadata layout. Due to the demand of developers to add arbitrary values to the key's metadata we changed the way a key handles it metadata.

From the static fixed set of known values we switched to a flexible new model: inside the keystream each key has now it's own metadata stored as a XML stream. This looks like this:

<?xml version="1.0" encoding="utf-8"?>
<key id="5">
        <state id="8">authenticated</state>
        <module id="cascade" type="error correction">
                    <state id="2">sifted</state>
                    <state id="3">corrected</state>

The <modules> tag holds the key's history. One can examine which module the key passed alongside with each module's new specific parameters and values. Every module has now the ability to add arbitrary values at will and read what other modules added to the key metadata in the past.

Alongside this change the tools qkd-key-dump and qkd-key-compare have been empowered to examine and compare keys and key metadata.

However, this changes are currently only available at the develop branch and are not reflected in the master.

AIT QKD R10 v9.9999.7 released

Added by Oliver Maurhart about 1 year ago

We are proud to announce the release of the next version of the AIT QKD R10: v9.9999.7.

This version is immediately available from our GitLab servers as the master branch:

There have been a lot of changes. Among these are:

  • qkd-key-compare: a new tool which lets you compare two keystream files
  • qkd-view now supports JSON output for easy computational parsing
  • automatic IP assignment and routing of Q3P
  • Ubuntu 15.10 and Ubuntu 16.04 package creation
  • new QKD module: qkd-sync for easy synchronization of parallel keystreams
  • many bugfixes

... and much more. Take a look at the latest changes at

QCrypt 2015

Added by Oliver Maurhart almost 2 years ago

At this year's QCrypt 2015, the AIT held a workshop showing the main concepts and design of the AIT QKD R10.

Along with the presentation the attendees were provided with handout slides and with virtual machines based on VirtiualBox to play with.

The slides of the workshop and the installation instructions for the VMs are free for download at QCrypt 2015.

Launch of the AIT QKD R10 software plattform

Added by Oliver Maurhart about 2 years ago

Since SECOQC AIT has made the QKD software available to various universities and working groups in the field. After years of development we moved the development facility of the AIT-QKD-software to a public site from which anyone can download the software sources and participate in the software development:

The present sources are significant further development beyond the former AIT QKD Developer Snapshot and add new features and tools to the whole suite.

The QKD-software presented now includes the following sources that constitute a complete package needed to realize a QKD point-to-point connection (QKD Link) and its integration in a trusted-repeater QKD Network:

  • Full QKD protocol stack including
    • Sifting
    • Error correction: Cascade
    • Privacy amplification
    • Authentication
  • QKD-link simulator
  • Overall communication between Alice and Bob
The following features are also included:
  • Easy and well defined interfaces between the modules
  • Interface to the QKD-link simulator as well as the
  • Interface to the QKD-network with SECOQC-type key-stores
  • Internal monitoring on dbus
Typical use cases of the software are:
  • Simulation of QKD-links including losses and detector imperfections on a single PC
  • Emulation of QKD-links in the framework of a communication network
  • Performance monitoring of user-written reconciliation software in a reproducible QKD environment
  • QKD-network simulation including key management

These use cases can directly be used in the education of Bachelor and Master Students.


    Also available in: Atom