Lines Matching refs:len

25 int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)  in md4_vector()  argument
32 md4_process(&md, addr[i], len[i]); in md4_vector()
60 int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) in md5_vector() argument
67 md5_process(&md, addr[i], len[i]); in md5_vector()
73 int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) in sha1_vector() argument
80 sha1_process(&md, addr[i], len[i]); in sha1_vector()
86 void * aes_encrypt_init(const u8 *key, size_t len) in aes_encrypt_init() argument
92 if (aes_setup(key, len, 0, skey) != CRYPT_OK) { in aes_encrypt_init()
115 void * aes_decrypt_init(const u8 *key, size_t len) in aes_decrypt_init() argument
121 if (aes_setup(key, len, 0, skey) != CRYPT_OK) { in aes_decrypt_init()
195 void crypto_hash_update(struct crypto_hash *ctx, const u8 *data, size_t len) in crypto_hash_update() argument
202 ctx->error = md5_process(&ctx->u.md, data, len) != CRYPT_OK; in crypto_hash_update()
205 ctx->error = sha1_process(&ctx->u.md, data, len) != CRYPT_OK; in crypto_hash_update()
209 ctx->error = hmac_process(&ctx->u.hmac, data, len) != CRYPT_OK; in crypto_hash_update()
215 int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len) in crypto_hash_finish() argument
223 if (mac == NULL || len == NULL) { in crypto_hash_finish()
235 if (*len < 16) { in crypto_hash_finish()
236 *len = 16; in crypto_hash_finish()
240 *len = 16; in crypto_hash_finish()
245 if (*len < 20) { in crypto_hash_finish()
246 *len = 20; in crypto_hash_finish()
250 *len = 20; in crypto_hash_finish()
255 if (*len < 20) { in crypto_hash_finish()
256 *len = 20; in crypto_hash_finish()
262 if (*len < 16) { in crypto_hash_finish()
263 *len = 16; in crypto_hash_finish()
267 clen = *len; in crypto_hash_finish()
272 *len = clen; in crypto_hash_finish()
355 u8 *crypt, size_t len) in crypto_cipher_encrypt() argument
361 os_memcpy(crypt, plain, len); in crypto_cipher_encrypt()
363 ctx->u.rc4.used_bytes, crypt, len); in crypto_cipher_encrypt()
364 ctx->u.rc4.used_bytes += len; in crypto_cipher_encrypt()
368 res = cbc_encrypt(plain, crypt, len, &ctx->u.cbc); in crypto_cipher_encrypt()
379 u8 *plain, size_t len) in crypto_cipher_decrypt() argument
385 os_memcpy(plain, crypt, len); in crypto_cipher_decrypt()
387 ctx->u.rc4.used_bytes, plain, len); in crypto_cipher_decrypt()
388 ctx->u.rc4.used_bytes += len; in crypto_cipher_decrypt()
392 res = cbc_decrypt(crypt, plain, len, &ctx->u.cbc); in crypto_cipher_decrypt()
420 struct crypto_public_key * crypto_public_key_import(const u8 *key, size_t len) in crypto_public_key_import() argument
429 res = rsa_import(key, len, &pk->rsa); in crypto_public_key_import()
451 size_t len, in crypto_private_key_import() argument
461 res = rsa_import(key, len, &pk->rsa); in crypto_private_key_import()
483 size_t len) in crypto_public_key_from_cert() argument
557 unsigned long len, modlen; in crypto_rsa_encrypt_pkcs1() local
566 len = *outlen; in crypto_rsa_encrypt_pkcs1()
567 res = rsa_exptmod(out, modlen, out, &len, key_type, key); in crypto_rsa_encrypt_pkcs1()
573 *outlen = len; in crypto_rsa_encrypt_pkcs1()
620 unsigned long len; in crypto_public_key_decrypt_pkcs1() local
623 len = *plain_len; in crypto_public_key_decrypt_pkcs1()
624 res = rsa_exptmod(crypt, crypt_len, plain, &len, PK_PUBLIC, in crypto_public_key_decrypt_pkcs1()
641 if (len < 3 + 8 + 16 /* min hash len */ || in crypto_public_key_decrypt_pkcs1()
649 while (pos < plain + len && *pos == 0xff) in crypto_public_key_decrypt_pkcs1()
658 if (pos + 16 /* min hash len */ >= plain + len || *pos != 0x00) { in crypto_public_key_decrypt_pkcs1()
664 len -= pos - plain; in crypto_public_key_decrypt_pkcs1()
667 os_memmove(plain, pos, len); in crypto_public_key_decrypt_pkcs1()
668 *plain_len = len; in crypto_public_key_decrypt_pkcs1()
730 u8 *secret, size_t *len) in crypto_dh_derive_secret() argument
734 prime, prime_len, secret, len); in crypto_dh_derive_secret()