/crypto/ |
D | cipher.c | 23 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() 29 u8 *buffer, *alignbuffer; in setkey_unaligned() 37 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); in setkey_unaligned() 46 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() 63 static void cipher_crypt_unaligned(void (*fn)(struct crypto_tfm *, u8 *, in cipher_crypt_unaligned() argument 64 const u8 *), in cipher_crypt_unaligned() argument 66 u8 *dst, const u8 *src) in cipher_crypt_unaligned() 70 u8 buffer[size + alignmask]; in cipher_crypt_unaligned() 71 u8 *tmp = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); in cipher_crypt_unaligned() 79 u8 *dst, const u8 *src) in cipher_encrypt_unaligned() [all …]
|
D | pcbc.c | 29 static int crypto_pcbc_setkey(struct crypto_tfm *parent, const u8 *key, in crypto_pcbc_setkey() 49 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = in crypto_pcbc_encrypt_segment() 53 u8 *src = walk->src.virt.addr; in crypto_pcbc_encrypt_segment() 54 u8 *dst = walk->dst.virt.addr; in crypto_pcbc_encrypt_segment() 55 u8 *iv = walk->iv; in crypto_pcbc_encrypt_segment() 74 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = in crypto_pcbc_encrypt_inplace() 78 u8 *src = walk->src.virt.addr; in crypto_pcbc_encrypt_inplace() 79 u8 *iv = walk->iv; in crypto_pcbc_encrypt_inplace() 80 u8 tmpbuf[bsize]; in crypto_pcbc_encrypt_inplace() 127 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = in crypto_pcbc_decrypt_segment() [all …]
|
D | arc4.c | 23 u8 S[256]; 24 u8 x, y; 27 static int arc4_set_key(struct crypto_tfm *tfm, const u8 *in_key, in arc4_set_key() 41 u8 a = ctx->S[i]; in arc4_set_key() 52 static void arc4_crypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) in arc4_crypt() 56 u8 *const S = ctx->S; in arc4_crypt() 57 u8 x = ctx->x; in arc4_crypt() 58 u8 y = ctx->y; in arc4_crypt() 59 u8 a, b; in arc4_crypt()
|
D | cbc.c | 26 static int crypto_cbc_setkey(struct crypto_tfm *parent, const u8 *key, in crypto_cbc_setkey() 46 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = in crypto_cbc_encrypt_segment() 50 u8 *src = walk->src.virt.addr; in crypto_cbc_encrypt_segment() 51 u8 *dst = walk->dst.virt.addr; in crypto_cbc_encrypt_segment() 52 u8 *iv = walk->iv; in crypto_cbc_encrypt_segment() 70 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = in crypto_cbc_encrypt_inplace() 74 u8 *src = walk->src.virt.addr; in crypto_cbc_encrypt_inplace() 75 u8 *iv = walk->iv; in crypto_cbc_encrypt_inplace() 118 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = in crypto_cbc_decrypt_segment() 122 u8 *src = walk->src.virt.addr; in crypto_cbc_decrypt_segment() [all …]
|
D | ctr.c | 29 u8 nonce[CTR_RFC3686_NONCE_SIZE]; 32 static int crypto_ctr_setkey(struct crypto_tfm *parent, const u8 *key, in crypto_ctr_setkey() 54 u8 *ctrblk = walk->iv; in crypto_ctr_crypt_final() 55 u8 tmp[bsize + alignmask]; in crypto_ctr_crypt_final() 56 u8 *keystream = PTR_ALIGN(tmp + 0, alignmask + 1); in crypto_ctr_crypt_final() 57 u8 *src = walk->src.virt.addr; in crypto_ctr_crypt_final() 58 u8 *dst = walk->dst.virt.addr; in crypto_ctr_crypt_final() 71 void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = in crypto_ctr_crypt_segment() 74 u8 *ctrblk = walk->iv; in crypto_ctr_crypt_segment() 75 u8 *src = walk->src.virt.addr; in crypto_ctr_crypt_segment() [all …]
|
D | xcbc.c | 52 u8 *odds; 53 u8 *prev; 54 u8 *key; 55 u8 *consts; 56 void (*xor)(u8 *a, const u8 *b, unsigned int bs); 61 static void xor_128(u8 *a, const u8 *b, unsigned int bs) in xor_128() 74 u8 key1[bs]; in _crypto_xcbc_digest_setkey() 85 const u8 *inkey, unsigned int keylen) in crypto_xcbc_digest_setkey() 94 ctx->consts = (u8*)ks; in crypto_xcbc_digest_setkey() 201 static int crypto_xcbc_digest_final(struct hash_desc *pdesc, u8 *out) in crypto_xcbc_digest_final() [all …]
|
D | crc32c.c | 136 static u32 crc32c(u32 crc, const u8 *data, unsigned int length) in crc32c() 164 static int chksum_setkey(struct crypto_shash *tfm, const u8 *key, in chksum_setkey() 177 static int chksum_update(struct shash_desc *desc, const u8 *data, in chksum_update() 186 static int chksum_final(struct shash_desc *desc, u8 *out) in chksum_final() 194 static int __chksum_finup(u32 *crcp, const u8 *data, unsigned int len, u8 *out) in __chksum_finup() 200 static int chksum_finup(struct shash_desc *desc, const u8 *data, in chksum_finup() 201 unsigned int len, u8 *out) in chksum_finup() 208 static int chksum_digest(struct shash_desc *desc, const u8 *data, in chksum_digest() 209 unsigned int length, u8 *out) in chksum_digest()
|
D | tcrypt.h | 47 static u8 speed_template_8[] = {8, 0}; 48 static u8 speed_template_24[] = {24, 0}; 49 static u8 speed_template_8_32[] = {8, 32, 0}; 50 static u8 speed_template_16_32[] = {16, 32, 0}; 51 static u8 speed_template_16_24_32[] = {16, 24, 32, 0}; 52 static u8 speed_template_32_40_48[] = {32, 40, 48, 0}; 53 static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
|
D | shash.c | 30 static int shash_setkey_unaligned(struct crypto_shash *tfm, const u8 *key, in shash_setkey_unaligned() 36 u8 *buffer, *alignbuffer; in shash_setkey_unaligned() 44 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); in shash_setkey_unaligned() 52 int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, in crypto_shash_setkey() 71 return len + (mask & ~(__alignof__(u8 __attribute__ ((aligned))) - 1)); in shash_align_buffer_size() 74 static int shash_update_unaligned(struct shash_desc *desc, const u8 *data, in shash_update_unaligned() 82 u8 buf[shash_align_buffer_size(unaligned_len, alignmask)] in shash_update_unaligned() 91 int crypto_shash_update(struct shash_desc *desc, const u8 *data, in crypto_shash_update() 105 static int shash_final_unaligned(struct shash_desc *desc, u8 *out) in shash_final_unaligned() 111 u8 buf[shash_align_buffer_size(ds, alignmask)] in shash_final_unaligned() [all …]
|
D | crypto_null.c | 32 static int null_compress(struct crypto_tfm *tfm, const u8 *src, in null_compress() 33 unsigned int slen, u8 *dst, unsigned int *dlen) in null_compress() 47 static int null_update(struct shash_desc *desc, const u8 *data, in null_update() 53 static int null_final(struct shash_desc *desc, u8 *out) in null_final() 58 static int null_digest(struct shash_desc *desc, const u8 *data, in null_digest() 59 unsigned int len, u8 *out) in null_digest() 64 static int null_hash_setkey(struct crypto_shash *tfm, const u8 *key, in null_hash_setkey() 68 static int null_setkey(struct crypto_tfm *tfm, const u8 *key, in null_setkey() 72 static void null_crypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in null_crypt()
|
D | tea.c | 47 static int tea_setkey(struct crypto_tfm *tfm, const u8 *in_key, in tea_setkey() 62 static void tea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in tea_encrypt() 90 static void tea_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in tea_decrypt() 120 static int xtea_setkey(struct crypto_tfm *tfm, const u8 *in_key, in xtea_setkey() 135 static void xtea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in xtea_encrypt() 156 static void xtea_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in xtea_decrypt() 179 static void xeta_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in xeta_encrypt() 200 static void xeta_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in xeta_decrypt()
|
D | deflate.c | 128 static int deflate_compress(struct crypto_tfm *tfm, const u8 *src, in deflate_compress() 129 unsigned int slen, u8 *dst, unsigned int *dlen) in deflate_compress() 141 stream->next_in = (u8 *)src; in deflate_compress() 143 stream->next_out = (u8 *)dst; in deflate_compress() 157 static int deflate_decompress(struct crypto_tfm *tfm, const u8 *src, in deflate_decompress() 158 unsigned int slen, u8 *dst, unsigned int *dlen) in deflate_decompress() 171 stream->next_in = (u8 *)src; in deflate_decompress() 173 stream->next_out = (u8 *)dst; in deflate_decompress() 183 u8 zerostuff = 0; in deflate_decompress()
|
D | ccm.c | 36 u8 nonce[3]; 40 u8 odata[16]; 41 u8 idata[16]; 42 u8 auth_tag[16]; 55 return (void *)PTR_ALIGN((u8 *)aead_request_ctx(req), align + 1); in crypto_ccm_reqctx() 58 static int set_msg_len(u8 *block, unsigned int msglen, int csize) in set_msg_len() 71 memcpy(block - csize, (u8 *)&data + 4 - csize, csize); in set_msg_len() 76 static int crypto_ccm_setkey(struct crypto_aead *aead, const u8 *key, in crypto_ccm_setkey() 123 static int format_input(u8 *info, struct aead_request *req, in format_input() 145 static int format_adata(u8 *adata, unsigned int a) in format_adata() [all …]
|
D | authenc.c | 37 static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, in crypto_authenc_setkey() 106 static u8 *crypto_authenc_hash(struct aead_request *req, unsigned int flags, in crypto_authenc_hash() 117 u8 *hash = aead_request_ctx(req); in crypto_authenc_hash() 120 hash = (u8 *)ALIGN((unsigned long)hash + crypto_hash_alignmask(auth), in crypto_authenc_hash() 146 static int crypto_authenc_genicv(struct aead_request *req, u8 *iv, in crypto_authenc_genicv() 155 u8 *vdst; in crypto_authenc_genicv() 156 u8 *hash; in crypto_authenc_genicv() 187 u8 *iv = (u8 *)(abreq + 1) + in crypto_authenc_encrypt_done() 204 u8 *iv = (u8 *)(abreq + 1) + crypto_ablkcipher_reqsize(enc); in crypto_authenc_encrypt() 241 u8 *iv = req->giv; in crypto_authenc_givencrypt() [all …]
|
D | sha1_generic.c | 31 u8 buffer[64]; 49 static int sha1_update(struct shash_desc *desc, const u8 *data, in sha1_update() 54 const u8 *src; in sha1_update() 86 static int sha1_final(struct shash_desc *desc, u8 *out) in sha1_final() 92 static const u8 padding[64] = { 0x80, }; in sha1_final() 102 sha1_update(desc, (const u8 *)&bits, sizeof(bits)); in sha1_final()
|
D | wp512.c | 39 u8 bitLength[WP512_LENGTHBYTES]; 40 u8 buffer[WP512_BLOCK_SIZE]; 997 static int wp512_update(struct shash_desc *desc, const u8 *source, in wp512_update() 1007 u8 *buffer = wctx->buffer; in wp512_update() 1008 u8 *bitLength = wctx->bitLength; in wp512_update() 1015 bitLength[i] = (u8)carry; in wp512_update() 1022 buffer[bufferPos++] |= (u8)(b >> bufferRem); in wp512_update() 1059 static int wp512_final(struct shash_desc *desc, u8 *out) in wp512_final() 1063 u8 *buffer = wctx->buffer; in wp512_final() 1064 u8 *bitLength = wctx->bitLength; in wp512_final() [all …]
|
D | compress.c | 21 const u8 *src, unsigned int slen, in crypto_compress() 22 u8 *dst, unsigned int *dlen) in crypto_compress() 29 const u8 *src, unsigned int slen, in crypto_decompress() 30 u8 *dst, unsigned int *dlen) in crypto_decompress()
|
D | khazad.c | 756 static int khazad_setkey(struct crypto_tfm *tfm, const u8 *in_key, in khazad_setkey() 803 u8 *ciphertext, const u8 *plaintext) in khazad_crypt() 837 static void khazad_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in khazad_encrypt() 843 static void khazad_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) in khazad_decrypt()
|
D | gcm.c | 33 u8 nonce[4]; 40 u8 buffer[16]; 44 u8 auth_tag[16]; 45 u8 iauth_tag[16]; 62 return (void *)PTR_ALIGN((u8 *)aead_request_ctx(req), align + 1); in crypto_gcm_reqctx() 75 const u8 *src, unsigned int srclen) in crypto_gcm_ghash_update() 77 u8 *dst = ctx->buffer; in crypto_gcm_ghash_update() 81 u8 *pos = dst + (16 - ctx->bytes); in crypto_gcm_ghash_update() 111 u8 *src; in crypto_gcm_ghash_update_sg() 142 u8 *dst = ctx->buffer; in crypto_gcm_ghash_flush() [all …]
|
D | xts.c | 32 static int setkey(struct crypto_tfm *parent, const u8 *key, in setkey() 82 void (*fn)(struct crypto_tfm *, u8 *, const u8 *); 94 void (*tw)(struct crypto_tfm *, u8 *, const u8 *), in crypt() argument 95 void (*fn)(struct crypto_tfm *, u8 *, const u8 *)) in crypt() 104 u8 *wsrc; in crypt() 105 u8 *wdst; in crypt()
|
D | digest.c | 95 static int final(struct hash_desc *desc, u8 *out) in final() 104 u8 *dst = (u8 *)ALIGN(addr, align) + in final() 115 static int nosetkey(struct crypto_hash *tfm, const u8 *key, unsigned int keylen) in nosetkey() 121 static int setkey(struct crypto_hash *hash, const u8 *key, unsigned int keylen) in setkey() 130 struct scatterlist *sg, unsigned int nbytes, u8 *out) in digest() 162 static int digest_async_nosetkey(struct crypto_ahash *tfm_async, const u8 *key, in digest_async_nosetkey() 169 static int digest_async_setkey(struct crypto_ahash *tfm_async, const u8 *key, in digest_async_setkey()
|
D | cast6.c | 35 u8 Kr[12][4]; 364 static const u8 Tr[4][8] = { 384 static int cast6_setkey(struct crypto_tfm *tfm, const u8 *in_key, in cast6_setkey() 431 static void Q (u32 * block, u8 * Kr, u32 * Km) { in Q() 440 static void QBAR (u32 * block, u8 * Kr, u32 * Km) { in QBAR() 448 static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) in cast6_encrypt() 455 u8 * Kr; in cast6_encrypt() 481 static void cast6_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) { in cast6_decrypt() 487 u8 * Kr; in cast6_decrypt()
|
D | lzo.c | 47 static int lzo_compress(struct crypto_tfm *tfm, const u8 *src, in lzo_compress() 48 unsigned int slen, u8 *dst, unsigned int *dlen) in lzo_compress() 63 static int lzo_decompress(struct crypto_tfm *tfm, const u8 *src, in lzo_decompress() 64 unsigned int slen, u8 *dst, unsigned int *dlen) in lzo_decompress()
|
D | tgr192.c | 39 u8 hash[64]; 466 static void tgr192_transform(struct tgr192_ctx *tctx, const u8 * data) in tgr192_transform() 514 static int tgr192_update(struct shash_desc *desc, const u8 *inbuf, in tgr192_update() 555 static int tgr192_final(struct shash_desc *desc, u8 * out) in tgr192_final() 609 static int tgr160_final(struct shash_desc *desc, u8 * out) in tgr160_final() 611 u8 D[64]; in tgr160_final() 620 static int tgr128_final(struct shash_desc *desc, u8 * out) in tgr128_final() 622 u8 D[64]; in tgr128_final()
|
D | salsa20_generic.c | 58 static void salsa20_wordtobyte(u8 output[64], const u32 input[16]) in salsa20_wordtobyte() 107 static void salsa20_keysetup(struct salsa20_ctx *ctx, const u8 *k, u32 kbytes) in salsa20_keysetup() 131 static void salsa20_ivsetup(struct salsa20_ctx *ctx, const u8 *iv) in salsa20_ivsetup() 139 static void salsa20_encrypt_bytes(struct salsa20_ctx *ctx, u8 *dst, in salsa20_encrypt_bytes() 140 const u8 *src, unsigned int bytes) in salsa20_encrypt_bytes() 142 u8 buf[64]; in salsa20_encrypt_bytes() 169 static int setkey(struct crypto_tfm *tfm, const u8 *key, in setkey()
|