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 | 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 | 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 |


