1 /*############################################################################ 2 # Copyright 2016 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 #ifndef EPID_COMMON_SRC_GROUPPUBKEY_H_ 17 #define EPID_COMMON_SRC_GROUPPUBKEY_H_ 18 /*! 19 * \file 20 * \brief Group public key interface. 21 * \addtogroup EpidCommon 22 * @{ 23 */ 24 #include "epid/common/errors.h" 25 #include "epid/common/math/ecgroup.h" 26 #include "epid/common/types.h" 27 28 /// Internal representation of GroupPubKey 29 typedef struct GroupPubKey_ { 30 GroupId gid; ///< group ID 31 EcPoint* h1; ///< an element in G1 32 EcPoint* h2; ///< an element in G1 33 EcPoint* w; ///< an element in G2 34 } GroupPubKey_; 35 36 /// Constructs internal representation of GroupPubKey 37 /*! 38 Allocates memory and initializes gid, h1, h2, w parameters. Use 39 DeleteGroupPubKey() to deallocate memory 40 41 \param[in] pub_key_str 42 Oct string representation of group public key 43 \param[in] G1 44 EcGroup containing elements h1 and h2 45 \param[in] G2 46 EcGroup containing element w 47 \param[out] pub_key 48 Group public key: (gid, h1, h2, w) 49 50 \returns ::EpidStatus 51 \see DeleteGroupPubKey 52 */ 53 EpidStatus CreateGroupPubKey(GroupPubKey const* pub_key_str, EcGroup* G1, 54 EcGroup* G2, GroupPubKey_** pub_key); 55 56 /// Deallocates storage for internal representation of GroupPubKey 57 /*! 58 Frees memory pointed to by Group public key. Nulls the pointer. 59 60 \param[in] pub_key 61 Group public key to be freed 62 63 \see CreateGroupPubKey 64 */ 65 void DeleteGroupPubKey(GroupPubKey_** pub_key); 66 /*! @} */ 67 #endif // EPID_COMMON_SRC_GROUPPUBKEY_H_ 68