A Comprehensive Codebook Generator

合集下载

codegenerator用法

codegenerator用法

codegenerator用法一、概述CodeGenerator是一款强大的代码生成工具,可用于快速生成各种类型的代码,如Java、C++、Python等。

本文档将详细介绍CodeGenerator的使用方法,帮助您更好地了解和掌握该工具。

二、安装与配置1.下载安装包:访问CodeGenerator官方网站,下载适用于您的操作系统的安装包。

2.安装:根据安装指南,完成安装过程。

3.配置环境:确保您的开发环境已正确配置,包括Java、C++或Python等必要的开发工具。

三、使用方法1.打开CodeGenerator:启动CodeGenerator应用程序。

2.选择编程语言:在CodeGenerator界面中,选择您所需的编程语言,如Java、C++或Python。

3.输入代码模板:在CodeGenerator编辑器中,输入您要生成的代码模板。

您可以参考CodeGenerator内置的代码模板或自行创建新的模板。

4.生成代码:完成代码模板输入后,点击生成按钮,CodeGenerator将根据您的输入生成相应的代码。

5.查看代码:在CodeGenerator的输出窗口中,您可以查看生成的代码,并进行必要的修改和调整。

四、高级用法1.自定义模板:CodeGenerator支持自定义模板,您可以在编辑器中创建新的模板,并将其保存以供后续使用。

2.参数化生成:通过在代码模板中添加参数,您可以实现代码的参数化生成,根据不同的参数生成不同的代码。

3.多语言支持:CodeGenerator支持同时生成多种语言的代码,只需在选择编程语言时进行切换即可。

4.版本控制:CodeGenerator支持与版本控制系统(如Git)集成,方便您对生成的代码进行版本控制和管理。

五、常见问题及解决方案1.生成失败:检查您的代码模板是否正确,以及CodeGenerator 是否已正确安装和配置。

2.生成的代码不正确:检查生成的代码是否符合您的预期,并尝试手动生成代码以获得更准确的反馈。

纳瓦尔宝典英语版

纳瓦尔宝典英语版

纳瓦尔宝典英语版The Naval Codebook: English EditionThe Naval Codebook is a comprehensive guide to naval operations, strategies, and protocols. In this English edition, sailors and officers will find valuable information and insights to navigate the complexities of the maritime domain. This article aims to provide a detailed overview of the contents covered in the Naval Codebook.Chapter 1: Introduction to Naval OperationsThis chapter serves as an introduction to the fundamentals of naval operations. It covers the various components of a naval force, including ships, submarines, and aircraft. Readers will learn about the different roles and responsibilities within a naval unit, as well as the importance of effective communication and coordination.Chapter 2: Naval StrategiesIn this chapter, the Naval Codebook explores the different strategies employed by naval forces. It delves into the concept of sea control and the various tactics used to achieve it. Readers will gain an understanding of offensive and defensive strategies, including blockade, convoy operations, and amphibious assaults.Chapter 3: Naval Warfare PrinciplesThis chapter focuses on the principles of naval warfare. It examines the principles of war, such as objective, offensive, mass, and economy of force. Additionally, it discusses the importance of intelligence, surveillance, and reconnaissance (ISR) in naval operations. Readers will also learn about the principles of maneuver, covering concepts such as encirclement, penetration, and disruption.Chapter 4: Naval Command and ControlIn this chapter, the Naval Codebook addresses the crucial aspect of command and control in naval operations. It explores the command structure and the role ofcommanders at various levels. The chapter also covers the importance of effective decision-making, communication, and information sharing in naval command and control.Chapter 5: Naval LogisticsLogistics is an integral part of any naval operation, and this chapter provides a comprehensive overview of the subject. It covers the planning, acquisition, and distribution of resources, including fuel, ammunition, and supplies. Readers will gain insights into the importance of sustainment and the challenges faced in maintaining operational readiness.Chapter 6: Naval CommunicationsEffective communication is vital for successful naval operations, and this chapter delves into the various communication methods and systems used by naval forces. It covers both internal communication within a naval unit and external communication with other units and headquarters. The chapter also highlights the significance of encryption and secure communication in naval operations.Chapter 7: Naval IntelligenceIntelligence gathering and analysis play a crucial role in naval operations, and this chapter focuses on the principles and methods of naval intelligence. It covers the collection and processing of information, including signals intelligence, human intelligence, and imagery intelligence. Readers will also gain an understanding of the importance of intelligence fusion and analysis in decision-making.Chapter 8: Naval Safety and SecuritySafety and security are paramount in naval operations, and this chapter addresses the measures and procedures to ensure the well-being of personnel and the integrity of naval assets. It covers topics such as force protection, damage control, and emergency response. Readers will also learn about the importance of adhering to safety and security protocols to mitigate risks and enhance operational effectiveness.ConclusionThe Naval Codebook: English Edition provides a comprehensive and detailed guide to naval operations, strategies, and protocols. It covers a wide range of topics, from the fundamentals of naval operations to advanced concepts of warfare and logistics. Sailors and officers will find this codebook an indispensable resource to enhance their understanding and proficiency in naval operations.。

VSCode代码片段生成器自动生成重复代码

VSCode代码片段生成器自动生成重复代码

VSCode代码片段生成器自动生成重复代码在软件开发过程中,我们经常会遇到需要编写大量重复的代码的情况。

这不仅浪费时间和精力,还容易导致错误。

为了提高开发效率和代码质量,我们可以利用VSCode代码片段生成器自动生成重复代码。

VSCode是一款开源的跨平台代码编辑器,它具有丰富的扩展功能。

其中一个很实用的功能就是代码片段生成器,它可以帮助我们快速生成重复的代码块。

首先,我们需要安装VSCode的Code Snippets Generator插件。

在VSCode的插件市场中搜索并安装该插件。

安装完成后,重启VSCode使插件生效。

接下来,我们打开VSCode,在编辑器中点击“视图”菜单,然后选择“资源管理器”。

在资源管理器中,我们可以看到一个名为“.vscode”的文件夹。

在该文件夹中,我们可以找到一个名为“snippets.json”的文件。

我们打开“snippets.json”文件,并按照以下格式添加代码片段:```json{"生成器名称": {"scope": "文件类型","prefix": "触发器","body": ["代码段"],"description": "描述信息"}}```在上面的代码中,我们需要修改以下几个参数:- 生成器名称:自定义的代码片段生成器的名称,可以根据需求进行修改。

- 文件类型:代码片段所适用的文件类型。

可以是特定的文件扩展名(如".js"、".html"等),也可以是通用的文件类型(如"javascript"、"html"等)。

- 触发器:生成代码片段的触发器。

当我们输入该触发器并按下Tab键时,代码片段将被生成。

moodle练习题

moodle练习题

moodle练习题一、基础知识1. Moodle是一个开源的什么类型的软件?2. Moodle的官方语言是什么?3. Moodle的数据库默认使用的是什么?4. Moodle的系统要求是什么?5. Moodle的主要功能有哪些?6. Moodle的插件类型有哪些?7. Moodle中课程格式有哪些?8. Moodle中如何设置课程可见性?9. Moodle中如何添加和编辑资源?10. Moodle中如何创建和编辑活动?二、课程管理11. 如何在Moodle中创建一个新课程?12. 如何设置课程的基本信息?13. 如何在Moodle中添加和删除课程参与者?14. 如何设置课程的角色和权限?15. 如何在Moodle中备份和恢复课程?16. 如何在Moodle中导入和导出课程内容?17. 如何在Moodle中设置课程进度跟踪?18. 如何在Moodle中设置课程评分策略?19. 如何在Moodle中创建课程讨论区?20. 如何在Moodle中设置课程通知?三、资源与活动21. Moodle中常见的资源类型有哪些?22. 如何在Moodle中添加外部资源?23. 如何在Moodle中和分享文件资源?24. 如何在Moodle中创建和管理论坛活动?25. 如何在Moodle中创建和编辑测验?26. 如何在Moodle中设置测验的评分和反馈?27. 如何在Moodle中创建和编辑作业?28. 如何在Moodle中设置作业的提交和评分?29. 如何在Moodle中创建和编辑问卷?30. 如何在Moodle中创建和编辑投票?四、用户管理31. 如何在Moodle中创建和编辑用户?32. 如何在Moodle中设置用户的角色和权限?33. 如何在Moodle中批量导入用户?34. 如何在Moodle中设置用户密码?35. 如何在Moodle中查看和管理用户日志?36. 如何在Moodle中设置用户配置文件?37. 如何在Moodle中设置用户邮件通知?38. 如何在Moodle中设置用户讨论区订阅?39. 如何在Moodle中设置用户课程跟踪?40. 如何在Moodle中设置用户课程进度?五、插件与扩展41. 如何在Moodle中安装和更新插件?42. Moodle中常见的插件类型有哪些?43. 如何在Moodle中创建自定义插件?44. 如何在Moodle中设置插件权限?45. 如何在Moodle中备份和恢复插件?46. 如何在Moodle中使用第三方插件?47. 如何在Moodle中创建和编辑插件设置?48. 如何在Moodle中更新插件版本?49. 如何在Moodle中删除插件?50. 如何在Moodle中管理插件依赖关系?六、成绩与报告51. 如何在Moodle中查看学生的成绩?52. 如何设置成绩的显示方式和格式?53. 如何在Moodle中创建成绩类别?54. 如何在Moodle中调整成绩权重?55. 如何导出和打印成绩报告?56. 如何设置成绩的发布策略?57. 如何在Moodle中查看成绩统计信息?58. 如何在Moodle中设置成绩的审核流程?59. 如何在Moodle中为学生提供成绩反馈?60. 如何在Moodle中设置成绩的解锁和锁定?七、讨论与互动61. 如何在Moodle中创建讨论论坛?62. 如何设置论坛的发帖权限?63. 如何在Moodle中管理论坛帖子?64. 如何在论坛中设置订阅和通知?65. 如何在Moodle中创建和编辑讨论话题?66. 如何在Moodle中设置讨论话题的评分?67. 如何在Moodle中跟踪讨论进度?68. 如何在Moodle中设置讨论的可见性?八、课程内容创建71. 如何在Moodle中创建和编辑页面?72. 如何在Moodle中添加视频和音频资源?73. 如何在Moodle中创建和编辑书籍?74. 如何在Moodle中添加和编辑标签?75. 如何在Moodle中创建和编辑课程段?76. 如何在Moodle中设置课程段的发布和隐藏?77. 如何在Moodle中创建和编辑课程摘要?78. 如何在Moodle中添加外部工具资源?79. 如何在Moodle中创建和编辑课程文件?80. 如何在Moodle中设置文件的访问权限?九、课程评估81. 如何在Moodle中创建测验?82. 如何添加和编辑测验题目?83. 如何设置测验的时间限制?84. 如何在Moodle中设置测验的尝试次数?85. 如何在Moodle中设置测验的评分策略?. 如何在Moodle中创建和编辑作业?87. 如何设置作业的提交截止日期?88. 如何在Moodle中设置作业的评分标准?89. 如何在Moodle中创建和编辑问卷?90. 如何在Moodle中分析问卷结果?十、系统管理与维护91. 如何在Moodle中更新系统?92. 如何在Moodle中备份整个站点?93. 如何在Moodle中恢复站点备份?94. 如何在Moodle中管理数据库?95. 如何在Moodle中设置站点的基本信息?96. 如何在Moodle中管理插件?97. 如何在Moodle中设置语言和地区?98. 如何在Moodle中设置站点的安全策略?99. 如何在Moodle中监控站点性能?100. 如何在Moodle中设置站点统计和日志?十一、用户交互与沟通101. 如何在Moodle中发送站内消息?102. 如何设置消息通知的偏好?103. 如何在Moodle中添加和编辑个人资料?104. 如何在Moodle中查看和回复私人消息?105. 如何在Moodle中创建和加入用户组?106. 如何在Moodle中设置用户组的权限?107. 如何在Moodle中管理用户组的成员?108. 如何在Moodle中创建和编辑用户讨论区?109. 如何在Moodle中设置讨论区的订阅选项?110. 如何在Moodle中查看和参与用户讨论?十二、课程设计与布局111. 如何在Moodle中更改课程布局?112. 如何在Moodle中添加和编辑课程主题?113. 如何在Moodle中设置课程主题的顺序?114. 如何在Moodle中使用课程摘要区块?115. 如何在Moodle中添加和编辑课程介绍?116. 如何在Moodle中设置课程的开始和结束日期?117. 如何在Moodle中设置课程的格式和结构?118. 如何在Moodle中添加和编辑课程标签?119. 如何在Moodle中设置课程的进度条?120. 如何在Moodle中设置课程的导航菜单?十三、高级功能与定制121. 如何在Moodle中使用自定义CSS?122. 如何在Moodle中创建自定义角色?123. 如何在Moodle中设置角色的权限?124. 如何在Moodle中创建和编辑自定义报告?125. 如何在Moodle中使用Web服务?126. 如何在Moodle中设置外部认证?127. 如何在Moodle中使用学习分析工具?128. 如何在Moodle中集成第三方应用程序?129. 如何在Moodle中创建自定义插件?130. 如何在Moodle中设置插件的市场?十四、移动学习与接入131. 如何在Moodle中使用移动应用?132. 如何在移动应用中访问和参与课程?133. 如何在Moodle中设置移动通知?134. 如何在移动应用中提交作业和测验?135. 如何在Moodle中管理移动设备的接入?136. 如何在Moodle中设置移动学习的最佳实践?137. 如何在Moodle中监控移动学习活动?138. 如何在Moodle中为移动学习提供支持?139. 如何在Moodle中优化课程内容以适应移动设备?140. 如何在Moodle中测试移动兼容性?十五、安全与隐私141. 如何在Moodle中设置安全的登录机制?142. 如何在Moodle中管理用户密码策略?143. 如何在Moodle中设置数据备份和恢复的安全措施?144. 如何在Moodle中保护用户隐私?145. 如何在Moodle中设置访问控制?146. 如何在Moodle中监控和防止恶意活动?147. 如何在Moodle中更新和补丁安全漏洞?148. 如何在Moodle中设置SSL/TLS加密?149. 如何在Moodle中管理用户身份验证?150. 如何在Moodle中创建和审核安全日志?十六、课程迁移与整合151. 如何在Moodle中迁移课程内容?152. 如何在Moodle中整合其他教育平台的内容?153. 如何在Moodle中导入其他格式的课程包?154. 如何在Moodle中导出课程内容?155. 如何在Moodle中备份和恢复单个课程?156. 如何在Moodle中复制课程?157. 如何在Moodle中设置课程的共享和协作?158. 如何在Moodle中管理课程模板?159. 如何在Moodle中整合外部视频和音频资源?160. 如何在Moodle中整合第三方评估工具?十七、多语言支持与国际化161. 如何在Moodle中安装和切换语言包?162. 如何在Moodle中设置默认语言?163. 如何在Moodle中为特定课程设置语言?164. 如何在Moodle中创建和编辑语言字符串?165. 如何在Moodle中管理多语言内容?166. 如何在Moodle中设置国际化日期格式?167. 如何在Moodle中支持不同地区的货币?168. 如何在Moodle中设置多语言用户界面?169. 如何在Moodle中为不同语言的用户提供支持?170. 如何在Moodle中集成翻译服务?十八、课程营销与推广171. 如何在Moodle中创建课程宣传页面?172. 如何在Moodle中使用社交媒体推广课程?173. 如何在Moodle中设置课程推荐?174. 如何在Moodle中创建课程优惠券?175. 如何在Moodle中设置课程折扣?176. 如何在Moodle中管理课程报名流程?177. 如何在Moodle中设置课程报名费用?178. 如何在Moodle中跟踪课程报名情况?179. 如何在Moodle中设置课程营销策略?180. 如何在Moodle中评估课程推广效果?十九、技术支持与故障排除181. 如何在Moodle中查看系统错误日志?182. 如何在Moodle中解决常见的安装问题?183. 如何在Moodle中更新服务器环境?184. 如何在Moodle中解决数据库连接问题?185. 如何在Moodle中恢复丢失的数据?1. 如何在Moodle中解决插件兼容性问题?187. 如何在Moodle中优化系统性能?188. 如何在Moodle中管理缓存?189. 如何在Moodle中解决用户登录问题?190. 如何在Moodle中获取技术支持和帮助?二十、持续学习与社区参与191. 如何在Moodle中参与社区讨论?192. 如何在Moodle中贡献代码和插件?193. 如何在Moodle中获取开发者文档?194. 如何在Moodle中参与翻译项目?195. 如何在Moodle中找到学习伙伴?196. 如何在Moodle中参与在线研讨会和培训?197. 如何在Moodle中分享最佳实践和案例研究?198. 如何在Moodle中参与课程开发协作?199. 如何在Moodle中跟踪学习进度和成就?200. 如何在Moodle中建立个人学习网络?答案一、基础知识1. Moodle是一个开源的学习管理系统(LMS)。

《Java EE企业级应用开发教程(Spring+Spring MVC+MyBatis)》_课后习题

《Java EE企业级应用开发教程(Spring+Spring MVC+MyBatis)》_课后习题

第一章【思考题】1、请简述Spring框架的优点。

2、请简述什么是Spring的IoC和DI。

【答案】1、Spring框架的优点如下:(1)非侵入式设计:Spring是一种非侵入式(non-invasive)框架,它可以使应用程序代码对框架的依赖最小化。

(2)方便解耦、简化开发:Spring就是一个大工厂,可以将所有对象的创建和依赖关系的维护工作都交给Spring容器管理,大大的降低了组件之间的耦合性。

(3)支持AOP:Spring提供了对AOP的支持,它允许将一些通用任务,如安全、事务、日志等进行集中式处理,从而提高了程序的复用性。

(4)支持声明式事务处理:只需要通过配置就可以完成对事务的管理,而无需手动编程。

(5)方便程序的测试:Spring提供了对Junit4的支持,可以通过注解方便的测试Spring 程序。

(6)方便集成各种优秀框架:Spring不排斥各种优秀的开源框架,其内部提供了对各种优秀框架(如:Struts、Hibernate、MyBatis、Quartz等)的直接支持。

(7)降低了Java EE API的使用难度:Spring对Java EE开发中非常难用的一些API (如:JDBC、JavaMail等),都提供了封装,使这些API应用难度大大降低。

2、IoC的全称是Inversion of Control,中文名称为控制反转。

控制反转就是指在使用Spring框架之后,对象的实例不再由调用者来创建,而是由Spring容器来创建,Spring 容器会负责控制程序之间的关系,而不是由调用者的程序代码直接控制。

这样,控制权由应用代码转移到了Spring容器,控制权发生了反转。

DI的全称是Dependency Injection,中文称之为依赖注入。

它与控制反转(IoC)的含义相同,只不过这两个称呼是从两个角度描述的同一个概念。

从Spring容器的角度来看,Spring容器负责将被依赖对象赋值给调用者的成员变量,这相当于为调用者注入了它依赖的实例,这就是Spring的依赖注入。

计算机英语学生用书(第二版)习题答案chapter 05.

计算机英语学生用书(第二版)习题答案chapter 05.
IV. Exercises Comprehension I. Filling Blanks
II. True or False III.Answering Questions IV. Translating Terms
Vocabulary
V. Selecting Words
Collocation Summary
• First generation—— machine language • Second generation—— assembly language • Third generation—— high-level languages • Fourth generation—— very-high-level
5. T
IIV. Exercises—Comprehension
III. Answer the following question.
1. List the five steps of programming.
1. Programming is traditionally a five-step problem-solving process. The five steps are as follows: The first step: Problem definition The second step: Program design The third step: Program coding The fourth step: Program testing The fifth step: Program documentation and maintenance
languages • Fifth generation—— natural languages

JApiDocs(自动生成接口文档神器)

JApiDocs(自动生成接口文档神器)

JApiDocs(⾃动⽣成接⼝⽂档神器)JApiDocs教程前⾔作为⼀名优秀的程序员来说,由于涉及到要与前端进⾏对接,所以避免不了的就是写接⼝⽂档。

写完接⼝⽂档,⼀旦代码返回结果,参数等出现变动,接⼝⽂档还得随之改动,⼗分⿇烦,违背了我们简单,快速,低bug的开发初衷。

所以,⾃动⽣成接⼝⽂档的⼯具就出现了。

⼤家最熟悉的应该就是swagger了,我并没有使⽤过swagger,虽然它⽐较健壮,稳定。

但是由于它的规范很复杂,需要将代码变动的地⽅也很多。

所以我使⽤了JApiDocs这个⼯具来为我的项⽬⾃定⽣成接⼝⽂档。

它的优点就是,相对于springboot以及ssm开发模式⽽⾔,它的改动都不是很⼤,规范⼀下代码,就可以轻松获取接⼝⽂档了。

问题:参数为实体类对象时,直接显⽰对象⾥的所有字段。

⽽真正使⽤的字段只有⼀部分。

⼤体没什么⽑病,界⾯也很简洁美观。

⼤家如果有解决参数精准显⽰的想法,可以在评论区⼀起讨论下。

⼀、Maven依赖<!-- JApiDocs --><dependency><groupId>io.github.yedaxia</groupId><artifactId>japidocs</artifactId><version>1.4.3</version></dependency>⼆、代码规范为什么要进⾏代码规范?JApiDocs会根据固定的格式,来为我们解析出相应的接⼝⽂档,相对⽐与swagger来说,JApiDocs的格式相对来说是很简单的,springboot开发的项⽬使⽤起来改动不⼤,同时还能使我们的代码规范,简洁,⼀致。

所以我们只要遵循以下⼏点就能得到规整的接⼝⽂档了。

以下都是针对于controller模块:1. 分组名称 @description注:官⽅⽂档中注明分组名称@description,但是实际应⽤中不需要加⼊注解,像下例所⽰,直接写注释即可。

使用 MCAL4.3 中的 CSE (加密服务引擎) 模块 - NXP Semiconductors

使用 MCAL4.3 中的 CSE (加密服务引擎) 模块 - NXP Semiconductors

