AVR-Crypto-Lib/en: Unterschied zwischen den Versionen

Aus LaborWiki
Wechseln zu: Navigation, Suche
(Short Facts)
K (+update tables)
Zeile 61: Zeile 61:
  
 
==Facts==
 
==Facts==
 
+
===Blockchiphers===
===Blockciphers===
+
{| {{Prettytable}} class="wikitable sortable" style="text-align:right"
{| {{Prettytable}}
+
! align="center" style="background:#f0f0f0;"| Name
| align="center" style="background:#f0f0f0;"|'''name'''
+
! align="center" style="background:#f0f0f0;"| Variants
| align="center" style="background:#f0f0f0;"|'''variant'''
+
! align="center" style="background:#f0f0f0;"| Language
| align="center" style="background:#f0f0f0;"|'''language'''
+
! align="center" style="background:#f0f0f0;"| Size (flash) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (context) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (stack) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Keylength (Bits)
| align="center" style="background:#f0f0f0;"|'''keysize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Blocksize (Bits)
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Time (initialisation)
| align="center" style="background:#f0f0f0;"|'''time (initalisation)'''
+
! align="center" style="background:#f0f0f0;"| Time (encryption)
| align="center" style="background:#f0f0f0;"|'''time (encrypt)'''
+
! align="center" style="background:#f0f0f0;"| Time (decryption)
| align="center" style="background:#f0f0f0;"|'''time (decrypt)'''
+
! align="center" style="background:#f0f0f0;"| Attacs
| align="center" style="background:#f0f0f0;"|'''attacks'''
+
! align="center" style="background:#f0f0f0;"| Paper
| align="center" style="background:#f0f0f0;"|'''paper'''
+
! align="center" style="background:#f0f0f0;"| Licenses / Patents
| align="center" style="background:#f0f0f0;"|'''license / patents'''
 
 
|-
 
|-
| Camellia||C||C|| ||32|| ||128||128|| || || || || ||
+
| Camellia||C||C|| ||32|| || 128||128|| || || || || ||
 
|-
 
|-
 
| Camellia||C+Asm||C+Asm||5803||32|| ||128||128|| || || || || ||
 
| Camellia||C+Asm||C+Asm||5803||32|| ||128||128|| || || || || ||
 
|-
 
|-
| Cast5||C||C||14108||75|| ||0-128||64||13739||12550||13109|| || ||
+
| Cast5||C||C||14128||75|| ||0 128||64||13742||12550||13109|| || ||
 
|-
 
|-
| RC5||RC5-32/r/b||C||1524||3+(8*#Runden+1)|| ||1 – 2040||64||79352||7827||7223|| || ||
+
| RC5||RC5-32/r/b||C||1524||3+(8*#rounds+1)|| ||1 – 2040||64||79352||7827||7223|| || ||
 
|-
 
|-
| RC6||RC6-32/r/b||C||2656||19+(8*#Runden)|| ||1 – 2040||128||139940||26600||25986|| || ||
+
| RC6||RC6-32/r/b||C||2656||19+(8*#rounds)|| ||1 – 2040||128||139940||26600||25986|| || ||
 
|-
 
|-
| Noekeon||C||C|| ||0 (16)|| ||128||128|| || || || || ||
+
| Noekeon||C||C||1438||0 (16)|| ||128||128||26037||25798||26396|| || ||
 
|-
 
|-
| Noekeon||Asm||Asm||850||0 (16)|| ||128||128||10566||10340||10895|| || ||
+
| Noekeon||Asm||Asm||774||0 (16)|| ||128||128||10416||10191||10745|| || ||
 
|-
 
|-
| DES||C||C||2480||0|| ||56||64|| || || || || ||
+
| DES||C||C||2480||0|| ||56||64||||284952||284977|| || ||
 
|-
 
|-
| TDES||C||C||2480||0|| ||168||64||0||852082||852107|| || ||
+
| TDES||C||C||2480||0|| ||168||64||||852082||852107|| || ||
 
|-
 
|-
| Serpent||Non-bitslice||C|| ||528|| ||1 – 256||128|| || || || || ||
+
| Serpent||Non-bitslice||C||2862||528|| ||1 – 256||128||537021||492884||493004|| || ||
 
|-
 
|-
| Serpent||bitslice||C||4498||528|| ||1-256||128||102098||70827||70462|| || ||
+
| Serpent||bitslice||C||4498||528|| ||1 256||128||102098||70827||70462|| || ||
 
|-
 
|-
| Skipjack||C||C||1244||0|| ||80||64|| || || || || ||
+
| Skipjack||C||C||1244||0|| ||80||64|| ||38109||38450|| || ||
 
|-
 
|-
 
| Present||C||C||1514||256|| ||80||64||30395||105796||151624|| || ||
 
| Present||C||C||1514||256|| ||80||64||30395||105796||151624|| || ||
Zeile 107: Zeile 106:
 
| SEED||C||C|| ||16|| ||128||128|| || || || || ||
 
| SEED||C||C|| ||16|| ||128||128|| || || || || ||
 
|-
 
|-
| SEED||C+Asm||C+Asm||4052||16|| ||128||128|| || || || || ||
+
| SEED||C+Asm||C+Asm||4052||16|| ||128||128||129||50086||49808|| || ||
 
|-
 
|-
| XTEA||C||C|| ||0|| ||128||64|| || || || || ||
+
| XTEA||C||C||754||0|| ||128||64||||9912||9789|| || ||
 
|-
 
|-
| XTEA||Asm||Asm||504||0|| ||128||64|| || || || || ||
+
| XTEA||Asm||Asm||504||0|| ||128||64||||7687||7688|| || ||
 
|-
 
|-
 
| Shabea||C||C||2020||0||||0 – infinit||256|| || || || || ||
 
| Shabea||C||C||2020||0||||0 – infinit||256|| || || || || ||
 +
|-class="sortbottom"
 +
! align="center" style="background:#f0f0f0;"| Name
 +
! align="center" style="background:#f0f0f0;"| Variants
 +
! align="center" style="background:#f0f0f0;"| Language
 +
! align="center" style="background:#f0f0f0;"| Size (flash) (Bytes)
 +
! align="center" style="background:#f0f0f0;"| Size (context) (Bytes)
 +
! align="center" style="background:#f0f0f0;"| Size (stack) (Bytes)
 +
! align="center" style="background:#f0f0f0;"| Keylength (Bits)
 +
! align="center" style="background:#f0f0f0;"| Blocksize (Bits)
 +
! align="center" style="background:#f0f0f0;"| Time (initialisation)
 +
! align="center" style="background:#f0f0f0;"| Time (encryption)
 +
! align="center" style="background:#f0f0f0;"| Time (decryption)
 +
! align="center" style="background:#f0f0f0;"| Attacs
 +
! align="center" style="background:#f0f0f0;"| Paper
 +
! align="center" style="background:#f0f0f0;"| Licenses / Patents
 
|}
 
|}
  
===Streamchiphers===
+
===Streamciphers===
{| {{prettytable}}
+
{| {{Prettytable}} class="wikitable sortable" style="text-align:right"
| align="center" style="background:#f0f0f0;"|'''name'''
+
! align="center" style="background:#f0f0f0;"| Name
| align="center" style="background:#f0f0f0;"|'''variant'''
+
! align="center" style="background:#f0f0f0;"| Variants
| align="center" style="background:#f0f0f0;"|'''language'''
+
! align="center" style="background:#f0f0f0;"| Language
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (flash) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (context) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (stack) (Bytes)
| align="center" style="background:#f0f0f0;"|'''keysize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Keylength (Bits)
| align="center" style="background:#f0f0f0;"|'''output size (bits)'''
+
! align="center" style="background:#f0f0f0;"| Outputsize (Bits)
| align="center" style="background:#f0f0f0;"|'''time (initialisation)'''
+
! align="center" style="background:#f0f0f0;"| Time (initialisation)
| align="center" style="background:#f0f0f0;"|'''time (generation)'''
+
! align="center" style="background:#f0f0f0;"| Time (generation)
| align="center" style="background:#f0f0f0;"|'''attacks'''
+
! align="center" style="background:#f0f0f0;"| Attacs
| align="center" style="background:#f0f0f0;"|'''paper'''
+
! align="center" style="background:#f0f0f0;"| Paper
| align="center" style="background:#f0f0f0;"|'''license / patents'''
+
! align="center" style="background:#f0f0f0;"| Licenses / Patents
 
|-
 
|-
| ARCFOUR ||C  ||C  ||   ||258|| ||0 – 2040||8|| || || || ||
+
| ARCFOUR||C  ||C  ||230||258|| ||0 – 2040||8|| || || || ||
 
|-
 
|-
| ARCFOUR ||Asm||Asm||122||258|| ||0 – 2040||8|| || || || ||
+
| ARCFOUR||Asm||Asm||122||258|| ||0 – 2040||8|| || || || ||
 
|-
 
|-
| Trivium ||C  ||C  ||424|| 36|| ||      80||1|| || || || ||
+
| Trivium||C  ||C  ||424|| 36|| ||      80||1|| || || || ||
 
|-
 
|-
| Grain   ||C  ||C  ||778|| 20|| ||      80||1|| || || || ||
+
| Grain ||C  ||C  ||778|| 20|| ||      80||1|| || || || ||
 
|}
 
|}
  
 
===Hashes===
 
