resize.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*############################################################################
  2. # Copyright 2017 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################*/
  16. /// Declares ResizeOctStr
  17. /*! \file */
  18. #ifndef EPID_MEMBER_SRC_RESIZE_H_
  19. #define EPID_MEMBER_SRC_RESIZE_H_
  20. #include <string.h>
  21. #include "epid/common/errors.h"
  22. #include "epid/common/types.h"
  23. /// Resizes octet string number
  24. /*!
  25. Prepends input number with zeros when increasing the size.
  26. Removes leading zeros when decreasing the size.
  27. Return error if input number does not fit the new size.
  28. \param[in] a
  29. Octet string to resize
  30. \param[in] a_size
  31. Size of the a
  32. \param[out] r
  33. Result octet string
  34. \param[in] r_size
  35. New size
  36. \returns ::EpidStatus
  37. */
  38. EpidStatus ResizeOctStr(ConstOctStr a, size_t a_size, OctStr r, size_t r_size);
  39. #endif // EPID_MEMBER_SRC_RESIZE_H_