示例#1
0
static void
initialize(const u_char *seed, int server, int ossh_key_fix)
{
	u_char client_to_server_key[OBFUSCATE_KEY_LENGTH];
	u_char server_to_client_key[OBFUSCATE_KEY_LENGTH];
	
	generate_key_pair(seed, client_to_server_key, server_to_client_key, ossh_key_fix);

	if(server)
		set_keys(client_to_server_key, server_to_client_key);
	else
		set_keys(server_to_client_key, client_to_server_key);
}
示例#2
0
int main(int argc, char **argv)
{
	srand(get_tick_count());
	memset(&kb, 0, sizeof(kb));
	set_keys();
	player_init(&p1);
	smp_alloc((void*)&p1);
	graphics_init();
	physics_init();
	glutInit(&argc, argv);
	glutInitWindowPosition(200, 100);
	glutInitWindowSize(window_x, window_y);
	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
	glutCreateWindow(PROGRAM_NAME);
	glutDisplayFunc(graphics_loop);
	glutIdleFunc(graphics_loop);
	glutReshapeFunc(reshape);
	glutKeyboardFunc(kb_controller_dn_char);
	glutKeyboardUpFunc(kb_controller_up_char);
	glutSpecialFunc(kb_controller_dn);
	glutSpecialUpFunc(kb_controller_up);
	glutMouseFunc(mouse_handler);
	glutMotionFunc(mouse_motion_handler);
 	glutPassiveMotionFunc(mouse_motion_handler);
	threads.phys_main = thread_create(physics_loop, NULL);
	glutMainLoop();
	return EXIT_SUCCESS; 
}
示例#3
0
Person::Person(BIGNUM *_p, BIGNUM *_g, BIGNUM *_B) {
  p = BN_dup(_p);
  g = BN_dup(_g);
  B = BN_dup(_B);
  set_keys();
  calculate_hash();
}
示例#4
0
Person::Person(const char *p_str, const char *g_str) {
  p = NULL;
  g = NULL;
  B = NULL;
  hash = NULL;
  BN_hex2bn(&p, p_str);
  BN_hex2bn(&g, g_str);
  set_keys();
}
示例#5
0
void Person::set_g(const char *g_str) {
  if (g) BN_free(g);
  g = NULL;
  BN_hex2bn(&g, g_str);

  // Recalculate keys
  if (a) BN_free(a);
  if (A) BN_free(A);
  set_keys();
}
示例#6
0
文件: ship2.cpp 项目: jigsaw121/voap
void Ship::specs() {
    speed=0.3;
    slow=1.02;
    grav=0.1;
    turn=3.14159/45.0;
    modi = new Flamer(this);
    modi->initall(gm,x,y,team);
    //cargo.push_back(new TurretMod(this));
    //cargo.back()->initall(gm,x,y);
    cargo.push_back(new TrailMod(this));
    cargo.back()->initall(gm,x,y,team);
    set_keys();
}
示例#7
0
void HaliteDialog::DialogListView::uiUpdate(const hal::torrent_details_manager& tD) 
{	
	if (hal::try_update_lock<list_class_t> lock{ this })
	{		
		selection_from_listview();
		
		peer_details_.clear();
		
		BOOST_FOREACH (const hal::uuid& id, tD.selected_uuids())
		{
			if (const hal::torrent_details_ptr t = tD.get(id))
				std::copy(t->get_peer_details().begin(), t->get_peer_details().end(), 
					std::inserter(peer_details_, peer_details_.begin()));
		}
		
		std::set<std::wstring> ip_set;
		BOOST_FOREACH (const hal::peer_detail& pd,  peer_details_)
			ip_set.insert(pd.ip_address);
		
		erase_based_on_set(ip_set, true);

		if (IsSortOnce() || AutoSort())
		{
			if (GetSecondarySortColumn() != -1)
			{
				int index = GetColumnSortType(GetSecondarySortColumn());					
				if (index > WTL::LVCOLSORT_LAST)
					sort(index - (WTL::LVCOLSORT_LAST+1+hal::peer_detail::ip_address_e), IsSecondarySortDescending());
			}

			if (GetSortColumn() != -1)
			{		
				int index = GetColumnSortType(GetSortColumn());				
				if (index > WTL::LVCOLSORT_LAST)
					sort(index - (WTL::LVCOLSORT_LAST+1+hal::peer_detail::ip_address_e), IsSortDescending());
			}
		}
		
		set_keys(ip_set);		
		InvalidateRect(NULL,true);
	}
示例#8
0
void set_keys_to_match_preferences(void)
{
	set_keys(input_preferences->keycodes);
}
示例#9
0
 void change_password( const std::string& old_password, const std::string& new_password )
 {
    set_keys( get_keys( old_password ), new_password );
    set_base_key( get_base_key( old_password ), new_password );
 }