mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
crypto: testmgr - Add infrastructure for ansi_cprng self-tests
Add some necessary infrastructure to make it possible to run self-tests for ansi_cprng. The bits are likely very specific to the ANSI X9.31 CPRNG in AES mode, and thus perhaps should be named more specifically if/when we grow additional CPRNG support... Successfully tested against the cryptodev-2.6 tree and a Red Hat Enterprise Linux 5.x kernel with the follow-on patch that adds the actual test vectors. Signed-off-by: Jarod Wilson <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
5d667322a2
commit
7647d6ce20
2 changed files with 101 additions and 0 deletions
|
|
@ -70,6 +70,18 @@ struct aead_testvec {
|
|||
unsigned short rlen;
|
||||
};
|
||||
|
||||
struct cprng_testvec {
|
||||
char *key;
|
||||
char *dt;
|
||||
char *v;
|
||||
char *result;
|
||||
unsigned char klen;
|
||||
unsigned short dtlen;
|
||||
unsigned short vlen;
|
||||
unsigned short rlen;
|
||||
unsigned short loops;
|
||||
};
|
||||
|
||||
static char zeroed_string[48];
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue