summaryrefslogtreecommitdiff
path: root/cipher-aesctr.c
diff options
context:
space:
mode:
Diffstat (limited to 'cipher-aesctr.c')
-rw-r--r--cipher-aesctr.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/cipher-aesctr.c b/cipher-aesctr.c
index a4cf61e41..eed95c3e6 100644
--- a/cipher-aesctr.c
+++ b/cipher-aesctr.c
@@ -1,6 +1,6 @@
1/* $OpenBSD: cipher-aesctr.c,v 1.1 2014/04/29 15:39:33 markus Exp $ */ 1/* $OpenBSD: cipher-aesctr.c,v 1.2 2015/01/14 10:24:42 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2003 Markus Friedl <markus@openbsd.org> 3 * Copyright (c) 2003 Markus Friedl. All rights reserved.
4 * 4 *
5 * Permission to use, copy, modify, and distribute this software for any 5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above 6 * purpose with or without fee is hereby granted, provided that the above
@@ -15,9 +15,13 @@
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17 17
18#include "includes.h"
19
18#include <sys/types.h> 20#include <sys/types.h>
19#include <string.h> 21#include <string.h>
20 22
23#ifndef WITH_OPENSSL
24
21#include "cipher-aesctr.h" 25#include "cipher-aesctr.h"
22 26
23/* 27/*
@@ -25,7 +29,7 @@
25 * the counter is of size 'len' bytes and stored in network-byte-order. 29 * the counter is of size 'len' bytes and stored in network-byte-order.
26 * (LSB at ctr[len-1], MSB at ctr[0]) 30 * (LSB at ctr[len-1], MSB at ctr[0])
27 */ 31 */
28static __inline__ void 32static inline void
29aesctr_inc(u8 *ctr, u32 len) 33aesctr_inc(u8 *ctr, u32 len)
30{ 34{
31 ssize_t i; 35 ssize_t i;
@@ -76,3 +80,4 @@ aesctr_encrypt_bytes(aesctr_ctx *x,const u8 *m,u8 *c,u32 bytes)
76 n = (n + 1) % AES_BLOCK_SIZE; 80 n = (n + 1) % AES_BLOCK_SIZE;
77 } 81 }
78} 82}
83#endif /* !WITH_OPENSSL */