Skip to content

Commit 827ab99

Browse files
committed
upd
1 parent 8748095 commit 827ab99

42 files changed

Lines changed: 1148 additions & 744 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
-824 Bytes
Binary file not shown.
-824 Bytes
Binary file not shown.

os/linux/arm64/crypto/speck/test

3.27 KB
Binary file not shown.

os/linux/arm64/crypto/speck/test.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,27 @@ uint8_t plain128[]=
5050

5151
uint64_t cipher128[2] = {0x4eeeb48d9c188f43, 0x4109010405c0f53e};
5252

53+
#define R(v,n)(((v)>>(n))|((v)<<(64-(n))))
54+
#define F(n)for(i=0;i<n;i++)
55+
typedef unsigned long long W;
56+
57+
void speck128x(void*mk,void*in){
58+
W i,t,k[4],r[2];
59+
60+
memcpy(r,in,16);
61+
memcpy(k,mk,32);
62+
63+
F(34)
64+
r[1]=(R(r[1],8)+*r)^*k,
65+
*r=R(*r,61)^r[1],
66+
t=k[3],
67+
k[3]=(R(k[1],8)+*k)^i,
68+
*k=R(*k,61)^k[3],
69+
k[1]=k[2],k[2]=t;
70+
71+
memcpy(in,r,16);
72+
}
73+
5374
int main (void)
5475
{
5576
uint64_t buf[4];
@@ -71,7 +92,7 @@ int main (void)
7192
// copy plain text to local buffer
7293
memcpy (buf, plain128, sizeof(plain128));
7394

74-
speck128(key128, buf);
95+
speck128x(key128, buf);
7596

7697
equ = memcmp(cipher128, buf, sizeof(cipher128))==0;
7798

os/linux/arm64/execve.s.html

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)