Skip to content
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

[WIP] steal all the tests from SHA.jl #1

Closed
wants to merge 1 commit into from
Closed

Conversation

oxinabox
Copy link
Member

The tricky part is getting Nettle.jl to establish all the correct answers

@jw3126
Copy link
Collaborator

jw3126 commented Jan 11, 2018

I had mainly

import Nettle

@testset "compare with Nettle" begin
    for offset  [0,10^3, 10^4, 10^5]
        iter = offset:(offset+1000)
        for l  iter
            s = randstring(l)
            @test Nettle.hexdigest("md5", s) == bytes2hex(md5(s))
        end
    end
end

for tests. Something like this makes sure, that all padding scenarios are covered.

@jw3126
Copy link
Collaborator

jw3126 commented Jan 11, 2018

Btw, can you activate travis?

@oxinabox
Copy link
Member Author

I have now added travis. Github was being having issues lastnight and wasn't picking it up (even on a sync).
Nothing will pass until @staticfloat tags a new release of SHA.jl

The SHA.jl tests want to check update! works correctly when called not in isolation.
So I think wrapping Nettle.update! is required.

@jw3126
Copy link
Collaborator

jw3126 commented Jan 12, 2018

Okay sure! My point was its good to cover each case of i = length(data) % 128 for all i in 0:127 in order to test that the padding is correct. I guess we can test all three steps initialization, update! and digest! against nettle.

@oxinabox
Copy link
Member Author

Closed in preference for #3

@oxinabox oxinabox closed this Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants