mirror of
https://github.com/QuasarApp/qca.git
synced 2025-04-26 19:44:32 +00:00
Implement the Whirlpool hashing algorithm, and the
CAST5 cipher in QCA. CCMAIL: tnagy1024@gmail.com svn path=/trunk/kdesupport/qca/; revision=707711
This commit is contained in:
parent
8b904d7e81
commit
a0992ebbd0
@ -46,11 +46,13 @@
|
||||
- SHA-256
|
||||
- SHA-384
|
||||
- SHA-512
|
||||
- Whirlpool
|
||||
- Ciphers (QCA::Cipher) using
|
||||
- BlowFish
|
||||
- Triple DES
|
||||
- DES
|
||||
- AES (128, 192 and 256 bit)
|
||||
- CAST5 (also known as CAST-128)
|
||||
- Message Authentication Code (QCA::MessageAuthenticationCode), using
|
||||
- HMAC with SHA-1
|
||||
- HMAC with MD5
|
||||
@ -134,7 +136,7 @@
|
||||
The architecture of %QCA is shown below:
|
||||
|
||||
\image html qca-arch.png "QCA Architecture"
|
||||
\image latex qca-arch.eps "QCA Architecture"
|
||||
\image latex qca-arch.eps "QCA Architecture" width=\textwidth
|
||||
|
||||
Application authors normally only need to use the User API. The
|
||||
provider API is available for plugin authors, but can also
|
||||
|
@ -485,6 +485,17 @@ private:
|
||||
"Specifications for the Secure %Hash Standard", available from
|
||||
http://csrc.nist.gov/publications/. The label for SHA-512 is
|
||||
"sha512".
|
||||
|
||||
The Whirlpool algorithm takes an arbitrary data stream, known as
|
||||
the message (up to \f$2^{256}\f$ bits in length) and outputs a
|
||||
condensed 512 bit (64 byte) representation of that data
|
||||
stream, known as the message digest. The Whirlpool algorithm is
|
||||
considered secure in that it is considered computationally
|
||||
infeasible to find the message that produced the message
|
||||
digest. For more information on Whirlpool, see
|
||||
http://paginas.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html
|
||||
or ISO/IEC 10118-3:2004. The label for Whirlpool is
|
||||
"whirlpool".
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -541,6 +552,7 @@ private:
|
||||
- AES128 - "aes128"
|
||||
- AES192 - "aes192"
|
||||
- AES256 - "aes256"
|
||||
- CAST5 (CAST-128) - "cast5"
|
||||
|
||||
When checking for the availability of a particular kind
|
||||
of cipher operation (e.g. AES128 in CBC mode with PKCS7
|
||||
|
@ -6347,6 +6347,8 @@ public:
|
||||
return KeyLength( 24, 24, 1);
|
||||
} else if (m_type.left(6) == "aes256") {
|
||||
return KeyLength( 32, 32, 1);
|
||||
} else if (m_type.left(5) == "cast5") {
|
||||
return KeyLength( 5, 16, 1);
|
||||
} else if (m_type.left(8) == "blowfish") {
|
||||
// Don't know - TODO
|
||||
return KeyLength( 1, 32, 1);
|
||||
@ -6386,6 +6388,9 @@ static QStringList all_hash_types()
|
||||
#endif
|
||||
#ifdef SHA512_DIGEST_LENGTH
|
||||
list += "sha512";
|
||||
#endif
|
||||
#ifdef OBJ_whirlpool
|
||||
list += "whirlpool";
|
||||
#endif
|
||||
return list;
|
||||
}
|
||||
@ -6421,6 +6426,11 @@ static QStringList all_cipher_types()
|
||||
list += "des-cbc-pkcs7";
|
||||
list += "des-cfb";
|
||||
list += "des-ofb";
|
||||
list += "cast5-ecb";
|
||||
list += "cast5-cbc";
|
||||
list += "cast5-cbc-pkcs7";
|
||||
list += "cast5-cfb";
|
||||
list += "cast5-ofb";
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -6589,6 +6599,10 @@ public:
|
||||
#ifdef SHA512_DIGEST_LENGTH
|
||||
else if ( type == "sha512" )
|
||||
return new opensslHashContext( EVP_sha512(), this, type);
|
||||
#endif
|
||||
#ifdef OBJ_whirlpool
|
||||
else if ( type == "whirlpool" )
|
||||
return new opensslHashContext( EVP_whirlpool(), this, type);
|
||||
#endif
|
||||
else if ( type == "pbkdf1(sha1)" )
|
||||
return new opensslPbkdf1Context( EVP_sha1(), this, type );
|
||||
@ -6672,6 +6686,16 @@ public:
|
||||
return new opensslCipherContext( EVP_des_cfb(), 0, this, type);
|
||||
else if ( type == "des-ofb" )
|
||||
return new opensslCipherContext( EVP_des_ofb(), 0, this, type);
|
||||
else if ( type == "cast5-ecb" )
|
||||
return new opensslCipherContext( EVP_cast5_ecb(), 0, this, type);
|
||||
else if ( type == "cast5-cbc" )
|
||||
return new opensslCipherContext( EVP_cast5_cbc(), 0, this, type);
|
||||
else if ( type == "cast5-cbc-pkcs7" )
|
||||
return new opensslCipherContext( EVP_cast5_cbc(), 1, this, type);
|
||||
else if ( type == "cast5-cfb" )
|
||||
return new opensslCipherContext( EVP_cast5_cfb(), 0, this, type);
|
||||
else if ( type == "cast5-ofb" )
|
||||
return new opensslCipherContext( EVP_cast5_ofb(), 0, this, type);
|
||||
else if ( type == "pkey" )
|
||||
return new MyPKeyContext( this );
|
||||
else if ( type == "dlgroup" )
|
||||
|
Loading…
x
Reference in New Issue
Block a user