-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to make the size of Cipher consistent between 32 and 64 bit machine? #20
Comments
Which |
When creating an instance of Cipher, there are so many layers of objects(depending on the features chosen), which hide some |
Like these? Why do they become a problem? |
Yeah, like the |
Why are these |
I first designed it to construct the |
Hmm... That is a very strange design. Maybe you should just create a |
That's actually the secure part of WASM where it is not allowed to visit arbitrary memory in the host, and the memory it can visit is a chunk of linear memory that the host has allocated for it (size in page). The current solution I have is to let the WASM construct the |
I just take a look at those const variables in these cipher structs, they all have relatively small value, such as key's kength, iv's length, block's length, ... so it shouldn't be a problem if In most cases, you could just ignore those const values, because they are not actually used in the internal implementation. |
I've noticed that there are quite some
usize
typed variables being used(which will be in size 4bytes in a 32bit machine, and 8bytes in a 64bit machine), and I was trying to change some of them myself, but I realized that there are too many layers, and the size of the constructed object just cannot be aligned between 32bit and 64bit machine. Is there a faster way to force one into another?The text was updated successfully, but these errors were encountered: