Code Monkey home page Code Monkey logo

cctv's Introduction

The Community Cryptography Test Vectors

CCTV is an experiment, part of the Community Cryptography Specification Project, in test vector collection and reuse.

All cryptography-related test vectors are welcome, and projects are encouraged to reuse them and contribute back any new vectors they generate.

cctv's People

Contributors

bdd avatar botovq avatar filosottile avatar pornin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cctv's Issues

Rust parsing

Hi, I just turned some wycheproofs into static dalek test cases via codegen

If I send a PR to parse these CCTV JSON to codegen into static Rust w/ similar API to wycheproofs

Would there be interest here to maintain it in this repo together alongside the Go impl ?

It would also make sure the files reflect testing the codegen on downstream tests.

I'm aiming to abstract similar high level API for between CCTV and wycheproofs where possible so it's easier to plug into all.

Reproducing ML-KEM-768 Modulus tests

I am having trouble reproducing your "modulus" KATs for ML-KEM-768.

Each line of your input file contains 1184 bytes, which is 384*K+32, as specified in the "Type Check" condition (line 982) of the spec.

BUT... the ByteDecode12 function only works for exact multiples of 384 bytes.

In our official comments to NIST, we wrote:

"Line 984. Similarly, the application of ByteDecode12(EK_Tilde) cannot be correct, since EK_Tilde is 1184 bytes when K = 3, which is not an integer multiple of 384. Perhaps ByteDecode12(EK_Tilde[0:384k]) is intended (as in line 2 of Algorithm 13) so that the final 32 bytes are eliminated?"

Do you draw the same interpretation?

Should I eliminate the final 32 bytes before performing the Modulus Check?
Thanks,
Rod, AWS

Correctness of the x25519 test vector data

Hey. I have been playing with AGE and using your comprehensive test vectors to try my code.

I tried this one

expect: success
payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab
file key: 59454c4c4f57205355424d4152494e45
identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6
age-encryption.org/v1
-> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc
EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U
--- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0
îÏbÇΑ´3'NhÔòù�L·L[þ÷¾ªRÈð¼�™,�ƒ1ûf

I had difficulties decrypting it using pyage library, HMAC verification and file key were reproduced but there was just payload problem. Details here jojonas/pyage#13 (comment)

I downloaded the file and investigated it using a hex editor. Copying the encrypted payload otherwise leads to tag issues, probably because github and other file browsers attempt to decode the binary payload.

I find the hex encoded payload to be decryptable it has to be

eecf62c7ce91b433274e68d4f2f9134cb74c5bfef7beaa52c8f0bc0e992c1e8331fb66

so the 16 byte nonce is eecf62c7ce91b433274e68d4f2f9134c and ciphertext is b74c5bfef7beaa52c8f0bc0e992c1e8331fb66. This is not at all equal to

payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab

if I attempt to decrypt 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab I find the tag is invalid. However if I decrypt eecf62c7ce91b433274e68d4f2f9134cb74c5bfef7beaa52c8f0bc0e992c1e8331fb66 I get valid tag and decrypted payload is age string (three bytes 616765 hex encoded).

I assume this is correct because of

func main() {
f := testkit.NewTestFile()
f.VersionLine("v1")
f.X25519(testkit.TestX25519Recipient)
f.HMAC()
f.Payload("age")
f.Generate()
}

could you double check this test vector and see if the payload 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab shouldn't be replaced by eecf62c7ce91b433274e68d4f2f9134cb74c5bfef7beaa52c8f0bc0e992c1e8331fb66?

The code that decrypts the payload and gives age plaintext is available here jojonas/pyage#13 (comment)

Age armor tests and RFC7468, which textual encoding to use?

I'm trying to add armored support to dage and I'm struggling to understand which textual encoding of RFC7468 should be supported, because the test vectors seem to allow whitespace before and after which would imply lax encoding, but at the same time, whitespace in armored body is not allowed so it can't be the lax encoding...

AES GCM vectors for len(aad) mod 8 != 0

Interestingly enough this bug has appeared in implementations, including at longer AAD lengths (~10k bytes). This is a tracking issue to remember there would be some value in creating some test vectors for this 😄

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.