Using the CSE (Cryptographic Services Engine) Module in MCAL4.3by: NXP Semiconductors1 IntroductionToday, people are concerned about sharing/transmittinginformation in a secure and trusted manner betweenparties in the automotive area. The security functionsimplemented with Cryptographic Services Engine(CSE)module are described in the Secure HardwareExtension(SHE) functional specification.This application note provides an introduction to theCSE module on the MPC5777C and explains how toconfigure and use this module in MCAL4.3. Afterreading this application note, you should be able to:• Understand the CSE configuration process inMCAL4.3• Understand how CSE module working on theMPC5777CThe application note also provides examples for specificconfigurations. The examples are provided in thesoftware package accompanying this document and isalso explained in detail. To aid in understanding of thisdocument and software package, you need to downloadthe MPC5777C reference manual from the NXPwebsite. The following table shows the abbreviationsused throughout the document.NXP SemiconductorsDocument Number: AN 13061 Application Notes Rev. 0 , 12/2020 Contents 1 Introduction ............................................................................ 1 3 CSE module on MPC5777C device ....................................... 2 3.1 Chip-specific CSE information ............................... 2 3.2 Main features .......................................................... 2 3.3 Modes of operation ................................................. 3 3.4 Block diagram ......................................................... 3 4 AES-128 encryption and decryption overview ....................... 5 4.1 Electronic Codebook (ECB) ................................... 5 4.2 Chiper-block chaining (CBC) ................................. 5 4.3 CMAC (Cipherbased Message Authentication Code) 6 5 CRYPTO module in MCAL4.3 ......................................... 7 6 CRYPTO loading key and processing primitive .............. 11 7 References . (12)2 CSE module on MPC5777CTable 1. Abbreviations and acronyms2 CSE module on MPC5777CThe Cryptographic Services Engine (CSE) is a peripheral module that implements the security functions described in the Secure Hardware Extension (SHE) Functional Specification Version 1.1.The CSE design includes a host interface with a set of memory mapped registers and a system bus interface. The host interface are used by the CPU to issue commands. The system bus interface allows the CSE to access system memory directly. Two dedicated blocks of system flash memory are used by the CSE for secure key storage.2.1 Chip-specific CSE informationThis chip has one instance of the CSE module. The module:•Executes the chip's secure boot process. See the System Boot details in the MPC5777C Reference Manual.•Exclusive access to the flash memory blocks mapped to the C55FMC_LOCK1 register, PASS_LOCK1_PGn registers, and TDRn_LOCK1 DCF client. See C55FMC_LOCK1 register bit mapping. The system MPU is automatically configured to prevent other bus masters frominterfering with CSE's access to the flash memory.2.2 FeaturesThe CSE has the following features:•Secure storage for cryptographic keys•AES-128 encryption and decryption•AES-128 CMAC authentication•True random number generation•Secure boot mode•System bus master interface2.3 Modes of operationThe CSE supports operation in Normal and Debug modes of operation. The use of the cryptographic keys stored by the CSE is controlled based on the activation of the CPU debug port and the successful completion of the secure boot process.The CSE has a low-power mode that disables the clock to all logic except the host interface. Register accesses are supported in this mode, but commands are not processed.2.4 Block diagramThe CSE design includes a command processor, host interface, system bus interface, local memory, AES logic, and True Random Number Generator (TRNG) as shown below.A host interface (via the peripheral bridge) with a set of memory mapped registers that are used by the CPU to issue commands. Furthermore, a system bus interface (via the crossbar interface) allows the CSE to directly access system memory. Here the crypto module behaves like any other master on the Crossbar switch (XBAR). Through the host interface, you can configure and control the CSE module, like putting the module into low power mode, enabling interrupts for finished command processing, or suspending command processing. A status and error register gives further system information. For a complete list of CSE commands see MPC5777C reference manual.Two dedicated blocks of system flash memory are used by the CSE for secure key and firmware storage. These blocks are not accessible by other masters from the system. Therefore, they are called secure flash. The command processing is done by a 32-bit CSE core with attached ROM and RAM running at system frequency. After system boot, the core comes out of reset and executes boot code from the module ROM. This code will load the firmware from the secure flash into the module RAM and start executing from there. This reduces the flash accesses by the crypto core on the Crossbar. The AES block is a slave to the crypto internal bus. It processes the encryption (plaintext → ciphertext) and decryption (ciphertext → plaintext) and offers AES CMAC authentication. This application note deals only with the authentication capabilities of the CSE.2 CSE module on MPC5777CFigure 1. CSE block diagram on MPC5777C3 AES-128 encryption and decryption overviewBlock ciphers like the AES algorithm, working with a defined granularity, are often 64 bits or 128 bits. The simplest way to encode data is to split the message in the cipher specific granularity. In this case, the cipher output depends only on the key and input value. The drawback of this cipher mode, which is called Electronic Code Book (ECB), is that the same input values will be decoded into the same output values. This gives attackers the opportunity to use statistical analysis (for example, in a normal text some letter combinations occur much more often than others).To overcome this issue other cipher modes were developed like the Cipher-block chaining (CBC), Cipher feedback (CFB), Output feedback (OFB) and Counter (CTR) mode.The CSE module supports only the ECB and the CBC mode which are described in the following sections.3.1 Electronic Codebook (ECB)Each block has no relationship with another block of the same message or information. The following figure shows the block diagram of the ECB mode.Figure 2. ECB block diagramThe following figure shows the drawback of the ECB mode. Taking the Freescale logo as an example it is still visible in the encoded form using this mode. It is obvious that this is not very secure.Figure 3. Encoding using ECB mode3.2 Cipher-block chaining (CBC)The Cipher-block (CBC) mode, invented in 1976, is one of the most important cipher modes. In this mode the output of the last encoding step is xor’ed with the input block of the actual encoding step. Because of this, an additional value for the first encoding step is necessary which is called initialization vector (IV). Using this method each cipher block depends on the plaintext blocks processed up to that point.3 AES-128 encryption and decryption overviewThe following figure shows the block diagram of the CBC mode.Figure 4. CBC block diagramThe following figure shows the encoding result of the Freescale logo using the CBC cipher mode. The difference from the ECB mode is self-evident. In many applications ECB mode may not be appropriate.Figure 5. Encoding using CBC mode3.3 CMAC (Cipher-based Message Authentication Code)A CMAC provides a method for authenticating messages and data. The CMAC algorithm accepts as input a secret key and an arbitrary-length message to be authenticated, and outputs a CMAC. The CMAC value protects both a message's data integrity as well as its authenticity, by allowing verifiers (who also possess the secret key) to detect any change in the message contentFigure 6. CMAC SchemeIf you want more information about CSE functional description and CSE commands, see MPC5777C reference manual.CRYPTO module in MCAL4.34 CRYPTO module in MCAL4.3The following figure shows the location of Crypto Driver module in the micro controller abstraction layer. It is below the Crypto Interface module and Crypto Service Manager module. It implements a generic interface for synchronous and asynchronous cryptographic primitives. It also supports key storage, key configuration, and key management for cryptographic services.To provide cryptographic functionalities an ECU needs to integrate one unique Crypto Service Manager module and one Crypto Interface. However, the Crypto interface can access several Crypto Drivers, each of them is configured according to the underlying Crypto Driver Object.Figure 7. AUTOSAR layered view with crypto moduleA Crypto Driver Object represents an instance of independent crypto hardware “device” (e.g. AES accelerator). There could be a channel for fast AES and CMAC calculations on a HSM for jobs with high priority, which ends on a native AES calculation service in the Crypto Driver. But it is also possible that a Crypto Driver Object is a piece of software, e.g. for RSA calculations where jobs are able to encrypt, decrypt, sign or verify. The Crypto Driver Object is the endpoint of a crypto channel.NOTECrypto have layers including Crypto Cryif and CSM, since CSM is alwaysa stub and only in order to avoid compiler error. Thejob_configuration_structure is responsible by CSM, so the job structurecannot generated by NXP CSM itself, as CSM is a stub in MCALperspective. Developers need to manually update the structure and passingit to Crypto_Process_Job. So if need more CSM package support andshould contact the third party(i.e vector DaVinci).CRYPTO module in MCAL4.3Figure 8 shows the relationship between different configuration items in EB:Cryptoprimitives ->CryptoDriverObject->CryIfChannel->CsmQueue->CsmJobs CryptokeyElement->CryptokeyType->Cryptokey->CryIfKey->CsmKeysCrypto Driver Object: A Crypto Driver implements one or more Crypto Driver Objects. The Crypto Driver Object can offer different crypto primitives in hardware or software. The Crypto Driver Objects of one Crypto Driver are independent of each other. There is only one workspace for each Crypto Driver Object (i.e. only one crypto primitive can be performed at the same time)CryptoKeyElement: Key elements are used to store data. This data can be key material or the IV needed for AES encryption. It can also be used to configure the behavior of the key management functions.CryptoKeyType: A key type consists of references to key elements. The key types are typically pre-configured by the vendor of the Crypto Driver.CryptoKey: A Key can be referenced by a job in the CSM. In the Crypto Driver, the key references a specific key type.CryptoPrimitive: A crypto primitive is an instance of a configured cryptographic algorithm realized in a Crypto Driver Object.Figure 8. Crypto configuration in EBCRYPTO module in MCAL4.3 CryIf: The crypto drivers are called by CryIf, the Crypto drivers access the underlying hardware and software objects to calculate results with their cryptographic primitives. The results are forwarded to CryIf.CsmJob: A job is an instance of a job’s configured in cryptographic primitive. An operation of a crypto primitive declares what part of the crypto primitive will be performed. There are three different operation modes:•START is a operation mode indicates a new request of a crypto primitive and will be cancel all previous request of the same job and preemptive•UPDATE mode indicates that the crypto primitive expects input data•FINISH mode indicates that after this part all data are fed completely and the crypto primitive can finalize the calculationThe priority of a job defines the importance of it. The higher the priority means more immediately the job is executed. The priority of a cryptographic job is part of the configuration.Figure 9. Cryif and CsmJobs in EBNOTEThe crypro driver does not have callback function in CryIf.c file, so itshould add SampleAppCrypto(job, result) intoCryIf_CallbackNotification(const Crypto_JobType* job, Std_ReturnTyperesult) function in CryIf.c file.CRYPTO module in MCAL4.3As show in the following figure, this sample configure three primitives, ENCRYPT, RNG(random number generated) and DECRYPT.Figure 10. CryptoPrimitive configuration in EBAs show in the following figure, A CryptoKeyElement having the CryptoKeyElementId set to 1 represents a key material and cannot be set be using the field CryptoKeyElementInitValue. All the other CryptoKeyElementIds can be set either using CryptoKeyElementSet function or the Tresos field CryptoKeyElementInitValue.Figure 11. CryptoKeyEelment configuration in EBAs show in the following figure, key elements and keys have to be configured for all primitives supported in this release. Containers CryptoKeyElements, CryptoKeyTypes and CryptoKeys should be activated or deactivated in Tresos in the same time. For a key it is mandatory to have a key type and configured key elements. The index of the different key elements from the different Crypto services are defined as in imported types table SWS_Csm_01022(in AUOTOSAR document Specification of Crypto Service Manager)A key has a state which is either 'valid' or 'invalid'. By default, all the keys are 'invalid' and have to be set to valid by using the function Crypto_KeySetValid. If a key is in the invalid state then the Crypto services which make use of the key returns CRYPTO_E_KEY_NOT_VALID value.Figure 12. CryptoKey configuration in EBCRYPTO loading key and processing primitive Because crypto driver not include CSM layer, so the Crypto_JobType structure should be initialized manually in the code.Figure 13. Csm in EB5 CRYPTO loading key and processing primitiveTo process a primitive (random number generation, MAC generation or verification, AESencrypt/decrypt), the following sequence should be followed:1.If keys are needed, the containers CryptoKeyElements, CryptoKeyTypes, CryptoKeys should beenabled2.Crypto_KeyElementSet(65536, CryptoKeyElementId_0, aes_test01_key, 16) meaning a keymaterial corresponding to key 65536 and having the size 16 bytes is configured3.Call the API function Crypto_KeySetValid(65536) to enable key 655364.Call the API function Crypto_ProcessJob() to process job, it process three jobs(randomgenerated, encryption and decryption) in this sample codeFigure 14. Process job in sample code6 ReferencesCall API function StringCompare ((uint8_t*)ucPlainText, ucDecText, 16) to verify the encryption and decryption functionality.Figure 15. Compare the ucPlainText and ucDecText6 References•MPC5777C Reference Manual (Document ID: MPC5777CPRM)•Specification of Crypto Service Manager(Document link)•Specification of Crypto Driver(Document link)•AUTOSAR_MCAL_CRYPTO_IM•AUTOSAR_MCAL_CRYPTO_UMDocument Number: AN 13061 Rev. 0 12/2020 How to Reach Us: Home Page: Web Support: /supportInformation in this document is provided solely to enable system and software implementers to use NXP products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. NXP reserves the right to make changes without further notice to any products herein. NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does NXP assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical ” parameters that may be provided in NXP data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including “typicals,” must be validated for each customer application by customer's technical experts. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of sale, which can be found at the following address:/SalesTermsandConditions . While NXP has implemented advanced security features, all products may be subject to unidentified vulnerabilities. Customers are responsible for the design and operation of their applications and products to reduce the effect of these vulnerabilities on customer’s applications and products, and NXP accepts no li ability for any vulnerability that is discovered. Customers should implement appropriate design and operating safeguards to minimize the risks associated with their applications and products. NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD, COOLFLUX, EMBRACE, GREENCHIP, HITAG, I2C BUS, ICODE, JCOP, LIFE VIBES, MIFARE, MIFARE CLASSIC, MIFARE DESFire, MIFARE PLUS, MIFARE FLEX, MANTIS, MIFARE ULTRALIGHT, MIFARE4MOBILE, MIGLO, NTAG, ROADLINK, SMARTLX, SMARTMX, STARPLUG, TOPFET, TRENCHMOS, UCODE, Freescale, the Freescale logo, AltiVec, C 5, CodeTEST, CodeWarrior, ColdFire, ColdFire+, C Ware, the Energy Efficient Solutions logo, Kinetis, Layerscape, MagniV, mobileGT, PEG, PowerQUICC, Processor Expert, QorIQ, QorIQ Qonverge, Ready Play, SafeAssure, the SafeAssure logo, StarCore, Symphony, VortiQa, Vybrid, Airfast, BeeKit, BeeStack, CoreNet, Flexis, MXC, Platform in a Package, QUICC Engine, SMARTMOS, Tower, TurboLink, and UMEMS are trademarks of NXP B.V. All other product or service names are the property of their respective owners. Arm, AMBA, Arm Powered, Artisan, Cortex, Jazelle, Keil, SecurCore, Thumb, TrustZone, and μVision are registered trademarks of Arm Limited (or its subsidiaries) in the EU and/or elsewhere. Arm7, Arm9, Arm11, big.LITTLE, CoreLink, CoreSight, DesignStart, Mali, Mbed, NEON, POP, Sensinode, Socrates, ULINK and Versatile are trademarks of Arm Limited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. The Power Architecture and word marks and the Power and logos and related marks are trademarks and service marks licensed by . © 2020 NXP B.V.。

Markdown的插件推荐和使用技巧

Markdown的插件推荐和使用技巧

Markdown的插件推荐和使用技巧Markdown是一种轻量级标记语言,广泛用于写作、博客、笔记等方面。

它通过简单的标记符号实现文档的格式和排版,具有易读、易写、易改的特点。

为了提升Markdown的编辑效率和功能,插件的使用变得十分重要。

本文将介绍一些常用的Markdown插件,并分享一些使用技巧,帮助你更好地使用Markdown。

一、插件推荐1. Markdown All in OneMarkdown All in One是一款功能强大的插件,集成了多种常用功能,例如格式切换、表格插入、目录生成等。

同时,它还支持自定义快捷键,提供了丰富的选项供用户设置。

