Skip to content
Snippets Groups Projects
  1. Aug 16, 2019
  2. Aug 15, 2019
    • tholenst's avatar
      Add a function ResizeStringUninitialized to subtle util. · 52877193
      tholenst authored
      This function has the contract that it doesn't need to initialize the string when resizing. At the moment, the only implementation we have is the one which does the additional work of actually resizing the string.
      
      PiperOrigin-RevId: 263559220
      52877193
    • tholenst's avatar
      Migrate the tests for the HMacKeyManager. · 89ac7b0e
      tholenst authored
      With the KeyTypeManager we can now test individual functions easily, so I'll do that here.
      
      PiperOrigin-RevId: 263558445
      89ac7b0e
    • tholenst's avatar
      Replace the vector with a string in aes_ctr_boringssl. · a39f6148
      tholenst authored
      We also replace some memcpy instances with string operations. Context on the string replacement: cl/263529237
      
      PiperOrigin-RevId: 263557252
      a39f6148
    • tholenst's avatar
      Stop using string::replace. · 58fe4b13
      tholenst authored
      In an earlier change I used string::replace, but looking at the string::replace API it feels that it is a little bit weird. Let's try to avoid it.
      
      PiperOrigin-RevId: 263549047
      58fe4b13
    • tholenst's avatar
      Migrate the tests for the AesSivKeyManagerTest. · abceabbf
      tholenst authored
      PiperOrigin-RevId: 263531796
      abceabbf
    • tholenst's avatar
      Migrate the AesSivKeyManager to a KeyTypeManager. · b192aa97
      tholenst authored
      We will migrate the test in an upcoming cl.
      
      PiperOrigin-RevId: 263530089
      b192aa97
    • tholenst's avatar
      Replace the vector with a string in aes_gcm_boringssl. · a5cb0e0d
      tholenst authored
      This removes one string copy from both encryption and decryption. When doing this, we need to ensure that we can write in the buffer underlying the string. The C++11 standard states in the relevant section 21.4.5: Returns: *(begin() + pos) if pos < size(), otherwise a reference to an object of type T with value charT(); the referenced value shall not be modified."
      
      This is somewhat unclear: should the referenced value only not be modified in case pos = size() -- which would be a natural restriction, or should the referenced value never be modified (which would mean that string a; a[1] = 'a'; is already UB).
      
      The second interpretation seems outrageous, and C++14 clarifies it, apparently: "operator[]: returns *(begin() + pos) if pos < size(). Otherwise, returns a reference to an object of type charT with value charT(), where modifying the object leads to undefined behavior."
      
      I think the intention of the standard is that this works, and furthermore, I don't believe that any compiler will break this in C++11.
      
      PiperOrigin-RevId: 263529237
      a5cb0e0d
  3. Aug 14, 2019
  4. Aug 13, 2019
  5. Aug 12, 2019
  6. Aug 09, 2019
  7. Aug 08, 2019
    • tholenst's avatar
      Add the streaming_aead_test_util_test to CMake. · c72d510c
      tholenst authored
      This was forgotten in a previous cl.
      
      PiperOrigin-RevId: 262357462
      c72d510c
    • paulavidas's avatar
      Fix ciphertext segment size validation. · 9cdfccc3
      paulavidas authored
      We changed the segment size validation in all Tink streaming keys such that the first block always needs to have room for at least 1 byte of ciphertext. Previously it was not consistent. The decision whether to allow empty ciphertexts in the first segment is somewhat arbitrary, but it should be consistent everywhere.
      
      PiperOrigin-RevId: 262315914
      9cdfccc3
    • tholenst's avatar
      Add using declarations for the type parameters in KeyTypeManagers and use them. · c101e379
      tholenst authored
      We previously used passed an owned raw pointer from registry.h to registry_impl.h, because this makes it possible to infer template parameters (which doesn't work with unique pointers). However, it is better to instead specify the parameters explicitly, which is easiest if we add typedefs to the KeyTypeManager class.
      
      This will also be useful elsewhere (to create [1] automatically).
      
      PiperOrigin-RevId: 262295924
      c101e379
  8. Aug 07, 2019
  9. Aug 06, 2019
Loading