📄 sqcts.h
字号:
#ifndef __SQCTS_H#define __SQCTS_H/* Ciphertext Stealing (CTS) mode support IMPORTANT REMARKS: 1. This is a variant of Cipher Block Chaining which relaxes the restriction that the buffer length be a multiple of SQUARE_BLOCKSIZE. Note that the buffer length must still be >= SQUARE_BLOCKSIZE. 2. The IV is encrypted to avoid the possibility of being correlated with the plaintext.*/ #include "square.h"typedef struct { squareKeySchedule roundKeys_e, roundKeys_d; byte mask[SQUARE_BLOCKSIZE];} squareCtsContext;void squareCtsInit (squareCtsContext *ctxCts, const squareBlock key);void squareCtsSetIV (squareCtsContext *ctxCts, const squareBlock iv);void squareCtsEncrypt (squareCtsContext *ctxCts, byte *buffer, unsigned length);void squareCtsDecrypt (squareCtsContext *ctxCts, byte *buffer, unsigned length);void squareCtsFinal (squareCtsContext *ctxCts);#endif /* __SQCTS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -