Home
last modified time | relevance | path

Searched refs:rc4 (Results 1 – 2 of 2) sorted by relevance

/optee_os/core/lib/libtomcrypt/src/prngs/
H A Drc4.c36 prng->u.rc4.s.x = 0; in rc4_start()
38 XMEMSET(&prng->u.rc4.s.buf, 0, sizeof(prng->u.rc4.s.buf)); in rc4_start()
63 … if ((err = rc4_stream_keystream(&prng->u.rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; in rc4_add_entropy()
66 if ((err = rc4_stream_setup(&prng->u.rc4.s, buf, sizeof(buf))) != CRYPT_OK) goto LBL_UNLOCK; in rc4_add_entropy()
68 for (i = 0; i < 12; i++) rc4_stream_keystream(&prng->u.rc4.s, buf, sizeof(buf)); in rc4_add_entropy()
73 while (inlen--) prng->u.rc4.s.buf[prng->u.rc4.s.x++ % sizeof(prng->u.rc4.s.buf)] ^= *in++; in rc4_add_entropy()
96 XMEMCPY(buf, prng->u.rc4.s.buf, sizeof(buf)); in rc4_ready()
98 len = MIN(prng->u.rc4.s.x, 256); /* TODO: we can perhaps always use all 256 bytes */ in rc4_ready()
99 if ((err = rc4_stream_setup(&prng->u.rc4.s, buf, len)) != CRYPT_OK) goto LBL_UNLOCK; in rc4_ready()
101 for (i = 0; i < 12; i++) rc4_stream_keystream(&prng->u.rc4.s, buf, sizeof(buf)); in rc4_ready()
[all …]
/optee_os/core/lib/libtomcrypt/src/headers/
H A Dtomcrypt_prng.h58 struct rc4_prng rc4; member