===Hashes===
{| {{prettytable}}
+
{| {{prettytable}} class="wikitable sortable" style="text-align:right"
| align="center" style="background:#f0f0f0;"|'''name'''
+
! align="center" style="background:#f0f0f0;"| Name
| align="center" style="background:#f0f0f0;"|'''variant'''
+
! align="center" style="background:#f0f0f0;"| Variants
| align="center" style="background:#f0f0f0;"|'''language'''
+
! align="center" style="background:#f0f0f0;"| Language
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (flash) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (context) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (stack) (Bytes)
| align="center" style="background:#f0f0f0;"|'''hashsize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Hashsize (Bits)
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Blocksize (Bits)
| align="center" style="background:#f0f0f0;"|'''time (initialsation)'''
+
! align="center" style="background:#f0f0f0;"| Time (initialisation)
| align="center" style="background:#f0f0f0;"|'''time (per block)'''
+
! align="center" style="background:#f0f0f0;"| Time (per block)
| align="center" style="background:#f0f0f0;"|'''time (finalisation)'''
+
! align="center" style="background:#f0f0f0;"| Time (finalisation)
| align="center" style="background:#f0f0f0;"|'''attacks'''
+
! align="center" style="background:#f0f0f0;"| Attacs
| align="center" style="background:#f0f0f0;"|'''paper'''
+
! align="center" style="background:#f0f0f0;"| Paper
| align="center" style="background:#f0f0f0;"|'''license / patents'''
+
! align="center" style="background:#f0f0f0;"| Licenses / Patents
 
|-
 
|-
| SHA-256||C  ||C  ||   ||40|| ||256||512|| || || || || ||
+
| SHA-256||C  ||C  ||3428||40|| ||256||512||257||179184||183576|| || ||
 
|-
 
|-
| SHA-256||Asm||Asm||1600||40|| ||256||512|| || || || || ||
+
| SHA-256||Asm||Asm||1600||40|| ||256||512||314||53386||53791|| || ||
 
|-
 
|-
| SHA-1  ||C  ||C  ||   ||28|| ||160||512|| || || || || ||
+
| SHA-1  ||C  ||C  ||2774||28|| ||160||512||91||81344||85736|| || ||
 
|-
 
|-
| SHA-1  ||Asm||Asm||1070||28|| ||160||512|| || || || || ||
+
| SHA-1  ||Asm||Asm||1070||28|| ||160||512||218||40330||40735|| || ||
 
|-
 
|-
| MD5    ||C  ||C  ||2086||20|| ||128||512|| || || || || ||
+
| MD5    ||C  ||C  ||2086||20|| ||128||512||71||41786||42358|| || ||
 
|}
 
|}
  
 
===MACs===
 
===MACs===
{| {{prettytable}}
+
{| {{Prettytable}} class="wikitable sortable" style="text-align:right"
| align="center" style="background:#f0f0f0;"|'''name'''
+
! align="center" style="background:#f0f0f0;"| Name
| align="center" style="background:#f0f0f0;"|'''variant'''
+
! align="center" style="background:#f0f0f0;"| Variants
| align="center" style="background:#f0f0f0;"|'''language'''
+
! align="center" style="background:#f0f0f0;"| Language
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (flash) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (context) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (stack) (Bytes)
| align="center" style="background:#f0f0f0;"|'''keysize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Keylength (Bits)
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Blocksize (Bits)
| align="center" style="background:#f0f0f0;"|'''time (initialisation)'''
+
! align="center" style="background:#f0f0f0;"| Time (initialisation)
| align="center" style="background:#f0f0f0;"|'''time (per block)'''
+
! align="center" style="background:#f0f0f0;"| Time (per block)
| align="center" style="background:#f0f0f0;"|'''time (finalisation)'''
+
! align="center" style="background:#f0f0f0;"| Time (finalisation)
| align="center" style="background:#f0f0f0;"|'''attacks'''
+
! align="center" style="background:#f0f0f0;"| Attacs
| align="center" style="background:#f0f0f0;"|'''paper'''
+
! align="center" style="background:#f0f0f0;"| Paper
| align="center" style="background:#f0f0f0;"|'''license / patents'''
+
! align="center" style="background:#f0f0f0;"| Licenses / Patents
 
|-
 
|-
 
| HMAC-SHA256|| ||C||2712||40|| || any || 512 || || || || || ||
 
| HMAC-SHA256|| ||C||2712||40|| || any || 512 || || || || || ||
 +
|-
 +
| HMAC-SHA1  || ||C||2182||28|| || any || 512 || || || || || ||
 
|}
 
|}
  
 
===PRNGs===
 
===PRNGs===
{| {{prettytable}}
+
{| {{Prettytable}} class="wikitable sortable" style="text-align:right"
| align="center" style="background:#f0f0f0;"|'''name'''
+
! align="center" style="background:#f0f0f0;"| Name
| align="center" style="background:#f0f0f0;"|'''variant'''
+
! align="center" style="background:#f0f0f0;"| Variants
| align="center" style="background:#f0f0f0;"|'''language'''
+
! align="center" style="background:#f0f0f0;"| Language
| align="center" style="background:#f0f0f0;"|'''size (flash) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (flash) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (context) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (context) (Bytes)
| align="center" style="background:#f0f0f0;"|'''size (stack) (bytes)'''
+
! align="center" style="background:#f0f0f0;"| Size (stack) (Bytes)
| align="center" style="background:#f0f0f0;"|'''blocksize (bits)'''
+
! align="center" style="background:#f0f0f0;"| Blocksize (Bits)
| align="center" style="background:#f0f0f0;"|'''time (input)'''
+
! align="center" style="background:#f0f0f0;"| Time (input processing)
| align="center" style="background:#f0f0f0;"|'''time (output)'''
+
! align="center" style="background:#f0f0f0;"| Time (output generation)
| align="center" style="background:#f0f0f0;"|'''attacks'''
+
! align="center" style="background:#f0f0f0;"| Attacs
| align="center" style="background:#f0f0f0;"|'''paper'''
+
! align="center" style="background:#f0f0f0;"| Paper
| align="center" style="background:#f0f0f0;"|'''license / patents'''
+
! align="center" style="background:#f0f0f0;"| Licenses / Patents
 
|-
 
|-
 
| Entropium|| ||C||2174||64|| ||256|| || || || ||
 
| Entropium|| ||C||2174||64|| ||256|| || || || ||
 
|}
 
|}

Version vom 6. August 2008, 14:58 Uhr


UC-Crypto-logo.png

Where can I find it?

SVN: [1]

via Track (also svn, but suitable for direct browsing):[2]

Short Facts

  • small implementation of cryptographic algorithms in C (quite protable)
  • even smaller implementations in assembly language (ATmega, gnu-avr-as)
  • allfunctions are reentrant (except functions of the PRNG "Entopium")
  • license: GPLv3 (nearly everything) (for different licensing contact author)

About

Crypto-avr-lib is a set of implementations of different cryptographic primitives. Due to the special limitations of microcontrollers (very raw space, RAM and flash are ranging from a few bytes to a few KiB) reference or "normal" optimised implementations are not useable. Therefor we try to provide special implementations which respect the extrem limited resources of microcontroller applications.

What should be done

symmetric

block aes cast6 twofish idea kasumi
stream seal A5/1 Turing Rabbit
hashes ripemd whirlpool

What we have

symmetric

block

  • XTEA
  • CAST5
  • Camellia
  • Skipjack
  • Noekeon
  • RC5
  • RC6
  • SEED
  • DES
  • TDES (aka EDE-DES, 3DES)
  • SHABEA
  • Serpent
  • Present

stream

  • ARCFOUR (RC4 kompatibel)
  • Trivium
  • Grain

hashes

  • SHA-256
  • SHA-1
  • MD5

others

  • HMAC-SHA256 (following RFC 2104)
  • PRNG

Facts

Blockchiphers

Name Variants Language Size (flash) (Bytes) Size (context) (Bytes) Size (stack) (Bytes) Keylength (Bits) Blocksize (Bits) Time (initialisation) Time (encryption) Time (decryption) Attacs Paper Licenses / Patents
Camellia C C 32 128 128
Camellia C+Asm C+Asm 5803 32 128 128
Cast5 C C 14128 75 0 – 128 64 13742 12550 13109
RC5 RC5-32/r/b C 1524 3+(8*#rounds+1) 1 – 2040 64 79352 7827 7223
RC6 RC6-32/r/b C 2656 19+(8*#rounds) 1 – 2040 128 139940 26600 25986
Noekeon C C 1438 0 (16) 128 128 26037 25798 26396
Noekeon Asm Asm 774 0 (16) 128 128 10416 10191 10745
DES C C 2480 0 56 64 284952 284977
TDES C C 2480 0 168 64 852082 852107
Serpent Non-bitslice C 2862 528 1 – 256 128 537021 492884 493004
Serpent bitslice C 4498 528 1 – 256 128 102098 70827 70462
Skipjack C C 1244 0 80 64 38109 38450
Present C C 1514 256 80 64 30395 105796 151624
SEED C C 16 128 128
SEED C+Asm C+Asm 4052 16 128 128 129 50086 49808
XTEA C C 754 0 128 64 9912 9789
XTEA Asm Asm 504 0 128 64 7687 7688
Shabea C C 2020 0 0 – infinit 256
Name Variants Language Size (flash) (Bytes) Size (context) (Bytes) Size (stack) (Bytes) Keylength (Bits) Blocksize (Bits) Time (initialisation) Time (encryption) Time (decryption) Attacs Paper Licenses / Patents

Streamciphers

Name Variants Language Size (flash) (Bytes) Size (context) (Bytes) Size (stack) (Bytes) Keylength (Bits) Outputsize (Bits) Time (initialisation) Time (generation) Attacs Paper Licenses / Patents
ARCFOUR C C 230 258 0 – 2040 8
ARCFOUR Asm Asm 122 258 0 – 2040 8
Trivium C C 424 36 80 1
Grain C C 778 20 80 1

Hashes

Name Variants Language Size (flash) (Bytes) Size (context) (Bytes) Size (stack) (Bytes) Hashsize (Bits) Blocksize (Bits) Time (initialisation) Time (per block) Time (finalisation) Attacs Paper Licenses / Patents
SHA-256 C C 3428 40 256 512 257 179184 183576
SHA-256 Asm Asm 1600 40 256 512 314 53386 53791
SHA-1 C C 2774 28 160 512 91 81344 85736
SHA-1 Asm Asm 1070 28 160 512 218 40330 40735
MD5 C C 2086 20 128 512 71 41786 42358

MACs

Name Variants Language Size (flash) (Bytes) Size (context) (Bytes) Size (stack) (Bytes) Keylength (Bits) Blocksize (Bits) Time (initialisation) Time (per block) Time (finalisation) Attacs Paper Licenses / Patents
HMAC-SHA256 C 2712 40 any 512
HMAC-SHA1 C 2182 28 any 512

PRNGs

Name Variants Language Size (flash) (Bytes) Size (context) (Bytes) Size (stack) (Bytes) Blocksize (Bits) Time (input processing) Time (output generation) Attacs Paper Licenses / Patents
Entropium C 2174 64 256