Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
1
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
2d3553e
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
acpi
asm-generic
clocksource
crypto
internal
acompress.h
aead.h
akcipher.h
blake2b.h
blake2s.h
chacha.h
cipher.h
des.h
ecc.h
engine.h
geniv.h
hash.h
kdf_selftest.h
kpp.h
poly1305.h
rng.h
rsa.h
scompress.h
sig.h
simd.h
skcipher.h
acompress.h
aead.h
aes.h
akcipher.h
algapi.h
arc4.h
aria.h
authenc.h
b128ops.h
blake2b.h
blake2s.h
blowfish.h
cast5.h
cast6.h
cast_common.h
chacha.h
chacha20poly1305.h
cryptd.h
ctr.h
curve25519.h
des.h
dh.h
drbg.h
ecc_curve.h
ecdh.h
engine.h
gcm.h
gf128mul.h
ghash.h
hash.h
hash_info.h
hmac.h
if_alg.h
kdf_sp800108.h
kpp.h
krb5.h
md5.h
nhpoly1305.h
null.h
padlock.h
pcrypt.h
pkcs7.h
poly1305.h
polyval.h
public_key.h
rng.h
scatterwalk.h
serpent.h
sha1.h
sha1_base.h
sha2.h
sha256_base.h
sha3.h
sha512_base.h
sig.h
skcipher.h
sm3.h
sm3_base.h
sm4.h
streebog.h
twofish.h
utils.h
xts.h
cxl
drm
dt-bindings
hyperv
keys
kunit
kvm
linux
math-emu
media
memory
misc
net
pcmcia
ras
rdma
rv
scsi
soc
sound
target
trace
uapi
ufs
vdso
video
xen
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
include
/
crypto
/
internal
/
scompress.h
Copy path
Blame
Blame
Latest commit
History
History
114 lines (98 loc) · 3.01 KB
Breadcrumbs
linux
/
include
/
crypto
/
internal
/
scompress.h
Top
File metadata and controls
Code
Blame
114 lines (98 loc) · 3.01 KB
Raw
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Synchronous Compression operations * * Copyright 2015 LG Electronics Inc. * Copyright (c) 2016, Intel Corporation * Author: Giovanni Cabiddu <giovanni.cabiddu@intel.com> */ #ifndef _CRYPTO_SCOMP_INT_H #define _CRYPTO_SCOMP_INT_H #include <crypto/acompress.h> #include <crypto/algapi.h> struct acomp_req; struct crypto_scomp { struct crypto_tfm base; }; /** * struct scomp_alg - synchronous compression algorithm * * @alloc_ctx: Function allocates algorithm specific context * @free_ctx: Function frees context allocated with alloc_ctx * @compress: Function performs a compress operation * @decompress: Function performs a de-compress operation * @base: Common crypto API algorithm data structure * @stream: Per-cpu memory for algorithm * @calg: Cmonn algorithm data structure shared with acomp */ struct scomp_alg { void *(*alloc_ctx)(void); void (*free_ctx)(void *ctx); int (*compress)(struct crypto_scomp *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx); int (*decompress)(struct crypto_scomp *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx); union { struct COMP_ALG_COMMON; struct comp_alg_common calg; }; }; static inline struct scomp_alg *__crypto_scomp_alg(struct crypto_alg *alg) { return container_of(alg, struct scomp_alg, base); } static inline struct crypto_scomp *__crypto_scomp_tfm(struct crypto_tfm *tfm) { return container_of(tfm, struct crypto_scomp, base); } static inline struct crypto_tfm *crypto_scomp_tfm(struct crypto_scomp *tfm) { return &tfm->base; } static inline void crypto_free_scomp(struct crypto_scomp *tfm) { crypto_destroy_tfm(tfm, crypto_scomp_tfm(tfm)); } static inline struct scomp_alg *crypto_scomp_alg(struct crypto_scomp *tfm) { return __crypto_scomp_alg(crypto_scomp_tfm(tfm)->__crt_alg); } static inline int crypto_scomp_compress(struct crypto_scomp *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { return crypto_scomp_alg(tfm)->compress(tfm, src, slen, dst, dlen, ctx); } static inline int crypto_scomp_decompress(struct crypto_scomp *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { return crypto_scomp_alg(tfm)->decompress(tfm, src, slen, dst, dlen, ctx); } /** * crypto_register_scomp() -- Register synchronous compression algorithm * * Function registers an implementation of a synchronous * compression algorithm * * @alg: algorithm definition * * Return: zero on success; error code in case of error */ int crypto_register_scomp(struct scomp_alg *alg); /** * crypto_unregister_scomp() -- Unregister synchronous compression algorithm * * Function unregisters an implementation of a synchronous * compression algorithm * * @alg: algorithm definition */ void crypto_unregister_scomp(struct scomp_alg *alg); int crypto_register_scomps(struct scomp_alg *algs, int count); void crypto_unregister_scomps(struct scomp_alg *algs, int count); #endif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
You can’t perform that action at this time.