Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples #26

Merged
merged 7 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ if(NOT USE_SOFTWARE_CRYPTO_SHA256)
add_compile_definitions(NO_SOFTWARE_CRYPTO_SHA256)
endif()

option(USE_SOFTWARE_CRYPTO_SHA512 "include software SHA512" OFF)
option(USE_SOFTWARE_CRYPTO_SHA512 "include software SHA512" ON)
if(NOT USE_SOFTWARE_CRYPTO_SHA512)
add_compile_definitions(NO_SOFTWARE_CRYPTO_SHA512)
endif()
Expand Down
12 changes: 12 additions & 0 deletions cmake/linker-map.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(command ${CMAKE_C_COMPILER} ${flags} -Wl,--version)


function(add_linker_map_for_target TARGET)
if (APPLE)
# LLVM only understands this flag.
# The map output differs from GNU ld.
target_link_options(${TARGET} PRIVATE "-Wl,-map,${TARGET}.map")
else()
target_link_options(${TARGET} PRIVATE "-Wl,-Map=${TARGET}.map")
endif()
endfunction()
11 changes: 8 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
include(../cmake/linker-map.cmake)
#######################################
# NFC example

add_executable(nfc nfc.c)
add_linker_map_for_target(nfc)
target_link_libraries(nfc ${PRODUCT_NAME})

add_executable(nfc_simulator nfc_simulator.c stateless_rp.c)
add_linker_map_for_target(nfc_simulator)
target_link_libraries(nfc_simulator ${PRODUCT_NAME})

#######################################
# FIDO2 authenticator simulator example
# Test applications

add_executable(nfc_simulator nfc_simulator.c)
target_link_libraries(nfc_simulator ${PRODUCT_NAME})
add_subdirectory(measurements)
15 changes: 15 additions & 0 deletions examples/measurements/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include(../../cmake/linker-map.cmake)

set(measurement_dependencies gpio.c)

function(add_measurement name)
add_executable(${name} "${name}.c" ${measurement_dependencies})
add_linker_map_for_target(${name})
target_link_libraries(${name} ${PRODUCT_NAME})
endfunction()

add_measurement("aes_gcm_measure")
add_measurement("ed25519_measure")
add_measurement("sha256_measure")
add_measurement("sha512_measure")
add_measurement("inflate_measure")
71 changes: 71 additions & 0 deletions examples/measurements/aes_gcm_measure.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright (c) 2022 Felix Gohla, Konrad Hanff, Tobias Kantusch,
* Quentin Kuth, Felix Roth. All rights reserved.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/

#include "fido.h"
#include "gpio.h"

#define SAMPLES 20

// See scripts/gen_aes_gcm.py
static const uint8_t key[] = { 0x7d, 0x1a, 0x22, 0xe8, 0x33, 0x8c, 0xf9, 0x8c, 0x18, 0x4a, 0x36, 0xd7, 0x1f, 0x53, 0x57, 0x06, 0xe7, 0x61, 0xab, 0x8c, 0xe9, 0xe3, 0xca, 0xde, 0x0e, 0x18, 0x60, 0xdf, 0xa9, 0xb2, 0x6f, 0x36 };
static const uint8_t associated_data[12] = "fidoonmicros";
static const uint8_t nonce[] = { 0xb7, 0x3a, 0x1b, 0x33, 0x1e, 0xe7, 0xef, 0x59, 0x44, 0xf8, 0x50, 0x73 };
static const uint8_t ciphertext[] = { 0x20, 0x21, 0x93, 0x59, 0x35, 0x51, 0xec, 0xaa, 0x5c, 0x63, 0xe2, 0x31, 0xbb, 0x1b, 0x12, 0x29, 0x1d, 0x12, 0x24, 0xe5, 0x63, 0x28, 0xfd, 0xcd, 0x8a, 0x3a, 0xee, 0x45, 0x9c, 0x22, 0x32, 0xcb, 0xba, 0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c4, 0xa3, 0x28, 0x59, 0x54, 0x47, 0x09 };

int main(void) {
// Wait until the microcontroller booted up to remove increased power consumption in the measurements at the beginning.
delay(3000);

uint8_t plain[576] = {0};

setup_pin();
pin_off();

int e = 0;

// Test AES GCM decryption.
for (size_t i = 0; i < SAMPLES; ++i) {
pin_on();
e = fido_aes_gcm_decrypt(
key,
sizeof(key),
nonce,
sizeof(nonce),
ciphertext,
sizeof(ciphertext),
associated_data,
sizeof(associated_data),
tag,
plain
);
pin_off();

delay(500);
}

delay(1000);
pin_on();
for (size_t i = 0; i < SAMPLES; ++i) {
e = fido_aes_gcm_decrypt(
key,
sizeof(key),
nonce,
sizeof(nonce),
ciphertext,
sizeof(ciphertext),
associated_data,
sizeof(associated_data),
tag,
plain
);
}
pin_off();

return e;
}
61 changes: 61 additions & 0 deletions examples/measurements/ed25519_measure.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2022 Felix Gohla, Konrad Hanff, Tobias Kantusch,
* Quentin Kuth, Felix Roth. All rights reserved.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/

#include "fido.h"
#include "gpio.h"

#include <string.h>

#define SAMPLES 20

// See scripts/gen_ed25519.py
// This is the DEMO private key corresponding to the public key below.
// static const uint8_t private_key[] = { 0x5b, 0x35, 0xd2, 0x98, 0x87, 0xd9, 0x2d, 0xd7, 0x8b, 0xc9, 0xf2, 0x5f, 0x19, 0xa3, 0xdf, 0xb1, 0x7c, 0xe5, 0x4d, 0x72, 0xd7, 0xe5, 0xdb, 0x29, 0xa7, 0x69, 0xe9, 0x45, 0x14, 0xc9, 0x44, 0xb3 };
static const uint8_t public_key[] = { 0x5e, 0x51, 0x78, 0x80, 0xf9, 0x31, 0x4f, 0x44, 0x57, 0x6a, 0xfc, 0xe8, 0xd4, 0x1d, 0x77, 0xef, 0xb9, 0xd8, 0x94, 0x5a, 0x57, 0x27, 0xb6, 0x5e, 0x0f, 0xea, 0x41, 0x49, 0x2d, 0x7d, 0x68, 0x80 };

// 576 * 'f'
static const uint8_t message[] = { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66 };
static const uint8_t signature[] = { 0x2e, 0x55, 0x1a, 0x75, 0xf6, 0x48, 0x01, 0xc0, 0x1f, 0x56, 0x81, 0x22, 0xb3, 0x7a, 0xc2, 0xf5, 0x43, 0xa7, 0x9a, 0x5e, 0x0a, 0xc0, 0xba, 0x9c, 0xbe, 0xdd, 0xc8, 0x71, 0x95, 0xc6, 0x74, 0x82, 0x11, 0x66, 0xea, 0xaf, 0x17, 0x30, 0xb5, 0xbc, 0xf3, 0xef, 0x2b, 0x2c, 0xa1, 0xf0, 0xe7, 0xa4, 0x0c, 0x8a, 0x9b, 0xad, 0x55, 0x06, 0x28, 0x46, 0x2f, 0xdf, 0x51, 0x56, 0xc7, 0x51, 0x88, 0x08 };

int main(void) {
// Wait until the microcontroller booted up to remove increased power consumption in the measurements at the beginning.
delay(3000);

setup_pin();
pin_off();

int e = 0;

// Test ed25519 verification.
for (size_t i = 0; i < SAMPLES; ++i) {
pin_on();
e = fido_ed25519_verify(
signature,
public_key,
message,
sizeof(message)
);
pin_off();

delay(500);
}

delay(1000);
pin_on();
for (size_t i = 0; i < SAMPLES; ++i) {
e = fido_ed25519_verify(
signature,
public_key,
message,
sizeof(message)
);
}
pin_off();

return e;
}
41 changes: 41 additions & 0 deletions examples/measurements/gpio.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2022 Felix Gohla, Konrad Hanff, Tobias Kantusch,
* Quentin Kuth, Felix Roth. All rights reserved.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/

#if defined(__AVR__)

#include <avr/io.h>
#include <util/delay.h>

#define PIN PB5

void setup_pin() {
DDRB |= _BV(PIN);
}

void pin_on() {
PORTB |= _BV(PIN);
}

void pin_off() {
PORTB &= ~_BV(PIN);
}

void delay(double ms) {
for (double i = 0; i < ms; i++) {
_delay_ms(1);
}
}

#else
// To make the examples compile, default to NOOP.
#warning GPIO does not work on this system, defaulting to nop
void setup_pin() {}
void pin_on() {}
void pin_off() {}
void delay(double ms) {}
#endif
29 changes: 29 additions & 0 deletions examples/measurements/gpio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2022 Felix Gohla, Konrad Hanff, Tobias Kantusch,
* Quentin Kuth, Felix Roth. All rights reserved.
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/

/**
* @brief Setup the logical PPK2 output pin.
*/
void setup_pin();

/**
* @brief Turn the logical PPK2 output pin on.
*/
void pin_on();

/**
* @brief Turn the logical PPK2 output pin off.
*/
void pin_off();

/**
* @brief Delay program execution by given milliseconds.
*
* @param ms Milliseconds to delay program execution
*/
void delay(double ms);
Loading