当前位置: 首页 > news >正文

jsp电商网站开发流程图seo诊断a5

jsp电商网站开发流程图,seo诊断a5,上海商用厨房设计,纯静态网站挂马文章目录 openssl3.2 - 官方demo学习 - mac - siphash.c概述笔记END openssl3.2 - 官方demo学习 - mac - siphash.c 概述 MAC算法为 SIPHASH, 设置参数(C-rounds, D-rounds, 也可以不设置, 有默认值) 用key初始化MAC算法, 算明文的MAC值 笔记 /*! \file siphash.c \note op…

文章目录

    • openssl3.2 - 官方demo学习 - mac - siphash.c
    • 概述
    • 笔记
    • END

openssl3.2 - 官方demo学习 - mac - siphash.c

概述

MAC算法为 SIPHASH, 设置参数(C-rounds, D-rounds, 也可以不设置, 有默认值)
用key初始化MAC算法, 算明文的MAC值

笔记

/*!
\file siphash.c
\note
openssl3.2 - 官方demo学习 - mac - siphash.c
MAC算法为 SIPHASH, 设置参数(C-rounds, D-rounds, 也可以不设置, 有默认值)
用key初始化MAC算法, 算明文的MAC值
*//** Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.** Licensed under the Apache License 2.0 (the "License").  You may not use* this file except in compliance with the License.  You can obtain a copy* in the file LICENSE in the source distribution or at* https://www.openssl.org/source/license.html*/#include <stdio.h>
#include <stdlib.h>
#include <openssl/core_names.h>
#include <openssl/evp.h>
#include <openssl/params.h>
#include <openssl/err.h>#include "my_openSSL_lib.h"/** Taken from the test vector from the paper "SipHash: a fast short-input PRF".* https://www.aumasson.jp/siphash/siphash.pdf*//** Hard coding the key into an application is very bad.* It is done here solely for educational purposes.*/
static unsigned char key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
};static unsigned char data[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e
};static const unsigned char expected_output[] = {0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1
};/** A property query used for selecting the SIPHASH implementation.*/
static char* propq = NULL;int main(int argc, char** argv)
{int ret = EXIT_FAILURE;EVP_MAC* _evp_mac = NULL;EVP_MAC_CTX* _evp_mac_ctx = NULL;unsigned char out[8];OSSL_PARAM params[4], * p = params;OSSL_LIB_CTX* _ossl_lib_ctx = NULL;unsigned int digest_len = 8, c_rounds = 2, d_rounds = 4;size_t out_len = 0;_ossl_lib_ctx = OSSL_LIB_CTX_new();if (_ossl_lib_ctx == NULL) {fprintf(stderr, "OSSL_LIB_CTX_new() returned NULL\n");goto end;}/* Fetch the SipHash implementation */_evp_mac = EVP_MAC_fetch(_ossl_lib_ctx, "SIPHASH", propq);if (_evp_mac == NULL) {fprintf(stderr, "EVP_MAC_fetch() returned NULL\n");goto end;}/* Create a context for the SipHash operation */_evp_mac_ctx = EVP_MAC_CTX_new(_evp_mac);if (_evp_mac_ctx == NULL) {fprintf(stderr, "EVP_MAC_CTX_new() returned NULL\n");goto end;}/* SipHash can support either 8 or 16-byte digests. */*p++ = OSSL_PARAM_construct_uint(OSSL_MAC_PARAM_SIZE, &digest_len);/** The number of C-rounds and D-rounds is configurable. Standard SipHash* uses values of 2 and 4 respectively. The following lines are unnecessary* as they set the default, but demonstrate how to change these values.*/*p++ = OSSL_PARAM_construct_uint(OSSL_MAC_PARAM_C_ROUNDS, &c_rounds);*p++ = OSSL_PARAM_construct_uint(OSSL_MAC_PARAM_D_ROUNDS, &d_rounds);*p = OSSL_PARAM_construct_end();/* Initialise the SIPHASH operation */if (!EVP_MAC_init(_evp_mac_ctx, key, sizeof(key), params)) {fprintf(stderr, "EVP_MAC_init() failed\n");goto end;}/* Make one or more calls to process the data to be authenticated */if (!EVP_MAC_update(_evp_mac_ctx, data, sizeof(data))) {fprintf(stderr, "EVP_MAC_update() failed\n");goto end;}/* Make one call to the final to get the MAC */if (!EVP_MAC_final(_evp_mac_ctx, out, &out_len, sizeof(out))) {fprintf(stderr, "EVP_MAC_final() failed\n");goto end;}printf("Generated MAC:\n");BIO_dump_indent_fp(stdout, out, (int)out_len, 2);putchar('\n');if (out_len != sizeof(expected_output)) {fprintf(stderr, "Generated MAC has an unexpected length\n");goto end;}if (CRYPTO_memcmp(expected_output, out, sizeof(expected_output)) != 0) {fprintf(stderr, "Generated MAC does not match expected value\n");goto end;}ret = EXIT_SUCCESS;
end:EVP_MAC_CTX_free(_evp_mac_ctx);EVP_MAC_free(_evp_mac);OSSL_LIB_CTX_free(_ossl_lib_ctx);if (ret != EXIT_SUCCESS)ERR_print_errors_fp(stderr);return ret;
}

END

http://www.yidumall.com/news/42455.html

相关文章:

  • 张家口职教中心计算机网站建设外链购买平台
  • 网站建设接单搜索引擎调词平台多少钱
  • 高师院校语言类课程体系改革与建设 教学成果奖申报网站seo推广优化服务
  • 网络工程师自学网站广州网络营销推广
  • 营销型网站源码线上推广活动有哪些
  • 泰安网站设计百度关键词优化工具
  • 网站开发与制作中期报告搜索引擎广告形式有哪些
  • 企业seo排名服务裤子seo标题优化关键词
  • 做英语网站百度秒收录软件
  • 莆田做网站的公司网推怎么做
  • 建设银行境外购物网站中公教育培训机构官网
  • 怎么自己做网页初学者网络优化工程师有多累
  • 有合作做时时彩网站的吗谷歌外贸网站推广
  • 连云港公司做网站广东今日最新疫情通报
  • 网上还有什么网站做批发软文发布
  • wordpress城市插件无锡seo优化公司
  • 营销型网站九大特点百度搜索下载app
  • 贵阳网站建设王道下拉惠淘宝优化
  • 郑州计算机培训机构哪个最好seo排名优化公司价格
  • php动态网站开发视频关键词林俊杰无损下载
  • 网站制作深圳社群运营
  • 做网站怎么自定义背景图片seo推广平台
  • 网站设计一个版块seo推广培训课程
  • 国内免费无版权图片素材网站全网搜索引擎
  • 淘宝网站开发注册网站流程
  • 深圳做夜场做网站杭州seo网站优化公司
  • 国外jquery特效网站营销型网站案例
  • 公司网站要什么做营销推广的工具有哪些
  • 旅社网站建设国产搜什么关键词最好看
  • 我的网站要换新域名如何做seo免费培训