亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? des.c

?? 基于cc1010的設計實例
?? C
字號:
/*****************************************************************************
 *                                                                           *
 *        **********                                                         *
 *       ************                                                        *
 *      ***        ***                                                       *
 *      ***   +++   ***                                                      *
 *      ***   + +   ***                                                      *
 *      ***   +                CHIPCON CC1010 Wireless audio project         *
 *      ***   + +   ***                                                      *
 *      ***   +++   ***          DES - extended version of HAL - DES         *
 *      ***       ***                                                        *
 *       ***********                                                         *
 *        *********                                                          *
 *                                                                           *
 *****************************************************************************
 * This source file is part of a software project for Full Duplex,           *
 * single-chip, wireless intercom, written for the CC1010 chip               *
 * (RF-transceiver chip with integrated 8051 micro-controller).              *
 *****************************************************************************
 * Author:              ROH, (OAE)                                           *
 *****************************************************************************
 * Revision history:                                                         *
 *                                                                           *
 * $Log: DES.c,v $
 * Revision 1.1  2003/08/04 12:35:06  tos
 * Initial version in CVS.
 *
 *                                                                           *
 *                                                                           *
 ****************************************************************************/


#include <chipcon/hal.h>

//----------------------------------------------------------------------------
//  byte* DES(...)
//
//  Description:
//      This function performs DES encryption/decryption on a block of data.
//      The encryption/decryption operations are performed in place (i.e.
//      the plaintext is overwritten by the ciphertext or vice versa) on
//      suitably aligned data [ address(_buffer_) mod 8 = 0 ]. _key_ should 
//      point to the key used for single-DES operations or keys in the case 
//      of triple-DES.
//      Two modes of the DES standard are supported: 8-bit Cipher Feedback
//      (CFB) and Output Feedback (OFB.) CFB is self-synchronizing (the end of
//      a ciphertext can be decrypted even though the beginning is unavailable)
//      and can be used to calculate error check codes. OFB is not self-
//      synchronizing and is not suitable for error check code calculation,
//      but does have the favourable property that a single bit error in the
//      received ciphertext produces only a single bit error in the decrypted
//      plaintext.
//      In CFB/OFB mode an initialization vector of 8 bytes is part of the
//      algorithm. This vector must be identical for the encryption and 
//      decryption process. The choice of initialization data does not affect
//      the security of the encryption in any way, and this function thus uses
//      the value 0.
//      _option_ is used to chose between these modes of operation, between
//      single-DES and triple-DES, and between decryption and decryption.
//      This function does not return until all data has been encrypted/
//      decrypted, since the DES hardware is so fast. The DES hardware can
//      run at the same time as the 8051 and generate an intterrupt when
//      finished. If this is desired the hardware must be programmed directly.
//
//  Arguments:
//      byte options
//          One or more of the below defined constants define the desired
//          operational mode:
//          DES_SINGLE_DES
//          DES_TRIPLE_DES
//          DES_ENCRYPT
//          DES_DECRYPT
//          DES_OFB_MODE
//          DES_CFB_MODE

