AVR-Crypto-Lib/en

Aus LaborWiki

Wechseln zu: Navigation, Suche


Eine deutsche Version dieses Artikels ist unter AVR-Crypto-Lib verfügbar.


This project will move in the near future to a new server and will get
its own repository and a wiki. At that point we will also migrate it from
subversion to bazaar.
Stay tuned.

WARNING: Some of the timings given in the tables below seem to be wrong!
         Do not rely on those figures!

[Bearbeiten] Where can I find it?

[Bearbeiten] new repository

BZR: [1] Use

 bzr co http://avrcryptolib.das-labor.org/bzr .

to get a copy in your current directory

There is also a nightly build tar ball available at [2]

Some Docu will be collected at a new wiki dedicated to this project: [3]


[Bearbeiten] old repository

SVN: [4]

via Trac (also svn, but suitable for direct browsing):[5]

[Bearbeiten] Short Facts

  • small implementation of cryptographic algorithms in C (quite portable)
  • 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 the author)

[Bearbeiten] About

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

[Bearbeiten] What should be done

[Bearbeiten] symmetric

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

[Bearbeiten] What we have

[Bearbeiten] blockciphers

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

[Bearbeiten] streamciphers

  • ARCFOUR (RC4 compatible)
  • Trivium
  • Grain
  • MUGI

[Bearbeiten] hashes

  • Blake
  • BlueMidnightWish
  • Grøstl
  • MD5
  • SHA-256
  • SHA-1
  • SHABAL
  • Skein
  • Twister

[Bearbeiten] others

[Bearbeiten] Facts

[Bearbeiten] Blockchiphers

