Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I implemented an Ansi 9.19 mac generator in java, but now I don't know how to validate its functionality. I couldn't find any sample of a {plain text,key,mac} on the internet, and I want to know if there is a good way to test my implementation.

share|improve this question
up vote 2 down vote accepted

Bouncy Castle has an ISO 9797/ANSI 9.19 Mac implementation with a test vector.

Botan also has an implementation and test vectors, which cross-verify with Bouncy Castle (at least the 128 bit key ones anyway).

From the looks, official test vectors appear to be scarce (unless you want to pay for a copy of the standard and chance one being in there), and it's less than clear that the BC/Botan vectors are official, so cross testing with existing implementations might be the best you can manage.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.