Revert "Fix lwip implementation of retransmission timers."
[bertos.git] / bertos / sec / cipher.h
index 24c24b0da656f1ae6d32f5f666db5155a7811eff..22eb313bdd27e3f08db35394962d786e1971f63d 100644 (file)
@@ -188,4 +188,32 @@ void cipher_ctr_decrypt(BlockCipher *c, void *block);
  */
 void cipher_ctr_step(BlockCipher *c, void *block);
 
+
+/*********************************************************************************/
+/* OFB mode                                                                      */
+/*********************************************************************************/
+
+/**
+ * Initialize OFB by setting the IV.
+ *
+ * \note the memory pointed by \a iv will be used and modified by the OFB
+ * functions. It is caller's responsibility to keep it available until there is
+ * no more OFB work to do.
+ */
+INLINE void cipher_ofb_begin(BlockCipher *c, void *iv)
+{
+       c->buf = iv;
+}
+
+/**
+ * Encrypt a block (in-place) using the current key in OFB mode.
+ */
+void cipher_ofb_encrypt(BlockCipher *c, void *block);
+
+/**
+ * Decrypt a block (in-place) using the current key in OFB mode.
+ */
+void cipher_ofb_decrypt(BlockCipher *c, void *block);
+
+
 #endif /* SEC_CIPHER_H */