void aes_init(ctx_aes* aes, int keySize, uint8_t* keyBytes) { SetNbNkNr(aes, keySize);//初始化 memcpy(aes->key,keyBytes,keySize); KeyExpansion(aes); /* expand the seed key into a key schedule and store in w */ }
void InitAes(int keySize, unsigned char* keyBytes) { SetNbNkNr(keySize);//��ʼ�� memcpy(key,keyBytes,keySize); KeyExpansion(); // expand the seed key into a key schedule and store in w } // Aes constructor
void Aes_setKey(int keysize,BYTE* keyBytes,BYTE *w,BYTE *key,BYTE* Nr,BYTE *Nk) { SetNbNkNr(keysize,Nr,Nk); AES_Memcpy(key,keyBytes,keysize); KeyExpansion(w,key,*Nr,*Nk); }