Go to the documentation of this file.
37 #define TRACE_LEVEL CRYPTO_TRACE_LEVEL
45 #if (XTS_SUPPORT == ENABLED)
58 const void *key,
size_t keyLen)
69 if(keyLen != 32 && keyLen != 64)
77 k2 = (uint8_t *) key + (keyLen / 2);
262 for(i = 15; i > 0; i--)
264 x[i] = (
a[i] << 1) | (
a[i - 1] >> 7);
271 x[0] ^= 0x87 & ~(
c - 1);
287 for(i = 0; i < 16; i++)
CipherAlgoDecryptBlock decryptBlock
CipherContext cipherContext1
CipherAlgoEncryptBlock encryptBlock
XEX-based tweaked-codebook mode with ciphertext stealing (XTS)
@ ERROR_INVALID_PARAMETER
Invalid parameter.
#define osMemcpy(dest, src, length)
void xtsXorBlock(uint8_t *x, const uint8_t *a, const uint8_t *b)
XOR operation.
error_t xtsInit(XtsContext *context, const CipherAlgo *cipherAlgo, const void *key, size_t keyLen)
Initialize XTS context.
error_t xtsEncrypt(XtsContext *context, const uint8_t *i, const uint8_t *p, uint8_t *c, size_t length)
Encrypt a data unit using XTS.
General definitions for cryptographic algorithms.
CipherContext cipherContext2
void xtsMul(uint8_t *x, const uint8_t *a)
Multiplication by x in GF(2^128)
Common interface for encryption algorithms.
const CipherAlgo * cipherAlgo
error_t xtsDecrypt(XtsContext *context, const uint8_t *i, const uint8_t *c, uint8_t *p, size_t length)
Decrypt a data unit using XTS.