{"id":17290566,"url":"https://github.com/squell/tinytwofish","last_synced_at":"2025-04-14T11:42:07.959Z","repository":{"id":14109723,"uuid":"16814377","full_name":"squell/tinyTwofish","owner":"squell","description":"Configurable implementation of the Twofish block cipher for AVR 8-bit microcontrollers (ATtiny, ATmega)","archived":false,"fork":false,"pushed_at":"2016-11-14T23:16:26.000Z","size":133,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T10:56:23.953Z","etag":null,"topics":["assembly","avr","c","crypto","twofish"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squell.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-13T19:33:13.000Z","updated_at":"2025-02-15T16:22:32.000Z","dependencies_parsed_at":"2022-09-23T19:02:39.310Z","dependency_job_id":null,"html_url":"https://github.com/squell/tinyTwofish","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squell%2FtinyTwofish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squell%2FtinyTwofish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squell%2FtinyTwofish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squell%2FtinyTwofish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squell","download_url":"https://codeload.github.com/squell/tinyTwofish/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248874913,"owners_count":21175928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembly","avr","c","crypto","twofish"],"created_at":"2024-10-15T10:38:34.719Z","updated_at":"2025-04-14T11:42:07.899Z","avatar_url":"https://github.com/squell.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"; -------------------------------------------------------\n; Files:\n;\n; 2fish_avr.cfg\n;\tCompile-time options/info (incl. key size)\n; 2fish_avr.s\n;\tTwofish encryption algorithm\n; 2fish_c_avr.h\n; 2fish_c_avr.s\n; \tWrapper for interfacing with C programs\n; avrmacros.s\n;\tUseful GNU as macros for the AVR\n; example.s\n;\tTest/demo program\n; kat_test.s\n; \tKnown Answer Tests in AVR assembly\n; kat_example.c \n;\tExample/Known Answer Tests in C\n; driver.c\n;\tSimple AVR emulator using simavr\n;\n; Extra files:\n;\n; portable/2fishy.*, portable/2fishy_test.c\n; \tPortable reference implementation (used during development)\n; portable/2fish_x86_64.s\n;\tx86-64 implementation (used during development)\n; portable/KAT.txt\n;\tKnown-Answer-Tests from the original paper\n;\n; -------------------------------------------------------\n; Overview of most interesting implementations; KEY_SIZE=128\n; Column information:\n;\n; SIZE\tActual footprint of code + tables (excl. alignment)\n; ASIZE\tMinimum amount of flash necessary to load (incl. alignment)\n; SRAM\tTotal amount of SRAM needed (.bss and stack)\n; E\tCycles needed to encrypt one block\n; KE\tCycles needed to keyschedule \u0026 encrypt one block\n;\n; For a giving keysize, tinyTwofish runs in constant time; the timings\n; listed are indepedent of the encryption key or the plaintext.\n\n; Implementations not pre-computing the key-dependent s-box:\n; Per SRAM size:\n;\n; 1) Smallest possible\n; 2) Trade-off favouring space\n; 3) Trade-off favouring speed\n; 4) Fastest possible\n\nSIZE: 724\tASIZE: 768\tSRAM: 42\tE: 83511 KE: 83891\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=0 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=0 TAB_key=0 TAB_sbox=0 TAB_q=0 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1130\tASIZE: 1536\tSRAM: 37\tE: 17448 KE: 17828\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=0 TAB_sbox=0 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1498\tASIZE: 1536\tSRAM: 35\tE: 12624 KE: 13004\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=0 TAB_sbox=0 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 2274\tASIZE: 2560\tSRAM: 35\tE: 11939 KE: 12319\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=1 UNROLL_enc=1 UNROLL_swap=1 TAB_key=0 TAB_sbox=0 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=1\n\nSIZE: 688\tASIZE: 704\tSRAM: 179\tE: 38006 KE: 83629\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=0 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=0 TAB_key=1 TAB_sbox=0 TAB_q=0 SRAM_q=1 UNROLL_whiten=0 INLINE_whiten=0\nSIZE: 1136\tASIZE: 1536\tSRAM: 174\tE: 7769 KE: 17332\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=0 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1524\tASIZE: 1536\tSRAM: 174\tE: 5785 KE: 12929\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=0 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 2304\tASIZE: 2560\tSRAM: 172\tE: 5557 KE: 12321\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=1 UNROLL_enc=1 UNROLL_swap=1 TAB_key=1 TAB_sbox=0 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=1\n\nSIZE: 684\tASIZE: 704\tSRAM: 691\tE: 11894 KE: 24877\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=0 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=0 TAB_key=1 TAB_sbox=0 TAB_q=1 SRAM_q=1 UNROLL_whiten=0 INLINE_whiten=0\nSIZE: 762\tASIZE: 768\tSRAM: 686\tE: 7385 KE: 16468\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=0 TAB_q=1 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1150\tASIZE: 1152\tSRAM: 686\tE: 5401 KE: 12065\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=0 TAB_q=1 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1930\tASIZE: 1984\tSRAM: 684\tE: 5173 KE: 11457\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=1 UNROLL_enc=1 UNROLL_swap=1 TAB_key=1 TAB_sbox=0 TAB_q=1 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=1\n\n; Implementations using key-dependent S-Boxes (requires \u003e1K SRAM)\n; Per SRAM size:\n;\n; 1) Trade-off favouring space\n; 2) Trade-off favouring speed\n; 3) Fastest possible\n;\n; NOTE:\n; - The 'smallest possible implementations' in this category perform worse but have larger Flash/SRAM footprints than some S-Box-less configurations\n; - These implementations offer a SRAM vs. space/key setup time trade-off (TAB_q=0/1)\n\nSIZE: 948\tASIZE: 960\tSRAM: 1199\tE: 4537 KE: 288237\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=0 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1116\tASIZE: 1152\tSRAM: 1198\tE: 3801\tKE: 285011\t; INLINE_round_g=1 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=0 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1554\tASIZE: 1600\tSRAM: 1197\tE: 3573\tKE: 284783\t; INLINE_round_g=1 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=1 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=0 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=1\n\nSIZE: 1318\tASIZE: 1536\tSRAM: 1198\tE: 4537 KE: 50253\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1514\tASIZE: 1536\tSRAM: 1198\tE: 3801 KE: 35779\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 2158\tASIZE: 2560\tSRAM: 1196\tE: 3573 KE: 35171\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=1 UNROLL_enc=1 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=1 SRAM_q=0 UNROLL_whiten=1 INLINE_whiten=1\n\nSIZE: 944\tASIZE: 960\tSRAM: 1710\tE: 4537 KE: 46701\t; INLINE_round_g=0 UNROLL_round_h=0 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=1 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1140\tASIZE: 1152\tSRAM: 1710\tE: 3801 KE: 32227\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=0 UNROLL_enc=0 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=1 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=0\nSIZE: 1784\tASIZE: 1792\tSRAM: 1708\tE: 3573 KE: 31619\t; INLINE_round_g=1 UNROLL_round_h=1 UNROLL_round_g=1 UNROLL_keypair=1 UNROLL_enc=1 UNROLL_swap=1 TAB_key=1 TAB_sbox=1 TAB_q=1 SRAM_q=1 UNROLL_whiten=1 INLINE_whiten=1\n\n\n; A full list of all useful combinations of options is in config.txt.\n;\n; General recommendation:\n; UNROLL_round_g = UNROLL_swap = UNROLL_whiten = 1, INLINE_whiten=0\n; \tOther settings result in unfavourable trade-offs.\n; UNROLL_keypair = UNROLL_enc = 0\n; \tThese control 'outer loops' which do not need to be unrolled.\n; INLINE_round_g = UNROLL_round_h\n;\n; Increasing KEY_SIZE to 192 or 256 will increase SRAM size with 8/16\n; bytes if TAB_key=0; as well as increase ROM footprint.\n;\n; Certain configurations are sub-optimal, in the sense that they have no \n; advantage over another configuration. These are omitted from config.txt.\n;\n; Range of supported MCU's:\n; - tinyTwofish can run on ATtiny13 with KEY_SIZE=128 and KEY_SIZE=192\n; - ATmega32 and better (e.g. Arduino) can handle any configuration\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquell%2Ftinytwofish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquell%2Ftinytwofish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquell%2Ftinytwofish/lists"}