//      byte xdata* key
//          A pointer to a key (or three keys for triple-DES) stored in
//          XDATA memory space. This address must be divisible by eight, i.e.
//          address(_key_) mod 8 = 0. The 56 active bits of a DES-key are
//          expected to be in a compressed 7-byte format, in which all parity
//          bits are removed. In the case of a single key, the 56 bits of the key
//          must lie on _key_[0] - _key_[6], in big-endian order. In the case of
//          three keys (triple-des), the three keys must lie on _key_[0] -
//          _key_[6], _key_[8] - _key_[14] and _key_[16] - _key_[22], all in big-
//          endian order. The macro DES_NORMAL_2_COMPACT_KEY(...) can be used
//          to convert a regular DES key to the compact form. A key can be
//          generated by simply using 7 random bytes.
//
//      byte xdata* buffer
//          Pointer to the data to encrypt/decrypt in XDATA memory space.
//          Encryption/decryption is performed in-place, i.e. the original
//          plaintext/ciphertext is overwritten. The address of _buffer_ must
//          be divisible by eight, i.e. address(_buffer_) mod 8 = 0.
//      word length
//          The number of bytes to perform the encryption/decryption on.
//      bit wait
//          If this bit is set, the function will wait until encryption/decryption
//          is completed, otherwise the function will return a
//
//  Return value:
//      byte*
//          A pointer to the start of _buffer_ is returned.
//----------------------------------------------------------------------------
byte* DES(byte options, byte xdata* buffer, byte xdata* key, word length, bit wait) {

    CRPCON=0x10|(options&0x0E);         // Init control register
    CRPKEY=((word)key)>>3;              // Put address of key(s) into register
    CRPDAT=((word)buffer)>>3;           // Put address of data into register
    CRPINI7=CRPINI6=CRPINI5=CRPINI4=0;  // Clear initialization vector
    CRPINI3=CRPINI2=CRPINI1=CRPINI0=0;

    while (length) {
        // Encryption/decryption performed in blocks of maximum 256 bytes.
        if (length&0xFF00){    // >=256
            CRPCNT=0;
            length-=256;
        } else {
            CRPCNT=length;
            length=0;
        }
        CRPCON|=0x01;           // Start encryption/decryption

        // Wait until finished if wait bit is set
        if (wait)
            while (CRPCON&0x01);
    }

    return buffer;
}
//----------------------------------------------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲婷婷在线视频| 日本伊人色综合网| 91免费国产视频网站| 亚洲欧美一区二区在线观看| 成人精品一区二区三区中文字幕| 亚洲欧洲一区二区在线播放| 99久久精品免费精品国产| 亚洲视频一区在线| 在线视频观看一区| 婷婷激情综合网| 欧美一区二区在线看| 久久91精品久久久久久秒播| 久久久午夜精品| 成人三级伦理片| 亚洲欧美国产三级| 欧美日韩电影一区| 裸体一区二区三区| 国产视频在线观看一区二区三区 | 天天综合网天天综合色| 日韩一区二区中文字幕| 国产乱码精品一区二区三区忘忧草 | 欧美视频在线一区| 青青草国产精品亚洲专区无| 久久久一区二区| 91视频免费观看| 五月天亚洲精品| 欧美精品一区二区久久久| 国产不卡在线播放| 一区二区三国产精华液| 91精品国产一区二区三区蜜臀| 黑人巨大精品欧美一区| 中文字幕中文乱码欧美一区二区| 91成人国产精品| 麻豆91免费看| 最好看的中文字幕久久| 欧美一区日韩一区| 成人精品小蝌蚪| 丝袜亚洲另类欧美综合| 久久精品亚洲麻豆av一区二区| 色综合久久久久| 免费成人美女在线观看.| 国产精品入口麻豆九色| 欧美日韩aaaaa| 国产v日产∨综合v精品视频| 亚洲影视在线观看| 精品国产乱码久久| 色噜噜狠狠成人网p站| 美女精品一区二区| 亚洲视频免费在线观看| 日韩欧美资源站| 色欧美日韩亚洲| 国产精品18久久久久久久网站| 一片黄亚洲嫩模| 久久久久久亚洲综合影院红桃| 色婷婷综合激情| 国产精品18久久久久久久久| 亚洲va欧美va人人爽| 亚洲国产精品v| 3d动漫精品啪啪| www.视频一区| 精品写真视频在线观看| 亚洲综合图片区| 中文字幕精品—区二区四季| 日韩视频123| 91传媒视频在线播放| 国产激情精品久久久第一区二区| 日日夜夜精品视频天天综合网| 中文字幕一区三区| 久久亚洲免费视频| 欧美精品丝袜中出| 91玉足脚交白嫩脚丫在线播放| 精品一区二区在线视频| 亚洲国产成人av| 亚洲欧洲三级电影| 久久久蜜桃精品| 91精品国产手机| 色琪琪一区二区三区亚洲区| 成人美女在线观看| 极品销魂美女一区二区三区| 亚洲成人7777| 亚洲另类中文字| 国产精品久久久久久久久晋中 | 亚洲成人777| 亚洲免费大片在线观看| 国产精品婷婷午夜在线观看| 精品欧美一区二区久久| 欧美精品三级日韩久久| 色综合中文综合网| 老司机精品视频一区二区三区| 亚洲国产精品影院| 亚洲美女视频一区| 亚洲欧洲国产专区| 欧美国产精品劲爆| 久久九九久久九九| 精品久久久久久久久久久久久久久| 欧美日韩电影一区| 欧美在线短视频| 91在线观看污| 白白色亚洲国产精品| 成人午夜伦理影院| 国产91丝袜在线18| 国产成人一级电影| 国产精品伊人色| 国产乱人伦偷精品视频免下载| 精品在线观看视频| 国内一区二区在线| 国产一区999| 国产在线播放一区三区四| 久久精品国产精品亚洲精品| 日韩av电影免费观看高清完整版| 亚洲成人一区二区在线观看| 亚洲综合免费观看高清完整版| 一区二区三区在线观看视频| 亚洲女人****多毛耸耸8| 亚洲人妖av一区二区| 国产精品电影一区二区三区| 国产精品久久久久久久久免费樱桃 | 欧美一级免费大片| 日韩一卡二卡三卡四卡| 日韩你懂的电影在线观看| 日韩欧美123| 久久久久久久综合| 欧美经典一区二区三区| 亚洲国产精品二十页| 亚洲视频一区二区免费在线观看| 亚洲美女视频在线| 五月天激情综合网| 美女一区二区视频| 国产一区二区三区日韩| 国产99精品国产| 99久久精品国产一区| 色乱码一区二区三区88| 欧美日韩精品一区二区| 日韩欧美一卡二卡| 久久久欧美精品sm网站| 中文字幕在线观看不卡视频| 亚洲精品久久嫩草网站秘色| 亚洲一区二区免费视频| 日韩黄色小视频| 国产美女一区二区三区| www.av精品| 欧美亚洲免费在线一区| 日韩一区二区电影在线| 国产偷v国产偷v亚洲高清| 亚洲色欲色欲www| 婷婷国产在线综合| 国产在线观看免费一区| av亚洲精华国产精华精华| 欧美影院一区二区三区| 日韩欧美一区在线观看| 国产欧美日韩三区| 亚洲男同性恋视频| 免费一级欧美片在线观看| 国产suv精品一区二区三区| 色哟哟一区二区| 91精品黄色片免费大全| 久久久五月婷婷| 亚洲精品国产无套在线观| 日韩av电影免费观看高清完整版 | 久久精品国产一区二区三区免费看 | 男女男精品视频网| 国产成人av资源| 欧美综合久久久| 精品久久久网站| 亚洲欧美日韩成人高清在线一区| 爽爽淫人综合网网站| 国产精品91一区二区| 日本大香伊一区二区三区| 日韩一二三四区| 国产精品女主播av| 偷偷要91色婷婷| 国产91精品入口| 欧美日本一区二区在线观看| 久久久久国产精品人| 一区二区三区.www| 国产一区二区三区精品欧美日韩一区二区三区 | 亚洲男人电影天堂| 精彩视频一区二区三区| 在线一区二区三区四区五区| 欧美tk丨vk视频| 自拍av一区二区三区| 另类小说欧美激情| 91国产免费看| 26uuu久久天堂性欧美| 亚洲精品成人悠悠色影视| 久久国产剧场电影| 色偷偷成人一区二区三区91| 亚洲精品一区二区三区四区高清 | 丝袜脚交一区二区| 91丝袜美腿高跟国产极品老师| 欧美电视剧在线看免费| 有码一区二区三区| 国产激情91久久精品导航| 欧美精品久久99久久在免费线 | 中文字幕不卡在线观看| 蜜桃视频第一区免费观看| 色婷婷综合久久久| 中文字幕电影一区| 麻豆精品一二三| 欧美偷拍一区二区|