def pre(self): self.k = self.declare(LLVMArrayType(uint8_t, 32)) self.n = self.declare(LLVMArrayType(uint8_t, 16)) self.k_p = self.declare_pointer(LLVMArrayType(uint8_t, 32)) self.n_p = self.declare_pointer(LLVMArrayType(uint8_t, 16)) self.ks_p = self.declare_pointer(LLVMArrayType(uint8_t, 64)) self.points_to(self.k_p, self.k) self.points_to(self.n_p, self.n)
def specification(self): (k, k_p) = ptr_to_fresh(self, LLVMArrayType(i8, 32)) (v, v_p) = ptr_to_fresh(self, LLVMArrayType(i8, 8)) (m, m_p) = ptr_to_fresh(self, LLVMArrayType(i8, self.size)) self.execute_func(k_p, v_p, cryptol('0 : [32]'), m_p, cryptol(f'{self.size!r} : [32]')) self.returns(cryptol('0 : [32]')) self.points_to(m_p, cryptol("Salsa20_encrypt")((k, v, m)))
def specification(self): k = self.fresh_var(LLVMArrayType(i8, 32)) n = self.fresh_var(LLVMArrayType(i8, 16)) k_p = self.alloc(LLVMArrayType(i8, 32)) n_p = self.alloc(LLVMArrayType(i8, 16)) ks_p = self.alloc(LLVMArrayType(i8, 64)) self.points_to(k_p, k) self.points_to(n_p, n) self.execute_func(k_p, n_p, ks_p) self.returns(void) self.points_to(ks_p, cryptol("Salsa20_expansion`{a=2}")((k, n)))
def __init__(self): super().__init__(LLVMArrayType(uint32_t, 16))
def pre(self): (self.k, self.k_p) = self.val_and_pointer(LLVMArrayType(uint8_t, 32)) (self.v, self.v_p) = self.val_and_pointer(LLVMArrayType(uint8_t, 8)) (self.m, self.m_p) = self.val_and_pointer(LLVMArrayType(uint8_t, self.size))
def __init__(self): super().__init__(LLVMArrayType(uint8_t, 64))
def specification(self) -> None: oneptr_update_func(self, LLVMArrayType(i8, 64), "Salsa20")
def specification(self) -> None: oneptr_update_func(self, LLVMArrayType(i32, 16), "doubleround")