摘要: 任务4 Vector.hpp 1 #pragma once 2 #include <iostream> 3 using namespace std; 4 5 template <typename T> 6 class Vector { 7 private: 8 int size_; 9 T* dat 阅读全文
posted @ 2024-12-21 22:05 打盹 阅读(11) 评论(0) 推荐(0)
摘要: 任务1 publisher.hpp 1 #pragma once 2 3 #include <iostream> 4 #include <string> 5 6 using std::cout; 7 using std::endl; 8 using std::string; 9 10 // 发行/出 阅读全文
posted @ 2024-12-06 21:46 打盹 阅读(22) 评论(0) 推荐(0)
摘要: 任务1 task1 1 #include <iostream> 2 3 using std::cout; 4 using std::endl; 5 6 // 类A的定义 7 class A { 8 public: 9 A(int x0, int y0); 10 void display() cons 阅读全文
posted @ 2024-11-24 20:11 打盹 阅读(11) 评论(0) 推荐(0)
摘要: 任务1 button.hpp 1 #pragma once 2 3 #include <iostream> 4 #include <string> 5 6 using std::string; 7 using std::cout; 8 9 // 按钮类 10 class Button { 11 pu 阅读全文
posted @ 2024-11-10 18:07 打盹 阅读(19) 评论(0) 推荐(0)
摘要: 任务1: T.h 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T &t); 阅读全文
posted @ 2024-10-26 22:58 打盹 阅读(34) 评论(0) 推荐(0)
摘要: 实验1: task.cpp 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <algorithm> 5 using namespace std; 6 7 template<typename T> 8 v 阅读全文
posted @ 2024-10-11 22:08 打盹 阅读(43) 评论(0) 推荐(3)
摘要: 前言 base打了没几天就军训了,前两周的还打了打,军训烤红薯了,后面上的题都懒得看了,趁着国庆假期,闪击了下苏州,人太多了,还不如待在学校水一水。因为是复现平台做的,顺序比较乱。 铜匠 附件: ​ from Crypto.Util.number import getPrime, bytes_to_ 阅读全文
posted @ 2024-10-09 16:48 打盹 阅读(135) 评论(0) 推荐(0)
摘要: 缘起 在遇到AES和DES等分组加密算法时,需要明文满足一定的长度要求(分组的倍数),但是大多数情况下明文没法满足长度的苛刻要求,于是就要进行padding使传入的内容满足长度要求。 Nopadding 就是不填充,明文满足分组算法的长度要求,不需要再进行填充。 PKCS5/PKCS7 填充数据为填 阅读全文
posted @ 2024-10-09 16:45 打盹 阅读(41) 评论(0) 推荐(0)
摘要: 原理 用到格基规约和LLL算法。。。 啊?你问那是什么?去搜吧,反正我没看懂。 实现 有一个 e 阶的多项式 f, 那么可以: 在模 n 意义下,快速求出 以内的根 给定 β,快速求出模某个 b 意义下较小的根,其中b≥​​​,是 n 的因数。 一般采用sage下的small_roots(X=2^k 阅读全文
posted @ 2024-10-09 16:45 打盹 阅读(268) 评论(0) 推荐(0)
摘要: 一直在抄脚本,终于想着来看看原理了。 dp是什么? dp = d mod (p-1) 基本前备知识 e*d = 1 mod ϕ(n) 那么开推吧 dp = d mod (p-1) --> dp * e = e*d mod (p-1) --> e*d = dp * e mod (p-1) --> e* 阅读全文
posted @ 2024-10-09 16:44 打盹 阅读(116) 评论(0) 推荐(0)