diff options
Diffstat (limited to 'nacl/crypto_stream/aes128ctr/portable/stream.c')
-rw-r--r-- | nacl/crypto_stream/aes128ctr/portable/stream.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/nacl/crypto_stream/aes128ctr/portable/stream.c b/nacl/crypto_stream/aes128ctr/portable/stream.c new file mode 100644 index 00000000..963fa8c1 --- /dev/null +++ b/nacl/crypto_stream/aes128ctr/portable/stream.c | |||
@@ -0,0 +1,28 @@ | |||
1 | #include "crypto_stream.h" | ||
2 | |||
3 | int crypto_stream( | ||
4 | unsigned char *out, | ||
5 | unsigned long long outlen, | ||
6 | const unsigned char *n, | ||
7 | const unsigned char *k | ||
8 | ) | ||
9 | { | ||
10 | unsigned char d[crypto_stream_BEFORENMBYTES]; | ||
11 | crypto_stream_beforenm(d, k); | ||
12 | crypto_stream_afternm(out, outlen, n, d); | ||
13 | return 0; | ||
14 | } | ||
15 | |||
16 | int crypto_stream_xor( | ||
17 | unsigned char *out, | ||
18 | const unsigned char *in, | ||
19 | unsigned long long inlen, | ||
20 | const unsigned char *n, | ||
21 | const unsigned char *k | ||
22 | ) | ||
23 | { | ||
24 | unsigned char d[crypto_stream_BEFORENMBYTES]; | ||
25 | crypto_stream_beforenm(d, k); | ||
26 | crypto_stream_xor_afternm(out, in, inlen, n, d); | ||
27 | return 0; | ||
28 | } | ||