forked from DLTcollab/tangle-accelerator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mam): Register user ID with MAM channel seed
Register user identity with MAM channel seed. The return user ID is an UUID. Asymmetric encryption for key exchange will be implemented in the coming PR. For DLTcollab#560
- Loading branch information
Showing
14 changed files
with
330 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "ta_register_mam_channel.h" | ||
|
||
ta_register_mam_channel_req_t* ta_register_mam_channel_req_new() { | ||
ta_register_mam_channel_req_t* req = (ta_register_mam_channel_req_t*)malloc(sizeof(ta_register_mam_channel_req_t)); | ||
if (req != NULL) { | ||
return req; | ||
} | ||
return NULL; | ||
} | ||
|
||
void ta_register_mam_channel_req_free(ta_register_mam_channel_req_t** req) { | ||
if (!req || !(*req)) { | ||
return; | ||
} | ||
free(*req); | ||
*req = NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (C) 2020 BiiLabs Co., Ltd. and Contributors | ||
* All Rights Reserved. | ||
* This is free software; you can redistribute it and/or modify it under the | ||
* terms of the MIT license. A copy of the license can be found in the file | ||
* "LICENSE" at the root of this distribution. | ||
*/ | ||
|
||
#ifndef REQUEST_TA_REGISTER_MAM_CHANNEL_H_ | ||
#define REQUEST_TA_REGISTER_MAM_CHANNEL_H_ | ||
|
||
#include "common/model/transaction.h" | ||
#include "common/ta_errors.h" | ||
#include "utils/containers/hash/hash243_queue.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @file accelerator/core/request/ta_register_mam_channel.h | ||
*/ | ||
|
||
/** struct of ta_register_mam_channel_req_t */ | ||
typedef struct ta_register_mam_channel_req { | ||
char seed[NUM_TRYTES_ADDRESS + 1]; | ||
} ta_register_mam_channel_req_t; | ||
|
||
/** | ||
* @brief Allocate memory of ta_register_mam_channel_req_t | ||
* | ||
* @return | ||
* - struct of ta_register_mam_channel_req_t on success | ||
* - NULL on error | ||
*/ | ||
ta_register_mam_channel_req_t* ta_register_mam_channel_req_new(); | ||
|
||
/** | ||
* @brief Free memory of ta_register_mam_channel_req_t | ||
* | ||
* @param[in] req Data type of ta_register_mam_channel_req_t | ||
*/ | ||
void ta_register_mam_channel_req_free(ta_register_mam_channel_req_t** req); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // REQUEST_TA_REGISTER_MAM_CHANNEL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.