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
#include <stdio.h> | |
#include <stdlib.h> | |
struct list { | |
void *data; | |
struct list *next; | |
}; | |
static struct list *head, *last; |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdarg.h> | |
#include <unistd.h> | |
#include <openssl/evp.h> | |
#include <openssl/err.h> | |
#include <openssl/params.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
/** | |
* @brief - a demo example of Safe Queue | |
* | |
* @copyright - 2021-present All rights reserved | |
* | |
* @author - Devendra Naga (devendra.aaru@outlook.com) | |
* | |
* @license - proprietary license, ask author for more information | |
*/ | |
#include "safe_queue.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
/** | |
* @brief - implement Safe Queue technique for passing messages between various threads / classes | |
* | |
* @copyright - 2021-present All rights reserved | |
* | |
* @author - Devendra Naga (devendra.aaru@outlook.com) | |
* | |
* @license - proprietary license, ask author for more information | |
*/ | |
#ifndef __SAFE_QUEUE_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
project(needham_schroeder_protocol) | |
cmake_minimum_required(VERSION 3.8) | |
set(SRC | |
./ns.cc) | |
include_directories(./) | |
set(CMAKE_CXX_FLAGS "-Wall -g -ggdb") |
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
#ifndef __NS_H__ | |
#define __NS_H__ | |
#include <iostream> | |
#include <string.h> | |
#include <string> | |
#include <openssl/conf.h> | |
#include <openssl/evp.h> | |
#include <openssl/err.h> | |
#include <openssl/rsa.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
#include <ns.h> | |
static int generate_key(int key_size, const std::string pkey, const std::string ppkey) | |
{ | |
RSA *rsa = nullptr; | |
BIGNUM *b; | |
FILE *fp; | |
int ret; | |
rsa = RSA_new(); |
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
#include <iostream> | |
#include <string> | |
#include <memory> | |
#include <string.h> | |
class AddOn { | |
public: | |
explicit AddOn(std::string description) { description_ = description; } | |
~AddOn() = default; |
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
#include <iostream> | |
#include <memory> | |
#include <queue> | |
#include <thread> | |
#include <mutex> | |
#include <condition_variable> | |
#include <functional> | |
template <class T> | |
class Message_Queue { |
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
/** | |
* | |
* HMAC tutorial | |
* | |
* Written by Devendra Naga (devendra.aaru@gmail.com) | |
* | |
* License MIT | |
*/ | |
#include <iostream> | |
#include <stdint.h> |