Changeset d7dadcb4 in mainline for uspace/lib/crypto/crypto.h


Ignore:
Timestamp:
2015-04-08T10:54:31Z (10 years ago)
Author:
Jan Kolarik <kolarik@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
053fc2b
Parents:
1dcc0b9
Message:

RC4 and MD5 algorithm used in TKIP/WEP security suites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/crypto/crypto.h

    r1dcc0b9 rd7dadcb4  
    3333
    3434#define AES_CIPHER_LENGTH 16
    35 #define MD5_HASH_LENGTH 16
    36 #define SHA1_HASH_LENGTH 20
    37 #define HMAC_BLOCK_LENGTH 64
    3835#define PBKDF2_KEY_LENGTH 32
    3936
    40 /** Hash function selector. */
     37/** Hash function selector and also result hash length indicator. */
    4138typedef enum {
    42         HASH_MD5,
    43         HASH_SHA1
     39        HASH_MD5 =      16,
     40        HASH_SHA1 =     20
    4441} hash_func_t;
    4542
     43extern int rc4(uint8_t *key, size_t key_size, uint8_t *input,
     44        size_t input_size, uint8_t *output);
    4645extern int aes_encrypt(uint8_t *key, uint8_t *input, uint8_t *output);
    4746extern int aes_decrypt(uint8_t *key, uint8_t *input, uint8_t *output);
    48 extern int sha1(uint8_t *input, size_t input_size, uint8_t *hash);
    49 extern int md5(uint8_t *input, size_t input_size, uint8_t *hash);
     47extern int create_hash(uint8_t *input, size_t input_size, uint8_t *output,
     48        hash_func_t hash_sel);
    5049extern int hmac(uint8_t *key, size_t key_size, uint8_t *msg, size_t msg_size,
    5150        uint8_t *hash, hash_func_t hash_sel);
Note: See TracChangeset for help on using the changeset viewer.