nsacyber / simon-speck Goto Github PK
View Code? Open in Web Editor NEWThe SIMON and SPECK families of lightweight block ciphers. #nsacyber
Home Page: https://nsacyber.github.io/simon-speck/
License: Other
The SIMON and SPECK families of lightweight block ciphers. #nsacyber
Home Page: https://nsacyber.github.io/simon-speck/
License: Other
It appears that the Speck6496KeySchedule as shown in the implementation guide tries to save a round key at an index that is out of bounds. This version of the Speck cipher has 26 rounds, which requires equally many round keys. The key schedules last assignment rk[i]=A;
is for index 26, the 27th round key.
This instruction shouldn't be there, all required round keys have already been generated.
Version from the "SIMON and SPECK Implementation Guide" [0]:
void Speck6496KeySchedule(u32 K[],u32 rk[])
{
u32 i,C=K[2],B=K[1],A=K[0];
for(i=0;i<26;){
rk[i]=A; ER32(B,A,i++);
rk[i]=A; ER32(C,A,i++);
}
rk[i]=A;
}
Fixed version:
void Speck6496KeySchedule(u32 K[],u32 rk[])
{
u32 i,C=K[2],B=K[1],A=K[0];
for(i=0;i<26;){
rk[i]=A; ER32(B,A,i++);
rk[i]=A; ER32(C,A,i++);
}
}
[0] R. Beaulieu, D. Shors, J. Smith, S. Treatman-Clark, B. Weeks and L. Wingers,
"SIMON and SPECK Implementation Guide", NSA Cybersecurity, June 26, 2018. [Online].
Available: https://nsacyber.github.io/simon-speck/implementations/ImplementationGuide1.1.pdf
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.