org.bouncycastle.crypto.test (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

# Package org.bouncycastle.crypto.test

Example code and test classes for the lightweight API.

See: Description

- Class Summary
  Class | Description
  --- | ---
  AEADTestUtil |
  AESFastTest | Test vectors from the NIST standard tests and Brian Gladman's vector set https://fp.gladman.plus.com/cryptography_technology/rijndael/
  AESLightTest | Test vectors from the NIST standard tests and Brian Gladman's vector set https://fp.gladman.plus.com/cryptography_technology/rijndael/
  AESTest | Test vectors from the NIST standard tests and Brian Gladman's vector set https://fp.gladman.plus.com/cryptography_technology/rijndael/
  AESVectorFileTest | Test vectors from the NIST standard tests and Brian Gladman's vector set https://fp.gladman.plus.com/cryptography_technology/rijndael/
  AESWrapPadTest | This is a test harness I use because I cannot modify the BC test harness without invalidating the signature on their signed provider library.
  AESWrapTest | Wrap Test
  AllTests |
  Argon2Test | Tests from https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03
  ARIATest |
  AsconTest |
  AsconTest.Counter |
  AsymmetricConstraintsTest |
  BCryptTest |
  BigIntegersTest |
  BigSkippingCipherTest |
  BIP340SignerTest | Regression test for BIP-340 Schnorr signatures over secp256k1.
  Blake2bDigestTest |
  Blake2bpDigestTest |
  Blake2sDigestTest |
  Blake2spDigestTest |
  Blake2xsDigestTest |
  Blake3Test | Test Cases for Blake3.
  BlockCipherMonteCarloTest | a basic test that takes a cipher, key parameter, and an input and output string.
  BlockCipherResetTest | Test whether block ciphers implement reset contract on init, encrypt/decrypt and reset.
  BlockCipherVectorTest | a basic test that takes a cipher, key parameter, and an input and output string.
  BlowfishTest | blowfish tester - vectors from https://www.counterpane.com/vectors.txt
  CamelliaLightTest | Camellia tester - vectors from https://www.cosic.esat.kuleuven.be/nessie/testvectors/ and RFC 3713
  CamelliaTest | Camellia tester - vectors from https://www.cosic.esat.kuleuven.be/nessie/testvectors/ and RFC 3713
  CAST5Test | cast tester - vectors from https://www.ietf.org/rfc/rfc2144.txt
  CAST6Test | cast6 tester - vectors from https://www.ietf.org/rfc/rfc2612.txt
  CCMTest | First four test vectors from NIST Special Publication 800-38C.
  ChaCha20Poly1305Test |
  ChaChaTest | ChaCha Test Test cases generated using ref version of ChaCha20 in estreambench-20080905.
  CipherStreamTest |
  CipherTest |
  CMacTest | CMAC tester - Official Test Vectors.
  ConcatenationKDFTest | Test vectors were copied from https://github.com/patrickfav/singlestep-kdf/wiki/NIST-SP-800-56C-Rev1:-Non-Official-Test-Vectors
  CramerShoupTest |
  CryptoServiceConstraintsTest |
  CSHAKETest | CSHAKE test vectors from: https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/cSHAKE_samples.pdf
  CTSTest | CTS tester
  DESedeTest | DESede tester
  DESTest | DES tester - vectors from FIPS 81
  DeterministicDSATest | Tests are taken from RFC 6979 - "Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)"
  DHKEKGeneratorTest | DHKEK Generator tests - from RFC 2631.
  DHTest |
  DigestConstraintsTest |
  DigestRandomNumberTest |
  DigestTest |
  DSATest | Test based on FIPS 186-2, Appendix 5, an example of DSA, and FIPS 168-3 test vectors.
  DSTU4145Test |
  DSTU7564Test |
  DSTU7624Test |
  EAXTest |
  ECCSISignerTest |
  ECDHKEKGeneratorTest | ECDHKEK Generator tests.
  ECGOST3410Test | ECGOST3410 tests are taken from GOST R 34.10-2001.
  ECIESKeyEncapsulationTest | Tests for the ECIES Key Encapsulation Mechanism
  ECIESTest | test for ECIES - Elliptic Curve Integrated Encryption Scheme
  ECNRTest | ECNR tests.
  ECTest | ECDSA tests are taken from X9.62.
  Ed25519Test |
  Ed448Test |
  ElephantTest |
  ElGamalTest |
  EqualsHashCodeTest |
  EthereumIESTest | test for Ethereum flavor of ECIES - Elliptic Curve Integrated Encryption Scheme Note the IV is always required when passing parameters, as the IV is added to the MAC.
  GCMReorderTest |
  GCMSIVTest | AES-GCM_SIV test cases.
  GCMTest | Test vectors from "The Galois/Counter Mode of Operation (GCM)", McGrew/Viega, Appendix B
  GiftCofbTest |
  GMacTest | Test vectors for AES-GMAC, extracted from NIST CAVP GCM test vectors.
  GOST28147MacTest | GOST 28147 MAC tester
  GOST28147Test |
  GOST3410Test |
  GOST3411_2012_256DigestTest |
  GOST3411_2012_512DigestTest |
  GOST3411DigestTest |
  GOST3412MacTest | see GOST_R_3413-2015
  GOST3412Test |
  Grain128AEADTest |
  Grain128Test | Grain-128 Test
  Grainv1Test | Grain v1 Test
  GSKKDFTest |
  Haraka256DigestTest |
  Haraka512DigestTest |
  HashCommitmentTest |
  HCFamilyTest | HC-128 and HC-256 Tests.
  HCFamilyVecTest | HC-128 and HC-256 Tests.
  HKDFGeneratorTest | HKDF tests - vectors from RFC 5869, + 2 more, 101 and 102
  HPKETestVectors |
  IDEATest |
  ISAACTest | ISAAC Test - see https://www.burtleburtle.net/bob/rand/isaacafa.html
  ISAPTest |
  ISO9796Test | test vectors from ISO 9796-1 and ISO 9796-2 edition 1.
  ISO9797Alg3MacTest |
  IsoTrailerTest |
  JournalingSecureRandomTest |
  KangarooTest | Test Cases for Kangaroo12.
  KDF1GeneratorTest | KDF1 tests - vectors from ISO 18033.
  KDF2GeneratorTest | KDF2 tests - vectors from ISO 18033.
  KDFCounterGeneratorTest |
  KDFDoublePipelineIteratorGeneratorTest |
  KDFFeedbackGeneratorTest |
  KeccakDigestTest | Keccak Digest Test
  KMACTest | KMAC test vectors from: https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/KMAC_samples.pdf
  LEATest | Test Cases for LEA Cipher.
  MacTest | MAC tester - vectors from FIP 81 and FIP 113.
  MD2DigestTest | standard vector test for MD2 from RFC1319 by B.Kaliski of RSA Laboratories April 1992
  MD4DigestTest | standard vector test for MD4 from RFC 1320.
  MD5DigestTest | standard vector test for MD5 from "Handbook of Applied Cryptography", page 345.
  MD5HMacTest | MD5 HMac Test, test vectors from RFC 2202
  MGF1GeneratorTest | MGF1 tests - vectors from ISO 18033 for KDF1 (equivalent).
  ModeTest | CFB/OFB Mode test of IV padding.
  NaccacheSternTest | Test case for NaccacheStern cipher.
  NISTCTSTest | CTS tester
  NISTECCTest |
  NoekeonTest | Noekeon tester
  NonMemoableDigestTest | SHA1 HMac Test, test vectors from RFC 2202
  NullTest |
  OAEPTest |
  OCBTest | Test vectors from RFC 7253 on The OCB Authenticated-Encryption Algorithm
  OpenBSDBCryptTest |
  OpenSSHKeyParsingTests |
  PaddingTest | General Padding tests.
  ParallelHashTest | ParallelHash test vectors from: https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/KMAC_samples.pdf
  PhotonBeetleTest |
  PKCS12Test | test for PKCS12 key generation - vectors from https://www.drh-consultancy.demon.co.uk/test.txt
  PKCS5Test | A test class for PKCS5 PBES2 with PBKDF2 (PKCS5 v2.0) using test vectors provider at RSA's PKCS5 Page The vectors are Base 64 encoded and encrypted using the password "password" (without quotes).
  Poly1305Test |
  PSSBlindTest |
  PSSTest |
  RadixConverterTest |
  RC2Test | RC2 tester - vectors from ftp://ftp.isi.edu/in-notes/rfc2268.txt RFC 2268 "A Description of the RC2(r) Encryption Algorithm"
  RC2WrapTest | RC2 wrap tester
  RC4Test | RC4 Test
  RC5Test | RC5 tester - vectors from ftp://ftp.nordu.net/rfc/rfc2040.txt RFC 2040 "The RC5, RC5-CBC, RC5-CBC-Pad, and RC5-CTS Algorithms"
  RC6Test | RC6 Test - test vectors from AES Submitted RSA Reference implementation.
  RegressionTest |
  ResetTest |
  RFC3211WrapTest | Wrap Test based on RFC3211 test vectors
  RijndaelTest | Test vectors from the NIST standard tests and Brian Gladman's vector set https://fp.gladman.plus.com/cryptography_technology/rijndael/
  RIPEMD128DigestTest | RIPEMD128 Digest Test
  RIPEMD128HMacTest | RIPEMD128 HMac Test, test vectors from RFC 2286
  RIPEMD160DigestTest | RIPEMD160 Digest Test
  RIPEMD160HMacTest | RIPEMD160 HMac Test, test vectors from RFC 2286
  RIPEMD256DigestTest | RIPEMD128 Digest Test
  RIPEMD320DigestTest | RIPEMD320 Digest Test
  RomulusTest |
  RSABlindedTest |
  RSABlindSignatureTest | Known-answer tests for `RSABlindSignatureClient` / `RSABlindSignatureServer` against the four named variants of RFC 9474 sec. 5, using the test vectors in RFC 9474 Appendix A.
  RSADigestSignerTest |
  RSAKeyEncapsulationTest | Tests for the RSA Key Encapsulation Mechanism
  RSATest |
  SAKKEKEMSTest |
  Salsa20Test | Salsa20 Test
  SCryptTest |
  SEEDTest | SEED tester - vectors https://www.ietf.org/rfc/rfc4009.txt
  SerpentTest | Test vectors based on the NESSIE submission
  SHA1DigestTest | standard vector test for SHA-1 from "Handbook of Applied Cryptography", page 345.
  SHA1HMacTest | SHA1 HMac Test, test vectors from RFC 2202
  SHA1InterleaveDigestTest | Test for the SHA_Interleave function from RFC 2945, section 3.1.
  SHA224DigestTest | standard vector test for SHA-224 from RFC 3874 - only the last three are in the RFC.
  SHA224HMacTest | SHA224 HMac Test
  SHA256DigestTest | standard vector test for SHA-256 from FIPS Draft 180-2.
  SHA256HMacTest | SHA256 HMac Test
  SHA384DigestTest | standard vector test for SHA-384 from FIPS Draft 180-2.
  SHA384HMacTest | SHA384 HMac Test
  SHA3DigestTest | SHA3 Digest Test
  SHA3HMacTest | SHA224 HMac Test
  SHA512DigestTest | standard vector test for SHA-512 from FIPS Draft 180-2.
  SHA512HMacTest | SHA512 HMac Test
  SHA512t224DigestTest | standard vector test for SHA-512/224 from FIPS 180-4.
  SHA512t256DigestTest | standard vector test for SHA-512/256 from FIPS 180-4.
  Shacal2Test | Shacal2 tester - vectors from https://www.cosic.esat.kuleuven.be/nessie/testvectors/
  SHAKEDigestTest | SHAKE Digest Test
  ShortenedDigestTest |
  SimpleTestTest |
  SipHash128Test |
  SipHashTest |
  SkeinDigestTest |
  SkeinMacTest |
  SkipjackTest |
  SM2EngineTest |
  SM2KeyExchangeTest |
  SM2SignerTest |
  SM3DigestTest | standard vector test for SM3 digest from chinese specification
  SM3HMacTest | SM3 HMac Test, using the standard RFC 2202 / RFC 4231 key/message inputs.
  SM4Test | SM4 tester, vectors from https://eprint.iacr.org/2008/329.pdf
  SP80038GTest |
  SP80038GTest.FPECharDecryptor |
  SP80038GTest.FPECharEncryptor |
  SparkleTest |
  SRP6Test |
  StreamCipherResetTest | Test whether block ciphers implement reset contract on init, encrypt/decrypt and reset.
  StreamCipherVectorTest | a basic test that takes a stream cipher, key parameter, and an input and output string.
  SymmetricConstraintsTest |
  TEATest | TEA tester - based on C implementation results from https://www.simonshepherd.supanet.com/tea.htm
  Threefish1024Test |
  Threefish256Test |
  Threefish512Test |
  TigerDigestTest | Tiger Digest Test
  TnepresTest | Test vectors based on Floppy 4 of the Serpent AES submission.
  TupleHashTest | TupleHash test vectors from: https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/KMAC_samples.pdf
  TwofishTest |
  VMPCKSA3Test | VMPC Test
  VMPCMacTest |
  VMPCTest | VMPC Test
  WhirlpoolDigestTest | ISO vector test for Whirlpool
  X25519Test |
  X448Test |
  X931SignerTest |
  XChaCha20Poly1305Test | XChaCha20-Poly1305 AEAD tests using the test vector from draft-irtf-cfrg-xchacha-03 Appendix A.3.
  XChaCha20Test | XChaCha20 stream cipher tests using the test vectors from draft-irtf-cfrg-xchacha-03.
  XoodyakTest |
  XSalsa20Test |
  XTEATest | TEA tester - based on C implementation results from https://www.simonshepherd.supanet.com/tea.htm
  ZucTest | Test Cases for Zuc128 and Zuc256.

## Package org.bouncycastle.crypto.test Description

Example code and test classes for the lightweight API.