Changeset d7dadcb4 in mainline for uspace/lib/crypto/crypto.h
- Timestamp:
- 2015-04-08T10:54:31Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 053fc2b
- Parents:
- 1dcc0b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/crypto/crypto.h
r1dcc0b9 rd7dadcb4 33 33 34 34 #define AES_CIPHER_LENGTH 16 35 #define MD5_HASH_LENGTH 1636 #define SHA1_HASH_LENGTH 2037 #define HMAC_BLOCK_LENGTH 6438 35 #define PBKDF2_KEY_LENGTH 32 39 36 40 /** Hash function selector . */37 /** Hash function selector and also result hash length indicator. */ 41 38 typedef enum { 42 HASH_MD5 ,43 HASH_SHA1 39 HASH_MD5 = 16, 40 HASH_SHA1 = 20 44 41 } hash_func_t; 45 42 43 extern int rc4(uint8_t *key, size_t key_size, uint8_t *input, 44 size_t input_size, uint8_t *output); 46 45 extern int aes_encrypt(uint8_t *key, uint8_t *input, uint8_t *output); 47 46 extern 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);47 extern int create_hash(uint8_t *input, size_t input_size, uint8_t *output, 48 hash_func_t hash_sel); 50 49 extern int hmac(uint8_t *key, size_t key_size, uint8_t *msg, size_t msg_size, 51 50 uint8_t *hash, hash_func_t hash_sel);
Note:
See TracChangeset
for help on using the changeset viewer.