};
AES_KEY wctx, xctx;
- int ret;
+ int ret, nfailures = 0;
ret = AES_wrap_unwrap_test(kek, 128, NULL, e1, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 192, NULL, e2, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e3, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 192, NULL, e4, key, 24);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e5, key, 24);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e6, key, 32);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
+
+ return nfailures;
}
#endif
};
AES_KEY wctx, xctx;
- int ret;
+ int ret, nfailures = 0;
ret = AES_wrap_unwrap_test(kek, 128, NULL, e1, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 192, NULL, e2, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e3, key, 16);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 192, NULL, e4, key, 24);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e5, key, 24);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
ret = AES_wrap_unwrap_test(kek, 256, NULL, e6, key, 32);
+ if (ret == 0)
+ nfailures++;
fprintf(stderr, "Key test result %d\n", ret);
+
+ return nfailures;
}
#endif
-# $OpenBSD: Makefile,v 1.3 2014/04/17 18:33:21 miod Exp $
+# $OpenBSD: Makefile,v 1.4 2014/04/22 21:27:13 miod Exp $
SUBDIR= \
+ aeswrap \
bf \
bn \
cast \
--- /dev/null
+# $OpenBSD: Makefile,v 1.1 2014/04/22 21:27:15 miod Exp $
+
+PROG= aes_wrap
+CRYPTO= ${.CURDIR}/../../../../lib/libssl/src/crypto
+CFLAGS+= -DAES_WRAP_TEST
+CFLAGS+= -I${CRYPTO} -I${CRYPTO}/aes
+.PATH: ${CRYPTO}/aes
+
+LDADD= -lcrypto
+DPADD= ${LIBCRYPTO}
+
+.include <bsd.regress.mk>