Comments (3)
Hi @seceng-jan
Thanks for trying the code and reporting this.
I honestly don't think that this is an issue. If you take a look at the NIST 800-38D, you will notice that the AAD is formed with the number of data to authenticate and a padding of zeros to reach the block size.
...In Steps 4 and 5, the AAD and the ciphertext are each appended with the minimum number of ‘0’ bits, possibly none, so that the bit lengths of the resulting strings are multiples of the block size.
This means that the user should supply the AAD already padded.
The reason why this doesn't happen for the data, is because I wrongly masked them.
In file gcm_gctr.vhd
line 162:
gctr_data_out <= (gctr_data_in_i xor aes_ecb_data) and gctr_data_mask;
should actually be:
gctr_data_out <= gctr_data_in_i xor (aes_ecb_data and gctr_data_mask);
Hope this makes sense.
Luca
from aes-gcm-128-192-256-bits.
Hi Luca!
Thanks for the response. That does make sense. If you like, you can close this issue - don't know if you want to change gcm_gctr.vhd
first.
Best regards,
Jan
from aes-gcm-128-192-256-bits.
Although this wasn't an issue, I preferred to add the logic that masks the AAD and Data that are supplied to the GHASH block. This will avoid other users to end up into this issue.
Commit can be found here
from aes-gcm-128-192-256-bits.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aes-gcm-128-192-256-bits.