• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
19 #ifndef EPID_MEMBER_SRC_RESIZE_H_
20 #define EPID_MEMBER_SRC_RESIZE_H_
21 
22 #include <string.h>
23 #include "epid/common/errors.h"
24 #include "epid/common/types.h"
25 
26 /// Resizes octet string number
27 /*!
28 Prepends input number with zeros when increasing the size.
29 Removes leading zeros when decreasing the size.
30 Return error if input number does not fit the new size.
31 
32 \param[in] a
33 Octet string to resize
34 \param[in] a_size
35 Size of the a
36 \param[out] r
37 Result octet string
38 \param[in] r_size
39 New size
40 
41 \returns ::EpidStatus
42 */
43 EpidStatus ResizeOctStr(ConstOctStr a, size_t a_size, OctStr r, size_t r_size);
44 
45 #endif  // EPID_MEMBER_SRC_RESIZE_H_
46