Skip to content

Instantly share code, notes, and snippets.

View devendranaga's full-sized avatar
🍈

Dev devendranaga

🍈
  • Bangalore
View GitHub Profile
@devendranaga
devendranaga / safe_queue.h
Created November 4, 2021 12:30
safe_queue
/**
* @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__
project(needham_schroeder_protocol)
cmake_minimum_required(VERSION 3.8)
set(SRC
./ns.cc)
include_directories(./)
set(CMAKE_CXX_FLAGS "-Wall -g -ggdb")
#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>
#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();
@devendranaga
devendranaga / decorator.cc
Created January 1, 2021 07:16
decorator c++ design pattern
#include <iostream>
#include <string>
#include <memory>
#include <string.h>
class AddOn {
public:
explicit AddOn(std::string description) { description_ = description; }
~AddOn() = default;
#include <iostream>
#include <memory>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <functional>
template <class T>
class Message_Queue {
#include "Arduino.h"
class trng_device {
public:
explicit trng_device() {
}
~trng_device() {
}
virtual void init() = 0;
#include <iostream>
#include <stdint.h>
#include <string.h>
#include <openssl/pem.h>
#include <openssl/evp.h>
#include <openssl/ec.h>
class sm2_crypto {
public:
explicit sm2_crypto() {
#include <iostream>
#include <memory>
#include <vector>
#include <time.h>
#include <sys/time.h>
namespace Core_Middleware {
class Perf_Item {
public:
/**
* program to demonstrate wireless ioctl
*/
#include <stdint.h>
#include <stdio.h>
#include <math.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <linux/wireless.h>