Changeset a35b458 in mainline for uspace/lib/crypto/rc4.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/crypto/rc4.c
r3061bc1 ra35b458 65 65 for (size_t i = 0; i < SBOX_SIZE; i++) 66 66 sbox[i] = i; 67 67 68 68 uint8_t j = 0; 69 69 for (size_t i = 0; i < SBOX_SIZE; i++) { … … 93 93 if ((!key) || (!input)) 94 94 return EINVAL; 95 95 96 96 if (!output) 97 97 return ENOMEM; 98 98 99 99 /* Initialize sbox. */ 100 100 uint8_t sbox[SBOX_SIZE]; 101 101 create_sbox(key, key_size, sbox); 102 102 103 103 /* Skip first x bytes. */ 104 104 uint8_t i = 0; … … 109 109 swap(i, j, sbox); 110 110 } 111 111 112 112 /* Processing loop. */ 113 113 uint8_t val; … … 119 119 output[k] = val ^ input[k]; 120 120 } 121 121 122 122 return EOK; 123 123 }
Note:
See TracChangeset
for help on using the changeset viewer.