Skip to content

Instantly share code, notes, and snippets.

View bigbrett's full-sized avatar

Brett Nicholas bigbrett

View GitHub Profile
---
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
#include <openssl/engine.h>
#include <openssl/ossl_typ.h>
#include <openssl/evp.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "wsaes_api.h"
" be vIMproved
set nocompatible
" enable plugins
filetype plugin on
" Pathogen
"execute pathogen#infect()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" => VIM user interface
# ~/i.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
root@zedboard-zynq7:~/scripts# openssl speed -evp aes-256-cbc -engine /home/root/lib/libwsaescbcengine.so
engine "wsaescbc" set.
Doing aes-256-cbc for 3s on 16 size blocks: 28786 aes-256-cbc's in 0.04s
Doing aes-256-cbc for 3s on 64 size blocks: 12862 aes-256-cbc's in 0.04s
Doing aes-256-cbc for 3s on 256 size blocks: 4033 aes-256-cbc's in 0.03s
Doing aes-256-cbc for 3s on 1024 size blocks: 1077 aes-256-cbc's in 0.04s
Doing aes-256-cbc for 3s on 8192 size blocks: 138 aes-256-cbc's in 0.06s
OpenSSL 1.0.2j 26 Sep 2016
The 'numbers' are in 1000s of bytes per second processed.
@bigbrett
bigbrett / rsaref.c
Created August 23, 2017 13:58
RSA Reference engine from RSA labs
/* Demo of how to construct your own engine and using it. The basis of this
engine is RSAref, an old reference of the RSA algorithm which can still
be found a little here and there. */
#include <stdio.h>
#include <string.h>
#include "./source/global.h"
#include "./source/rsaref.h"
#include "./source/rsa.h"
#include "./source/des.h"
@bigbrett
bigbrett / cool_informative_shit.md
Created August 23, 2017 13:09
A series of informative things I want to read later
@bigbrett
bigbrett / cpu-pl-test.c
Created August 22, 2017 15:27
Xilinx kernel module demonstrating kernel<-->PL memory mapped acces with and without caches using kernel asm/io.h primitives
/* CPU <-> PL Communication Example
*
* This small example is designed to show how to communicate between the CPU and the PL
* without using DMA. For some applications the amount of data being transferred may be
* small enough that is quicker to not use DMA.
*
* This example assumes a BRAM is on the PL for the testing at a specific address.
* It includes several test methods, cached and non-cached, to compare the performance.
* There are likely more optimization methods that could be applied as this is not
* intended to be that (such as LDM/STRM). This BRAM is connected to the GP0 and GP1
@bigbrett
bigbrett / eng_rsax.c
Created August 10, 2017 18:16
last known commit of the the Intel RSAX engine before it was dropped from the openSSL source tree
/* crypto/engine/eng_rsax.c */
/* Copyright (c) 2010-2010 Intel Corp.
* Author: Vinodh.Gopal@intel.com
* Jim Guilford
* Erdinc.Ozturk@intel.com
* Maxim.Perminov@intel.com
* Ying.Huang@intel.com
*
* More information about algorithm used can be found at:
* http://www.cse.buffalo.edu/srds2009/escs2009_submission_Gopal.pdf
@bigbrett
bigbrett / rsaParamGen.py
Last active July 12, 2017 18:50
Python RSA parameter generator
#!/usr/bin/python
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
keysize = 2048;
print("Key size = %s" % keysize)
generate = True