Changeset a931b7b in mainline for uspace/lib/crypto/rc4.c


Ignore:
Timestamp:
2015-04-13T20:48:33Z (10 years ago)
Author:
Jan Kolarik <kolarik@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc575ef9
Parents:
053fc2b
Message:

Added TKIP support, handling old WPA in 4way handshake, some fixes in wifi_supplicant app

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/crypto/rc4.c

    r053fc2b ra931b7b  
    8282 * @param input Input data sequence to be processed.
    8383 * @param input_size Size of input data sequence.
     84 * @param skip Number of bytes to be skipped from the beginning of key stream.
    8485 * @param output Result data sequence.
    8586 *
     
    8889 */
    8990int rc4(uint8_t *key, size_t key_size, uint8_t *input, size_t input_size,
    90         uint8_t *output)
     91        size_t skip, uint8_t *output)
    9192{
    9293        if(!key || !input)
     
    100101        create_sbox(key, key_size, sbox);
    101102       
     103        /* Skip first x bytes. */
     104        uint8_t i = 0, j = 0;
     105        for(size_t k = 0; k < skip; k++) {
     106                i = i+1;
     107                j = j + sbox[i];
     108                swap(i, j, sbox);
     109        }
     110       
    102111        /* Processing loop. */
    103         uint8_t i = 0, j = 0, val;
     112        uint8_t val;
    104113        for(size_t k = 0; k < input_size; k++) {
    105114                i = i+1;
Note: See TracChangeset for help on using the changeset viewer.