summaryrefslogtreecommitdiff
path: root/modules/crypto
Commit message (Collapse)AuthorAgeFilesLines
* alignasof: new modulePaul Eggert2023-01-156-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This splits off support for the C23 keywords alignas and alignof, from the now-deprecated stdalign module. The latter now merely provides C11 support. * MODULES.html.sh, NEWS, doc/gnulib.texi: * doc/posix-headers/stdalign.texi: Document the change. * lib/stdalign.in.h: Remove most of the definitions (which are now supplied by the alignasof module), leaving only __alignas_is_defined and __alignof_is_defined. * modules/alignasof, modules/alignasof-tests: New files. * m4/stdalign.m4 (gl_ALIGNASOF): New macro, with most of the contents of the old gl_STDALIGN_H. Do not define __alignas_is_defined or __alignof_is_defined. (gl_STDALIGN_H): Rely on gl_ALIGNASOF for most of the work. * modules/alignalloc, modules/alignof, modules/argp: * modules/crypto/md4-buffer, modules/crypto/md5-buffer: * modules/crypto/sha1-buffer, modules/crypto/sha256-buffer: * modules/crypto/sha512-buffer, modules/crypto/sm3-buffer: * modules/fts, modules/rawmemchr, modules/relocatable-prog-wrapper: * modules/stddef-tests, modules/sys_socket: Depend on alignasof, not stdalign. * modules/stdalign: Deprecate. Depend on alignasof. * modules/stdalign-tests: Move most contents to the new module alignasof-tests, and depend on that.
* getrandom: Rename LIB_GETRANDOM to GETRANDOM_LIB.Bruno Haible2023-01-0719-19/+19
| | | | | | * m4/getrandom.m4: Rename LIB_GETRANDOM to GETRANDOM_LIB. All uses changed. * NEWS: Mention the change.
* Fix various test link errors on MSVC.Bruno Haible2022-09-0517-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/crypto/gc-arcfour-tests (Makefile.am): Link test-gc-arcfour with $(LIB_GETRANDOM). * modules/crypto/gc-arctwo-tests (Makefile.am): Link test-gc-arctwo with $(LIB_GETRANDOM). * modules/crypto/gc-des-tests (Makefile.am): Link test-gc-des with $(LIB_GETRANDOM). * modules/crypto/gc-hmac-md5-tests (Makefile.am): Link test-gc-hmac-md5 with $(LIB_GETRANDOM). * modules/crypto/gc-hmac-sha1-tests (Makefile.am): Link test-gc-hmac-sha1 with $(LIB_GETRANDOM). * modules/crypto/gc-hmac-sha256-tests (Makefile.am): Link test-gc-hmac-sha256 with $(LIB_GETRANDOM). * modules/crypto/gc-hmac-sha512-tests (Makefile.am): Link test-gc-hmac-sha512 with $(LIB_GETRANDOM). * modules/crypto/gc-md2-tests (Makefile.am): Link test-gc-md2 with $(LIB_GETRANDOM). * modules/crypto/gc-md4-tests (Makefile.am): Link test-gc-md4 with $(LIB_GETRANDOM). * modules/crypto/gc-md5-tests (Makefile.am): Link test-gc-md5 with $(LIB_GETRANDOM). * modules/crypto/gc-pbkdf2-tests (Makefile.am): Link test-gc-pbkdf2 with $(LIB_GETRANDOM). * modules/crypto/gc-pbkdf2-sha1-tests (Makefile.am): Link test-gc-pbkdf2-sha1 with $(LIB_GETRANDOM). * modules/crypto/gc-rijndael-tests (Makefile.am): Link test-gc-rijndael with $(LIB_GETRANDOM). * modules/crypto/gc-sha1-tests (Makefile.am): Link test-gc-sha1 with $(LIB_GETRANDOM). * modules/crypto/gc-sha256-tests (Makefile.am): Link test-gc-sha256 with $(LIB_GETRANDOM). * modules/crypto/gc-sha512-tests (Makefile.am): Link test-gc-sha512 with $(LIB_GETRANDOM). * modules/crypto/gc-sm3-tests (Makefile.am): Link test-gc-sm3 with $(LIB_GETRANDOM). * modules/sys_stat-c++-tests (Makefile.am): Link test-sys_stat-c++ with $(LIB_GETRANDOM). * modules/unistd-c++-tests (Makefile.am): Link test-unistd-c++ with $(LIB_GETRANDOM).
* Use the GL_CFLAG_GNULIB_WARNINGS for most AC_LIBOBJ compilation units.Bruno Haible2022-01-091-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/_Exit (configure.ac): Define an Automake conditional. Remove the AC_LIBOBJ invocation. (Makefile.am): Augment lib_SOURCES, guarded by that Automake conditional. * modules/accept: Likewise. * modules/access: Likewise. * modules/acosf: Likewise. * modules/acosl: Likewise. * modules/aligned_alloc: Likewise. * modules/alphasort: Likewise. * modules/argz: Likewise. * modules/asinf: Likewise. * modules/asinl: Likewise. * modules/atan2f: Likewise. * modules/atanf: Likewise. * modules/atanl: Likewise. * modules/atexit: Likewise. * modules/atoll: Likewise. * modules/bind: Likewise. * modules/btowc: Likewise. * modules/c32rtomb: Likewise. * modules/canonicalize-lgpl: Likewise. * modules/cbrt: Likewise. * modules/cbrtf: Likewise. * modules/cbrtl: Likewise. * modules/ceil: Likewise. * modules/ceilf: Likewise. * modules/ceill: Likewise. * modules/chdir-long: Likewise. * modules/chown: Likewise. * modules/close: Likewise. * modules/closedir: Likewise. * modules/cnd: Likewise. * modules/connect: Likewise. * modules/copy-file-range: Likewise. * modules/copysign: Likewise. * modules/copysignf: Likewise. * modules/copysignl: Likewise. * modules/cosf: Likewise. * modules/coshf: Likewise. * modules/cosl: Likewise. * modules/creat: Likewise. * modules/crypto/gc: Likewise. * modules/ctime: Likewise. * modules/dirfd: Likewise. * modules/dup: Likewise. * modules/dup2: Likewise. * modules/duplocale: Likewise. * modules/error: Likewise. * modules/euidaccess: Likewise. * modules/execinfo: Likewise. * modules/execl: Likewise. * modules/execle: Likewise. * modules/execlp: Likewise. * modules/execv: Likewise. * modules/execve: Likewise. * modules/execvp: Likewise. * modules/execvpe: Likewise. * modules/exp2: Likewise. * modules/exp2f: Likewise. * modules/exp2l: Likewise. * modules/expf: Likewise. * modules/expl: Likewise. * modules/explicit_bzero: Likewise. * modules/expm1: Likewise. * modules/expm1f: Likewise. * modules/expm1l: Likewise. * modules/fabsf: Likewise. * modules/fabsl: Likewise. * modules/faccessat: Likewise. * modules/fchdir: Likewise. * modules/fchmodat: Likewise. * modules/fchownat: Likewise. * modules/fclose: Likewise. * modules/fcntl: Likewise. * modules/fdatasync: Likewise. * modules/fdopen: Likewise. * modules/fdopendir: Likewise. * modules/fflush: Likewise. * modules/ffs: Likewise. * modules/ffsl: Likewise. * modules/ffsll: Likewise. * modules/fileblocks: Likewise. * modules/float: Likewise. * modules/flock: Likewise. * modules/floor: Likewise. * modules/floorf: Likewise. * modules/floorl: Likewise. * modules/fma: Likewise. * modules/fmaf: Likewise. * modules/fmal: Likewise. * modules/fmod: Likewise. * modules/fmodf: Likewise. * modules/fmodl: Likewise. * modules/forkpty: Likewise. * modules/fpending: Likewise. * modules/fpurge: Likewise. * modules/freadable: Likewise. * modules/freadahead: Likewise. * modules/freadptr: Likewise. * modules/free-posix: Likewise. * modules/freopen: Likewise. * modules/frexpf: Likewise. * modules/fseek: Likewise. * modules/fseeko: Likewise. * modules/fseterr: Likewise. * modules/fstat: Likewise. * modules/fstatat: Likewise. * modules/fsusage: Likewise. * modules/fsync: Likewise. * modules/ftell: Likewise. * modules/ftello: Likewise. * modules/ftruncate: Likewise. * modules/fts: Likewise. * modules/futimens: Likewise. * modules/fwritable: Likewise. * modules/fwriting: Likewise. * modules/getaddrinfo: Likewise. * modules/getcwd: Likewise. * modules/getcwd-lgpl: Likewise. * modules/getdelim: Likewise. * modules/getdomainname: Likewise. * modules/getdtablesize: Likewise. * modules/getentropy: Likewise. * modules/getgroups: Likewise. * modules/gethostname: Likewise. * modules/getline: Likewise. * modules/getloadavg: Likewise. * modules/getlogin: Likewise. * modules/getlogin_r: Likewise. * modules/getopt-posix: Likewise. * modules/getpagesize: Likewise. * modules/getpeername: Likewise. * modules/getrandom: Likewise. * modules/getrusage: Likewise. * modules/getsockname: Likewise. * modules/getsockopt: Likewise. * modules/getsubopt: Likewise. * modules/gettimeofday: Likewise. * modules/getumask: Likewise. * modules/getusershell: Likewise. * modules/glob: Likewise. * modules/grantpt: Likewise. * modules/group-member: Likewise. * modules/hypot: Likewise. * modules/hypotf: Likewise. * modules/hypotl: Likewise. * modules/iconv_open: Likewise. * modules/ilogb: Likewise. * modules/ilogbf: Likewise. * modules/ilogbl: Likewise. * modules/imaxabs: Likewise. * modules/imaxdiv: Likewise. * modules/inet_ntop: Likewise. * modules/inet_pton: Likewise. * modules/ioctl: Likewise. * modules/isapipe: Likewise. * modules/isatty: Likewise. * modules/isblank: Likewise. * modules/isfinite: Likewise. * modules/isinf: Likewise. * modules/iswblank: Likewise. * modules/iswctype: Likewise. * modules/iswdigit: Likewise. * modules/iswxdigit: Likewise. * modules/lchmod: Likewise. * modules/lchown: Likewise. * modules/ldexpf: Likewise. * modules/ldexpl: Likewise. * modules/libgmp: Likewise. * modules/link: Likewise. * modules/linkat: Likewise. * modules/listen: Likewise. * modules/localeconv: Likewise. * modules/localtime: Likewise. * modules/log: Likewise. * modules/log10: Likewise. * modules/log10f: Likewise. * modules/log10l: Likewise. * modules/log1p: Likewise. * modules/log1pf: Likewise. * modules/log1pl: Likewise. * modules/log2: Likewise. * modules/log2f: Likewise. * modules/log2l: Likewise. * modules/logb: Likewise. * modules/logbf: Likewise. * modules/logbl: Likewise. * modules/logf: Likewise. * modules/login_tty: Likewise. * modules/logl: Likewise. * modules/lseek: Likewise. * modules/lstat: Likewise. * modules/mbrlen: Likewise. * modules/mbrtoc32: Likewise. * modules/mbrtowc: Likewise. * modules/mbsinit: Likewise. * modules/mbsnrtowcs: Likewise. * modules/mbsrtowcs: Likewise. * modules/mbtowc: Likewise. * modules/memalign: Likewise. * modules/memchr: Likewise. * modules/memcmp: Likewise. * modules/memcpy: Likewise. * modules/memmove: Likewise. * modules/mempcpy: Likewise. * modules/memrchr: Likewise. * modules/memset: Likewise. * modules/mkdir: Likewise. * modules/mkdirat: Likewise. * modules/mkdtemp: Likewise. * modules/mkfifo: Likewise. * modules/mkfifoat: Likewise. * modules/mknod: Likewise. * modules/mkostemp: Likewise. * modules/mkostemps: Likewise. * modules/mkstemp: Likewise. * modules/mkstemps: Likewise. * modules/modf: Likewise. * modules/modff: Likewise. * modules/modfl: Likewise. * modules/mountlist: Likewise. * modules/msvc-inval: Likewise. * modules/msvc-nothrow: Likewise. * modules/mtx: Likewise. * modules/nanosleep: Likewise. * modules/nl_langinfo: Likewise. * modules/obstack: Likewise. * modules/open: Likewise. * modules/openat: Likewise. * modules/opendir: Likewise. * modules/openpty: Likewise. * modules/pclose: Likewise. * modules/perror: Likewise. * modules/pipe-posix: Likewise. * modules/poll: Likewise. * modules/popen: Likewise. * modules/posix_memalign: Likewise. * modules/posix_openpt: Likewise. * modules/posix_spawn: Likewise. * modules/posix_spawn-internal: Likewise. * modules/posix_spawn_file_actions_addchdir: Likewise. * modules/posix_spawn_file_actions_addclose: Likewise. * modules/posix_spawn_file_actions_adddup2: Likewise. * modules/posix_spawn_file_actions_addfchdir: Likewise. * modules/posix_spawn_file_actions_addopen: Likewise. * modules/posix_spawn_file_actions_destroy: Likewise. * modules/posix_spawn_file_actions_init: Likewise. * modules/posix_spawnattr_destroy: Likewise. * modules/posix_spawnattr_getflags: Likewise. * modules/posix_spawnattr_getpgroup: Likewise. * modules/posix_spawnattr_getschedparam: Likewise. * modules/posix_spawnattr_getschedpolicy: Likewise. * modules/posix_spawnattr_getsigdefault: Likewise. * modules/posix_spawnattr_getsigmask: Likewise. * modules/posix_spawnattr_init: Likewise. * modules/posix_spawnattr_setflags: Likewise. * modules/posix_spawnattr_setpgroup: Likewise. * modules/posix_spawnattr_setschedparam: Likewise. * modules/posix_spawnattr_setschedpolicy: Likewise. * modules/posix_spawnattr_setsigdefault: Likewise. * modules/posix_spawnattr_setsigmask: Likewise. * modules/posix_spawnp: Likewise. * modules/powf: Likewise. * modules/pread: Likewise. * modules/pselect: Likewise. * modules/pthread-cond: Likewise. * modules/pthread-mutex: Likewise. * modules/pthread-once: Likewise. * modules/pthread-rwlock: Likewise. * modules/pthread-spin: Likewise. * modules/pthread-thread: Likewise. * modules/pthread-tss: Likewise. * modules/pthread_mutex_timedlock: Likewise. * modules/pthread_sigmask: Likewise. * modules/ptsname: Likewise. * modules/ptsname_r: Likewise. * modules/putenv: Likewise. * modules/pwrite: Likewise. * modules/qsort_r: Likewise. * modules/raise: Likewise. * modules/random: Likewise. * modules/random_r: Likewise. * modules/rawmemchr: Likewise. * modules/read: Likewise. * modules/readdir: Likewise. * modules/readline: Likewise. * modules/readlink: Likewise. * modules/readlinkat: Likewise. * modules/readutmp: Likewise. * modules/reallocarray: Likewise. * modules/recv: Likewise. * modules/recvfrom: Likewise. * modules/regex: Likewise. * modules/relocatable-prog: Likewise. * modules/remainder: Likewise. * modules/remainderf: Likewise. * modules/remainderl: Likewise. * modules/remove: Likewise. * modules/rename: Likewise. * modules/renameat: Likewise. * modules/rewinddir: Likewise. * modules/rint: Likewise. * modules/rintf: Likewise. * modules/rintl: Likewise. * modules/rmdir: Likewise. * modules/round: Likewise. * modules/roundf: Likewise. * modules/roundl: Likewise. * modules/rpmatch: Likewise. * modules/scandir: Likewise. * modules/sched_yield: Likewise. * modules/secure_getenv: Likewise. * modules/select: Likewise. * modules/selinux-h: Likewise. * modules/send: Likewise. * modules/sendto: Likewise. * modules/setenv: Likewise. * modules/sethostname: Likewise. * modules/setlocale: Likewise. * modules/setlocale-null: Likewise. * modules/setsockopt: Likewise. * modules/shutdown: Likewise. * modules/sig2str: Likewise. * modules/sigabbrev_np: Likewise. * modules/sigaction: Likewise. * modules/sigdescr_np: Likewise. * modules/signbit: Likewise. * modules/sigprocmask: Likewise. * modules/sinf: Likewise. * modules/sinhf: Likewise. * modules/sinl: Likewise. * modules/sleep: Likewise. * modules/socket: Likewise. * modules/spawn-pipe: Likewise. * modules/sqrtf: Likewise. * modules/sqrtl: Likewise. * modules/stat: Likewise. * modules/stdio: Likewise. * modules/stpcpy: Likewise. * modules/stpncpy: Likewise. * modules/strcase: Likewise. * modules/strchrnul: Likewise. * modules/strcspn: Likewise. * modules/strdup-posix: Likewise. * modules/strerror: Likewise. * modules/strerror-override: Likewise. * modules/strerrorname_np: Likewise. * modules/strfmon_l: Likewise. * modules/strftime-fixes: Likewise. * modules/strncat: Likewise. * modules/strndup: Likewise. * modules/strnlen: Likewise. * modules/strpbrk: Likewise. * modules/strptime: Likewise. * modules/strsep: Likewise. * modules/strsignal: Likewise. * modules/strtod: Likewise. * modules/strtoimax: Likewise. * modules/strtok_r: Likewise. * modules/strtol: Likewise. * modules/strtold: Likewise. * modules/strtoll: Likewise. * modules/strtoul: Likewise. * modules/strtoull: Likewise. * modules/strtoumax: Likewise. * modules/strverscmp: Likewise. * modules/symlink: Likewise. * modules/symlinkat: Likewise. * modules/tanf: Likewise. * modules/tanhf: Likewise. * modules/tanl: Likewise. * modules/tcgetsid: Likewise. * modules/thrd: Likewise. * modules/time_r: Likewise. * modules/time_rz: Likewise. * modules/timegm: Likewise. * modules/times: Likewise. * modules/timespec_get: Likewise. * modules/timespec_getres: Likewise. * modules/tmpfile: Likewise. * modules/towctrans: Likewise. * modules/trunc: Likewise. * modules/truncate: Likewise. * modules/truncf: Likewise. * modules/truncl: Likewise. * modules/tsearch: Likewise. * modules/tss: Likewise. * modules/ttyname_r: Likewise. * modules/tzset: Likewise. * modules/uname: Likewise. * modules/unlink: Likewise. * modules/unlinkat: Likewise. * modules/unlockpt: Likewise. * modules/unsetenv: Likewise. * modules/usleep: Likewise. * modules/utime: Likewise. * modules/utimensat: Likewise. * modules/waitpid: Likewise. * modules/wcpcpy: Likewise. * modules/wcpncpy: Likewise. * modules/wcrtomb: Likewise. * modules/wcscasecmp: Likewise. * modules/wcscat: Likewise. * modules/wcschr: Likewise. * modules/wcscmp: Likewise. * modules/wcscoll: Likewise. * modules/wcscpy: Likewise. * modules/wcscspn: Likewise. * modules/wcsdup: Likewise. * modules/wcsftime: Likewise. * modules/wcslen: Likewise. * modules/wcsncasecmp: Likewise. * modules/wcsncat: Likewise. * modules/wcsncmp: Likewise. * modules/wcsncpy: Likewise. * modules/wcsnlen: Likewise. * modules/wcsnrtombs: Likewise. * modules/wcspbrk: Likewise. * modules/wcsrchr: Likewise. * modules/wcsrtombs: Likewise. * modules/wcsspn: Likewise. * modules/wcsstr: Likewise. * modules/wcstok: Likewise. * modules/wcswidth: Likewise. * modules/wcsxfrm: Likewise. * modules/wctob: Likewise. * modules/wctomb: Likewise. * modules/wctrans: Likewise. * modules/wctype: Likewise. * modules/wcwidth: Likewise. * modules/windows-cond: Likewise. * modules/windows-mutex: Likewise. * modules/windows-once: Likewise. * modules/windows-recmutex: Likewise. * modules/windows-rwlock: Likewise. * modules/windows-spawn: Likewise. * modules/windows-spin: Likewise. * modules/windows-thread: Likewise. * modules/windows-timedmutex: Likewise. * modules/windows-timedrecmutex: Likewise. * modules/windows-timedrwlock: Likewise. * modules/windows-tls: Likewise. * modules/wmemchr: Likewise. * modules/wmemcmp: Likewise. * modules/wmemcpy: Likewise. * modules/wmemmove: Likewise. * modules/wmempcpy: Likewise. * modules/wmemset: Likewise. * modules/write: Likewise.
* sm3-buffer tests: New module.Bruno Haible2021-09-192-11/+11
| | | | | | | * tests/test-sm3-buffer.c: Renamed from tests/test-sm3.c. * modules/crypto/sm3-buffer-tests: Renamed from modules/crypto/sm3-tests. Test tests/test-sm3-buffer.c instead of tests/test-sm3.c.
* sm3-buffer: New module.Bruno Haible2021-09-192-10/+35
| | | | | | | | | * lib/sm3-stream.c: New file, extracted from lib/sm3.c. * lib/sm3.c: Don't include stdlib.h, unlocked-io.h. (BLOCKSIZE, sm3_stream): Moved to sm3-stream.c. * lib/sm3.h: Tweak. * modules/crypto/sm3-buffer: New file, based on modules/crypto/sm3. * modules/crypto/sm3: Rewritten.
* sha512-buffer tests: New module.Bruno Haible2021-09-192-12/+20
| | | | | | | | | * tests/test-sha512-stream.c: Renamed from tests/test-sha512.c. * modules/crypto/sha512-buffer-tests: New file, based on modules/crypto/sha512-tests. * modules/crypto/sha512-tests: Remove tests that are now in modules/crypto/sha512-buffer-tests. Test tests/test-sha512-stream.c instead of tests/test-sha512.c.
* sha512: Clarify module to source relation.Bruno Haible2021-09-191-1/+5
| | | | | | | | | | | | * lib/sha512-stream.c: New file, extracted from lib/sha512.c. * lib/sha512.c: Don't include stdlib.h, unlocked-io.h. (BLOCKSIZE, shaxxx_stream, sha512_stream, sha384_stream): Moved to sha512-stream.c. * lib/sha512.h: Tweak. * modules/crypto/sha512 (Files): Add lib/sha512-stream.c. (configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM. (Makefile.am): Arrange to compile sha512-stream.c. (Link): Mention $(LIB_CRYPTO).
* sha256-buffer tests: New module.Bruno Haible2021-09-192-12/+20
| | | | | | | | | * tests/test-sha256-stream.c: Renamed from tests/test-sha256.c. * modules/crypto/sha256-buffer-tests: New file, based on modules/crypto/sha256-tests. * modules/crypto/sha256-tests: Remove tests that are now in modules/crypto/sha256-buffer-tests. Test tests/test-sha256-stream.c instead of tests/test-sha256.c.
* sha256: Clarify module to source relation.Bruno Haible2021-09-191-1/+5
| | | | | | | | | | | | * lib/sha256-stream.c: New file, extracted from lib/sha256.c. * lib/sha256.c: Don't include stdlib.h, unlocked-io.h. (BLOCKSIZE, shaxxx_stream, sha256_stream, sha224_stream): Moved to sha256-stream.c. * lib/sha256.h: Tweak. * modules/crypto/sha256 (Files): Add lib/sha256-stream.c. (configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM. (Makefile.am): Arrange to compile sha256-stream.c. (Link): Mention $(LIB_CRYPTO).
* sha1-buffer tests: New module.Bruno Haible2021-09-192-10/+22
| | | | | | | | | | | * tests/test-sha1-buffer.c: New file, based on tests/test-sha1.c. * tests/test-sha1-stream.c: Renamed from tests/test-sha1.c. (main): Remove sha1-buffer tests. * modules/crypto/sha1-buffer-tests: New file, based on modules/crypto/sha1-tests. * modules/crypto/sha1-tests: Remove tests that are now in modules/crypto/sha1-buffer-tests. Test tests/test-sha1-stream.c instead of tests/test-sha1.c.
* sha1: Clarify module to source relation.Bruno Haible2021-09-191-1/+5
| | | | | | | | | | | * lib/sha1-stream.c: New file, extracted from lib/sha1.c. * lib/sha1.c: Don't include stdlib.h, unlocked-io.h. (BLOCKSIZE, sha1_stream): Moved to sha1-stream.c. * lib/sha1.h: Correct indentation. * modules/crypto/sha1 (Files): Add lib/sha1-stream.c. (configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM. (Makefile.am): Arrange to compile sha1-stream.c. (Link): Mention $(LIB_CRYPTO).
* md5-buffer tests: New module.Bruno Haible2021-09-192-10/+22
| | | | | | | | | | | * tests/test-md5-buffer.c: New file, based on tests/test-md5.c. * tests/test-md5-stream.c: Renamed from tests/test-md5.c. (main): Remove md5-buffer tests. * modules/crypto/md5-buffer-tests: New file, based on modules/crypto/md5-tests. * modules/crypto/md5-tests: Remove tests that are now in modules/crypto/md5-buffer-tests. Test tests/test-md5-stream.c instead of tests/test-md5.c.
* md5: Clarify module to source relation.Bruno Haible2021-09-191-1/+5
| | | | | | | | | | | * lib/md5-stream.c: New file, extracted from lib/md5.c. * lib/md5.c: Don't include stdlib.h, unlocked-io.h. (BLOCKSIZE, md5_stream): Moved to md5-stream.c. * lib/md5.h: Tweak. * modules/crypto/md5 (Files): Add lib/md5-stream.c. (configure.ac): Don't define GL_COMPILE_CRYPTO_STREAM. (Makefile.am): Arrange to compile md5-stream.c. (Link): Mention $(LIB_CRYPTO).
* md4-buffer tests: New module.Bruno Haible2021-09-192-10/+10
| | | | | | | * tests/test-md4-buffer.c: Renamed from tests/test-md4.c. * modules/crypto/md4-buffer-tests: Renamed from modules/crypto/md4-tests. Test tests/test-md4-buffer.c instead of tests/test-md4.c.
* md4-buffer: New module.Bruno Haible2021-09-192-9/+31
| | | | | | | | | * lib/md4-stream.c: New file, extracted from lib/md4.c. * lib/md4.c: Don't include stdlib.h, unlocked-io.h. (BLOCKSIZE, md4_stream): Moved to md4-stream.c. * lib/md4.h: Reorder declarations. * modules/crypto/md4-buffer: New file, based on modules/crypto/md4. * modules/crypto/md4: Rewritten.
* md2-buffer tests: New module.Bruno Haible2021-09-192-10/+10
| | | | | | | * tests/test-md2-buffer.c: Renamed from tests/test-md2.c. * modules/crypto/md2-buffer-tests: Renamed from modules/crypto/md2-tests. Test tests/test-md2-buffer.c instead of tests/test-md2.c.
* md2-buffer: New module.Bruno Haible2021-09-192-5/+27
| | | | | | | | | * lib/md2-stream.c: New file, extracted from lib/md2.c. * lib/md2.c: Don't include stdlib.h, unlocked-io.h. (BLOCKSIZE, md2_stream): Moved to md2-stream.c. * lib/md2.h: Reorder declarations. * modules/crypto/md2-buffer: New file, based on modules/crypto/md2. * modules/crypto/md2: Rewritten.
* crypto: revert previous changePaul Eggert2021-09-074-4/+0
|
* crypto: add missing file af_alg.hPaul Eggert2021-09-064-0/+4
| | | | | | * modules/crypto/md5-buffer, modules/crypto/sha1-buffer: * modules/crypto/sha256-buffer, modules/crypto/sha512-buffer: (Files): Add lib/af_alg.h, since the .c files include it.
* gc-random: Fix link error in tests.Bruno Haible2021-01-202-1/+4
| | | | | | * modules/crypto/gc-random (Link): New section. * modules/crypto/gc-tests (Makefile.am): Link test-gc with $(LIB_GETRANDOM).
* gc-random: Replace implementation with call to getrandom.Simon Josefsson2021-01-202-6/+2
| | | | | | | | | | | | * lib/gc-gnulib.c [GNULIB_GC_RANDOM]: Replace #include's with those needed for getrandom. (gc_init): Remove old randomness code. (gc_done): Likewise. (randomize): Rewrite using getrandom, inspired by getentropy. * m4/gc-random.m4: Remove file. * modules/crypto/gc-random: Drop gc-random.m4, gl_GC_RANDOM, and LIB_GC_RANDOM. Add conditional dependency on getrandom. * modules/crypto/gc-tests (test_gc_LDADD): Drop LIB_GC_RANDOM.
* Use module 'c99' when needed for variadic macros with '...' syntax.Bruno Haible2020-09-051-0/+1
| | | | * modules/crypto/sm3 (Depends-on): Add c99.
* Use module 'c99' when needed for declaration-after-statement syntax.Bruno Haible2020-09-0512-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/backup-rename (Depends-on): Add c99. * modules/backupfile (Depends-on): Likewise. * modules/bitset-tests (Depends-on): Likewise. * modules/bitsetv (Depends-on): Likewise. * modules/c-strtod (Depends-on): Likewise. * modules/c-strtold (Depends-on): Likewise. * modules/clean-temp (Depends-on): Likewise. * modules/copy-file (Depends-on): Likewise. * modules/crypto/hmac-md5-tests (Depends-on): Likewise. * modules/crypto/hmac-sha1-tests (Depends-on): Likewise. * modules/crypto/hmac-sha256-tests (Depends-on): Likewise. * modules/crypto/hmac-sha512-tests (Depends-on): Likewise. * modules/crypto/md5-buffer (Depends-on): Likewise. * modules/crypto/md5-tests (Depends-on): Likewise. * modules/crypto/sha1-buffer (Depends-on): Likewise. * modules/crypto/sha1-tests (Depends-on): Likewise. * modules/crypto/sha256-buffer (Depends-on): Likewise. * modules/crypto/sha256-tests (Depends-on): Likewise. * modules/crypto/sha512-buffer (Depends-on): Likewise. * modules/crypto/sha512-tests (Depends-on): Likewise. * modules/diffseq (Depends-on): Likewise. * modules/fatal-signal (Depends-on): Likewise. * modules/fchmodat (Depends-on): Likewise. * modules/fstrcmp (Depends-on): Likewise. * modules/fsusage (Depends-on): Likewise. * modules/fts (Depends-on): Likewise. * modules/fts-tests (Depends-on): Likewise. * modules/getumask (Depends-on): Likewise. * modules/git-merge-changelog (Depends-on): Likewise. * modules/hash-map (Depends-on): Likewise. * modules/hash-set (Depends-on): Likewise. * modules/lchmod (Depends-on): Likewise. * modules/libgmp-tests (Depends-on): Likewise. * modules/libtextstyle-optional-tests (Depends-on): Likewise. * modules/linkedhash-map (Depends-on): Likewise. * modules/linkedhash-set (Depends-on): Likewise. * modules/long-options (Depends-on): Likewise. * modules/mbrtoc32 (Depends-on): Likewise. * modules/memchr2-tests (Depends-on): Likewise. * modules/memmem-tests (Depends-on): Likewise. * modules/memrchr-tests (Depends-on): Likewise. * modules/mktime-internal (Depends-on): Likewise. * modules/nstrftime (Depends-on): Likewise. * modules/opendirat (Depends-on): Likewise. * modules/parse-datetime (Depends-on): Likewise. * modules/quotearg-simple-tests (Depends-on): Likewise. * modules/same (Depends-on): Likewise. * modules/supersede (Depends-on): Likewise. * modules/supersede-tests (Depends-on): Likewise. * modules/time_rz (Depends-on): Likewise. * modules/unistr/u16-chr-tests (Depends-on): Likewise. * modules/unistr/u32-chr-tests (Depends-on): Likewise. * modules/unistr/u8-chr-tests (Depends-on): Likewise. * modules/xalloc (Depends-on): Likewise. * modules/xnanosleep (Depends-on): Likewise.
* crypto/gc-random: Fix typo in last commit.Bruno Haible2020-05-302-2/+2
|
* crypto/gc-random: Fix link error on MSVC.Bruno Haible2020-05-302-1/+4
| | | | | | | * m4/gc-random.m4 (gl_GC_RANDOM): Set LIB_GC_RAMDOM. * modules/crypto/gc-random (Link): New section. * modules/crypto/gc-tests (Makefile.am): Link test-gc against $(LIB_GC_RAMDOM).
* crypto/gc: Make more robust in multithreaded applications.Bruno Haible2020-05-281-0/+1
| | | | | * lib/gc-gnulib.c (randomize): Pass an O_CLOEXEC flag to open(). * modules/crypto/gc (Depends-on): Add 'open'.
* crypto/af_alg, renameatu, same, term-style-control: Depend on fstat.Bruno Haible2020-03-091-0/+1
| | | | | | | * modules/crypto/af_alg (Depends-on): Add fstat. * modules/renameatu (Depends-on): Likewise. * modules/same (Depends-on): Likewise. * modules/term-style-control (Depends-on): Likewise.
* crypto/hmac-*: Use 'restrict'.Bruno Haible2020-02-234-0/+4
| | | | | | | | | * lib/hmac.h (hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512): Use 'restrict'. * modules/crypto/hmac-md5 (configure.ac): Require AC_C_RESTRICT. * modules/crypto/hmac-sha1 (configure.ac): Likewise. * modules/crypto/hmac-sha256 (configure.ac): Likewise. * modules/crypto/hmac-sha512 (configure.ac): Likewise.
* crypto/sha512-buffer: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | | * lib/sha512.h (sha512_finish_ctx, sha384_finish_ctx, sha512_read_ctx, sha384_read_ctx, sha512_buffer, sha384_buffer): Use 'restrict'. * modules/crypto/sha512-buffer (configure.ac): Require AC_C_RESTRICT.
* crypto/sha256-buffer: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | | * lib/sha256.h (sha256_finish_ctx, sha224_finish_ctx, sha256_read_ctx, sha224_read_ctx, sha256_buffer, sha224_buffer): Use 'restrict'. * modules/crypto/sha256-buffer (configure.ac): Require AC_C_RESTRICT.
* crypto/sha1-buffer: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | | * lib/sha1.h (sha1_finish_ctx, sha1_read_ctx, sha1_buffer): Use 'restrict'. * modules/crypto/sha1-buffer (configure.ac): Require AC_C_RESTRICT.
* crypto/md5-buffer: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | | * lib/md5.h (__md5_finish_ctx, __md5_read_ctx, __md5_buffer): Use 'restrict'. * modules/crypto/md5-buffer (configure.ac): Require AC_C_RESTRICT.
* crypto/md4: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | * lib/md4.h (md4_finish_ctx, md4_read_ctx, md4_buffer): Use 'restrict'. * modules/crypto/md4 (configure.ac): Require AC_C_RESTRICT.
* crypto/md2: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | * lib/md2.h (md2_finish_ctx, md2_read_ctx, md2_buffer): Use 'restrict'. * modules/crypto/md2 (configure.ac): Require AC_C_RESTRICT.
* crypto/rijndael: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | | * lib/rijndael-api-fst.h (rijndaelBlockEncrypt, rijndaelPadEncrypt, rijndaelBlockDecrypt, rijndaelPadDecrypt): Use 'restrict'. * modules/crypto/rijndael (configure.ac): Require AC_C_RESTRICT.
* crypto/arctwo: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | * lib/arctwo.h (arctwo_encrypt, arctwo_decrypt): Use 'restrict'. * modules/crypto/arctwo (configure.ac): Require AC_C_RESTRICT.
* crypto/arcfour: Use 'restrict'.Bruno Haible2020-02-231-0/+1
| | | | | * lib/arcfour.h (arcfour_stream): Use 'restrict'. * modules/crypto/arcfour (configure.ac): Require AC_C_RESTRICT.
* crypto/gc-pbkdf2: New module.Simon Josefsson2020-01-153-2/+41
| | | | | | | | | | | * MODULES.html.sh (func_all_modules): Add gc-pbkdf2. * NEWS: Deprecated gc-pbkdf2-sha1 in favor of gc-pbkdf2. * lib/gc-pbkdf2.c: New file. * lib/gc-pbkdf2-sha1.c: Use new interface. * lib/gc.h (GC_MAX_DIGEST_SIZE, gc_pbkdf2_hmac): Add. * modules/crypto/gc-pbkdf2: New file. * modules/crypto/gc-pbkdf2-tests: New file. * tests/test-gc-pbkdf2.c: New file.
* crypto/gc-sha512: Add tests.Bruno Haible2019-08-241-0/+11
| | | | | * tests/test-gc-sha512.c: New file, based on tests/test-gc-sha1.c. * modules/crypto/gc-sha512-tests: New file.
* crypto/gc-sha256: Add tests.Bruno Haible2019-08-241-0/+11
| | | | | * tests/test-gc-sha256.c: New file, based on tests/test-gc-sha1.c. * modules/crypto/gc-sha256-tests: New file.
* crypto/gc-sha256, crypto/gc-sha512: New modules.Bruno Haible2019-08-242-0/+48
| | | | | | | | | | | | * lib/gc.h (gc_sha256, gc_sha512): New declarations. * lib/gc-gnulib.c: Include sha256.h, sha512.h. (MAX_DIGEST_SIZE): Set to 64. (_gc_hash_ctx, gc_hash_open, gc_hash_digest_length, gc_hash_write, gc_hash_read, gc_hash_buffer): Add support for sha256 and sha512. (gc_sha256, gc_sha512): New functions. * lib/gc-libgcrypt.c (gc_sha256, gc_sha512): New functions. * modules/crypto/gc-sha256: New file, based on modules/crypto/gc-sha1. * modules/crypto/gc-sha512: New file, based on modules/crypto/gc-sha1.
* crypto/gc-{md[24],rijndael} tests: Fix link error with --with-libgcrypt.Bruno Haible2019-08-243-0/+3
| | | | | | | * modules/crypto/gc-md2-tests (test_gc_md2_LDADD): New variable. * modules/crypto/gc-md4-tests (test_gc_md4_LDADD): New variable. * modules/crypto/gc-rijndael-tests (test_gc_rijndael_LDADD): New variable.
* gc: Fix configuration with --with-libgcrypt.Bruno Haible2019-08-241-0/+1
| | | | | | * m4/libgcrypt.m4: New file, copied from libgcrypt/src/libgcrypt.m4. * modules/crypto/gc (Files): Add it. * m4/gc.m4 (gl_GC): Assume AM_PATH_LIBGCRYPT is defined.
* Remove incorrect 'Link' sections.Bruno Haible2019-01-044-8/+0
| | | | | | | | | | | | | | | | | | | * modules/acl (Link): Remove section. Use combined 'Link' sections from the dependencies instead. * modules/crypto/md5 (Link): Likewise. * modules/crypto/sha1 (Link): Likewise. * modules/crypto/sha256 (Link): Likewise. * modules/crypto/sha512 (Link): Likewise. * modules/faccessat (Link): Likewise. * modules/fdutimensat (Link): Likewise. * modules/iconv_open-utf (Link): Likewise. * modules/propername (Link): Likewise. * modules/qacl (Link): Likewise. * modules/unicodeio (Link): Likewise. * modules/utimecmp (Link): Likewise. * modules/utimensat (Link): Likewise. * modules/xstriconv (Link): Likewise. * modules/xstriconveh (Link): Likewise.
* hmac-*: refactor to remove repetitive codePádraig Brady2018-10-014-0/+4
| | | | | | | | | | | | | | | | | | A net removal of 240 lines. * lib/hmac.c: A new parameterized single implementation. * lib/hmac-md5.c: Define parameters and include implementation. * lib/hmac-sha1.c: Likewise. * lib/hmac-sha256.c: Likewise. * lib/hmac-sha512.c: Likewise. * modules/crypto/hmac-md5: Reference the new implementation file. * modules/crypto/hmac-sha1: Likewise. * modules/crypto/hmac-sha256: Likewise. * modules/crypto/hmac-sha512: Likewise. * tests/test-hmac-md5.c: Refactor common code to a single function. * tests/test-hmac-sha1.c: Likewise. * tests/test-hmac-sha256.c: Likewise. * tests/test-hmac-sha512.c: Likewise.
* af_alg: Fix state of stream after sendfile() succeeds.Bruno Haible2018-06-251-0/+1
| | | | | | | | * lib/af_alg.c (afalg_stream): Invoke fflush and lseek, to ensure that the stream is correctly positioned afterwards. * modules/crypto/af_alg (Depends-on): Add fflush. * tests/test-digest.h (test_digest_on_files): Verify that after the operation the stream is positioned at end of file.
* af_alg tests: Add another test.Bruno Haible2018-06-254-0/+4
| | | | | | | | | | | | | * tests/test-digest.h (test_digest_on_files): Also check a large file with a skipped header. * tests/test-md5.c: Include macros.h. * tests/test-sha1.c: Likewise. * tests/test-sha256.c: Likewise. * tests/test-sha512.c: Likewise. * modules/crypto/md5-tests (Files): Add tests/macros.h. * modules/crypto/sha1-tests (Files): Likewise. * modules/crypto/sha256-tests (Files): Likewise. * modules/crypto/sha512-tests (Files): Likewise.
* crypto: use byteswapPaul Eggert2018-06-176-0/+6
| | | | | | | | | | * lib/md4.c, lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c: * lib/sm3.c: Include <byteswap.h>. (SWAP): Use its macros rather than reinventing the wheel. * modules/crypto/md4, modules/crypto/md5-buffer: * modules/crypto/sha1-buffer, modules/crypto/sha256-buffer: * modules/crypto/sha512-buffer, modules/crypto/sm3: (Depends-on): Add byteswap.
* Port crypto/af_alg to GCC 4.8.4Paul Eggert2018-06-031-0/+1
| | | | | | Problem reported by Peter Simons in: https://lists.gnu.org/r/bug-gnulib/2018-06/msg00002.html * modules/crypto/af_alg (Depends-on): Add c99 if USE_AF_ALG.