Lines Matching refs:len
25 int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
32 md4_process(&md, addr[i], len[i]);
59 int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
66 md5_process(&md, addr[i], len[i]);
72 int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
79 sha1_process(&md, addr[i], len[i]);
85 void * aes_encrypt_init(const u8 *key, size_t len)
91 if (aes_setup(key, len, 0, skey) != CRYPT_OK) {
114 void * aes_decrypt_init(const u8 *key, size_t len)
120 if (aes_setup(key, len, 0, skey) != CRYPT_OK) {
194 void crypto_hash_update(struct crypto_hash *ctx, const u8 *data, size_t len)
201 ctx->error = md5_process(&ctx->u.md, data, len) != CRYPT_OK;
204 ctx->error = sha1_process(&ctx->u.md, data, len) != CRYPT_OK;
208 ctx->error = hmac_process(&ctx->u.hmac, data, len) != CRYPT_OK;
214 int crypto_hash_finish(struct crypto_hash *ctx, u8 *mac, size_t *len)
222 if (mac == NULL || len == NULL) {
234 if (*len < 16) {
235 *len = 16;
239 *len = 16;
244 if (*len < 20) {
245 *len = 20;
249 *len = 20;
254 if (*len < 20) {
255 *len = 20;
261 if (*len < 16) {
262 *len = 16;
266 clen = *len;
271 *len = clen;
351 u8 *crypt, size_t len)
357 os_memcpy(crypt, plain, len);
359 ctx->u.rc4.used_bytes, crypt, len);
360 ctx->u.rc4.used_bytes += len;
364 res = cbc_encrypt(plain, crypt, len, &ctx->u.cbc);
375 u8 *plain, size_t len)
381 os_memcpy(plain, crypt, len);
383 ctx->u.rc4.used_bytes, plain, len);
384 ctx->u.rc4.used_bytes += len;
388 res = cbc_decrypt(crypt, plain, len, &ctx->u.cbc);
416 struct crypto_public_key * crypto_public_key_import(const u8 *key, size_t len)
425 res = rsa_import(key, len, &pk->rsa);
447 size_t len,
457 res = rsa_import(key, len, &pk->rsa);
479 size_t len)
553 unsigned long len, modlen;
562 len = *outlen;
563 res = rsa_exptmod(out, modlen, out, &len, key_type, key);
569 *outlen = len;
616 unsigned long len;
619 len = *plain_len;
620 res = rsa_exptmod(crypt, crypt_len, plain, &len, PK_PUBLIC,
637 if (len < 3 + 8 + 16 /* min hash len */ ||
645 while (pos < plain + len && *pos == 0xff)
654 if (pos + 16 /* min hash len */ >= plain + len || *pos != 0x00) {
660 len -= pos - plain;
663 os_memmove(plain, pos, len);
664 *plain_len = len;