Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetric keygen: high-level wrappers #561

Merged
merged 13 commits into from
Dec 11, 2019

Commits on Dec 6, 2019

  1. Symmetric keygen: ThemisPP

    C++ provides both convenient and in-place key generation routines.
    
    In-place key generation may be useful for C++03 code that does not
    want to have an extra copy of std::vector when it's being returned.
    
    ThemisPP does not provide separate types for keys, it works with
    plain std::vector.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    9637896 View commit details
    Browse the repository at this point in the history
  2. Symmetric keygen: WasmThemis

    Straightforward implementation. The only interestring thing is that
    size_t is mapped to i32 with Emscripten, as noted in all other APIs.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    2a7d3a8 View commit details
    Browse the repository at this point in the history
  3. Symmetric keygen: GoThemis

    Straightforward implementation.
    
    GoThemis provides wrapper types for private and public keys so we
    add another one with the same interface for symmetric keys.
    
    Currently GoThemis does not return Themis error codes to Go, so CGo
    code returns "bool" for simplicity and consistency.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    d7bbef3 View commit details
    Browse the repository at this point in the history
  4. Symmetric keygen: ObjCThemis and SwiftThemis

    Straightforward implementation. Objective-C function is automatically
    bridged to Swift, we don't have to do anything for that.
    
    Keypair generation API for ObjCThemis does not report exact errors
    to the user and simply returns "nil", We do the same for symmetric
    key generation for consistency.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    b4ce8bd View commit details
    Browse the repository at this point in the history
  5. Symmetric keygen: PHPThemis

    Straightforward implementation. PHPThemis exports its functionality
    as PHP functions so just add a new one. Byte arrays are returned as
    simply strings, no new types here. Just don't forget that we have
    to support both PHP 5 and PHP 7 wrappers.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    f72c0e1 View commit details
    Browse the repository at this point in the history
  6. Symmetric keygen: PyThemis

    Straightforward implementation.
    
    string_at() returns "str" with Python 2 and "bytes" with Python 3.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    c0cc339 View commit details
    Browse the repository at this point in the history
  7. Symmetric keygen: RbThemis

    Straightforward implementation. Probably the most concise one :)
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    971c2b2 View commit details
    Browse the repository at this point in the history
  8. Symmetric keygen: RustThemis

    Straigtforward implementation (albeit verbose).
    
    RustThemis has a relatively high bar for API documentation quality.
    Don't let it drop and provide detailed descriptions.
    
    themis_gen_sym_key() is added to libthemis-sys by bindgen automatically,
    we don't have to remember to do that manually.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    c5c3e80 View commit details
    Browse the repository at this point in the history
  9. Stricter length tests

    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    87ea19a View commit details
    Browse the repository at this point in the history
  10. More empty buffer checks

    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    a00dbf0 View commit details
    Browse the repository at this point in the history
  11. fixup! Stricter length tests

    JavaScript vOv
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    62ade93 View commit details
    Browse the repository at this point in the history
  12. fixup! Symmetric keygen: ObjCThemis and SwiftThemis

    Resolve a warning about "this function declaration is not a prototype".
    Objective-C is still C, not C++, so if a function does not take any
    arguments then it should have "(void)" argument list, not "()". Latter
    is considered to take any number of any arguments (for legacy reasons).
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    748664d View commit details
    Browse the repository at this point in the history
  13. More instance tests for PHP

    Just like with JsThemis that has nontrivial wrapper, let's make sure
    that key generation returns distinct objects for every call and we
    don't do anything silly in the implementation.
    ilammy committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    5922a4f View commit details
    Browse the repository at this point in the history