This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ECE4802 - Cryptography | |
Homework 1 | |
Part 1 | |
Nam Tran Ngoc | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ECE4802 - Cryptography | |
Homework 1 | |
Part 2 | |
Nam Tran Ngoc | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./a.out | |
0: 0101 1000 0 | |
1: 0010 1100 0 | |
2: 0001 0110 0 | |
3: 0000 1011 1 | |
4: 0000 0101 1 | |
5: 0000 0010 0 | |
6: 0000 0001 1 | |
7: 1000 0000 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INPUT | |
1 1 0 0 0 1 0 0 | |
0 0 1 0 1 0 0 0 | |
0 1 0 1 0 0 0 0 | |
0 1 1 0 1 0 0 1 | |
EXPANSION | |
1 1 1 0 0 0 | |
0 0 1 0 0 0 | |
0 0 0 1 0 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15*29 mod 13 = 6 | |
15*29 mod 12 = 3 | |
15*28 mod 12 = 0 | |
(15*29+7*12) mod 13 = 12 | |
5^-1 mod 19 = 4 | |
5^-1 mod 12 = 5 | |
5^-1 mod 17 = 3 | |
5^-1 mod 10 = -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.10) | |
project(yart) | |
enable_language(C CXX) | |
if(CMAKE_CROSSCOMPILING) | |
message(STATUS "Crosscompiling enabled, using toolchain file: ${CMAKE_TOOLCHAIN_FILE}") | |
add_subdirectory(src) | |
else() | |
message(STATUS "No crosscompiling specified, compiling in /tests only.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") | |
set(CMAKE_SYSTEM_NAME Generic) | |
set(CMAKE_SYSTEM_PROCESSOR arm) | |
set(CMAKE_CROSSCOMPILING TRUE) | |
set(CMAKE_C_COMPILER arm-none-eabi-gcc) | |
set(CMAKE_CXX_COMPILER arm-none-eabi-g++) | |
set(OBJCOPY arm-none-eabi-objcopy) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make_minimum_required(VERSION 3.10) | |
set(LDSCRIPT "${CMAKE_SOURCE_DIR}/stm32f429i-discovery.ld") | |
set(LIBNAME "opencm3_stm32f4") | |
add_definitions(-DSTM32F4) | |
set(FP_FLAGS "-mfloat-abi=hard -mfpu=fpv4-sp-d16") | |
set(ARCH_FLAGS "-mthumb -mcpu=cortex-m4 ${FP_FLAGS}") | |
set(OPENCM3_DIR "${CMAKE_SOURCE_DIR}/lib/libopencm3") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.10) | |
if(DEFINED ENV{CPPUTEST_HOME}) | |
message(STATUS "Using CppUTest home: $ENV{CPPUTEST_HOME}") | |
set(CPPUTEST_INCLUDE_DIRS $ENV{CPPUTEST_HOME}/include) | |
set(CPPUTEST_LIBRARIES $ENV{CPPUTEST_HOME}/build/lib) | |
set(CPPUTEST_LDFLAGS CppUTest CppUTestExt) | |
else() | |
find_package(PkgConfig REQUIRED) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Written by Nam Tran Ngoc | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
unsigned int a, b, c; | |
printf("Please enter three positive integers as sides of a triangle, separated between spaces: \n"); | |
scanf("%d %d %d", &a, &b, &c); | |