Name Variant Language Size (Flash) (Bytes) Size (Context) (Bytes) Size (Stack) (Bytes) Keysize (Bits) Blockize (Bits) Cycles (Initialisation) Cycles (Encryption) Cycles (Decryption) Nessie test Attacs Paper License / Patents
AES 128 C 2668176 128128 4632 21279 39340 ok
AES 192 C 2668208 192128 5082 25724 47799 ok
AES 256 C 2668240 256128 6161 30174 56253 ok
AES 128 Asm 2070176 128128 2039 2555 6764 unconfirmed
AES 192 Asm 2070208 128128 2267 3039 8164 unconfirmed
AES 256 Asm 2070240 128128 2852 3521 9562 unconfirmed
AES 128-fastdecAsm 2580176 128128 2039 2555 3193 unconfirmed
AES 192-fastdecAsm 2580208 128128 2267 3039 3819 unconfirmed
AES 256-fastdecAsm 2580240 128128 2852 3521 4443 unconfirmed
CamelliaC C 8694 32 128128 10190 43200 44066 unconfirmed
CamelliaC+AsmC+Asm 4088 32 128128 11115 10185 10217 unconfirmed
Cast5 C C 1431275 0 – 12864 137421255013109 unconfirmed
RC5 RC5-32/r/bC16503+(8*#rounds+1) 1 – 2040 79352 7827 7223 unconfirmed US-Patent 5,724,428 expires: 03/03/2015
RC6RC6-32/r/bC278019+(8*#rounds) 1 – 2040128 1399402660025986 unconfirmed
NoekeonCC16160 (16) 128128 260372579826396 unconfirmed
NoekeonAsmAsm7740 (16) 128128 104161019110745 unconfirmed
DESCC26420 5664 284952284977 unconfirmed
TDESCC26420 16864852082852107 unconfirmed
SerpentNon-bitsliceC3064528 1 – 256128537021492884493004 unconfirmed
SerpentNon-bitslice, smallAsm1290528 1 – 256128114844105771105871 unconfirmed
SerpentNon-bitslice, fast Asm1400528 1 – 256128110582101648101743 unconfirmed
SerpentbitsliceC4482528 1 – 2561281020987082770462 unconfirmed
SkipjackCC11440 80643810938450 unconfirmed
PresentCC1514256 806430395105796151624 unconfirmed
SEEDCC 372616 128128 18156906 56427 unconfirmed
SEEDAsmAsm165616 1281281811140111394 unconfirmed
XTEACC8200 1286499129789 unconfirmed
XTEAAsmAsm5040 1286476877688 unconfirmed
ShabeaCC198800 – infinit256 unconfirmed
Threefish-256AsmAsm506864 256256 3754093640912 unconfirmed
Threefish-512AsmAsm506896 512512 5479302093240 unconfirmed
Threefish-1024AsmAsm5068160 10241024 892220606218694 unconfirmed
Threefish-256 C C 1975264 256256 806229592223251 unconfirmed
Threefish-512 C C 1975296 512512 1299453625440279 unconfirmed
Threefish-1024 C C 19752160 10241024 226710330561010445 unconfirmed
Name Variant Language Size (Flash) (Bytes) Size (Context) (Bytes) Size (Stack) (Bytes) Keysize (Bits) Blockize (Bits) Cycles (Initialisation) Cycles (Encryption) Cycles (Decryption) Nessie test Attacs Paper License / Patents


[Bearbeiten] Streamciphers

Name Variant Language Size (Flash) (Bytes) Size (Context) (Bytes) Size (Stack) (Bytes) Keysize (Bits) Output size (Bits) Cycles (Initialisation) Cycles (Generation) Attacs Paper License / Patents
ARCFOURC C 230258 8 – 20408 64086 56
ARCFOURAsmAsm112258 8 – 20408 6689 42
TriviumC C 424 36 801 775726 665
Grain C C 778 20 801 107366 617
MUGI C C 3500152 128641138864105


[Bearbeiten] Hashes

Name Variant Language Size (Flash) (Bytes) Size (Context) (Bytes) Size (Stack) (Bytes) Hashsize (Bits) Blockize (Bits) Cycles (Initialisation) Cycles (per block) Cycles (per byte) Cycles (Finalisation) Attacs Paper License / Patents
Blake-28 C C 3844 53 224 512 373 7002 109.41 8032
Blake-32 C C 3844 53 256 512 374 7002 109.41 8100
Blake-48 C C 7444 101 384 1024 904 29987 234.27 35709
Blake-64 C C 7444 101 512 1024 905 29987 234.27 38219
BlueMidnightWish-224 C C 6024 68 224 512 434 4324 67.56 5801
BlueMidnightWish-256 C C 6024 68 256 512 434 4317 67.45 5829
BlueMidnightWish-384 C C 15128 132 384 1024 1967 58353 455.88 57419
BlueMidnightWish-512 C C 15128 132 512 1024 1968 58353 455.88 57538
MD5 C C 2494 20 128 512 69 42863 669.73 43607
MD5 asm asm 1686 20 128 512 69 18265 285.39 18861
SHA-1 C C 2596 28 160 512 89 15622 244.09 19835
SHA-1 asm asm 1070 28 160 512 215 40595 634.30 41180
SHA-256 C C 2910 40 256 512 255 49632 775.50 53840
SHA-256 asm asm 1604 40 256 512 335 54334 848.97 55025
Shabal-192 C C 2290 188 192 512 1547 59601 931.27 37261
Shabal-192 asm asm 1580 188 192 512 1059 13708 214.19 51707
Shabal-224 C C 2290 188 224 512 1547 59601 931.27 37293
Shabal-224 asm asm 1580 188 224 512 1059 13708 214.19 51735
Shabal-256 C C 2290 188 256 512 1547 59601 931.27 37325
Shabal-256 asm asm 1580 188 256 512 1059 13708 214.19 51763
Shabal-384 C C 2290 188 384 512 1547 59608 931.38 37453
Shabal-384 asm asm 1580 188 384 512 1059 13708 214.19 51875
Shabal-512 C C 2290 188 512 512 1547 59608 931.38 37581
Shabal-512 asm asm 1578 188 512 512 1059 13708 214.19 51985
Skein-1024-1024 C C 6472 146 1024 1024 56657 51864 405.19 104945
Skein-1024-1024 asm asm 2486 146 1024 1024 28983 26256 205.12 51980
Skein-1024-128 C C 6472 146 128 1024 56657 51871 405.24 104049
Skein-1024-128 asm asm 2486 146 128 1024 28983 26263 205.18 51194
Skein-1024-160 C C 6472 146 160 1024 56657 51871 405.24 104081
Skein-1024-160 asm asm 2486 146 160 1024 28983 26256 205.12 51222
Skein-1024-224 C C 6472 146 224 1024 56657 51871 405.24 104145
Skein-1024-224 asm asm 2486 146 224 1024 28983 26256 205.12 51285
Skein-1024-256 C C 6472 146 256 1024 56657 51871 405.24 104177
Skein-1024-256 asm asm 2486 146 256 1024 28983 26263 205.18 51306
Skein-1024-384 C C 6472 146 384 1024 56657 51864 405.19 104305
Skein-1024-384 asm asm 2486 146 384 1024 28976 26263 205.18 51418
Skein-1024-512 C C 6472 146 512 1024 56657 51864 405.19 104433
Skein-1024-512 asm asm 2486 146 512 1024 28983 26256 205.12 51530
Skein-256-128 C C 4656 50 128 256 35854 33299 1040.59 65698
Skein-256-128 asm asm 2052 50 128 256 42999 42003 1312.59 84618
Skein-256-160 C C 4656 50 160 256 35861 33292 1040.38 65730
Skein-256-160 asm asm 2052 50 160 256 42999 42003 1312.59 84653
Skein-256-224 C C 4656 50 224 256 35861 33292 1040.38 65794
Skein-256-224 asm asm 2052 50 224 256 43006 42003 1312.59 84709
Skein-256-256 C C 4656 50 256 256 35861 33292 1040.38 65826
Skein-256-256 asm asm 2052 50 256 256 43006 42003 1312.59 84732
Skein-256-384 C C 4656 50 384 256 35861 33299 1040.59 95764
Skein-256-384 asm asm 2052 50 384 256 42999 42003 1312.59 61753
Skein-256-512 C C 4656 50 512 256 35861 33299 1040.59 95892
Skein-256-512 asm asm 2052 50 512 256 42999 42003 1312.59 61864
Skein-512-1024 C C 5036 82 1024 512 64547 60138 939.66 114278
Skein-512-1024 asm asm 2154 82 1024 512 30529 29176 455.88 89645
Skein-512-128 C C 5036 82 128 512 64547 60145 939.77 120917
Skein-512-128 asm asm 2154 82 128 512 30529 29176 455.88 59041
Skein-512-160 C C 5036 82 160 512 64547 60145 939.77 120942
Skein-512-160 asm asm 2154 82 160 512 30522 29183 455.98 59062
Skein-512-224 C C 5036 82 224 512 64547 60145 939.77 121013
Skein-512-224 asm asm 2154 82 224 512 30529 29176 455.88 59125
Skein-512-256 C C 5036 82 256 512 64547 60138 939.66 121045
Skein-512-256 asm asm 2154 82 256 512 30522 29176 455.88 59153
Skein-512-384 C C 5036 82 384 512 64547 60138 939.66 121173
Skein-512-384 asm asm 2154 82 384 512 30522 29183 455.98 59265
Skein-512-512 C C 5036 82 512 512 64547 60138 939.66 121301
Skein-512-512 asm asm 2154 82 512 512 30529 29176 455.88 59379
Twister-224 C C 3224 80 224 512 396 49217 769.02 56565
Twister-224 asm asm 1616 80 224 512 480 36528 570.75 27448
Twister-256 C C 3224 80 256 512 396 49217 769.02 56705
Twister-256 asm asm 1616 80 256 512 425 36535 570.86 27502
Twister-384 C C 3746 144 384 512 720 12670 197.97 78479
Twister-384 asm asm 2156 144 384 512 745 55707 870.42 69785
Twister-512 C C 3746 144 512 512 720 12670 197.97 54945
Twister-512 asm asm 2156 144 512 512 743 55707 870.42 77776


[Bearbeiten] MACs

Name Variant Language Size (Flash) (Bytes) Size (Context) (Bytes) Size (Stack) (Bytes) Keysize (Bits) Blockize (Bits) Cycles (Initialisation) Cycles (per block) Cycles (Finalisation) Attacs Paper License / Patents
HMAC-SHA256 C2712 (incl. SHA256)40 beliebig 512
HMAC-SHA1 C2182 (incl. SHA1)28 beliebig 512
OMAC-Noekeon Asm1184 (incl. Noekeon)16 128 128 95 10533 21474
OMAC-Noekeon C1284 (incl. Noekeon)16 128 128 95 10589 21741


[Bearbeiten] PRNGs

Name Variant Language Size (Flash) (Bytes) Size (Context) (Bytes) Size (Stack) (Bytes) Blockize (Bits) Cycles (Input) Cycles (Output) Attacs Paper License / Patents
Entropium C217464 256
Persönliche Werkzeuge