Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:kfreitag
veracrypt
load_xts.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File load_xts.diff of Package veracrypt
diff --git a/Volume/EncryptionTest.cpp b/Volume/EncryptionTest.cpp index 23d04ea..fc06420 100644 --- a/src/Volume/EncryptionTest.cpp +++ b/src/Volume/EncryptionTest.cpp @@ -9,6 +9,15 @@ contained in the file License.txt included in VeraCrypt binary and source code distribution packages. */ +#include <linux/if_alg.h> +#include <sys/socket.h> +#include <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#ifndef AF_ALG +#define AF_ALG 38 +#endif #include "Cipher.h" #include "Common/Crc.h" @@ -501,6 +510,22 @@ namespace VeraCrypt nbrUnits = sizeof (buf) / ENCRYPTION_DATA_UNIT_SIZE; + /* Enable the kernel XTS module */ + struct sockaddr_alg sa_alg; + int sock; + + sock = socket(AF_ALG, SOCK_SEQPACKET, 0); + if (sock < 0) { + perror("socket(AF_ALG)"); + exit(1); + } + sa_alg.salg_family = AF_ALG; + strncpy((char *) sa_alg.salg_name, "xts", sizeof(sa_alg.salg_name)); + strncpy((char *) sa_alg.salg_type, "hash", sizeof(sa_alg.salg_name)); + + bind(sock, (struct sockaddr *) &sa_alg, sizeof(sa_alg)); + close(sock); + /* The buffer can accommodate 4 data units and we'll test 4 cases by "scrolling". The data unit 0xFFFFFFFFFF will "move" from the start of the buffer to its end. For a 512-byte data unit, the byte offset 562949953420800 corresponds to the data unit 0xFFFFFFFFFF. */
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor