modyfied copyright

This commit is contained in:
bg 2008-07-03 04:11:34 +00:00
parent 96ebafd201
commit 6bca96e560
22 changed files with 2054 additions and 2235 deletions

9
A5_1.c
View File

@ -17,10 +17,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* File: A5_1.c
* Author: Daniel Otte
* Date: 24.06.2006
* License: GPL
* File: A5_1.c
* Author: Daniel Otte
* email: daniel.otte@rub.de
* Date: 2006-06-24
* License: GPLv3 or later
* Description: Implementation of the A5/1 stream cipher algorithm, as used in GSM.
* ! Warning, this is weak crypto !
*

View File

@ -30,6 +30,10 @@ PRG = remove_me
#-------------------------------------------------------------------------------
all: $(foreach algo, $(ALGORITHMS), $(algo)_OBJ)
#-------------------------------------------------------------------------------
define BLA_TEMPLATE2
$(2): $(3)
@echo "[gcc]: $$@"
@ -151,11 +155,6 @@ $(foreach algo, $(ALGORITHMS),$(eval $(call FLASH_TEMPLATE, $(algo), \
$(patsubst %.o,%.hex,$(firstword $($(algo)_TEST_BIN)))) ))
#-------------------------------------------------------------------------------
.PHONY: all
all: $(foreach algo, $(ALGORITHMS), $(algo)_OBJ)
#all: $(PRG).elf lst text eeprom
.PHONY: clean
clean:

View File

@ -17,10 +17,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* File: arcfour-asm.S
* Author: Daniel Otte
* Date: 07.06.2006
* License: GPL
* File: arcfour-asm.S
* Author: Daniel Otte
* Date: 2006-07-06
* License: GPLv3 or later
* Description: Implementation of the ARCFOUR (RC4 compatible) stream cipher algorithm.
*
*/

View File

@ -17,10 +17,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* File: arcfour.c
* Author: Daniel Otte
* Date: 07.06.2006
* License: GPL
* File: arcfour.c
* Author: Daniel Otte
* email: daniel.otte@rub.de
* Date: 2006-06-07
* License: GPLv3 or later
* Description: Implementation of the ARCFOUR (RC4 compatible) stream cipher algorithm.
*
*/

View File

@ -17,10 +17,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* File: camellis-asm.S
* Author: Daniel Otte
* Date: 10.11.2006
* License: GPL
* File: camellis-asm.S
* Author: Daniel Otte
* Date: 2006-11-10
* License: GPLv3 or later
* Description: Implementation of the camellia block cipher algorithm.
*
*/

View File

@ -19,9 +19,10 @@
/*
* \file cast5.c
* \author Daniel Otte
* \date 26.07.2006
* \email daniel.otte@rub.de
* \date 2006-07-26
* \par License:
* GPL
* GPLv3 or later
* \brief Implementation of the CAST5 (aka CAST-128) cipher algorithm as described in RFC 2144
*
*/

2
cli.c
View File

@ -20,7 +20,7 @@
*
* author: Daniel Otte
* email: daniel.otte@rub.de
* license: GPLv3
* license: GPLv3 or later
*
* components to help implementing simple command based interaction
*

11
des.c
View File

@ -17,12 +17,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file des.c
* \author Daniel Otte
* \date 2007-06-16
* \brief DES and EDE-DES implementation
* \file des.c
* \author Daniel Otte
* \email daniel.otte@rub.de
* \date 2007-06-16
* \brief DES and EDE-DES implementation
* \par License
* GPL
* GPLv3 or later
*
*/
#include "config.h"

View File

@ -17,11 +17,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file entropium.c
* \author Daniel Otte
* \date 17.05.2006
* \file entropium.c
* \author Daniel Otte
* \email daniel.otte@rub.de
* \date 2006-05-17
* \par License:
* GPL
* GPLv3 or later
* \brief This file contains an implementaition of a pseudo-random-number generator.
*
* Extension 1:

View File

@ -20,7 +20,7 @@
*
* author: Daniel Otte
* email: daniel.otte@rub.de
* license: GPLv3
* license: GPLv3 or later
*
*/

View File

@ -1,60 +0,0 @@
/**
*
* author: Daniel Otte
* email: daniel.otte@rub.de
* license: GPLv3
*
* this program generate a lookuptable for the h-function in grain
*/
#include <stdint.h>
#include <stdio.h>
#define X(i) ((x)>>((i)))
uint8_t h(uint8_t x){
uint8_t h;
h = (X(1)) ^ (X(4)) ^
(X(0)&X(3)) ^ (X(2)&X(3)) ^ (X(3)&X(4)) ^
(X(0)&X(1)&X(2)) ^ (X(0)&X(2)&X(3)) ^ (X(0)&X(2)&X(4)) ^
(X(1)&X(2)&X(4)) ^ (X(2)&X(3)&X(4)) ;
return h&1;
}
int main(void){
uint8_t i;
uint32_t lut;
puts(
"/* \n"
" * author: Daniel Otte \n"
" * email: daniel.otte@rub.de \n"
" * license: GPLv3 \n"
" * \n"
" * this program generate a lookuptable for the h-function in grain \n"
" * \n"
" */ \n");
puts("/* \n"
" * x0 x1 x2 x3 x4 - h");
for(i=0; i<0x20; ++i){
printf(" * %c %c %c %c %c - %c\n",
(i&0x01)?'1':'0',
(i&0x02)?'1':'0',
(i&0x04)?'1':'0',
(i&0x08)?'1':'0',
(i&0x10)?'1':'0',
(h(i))?'1':'0' );
lut >>=1;
lut |= h(i)?0x80000000:0x00000000;
if(i%4==3){
puts(" * --");
}
}
puts(" */\n");
printf(" uint8_t lut[4]= {0x%2.2X, 0x%2.2X, 0x%2.2X, 0x%2.2X} \n",
lut&0xFF, (lut>>8)&0xFF, (lut>>16)&0xFF, (lut>>24)&0xFF);
return 0;
}

