AVR-Crypto-Lib/en
Aus LaborWiki
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
- HMAC-SHA256 (following RFC 2104)
- PRNG
[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 | 2668 | 176 | 128 | 128 | 4632 | 21279 | 39340 | ok | |||||
| AES | 192 | C | 2668 | 208 | 192 | 128 | 5082 | 25724 | 47799 | ok | |||||
| AES | 256 | C | 2668 | 240 | 256 | 128 | 6161 | 30174 | 56253 | ok | |||||
| AES | 128 | Asm | 2070 | 176 | 128 | 128 | 2039 | 2555 | 6764 | unconfirmed | |||||
| AES | 192 | Asm | 2070 | 208 | 128 | 128 | 2267 | 3039 | 8164 | unconfirmed | |||||
| AES | 256 | Asm | 2070 | 240 | 128 | 128 | 2852 | 3521 | 9562 | unconfirmed | |||||
| AES | 128-fastdec | Asm | 2580 | 176 | 128 | 128 | 2039 | 2555 | 3193 | unconfirmed | |||||
| AES | 192-fastdec | Asm | 2580 | 208 | 128 | 128 | 2267 | 3039 | 3819 | unconfirmed | |||||
| AES | 256-fastdec | Asm | 2580 | 240 | 128 | 128 | 2852 | 3521 | 4443 | unconfirmed | |||||
| Camellia | C | C | 8694 | 32 | 128 | 128 | 10190 | 43200 | 44066 | unconfirmed | |||||
| Camellia | C+Asm | C+Asm | 4088 | 32 | 128 | 128 | 11115 | 10185 | 10217 | unconfirmed | |||||
| Cast5 | C | C | 14312 | 75 | 0 – 128 | 64 | 13742 | 12550 | 13109 | unconfirmed | |||||
| RC5 | RC5-32/r/b | C | 1650 | 3+(8*#rounds+1) | 1 – 2040 | 79352 | 7827 | 7223 | unconfirmed | US-Patent 5,724,428 expires: 03/03/2015 | |||||
| RC6 | RC6-32/r/b | C | 2780 | 19+(8*#rounds) | 1 – 2040 | 128 | 139940 | 26600 | 25986 | unconfirmed | |||||
| Noekeon | C | C | 1616 | 0 (16) | 128 | 128 | 26037 | 25798 | 26396 | unconfirmed | |||||
| Noekeon | Asm | Asm | 774 | 0 (16) | 128 | 128 | 10416 | 10191 | 10745 | unconfirmed | |||||
| DES | C | C | 2642 | 0 | 56 | 64 | – | 284952 | 284977 | unconfirmed | |||||
| TDES | C | C | 2642 | 0 | 168 | 64 | – | 852082 | 852107 | unconfirmed | |||||
| Serpent | Non-bitslice | C | 3064 | 528 | 1 – 256 | 128 | 537021 | 492884 | 493004 | unconfirmed | |||||
| Serpent | Non-bitslice, small | Asm | 1290 | 528 | 1 – 256 | 128 | 114844 | 105771 | 105871 | unconfirmed | |||||
| Serpent | Non-bitslice, fast | Asm | 1400 | 528 | 1 – 256 | 128 | 110582 | 101648 | 101743 | unconfirmed | |||||
| Serpent | bitslice | C | 4482 | 528 | 1 – 256 | 128 | 102098 | 70827 | 70462 | unconfirmed | |||||
| Skipjack | C | C | 1144 | 0 | 80 | 64 | – | 38109 | 38450 | unconfirmed | |||||
| Present | C | C | 1514 | 256 | 80 | 64 | 30395 | 105796 | 151624 | unconfirmed | |||||
| SEED | C | C | 3726 | 16 | 128 | 128 | 181 | 56906 | 56427 | unconfirmed | |||||
| SEED | Asm | Asm | 1656 | 16 | 128 | 128 | 181 | 11401 | 11394 | unconfirmed | |||||
| XTEA | C | C | 820 | 0 | 128 | 64 | – | 9912 | 9789 | unconfirmed | |||||
| XTEA | Asm | Asm | 504 | 0 | 128 | 64 | – | 7687 | 7688 | unconfirmed | |||||
| Shabea | C | C | 1988 | 0 | 0 – infinit | 256 | unconfirmed | ||||||||
| Threefish-256 | Asm | Asm | 5068 | 64 | 256 | 256 | 375 | 40936 | 40912 | unconfirmed | |||||
| Threefish-512 | Asm | Asm | 5068 | 96 | 512 | 512 | 547 | 93020 | 93240 | unconfirmed | |||||
| Threefish-1024 | Asm | Asm | 5068 | 160 | 1024 | 1024 | 892 | 220606 | 218694 | unconfirmed | |||||
| Threefish-256 | C | C | 19752 | 64 | 256 | 256 | 806 | 229592 | 223251 | unconfirmed | |||||
| Threefish-512 | C | C | 19752 | 96 | 512 | 512 | 1299 | 453625 | 440279 | unconfirmed | |||||
| Threefish-1024 | C | C | 19752 | 160 | 1024 | 1024 | 2267 | 1033056 | 1010445 | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ARCFOUR | C | C | 230 | 258 | 8 – 2040 | 8 | 64086 | 56 | ||||
| ARCFOUR | Asm | Asm | 112 | 258 | 8 – 2040 | 8 | 6689 | 42 | ||||
| Trivium | C | C | 424 | 36 | 80 | 1 | 775726 | 665 | ||||
| Grain | C | C | 778 | 20 | 80 | 1 | 107366 | 617 | ||||
| MUGI | C | C | 3500 | 152 | 128 | 64 | 113886 | 4105 |
[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 | 3774 | 53 | 224 | 512 | 386 | 71362 | 1115.03 | 71893 | ||||
| Blake-32 | C | C | 3774 | 53 | 256 | 512 | 387 | 71362 | 1115.03 | 71961 | ||||
| Blake-48 | C | C | 7422 | 101 | 384 | 1024 | 924 | 511222 | 3993.92 | 519337 | ||||
| Blake-64 | C | C | 7422 | 101 | 512 | 1024 | 925 | 511222 | 3993.92 | 521812 | ||||
| BlueMidnightWish-224 | C | C | 6857 | 68 | 224 | 512 | 444 | 88835 | 1388.05 | 179259 | ||||
| BlueMidnightWish-224 | asm | asm | 3274 | 68 | 224 | 512 | 269 | 31461 | 491.58 | 63502 | ||||
| BlueMidnightWish-256 | C | C | 6857 | 68 | 256 | 512 | 444 | 88835 | 1388.05 | 179283 | ||||
| BlueMidnightWish-256 | asm | asm | 3274 | 68 | 256 | 512 | 271 | 31461 | 491.58 | 63535 | ||||
| BlueMidnightWish-384 | C | C | 18305 | 132 | 384 | 1024 | 2030 | 384343 | 3002.68 | 771581 | ||||
| BlueMidnightWish-384 | asm | asm | 18281 | 132 | 384 | 1024 | 2030 | 384343 | 3002.68 | 771581 | ||||
| BlueMidnightWish-512 | C | C | 18305 | 132 | 512 | 1024 | 2031 | 384343 | 3002.68 | 771686 | ||||
| BlueMidnightWish-512 | asm | asm | 21555 | 132 | 512 | 1024 | 2031 | 384343 | 3002.68 | 771686 | ||||
| Groestl-224 | C | C | 2330 | 68 | 224 | 512 | 356 | 522414 | 8162.72 | 783700 | ||||
| Groestl-256 | C | C | 2330 | 68 | 256 | 512 | 356 | 522414 | 8162.72 | 783732 | ||||
| Groestl-384 | C | C | 2330 | 132 | 384 | 1024 | 706 | 1460488 | 11410.06 | 2190914 | ||||
| Groestl-512 | C | C | 2330 | 132 | 512 | 1024 | 697 | 1460488 | 11410.06 | 2191042 | ||||
| Keccak-224 | C | C | 3705 | 206 | 224 | 1152 | 1089 | 1307954 | 9083.01 | 1309167 | ||||
| Keccak-256 | C | C | 3705 | 206 | 256 | 1088 | 1089 | 1307866 | 9616.66 | 1309070 | ||||
| Keccak-384 | C | C | 3705 | 206 | 384 | 832 | 1089 | 1307514 | 12572.25 | 1308657 | ||||
| Keccak-512 | C | C | 3705 | 206 | 512 | 576 | 1089 | 1307162 | 18155.03 | 1308248 | ||||
| MD5 | C | C | 2506 | 20 | 128 | 512 | 75 | 42682 | 666.91 | 43137 | ||||
| MD5 | asm | asm | 1686 | 20 | 128 | 512 | 75 | 18297 | 285.89 | 18636 | ||||
| SHA-1 | C | C | 2764 | 28 | 160 | 512 | 92 | 75422 | 1178.47 | 76333 | ||||
| SHA-1 | asm | asm | 1022 | 28 | 160 | 512 | 221 | 37070 | 579.22 | 37355 | ||||
| SHA-256 | C | C | 3386 | 40 | 256 | 512 | 261 | 177155 | 2768.05 | 181300 | ||||
| SHA-256 | asm | asm | 1598 | 40 | 256 | 512 | 338 | 50165 | 783.83 | 50559 | ||||
| Shabal-192 | C | C | 2312 | 188 | 192 | 512 | 1582 | 59463 | 929.11 | 231809 | ||||
| Shabal-192 | asm | asm | 1580 | 188 | 192 | 512 | 1087 | 13729 | 214.52 | 50842 | ||||
| Shabal-224 | C | C | 2312 | 188 | 224 | 512 | 1582 | 59463 | 929.11 | 231838 | ||||
| Shabal-224 | asm | asm | 1580 | 188 | 224 | 512 | 1087 | 13729 | 214.52 | 50877 | ||||
| Shabal-256 | C | C | 2312 | 188 | 256 | 512 | 1582 | 59463 | 929.11 | 231887 | ||||
| Shabal-256 | asm | asm | 1580 | 188 | 256 | 512 | 1087 | 13729 | 214.52 | 50905 | ||||
| Shabal-384 | C | C | 2312 | 188 | 384 | 512 | 1582 | 59463 | 929.11 | 232012 | ||||
| Shabal-384 | asm | asm | 1580 | 188 | 384 | 512 | 1087 | 13729 | 214.52 | 51010 | ||||
| Shabal-512 | C | C | 2312 | 188 | 512 | 512 | 1582 | 59463 | 929.11 | 232140 | ||||
| Shabal-512 | asm | asm | 1578 | 188 | 512 | 512 | 1087 | 13729 | 214.52 | 51130 | ||||
| Skein-1024-1024 | C | C | 7130 | 146 | 1024 | 1024 | 1125066 | 1122785 | 8771.76 | 2246720 | ||||
| Skein-1024-1024 | asm | asm | 3246 | 146 | 1024 | 1024 | 222289 | 220215 | 1720.43 | 441751 | ||||
| Skein-1024-128 | C | C | 7130 | 146 | 128 | 1024 | 1125066 | 1122785 | 8771.76 | 2245824 | ||||
| Skein-1024-128 | asm | asm | 2486 | 146 | 128 | 1024 | 222289 | 220215 | 1720.43 | 440965 | ||||
| Skein-1024-160 | C | C | 7130 | 146 | 160 | 1024 | 1125066 | 1122785 | 8771.76 | 2245856 | ||||
| Skein-1024-160 | asm | asm | 2486 | 146 | 160 | 1024 | 222289 | 220215 | 1720.43 | 440993 | ||||
| Skein-1024-224 | C | C | 7130 | 146 | 224 | 1024 | 1125066 | 1122785 | 8771.76 | 2245920 | ||||
| Skein-1024-224 | asm | asm | 2486 | 146 | 224 | 1024 | 222289 | 220215 | 1720.43 | 441049 | ||||
| Skein-1024-256 | C | C | 7130 | 146 | 256 | 1024 | 1125066 | 1122785 | 8771.76 | 2245952 | ||||
| Skein-1024-256 | asm | asm | 2486 | 146 | 256 | 1024 | 222289 | 220215 | 1720.43 | 441077 | ||||
| Skein-1024-384 | C | C | 7130 | 146 | 384 | 1024 | 1125066 | 1122785 | 8771.76 | 2246080 | ||||
| Skein-1024-384 | asm | asm | 2486 | 146 | 384 | 1024 | 222289 | 220215 | 1720.43 | 441189 | ||||
| Skein-1024-512 | C | C | 7130 | 146 | 512 | 1024 | 1125066 | 1122785 | 8771.76 | 2246208 | ||||
| Skein-1024-512 | asm | asm | 2486 | 146 | 512 | 1024 | 222289 | 220215 | 1720.43 | 441301 | ||||
| Skein-256-128 | C | C | 4986 | 50 | 128 | 256 | 234138 | 232433 | 7263.53 | 465587 | ||||
| Skein-256-128 | asm | asm | 2052 | 50 | 128 | 256 | 39951 | 38646 | 1207.69 | 77910 | ||||
| Skein-256-160 | C | C | 4986 | 50 | 160 | 256 | 234138 | 232433 | 7263.53 | 465619 | ||||
| Skein-256-160 | asm | asm | 2052 | 50 | 160 | 256 | 39951 | 38646 | 1207.69 | 77938 | ||||
| Skein-256-224 | C | C | 4986 | 50 | 224 | 256 | 234138 | 232433 | 7263.53 | 465683 | ||||
| Skein-256-224 | asm | asm | 2052 | 50 | 224 | 256 | 39951 | 38646 | 1207.69 | 77994 | ||||
| Skein-256-256 | C | C | 4986 | 50 | 256 | 256 | 234138 | 232433 | 7263.53 | 465715 | ||||
| Skein-256-256 | asm | asm | 2052 | 50 | 256 | 256 | 39951 | 38646 | 1207.69 | 78024 | ||||
| Skein-256-384 | C | C | 4986 | 50 | 384 | 256 | 234138 | 232433 | 7263.53 | 698604 | ||||
| Skein-256-384 | asm | asm | 2052 | 50 | 384 | 256 | 39951 | 38646 | 1207.69 | 117108 | ||||
| Skein-256-512 | C | C | 4408 | 50 | 512 | 256 | 234138 | 232433 | 7263.53 | 698732 | ||||
| Skein-256-512 | asm | asm | 2052 | 50 | 512 | 256 | 39951 | 38646 | 1207.69 | 117219 | ||||
| Skein-512-1024 | C | C | 5466 | 82 | 1024 | 512 | 488243 | 486346 | 7599.16 | 1461354 | ||||
| Skein-512-1024 | asm | asm | 2154 | 82 | 1024 | 512 | 94064 | 92505 | 1445.39 | 279312 | ||||
| Skein-512-128 | C | C | 5466 | 82 | 128 | 512 | 488243 | 486346 | 7599.16 | 973266 | ||||
| Skein-512-128 | asm | asm | 2154 | 82 | 128 | 512 | 94064 | 92505 | 1445.39 | 185599 | ||||
| Skein-512-160 | C | C | 5466 | 82 | 160 | 512 | 488243 | 486346 | 7599.16 | 973298 | ||||
| Skein-512-160 | asm | asm | 2154 | 82 | 160 | 512 | 94064 | 92505 | 1445.39 | 185627 | ||||
| Skein-512-224 | C | C | 5466 | 82 | 224 | 512 | 488243 | 486346 | 7599.16 | 973362 | ||||
| Skein-512-224 | asm | asm | 2154 | 82 | 224 | 512 | 94064 | 92505 | 1445.39 | 185683 | ||||
| Skein-512-256 | C | C | 5466 | 82 | 256 | 512 | 488243 | 486346 | 7599.16 | 973394 | ||||
| Skein-512-256 | asm | asm | 1798 | 82 | 256 | 512 | 94064 | 92505 | 1445.39 | 185711 | ||||
| Skein-512-384 | C | C | 5466 | 82 | 384 | 512 | 488243 | 486346 | 7599.16 | 973522 | ||||
| Skein-512-384 | asm | asm | 2154 | 82 | 384 | 512 | 94064 | 92505 | 1445.39 | 185823 | ||||
| Skein-512-512 | C | C | 5466 | 82 | 512 | 512 | 488243 | 486346 | 7599.16 | 973650 | ||||
| Skein-512-512 | asm | asm | 2154 | 82 | 512 | 512 | 94064 | 92505 | 1445.39 | 185937 | ||||
| Twister-224 | C | C | 3248 | 80 | 224 | 512 | 438 | 241131 | 3767.67 | 509591 | ||||
| Twister-224 | asm | asm | 1614 | 80 | 224 | 512 | 572 | 164320 | 2567.50 | 347463 | ||||
| Twister-256 | C | C | 3248 | 80 | 256 | 512 | 438 | 241131 | 3767.67 | 509727 | ||||
| Twister-256 | asm | asm | 1614 | 80 | 256 | 512 | 435 | 164320 | 2567.50 | 347524 | ||||
| Twister-384 | C | C | 3822 | 144 | 384 | 512 | 783 | 269721 | 4214.39 | 860590 | ||||
| Twister-384 | asm | asm | 2156 | 144 | 384 | 512 | 776 | 183120 | 2861.25 | 586188 | ||||
| Twister-512 | C | C | 3822 | 144 | 512 | 512 | 783 | 269721 | 4214.39 | 968288 | ||||
| Twister-512 | asm | asm | 2156 | 144 | 512 | 512 | 778 | 183120 | 2861.25 | 659715 |
[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 | C | 2712 (incl. SHA256) | 40 | beliebig | 512 | ||||||||
| HMAC-SHA1 | C | 2182 (incl. SHA1) | 28 | beliebig | 512 | ||||||||
| OMAC-Noekeon | Asm | 1184 (incl. Noekeon) | 16 | 128 | 128 | 95 | 10533 | 21474 | |||||
| OMAC-Noekeon | C | 1284 (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 | C | 2174 | 64 | 256 |


