Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision ae06d3dfc39e62f24a6dbb62d8e15a198b536d29 authored by Matthias J. Kannwischer on 31 January 2019, 10:15:17 UTC, committed by Joost Rijneveld on 31 January 2019, 10:15:17 UTC
Add kyber512 and kyber1024 (#35)
* add kyber512 and kyber1024 ref

* add m4 optimized kyber512 and kyber1024

* add kyber512 and kyber1024 benchmarks
1 parent c589096
  • Files
  • Changes
  • 0f0e6f5
  • /
  • benchmarks_to_md.py
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:ae06d3dfc39e62f24a6dbb62d8e15a198b536d29
directory badge
swh:1:dir:0f0e6f57638ca1490f87065c51561ec2d36d88b1
content badge
swh:1:cnt:d0d570e611decc423f7ff109b2f9fb4ca011c74e

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
benchmarks_to_md.py
#!/usr/bin/env python3
import os
import numpy as np

BENCHMARK_DIR = 'benchmarks/'

def parseData(fileContents):
    parts = fileContents.split("\n")
    keygen = int(parts[1])
    encsign = int(parts[3])
    decverify = int(parts[5])
    return [keygen, encsign, decverify]

def getStats(l):
    return "AVG: {:,} <br /> MIN: {:,} <br /> MAX: {:,}".format(int(np.mean(l)), min(l), max(l));

def formatData(scheme, implementation, data, printStats):
    if printStats:
        keygen    = getStats([item[0] for item in data])
        encsign   = getStats([item[1] for item in data])
        decverify = getStats([item[2] for item in data])
        print("| {} ({} executions) | {} | {} |  {} | {} |".format(scheme,len(data), implementation, keygen, encsign, decverify))
    else:
        keygen     = "{:,}".format(max([item[0] for item in data]))
        encsign    = "{:,}".format(max([item[1] for item in data]))
        decverify  = "{:,}".format( max([item[2] for item in data]))
        print("| {} | {} | {} |  {} | {} |".format(scheme, implementation, keygen, encsign, decverify))

def processPrimitives(path, printStats):
    if os.path.exists(path) == False:
        return;
    for scheme in sorted(os.listdir(path)):
        for implementation in sorted(os.listdir(path+"/"+scheme)):
            measurements = []
            for measurement in os.listdir(path+"/"+scheme+"/"+implementation):
                with open(path+"/"+scheme+"/"+implementation+"/"+measurement, "r") as f:
                    d = parseData(f.read())
                    measurements.append(d)
            formatData(scheme, implementation, measurements, printStats)


print("### Speed Evaluation")
print("#### Key Encapsulation Schemes")
print("| scheme | implementation | key generation [cycles] | encapsulation [cycles] | decapsulation [cycles] |")
print("| ------ | -------------- | ----------------------- | ---------------------- | -----------------------|")
processPrimitives(BENCHMARK_DIR+"speed/crypto_kem/", True)

print("#### Signature Schemes")
print("| scheme | implementation | key generation [cycles] | sign [cycles] | verify [cycles] |")
print("| ------ | -------------- | ----------------------- | ------------- | ----------------|")
processPrimitives(BENCHMARK_DIR+"speed/crypto_sign/", True)


print("### Memory Evaluation")
print("#### Key Encapsulation Schemes")
print("| scheme | implementation | key generation [bytes] | encapsulation [bytes] | decapsulation [bytes] |")
print("| ------ | -------------- | ----------------------- | ---------------------- | -----------------------|")
processPrimitives(BENCHMARK_DIR+"stack/crypto_kem/", False)

print("#### Signature Schemes")

print("| scheme | implementation | key generation [bytes] | sign [bytes] | verify [bytes] |")
print("| ------ | -------------- | ----------------------- | ------------- | ----------------|")
processPrimitives(BENCHMARK_DIR+"stack/crypto_sign/", False)
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API