Comments (9)
I am not sure how to refactor Hash.hs
and MAC.hs
for the new Gadget interface. Can you give some guide lines for the same.
from raaz.
On Tue, Aug 20, 2013 at 04:07:35AM -0700, satvikc wrote:
I am not sure how to refactor
Hash.hs
andMAC.hs
for the new Gadget interface. Can you give some guide lines for the same.
We can discuss this in person sometime.
Regards
ppk
from raaz.
I have rewritten the Hash and MAC but I ran into few problems
- I am not sure how to define
finalize
forHMAC g
as I require outer pad and I have no way of getting that fromHMAC g
. - Also I had to add a function
reInitialize :: g -> PrimitiveOf g -> IV (PrimitiveOf g)
inHashGadget
to make rest of the HMAC work.
You can look at the code here
from raaz.
On Thu, Aug 22, 2013 at 11:39:58AM -0700, satvikc wrote:
I have rewritten the Hash and MAC but I ran into few problems
- I am not sure how to define
finalize
forHMAC g
as I require outer pad and I have no way of getting that fromHMAC g
.
Define IV (HMAC h) = (IV h, IV h)
The IV (HMAC h) should be (IV h, IV h). The first IV h is for the
inner pad (i.e. hash of the inner pad) and the second for the IV of
the outer pad. You might need to store the IV h inside a memory
element so you might need some storable or something like that
instance.
Regards
ppk
from raaz.
the type of finalize is g -> IO (PrimitiveOf g
. And I have no way of
inspecting the memory component of g.
On Fri, Aug 23, 2013 at 10:14 AM, Piyush P Kurur
[email protected]:
On Thu, Aug 22, 2013 at 11:39:58AM -0700, satvikc wrote:
I have rewritten the Hash and MAC but I ran into few problems
- I am not sure how to define
finalize
forHMAC g
as I require outer
pad and I have no way of getting that fromHMAC g
.Define IV (HMAC h) = (IV h, IV h)
The IV (HMAC h) should be (IV h, IV h). The first IV h is for the
inner pad (i.e. hash of the inner pad) and the second for the IV of
the outer pad. You might need to store the IV h inside a memory
element so you might need some storable or something like that
instance.Regards
ppk
—
Reply to this email directly or view it on GitHubhttps://github.com/piyush-kurur/raaz/issues/54#issuecomment-23143189
.
Satvik Chauhan
Fourth Year Under Graduate Student
Deptt. of Computer Science and Engineering
Indian Institute of Technology Kanpur
Kanpur-208016, INDIA
Email: [email protected] , [email protected]
from raaz.
CryptoArray doesn't have a memory instance.
MemoryOf g
has Memory typeclass constraint, so I can put neither CryptoArray nor ForeignCryptoPtr directly into MemoryOf (HMACGadget g)
. The only solution which I could think of is to define a newtype with a Memory instance.
from raaz.
I have refactored the code using the above solution. I am not sure how to solve the following error from
instance CryptoPrimitive p => CryptoPrimitive (HMAC p) where
type Recommended (HMAC p) = HMAC (Recommended p)
type Reference (HMAC p) = HMAC (Reference p)
Raaz/Primitives/Hash.hs:250:10:
Could not deduce (PrimitiveOf (HMAC (Recommended p)) ~ HMAC p)
from the context (CryptoPrimitive p)
bound by the instance declaration
at Raaz/Primitives/Hash.hs:250:10-54
In the instance declaration for `CryptoPrimitive (HMAC p)'
Adding that to the type forces to use undecidableinstances which I dont want to use.
from raaz.
I have refactored the code but tests are failing. I am not sure where the bug is. But it is happening because of some garbage as the hash on the same string is giving different values each time.
from raaz.
The interface is no more relevant I am closing this issue
from raaz.
Related Issues (20)
- Uploading candidate release onto Debian experimental HOT 34
- 32-bit windows build fails on appveyor HOT 7
- Getting rid of unwanted files HOT 1
- Platform czars for raaz HOT 3
- Automatically run and check examples embedded in haddock
- Entropy and randomness quality tests.
- Backpack based modules HOT 1
- travis get random flags HOT 1
- Fix appveyor to build against 32-bit windows as well HOT 2
- Integrate standard test vectors.
- Integration of primitives from libverse HOT 1
- Raaz executable segfaults HOT 4
- Installation via Stack HOT 2
- Almost non-existent haddock documentation with the backpack based design HOT 2
- Use windows NUL file for /dev/null in the test for empty reads
- Apache 2.0 licensing HOT 9
- XChaCha20 variant HOT 2
- Use explicit_bzero and friends HOT 2
- upload `2.2` to hackage HOT 9
- Poly1305 tests based on inbuilt haskell `Integer` HOT 1
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 raaz.