Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions 3way.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ static inline word32 reverseBits(word32 a)

// thanks to Paulo Barreto for this optimized theta()
#define theta(a0, a1, a2) \
{ \
word32 b0, b1, c; \
c = a0 ^ a1 ^ a2; \
{ \
word32 b0, b1, c; \
c = a0 ^ a1 ^ a2; \
c = rotlConstant<16>(c) ^ rotlConstant<8>(c); \
b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \
b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \
a0 ^= c ^ b0; \
a1 ^= c ^ b1; \
a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \
b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \
b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \
a0 ^= c ^ b0; \
a1 ^= c ^ b1; \
a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \
}

#define rho(a0, a1, a2) \
Expand Down
4 changes: 2 additions & 2 deletions aes_armv4.S
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ AES_Te:
.size AES_Te,.-AES_Te

@ void cryptogams_AES_encrypt_block(const unsigned char *in, unsigned char *out,
@ const AES_KEY *key) {
@ const AES_KEY *key) {
.globl cryptogams_AES_encrypt_block
.type cryptogams_AES_encrypt_block,%function
.align 5
Expand Down Expand Up @@ -955,7 +955,7 @@ AES_Td:
.size AES_Td,.-AES_Td

@ void cryptogams_AES_decrypt_block(const unsigned char *in, unsigned char *out,
@ const AES_KEY *key) {
@ const AES_KEY *key) {
.globl cryptogams_AES_decrypt_block
.type cryptogams_AES_decrypt_block,%function
.align 5
Expand Down
18 changes: 9 additions & 9 deletions asn.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ NAMESPACE_BEGIN(CryptoPP)
enum ASNTag
{
/// \brief ASN.1 Boolean
BOOLEAN = 0x01,
BOOLEAN = 0x01,
/// \brief ASN.1 Integer
INTEGER = 0x02,
INTEGER = 0x02,
/// \brief ASN.1 Bit string
BIT_STRING = 0x03,
/// \brief ASN.1 Octet string
Expand All @@ -53,21 +53,21 @@ enum ASNTag
/// \brief ASN.1 Sequence
SEQUENCE = 0x10,
/// \brief ASN.1 Set
SET = 0x11,
SET = 0x11,
/// \brief ASN.1 Numeric string
NUMERIC_STRING = 0x12,
/// \brief ASN.1 Printable string
PRINTABLE_STRING = 0x13,
PRINTABLE_STRING = 0x13,
/// \brief ASN.1 T61 string
T61_STRING = 0x14,
/// \brief ASN.1 Videotext string
VIDEOTEXT_STRING = 0x15,
VIDEOTEXT_STRING = 0x15,
/// \brief ASN.1 IA5 string
IA5_STRING = 0x16,
/// \brief ASN.1 UTC time
UTC_TIME = 0x17,
UTC_TIME = 0x17,
/// \brief ASN.1 Generalized time
GENERALIZED_TIME = 0x18,
GENERALIZED_TIME = 0x18,
/// \brief ASN.1 Graphic string
GRAPHIC_STRING = 0x19,
/// \brief ASN.1 Visible string
Expand All @@ -77,7 +77,7 @@ enum ASNTag
/// \brief ASN.1 Universal string
UNIVERSAL_STRING = 0x1c,
/// \brief ASN.1 BMP string
BMP_STRING = 0x1e
BMP_STRING = 0x1e
};

/// \brief ASN.1 flags
Expand Down Expand Up @@ -264,7 +264,7 @@ CRYPTOPP_DLL size_t CRYPTOPP_API BERDecodePeekLength(const BufferedTransformatio
class CRYPTOPP_DLL OID
{
public:
virtual ~OID() {}
//virtual ~OID() {}

/// \brief Construct an OID
OID() {}
Expand Down
28 changes: 14 additions & 14 deletions cpuid64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ SUBTITLE Microsoft specific ASM code to utilize CPUID and XGETBV64 for down leve
XGETBV64 PROC FRAME
.endprolog
;; query
DB 0fh, 01h, 0d0h
DB 0fh, 01h, 0d0h
;; xcr = (EDX << 32) | EAX
and rax, 0ffffffffh
shl rdx, 32
or rax, rdx
and rax, 0ffffffffh
shl rdx, 32
or rax, rdx
ret
XGETBV64 ENDP

Expand All @@ -38,24 +38,24 @@ XGETBV64 ENDP
ALIGN 8
CPUID64 PROC FRAME
;; preserve per ABI
mov [rsp+8], rbx
.savereg rbx, 8
mov [rsp+8], rbx
.savereg rbx, 8
.endprolog
;; eax = func
mov rax, rcx
mov rax, rcx
;; ecx = subfunc
mov rcx, rdx
mov rcx, rdx
;; query
cpuid
;; save
mov [r8+0], eax
mov [r8+4], ebx
mov [r8+8], ecx
mov [r8+12], edx
mov [r8+0], eax
mov [r8+4], ebx
mov [r8+8], ecx
mov [r8+12], edx
;; return value
mov rax, 1
mov rax, 1
;; restore
mov rbx, [rsp+8]
mov rbx, [rsp+8]
ret
CPUID64 ENDP

Expand Down
14 changes: 7 additions & 7 deletions integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ static word LinearMultiply(word *C, const word *AA, word B, size_t N)
Acc2WordsBy1(c, LowWord(p)) \
Acc2WordsBy1(d, HighWord(p))

#define Mul_SaveAcc(k, i, j) \
#define Mul_SaveAcc(k, i, j) \
R[k] = LowWord(c); \
Add2WordsBy1(c, d, HighWord(c)) \
MultiplyWords(p, A[i], B[j]) \
Expand Down Expand Up @@ -1203,13 +1203,13 @@ static word LinearMultiply(word *C, const word *AA, word B, size_t N)
#define Mul_Acc(i, j) \
MulAcc(c, d, A[i], B[j])

#define Mul_SaveAcc(k, i, j) \
#define Mul_SaveAcc(k, i, j) \
R[k] = c; \
c = LowWord(d); \
AssignWord(d, HighWord(d)) \
MulAcc(c, d, A[i], B[j])

#define Mul_End(k, i) \
#define Mul_End(k, i) \
R[k] = c; \
MultiplyWords(p, A[i], B[i]) \
Acc2WordsBy2(p, d) \
Expand Down Expand Up @@ -1244,7 +1244,7 @@ static word LinearMultiply(word *C, const word *AA, word B, size_t N)
#define Squ_NonDiag \
Double3Words(c, d)

#define Squ_SaveAcc(k, i, j) \
#define Squ_SaveAcc(k, i, j) \
Acc3WordsBy2(c, d, e) \
R[k] = c; \
MultiplyWords(p, A[i], A[j]) \
Expand Down Expand Up @@ -1361,12 +1361,12 @@ void Baseline_MultiplyBottom8(word *R, const word *AA, const word *BB)
MultiplyWords(p, A[i], B[j]);\
Acc2WordsBy1(d, HighWord(p));

#define Top_SaveAcc0(i, j) \
#define Top_SaveAcc0(i, j) \
c = LowWord(d); \
AssignWord(d, HighWord(d)) \
MulAcc(c, d, A[i], B[j])

#define Top_SaveAcc1(i, j) \
#define Top_SaveAcc1(i, j) \
c = L<c; \
Acc2WordsBy1(d, c); \
c = LowWord(d); \
Expand Down Expand Up @@ -3756,7 +3756,7 @@ std::ostream& operator<<(std::ostream& out, const Integer &a)

return out;
#else
return out << suffix;
return out << suffix;
#endif
}

Expand Down
8 changes: 4 additions & 4 deletions integer.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,17 +538,17 @@ class CRYPTOPP_DLL Integer : private InitializeInteger, public ASN1Object
/// \brief Negation
bool operator!() const;
/// \brief Addition
Integer operator+() const {return *this;}
Integer operator+() const {return *this;}
/// \brief Subtraction
Integer operator-() const;
Integer operator-() const;
/// \brief Pre-increment
Integer& operator++();
/// \brief Pre-decrement
Integer& operator--();
/// \brief Post-increment
Integer operator++(int) {Integer temp = *this; ++*this; return temp;}
Integer operator++(int) {Integer temp = *this; ++*this; return temp;}
/// \brief Post-decrement
Integer operator--(int) {Integer temp = *this; --*this; return temp;}
Integer operator--(int) {Integer temp = *this; --*this; return temp;}
//@}

/// \name BINARY OPERATORS
Expand Down
2 changes: 1 addition & 1 deletion misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ template <class T>
inline T Crop(T value, size_t bits)
{
if (bits < 8*sizeof(value))
return T(value & ((T(1) << bits) - 1));
return T(value & ((T(1) << bits) - 1));
else
return value;
}
Expand Down
2 changes: 1 addition & 1 deletion panama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void Panama<B>::Iterate(size_t count, const word32 *p, byte *output, const byte

word32 *const b16 = (word32 *)(void *)(bPtr+((bstart+16*32) & 31*32));
word32 *const b4 = (word32 *)(void *)(bPtr+((bstart+(32-4)*32) & 31*32));
bstart += 32;
bstart += 32;
word32 *const b0 = (word32 *)(void *)(bPtr+((bstart) & 31*32));
word32 *const b25 = (word32 *)(void *)(bPtr+((bstart+(32-25)*32) & 31*32));

Expand Down
2 changes: 1 addition & 1 deletion panama.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ template <class B = LittleEndian>
class PanamaMAC : public HermeticHashFunctionMAC<PanamaHash<B> >
{
public:
PanamaMAC() {}
PanamaMAC() {}
PanamaMAC(const byte *key, unsigned int length)
{this->SetKey(key, length);}
};
Expand Down
10 changes: 5 additions & 5 deletions rijndael.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,11 @@ void Rijndael::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLen, c
}
else if (keyLen == 32)
{
temp = rk[11];
rk[12] = rk[ 4] ^ (word32(Se[GETBYTE(temp, 3)]) << 24) ^ (word32(Se[GETBYTE(temp, 2)]) << 16) ^ (word32(Se[GETBYTE(temp, 1)]) << 8) ^ Se[GETBYTE(temp, 0)];
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
temp = rk[11];
rk[12] = rk[ 4] ^ (word32(Se[GETBYTE(temp, 3)]) << 24) ^ (word32(Se[GETBYTE(temp, 2)]) << 16) ^ (word32(Se[GETBYTE(temp, 1)]) << 8) ^ Se[GETBYTE(temp, 0)];
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
}
rk += keyLen/4;
}
Expand Down
4 changes: 2 additions & 2 deletions seckey.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class BlockCipherFinal : public ClonableImpl<BlockCipherFinal<DIR, BASE>, BASE>
public:
/// \brief Construct a default BlockCipherFinal
/// \details The cipher is not keyed.
BlockCipherFinal() {}
BlockCipherFinal() {}

/// \brief Construct a BlockCipherFinal
/// \param key a byte array used to key the cipher
Expand Down Expand Up @@ -372,7 +372,7 @@ class MessageAuthenticationCodeFinal : public ClonableImpl<MessageAuthentication
public:
/// \brief Construct a default MessageAuthenticationCodeFinal
/// \details The message authentication code is not keyed.
MessageAuthenticationCodeFinal() {}
MessageAuthenticationCodeFinal() {}
/// \brief Construct a BlockCipherFinal
/// \param key a byte array used to key the algorithm
/// \details key must be at least DEFAULT_KEYLENGTH in length. Internally, the function calls
Expand Down
18 changes: 9 additions & 9 deletions serpentp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ NAMESPACE_BEGIN(CryptoPP)
// linear transformation
#define LT(i,a,b,c,d,e) {\
a = rotlConstant<13>(a); \
c = rotlConstant<3>(c); \
d = rotlConstant<7>(d ^ c ^ (a << 3)); \
b = rotlConstant<1>(b ^ a ^ c); \
a = rotlConstant<5>(a ^ b ^ d); \
c = rotlConstant<3>(c); \
d = rotlConstant<7>(d ^ c ^ (a << 3)); \
b = rotlConstant<1>(b ^ a ^ c); \
a = rotlConstant<5>(a ^ b ^ d); \
c = rotlConstant<22>(c ^ d ^ (b << 7));}

// inverse linear transformation
#define ILT(i,a,b,c,d,e) {\
c = rotrConstant<22>(c); \
a = rotrConstant<5>(a); \
a = rotrConstant<5>(a); \
c ^= d ^ (b << 7); \
a ^= b ^ d; \
b = rotrConstant<1>(b); \
a ^= b ^ d; \
b = rotrConstant<1>(b); \
d = rotrConstant<7>(d) ^ c ^ (a << 3); \
b ^= a ^ c; \
c = rotrConstant<3>(c); \
b ^= a ^ c; \
c = rotrConstant<3>(c); \
a = rotrConstant<13>(a);}

// order of output from S-box functions
Expand Down
22 changes: 11 additions & 11 deletions sosemanuk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,17 +516,17 @@ void SosemanukPolicy::OperateKeystream(KeystreamOperation operation, byte *outpu
AS2( pand xmm0, xmm2)
AS2( pxor xmm0, xmm3)
AS2( pxor xmm2, xmm1)
AS2( pxor xmm2, xmm0)
AS2( por xmm3, xmm4)
AS2( pxor xmm3, xmm1)
AS2( pxor xmm4, xmm2)
AS2( movdqa xmm1, xmm3)
AS2( por xmm3, xmm4)
AS2( pxor xmm3, xmm0)
AS2( pand xmm0, xmm1)
AS2( pxor xmm4, xmm0)
AS2( pxor xmm1, xmm3)
AS2( pxor xmm1, xmm4)
AS2( pxor xmm2, xmm0)
AS2( por xmm3, xmm4)
AS2( pxor xmm3, xmm1)
AS2( pxor xmm4, xmm2)
AS2( movdqa xmm1, xmm3)
AS2( por xmm3, xmm4)
AS2( pxor xmm3, xmm0)
AS2( pand xmm0, xmm1)
AS2( pxor xmm4, xmm0)
AS2( pxor xmm1, xmm3)
AS2( pxor xmm1, xmm4)
AS2( pxor xmm4, xmm7)
// xor with v
AS2( pxor xmm2, [WORD_REG(di)+80*4])
Expand Down
2 changes: 1 addition & 1 deletion strciphr.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ class SymmetricCipherFinal : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BASE
virtual ~SymmetricCipherFinal() {}

/// \brief Construct a stream cipher
SymmetricCipherFinal() {}
SymmetricCipherFinal() {}

/// \brief Construct a stream cipher
/// \param key a byte array used to key the cipher
Expand Down
Loading
Loading