2. TyporaTypora是一种所见即所得的Markdown编辑器,简洁易用,免费开源。

它支持实时预览,使得文章的编写更加直观和高效。

此外,Typora还提供了多种主题和样式,让你可以自由地定制文档的外观。

3. MermaidMermaid是一款流程图、时序图等图表的插件,能够将简单的文本内容转换为美观的图表展示。

对于需要频繁使用图表的用户来说,Mermaid是一个很好的选择。

4. PlantUMLPlantUML是一种用于绘制UML图的插件,它支持多种UML图类型,如时序图、类图等。

通过简单的文本描述,PlantUML能够自动生成清晰的UML图,方便用户进行文档的编写和图形的展示。

5. MathJaxMathJax是一种用于显示数学公式的插件,支持多种数学符号和公式的输入和展示。

对于需要在Markdown中插入数学公式的用户来说,MathJax是一个不可或缺的工具。

二、使用技巧1. 使用代码块Markdown支持插入代码块,并且可以指定代码的语言类型,以实现代码高亮效果。

要在Markdown中插入代码块,可以使用三个反引号(```)包裹代码,并在反引号后指定代码的语言类型。

2. 使用标题和列表Markdown中通过添加井号(#)来表示标题,使用星号(*)或者加号(+)或者减号(-)来表示无序列表。

rfc3394.Advanced Encryption Standard (AES) Key Wrap Algorithm

rfc3394.Advanced Encryption Standard (AES) Key Wrap Algorithm

Network Working Group J. Schaad Request for Comments: 3394 Soaring Hawk Consulting Category: Informational R. Housley RSA Laboratories September 2002 Advanced Encryption Standard (AES) Key Wrap AlgorithmStatus of this MemoThis memo provides information for the Internet community. It doesnot specify an Internet standard of any kind. Distribution of thismemo is unlimited.Copyright NoticeCopyright (C) The Internet Society (2002). All Rights Reserved.AbstractThe purpose of this document is to make the Advanced EncryptionStandard (AES) Key Wrap algorithm conveniently available to theInternet community. The United States of America has adopted AES as the new encryption standard. The AES Key Wrap algorithm willprobably be adopted by the USA for encryption of AES keys. Theauthors took most of the text in this document from the draft AES Key Wrap posted by NIST.Table of Contents1. Introduction (2)2. Overview (2)2.1 Notation and Definitions (3)2.2 Algorithms (4)2.2.1 Key Wrap (4)2.2.2 Key Unwrap (5)2.2.3 Key Data Integrity -- the Initial Value (6)2.2.3.1 Default Initial Value (7)2.2.3.2 Alternative Initial Values (7)3. Object Identifiers (8)4. Test Vectors (8)4.1 Wrap 128 bits of Key Data with a 128-bit KEK (8)4.2 Wrap 128 bits of Key Data with a 192-bit KEK (11)4.3 Wrap 128 bits of Key Data with a 256-bit KEK (14)4.4 Wrap 192 bits of Key Data with a 192-bit KEK (17)4.5 Wrap 192 bits of Key Data with a 256-bit KEK (24)4.6 Wrap 256 bits of Key Data with a 256-bit KEK (30)Schaad & Housley Informational [Page 1]5. Security Considerations (39)6. References (39)7. Acknowledgments (39)8. Authors’ Addresses (39)9. Full Copyright Statement (40)1. IntroductionNOTE: Most of the following text is taken from [AES-WRAP], and theassertions regarding the security of the AES Key Wrap algorithm aremade by the US Government, not by the authors of this document.This specification is intended to satisfy the National Institute ofStandards and Technology (NIST) Key Wrap requirement to: Design acryptographic algorithm called a Key Wrap that uses the AdvancedEncryption Standard (AES) as a primitive to securely encryptplaintext key(s) with any associated integrity information and data, such that the combination could be longer than the width of the AESblock size (128-bits). Each ciphertext bit should be a highly non-linear function of each plaintext bit, and (when unwrapping) eachplaintext bit should be a highly non-linear function of eachciphertext bit. It is sufficient to approximate an idealpseudorandom permutation to the degree that exploitation ofundesirable phenomena is as unlikely as guessing the AES engine key. This key wrap algorithm needs to provide ample security to protectkeys in the context of prudently designed key managementarchitecture.Throughout this document, any data being wrapped will be referred to as the key data. It makes no difference to the algorithm whether the data being wrapped is a key; in fact there is often good reason toinclude other data with the key, to wrap multiple keys together, orto wrap data that isn’t strictly a key. So, the term "key data" isused broadly to mean any data being wrapped, but particularly keys,since this is primarily a key wrap algorithm. The key used to do the wrapping will be referred to as the key-encryption key (KEK).In this document a KEK can be any valid key supported by the AEScodebook. That is, a KEK can be a 128-bit key, a 192-bit key, or a256-bit key.2. OverviewThe AES key wrap algorithm is designed to wrap or encrypt key data.The key wrap operates on blocks of 64 bits. Before being wrapped,the key data is parsed into n blocks of 64 bits.Schaad & Housley Informational [Page 2]The only restriction the key wrap algorithm places on n is that n beat least two. (For key data with length less than or equal to 64bits, the constant field used in this specification and the key dataform a single 128-bit codebook input making this key wrapunnecessary.) The key wrap algorithm accommodates all supported AESkey sizes. However, other cryptographic values often need to bewrapped. One such value is the seed of the random number generatorfor DSS. This seed value requires n to be greater than four.Undoubtedly other values require this type of protection. Therefore,no upper bound is imposed on n.The AES key wrap can be configured to use any of the three key sizessupported by the AES codebook. The choice of a key size affects theoverall security provided by the key wrap, but it does not alter thedescription of the key wrap algorithm. Therefore, in the description that follows, the key wrap is described generically; no key size isspecified for the KEK.2.1 Notation and DefinitionsThe following notation is used in the description of the key wrapping algorithms:AES(K, W) Encrypt W using the AES codebook with key KAES-1(K, W) Decrypt W using the AES codebook with key KMSB(j, W) Return the most significant j bits of WLSB(j, W) Return the least significant j bits of WB1 ^ B2 The bitwise exclusive or (XOR) of B1 and B2B1 | B2 Concatenate B1 and B2K The key-encryption key Kn The number of 64-bit key data blockss The number of steps in the wrapping process, s = 6nP[i] The ith plaintext key data blockC[i] The ith ciphertext data blockA The 64-bit integrity check registerR[i] An array of 64-bit registers wherei = 0, 1, 2, ..., nA[t], R[i][t] The contents of registers A and R[i] after encryption step t.IV The 64-bit initial value used during the wrappingprocess.In the key wrap algorithm, the concatenation function will be used to concatenate 64-bit quantities to form the 128-bit input to the AEScodebook. The extraction functions will be used to split the 128-bit output from the AES codebook into two 64-bit quantities.Schaad & Housley Informational [Page 3]2.2 AlgorithmsThe specification of the key wrap algorithm requires the use of theAES codebook [AES]. The next three sections will describe the keywrap algorithm, the key unwrap algorithm, and the inherent dataintegrity check.2.2.1 Key WrapThe inputs to the key wrapping process are the KEK and the plaintext to be wrapped. The plaintext consists of n 64-bit blocks, containing the key data being wrapped. The key wrapping process is describedbelow.Inputs: Plaintext, n 64-bit values {P1, P2, ..., Pn}, andKey, K (the KEK).Outputs: Ciphertext, (n+1) 64-bit values {C0, C1, ..., Cn}.1) Initialize variables.Set A0 to an initial value (see 2.2.3)For i = 1 to nR[0][i] = P[i]2) Calculate intermediate values.For t = 1 to s, where s = 6nA[t] = MSB(64, AES(K, A[t-1] | R[t-1][1])) ^ tFor i = 1 to n-1R[t][i] = R[t-1][i+1]R[t][n] = LSB(64, AES(K, A[t-1] | R[t-1][1]))3) Output the results.Set C[0] = A[t]For i = 1 to nC[i] = R[t][i]An alternative description of the key wrap algorithm involvesindexing rather than shifting. This approach allows one to calculate the wrapped key in place, avoiding the rotation in the previousdescription. This produces identical results and is more easilyimplemented in software.Schaad & Housley Informational [Page 4]Inputs: Plaintext, n 64-bit values {P1, P2, ..., Pn}, andKey, K (the KEK).Outputs: Ciphertext, (n+1) 64-bit values {C0, C1, ..., Cn}.1) Initialize variables.Set A = IV, an initial value (see 2.2.3)For i = 1 to nR[i] = P[i]2) Calculate intermediate values.For j = 0 to 5For i=1 to nB = AES(K, A | R[i])A = MSB(64, B) ^ t where t = (n*j)+iR[i] = LSB(64, B)3) Output the results.Set C[0] = AFor i = 1 to nC[i] = R[i]2.2.2 Key UnwrapThe inputs to the unwrap process are the KEK and (n+1) 64-bit blocks of ciphertext consisting of previously wrapped key. It returns nblocks of plaintext consisting of the n 64-bit blocks of thedecrypted key data.Inputs: Ciphertext, (n+1) 64-bit values {C0, C1, ..., Cn}, andKey, K (the KEK).Outputs: Plaintext, n 64-bit values {P1, P2, ..., Pn}.1) Initialize variables.Set A[s] = C[0] where s = 6nFor i = 1 to nR[s][i] = C[i]2) Calculate the intermediate values.For t = s to 1A[t-1] = MSB(64, AES-1(K, ((A[t] ^ t) | R[t][n]))R[t-1][1] = LSB(64, AES-1(K, ((A[t]^t) | R[t][n]))For i = 2 to nR[t-1][i] = R[t][i-1]Schaad & Housley Informational [Page 5]3) Output the results.If A[0] is an appropriate initial value (see 2.2.3),ThenFor i = 1 to nP[i] = R[0][i]ElseReturn an errorThe unwrap algorithm can also be specified as an index basedoperation, allowing the calculations to be carried out in place.Again, this produces the same results as the register shiftingapproach.Inputs: Ciphertext, (n+1) 64-bit values {C0, C1, ..., Cn}, andKey, K (the KEK).Outputs: Plaintext, n 64-bit values {P0, P1, K, Pn}.1) Initialize variables.Set A = C[0]For i = 1 to nR[i] = C[i]2) Compute intermediate values.For j = 5 to 0For i = n to 1B = AES-1(K, (A ^ t) | R[i]) where t = n*j+iA = MSB(64, B)R[i] = LSB(64, B)3) Output results.If A is an appropriate initial value (see 2.2.3),ThenFor i = 1 to nP[i] = R[i]ElseReturn an error2.2.3 Key Data Integrity -- the Initial ValueThe initial value (IV) refers to the value assigned to A[0] in thefirst step of the wrapping process. This value is used to obtain an integrity check on the key data. In the final step of the unwrapping process, the recovered value of A[0] is compared to the expected Schaad & Housley Informational [Page 6]value of A[0]. If there is a match, the key is accepted as valid,and the unwrapping algorithm returns it. If there is not a match,then the key is rejected, and the unwrapping algorithm returns anerror.The exact properties achieved by this integrity check depend on thedefinition of the initial value. Different applications may call for somewhat different properties; for example, whether there is need to determine the integrity of key data throughout its lifecycle or just when it is unwrapped. This specification defines a default initialvalue that supports integrity of the key data during the period it is wrapped (2.2.3.1). Provision is also made to support alternativeinitial values (in 2.2.3.2).2.2.3.1 Default Initial ValueThe default initial value (IV) is defined to be the hexadecimalconstant:A[0] = IV = A6A6A6A6A6A6A6A6The use of a constant as the IV supports a strong integrity check on the key data during the period that it is wrapped. If unwrappingproduces A[0] = A6A6A6A6A6A6A6A6, then the chance that the key datais corrupt is 2^-64. If unwrapping produces A[0] any other value,then the unwrap must return an error and not return any key data.2.2.3.2 Alternative Initial ValuesWhen the key wrap is used as part of a larger key management protocol or system, the desired scope for data integrity may be more than just the key data or the desired duration for more than just the periodthat it is wrapped. Also, if the key data is not just an AES key, it may not always be a multiple of 64 bits. Alternative definitions of the initial value can be used to address such problems. NIST willdefine alternative initial values in future key managementpublications as needed. In order to accommodate a set ofalternatives that may evolve over time, key wrap implementations that are not application-specific will require some flexibility in the way that the initial value is set and tested.Schaad & Housley Informational [Page 7]3. Object IdentifiersNIST has assigned the following object identifiers to identify thekey wrap algorithm with the default initial value specified in2.2.3.1. One object identifier is assigned for use with each of the KEK AES key sizes.aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16)us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 1 } id-aes128-wrap OBJECT IDENTIFIER ::= { aes 5 }id-aes192-wrap OBJECT IDENTIFIER ::= { aes 25 }id-aes256-wrap OBJECT IDENTIFIER ::= { aes 45 }4. Test VectorsThe examples in this section were generated using the index-basedimplementation of the key wrap algorithm. The use of this approachallows a straightforward software implementation of the key wrapalgorithm.4.1 Wrap 128 bits of Key Data with a 128-bit KEKInput:KEK: 000102030405060708090A0B0C0D0E0FKey Data: 00112233445566778899AABBCCDDEEFFWrap:Step t A R1 R21In A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFEnc F4740052E82A2251 74CE86FBD7B805E7 8899AABBCCDDEEFFXorT F4740052E82A2250 74CE86FBD7B805E7 8899AABBCCDDEEFF2In F4740052E82A2250 74CE86FBD7B805E7 8899AABBCCDDEEFFEnc 06BA4EBDE7768D0B 74CE86FBD7B805E7 D132EE38147E76F8XorT 06BA4EBDE7768D09 74CE86FBD7B805E7 D132EE38147E76F83In 06BA4EBDE7768D09 74CE86FBD7B805E7 D132EE38147E76F8Enc FC967627BE937208 FE6E8D679C5D3460 D132EE38147E76F8XorT FC967627BE93720B FE6E8D679C5D3460 D132EE38147E76F8Schaad & Housley Informational [Page 8]4In FC967627BE93720B FE6E8D679C5D3460 D132EE38147E76F8Enc 5896EA9028EE203B FE6E8D679C5D3460 07B2BD973E36A6FCXorT 5896EA9028EE203F FE6E8D679C5D3460 07B2BD973E36A6FC5In 5896EA9028EE203F FE6E8D679C5D3460 07B2BD973E36A6FCEnc 93AEA71B258D90C3 25F5A3ADC2195401 07B2BD973E36A6FCXorT 93AEA71B258D90C6 25F5A3ADC2195401 07B2BD973E36A6FC6In 93AEA71B258D90C6 25F5A3ADC2195401 07B2BD973E36A6FCEnc E3EE986344D878F7 25F5A3ADC2195401 F14863BB1E9CA90AXorT E3EE986344D878F1 25F5A3ADC2195401 F14863BB1E9CA90A7In E3EE986344D878F1 25F5A3ADC2195401 F14863BB1E9CA90AEnc 2BFC21B2C20E4006 B556D35ED8CEF052 F14863BB1E9CA90AXorT 2BFC21B2C20E4001 B556D35ED8CEF052 F14863BB1E9CA90A8In 2BFC21B2C20E4001 B556D35ED8CEF052 F14863BB1E9CA90AEnc 4BE8CE99C0A43A7D B556D35ED8CEF052 64BAE5818D0570BBXorT 4BE8CE99C0A43A75 B556D35ED8CEF052 64BAE5818D0570BB9In 4BE8CE99C0A43A75 B556D35ED8CEF052 64BAE5818D0570BBEnc EBE1CE91067024F3 BE114B343EB00981 64BAE5818D0570BBXorT EBE1CE91067024FA BE114B343EB00981 64BAE5818D0570BB10In EBE1CE91067024FA BE114B343EB00981 64BAE5818D0570BBEnc 5A9C7B1F5B1C3B46 BE114B343EB00981 4FD3D2B7D74FBB42XorT 5A9C7B1F5B1C3B4C BE114B343EB00981 4FD3D2B7D74FBB4211In 5A9C7B1F5B1C3B4C BE114B343EB00981 4FD3D2B7D74FBB42Enc 93B71967EED41FFC AEF34BD8FB5A7B82 4FD3D2B7D74FBB42XorT 93B71967EED41FF7 AEF34BD8FB5A7B82 4FD3D2B7D74FBB4212In 93B71967EED41FF7 AEF34BD8FB5A7B82 4FD3D2B7D74FBB42Enc 1FA68B0A8112B44B AEF34BD8FB5A7B82 9D3E862371D2CFE5XorT 1FA68B0A8112B447 AEF34BD8FB5A7B82 9D3E862371D2CFE5Output:Ciphertext: 1FA68B0A8112B447 AEF34BD8FB5A7B82 9D3E862371D2CFE5 Schaad & Housley Informational [Page 9]Unwrap:Step t A R1 R212In 1FA68B0A8112B447 AEF34BD8FB5A7B82 9D3E862371D2CFE5XorT 1FA68B0A8112B44B AEF34BD8FB5A7B82 9D3E862371D2CFE5Dec 93B71967EED41FF7 AEF34BD8FB5A7B82 4FD3D2B7D74FBB4211In 93B71967EED41FF7 AEF34BD8FB5A7B82 4FD3D2B7D74FBB42XorT 93B71967EED41FFC AEF34BD8FB5A7B82 4FD3D2B7D74FBB42Dec 5A9C7B1F5B1C3B4C BE114B343EB00981 4FD3D2B7D74FBB4210In 5A9C7B1F5B1C3B4C BE114B343EB00981 4FD3D2B7D74FBB42XorT 5A9C7B1F5B1C3B46 BE114B343EB00981 4FD3D2B7D74FBB42Dec EBE1CE91067024FA BE114B343EB00981 64BAE5818D0570BB9In EBE1CE91067024FA BE114B343EB00981 64BAE5818D0570BBXorT EBE1CE91067024F3 BE114B343EB00981 64BAE5818D0570BBDec 4BE8CE99C0A43A75 B556D35ED8CEF052 64BAE5818D0570BB8In 4BE8CE99C0A43A75 B556D35ED8CEF052 64BAE5818D0570BBXorT 4BE8CE99C0A43A7D B556D35ED8CEF052 64BAE5818D0570BBDec 2BFC21B2C20E4001 B556D35ED8CEF052 F14863BB1E9CA90A7In 2BFC21B2C20E4001 B556D35ED8CEF052 F14863BB1E9CA90AXorT 2BFC21B2C20E4006 B556D35ED8CEF052 F14863BB1E9CA90ADec E3EE986344D878F1 25F5A3ADC2195401 F14863BB1E9CA90A6In E3EE986344D878F1 25F5A3ADC2195401 F14863BB1E9CA90AXorT E3EE986344D878F7 25F5A3ADC2195401 F14863BB1E9CA90ADec 93AEA71B258D90C6 25F5A3ADC2195401 07B2BD973E36A6FC5In 93AEA71B258D90C6 25F5A3ADC2195401 07B2BD973E36A6FCXorT 93AEA71B258D90C3 25F5A3ADC2195401 07B2BD973E36A6FCDec 5896EA9028EE203F FE6E8D679C5D3460 07B2BD973E36A6FC4In 5896EA9028EE203F FE6E8D679C5D3460 07B2BD973E36A6FCXorT 5896EA9028EE203B FE6E8D679C5D3460 07B2BD973E36A6FCDec FC967627BE93720B FE6E8D679C5D3460 D132EE38147E76F8Schaad & Housley Informational [Page 10]In FC967627BE93720B FE6E8D679C5D3460 D132EE38147E76F8XorT FC967627BE937208 FE6E8D679C5D3460 D132EE38147E76F8Dec 06BA4EBDE7768D09 74CE86FBD7B805E7 D132EE38147E76F82In 06BA4EBDE7768D09 74CE86FBD7B805E7 D132EE38147E76F8XorT 06BA4EBDE7768D0B 74CE86FBD7B805E7 D132EE38147E76F8Dec F4740052E82A2250 74CE86FBD7B805E7 8899AABBCCDDEEFF1In F4740052E82A2250 74CE86FBD7B805E7 8899AABBCCDDEEFFXorT F4740052E82A2251 74CE86FBD7B805E7 8899AABBCCDDEEFFDec A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFPlaintext A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFOutput:Key Data: 00112233445566778899AABBCCDDEEFF4.2 Wrap 128 bits of Key Data with a 192-bit KEKInput:KEK: 000102030405060708090A0B0C0D0E0F1011121314151617Key Data: 00112233445566778899AABBCCDDEEFFWrap:Step t A R1 R21In A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFEnc DFE8FD5D1A3786A7 351D385096CCFB29 8899AABBCCDDEEFFXorT DFE8FD5D1A3786A6 351D385096CCFB29 8899AABBCCDDEEFF2In DFE8FD5D1A3786A6 351D385096CCFB29 8899AABBCCDDEEFFEnc 9D9B32B9ED742E02 351D385096CCFB29 51F22F3286758A2DXorT 9D9B32B9ED742E00 351D385096CCFB29 51F22F3286758A2D3In 9D9B32B9ED742E00 351D385096CCFB29 51F22F3286758A2DEnc 7B8E343CA51CF8AB BC164F51E20CC983 51F22F3286758A2DXorT 7B8E343CA51CF8A8 BC164F51E20CC983 51F22F3286758A2D4In 7B8E343CA51CF8A8 BC164F51E20CC983 51F22F3286758A2DEnc 02A97C5897140595 BC164F51E20CC983 05FC2D8F8FF4B919XorT 02A97C5897140591 BC164F51E20CC983 05FC2D8F8FF4B919Schaad & Housley Informational [Page 11]In 02A97C5897140591 BC164F51E20CC983 05FC2D8F8FF4B919Enc 15D4B63F66583817 429487269D3A0016 05FC2D8F8FF4B919XorT 15D4B63F66583812 429487269D3A0016 05FC2D8F8FF4B9196In 15D4B63F66583812 429487269D3A0016 05FC2D8F8FF4B919Enc AE2D0B76A6951EEA 429487269D3A0016 05A2D8FB4DD5BD7AXorT AE2D0B76A6951EEC 429487269D3A0016 05A2D8FB4DD5BD7A7In AE2D0B76A6951EEC 429487269D3A0016 05A2D8FB4DD5BD7AEnc 79F849444F4B8AA8 D40B091CDBAC0340 05A2D8FB4DD5BD7AXorT 79F849444F4B8AAF D40B091CDBAC0340 05A2D8FB4DD5BD7A8In 79F849444F4B8AAF D40B091CDBAC0340 05A2D8FB4DD5BD7AEnc 5933A9195B5F5E21 D40B091CDBAC0340 89F0D6C06F8CA9B4XorT 5933A9195B5F5E29 D40B091CDBAC0340 89F0D6C06F8CA9B49In 5933A9195B5F5E29 D40B091CDBAC0340 89F0D6C06F8CA9B4Enc 57ADA800299C2E85 4D5B3DFE7C04ABBA 89F0D6C06F8CA9B4XorT 57ADA800299C2E8C 4D5B3DFE7C04ABBA 89F0D6C06F8CA9B410In 57ADA800299C2E8C 4D5B3DFE7C04ABBA 89F0D6C06F8CA9B4Enc BF17BD6A9BC80163 4D5B3DFE7C04ABBA EB24CCFA52EA9078XorT BF17BD6A9BC80169 4D5B3DFE7C04ABBA EB24CCFA52EA907811In BF17BD6A9BC80169 4D5B3DFE7C04ABBA EB24CCFA52EA9078Enc B68BF270AE81544F F92B5B97C050AED2 EB24CCFA52EA9078XorT B68BF270AE815444 F92B5B97C050AED2 EB24CCFA52EA907812In B68BF270AE815444 F92B5B97C050AED2 EB24CCFA52EA9078Enc 96778B25AE6CA439 F92B5B97C050AED2 468AB8A17AD84E5DXorT 96778B25AE6CA435 F92B5B97C050AED2 468AB8A17AD84E5DOutput:Ciphertext: 96778B25AE6CA435 F92B5B97C050AED2 468AB8A17AD84E5D Schaad & Housley Informational [Page 12]Unwrap:Step t A R1 R212In 96778B25AE6CA435 F92B5B97C050AED2 468AB8A17AD84E5DXorT 96778B25AE6CA439 F92B5B97C050AED2 468AB8A17AD84E5DDec B68BF270AE815444 F92B5B97C050AED2 EB24CCFA52EA907811In B68BF270AE815444 F92B5B97C050AED2 EB24CCFA52EA9078XorT B68BF270AE81544F F92B5B97C050AED2 EB24CCFA52EA9078Dec BF17BD6A9BC80169 4D5B3DFE7C04ABBA EB24CCFA52EA907810In BF17BD6A9BC80169 4D5B3DFE7C04ABBA EB24CCFA52EA9078XorT BF17BD6A9BC80163 4D5B3DFE7C04ABBA EB24CCFA52EA9078Dec 57ADA800299C2E8C 4D5B3DFE7C04ABBA 89F0D6C06F8CA9B49In 57ADA800299C2E8C 4D5B3DFE7C04ABBA 89F0D6C06F8CA9B4XorT 57ADA800299C2E85 4D5B3DFE7C04ABBA 89F0D6C06F8CA9B4Dec 5933A9195B5F5E29 D40B091CDBAC0340 89F0D6C06F8CA9B48In 5933A9195B5F5E29 D40B091CDBAC0340 89F0D6C06F8CA9B4XorT 5933A9195B5F5E21 D40B091CDBAC0340 89F0D6C06F8CA9B4Dec 79F849444F4B8AAF D40B091CDBAC0340 05A2D8FB4DD5BD7A7In 79F849444F4B8AAF D40B091CDBAC0340 05A2D8FB4DD5BD7AXorT 79F849444F4B8AA8 D40B091CDBAC0340 05A2D8FB4DD5BD7ADec AE2D0B76A6951EEC 429487269D3A0016 05A2D8FB4DD5BD7A6In AE2D0B76A6951EEC 429487269D3A0016 05A2D8FB4DD5BD7AXorT AE2D0B76A6951EEA 429487269D3A0016 05A2D8FB4DD5BD7ADec 15D4B63F66583812 429487269D3A0016 05FC2D8F8FF4B9195In 15D4B63F66583812 429487269D3A0016 05FC2D8F8FF4B919XorT 15D4B63F66583817 429487269D3A0016 05FC2D8F8FF4B919Dec 02A97C5897140591 BC164F51E20CC983 05FC2D8F8FF4B9194In 02A97C5897140591 BC164F51E20CC983 05FC2D8F8FF4B919XorT 02A97C5897140595 BC164F51E20CC983 05FC2D8F8FF4B919Dec 7B8E343CA51CF8A8 BC164F51E20CC983 51F22F3286758A2DSchaad & Housley Informational [Page 13]3In 7B8E343CA51CF8A8 BC164F51E20CC983 51F22F3286758A2DXorT 7B8E343CA51CF8AB BC164F51E20CC983 51F22F3286758A2DDec 9D9B32B9ED742E00 351D385096CCFB29 51F22F3286758A2D2In 9D9B32B9ED742E00 351D385096CCFB29 51F22F3286758A2DXorT 9D9B32B9ED742E02 351D385096CCFB29 51F22F3286758A2DDec DFE8FD5D1A3786A6 351D385096CCFB29 8899AABBCCDDEEFF1In DFE8FD5D1A3786A6 351D385096CCFB29 8899AABBCCDDEEFFXorT DFE8FD5D1A3786A7 351D385096CCFB29 8899AABBCCDDEEFFDec A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFPlaintext A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFOutput:Key Data: 00112233445566778899AABBCCDDEEFF4.3 Wrap 128 bits of Key Data with a 256-bit KEKInput:KEK:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F Key Data: 00112233445566778899AABBCCDDEEFFWrap:Step t A R1 R21In A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFEnc 794314D454E3FDE1 F661BD9F31FBFA31 8899AABBCCDDEEFFXorT 794314D454E3FDE0 F661BD9F31FBFA31 8899AABBCCDDEEFF2In 794314D454E3FDE0 F661BD9F31FBFA31 8899AABBCCDDEEFFEnc D450EA5C5BBCB561 F661BD9F31FBFA31 F60E0CDB7F429FE8XorT D450EA5C5BBCB563 F661BD9F31FBFA31 F60E0CDB7F429FE83In D450EA5C5BBCB563 F661BD9F31FBFA31 F60E0CDB7F429FE8Enc 85DBDF1879D5C0A5 5602001BFA07AD8B F60E0CDB7F429FE8XorT 85DBDF1879D5C0A6 5602001BFA07AD8B F60E0CDB7F429FE8Schaad & Housley Informational [Page 14]4In 85DBDF1879D5C0A6 5602001BFA07AD8B F60E0CDB7F429FE8Enc 738C291128B7226D 5602001BFA07AD8B 58924F777C3F678CXorT 738C291128B72269 5602001BFA07AD8B 58924F777C3F678C5In 738C291128B72269 5602001BFA07AD8B 58924F777C3F678CEnc 2656A02DFFF054DC F4DF378183E3D5B2 58924F777C3F678CXorT 2656A02DFFF054D9 F4DF378183E3D5B2 58924F777C3F678C6In 2656A02DFFF054D9 F4DF378183E3D5B2 58924F777C3F678CEnc DDFD0C0E8B52A63A F4DF378183E3D5B2 91AC1D36A964F41BXorT DDFD0C0E8B52A63C F4DF378183E3D5B2 91AC1D36A964F41B7In DDFD0C0E8B52A63C F4DF378183E3D5B2 91AC1D36A964F41BEnc 39AB00D4AE4399EA 5271D5CED80F34ED 91AC1D36A964F41BXorT 39AB00D4AE4399ED 5271D5CED80F34ED 91AC1D36A964F41B8In 39AB00D4AE4399ED 5271D5CED80F34ED 91AC1D36A964F41BEnc 4CE414878463EAAC 5271D5CED80F34ED 67D8ED899E7929B8XorT 4CE414878463EAA4 5271D5CED80F34ED 67D8ED899E7929B89In 4CE414878463EAA4 5271D5CED80F34ED 67D8ED899E7929B8Enc FBB44DB106AA0789 0DF7E50829123648 67D8ED899E7929B8XorT FBB44DB106AA0780 0DF7E50829123648 67D8ED899E7929B810In FBB44DB106AA0780 0DF7E50829123648 67D8ED899E7929B8Enc 877112A7308ADCC5 0DF7E50829123648 3472D5993D318FD2XorT 877112A7308ADCCF 0DF7E50829123648 3472D5993D318FD211In 877112A7308ADCCF 0DF7E50829123648 3472D5993D318FD2Enc 78E40190807CC151 63E9777905818A2A 3472D5993D318FD2XorT 78E40190807CC15A 63E9777905818A2A 3472D5993D318FD212In 78E40190807CC15A 63E9777905818A2A 3472D5993D318FD2Enc 64E8C3F9CE0F5BAE 63E9777905818A2A 93C8191E7D6E8AE7XorT 64E8C3F9CE0F5BA2 63E9777905818A2A 93C8191E7D6E8AE7Output:Ciphertext: 64E8C3F9CE0F5BA2 63E9777905818A2A 93C8191E7D6E8AE7 Schaad & Housley Informational [Page 15]Unwrap:Step t A R1 R212In 64E8C3F9CE0F5BA2 63E9777905818A2A 93C8191E7D6E8AE7XorT 64E8C3F9CE0F5BAE 63E9777905818A2A 93C8191E7D6E8AE7Dec 78E40190807CC15A 63E9777905818A2A 3472D5993D318FD211In 78E40190807CC15A 63E9777905818A2A 3472D5993D318FD2XorT 78E40190807CC151 63E9777905818A2A 3472D5993D318FD2Dec 877112A7308ADCCF 0DF7E50829123648 3472D5993D318FD210In 877112A7308ADCCF 0DF7E50829123648 3472D5993D318FD2XorT 877112A7308ADCC5 0DF7E50829123648 3472D5993D318FD2Dec FBB44DB106AA0780 0DF7E50829123648 67D8ED899E7929B89In FBB44DB106AA0780 0DF7E50829123648 67D8ED899E7929B8XorT FBB44DB106AA0789 0DF7E50829123648 67D8ED899E7929B8Dec 4CE414878463EAA4 5271D5CED80F34ED 67D8ED899E7929B88In 4CE414878463EAA4 5271D5CED80F34ED 67D8ED899E7929B8XorT 4CE414878463EAAC 5271D5CED80F34ED 67D8ED899E7929B8Dec 39AB00D4AE4399ED 5271D5CED80F34ED 91AC1D36A964F41B7In 39AB00D4AE4399ED 5271D5CED80F34ED 91AC1D36A964F41BXorT 39AB00D4AE4399EA 5271D5CED80F34ED 91AC1D36A964F41BDec DDFD0C0E8B52A63C F4DF378183E3D5B2 91AC1D36A964F41B6In DDFD0C0E8B52A63C F4DF378183E3D5B2 91AC1D36A964F41BXorT DDFD0C0E8B52A63A F4DF378183E3D5B2 91AC1D36A964F41BDec 2656A02DFFF054D9 F4DF378183E3D5B2 58924F777C3F678C5In 2656A02DFFF054D9 F4DF378183E3D5B2 58924F777C3F678CXorT 2656A02DFFF054DC F4DF378183E3D5B2 58924F777C3F678CDec 738C291128B72269 5602001BFA07AD8B 58924F777C3F678C4In 738C291128B72269 5602001BFA07AD8B 58924F777C3F678CXorT 738C291128B7226D 5602001BFA07AD8B 58924F777C3F678CDec 85DBDF1879D5C0A6 5602001BFA07AD8B F60E0CDB7F429FE8Schaad & Housley Informational [Page 16]In 85DBDF1879D5C0A6 5602001BFA07AD8B F60E0CDB7F429FE8XorT 85DBDF1879D5C0A5 5602001BFA07AD8B F60E0CDB7F429FE8Dec D450EA5C5BBCB563 F661BD9F31FBFA31 F60E0CDB7F429FE82In D450EA5C5BBCB563 F661BD9F31FBFA31 F60E0CDB7F429FE8XorT D450EA5C5BBCB561 F661BD9F31FBFA31 F60E0CDB7F429FE8Dec 794314D454E3FDE0 F661BD9F31FBFA31 8899AABBCCDDEEFF1In 794314D454E3FDE0 F661BD9F31FBFA31 8899AABBCCDDEEFFXorT 794314D454E3FDE1 F661BD9F31FBFA31 8899AABBCCDDEEFFDec A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFPlaintext A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFFOutput:Key Data: 00112233445566778899AABBCCDDEEFF4.4 Wrap 192 bits of Key Data with a 192-bit KEKInput:KEK: 000102030405060708090A0B0C0D0E0F1011121314151617Key Data: 00112233445566778899AABBCCDDEEFF0001020304050607Wrap:Step t A/R3 R1 R21In A6A6A6A6A6A6A6A6 0011223344556677 8899AABBCCDDEEFF0001020304050607Enc DFE8FD5D1A3786A7 351D385096CCFB29 8899AABBCCDDEEFF0001020304050607XorT DFE8FD5D1A3786A6 351D385096CCFB29 8899AABBCCDDEEFF00010203040506072In DFE8FD5D1A3786A6 351D385096CCFB29 8899AABBCCDDEEFF0001020304050607Enc 9D9B32B9ED742E02 351D385096CCFB29 51F22F3286758A2D0001020304050607XorT 9D9B32B9ED742E00 351D385096CCFB29 51F22F3286758A2D0001020304050607Schaad & Housley Informational [Page 17]。

软件开发英语词汇练习30题

软件开发英语词汇练习30题

软件开发英语词汇练习30题1. In software development, a "bug" refers to:A. A featureB. A mistakeC. A successD. A plan答案:B。

本题中,“bug”在软件开发中通常指“错误”。

选项A“feature”意思是“特征”;选项C“success”是“成功”;选项D“plan”是“计划”。

在软件开发语境下,“bug”指的是错误,所以选B。

2. When we talk about "code review", we mean:A. Checking the quality of the codeB. Writing new codeC. Deleting old codeD. Ignoring the code答案:A。

“code review”指的是检查代码的质量。

选项B“Writing new code”是写新代码;选项C“Deleting old code”是删除旧代码;选项D“Ignoring the code”是忽略代码。

进行“code review”就是检查代码质量,故选A。

3. The term "debugging" is related to:A. Fixing errors in the codeB. Adding new functions to the codeC. Changing the design of the codeD. Making the code more complex答案:A。

“debugging”与修复代码中的错误有关。

选项B“Adding new functions to the code”是给代码添加新功能;选项C“Changing the design of the code”是改变代码的设计;选项D“Making the code more complex”是让代码更复杂。

Python课程考试试卷

Python课程考试试卷

Python课程考试试卷一、选择题(每题2分,共20分)1. 在Python中,以下哪个是正确的字符串定义?A. str = "Hello, World!"B. string = "Hello, World!"C. string = 'Hello, World!'D. Str = "Hello, World!"2. Python的哪个版本开始引入了函数注解(Function Annotations)?A. Python 2.6B. Python 2.7C. Python 3.0D. Python 3.33. 下列哪个是Python的内置数据类型?A. ListB. TupleC. Both A and BD. None of the above4. 在Python中,以下哪个语句可以创建一个空字典?A. dict = {}B. dict = []C. dict = ()D. dict = ""5. 下列哪个是Python的第三方库?A. osB. sysC. numpyD. re6. 在Python中,以下哪个是正确的列表推导式?A. [x for x in range(10)]B. {x for x in range(10)}C. (x for x in range(10))D. [x: x*2 for x in range(5)]7. Python中的哪个关键字用于定义类?A. classB. defC. functionD. type8. 在Python中,以下哪个是正确的条件语句?A. if x = 5B. if x == 5C. if x is 5D. if x equals 59. 下列哪个是Python的文件操作模式?A. 'r'B. 'w'C. 'a'D. All of the above10. 在Python中,以下哪个是正确的异常处理语句?A. try:passexcept:passB. try:passcatch:passC. try:passexcept Exception as e:passD. try:passexcept Exception to e:pass二、简答题(每题5分,共20分)1. 请简述Python中的列表和元组的区别。

密码学与信息安全 第6章 3DES、分组密码工作模式及流密码

密码学与信息安全 第6章 3DES、分组密码工作模式及流密码

6.3 密码分组链接(CBC)模式
为了解决ECB的安全缺陷,可以让重复的明文分 组产生不同的密文分组,CBC(Cipher block chaining)模式就可满足这一要求。它一次对一个 明文分组加密,每次加密使用同一密钥,加密算 法的输入是当前明文分组和前一次密文分组的异 或,因此加密算法的输入不会显示出与这次的明 文分组之间的固定关系,所以重复的明文分组不 会在密文中暴露出这种重复关系。
一般b取64,s取8
C 1 P1 S s [ E ( K , IV )] P 1 C 1 S s [ E ( K , IV )]
6.5 输出反馈(OFB)模式
OFB和CFB结构几乎一样,区别在于OFB模式是将加密 算法的输出反馈到移位寄存器,而CFB模式中是将密文单 元反馈到移位寄存器。 OFB模式的优点是传输过程中比特错误不会被传播。但是 因为密文没有参与链操作,所以使得OFB模式更容易受到 攻击;
因为对S的操作仅是交换,所以惟一的改变就是置换。 S仍然包含所有值为0~255的元素。密钥的主要功能是将 S-box搅乱,i确保S-box的每个元素都得到处理,j保证 S-box的搅乱是随机的。
6.7.2 RC4算法
密钥流的生成: 矢量S一旦完成初始化,输入密钥K就不 再被使用 。密钥流的生成是从S[0]到S[255],对每个S[i], 根据当前S的值,将S[i]与S中的另一字节置换。当S[255] 完成置换后,操作继续重复从S[0]开始:/*Stream Generation*/ i, j=0; while (明文未结束) i=(i+1) mod 256 j=(j+S[i]) mod 256; Swap (S[i],S[j]); t=(S[i]+S[j]) mod 256; k=S[t]; k即为生成的随机子密钥,加密中,将k的值与下一明文字 节异或;解密中,将k的值与下一密文字节异或。

codebook机制 -回复

codebook机制 -回复

codebook机制-回复[codebook机制]是一种在密码学中使用的重要技术,用于保护私密信息的安全性和完整性。

本文将逐步回答关于[codebook机制]的问题,并深入探讨其原理、应用和安全性。

一、[codebook机制]的定义和原理1.1 定义[codebook机制]是一种基于对称密码算法的技术,通过事先准备好的[codebook]来实现信息的加密和解密。

该机制将明文映射到[codebook]中的某个特定的密文,然后通过将密文映射回明文来实现解密过程。

1.2 原理[codebook机制]的原理是基于一种映射关系,将明文和密文进行一一映射。

通常,[codebook]是由密钥生成的,它包含了密钥和密文之间的映射关系。

二、[codebook机制]的应用2.1 信息加密[codebook机制]可以用于对信息进行加密,使得只有持有正确密钥的人可以解密。

加密过程中,明文首先通过[codebook]进行映射得到密文,然后传输给接收者。

接收者通过解密过程,将密文映射回明文,从而得到原始信息。

2.2 数据完整性验证[codebook机制]还可用于验证数据的完整性。

发送者可以在发送前生成该数据的[codebook],并将[codebook]的指纹附加在数据上。

接收者在接收后,通过[codebook]中的映射关系,验证指纹是否一致,从而判断接收到的数据是否被篡改过。

2.3 密码破解[codebook机制]在密码破解中扮演着重要的角色。

攻击者需要事先知道[codebook]的内容,例如,通过偷窃或猜测密钥等方式获取。

一旦攻击者获得[codebook],就可以通过逆向映射关系来获得明文。

三、[codebook机制]的安全性3.1 密钥保护[codebook机制]的安全性极大地依赖于密钥的安全性。

如果密钥被泄露,攻击者可以很容易地获得[codebook]的内容,并获取原始信息。

因此,在使用[codebook机制]时,需要严格保护密钥的安全性,采取适当的密钥管理措施。

程序编辑器中的代码自动补全插件推荐

程序编辑器中的代码自动补全插件推荐

程序编辑器中的代码自动补全插件推荐在程序编辑器中,代码自动补全插件是程序员们工作中的好帮手。

它可以帮助程序员快速而准确地输入代码,提高编码效率和准确性。

本文将为大家推荐几款在程序编辑器中使用的代码自动补全插件。

一、EmmetEmmet是一款在HTML和CSS开发中非常实用的代码自动补全插件。

它基于缩写(Abbreviation)扩展表达式,能够将简短的缩写扩展为完整的HTML或CSS代码。

例如,输入"ul>li.item$*5"后按下Tab键,Emmet会自动扩展为一个包含5个列表项的无序列表。

二、IntelliSenseIntelliSense是Visual Studio中自带的代码自动补全功能,广泛应用于C#、JavaScript等编程语言的开发中。

它通过检索代码库和分析上下文,为开发者提供准确且智能的代码补全建议。

IntelliSense能够根据已有的代码或变量类型,快速推断出可能的代码补全选项,并提供相应的参考文档和参数提示。

三、TabnineTabnine是一款基于机器学习的代码自动补全插件,适用于各种主流的代码编辑器和集成开发环境。

它通过分析大量的开源代码和开发者书写的代码,能够快速预测下一个可能的代码片段,并提供相应的补全建议。

Tabnine的智能提示和高度定制性,使得程序员在编写代码时更加高效和流畅。

四、CodotaCodota是一款在Java开发中广受欢迎的代码自动补全插件。

它通过分析云端海量的Java代码库,能够为开发者提供准确和实用的代码补全建议。

Codota具有智能的代码推断和语义分析功能,能够预测开发者的意图,并给出相应的代码片段。

此外,Codota还提供了一键导入依赖的功能,减少开发者的工作量。

五、KiteKite是一款适用于Python开发的智能代码补全工具。

它通过机器学习和自然语言处理技术,能够为开发者提供准确且实用的代码补全建议。

Kite在编写Python代码时,能够自动补全函数、类、变量等代码片段,并给出相应的文档和用法示例。

自动生成书籍isbn正则表达式

自动生成书籍isbn正则表达式

自动生成书籍 ISBN 正则表达式本文介绍了如何使用正则表达式自动生成书籍 ISBN 号,包括 ISBN 号的格式和生成方法。

下面是本店铺为大家精心编写的5篇《自动生成书籍 ISBN 正则表达式》,供大家借鉴与参考,希望对大家有所帮助。

《自动生成书籍 ISBN 正则表达式》篇1引言ISBN(International Standard Book Number) 是国际标准书号的缩写,是一种用于识别图书的独特编号。

每个 ISBN 号都由 13 个数字组成,分为 5 组,每组数字之间用一个短横线分隔。

ISBN 号的格式非常重要,因为它是书籍的唯一标识符,用于区分不同书籍之间的差异。

生成 ISBN 号的正则表达式生成 ISBN 号的正则表达式如下:```^ISBN-13:s*d{9}-d{3}-d{4}$```该正则表达式包括以下部分:- `^ISBN-13:` 是字符串的开始,表示 ISBN 号的开头。

- `s*` 表示可以出现 0 个或多个空格。

- `d{9}` 表示 9 个数字,表示 ISBN 号的前 9 位。

- `-` 表示一个短横线。

- `d{3}` 表示 3 个数字,表示 ISBN 号的第 4 到第 6 位。

- `-` 表示一个短横线。

- `d{4}` 表示 4 个数字,表示 ISBN 号的最后 4 位。

- `$` 是字符串的结尾,表示 ISBN 号的结尾。

该正则表达式可以用于验证 ISBN 号是否符合格式要求,也可以用于自动生成 ISBN 号。

生成 ISBN 号的示例代码 (Python)以下是一个 Python 示例代码,用于生成符合格式要求的 ISBN 号:```pythonimport redef generate_isbn13():# 生成 9 位数字num = "".join(str(i) for i in range(1, 10))# 在数字中插入短横线num = num.replace(str(i), str(i) + "-")# 检查数字是否符合 ISBN 格式if re.match(r"^ISBN-13:s*d{9}-d{3}-d{4}$", num):return numelse:return None# 生成 ISBN 号isbn = generate_isbn13()print("ISBN:", isbn)```输出结果:```ISBN: 978-1-234-5678-90-1```结论使用正则表达式可以方便地生成符合格式要求的 ISBN 号,可以节省手动输入 ISBN 号的时间和精力。

介绍gerrit的书籍

介绍gerrit的书籍

介绍gerrit的书籍Gerrit是一个基于开源的Web代码审查工具,一直以来被广泛用于软件开发团队中。

它为开发人员提供了一种方便有效的方法来进行代码审查和版本控制,从而帮助团队提高代码质量和团队协作效率。

有关Gerrit的详细信息,可以在很多书籍中找到。

下面我将逐步介绍几本关于Gerrit的书籍。

1. 《Gerrit Code Review:An Introduction and Concept Guide》这本书由Matthew McCullough撰写,是一本关于Gerrit使用和观念的入门指南。

它首先介绍了Gerrit的基本概念和工作原理,然后详细解释了如何在不同开发环境中安装和配置Gerrit。

书中还包含了一些常用的代码审查和版本控制技术,以及如何在团队中使用Gerrit进行协作和代码管理的最佳实践。

这本书适合那些想要快速了解和上手Gerrit的开发人员和团队。

2. 《Gerrit Cookbook: Over 60 recipes to help you learn and master Gerrit code-review system》这本书由Luca Milanesio和Marco Miller共同撰写,是一本面向开发人员的Gerrit代码审查系统的实用指南。

它提供了60多个实用的Gerrit技巧和技术,帮助读者熟悉Gerrit的各种功能和扩展。

书中通过一系列具体的示例和解决方案,详细介绍了如何配置Gerrit服务器、创建和管理代码审查任务、处理冲突和合并请求等常见操作。

这本书适合具有一定Gerrit 基础知识的开发人员,希望进一步提高他们在代码审查中的技能和效率。

3. 《Gerrit Handbook: The Definitive Guide to Gerrit Code Review》这本书由Sharma Rawat撰写,是一本涵盖Gerrit Code Review的综合指南。

IDEA 插件 Easycode代码生成器详解

IDEA 插件 Easycode代码生成器详解

IDEA 插件Easycode代码生成器详解介绍Easycode是idea的一个插件,可以直接对数据的表生成entity,controller,service,dao,mapper,无需任何编码,减少了开发人员的工作量,同时提高了工作效率。

使用介绍:1. 安装Easycode插件如上图所示,我已经安装好了,若不知道IDEA怎么安装插件可参考《IDEA常用插件简单安装步骤详解》注:建议大家在安装一个插件,叫做Lombok。

Lombok能通过注解的方式,在编译时自动为属性生成构造器、getter/setter、equals、hashcode、toString方法。

出现的神奇就是在源码中没有getter和setter方法,但是在编译生成的字节码文件中有getter和setter方法。

2. 建立数据库-- ------------------------------ Table structure for user-- ----------------------------DROP TABLE IF EXISTS `user`;CREATE TABLE `user` (`id` int(11) NOT NULL,`username` varchar(20) DEFAULT NULL,`sex` varchar(6) DEFAULT NULL,`birthday` date DEFAULT NULL,`address` varchar(20) DEFAULT NULL,`password` varchar(20) DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;SET FOREIGN_KEY_CHECKS = 1;3.在IDEA上配置数据库连接注:先建立一个springboot项目,项目建好之后,找到右边窗口的Database,如下图所示:然后按照下图步骤操作:Normal 07.8 磅2falsefalsefalseEN-USZH-CNX-NONE/* Style Definitions */table.MsoNormalTable{mso-style-name:普通表格;mso-tstyle-rowband-size:0;mso-tstyle-colband-size:0;mso-style-noshow:yes;mso-style-priority:99;mso-style-parent:”“;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-para-margin:0cm;mso-para-margin-bottom:.0001pt;mso-pagination:widow-orphan;font-size:10.5pt;mso-bidi-font-size:11.0pt;font-family:等线;mso-ascii-font-family:等线;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:等线;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:等线;mso-hansi-theme-font:minor-latin;mso-font-kerning:1.0pt;}填写数据库名字,用户名,密码。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

A Comprehensive Codebook Generator Naoko S. Stearns, Research Triangle Institute; RTP, NC John R. Gerlach, IMS America; Plymouth Meeting, PAAbstractA recent project at Research Triangle Institute (RTI) involved a large transportation survey that required validating and packaging of the data, in the form of ASCII text files and SAS data sets, for use by the public domain. In addition, a detailed codebook was produced for each edited file, which included a frequency distribution for categorical data and descriptive statistics for continuous data, along with the usual information concerning data attributes.In order to facilitate the process of generating a codebook for each edited file, RTI developed a SAS application that allowed those people involved with the project to produce the codebook independently. Upon creating the codebook listing, the member of the project team, or end-user, would export the listing from SAS creating a RTF (Rich Text Format) file, then, import the RTF file into a Word document producing the finished deliverable. This paper explains the SAS solution that generates the codebooks for a large survey project.The ProcessThe transportation survey consists of many pages of raw data that produces different files consisting of 3,000 to 400,000 records and 30 to over 200 variables. Each file requires many validation checks that begin the rigorous task of cleaning the data. Once the data have been validated, two deliverable files are produced: an ASCII text file and a SAS data set. Finally, an in-house SAS application creates a detailed codebook representing the deliverable files.The In-house ApplicationThe codebook generator developed for the transportation survey project consists of several SAS programs: a driver program that allows the end-user to specify options and user-specified information stored in a CARDS statement and a format library; a program that creates the SAS data set representing the codebook; and, a report generator that produces the final product.Typical of most projects, the in-house application contains many unique specifications that might complicate the scope of this paper, as well as exceed its preferred format. Consequently, the options and driver programs are not discussed. Rather, this paper expounds on the idea of including actual values or ranges with respective frequencies along with the usual information found in codebooks, namely the dataattributes (e.g., type and length).Several RequisitesThe main program requires two end-usersources, as well as the edited (validated) file. One source indicates the type of analysis for each variable, that is,whether the application computes ranges as well as a frequency, depending on the nature of the variable, suchas categorical and continuous data, rather than nominaldata such as an ID number or zip code. The codebook generator at RTI obtains this information via a CARDSstatement located in the driver program. The in-streamdata consists of four fields denoting type of analysis (1,2,or 3), the variable identifier, the associated format, and a possible special code. Consider the following illustration.cards;1 WKBYAUTO $YORN.1 WKBYVAN $YORN.2 HOUSEID HOUSEID.2 TIMETOWK TIMET. 9942 PARKAMNT PRKAMT. 99943 STFIPS3 MSA< more data >;Also, the end-user needs to define a formatlibrary, as appropriate, which the application uses inorder to list discrete and range values, along with their respective meaning. Consider the following example.proc format cntlout=fmtdata(keep=fmtname start label);value $yorn ‘01’ = ‘01 = Yes’‘02’ = ‘02 = No’‘94’ = ‘94 = Legitimate Skip’‘98’ = ‘98 = Not Ascertained’‘99’ = ‘99 = Refused’;value houseid other = ‘ ‘;value timet other = ‘ ‘994 = ‘994 = Legitimate Skip’998 = ‘998 = Not Ascertained’999 = ‘999 = Refused’;value prkamt other = ‘ ‘9994 = ‘9994 = Legitimate Skip’9998 = ‘9998 = Not Ascertained’9999 = ‘9999 = Refused’;run;Applications DevelopmentGiven both end-user specified sources and the edited data file, the codebook program produces a very comprehensive codebook that exceeds the usual listing of data attributes.The ReportThe codebook report consists of the variable name, the data type, the length of its internal value, the label, and the values along with respective frequencies. The values listed in the report depends on how the user defines the variable, either as discrete, continuous, or as nominal data. Consequently, the codebook generator uses one of three computing methods for each variable, depending on what the user specified as appropriate. Also, the macros %freq, %range, and %charange perform the specified task.Cetegorical VariablesCategorical variables denote distinct groups or levels that can be stored as either numeric or character variables. Regardless of data type, the RTI codebook generator produces a frequency distribution based on the formatted values of the variable. The macro %freqs performs this task.Continuous Numeric VariablesAge, time, and income illustrate continuous data often found in surveys. For these variables, the codebook generator computes frequencies based on a format that denotes special values (e.g., 998, 999) or other, which represents nonmissing values. Then, it computes the minimum and maximum range of the variable, replacing the other category with that range. For this scenario, the macros %freq and %ranges accomplish the task. Nominal DataConsider the numeric variable denoting a household identifier, which emulates a continuous numeric variable. In this case, the codebook generator treats the variable as it would any other such variable. Obviously, however, you do not want to see every unique value listed, having a frequency of one occurrence. To avoid that from happening, the user specifies a format so that there is only one level of other category, if there are no missing values. Then, the %ranges macro computes the minimum and maximum values, superseding the nonmissing value with that range. The process requires a different approach for character data, hence, the macro %charange.The Macro %freqsInitially, the FREQ procedure creates an output data set that contains those values stored by the variable along with the respective frequencies. Then, utilizing the respective format for each variable, the CNTLOUT option of the FORMAT procedure creates the data set temp, which ensures that all possible values are represented,not only those found in the data. A subsequent Data step creates the so-called filler data set depending on the typeof format, either character or numeric.%macro freqs;proc freq data=&dslib..&indsn.;%do i = 1 %to &fn.;tables &&fv&i. / list missing noprintout=frq&i.(keep=&&fv&i. count);format &&fv&i. &&ff&i.;%end;run;%do i = 1 %to &fn.;proc format cntlout=temp(keep=startrename=(start=&&fv&i.));select &&fe&i.;run;%if “%substr(&&fe&i.,1,1)” eq “$”%then %do;data temp;retain count 0;set temp;run;%end;%else %do;data temp;retain count 0;set temp(rename=(&&fv&i.=dummy));&&fv&i. = input(dummy,??best16.);if &&fv.&i. eq .then delete;drop dummy;run;%end;data frq&i.;set frq&i.;contodr = _n_;run;data temp;set temp;contodr = _n_;run;proc sort data=frq&i.;by &&fv&i. contodr;run;proc sort data=temp;by &&fv&i. contodr;run;The following merge creates a data setrepresenting all values, even those having a frequency ofzero. Thus, each variable has a respective data set thatcontains formatted values with it frequency of occurrence.data frq&i.;merge temp frq&i.(drop=contodr);by &&fv&i.;run;data frq&i.(drop=&&fv&i.);retain name ‘ ‘;set frq&i.;call vname(&&fv&i.,name);run;%end;The following code concatenates the frequencydata sets into a single data set. Then, the data set cbvlistthat contains the user-specified information for eachvariable contributes the format name of each variablerequired for an equi-join using the SQL procedure. A finalmerge of the data sets freqdata and fmtdata producesthe desired comprehensive data set.Applications Developmentdata freqdata;set %do i = 1 %to &fn.; frq&i. %end; ;run;proc sort data=cbvlist;by name;run;proc sort data=freqdata;by name contodr;run;data freqdata;merge freqdata(in=a) cbvlist;by name;if a;run;proc sort data=cbvlist;by fmtname;run;proc sort data=fmtdata;by fmtname labodr;run;proc sql;create table fmtdata asselect , bel, blodr,cb.fmtnamefrom cbvlist cb, fmtdata fmwhere cb.fmtname eq fm.fmtname;quit;data freqdata;merge freqdata(in=a) fmtdata;by name fmtname;if a;run;%mend freqs;The Macro %rangesFor each continuous numeric variable, the MEANS procedure creates an output data set that contains its minimum and maximum value, and, the subsequent Data step creates the variable name that identifies the analysis variable. Then, another Data step concatenates those data sets and creates the variable label that denotes the range of each analysis variable. Finally, the data set is sorted by the variable name.%macro ranges;%do i = 1 %to &mn.;proc means data=&dslib..&indsn.(keep=&&mv.&i. %if &&scv&i. ne . %thenwhere=(&&mv&i. lt &&scv&i.); )noprint;var &&mv&i.;output out=rang&i.(drop=_type__freq_ min=min max=max;run;data rang&i.;length name $8;set rang&i.;name = “%upcase(&&mv&i.)”;run;%end;data rangdata;set %do i = 1 %to &mn.; rang&i. %end;label = ‘(‘ || trim(left(put(min,13.))) || ‘-‘ || trim(left(put(max,13.))) || ‘)’; run;proc sort data=rangdata;by name;run;%mend ranges;The Macro %charangeThe macro %charange deals with nominal,character type data. First, the macro sorts the data setby the variable of interest. Then, the following Data stepobtains the first and last values, storing them in thevariables min and max, respectively. Similar to the%range macro, another Data step concatenates theseveral data sets and creates the variable label thatdenotes the ‘range’ of each variable. Finally, the data setis sorted by the variable name.%macro charange;%do i = 1 %to &cn.;proc sort data=&section..&indsn.(keep=&&cv&i. where=((&&cv&i. ne ‘’) and&&cv&i. ne ‘none’))) out=chrange&i.;by &&cv&i.;run;data chrang&i.;length name $8 min max $13;set chrang&i. end=eof;by &&cv&i.;retain min;name = “%upcase(&&cv&i.)”;if _n_ eq 1 then min = &&cv&i.;if eof then do;max = &&cv&i.;output;end;run;%end;data chrang;drop min max;set %do = 1 %to &cn.;chrang&i. %end; ;label = ‘(‘ || min || ‘ - ‘ ||max || ‘)’;run;proc sort data=chrang;by name;run;%mend charange;The Methods CombinedGiven the validated data, the format library, andthe user-specified method for computing frequencies, themacros %freq, %range, and %charange produce a dataset containing the formatted values or ranges, along withthe respective frequencies. Then, the several data setsare merged together by the common variable name toproduce the data set used for reporting, as follows.data dict.&outdsn.;merge freqdata rangdata chrang;by name;run;The ResultThe REPORT procedure produces the actual codebook, which is part of the driver portion of the RTIcodebook generator. The column attributes include: thevariable name, label, code denoting value, and thefrequency of occurrence. The partial output below liststhe frequencies in juxtaposition with the formatted values,not usually found in most codebooks.Applications DevelopmentTargetVariable Value Range Freqs WKBYAUTO 01 = Yes 8,77202 = No 3,15294 = Legitimate Skip 13,04898 = Not Ascertained 999 = Refused 0 WKBYVAN 01 = Yes 37802 = No 11,54494 = Legitimate Skip 13,04898 = Not Ascertained 1199 = Refused 0 HOUSEID (1200302 - 1280295) 24,981 TIMETOWK (0 - 600) 11,751994 = Legitimate Skip 13,048998 = Not Ascertained 172999 = Refused 10 PARKAMNT (0 – 850) 7669994 = Legitimate Skip 24,2119998 = Not Ascertained 49999 = Refused 0STFIPS (05 - 51 ) .MSA (0000 - 8880 ) .CaveatThe label portion of a user-specified format includes the value being formatted. For example, the numeric format GENDF might be defined as follows:proc format;value gendf 1 = ‘1 = Male’2 = ‘2 = Female’94 = ‘94 = Legitimate Skip’95 = ‘95 = Not Ascertained’99 = ‘99 = Refused’;run;Thus, the application utilizes tailor made formats. One alternative would be to export an existing format, modify the label to include the actual value, then create a revised format that is more suitable to the application. Consider the following SAS code that modifies the format GENDF. proc format cntlout=gendf;select gendf;run;data gendf;length label $50;set gendf;if start eq endthen label=trim(start) || ‘ = ’ || label; else label=trim(start) || ‘-‘ ||trim(end) || ‘ = ’ || label;run;proc format cntlin=gendf;run;ConclusionThe following code produces a typical codebook using the SQL procedure and Dictionary tables. However, the report does not contain information made available using the RTI codebook generator, which includes actual frequencies of formatted values or rangeof values, as specified by the user, depending on thenature of the data.%macro codebook(lib=WORK,memtype=DATA);options number pageno=1;proc sql;create table _codebk_ asselect memname label='Data Set', namelabel='Variable', upcase(type) as typelabel='Type', length label='Length',label label='Label', formatlabel='Format', informatlabel='Informat'from dictionary.columnswhere libname = "%upcase(&lib.)" andmemtype = "%upcase(&memtype.)";quit;proc print data=_codebk_ label;id memname;by memname;where memname ne '_CODEBK_';title "Codebook of %upcase(&lib.)”;run;%mend codebook;Author InformationNaoko S. StearnsResearch Triangle InstituteResearch Triangle Park, NC 27709-2194919.541.7369John R. GerlachIMS America600 West Germantown PikePlymouth Meeting, PA 19462-1048610.832.5493SAS is a registered trademark of SAS Institute.Applications Development。

相关文档
最新文档