- 博客(36)
- 资源 (5)
- 收藏
- 关注

原创 ECC(Elliptic Curve Cryptography)椭圆曲线密码详解
椭圆曲线密码基于离散对数难题公钥密码ECC 非对称密钥功能:加密、签名、密钥交换ECC是RSA的后继更短的密钥长度、更快的签名、更快的密钥协商私钥长度为256bits, 32字节。大小在曲线的域范围内(field size),256bits的整数。此范围内任意整数都是合法的私钥。公钥为曲线上的点(EC points),坐标为{x,y}.能够压缩为一个坐标长度+1bit,为压缩的公钥(compressed public key)。不同的椭圆曲线具有不同的安全级别、不同的性能、不同的密钥长度。EC
2020-10-03 10:43:39
14858
2
原创 strongswan对称算法plugin
strongswan对称算法plugin:https://blog.youkuaiyun.com/wq897387/article/details/123486699。
2025-03-19 16:48:45
95
原创 【2】Strongswan 源码认识
一类是libstrongswan的plugin,一类是libcharon的plugin。使用pkkey接口与linux kernel的xfrm模块进行交互,高实验性阶段。libstrongswan的plugin主要提供加密,认证,数据库相关的功能。eap-TLS、eap-ttls、eap-peap等插件使用的TLS实现。包含基于TPM的平台信任服务(PTS)和SWID标签处理的代码。strongSwan库,包含守护进程和实用程序使用的基本函数。管理attr sql插件提供的属性和IP地址池的实用程序。
2025-03-19 16:45:19
636
原创 【1】Strongswan术语
需要被IPsec处理的流,会被指向到一个SA。SA包含协议AH或ESP。模式transport或tunnel模式。pattern源IP加目的IP对。NAT的PORT对。方向属性,取值分别为:out、in、fwd。SP是一条规则,决定一条流(flow)是否需要被IPsec处理。SP的处理有三种方式:丢弃、Strongswan术语。
2025-03-18 11:13:39
161
原创 我的TLS1.3之旅
【001】The connection itself is secure because symmetric cryptography is used to encrypt the data transmitted.【002】The keys are uniquely generated for each connection and are based on a shared secret negotiated at the beginning of the session, also known as
2020-12-27 00:28:46
664
原创 openssl 随机数
struct rand_meth_st { int (*seed) (const void *buf, int num); int (*bytes) (unsigned char *buf, int num); void (*cleanup) (void); int (*add) (const void *buf, int num, double randomness); int (*pseudorand) (unsigned char *buf, int num);
2020-09-25 09:03:07
2153
原创 openssl 配置文件
typedef struct { char *section; char *name; char *value;} CONF_VALUE;Openssl采用哈希表来存放这些信息,后面会看到,LHASH 作为函数的参数。实例:#include "/usr/include/openssl/opensslconf.h"#include <openssl/conf.h>int main(){ CONF *conf; long eline,result;
2020-09-24 22:40:00
813
原创 openssl BIO
struct bio_method_st { int type; char *name; int (*bwrite) (BIO *, const char *, size_t, size_t *); int (*bwrite_old) (BIO *, const char *, int); int (*bread) (BIO *, char *, size_t, size_t *); int (*bread_old) (BIO *, char *, int);
2020-09-24 18:26:20
345
原创 openssl DSO
struct dso_st { DSO_METHOD *meth; /* * Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use * anything but will need to cache the filename for use in the dso_bind * handler. All in all, let each method control its ow
2020-09-24 17:32:17
538
原创 openssl 内存分配
struct app_mem_info_st { CRYPTO_THREAD_ID threadid; const char *file; int line; const char *info; struct app_mem_info_st *next; /* tail of thread's stack */ int references;};struct mem_st { void *addr; int num; const
2020-09-24 17:06:11
238
原创 openssl 哈希表
struct lhash_node_st { void *data; struct lhash_node_st *next; unsigned long hash;};本结构是一个单链表。其中,data用于存放数据地址,next为下一个数据地址,hash为数据哈希计算值。struct lhash_st { OPENSSL_LH_NODE **b; //b指针数组用于存放所有的数据,数组中的每一个值为数据链表的头指针 OPENSSL_LH_COMPFUNC c
2020-09-24 16:24:14
260
原创 openssl stack
提供了用宏来帮助用户实现接口。用户可以参考safestack.h 中的宏SKM_DEFINE_STACK_OF(t1, t2, t3)来定义自己的上层堆栈操作函数# define STACK_OF(type) struct stack_st_##type# define SKM_DEFINE_STACK_OF(t1, t2, t3) \ STACK_OF(t1); \ typedef int (*sk_##t1##_compfunc)(const t3 * const *a, cons
2020-09-24 15:48:48
366
原创 openssl Linux安装
If you want to install it anywhere else, run config like this: On Unix: $ ./config --prefix=/opt/openssl --openssldir=/usr/local/ssenable-crypto-mdebug Build support for debugging memory allocated via OPENSSL
2020-09-24 15:33:12
422
原创 内核小碎碎-第九集 设备树的前世今生 从dts到dtb 到启动参数传递 再到内核解析dtb 最终的使用
内核启动点,位于arch/arm/kernel/head.S .arm __HEADENTRY(stext)接着head.S/* * r1 = machine no, r2 = atags or dtb, * r8 = phys_offset, r9 = cpuid, r10 = procinfo */ bl __vet_atags__vet_atags:在arch/...
2020-07-01 17:55:07
431
原创 unflatten_dt_nodes函数解析
/** * unflatten_dt_nodes - Alloc and populate a device_node from the flat tree * @blob: The parent device tree blob * @mem: Memory chunk to use for allocating device nodes and properties * @dad: Parent struct device_node * @nodepp: The device_node tre
2020-07-01 11:04:59
1461
原创 Android3.5签名
创建前面时,出现:建议使用 "keytool -importkeystore -srckeystore D:\Andriod\appKey\wrzsRobot.jks -destkeystore D:\Andriod\appKey\wrzsRobot.jks -deststoretype pkcs12" 迁移到行业标准格式 PKCS12。复制到cmd窗口执行,出现:C:\Users\ICAN>keytool -importkeystore -srckeystore D:\Andriod\app
2020-05-14 09:53:30
149
原创 内核小碎碎第八集 []
static struct resource s3c_rtc_resource[] = { [0] = DEFINE_RES_MEM(S3C_PA_RTC, SZ_256), [1] = DEFINE_RES_IRQ(IRQ_RTC_ALARM), [2] = DEFINE_RES_IRQ(IRQ_RTC_TIC),};struct platform_device s3c_device...
2020-04-14 17:13:45
84
原创 内核小碎碎第七集 vexpress设备树解析
//vexpress-v2m.dtsi,被vexpress-v2p-ca9.dts包含之后,会和里面的smb整合vexpress-v2p-ca9.dts中smb如下:smb: smb@4000000 { compatible = "simple-bus"; #address-cells = <2>; #size-cells = <1>; ranges...
2020-04-14 10:09:08
757
原创 内核小碎碎-第五集 platform_device 与 platform_driver
struct platform_driver { int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_me...
2020-04-10 19:11:14
197
原创 内核小碎碎第六集 linux内核驱动主要数据结构解析
struct kobject { const char *name; struct list_head entry; //双向链表,挂接kobject,遍历链表上包含kobject的所有驱动,执行期望的操作; struct kobject *parent;//parent指向上级,如总线bus结构体也包含kobject对象,总线为驱动的上一层级 struct kset *kset; ...
2020-04-02 17:56:22
201
原创 内核小碎碎-第五集 从 device_node 到 platform_device
struct device_node { const char *name; const char *type; phandle phandle; const char *full_name; struct fwnode_handle fwnode; struct property *properties; struct property *deadprops; /* remove...
2020-04-01 13:33:05
309
原创 内核小碎碎-第四集 解析dtb
DTB文件格式如图【图片摘自https://blog.youkuaiyun.com/cc289123557/article/details/51782449】可参考内核的Booting-without-of.txt描述,主要内容如下: a) ATAGS interface. Minimal information is passed from firmware to the kernel with a...
2020-03-30 11:41:03
336
原创 内核小碎碎-第三集 pr_info
使用示例:pr_info(" %s[%#x]\t[%pa-%pa], %pa bytes%s flags: %#x\n", type->name, idx, &base, &end, &size, nid_buf, flags);追踪:#define pr_info(fmt, ...) __pr(__pr_info, fmt, ##__VA_ARGS__...
2020-03-26 11:56:56
1264
原创 内核小碎碎-第二集 arm_memblock_init
内核内存布局图框图【来自https://www.cnblogs.com/arnoldlu/p/8068286.html】void __init arm_memblock_init(const struct machine_desc *mdesc){ /* Register the kernel text, kernel data and initrd with memblock. */ ...
2020-03-26 11:03:34
484
原创 内核小碎碎第一集 启动参数解析 parse_args
1 跳过空格char *skip_spaces(const char *str){ while (isspace(*str)) ++str; return (char *)str;}2 面向对象struct obs_kernel_param { const char *str; int (*setup_func)(char *); int early;};/* Ch...
2020-03-24 18:21:55
340
原创 读内核杂记getopt
static void parse_args(int argc, char **argv){int c;prog = argv[0]; //程序名称字符串地址while ((c = getopt(argc, argv, “ynv”)) != -1) {switch © {case ‘y’:x86_64 = 1;break;case ‘n’:x86_64 = 0;break;...
2020-03-24 16:24:27
107
ARM中文指令集 查找方便
2010-03-17
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人