Mercurial > projects > dcrypt
view dcrypt/crypto/Cipher.d @ 6:5cb17e09d685
Minor edits to the unittests of hash functions and ciphers. Added AES and test vectors.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sat, 16 Aug 2008 22:43:22 -0400 |
parents | 71aae178f89a |
children |
line wrap: on
line source
/** * This file is part of the dcrypt project. * * Copyright: Copyright (C) dcrypt contributors 2008. All rights reserved. * License: MIT * Authors: Thomas Dixon */ module dcrypt.crypto.Cipher; public import dcrypt.crypto.errors.InvalidKeyError; public import dcrypt.crypto.errors.ShortBufferError; public import dcrypt.crypto.errors.NotInitializedError; public import dcrypt.crypto.errors.InvalidParameterError; public import dcrypt.crypto.params.CipherParameters; /** Base cipher class */ interface Cipher { static const bool ENCRYPT = true, DECRYPT = false; /** * Initialize a cipher. * * Params: * encrypt = True if we are encrypting. * params = Parameters to be passed to the cipher. (Key, rounds, etc.) */ void init(bool encrypt, CipherParameters params); /** Returns: The name of the algorithm of this cipher. */ char[] name(); /** Reset cipher to its state immediately subsequent the last init. */ void reset(); }