View File

@ -1,91 +0,0 @@
/**
*
* author: Daniel Otte
* email: daniel.otte@rub.de
* license: GPLv3
*
* this program generate a lookuptable for the nfsr-feedback-function in grain
*/
#include <stdint.h>
#include <stdio.h>
#define X(i) ((x)>>((i)))
#define B63 X(0)
#define B60 X(3)
#define B52 X(5)
#define B45 X(6)
#define B37 X(4)
#define B33 X(8)
#define B28 X(2)
#define B21 X(9)
#define B15 X(1)
#define B09 X(7)
uint8_t g(uint16_t x){
uint8_t a,b,d,e;
uint8_t ret;
ret = B60 ^ B52 ^ B45 ^ B37 ^ B33 ^ B28 ^ B21 ^ B09;
ret ^= (a = B63 & B60);
ret ^= (b = B37 & B33);
ret ^= B15 & B09;
ret ^= (d = B60 & B52 & B45);
ret ^= (e = B33 & B28 & B21);
ret ^= B63 & B45 & B28 & B09;
ret ^= b & B60 & B52;
ret ^= a & B21 & B15;
ret ^= d & B63 & B37;
ret ^= e & B15 & B09;
ret ^= e & B52 & B45 & B37;
return ret&1;
}
int main(void){
uint16_t i;
uint8_t t, lut[128]={0}; /* 2**10 / 8 == 2**(10-3) == 2**7 == 128 */
puts(
"/* \n"
" * author: Daniel Otte \n"
" * email: daniel.otte@rub.de \n"
" * license: GPLv3 \n"
" * \n"
" * this program generate a lookuptable for the h-function in grain \n"
" * \n"
" */ \n");
puts("/* \n"
" * b63 b15 b28 b60 b37 b52 b45 b09 b33 b21 - g");
for(i=0; i<0x0400; ++i){
t = g(i);
printf(" * %c %c %c %c %c %c %c %c %c %c - %c\n",
(i&0x01)?'1':'0',
(i&0x02)?'1':'0',
(i&0x04)?'1':'0',
(i&0x08)?'1':'0',
(i&0x10)?'1':'0',
(i&0x20)?'1':'0',
(i&0x40)?'1':'0',
(i&0x80)?'1':'0',
(i&0x0100)?'1':'0',
(i&0x0200)?'1':'0',
t?'1':'0' );
lut[i/8] |= t<<(i%8);
// if(i%4==3){
// puts(" * --");
// }
}
puts(" */\n");
printf(" uint8_t g_lut[128]= {");
for(i=0; i<128; ++i){
if(i%16==0){
printf("\n\t");
}
printf("0x%2.2X%c ", lut[i], (i!=127)?',':' ');
}
printf("};\n\n");
return 0;
}

View File

@ -19,9 +19,9 @@
/**
*
* implementation of HMAC as described in RFC2104
* Author: Daniel Otte
*
* License: GPL
* Author: Daniel Otte
* email: daniel.otte@rub.de
* License: GPLv3 or later
**/
/*

View File

@ -18,11 +18,12 @@
*/
/**
* \file main-seed-test.c
* \author Daniel Otte
* \author Daniel Otte
* \email daniel.otte@rub.de
* \date 2007-06-01
* \brief test suit for SEED
* \par License
* GPL
* GPLv3 or later
*
*/
#include "config.h"

View File

@ -22,7 +22,7 @@
* \date 2007-06-07
* \brief test suit for SHABEA
* \par License
* GPL
* GPLv3 or later
*
*/
#include "config.h"

4
md5.c
View File

@ -19,9 +19,9 @@
/*
* \file md5.c
* \author Daniel Otte
* \date 31.07.2006
* \date 2006-07-31
* \par License:
* GPL
* GPLv3 or later
* \brief Implementation of the MD5 hash algorithm as described in RFC 1321
*
*/

View File

@ -19,7 +19,7 @@
/*
* author: Daniel Otte
* email: daniel.otte@rub.de
* license: GPLv3
* license: GPLv3 or later
*
*
*

View File

@ -1,35 +0,0 @@
/**
*
* author: Daniel Otte
* email: daniel.otte@rub.de
* license: GPLv3
*
*/
#include <stdio.h>
#include <stdint.h>
uint8_t getnextrc(uint8_t a){
if((a&0x80) != 0){
return (a<<1) ^ 0x1B;
} else {
return (a<<1);
}
}
#define N 32
int main(void){
uint8_t c=0x80;
uint32_t i;
puts("\nNoekeon Round Constants:");
for(i=0; i<N; ++i){
printf(" 0x%2.2X,", c);
if(i%8==7){
puts("");
}
c=getnextrc(c);
}
return 0;
}

View File

@ -22,7 +22,7 @@
* \date 2007-06-1
* \brief SEED parts in assembler for AVR
* \par License
* GPL
* GPLv3 or later
*
*/
SPL = 0x3D

1954
sha1-asm.S

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,9 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* xtea-asm.S
* Author: Daniel Otte
* Date: 06.06.2006
* License: GPL
* Author: Daniel Otte
* Date: 2006-06-06
* License: GPLv3 or later
* Implementation of XTEA for AVR
* include xtea.h in your C-Project to use this functions.
*/