⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 des_enc.m4

📁 OpenSSL 0.9.8k 最新版OpenSSL
💻 M4
📖 第 1 页 / 共 4 页
字号:
	ld	[out3+local0], local0	xor	$2, local4, $2	and	local2, 252, local2	ld	[global1+local1], local1	xor	$2, local5, $2            ! 6 finished local5 used	ld	[global3+local2], local2	srl	$1, 3, local3	xor	$2, local0, $2	ifelse($6,{}, {}, {ld	[$6+4], out1}) ! key next encryption/decryption	sll	$1, 29, local4	xor	$2, local1, $2	ifelse($7,{}, {}, {retl})	xor	$2, local2, $2})! {fp_macro}!!  parameter 1   right (original left)!  parameter 2   left (original right)!  parameter 3   1 for optional store to [in0]!  parameter 4   1 for load input/output address to local5/7!!  The final permutation logic switches the halfes, meaning that!  left and right ends up the the registers originally used.define(fp_macro, {! {fp_macro}! $1 $2 $3 $4 $5 $6 $7 $8 $9	! initially undo the rotate 3 left done after initial permutation	! original left is received shifted 3 right and 29 left in local3/4	sll	$2, 29, local1	or	local3, local4, $1	srl	$2, 3, $2	sethi	%hi(0x55555555), local2	or	$2, local1, $2	or	local2, %lo(0x55555555), local2	srl	$2, 1, local3	sethi	%hi(0x00ff00ff), local1	xor	local3, $1, local3	or	local1, %lo(0x00ff00ff), local1	and	local3, local2, local3	sethi	%hi(0x33333333), local4	sll	local3, 1, local2	xor	$1, local3, $1	srl	$1, 8, local3	xor	$2, local2, $2	xor	local3, $2, local3	or	local4, %lo(0x33333333), local4	and	local3, local1, local3	sethi	%hi(0x0000ffff), local1	sll	local3, 8, local2	xor	$2, local3, $2	srl	$2, 2, local3	xor	$1, local2, $1	xor	local3, $1, local3	or	local1, %lo(0x0000ffff), local1	and	local3, local4, local3	sethi	%hi(0x0f0f0f0f), local4	sll	local3, 2, local2	ifelse($4,1, {LDPTR INPUT, local5})	xor	$1, local3, $1	ifelse($4,1, {LDPTR OUTPUT, local7})	srl	$1, 16, local3	xor	$2, local2, $2	xor	local3, $2, local3	or	local4, %lo(0x0f0f0f0f), local4	and	local3, local1, local3	sll	local3, 16, local2	xor	$2, local3, local1	srl	local1, 4, local3	xor	$1, local2, $1	xor	local3, $1, local3	and	local3, local4, local3	sll	local3, 4, local2	xor	$1, local3, $1	! optional store:	ifelse($3,1, {st $1, [in0]})	xor	local1, local2, $2	ifelse($3,1, {st $2, [in0+4]})})! {fp_ip_macro}!! Does initial permutation for next block mixed with! final permutation for current block.!! parameter 1   original left! parameter 2   original right! parameter 3   left ip! parameter 4   right ip! parameter 5   1: load ks1/ks2 to in3/in4, add 120 to in4!                2: mov in4 to in3!! also adds -8 to length in2 and loads loop counter to out4define(fp_ip_macro, {! {fp_ip_macro}! $1 $2 $3 $4 $5 $6 $7 $8 $9	define({temp1},{out4})	define({temp2},{local3})	define({ip1},{local1})	define({ip2},{local2})	define({ip4},{local4})	define({ip5},{local5})	! $1 in local3, local4	ld	[out2+256], ip1	sll	out5, 29, temp1	or	local3, local4, $1	srl	out5, 3, $2	ifelse($5,2,{mov in4, in3})	ld	[out2+272], ip5	srl	$4, 4, local0	or	$2, temp1, $2	srl	$2, 1, temp1	xor	temp1, $1, temp1	and	temp1, ip5, temp1	xor	local0, $3, local0	sll	temp1, 1, temp2	xor	$1, temp1, $1	and	local0, ip1, local0	add	in2, -8, in2	sll	local0, 4, local7	xor	$3, local0, $3	ld	[out2+268], ip4	srl	$1, 8, temp1	xor	$2, temp2, $2	ld	[out2+260], ip2	srl	$3, 16, local0	xor	$4, local7, $4	xor	temp1, $2, temp1	xor	local0, $4, local0	and	temp1, ip4, temp1	and	local0, ip2, local0	sll	temp1, 8, temp2	xor	$2, temp1, $2	sll	local0, 16, local7	xor	$4, local0, $4	srl	$2, 2, temp1	xor	$1, temp2, $1	ld	[out2+264], temp2         ! ip3	srl	$4, 2, local0	xor	$3, local7, $3	xor	temp1, $1, temp1	xor	local0, $3, local0	and	temp1, temp2, temp1	and	local0, temp2, local0	sll	temp1, 2, temp2	xor	$1, temp1, $1	sll	local0, 2, local7	xor	$3, local0, $3	srl	$1, 16, temp1	xor	$2, temp2, $2	srl	$3, 8, local0	xor	$4, local7, $4	xor	temp1, $2, temp1	xor	local0, $4, local0	and	temp1, ip2, temp1	and	local0, ip4, local0	sll	temp1, 16, temp2	xor	$2, temp1, local4	sll	local0, 8, local7	xor	$4, local0, $4	srl	$4, 1, local0	xor	$3, local7, $3	srl	local4, 4, temp1	xor	local0, $3, local0	xor	$1, temp2, $1	and	local0, ip5, local0	sll	local0, 1, local7	xor	temp1, $1, temp1	xor	$3, local0, $3	xor	$4, local7, $4	sll	$3, 3, local5	and	temp1, ip1, temp1	sll	temp1, 4, temp2	xor	$1, temp1, $1	ifelse($5,1,{LDPTR	KS2, in4})	sll	$4, 3, local2	xor	local4, temp2, $2	! reload since used as temporar:	ld	[out2+280], out4          ! loop counter	srl	$3, 29, local0	ifelse($5,1,{add in4, 120, in4})	ifelse($5,1,{LDPTR	KS1, in3})	srl	$4, 29, local7	or	local0, local5, $4	or	local2, local7, $3})! {load_little_endian}!! parameter 1  address! parameter 2  destination left! parameter 3  destination right! parameter 4  temporar! parameter 5  labeldefine(load_little_endian, {! {load_little_endian}! $1 $2 $3 $4 $5 $6 $7 $8 $9	! first in memory to rightmost in register#ifdef OPENSSL_SYSNAME_ULTRASPARC	andcc	$1, 3, global0	bne,pn	%icc, $5	nop	lda	[$1] 0x88, $2	add	$1, 4, $4	ba,pt	%icc, $5a	lda	[$4] 0x88, $3#endif$5:	ldub	[$1+3], $2	ldub	[$1+2], $4	sll	$2, 8, $2	or	$2, $4, $2	ldub	[$1+1], $4	sll	$2, 8, $2	or	$2, $4, $2	ldub	[$1+0], $4	sll	$2, 8, $2	or	$2, $4, $2	ldub	[$1+3+4], $3	ldub	[$1+2+4], $4	sll	$3, 8, $3	or	$3, $4, $3	ldub	[$1+1+4], $4	sll	$3, 8, $3	or	$3, $4, $3	ldub	[$1+0+4], $4	sll	$3, 8, $3	or	$3, $4, $3$5a:})! {load_little_endian_inc}!! parameter 1  address! parameter 2  destination left! parameter 3  destination right! parameter 4  temporar! parameter 4  label!! adds 8 to addressdefine(load_little_endian_inc, {! {load_little_endian_inc}! $1 $2 $3 $4 $5 $6 $7 $8 $9	! first in memory to rightmost in register#ifdef OPENSSL_SYSNAME_ULTRASPARC	andcc	$1, 3, global0	bne,pn	%icc, $5	nop	lda	[$1] 0x88, $2	add	$1, 4, $1	lda	[$1] 0x88, $3	ba,pt	%icc, $5a	add	$1, 4, $1#endif$5:	ldub	[$1+3], $2	ldub	[$1+2], $4	sll	$2, 8, $2	or	$2, $4, $2	ldub	[$1+1], $4	sll	$2, 8, $2	or	$2, $4, $2	ldub	[$1+0], $4	sll	$2, 8, $2	or	$2, $4, $2	ldub	[$1+3+4], $3	add	$1, 8, $1	ldub	[$1+2+4-8], $4	sll	$3, 8, $3	or	$3, $4, $3	ldub	[$1+1+4-8], $4	sll	$3, 8, $3	or	$3, $4, $3	ldub	[$1+0+4-8], $4	sll	$3, 8, $3	or	$3, $4, $3$5a:})! {load_n_bytes}!! Loads 1 to 7 bytes little endian! Remaining bytes are zeroed.!! parameter 1  address! parameter 2  length! parameter 3  destination register left! parameter 4  destination register right! parameter 5  temp! parameter 6  temp2! parameter 7  label! parameter 8  return labeldefine(load_n_bytes, {! {load_n_bytes}! $1 $2 $5 $6 $7 $8 $7 $8 $9$7.0:	call	.+8	sll	$2, 2, $6	add	%o7,$7.jmp.table-$7.0,$5	add	$5, $6, $5	mov	0, $4	ld	[$5], $5	jmp	%o7+$5	mov	0, $3$7.7:	ldub	[$1+6], $5	sll	$5, 16, $5	or	$3, $5, $3$7.6:	ldub	[$1+5], $5	sll	$5, 8, $5	or	$3, $5, $3$7.5:	ldub	[$1+4], $5	or	$3, $5, $3$7.4:	ldub	[$1+3], $5	sll	$5, 24, $5	or	$4, $5, $4$7.3:	ldub	[$1+2], $5	sll	$5, 16, $5	or	$4, $5, $4$7.2:	ldub	[$1+1], $5	sll	$5, 8, $5	or	$4, $5, $4$7.1:	ldub	[$1+0], $5	ba	$8	or	$4, $5, $4	.align 4$7.jmp.table:	.word	0	.word	$7.1-$7.0	.word	$7.2-$7.0	.word	$7.3-$7.0	.word	$7.4-$7.0	.word	$7.5-$7.0	.word	$7.6-$7.0	.word	$7.7-$7.0})! {store_little_endian}!! parameter 1  address! parameter 2  source left! parameter 3  source right! parameter 4  temporardefine(store_little_endian, {! {store_little_endian}! $1 $2 $3 $4 $5 $6 $7 $8 $9	! rightmost in register to first in memory#ifdef OPENSSL_SYSNAME_ULTRASPARC	andcc	$1, 3, global0	bne,pn	%icc, $5	nop	sta	$2, [$1] 0x88	add	$1, 4, $4	ba,pt	%icc, $5a	sta	$3, [$4] 0x88#endif$5:	and	$2, 255, $4	stub	$4, [$1+0]	srl	$2, 8, $4	and	$4, 255, $4	stub	$4, [$1+1]	srl	$2, 16, $4	and	$4, 255, $4	stub	$4, [$1+2]	srl	$2, 24, $4	stub	$4, [$1+3]	and	$3, 255, $4	stub	$4, [$1+0+4]	srl	$3, 8, $4	and	$4, 255, $4	stub	$4, [$1+1+4]	srl	$3, 16, $4	and	$4, 255, $4	stub	$4, [$1+2+4]	srl	$3, 24, $4	stub	$4, [$1+3+4]$5a:})! {store_n_bytes}!! Stores 1 to 7 bytes little endian!! parameter 1  address! parameter 2  length! parameter 3  source register left! parameter 4  source register right! parameter 5  temp! parameter 6  temp2! parameter 7  label! parameter 8  return labeldefine(store_n_bytes, {! {store_n_bytes}! $1 $2 $5 $6 $7 $8 $7 $8 $9

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -