-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Symmetric keygen: Themis Core (#560)
* Cleanup existing Doxygen comments for key generation Properly group and document all members of this file. The definition of themis_key_kind_t is tweaked a bit so that Doxygen does not generate two entries for both the enum and the typedef. However, we still keep the "enum themis_key_kind" tag available. * Symmetric keygen: Themis Core Implement themis_gen_sym_key() function in Themis Core. Add tests. It's pretty much documented in doxygen comments. This is the actual key generation implementation which will be used by all wrappers. * Additional tests with sanity checks Verify that we can generate big keys too, up to MAX_KEY_SIZE. Verify that key generation routines actually fill in the key buffer when they return THEMIS_SUCCESS, and that every invocation returns a different key. * Handle zero length consistently Asymmetric key generation API considers zero length "too small", not an error, and outputs a proper length while returning approriate error code. Update symmetric key generation behavior for consistency. * More strict check for default key length After fierce discussion we have reached a compromise: we should do a more strict check than "returns length greater that zero", but we do not want to export THEMIS_SYM_KEY_LENGTH constant. Copying its value for tests is acceptable.
- Loading branch information
Showing
4 changed files
with
262 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters