Changeset View
Changeset View
Standalone View
Standalone View
include/QtCrypto/qca_basic.h
Show All 39 Lines | |||||
40 | 40 | | |||
41 | // Qt5 comes with QStringLiteral for wrapping string literals, which Qt4 does | 41 | // Qt5 comes with QStringLiteral for wrapping string literals, which Qt4 does | ||
42 | // not have. It is needed if the headers are built with QT_NO_CAST_FROM_ASCII. | 42 | // not have. It is needed if the headers are built with QT_NO_CAST_FROM_ASCII. | ||
43 | // Defining it here as QString::fromUtf8 for convenience. | 43 | // Defining it here as QString::fromUtf8 for convenience. | ||
44 | #ifndef QStringLiteral | 44 | #ifndef QStringLiteral | ||
45 | #define QStringLiteral(str) QString::fromUtf8(str) | 45 | #define QStringLiteral(str) QString::fromUtf8(str) | ||
46 | #endif | 46 | #endif | ||
47 | 47 | | |||
48 | namespace QCA { | 48 | namespace QCA | ||
49 | { | ||||
49 | 50 | | |||
50 | /** | 51 | /** | ||
51 | \defgroup UserAPI QCA user API | 52 | \defgroup UserAPI QCA user API | ||
52 | 53 | | |||
53 | This is the main set of QCA classes, intended for use | 54 | This is the main set of QCA classes, intended for use | ||
54 | in standard applications. | 55 | in standard applications. | ||
55 | */ | 56 | */ | ||
56 | 57 | | |||
Show All 32 Lines | 75 | public: | |||
89 | 90 | | |||
90 | ~Random(); | 91 | ~Random(); | ||
91 | 92 | | |||
92 | /** | 93 | /** | ||
93 | Assignment operator | 94 | Assignment operator | ||
94 | 95 | | |||
95 | \param from the %Random object to copy state from | 96 | \param from the %Random object to copy state from | ||
96 | */ | 97 | */ | ||
97 | Random & operator=(const Random &from); | 98 | Random &operator=(const Random &from); | ||
98 | 99 | | |||
99 | /** | 100 | /** | ||
100 | Provide a random byte. | 101 | Provide a random byte. | ||
101 | 102 | | |||
102 | This method isn't normally required - you should use | 103 | This method isn't normally required - you should use | ||
103 | the static randomChar() method instead. | 104 | the static randomChar() method instead. | ||
104 | 105 | | |||
105 | \sa randomChar | 106 | \sa randomChar | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 218 | public: | |||
234 | 235 | | |||
235 | ~Hash(); | 236 | ~Hash(); | ||
236 | 237 | | |||
237 | /** | 238 | /** | ||
238 | Assignment operator | 239 | Assignment operator | ||
239 | 240 | | |||
240 | \param from the Hash object to copy state from | 241 | \param from the Hash object to copy state from | ||
241 | */ | 242 | */ | ||
242 | Hash & operator=(const Hash &from); | 243 | Hash &operator=(const Hash &from); | ||
243 | 244 | | |||
244 | /** | 245 | /** | ||
245 | Returns a list of all of the hash types available | 246 | Returns a list of all of the hash types available | ||
246 | 247 | | |||
247 | \param provider the name of the provider to get a list from, if one | 248 | \param provider the name of the provider to get a list from, if one | ||
248 | provider is required. If not specified, available hash types from all | 249 | provider is required. If not specified, available hash types from all | ||
249 | providers will be returned. | 250 | providers will be returned. | ||
250 | */ | 251 | */ | ||
▲ Show 20 Lines • Show All 339 Lines • ▼ Show 20 Line(s) | |||||
590 | public: | 591 | public: | ||
591 | /** | 592 | /** | ||
592 | Mode settings for cipher algorithms. | 593 | Mode settings for cipher algorithms. | ||
593 | 594 | | |||
594 | \note ECB is almost never what you want, unless you | 595 | \note ECB is almost never what you want, unless you | ||
595 | are trying to implement a %Cipher variation that is not | 596 | are trying to implement a %Cipher variation that is not | ||
596 | supported by %QCA. | 597 | supported by %QCA. | ||
597 | */ | 598 | */ | ||
598 | enum Mode | 599 | enum Mode { | ||
599 | { | | |||
600 | CBC, ///< operate in %Cipher Block Chaining mode | 600 | CBC, ///< operate in %Cipher Block Chaining mode | ||
601 | CFB, ///< operate in %Cipher FeedBack mode | 601 | CFB, ///< operate in %Cipher FeedBack mode | ||
602 | ECB, ///< operate in Electronic Code Book mode | 602 | ECB, ///< operate in Electronic Code Book mode | ||
603 | OFB, ///< operate in Output FeedBack Mode | 603 | OFB, ///< operate in Output FeedBack Mode | ||
604 | CTR, ///< operate in CounTer Mode | 604 | CTR, ///< operate in CounTer Mode | ||
605 | GCM, ///< operate in Galois Counter Mode | 605 | GCM, ///< operate in Galois Counter Mode | ||
606 | CCM ///< operate in Counter with CBC-MAC | 606 | CCM ///< operate in Counter with CBC-MAC | ||
607 | }; | 607 | }; | ||
608 | 608 | | |||
609 | /** | 609 | /** | ||
610 | Padding variations for cipher algorithms. | 610 | Padding variations for cipher algorithms. | ||
611 | 611 | | |||
612 | See the \ref paddingDescription description for more details on | 612 | See the \ref paddingDescription description for more details on | ||
613 | padding schemes. | 613 | padding schemes. | ||
614 | */ | 614 | */ | ||
615 | enum Padding | 615 | enum Padding { | ||
616 | { | | |||
617 | DefaultPadding, ///< Default for cipher-mode | 616 | DefaultPadding, ///< Default for cipher-mode | ||
618 | NoPadding, ///< Do not use padding | 617 | NoPadding, ///< Do not use padding | ||
619 | PKCS7 ///< Pad using the scheme in PKCS#7 | 618 | PKCS7 ///< Pad using the scheme in PKCS#7 | ||
620 | }; | 619 | }; | ||
621 | 620 | | |||
622 | /** | 621 | /** | ||
623 | Standard constructor | 622 | Standard constructor | ||
624 | 623 | | |||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
671 | 670 | | |||
672 | ~Cipher(); | 671 | ~Cipher(); | ||
673 | 672 | | |||
674 | /** | 673 | /** | ||
675 | Assignment operator | 674 | Assignment operator | ||
676 | 675 | | |||
677 | \param from the Cipher to copy state from | 676 | \param from the Cipher to copy state from | ||
678 | */ | 677 | */ | ||
679 | Cipher & operator=(const Cipher &from); | 678 | Cipher &operator=(const Cipher &from); | ||
680 | 679 | | |||
681 | /** | 680 | /** | ||
682 | Returns a list of all of the cipher types available | 681 | Returns a list of all of the cipher types available | ||
683 | 682 | | |||
684 | \param provider the name of the provider to get a list from, if one | 683 | \param provider the name of the provider to get a list from, if one | ||
685 | provider is required. If not specified, available cipher types from all | 684 | provider is required. If not specified, available cipher types from all | ||
686 | providers will be returned. | 685 | providers will be returned. | ||
687 | */ | 686 | */ | ||
▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 827 | public: | |||
852 | /** | 851 | /** | ||
853 | Assignment operator. | 852 | Assignment operator. | ||
854 | 853 | | |||
855 | Copies the state (including key) from one MessageAuthenticationCode | 854 | Copies the state (including key) from one MessageAuthenticationCode | ||
856 | to another | 855 | to another | ||
857 | 856 | | |||
858 | \param from the MessageAuthenticationCode to assign from. | 857 | \param from the MessageAuthenticationCode to assign from. | ||
859 | */ | 858 | */ | ||
860 | MessageAuthenticationCode & operator=(const MessageAuthenticationCode &from); | 859 | MessageAuthenticationCode &operator=(const MessageAuthenticationCode &from); | ||
861 | 860 | | |||
862 | /** | 861 | /** | ||
863 | Returns a list of all of the message authentication code types | 862 | Returns a list of all of the message authentication code types | ||
864 | available | 863 | available | ||
865 | 864 | | |||
866 | \param provider the name of the provider to get a list from, if one | 865 | \param provider the name of the provider to get a list from, if one | ||
867 | provider is required. If not specified, available message authentication | 866 | provider is required. If not specified, available message authentication | ||
868 | codes types from all providers will be returned. | 867 | codes types from all providers will be returned. | ||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 953 | public: | |||
964 | /** | 963 | /** | ||
965 | Assignment operator | 964 | Assignment operator | ||
966 | 965 | | |||
967 | Copies the state (including key) from one KeyDerivationFunction | 966 | Copies the state (including key) from one KeyDerivationFunction | ||
968 | to another | 967 | to another | ||
969 | 968 | | |||
970 | \param from the KeyDerivationFunction to assign from | 969 | \param from the KeyDerivationFunction to assign from | ||
971 | */ | 970 | */ | ||
972 | KeyDerivationFunction & operator=(const KeyDerivationFunction &from); | 971 | KeyDerivationFunction &operator=(const KeyDerivationFunction &from); | ||
973 | 972 | | |||
974 | /** | 973 | /** | ||
975 | Generate the key from a specified secret and salt value | 974 | Generate the key from a specified secret and salt value | ||
976 | 975 | | |||
977 | \note key length is ignored for some functions | 976 | \note key length is ignored for some functions | ||
978 | 977 | | |||
979 | \param secret the secret (password or passphrase) | 978 | \param secret the secret (password or passphrase) | ||
980 | \param salt the salt to use | 979 | \param salt the salt to use | ||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Line(s) | 1093 | public: | |||
1112 | /** | 1111 | /** | ||
1113 | Assignment operator | 1112 | Assignment operator | ||
1114 | 1113 | | |||
1115 | Copies the state (including key) from one HKDF | 1114 | Copies the state (including key) from one HKDF | ||
1116 | to another | 1115 | to another | ||
1117 | 1116 | | |||
1118 | \param from the HKDF to assign from | 1117 | \param from the HKDF to assign from | ||
1119 | */ | 1118 | */ | ||
1120 | HKDF & operator=(const HKDF &from); | 1119 | HKDF &operator=(const HKDF &from); | ||
1121 | 1120 | | |||
1122 | /** | 1121 | /** | ||
1123 | Generate the key from a specified secret, salt value, and an additional info | 1122 | Generate the key from a specified secret, salt value, and an additional info | ||
1124 | 1123 | | |||
1125 | \note key length is ignored for some functions | 1124 | \note key length is ignored for some functions | ||
1126 | 1125 | | |||
1127 | \param secret the secret (password or passphrase) | 1126 | \param secret the secret (password or passphrase) | ||
1128 | \param salt the salt to use | 1127 | \param salt the salt to use | ||
Show All 12 Lines |